diff --git a/Gopkg.lock b/Gopkg.lock index d4bd4ea6af..6052691ae2 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -31,6 +31,12 @@ revision = "dcef7f55730566d41eae5db10e7d6981829720f6" version = "1.0.1" +[[projects]] + name = "github.com/fsnotify/fsnotify" + packages = ["."] + revision = "629574ca2a5df945712d3079857300b5e4da0236" + version = "v1.4.2" + [[projects]] name = "github.com/ghodss/yaml" packages = ["."] @@ -109,6 +115,12 @@ packages = [".","simplelru"] revision = "0a025b7e63adc15a622f29b0b2c4c3848243bbf6" +[[projects]] + branch = "master" + name = "github.com/hashicorp/hcl" + packages = [".","hcl/ast","hcl/parser","hcl/scanner","hcl/strconv","hcl/token","json/parser","json/scanner","json/token"] + revision = "23c074d0eceb2b8a5bfdbb271ab780cde70f05a8" + [[projects]] name = "github.com/json-iterator/go" packages = ["."] @@ -121,12 +133,30 @@ packages = ["."] revision = "59fac5042749a5afb9af70e813da1dd5474f0167" +[[projects]] + name = "github.com/magiconair/properties" + packages = ["."] + revision = "be5ece7dd465ab0765a9682137865547526d1dfb" + version = "v1.7.3" + [[projects]] branch = "master" name = "github.com/mailru/easyjson" packages = ["buffer","jlexer","jwriter"] revision = "4d347d79dea0067c945f374f990601decb08abb5" +[[projects]] + branch = "master" + name = "github.com/mitchellh/mapstructure" + packages = ["."] + revision = "06020f85339e21b2478f756a78e295255ffa4d6a" + +[[projects]] + name = "github.com/pelletier/go-toml" + packages = ["."] + revision = "16398bac157da96aa88f98a2df640c7f32af1da2" + version = "v1.0.1" + [[projects]] branch = "master" name = "github.com/petar/GoLLRB" @@ -157,12 +187,36 @@ revision = "f006c2ac4710855cf0f916dd6b77acf6b048dc6e" version = "v1.0.3" +[[projects]] + name = "github.com/spf13/afero" + packages = [".","mem"] + revision = "8d919cbe7e2627e417f3e45c3c0e489a5b7e2536" + version = "v1.0.0" + +[[projects]] + name = "github.com/spf13/cast" + packages = ["."] + revision = "acbeb36b902d72a7a4c18e8f3241075e7ab763e4" + version = "v1.1.0" + +[[projects]] + branch = "master" + name = "github.com/spf13/jwalterweatherman" + packages = ["."] + revision = "12bd96e66386c1960ab0f74ced1362f66f552f7b" + [[projects]] name = "github.com/spf13/pflag" packages = ["."] revision = "e57e3eeb33f795204c1ca35f56c44f83227c6e66" version = "v1.0.0" +[[projects]] + name = "github.com/spf13/viper" + packages = ["."] + revision = "25b30aa063fc18e48662b86996252eabdcf2f0c7" + version = "v1.0.0" + [[projects]] name = "github.com/stretchr/testify" packages = ["assert"] @@ -178,7 +232,7 @@ [[projects]] branch = "master" name = "golang.org/x/net" - packages = ["context","http2","http2/hpack","idna","lex/httplex"] + packages = ["context","http2","http2/hpack","idna","internal/timeseries","lex/httplex","trace"] revision = "c73622c77280266305273cb545f54516ced95b93" [[projects]] @@ -193,6 +247,18 @@ packages = ["collate","collate/build","internal/colltab","internal/gen","internal/tag","internal/triegen","internal/ucd","language","secure/bidirule","transform","unicode/bidi","unicode/cldr","unicode/norm","unicode/rangetable","width"] revision = "3cfc6c0d6bf80d724d98c26c4822f4a35d37598e" +[[projects]] + branch = "master" + name = "google.golang.org/genproto" + packages = ["googleapis/rpc/status"] + revision = "7f0da29060c682909f650ad8ed4e515bd74fa12a" + +[[projects]] + name = "google.golang.org/grpc" + packages = [".","balancer","balancer/roundrobin","codes","connectivity","credentials","encoding","grpclb/grpc_lb_v1/messages","grpclog","internal","keepalive","metadata","naming","peer","resolver","resolver/dns","resolver/passthrough","stats","status","tap","transport"] + revision = "5a9f7b402fe85096d2e1d0383435ee1876e863d0" + version = "v1.8.0" + [[projects]] name = "gopkg.in/inf.v0" packages = ["."] @@ -225,7 +291,7 @@ [[projects]] name = "k8s.io/client-go" - packages = ["discovery","discovery/fake","kubernetes/scheme","pkg/version","rest","rest/watch","testing","tools/cache","tools/clientcmd/api","tools/metrics","tools/pager","transport","util/cert","util/flowcontrol","util/integer"] + packages = ["discovery","discovery/fake","informers","informers/admissionregistration","informers/admissionregistration/v1alpha1","informers/apps","informers/apps/v1beta1","informers/apps/v1beta2","informers/autoscaling","informers/autoscaling/v1","informers/autoscaling/v2beta1","informers/batch","informers/batch/v1","informers/batch/v1beta1","informers/batch/v2alpha1","informers/certificates","informers/certificates/v1beta1","informers/core","informers/core/v1","informers/extensions","informers/extensions/v1beta1","informers/internalinterfaces","informers/networking","informers/networking/v1","informers/policy","informers/policy/v1beta1","informers/rbac","informers/rbac/v1","informers/rbac/v1alpha1","informers/rbac/v1beta1","informers/scheduling","informers/scheduling/v1alpha1","informers/settings","informers/settings/v1alpha1","informers/storage","informers/storage/v1","informers/storage/v1beta1","kubernetes","kubernetes/fake","kubernetes/scheme","kubernetes/typed/admissionregistration/v1alpha1","kubernetes/typed/admissionregistration/v1alpha1/fake","kubernetes/typed/apps/v1beta1","kubernetes/typed/apps/v1beta1/fake","kubernetes/typed/apps/v1beta2","kubernetes/typed/apps/v1beta2/fake","kubernetes/typed/authentication/v1","kubernetes/typed/authentication/v1/fake","kubernetes/typed/authentication/v1beta1","kubernetes/typed/authentication/v1beta1/fake","kubernetes/typed/authorization/v1","kubernetes/typed/authorization/v1/fake","kubernetes/typed/authorization/v1beta1","kubernetes/typed/authorization/v1beta1/fake","kubernetes/typed/autoscaling/v1","kubernetes/typed/autoscaling/v1/fake","kubernetes/typed/autoscaling/v2beta1","kubernetes/typed/autoscaling/v2beta1/fake","kubernetes/typed/batch/v1","kubernetes/typed/batch/v1/fake","kubernetes/typed/batch/v1beta1","kubernetes/typed/batch/v1beta1/fake","kubernetes/typed/batch/v2alpha1","kubernetes/typed/batch/v2alpha1/fake","kubernetes/typed/certificates/v1beta1","kubernetes/typed/certificates/v1beta1/fake","kubernetes/typed/core/v1","kubernetes/typed/core/v1/fake","kubernetes/typed/extensions/v1beta1","kubernetes/typed/extensions/v1beta1/fake","kubernetes/typed/networking/v1","kubernetes/typed/networking/v1/fake","kubernetes/typed/policy/v1beta1","kubernetes/typed/policy/v1beta1/fake","kubernetes/typed/rbac/v1","kubernetes/typed/rbac/v1/fake","kubernetes/typed/rbac/v1alpha1","kubernetes/typed/rbac/v1alpha1/fake","kubernetes/typed/rbac/v1beta1","kubernetes/typed/rbac/v1beta1/fake","kubernetes/typed/scheduling/v1alpha1","kubernetes/typed/scheduling/v1alpha1/fake","kubernetes/typed/settings/v1alpha1","kubernetes/typed/settings/v1alpha1/fake","kubernetes/typed/storage/v1","kubernetes/typed/storage/v1/fake","kubernetes/typed/storage/v1beta1","kubernetes/typed/storage/v1beta1/fake","listers/admissionregistration/v1alpha1","listers/apps/v1beta1","listers/apps/v1beta2","listers/autoscaling/v1","listers/autoscaling/v2beta1","listers/batch/v1","listers/batch/v1beta1","listers/batch/v2alpha1","listers/certificates/v1beta1","listers/core/v1","listers/extensions/v1beta1","listers/networking/v1","listers/policy/v1beta1","listers/rbac/v1","listers/rbac/v1alpha1","listers/rbac/v1beta1","listers/scheduling/v1alpha1","listers/settings/v1alpha1","listers/storage/v1","listers/storage/v1beta1","pkg/version","rest","rest/watch","testing","tools/cache","tools/clientcmd/api","tools/metrics","tools/pager","tools/reference","transport","util/cert","util/flowcontrol","util/integer","util/workqueue"] revision = "2ae454230481a7cb5544325e12ad7658ecccd19b" version = "v5.0.1" @@ -238,6 +304,6 @@ [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "09128e8e6b2fd35470beae346f4f617763de4f5dc1a8970e1837470fc0db77b5" + inputs-digest = "43887dbca309587b794a57e300ce66e4d8c01eb953ea14013546a34effe4ef08" solver-name = "gps-cdcl" solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml index d37de6c670..541bc91294 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -35,3 +35,7 @@ [[constraint]] name = "github.com/stretchr/testify" version = "1.1.4" + +[[constraint]] + name = "google.golang.org/grpc" + version = "1.8.0" \ No newline at end of file diff --git a/build/Makefile b/build/Makefile index 656c029a62..801adea4aa 100644 --- a/build/Makefile +++ b/build/Makefile @@ -24,11 +24,11 @@ # NAME = agon-build -VERSION = 0.1 +VERSION ?= 0.1 TAG = $(NAME):$(VERSION) -CLUSTER_NAME = test-cluster -KUBECONFIG = $(build_path)/.kube -REPOSITORY = gcr.io/agon-images +CLUSTER_NAME ?= test-cluster +KUBECONFIG ?= $(build_path)/.kube +REPOSITORY ?= gcr.io/agon-images # Directory that this Makefile is in. mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) @@ -42,6 +42,7 @@ common_mounts = -v $(build_path)/.config/gcloud:/root/.config/gcloud \ -v $(agon_path):$(mount_path) gameserver_tag = $(REPOSITORY)/gameservers-controller:$(VERSION) +sidecar_tag = $(REPOSITORY)/gameservers-sidecar:$(VERSION) # _____ _ # |_ _|_ _ _ __ __ _ ___| |_ ___ @@ -50,12 +51,14 @@ gameserver_tag = $(REPOSITORY)/gameservers-controller:$(VERSION) # |_|\__,_|_| \__, |\___|\__|___/ # |___/ +# build all +build: build-gameservers-controller-image build-gameservers-sidecar-image + # Run all tests test: ensure-image docker run --rm $(common_mounts) --entrypoint=go $(TAG) test -race $(agon_package)/... -# Build a static binary for the gameserver operator -# CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main . +# Build a static binary for the gameserver controller build-gameservers-controller-binary: ensure-image docker run --rm -e "CGO_ENABLED=0" $(common_mounts) --entrypoint=go $(TAG) build \ -o $(mount_path)/gameservers/controller/bin/controller -a -installsuffix cgo $(agon_package)/gameservers/controller @@ -64,9 +67,22 @@ build-gameservers-controller-binary: ensure-image build-gameservers-controller-image: ensure-image build-gameservers-controller-binary docker build $(agon_path)/gameservers/controller/ --tag=$(gameserver_tag) -# Generate the CRD client -gen-client: ensure-image - docker run --rm $(common_mounts) --entrypoint="/root/gen-client.sh" $(TAG) +# build the static binary for the gamesever sidecar +build-gameservers-sidecar-binary: ensure-image + docker run --rm -e "CGO_ENABLED=0" $(common_mounts) --entrypoint=go $(TAG) build \ + -o $(mount_path)/gameservers/sidecar/bin/sidecar -a -installsuffix cgo $(agon_package)/gameservers/sidecar + +# Build the image for the gameserver sidecar +build-gameservers-sidecar-image: ensure-image build-gameservers-sidecar-binary + docker build $(agon_path)/gameservers/sidecar/ --tag=$(sidecar_tag) + +# Generate the sidecar gRPC code +gen-gameservers-sidecar-grpc: ensure-image + docker run --rm $(common_mounts) --entrypoint="/root/gen-grpc-go.sh" $(TAG) + +# Generate the client for our CustomResourceDefinition +gen-crd-client: ensure-image + docker run --rm $(common_mounts) --entrypoint="/root/gen-crd-client.sh" $(TAG) docker run --rm $(common_mounts) --entrypoint=goimports $(TAG) -w $(mount_path)/pkg # Run a bash shell with the developer tools in it. (Creates the image if it doesn't exist) diff --git a/build/README.md b/build/README.md index 52c5f99323..38bc66af63 100644 --- a/build/README.md +++ b/build/README.md @@ -12,9 +12,12 @@ tasks you may wish to accomplish. Targets for developing with the build image -### `make build-gameserver-image` +### `make build-gameservers-controller-image` Compile the gameserver controller and then build the docker image +### `make build-gameservers-sidecar-image` +Compile the gameserver sidecar and then build the docker image + ### `make test` Run all tests diff --git a/build/crd.boilerplate.go.txt b/build/boilerplate.go.txt similarity index 100% rename from build/crd.boilerplate.go.txt rename to build/boilerplate.go.txt diff --git a/build/build-image/Dockerfile b/build/build-image/Dockerfile index 50532bcfd2..c0d5ece96a 100644 --- a/build/build-image/Dockerfile +++ b/build/build-image/Dockerfile @@ -26,17 +26,31 @@ ENV PATH /google-cloud-sdk/bin:$PATH RUN gcloud components update && gcloud components install kubectl RUN echo "source <(kubectl completion bash)" >> /root/.bashrc +# install protoc for grpc +ENV PB_VER 3.5.0 +ENV PB_URL https://github.com/google/protobuf/releases/download/v${PB_VER}/protoc-${PB_VER}-linux-x86_64.zip +RUN mkdir -p /tmp/protoc && \ + curl -L ${PB_URL} > /tmp/protoc/protoc.zip && \ + cd /tmp/protoc && \ + unzip protoc.zip && \ + cp /tmp/protoc/bin/protoc /usr/local/bin && \ + cp -R /tmp/protoc/include/* /usr/local/include && \ + chmod go+rx /usr/local/bin/protoc && \ + cd /tmp && \ + rm -r /tmp/protoc + # install go tooling for building and testing RUN go get -u github.com/golang/dep/cmd/dep && \ go get -u github.com/alecthomas/gometalinter && \ go get -u k8s.io/code-generator/... && \ + go get -u github.com/golang/protobuf/protoc-gen-go && \ /go/bin/gometalinter --install # make sure we keep the path to go RUN echo "export PATH=/usr/local/go/bin:/go/bin/:\$PATH" >> /root/.bashrc # script for generating the CRD scripts -COPY gen-client.sh /root/gen-client.sh -RUN chmod +x /root/gen-client.sh +COPY *.sh /root/ +RUN chmod +x /root/*.sh ENTRYPOINT kubectl \ No newline at end of file diff --git a/build/build-image/gen-client.sh b/build/build-image/gen-crd-client.sh similarity index 91% rename from build/build-image/gen-client.sh rename to build/build-image/gen-crd-client.sh index 5c1459c5bc..eb9b333ce5 100644 --- a/build/build-image/gen-client.sh +++ b/build/build-image/gen-crd-client.sh @@ -18,4 +18,4 @@ rsync -r /go/src/github.com/agonio/agon/vendor/k8s.io/ /go/src/k8s.io/ /go/src/k8s.io/code-generator/generate-groups.sh "all" \ github.com/agonio/agon/pkg/client \ github.com/agonio/agon/pkg/apis stable:v1alpha1 \ - --go-header-file=/go/src/github.com/agonio/agon/build/crd.boilerplate.go.txt + --go-header-file=/go/src/github.com/agonio/agon/build/boilerplate.go.txt diff --git a/build/build-image/gen-grpc-go.sh b/build/build-image/gen-grpc-go.sh new file mode 100644 index 0000000000..a9a37185f0 --- /dev/null +++ b/build/build-image/gen-grpc-go.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +# Copyright 2017 Google Inc. All Rights Reserved. +# +# 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. + +cd /go/src/github.com/agonio/agon +protoc -I . sdk.proto --go_out=plugins=grpc:sdks/go +cat ./build/boilerplate.go.txt ./sdks/go/sdk.pb.go >> ./sdk.pb.go +goimports -w ./sdk.pb.go +cp ./sdk.pb.go ./gameservers/sidecar/sdk +mv ./sdk.pb.go ./sdks/go \ No newline at end of file diff --git a/examples/gameserver.yaml b/examples/gameserver.yaml index 538aa29676..7158b24e87 100644 --- a/examples/gameserver.yaml +++ b/examples/gameserver.yaml @@ -29,7 +29,7 @@ metadata: name: "gds-example" spec: # if there is more than one container, specify which one is the game server - container: exampleServer + container: example-server # `static` is the only current option. Dynamic port allocated will come in future releases. # When `static` is the policy specified, `hostPort` is required, to specify the port that game clients will connect to portPolicy: "static" @@ -48,6 +48,6 @@ spec: # Pod Specification spec: containers: - - name: exampleServer + - name: example-server image: gcr.io/agon/test-server:0.1 imagePullPolicy: Always diff --git a/examples/simple-udp/server/main.go b/examples/simple-udp/server/main.go index e2513649b7..05bca5713c 100644 --- a/examples/simple-udp/server/main.go +++ b/examples/simple-udp/server/main.go @@ -20,6 +20,8 @@ import ( "log" "net" "os" + + "github.com/agonio/agon/sdks/go" ) const exit = "EXIT" @@ -40,6 +42,18 @@ func main() { } defer conn.Close() + log.Print("Creating SDK instance") + s, err := sdk.NewSDK() + if err != nil { + log.Fatalf("Could not connect to sdk: %v", err) + } + log.Print("Marking this server as ready") + // This tells Agon that the server is ready to receive connections. + err = s.Ready() + if err != nil { + log.Fatalf("Could not send ready message") + } + b := make([]byte, 1024) for { n, sender, err := conn.ReadFrom(b) @@ -51,6 +65,11 @@ func main() { log.Printf("Received packet from %v: %v", sender.String(), txt) if txt == exit { log.Printf("Received EXIT command. Exiting.") + // This tells Agon to shutdown this Game Server + err := s.Shutdown() + if err != nil { + log.Printf("Could not shutdown") + } os.Exit(0) } diff --git a/gameservers/controller/controller.go b/gameservers/controller/controller.go index d74d4a651d..7da5b9e160 100644 --- a/gameservers/controller/controller.go +++ b/gameservers/controller/controller.go @@ -42,24 +42,31 @@ import ( "k8s.io/client-go/util/workqueue" ) -const gameServerPodLabel = stable.GroupName + "/gameserver" +var ( + errPodNotFound = errors.New("A Pod for this GameServer Was Not Found") +) // Controller is a GameServer crd controller type Controller struct { - crdGetter v1beta1.CustomResourceDefinitionInterface - podGetter typedcorev1.PodsGetter - podLister corelisterv1.PodLister - gameServerGetter getterv1alpha1.GameServersGetter - gameServerLister listerv1alpha1.GameServerLister - gameServerSynced cache.InformerSynced - queue workqueue.RateLimitingInterface + sidecarImage string + alwaysPullSidecarImage bool + crdGetter v1beta1.CustomResourceDefinitionInterface + podGetter typedcorev1.PodsGetter + podLister corelisterv1.PodLister + gameServerGetter getterv1alpha1.GameServersGetter + gameServerLister listerv1alpha1.GameServerLister + gameServerSynced cache.InformerSynced + nodeLister corelisterv1.NodeLister + queue workqueue.RateLimitingInterface // this allows for overwriting for testing purposes syncHandler func(string) error } // NewController returns a new gameserver crd controller -func NewController(kubeClient kubernetes.Interface, +func NewController(sidecarImage string, + alwaysPullSidecarImage bool, + kubeClient kubernetes.Interface, kubeInformerFactory informers.SharedInformerFactory, extClient extclientset.Interface, agonClient versioned.Interface, @@ -69,17 +76,28 @@ func NewController(kubeClient kubernetes.Interface, gsInformer := gameServers.Informer() c := &Controller{ - crdGetter: extClient.ApiextensionsV1beta1().CustomResourceDefinitions(), - podGetter: kubeClient.CoreV1(), - podLister: kubeInformerFactory.Core().V1().Pods().Lister(), - gameServerGetter: agonClient.StableV1alpha1(), - gameServerLister: gameServers.Lister(), - gameServerSynced: gsInformer.HasSynced, - queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), stable.GroupName), + sidecarImage: sidecarImage, + alwaysPullSidecarImage: alwaysPullSidecarImage, + crdGetter: extClient.ApiextensionsV1beta1().CustomResourceDefinitions(), + podGetter: kubeClient.CoreV1(), + podLister: kubeInformerFactory.Core().V1().Pods().Lister(), + gameServerGetter: agonClient.StableV1alpha1(), + gameServerLister: gameServers.Lister(), + gameServerSynced: gsInformer.HasSynced, + nodeLister: kubeInformerFactory.Core().V1().Nodes().Lister(), + queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), stable.GroupName), } gsInformer.AddEventHandler(cache.ResourceEventHandlerFuncs{ AddFunc: c.enqueueGameServer, + UpdateFunc: func(oldObj, newObj interface{}) { + // no point in processing unless there is a State change + oldGs := oldObj.(*stablev1alpha1.GameServer) + newGs := newObj.(*stablev1alpha1.GameServer) + if oldGs.Status.State != newGs.Status.State { + c.enqueueGameServer(newGs) + } + }, }) c.syncHandler = c.syncGameServer @@ -192,7 +210,13 @@ func (c *Controller) syncGameServer(key string) error { if err != nil { return err } - if err := c.syncGameServerCreatingState(gs); err != nil { + if gs, err = c.syncGameServerCreatingState(gs); err != nil { + return err + } + if gs, err = c.syncGameServerRequestReadyState(gs); err != nil { + return err + } + if _, err = c.syncGameServerShutdownState(gs); err != nil { return err } @@ -214,66 +238,166 @@ func (c *Controller) syncGameServerBlankState(gs *stablev1alpha1.GameServer) (*s // syncGameServerCreatingState checks if the GameServer is in the Creating state, and if so // creates a Pod for the GameServer and moves the state to Starting -func (c *Controller) syncGameServerCreatingState(gs *stablev1alpha1.GameServer) error { - if gs.Status.State == stablev1alpha1.CreatingState { +func (c *Controller) syncGameServerCreatingState(gs *stablev1alpha1.GameServer) (*stablev1alpha1.GameServer, error) { + if gs.Status.State == stablev1alpha1.Creating { logrus.WithField("gs", gs).Info("Syncing Create State") // Maybe something went wrong, and the pod was created, but the state was never moved to Starting, so let's check - ret, err := c.podLister.List(labels.SelectorFromSet(labels.Set{gameServerPodLabel: gs.ObjectMeta.Name})) + ret, err := c.listGameServerPods(gs) if err != nil { - return errors.Wrapf(err, "error checking if pod exists for GameServer %s", gs.Name) + return nil, err } if len(ret) == 0 { - pod := &corev1.Pod{ - ObjectMeta: *gs.Spec.Template.ObjectMeta.DeepCopy(), - Spec: *gs.Spec.Template.Spec.DeepCopy(), + sidecar := corev1.Container{ + Name: "agon-gameserver-sidecar", + Image: c.sidecarImage, + Env: []corev1.EnvVar{ + { + Name: "GAMESERVER_NAME", + Value: gs.ObjectMeta.Name, + }, + { + Name: "POD_NAMESPACE", + ValueFrom: &corev1.EnvVarSource{ + FieldRef: &corev1.ObjectFieldSelector{ + FieldPath: "metadata.namespace", + }, + }, + }, + }, } - // Switch to GenerateName, so that we always get a Unique name for the Pod, and there - // can be no collisions - pod.ObjectMeta.GenerateName = gs.ObjectMeta.Name + "-" - pod.ObjectMeta.Name = "" - // Pods for GameServers need to stay in the same namespace - pod.ObjectMeta.Namespace = gs.ObjectMeta.Namespace - // Make sure these are blank, just in case - pod.ResourceVersion = "" - pod.UID = "" - if pod.ObjectMeta.Labels == nil { - pod.ObjectMeta.Labels = make(map[string]string, 1) + if c.alwaysPullSidecarImage { + sidecar.ImagePullPolicy = corev1.PullAlways } - pod.ObjectMeta.Labels[stable.GroupName+"/role"] = "gameserver" - // store the GameServer name as a label, for easy lookup later on - pod.ObjectMeta.Labels[gameServerPodLabel] = gs.ObjectMeta.Name - ref := metav1.NewControllerRef(gs, stablev1alpha1.SchemeGroupVersion.WithKind("GameServer")) - pod.ObjectMeta.OwnerReferences = append(pod.ObjectMeta.OwnerReferences, *ref) - i, gsContainer, err := gs.FindGameServerContainer() + pod, err := gs.Pod(sidecar) + // this shouldn't happen, but if it does. if err != nil { + logrus.WithField("gamserver", gs).WithError(err).Error("error creating pod from Game Server") return c.moveToErrorState(gs) } - cp := corev1.ContainerPort{ - ContainerPort: gs.Spec.ContainerPort, - HostPort: gs.Spec.HostPort, - Protocol: gs.Spec.Protocol, - } - gsContainer.Ports = append(gsContainer.Ports, cp) - pod.Spec.Containers[i] = gsContainer logrus.WithField("pod", pod).Info("creating Pod for GameServer") if _, err := c.podGetter.Pods(gs.ObjectMeta.Namespace).Create(pod); err != nil { - return errors.Wrapf(err, "error creating Pod for GameServer %s", gs.Name) + if k8serrors.IsInvalid(err) { + logrus.WithField("pod", pod).WithField("gameserver", gs).Errorf("Pod created is invalid") + return c.moveToErrorState(gs) + } + return gs, errors.Wrapf(err, "error creating Pod for GameServer %s", gs.Name) } } gsCopy := gs.DeepCopy() - gsCopy.Status.State = stablev1alpha1.StartingState - if _, err := c.gameServerGetter.GameServers(gs.ObjectMeta.Namespace).Update(gsCopy); err != nil { - return errors.Wrapf(err, "error updating GameServer %s to Creating state", gs.Name) + gsCopy.Status.State = stablev1alpha1.Starting + gs, err = c.gameServerGetter.GameServers(gs.ObjectMeta.Namespace).Update(gsCopy) + return gs, errors.Wrapf(err, "error updating GameServer %s to Starting state", gs.Name) + } + return gs, nil +} + +// syncGameServerRequestReadyState checks if the Game Server is Requesting to be ready, +// and then adds the IP and Port information to the Status and marks the GameServer +// as Ready +func (c *Controller) syncGameServerRequestReadyState(gs *stablev1alpha1.GameServer) (*stablev1alpha1.GameServer, error) { + if gs.Status.State == stablev1alpha1.RequestReady { + logrus.WithField("gs", gs).Info("Syncing RequestReady State") + pod, err := c.gameServerPod(gs) + if err != nil { + return gs, errors.Wrapf(err, "error getting pod for GameServer %s", gs.ObjectMeta.Name) } + addr, err := c.externalIP(pod) + if err != nil { + return gs, errors.Wrapf(err, "error getting external ip for GameServer %s", gs.ObjectMeta.Name) + } + + gsCopy := gs.DeepCopy() + gsCopy.Status.State = stablev1alpha1.Ready + gsCopy.Status.Address = addr + // HostPort is always going to be populated, even when dynamic + // This will be a double up of information, but it will be easier to read + gsCopy.Status.Port = gs.Spec.HostPort + + gs, err = c.gameServerGetter.GameServers(gs.ObjectMeta.Namespace).Update(gsCopy) + return gs, errors.Wrapf(err, "error setting Ready, Port and Address on GameServer %s Status", gs.ObjectMeta.Name) } + return gs, nil +} - return nil +// syncGameServerShutdownState deletes the game server (and therefore the backing Pod) if it is in shutdown state +func (c *Controller) syncGameServerShutdownState(gs *stablev1alpha1.GameServer) (*stablev1alpha1.GameServer, error) { + if gs.Status.State == stablev1alpha1.Shutdown { + logrus.WithField("gs", gs).Info("Syncing Shutdown State") + // let's be explicit about how we want to shut things down + p := metav1.DeletePropagationBackground + err := c.gameServerGetter.GameServers(gs.ObjectMeta.Namespace).Delete(gs.ObjectMeta.Name, &metav1.DeleteOptions{PropagationPolicy: &p}) + return nil, errors.Wrapf(err, "error deleting Game Server %s", gs.ObjectMeta.Name) + } + + return gs, nil +} + +// moveToErrorState moves the GameServer to the error state +func (c Controller) moveToErrorState(gs *stablev1alpha1.GameServer) (*stablev1alpha1.GameServer, error) { + copy := gs.DeepCopy() + copy.Status.State = stablev1alpha1.Error + + gs, err := c.gameServerGetter.GameServers(gs.ObjectMeta.Namespace).Update(copy) + return gs, errors.Wrapf(err, "error moving GameServer %s to Error State", gs.ObjectMeta.Name) +} + +// gameServerPod returns the Pod for this Game Server, or an error if there are none, +// or it cannot be determined (there are more than one, which should not happen) +func (c *Controller) gameServerPod(gs *stablev1alpha1.GameServer) (*corev1.Pod, error) { + pods, err := c.listGameServerPods(gs) + if err != nil { + return nil, err + } + len := len(pods) + if len == 0 { + return nil, errPodNotFound + } + if len > 1 { + return nil, errors.Errorf("Found %d pods for Game Server %s", len, gs.ObjectMeta.Name) + } + return pods[0], nil +} + +// listGameServerPods returns all the Pods that the GameServer created. +// This should only ever be one. +func (c *Controller) listGameServerPods(gs *stablev1alpha1.GameServer) ([]*corev1.Pod, error) { + pods, err := c.podLister.List(labels.SelectorFromSet(labels.Set{stablev1alpha1.GameServerPodLabel: gs.ObjectMeta.Name})) + if err != nil { + return pods, errors.Wrapf(err, "error checking if pod exists for GameServer %s", gs.Name) + } + + // there is a small chance that the GameServer name is not unique, and a Pod for a previous + // GameServer is has yet to Terminate so check its controller, just to be sure. + var result []*corev1.Pod + for _, p := range pods { + if metav1.IsControlledBy(p, gs) { + result = append(result, p) + } + } + + return result, nil +} + +// ExternalIP returns the external IP that the given Pod is being run on +func (c Controller) externalIP(pod *corev1.Pod) (string, error) { + node, err := c.nodeLister.Get(pod.Spec.NodeName) + if err != nil { + return "", errors.Wrapf(err, "error retrieving node %s for Pod %s", node.ObjectMeta.Name, pod.ObjectMeta.Name) + } + + for _, a := range node.Status.Addresses { + if a.Type == corev1.NodeExternalIP { + return a.Address, nil + } + } + + return "", errors.Errorf("Could not find an external ip for Node: #%s", node.ObjectMeta.Name) } // createCRDIfDoesntExist creates the GameServer CRD if it doesn't exist. @@ -315,12 +439,3 @@ func (c Controller) waitForEstablishedCRD() error { return false, nil }) } - -// moveToErrorState moves the GameServer to the error state -func (c Controller) moveToErrorState(gs *stablev1alpha1.GameServer) error { - copy := gs.DeepCopy() - copy.Status.State = stablev1alpha1.ErrorState - - _, err := c.gameServerGetter.GameServers(gs.ObjectMeta.Namespace).Update(gs) - return errors.Wrapf(err, "error moving GameServer %s to Error State", gs.ObjectMeta.Name) -} diff --git a/gameservers/controller/controller_test.go b/gameservers/controller/controller_test.go index a887664a23..79cea23ea1 100644 --- a/gameservers/controller/controller_test.go +++ b/gameservers/controller/controller_test.go @@ -35,6 +35,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/util/validation/field" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/informers" kubefake "k8s.io/client-go/kubernetes/fake" @@ -149,9 +150,9 @@ func TestSyncGameServer(t *testing.T) { expectedState := v1alpha1.State("notastate") switch updateCount { case 1: - expectedState = v1alpha1.CreatingState + expectedState = v1alpha1.Creating case 2: - expectedState = v1alpha1.StartingState + expectedState = v1alpha1.Starting } assert.Equal(t, expectedState, gs.Status.State) @@ -172,7 +173,7 @@ func TestSyncGameServer(t *testing.T) { c, mocks := newFakeController() fixture := &v1alpha1.GameServer{ObjectMeta: metav1.ObjectMeta{Name: "test", Namespace: "default"}, Spec: newSingeContainerSpec(), - Status: v1alpha1.GameServerStatus{State: v1alpha1.ReadyState}} + Status: v1alpha1.GameServerStatus{State: v1alpha1.Ready}} agonWatch := watch.NewFake() podAction := false @@ -206,11 +207,12 @@ func TestWatchGameServers(t *testing.T) { return true, newEstablishedCRD(), nil }) - received := make(chan bool) + received := make(chan string) + defer close(received) c.syncHandler = func(name string) error { - defer close(received) assert.Equal(t, "default/test", name) + received <- name return nil } @@ -222,8 +224,17 @@ func TestWatchGameServers(t *testing.T) { assert.Nil(t, err, "Run should not error") }() + logrus.Info("Adding first fixture") fakeWatch.Add(&fixture) - <-received + assert.Equal(t, "default/test", <-received) + + // no state change + fakeWatch.Modify(&fixture) + copyFixture := fixture.DeepCopy() + copyFixture.Status.State = v1alpha1.Starting + logrus.Info("modify copyFixture") + fakeWatch.Modify(copyFixture) + assert.Equal(t, "default/test", <-received) } func TestSyncGameServerBlankState(t *testing.T) { @@ -247,7 +258,7 @@ func TestSyncGameServerBlankState(t *testing.T) { assert.True(t, updated, "update should occur") assert.Equal(t, fixture.ObjectMeta.Name, result.ObjectMeta.Name) assert.Equal(t, fixture.ObjectMeta.Namespace, result.ObjectMeta.Namespace) - assert.Equal(t, v1alpha1.CreatingState, result.Status.State) + assert.Equal(t, v1alpha1.Creating, result.Status.State) }) t.Run("Gameserver with unknown state", func(t *testing.T) { @@ -262,7 +273,7 @@ func TestSyncGameServerCreatingState(t *testing.T) { newFixture := func() *v1alpha1.GameServer { fixture := &v1alpha1.GameServer{ObjectMeta: metav1.ObjectMeta{Name: "test", Namespace: "default"}, - Spec: newSingeContainerSpec(), Status: v1alpha1.GameServerStatus{State: v1alpha1.CreatingState}} + Spec: newSingeContainerSpec(), Status: v1alpha1.GameServerStatus{State: v1alpha1.Creating}} fixture.ApplyDefaults() return fixture } @@ -272,19 +283,26 @@ func TestSyncGameServerCreatingState(t *testing.T) { fixture := newFixture() podCreated := false gsUpdated := false + var pod *corev1.Pod mocks.kubeClient.AddReactor("create", "pods", func(action k8stesting.Action) (bool, runtime.Object, error) { podCreated = true ca := action.(k8stesting.CreateAction) - pod := ca.GetObject().(*corev1.Pod) + pod = ca.GetObject().(*corev1.Pod) assert.Equal(t, fixture.ObjectMeta.Name+"-", pod.ObjectMeta.GenerateName) assert.Equal(t, fixture.ObjectMeta.Namespace, pod.ObjectMeta.Namespace) assert.Equal(t, "gameserver", pod.ObjectMeta.Labels[stable.GroupName+"/role"]) - assert.Equal(t, fixture.ObjectMeta.Name, pod.ObjectMeta.Labels[gameServerPodLabel]) + assert.Equal(t, fixture.ObjectMeta.Name, pod.ObjectMeta.Labels[v1alpha1.GameServerPodLabel]) assert.True(t, metav1.IsControlledBy(pod, fixture)) assert.Equal(t, fixture.Spec.HostPort, pod.Spec.Containers[0].Ports[0].HostPort) assert.Equal(t, fixture.Spec.ContainerPort, pod.Spec.Containers[0].Ports[0].ContainerPort) assert.Equal(t, corev1.Protocol("UDP"), pod.Spec.Containers[0].Ports[0].Protocol) + assert.Len(t, pod.Spec.Containers, 2, "Should have a sidecar container") + assert.Equal(t, pod.Spec.Containers[1].Image, c.sidecarImage) + assert.Len(t, pod.Spec.Containers[1].Env, 2, "2 env vars") + assert.Equal(t, "GAMESERVER_NAME", pod.Spec.Containers[1].Env[0].Name) + assert.Equal(t, fixture.ObjectMeta.Name, pod.Spec.Containers[1].Env[0].Value) + assert.Equal(t, "POD_NAMESPACE", pod.Spec.Containers[1].Env[1].Name) return true, pod, nil }) @@ -292,11 +310,12 @@ func TestSyncGameServerCreatingState(t *testing.T) { gsUpdated = true ua := action.(k8stesting.UpdateAction) gs := ua.GetObject().(*v1alpha1.GameServer) - assert.Equal(t, v1alpha1.StartingState, gs.Status.State) + assert.Equal(t, v1alpha1.Starting, gs.Status.State) return true, gs, nil }) - err := c.syncGameServerCreatingState(fixture) + gs, err := c.syncGameServerCreatingState(fixture) + assert.Equal(t, v1alpha1.Starting, gs.Status.State) assert.Nil(t, err) assert.True(t, podCreated, "Pod should have been created") assert.True(t, gsUpdated, "GameServer should have been updated") @@ -307,15 +326,11 @@ func TestSyncGameServerCreatingState(t *testing.T) { fixture := newFixture() podCreated := false gsUpdated := false - fakeWatch := watch.NewFake() - pod := corev1.Pod{ - ObjectMeta: *fixture.ObjectMeta.DeepCopy(), - } - pod.ObjectMeta.Labels = map[string]string{gameServerPodLabel: fixture.ObjectMeta.Name} + pod, err := fixture.Pod() + assert.Nil(t, err) - mocks.kubeClient.AddWatchReactor("pods", k8stesting.DefaultWatchReactor(fakeWatch, nil)) mocks.kubeClient.AddReactor("list", "pods", func(action k8stesting.Action) (bool, runtime.Object, error) { - return true, &corev1.PodList{Items: []corev1.Pod{pod}}, nil + return true, &corev1.PodList{Items: []corev1.Pod{*pod}}, nil }) mocks.kubeClient.AddReactor("create", "pods", func(action k8stesting.Action) (bool, runtime.Object, error) { podCreated = true @@ -325,28 +340,215 @@ func TestSyncGameServerCreatingState(t *testing.T) { gsUpdated = true ua := action.(k8stesting.UpdateAction) gs := ua.GetObject().(*v1alpha1.GameServer) - assert.Equal(t, v1alpha1.StartingState, gs.Status.State) + assert.Equal(t, v1alpha1.Starting, gs.Status.State) return true, gs, nil }) stop := startInformers(c, mocks) defer close(stop) - fakeWatch.Add(&pod) - - err := c.syncGameServerCreatingState(fixture) + gs, err := c.syncGameServerCreatingState(fixture) + assert.Equal(t, v1alpha1.Starting, gs.Status.State) assert.Nil(t, err) assert.False(t, podCreated, "Pod should not have been created") assert.True(t, gsUpdated, "GameServer should have been updated") }) - t.Run("Gameserver with unknown state", func(t *testing.T) { + t.Run("creates an invalid podspec", func(t *testing.T) { + c, mocks := newFakeController() + fixture := newFixture() + podCreated := false + gsUpdated := false + + mocks.kubeClient.AddReactor("create", "pods", func(action k8stesting.Action) (bool, runtime.Object, error) { + podCreated = true + return true, nil, k8serrors.NewInvalid(schema.GroupKind{}, "test", field.ErrorList{}) + }) + mocks.agonClient.AddReactor("update", "gameservers", func(action k8stesting.Action) (bool, runtime.Object, error) { + gsUpdated = true + ua := action.(k8stesting.UpdateAction) + gs := ua.GetObject().(*v1alpha1.GameServer) + assert.Equal(t, v1alpha1.Error, gs.Status.State) + return true, gs, nil + }) + + stop := startInformers(c, mocks) + defer close(stop) + + gs, err := c.syncGameServerCreatingState(fixture) + assert.Nil(t, err) + + assert.True(t, podCreated, "attempt should have been made to create a pod") + assert.True(t, gsUpdated, "GameServer should be updated") + assert.Equal(t, v1alpha1.Error, gs.Status.State) + }) + + t.Run("GameServer with unknown state", func(t *testing.T) { testWithUnknownState(t, func(c *Controller, fixture *v1alpha1.GameServer) (*v1alpha1.GameServer, error) { - return fixture, c.syncGameServerCreatingState(fixture) + return c.syncGameServerCreatingState(fixture) }) }) } +func TestSyncGameServerRequestReadyState(t *testing.T) { + t.Parallel() + + t.Run("GameServer with ReadyRequest State", func(t *testing.T) { + c, mocks := newFakeController() + + ipFixture := "12.12.12.12" + gsFixture := &v1alpha1.GameServer{ObjectMeta: metav1.ObjectMeta{Name: "test", Namespace: "default"}, + Spec: newSingeContainerSpec(), Status: v1alpha1.GameServerStatus{State: v1alpha1.RequestReady}} + gsFixture.ApplyDefaults() + node := corev1.Node{ObjectMeta: metav1.ObjectMeta{Name: "node1"}, Status: corev1.NodeStatus{Addresses: []corev1.NodeAddress{{Address: ipFixture, Type: corev1.NodeExternalIP}}}} + pod, err := gsFixture.Pod() + assert.Nil(t, err) + pod.Spec.NodeName = node.ObjectMeta.Name + gsUpdated := false + + mocks.kubeClient.AddReactor("list", "pods", func(action k8stesting.Action) (bool, runtime.Object, error) { + return true, &corev1.PodList{Items: []corev1.Pod{*pod}}, nil + }) + mocks.kubeClient.AddReactor("list", "nodes", func(action k8stesting.Action) (bool, runtime.Object, error) { + return true, &corev1.NodeList{Items: []corev1.Node{node}}, nil + }) + mocks.agonClient.AddReactor("update", "gameservers", func(action k8stesting.Action) (bool, runtime.Object, error) { + gsUpdated = true + ua := action.(k8stesting.UpdateAction) + gs := ua.GetObject().(*v1alpha1.GameServer) + assert.Equal(t, v1alpha1.Ready, gs.Status.State) + assert.Equal(t, gs.Spec.HostPort, gs.Status.Port) + assert.Equal(t, ipFixture, gs.Status.Address) + return true, gs, nil + }) + + stop := startInformers(c, mocks) + defer close(stop) + + gs, err := c.syncGameServerRequestReadyState(gsFixture) + assert.Nil(t, err, "should not error") + assert.True(t, gsUpdated, "GameServer wasn't updated") + assert.Equal(t, v1alpha1.Ready, gs.Status.State) + assert.Equal(t, gs.Spec.HostPort, gs.Status.Port) + assert.Equal(t, ipFixture, gs.Status.Address) + + }) + + t.Run("GameServer with unknown state", func(t *testing.T) { + testWithUnknownState(t, func(c *Controller, fixture *v1alpha1.GameServer) (*v1alpha1.GameServer, error) { + return c.syncGameServerRequestReadyState(fixture) + }) + }) +} + +func TestSyncGameServerShutdownState(t *testing.T) { + t.Run("GameServer with a Shutdown state", func(t *testing.T) { + c, mocks := newFakeController() + gsFixture := &v1alpha1.GameServer{ObjectMeta: metav1.ObjectMeta{Name: "test", Namespace: "default"}, + Spec: newSingeContainerSpec(), Status: v1alpha1.GameServerStatus{State: v1alpha1.Shutdown}} + gsFixture.ApplyDefaults() + checkDeleted := false + + mocks.agonClient.AddReactor("delete", "gameservers", func(action k8stesting.Action) (bool, runtime.Object, error) { + checkDeleted = true + assert.Equal(t, "default", action.GetNamespace()) + da := action.(k8stesting.DeleteAction) + assert.Equal(t, "test", da.GetName()) + + return true, nil, nil + }) + + stop := startInformers(c, mocks) + defer close(stop) + + gs, err := c.syncGameServerShutdownState(gsFixture) + assert.Nil(t, gs) + assert.Nil(t, err) + assert.True(t, checkDeleted, "GameServer should be deleted") + }) + + t.Run("GameServer with unknown state", func(t *testing.T) { + testWithUnknownState(t, func(c *Controller, fixture *v1alpha1.GameServer) (*v1alpha1.GameServer, error) { + return c.syncGameServerRequestReadyState(fixture) + }) + }) +} + +func TestControllerExternalIP(t *testing.T) { + t.Parallel() + c, mocks := newFakeController() + ipfixture := "12.12.12.12" + node := corev1.Node{ObjectMeta: metav1.ObjectMeta{Name: "node1"}, Status: corev1.NodeStatus{Addresses: []corev1.NodeAddress{{Address: ipfixture, Type: corev1.NodeExternalIP}}}} + pod := corev1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "pod"}, + Spec: corev1.PodSpec{NodeName: node.ObjectMeta.Name}} + + mocks.kubeClient.AddReactor("list", "pods", func(action k8stesting.Action) (bool, runtime.Object, error) { + return true, &corev1.PodList{Items: []corev1.Pod{pod}}, nil + }) + mocks.kubeClient.AddReactor("list", "nodes", func(action k8stesting.Action) (bool, runtime.Object, error) { + return true, &corev1.NodeList{Items: []corev1.Node{node}}, nil + }) + + stop := startInformers(c, mocks) + defer close(stop) + + addr, err := c.externalIP(&pod) + assert.Nil(t, err) + assert.Equal(t, ipfixture, addr) +} + +func TestControllerGameServerPod(t *testing.T) { + t.Parallel() + c, mocks := newFakeController() + fakeWatch := watch.NewFake() + mocks.kubeClient.AddWatchReactor("pods", k8stesting.DefaultWatchReactor(fakeWatch, nil)) + gs := &v1alpha1.GameServer{ObjectMeta: metav1.ObjectMeta{Name: "gameserver", UID: "1234"}, Spec: newSingeContainerSpec()} + gs.ApplyDefaults() + pod := &corev1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "pod1", Labels: map[string]string{v1alpha1.GameServerPodLabel: gs.ObjectMeta.Name}}} + + stop := startInformers(c, mocks) + defer close(stop) + + _, err := c.gameServerPod(gs) + assert.Equal(t, errPodNotFound, err) + + // not owned + fakeWatch.Add(pod.DeepCopy()) + cache.WaitForCacheSync(stop, c.gameServerSynced) + _, err = c.gameServerPod(gs) + assert.Equal(t, errPodNotFound, err) + + // owned + ownedPod, err := gs.Pod() + assert.Nil(t, err) + ownedPod.ObjectMeta.Name = "owned1" + fakeWatch.Add(ownedPod) + cache.WaitForCacheSync(stop, c.gameServerSynced) + // should be fine + pod2, err := c.gameServerPod(gs) + assert.Nil(t, err) + assert.Equal(t, ownedPod, pod2) + + // add another non-owned pod + p2 := pod.DeepCopy() + p2.ObjectMeta.Name = "pod2" + fakeWatch.Add(p2) + cache.WaitForCacheSync(stop, c.gameServerSynced) + // should still be fine + pod2, err = c.gameServerPod(gs) + assert.Nil(t, err) + assert.Equal(t, ownedPod, pod2) + + // now add another owned pod + p3 := ownedPod.DeepCopy() + p3.ObjectMeta.Name = "pod3" + fakeWatch.Add(p3) + cache.WaitForCacheSync(stop, c.gameServerSynced) + // should error out + _, err = c.gameServerPod(gs) + assert.NotNil(t, err) +} + // testWithUnknownState runs a test with a state that doesn't exist, to ensure a handler // doesn't do process anything beyond the state it is meant to handle. func testWithUnknownState(t *testing.T, f func(*Controller, *v1alpha1.GameServer) (*v1alpha1.GameServer, error)) { @@ -371,8 +573,8 @@ type mocks struct { kubeClient *kubefake.Clientset kubeInformationFactory informers.SharedInformerFactory extClient *extfake.Clientset - agonClient *agonfake.Clientset - agonInformerFactory externalversions.SharedInformerFactory + agonClient *agonfake.Clientset + agonInformerFactory externalversions.SharedInformerFactory } // newFakeController returns a controller, backed by the fake Clientset @@ -383,20 +585,20 @@ func newFakeController() (*Controller, mocks) { agonClient := &agonfake.Clientset{} agonInformerFactory := externalversions.NewSharedInformerFactory(agonClient, 30*time.Second) - return NewController(kubeClient, kubeInformationFactory, extClient, agonClient, agonInformerFactory), + return NewController("sidecar:dev", false, kubeClient, kubeInformationFactory, extClient, agonClient, agonInformerFactory), mocks{ kubeClient: kubeClient, kubeInformationFactory: kubeInformationFactory, extClient: extClient, - agonClient: agonClient, - agonInformerFactory: agonInformerFactory} + agonClient: agonClient, + agonInformerFactory: agonInformerFactory} } func newSingeContainerSpec() v1alpha1.GameServerSpec { return v1alpha1.GameServerSpec{ ContainerPort: 7777, HostPort: 9999, - PortPolicy: v1alpha1.StaticPortPolicy, + PortPolicy: v1alpha1.Static, Template: corev1.PodTemplateSpec{ Spec: corev1.PodSpec{ Containers: []corev1.Container{{Name: "container", Image: "container/image"}}, diff --git a/gameservers/controller/deployment.yaml b/gameservers/controller/deployment.yaml index e60561a73d..4bed2fa8ed 100644 --- a/gameservers/controller/deployment.yaml +++ b/gameservers/controller/deployment.yaml @@ -29,3 +29,6 @@ spec: - name: gameservers-controller image: gcr.io/agon-images/gameservers-controller:0.1 imagePullPolicy: Always + env: + - name: ALWAYS_PULL_SIDECAR + value: "true" diff --git a/gameservers/controller/main.go b/gameservers/controller/main.go index f755e0e6c3..c713159123 100644 --- a/gameservers/controller/main.go +++ b/gameservers/controller/main.go @@ -16,12 +16,16 @@ package main import ( + "strings" "time" "github.com/agonio/agon/pkg/client/clientset/versioned" "github.com/agonio/agon/pkg/client/informers/externalversions" "github.com/agonio/agon/pkg/signals" + "github.com/agonio/agon/pkg/util/runtime" "github.com/sirupsen/logrus" + "github.com/spf13/pflag" + "github.com/spf13/viper" extclientset "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" "k8s.io/client-go/informers" "k8s.io/client-go/kubernetes" @@ -29,7 +33,11 @@ import ( ) // Version the release version of the gameserver controller -const Version = "0.1" +const ( + Version = "0.1" + sidecarFlag = "sidecar" + pullSidecarFlag = "always-pull-sidecar" +) func init() { logrus.SetFormatter(&logrus.JSONFormatter{}) @@ -37,7 +45,24 @@ func init() { // main starts the operator for the gameserver CRD func main() { - logrus.WithField("Version", Version).Info("starting gameServer operator...") + viper.SetDefault(sidecarFlag, "gcr.io/agon-images/gameservers-sidecar:"+Version) + viper.SetDefault(pullSidecarFlag, false) + + pflag.String(sidecarFlag, viper.GetString(sidecarFlag), "Flag to overwrite the GameServer sidecar image that is used. Can also use SIDECAR env variable") + pflag.Bool(pullSidecarFlag, viper.GetBool(pullSidecarFlag), "For development purposes, set the sidecar image to have a ImagePullPolicy of Always. Can also use ALWAYS_PULL_SIDECAR env variable") + pflag.Parse() + + viper.SetEnvKeyReplacer(strings.NewReplacer("-", "_")) + runtime.Must(viper.BindEnv(sidecarFlag)) + runtime.Must(viper.BindEnv(pullSidecarFlag)) + runtime.Must(viper.BindPFlags(pflag.CommandLine)) + + sidecarImage := viper.GetString(sidecarFlag) + alwaysPullSidecar := viper.GetBool(pullSidecarFlag) + + logrus.WithField(sidecarFlag, sidecarImage). + WithField("alwaysPullSidecarImage", alwaysPullSidecar). + WithField("Version", Version).Info("starting gameServer operator...") config, err := rest.InClusterConfig() if err != nil { @@ -61,7 +86,7 @@ func main() { agonInformerFactory := externalversions.NewSharedInformerFactory(agonClient, 30*time.Second) kubeInformationFactory := informers.NewSharedInformerFactory(kubeClient, 30*time.Second) - c := NewController(kubeClient, kubeInformationFactory, extClient, agonClient, agonInformerFactory) + c := NewController(sidecarImage, alwaysPullSidecar, kubeClient, kubeInformationFactory, extClient, agonClient, agonInformerFactory) stop := signals.NewStopChannel() diff --git a/gameservers/sidecar/Dockerfile b/gameservers/sidecar/Dockerfile new file mode 100644 index 0000000000..c07a433c30 --- /dev/null +++ b/gameservers/sidecar/Dockerfile @@ -0,0 +1,10 @@ +FROM alpine:3.6 + +COPY ./bin/sidecar /home/agon/sidecar +RUN apk --update add ca-certificates && \ + adduser -D agon && \ + chown -R agon /home/agon && \ + chmod o+x /home/agon/sidecar + +USER agon +ENTRYPOINT /home/agon/sidecar \ No newline at end of file diff --git a/gameservers/sidecar/local.go b/gameservers/sidecar/local.go new file mode 100644 index 0000000000..d2f0419ca9 --- /dev/null +++ b/gameservers/sidecar/local.go @@ -0,0 +1,41 @@ +// Copyright 2017 Google Inc. All Rights Reserved. +// +// 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 main + +import ( + "github.com/agonio/agon/gameservers/sidecar/sdk" + "github.com/sirupsen/logrus" + "golang.org/x/net/context" +) + +var _ sdk.SDKServer = &Local{} + +// Local type is the SDKServer implementation for when the sidecar +// is being run for local development, and doesn't connect to the +// Kubernetes cluster +type Local struct { +} + +// Ready logs that the Ready request has been received +func (l *Local) Ready(context.Context, *sdk.Empty) (*sdk.Empty, error) { + logrus.Info("Ready request has been received!") + return &sdk.Empty{}, nil +} + +// Shutdown logs that the shutdown request has been received +func (l *Local) Shutdown(context.Context, *sdk.Empty) (*sdk.Empty, error) { + logrus.Info("Shutdown request has been received!") + return &sdk.Empty{}, nil +} diff --git a/gameservers/sidecar/local_test.go b/gameservers/sidecar/local_test.go new file mode 100644 index 0000000000..8796ccb296 --- /dev/null +++ b/gameservers/sidecar/local_test.go @@ -0,0 +1,35 @@ +// Copyright 2017 Google Inc. All Rights Reserved. +// +// 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 main + +import ( + "testing" + + "github.com/agonio/agon/gameservers/sidecar/sdk" + "github.com/stretchr/testify/assert" + "golang.org/x/net/context" +) + +func TestLocal(t *testing.T) { + ctx := context.Background() + e := &sdk.Empty{} + l := Local{} + + _, err := l.Ready(ctx, e) + assert.Nil(t, err, "Ready should not error") + + _, err = l.Shutdown(ctx, e) + assert.Nil(t, err, "Shutdown should not error") +} diff --git a/gameservers/sidecar/main.go b/gameservers/sidecar/main.go new file mode 100644 index 0000000000..1383f411ab --- /dev/null +++ b/gameservers/sidecar/main.go @@ -0,0 +1,87 @@ +// Copyright 2017 Google Inc. All Rights Reserved. +// +// 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. + +// sidecar for the game server that the sdk connects to +package main + +import ( + "fmt" + "net" + + "github.com/agonio/agon/gameservers/sidecar/sdk" + "github.com/agonio/agon/pkg/util/runtime" + "github.com/sirupsen/logrus" + "github.com/spf13/pflag" + "github.com/spf13/viper" + "golang.org/x/net/context" + "google.golang.org/grpc" +) + +const ( + // Version the release version of the sidecar + Version = "0.1" + port = 59357 + + // gameServerNameEnv is the environment variable for the Game Server name + gameServerNameEnv = "GAMESERVER_NAME" + // podNamespaceEnv is the environment variable for the current Game Server namespace + podNamespaceEnv = "POD_NAMESPACE" + + // localFlag determines if this is running locally or not + localFlag = "local" +) + +func init() { + logrus.SetFormatter(&logrus.JSONFormatter{}) +} + +func main() { + viper.SetDefault(localFlag, false) + pflag.Bool(localFlag, viper.GetBool(localFlag), "Set this, or LOCAL env, to 'true' to run this binary in local development mode. Defaults to 'false'") + pflag.Parse() + + runtime.Must(viper.BindEnv(localFlag)) + runtime.Must(viper.BindEnv(gameServerNameEnv)) + runtime.Must(viper.BindEnv(podNamespaceEnv)) + runtime.Must(viper.BindPFlags(pflag.CommandLine)) + + isLocal := viper.GetBool(localFlag) + + logrus.WithField(localFlag, isLocal).WithField("version", Version).WithField("port", port).Info("Starting sdk sidecar") + + lis, err := net.Listen("tcp", fmt.Sprintf("localhost:%d", port)) + if err != nil { + logrus.WithField("port", port).Fatalf("Could not listen on port") + } + grpcServer := grpc.NewServer() + + if isLocal { + sdk.RegisterSDKServer(grpcServer, &Local{}) + } else { + var s *Sidecar + s, err = NewSidecar(viper.GetString(gameServerNameEnv), viper.GetString(podNamespaceEnv)) + if err != nil { + logrus.WithError(err).Fatalf("Could not start sidecar") + } + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + go s.Run(ctx.Done()) + sdk.RegisterSDKServer(grpcServer, s) + } + + err = grpcServer.Serve(lis) + if err != nil { + logrus.WithError(err).Error("Could not serve grpc server") + } +} diff --git a/gameservers/sidecar/sdk/sdk.pb.go b/gameservers/sidecar/sdk/sdk.pb.go new file mode 100644 index 0000000000..e80cf7d5e4 --- /dev/null +++ b/gameservers/sidecar/sdk/sdk.pb.go @@ -0,0 +1,183 @@ +// Copyright 2017 Google Inc. All Rights Reserved. +// +// 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 code was autogenerated. Do not edit directly. +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: sdk.proto + +/* +Package sdk is a generated protocol buffer package. + +It is generated from these files: + sdk.proto + +It has these top-level messages: + Empty +*/ +package sdk + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +type Empty struct { +} + +func (m *Empty) Reset() { *m = Empty{} } +func (m *Empty) String() string { return proto.CompactTextString(m) } +func (*Empty) ProtoMessage() {} +func (*Empty) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func init() { + proto.RegisterType((*Empty)(nil), "stable.agon.io.sdk.Empty") +} + +// 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 + +// Client API for SDK service + +type SDKClient interface { + // Call when the GameServer is ready + Ready(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) + // Call when the GmaeServer is shutting down + Shutdown(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) +} + +type sDKClient struct { + cc *grpc.ClientConn +} + +func NewSDKClient(cc *grpc.ClientConn) SDKClient { + return &sDKClient{cc} +} + +func (c *sDKClient) Ready(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) { + out := new(Empty) + err := grpc.Invoke(ctx, "/stable.agon.io.sdk.SDK/Ready", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *sDKClient) Shutdown(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) { + out := new(Empty) + err := grpc.Invoke(ctx, "/stable.agon.io.sdk.SDK/Shutdown", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for SDK service + +type SDKServer interface { + // Call when the GameServer is ready + Ready(context.Context, *Empty) (*Empty, error) + // Call when the GmaeServer is shutting down + Shutdown(context.Context, *Empty) (*Empty, error) +} + +func RegisterSDKServer(s *grpc.Server, srv SDKServer) { + s.RegisterService(&_SDK_serviceDesc, srv) +} + +func _SDK_Ready_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SDKServer).Ready(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/stable.agon.io.sdk.SDK/Ready", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SDKServer).Ready(ctx, req.(*Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _SDK_Shutdown_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SDKServer).Shutdown(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/stable.agon.io.sdk.SDK/Shutdown", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SDKServer).Shutdown(ctx, req.(*Empty)) + } + return interceptor(ctx, in, info, handler) +} + +var _SDK_serviceDesc = grpc.ServiceDesc{ + ServiceName: "stable.agon.io.sdk.SDK", + HandlerType: (*SDKServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Ready", + Handler: _SDK_Ready_Handler, + }, + { + MethodName: "Shutdown", + Handler: _SDK_Shutdown_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "sdk.proto", +} + +func init() { proto.RegisterFile("sdk.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 121 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2c, 0x4e, 0xc9, 0xd6, + 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x2a, 0x2e, 0x49, 0x4c, 0xca, 0x49, 0xd5, 0x4b, 0x4c, + 0xcf, 0xcf, 0xd3, 0xcb, 0xcc, 0xd7, 0x2b, 0x4e, 0xc9, 0x56, 0x62, 0xe7, 0x62, 0x75, 0xcd, 0x2d, + 0x28, 0xa9, 0x34, 0xea, 0x62, 0xe4, 0x62, 0x0e, 0x76, 0xf1, 0x16, 0xb2, 0xe7, 0x62, 0x0d, 0x4a, + 0x4d, 0x4c, 0xa9, 0x14, 0x92, 0xd4, 0xc3, 0x54, 0xae, 0x07, 0x56, 0x2b, 0x85, 0x5b, 0x4a, 0x89, + 0x41, 0xc8, 0x89, 0x8b, 0x23, 0x38, 0xa3, 0xb4, 0x24, 0x25, 0xbf, 0x3c, 0x8f, 0x5c, 0x33, 0x9c, + 0x58, 0xa3, 0x98, 0x8b, 0x53, 0xb2, 0x93, 0xd8, 0xc0, 0xee, 0x36, 0x06, 0x04, 0x00, 0x00, 0xff, + 0xff, 0x0f, 0xb4, 0x24, 0x6b, 0xc4, 0x00, 0x00, 0x00, +} diff --git a/gameservers/sidecar/sidecar.go b/gameservers/sidecar/sidecar.go index 2b6629d541..eb9d3e411e 100644 --- a/gameservers/sidecar/sidecar.go +++ b/gameservers/sidecar/sidecar.go @@ -12,8 +12,143 @@ // See the License for the specific language governing permissions and // limitations under the License. -// placeholder for where the sidecar will be developed package main -func main() { +import ( + "fmt" + "time" + + "github.com/agonio/agon/gameservers/sidecar/sdk" + "github.com/agonio/agon/pkg/apis/stable" + stablev1alpha1 "github.com/agonio/agon/pkg/apis/stable/v1alpha1" + "github.com/agonio/agon/pkg/client/clientset/versioned" + typedv1alpha1 "github.com/agonio/agon/pkg/client/clientset/versioned/typed/stable/v1alpha1" + "github.com/agonio/agon/pkg/util/runtime" + "github.com/pkg/errors" + "github.com/sirupsen/logrus" + "golang.org/x/net/context" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/wait" + "k8s.io/client-go/rest" + "k8s.io/client-go/util/workqueue" +) + +var _ sdk.SDKServer = &Sidecar{} + +// Sidecar GameServer sidecar implementation that will update the +// game server status on SDK request +type Sidecar struct { + gameServerName string + namespace string + gameServerGetter typedv1alpha1.GameServersGetter + queue workqueue.RateLimitingInterface +} + +// NewSidecar creates a Sidecar that sets up an +// InClusterConfig for Kubernetes +func NewSidecar(gameServerName, namespace string) (*Sidecar, error) { + config, err := rest.InClusterConfig() + if err != nil { + return nil, errors.Wrap(err, "Could not create Kubernetes in cluster config") + } + + agonClient, err := versioned.NewForConfig(config) + if err != nil { + return nil, errors.Wrap(err, "Could not create the agon api clientset") + } + + s := &Sidecar{ + gameServerName: gameServerName, + namespace: namespace, + gameServerGetter: agonClient.StableV1alpha1(), + } + + s.queue = s.newWorkQueue() + + logrus.WithField("gameServerNameEnv", s.gameServerName).WithField("namespace", s.namespace).Info("created GameServer sidecar") + + return s, nil +} + +func (s *Sidecar) newWorkQueue() workqueue.RateLimitingInterface { + return workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), + fmt.Sprintf("%s/%s/%s", stable.GroupName, s.namespace, s.gameServerName)) +} + +// Run processes the rate limited queue. +// Will block until stop is closed +func (s *Sidecar) Run(stop <-chan struct{}) { + defer s.queue.ShutDown() + logrus.Info("Starting worker") + wait.Until(s.runWorker, time.Second, stop) + <-stop + logrus.Info("Shut down workers") +} + +// runWorker is a long-running function that will continually call the +// processNextWorkItem function in order to read and process a message on the +// workqueue. +func (s *Sidecar) runWorker() { + for s.processNextWorkItem() { + } +} + +func (s *Sidecar) processNextWorkItem() bool { + obj, quit := s.queue.Get() + if quit { + return false + } + defer s.queue.Done(obj) + + logrus.WithField("obj", obj).Info("Processing obj") + + var state stablev1alpha1.State + var ok bool + if state, ok = obj.(stablev1alpha1.State); !ok { + runtime.HandleError(logrus.WithField("obj", obj), errors.Errorf("expected State in queue, but got %T", obj)) + // this is a bad entry, we don't want to reprocess + s.queue.Forget(obj) + return true + } + + if err := s.updateState(state); err != nil { + // we don't forget here, because we want this to be retried via the queue + runtime.HandleError(logrus.WithField("obj", obj), err) + s.queue.AddRateLimited(obj) + return true + } + + s.queue.Forget(obj) + return true +} + +// updateState sets the GameServer Status's state to the state +// that has been passed through +func (s *Sidecar) updateState(state stablev1alpha1.State) error { + logrus.WithField("state", state).Info("Updating state") + gameServers := s.gameServerGetter.GameServers(s.namespace) + gs, err := gameServers.Get(s.gameServerName, metav1.GetOptions{}) + if err != nil { + return errors.Wrapf(err, "could not retrieve GameServer %s/%s", s.namespace, s.gameServerName) + } + gs.Status.State = state + _, err = gameServers.Update(gs) + + return errors.Wrapf(err, "could not update GameServer %s/%s to state %s", s.namespace, s.gameServerName, state) +} + +// Ready enters the RequestReady state change for this GameServer into +// the workqueue so it can be updated +func (s *Sidecar) Ready(ctx context.Context, e *sdk.Empty) (*sdk.Empty, error) { + logrus.Info("Received Ready request, adding to queue") + s.queue.AddRateLimited(stablev1alpha1.RequestReady) + return e, nil +} + +// Shutdown enters the Shutdown state change for this GameServer into +// the workqueue so it can be updated +func (s *Sidecar) Shutdown(ctx context.Context, e *sdk.Empty) (*sdk.Empty, error) { + logrus.Info("Received Shutdown request, adding to queue") + s.queue.AddRateLimited(stablev1alpha1.Shutdown) + return e, nil } diff --git a/gameservers/sidecar/sidecar_test.go b/gameservers/sidecar/sidecar_test.go new file mode 100644 index 0000000000..9574603b61 --- /dev/null +++ b/gameservers/sidecar/sidecar_test.go @@ -0,0 +1,95 @@ +// Copyright 2017 Google Inc. All Rights Reserved. +// +// 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 main + +import ( + "testing" + "time" + + "github.com/agonio/agon/gameservers/sidecar/sdk" + "github.com/agonio/agon/pkg/apis/stable/v1alpha1" + "github.com/agonio/agon/pkg/client/clientset/versioned/fake" + "github.com/stretchr/testify/assert" + "golang.org/x/net/context" + "k8s.io/apimachinery/pkg/runtime" + k8stesting "k8s.io/client-go/testing" +) + +func TestSidecarRun(t *testing.T) { + t.Parallel() + + fixtures := map[string]struct { + state v1alpha1.State + f func(*Sidecar, context.Context) + }{ + "ready": { + state: v1alpha1.RequestReady, + f: func(sc *Sidecar, ctx context.Context) { + sc.Ready(ctx, &sdk.Empty{}) + }, + }, + "shutdown": { + state: v1alpha1.Shutdown, + f: func(sc *Sidecar, ctx context.Context) { + sc.Shutdown(ctx, &sdk.Empty{}) + }, + }, + } + + for k, v := range fixtures { + t.Run(k, func(t *testing.T) { + agonClient := &fake.Clientset{} + done := make(chan bool) + + agonClient.AddReactor("get", "gameservers", func(action k8stesting.Action) (bool, runtime.Object, error) { + gs := &v1alpha1.GameServer{ + Status: v1alpha1.GameServerStatus{ + State: v1alpha1.Starting, + }, + } + return true, gs, nil + }) + agonClient.AddReactor("update", "gameservers", func(action k8stesting.Action) (bool, runtime.Object, error) { + defer close(done) + ua := action.(k8stesting.UpdateAction) + gs := ua.GetObject().(*v1alpha1.GameServer) + + assert.Equal(t, v.state, gs.Status.State) + + return true, gs, nil + }) + + sc := &Sidecar{ + gameServerName: "test", + namespace: "default", + gameServerGetter: agonClient.StableV1alpha1(), + } + sc.queue = sc.newWorkQueue() + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + go sc.Run(ctx.Done()) + v.f(sc, ctx) + timeout := time.After(10 * time.Second) + + select { + case <-done: + case <-timeout: + assert.Fail(t, "Timeout on Run") + } + }) + } +} diff --git a/pkg/apis/stable/v1alpha1/types.go b/pkg/apis/stable/v1alpha1/types.go index 80a90004a5..4e77406d1c 100644 --- a/pkg/apis/stable/v1alpha1/types.go +++ b/pkg/apis/stable/v1alpha1/types.go @@ -15,28 +15,38 @@ package v1alpha1 import ( + "github.com/agonio/agon/pkg/apis/stable" "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) const ( - // CreatingState is when the Pod for the GameServer is being created, + // Creating is when the Pod for the GameServer is being created, // but they have yet to register themselves yet as Ready - CreatingState State = "Creating" - // StartingState is for when the Pods for the GameServer are being + Creating State = "Creating" + // Starting is for when the Pods for the GameServer are being // created but have yet to register themselves as Ready - StartingState State = "Starting" - // ReadyState is when a GameServer is ready to take connections + Starting State = "Starting" + // RequestReady is when the GameServer has declared that it is ready + RequestReady State = "RequestReady" + // Ready is when a GameServer is ready to take connections // from Game clients - ReadyState State = "Ready" - - // Error state is when something has gone with the Gameserver and + Ready State = "Ready" + // Shutdown is when the GameServer has shutdown and everything needs to be + // deleted from the cluster + Shutdown State = "Shutdown" + // Error is when something has gone with the Gameserver and // it cannot be resolved - ErrorState State = "Error" + Error State = "Error" + + // Static PortPolicy means that the user defines the hostPort to be used + // in the configuration. + Static PortPolicy = "static" - // StaticPortPolicy is the PortPolicy is defined in the configuration - StaticPortPolicy PortPolicy = "static" + // GameServerPodLabel is the label that the name of the GameServer + // is set on the Pod the GameServer controls + GameServerPodLabel = stable.GroupName + "/gameserver" ) // +genclient @@ -81,7 +91,9 @@ type PortPolicy string // GameServerStatus is the status for a GameServer resource type GameServerStatus struct { // The current state of a GameServer, e.g. Creating, Starting, Ready, etc - State State `json:"state"` + State State `json:"state"` + Port int32 `json:"port"` + Address string `json:"address"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -105,7 +117,7 @@ func (gs *GameServer) ApplyDefaults() { } if gs.Status.State == "" { - gs.Status.State = CreatingState + gs.Status.State = Creating } } @@ -121,3 +133,46 @@ func (gs *GameServer) FindGameServerContainer() (int, corev1.Container, error) { return -1, corev1.Container{}, errors.Errorf("Could not find a container named %s", gs.Spec.Container) } + +// Pod creates a new Pod from the PodTemplateSpec +// attached for the +func (gs *GameServer) Pod(sidecars ...corev1.Container) (*corev1.Pod, error) { + pod := &corev1.Pod{ + ObjectMeta: *gs.Spec.Template.ObjectMeta.DeepCopy(), + Spec: *gs.Spec.Template.Spec.DeepCopy(), + } + // Switch to GenerateName, so that we always get a Unique name for the Pod, and there + // can be no collisions + pod.ObjectMeta.GenerateName = gs.ObjectMeta.Name + "-" + pod.ObjectMeta.Name = "" + // Pods for GameServers need to stay in the same namespace + pod.ObjectMeta.Namespace = gs.ObjectMeta.Namespace + // Make sure these are blank, just in case + pod.ResourceVersion = "" + pod.UID = "" + if pod.ObjectMeta.Labels == nil { + pod.ObjectMeta.Labels = make(map[string]string, 1) + } + pod.ObjectMeta.Labels[stable.GroupName+"/role"] = "gameserver" + // store the GameServer name as a label, for easy lookup later on + pod.ObjectMeta.Labels[GameServerPodLabel] = gs.ObjectMeta.Name + ref := metav1.NewControllerRef(gs, SchemeGroupVersion.WithKind("GameServer")) + pod.ObjectMeta.OwnerReferences = append(pod.ObjectMeta.OwnerReferences, *ref) + + i, gsContainer, err := gs.FindGameServerContainer() + // this shouldn't happen, but if it does. + if err != nil { + return pod, err + } + + cp := corev1.ContainerPort{ + ContainerPort: gs.Spec.ContainerPort, + HostPort: gs.Spec.HostPort, + Protocol: gs.Spec.Protocol, + } + gsContainer.Ports = append(gsContainer.Ports, cp) + pod.Spec.Containers[i] = gsContainer + + pod.Spec.Containers = append(pod.Spec.Containers, sidecars...) + return pod, nil +} diff --git a/pkg/apis/stable/v1alpha1/types_test.go b/pkg/apis/stable/v1alpha1/types_test.go index 1074c1e552..9c7c566964 100644 --- a/pkg/apis/stable/v1alpha1/types_test.go +++ b/pkg/apis/stable/v1alpha1/types_test.go @@ -17,20 +17,23 @@ package v1alpha1 import ( "testing" + "github.com/agonio/agon/pkg/apis/stable" + "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" - "k8s.io/api/core/v1" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) func TestGameServerFindGameServerContainer(t *testing.T) { t.Parallel() - fixture := v1.Container{Name: "mycontainer", Image: "foo/mycontainer"} + fixture := corev1.Container{Name: "mycontainer", Image: "foo/mycontainer"} gs := &GameServer{ Spec: GameServerSpec{ Container: "mycontainer", - Template: v1.PodTemplateSpec{ - Spec: v1.PodSpec{ - Containers: []v1.Container{ + Template: corev1.PodTemplateSpec{ + Spec: corev1.PodSpec{ + Containers: []corev1.Container{ fixture, {Name: "notmycontainer", Image: "foo/notmycontainer"}, }, @@ -42,7 +45,7 @@ func TestGameServerFindGameServerContainer(t *testing.T) { i, container, err := gs.FindGameServerContainer() assert.Nil(t, err) assert.Equal(t, fixture, container) - container.Ports = append(container.Ports, v1.ContainerPort{HostPort: 1234}) + container.Ports = append(container.Ports, corev1.ContainerPort{HostPort: 1234}) gs.Spec.Template.Spec.Containers[i] = container assert.Equal(t, gs.Spec.Template.Spec.Containers[0], container) } @@ -53,25 +56,25 @@ func TestGameServerApplyDefaults(t *testing.T) { data := map[string]struct { gameServer GameServer expectedContainer string - expectedProtocol v1.Protocol + expectedProtocol corev1.Protocol expectedState State }{ "set basic defaults on a very simple gameserver": { gameServer: GameServer{ Spec: GameServerSpec{ - Template: v1.PodTemplateSpec{ - Spec: v1.PodSpec{Containers: []v1.Container{{Name: "testing", Image: "testing/image"}}}}}, + Template: corev1.PodTemplateSpec{ + Spec: corev1.PodSpec{Containers: []corev1.Container{{Name: "testing", Image: "testing/image"}}}}}, }, expectedContainer: "testing", expectedProtocol: "UDP", - expectedState: CreatingState, + expectedState: Creating, }, "defaults are already set": { gameServer: GameServer{ Spec: GameServerSpec{ Container: "testing2", Protocol: "TCP", - Template: v1.PodTemplateSpec{ - Spec: v1.PodSpec{Containers: []v1.Container{ + Template: corev1.PodTemplateSpec{ + Spec: corev1.PodSpec{Containers: []corev1.Container{ {Name: "testing", Image: "testing/image"}, {Name: "testing2", Image: "testing/image2"}}}, }, @@ -94,3 +97,40 @@ func TestGameServerApplyDefaults(t *testing.T) { }) } } + +func TestGameServerPod(t *testing.T) { + fixture := &GameServer{ObjectMeta: metav1.ObjectMeta{Name: "test", Namespace: "default", UID: "1234"}, + Spec: GameServerSpec{ + ContainerPort: 7777, + HostPort: 9999, + PortPolicy: Static, + Template: corev1.PodTemplateSpec{ + Spec: corev1.PodSpec{ + Containers: []corev1.Container{{Name: "container", Image: "container/image"}}, + }, + }, + }, Status: GameServerStatus{State: Creating}} + fixture.ApplyDefaults() + + pod, err := fixture.Pod() + assert.Nil(t, err, "Pod should not return an error") + assert.Equal(t, fixture.ObjectMeta.Name+"-", pod.ObjectMeta.GenerateName) + assert.Equal(t, fixture.ObjectMeta.Namespace, pod.ObjectMeta.Namespace) + assert.Equal(t, "gameserver", pod.ObjectMeta.Labels[stable.GroupName+"/role"]) + assert.Equal(t, fixture.ObjectMeta.Name, pod.ObjectMeta.Labels[GameServerPodLabel]) + assert.True(t, metav1.IsControlledBy(pod, fixture)) + assert.Equal(t, fixture.Spec.HostPort, pod.Spec.Containers[0].Ports[0].HostPort) + assert.Equal(t, fixture.Spec.ContainerPort, pod.Spec.Containers[0].Ports[0].ContainerPort) + assert.Equal(t, corev1.Protocol("UDP"), pod.Spec.Containers[0].Ports[0].Protocol) + logrus.SetFormatter(&logrus.JSONFormatter{}) + assert.True(t, metav1.IsControlledBy(pod, fixture)) + + sidecar := corev1.Container{Name: "sidecar", Image: "container/sidecar"} + pod, err = fixture.Pod(sidecar) + assert.Nil(t, err, "Pod should not return an error") + assert.Equal(t, fixture.ObjectMeta.Name+"-", pod.ObjectMeta.GenerateName) + assert.Len(t, pod.Spec.Containers, 2, "Should have two containers") + assert.Equal(t, "container", pod.Spec.Containers[0].Name) + assert.Equal(t, "sidecar", pod.Spec.Containers[1].Name) + assert.True(t, metav1.IsControlledBy(pod, fixture)) +} diff --git a/pkg/client/clientset/versioned/clientset.go b/pkg/client/clientset/versioned/clientset.go index f99971e437..72518d3f11 100644 --- a/pkg/client/clientset/versioned/clientset.go +++ b/pkg/client/clientset/versioned/clientset.go @@ -16,8 +16,8 @@ package versioned import ( - glog "github.com/golang/glog" stablev1alpha1 "github.com/agonio/agon/pkg/client/clientset/versioned/typed/stable/v1alpha1" + glog "github.com/golang/glog" discovery "k8s.io/client-go/discovery" rest "k8s.io/client-go/rest" flowcontrol "k8s.io/client-go/util/flowcontrol" diff --git a/pkg/util/runtime/runtime.go b/pkg/util/runtime/runtime.go index dc3b4cb6a4..9fa3fdc235 100644 --- a/pkg/util/runtime/runtime.go +++ b/pkg/util/runtime/runtime.go @@ -35,3 +35,10 @@ func HandleError(logger *logrus.Entry, err error) { logger.WithError(err).Error() runtime.HandleError(err) } + +// Must panics if there is an error +func Must(err error) { + if err != nil { + panic(err) + } +} diff --git a/sdk.proto b/sdk.proto new file mode 100644 index 0000000000..505c15bb3b --- /dev/null +++ b/sdk.proto @@ -0,0 +1,28 @@ +// Copyright 2017 Google Inc. All Rights Reserved. +// +// 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 stable.agon.io.sdk; +option go_package = "sdk"; + +// SDK service to be used in the GameServer SDK to the Pod Sidecar +service SDK { + // Call when the GameServer is ready + rpc Ready(Empty) returns (Empty) {} + // Call when the GmaeServer is shutting down + rpc Shutdown(Empty) returns (Empty) {} +} + +message Empty {} diff --git a/sdks/go/sdk.go b/sdks/go/sdk.go new file mode 100644 index 0000000000..7aa458a6f4 --- /dev/null +++ b/sdks/go/sdk.go @@ -0,0 +1,64 @@ +// Copyright 2017 Google Inc. All Rights Reserved. +// +// 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 sdk + +import ( + "fmt" + + "time" + + "github.com/pkg/errors" + "golang.org/x/net/context" + "google.golang.org/grpc" +) + +const port = 59357 + +// SDK is an instance of the Agon SDK +type SDK struct { + client SDKClient + ctx context.Context +} + +// NewSDK starts a new SDK instance, and connects to +// localhost on port 59357. Blocks until connection and handshake are made. +// Times out after 30 seconds. +func NewSDK() (*SDK, error) { + addr := fmt.Sprintf("localhost:%d", port) + s := &SDK{ctx: context.Background()} + // block for at least 30 seconds + ctx, cancel := context.WithTimeout(s.ctx, 30*time.Second) + defer cancel() + conn, err := grpc.DialContext(ctx, addr, grpc.WithBlock(), grpc.WithInsecure()) + if err != nil { + return s, errors.Wrapf(err, "could not connect to %s", addr) + } + s.client = NewSDKClient(conn) + return s, nil +} + +// Ready marks the Game Server as ready to +// receive connections +func (s *SDK) Ready() error { + _, err := s.client.Ready(s.ctx, &Empty{}) + return errors.Wrap(err, "could not send Ready message") +} + +// Shutdown marks the Game Server as ready to +// shutdown +func (s *SDK) Shutdown() error { + _, err := s.client.Shutdown(s.ctx, &Empty{}) + return errors.Wrapf(err, "could not send Shutdown message") +} diff --git a/sdks/go/sdk.pb.go b/sdks/go/sdk.pb.go new file mode 100644 index 0000000000..e80cf7d5e4 --- /dev/null +++ b/sdks/go/sdk.pb.go @@ -0,0 +1,183 @@ +// Copyright 2017 Google Inc. All Rights Reserved. +// +// 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 code was autogenerated. Do not edit directly. +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: sdk.proto + +/* +Package sdk is a generated protocol buffer package. + +It is generated from these files: + sdk.proto + +It has these top-level messages: + Empty +*/ +package sdk + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +type Empty struct { +} + +func (m *Empty) Reset() { *m = Empty{} } +func (m *Empty) String() string { return proto.CompactTextString(m) } +func (*Empty) ProtoMessage() {} +func (*Empty) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func init() { + proto.RegisterType((*Empty)(nil), "stable.agon.io.sdk.Empty") +} + +// 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 + +// Client API for SDK service + +type SDKClient interface { + // Call when the GameServer is ready + Ready(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) + // Call when the GmaeServer is shutting down + Shutdown(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) +} + +type sDKClient struct { + cc *grpc.ClientConn +} + +func NewSDKClient(cc *grpc.ClientConn) SDKClient { + return &sDKClient{cc} +} + +func (c *sDKClient) Ready(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) { + out := new(Empty) + err := grpc.Invoke(ctx, "/stable.agon.io.sdk.SDK/Ready", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *sDKClient) Shutdown(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) { + out := new(Empty) + err := grpc.Invoke(ctx, "/stable.agon.io.sdk.SDK/Shutdown", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for SDK service + +type SDKServer interface { + // Call when the GameServer is ready + Ready(context.Context, *Empty) (*Empty, error) + // Call when the GmaeServer is shutting down + Shutdown(context.Context, *Empty) (*Empty, error) +} + +func RegisterSDKServer(s *grpc.Server, srv SDKServer) { + s.RegisterService(&_SDK_serviceDesc, srv) +} + +func _SDK_Ready_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SDKServer).Ready(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/stable.agon.io.sdk.SDK/Ready", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SDKServer).Ready(ctx, req.(*Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _SDK_Shutdown_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SDKServer).Shutdown(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/stable.agon.io.sdk.SDK/Shutdown", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SDKServer).Shutdown(ctx, req.(*Empty)) + } + return interceptor(ctx, in, info, handler) +} + +var _SDK_serviceDesc = grpc.ServiceDesc{ + ServiceName: "stable.agon.io.sdk.SDK", + HandlerType: (*SDKServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Ready", + Handler: _SDK_Ready_Handler, + }, + { + MethodName: "Shutdown", + Handler: _SDK_Shutdown_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "sdk.proto", +} + +func init() { proto.RegisterFile("sdk.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 121 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2c, 0x4e, 0xc9, 0xd6, + 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x2a, 0x2e, 0x49, 0x4c, 0xca, 0x49, 0xd5, 0x4b, 0x4c, + 0xcf, 0xcf, 0xd3, 0xcb, 0xcc, 0xd7, 0x2b, 0x4e, 0xc9, 0x56, 0x62, 0xe7, 0x62, 0x75, 0xcd, 0x2d, + 0x28, 0xa9, 0x34, 0xea, 0x62, 0xe4, 0x62, 0x0e, 0x76, 0xf1, 0x16, 0xb2, 0xe7, 0x62, 0x0d, 0x4a, + 0x4d, 0x4c, 0xa9, 0x14, 0x92, 0xd4, 0xc3, 0x54, 0xae, 0x07, 0x56, 0x2b, 0x85, 0x5b, 0x4a, 0x89, + 0x41, 0xc8, 0x89, 0x8b, 0x23, 0x38, 0xa3, 0xb4, 0x24, 0x25, 0xbf, 0x3c, 0x8f, 0x5c, 0x33, 0x9c, + 0x58, 0xa3, 0x98, 0x8b, 0x53, 0xb2, 0x93, 0xd8, 0xc0, 0xee, 0x36, 0x06, 0x04, 0x00, 0x00, 0xff, + 0xff, 0x0f, 0xb4, 0x24, 0x6b, 0xc4, 0x00, 0x00, 0x00, +} diff --git a/sdks/go/sdk_test.go b/sdks/go/sdk_test.go new file mode 100644 index 0000000000..bcd81aaad0 --- /dev/null +++ b/sdks/go/sdk_test.go @@ -0,0 +1,59 @@ +// Copyright 2017 Google Inc. All Rights Reserved. +// +// 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 sdk + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "golang.org/x/net/context" + "google.golang.org/grpc" +) + +func TestSDK(t *testing.T) { + m := &mock{} + s := SDK{ + ctx: context.Background(), + client: m, + } + //gate + assert.False(t, m.ready) + assert.False(t, m.shutdown) + + s.Ready() + assert.True(t, m.ready) + assert.False(t, m.shutdown) + + s.Shutdown() + assert.True(t, m.ready) + assert.True(t, m.shutdown) +} + +var _ SDKClient = &mock{} + +type mock struct { + ready bool + shutdown bool +} + +func (m *mock) Ready(ctx context.Context, e *Empty, opts ...grpc.CallOption) (*Empty, error) { + m.ready = true + return e, nil +} + +func (m *mock) Shutdown(ctx context.Context, e *Empty, opts ...grpc.CallOption) (*Empty, error) { + m.shutdown = true + return e, nil +} diff --git a/vendor/github.com/fsnotify/fsnotify/.gitignore b/vendor/github.com/fsnotify/fsnotify/.gitignore new file mode 100644 index 0000000000..4cd0cbaf43 --- /dev/null +++ b/vendor/github.com/fsnotify/fsnotify/.gitignore @@ -0,0 +1,6 @@ +# Setup a Global .gitignore for OS and editor generated files: +# https://help.github.com/articles/ignoring-files +# git config --global core.excludesfile ~/.gitignore_global + +.vagrant +*.sublime-project diff --git a/vendor/github.com/fsnotify/fsnotify/AUTHORS b/vendor/github.com/fsnotify/fsnotify/AUTHORS new file mode 100644 index 0000000000..0a5bf8f617 --- /dev/null +++ b/vendor/github.com/fsnotify/fsnotify/AUTHORS @@ -0,0 +1,46 @@ +# Names should be added to this file as +# Name or Organization +# The email address is not required for organizations. + +# You can update this list using the following command: +# +# $ git shortlog -se | awk '{print $2 " " $3 " " $4}' + +# Please keep the list sorted. + +Adrien Bustany +Amit Krishnan +Bjørn Erik Pedersen +Bruno Bigras +Caleb Spare +Case Nelson +Chris Howey +Christoffer Buchholz +Daniel Wagner-Hall +Dave Cheney +Evan Phoenix +Francisco Souza +Hari haran +John C Barstow +Kelvin Fo +Ken-ichirou MATSUZAWA +Matt Layher +Nathan Youngman +Patrick +Paul Hammond +Pawel Knap +Pieter Droogendijk +Pursuit92 +Riku Voipio +Rob Figueiredo +Slawek Ligus +Soge Zhang +Tiffany Jernigan +Tilak Sharma +Travis Cline +Tudor Golubenco +Yukang +bronze1man +debrando +henrikedwards +铁哥 diff --git a/vendor/github.com/fsnotify/fsnotify/CHANGELOG.md b/vendor/github.com/fsnotify/fsnotify/CHANGELOG.md new file mode 100644 index 0000000000..40d7660d58 --- /dev/null +++ b/vendor/github.com/fsnotify/fsnotify/CHANGELOG.md @@ -0,0 +1,307 @@ +# Changelog + +## v1.4.2 / 2016-10-10 + +* Linux: use InotifyInit1 with IN_CLOEXEC to stop leaking a file descriptor to a child process when using fork/exec [#178](https://github.com/fsnotify/fsnotify/pull/178) (thanks @pattyshack) + +## v1.4.1 / 2016-10-04 + +* Fix flaky inotify stress test on Linux [#177](https://github.com/fsnotify/fsnotify/pull/177) (thanks @pattyshack) + +## v1.4.0 / 2016-10-01 + +* add a String() method to Event.Op [#165](https://github.com/fsnotify/fsnotify/pull/165) (thanks @oozie) + +## v1.3.1 / 2016-06-28 + +* Windows: fix for double backslash when watching the root of a drive [#151](https://github.com/fsnotify/fsnotify/issues/151) (thanks @brunoqc) + +## v1.3.0 / 2016-04-19 + +* Support linux/arm64 by [patching](https://go-review.googlesource.com/#/c/21971/) x/sys/unix and switching to to it from syscall (thanks @suihkulokki) [#135](https://github.com/fsnotify/fsnotify/pull/135) + +## v1.2.10 / 2016-03-02 + +* Fix golint errors in windows.go [#121](https://github.com/fsnotify/fsnotify/pull/121) (thanks @tiffanyfj) + +## v1.2.9 / 2016-01-13 + +kqueue: Fix logic for CREATE after REMOVE [#111](https://github.com/fsnotify/fsnotify/pull/111) (thanks @bep) + +## v1.2.8 / 2015-12-17 + +* kqueue: fix race condition in Close [#105](https://github.com/fsnotify/fsnotify/pull/105) (thanks @djui for reporting the issue and @ppknap for writing a failing test) +* inotify: fix race in test +* enable race detection for continuous integration (Linux, Mac, Windows) + +## v1.2.5 / 2015-10-17 + +* inotify: use epoll_create1 for arm64 support (requires Linux 2.6.27 or later) [#100](https://github.com/fsnotify/fsnotify/pull/100) (thanks @suihkulokki) +* inotify: fix path leaks [#73](https://github.com/fsnotify/fsnotify/pull/73) (thanks @chamaken) +* kqueue: watch for rename events on subdirectories [#83](https://github.com/fsnotify/fsnotify/pull/83) (thanks @guotie) +* kqueue: avoid infinite loops from symlinks cycles [#101](https://github.com/fsnotify/fsnotify/pull/101) (thanks @illicitonion) + +## v1.2.1 / 2015-10-14 + +* kqueue: don't watch named pipes [#98](https://github.com/fsnotify/fsnotify/pull/98) (thanks @evanphx) + +## v1.2.0 / 2015-02-08 + +* inotify: use epoll to wake up readEvents [#66](https://github.com/fsnotify/fsnotify/pull/66) (thanks @PieterD) +* inotify: closing watcher should now always shut down goroutine [#63](https://github.com/fsnotify/fsnotify/pull/63) (thanks @PieterD) +* kqueue: close kqueue after removing watches, fixes [#59](https://github.com/fsnotify/fsnotify/issues/59) + +## v1.1.1 / 2015-02-05 + +* inotify: Retry read on EINTR [#61](https://github.com/fsnotify/fsnotify/issues/61) (thanks @PieterD) + +## v1.1.0 / 2014-12-12 + +* kqueue: rework internals [#43](https://github.com/fsnotify/fsnotify/pull/43) + * add low-level functions + * only need to store flags on directories + * less mutexes [#13](https://github.com/fsnotify/fsnotify/issues/13) + * done can be an unbuffered channel + * remove calls to os.NewSyscallError +* More efficient string concatenation for Event.String() [#52](https://github.com/fsnotify/fsnotify/pull/52) (thanks @mdlayher) +* kqueue: fix regression in rework causing subdirectories to be watched [#48](https://github.com/fsnotify/fsnotify/issues/48) +* kqueue: cleanup internal watch before sending remove event [#51](https://github.com/fsnotify/fsnotify/issues/51) + +## v1.0.4 / 2014-09-07 + +* kqueue: add dragonfly to the build tags. +* Rename source code files, rearrange code so exported APIs are at the top. +* Add done channel to example code. [#37](https://github.com/fsnotify/fsnotify/pull/37) (thanks @chenyukang) + +## v1.0.3 / 2014-08-19 + +* [Fix] Windows MOVED_TO now translates to Create like on BSD and Linux. [#36](https://github.com/fsnotify/fsnotify/issues/36) + +## v1.0.2 / 2014-08-17 + +* [Fix] Missing create events on OS X. [#14](https://github.com/fsnotify/fsnotify/issues/14) (thanks @zhsso) +* [Fix] Make ./path and path equivalent. (thanks @zhsso) + +## v1.0.0 / 2014-08-15 + +* [API] Remove AddWatch on Windows, use Add. +* Improve documentation for exported identifiers. [#30](https://github.com/fsnotify/fsnotify/issues/30) +* Minor updates based on feedback from golint. + +## dev / 2014-07-09 + +* Moved to [github.com/fsnotify/fsnotify](https://github.com/fsnotify/fsnotify). +* Use os.NewSyscallError instead of returning errno (thanks @hariharan-uno) + +## dev / 2014-07-04 + +* kqueue: fix incorrect mutex used in Close() +* Update example to demonstrate usage of Op. + +## dev / 2014-06-28 + +* [API] Don't set the Write Op for attribute notifications [#4](https://github.com/fsnotify/fsnotify/issues/4) +* Fix for String() method on Event (thanks Alex Brainman) +* Don't build on Plan 9 or Solaris (thanks @4ad) + +## dev / 2014-06-21 + +* Events channel of type Event rather than *Event. +* [internal] use syscall constants directly for inotify and kqueue. +* [internal] kqueue: rename events to kevents and fileEvent to event. + +## dev / 2014-06-19 + +* Go 1.3+ required on Windows (uses syscall.ERROR_MORE_DATA internally). +* [internal] remove cookie from Event struct (unused). +* [internal] Event struct has the same definition across every OS. +* [internal] remove internal watch and removeWatch methods. + +## dev / 2014-06-12 + +* [API] Renamed Watch() to Add() and RemoveWatch() to Remove(). +* [API] Pluralized channel names: Events and Errors. +* [API] Renamed FileEvent struct to Event. +* [API] Op constants replace methods like IsCreate(). + +## dev / 2014-06-12 + +* Fix data race on kevent buffer (thanks @tilaks) [#98](https://github.com/howeyc/fsnotify/pull/98) + +## dev / 2014-05-23 + +* [API] Remove current implementation of WatchFlags. + * current implementation doesn't take advantage of OS for efficiency + * provides little benefit over filtering events as they are received, but has extra bookkeeping and mutexes + * no tests for the current implementation + * not fully implemented on Windows [#93](https://github.com/howeyc/fsnotify/issues/93#issuecomment-39285195) + +## v0.9.3 / 2014-12-31 + +* kqueue: cleanup internal watch before sending remove event [#51](https://github.com/fsnotify/fsnotify/issues/51) + +## v0.9.2 / 2014-08-17 + +* [Backport] Fix missing create events on OS X. [#14](https://github.com/fsnotify/fsnotify/issues/14) (thanks @zhsso) + +## v0.9.1 / 2014-06-12 + +* Fix data race on kevent buffer (thanks @tilaks) [#98](https://github.com/howeyc/fsnotify/pull/98) + +## v0.9.0 / 2014-01-17 + +* IsAttrib() for events that only concern a file's metadata [#79][] (thanks @abustany) +* [Fix] kqueue: fix deadlock [#77][] (thanks @cespare) +* [NOTICE] Development has moved to `code.google.com/p/go.exp/fsnotify` in preparation for inclusion in the Go standard library. + +## v0.8.12 / 2013-11-13 + +* [API] Remove FD_SET and friends from Linux adapter + +## v0.8.11 / 2013-11-02 + +* [Doc] Add Changelog [#72][] (thanks @nathany) +* [Doc] Spotlight and double modify events on OS X [#62][] (reported by @paulhammond) + +## v0.8.10 / 2013-10-19 + +* [Fix] kqueue: remove file watches when parent directory is removed [#71][] (reported by @mdwhatcott) +* [Fix] kqueue: race between Close and readEvents [#70][] (reported by @bernerdschaefer) +* [Doc] specify OS-specific limits in README (thanks @debrando) + +## v0.8.9 / 2013-09-08 + +* [Doc] Contributing (thanks @nathany) +* [Doc] update package path in example code [#63][] (thanks @paulhammond) +* [Doc] GoCI badge in README (Linux only) [#60][] +* [Doc] Cross-platform testing with Vagrant [#59][] (thanks @nathany) + +## v0.8.8 / 2013-06-17 + +* [Fix] Windows: handle `ERROR_MORE_DATA` on Windows [#49][] (thanks @jbowtie) + +## v0.8.7 / 2013-06-03 + +* [API] Make syscall flags internal +* [Fix] inotify: ignore event changes +* [Fix] race in symlink test [#45][] (reported by @srid) +* [Fix] tests on Windows +* lower case error messages + +## v0.8.6 / 2013-05-23 + +* kqueue: Use EVT_ONLY flag on Darwin +* [Doc] Update README with full example + +## v0.8.5 / 2013-05-09 + +* [Fix] inotify: allow monitoring of "broken" symlinks (thanks @tsg) + +## v0.8.4 / 2013-04-07 + +* [Fix] kqueue: watch all file events [#40][] (thanks @ChrisBuchholz) + +## v0.8.3 / 2013-03-13 + +* [Fix] inoitfy/kqueue memory leak [#36][] (reported by @nbkolchin) +* [Fix] kqueue: use fsnFlags for watching a directory [#33][] (reported by @nbkolchin) + +## v0.8.2 / 2013-02-07 + +* [Doc] add Authors +* [Fix] fix data races for map access [#29][] (thanks @fsouza) + +## v0.8.1 / 2013-01-09 + +* [Fix] Windows path separators +* [Doc] BSD License + +## v0.8.0 / 2012-11-09 + +* kqueue: directory watching improvements (thanks @vmirage) +* inotify: add `IN_MOVED_TO` [#25][] (requested by @cpisto) +* [Fix] kqueue: deleting watched directory [#24][] (reported by @jakerr) + +## v0.7.4 / 2012-10-09 + +* [Fix] inotify: fixes from https://codereview.appspot.com/5418045/ (ugorji) +* [Fix] kqueue: preserve watch flags when watching for delete [#21][] (reported by @robfig) +* [Fix] kqueue: watch the directory even if it isn't a new watch (thanks @robfig) +* [Fix] kqueue: modify after recreation of file + +## v0.7.3 / 2012-09-27 + +* [Fix] kqueue: watch with an existing folder inside the watched folder (thanks @vmirage) +* [Fix] kqueue: no longer get duplicate CREATE events + +## v0.7.2 / 2012-09-01 + +* kqueue: events for created directories + +## v0.7.1 / 2012-07-14 + +* [Fix] for renaming files + +## v0.7.0 / 2012-07-02 + +* [Feature] FSNotify flags +* [Fix] inotify: Added file name back to event path + +## v0.6.0 / 2012-06-06 + +* kqueue: watch files after directory created (thanks @tmc) + +## v0.5.1 / 2012-05-22 + +* [Fix] inotify: remove all watches before Close() + +## v0.5.0 / 2012-05-03 + +* [API] kqueue: return errors during watch instead of sending over channel +* kqueue: match symlink behavior on Linux +* inotify: add `DELETE_SELF` (requested by @taralx) +* [Fix] kqueue: handle EINTR (reported by @robfig) +* [Doc] Godoc example [#1][] (thanks @davecheney) + +## v0.4.0 / 2012-03-30 + +* Go 1 released: build with go tool +* [Feature] Windows support using winfsnotify +* Windows does not have attribute change notifications +* Roll attribute notifications into IsModify + +## v0.3.0 / 2012-02-19 + +* kqueue: add files when watch directory + +## v0.2.0 / 2011-12-30 + +* update to latest Go weekly code + +## v0.1.0 / 2011-10-19 + +* kqueue: add watch on file creation to match inotify +* kqueue: create file event +* inotify: ignore `IN_IGNORED` events +* event String() +* linux: common FileEvent functions +* initial commit + +[#79]: https://github.com/howeyc/fsnotify/pull/79 +[#77]: https://github.com/howeyc/fsnotify/pull/77 +[#72]: https://github.com/howeyc/fsnotify/issues/72 +[#71]: https://github.com/howeyc/fsnotify/issues/71 +[#70]: https://github.com/howeyc/fsnotify/issues/70 +[#63]: https://github.com/howeyc/fsnotify/issues/63 +[#62]: https://github.com/howeyc/fsnotify/issues/62 +[#60]: https://github.com/howeyc/fsnotify/issues/60 +[#59]: https://github.com/howeyc/fsnotify/issues/59 +[#49]: https://github.com/howeyc/fsnotify/issues/49 +[#45]: https://github.com/howeyc/fsnotify/issues/45 +[#40]: https://github.com/howeyc/fsnotify/issues/40 +[#36]: https://github.com/howeyc/fsnotify/issues/36 +[#33]: https://github.com/howeyc/fsnotify/issues/33 +[#29]: https://github.com/howeyc/fsnotify/issues/29 +[#25]: https://github.com/howeyc/fsnotify/issues/25 +[#24]: https://github.com/howeyc/fsnotify/issues/24 +[#21]: https://github.com/howeyc/fsnotify/issues/21 diff --git a/vendor/github.com/fsnotify/fsnotify/CONTRIBUTING.md b/vendor/github.com/fsnotify/fsnotify/CONTRIBUTING.md new file mode 100644 index 0000000000..6a81ba4890 --- /dev/null +++ b/vendor/github.com/fsnotify/fsnotify/CONTRIBUTING.md @@ -0,0 +1,77 @@ +# Contributing + +## Issues + +* Request features and report bugs using the [GitHub Issue Tracker](https://github.com/fsnotify/fsnotify/issues). +* Please indicate the platform you are using fsnotify on. +* A code example to reproduce the problem is appreciated. + +## Pull Requests + +### Contributor License Agreement + +fsnotify is derived from code in the [golang.org/x/exp](https://godoc.org/golang.org/x/exp) package and it may be included [in the standard library](https://github.com/fsnotify/fsnotify/issues/1) in the future. Therefore fsnotify carries the same [LICENSE](https://github.com/fsnotify/fsnotify/blob/master/LICENSE) as Go. Contributors retain their copyright, so you need to fill out a short form before we can accept your contribution: [Google Individual Contributor License Agreement](https://developers.google.com/open-source/cla/individual). + +Please indicate that you have signed the CLA in your pull request. + +### How fsnotify is Developed + +* Development is done on feature branches. +* Tests are run on BSD, Linux, OS X and Windows. +* Pull requests are reviewed and [applied to master][am] using [hub][]. + * Maintainers may modify or squash commits rather than asking contributors to. +* To issue a new release, the maintainers will: + * Update the CHANGELOG + * Tag a version, which will become available through gopkg.in. + +### How to Fork + +For smooth sailing, always use the original import path. Installing with `go get` makes this easy. + +1. Install from GitHub (`go get -u github.com/fsnotify/fsnotify`) +2. Create your feature branch (`git checkout -b my-new-feature`) +3. Ensure everything works and the tests pass (see below) +4. Commit your changes (`git commit -am 'Add some feature'`) + +Contribute upstream: + +1. Fork fsnotify on GitHub +2. Add your remote (`git remote add fork git@github.com:mycompany/repo.git`) +3. Push to the branch (`git push fork my-new-feature`) +4. Create a new Pull Request on GitHub + +This workflow is [thoroughly explained by Katrina Owen](https://splice.com/blog/contributing-open-source-git-repositories-go/). + +### Testing + +fsnotify uses build tags to compile different code on Linux, BSD, OS X, and Windows. + +Before doing a pull request, please do your best to test your changes on multiple platforms, and list which platforms you were able/unable to test on. + +To aid in cross-platform testing there is a Vagrantfile for Linux and BSD. + +* Install [Vagrant](http://www.vagrantup.com/) and [VirtualBox](https://www.virtualbox.org/) +* Setup [Vagrant Gopher](https://github.com/nathany/vagrant-gopher) in your `src` folder. +* Run `vagrant up` from the project folder. You can also setup just one box with `vagrant up linux` or `vagrant up bsd` (note: the BSD box doesn't support Windows hosts at this time, and NFS may prompt for your host OS password) +* Once setup, you can run the test suite on a given OS with a single command `vagrant ssh linux -c 'cd fsnotify/fsnotify; go test'`. +* When you're done, you will want to halt or destroy the Vagrant boxes. + +Notice: fsnotify file system events won't trigger in shared folders. The tests get around this limitation by using the /tmp directory. + +Right now there is no equivalent solution for Windows and OS X, but there are Windows VMs [freely available from Microsoft](http://www.modern.ie/en-us/virtualization-tools#downloads). + +### Maintainers + +Help maintaining fsnotify is welcome. To be a maintainer: + +* Submit a pull request and sign the CLA as above. +* You must be able to run the test suite on Mac, Windows, Linux and BSD. + +To keep master clean, the fsnotify project uses the "apply mail" workflow outlined in Nathaniel Talbott's post ["Merge pull request" Considered Harmful][am]. This requires installing [hub][]. + +All code changes should be internal pull requests. + +Releases are tagged using [Semantic Versioning](http://semver.org/). + +[hub]: https://github.com/github/hub +[am]: http://blog.spreedly.com/2014/06/24/merge-pull-request-considered-harmful/#.VGa5yZPF_Zs diff --git a/vendor/github.com/fsnotify/fsnotify/LICENSE b/vendor/github.com/fsnotify/fsnotify/LICENSE new file mode 100644 index 0000000000..f21e540800 --- /dev/null +++ b/vendor/github.com/fsnotify/fsnotify/LICENSE @@ -0,0 +1,28 @@ +Copyright (c) 2012 The Go Authors. All rights reserved. +Copyright (c) 2012 fsnotify 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/fsnotify/fsnotify/README.md b/vendor/github.com/fsnotify/fsnotify/README.md new file mode 100644 index 0000000000..3c891e349b --- /dev/null +++ b/vendor/github.com/fsnotify/fsnotify/README.md @@ -0,0 +1,50 @@ +# File system notifications for Go + +[![GoDoc](https://godoc.org/github.com/fsnotify/fsnotify?status.svg)](https://godoc.org/github.com/fsnotify/fsnotify) [![Go Report Card](https://goreportcard.com/badge/github.com/fsnotify/fsnotify)](https://goreportcard.com/report/github.com/fsnotify/fsnotify) + +fsnotify utilizes [golang.org/x/sys](https://godoc.org/golang.org/x/sys) rather than `syscall` from the standard library. Ensure you have the latest version installed by running: + +```console +go get -u golang.org/x/sys/... +``` + +Cross platform: Windows, Linux, BSD and OS X. + +|Adapter |OS |Status | +|----------|----------|----------| +|inotify |Linux 2.6.27 or later, Android\*|Supported [![Build Status](https://travis-ci.org/fsnotify/fsnotify.svg?branch=master)](https://travis-ci.org/fsnotify/fsnotify)| +|kqueue |BSD, OS X, iOS\*|Supported [![Build Status](https://travis-ci.org/fsnotify/fsnotify.svg?branch=master)](https://travis-ci.org/fsnotify/fsnotify)| +|ReadDirectoryChangesW|Windows|Supported [![Build status](https://ci.appveyor.com/api/projects/status/ivwjubaih4r0udeh/branch/master?svg=true)](https://ci.appveyor.com/project/NathanYoungman/fsnotify/branch/master)| +|FSEvents |OS X |[Planned](https://github.com/fsnotify/fsnotify/issues/11)| +|FEN |Solaris 11 |[In Progress](https://github.com/fsnotify/fsnotify/issues/12)| +|fanotify |Linux 2.6.37+ | | +|USN Journals |Windows |[Maybe](https://github.com/fsnotify/fsnotify/issues/53)| +|Polling |*All* |[Maybe](https://github.com/fsnotify/fsnotify/issues/9)| + +\* Android and iOS are untested. + +Please see [the documentation](https://godoc.org/github.com/fsnotify/fsnotify) for usage. Consult the [Wiki](https://github.com/fsnotify/fsnotify/wiki) for the FAQ and further information. + +## API stability + +fsnotify is a fork of [howeyc/fsnotify](https://godoc.org/github.com/howeyc/fsnotify) with a new API as of v1.0. The API is based on [this design document](http://goo.gl/MrYxyA). + +All [releases](https://github.com/fsnotify/fsnotify/releases) are tagged based on [Semantic Versioning](http://semver.org/). Further API changes are [planned](https://github.com/fsnotify/fsnotify/milestones), and will be tagged with a new major revision number. + +Go 1.6 supports dependencies located in the `vendor/` folder. Unless you are creating a library, it is recommended that you copy fsnotify into `vendor/github.com/fsnotify/fsnotify` within your project, and likewise for `golang.org/x/sys`. + +## Contributing + +Please refer to [CONTRIBUTING][] before opening an issue or pull request. + +## Example + +See [example_test.go](https://github.com/fsnotify/fsnotify/blob/master/example_test.go). + +[contributing]: https://github.com/fsnotify/fsnotify/blob/master/CONTRIBUTING.md + +## Related Projects + +* [notify](https://github.com/rjeczalik/notify) +* [fsevents](https://github.com/fsnotify/fsevents) + diff --git a/vendor/github.com/fsnotify/fsnotify/example_test.go b/vendor/github.com/fsnotify/fsnotify/example_test.go new file mode 100644 index 0000000000..700502cb3a --- /dev/null +++ b/vendor/github.com/fsnotify/fsnotify/example_test.go @@ -0,0 +1,42 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !plan9 + +package fsnotify_test + +import ( + "log" + + "github.com/fsnotify/fsnotify" +) + +func ExampleNewWatcher() { + watcher, err := fsnotify.NewWatcher() + if err != nil { + log.Fatal(err) + } + defer watcher.Close() + + done := make(chan bool) + go func() { + for { + select { + case event := <-watcher.Events: + log.Println("event:", event) + if event.Op&fsnotify.Write == fsnotify.Write { + log.Println("modified file:", event.Name) + } + case err := <-watcher.Errors: + log.Println("error:", err) + } + } + }() + + err = watcher.Add("/tmp/foo") + if err != nil { + log.Fatal(err) + } + <-done +} diff --git a/vendor/github.com/fsnotify/fsnotify/fen.go b/vendor/github.com/fsnotify/fsnotify/fen.go new file mode 100644 index 0000000000..ced39cb881 --- /dev/null +++ b/vendor/github.com/fsnotify/fsnotify/fen.go @@ -0,0 +1,37 @@ +// 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. + +// +build solaris + +package fsnotify + +import ( + "errors" +) + +// Watcher watches a set of files, delivering events to a channel. +type Watcher struct { + Events chan Event + Errors chan error +} + +// NewWatcher establishes a new watcher with the underlying OS and begins waiting for events. +func NewWatcher() (*Watcher, error) { + return nil, errors.New("FEN based watcher not yet supported for fsnotify\n") +} + +// Close removes all watches and closes the events channel. +func (w *Watcher) Close() error { + return nil +} + +// Add starts watching the named file or directory (non-recursively). +func (w *Watcher) Add(name string) error { + return nil +} + +// Remove stops watching the the named file or directory (non-recursively). +func (w *Watcher) Remove(name string) error { + return nil +} diff --git a/vendor/github.com/fsnotify/fsnotify/fsnotify.go b/vendor/github.com/fsnotify/fsnotify/fsnotify.go new file mode 100644 index 0000000000..e7f55fee7a --- /dev/null +++ b/vendor/github.com/fsnotify/fsnotify/fsnotify.go @@ -0,0 +1,62 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !plan9 + +// Package fsnotify provides a platform-independent interface for file system notifications. +package fsnotify + +import ( + "bytes" + "fmt" +) + +// Event represents a single file system notification. +type Event struct { + Name string // Relative path to the file or directory. + Op Op // File operation that triggered the event. +} + +// Op describes a set of file operations. +type Op uint32 + +// These are the generalized file operations that can trigger a notification. +const ( + Create Op = 1 << iota + Write + Remove + Rename + Chmod +) + +func (op Op) String() string { + // Use a buffer for efficient string concatenation + var buffer bytes.Buffer + + if op&Create == Create { + buffer.WriteString("|CREATE") + } + if op&Remove == Remove { + buffer.WriteString("|REMOVE") + } + if op&Write == Write { + buffer.WriteString("|WRITE") + } + if op&Rename == Rename { + buffer.WriteString("|RENAME") + } + if op&Chmod == Chmod { + buffer.WriteString("|CHMOD") + } + if buffer.Len() == 0 { + return "" + } + return buffer.String()[1:] // Strip leading pipe +} + +// String returns a string representation of the event in the form +// "file: REMOVE|WRITE|..." +func (e Event) String() string { + return fmt.Sprintf("%q: %s", e.Name, e.Op.String()) +} diff --git a/vendor/github.com/fsnotify/fsnotify/fsnotify_test.go b/vendor/github.com/fsnotify/fsnotify/fsnotify_test.go new file mode 100644 index 0000000000..9d6d72afc5 --- /dev/null +++ b/vendor/github.com/fsnotify/fsnotify/fsnotify_test.go @@ -0,0 +1,40 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !plan9 + +package fsnotify + +import "testing" + +func TestEventStringWithValue(t *testing.T) { + for opMask, expectedString := range map[Op]string{ + Chmod | Create: `"/usr/someFile": CREATE|CHMOD`, + Rename: `"/usr/someFile": RENAME`, + Remove: `"/usr/someFile": REMOVE`, + Write | Chmod: `"/usr/someFile": WRITE|CHMOD`, + } { + event := Event{Name: "/usr/someFile", Op: opMask} + if event.String() != expectedString { + t.Fatalf("Expected %s, got: %v", expectedString, event.String()) + } + + } +} + +func TestEventOpStringWithValue(t *testing.T) { + expectedOpString := "WRITE|CHMOD" + event := Event{Name: "someFile", Op: Write | Chmod} + if event.Op.String() != expectedOpString { + t.Fatalf("Expected %s, got: %v", expectedOpString, event.Op.String()) + } +} + +func TestEventOpStringWithNoValue(t *testing.T) { + expectedOpString := "" + event := Event{Name: "testFile", Op: 0} + if event.Op.String() != expectedOpString { + t.Fatalf("Expected %s, got: %v", expectedOpString, event.Op.String()) + } +} diff --git a/vendor/github.com/fsnotify/fsnotify/inotify.go b/vendor/github.com/fsnotify/fsnotify/inotify.go new file mode 100644 index 0000000000..f3b74c51f0 --- /dev/null +++ b/vendor/github.com/fsnotify/fsnotify/inotify.go @@ -0,0 +1,325 @@ +// 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. + +// +build linux + +package fsnotify + +import ( + "errors" + "fmt" + "io" + "os" + "path/filepath" + "strings" + "sync" + "unsafe" + + "golang.org/x/sys/unix" +) + +// Watcher watches a set of files, delivering events to a channel. +type Watcher struct { + Events chan Event + Errors chan error + mu sync.Mutex // Map access + cv *sync.Cond // sync removing on rm_watch with IN_IGNORE + fd int + poller *fdPoller + watches map[string]*watch // Map of inotify watches (key: path) + paths map[int]string // Map of watched paths (key: watch descriptor) + done chan struct{} // Channel for sending a "quit message" to the reader goroutine + doneResp chan struct{} // Channel to respond to Close +} + +// NewWatcher establishes a new watcher with the underlying OS and begins waiting for events. +func NewWatcher() (*Watcher, error) { + // Create inotify fd + fd, errno := unix.InotifyInit1(unix.IN_CLOEXEC) + if fd == -1 { + return nil, errno + } + // Create epoll + poller, err := newFdPoller(fd) + if err != nil { + unix.Close(fd) + return nil, err + } + w := &Watcher{ + fd: fd, + poller: poller, + watches: make(map[string]*watch), + paths: make(map[int]string), + Events: make(chan Event), + Errors: make(chan error), + done: make(chan struct{}), + doneResp: make(chan struct{}), + } + w.cv = sync.NewCond(&w.mu) + + go w.readEvents() + return w, nil +} + +func (w *Watcher) isClosed() bool { + select { + case <-w.done: + return true + default: + return false + } +} + +// Close removes all watches and closes the events channel. +func (w *Watcher) Close() error { + if w.isClosed() { + return nil + } + + // Send 'close' signal to goroutine, and set the Watcher to closed. + close(w.done) + + // Wake up goroutine + w.poller.wake() + + // Wait for goroutine to close + <-w.doneResp + + return nil +} + +// Add starts watching the named file or directory (non-recursively). +func (w *Watcher) Add(name string) error { + name = filepath.Clean(name) + if w.isClosed() { + return errors.New("inotify instance already closed") + } + + const agnosticEvents = unix.IN_MOVED_TO | unix.IN_MOVED_FROM | + unix.IN_CREATE | unix.IN_ATTRIB | unix.IN_MODIFY | + unix.IN_MOVE_SELF | unix.IN_DELETE | unix.IN_DELETE_SELF + + var flags uint32 = agnosticEvents + + w.mu.Lock() + watchEntry, found := w.watches[name] + w.mu.Unlock() + if found { + watchEntry.flags |= flags + flags |= unix.IN_MASK_ADD + } + wd, errno := unix.InotifyAddWatch(w.fd, name, flags) + if wd == -1 { + return errno + } + + w.mu.Lock() + w.watches[name] = &watch{wd: uint32(wd), flags: flags} + w.paths[wd] = name + w.mu.Unlock() + + return nil +} + +// Remove stops watching the named file or directory (non-recursively). +func (w *Watcher) Remove(name string) error { + name = filepath.Clean(name) + + // Fetch the watch. + w.mu.Lock() + defer w.mu.Unlock() + watch, ok := w.watches[name] + + // Remove it from inotify. + if !ok { + return fmt.Errorf("can't remove non-existent inotify watch for: %s", name) + } + // inotify_rm_watch will return EINVAL if the file has been deleted; + // the inotify will already have been removed. + // watches and pathes are deleted in ignoreLinux() implicitly and asynchronously + // by calling inotify_rm_watch() below. e.g. readEvents() goroutine receives IN_IGNORE + // so that EINVAL means that the wd is being rm_watch()ed or its file removed + // by another thread and we have not received IN_IGNORE event. + success, errno := unix.InotifyRmWatch(w.fd, watch.wd) + if success == -1 { + // TODO: Perhaps it's not helpful to return an error here in every case. + // the only two possible errors are: + // EBADF, which happens when w.fd is not a valid file descriptor of any kind. + // EINVAL, which is when fd is not an inotify descriptor or wd is not a valid watch descriptor. + // Watch descriptors are invalidated when they are removed explicitly or implicitly; + // explicitly by inotify_rm_watch, implicitly when the file they are watching is deleted. + return errno + } + + // wait until ignoreLinux() deleting maps + exists := true + for exists { + w.cv.Wait() + _, exists = w.watches[name] + } + + return nil +} + +type watch struct { + wd uint32 // Watch descriptor (as returned by the inotify_add_watch() syscall) + flags uint32 // inotify flags of this watch (see inotify(7) for the list of valid flags) +} + +// readEvents reads from the inotify file descriptor, converts the +// received events into Event objects and sends them via the Events channel +func (w *Watcher) readEvents() { + var ( + buf [unix.SizeofInotifyEvent * 4096]byte // Buffer for a maximum of 4096 raw events + n int // Number of bytes read with read() + errno error // Syscall errno + ok bool // For poller.wait + ) + + defer close(w.doneResp) + defer close(w.Errors) + defer close(w.Events) + defer unix.Close(w.fd) + defer w.poller.close() + + for { + // See if we have been closed. + if w.isClosed() { + return + } + + ok, errno = w.poller.wait() + if errno != nil { + select { + case w.Errors <- errno: + case <-w.done: + return + } + continue + } + + if !ok { + continue + } + + n, errno = unix.Read(w.fd, buf[:]) + // If a signal interrupted execution, see if we've been asked to close, and try again. + // http://man7.org/linux/man-pages/man7/signal.7.html : + // "Before Linux 3.8, reads from an inotify(7) file descriptor were not restartable" + if errno == unix.EINTR { + continue + } + + // unix.Read might have been woken up by Close. If so, we're done. + if w.isClosed() { + return + } + + if n < unix.SizeofInotifyEvent { + var err error + if n == 0 { + // If EOF is received. This should really never happen. + err = io.EOF + } else if n < 0 { + // If an error occurred while reading. + err = errno + } else { + // Read was too short. + err = errors.New("notify: short read in readEvents()") + } + select { + case w.Errors <- err: + case <-w.done: + return + } + continue + } + + var offset uint32 + // We don't know how many events we just read into the buffer + // While the offset points to at least one whole event... + for offset <= uint32(n-unix.SizeofInotifyEvent) { + // Point "raw" to the event in the buffer + raw := (*unix.InotifyEvent)(unsafe.Pointer(&buf[offset])) + + mask := uint32(raw.Mask) + nameLen := uint32(raw.Len) + // If the event happened to the watched directory or the watched file, the kernel + // doesn't append the filename to the event, but we would like to always fill the + // the "Name" field with a valid filename. We retrieve the path of the watch from + // the "paths" map. + w.mu.Lock() + name := w.paths[int(raw.Wd)] + w.mu.Unlock() + if nameLen > 0 { + // Point "bytes" at the first byte of the filename + bytes := (*[unix.PathMax]byte)(unsafe.Pointer(&buf[offset+unix.SizeofInotifyEvent])) + // The filename is padded with NULL bytes. TrimRight() gets rid of those. + name += "/" + strings.TrimRight(string(bytes[0:nameLen]), "\000") + } + + event := newEvent(name, mask) + + // Send the events that are not ignored on the events channel + if !event.ignoreLinux(w, raw.Wd, mask) { + select { + case w.Events <- event: + case <-w.done: + return + } + } + + // Move to the next event in the buffer + offset += unix.SizeofInotifyEvent + nameLen + } + } +} + +// Certain types of events can be "ignored" and not sent over the Events +// channel. Such as events marked ignore by the kernel, or MODIFY events +// against files that do not exist. +func (e *Event) ignoreLinux(w *Watcher, wd int32, mask uint32) bool { + // Ignore anything the inotify API says to ignore + if mask&unix.IN_IGNORED == unix.IN_IGNORED { + w.mu.Lock() + defer w.mu.Unlock() + name := w.paths[int(wd)] + delete(w.paths, int(wd)) + delete(w.watches, name) + w.cv.Broadcast() + return true + } + + // If the event is not a DELETE or RENAME, the file must exist. + // Otherwise the event is ignored. + // *Note*: this was put in place because it was seen that a MODIFY + // event was sent after the DELETE. This ignores that MODIFY and + // assumes a DELETE will come or has come if the file doesn't exist. + if !(e.Op&Remove == Remove || e.Op&Rename == Rename) { + _, statErr := os.Lstat(e.Name) + return os.IsNotExist(statErr) + } + return false +} + +// newEvent returns an platform-independent Event based on an inotify mask. +func newEvent(name string, mask uint32) Event { + e := Event{Name: name} + if mask&unix.IN_CREATE == unix.IN_CREATE || mask&unix.IN_MOVED_TO == unix.IN_MOVED_TO { + e.Op |= Create + } + if mask&unix.IN_DELETE_SELF == unix.IN_DELETE_SELF || mask&unix.IN_DELETE == unix.IN_DELETE { + e.Op |= Remove + } + if mask&unix.IN_MODIFY == unix.IN_MODIFY { + e.Op |= Write + } + if mask&unix.IN_MOVE_SELF == unix.IN_MOVE_SELF || mask&unix.IN_MOVED_FROM == unix.IN_MOVED_FROM { + e.Op |= Rename + } + if mask&unix.IN_ATTRIB == unix.IN_ATTRIB { + e.Op |= Chmod + } + return e +} diff --git a/vendor/github.com/fsnotify/fsnotify/inotify_poller.go b/vendor/github.com/fsnotify/fsnotify/inotify_poller.go new file mode 100644 index 0000000000..cc7db4b22e --- /dev/null +++ b/vendor/github.com/fsnotify/fsnotify/inotify_poller.go @@ -0,0 +1,187 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build linux + +package fsnotify + +import ( + "errors" + + "golang.org/x/sys/unix" +) + +type fdPoller struct { + fd int // File descriptor (as returned by the inotify_init() syscall) + epfd int // Epoll file descriptor + pipe [2]int // Pipe for waking up +} + +func emptyPoller(fd int) *fdPoller { + poller := new(fdPoller) + poller.fd = fd + poller.epfd = -1 + poller.pipe[0] = -1 + poller.pipe[1] = -1 + return poller +} + +// Create a new inotify poller. +// This creates an inotify handler, and an epoll handler. +func newFdPoller(fd int) (*fdPoller, error) { + var errno error + poller := emptyPoller(fd) + defer func() { + if errno != nil { + poller.close() + } + }() + poller.fd = fd + + // Create epoll fd + poller.epfd, errno = unix.EpollCreate1(0) + if poller.epfd == -1 { + return nil, errno + } + // Create pipe; pipe[0] is the read end, pipe[1] the write end. + errno = unix.Pipe2(poller.pipe[:], unix.O_NONBLOCK) + if errno != nil { + return nil, errno + } + + // Register inotify fd with epoll + event := unix.EpollEvent{ + Fd: int32(poller.fd), + Events: unix.EPOLLIN, + } + errno = unix.EpollCtl(poller.epfd, unix.EPOLL_CTL_ADD, poller.fd, &event) + if errno != nil { + return nil, errno + } + + // Register pipe fd with epoll + event = unix.EpollEvent{ + Fd: int32(poller.pipe[0]), + Events: unix.EPOLLIN, + } + errno = unix.EpollCtl(poller.epfd, unix.EPOLL_CTL_ADD, poller.pipe[0], &event) + if errno != nil { + return nil, errno + } + + return poller, nil +} + +// Wait using epoll. +// Returns true if something is ready to be read, +// false if there is not. +func (poller *fdPoller) wait() (bool, error) { + // 3 possible events per fd, and 2 fds, makes a maximum of 6 events. + // I don't know whether epoll_wait returns the number of events returned, + // or the total number of events ready. + // I decided to catch both by making the buffer one larger than the maximum. + events := make([]unix.EpollEvent, 7) + for { + n, errno := unix.EpollWait(poller.epfd, events, -1) + if n == -1 { + if errno == unix.EINTR { + continue + } + return false, errno + } + if n == 0 { + // If there are no events, try again. + continue + } + if n > 6 { + // This should never happen. More events were returned than should be possible. + return false, errors.New("epoll_wait returned more events than I know what to do with") + } + ready := events[:n] + epollhup := false + epollerr := false + epollin := false + for _, event := range ready { + if event.Fd == int32(poller.fd) { + if event.Events&unix.EPOLLHUP != 0 { + // This should not happen, but if it does, treat it as a wakeup. + epollhup = true + } + if event.Events&unix.EPOLLERR != 0 { + // If an error is waiting on the file descriptor, we should pretend + // something is ready to read, and let unix.Read pick up the error. + epollerr = true + } + if event.Events&unix.EPOLLIN != 0 { + // There is data to read. + epollin = true + } + } + if event.Fd == int32(poller.pipe[0]) { + if event.Events&unix.EPOLLHUP != 0 { + // Write pipe descriptor was closed, by us. This means we're closing down the + // watcher, and we should wake up. + } + if event.Events&unix.EPOLLERR != 0 { + // If an error is waiting on the pipe file descriptor. + // This is an absolute mystery, and should never ever happen. + return false, errors.New("Error on the pipe descriptor.") + } + if event.Events&unix.EPOLLIN != 0 { + // This is a regular wakeup, so we have to clear the buffer. + err := poller.clearWake() + if err != nil { + return false, err + } + } + } + } + + if epollhup || epollerr || epollin { + return true, nil + } + return false, nil + } +} + +// Close the write end of the poller. +func (poller *fdPoller) wake() error { + buf := make([]byte, 1) + n, errno := unix.Write(poller.pipe[1], buf) + if n == -1 { + if errno == unix.EAGAIN { + // Buffer is full, poller will wake. + return nil + } + return errno + } + return nil +} + +func (poller *fdPoller) clearWake() error { + // You have to be woken up a LOT in order to get to 100! + buf := make([]byte, 100) + n, errno := unix.Read(poller.pipe[0], buf) + if n == -1 { + if errno == unix.EAGAIN { + // Buffer is empty, someone else cleared our wake. + return nil + } + return errno + } + return nil +} + +// Close all poller file descriptors, but not the one passed to it. +func (poller *fdPoller) close() { + if poller.pipe[1] != -1 { + unix.Close(poller.pipe[1]) + } + if poller.pipe[0] != -1 { + unix.Close(poller.pipe[0]) + } + if poller.epfd != -1 { + unix.Close(poller.epfd) + } +} diff --git a/vendor/github.com/fsnotify/fsnotify/inotify_poller_test.go b/vendor/github.com/fsnotify/fsnotify/inotify_poller_test.go new file mode 100644 index 0000000000..26623efeff --- /dev/null +++ b/vendor/github.com/fsnotify/fsnotify/inotify_poller_test.go @@ -0,0 +1,229 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build linux + +package fsnotify + +import ( + "testing" + "time" + + "golang.org/x/sys/unix" +) + +type testFd [2]int + +func makeTestFd(t *testing.T) testFd { + var tfd testFd + errno := unix.Pipe(tfd[:]) + if errno != nil { + t.Fatalf("Failed to create pipe: %v", errno) + } + return tfd +} + +func (tfd testFd) fd() int { + return tfd[0] +} + +func (tfd testFd) closeWrite(t *testing.T) { + errno := unix.Close(tfd[1]) + if errno != nil { + t.Fatalf("Failed to close write end of pipe: %v", errno) + } +} + +func (tfd testFd) put(t *testing.T) { + buf := make([]byte, 10) + _, errno := unix.Write(tfd[1], buf) + if errno != nil { + t.Fatalf("Failed to write to pipe: %v", errno) + } +} + +func (tfd testFd) get(t *testing.T) { + buf := make([]byte, 10) + _, errno := unix.Read(tfd[0], buf) + if errno != nil { + t.Fatalf("Failed to read from pipe: %v", errno) + } +} + +func (tfd testFd) close() { + unix.Close(tfd[1]) + unix.Close(tfd[0]) +} + +func makePoller(t *testing.T) (testFd, *fdPoller) { + tfd := makeTestFd(t) + poller, err := newFdPoller(tfd.fd()) + if err != nil { + t.Fatalf("Failed to create poller: %v", err) + } + return tfd, poller +} + +func TestPollerWithBadFd(t *testing.T) { + _, err := newFdPoller(-1) + if err != unix.EBADF { + t.Fatalf("Expected EBADF, got: %v", err) + } +} + +func TestPollerWithData(t *testing.T) { + tfd, poller := makePoller(t) + defer tfd.close() + defer poller.close() + + tfd.put(t) + ok, err := poller.wait() + if err != nil { + t.Fatalf("poller failed: %v", err) + } + if !ok { + t.Fatalf("expected poller to return true") + } + tfd.get(t) +} + +func TestPollerWithWakeup(t *testing.T) { + tfd, poller := makePoller(t) + defer tfd.close() + defer poller.close() + + err := poller.wake() + if err != nil { + t.Fatalf("wake failed: %v", err) + } + ok, err := poller.wait() + if err != nil { + t.Fatalf("poller failed: %v", err) + } + if ok { + t.Fatalf("expected poller to return false") + } +} + +func TestPollerWithClose(t *testing.T) { + tfd, poller := makePoller(t) + defer tfd.close() + defer poller.close() + + tfd.closeWrite(t) + ok, err := poller.wait() + if err != nil { + t.Fatalf("poller failed: %v", err) + } + if !ok { + t.Fatalf("expected poller to return true") + } +} + +func TestPollerWithWakeupAndData(t *testing.T) { + tfd, poller := makePoller(t) + defer tfd.close() + defer poller.close() + + tfd.put(t) + err := poller.wake() + if err != nil { + t.Fatalf("wake failed: %v", err) + } + + // both data and wakeup + ok, err := poller.wait() + if err != nil { + t.Fatalf("poller failed: %v", err) + } + if !ok { + t.Fatalf("expected poller to return true") + } + + // data is still in the buffer, wakeup is cleared + ok, err = poller.wait() + if err != nil { + t.Fatalf("poller failed: %v", err) + } + if !ok { + t.Fatalf("expected poller to return true") + } + + tfd.get(t) + // data is gone, only wakeup now + err = poller.wake() + if err != nil { + t.Fatalf("wake failed: %v", err) + } + ok, err = poller.wait() + if err != nil { + t.Fatalf("poller failed: %v", err) + } + if ok { + t.Fatalf("expected poller to return false") + } +} + +func TestPollerConcurrent(t *testing.T) { + tfd, poller := makePoller(t) + defer tfd.close() + defer poller.close() + + oks := make(chan bool) + live := make(chan bool) + defer close(live) + go func() { + defer close(oks) + for { + ok, err := poller.wait() + if err != nil { + t.Fatalf("poller failed: %v", err) + } + oks <- ok + if !<-live { + return + } + } + }() + + // Try a write + select { + case <-time.After(50 * time.Millisecond): + case <-oks: + t.Fatalf("poller did not wait") + } + tfd.put(t) + if !<-oks { + t.Fatalf("expected true") + } + tfd.get(t) + live <- true + + // Try a wakeup + select { + case <-time.After(50 * time.Millisecond): + case <-oks: + t.Fatalf("poller did not wait") + } + err := poller.wake() + if err != nil { + t.Fatalf("wake failed: %v", err) + } + if <-oks { + t.Fatalf("expected false") + } + live <- true + + // Try a close + select { + case <-time.After(50 * time.Millisecond): + case <-oks: + t.Fatalf("poller did not wait") + } + tfd.closeWrite(t) + if !<-oks { + t.Fatalf("expected true") + } + tfd.get(t) +} diff --git a/vendor/github.com/fsnotify/fsnotify/inotify_test.go b/vendor/github.com/fsnotify/fsnotify/inotify_test.go new file mode 100644 index 0000000000..a4bb202d1f --- /dev/null +++ b/vendor/github.com/fsnotify/fsnotify/inotify_test.go @@ -0,0 +1,360 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build linux + +package fsnotify + +import ( + "fmt" + "os" + "path/filepath" + "strings" + "testing" + "time" +) + +func TestInotifyCloseRightAway(t *testing.T) { + w, err := NewWatcher() + if err != nil { + t.Fatalf("Failed to create watcher") + } + + // Close immediately; it won't even reach the first unix.Read. + w.Close() + + // Wait for the close to complete. + <-time.After(50 * time.Millisecond) + isWatcherReallyClosed(t, w) +} + +func TestInotifyCloseSlightlyLater(t *testing.T) { + w, err := NewWatcher() + if err != nil { + t.Fatalf("Failed to create watcher") + } + + // Wait until readEvents has reached unix.Read, and Close. + <-time.After(50 * time.Millisecond) + w.Close() + + // Wait for the close to complete. + <-time.After(50 * time.Millisecond) + isWatcherReallyClosed(t, w) +} + +func TestInotifyCloseSlightlyLaterWithWatch(t *testing.T) { + testDir := tempMkdir(t) + defer os.RemoveAll(testDir) + + w, err := NewWatcher() + if err != nil { + t.Fatalf("Failed to create watcher") + } + w.Add(testDir) + + // Wait until readEvents has reached unix.Read, and Close. + <-time.After(50 * time.Millisecond) + w.Close() + + // Wait for the close to complete. + <-time.After(50 * time.Millisecond) + isWatcherReallyClosed(t, w) +} + +func TestInotifyCloseAfterRead(t *testing.T) { + testDir := tempMkdir(t) + defer os.RemoveAll(testDir) + + w, err := NewWatcher() + if err != nil { + t.Fatalf("Failed to create watcher") + } + + err = w.Add(testDir) + if err != nil { + t.Fatalf("Failed to add .") + } + + // Generate an event. + os.Create(filepath.Join(testDir, "somethingSOMETHINGsomethingSOMETHING")) + + // Wait for readEvents to read the event, then close the watcher. + <-time.After(50 * time.Millisecond) + w.Close() + + // Wait for the close to complete. + <-time.After(50 * time.Millisecond) + isWatcherReallyClosed(t, w) +} + +func isWatcherReallyClosed(t *testing.T, w *Watcher) { + select { + case err, ok := <-w.Errors: + if ok { + t.Fatalf("w.Errors is not closed; readEvents is still alive after closing (error: %v)", err) + } + default: + t.Fatalf("w.Errors would have blocked; readEvents is still alive!") + } + + select { + case _, ok := <-w.Events: + if ok { + t.Fatalf("w.Events is not closed; readEvents is still alive after closing") + } + default: + t.Fatalf("w.Events would have blocked; readEvents is still alive!") + } +} + +func TestInotifyCloseCreate(t *testing.T) { + testDir := tempMkdir(t) + defer os.RemoveAll(testDir) + + w, err := NewWatcher() + if err != nil { + t.Fatalf("Failed to create watcher: %v", err) + } + defer w.Close() + + err = w.Add(testDir) + if err != nil { + t.Fatalf("Failed to add testDir: %v", err) + } + h, err := os.Create(filepath.Join(testDir, "testfile")) + if err != nil { + t.Fatalf("Failed to create file in testdir: %v", err) + } + h.Close() + select { + case _ = <-w.Events: + case err := <-w.Errors: + t.Fatalf("Error from watcher: %v", err) + case <-time.After(50 * time.Millisecond): + t.Fatalf("Took too long to wait for event") + } + + // At this point, we've received one event, so the goroutine is ready. + // It's also blocking on unix.Read. + // Now we try to swap the file descriptor under its nose. + w.Close() + w, err = NewWatcher() + defer w.Close() + if err != nil { + t.Fatalf("Failed to create second watcher: %v", err) + } + + <-time.After(50 * time.Millisecond) + err = w.Add(testDir) + if err != nil { + t.Fatalf("Error adding testDir again: %v", err) + } +} + +// This test verifies the watcher can keep up with file creations/deletions +// when under load. +func TestInotifyStress(t *testing.T) { + maxNumToCreate := 1000 + + testDir := tempMkdir(t) + defer os.RemoveAll(testDir) + testFilePrefix := filepath.Join(testDir, "testfile") + + w, err := NewWatcher() + if err != nil { + t.Fatalf("Failed to create watcher: %v", err) + } + defer w.Close() + + err = w.Add(testDir) + if err != nil { + t.Fatalf("Failed to add testDir: %v", err) + } + + doneChan := make(chan struct{}) + // The buffer ensures that the file generation goroutine is never blocked. + errChan := make(chan error, 2*maxNumToCreate) + + go func() { + for i := 0; i < maxNumToCreate; i++ { + testFile := fmt.Sprintf("%s%d", testFilePrefix, i) + + handle, err := os.Create(testFile) + if err != nil { + errChan <- fmt.Errorf("Create failed: %v", err) + continue + } + + err = handle.Close() + if err != nil { + errChan <- fmt.Errorf("Close failed: %v", err) + continue + } + } + + // If we delete a newly created file too quickly, inotify will skip the + // create event and only send the delete event. + time.Sleep(100 * time.Millisecond) + + for i := 0; i < maxNumToCreate; i++ { + testFile := fmt.Sprintf("%s%d", testFilePrefix, i) + err = os.Remove(testFile) + if err != nil { + errChan <- fmt.Errorf("Remove failed: %v", err) + } + } + + close(doneChan) + }() + + creates := 0 + removes := 0 + + finished := false + after := time.After(10 * time.Second) + for !finished { + select { + case <-after: + t.Fatalf("Not done") + case <-doneChan: + finished = true + case err := <-errChan: + t.Fatalf("Got an error from file creator goroutine: %v", err) + case err := <-w.Errors: + t.Fatalf("Got an error from watcher: %v", err) + case evt := <-w.Events: + if !strings.HasPrefix(evt.Name, testFilePrefix) { + t.Fatalf("Got an event for an unknown file: %s", evt.Name) + } + if evt.Op == Create { + creates++ + } + if evt.Op == Remove { + removes++ + } + } + } + + // Drain remaining events from channels + count := 0 + for count < 10 { + select { + case err := <-errChan: + t.Fatalf("Got an error from file creator goroutine: %v", err) + case err := <-w.Errors: + t.Fatalf("Got an error from watcher: %v", err) + case evt := <-w.Events: + if !strings.HasPrefix(evt.Name, testFilePrefix) { + t.Fatalf("Got an event for an unknown file: %s", evt.Name) + } + if evt.Op == Create { + creates++ + } + if evt.Op == Remove { + removes++ + } + count = 0 + default: + count++ + // Give the watcher chances to fill the channels. + time.Sleep(time.Millisecond) + } + } + + if creates-removes > 1 || creates-removes < -1 { + t.Fatalf("Creates and removes should not be off by more than one: %d creates, %d removes", creates, removes) + } + if creates < 50 { + t.Fatalf("Expected at least 50 creates, got %d", creates) + } +} + +func TestInotifyRemoveTwice(t *testing.T) { + testDir := tempMkdir(t) + defer os.RemoveAll(testDir) + testFile := filepath.Join(testDir, "testfile") + + handle, err := os.Create(testFile) + if err != nil { + t.Fatalf("Create failed: %v", err) + } + handle.Close() + + w, err := NewWatcher() + if err != nil { + t.Fatalf("Failed to create watcher: %v", err) + } + defer w.Close() + + err = w.Add(testFile) + if err != nil { + t.Fatalf("Failed to add testFile: %v", err) + } + + err = os.Remove(testFile) + if err != nil { + t.Fatalf("Failed to remove testFile: %v", err) + } + + err = w.Remove(testFile) + if err == nil { + t.Fatalf("no error on removing invalid file") + } + s1 := fmt.Sprintf("%s", err) + + err = w.Remove(testFile) + if err == nil { + t.Fatalf("no error on removing invalid file") + } + s2 := fmt.Sprintf("%s", err) + + if s1 != s2 { + t.Fatalf("receive different error - %s / %s", s1, s2) + } +} + +func TestInotifyInnerMapLength(t *testing.T) { + testDir := tempMkdir(t) + defer os.RemoveAll(testDir) + testFile := filepath.Join(testDir, "testfile") + + handle, err := os.Create(testFile) + if err != nil { + t.Fatalf("Create failed: %v", err) + } + handle.Close() + + w, err := NewWatcher() + if err != nil { + t.Fatalf("Failed to create watcher: %v", err) + } + defer w.Close() + + err = w.Add(testFile) + if err != nil { + t.Fatalf("Failed to add testFile: %v", err) + } + go func() { + for err := range w.Errors { + t.Fatalf("error received: %s", err) + } + }() + + err = os.Remove(testFile) + if err != nil { + t.Fatalf("Failed to remove testFile: %v", err) + } + _ = <-w.Events // consume Remove event + <-time.After(50 * time.Millisecond) // wait IN_IGNORE propagated + + w.mu.Lock() + defer w.mu.Unlock() + if len(w.watches) != 0 { + t.Fatalf("Expected watches len is 0, but got: %d, %v", len(w.watches), w.watches) + } + if len(w.paths) != 0 { + t.Fatalf("Expected paths len is 0, but got: %d, %v", len(w.paths), w.paths) + } +} diff --git a/vendor/github.com/fsnotify/fsnotify/integration_darwin_test.go b/vendor/github.com/fsnotify/fsnotify/integration_darwin_test.go new file mode 100644 index 0000000000..5564554f72 --- /dev/null +++ b/vendor/github.com/fsnotify/fsnotify/integration_darwin_test.go @@ -0,0 +1,147 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package fsnotify + +import ( + "os" + "path/filepath" + "testing" + "time" + + "golang.org/x/sys/unix" +) + +// testExchangedataForWatcher tests the watcher with the exchangedata operation on OS X. +// +// This is widely used for atomic saves on OS X, e.g. TextMate and in Apple's NSDocument. +// +// See https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man2/exchangedata.2.html +// Also see: https://github.com/textmate/textmate/blob/cd016be29489eba5f3c09b7b70b06da134dda550/Frameworks/io/src/swap_file_data.cc#L20 +func testExchangedataForWatcher(t *testing.T, watchDir bool) { + // Create directory to watch + testDir1 := tempMkdir(t) + + // For the intermediate file + testDir2 := tempMkdir(t) + + defer os.RemoveAll(testDir1) + defer os.RemoveAll(testDir2) + + resolvedFilename := "TestFsnotifyEvents.file" + + // TextMate does: + // + // 1. exchangedata (intermediate, resolved) + // 2. unlink intermediate + // + // Let's try to simulate that: + resolved := filepath.Join(testDir1, resolvedFilename) + intermediate := filepath.Join(testDir2, resolvedFilename+"~") + + // Make sure we create the file before we start watching + createAndSyncFile(t, resolved) + + watcher := newWatcher(t) + + // Test both variants in isolation + if watchDir { + addWatch(t, watcher, testDir1) + } else { + addWatch(t, watcher, resolved) + } + + // Receive errors on the error channel on a separate goroutine + go func() { + for err := range watcher.Errors { + t.Fatalf("error received: %s", err) + } + }() + + // Receive events on the event channel on a separate goroutine + eventstream := watcher.Events + var removeReceived counter + var createReceived counter + + done := make(chan bool) + + go func() { + for event := range eventstream { + // Only count relevant events + if event.Name == filepath.Clean(resolved) { + if event.Op&Remove == Remove { + removeReceived.increment() + } + if event.Op&Create == Create { + createReceived.increment() + } + } + t.Logf("event received: %s", event) + } + done <- true + }() + + // Repeat to make sure the watched file/directory "survives" the REMOVE/CREATE loop. + for i := 1; i <= 3; i++ { + // The intermediate file is created in a folder outside the watcher + createAndSyncFile(t, intermediate) + + // 1. Swap + if err := unix.Exchangedata(intermediate, resolved, 0); err != nil { + t.Fatalf("[%d] exchangedata failed: %s", i, err) + } + + time.Sleep(50 * time.Millisecond) + + // 2. Delete the intermediate file + err := os.Remove(intermediate) + + if err != nil { + t.Fatalf("[%d] remove %s failed: %s", i, intermediate, err) + } + + time.Sleep(50 * time.Millisecond) + + } + + // We expect this event to be received almost immediately, but let's wait 500 ms to be sure + time.Sleep(500 * time.Millisecond) + + // The events will be (CHMOD + REMOVE + CREATE) X 2. Let's focus on the last two: + if removeReceived.value() < 3 { + t.Fatal("fsnotify remove events have not been received after 500 ms") + } + + if createReceived.value() < 3 { + t.Fatal("fsnotify create events have not been received after 500 ms") + } + + watcher.Close() + t.Log("waiting for the event channel to become closed...") + select { + case <-done: + t.Log("event channel closed") + case <-time.After(2 * time.Second): + t.Fatal("event stream was not closed after 2 seconds") + } +} + +// TestExchangedataInWatchedDir test exchangedata operation on file in watched dir. +func TestExchangedataInWatchedDir(t *testing.T) { + testExchangedataForWatcher(t, true) +} + +// TestExchangedataInWatchedDir test exchangedata operation on watched file. +func TestExchangedataInWatchedFile(t *testing.T) { + testExchangedataForWatcher(t, false) +} + +func createAndSyncFile(t *testing.T, filepath string) { + f1, err := os.OpenFile(filepath, os.O_WRONLY|os.O_CREATE, 0666) + if err != nil { + t.Fatalf("creating %s failed: %s", filepath, err) + } + f1.Sync() + f1.Close() +} diff --git a/vendor/github.com/fsnotify/fsnotify/integration_test.go b/vendor/github.com/fsnotify/fsnotify/integration_test.go new file mode 100644 index 0000000000..8b7e9d3ec8 --- /dev/null +++ b/vendor/github.com/fsnotify/fsnotify/integration_test.go @@ -0,0 +1,1237 @@ +// 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. + +// +build !plan9,!solaris + +package fsnotify + +import ( + "io/ioutil" + "os" + "os/exec" + "path" + "path/filepath" + "runtime" + "sync/atomic" + "testing" + "time" +) + +// An atomic counter +type counter struct { + val int32 +} + +func (c *counter) increment() { + atomic.AddInt32(&c.val, 1) +} + +func (c *counter) value() int32 { + return atomic.LoadInt32(&c.val) +} + +func (c *counter) reset() { + atomic.StoreInt32(&c.val, 0) +} + +// tempMkdir makes a temporary directory +func tempMkdir(t *testing.T) string { + dir, err := ioutil.TempDir("", "fsnotify") + if err != nil { + t.Fatalf("failed to create test directory: %s", err) + } + return dir +} + +// tempMkFile makes a temporary file. +func tempMkFile(t *testing.T, dir string) string { + f, err := ioutil.TempFile(dir, "fsnotify") + if err != nil { + t.Fatalf("failed to create test file: %v", err) + } + defer f.Close() + return f.Name() +} + +// newWatcher initializes an fsnotify Watcher instance. +func newWatcher(t *testing.T) *Watcher { + watcher, err := NewWatcher() + if err != nil { + t.Fatalf("NewWatcher() failed: %s", err) + } + return watcher +} + +// addWatch adds a watch for a directory +func addWatch(t *testing.T, watcher *Watcher, dir string) { + if err := watcher.Add(dir); err != nil { + t.Fatalf("watcher.Add(%q) failed: %s", dir, err) + } +} + +func TestFsnotifyMultipleOperations(t *testing.T) { + watcher := newWatcher(t) + + // Receive errors on the error channel on a separate goroutine + go func() { + for err := range watcher.Errors { + t.Fatalf("error received: %s", err) + } + }() + + // Create directory to watch + testDir := tempMkdir(t) + defer os.RemoveAll(testDir) + + // Create directory that's not watched + testDirToMoveFiles := tempMkdir(t) + defer os.RemoveAll(testDirToMoveFiles) + + testFile := filepath.Join(testDir, "TestFsnotifySeq.testfile") + testFileRenamed := filepath.Join(testDirToMoveFiles, "TestFsnotifySeqRename.testfile") + + addWatch(t, watcher, testDir) + + // Receive events on the event channel on a separate goroutine + eventstream := watcher.Events + var createReceived, modifyReceived, deleteReceived, renameReceived counter + done := make(chan bool) + go func() { + for event := range eventstream { + // Only count relevant events + if event.Name == filepath.Clean(testDir) || event.Name == filepath.Clean(testFile) { + t.Logf("event received: %s", event) + if event.Op&Remove == Remove { + deleteReceived.increment() + } + if event.Op&Write == Write { + modifyReceived.increment() + } + if event.Op&Create == Create { + createReceived.increment() + } + if event.Op&Rename == Rename { + renameReceived.increment() + } + } else { + t.Logf("unexpected event received: %s", event) + } + } + done <- true + }() + + // Create a file + // This should add at least one event to the fsnotify event queue + var f *os.File + f, err := os.OpenFile(testFile, os.O_WRONLY|os.O_CREATE, 0666) + if err != nil { + t.Fatalf("creating test file failed: %s", err) + } + f.Sync() + + time.Sleep(time.Millisecond) + f.WriteString("data") + f.Sync() + f.Close() + + time.Sleep(50 * time.Millisecond) // give system time to sync write change before delete + + if err := testRename(testFile, testFileRenamed); err != nil { + t.Fatalf("rename failed: %s", err) + } + + // Modify the file outside of the watched dir + f, err = os.Open(testFileRenamed) + if err != nil { + t.Fatalf("open test renamed file failed: %s", err) + } + f.WriteString("data") + f.Sync() + f.Close() + + time.Sleep(50 * time.Millisecond) // give system time to sync write change before delete + + // Recreate the file that was moved + f, err = os.OpenFile(testFile, os.O_WRONLY|os.O_CREATE, 0666) + if err != nil { + t.Fatalf("creating test file failed: %s", err) + } + f.Close() + time.Sleep(50 * time.Millisecond) // give system time to sync write change before delete + + // We expect this event to be received almost immediately, but let's wait 500 ms to be sure + time.Sleep(500 * time.Millisecond) + cReceived := createReceived.value() + if cReceived != 2 { + t.Fatalf("incorrect number of create events received after 500 ms (%d vs %d)", cReceived, 2) + } + mReceived := modifyReceived.value() + if mReceived != 1 { + t.Fatalf("incorrect number of modify events received after 500 ms (%d vs %d)", mReceived, 1) + } + dReceived := deleteReceived.value() + rReceived := renameReceived.value() + if dReceived+rReceived != 1 { + t.Fatalf("incorrect number of rename+delete events received after 500 ms (%d vs %d)", rReceived+dReceived, 1) + } + + // Try closing the fsnotify instance + t.Log("calling Close()") + watcher.Close() + t.Log("waiting for the event channel to become closed...") + select { + case <-done: + t.Log("event channel closed") + case <-time.After(2 * time.Second): + t.Fatal("event stream was not closed after 2 seconds") + } +} + +func TestFsnotifyMultipleCreates(t *testing.T) { + watcher := newWatcher(t) + + // Receive errors on the error channel on a separate goroutine + go func() { + for err := range watcher.Errors { + t.Fatalf("error received: %s", err) + } + }() + + // Create directory to watch + testDir := tempMkdir(t) + defer os.RemoveAll(testDir) + + testFile := filepath.Join(testDir, "TestFsnotifySeq.testfile") + + addWatch(t, watcher, testDir) + + // Receive events on the event channel on a separate goroutine + eventstream := watcher.Events + var createReceived, modifyReceived, deleteReceived counter + done := make(chan bool) + go func() { + for event := range eventstream { + // Only count relevant events + if event.Name == filepath.Clean(testDir) || event.Name == filepath.Clean(testFile) { + t.Logf("event received: %s", event) + if event.Op&Remove == Remove { + deleteReceived.increment() + } + if event.Op&Create == Create { + createReceived.increment() + } + if event.Op&Write == Write { + modifyReceived.increment() + } + } else { + t.Logf("unexpected event received: %s", event) + } + } + done <- true + }() + + // Create a file + // This should add at least one event to the fsnotify event queue + var f *os.File + f, err := os.OpenFile(testFile, os.O_WRONLY|os.O_CREATE, 0666) + if err != nil { + t.Fatalf("creating test file failed: %s", err) + } + f.Sync() + + time.Sleep(time.Millisecond) + f.WriteString("data") + f.Sync() + f.Close() + + time.Sleep(50 * time.Millisecond) // give system time to sync write change before delete + + os.Remove(testFile) + + time.Sleep(50 * time.Millisecond) // give system time to sync write change before delete + + // Recreate the file + f, err = os.OpenFile(testFile, os.O_WRONLY|os.O_CREATE, 0666) + if err != nil { + t.Fatalf("creating test file failed: %s", err) + } + f.Close() + time.Sleep(50 * time.Millisecond) // give system time to sync write change before delete + + // Modify + f, err = os.OpenFile(testFile, os.O_WRONLY, 0666) + if err != nil { + t.Fatalf("creating test file failed: %s", err) + } + f.Sync() + + time.Sleep(time.Millisecond) + f.WriteString("data") + f.Sync() + f.Close() + + time.Sleep(50 * time.Millisecond) // give system time to sync write change before delete + + // Modify + f, err = os.OpenFile(testFile, os.O_WRONLY, 0666) + if err != nil { + t.Fatalf("creating test file failed: %s", err) + } + f.Sync() + + time.Sleep(time.Millisecond) + f.WriteString("data") + f.Sync() + f.Close() + + time.Sleep(50 * time.Millisecond) // give system time to sync write change before delete + + // We expect this event to be received almost immediately, but let's wait 500 ms to be sure + time.Sleep(500 * time.Millisecond) + cReceived := createReceived.value() + if cReceived != 2 { + t.Fatalf("incorrect number of create events received after 500 ms (%d vs %d)", cReceived, 2) + } + mReceived := modifyReceived.value() + if mReceived < 3 { + t.Fatalf("incorrect number of modify events received after 500 ms (%d vs atleast %d)", mReceived, 3) + } + dReceived := deleteReceived.value() + if dReceived != 1 { + t.Fatalf("incorrect number of rename+delete events received after 500 ms (%d vs %d)", dReceived, 1) + } + + // Try closing the fsnotify instance + t.Log("calling Close()") + watcher.Close() + t.Log("waiting for the event channel to become closed...") + select { + case <-done: + t.Log("event channel closed") + case <-time.After(2 * time.Second): + t.Fatal("event stream was not closed after 2 seconds") + } +} + +func TestFsnotifyDirOnly(t *testing.T) { + watcher := newWatcher(t) + + // Create directory to watch + testDir := tempMkdir(t) + defer os.RemoveAll(testDir) + + // Create a file before watching directory + // This should NOT add any events to the fsnotify event queue + testFileAlreadyExists := filepath.Join(testDir, "TestFsnotifyEventsExisting.testfile") + { + var f *os.File + f, err := os.OpenFile(testFileAlreadyExists, os.O_WRONLY|os.O_CREATE, 0666) + if err != nil { + t.Fatalf("creating test file failed: %s", err) + } + f.Sync() + f.Close() + } + + addWatch(t, watcher, testDir) + + // Receive errors on the error channel on a separate goroutine + go func() { + for err := range watcher.Errors { + t.Fatalf("error received: %s", err) + } + }() + + testFile := filepath.Join(testDir, "TestFsnotifyDirOnly.testfile") + + // Receive events on the event channel on a separate goroutine + eventstream := watcher.Events + var createReceived, modifyReceived, deleteReceived counter + done := make(chan bool) + go func() { + for event := range eventstream { + // Only count relevant events + if event.Name == filepath.Clean(testDir) || event.Name == filepath.Clean(testFile) || event.Name == filepath.Clean(testFileAlreadyExists) { + t.Logf("event received: %s", event) + if event.Op&Remove == Remove { + deleteReceived.increment() + } + if event.Op&Write == Write { + modifyReceived.increment() + } + if event.Op&Create == Create { + createReceived.increment() + } + } else { + t.Logf("unexpected event received: %s", event) + } + } + done <- true + }() + + // Create a file + // This should add at least one event to the fsnotify event queue + var f *os.File + f, err := os.OpenFile(testFile, os.O_WRONLY|os.O_CREATE, 0666) + if err != nil { + t.Fatalf("creating test file failed: %s", err) + } + f.Sync() + + time.Sleep(time.Millisecond) + f.WriteString("data") + f.Sync() + f.Close() + + time.Sleep(50 * time.Millisecond) // give system time to sync write change before delete + + os.Remove(testFile) + os.Remove(testFileAlreadyExists) + + // We expect this event to be received almost immediately, but let's wait 500 ms to be sure + time.Sleep(500 * time.Millisecond) + cReceived := createReceived.value() + if cReceived != 1 { + t.Fatalf("incorrect number of create events received after 500 ms (%d vs %d)", cReceived, 1) + } + mReceived := modifyReceived.value() + if mReceived != 1 { + t.Fatalf("incorrect number of modify events received after 500 ms (%d vs %d)", mReceived, 1) + } + dReceived := deleteReceived.value() + if dReceived != 2 { + t.Fatalf("incorrect number of delete events received after 500 ms (%d vs %d)", dReceived, 2) + } + + // Try closing the fsnotify instance + t.Log("calling Close()") + watcher.Close() + t.Log("waiting for the event channel to become closed...") + select { + case <-done: + t.Log("event channel closed") + case <-time.After(2 * time.Second): + t.Fatal("event stream was not closed after 2 seconds") + } +} + +func TestFsnotifyDeleteWatchedDir(t *testing.T) { + watcher := newWatcher(t) + defer watcher.Close() + + // Create directory to watch + testDir := tempMkdir(t) + defer os.RemoveAll(testDir) + + // Create a file before watching directory + testFileAlreadyExists := filepath.Join(testDir, "TestFsnotifyEventsExisting.testfile") + { + var f *os.File + f, err := os.OpenFile(testFileAlreadyExists, os.O_WRONLY|os.O_CREATE, 0666) + if err != nil { + t.Fatalf("creating test file failed: %s", err) + } + f.Sync() + f.Close() + } + + addWatch(t, watcher, testDir) + + // Add a watch for testFile + addWatch(t, watcher, testFileAlreadyExists) + + // Receive errors on the error channel on a separate goroutine + go func() { + for err := range watcher.Errors { + t.Fatalf("error received: %s", err) + } + }() + + // Receive events on the event channel on a separate goroutine + eventstream := watcher.Events + var deleteReceived counter + go func() { + for event := range eventstream { + // Only count relevant events + if event.Name == filepath.Clean(testDir) || event.Name == filepath.Clean(testFileAlreadyExists) { + t.Logf("event received: %s", event) + if event.Op&Remove == Remove { + deleteReceived.increment() + } + } else { + t.Logf("unexpected event received: %s", event) + } + } + }() + + os.RemoveAll(testDir) + + // We expect this event to be received almost immediately, but let's wait 500 ms to be sure + time.Sleep(500 * time.Millisecond) + dReceived := deleteReceived.value() + if dReceived < 2 { + t.Fatalf("did not receive at least %d delete events, received %d after 500 ms", 2, dReceived) + } +} + +func TestFsnotifySubDir(t *testing.T) { + watcher := newWatcher(t) + + // Create directory to watch + testDir := tempMkdir(t) + defer os.RemoveAll(testDir) + + testFile1 := filepath.Join(testDir, "TestFsnotifyFile1.testfile") + testSubDir := filepath.Join(testDir, "sub") + testSubDirFile := filepath.Join(testDir, "sub/TestFsnotifyFile1.testfile") + + // Receive errors on the error channel on a separate goroutine + go func() { + for err := range watcher.Errors { + t.Fatalf("error received: %s", err) + } + }() + + // Receive events on the event channel on a separate goroutine + eventstream := watcher.Events + var createReceived, deleteReceived counter + done := make(chan bool) + go func() { + for event := range eventstream { + // Only count relevant events + if event.Name == filepath.Clean(testDir) || event.Name == filepath.Clean(testSubDir) || event.Name == filepath.Clean(testFile1) { + t.Logf("event received: %s", event) + if event.Op&Create == Create { + createReceived.increment() + } + if event.Op&Remove == Remove { + deleteReceived.increment() + } + } else { + t.Logf("unexpected event received: %s", event) + } + } + done <- true + }() + + addWatch(t, watcher, testDir) + + // Create sub-directory + if err := os.Mkdir(testSubDir, 0777); err != nil { + t.Fatalf("failed to create test sub-directory: %s", err) + } + + // Create a file + var f *os.File + f, err := os.OpenFile(testFile1, os.O_WRONLY|os.O_CREATE, 0666) + if err != nil { + t.Fatalf("creating test file failed: %s", err) + } + f.Sync() + f.Close() + + // Create a file (Should not see this! we are not watching subdir) + var fs *os.File + fs, err = os.OpenFile(testSubDirFile, os.O_WRONLY|os.O_CREATE, 0666) + if err != nil { + t.Fatalf("creating test file failed: %s", err) + } + fs.Sync() + fs.Close() + + time.Sleep(200 * time.Millisecond) + + // Make sure receive deletes for both file and sub-directory + os.RemoveAll(testSubDir) + os.Remove(testFile1) + + // We expect this event to be received almost immediately, but let's wait 500 ms to be sure + time.Sleep(500 * time.Millisecond) + cReceived := createReceived.value() + if cReceived != 2 { + t.Fatalf("incorrect number of create events received after 500 ms (%d vs %d)", cReceived, 2) + } + dReceived := deleteReceived.value() + if dReceived != 2 { + t.Fatalf("incorrect number of delete events received after 500 ms (%d vs %d)", dReceived, 2) + } + + // Try closing the fsnotify instance + t.Log("calling Close()") + watcher.Close() + t.Log("waiting for the event channel to become closed...") + select { + case <-done: + t.Log("event channel closed") + case <-time.After(2 * time.Second): + t.Fatal("event stream was not closed after 2 seconds") + } +} + +func TestFsnotifyRename(t *testing.T) { + watcher := newWatcher(t) + + // Create directory to watch + testDir := tempMkdir(t) + defer os.RemoveAll(testDir) + + addWatch(t, watcher, testDir) + + // Receive errors on the error channel on a separate goroutine + go func() { + for err := range watcher.Errors { + t.Fatalf("error received: %s", err) + } + }() + + testFile := filepath.Join(testDir, "TestFsnotifyEvents.testfile") + testFileRenamed := filepath.Join(testDir, "TestFsnotifyEvents.testfileRenamed") + + // Receive events on the event channel on a separate goroutine + eventstream := watcher.Events + var renameReceived counter + done := make(chan bool) + go func() { + for event := range eventstream { + // Only count relevant events + if event.Name == filepath.Clean(testDir) || event.Name == filepath.Clean(testFile) || event.Name == filepath.Clean(testFileRenamed) { + if event.Op&Rename == Rename { + renameReceived.increment() + } + t.Logf("event received: %s", event) + } else { + t.Logf("unexpected event received: %s", event) + } + } + done <- true + }() + + // Create a file + // This should add at least one event to the fsnotify event queue + var f *os.File + f, err := os.OpenFile(testFile, os.O_WRONLY|os.O_CREATE, 0666) + if err != nil { + t.Fatalf("creating test file failed: %s", err) + } + f.Sync() + + f.WriteString("data") + f.Sync() + f.Close() + + // Add a watch for testFile + addWatch(t, watcher, testFile) + + if err := testRename(testFile, testFileRenamed); err != nil { + t.Fatalf("rename failed: %s", err) + } + + // We expect this event to be received almost immediately, but let's wait 500 ms to be sure + time.Sleep(500 * time.Millisecond) + if renameReceived.value() == 0 { + t.Fatal("fsnotify rename events have not been received after 500 ms") + } + + // Try closing the fsnotify instance + t.Log("calling Close()") + watcher.Close() + t.Log("waiting for the event channel to become closed...") + select { + case <-done: + t.Log("event channel closed") + case <-time.After(2 * time.Second): + t.Fatal("event stream was not closed after 2 seconds") + } + + os.Remove(testFileRenamed) +} + +func TestFsnotifyRenameToCreate(t *testing.T) { + watcher := newWatcher(t) + + // Create directory to watch + testDir := tempMkdir(t) + defer os.RemoveAll(testDir) + + // Create directory to get file + testDirFrom := tempMkdir(t) + defer os.RemoveAll(testDirFrom) + + addWatch(t, watcher, testDir) + + // Receive errors on the error channel on a separate goroutine + go func() { + for err := range watcher.Errors { + t.Fatalf("error received: %s", err) + } + }() + + testFile := filepath.Join(testDirFrom, "TestFsnotifyEvents.testfile") + testFileRenamed := filepath.Join(testDir, "TestFsnotifyEvents.testfileRenamed") + + // Receive events on the event channel on a separate goroutine + eventstream := watcher.Events + var createReceived counter + done := make(chan bool) + go func() { + for event := range eventstream { + // Only count relevant events + if event.Name == filepath.Clean(testDir) || event.Name == filepath.Clean(testFile) || event.Name == filepath.Clean(testFileRenamed) { + if event.Op&Create == Create { + createReceived.increment() + } + t.Logf("event received: %s", event) + } else { + t.Logf("unexpected event received: %s", event) + } + } + done <- true + }() + + // Create a file + // This should add at least one event to the fsnotify event queue + var f *os.File + f, err := os.OpenFile(testFile, os.O_WRONLY|os.O_CREATE, 0666) + if err != nil { + t.Fatalf("creating test file failed: %s", err) + } + f.Sync() + f.Close() + + if err := testRename(testFile, testFileRenamed); err != nil { + t.Fatalf("rename failed: %s", err) + } + + // We expect this event to be received almost immediately, but let's wait 500 ms to be sure + time.Sleep(500 * time.Millisecond) + if createReceived.value() == 0 { + t.Fatal("fsnotify create events have not been received after 500 ms") + } + + // Try closing the fsnotify instance + t.Log("calling Close()") + watcher.Close() + t.Log("waiting for the event channel to become closed...") + select { + case <-done: + t.Log("event channel closed") + case <-time.After(2 * time.Second): + t.Fatal("event stream was not closed after 2 seconds") + } + + os.Remove(testFileRenamed) +} + +func TestFsnotifyRenameToOverwrite(t *testing.T) { + switch runtime.GOOS { + case "plan9", "windows": + t.Skipf("skipping test on %q (os.Rename over existing file does not create event).", runtime.GOOS) + } + + watcher := newWatcher(t) + + // Create directory to watch + testDir := tempMkdir(t) + defer os.RemoveAll(testDir) + + // Create directory to get file + testDirFrom := tempMkdir(t) + defer os.RemoveAll(testDirFrom) + + testFile := filepath.Join(testDirFrom, "TestFsnotifyEvents.testfile") + testFileRenamed := filepath.Join(testDir, "TestFsnotifyEvents.testfileRenamed") + + // Create a file + var fr *os.File + fr, err := os.OpenFile(testFileRenamed, os.O_WRONLY|os.O_CREATE, 0666) + if err != nil { + t.Fatalf("creating test file failed: %s", err) + } + fr.Sync() + fr.Close() + + addWatch(t, watcher, testDir) + + // Receive errors on the error channel on a separate goroutine + go func() { + for err := range watcher.Errors { + t.Fatalf("error received: %s", err) + } + }() + + // Receive events on the event channel on a separate goroutine + eventstream := watcher.Events + var eventReceived counter + done := make(chan bool) + go func() { + for event := range eventstream { + // Only count relevant events + if event.Name == filepath.Clean(testFileRenamed) { + eventReceived.increment() + t.Logf("event received: %s", event) + } else { + t.Logf("unexpected event received: %s", event) + } + } + done <- true + }() + + // Create a file + // This should add at least one event to the fsnotify event queue + var f *os.File + f, err = os.OpenFile(testFile, os.O_WRONLY|os.O_CREATE, 0666) + if err != nil { + t.Fatalf("creating test file failed: %s", err) + } + f.Sync() + f.Close() + + if err := testRename(testFile, testFileRenamed); err != nil { + t.Fatalf("rename failed: %s", err) + } + + // We expect this event to be received almost immediately, but let's wait 500 ms to be sure + time.Sleep(500 * time.Millisecond) + if eventReceived.value() == 0 { + t.Fatal("fsnotify events have not been received after 500 ms") + } + + // Try closing the fsnotify instance + t.Log("calling Close()") + watcher.Close() + t.Log("waiting for the event channel to become closed...") + select { + case <-done: + t.Log("event channel closed") + case <-time.After(2 * time.Second): + t.Fatal("event stream was not closed after 2 seconds") + } + + os.Remove(testFileRenamed) +} + +func TestRemovalOfWatch(t *testing.T) { + // Create directory to watch + testDir := tempMkdir(t) + defer os.RemoveAll(testDir) + + // Create a file before watching directory + testFileAlreadyExists := filepath.Join(testDir, "TestFsnotifyEventsExisting.testfile") + { + var f *os.File + f, err := os.OpenFile(testFileAlreadyExists, os.O_WRONLY|os.O_CREATE, 0666) + if err != nil { + t.Fatalf("creating test file failed: %s", err) + } + f.Sync() + f.Close() + } + + watcher := newWatcher(t) + defer watcher.Close() + + addWatch(t, watcher, testDir) + if err := watcher.Remove(testDir); err != nil { + t.Fatalf("Could not remove the watch: %v\n", err) + } + + go func() { + select { + case ev := <-watcher.Events: + t.Fatalf("We received event: %v\n", ev) + case <-time.After(500 * time.Millisecond): + t.Log("No event received, as expected.") + } + }() + + time.Sleep(200 * time.Millisecond) + // Modify the file outside of the watched dir + f, err := os.Open(testFileAlreadyExists) + if err != nil { + t.Fatalf("Open test file failed: %s", err) + } + f.WriteString("data") + f.Sync() + f.Close() + if err := os.Chmod(testFileAlreadyExists, 0700); err != nil { + t.Fatalf("chmod failed: %s", err) + } + time.Sleep(400 * time.Millisecond) +} + +func TestFsnotifyAttrib(t *testing.T) { + if runtime.GOOS == "windows" { + t.Skip("attributes don't work on Windows.") + } + + watcher := newWatcher(t) + + // Create directory to watch + testDir := tempMkdir(t) + defer os.RemoveAll(testDir) + + // Receive errors on the error channel on a separate goroutine + go func() { + for err := range watcher.Errors { + t.Fatalf("error received: %s", err) + } + }() + + testFile := filepath.Join(testDir, "TestFsnotifyAttrib.testfile") + + // Receive events on the event channel on a separate goroutine + eventstream := watcher.Events + // The modifyReceived counter counts IsModify events that are not IsAttrib, + // and the attribReceived counts IsAttrib events (which are also IsModify as + // a consequence). + var modifyReceived counter + var attribReceived counter + done := make(chan bool) + go func() { + for event := range eventstream { + // Only count relevant events + if event.Name == filepath.Clean(testDir) || event.Name == filepath.Clean(testFile) { + if event.Op&Write == Write { + modifyReceived.increment() + } + if event.Op&Chmod == Chmod { + attribReceived.increment() + } + t.Logf("event received: %s", event) + } else { + t.Logf("unexpected event received: %s", event) + } + } + done <- true + }() + + // Create a file + // This should add at least one event to the fsnotify event queue + var f *os.File + f, err := os.OpenFile(testFile, os.O_WRONLY|os.O_CREATE, 0666) + if err != nil { + t.Fatalf("creating test file failed: %s", err) + } + f.Sync() + + f.WriteString("data") + f.Sync() + f.Close() + + // Add a watch for testFile + addWatch(t, watcher, testFile) + + if err := os.Chmod(testFile, 0700); err != nil { + t.Fatalf("chmod failed: %s", err) + } + + // We expect this event to be received almost immediately, but let's wait 500 ms to be sure + // Creating/writing a file changes also the mtime, so IsAttrib should be set to true here + time.Sleep(500 * time.Millisecond) + if modifyReceived.value() != 0 { + t.Fatal("received an unexpected modify event when creating a test file") + } + if attribReceived.value() == 0 { + t.Fatal("fsnotify attribute events have not received after 500 ms") + } + + // Modifying the contents of the file does not set the attrib flag (although eg. the mtime + // might have been modified). + modifyReceived.reset() + attribReceived.reset() + + f, err = os.OpenFile(testFile, os.O_WRONLY, 0) + if err != nil { + t.Fatalf("reopening test file failed: %s", err) + } + + f.WriteString("more data") + f.Sync() + f.Close() + + time.Sleep(500 * time.Millisecond) + + if modifyReceived.value() != 1 { + t.Fatal("didn't receive a modify event after changing test file contents") + } + + if attribReceived.value() != 0 { + t.Fatal("did receive an unexpected attrib event after changing test file contents") + } + + modifyReceived.reset() + attribReceived.reset() + + // Doing a chmod on the file should trigger an event with the "attrib" flag set (the contents + // of the file are not changed though) + if err := os.Chmod(testFile, 0600); err != nil { + t.Fatalf("chmod failed: %s", err) + } + + time.Sleep(500 * time.Millisecond) + + if attribReceived.value() != 1 { + t.Fatal("didn't receive an attribute change after 500ms") + } + + // Try closing the fsnotify instance + t.Log("calling Close()") + watcher.Close() + t.Log("waiting for the event channel to become closed...") + select { + case <-done: + t.Log("event channel closed") + case <-time.After(1e9): + t.Fatal("event stream was not closed after 1 second") + } + + os.Remove(testFile) +} + +func TestFsnotifyClose(t *testing.T) { + watcher := newWatcher(t) + watcher.Close() + + var done int32 + go func() { + watcher.Close() + atomic.StoreInt32(&done, 1) + }() + + time.Sleep(50e6) // 50 ms + if atomic.LoadInt32(&done) == 0 { + t.Fatal("double Close() test failed: second Close() call didn't return") + } + + testDir := tempMkdir(t) + defer os.RemoveAll(testDir) + + if err := watcher.Add(testDir); err == nil { + t.Fatal("expected error on Watch() after Close(), got nil") + } +} + +func TestFsnotifyFakeSymlink(t *testing.T) { + if runtime.GOOS == "windows" { + t.Skip("symlinks don't work on Windows.") + } + + watcher := newWatcher(t) + + // Create directory to watch + testDir := tempMkdir(t) + defer os.RemoveAll(testDir) + + var errorsReceived counter + // Receive errors on the error channel on a separate goroutine + go func() { + for errors := range watcher.Errors { + t.Logf("Received error: %s", errors) + errorsReceived.increment() + } + }() + + // Count the CREATE events received + var createEventsReceived, otherEventsReceived counter + go func() { + for ev := range watcher.Events { + t.Logf("event received: %s", ev) + if ev.Op&Create == Create { + createEventsReceived.increment() + } else { + otherEventsReceived.increment() + } + } + }() + + addWatch(t, watcher, testDir) + + if err := os.Symlink(filepath.Join(testDir, "zzz"), filepath.Join(testDir, "zzznew")); err != nil { + t.Fatalf("Failed to create bogus symlink: %s", err) + } + t.Logf("Created bogus symlink") + + // We expect this event to be received almost immediately, but let's wait 500 ms to be sure + time.Sleep(500 * time.Millisecond) + + // Should not be error, just no events for broken links (watching nothing) + if errorsReceived.value() > 0 { + t.Fatal("fsnotify errors have been received.") + } + if otherEventsReceived.value() > 0 { + t.Fatal("fsnotify other events received on the broken link") + } + + // Except for 1 create event (for the link itself) + if createEventsReceived.value() == 0 { + t.Fatal("fsnotify create events were not received after 500 ms") + } + if createEventsReceived.value() > 1 { + t.Fatal("fsnotify more create events received than expected") + } + + // Try closing the fsnotify instance + t.Log("calling Close()") + watcher.Close() +} + +func TestCyclicSymlink(t *testing.T) { + if runtime.GOOS == "windows" { + t.Skip("symlinks don't work on Windows.") + } + + watcher := newWatcher(t) + + testDir := tempMkdir(t) + defer os.RemoveAll(testDir) + + link := path.Join(testDir, "link") + if err := os.Symlink(".", link); err != nil { + t.Fatalf("could not make symlink: %v", err) + } + addWatch(t, watcher, testDir) + + var createEventsReceived counter + go func() { + for ev := range watcher.Events { + if ev.Op&Create == Create { + createEventsReceived.increment() + } + } + }() + + if err := os.Remove(link); err != nil { + t.Fatalf("Error removing link: %v", err) + } + + // It would be nice to be able to expect a delete event here, but kqueue has + // no way for us to get events on symlinks themselves, because opening them + // opens an fd to the file to which they point. + + if err := ioutil.WriteFile(link, []byte("foo"), 0700); err != nil { + t.Fatalf("could not make symlink: %v", err) + } + + // We expect this event to be received almost immediately, but let's wait 500 ms to be sure + time.Sleep(500 * time.Millisecond) + + if got := createEventsReceived.value(); got == 0 { + t.Errorf("want at least 1 create event got %v", got) + } + + watcher.Close() +} + +// TestConcurrentRemovalOfWatch tests that concurrent calls to RemoveWatch do not race. +// See https://codereview.appspot.com/103300045/ +// go test -test.run=TestConcurrentRemovalOfWatch -test.cpu=1,1,1,1,1 -race +func TestConcurrentRemovalOfWatch(t *testing.T) { + if runtime.GOOS != "darwin" { + t.Skip("regression test for race only present on darwin") + } + + // Create directory to watch + testDir := tempMkdir(t) + defer os.RemoveAll(testDir) + + // Create a file before watching directory + testFileAlreadyExists := filepath.Join(testDir, "TestFsnotifyEventsExisting.testfile") + { + var f *os.File + f, err := os.OpenFile(testFileAlreadyExists, os.O_WRONLY|os.O_CREATE, 0666) + if err != nil { + t.Fatalf("creating test file failed: %s", err) + } + f.Sync() + f.Close() + } + + watcher := newWatcher(t) + defer watcher.Close() + + addWatch(t, watcher, testDir) + + // Test that RemoveWatch can be invoked concurrently, with no data races. + removed1 := make(chan struct{}) + go func() { + defer close(removed1) + watcher.Remove(testDir) + }() + removed2 := make(chan struct{}) + go func() { + close(removed2) + watcher.Remove(testDir) + }() + <-removed1 + <-removed2 +} + +func TestClose(t *testing.T) { + // Regression test for #59 bad file descriptor from Close + testDir := tempMkdir(t) + defer os.RemoveAll(testDir) + + watcher := newWatcher(t) + if err := watcher.Add(testDir); err != nil { + t.Fatalf("Expected no error on Add, got %v", err) + } + err := watcher.Close() + if err != nil { + t.Fatalf("Expected no error on Close, got %v.", err) + } +} + +// TestRemoveWithClose tests if one can handle Remove events and, at the same +// time, close Watcher object without any data races. +func TestRemoveWithClose(t *testing.T) { + testDir := tempMkdir(t) + defer os.RemoveAll(testDir) + + const fileN = 200 + tempFiles := make([]string, 0, fileN) + for i := 0; i < fileN; i++ { + tempFiles = append(tempFiles, tempMkFile(t, testDir)) + } + watcher := newWatcher(t) + if err := watcher.Add(testDir); err != nil { + t.Fatalf("Expected no error on Add, got %v", err) + } + startC, stopC := make(chan struct{}), make(chan struct{}) + errC := make(chan error) + go func() { + for { + select { + case <-watcher.Errors: + case <-watcher.Events: + case <-stopC: + return + } + } + }() + go func() { + <-startC + for _, fileName := range tempFiles { + os.Remove(fileName) + } + }() + go func() { + <-startC + errC <- watcher.Close() + }() + close(startC) + defer close(stopC) + if err := <-errC; err != nil { + t.Fatalf("Expected no error on Close, got %v.", err) + } +} + +func testRename(file1, file2 string) error { + switch runtime.GOOS { + case "windows", "plan9": + return os.Rename(file1, file2) + default: + cmd := exec.Command("mv", file1, file2) + return cmd.Run() + } +} diff --git a/vendor/github.com/fsnotify/fsnotify/kqueue.go b/vendor/github.com/fsnotify/fsnotify/kqueue.go new file mode 100644 index 0000000000..c2b4acb18d --- /dev/null +++ b/vendor/github.com/fsnotify/fsnotify/kqueue.go @@ -0,0 +1,503 @@ +// 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. + +// +build freebsd openbsd netbsd dragonfly darwin + +package fsnotify + +import ( + "errors" + "fmt" + "io/ioutil" + "os" + "path/filepath" + "sync" + "time" + + "golang.org/x/sys/unix" +) + +// Watcher watches a set of files, delivering events to a channel. +type Watcher struct { + Events chan Event + Errors chan error + done chan bool // Channel for sending a "quit message" to the reader goroutine + + kq int // File descriptor (as returned by the kqueue() syscall). + + mu sync.Mutex // Protects access to watcher data + watches map[string]int // Map of watched file descriptors (key: path). + externalWatches map[string]bool // Map of watches added by user of the library. + dirFlags map[string]uint32 // Map of watched directories to fflags used in kqueue. + paths map[int]pathInfo // Map file descriptors to path names for processing kqueue events. + fileExists map[string]bool // Keep track of if we know this file exists (to stop duplicate create events). + isClosed bool // Set to true when Close() is first called +} + +type pathInfo struct { + name string + isDir bool +} + +// NewWatcher establishes a new watcher with the underlying OS and begins waiting for events. +func NewWatcher() (*Watcher, error) { + kq, err := kqueue() + if err != nil { + return nil, err + } + + w := &Watcher{ + kq: kq, + watches: make(map[string]int), + dirFlags: make(map[string]uint32), + paths: make(map[int]pathInfo), + fileExists: make(map[string]bool), + externalWatches: make(map[string]bool), + Events: make(chan Event), + Errors: make(chan error), + done: make(chan bool), + } + + go w.readEvents() + return w, nil +} + +// Close removes all watches and closes the events channel. +func (w *Watcher) Close() error { + w.mu.Lock() + if w.isClosed { + w.mu.Unlock() + return nil + } + w.isClosed = true + w.mu.Unlock() + + // copy paths to remove while locked + w.mu.Lock() + var pathsToRemove = make([]string, 0, len(w.watches)) + for name := range w.watches { + pathsToRemove = append(pathsToRemove, name) + } + w.mu.Unlock() + // unlock before calling Remove, which also locks + + var err error + for _, name := range pathsToRemove { + if e := w.Remove(name); e != nil && err == nil { + err = e + } + } + + // Send "quit" message to the reader goroutine: + w.done <- true + + return nil +} + +// Add starts watching the named file or directory (non-recursively). +func (w *Watcher) Add(name string) error { + w.mu.Lock() + w.externalWatches[name] = true + w.mu.Unlock() + _, err := w.addWatch(name, noteAllEvents) + return err +} + +// Remove stops watching the the named file or directory (non-recursively). +func (w *Watcher) Remove(name string) error { + name = filepath.Clean(name) + w.mu.Lock() + watchfd, ok := w.watches[name] + w.mu.Unlock() + if !ok { + return fmt.Errorf("can't remove non-existent kevent watch for: %s", name) + } + + const registerRemove = unix.EV_DELETE + if err := register(w.kq, []int{watchfd}, registerRemove, 0); err != nil { + return err + } + + unix.Close(watchfd) + + w.mu.Lock() + isDir := w.paths[watchfd].isDir + delete(w.watches, name) + delete(w.paths, watchfd) + delete(w.dirFlags, name) + w.mu.Unlock() + + // Find all watched paths that are in this directory that are not external. + if isDir { + var pathsToRemove []string + w.mu.Lock() + for _, path := range w.paths { + wdir, _ := filepath.Split(path.name) + if filepath.Clean(wdir) == name { + if !w.externalWatches[path.name] { + pathsToRemove = append(pathsToRemove, path.name) + } + } + } + w.mu.Unlock() + for _, name := range pathsToRemove { + // Since these are internal, not much sense in propagating error + // to the user, as that will just confuse them with an error about + // a path they did not explicitly watch themselves. + w.Remove(name) + } + } + + return nil +} + +// Watch all events (except NOTE_EXTEND, NOTE_LINK, NOTE_REVOKE) +const noteAllEvents = unix.NOTE_DELETE | unix.NOTE_WRITE | unix.NOTE_ATTRIB | unix.NOTE_RENAME + +// keventWaitTime to block on each read from kevent +var keventWaitTime = durationToTimespec(100 * time.Millisecond) + +// addWatch adds name to the watched file set. +// The flags are interpreted as described in kevent(2). +// Returns the real path to the file which was added, if any, which may be different from the one passed in the case of symlinks. +func (w *Watcher) addWatch(name string, flags uint32) (string, error) { + var isDir bool + // Make ./name and name equivalent + name = filepath.Clean(name) + + w.mu.Lock() + if w.isClosed { + w.mu.Unlock() + return "", errors.New("kevent instance already closed") + } + watchfd, alreadyWatching := w.watches[name] + // We already have a watch, but we can still override flags. + if alreadyWatching { + isDir = w.paths[watchfd].isDir + } + w.mu.Unlock() + + if !alreadyWatching { + fi, err := os.Lstat(name) + if err != nil { + return "", err + } + + // Don't watch sockets. + if fi.Mode()&os.ModeSocket == os.ModeSocket { + return "", nil + } + + // Don't watch named pipes. + if fi.Mode()&os.ModeNamedPipe == os.ModeNamedPipe { + return "", nil + } + + // Follow Symlinks + // Unfortunately, Linux can add bogus symlinks to watch list without + // issue, and Windows can't do symlinks period (AFAIK). To maintain + // consistency, we will act like everything is fine. There will simply + // be no file events for broken symlinks. + // Hence the returns of nil on errors. + if fi.Mode()&os.ModeSymlink == os.ModeSymlink { + name, err = filepath.EvalSymlinks(name) + if err != nil { + return "", nil + } + + w.mu.Lock() + _, alreadyWatching = w.watches[name] + w.mu.Unlock() + + if alreadyWatching { + return name, nil + } + + fi, err = os.Lstat(name) + if err != nil { + return "", nil + } + } + + watchfd, err = unix.Open(name, openMode, 0700) + if watchfd == -1 { + return "", err + } + + isDir = fi.IsDir() + } + + const registerAdd = unix.EV_ADD | unix.EV_CLEAR | unix.EV_ENABLE + if err := register(w.kq, []int{watchfd}, registerAdd, flags); err != nil { + unix.Close(watchfd) + return "", err + } + + if !alreadyWatching { + w.mu.Lock() + w.watches[name] = watchfd + w.paths[watchfd] = pathInfo{name: name, isDir: isDir} + w.mu.Unlock() + } + + if isDir { + // Watch the directory if it has not been watched before, + // or if it was watched before, but perhaps only a NOTE_DELETE (watchDirectoryFiles) + w.mu.Lock() + + watchDir := (flags&unix.NOTE_WRITE) == unix.NOTE_WRITE && + (!alreadyWatching || (w.dirFlags[name]&unix.NOTE_WRITE) != unix.NOTE_WRITE) + // Store flags so this watch can be updated later + w.dirFlags[name] = flags + w.mu.Unlock() + + if watchDir { + if err := w.watchDirectoryFiles(name); err != nil { + return "", err + } + } + } + return name, nil +} + +// readEvents reads from kqueue and converts the received kevents into +// Event values that it sends down the Events channel. +func (w *Watcher) readEvents() { + eventBuffer := make([]unix.Kevent_t, 10) + + for { + // See if there is a message on the "done" channel + select { + case <-w.done: + err := unix.Close(w.kq) + if err != nil { + w.Errors <- err + } + close(w.Events) + close(w.Errors) + return + default: + } + + // Get new events + kevents, err := read(w.kq, eventBuffer, &keventWaitTime) + // EINTR is okay, the syscall was interrupted before timeout expired. + if err != nil && err != unix.EINTR { + w.Errors <- err + continue + } + + // Flush the events we received to the Events channel + for len(kevents) > 0 { + kevent := &kevents[0] + watchfd := int(kevent.Ident) + mask := uint32(kevent.Fflags) + w.mu.Lock() + path := w.paths[watchfd] + w.mu.Unlock() + event := newEvent(path.name, mask) + + if path.isDir && !(event.Op&Remove == Remove) { + // Double check to make sure the directory exists. This can happen when + // we do a rm -fr on a recursively watched folders and we receive a + // modification event first but the folder has been deleted and later + // receive the delete event + if _, err := os.Lstat(event.Name); os.IsNotExist(err) { + // mark is as delete event + event.Op |= Remove + } + } + + if event.Op&Rename == Rename || event.Op&Remove == Remove { + w.Remove(event.Name) + w.mu.Lock() + delete(w.fileExists, event.Name) + w.mu.Unlock() + } + + if path.isDir && event.Op&Write == Write && !(event.Op&Remove == Remove) { + w.sendDirectoryChangeEvents(event.Name) + } else { + // Send the event on the Events channel + w.Events <- event + } + + if event.Op&Remove == Remove { + // Look for a file that may have overwritten this. + // For example, mv f1 f2 will delete f2, then create f2. + if path.isDir { + fileDir := filepath.Clean(event.Name) + w.mu.Lock() + _, found := w.watches[fileDir] + w.mu.Unlock() + if found { + // make sure the directory exists before we watch for changes. When we + // do a recursive watch and perform rm -fr, the parent directory might + // have gone missing, ignore the missing directory and let the + // upcoming delete event remove the watch from the parent directory. + if _, err := os.Lstat(fileDir); err == nil { + w.sendDirectoryChangeEvents(fileDir) + } + } + } else { + filePath := filepath.Clean(event.Name) + if fileInfo, err := os.Lstat(filePath); err == nil { + w.sendFileCreatedEventIfNew(filePath, fileInfo) + } + } + } + + // Move to next event + kevents = kevents[1:] + } + } +} + +// newEvent returns an platform-independent Event based on kqueue Fflags. +func newEvent(name string, mask uint32) Event { + e := Event{Name: name} + if mask&unix.NOTE_DELETE == unix.NOTE_DELETE { + e.Op |= Remove + } + if mask&unix.NOTE_WRITE == unix.NOTE_WRITE { + e.Op |= Write + } + if mask&unix.NOTE_RENAME == unix.NOTE_RENAME { + e.Op |= Rename + } + if mask&unix.NOTE_ATTRIB == unix.NOTE_ATTRIB { + e.Op |= Chmod + } + return e +} + +func newCreateEvent(name string) Event { + return Event{Name: name, Op: Create} +} + +// watchDirectoryFiles to mimic inotify when adding a watch on a directory +func (w *Watcher) watchDirectoryFiles(dirPath string) error { + // Get all files + files, err := ioutil.ReadDir(dirPath) + if err != nil { + return err + } + + for _, fileInfo := range files { + filePath := filepath.Join(dirPath, fileInfo.Name()) + filePath, err = w.internalWatch(filePath, fileInfo) + if err != nil { + return err + } + + w.mu.Lock() + w.fileExists[filePath] = true + w.mu.Unlock() + } + + return nil +} + +// sendDirectoryEvents searches the directory for newly created files +// and sends them over the event channel. This functionality is to have +// the BSD version of fsnotify match Linux inotify which provides a +// create event for files created in a watched directory. +func (w *Watcher) sendDirectoryChangeEvents(dirPath string) { + // Get all files + files, err := ioutil.ReadDir(dirPath) + if err != nil { + w.Errors <- err + } + + // Search for new files + for _, fileInfo := range files { + filePath := filepath.Join(dirPath, fileInfo.Name()) + err := w.sendFileCreatedEventIfNew(filePath, fileInfo) + + if err != nil { + return + } + } +} + +// sendFileCreatedEvent sends a create event if the file isn't already being tracked. +func (w *Watcher) sendFileCreatedEventIfNew(filePath string, fileInfo os.FileInfo) (err error) { + w.mu.Lock() + _, doesExist := w.fileExists[filePath] + w.mu.Unlock() + if !doesExist { + // Send create event + w.Events <- newCreateEvent(filePath) + } + + // like watchDirectoryFiles (but without doing another ReadDir) + filePath, err = w.internalWatch(filePath, fileInfo) + if err != nil { + return err + } + + w.mu.Lock() + w.fileExists[filePath] = true + w.mu.Unlock() + + return nil +} + +func (w *Watcher) internalWatch(name string, fileInfo os.FileInfo) (string, error) { + if fileInfo.IsDir() { + // mimic Linux providing delete events for subdirectories + // but preserve the flags used if currently watching subdirectory + w.mu.Lock() + flags := w.dirFlags[name] + w.mu.Unlock() + + flags |= unix.NOTE_DELETE | unix.NOTE_RENAME + return w.addWatch(name, flags) + } + + // watch file to mimic Linux inotify + return w.addWatch(name, noteAllEvents) +} + +// kqueue creates a new kernel event queue and returns a descriptor. +func kqueue() (kq int, err error) { + kq, err = unix.Kqueue() + if kq == -1 { + return kq, err + } + return kq, nil +} + +// register events with the queue +func register(kq int, fds []int, flags int, fflags uint32) error { + changes := make([]unix.Kevent_t, len(fds)) + + for i, fd := range fds { + // SetKevent converts int to the platform-specific types: + unix.SetKevent(&changes[i], fd, unix.EVFILT_VNODE, flags) + changes[i].Fflags = fflags + } + + // register the events + success, err := unix.Kevent(kq, changes, nil, nil) + if success == -1 { + return err + } + return nil +} + +// read retrieves pending events, or waits until an event occurs. +// A timeout of nil blocks indefinitely, while 0 polls the queue. +func read(kq int, events []unix.Kevent_t, timeout *unix.Timespec) ([]unix.Kevent_t, error) { + n, err := unix.Kevent(kq, nil, events, timeout) + if err != nil { + return nil, err + } + return events[0:n], nil +} + +// durationToTimespec prepares a timeout value +func durationToTimespec(d time.Duration) unix.Timespec { + return unix.NsecToTimespec(d.Nanoseconds()) +} diff --git a/vendor/github.com/fsnotify/fsnotify/open_mode_bsd.go b/vendor/github.com/fsnotify/fsnotify/open_mode_bsd.go new file mode 100644 index 0000000000..7d8de14513 --- /dev/null +++ b/vendor/github.com/fsnotify/fsnotify/open_mode_bsd.go @@ -0,0 +1,11 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build freebsd openbsd netbsd dragonfly + +package fsnotify + +import "golang.org/x/sys/unix" + +const openMode = unix.O_NONBLOCK | unix.O_RDONLY diff --git a/vendor/github.com/fsnotify/fsnotify/open_mode_darwin.go b/vendor/github.com/fsnotify/fsnotify/open_mode_darwin.go new file mode 100644 index 0000000000..9139e17161 --- /dev/null +++ b/vendor/github.com/fsnotify/fsnotify/open_mode_darwin.go @@ -0,0 +1,12 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build darwin + +package fsnotify + +import "golang.org/x/sys/unix" + +// note: this constant is not defined on BSD +const openMode = unix.O_EVTONLY diff --git a/vendor/github.com/fsnotify/fsnotify/windows.go b/vendor/github.com/fsnotify/fsnotify/windows.go new file mode 100644 index 0000000000..09436f31d8 --- /dev/null +++ b/vendor/github.com/fsnotify/fsnotify/windows.go @@ -0,0 +1,561 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build windows + +package fsnotify + +import ( + "errors" + "fmt" + "os" + "path/filepath" + "runtime" + "sync" + "syscall" + "unsafe" +) + +// Watcher watches a set of files, delivering events to a channel. +type Watcher struct { + Events chan Event + Errors chan error + isClosed bool // Set to true when Close() is first called + mu sync.Mutex // Map access + port syscall.Handle // Handle to completion port + watches watchMap // Map of watches (key: i-number) + input chan *input // Inputs to the reader are sent on this channel + quit chan chan<- error +} + +// NewWatcher establishes a new watcher with the underlying OS and begins waiting for events. +func NewWatcher() (*Watcher, error) { + port, e := syscall.CreateIoCompletionPort(syscall.InvalidHandle, 0, 0, 0) + if e != nil { + return nil, os.NewSyscallError("CreateIoCompletionPort", e) + } + w := &Watcher{ + port: port, + watches: make(watchMap), + input: make(chan *input, 1), + Events: make(chan Event, 50), + Errors: make(chan error), + quit: make(chan chan<- error, 1), + } + go w.readEvents() + return w, nil +} + +// Close removes all watches and closes the events channel. +func (w *Watcher) Close() error { + if w.isClosed { + return nil + } + w.isClosed = true + + // Send "quit" message to the reader goroutine + ch := make(chan error) + w.quit <- ch + if err := w.wakeupReader(); err != nil { + return err + } + return <-ch +} + +// Add starts watching the named file or directory (non-recursively). +func (w *Watcher) Add(name string) error { + if w.isClosed { + return errors.New("watcher already closed") + } + in := &input{ + op: opAddWatch, + path: filepath.Clean(name), + flags: sysFSALLEVENTS, + reply: make(chan error), + } + w.input <- in + if err := w.wakeupReader(); err != nil { + return err + } + return <-in.reply +} + +// Remove stops watching the the named file or directory (non-recursively). +func (w *Watcher) Remove(name string) error { + in := &input{ + op: opRemoveWatch, + path: filepath.Clean(name), + reply: make(chan error), + } + w.input <- in + if err := w.wakeupReader(); err != nil { + return err + } + return <-in.reply +} + +const ( + // Options for AddWatch + sysFSONESHOT = 0x80000000 + sysFSONLYDIR = 0x1000000 + + // Events + sysFSACCESS = 0x1 + sysFSALLEVENTS = 0xfff + sysFSATTRIB = 0x4 + sysFSCLOSE = 0x18 + sysFSCREATE = 0x100 + sysFSDELETE = 0x200 + sysFSDELETESELF = 0x400 + sysFSMODIFY = 0x2 + sysFSMOVE = 0xc0 + sysFSMOVEDFROM = 0x40 + sysFSMOVEDTO = 0x80 + sysFSMOVESELF = 0x800 + + // Special events + sysFSIGNORED = 0x8000 + sysFSQOVERFLOW = 0x4000 +) + +func newEvent(name string, mask uint32) Event { + e := Event{Name: name} + if mask&sysFSCREATE == sysFSCREATE || mask&sysFSMOVEDTO == sysFSMOVEDTO { + e.Op |= Create + } + if mask&sysFSDELETE == sysFSDELETE || mask&sysFSDELETESELF == sysFSDELETESELF { + e.Op |= Remove + } + if mask&sysFSMODIFY == sysFSMODIFY { + e.Op |= Write + } + if mask&sysFSMOVE == sysFSMOVE || mask&sysFSMOVESELF == sysFSMOVESELF || mask&sysFSMOVEDFROM == sysFSMOVEDFROM { + e.Op |= Rename + } + if mask&sysFSATTRIB == sysFSATTRIB { + e.Op |= Chmod + } + return e +} + +const ( + opAddWatch = iota + opRemoveWatch +) + +const ( + provisional uint64 = 1 << (32 + iota) +) + +type input struct { + op int + path string + flags uint32 + reply chan error +} + +type inode struct { + handle syscall.Handle + volume uint32 + index uint64 +} + +type watch struct { + ov syscall.Overlapped + ino *inode // i-number + path string // Directory path + mask uint64 // Directory itself is being watched with these notify flags + names map[string]uint64 // Map of names being watched and their notify flags + rename string // Remembers the old name while renaming a file + buf [4096]byte +} + +type indexMap map[uint64]*watch +type watchMap map[uint32]indexMap + +func (w *Watcher) wakeupReader() error { + e := syscall.PostQueuedCompletionStatus(w.port, 0, 0, nil) + if e != nil { + return os.NewSyscallError("PostQueuedCompletionStatus", e) + } + return nil +} + +func getDir(pathname string) (dir string, err error) { + attr, e := syscall.GetFileAttributes(syscall.StringToUTF16Ptr(pathname)) + if e != nil { + return "", os.NewSyscallError("GetFileAttributes", e) + } + if attr&syscall.FILE_ATTRIBUTE_DIRECTORY != 0 { + dir = pathname + } else { + dir, _ = filepath.Split(pathname) + dir = filepath.Clean(dir) + } + return +} + +func getIno(path string) (ino *inode, err error) { + h, e := syscall.CreateFile(syscall.StringToUTF16Ptr(path), + syscall.FILE_LIST_DIRECTORY, + syscall.FILE_SHARE_READ|syscall.FILE_SHARE_WRITE|syscall.FILE_SHARE_DELETE, + nil, syscall.OPEN_EXISTING, + syscall.FILE_FLAG_BACKUP_SEMANTICS|syscall.FILE_FLAG_OVERLAPPED, 0) + if e != nil { + return nil, os.NewSyscallError("CreateFile", e) + } + var fi syscall.ByHandleFileInformation + if e = syscall.GetFileInformationByHandle(h, &fi); e != nil { + syscall.CloseHandle(h) + return nil, os.NewSyscallError("GetFileInformationByHandle", e) + } + ino = &inode{ + handle: h, + volume: fi.VolumeSerialNumber, + index: uint64(fi.FileIndexHigh)<<32 | uint64(fi.FileIndexLow), + } + return ino, nil +} + +// Must run within the I/O thread. +func (m watchMap) get(ino *inode) *watch { + if i := m[ino.volume]; i != nil { + return i[ino.index] + } + return nil +} + +// Must run within the I/O thread. +func (m watchMap) set(ino *inode, watch *watch) { + i := m[ino.volume] + if i == nil { + i = make(indexMap) + m[ino.volume] = i + } + i[ino.index] = watch +} + +// Must run within the I/O thread. +func (w *Watcher) addWatch(pathname string, flags uint64) error { + dir, err := getDir(pathname) + if err != nil { + return err + } + if flags&sysFSONLYDIR != 0 && pathname != dir { + return nil + } + ino, err := getIno(dir) + if err != nil { + return err + } + w.mu.Lock() + watchEntry := w.watches.get(ino) + w.mu.Unlock() + if watchEntry == nil { + if _, e := syscall.CreateIoCompletionPort(ino.handle, w.port, 0, 0); e != nil { + syscall.CloseHandle(ino.handle) + return os.NewSyscallError("CreateIoCompletionPort", e) + } + watchEntry = &watch{ + ino: ino, + path: dir, + names: make(map[string]uint64), + } + w.mu.Lock() + w.watches.set(ino, watchEntry) + w.mu.Unlock() + flags |= provisional + } else { + syscall.CloseHandle(ino.handle) + } + if pathname == dir { + watchEntry.mask |= flags + } else { + watchEntry.names[filepath.Base(pathname)] |= flags + } + if err = w.startRead(watchEntry); err != nil { + return err + } + if pathname == dir { + watchEntry.mask &= ^provisional + } else { + watchEntry.names[filepath.Base(pathname)] &= ^provisional + } + return nil +} + +// Must run within the I/O thread. +func (w *Watcher) remWatch(pathname string) error { + dir, err := getDir(pathname) + if err != nil { + return err + } + ino, err := getIno(dir) + if err != nil { + return err + } + w.mu.Lock() + watch := w.watches.get(ino) + w.mu.Unlock() + if watch == nil { + return fmt.Errorf("can't remove non-existent watch for: %s", pathname) + } + if pathname == dir { + w.sendEvent(watch.path, watch.mask&sysFSIGNORED) + watch.mask = 0 + } else { + name := filepath.Base(pathname) + w.sendEvent(filepath.Join(watch.path, name), watch.names[name]&sysFSIGNORED) + delete(watch.names, name) + } + return w.startRead(watch) +} + +// Must run within the I/O thread. +func (w *Watcher) deleteWatch(watch *watch) { + for name, mask := range watch.names { + if mask&provisional == 0 { + w.sendEvent(filepath.Join(watch.path, name), mask&sysFSIGNORED) + } + delete(watch.names, name) + } + if watch.mask != 0 { + if watch.mask&provisional == 0 { + w.sendEvent(watch.path, watch.mask&sysFSIGNORED) + } + watch.mask = 0 + } +} + +// Must run within the I/O thread. +func (w *Watcher) startRead(watch *watch) error { + if e := syscall.CancelIo(watch.ino.handle); e != nil { + w.Errors <- os.NewSyscallError("CancelIo", e) + w.deleteWatch(watch) + } + mask := toWindowsFlags(watch.mask) + for _, m := range watch.names { + mask |= toWindowsFlags(m) + } + if mask == 0 { + if e := syscall.CloseHandle(watch.ino.handle); e != nil { + w.Errors <- os.NewSyscallError("CloseHandle", e) + } + w.mu.Lock() + delete(w.watches[watch.ino.volume], watch.ino.index) + w.mu.Unlock() + return nil + } + e := syscall.ReadDirectoryChanges(watch.ino.handle, &watch.buf[0], + uint32(unsafe.Sizeof(watch.buf)), false, mask, nil, &watch.ov, 0) + if e != nil { + err := os.NewSyscallError("ReadDirectoryChanges", e) + if e == syscall.ERROR_ACCESS_DENIED && watch.mask&provisional == 0 { + // Watched directory was probably removed + if w.sendEvent(watch.path, watch.mask&sysFSDELETESELF) { + if watch.mask&sysFSONESHOT != 0 { + watch.mask = 0 + } + } + err = nil + } + w.deleteWatch(watch) + w.startRead(watch) + return err + } + return nil +} + +// readEvents reads from the I/O completion port, converts the +// received events into Event objects and sends them via the Events channel. +// Entry point to the I/O thread. +func (w *Watcher) readEvents() { + var ( + n, key uint32 + ov *syscall.Overlapped + ) + runtime.LockOSThread() + + for { + e := syscall.GetQueuedCompletionStatus(w.port, &n, &key, &ov, syscall.INFINITE) + watch := (*watch)(unsafe.Pointer(ov)) + + if watch == nil { + select { + case ch := <-w.quit: + w.mu.Lock() + var indexes []indexMap + for _, index := range w.watches { + indexes = append(indexes, index) + } + w.mu.Unlock() + for _, index := range indexes { + for _, watch := range index { + w.deleteWatch(watch) + w.startRead(watch) + } + } + var err error + if e := syscall.CloseHandle(w.port); e != nil { + err = os.NewSyscallError("CloseHandle", e) + } + close(w.Events) + close(w.Errors) + ch <- err + return + case in := <-w.input: + switch in.op { + case opAddWatch: + in.reply <- w.addWatch(in.path, uint64(in.flags)) + case opRemoveWatch: + in.reply <- w.remWatch(in.path) + } + default: + } + continue + } + + switch e { + case syscall.ERROR_MORE_DATA: + if watch == nil { + w.Errors <- errors.New("ERROR_MORE_DATA has unexpectedly null lpOverlapped buffer") + } else { + // The i/o succeeded but the buffer is full. + // In theory we should be building up a full packet. + // In practice we can get away with just carrying on. + n = uint32(unsafe.Sizeof(watch.buf)) + } + case syscall.ERROR_ACCESS_DENIED: + // Watched directory was probably removed + w.sendEvent(watch.path, watch.mask&sysFSDELETESELF) + w.deleteWatch(watch) + w.startRead(watch) + continue + case syscall.ERROR_OPERATION_ABORTED: + // CancelIo was called on this handle + continue + default: + w.Errors <- os.NewSyscallError("GetQueuedCompletionPort", e) + continue + case nil: + } + + var offset uint32 + for { + if n == 0 { + w.Events <- newEvent("", sysFSQOVERFLOW) + w.Errors <- errors.New("short read in readEvents()") + break + } + + // Point "raw" to the event in the buffer + raw := (*syscall.FileNotifyInformation)(unsafe.Pointer(&watch.buf[offset])) + buf := (*[syscall.MAX_PATH]uint16)(unsafe.Pointer(&raw.FileName)) + name := syscall.UTF16ToString(buf[:raw.FileNameLength/2]) + fullname := filepath.Join(watch.path, name) + + var mask uint64 + switch raw.Action { + case syscall.FILE_ACTION_REMOVED: + mask = sysFSDELETESELF + case syscall.FILE_ACTION_MODIFIED: + mask = sysFSMODIFY + case syscall.FILE_ACTION_RENAMED_OLD_NAME: + watch.rename = name + case syscall.FILE_ACTION_RENAMED_NEW_NAME: + if watch.names[watch.rename] != 0 { + watch.names[name] |= watch.names[watch.rename] + delete(watch.names, watch.rename) + mask = sysFSMOVESELF + } + } + + sendNameEvent := func() { + if w.sendEvent(fullname, watch.names[name]&mask) { + if watch.names[name]&sysFSONESHOT != 0 { + delete(watch.names, name) + } + } + } + if raw.Action != syscall.FILE_ACTION_RENAMED_NEW_NAME { + sendNameEvent() + } + if raw.Action == syscall.FILE_ACTION_REMOVED { + w.sendEvent(fullname, watch.names[name]&sysFSIGNORED) + delete(watch.names, name) + } + if w.sendEvent(fullname, watch.mask&toFSnotifyFlags(raw.Action)) { + if watch.mask&sysFSONESHOT != 0 { + watch.mask = 0 + } + } + if raw.Action == syscall.FILE_ACTION_RENAMED_NEW_NAME { + fullname = filepath.Join(watch.path, watch.rename) + sendNameEvent() + } + + // Move to the next event in the buffer + if raw.NextEntryOffset == 0 { + break + } + offset += raw.NextEntryOffset + + // Error! + if offset >= n { + w.Errors <- errors.New("Windows system assumed buffer larger than it is, events have likely been missed.") + break + } + } + + if err := w.startRead(watch); err != nil { + w.Errors <- err + } + } +} + +func (w *Watcher) sendEvent(name string, mask uint64) bool { + if mask == 0 { + return false + } + event := newEvent(name, uint32(mask)) + select { + case ch := <-w.quit: + w.quit <- ch + case w.Events <- event: + } + return true +} + +func toWindowsFlags(mask uint64) uint32 { + var m uint32 + if mask&sysFSACCESS != 0 { + m |= syscall.FILE_NOTIFY_CHANGE_LAST_ACCESS + } + if mask&sysFSMODIFY != 0 { + m |= syscall.FILE_NOTIFY_CHANGE_LAST_WRITE + } + if mask&sysFSATTRIB != 0 { + m |= syscall.FILE_NOTIFY_CHANGE_ATTRIBUTES + } + if mask&(sysFSMOVE|sysFSCREATE|sysFSDELETE) != 0 { + m |= syscall.FILE_NOTIFY_CHANGE_FILE_NAME | syscall.FILE_NOTIFY_CHANGE_DIR_NAME + } + return m +} + +func toFSnotifyFlags(action uint32) uint64 { + switch action { + case syscall.FILE_ACTION_ADDED: + return sysFSCREATE + case syscall.FILE_ACTION_REMOVED: + return sysFSDELETE + case syscall.FILE_ACTION_MODIFIED: + return sysFSMODIFY + case syscall.FILE_ACTION_RENAMED_OLD_NAME: + return sysFSMOVEDFROM + case syscall.FILE_ACTION_RENAMED_NEW_NAME: + return sysFSMOVEDTO + } + return 0 +} diff --git a/vendor/github.com/hashicorp/hcl/.gitignore b/vendor/github.com/hashicorp/hcl/.gitignore new file mode 100644 index 0000000000..15586a2b54 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/.gitignore @@ -0,0 +1,9 @@ +y.output + +# ignore intellij files +.idea +*.iml +*.ipr +*.iws + +*.test diff --git a/vendor/github.com/hashicorp/hcl/LICENSE b/vendor/github.com/hashicorp/hcl/LICENSE new file mode 100644 index 0000000000..c33dcc7c92 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/LICENSE @@ -0,0 +1,354 @@ +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/hcl/Makefile b/vendor/github.com/hashicorp/hcl/Makefile new file mode 100644 index 0000000000..84fd743f5c --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/Makefile @@ -0,0 +1,18 @@ +TEST?=./... + +default: test + +fmt: generate + go fmt ./... + +test: generate + go get -t ./... + go test $(TEST) $(TESTARGS) + +generate: + go generate ./... + +updatedeps: + go get -u golang.org/x/tools/cmd/stringer + +.PHONY: default generate test updatedeps diff --git a/vendor/github.com/hashicorp/hcl/README.md b/vendor/github.com/hashicorp/hcl/README.md new file mode 100644 index 0000000000..c8223326dd --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/README.md @@ -0,0 +1,125 @@ +# HCL + +[![GoDoc](https://godoc.org/github.com/hashicorp/hcl?status.png)](https://godoc.org/github.com/hashicorp/hcl) [![Build Status](https://travis-ci.org/hashicorp/hcl.svg?branch=master)](https://travis-ci.org/hashicorp/hcl) + +HCL (HashiCorp Configuration Language) is a configuration language built +by HashiCorp. The goal of HCL is to build a structured configuration language +that is both human and machine friendly for use with command-line tools, but +specifically targeted towards DevOps tools, servers, etc. + +HCL is also fully JSON compatible. That is, JSON can be used as completely +valid input to a system expecting HCL. This helps makes systems +interoperable with other systems. + +HCL is heavily inspired by +[libucl](https://github.com/vstakhov/libucl), +nginx configuration, and others similar. + +## Why? + +A common question when viewing HCL is to ask the question: why not +JSON, YAML, etc.? + +Prior to HCL, the tools we built at [HashiCorp](http://www.hashicorp.com) +used a variety of configuration languages from full programming languages +such as Ruby to complete data structure languages such as JSON. What we +learned is that some people wanted human-friendly configuration languages +and some people wanted machine-friendly languages. + +JSON fits a nice balance in this, but is fairly verbose and most +importantly doesn't support comments. With YAML, we found that beginners +had a really hard time determining what the actual structure was, and +ended up guessing more often than not whether to use a hyphen, colon, etc. +in order to represent some configuration key. + +Full programming languages such as Ruby enable complex behavior +a configuration language shouldn't usually allow, and also forces +people to learn some set of Ruby. + +Because of this, we decided to create our own configuration language +that is JSON-compatible. Our configuration language (HCL) is designed +to be written and modified by humans. The API for HCL allows JSON +as an input so that it is also machine-friendly (machines can generate +JSON instead of trying to generate HCL). + +Our goal with HCL is not to alienate other configuration languages. +It is instead to provide HCL as a specialized language for our tools, +and JSON as the interoperability layer. + +## Syntax + +For a complete grammar, please see the parser itself. A high-level overview +of the syntax and grammar is listed here. + + * Single line comments start with `#` or `//` + + * Multi-line comments are wrapped in `/*` and `*/`. Nested block comments + are not allowed. A multi-line comment (also known as a block comment) + terminates at the first `*/` found. + + * Values are assigned with the syntax `key = value` (whitespace doesn't + matter). The value can be any primitive: a string, number, boolean, + object, or list. + + * Strings are double-quoted and can contain any UTF-8 characters. + Example: `"Hello, World"` + + * Multi-line strings start with `<- + echo %Path% + + go version + + go env + + go get -t ./... + +build_script: +- cmd: go test -v ./... diff --git a/vendor/github.com/hashicorp/hcl/decoder.go b/vendor/github.com/hashicorp/hcl/decoder.go new file mode 100644 index 0000000000..bed9ebbe14 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/decoder.go @@ -0,0 +1,729 @@ +package hcl + +import ( + "errors" + "fmt" + "reflect" + "sort" + "strconv" + "strings" + + "github.com/hashicorp/hcl/hcl/ast" + "github.com/hashicorp/hcl/hcl/parser" + "github.com/hashicorp/hcl/hcl/token" +) + +// This is the tag to use with structures to have settings for HCL +const tagName = "hcl" + +var ( + // nodeType holds a reference to the type of ast.Node + nodeType reflect.Type = findNodeType() +) + +// Unmarshal accepts a byte slice as input and writes the +// data to the value pointed to by v. +func Unmarshal(bs []byte, v interface{}) error { + root, err := parse(bs) + if err != nil { + return err + } + + return DecodeObject(v, root) +} + +// Decode reads the given input and decodes it into the structure +// given by `out`. +func Decode(out interface{}, in string) error { + obj, err := Parse(in) + if err != nil { + return err + } + + return DecodeObject(out, obj) +} + +// DecodeObject is a lower-level version of Decode. It decodes a +// raw Object into the given output. +func DecodeObject(out interface{}, n ast.Node) error { + val := reflect.ValueOf(out) + if val.Kind() != reflect.Ptr { + return errors.New("result must be a pointer") + } + + // If we have the file, we really decode the root node + if f, ok := n.(*ast.File); ok { + n = f.Node + } + + var d decoder + return d.decode("root", n, val.Elem()) +} + +type decoder struct { + stack []reflect.Kind +} + +func (d *decoder) decode(name string, node ast.Node, result reflect.Value) error { + k := result + + // If we have an interface with a valid value, we use that + // for the check. + if result.Kind() == reflect.Interface { + elem := result.Elem() + if elem.IsValid() { + k = elem + } + } + + // Push current onto stack unless it is an interface. + if k.Kind() != reflect.Interface { + d.stack = append(d.stack, k.Kind()) + + // Schedule a pop + defer func() { + d.stack = d.stack[:len(d.stack)-1] + }() + } + + switch k.Kind() { + case reflect.Bool: + return d.decodeBool(name, node, result) + case reflect.Float32, reflect.Float64: + return d.decodeFloat(name, node, result) + case reflect.Int, reflect.Int32, reflect.Int64: + return d.decodeInt(name, node, result) + case reflect.Interface: + // When we see an interface, we make our own thing + return d.decodeInterface(name, node, result) + case reflect.Map: + return d.decodeMap(name, node, result) + case reflect.Ptr: + return d.decodePtr(name, node, result) + case reflect.Slice: + return d.decodeSlice(name, node, result) + case reflect.String: + return d.decodeString(name, node, result) + case reflect.Struct: + return d.decodeStruct(name, node, result) + default: + return &parser.PosError{ + Pos: node.Pos(), + Err: fmt.Errorf("%s: unknown kind to decode into: %s", name, k.Kind()), + } + } +} + +func (d *decoder) decodeBool(name string, node ast.Node, result reflect.Value) error { + switch n := node.(type) { + case *ast.LiteralType: + if n.Token.Type == token.BOOL { + v, err := strconv.ParseBool(n.Token.Text) + if err != nil { + return err + } + + result.Set(reflect.ValueOf(v)) + return nil + } + } + + return &parser.PosError{ + Pos: node.Pos(), + Err: fmt.Errorf("%s: unknown type %T", name, node), + } +} + +func (d *decoder) decodeFloat(name string, node ast.Node, result reflect.Value) error { + switch n := node.(type) { + case *ast.LiteralType: + if n.Token.Type == token.FLOAT || n.Token.Type == token.NUMBER { + v, err := strconv.ParseFloat(n.Token.Text, 64) + if err != nil { + return err + } + + result.Set(reflect.ValueOf(v).Convert(result.Type())) + return nil + } + } + + return &parser.PosError{ + Pos: node.Pos(), + Err: fmt.Errorf("%s: unknown type %T", name, node), + } +} + +func (d *decoder) decodeInt(name string, node ast.Node, result reflect.Value) error { + switch n := node.(type) { + case *ast.LiteralType: + switch n.Token.Type { + case token.NUMBER: + v, err := strconv.ParseInt(n.Token.Text, 0, 0) + if err != nil { + return err + } + + if result.Kind() == reflect.Interface { + result.Set(reflect.ValueOf(int(v))) + } else { + result.SetInt(v) + } + return nil + case token.STRING: + v, err := strconv.ParseInt(n.Token.Value().(string), 0, 0) + if err != nil { + return err + } + + if result.Kind() == reflect.Interface { + result.Set(reflect.ValueOf(int(v))) + } else { + result.SetInt(v) + } + return nil + } + } + + return &parser.PosError{ + Pos: node.Pos(), + Err: fmt.Errorf("%s: unknown type %T", name, node), + } +} + +func (d *decoder) decodeInterface(name string, node ast.Node, result reflect.Value) error { + // When we see an ast.Node, we retain the value to enable deferred decoding. + // Very useful in situations where we want to preserve ast.Node information + // like Pos + if result.Type() == nodeType && result.CanSet() { + result.Set(reflect.ValueOf(node)) + return nil + } + + var set reflect.Value + redecode := true + + // For testing types, ObjectType should just be treated as a list. We + // set this to a temporary var because we want to pass in the real node. + testNode := node + if ot, ok := node.(*ast.ObjectType); ok { + testNode = ot.List + } + + switch n := testNode.(type) { + case *ast.ObjectList: + // If we're at the root or we're directly within a slice, then we + // decode objects into map[string]interface{}, otherwise we decode + // them into lists. + if len(d.stack) == 0 || d.stack[len(d.stack)-1] == reflect.Slice { + var temp map[string]interface{} + tempVal := reflect.ValueOf(temp) + result := reflect.MakeMap( + reflect.MapOf( + reflect.TypeOf(""), + tempVal.Type().Elem())) + + set = result + } else { + var temp []map[string]interface{} + tempVal := reflect.ValueOf(temp) + result := reflect.MakeSlice( + reflect.SliceOf(tempVal.Type().Elem()), 0, len(n.Items)) + set = result + } + case *ast.ObjectType: + // If we're at the root or we're directly within a slice, then we + // decode objects into map[string]interface{}, otherwise we decode + // them into lists. + if len(d.stack) == 0 || d.stack[len(d.stack)-1] == reflect.Slice { + var temp map[string]interface{} + tempVal := reflect.ValueOf(temp) + result := reflect.MakeMap( + reflect.MapOf( + reflect.TypeOf(""), + tempVal.Type().Elem())) + + set = result + } else { + var temp []map[string]interface{} + tempVal := reflect.ValueOf(temp) + result := reflect.MakeSlice( + reflect.SliceOf(tempVal.Type().Elem()), 0, 1) + set = result + } + case *ast.ListType: + var temp []interface{} + tempVal := reflect.ValueOf(temp) + result := reflect.MakeSlice( + reflect.SliceOf(tempVal.Type().Elem()), 0, 0) + set = result + case *ast.LiteralType: + switch n.Token.Type { + case token.BOOL: + var result bool + set = reflect.Indirect(reflect.New(reflect.TypeOf(result))) + case token.FLOAT: + var result float64 + set = reflect.Indirect(reflect.New(reflect.TypeOf(result))) + case token.NUMBER: + var result int + set = reflect.Indirect(reflect.New(reflect.TypeOf(result))) + case token.STRING, token.HEREDOC: + set = reflect.Indirect(reflect.New(reflect.TypeOf(""))) + default: + return &parser.PosError{ + Pos: node.Pos(), + Err: fmt.Errorf("%s: cannot decode into interface: %T", name, node), + } + } + default: + return fmt.Errorf( + "%s: cannot decode into interface: %T", + name, node) + } + + // Set the result to what its supposed to be, then reset + // result so we don't reflect into this method anymore. + result.Set(set) + + if redecode { + // Revisit the node so that we can use the newly instantiated + // thing and populate it. + if err := d.decode(name, node, result); err != nil { + return err + } + } + + return nil +} + +func (d *decoder) decodeMap(name string, node ast.Node, result reflect.Value) error { + if item, ok := node.(*ast.ObjectItem); ok { + node = &ast.ObjectList{Items: []*ast.ObjectItem{item}} + } + + if ot, ok := node.(*ast.ObjectType); ok { + node = ot.List + } + + n, ok := node.(*ast.ObjectList) + if !ok { + return &parser.PosError{ + Pos: node.Pos(), + Err: fmt.Errorf("%s: not an object type for map (%T)", name, node), + } + } + + // If we have an interface, then we can address the interface, + // but not the slice itself, so get the element but set the interface + set := result + if result.Kind() == reflect.Interface { + result = result.Elem() + } + + resultType := result.Type() + resultElemType := resultType.Elem() + resultKeyType := resultType.Key() + if resultKeyType.Kind() != reflect.String { + return &parser.PosError{ + Pos: node.Pos(), + Err: fmt.Errorf("%s: map must have string keys", name), + } + } + + // Make a map if it is nil + resultMap := result + if result.IsNil() { + resultMap = reflect.MakeMap( + reflect.MapOf(resultKeyType, resultElemType)) + } + + // Go through each element and decode it. + done := make(map[string]struct{}) + for _, item := range n.Items { + if item.Val == nil { + continue + } + + // github.com/hashicorp/terraform/issue/5740 + if len(item.Keys) == 0 { + return &parser.PosError{ + Pos: node.Pos(), + Err: fmt.Errorf("%s: map must have string keys", name), + } + } + + // Get the key we're dealing with, which is the first item + keyStr := item.Keys[0].Token.Value().(string) + + // If we've already processed this key, then ignore it + if _, ok := done[keyStr]; ok { + continue + } + + // Determine the value. If we have more than one key, then we + // get the objectlist of only these keys. + itemVal := item.Val + if len(item.Keys) > 1 { + itemVal = n.Filter(keyStr) + done[keyStr] = struct{}{} + } + + // Make the field name + fieldName := fmt.Sprintf("%s.%s", name, keyStr) + + // Get the key/value as reflection values + key := reflect.ValueOf(keyStr) + val := reflect.Indirect(reflect.New(resultElemType)) + + // If we have a pre-existing value in the map, use that + oldVal := resultMap.MapIndex(key) + if oldVal.IsValid() { + val.Set(oldVal) + } + + // Decode! + if err := d.decode(fieldName, itemVal, val); err != nil { + return err + } + + // Set the value on the map + resultMap.SetMapIndex(key, val) + } + + // Set the final map if we can + set.Set(resultMap) + return nil +} + +func (d *decoder) decodePtr(name string, node ast.Node, result reflect.Value) error { + // Create an element of the concrete (non pointer) type and decode + // into that. Then set the value of the pointer to this type. + resultType := result.Type() + resultElemType := resultType.Elem() + val := reflect.New(resultElemType) + if err := d.decode(name, node, reflect.Indirect(val)); err != nil { + return err + } + + result.Set(val) + return nil +} + +func (d *decoder) decodeSlice(name string, node ast.Node, result reflect.Value) error { + // If we have an interface, then we can address the interface, + // but not the slice itself, so get the element but set the interface + set := result + if result.Kind() == reflect.Interface { + result = result.Elem() + } + // Create the slice if it isn't nil + resultType := result.Type() + resultElemType := resultType.Elem() + if result.IsNil() { + resultSliceType := reflect.SliceOf(resultElemType) + result = reflect.MakeSlice( + resultSliceType, 0, 0) + } + + // Figure out the items we'll be copying into the slice + var items []ast.Node + switch n := node.(type) { + case *ast.ObjectList: + items = make([]ast.Node, len(n.Items)) + for i, item := range n.Items { + items[i] = item + } + case *ast.ObjectType: + items = []ast.Node{n} + case *ast.ListType: + items = n.List + default: + return &parser.PosError{ + Pos: node.Pos(), + Err: fmt.Errorf("unknown slice type: %T", node), + } + } + + for i, item := range items { + fieldName := fmt.Sprintf("%s[%d]", name, i) + + // Decode + val := reflect.Indirect(reflect.New(resultElemType)) + + // if item is an object that was decoded from ambiguous JSON and + // flattened, make sure it's expanded if it needs to decode into a + // defined structure. + item := expandObject(item, val) + + if err := d.decode(fieldName, item, val); err != nil { + return err + } + + // Append it onto the slice + result = reflect.Append(result, val) + } + + set.Set(result) + return nil +} + +// expandObject detects if an ambiguous JSON object was flattened to a List which +// should be decoded into a struct, and expands the ast to properly deocode. +func expandObject(node ast.Node, result reflect.Value) ast.Node { + item, ok := node.(*ast.ObjectItem) + if !ok { + return node + } + + elemType := result.Type() + + // our target type must be a struct + switch elemType.Kind() { + case reflect.Ptr: + switch elemType.Elem().Kind() { + case reflect.Struct: + //OK + default: + return node + } + case reflect.Struct: + //OK + default: + return node + } + + // A list value will have a key and field name. If it had more fields, + // it wouldn't have been flattened. + if len(item.Keys) != 2 { + return node + } + + keyToken := item.Keys[0].Token + item.Keys = item.Keys[1:] + + // we need to un-flatten the ast enough to decode + newNode := &ast.ObjectItem{ + Keys: []*ast.ObjectKey{ + &ast.ObjectKey{ + Token: keyToken, + }, + }, + Val: &ast.ObjectType{ + List: &ast.ObjectList{ + Items: []*ast.ObjectItem{item}, + }, + }, + } + + return newNode +} + +func (d *decoder) decodeString(name string, node ast.Node, result reflect.Value) error { + switch n := node.(type) { + case *ast.LiteralType: + switch n.Token.Type { + case token.NUMBER: + result.Set(reflect.ValueOf(n.Token.Text).Convert(result.Type())) + return nil + case token.STRING, token.HEREDOC: + result.Set(reflect.ValueOf(n.Token.Value()).Convert(result.Type())) + return nil + } + } + + return &parser.PosError{ + Pos: node.Pos(), + Err: fmt.Errorf("%s: unknown type for string %T", name, node), + } +} + +func (d *decoder) decodeStruct(name string, node ast.Node, result reflect.Value) error { + var item *ast.ObjectItem + if it, ok := node.(*ast.ObjectItem); ok { + item = it + node = it.Val + } + + if ot, ok := node.(*ast.ObjectType); ok { + node = ot.List + } + + // Handle the special case where the object itself is a literal. Previously + // the yacc parser would always ensure top-level elements were arrays. The new + // parser does not make the same guarantees, thus we need to convert any + // top-level literal elements into a list. + if _, ok := node.(*ast.LiteralType); ok && item != nil { + node = &ast.ObjectList{Items: []*ast.ObjectItem{item}} + } + + list, ok := node.(*ast.ObjectList) + if !ok { + return &parser.PosError{ + Pos: node.Pos(), + Err: fmt.Errorf("%s: not an object type for struct (%T)", name, node), + } + } + + // This slice will keep track of all the structs we'll be decoding. + // There can be more than one struct if there are embedded structs + // that are squashed. + structs := make([]reflect.Value, 1, 5) + structs[0] = result + + // Compile the list of all the fields that we're going to be decoding + // from all the structs. + type field struct { + field reflect.StructField + val reflect.Value + } + fields := []field{} + for len(structs) > 0 { + structVal := structs[0] + structs = structs[1:] + + structType := structVal.Type() + for i := 0; i < structType.NumField(); i++ { + fieldType := structType.Field(i) + tagParts := strings.Split(fieldType.Tag.Get(tagName), ",") + + // Ignore fields with tag name "-" + if tagParts[0] == "-" { + continue + } + + if fieldType.Anonymous { + fieldKind := fieldType.Type.Kind() + if fieldKind != reflect.Struct { + return &parser.PosError{ + Pos: node.Pos(), + Err: fmt.Errorf("%s: unsupported type to struct: %s", + fieldType.Name, fieldKind), + } + } + + // We have an embedded field. We "squash" the fields down + // if specified in the tag. + squash := false + for _, tag := range tagParts[1:] { + if tag == "squash" { + squash = true + break + } + } + + if squash { + structs = append( + structs, result.FieldByName(fieldType.Name)) + continue + } + } + + // Normal struct field, store it away + fields = append(fields, field{fieldType, structVal.Field(i)}) + } + } + + usedKeys := make(map[string]struct{}) + decodedFields := make([]string, 0, len(fields)) + decodedFieldsVal := make([]reflect.Value, 0) + unusedKeysVal := make([]reflect.Value, 0) + for _, f := range fields { + field, fieldValue := f.field, f.val + if !fieldValue.IsValid() { + // This should never happen + panic("field is not valid") + } + + // If we can't set the field, then it is unexported or something, + // and we just continue onwards. + if !fieldValue.CanSet() { + continue + } + + fieldName := field.Name + + tagValue := field.Tag.Get(tagName) + tagParts := strings.SplitN(tagValue, ",", 2) + if len(tagParts) >= 2 { + switch tagParts[1] { + case "decodedFields": + decodedFieldsVal = append(decodedFieldsVal, fieldValue) + continue + case "key": + if item == nil { + return &parser.PosError{ + Pos: node.Pos(), + Err: fmt.Errorf("%s: %s asked for 'key', impossible", + name, fieldName), + } + } + + fieldValue.SetString(item.Keys[0].Token.Value().(string)) + continue + case "unusedKeys": + unusedKeysVal = append(unusedKeysVal, fieldValue) + continue + } + } + + if tagParts[0] != "" { + fieldName = tagParts[0] + } + + // Determine the element we'll use to decode. If it is a single + // match (only object with the field), then we decode it exactly. + // If it is a prefix match, then we decode the matches. + filter := list.Filter(fieldName) + + prefixMatches := filter.Children() + matches := filter.Elem() + if len(matches.Items) == 0 && len(prefixMatches.Items) == 0 { + continue + } + + // Track the used key + usedKeys[fieldName] = struct{}{} + + // Create the field name and decode. We range over the elements + // because we actually want the value. + fieldName = fmt.Sprintf("%s.%s", name, fieldName) + if len(prefixMatches.Items) > 0 { + if err := d.decode(fieldName, prefixMatches, fieldValue); err != nil { + return err + } + } + for _, match := range matches.Items { + var decodeNode ast.Node = match.Val + if ot, ok := decodeNode.(*ast.ObjectType); ok { + decodeNode = &ast.ObjectList{Items: ot.List.Items} + } + + if err := d.decode(fieldName, decodeNode, fieldValue); err != nil { + return err + } + } + + decodedFields = append(decodedFields, field.Name) + } + + if len(decodedFieldsVal) > 0 { + // Sort it so that it is deterministic + sort.Strings(decodedFields) + + for _, v := range decodedFieldsVal { + v.Set(reflect.ValueOf(decodedFields)) + } + } + + return nil +} + +// findNodeType returns the type of ast.Node +func findNodeType() reflect.Type { + var nodeContainer struct { + Node ast.Node + } + value := reflect.ValueOf(nodeContainer).FieldByName("Node") + return value.Type() +} diff --git a/vendor/github.com/hashicorp/hcl/decoder_test.go b/vendor/github.com/hashicorp/hcl/decoder_test.go new file mode 100644 index 0000000000..8682f470ed --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/decoder_test.go @@ -0,0 +1,1203 @@ +package hcl + +import ( + "io/ioutil" + "path/filepath" + "reflect" + "testing" + "time" + + "github.com/davecgh/go-spew/spew" + "github.com/hashicorp/hcl/hcl/ast" +) + +func TestDecode_interface(t *testing.T) { + cases := []struct { + File string + Err bool + Out interface{} + }{ + { + "basic.hcl", + false, + map[string]interface{}{ + "foo": "bar", + "bar": "${file(\"bing/bong.txt\")}", + }, + }, + { + "basic_squish.hcl", + false, + map[string]interface{}{ + "foo": "bar", + "bar": "${file(\"bing/bong.txt\")}", + "foo-bar": "baz", + }, + }, + { + "empty.hcl", + false, + map[string]interface{}{ + "resource": []map[string]interface{}{ + map[string]interface{}{ + "foo": []map[string]interface{}{ + map[string]interface{}{}, + }, + }, + }, + }, + }, + { + "tfvars.hcl", + false, + map[string]interface{}{ + "regularvar": "Should work", + "map.key1": "Value", + "map.key2": "Other value", + }, + }, + { + "escape.hcl", + false, + map[string]interface{}{ + "foo": "bar\"baz\\n", + "qux": "back\\slash", + "bar": "new\nline", + "qax": `slash\:colon`, + "nested": `${HH\\:mm\\:ss}`, + "nestedquotes": `${"\"stringwrappedinquotes\""}`, + }, + }, + { + "float.hcl", + false, + map[string]interface{}{ + "a": 1.02, + "b": 2, + }, + }, + { + "multiline_bad.hcl", + true, + nil, + }, + { + "multiline_literal.hcl", + true, + nil, + }, + { + "multiline_literal_with_hil.hcl", + false, + map[string]interface{}{"multiline_literal_with_hil": "${hello\n world}"}, + }, + { + "multiline_no_marker.hcl", + true, + nil, + }, + { + "multiline.hcl", + false, + map[string]interface{}{"foo": "bar\nbaz\n"}, + }, + { + "multiline_indented.hcl", + false, + map[string]interface{}{"foo": " bar\n baz\n"}, + }, + { + "multiline_no_hanging_indent.hcl", + false, + map[string]interface{}{"foo": " baz\n bar\n foo\n"}, + }, + { + "multiline_no_eof.hcl", + false, + map[string]interface{}{"foo": "bar\nbaz\n", "key": "value"}, + }, + { + "multiline.json", + false, + map[string]interface{}{"foo": "bar\nbaz"}, + }, + { + "null_strings.json", + false, + map[string]interface{}{ + "module": []map[string]interface{}{ + map[string]interface{}{ + "app": []map[string]interface{}{ + map[string]interface{}{"foo": ""}, + }, + }, + }, + }, + }, + { + "scientific.json", + false, + map[string]interface{}{ + "a": 1e-10, + "b": 1e+10, + "c": 1e10, + "d": 1.2e-10, + "e": 1.2e+10, + "f": 1.2e10, + }, + }, + { + "scientific.hcl", + false, + map[string]interface{}{ + "a": 1e-10, + "b": 1e+10, + "c": 1e10, + "d": 1.2e-10, + "e": 1.2e+10, + "f": 1.2e10, + }, + }, + { + "terraform_heroku.hcl", + false, + map[string]interface{}{ + "name": "terraform-test-app", + "config_vars": []map[string]interface{}{ + map[string]interface{}{ + "FOO": "bar", + }, + }, + }, + }, + { + "structure_multi.hcl", + false, + map[string]interface{}{ + "foo": []map[string]interface{}{ + map[string]interface{}{ + "baz": []map[string]interface{}{ + map[string]interface{}{"key": 7}, + }, + }, + map[string]interface{}{ + "bar": []map[string]interface{}{ + map[string]interface{}{"key": 12}, + }, + }, + }, + }, + }, + { + "structure_multi.json", + false, + map[string]interface{}{ + "foo": []map[string]interface{}{ + map[string]interface{}{ + "baz": []map[string]interface{}{ + map[string]interface{}{"key": 7}, + }, + }, + map[string]interface{}{ + "bar": []map[string]interface{}{ + map[string]interface{}{"key": 12}, + }, + }, + }, + }, + }, + { + "list_of_lists.hcl", + false, + map[string]interface{}{ + "foo": []interface{}{ + []interface{}{"foo"}, + []interface{}{"bar"}, + }, + }, + }, + { + "list_of_maps.hcl", + false, + map[string]interface{}{ + "foo": []interface{}{ + map[string]interface{}{"somekey1": "someval1"}, + map[string]interface{}{"somekey2": "someval2", "someextrakey": "someextraval"}, + }, + }, + }, + { + "assign_deep.hcl", + false, + map[string]interface{}{ + "resource": []interface{}{ + map[string]interface{}{ + "foo": []interface{}{ + map[string]interface{}{ + "bar": []map[string]interface{}{ + map[string]interface{}{}}}}}}}, + }, + { + "structure_list.hcl", + false, + map[string]interface{}{ + "foo": []map[string]interface{}{ + map[string]interface{}{ + "key": 7, + }, + map[string]interface{}{ + "key": 12, + }, + }, + }, + }, + { + "structure_list.json", + false, + map[string]interface{}{ + "foo": []map[string]interface{}{ + map[string]interface{}{ + "key": 7, + }, + map[string]interface{}{ + "key": 12, + }, + }, + }, + }, + { + "structure_list_deep.json", + false, + map[string]interface{}{ + "bar": []map[string]interface{}{ + map[string]interface{}{ + "foo": []map[string]interface{}{ + map[string]interface{}{ + "name": "terraform_example", + "ingress": []map[string]interface{}{ + map[string]interface{}{ + "from_port": 22, + }, + map[string]interface{}{ + "from_port": 80, + }, + }, + }, + }, + }, + }, + }, + }, + + { + "structure_list_empty.json", + false, + map[string]interface{}{ + "foo": []interface{}{}, + }, + }, + + { + "nested_block_comment.hcl", + false, + map[string]interface{}{ + "bar": "value", + }, + }, + + { + "unterminated_block_comment.hcl", + true, + nil, + }, + + { + "unterminated_brace.hcl", + true, + nil, + }, + + { + "nested_provider_bad.hcl", + true, + nil, + }, + + { + "object_list.json", + false, + map[string]interface{}{ + "resource": []map[string]interface{}{ + map[string]interface{}{ + "aws_instance": []map[string]interface{}{ + map[string]interface{}{ + "db": []map[string]interface{}{ + map[string]interface{}{ + "vpc": "foo", + "provisioner": []map[string]interface{}{ + map[string]interface{}{ + "file": []map[string]interface{}{ + map[string]interface{}{ + "source": "foo", + "destination": "bar", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + + // Terraform GH-8295 sanity test that basic decoding into + // interface{} works. + { + "terraform_variable_invalid.json", + false, + map[string]interface{}{ + "variable": []map[string]interface{}{ + map[string]interface{}{ + "whatever": "abc123", + }, + }, + }, + }, + + { + "interpolate.json", + false, + map[string]interface{}{ + "default": `${replace("europe-west", "-", " ")}`, + }, + }, + + { + "block_assign.hcl", + true, + nil, + }, + + { + "escape_backslash.hcl", + false, + map[string]interface{}{ + "output": []map[string]interface{}{ + map[string]interface{}{ + "one": `${replace(var.sub_domain, ".", "\\.")}`, + "two": `${replace(var.sub_domain, ".", "\\\\.")}`, + "many": `${replace(var.sub_domain, ".", "\\\\\\\\.")}`, + }, + }, + }, + }, + + { + "git_crypt.hcl", + true, + nil, + }, + + { + "object_with_bool.hcl", + false, + map[string]interface{}{ + "path": []map[string]interface{}{ + map[string]interface{}{ + "policy": "write", + "permissions": []map[string]interface{}{ + map[string]interface{}{ + "bool": []interface{}{false}, + }, + }, + }, + }, + }, + }, + } + + for _, tc := range cases { + t.Run(tc.File, func(t *testing.T) { + d, err := ioutil.ReadFile(filepath.Join(fixtureDir, tc.File)) + if err != nil { + t.Fatalf("err: %s", err) + } + + var out interface{} + err = Decode(&out, string(d)) + if (err != nil) != tc.Err { + t.Fatalf("Input: %s\n\nError: %s", tc.File, err) + } + + if !reflect.DeepEqual(out, tc.Out) { + t.Fatalf("Input: %s. Actual, Expected.\n\n%#v\n\n%#v", tc.File, out, tc.Out) + } + + var v interface{} + err = Unmarshal(d, &v) + if (err != nil) != tc.Err { + t.Fatalf("Input: %s\n\nError: %s", tc.File, err) + } + + if !reflect.DeepEqual(v, tc.Out) { + t.Fatalf("Input: %s. Actual, Expected.\n\n%#v\n\n%#v", tc.File, out, tc.Out) + } + }) + } +} + +func TestDecode_interfaceInline(t *testing.T) { + cases := []struct { + Value string + Err bool + Out interface{} + }{ + {"t t e{{}}", true, nil}, + {"t=0t d {}", true, map[string]interface{}{"t": 0}}, + {"v=0E0v d{}", true, map[string]interface{}{"v": float64(0)}}, + } + + for _, tc := range cases { + t.Logf("Testing: %q", tc.Value) + + var out interface{} + err := Decode(&out, tc.Value) + if (err != nil) != tc.Err { + t.Fatalf("Input: %q\n\nError: %s", tc.Value, err) + } + + if !reflect.DeepEqual(out, tc.Out) { + t.Fatalf("Input: %q. Actual, Expected.\n\n%#v\n\n%#v", tc.Value, out, tc.Out) + } + + var v interface{} + err = Unmarshal([]byte(tc.Value), &v) + if (err != nil) != tc.Err { + t.Fatalf("Input: %q\n\nError: %s", tc.Value, err) + } + + if !reflect.DeepEqual(v, tc.Out) { + t.Fatalf("Input: %q. Actual, Expected.\n\n%#v\n\n%#v", tc.Value, out, tc.Out) + } + } +} + +func TestDecode_equal(t *testing.T) { + cases := []struct { + One, Two string + }{ + { + "basic.hcl", + "basic.json", + }, + { + "float.hcl", + "float.json", + }, + /* + { + "structure.hcl", + "structure.json", + }, + */ + { + "structure.hcl", + "structure_flat.json", + }, + { + "terraform_heroku.hcl", + "terraform_heroku.json", + }, + } + + for _, tc := range cases { + p1 := filepath.Join(fixtureDir, tc.One) + p2 := filepath.Join(fixtureDir, tc.Two) + + d1, err := ioutil.ReadFile(p1) + if err != nil { + t.Fatalf("err: %s", err) + } + + d2, err := ioutil.ReadFile(p2) + if err != nil { + t.Fatalf("err: %s", err) + } + + var i1, i2 interface{} + err = Decode(&i1, string(d1)) + if err != nil { + t.Fatalf("err: %s", err) + } + + err = Decode(&i2, string(d2)) + if err != nil { + t.Fatalf("err: %s", err) + } + + if !reflect.DeepEqual(i1, i2) { + t.Fatalf( + "%s != %s\n\n%#v\n\n%#v", + tc.One, tc.Two, + i1, i2) + } + } +} + +func TestDecode_flatMap(t *testing.T) { + var val map[string]map[string]string + + err := Decode(&val, testReadFile(t, "structure_flatmap.hcl")) + if err != nil { + t.Fatalf("err: %s", err) + } + + expected := map[string]map[string]string{ + "foo": map[string]string{ + "foo": "bar", + "key": "7", + }, + } + + if !reflect.DeepEqual(val, expected) { + t.Fatalf("Actual: %#v\n\nExpected: %#v", val, expected) + } +} + +func TestDecode_structure(t *testing.T) { + type Embedded interface{} + + type V struct { + Embedded `hcl:"-"` + Key int + Foo string + } + + var actual V + + err := Decode(&actual, testReadFile(t, "flat.hcl")) + if err != nil { + t.Fatalf("err: %s", err) + } + + expected := V{ + Key: 7, + Foo: "bar", + } + + if !reflect.DeepEqual(actual, expected) { + t.Fatalf("Actual: %#v\n\nExpected: %#v", actual, expected) + } +} + +func TestDecode_structurePtr(t *testing.T) { + type V struct { + Key int + Foo string + } + + var actual *V + + err := Decode(&actual, testReadFile(t, "flat.hcl")) + if err != nil { + t.Fatalf("err: %s", err) + } + + expected := &V{ + Key: 7, + Foo: "bar", + } + + if !reflect.DeepEqual(actual, expected) { + t.Fatalf("Actual: %#v\n\nExpected: %#v", actual, expected) + } +} + +func TestDecode_structureArray(t *testing.T) { + // This test is extracted from a failure in Consul (consul.io), + // hence the interesting structure naming. + + type KeyPolicyType string + + type KeyPolicy struct { + Prefix string `hcl:",key"` + Policy KeyPolicyType + } + + type Policy struct { + Keys []KeyPolicy `hcl:"key,expand"` + } + + expected := Policy{ + Keys: []KeyPolicy{ + KeyPolicy{ + Prefix: "", + Policy: "read", + }, + KeyPolicy{ + Prefix: "foo/", + Policy: "write", + }, + KeyPolicy{ + Prefix: "foo/bar/", + Policy: "read", + }, + KeyPolicy{ + Prefix: "foo/bar/baz", + Policy: "deny", + }, + }, + } + + files := []string{ + "decode_policy.hcl", + "decode_policy.json", + } + + for _, f := range files { + var actual Policy + + err := Decode(&actual, testReadFile(t, f)) + if err != nil { + t.Fatalf("Input: %s\n\nerr: %s", f, err) + } + + if !reflect.DeepEqual(actual, expected) { + t.Fatalf("Input: %s\n\nActual: %#v\n\nExpected: %#v", f, actual, expected) + } + } +} + +func TestDecode_sliceExpand(t *testing.T) { + type testInner struct { + Name string `hcl:",key"` + Key string + } + + type testStruct struct { + Services []testInner `hcl:"service,expand"` + } + + expected := testStruct{ + Services: []testInner{ + testInner{ + Name: "my-service-0", + Key: "value", + }, + testInner{ + Name: "my-service-1", + Key: "value", + }, + }, + } + + files := []string{ + "slice_expand.hcl", + } + + for _, f := range files { + t.Logf("Testing: %s", f) + + var actual testStruct + err := Decode(&actual, testReadFile(t, f)) + if err != nil { + t.Fatalf("Input: %s\n\nerr: %s", f, err) + } + + if !reflect.DeepEqual(actual, expected) { + t.Fatalf("Input: %s\n\nActual: %#v\n\nExpected: %#v", f, actual, expected) + } + } +} + +func TestDecode_structureMap(t *testing.T) { + // This test is extracted from a failure in Terraform (terraform.io), + // hence the interesting structure naming. + + type hclVariable struct { + Default interface{} + Description string + Fields []string `hcl:",decodedFields"` + } + + type rawConfig struct { + Variable map[string]hclVariable + } + + expected := rawConfig{ + Variable: map[string]hclVariable{ + "foo": hclVariable{ + Default: "bar", + Description: "bar", + Fields: []string{"Default", "Description"}, + }, + + "amis": hclVariable{ + Default: []map[string]interface{}{ + map[string]interface{}{ + "east": "foo", + }, + }, + Fields: []string{"Default"}, + }, + }, + } + + files := []string{ + "decode_tf_variable.hcl", + "decode_tf_variable.json", + } + + for _, f := range files { + t.Logf("Testing: %s", f) + + var actual rawConfig + err := Decode(&actual, testReadFile(t, f)) + if err != nil { + t.Fatalf("Input: %s\n\nerr: %s", f, err) + } + + if !reflect.DeepEqual(actual, expected) { + t.Fatalf("Input: %s\n\nActual: %#v\n\nExpected: %#v", f, actual, expected) + } + } +} + +func TestDecode_structureMapInvalid(t *testing.T) { + // Terraform GH-8295 + + type hclVariable struct { + Default interface{} + Description string + Fields []string `hcl:",decodedFields"` + } + + type rawConfig struct { + Variable map[string]*hclVariable + } + + var actual rawConfig + err := Decode(&actual, testReadFile(t, "terraform_variable_invalid.json")) + if err == nil { + t.Fatal("expected error") + } +} + +func TestDecode_interfaceNonPointer(t *testing.T) { + var value interface{} + err := Decode(value, testReadFile(t, "basic_int_string.hcl")) + if err == nil { + t.Fatal("should error") + } +} + +func TestDecode_intString(t *testing.T) { + var value struct { + Count int + } + + err := Decode(&value, testReadFile(t, "basic_int_string.hcl")) + if err != nil { + t.Fatalf("err: %s", err) + } + + if value.Count != 3 { + t.Fatalf("bad: %#v", value.Count) + } +} + +func TestDecode_float32(t *testing.T) { + var value struct { + A float32 `hcl:"a"` + B float32 `hcl:"b"` + } + + err := Decode(&value, testReadFile(t, "float.hcl")) + if err != nil { + t.Fatalf("err: %s", err) + } + + if got, want := value.A, float32(1.02); got != want { + t.Fatalf("wrong result %#v; want %#v", got, want) + } + if got, want := value.B, float32(2); got != want { + t.Fatalf("wrong result %#v; want %#v", got, want) + } +} + +func TestDecode_float64(t *testing.T) { + var value struct { + A float64 `hcl:"a"` + B float64 `hcl:"b"` + } + + err := Decode(&value, testReadFile(t, "float.hcl")) + if err != nil { + t.Fatalf("err: %s", err) + } + + if got, want := value.A, float64(1.02); got != want { + t.Fatalf("wrong result %#v; want %#v", got, want) + } + if got, want := value.B, float64(2); got != want { + t.Fatalf("wrong result %#v; want %#v", got, want) + } +} + +func TestDecode_intStringAliased(t *testing.T) { + var value struct { + Count time.Duration + } + + err := Decode(&value, testReadFile(t, "basic_int_string.hcl")) + if err != nil { + t.Fatalf("err: %s", err) + } + + if value.Count != time.Duration(3) { + t.Fatalf("bad: %#v", value.Count) + } +} + +func TestDecode_Node(t *testing.T) { + // given + var value struct { + Content ast.Node + Nested struct { + Content ast.Node + } + } + + content := ` +content { + hello = "world" +} +` + + // when + err := Decode(&value, content) + + // then + if err != nil { + t.Errorf("unable to decode content, %v", err) + return + } + + // verify ast.Node can be decoded later + var v map[string]interface{} + err = DecodeObject(&v, value.Content) + if err != nil { + t.Errorf("unable to decode content, %v", err) + return + } + + if v["hello"] != "world" { + t.Errorf("expected mapping to be returned") + } +} + +func TestDecode_NestedNode(t *testing.T) { + // given + var value struct { + Nested struct { + Content ast.Node + } + } + + content := ` +nested "content" { + hello = "world" +} +` + + // when + err := Decode(&value, content) + + // then + if err != nil { + t.Errorf("unable to decode content, %v", err) + return + } + + // verify ast.Node can be decoded later + var v map[string]interface{} + err = DecodeObject(&v, value.Nested.Content) + if err != nil { + t.Errorf("unable to decode content, %v", err) + return + } + + if v["hello"] != "world" { + t.Errorf("expected mapping to be returned") + } +} + +// https://github.com/hashicorp/hcl/issues/60 +func TestDecode_topLevelKeys(t *testing.T) { + type Template struct { + Source string + } + + templates := struct { + Templates []*Template `hcl:"template"` + }{} + + err := Decode(&templates, ` + template { + source = "blah" + } + + template { + source = "blahblah" + }`) + + if err != nil { + t.Fatal(err) + } + + if templates.Templates[0].Source != "blah" { + t.Errorf("bad source: %s", templates.Templates[0].Source) + } + + if templates.Templates[1].Source != "blahblah" { + t.Errorf("bad source: %s", templates.Templates[1].Source) + } +} + +func TestDecode_flattenedJSON(t *testing.T) { + // make sure we can also correctly extract a Name key too + type V struct { + Name string `hcl:",key"` + Description string + Default map[string]string + } + type Vars struct { + Variable []*V + } + + cases := []struct { + JSON string + Out interface{} + Expected interface{} + }{ + { // Nested object, no sibling keys + JSON: ` +{ + "var_name": { + "default": { + "key1": "a", + "key2": "b" + } + } +} + `, + Out: &[]*V{}, + Expected: &[]*V{ + &V{ + Name: "var_name", + Default: map[string]string{"key1": "a", "key2": "b"}, + }, + }, + }, + + { // Nested object with a sibling key (this worked previously) + JSON: ` +{ + "var_name": { + "description": "Described", + "default": { + "key1": "a", + "key2": "b" + } + } +} + `, + Out: &[]*V{}, + Expected: &[]*V{ + &V{ + Name: "var_name", + Description: "Described", + Default: map[string]string{"key1": "a", "key2": "b"}, + }, + }, + }, + + { // Multiple nested objects, one with a sibling key + JSON: ` +{ + "variable": { + "var_1": { + "default": { + "key1": "a", + "key2": "b" + } + }, + "var_2": { + "description": "Described", + "default": { + "key1": "a", + "key2": "b" + } + } + } +} + `, + Out: &Vars{}, + Expected: &Vars{ + Variable: []*V{ + &V{ + Name: "var_1", + Default: map[string]string{"key1": "a", "key2": "b"}, + }, + &V{ + Name: "var_2", + Description: "Described", + Default: map[string]string{"key1": "a", "key2": "b"}, + }, + }, + }, + }, + + { // Nested object to maps + JSON: ` +{ + "variable": { + "var_name": { + "description": "Described", + "default": { + "key1": "a", + "key2": "b" + } + } + } +} + `, + Out: &[]map[string]interface{}{}, + Expected: &[]map[string]interface{}{ + { + "variable": []map[string]interface{}{ + { + "var_name": []map[string]interface{}{ + { + "description": "Described", + "default": []map[string]interface{}{ + { + "key1": "a", + "key2": "b", + }, + }, + }, + }, + }, + }, + }, + }, + }, + + { // Nested object to maps without a sibling key should decode the same as above + JSON: ` +{ + "variable": { + "var_name": { + "default": { + "key1": "a", + "key2": "b" + } + } + } +} + `, + Out: &[]map[string]interface{}{}, + Expected: &[]map[string]interface{}{ + { + "variable": []map[string]interface{}{ + { + "var_name": []map[string]interface{}{ + { + "default": []map[string]interface{}{ + { + "key1": "a", + "key2": "b", + }, + }, + }, + }, + }, + }, + }, + }, + }, + + { // Nested objects, one with a sibling key, and one without + JSON: ` +{ + "variable": { + "var_1": { + "default": { + "key1": "a", + "key2": "b" + } + }, + "var_2": { + "description": "Described", + "default": { + "key1": "a", + "key2": "b" + } + } + } +} + `, + Out: &[]map[string]interface{}{}, + Expected: &[]map[string]interface{}{ + { + "variable": []map[string]interface{}{ + { + "var_1": []map[string]interface{}{ + { + "default": []map[string]interface{}{ + { + "key1": "a", + "key2": "b", + }, + }, + }, + }, + }, + }, + }, + { + "variable": []map[string]interface{}{ + { + "var_2": []map[string]interface{}{ + { + "description": "Described", + "default": []map[string]interface{}{ + { + "key1": "a", + "key2": "b", + }, + }, + }, + }, + }, + }, + }, + }, + }, + } + + for i, tc := range cases { + err := Decode(tc.Out, tc.JSON) + if err != nil { + t.Fatalf("[%d] err: %s", i, err) + } + + if !reflect.DeepEqual(tc.Out, tc.Expected) { + t.Fatalf("[%d]\ngot: %s\nexpected: %s\n", i, spew.Sdump(tc.Out), spew.Sdump(tc.Expected)) + } + } +} diff --git a/vendor/github.com/hashicorp/hcl/hcl.go b/vendor/github.com/hashicorp/hcl/hcl.go new file mode 100644 index 0000000000..575a20b50b --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl.go @@ -0,0 +1,11 @@ +// Package hcl decodes HCL into usable Go structures. +// +// hcl input can come in either pure HCL format or JSON format. +// It can be parsed into an AST, and then decoded into a structure, +// or it can be decoded directly from a string into a structure. +// +// If you choose to parse HCL into a raw AST, the benefit is that you +// can write custom visitor implementations to implement custom +// semantic checks. By default, HCL does not perform any semantic +// checks. +package hcl diff --git a/vendor/github.com/hashicorp/hcl/hcl/ast/ast.go b/vendor/github.com/hashicorp/hcl/hcl/ast/ast.go new file mode 100644 index 0000000000..6e5ef654bb --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl/ast/ast.go @@ -0,0 +1,219 @@ +// Package ast declares the types used to represent syntax trees for HCL +// (HashiCorp Configuration Language) +package ast + +import ( + "fmt" + "strings" + + "github.com/hashicorp/hcl/hcl/token" +) + +// Node is an element in the abstract syntax tree. +type Node interface { + node() + Pos() token.Pos +} + +func (File) node() {} +func (ObjectList) node() {} +func (ObjectKey) node() {} +func (ObjectItem) node() {} +func (Comment) node() {} +func (CommentGroup) node() {} +func (ObjectType) node() {} +func (LiteralType) node() {} +func (ListType) node() {} + +// File represents a single HCL file +type File struct { + Node Node // usually a *ObjectList + Comments []*CommentGroup // list of all comments in the source +} + +func (f *File) Pos() token.Pos { + return f.Node.Pos() +} + +// ObjectList represents a list of ObjectItems. An HCL file itself is an +// ObjectList. +type ObjectList struct { + Items []*ObjectItem +} + +func (o *ObjectList) Add(item *ObjectItem) { + o.Items = append(o.Items, item) +} + +// Filter filters out the objects with the given key list as a prefix. +// +// The returned list of objects contain ObjectItems where the keys have +// this prefix already stripped off. This might result in objects with +// zero-length key lists if they have no children. +// +// If no matches are found, an empty ObjectList (non-nil) is returned. +func (o *ObjectList) Filter(keys ...string) *ObjectList { + var result ObjectList + for _, item := range o.Items { + // If there aren't enough keys, then ignore this + if len(item.Keys) < len(keys) { + continue + } + + match := true + for i, key := range item.Keys[:len(keys)] { + key := key.Token.Value().(string) + if key != keys[i] && !strings.EqualFold(key, keys[i]) { + match = false + break + } + } + if !match { + continue + } + + // Strip off the prefix from the children + newItem := *item + newItem.Keys = newItem.Keys[len(keys):] + result.Add(&newItem) + } + + return &result +} + +// Children returns further nested objects (key length > 0) within this +// ObjectList. This should be used with Filter to get at child items. +func (o *ObjectList) Children() *ObjectList { + var result ObjectList + for _, item := range o.Items { + if len(item.Keys) > 0 { + result.Add(item) + } + } + + return &result +} + +// Elem returns items in the list that are direct element assignments +// (key length == 0). This should be used with Filter to get at elements. +func (o *ObjectList) Elem() *ObjectList { + var result ObjectList + for _, item := range o.Items { + if len(item.Keys) == 0 { + result.Add(item) + } + } + + return &result +} + +func (o *ObjectList) Pos() token.Pos { + // always returns the uninitiliazed position + return o.Items[0].Pos() +} + +// ObjectItem represents a HCL Object Item. An item is represented with a key +// (or keys). It can be an assignment or an object (both normal and nested) +type ObjectItem struct { + // keys is only one length long if it's of type assignment. If it's a + // nested object it can be larger than one. In that case "assign" is + // invalid as there is no assignments for a nested object. + Keys []*ObjectKey + + // assign contains the position of "=", if any + Assign token.Pos + + // val is the item itself. It can be an object,list, number, bool or a + // string. If key length is larger than one, val can be only of type + // Object. + Val Node + + LeadComment *CommentGroup // associated lead comment + LineComment *CommentGroup // associated line comment +} + +func (o *ObjectItem) Pos() token.Pos { + // I'm not entirely sure what causes this, but removing this causes + // a test failure. We should investigate at some point. + if len(o.Keys) == 0 { + return token.Pos{} + } + + return o.Keys[0].Pos() +} + +// ObjectKeys are either an identifier or of type string. +type ObjectKey struct { + Token token.Token +} + +func (o *ObjectKey) Pos() token.Pos { + return o.Token.Pos +} + +// LiteralType represents a literal of basic type. Valid types are: +// token.NUMBER, token.FLOAT, token.BOOL and token.STRING +type LiteralType struct { + Token token.Token + + // comment types, only used when in a list + LeadComment *CommentGroup + LineComment *CommentGroup +} + +func (l *LiteralType) Pos() token.Pos { + return l.Token.Pos +} + +// ListStatement represents a HCL List type +type ListType struct { + Lbrack token.Pos // position of "[" + Rbrack token.Pos // position of "]" + List []Node // the elements in lexical order +} + +func (l *ListType) Pos() token.Pos { + return l.Lbrack +} + +func (l *ListType) Add(node Node) { + l.List = append(l.List, node) +} + +// ObjectType represents a HCL Object Type +type ObjectType struct { + Lbrace token.Pos // position of "{" + Rbrace token.Pos // position of "}" + List *ObjectList // the nodes in lexical order +} + +func (o *ObjectType) Pos() token.Pos { + return o.Lbrace +} + +// Comment node represents a single //, # style or /*- style commment +type Comment struct { + Start token.Pos // position of / or # + Text string +} + +func (c *Comment) Pos() token.Pos { + return c.Start +} + +// CommentGroup node represents a sequence of comments with no other tokens and +// no empty lines between. +type CommentGroup struct { + List []*Comment // len(List) > 0 +} + +func (c *CommentGroup) Pos() token.Pos { + return c.List[0].Pos() +} + +//------------------------------------------------------------------- +// GoStringer +//------------------------------------------------------------------- + +func (o *ObjectKey) GoString() string { return fmt.Sprintf("*%#v", *o) } +func (o *ObjectList) GoString() string { return fmt.Sprintf("*%#v", *o) } diff --git a/vendor/github.com/hashicorp/hcl/hcl/ast/ast_test.go b/vendor/github.com/hashicorp/hcl/hcl/ast/ast_test.go new file mode 100644 index 0000000000..942256cadc --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl/ast/ast_test.go @@ -0,0 +1,200 @@ +package ast + +import ( + "reflect" + "strings" + "testing" + + "github.com/hashicorp/hcl/hcl/token" +) + +func TestObjectListFilter(t *testing.T) { + var cases = []struct { + Filter []string + Input []*ObjectItem + Output []*ObjectItem + }{ + { + []string{"foo"}, + []*ObjectItem{ + &ObjectItem{ + Keys: []*ObjectKey{ + &ObjectKey{ + Token: token.Token{Type: token.STRING, Text: `"foo"`}, + }, + }, + }, + }, + []*ObjectItem{ + &ObjectItem{ + Keys: []*ObjectKey{}, + }, + }, + }, + + { + []string{"foo"}, + []*ObjectItem{ + &ObjectItem{ + Keys: []*ObjectKey{ + &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"foo"`}}, + &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"bar"`}}, + }, + }, + &ObjectItem{ + Keys: []*ObjectKey{ + &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"baz"`}}, + }, + }, + }, + []*ObjectItem{ + &ObjectItem{ + Keys: []*ObjectKey{ + &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"bar"`}}, + }, + }, + }, + }, + } + + for _, tc := range cases { + input := &ObjectList{Items: tc.Input} + expected := &ObjectList{Items: tc.Output} + if actual := input.Filter(tc.Filter...); !reflect.DeepEqual(actual, expected) { + t.Fatalf("in order: input, expected, actual\n\n%#v\n\n%#v\n\n%#v", input, expected, actual) + } + } +} + +func TestWalk(t *testing.T) { + items := []*ObjectItem{ + &ObjectItem{ + Keys: []*ObjectKey{ + &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"foo"`}}, + &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"bar"`}}, + }, + Val: &LiteralType{Token: token.Token{Type: token.STRING, Text: `"example"`}}, + }, + &ObjectItem{ + Keys: []*ObjectKey{ + &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"baz"`}}, + }, + }, + } + + node := &ObjectList{Items: items} + + order := []string{ + "*ast.ObjectList", + "*ast.ObjectItem", + "*ast.ObjectKey", + "*ast.ObjectKey", + "*ast.LiteralType", + "*ast.ObjectItem", + "*ast.ObjectKey", + } + count := 0 + + Walk(node, func(n Node) (Node, bool) { + if n == nil { + return n, false + } + + typeName := reflect.TypeOf(n).String() + if order[count] != typeName { + t.Errorf("expected '%s' got: '%s'", order[count], typeName) + } + count++ + return n, true + }) +} + +func TestWalkEquality(t *testing.T) { + items := []*ObjectItem{ + &ObjectItem{ + Keys: []*ObjectKey{ + &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"foo"`}}, + }, + }, + &ObjectItem{ + Keys: []*ObjectKey{ + &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"bar"`}}, + }, + }, + } + + node := &ObjectList{Items: items} + + rewritten := Walk(node, func(n Node) (Node, bool) { return n, true }) + + newNode, ok := rewritten.(*ObjectList) + if !ok { + t.Fatalf("expected Objectlist, got %T", rewritten) + } + + if !reflect.DeepEqual(node, newNode) { + t.Fatal("rewritten node is not equal to the given node") + } + + if len(newNode.Items) != 2 { + t.Error("expected newNode length 2, got: %d", len(newNode.Items)) + } + + expected := []string{ + `"foo"`, + `"bar"`, + } + + for i, item := range newNode.Items { + if len(item.Keys) != 1 { + t.Error("expected keys newNode length 1, got: %d", len(item.Keys)) + } + + if item.Keys[0].Token.Text != expected[i] { + t.Errorf("expected key %s, got %s", expected[i], item.Keys[0].Token.Text) + } + + if item.Val != nil { + t.Errorf("expected item value should be nil") + } + } +} + +func TestWalkRewrite(t *testing.T) { + items := []*ObjectItem{ + &ObjectItem{ + Keys: []*ObjectKey{ + &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"foo"`}}, + &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"bar"`}}, + }, + }, + &ObjectItem{ + Keys: []*ObjectKey{ + &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"baz"`}}, + }, + }, + } + + node := &ObjectList{Items: items} + + suffix := "_example" + node = Walk(node, func(n Node) (Node, bool) { + switch i := n.(type) { + case *ObjectKey: + i.Token.Text = i.Token.Text + suffix + n = i + } + return n, true + }).(*ObjectList) + + Walk(node, func(n Node) (Node, bool) { + switch i := n.(type) { + case *ObjectKey: + if !strings.HasSuffix(i.Token.Text, suffix) { + t.Errorf("Token '%s' should have suffix: %s", i.Token.Text, suffix) + } + } + return n, true + }) + +} diff --git a/vendor/github.com/hashicorp/hcl/hcl/ast/walk.go b/vendor/github.com/hashicorp/hcl/hcl/ast/walk.go new file mode 100644 index 0000000000..ba07ad42b0 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl/ast/walk.go @@ -0,0 +1,52 @@ +package ast + +import "fmt" + +// WalkFunc describes a function to be called for each node during a Walk. The +// returned node can be used to rewrite the AST. Walking stops the returned +// bool is false. +type WalkFunc func(Node) (Node, bool) + +// Walk traverses an AST in depth-first order: It starts by calling fn(node); +// node must not be nil. If fn returns true, Walk invokes fn recursively for +// each of the non-nil children of node, followed by a call of fn(nil). The +// returned node of fn can be used to rewrite the passed node to fn. +func Walk(node Node, fn WalkFunc) Node { + rewritten, ok := fn(node) + if !ok { + return rewritten + } + + switch n := node.(type) { + case *File: + n.Node = Walk(n.Node, fn) + case *ObjectList: + for i, item := range n.Items { + n.Items[i] = Walk(item, fn).(*ObjectItem) + } + case *ObjectKey: + // nothing to do + case *ObjectItem: + for i, k := range n.Keys { + n.Keys[i] = Walk(k, fn).(*ObjectKey) + } + + if n.Val != nil { + n.Val = Walk(n.Val, fn) + } + case *LiteralType: + // nothing to do + case *ListType: + for i, l := range n.List { + n.List[i] = Walk(l, fn) + } + case *ObjectType: + n.List = Walk(n.List, fn).(*ObjectList) + default: + // should we panic here? + fmt.Printf("unknown type: %T\n", n) + } + + fn(nil) + return rewritten +} diff --git a/vendor/github.com/hashicorp/hcl/hcl/fmtcmd/fmtcmd.go b/vendor/github.com/hashicorp/hcl/hcl/fmtcmd/fmtcmd.go new file mode 100644 index 0000000000..2380d71e3c --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl/fmtcmd/fmtcmd.go @@ -0,0 +1,162 @@ +// Derivative work from: +// - https://golang.org/src/cmd/gofmt/gofmt.go +// - https://github.com/fatih/hclfmt + +package fmtcmd + +import ( + "bytes" + "errors" + "fmt" + "io" + "io/ioutil" + "os" + "os/exec" + "path/filepath" + "strings" + + "github.com/hashicorp/hcl/hcl/printer" +) + +var ( + ErrWriteStdin = errors.New("cannot use write option with standard input") +) + +type Options struct { + List bool // list files whose formatting differs + Write bool // write result to (source) file instead of stdout + Diff bool // display diffs of formatting changes +} + +func isValidFile(f os.FileInfo, extensions []string) bool { + if !f.IsDir() && !strings.HasPrefix(f.Name(), ".") { + for _, ext := range extensions { + if strings.HasSuffix(f.Name(), "."+ext) { + return true + } + } + } + + return false +} + +// If in == nil, the source is the contents of the file with the given filename. +func processFile(filename string, in io.Reader, out io.Writer, stdin bool, opts Options) error { + if in == nil { + f, err := os.Open(filename) + if err != nil { + return err + } + defer f.Close() + in = f + } + + src, err := ioutil.ReadAll(in) + if err != nil { + return err + } + + res, err := printer.Format(src) + if err != nil { + return fmt.Errorf("In %s: %s", filename, err) + } + + if !bytes.Equal(src, res) { + // formatting has changed + if opts.List { + fmt.Fprintln(out, filename) + } + if opts.Write { + err = ioutil.WriteFile(filename, res, 0644) + if err != nil { + return err + } + } + if opts.Diff { + data, err := diff(src, res) + if err != nil { + return fmt.Errorf("computing diff: %s", err) + } + fmt.Fprintf(out, "diff a/%s b/%s\n", filename, filename) + out.Write(data) + } + } + + if !opts.List && !opts.Write && !opts.Diff { + _, err = out.Write(res) + } + + return err +} + +func walkDir(path string, extensions []string, stdout io.Writer, opts Options) error { + visitFile := func(path string, f os.FileInfo, err error) error { + if err == nil && isValidFile(f, extensions) { + err = processFile(path, nil, stdout, false, opts) + } + return err + } + + return filepath.Walk(path, visitFile) +} + +func Run( + paths, extensions []string, + stdin io.Reader, + stdout io.Writer, + opts Options, +) error { + if len(paths) == 0 { + if opts.Write { + return ErrWriteStdin + } + if err := processFile("", stdin, stdout, true, opts); err != nil { + return err + } + return nil + } + + for _, path := range paths { + switch dir, err := os.Stat(path); { + case err != nil: + return err + case dir.IsDir(): + if err := walkDir(path, extensions, stdout, opts); err != nil { + return err + } + default: + if err := processFile(path, nil, stdout, false, opts); err != nil { + return err + } + } + } + + return nil +} + +func diff(b1, b2 []byte) (data []byte, err error) { + f1, err := ioutil.TempFile("", "") + if err != nil { + return + } + defer os.Remove(f1.Name()) + defer f1.Close() + + f2, err := ioutil.TempFile("", "") + if err != nil { + return + } + defer os.Remove(f2.Name()) + defer f2.Close() + + f1.Write(b1) + f2.Write(b2) + + data, err = exec.Command("diff", "-u", f1.Name(), f2.Name()).CombinedOutput() + if len(data) > 0 { + // diff exits with a non-zero status when the files don't match. + // Ignore that failure as long as we get output. + err = nil + } + return +} diff --git a/vendor/github.com/hashicorp/hcl/hcl/fmtcmd/fmtcmd_test.go b/vendor/github.com/hashicorp/hcl/hcl/fmtcmd/fmtcmd_test.go new file mode 100644 index 0000000000..b952d76d81 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl/fmtcmd/fmtcmd_test.go @@ -0,0 +1,440 @@ +// +build !windows +// TODO(jen20): These need fixing on Windows but fmt is not used right now +// and red CI is making it harder to process other bugs, so ignore until +// we get around to fixing them. + +package fmtcmd + +import ( + "bytes" + "fmt" + "io/ioutil" + "os" + "path/filepath" + "reflect" + "regexp" + "sort" + "syscall" + "testing" + + "github.com/hashicorp/hcl/testhelper" +) + +var fixtureExtensions = []string{"hcl"} + +func init() { + sort.Sort(ByFilename(fixtures)) +} + +func TestIsValidFile(t *testing.T) { + const fixtureDir = "./test-fixtures" + + cases := []struct { + Path string + Expected bool + }{ + {"good.hcl", true}, + {".hidden.ignore", false}, + {"file.ignore", false}, + {"dir.ignore", false}, + } + + for _, tc := range cases { + file, err := os.Stat(filepath.Join(fixtureDir, tc.Path)) + if err != nil { + t.Errorf("unexpected error: %s", err) + } + + if res := isValidFile(file, fixtureExtensions); res != tc.Expected { + t.Errorf("want: %b, got: %b", tc.Expected, res) + } + } +} + +func TestRunMultiplePaths(t *testing.T) { + path1, err := renderFixtures("") + if err != nil { + t.Errorf("unexpected error: %s", err) + } + defer os.RemoveAll(path1) + path2, err := renderFixtures("") + if err != nil { + t.Errorf("unexpected error: %s", err) + } + defer os.RemoveAll(path2) + + var expectedOut bytes.Buffer + for _, path := range []string{path1, path2} { + for _, fixture := range fixtures { + if !bytes.Equal(fixture.golden, fixture.input) { + expectedOut.WriteString(filepath.Join(path, fixture.filename) + "\n") + } + } + } + + _, stdout := mockIO() + err = Run( + []string{path1, path2}, + fixtureExtensions, + nil, stdout, + Options{ + List: true, + }, + ) + + if err != nil { + t.Errorf("unexpected error: %s", err) + } + if stdout.String() != expectedOut.String() { + t.Errorf("stdout want:\n%s\ngot:\n%s", expectedOut, stdout) + } +} + +func TestRunSubDirectories(t *testing.T) { + pathParent, err := ioutil.TempDir("", "") + if err != nil { + t.Errorf("unexpected error: %s", err) + } + defer os.RemoveAll(pathParent) + + path1, err := renderFixtures(pathParent) + if err != nil { + t.Errorf("unexpected error: %s", err) + } + path2, err := renderFixtures(pathParent) + if err != nil { + t.Errorf("unexpected error: %s", err) + } + + paths := []string{path1, path2} + sort.Strings(paths) + + var expectedOut bytes.Buffer + for _, path := range paths { + for _, fixture := range fixtures { + if !bytes.Equal(fixture.golden, fixture.input) { + expectedOut.WriteString(filepath.Join(path, fixture.filename) + "\n") + } + } + } + + _, stdout := mockIO() + err = Run( + []string{pathParent}, + fixtureExtensions, + nil, stdout, + Options{ + List: true, + }, + ) + + if err != nil { + t.Errorf("unexpected error: %s", err) + } + if stdout.String() != expectedOut.String() { + t.Errorf("stdout want:\n%s\ngot:\n%s", expectedOut, stdout) + } +} + +func TestRunStdin(t *testing.T) { + var expectedOut bytes.Buffer + for i, fixture := range fixtures { + if i != 0 { + expectedOut.WriteString("\n") + } + expectedOut.Write(fixture.golden) + } + + stdin, stdout := mockIO() + for _, fixture := range fixtures { + stdin.Write(fixture.input) + } + + err := Run( + []string{}, + fixtureExtensions, + stdin, stdout, + Options{}, + ) + + if err != nil { + t.Errorf("unexpected error: %s", err) + } + if !bytes.Equal(stdout.Bytes(), expectedOut.Bytes()) { + t.Errorf("stdout want:\n%s\ngot:\n%s", expectedOut, stdout) + } +} + +func TestRunStdinAndWrite(t *testing.T) { + var expectedOut = []byte{} + + stdin, stdout := mockIO() + stdin.WriteString("") + err := Run( + []string{}, []string{}, + stdin, stdout, + Options{ + Write: true, + }, + ) + + if err != ErrWriteStdin { + t.Errorf("error want:\n%s\ngot:\n%s", ErrWriteStdin, err) + } + if !bytes.Equal(stdout.Bytes(), expectedOut) { + t.Errorf("stdout want:\n%s\ngot:\n%s", expectedOut, stdout) + } +} + +func TestRunFileError(t *testing.T) { + path, err := ioutil.TempDir("", "") + if err != nil { + t.Errorf("unexpected error: %s", err) + } + defer os.RemoveAll(path) + filename := filepath.Join(path, "unreadable.hcl") + + var expectedError = &os.PathError{ + Op: "open", + Path: filename, + Err: syscall.EACCES, + } + + err = ioutil.WriteFile(filename, []byte{}, 0000) + if err != nil { + t.Errorf("unexpected error: %s", err) + } + + _, stdout := mockIO() + err = Run( + []string{path}, + fixtureExtensions, + nil, stdout, + Options{}, + ) + + if !reflect.DeepEqual(err, expectedError) { + t.Errorf("error want: %#v, got: %#v", expectedError, err) + } +} + +func TestRunNoOptions(t *testing.T) { + path, err := renderFixtures("") + if err != nil { + t.Errorf("unexpected error: %s", err) + } + defer os.RemoveAll(path) + + var expectedOut bytes.Buffer + for _, fixture := range fixtures { + expectedOut.Write(fixture.golden) + } + + _, stdout := mockIO() + err = Run( + []string{path}, + fixtureExtensions, + nil, stdout, + Options{}, + ) + + if err != nil { + t.Errorf("unexpected error: %s", err) + } + if stdout.String() != expectedOut.String() { + t.Errorf("stdout want:\n%s\ngot:\n%s", expectedOut, stdout) + } +} + +func TestRunList(t *testing.T) { + path, err := renderFixtures("") + if err != nil { + t.Errorf("unexpected error: %s", err) + } + defer os.RemoveAll(path) + + var expectedOut bytes.Buffer + for _, fixture := range fixtures { + if !bytes.Equal(fixture.golden, fixture.input) { + expectedOut.WriteString(fmt.Sprintln(filepath.Join(path, fixture.filename))) + } + } + + _, stdout := mockIO() + err = Run( + []string{path}, + fixtureExtensions, + nil, stdout, + Options{ + List: true, + }, + ) + + if err != nil { + t.Errorf("unexpected error: %s", err) + } + if stdout.String() != expectedOut.String() { + t.Errorf("stdout want:\n%s\ngot:\n%s", expectedOut, stdout) + } +} + +func TestRunWrite(t *testing.T) { + path, err := renderFixtures("") + if err != nil { + t.Errorf("unexpected error: %s", err) + } + defer os.RemoveAll(path) + + _, stdout := mockIO() + err = Run( + []string{path}, + fixtureExtensions, + nil, stdout, + Options{ + Write: true, + }, + ) + + if err != nil { + t.Errorf("unexpected error: %s", err) + } + for _, fixture := range fixtures { + res, err := ioutil.ReadFile(filepath.Join(path, fixture.filename)) + if err != nil { + t.Errorf("unexpected error: %s", err) + } + if !bytes.Equal(res, fixture.golden) { + t.Errorf("file %q contents want:\n%s\ngot:\n%s", fixture.filename, fixture.golden, res) + } + } +} + +func TestRunDiff(t *testing.T) { + path, err := renderFixtures("") + if err != nil { + t.Errorf("unexpected error: %s", err) + } + defer os.RemoveAll(path) + + var expectedOut bytes.Buffer + for _, fixture := range fixtures { + if len(fixture.diff) > 0 { + expectedOut.WriteString( + regexp.QuoteMeta( + fmt.Sprintf("diff a/%s/%s b/%s/%s\n", path, fixture.filename, path, fixture.filename), + ), + ) + // Need to use regex to ignore datetimes in diff. + expectedOut.WriteString(`--- .+?\n`) + expectedOut.WriteString(`\+\+\+ .+?\n`) + expectedOut.WriteString(regexp.QuoteMeta(string(fixture.diff))) + } + } + + expectedOutString := testhelper.Unix2dos(expectedOut.String()) + + _, stdout := mockIO() + err = Run( + []string{path}, + fixtureExtensions, + nil, stdout, + Options{ + Diff: true, + }, + ) + + if err != nil { + t.Errorf("unexpected error: %s", err) + } + if !regexp.MustCompile(expectedOutString).Match(stdout.Bytes()) { + t.Errorf("stdout want match:\n%s\ngot:\n%q", expectedOutString, stdout) + } +} + +func mockIO() (stdin, stdout *bytes.Buffer) { + return new(bytes.Buffer), new(bytes.Buffer) +} + +type fixture struct { + filename string + input, golden, diff []byte +} + +type ByFilename []fixture + +func (s ByFilename) Len() int { return len(s) } +func (s ByFilename) Swap(i, j int) { s[i], s[j] = s[j], s[i] } +func (s ByFilename) Less(i, j int) bool { return len(s[i].filename) > len(s[j].filename) } + +var fixtures = []fixture{ + { + "noop.hcl", + []byte(`resource "aws_security_group" "firewall" { + count = 5 +} +`), + []byte(`resource "aws_security_group" "firewall" { + count = 5 +} +`), + []byte(``), + }, { + "align_equals.hcl", + []byte(`variable "foo" { + default = "bar" + description = "bar" +} +`), + []byte(`variable "foo" { + default = "bar" + description = "bar" +} +`), + []byte(`@@ -1,4 +1,4 @@ + variable "foo" { +- default = "bar" ++ default = "bar" + description = "bar" + } +`), + }, { + "indentation.hcl", + []byte(`provider "aws" { + access_key = "foo" + secret_key = "bar" +} +`), + []byte(`provider "aws" { + access_key = "foo" + secret_key = "bar" +} +`), + []byte(`@@ -1,4 +1,4 @@ + provider "aws" { +- access_key = "foo" +- secret_key = "bar" ++ access_key = "foo" ++ secret_key = "bar" + } +`), + }, +} + +// parent can be an empty string, in which case the system's default +// temporary directory will be used. +func renderFixtures(parent string) (path string, err error) { + path, err = ioutil.TempDir(parent, "") + if err != nil { + return "", err + } + + for _, fixture := range fixtures { + err = ioutil.WriteFile(filepath.Join(path, fixture.filename), []byte(fixture.input), 0644) + if err != nil { + os.RemoveAll(path) + return "", err + } + } + + return path, nil +} diff --git a/vendor/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/dir.ignore b/vendor/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/dir.ignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/vendor/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/file.ignore b/vendor/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/file.ignore new file mode 100644 index 0000000000..9977a2836c --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/file.ignore @@ -0,0 +1 @@ +invalid diff --git a/vendor/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/good.hcl b/vendor/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/good.hcl new file mode 100644 index 0000000000..e69de29bb2 diff --git a/vendor/github.com/hashicorp/hcl/hcl/parser/error.go b/vendor/github.com/hashicorp/hcl/hcl/parser/error.go new file mode 100644 index 0000000000..5c99381dfb --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl/parser/error.go @@ -0,0 +1,17 @@ +package parser + +import ( + "fmt" + + "github.com/hashicorp/hcl/hcl/token" +) + +// PosError is a parse error that contains a position. +type PosError struct { + Pos token.Pos + Err error +} + +func (e *PosError) Error() string { + return fmt.Sprintf("At %s: %s", e.Pos, e.Err) +} diff --git a/vendor/github.com/hashicorp/hcl/hcl/parser/error_test.go b/vendor/github.com/hashicorp/hcl/hcl/parser/error_test.go new file mode 100644 index 0000000000..32399fec5d --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl/parser/error_test.go @@ -0,0 +1,9 @@ +package parser + +import ( + "testing" +) + +func TestPosError_impl(t *testing.T) { + var _ error = new(PosError) +} diff --git a/vendor/github.com/hashicorp/hcl/hcl/parser/parser.go b/vendor/github.com/hashicorp/hcl/hcl/parser/parser.go new file mode 100644 index 0000000000..098e1bc495 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl/parser/parser.go @@ -0,0 +1,526 @@ +// Package parser implements a parser for HCL (HashiCorp Configuration +// Language) +package parser + +import ( + "bytes" + "errors" + "fmt" + "strings" + + "github.com/hashicorp/hcl/hcl/ast" + "github.com/hashicorp/hcl/hcl/scanner" + "github.com/hashicorp/hcl/hcl/token" +) + +type Parser struct { + sc *scanner.Scanner + + // Last read token + tok token.Token + commaPrev token.Token + + comments []*ast.CommentGroup + leadComment *ast.CommentGroup // last lead comment + lineComment *ast.CommentGroup // last line comment + + enableTrace bool + indent int + n int // buffer size (max = 1) +} + +func newParser(src []byte) *Parser { + return &Parser{ + sc: scanner.New(src), + } +} + +// Parse returns the fully parsed source and returns the abstract syntax tree. +func Parse(src []byte) (*ast.File, error) { + // normalize all line endings + // since the scanner and output only work with "\n" line endings, we may + // end up with dangling "\r" characters in the parsed data. + src = bytes.Replace(src, []byte("\r\n"), []byte("\n"), -1) + + p := newParser(src) + return p.Parse() +} + +var errEofToken = errors.New("EOF token found") + +// Parse returns the fully parsed source and returns the abstract syntax tree. +func (p *Parser) Parse() (*ast.File, error) { + f := &ast.File{} + var err, scerr error + p.sc.Error = func(pos token.Pos, msg string) { + scerr = &PosError{Pos: pos, Err: errors.New(msg)} + } + + f.Node, err = p.objectList(false) + if scerr != nil { + return nil, scerr + } + if err != nil { + return nil, err + } + + f.Comments = p.comments + return f, nil +} + +// objectList parses a list of items within an object (generally k/v pairs). +// The parameter" obj" tells this whether to we are within an object (braces: +// '{', '}') or just at the top level. If we're within an object, we end +// at an RBRACE. +func (p *Parser) objectList(obj bool) (*ast.ObjectList, error) { + defer un(trace(p, "ParseObjectList")) + node := &ast.ObjectList{} + + for { + if obj { + tok := p.scan() + p.unscan() + if tok.Type == token.RBRACE { + break + } + } + + n, err := p.objectItem() + if err == errEofToken { + break // we are finished + } + + // we don't return a nil node, because might want to use already + // collected items. + if err != nil { + return node, err + } + + node.Add(n) + + // object lists can be optionally comma-delimited e.g. when a list of maps + // is being expressed, so a comma is allowed here - it's simply consumed + tok := p.scan() + if tok.Type != token.COMMA { + p.unscan() + } + } + return node, nil +} + +func (p *Parser) consumeComment() (comment *ast.Comment, endline int) { + endline = p.tok.Pos.Line + + // count the endline if it's multiline comment, ie starting with /* + if len(p.tok.Text) > 1 && p.tok.Text[1] == '*' { + // don't use range here - no need to decode Unicode code points + for i := 0; i < len(p.tok.Text); i++ { + if p.tok.Text[i] == '\n' { + endline++ + } + } + } + + comment = &ast.Comment{Start: p.tok.Pos, Text: p.tok.Text} + p.tok = p.sc.Scan() + return +} + +func (p *Parser) consumeCommentGroup(n int) (comments *ast.CommentGroup, endline int) { + var list []*ast.Comment + endline = p.tok.Pos.Line + + for p.tok.Type == token.COMMENT && p.tok.Pos.Line <= endline+n { + var comment *ast.Comment + comment, endline = p.consumeComment() + list = append(list, comment) + } + + // add comment group to the comments list + comments = &ast.CommentGroup{List: list} + p.comments = append(p.comments, comments) + + return +} + +// objectItem parses a single object item +func (p *Parser) objectItem() (*ast.ObjectItem, error) { + defer un(trace(p, "ParseObjectItem")) + + keys, err := p.objectKey() + if len(keys) > 0 && err == errEofToken { + // We ignore eof token here since it is an error if we didn't + // receive a value (but we did receive a key) for the item. + err = nil + } + if len(keys) > 0 && err != nil && p.tok.Type == token.RBRACE { + // This is a strange boolean statement, but what it means is: + // We have keys with no value, and we're likely in an object + // (since RBrace ends an object). For this, we set err to nil so + // we continue and get the error below of having the wrong value + // type. + err = nil + + // Reset the token type so we don't think it completed fine. See + // objectType which uses p.tok.Type to check if we're done with + // the object. + p.tok.Type = token.EOF + } + if err != nil { + return nil, err + } + + o := &ast.ObjectItem{ + Keys: keys, + } + + if p.leadComment != nil { + o.LeadComment = p.leadComment + p.leadComment = nil + } + + switch p.tok.Type { + case token.ASSIGN: + o.Assign = p.tok.Pos + o.Val, err = p.object() + if err != nil { + return nil, err + } + case token.LBRACE: + o.Val, err = p.objectType() + if err != nil { + return nil, err + } + default: + keyStr := make([]string, 0, len(keys)) + for _, k := range keys { + keyStr = append(keyStr, k.Token.Text) + } + + return nil, &PosError{ + Pos: p.tok.Pos, + Err: fmt.Errorf( + "key '%s' expected start of object ('{') or assignment ('=')", + strings.Join(keyStr, " ")), + } + } + + // do a look-ahead for line comment + p.scan() + if len(keys) > 0 && o.Val.Pos().Line == keys[0].Pos().Line && p.lineComment != nil { + o.LineComment = p.lineComment + p.lineComment = nil + } + p.unscan() + return o, nil +} + +// objectKey parses an object key and returns a ObjectKey AST +func (p *Parser) objectKey() ([]*ast.ObjectKey, error) { + keyCount := 0 + keys := make([]*ast.ObjectKey, 0) + + for { + tok := p.scan() + switch tok.Type { + case token.EOF: + // It is very important to also return the keys here as well as + // the error. This is because we need to be able to tell if we + // did parse keys prior to finding the EOF, or if we just found + // a bare EOF. + return keys, errEofToken + case token.ASSIGN: + // assignment or object only, but not nested objects. this is not + // allowed: `foo bar = {}` + if keyCount > 1 { + return nil, &PosError{ + Pos: p.tok.Pos, + Err: fmt.Errorf("nested object expected: LBRACE got: %s", p.tok.Type), + } + } + + if keyCount == 0 { + return nil, &PosError{ + Pos: p.tok.Pos, + Err: errors.New("no object keys found!"), + } + } + + return keys, nil + case token.LBRACE: + var err error + + // If we have no keys, then it is a syntax error. i.e. {{}} is not + // allowed. + if len(keys) == 0 { + err = &PosError{ + Pos: p.tok.Pos, + Err: fmt.Errorf("expected: IDENT | STRING got: %s", p.tok.Type), + } + } + + // object + return keys, err + case token.IDENT, token.STRING: + keyCount++ + keys = append(keys, &ast.ObjectKey{Token: p.tok}) + case token.ILLEGAL: + return keys, &PosError{ + Pos: p.tok.Pos, + Err: fmt.Errorf("illegal character"), + } + default: + return keys, &PosError{ + Pos: p.tok.Pos, + Err: fmt.Errorf("expected: IDENT | STRING | ASSIGN | LBRACE got: %s", p.tok.Type), + } + } + } +} + +// object parses any type of object, such as number, bool, string, object or +// list. +func (p *Parser) object() (ast.Node, error) { + defer un(trace(p, "ParseType")) + tok := p.scan() + + switch tok.Type { + case token.NUMBER, token.FLOAT, token.BOOL, token.STRING, token.HEREDOC: + return p.literalType() + case token.LBRACE: + return p.objectType() + case token.LBRACK: + return p.listType() + case token.COMMENT: + // implement comment + case token.EOF: + return nil, errEofToken + } + + return nil, &PosError{ + Pos: tok.Pos, + Err: fmt.Errorf("Unknown token: %+v", tok), + } +} + +// objectType parses an object type and returns a ObjectType AST +func (p *Parser) objectType() (*ast.ObjectType, error) { + defer un(trace(p, "ParseObjectType")) + + // we assume that the currently scanned token is a LBRACE + o := &ast.ObjectType{ + Lbrace: p.tok.Pos, + } + + l, err := p.objectList(true) + + // if we hit RBRACE, we are good to go (means we parsed all Items), if it's + // not a RBRACE, it's an syntax error and we just return it. + if err != nil && p.tok.Type != token.RBRACE { + return nil, err + } + + // No error, scan and expect the ending to be a brace + if tok := p.scan(); tok.Type != token.RBRACE { + return nil, &PosError{ + Pos: tok.Pos, + Err: fmt.Errorf("object expected closing RBRACE got: %s", tok.Type), + } + } + + o.List = l + o.Rbrace = p.tok.Pos // advanced via parseObjectList + return o, nil +} + +// listType parses a list type and returns a ListType AST +func (p *Parser) listType() (*ast.ListType, error) { + defer un(trace(p, "ParseListType")) + + // we assume that the currently scanned token is a LBRACK + l := &ast.ListType{ + Lbrack: p.tok.Pos, + } + + needComma := false + for { + tok := p.scan() + if needComma { + switch tok.Type { + case token.COMMA, token.RBRACK: + default: + return nil, &PosError{ + Pos: tok.Pos, + Err: fmt.Errorf( + "error parsing list, expected comma or list end, got: %s", + tok.Type), + } + } + } + switch tok.Type { + case token.BOOL, token.NUMBER, token.FLOAT, token.STRING, token.HEREDOC: + node, err := p.literalType() + if err != nil { + return nil, err + } + + // If there is a lead comment, apply it + if p.leadComment != nil { + node.LeadComment = p.leadComment + p.leadComment = nil + } + + l.Add(node) + needComma = true + case token.COMMA: + // get next list item or we are at the end + // do a look-ahead for line comment + p.scan() + if p.lineComment != nil && len(l.List) > 0 { + lit, ok := l.List[len(l.List)-1].(*ast.LiteralType) + if ok { + lit.LineComment = p.lineComment + l.List[len(l.List)-1] = lit + p.lineComment = nil + } + } + p.unscan() + + needComma = false + continue + case token.LBRACE: + // Looks like a nested object, so parse it out + node, err := p.objectType() + if err != nil { + return nil, &PosError{ + Pos: tok.Pos, + Err: fmt.Errorf( + "error while trying to parse object within list: %s", err), + } + } + l.Add(node) + needComma = true + case token.LBRACK: + node, err := p.listType() + if err != nil { + return nil, &PosError{ + Pos: tok.Pos, + Err: fmt.Errorf( + "error while trying to parse list within list: %s", err), + } + } + l.Add(node) + case token.RBRACK: + // finished + l.Rbrack = p.tok.Pos + return l, nil + default: + return nil, &PosError{ + Pos: tok.Pos, + Err: fmt.Errorf("unexpected token while parsing list: %s", tok.Type), + } + } + } +} + +// literalType parses a literal type and returns a LiteralType AST +func (p *Parser) literalType() (*ast.LiteralType, error) { + defer un(trace(p, "ParseLiteral")) + + return &ast.LiteralType{ + Token: p.tok, + }, nil +} + +// scan returns the next token from the underlying scanner. If a token has +// been unscanned then read that instead. In the process, it collects any +// comment groups encountered, and remembers the last lead and line comments. +func (p *Parser) scan() token.Token { + // If we have a token on the buffer, then return it. + if p.n != 0 { + p.n = 0 + return p.tok + } + + // Otherwise read the next token from the scanner and Save it to the buffer + // in case we unscan later. + prev := p.tok + p.tok = p.sc.Scan() + + if p.tok.Type == token.COMMENT { + var comment *ast.CommentGroup + var endline int + + // fmt.Printf("p.tok.Pos.Line = %+v prev: %d endline %d \n", + // p.tok.Pos.Line, prev.Pos.Line, endline) + if p.tok.Pos.Line == prev.Pos.Line { + // The comment is on same line as the previous token; it + // cannot be a lead comment but may be a line comment. + comment, endline = p.consumeCommentGroup(0) + if p.tok.Pos.Line != endline { + // The next token is on a different line, thus + // the last comment group is a line comment. + p.lineComment = comment + } + } + + // consume successor comments, if any + endline = -1 + for p.tok.Type == token.COMMENT { + comment, endline = p.consumeCommentGroup(1) + } + + if endline+1 == p.tok.Pos.Line && p.tok.Type != token.RBRACE { + switch p.tok.Type { + case token.RBRACE, token.RBRACK: + // Do not count for these cases + default: + // The next token is following on the line immediately after the + // comment group, thus the last comment group is a lead comment. + p.leadComment = comment + } + } + + } + + return p.tok +} + +// unscan pushes the previously read token back onto the buffer. +func (p *Parser) unscan() { + p.n = 1 +} + +// ---------------------------------------------------------------------------- +// Parsing support + +func (p *Parser) printTrace(a ...interface{}) { + if !p.enableTrace { + return + } + + const dots = ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . " + const n = len(dots) + fmt.Printf("%5d:%3d: ", p.tok.Pos.Line, p.tok.Pos.Column) + + i := 2 * p.indent + for i > n { + fmt.Print(dots) + i -= n + } + // i <= n + fmt.Print(dots[0:i]) + fmt.Println(a...) +} + +func trace(p *Parser, msg string) *Parser { + p.printTrace(msg, "(") + p.indent++ + return p +} + +// Usage pattern: defer un(trace(p, "...")) +func un(p *Parser) { + p.indent-- + p.printTrace(")") +} diff --git a/vendor/github.com/hashicorp/hcl/hcl/parser/parser_test.go b/vendor/github.com/hashicorp/hcl/hcl/parser/parser_test.go new file mode 100644 index 0000000000..2702122076 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl/parser/parser_test.go @@ -0,0 +1,575 @@ +package parser + +import ( + "fmt" + "io/ioutil" + "path/filepath" + "reflect" + "runtime" + "strings" + "testing" + + "github.com/hashicorp/hcl/hcl/ast" + "github.com/hashicorp/hcl/hcl/token" +) + +func TestType(t *testing.T) { + var literals = []struct { + typ token.Type + src string + }{ + {token.STRING, `foo = "foo"`}, + {token.NUMBER, `foo = 123`}, + {token.NUMBER, `foo = -29`}, + {token.FLOAT, `foo = 123.12`}, + {token.FLOAT, `foo = -123.12`}, + {token.BOOL, `foo = true`}, + {token.HEREDOC, "foo = <= 0 { + result = p.heredocIndent(result) + } + } + + return result +} + +// objectItem returns the printable HCL form of an object item. An object type +// starts with one/multiple keys and has a value. The value might be of any +// type. +func (p *printer) objectItem(o *ast.ObjectItem) []byte { + defer un(trace(p, fmt.Sprintf("ObjectItem: %s", o.Keys[0].Token.Text))) + var buf bytes.Buffer + + if o.LeadComment != nil { + for _, comment := range o.LeadComment.List { + buf.WriteString(comment.Text) + buf.WriteByte(newline) + } + } + + for i, k := range o.Keys { + buf.WriteString(k.Token.Text) + buf.WriteByte(blank) + + // reach end of key + if o.Assign.IsValid() && i == len(o.Keys)-1 && len(o.Keys) == 1 { + buf.WriteString("=") + buf.WriteByte(blank) + } + } + + buf.Write(p.output(o.Val)) + + if o.Val.Pos().Line == o.Keys[0].Pos().Line && o.LineComment != nil { + buf.WriteByte(blank) + for _, comment := range o.LineComment.List { + buf.WriteString(comment.Text) + } + } + + return buf.Bytes() +} + +// objectType returns the printable HCL form of an object type. An object type +// begins with a brace and ends with a brace. +func (p *printer) objectType(o *ast.ObjectType) []byte { + defer un(trace(p, "ObjectType")) + var buf bytes.Buffer + buf.WriteString("{") + + var index int + var nextItem token.Pos + var commented, newlinePrinted bool + for { + // Determine the location of the next actual non-comment + // item. If we're at the end, the next item is the closing brace + if index != len(o.List.Items) { + nextItem = o.List.Items[index].Pos() + } else { + nextItem = o.Rbrace + } + + // Go through the standalone comments in the file and print out + // the comments that we should be for this object item. + for _, c := range p.standaloneComments { + printed := false + var lastCommentPos token.Pos + for _, comment := range c.List { + // We only care about comments after the previous item + // we've printed so that comments are printed in the + // correct locations (between two objects for example). + // And before the next item. + if comment.Pos().After(p.prev) && comment.Pos().Before(nextItem) { + // If there are standalone comments and the initial newline has not + // been printed yet, do it now. + if !newlinePrinted { + newlinePrinted = true + buf.WriteByte(newline) + } + + // add newline if it's between other printed nodes + if index > 0 { + commented = true + buf.WriteByte(newline) + } + + // Store this position + lastCommentPos = comment.Pos() + + // output the comment itself + buf.Write(p.indent(p.heredocIndent([]byte(comment.Text)))) + + // Set printed to true to note that we printed something + printed = true + + /* + if index != len(o.List.Items) { + buf.WriteByte(newline) // do not print on the end + } + */ + } + } + + // Stuff to do if we had comments + if printed { + // Always write a newline + buf.WriteByte(newline) + + // If there is another item in the object and our comment + // didn't hug it directly, then make sure there is a blank + // line separating them. + if nextItem != o.Rbrace && nextItem.Line != lastCommentPos.Line+1 { + buf.WriteByte(newline) + } + } + } + + if index == len(o.List.Items) { + p.prev = o.Rbrace + break + } + + // At this point we are sure that it's not a totally empty block: print + // the initial newline if it hasn't been printed yet by the previous + // block about standalone comments. + if !newlinePrinted { + buf.WriteByte(newline) + newlinePrinted = true + } + + // check if we have adjacent one liner items. If yes we'll going to align + // the comments. + var aligned []*ast.ObjectItem + for _, item := range o.List.Items[index:] { + // we don't group one line lists + if len(o.List.Items) == 1 { + break + } + + // one means a oneliner with out any lead comment + // two means a oneliner with lead comment + // anything else might be something else + cur := lines(string(p.objectItem(item))) + if cur > 2 { + break + } + + curPos := item.Pos() + + nextPos := token.Pos{} + if index != len(o.List.Items)-1 { + nextPos = o.List.Items[index+1].Pos() + } + + prevPos := token.Pos{} + if index != 0 { + prevPos = o.List.Items[index-1].Pos() + } + + // fmt.Println("DEBUG ----------------") + // fmt.Printf("prev = %+v prevPos: %s\n", prev, prevPos) + // fmt.Printf("cur = %+v curPos: %s\n", cur, curPos) + // fmt.Printf("next = %+v nextPos: %s\n", next, nextPos) + + if curPos.Line+1 == nextPos.Line { + aligned = append(aligned, item) + index++ + continue + } + + if curPos.Line-1 == prevPos.Line { + aligned = append(aligned, item) + index++ + + // finish if we have a new line or comment next. This happens + // if the next item is not adjacent + if curPos.Line+1 != nextPos.Line { + break + } + continue + } + + break + } + + // put newlines if the items are between other non aligned items. + // newlines are also added if there is a standalone comment already, so + // check it too + if !commented && index != len(aligned) { + buf.WriteByte(newline) + } + + if len(aligned) >= 1 { + p.prev = aligned[len(aligned)-1].Pos() + + items := p.alignedItems(aligned) + buf.Write(p.indent(items)) + } else { + p.prev = o.List.Items[index].Pos() + + buf.Write(p.indent(p.objectItem(o.List.Items[index]))) + index++ + } + + buf.WriteByte(newline) + } + + buf.WriteString("}") + return buf.Bytes() +} + +func (p *printer) alignedItems(items []*ast.ObjectItem) []byte { + var buf bytes.Buffer + + // find the longest key and value length, needed for alignment + var longestKeyLen int // longest key length + var longestValLen int // longest value length + for _, item := range items { + key := len(item.Keys[0].Token.Text) + val := len(p.output(item.Val)) + + if key > longestKeyLen { + longestKeyLen = key + } + + if val > longestValLen { + longestValLen = val + } + } + + for i, item := range items { + if item.LeadComment != nil { + for _, comment := range item.LeadComment.List { + buf.WriteString(comment.Text) + buf.WriteByte(newline) + } + } + + for i, k := range item.Keys { + keyLen := len(k.Token.Text) + buf.WriteString(k.Token.Text) + for i := 0; i < longestKeyLen-keyLen+1; i++ { + buf.WriteByte(blank) + } + + // reach end of key + if i == len(item.Keys)-1 && len(item.Keys) == 1 { + buf.WriteString("=") + buf.WriteByte(blank) + } + } + + val := p.output(item.Val) + valLen := len(val) + buf.Write(val) + + if item.Val.Pos().Line == item.Keys[0].Pos().Line && item.LineComment != nil { + for i := 0; i < longestValLen-valLen+1; i++ { + buf.WriteByte(blank) + } + + for _, comment := range item.LineComment.List { + buf.WriteString(comment.Text) + } + } + + // do not print for the last item + if i != len(items)-1 { + buf.WriteByte(newline) + } + } + + return buf.Bytes() +} + +// list returns the printable HCL form of an list type. +func (p *printer) list(l *ast.ListType) []byte { + var buf bytes.Buffer + buf.WriteString("[") + + var longestLine int + for _, item := range l.List { + // for now we assume that the list only contains literal types + if lit, ok := item.(*ast.LiteralType); ok { + lineLen := len(lit.Token.Text) + if lineLen > longestLine { + longestLine = lineLen + } + } + } + + insertSpaceBeforeItem := false + lastHadLeadComment := false + for i, item := range l.List { + // Keep track of whether this item is a heredoc since that has + // unique behavior. + heredoc := false + if lit, ok := item.(*ast.LiteralType); ok && lit.Token.Type == token.HEREDOC { + heredoc = true + } + + if item.Pos().Line != l.Lbrack.Line { + // multiline list, add newline before we add each item + buf.WriteByte(newline) + insertSpaceBeforeItem = false + + // If we have a lead comment, then we want to write that first + leadComment := false + if lit, ok := item.(*ast.LiteralType); ok && lit.LeadComment != nil { + leadComment = true + + // If this isn't the first item and the previous element + // didn't have a lead comment, then we need to add an extra + // newline to properly space things out. If it did have a + // lead comment previously then this would be done + // automatically. + if i > 0 && !lastHadLeadComment { + buf.WriteByte(newline) + } + + for _, comment := range lit.LeadComment.List { + buf.Write(p.indent([]byte(comment.Text))) + buf.WriteByte(newline) + } + } + + // also indent each line + val := p.output(item) + curLen := len(val) + buf.Write(p.indent(val)) + + // if this item is a heredoc, then we output the comma on + // the next line. This is the only case this happens. + comma := []byte{','} + if heredoc { + buf.WriteByte(newline) + comma = p.indent(comma) + } + + buf.Write(comma) + + if lit, ok := item.(*ast.LiteralType); ok && lit.LineComment != nil { + // if the next item doesn't have any comments, do not align + buf.WriteByte(blank) // align one space + for i := 0; i < longestLine-curLen; i++ { + buf.WriteByte(blank) + } + + for _, comment := range lit.LineComment.List { + buf.WriteString(comment.Text) + } + } + + lastItem := i == len(l.List)-1 + if lastItem { + buf.WriteByte(newline) + } + + if leadComment && !lastItem { + buf.WriteByte(newline) + } + + lastHadLeadComment = leadComment + } else { + if insertSpaceBeforeItem { + buf.WriteByte(blank) + insertSpaceBeforeItem = false + } + + // Output the item itself + // also indent each line + val := p.output(item) + curLen := len(val) + buf.Write(val) + + // If this is a heredoc item we always have to output a newline + // so that it parses properly. + if heredoc { + buf.WriteByte(newline) + } + + // If this isn't the last element, write a comma. + if i != len(l.List)-1 { + buf.WriteString(",") + insertSpaceBeforeItem = true + } + + if lit, ok := item.(*ast.LiteralType); ok && lit.LineComment != nil { + // if the next item doesn't have any comments, do not align + buf.WriteByte(blank) // align one space + for i := 0; i < longestLine-curLen; i++ { + buf.WriteByte(blank) + } + + for _, comment := range lit.LineComment.List { + buf.WriteString(comment.Text) + } + } + } + + } + + buf.WriteString("]") + return buf.Bytes() +} + +// indent indents the lines of the given buffer for each non-empty line +func (p *printer) indent(buf []byte) []byte { + var prefix []byte + if p.cfg.SpacesWidth != 0 { + for i := 0; i < p.cfg.SpacesWidth; i++ { + prefix = append(prefix, blank) + } + } else { + prefix = []byte{tab} + } + + var res []byte + bol := true + for _, c := range buf { + if bol && c != '\n' { + res = append(res, prefix...) + } + + res = append(res, c) + bol = c == '\n' + } + return res +} + +// unindent removes all the indentation from the tombstoned lines +func (p *printer) unindent(buf []byte) []byte { + var res []byte + for i := 0; i < len(buf); i++ { + skip := len(buf)-i <= len(unindent) + if !skip { + skip = !bytes.Equal(unindent, buf[i:i+len(unindent)]) + } + if skip { + res = append(res, buf[i]) + continue + } + + // We have a marker. we have to backtrace here and clean out + // any whitespace ahead of our tombstone up to a \n + for j := len(res) - 1; j >= 0; j-- { + if res[j] == '\n' { + break + } + + res = res[:j] + } + + // Skip the entire unindent marker + i += len(unindent) - 1 + } + + return res +} + +// heredocIndent marks all the 2nd and further lines as unindentable +func (p *printer) heredocIndent(buf []byte) []byte { + var res []byte + bol := false + for _, c := range buf { + if bol && c != '\n' { + res = append(res, unindent...) + } + res = append(res, c) + bol = c == '\n' + } + return res +} + +// isSingleLineObject tells whether the given object item is a single +// line object such as "obj {}". +// +// A single line object: +// +// * has no lead comments (hence multi-line) +// * has no assignment +// * has no values in the stanza (within {}) +// +func (p *printer) isSingleLineObject(val *ast.ObjectItem) bool { + // If there is a lead comment, can't be one line + if val.LeadComment != nil { + return false + } + + // If there is assignment, we always break by line + if val.Assign.IsValid() { + return false + } + + // If it isn't an object type, then its not a single line object + ot, ok := val.Val.(*ast.ObjectType) + if !ok { + return false + } + + // If the object has no items, it is single line! + return len(ot.List.Items) == 0 +} + +func lines(txt string) int { + endline := 1 + for i := 0; i < len(txt); i++ { + if txt[i] == '\n' { + endline++ + } + } + return endline +} + +// ---------------------------------------------------------------------------- +// Tracing support + +func (p *printer) printTrace(a ...interface{}) { + if !p.enableTrace { + return + } + + const dots = ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . " + const n = len(dots) + i := 2 * p.indentTrace + for i > n { + fmt.Print(dots) + i -= n + } + // i <= n + fmt.Print(dots[0:i]) + fmt.Println(a...) +} + +func trace(p *printer, msg string) *printer { + p.printTrace(msg, "(") + p.indentTrace++ + return p +} + +// Usage pattern: defer un(trace(p, "...")) +func un(p *printer) { + p.indentTrace-- + p.printTrace(")") +} diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/printer.go b/vendor/github.com/hashicorp/hcl/hcl/printer/printer.go new file mode 100644 index 0000000000..6617ab8e7a --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl/printer/printer.go @@ -0,0 +1,66 @@ +// Package printer implements printing of AST nodes to HCL format. +package printer + +import ( + "bytes" + "io" + "text/tabwriter" + + "github.com/hashicorp/hcl/hcl/ast" + "github.com/hashicorp/hcl/hcl/parser" +) + +var DefaultConfig = Config{ + SpacesWidth: 2, +} + +// A Config node controls the output of Fprint. +type Config struct { + SpacesWidth int // if set, it will use spaces instead of tabs for alignment +} + +func (c *Config) Fprint(output io.Writer, node ast.Node) error { + p := &printer{ + cfg: *c, + comments: make([]*ast.CommentGroup, 0), + standaloneComments: make([]*ast.CommentGroup, 0), + // enableTrace: true, + } + + p.collectComments(node) + + if _, err := output.Write(p.unindent(p.output(node))); err != nil { + return err + } + + // flush tabwriter, if any + var err error + if tw, _ := output.(*tabwriter.Writer); tw != nil { + err = tw.Flush() + } + + return err +} + +// Fprint "pretty-prints" an HCL node to output +// It calls Config.Fprint with default settings. +func Fprint(output io.Writer, node ast.Node) error { + return DefaultConfig.Fprint(output, node) +} + +// Format formats src HCL and returns the result. +func Format(src []byte) ([]byte, error) { + node, err := parser.Parse(src) + if err != nil { + return nil, err + } + + var buf bytes.Buffer + if err := DefaultConfig.Fprint(&buf, node); err != nil { + return nil, err + } + + // Add trailing newline to result + buf.WriteString("\n") + return buf.Bytes(), nil +} diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/printer_test.go b/vendor/github.com/hashicorp/hcl/hcl/printer/printer_test.go new file mode 100644 index 0000000000..5248259b9d --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl/printer/printer_test.go @@ -0,0 +1,149 @@ +package printer + +import ( + "bytes" + "errors" + "flag" + "fmt" + "io/ioutil" + "path/filepath" + "testing" + + "github.com/hashicorp/hcl/hcl/parser" +) + +var update = flag.Bool("update", false, "update golden files") + +const ( + dataDir = "testdata" +) + +type entry struct { + source, golden string +} + +// Use go test -update to create/update the respective golden files. +var data = []entry{ + {"complexhcl.input", "complexhcl.golden"}, + {"list.input", "list.golden"}, + {"list_comment.input", "list_comment.golden"}, + {"comment.input", "comment.golden"}, + {"comment_crlf.input", "comment.golden"}, + {"comment_aligned.input", "comment_aligned.golden"}, + {"comment_array.input", "comment_array.golden"}, + {"comment_end_file.input", "comment_end_file.golden"}, + {"comment_multiline_indent.input", "comment_multiline_indent.golden"}, + {"comment_multiline_no_stanza.input", "comment_multiline_no_stanza.golden"}, + {"comment_multiline_stanza.input", "comment_multiline_stanza.golden"}, + {"comment_newline.input", "comment_newline.golden"}, + {"comment_object_multi.input", "comment_object_multi.golden"}, + {"comment_standalone.input", "comment_standalone.golden"}, + {"empty_block.input", "empty_block.golden"}, + {"list_of_objects.input", "list_of_objects.golden"}, + {"multiline_string.input", "multiline_string.golden"}, + {"object_singleline.input", "object_singleline.golden"}, + {"object_with_heredoc.input", "object_with_heredoc.golden"}, +} + +func TestFiles(t *testing.T) { + for _, e := range data { + source := filepath.Join(dataDir, e.source) + golden := filepath.Join(dataDir, e.golden) + t.Run(e.source, func(t *testing.T) { + check(t, source, golden) + }) + } +} + +func check(t *testing.T, source, golden string) { + src, err := ioutil.ReadFile(source) + if err != nil { + t.Error(err) + return + } + + res, err := format(src) + if err != nil { + t.Error(err) + return + } + + // update golden files if necessary + if *update { + if err := ioutil.WriteFile(golden, res, 0644); err != nil { + t.Error(err) + } + return + } + + // get golden + gld, err := ioutil.ReadFile(golden) + if err != nil { + t.Error(err) + return + } + + // formatted source and golden must be the same + if err := diff(source, golden, res, gld); err != nil { + t.Error(err) + return + } +} + +// diff compares a and b. +func diff(aname, bname string, a, b []byte) error { + var buf bytes.Buffer // holding long error message + + // compare lengths + if len(a) != len(b) { + fmt.Fprintf(&buf, "\nlength changed: len(%s) = %d, len(%s) = %d", aname, len(a), bname, len(b)) + } + + // compare contents + line := 1 + offs := 1 + for i := 0; i < len(a) && i < len(b); i++ { + ch := a[i] + if ch != b[i] { + fmt.Fprintf(&buf, "\n%s:%d:%d: %q", aname, line, i-offs+1, lineAt(a, offs)) + fmt.Fprintf(&buf, "\n%s:%d:%d: %q", bname, line, i-offs+1, lineAt(b, offs)) + fmt.Fprintf(&buf, "\n\n") + break + } + if ch == '\n' { + line++ + offs = i + 1 + } + } + + if buf.Len() > 0 { + return errors.New(buf.String()) + } + return nil +} + +// format parses src, prints the corresponding AST, verifies the resulting +// src is syntactically correct, and returns the resulting src or an error +// if any. +func format(src []byte) ([]byte, error) { + formatted, err := Format(src) + if err != nil { + return nil, err + } + + // make sure formatted output is syntactically correct + if _, err := parser.Parse(formatted); err != nil { + return nil, fmt.Errorf("parse: %s\n%s", err, formatted) + } + + return formatted, nil +} + +// lineAt returns the line in text starting at offset offs. +func lineAt(text []byte, offs int) []byte { + i := offs + for i < len(text) && text[i] != '\n' { + i++ + } + return text[offs:i] +} diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment.golden b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment.golden new file mode 100644 index 0000000000..9d4b072a01 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment.golden @@ -0,0 +1,36 @@ +// A standalone comment is a comment which is not attached to any kind of node + +// This comes from Terraform, as a test +variable "foo" { + # Standalone comment should be still here + + default = "bar" + description = "bar" # yooo +} + +/* This is a multi line standalone +comment*/ + +// fatih arslan +/* This is a developer test +account and a multine comment */ +developer = ["fatih", "arslan"] // fatih arslan + +# One line here +numbers = [1, 2] // another line here + +# Another comment +variable = { + description = "bar" # another yooo + + foo { + # Nested standalone + + bar = "fatih" + } +} + +// lead comment +foo { + bar = "fatih" // line comment 2 +} // line comment 3 diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment.input b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment.input new file mode 100644 index 0000000000..57c37ac1de --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment.input @@ -0,0 +1,37 @@ +// A standalone comment is a comment which is not attached to any kind of node + + // This comes from Terraform, as a test +variable "foo" { + # Standalone comment should be still here + + default = "bar" + description = "bar" # yooo +} + +/* This is a multi line standalone +comment*/ + + +// fatih arslan +/* This is a developer test +account and a multine comment */ +developer = [ "fatih", "arslan"] // fatih arslan + +# One line here +numbers = [1,2] // another line here + + # Another comment +variable = { + description = "bar" # another yooo + foo { + # Nested standalone + + bar = "fatih" + } +} + + // lead comment +foo { + bar = "fatih" // line comment 2 +} // line comment 3 + diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_aligned.golden b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_aligned.golden new file mode 100644 index 0000000000..6ff21504c9 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_aligned.golden @@ -0,0 +1,32 @@ +aligned { + # We have some aligned items below + foo = "fatih" # yoo1 + default = "bar" # yoo2 + bar = "bar and foo" # yoo3 + + default = { + bar = "example" + } + + #deneme arslan + fatih = ["fatih"] # yoo4 + + #fatih arslan + fatiharslan = ["arslan"] // yoo5 + + default = { + bar = "example" + } + + security_groups = [ + "foo", # kenya 1 + "${aws_security_group.firewall.foo}", # kenya 2 + ] + + security_groups2 = [ + "foo", # kenya 1 + "bar", # kenya 1.5 + "${aws_security_group.firewall.foo}", # kenya 2 + "foobar", # kenya 3 + ] +} diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_aligned.input b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_aligned.input new file mode 100644 index 0000000000..bd43ab1adc --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_aligned.input @@ -0,0 +1,28 @@ +aligned { +# We have some aligned items below + foo = "fatih" # yoo1 + default = "bar" # yoo2 + bar = "bar and foo" # yoo3 + default = { + bar = "example" + } + #deneme arslan + fatih = ["fatih"] # yoo4 + #fatih arslan + fatiharslan = ["arslan"] // yoo5 + default = { + bar = "example" + } + +security_groups = [ + "foo", # kenya 1 + "${aws_security_group.firewall.foo}", # kenya 2 +] + +security_groups2 = [ + "foo", # kenya 1 + "bar", # kenya 1.5 + "${aws_security_group.firewall.foo}", # kenya 2 + "foobar", # kenya 3 +] +} diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_array.golden b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_array.golden new file mode 100644 index 0000000000..e778eafa36 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_array.golden @@ -0,0 +1,13 @@ +banana = [ + # I really want to comment this item in the array. + "a", + + # This as well + "b", + + "c", # And C + "d", + + # And another + "e", +] diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_array.input b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_array.input new file mode 100644 index 0000000000..e778eafa36 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_array.input @@ -0,0 +1,13 @@ +banana = [ + # I really want to comment this item in the array. + "a", + + # This as well + "b", + + "c", # And C + "d", + + # And another + "e", +] diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_crlf.input b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_crlf.input new file mode 100644 index 0000000000..5d27206726 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_crlf.input @@ -0,0 +1,37 @@ +// A standalone comment is a comment which is not attached to any kind of node + + // This comes from Terraform, as a test +variable "foo" { + # Standalone comment should be still here + + default = "bar" + description = "bar" # yooo +} + +/* This is a multi line standalone +comment*/ + + +// fatih arslan +/* This is a developer test +account and a multine comment */ +developer = [ "fatih", "arslan"] // fatih arslan + +# One line here +numbers = [1,2] // another line here + + # Another comment +variable = { + description = "bar" # another yooo + foo { + # Nested standalone + + bar = "fatih" + } +} + + // lead comment +foo { + bar = "fatih" // line comment 2 +} // line comment 3 + diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_end_file.golden b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_end_file.golden new file mode 100644 index 0000000000..dbeae36a8b --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_end_file.golden @@ -0,0 +1,6 @@ +resource "blah" "blah" {} + +// +// +// + diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_end_file.input b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_end_file.input new file mode 100644 index 0000000000..68c4c282ec --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_end_file.input @@ -0,0 +1,5 @@ +resource "blah" "blah" {} + +// +// +// diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_indent.golden b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_indent.golden new file mode 100644 index 0000000000..74c4ccd896 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_indent.golden @@ -0,0 +1,12 @@ +resource "provider" "resource" { + /* + SPACE_SENSITIVE_CODE = < 0 { + s.err("unexpected null character (0x00)") + return eof + } + + // debug + // fmt.Printf("ch: %q, offset:column: %d:%d\n", ch, s.srcPos.Offset, s.srcPos.Column) + return ch +} + +// unread unreads the previous read Rune and updates the source position +func (s *Scanner) unread() { + if err := s.buf.UnreadRune(); err != nil { + panic(err) // this is user fault, we should catch it + } + s.srcPos = s.prevPos // put back last position +} + +// peek returns the next rune without advancing the reader. +func (s *Scanner) peek() rune { + peek, _, err := s.buf.ReadRune() + if err != nil { + return eof + } + + s.buf.UnreadRune() + return peek +} + +// Scan scans the next token and returns the token. +func (s *Scanner) Scan() token.Token { + ch := s.next() + + // skip white space + for isWhitespace(ch) { + ch = s.next() + } + + var tok token.Type + + // token text markings + s.tokStart = s.srcPos.Offset - s.lastCharLen + + // token position, initial next() is moving the offset by one(size of rune + // actually), though we are interested with the starting point + s.tokPos.Offset = s.srcPos.Offset - s.lastCharLen + if s.srcPos.Column > 0 { + // common case: last character was not a '\n' + s.tokPos.Line = s.srcPos.Line + s.tokPos.Column = s.srcPos.Column + } else { + // last character was a '\n' + // (we cannot be at the beginning of the source + // since we have called next() at least once) + s.tokPos.Line = s.srcPos.Line - 1 + s.tokPos.Column = s.lastLineLen + } + + switch { + case isLetter(ch): + tok = token.IDENT + lit := s.scanIdentifier() + if lit == "true" || lit == "false" { + tok = token.BOOL + } + case isDecimal(ch): + tok = s.scanNumber(ch) + default: + switch ch { + case eof: + tok = token.EOF + case '"': + tok = token.STRING + s.scanString() + case '#', '/': + tok = token.COMMENT + s.scanComment(ch) + case '.': + tok = token.PERIOD + ch = s.peek() + if isDecimal(ch) { + tok = token.FLOAT + ch = s.scanMantissa(ch) + ch = s.scanExponent(ch) + } + case '<': + tok = token.HEREDOC + s.scanHeredoc() + case '[': + tok = token.LBRACK + case ']': + tok = token.RBRACK + case '{': + tok = token.LBRACE + case '}': + tok = token.RBRACE + case ',': + tok = token.COMMA + case '=': + tok = token.ASSIGN + case '+': + tok = token.ADD + case '-': + if isDecimal(s.peek()) { + ch := s.next() + tok = s.scanNumber(ch) + } else { + tok = token.SUB + } + default: + s.err("illegal char") + } + } + + // finish token ending + s.tokEnd = s.srcPos.Offset + + // create token literal + var tokenText string + if s.tokStart >= 0 { + tokenText = string(s.src[s.tokStart:s.tokEnd]) + } + s.tokStart = s.tokEnd // ensure idempotency of tokenText() call + + return token.Token{ + Type: tok, + Pos: s.tokPos, + Text: tokenText, + } +} + +func (s *Scanner) scanComment(ch rune) { + // single line comments + if ch == '#' || (ch == '/' && s.peek() != '*') { + if ch == '/' && s.peek() != '/' { + s.err("expected '/' for comment") + return + } + + ch = s.next() + for ch != '\n' && ch >= 0 && ch != eof { + ch = s.next() + } + if ch != eof && ch >= 0 { + s.unread() + } + return + } + + // be sure we get the character after /* This allows us to find comment's + // that are not erminated + if ch == '/' { + s.next() + ch = s.next() // read character after "/*" + } + + // look for /* - style comments + for { + if ch < 0 || ch == eof { + s.err("comment not terminated") + break + } + + ch0 := ch + ch = s.next() + if ch0 == '*' && ch == '/' { + break + } + } +} + +// scanNumber scans a HCL number definition starting with the given rune +func (s *Scanner) scanNumber(ch rune) token.Type { + if ch == '0' { + // check for hexadecimal, octal or float + ch = s.next() + if ch == 'x' || ch == 'X' { + // hexadecimal + ch = s.next() + found := false + for isHexadecimal(ch) { + ch = s.next() + found = true + } + + if !found { + s.err("illegal hexadecimal number") + } + + if ch != eof { + s.unread() + } + + return token.NUMBER + } + + // now it's either something like: 0421(octal) or 0.1231(float) + illegalOctal := false + for isDecimal(ch) { + ch = s.next() + if ch == '8' || ch == '9' { + // this is just a possibility. For example 0159 is illegal, but + // 0159.23 is valid. So we mark a possible illegal octal. If + // the next character is not a period, we'll print the error. + illegalOctal = true + } + } + + if ch == 'e' || ch == 'E' { + ch = s.scanExponent(ch) + return token.FLOAT + } + + if ch == '.' { + ch = s.scanFraction(ch) + + if ch == 'e' || ch == 'E' { + ch = s.next() + ch = s.scanExponent(ch) + } + return token.FLOAT + } + + if illegalOctal { + s.err("illegal octal number") + } + + if ch != eof { + s.unread() + } + return token.NUMBER + } + + s.scanMantissa(ch) + ch = s.next() // seek forward + if ch == 'e' || ch == 'E' { + ch = s.scanExponent(ch) + return token.FLOAT + } + + if ch == '.' { + ch = s.scanFraction(ch) + if ch == 'e' || ch == 'E' { + ch = s.next() + ch = s.scanExponent(ch) + } + return token.FLOAT + } + + if ch != eof { + s.unread() + } + return token.NUMBER +} + +// scanMantissa scans the mantissa beginning from the rune. It returns the next +// non decimal rune. It's used to determine wheter it's a fraction or exponent. +func (s *Scanner) scanMantissa(ch rune) rune { + scanned := false + for isDecimal(ch) { + ch = s.next() + scanned = true + } + + if scanned && ch != eof { + s.unread() + } + return ch +} + +// scanFraction scans the fraction after the '.' rune +func (s *Scanner) scanFraction(ch rune) rune { + if ch == '.' { + ch = s.peek() // we peek just to see if we can move forward + ch = s.scanMantissa(ch) + } + return ch +} + +// scanExponent scans the remaining parts of an exponent after the 'e' or 'E' +// rune. +func (s *Scanner) scanExponent(ch rune) rune { + if ch == 'e' || ch == 'E' { + ch = s.next() + if ch == '-' || ch == '+' { + ch = s.next() + } + ch = s.scanMantissa(ch) + } + return ch +} + +// scanHeredoc scans a heredoc string +func (s *Scanner) scanHeredoc() { + // Scan the second '<' in example: '<= len(identBytes) && identRegexp.Match(s.src[lineStart:s.srcPos.Offset-s.lastCharLen]) { + break + } + + // Not an anchor match, record the start of a new line + lineStart = s.srcPos.Offset + } + + if ch == eof { + s.err("heredoc not terminated") + return + } + } + + return +} + +// scanString scans a quoted string +func (s *Scanner) scanString() { + braces := 0 + for { + // '"' opening already consumed + // read character after quote + ch := s.next() + + if (ch == '\n' && braces == 0) || ch < 0 || ch == eof { + s.err("literal not terminated") + return + } + + if ch == '"' && braces == 0 { + break + } + + // If we're going into a ${} then we can ignore quotes for awhile + if braces == 0 && ch == '$' && s.peek() == '{' { + braces++ + s.next() + } else if braces > 0 && ch == '{' { + braces++ + } + if braces > 0 && ch == '}' { + braces-- + } + + if ch == '\\' { + s.scanEscape() + } + } + + return +} + +// scanEscape scans an escape sequence +func (s *Scanner) scanEscape() rune { + // http://en.cppreference.com/w/cpp/language/escape + ch := s.next() // read character after '/' + switch ch { + case 'a', 'b', 'f', 'n', 'r', 't', 'v', '\\', '"': + // nothing to do + case '0', '1', '2', '3', '4', '5', '6', '7': + // octal notation + ch = s.scanDigits(ch, 8, 3) + case 'x': + // hexademical notation + ch = s.scanDigits(s.next(), 16, 2) + case 'u': + // universal character name + ch = s.scanDigits(s.next(), 16, 4) + case 'U': + // universal character name + ch = s.scanDigits(s.next(), 16, 8) + default: + s.err("illegal char escape") + } + return ch +} + +// scanDigits scans a rune with the given base for n times. For example an +// octal notation \184 would yield in scanDigits(ch, 8, 3) +func (s *Scanner) scanDigits(ch rune, base, n int) rune { + start := n + for n > 0 && digitVal(ch) < base { + ch = s.next() + if ch == eof { + // If we see an EOF, we halt any more scanning of digits + // immediately. + break + } + + n-- + } + if n > 0 { + s.err("illegal char escape") + } + + if n != start { + // we scanned all digits, put the last non digit char back, + // only if we read anything at all + s.unread() + } + + return ch +} + +// scanIdentifier scans an identifier and returns the literal string +func (s *Scanner) scanIdentifier() string { + offs := s.srcPos.Offset - s.lastCharLen + ch := s.next() + for isLetter(ch) || isDigit(ch) || ch == '-' || ch == '.' { + ch = s.next() + } + + if ch != eof { + s.unread() // we got identifier, put back latest char + } + + return string(s.src[offs:s.srcPos.Offset]) +} + +// recentPosition returns the position of the character immediately after the +// character or token returned by the last call to Scan. +func (s *Scanner) recentPosition() (pos token.Pos) { + pos.Offset = s.srcPos.Offset - s.lastCharLen + switch { + case s.srcPos.Column > 0: + // common case: last character was not a '\n' + pos.Line = s.srcPos.Line + pos.Column = s.srcPos.Column + case s.lastLineLen > 0: + // last character was a '\n' + // (we cannot be at the beginning of the source + // since we have called next() at least once) + pos.Line = s.srcPos.Line - 1 + pos.Column = s.lastLineLen + default: + // at the beginning of the source + pos.Line = 1 + pos.Column = 1 + } + return +} + +// err prints the error of any scanning to s.Error function. If the function is +// not defined, by default it prints them to os.Stderr +func (s *Scanner) err(msg string) { + s.ErrorCount++ + pos := s.recentPosition() + + if s.Error != nil { + s.Error(pos, msg) + return + } + + fmt.Fprintf(os.Stderr, "%s: %s\n", pos, msg) +} + +// isHexadecimal returns true if the given rune is a letter +func isLetter(ch rune) bool { + return 'a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' || ch == '_' || ch >= 0x80 && unicode.IsLetter(ch) +} + +// isDigit returns true if the given rune is a decimal digit +func isDigit(ch rune) bool { + return '0' <= ch && ch <= '9' || ch >= 0x80 && unicode.IsDigit(ch) +} + +// isDecimal returns true if the given rune is a decimal number +func isDecimal(ch rune) bool { + return '0' <= ch && ch <= '9' +} + +// isHexadecimal returns true if the given rune is an hexadecimal number +func isHexadecimal(ch rune) bool { + return '0' <= ch && ch <= '9' || 'a' <= ch && ch <= 'f' || 'A' <= ch && ch <= 'F' +} + +// isWhitespace returns true if the rune is a space, tab, newline or carriage return +func isWhitespace(ch rune) bool { + return ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r' +} + +// digitVal returns the integer value of a given octal,decimal or hexadecimal rune +func digitVal(ch rune) int { + switch { + case '0' <= ch && ch <= '9': + return int(ch - '0') + case 'a' <= ch && ch <= 'f': + return int(ch - 'a' + 10) + case 'A' <= ch && ch <= 'F': + return int(ch - 'A' + 10) + } + return 16 // larger than any legal digit val +} diff --git a/vendor/github.com/hashicorp/hcl/hcl/scanner/scanner_test.go b/vendor/github.com/hashicorp/hcl/hcl/scanner/scanner_test.go new file mode 100644 index 0000000000..4f2c9cbe0f --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl/scanner/scanner_test.go @@ -0,0 +1,591 @@ +package scanner + +import ( + "bytes" + "fmt" + "testing" + + "strings" + + "github.com/hashicorp/hcl/hcl/token" +) + +var f100 = strings.Repeat("f", 100) + +type tokenPair struct { + tok token.Type + text string +} + +var tokenLists = map[string][]tokenPair{ + "comment": []tokenPair{ + {token.COMMENT, "//"}, + {token.COMMENT, "////"}, + {token.COMMENT, "// comment"}, + {token.COMMENT, "// /* comment */"}, + {token.COMMENT, "// // comment //"}, + {token.COMMENT, "//" + f100}, + {token.COMMENT, "#"}, + {token.COMMENT, "##"}, + {token.COMMENT, "# comment"}, + {token.COMMENT, "# /* comment */"}, + {token.COMMENT, "# # comment #"}, + {token.COMMENT, "#" + f100}, + {token.COMMENT, "/**/"}, + {token.COMMENT, "/***/"}, + {token.COMMENT, "/* comment */"}, + {token.COMMENT, "/* // comment */"}, + {token.COMMENT, "/* /* comment */"}, + {token.COMMENT, "/*\n comment\n*/"}, + {token.COMMENT, "/*" + f100 + "*/"}, + }, + "operator": []tokenPair{ + {token.LBRACK, "["}, + {token.LBRACE, "{"}, + {token.COMMA, ","}, + {token.PERIOD, "."}, + {token.RBRACK, "]"}, + {token.RBRACE, "}"}, + {token.ASSIGN, "="}, + {token.ADD, "+"}, + {token.SUB, "-"}, + }, + "bool": []tokenPair{ + {token.BOOL, "true"}, + {token.BOOL, "false"}, + }, + "ident": []tokenPair{ + {token.IDENT, "a"}, + {token.IDENT, "a0"}, + {token.IDENT, "foobar"}, + {token.IDENT, "foo-bar"}, + {token.IDENT, "abc123"}, + {token.IDENT, "LGTM"}, + {token.IDENT, "_"}, + {token.IDENT, "_abc123"}, + {token.IDENT, "abc123_"}, + {token.IDENT, "_abc_123_"}, + {token.IDENT, "_äöü"}, + {token.IDENT, "_本"}, + {token.IDENT, "äöü"}, + {token.IDENT, "本"}, + {token.IDENT, "a۰۱۸"}, + {token.IDENT, "foo६४"}, + {token.IDENT, "bar9876"}, + }, + "heredoc": []tokenPair{ + {token.HEREDOC, "< 0 for %q", s.ErrorCount, src) + } +} + +func testTokenList(t *testing.T, tokenList []tokenPair) { + // create artifical source code + buf := new(bytes.Buffer) + for _, ident := range tokenList { + fmt.Fprintf(buf, "%s\n", ident.text) + } + + s := New(buf.Bytes()) + for _, ident := range tokenList { + tok := s.Scan() + if tok.Type != ident.tok { + t.Errorf("tok = %q want %q for %q\n", tok, ident.tok, ident.text) + } + + if tok.Text != ident.text { + t.Errorf("text = %q want %q", tok.String(), ident.text) + } + + } +} + +func countNewlines(s string) int { + n := 0 + for _, ch := range s { + if ch == '\n' { + n++ + } + } + return n +} diff --git a/vendor/github.com/hashicorp/hcl/hcl/strconv/quote.go b/vendor/github.com/hashicorp/hcl/hcl/strconv/quote.go new file mode 100644 index 0000000000..5f981eaa2f --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl/strconv/quote.go @@ -0,0 +1,241 @@ +package strconv + +import ( + "errors" + "unicode/utf8" +) + +// ErrSyntax indicates that a value does not have the right syntax for the target type. +var ErrSyntax = errors.New("invalid syntax") + +// Unquote interprets s as a single-quoted, double-quoted, +// or backquoted Go string literal, returning the string value +// that s quotes. (If s is single-quoted, it would be a Go +// character literal; Unquote returns the corresponding +// one-character string.) +func Unquote(s string) (t string, err error) { + n := len(s) + if n < 2 { + return "", ErrSyntax + } + quote := s[0] + if quote != s[n-1] { + return "", ErrSyntax + } + s = s[1 : n-1] + + if quote != '"' { + return "", ErrSyntax + } + if !contains(s, '$') && !contains(s, '{') && contains(s, '\n') { + return "", ErrSyntax + } + + // Is it trivial? Avoid allocation. + if !contains(s, '\\') && !contains(s, quote) && !contains(s, '$') { + switch quote { + case '"': + return s, nil + case '\'': + r, size := utf8.DecodeRuneInString(s) + if size == len(s) && (r != utf8.RuneError || size != 1) { + return s, nil + } + } + } + + var runeTmp [utf8.UTFMax]byte + buf := make([]byte, 0, 3*len(s)/2) // Try to avoid more allocations. + for len(s) > 0 { + // If we're starting a '${}' then let it through un-unquoted. + // Specifically: we don't unquote any characters within the `${}` + // section. + if s[0] == '$' && len(s) > 1 && s[1] == '{' { + buf = append(buf, '$', '{') + s = s[2:] + + // Continue reading until we find the closing brace, copying as-is + braces := 1 + for len(s) > 0 && braces > 0 { + r, size := utf8.DecodeRuneInString(s) + if r == utf8.RuneError { + return "", ErrSyntax + } + + s = s[size:] + + n := utf8.EncodeRune(runeTmp[:], r) + buf = append(buf, runeTmp[:n]...) + + switch r { + case '{': + braces++ + case '}': + braces-- + } + } + if braces != 0 { + return "", ErrSyntax + } + if len(s) == 0 { + // If there's no string left, we're done! + break + } else { + // If there's more left, we need to pop back up to the top of the loop + // in case there's another interpolation in this string. + continue + } + } + + if s[0] == '\n' { + return "", ErrSyntax + } + + c, multibyte, ss, err := unquoteChar(s, quote) + if err != nil { + return "", err + } + s = ss + if c < utf8.RuneSelf || !multibyte { + buf = append(buf, byte(c)) + } else { + n := utf8.EncodeRune(runeTmp[:], c) + buf = append(buf, runeTmp[:n]...) + } + if quote == '\'' && len(s) != 0 { + // single-quoted must be single character + return "", ErrSyntax + } + } + return string(buf), nil +} + +// contains reports whether the string contains the byte c. +func contains(s string, c byte) bool { + for i := 0; i < len(s); i++ { + if s[i] == c { + return true + } + } + return false +} + +func unhex(b byte) (v rune, ok bool) { + c := rune(b) + switch { + case '0' <= c && c <= '9': + return c - '0', true + case 'a' <= c && c <= 'f': + return c - 'a' + 10, true + case 'A' <= c && c <= 'F': + return c - 'A' + 10, true + } + return +} + +func unquoteChar(s string, quote byte) (value rune, multibyte bool, tail string, err error) { + // easy cases + switch c := s[0]; { + case c == quote && (quote == '\'' || quote == '"'): + err = ErrSyntax + return + case c >= utf8.RuneSelf: + r, size := utf8.DecodeRuneInString(s) + return r, true, s[size:], nil + case c != '\\': + return rune(s[0]), false, s[1:], nil + } + + // hard case: c is backslash + if len(s) <= 1 { + err = ErrSyntax + return + } + c := s[1] + s = s[2:] + + switch c { + case 'a': + value = '\a' + case 'b': + value = '\b' + case 'f': + value = '\f' + case 'n': + value = '\n' + case 'r': + value = '\r' + case 't': + value = '\t' + case 'v': + value = '\v' + case 'x', 'u', 'U': + n := 0 + switch c { + case 'x': + n = 2 + case 'u': + n = 4 + case 'U': + n = 8 + } + var v rune + if len(s) < n { + err = ErrSyntax + return + } + for j := 0; j < n; j++ { + x, ok := unhex(s[j]) + if !ok { + err = ErrSyntax + return + } + v = v<<4 | x + } + s = s[n:] + if c == 'x' { + // single-byte string, possibly not UTF-8 + value = v + break + } + if v > utf8.MaxRune { + err = ErrSyntax + return + } + value = v + multibyte = true + case '0', '1', '2', '3', '4', '5', '6', '7': + v := rune(c) - '0' + if len(s) < 2 { + err = ErrSyntax + return + } + for j := 0; j < 2; j++ { // one digit already; two more + x := rune(s[j]) - '0' + if x < 0 || x > 7 { + err = ErrSyntax + return + } + v = (v << 3) | x + } + s = s[2:] + if v > 255 { + err = ErrSyntax + return + } + value = v + case '\\': + value = '\\' + case '\'', '"': + if c != quote { + err = ErrSyntax + return + } + value = rune(c) + default: + err = ErrSyntax + return + } + tail = s + return +} diff --git a/vendor/github.com/hashicorp/hcl/hcl/strconv/quote_test.go b/vendor/github.com/hashicorp/hcl/hcl/strconv/quote_test.go new file mode 100644 index 0000000000..65be375d93 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl/strconv/quote_test.go @@ -0,0 +1,96 @@ +package strconv + +import "testing" + +type quoteTest struct { + in string + out string + ascii string +} + +var quotetests = []quoteTest{ + {"\a\b\f\r\n\t\v", `"\a\b\f\r\n\t\v"`, `"\a\b\f\r\n\t\v"`}, + {"\\", `"\\"`, `"\\"`}, + {"abc\xffdef", `"abc\xffdef"`, `"abc\xffdef"`}, + {"\u263a", `"☺"`, `"\u263a"`}, + {"\U0010ffff", `"\U0010ffff"`, `"\U0010ffff"`}, + {"\x04", `"\x04"`, `"\x04"`}, +} + +type unQuoteTest struct { + in string + out string +} + +var unquotetests = []unQuoteTest{ + {`""`, ""}, + {`"a"`, "a"}, + {`"abc"`, "abc"}, + {`"☺"`, "☺"}, + {`"hello world"`, "hello world"}, + {`"\xFF"`, "\xFF"}, + {`"\377"`, "\377"}, + {`"\u1234"`, "\u1234"}, + {`"\U00010111"`, "\U00010111"}, + {`"\U0001011111"`, "\U0001011111"}, + {`"\a\b\f\n\r\t\v\\\""`, "\a\b\f\n\r\t\v\\\""}, + {`"'"`, "'"}, + {`"${file("foo")}"`, `${file("foo")}`}, + {`"${file("\"foo\"")}"`, `${file("\"foo\"")}`}, + {`"echo ${var.region}${element(split(",",var.zones),0)}"`, + `echo ${var.region}${element(split(",",var.zones),0)}`}, + {`"${HH\\:mm\\:ss}"`, `${HH\\:mm\\:ss}`}, + {`"${\n}"`, `${\n}`}, +} + +var misquoted = []string{ + ``, + `"`, + `"a`, + `"'`, + `b"`, + `"\"`, + `"\9"`, + `"\19"`, + `"\129"`, + `'\'`, + `'\9'`, + `'\19'`, + `'\129'`, + `'ab'`, + `"\x1!"`, + `"\U12345678"`, + `"\z"`, + "`", + "`xxx", + "`\"", + `"\'"`, + `'\"'`, + "\"\n\"", + "\"\\n\n\"", + "'\n'", + `"${"`, + `"${foo{}"`, + "\"${foo}\n\"", +} + +func TestUnquote(t *testing.T) { + for _, tt := range unquotetests { + if out, err := Unquote(tt.in); err != nil || out != tt.out { + t.Errorf("Unquote(%#q) = %q, %v want %q, nil", tt.in, out, err, tt.out) + } + } + + // run the quote tests too, backward + for _, tt := range quotetests { + if in, err := Unquote(tt.out); in != tt.in { + t.Errorf("Unquote(%#q) = %q, %v, want %q, nil", tt.out, in, err, tt.in) + } + } + + for _, s := range misquoted { + if out, err := Unquote(s); out != "" || err != ErrSyntax { + t.Errorf("Unquote(%#q) = %q, %v want %q, %v", s, out, err, "", ErrSyntax) + } + } +} diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/array_comment.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/array_comment.hcl new file mode 100644 index 0000000000..78c2675823 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/array_comment.hcl @@ -0,0 +1,4 @@ +foo = [ + "1", + "2", # comment +] diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/assign_colon.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/assign_colon.hcl new file mode 100644 index 0000000000..eb5a99a694 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/assign_colon.hcl @@ -0,0 +1,6 @@ +resource = [{ + "foo": { + "bar": {}, + "baz": [1, 2, "foo"], + } +}] diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/comment.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/comment.hcl new file mode 100644 index 0000000000..1ff7f29fd2 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/comment.hcl @@ -0,0 +1,15 @@ +// Foo + +/* Bar */ + +/* +/* +Baz +*/ + +# Another + +# Multiple +# Lines + +foo = "bar" diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/comment_single.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/comment_single.hcl new file mode 100644 index 0000000000..fec56017dc --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/comment_single.hcl @@ -0,0 +1 @@ +# Hello diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/complex.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/complex.hcl new file mode 100644 index 0000000000..cccb5b06fc --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/complex.hcl @@ -0,0 +1,42 @@ +// This comes from Terraform, as a test +variable "foo" { + default = "bar" + description = "bar" +} + +provider "aws" { + access_key = "foo" + secret_key = "bar" +} + +provider "do" { + api_key = "${var.foo}" +} + +resource "aws_security_group" "firewall" { + count = 5 +} + +resource aws_instance "web" { + ami = "${var.foo}" + security_groups = [ + "foo", + "${aws_security_group.firewall.foo}" + ] + + network_interface { + device_index = 0 + description = "Main network interface" + } +} + +resource "aws_instance" "db" { + security_groups = "${aws_security_group.firewall.*.id}" + VPC = "foo" + + depends_on = ["aws_instance.web"] +} + +output "web_ip" { + value = "${aws_instance.web.private_ip}" +} diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/complex_key.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/complex_key.hcl new file mode 100644 index 0000000000..0007aaf5f7 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/complex_key.hcl @@ -0,0 +1 @@ +foo.bar = "baz" diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/empty.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/empty.hcl new file mode 100644 index 0000000000..e69de29bb2 diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/list.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/list.hcl new file mode 100644 index 0000000000..059d4ce65b --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/list.hcl @@ -0,0 +1 @@ +foo = [1, 2, "foo"] diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/list_comma.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/list_comma.hcl new file mode 100644 index 0000000000..50f4218ac8 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/list_comma.hcl @@ -0,0 +1 @@ +foo = [1, 2, "foo",] diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/multiple.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/multiple.hcl new file mode 100644 index 0000000000..029c54b0ce --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/multiple.hcl @@ -0,0 +1,2 @@ +foo = "bar" +key = 7 diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/old.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/old.hcl new file mode 100644 index 0000000000..e9f77cae90 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/old.hcl @@ -0,0 +1,3 @@ +default = { + "eu-west-1": "ami-b1cf19c6", +} diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/structure.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/structure.hcl new file mode 100644 index 0000000000..92592fbb3c --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/structure.hcl @@ -0,0 +1,5 @@ +// This is a test structure for the lexer +foo bar "baz" { + key = 7 + foo = "bar" +} diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/structure_basic.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/structure_basic.hcl new file mode 100644 index 0000000000..7229a1f012 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/structure_basic.hcl @@ -0,0 +1,5 @@ +foo { + value = 7 + "value" = 8 + "complex::value" = 9 +} diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/structure_empty.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/structure_empty.hcl new file mode 100644 index 0000000000..4d156ddea9 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/structure_empty.hcl @@ -0,0 +1 @@ +resource "foo" "bar" {} diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/types.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/types.hcl new file mode 100644 index 0000000000..cf2747ea1a --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/types.hcl @@ -0,0 +1,7 @@ +foo = "bar" +bar = 7 +baz = [1,2,3] +foo = -12 +bar = 3.14159 +foo = true +bar = false diff --git a/vendor/github.com/hashicorp/hcl/hcl/token/position.go b/vendor/github.com/hashicorp/hcl/hcl/token/position.go new file mode 100644 index 0000000000..59c1bb72d4 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl/token/position.go @@ -0,0 +1,46 @@ +package token + +import "fmt" + +// Pos describes an arbitrary source position +// including the file, line, and column location. +// A Position is valid if the line number is > 0. +type Pos struct { + Filename string // filename, if any + Offset int // offset, starting at 0 + Line int // line number, starting at 1 + Column int // column number, starting at 1 (character count) +} + +// IsValid returns true if the position is valid. +func (p *Pos) IsValid() bool { return p.Line > 0 } + +// String returns a string in one of several forms: +// +// file:line:column valid position with file name +// line:column valid position without file name +// file invalid position with file name +// - invalid position without file name +func (p Pos) String() string { + s := p.Filename + if p.IsValid() { + if s != "" { + s += ":" + } + s += fmt.Sprintf("%d:%d", p.Line, p.Column) + } + if s == "" { + s = "-" + } + return s +} + +// Before reports whether the position p is before u. +func (p Pos) Before(u Pos) bool { + return u.Offset > p.Offset || u.Line > p.Line +} + +// After reports whether the position p is after u. +func (p Pos) After(u Pos) bool { + return u.Offset < p.Offset || u.Line < p.Line +} diff --git a/vendor/github.com/hashicorp/hcl/hcl/token/token.go b/vendor/github.com/hashicorp/hcl/hcl/token/token.go new file mode 100644 index 0000000000..e37c0664ec --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/hcl/token/token.go @@ -0,0 +1,219 @@ +// Package token defines constants representing the lexical tokens for HCL +// (HashiCorp Configuration Language) +package token + +import ( + "fmt" + "strconv" + "strings" + + hclstrconv "github.com/hashicorp/hcl/hcl/strconv" +) + +// Token defines a single HCL token which can be obtained via the Scanner +type Token struct { + Type Type + Pos Pos + Text string + JSON bool +} + +// Type is the set of lexical tokens of the HCL (HashiCorp Configuration Language) +type Type int + +const ( + // Special tokens + ILLEGAL Type = iota + EOF + COMMENT + + identifier_beg + IDENT // literals + literal_beg + NUMBER // 12345 + FLOAT // 123.45 + BOOL // true,false + STRING // "abc" + HEREDOC // < 0 { + // Pop the current item + n := len(frontier) + item := frontier[n-1] + frontier = frontier[:n-1] + + switch v := item.Val.(type) { + case *ast.ObjectType: + items, frontier = flattenObjectType(v, item, items, frontier) + case *ast.ListType: + items, frontier = flattenListType(v, item, items, frontier) + default: + items = append(items, item) + } + } + + // Reverse the list since the frontier model runs things backwards + for i := len(items)/2 - 1; i >= 0; i-- { + opp := len(items) - 1 - i + items[i], items[opp] = items[opp], items[i] + } + + // Done! Set the original items + list.Items = items + return n, true + }) +} + +func flattenListType( + ot *ast.ListType, + item *ast.ObjectItem, + items []*ast.ObjectItem, + frontier []*ast.ObjectItem) ([]*ast.ObjectItem, []*ast.ObjectItem) { + // If the list is empty, keep the original list + if len(ot.List) == 0 { + items = append(items, item) + return items, frontier + } + + // All the elements of this object must also be objects! + for _, subitem := range ot.List { + if _, ok := subitem.(*ast.ObjectType); !ok { + items = append(items, item) + return items, frontier + } + } + + // Great! We have a match go through all the items and flatten + for _, elem := range ot.List { + // Add it to the frontier so that we can recurse + frontier = append(frontier, &ast.ObjectItem{ + Keys: item.Keys, + Assign: item.Assign, + Val: elem, + LeadComment: item.LeadComment, + LineComment: item.LineComment, + }) + } + + return items, frontier +} + +func flattenObjectType( + ot *ast.ObjectType, + item *ast.ObjectItem, + items []*ast.ObjectItem, + frontier []*ast.ObjectItem) ([]*ast.ObjectItem, []*ast.ObjectItem) { + // If the list has no items we do not have to flatten anything + if ot.List.Items == nil { + items = append(items, item) + return items, frontier + } + + // All the elements of this object must also be objects! + for _, subitem := range ot.List.Items { + if _, ok := subitem.Val.(*ast.ObjectType); !ok { + items = append(items, item) + return items, frontier + } + } + + // Great! We have a match go through all the items and flatten + for _, subitem := range ot.List.Items { + // Copy the new key + keys := make([]*ast.ObjectKey, len(item.Keys)+len(subitem.Keys)) + copy(keys, item.Keys) + copy(keys[len(item.Keys):], subitem.Keys) + + // Add it to the frontier so that we can recurse + frontier = append(frontier, &ast.ObjectItem{ + Keys: keys, + Assign: item.Assign, + Val: subitem.Val, + LeadComment: item.LeadComment, + LineComment: item.LineComment, + }) + } + + return items, frontier +} diff --git a/vendor/github.com/hashicorp/hcl/json/parser/parser.go b/vendor/github.com/hashicorp/hcl/json/parser/parser.go new file mode 100644 index 0000000000..125a5f0729 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/json/parser/parser.go @@ -0,0 +1,313 @@ +package parser + +import ( + "errors" + "fmt" + + "github.com/hashicorp/hcl/hcl/ast" + hcltoken "github.com/hashicorp/hcl/hcl/token" + "github.com/hashicorp/hcl/json/scanner" + "github.com/hashicorp/hcl/json/token" +) + +type Parser struct { + sc *scanner.Scanner + + // Last read token + tok token.Token + commaPrev token.Token + + enableTrace bool + indent int + n int // buffer size (max = 1) +} + +func newParser(src []byte) *Parser { + return &Parser{ + sc: scanner.New(src), + } +} + +// Parse returns the fully parsed source and returns the abstract syntax tree. +func Parse(src []byte) (*ast.File, error) { + p := newParser(src) + return p.Parse() +} + +var errEofToken = errors.New("EOF token found") + +// Parse returns the fully parsed source and returns the abstract syntax tree. +func (p *Parser) Parse() (*ast.File, error) { + f := &ast.File{} + var err, scerr error + p.sc.Error = func(pos token.Pos, msg string) { + scerr = fmt.Errorf("%s: %s", pos, msg) + } + + // The root must be an object in JSON + object, err := p.object() + if scerr != nil { + return nil, scerr + } + if err != nil { + return nil, err + } + + // We make our final node an object list so it is more HCL compatible + f.Node = object.List + + // Flatten it, which finds patterns and turns them into more HCL-like + // AST trees. + flattenObjects(f.Node) + + return f, nil +} + +func (p *Parser) objectList() (*ast.ObjectList, error) { + defer un(trace(p, "ParseObjectList")) + node := &ast.ObjectList{} + + for { + n, err := p.objectItem() + if err == errEofToken { + break // we are finished + } + + // we don't return a nil node, because might want to use already + // collected items. + if err != nil { + return node, err + } + + node.Add(n) + + // Check for a followup comma. If it isn't a comma, then we're done + if tok := p.scan(); tok.Type != token.COMMA { + break + } + } + + return node, nil +} + +// objectItem parses a single object item +func (p *Parser) objectItem() (*ast.ObjectItem, error) { + defer un(trace(p, "ParseObjectItem")) + + keys, err := p.objectKey() + if err != nil { + return nil, err + } + + o := &ast.ObjectItem{ + Keys: keys, + } + + switch p.tok.Type { + case token.COLON: + pos := p.tok.Pos + o.Assign = hcltoken.Pos{ + Filename: pos.Filename, + Offset: pos.Offset, + Line: pos.Line, + Column: pos.Column, + } + + o.Val, err = p.objectValue() + if err != nil { + return nil, err + } + } + + return o, nil +} + +// objectKey parses an object key and returns a ObjectKey AST +func (p *Parser) objectKey() ([]*ast.ObjectKey, error) { + keyCount := 0 + keys := make([]*ast.ObjectKey, 0) + + for { + tok := p.scan() + switch tok.Type { + case token.EOF: + return nil, errEofToken + case token.STRING: + keyCount++ + keys = append(keys, &ast.ObjectKey{ + Token: p.tok.HCLToken(), + }) + case token.COLON: + // If we have a zero keycount it means that we never got + // an object key, i.e. `{ :`. This is a syntax error. + if keyCount == 0 { + return nil, fmt.Errorf("expected: STRING got: %s", p.tok.Type) + } + + // Done + return keys, nil + case token.ILLEGAL: + return nil, errors.New("illegal") + default: + return nil, fmt.Errorf("expected: STRING got: %s", p.tok.Type) + } + } +} + +// object parses any type of object, such as number, bool, string, object or +// list. +func (p *Parser) objectValue() (ast.Node, error) { + defer un(trace(p, "ParseObjectValue")) + tok := p.scan() + + switch tok.Type { + case token.NUMBER, token.FLOAT, token.BOOL, token.NULL, token.STRING: + return p.literalType() + case token.LBRACE: + return p.objectType() + case token.LBRACK: + return p.listType() + case token.EOF: + return nil, errEofToken + } + + return nil, fmt.Errorf("Expected object value, got unknown token: %+v", tok) +} + +// object parses any type of object, such as number, bool, string, object or +// list. +func (p *Parser) object() (*ast.ObjectType, error) { + defer un(trace(p, "ParseType")) + tok := p.scan() + + switch tok.Type { + case token.LBRACE: + return p.objectType() + case token.EOF: + return nil, errEofToken + } + + return nil, fmt.Errorf("Expected object, got unknown token: %+v", tok) +} + +// objectType parses an object type and returns a ObjectType AST +func (p *Parser) objectType() (*ast.ObjectType, error) { + defer un(trace(p, "ParseObjectType")) + + // we assume that the currently scanned token is a LBRACE + o := &ast.ObjectType{} + + l, err := p.objectList() + + // if we hit RBRACE, we are good to go (means we parsed all Items), if it's + // not a RBRACE, it's an syntax error and we just return it. + if err != nil && p.tok.Type != token.RBRACE { + return nil, err + } + + o.List = l + return o, nil +} + +// listType parses a list type and returns a ListType AST +func (p *Parser) listType() (*ast.ListType, error) { + defer un(trace(p, "ParseListType")) + + // we assume that the currently scanned token is a LBRACK + l := &ast.ListType{} + + for { + tok := p.scan() + switch tok.Type { + case token.NUMBER, token.FLOAT, token.STRING: + node, err := p.literalType() + if err != nil { + return nil, err + } + + l.Add(node) + case token.COMMA: + continue + case token.LBRACE: + node, err := p.objectType() + if err != nil { + return nil, err + } + + l.Add(node) + case token.BOOL: + // TODO(arslan) should we support? not supported by HCL yet + case token.LBRACK: + // TODO(arslan) should we support nested lists? Even though it's + // written in README of HCL, it's not a part of the grammar + // (not defined in parse.y) + case token.RBRACK: + // finished + return l, nil + default: + return nil, fmt.Errorf("unexpected token while parsing list: %s", tok.Type) + } + + } +} + +// literalType parses a literal type and returns a LiteralType AST +func (p *Parser) literalType() (*ast.LiteralType, error) { + defer un(trace(p, "ParseLiteral")) + + return &ast.LiteralType{ + Token: p.tok.HCLToken(), + }, nil +} + +// scan returns the next token from the underlying scanner. If a token has +// been unscanned then read that instead. +func (p *Parser) scan() token.Token { + // If we have a token on the buffer, then return it. + if p.n != 0 { + p.n = 0 + return p.tok + } + + p.tok = p.sc.Scan() + return p.tok +} + +// unscan pushes the previously read token back onto the buffer. +func (p *Parser) unscan() { + p.n = 1 +} + +// ---------------------------------------------------------------------------- +// Parsing support + +func (p *Parser) printTrace(a ...interface{}) { + if !p.enableTrace { + return + } + + const dots = ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . " + const n = len(dots) + fmt.Printf("%5d:%3d: ", p.tok.Pos.Line, p.tok.Pos.Column) + + i := 2 * p.indent + for i > n { + fmt.Print(dots) + i -= n + } + // i <= n + fmt.Print(dots[0:i]) + fmt.Println(a...) +} + +func trace(p *Parser, msg string) *Parser { + p.printTrace(msg, "(") + p.indent++ + return p +} + +// Usage pattern: defer un(trace(p, "...")) +func un(p *Parser) { + p.indent-- + p.printTrace(")") +} diff --git a/vendor/github.com/hashicorp/hcl/json/parser/parser_test.go b/vendor/github.com/hashicorp/hcl/json/parser/parser_test.go new file mode 100644 index 0000000000..e0cebf50a8 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/json/parser/parser_test.go @@ -0,0 +1,384 @@ +package parser + +import ( + "fmt" + "io/ioutil" + "path/filepath" + "reflect" + "runtime" + "testing" + + "github.com/hashicorp/hcl/hcl/ast" + "github.com/hashicorp/hcl/hcl/token" +) + +func TestType(t *testing.T) { + var literals = []struct { + typ token.Type + src string + }{ + {token.STRING, `"foo": "bar"`}, + {token.NUMBER, `"foo": 123`}, + {token.FLOAT, `"foo": 123.12`}, + {token.FLOAT, `"foo": -123.12`}, + {token.BOOL, `"foo": true`}, + {token.STRING, `"foo": null`}, + } + + for _, l := range literals { + t.Logf("Testing: %s", l.src) + + p := newParser([]byte(l.src)) + item, err := p.objectItem() + if err != nil { + t.Error(err) + } + + lit, ok := item.Val.(*ast.LiteralType) + if !ok { + t.Errorf("node should be of type LiteralType, got: %T", item.Val) + } + + if lit.Token.Type != l.typ { + t.Errorf("want: %s, got: %s", l.typ, lit.Token.Type) + } + } +} + +func TestListType(t *testing.T) { + var literals = []struct { + src string + tokens []token.Type + }{ + { + `"foo": ["123", 123]`, + []token.Type{token.STRING, token.NUMBER}, + }, + { + `"foo": [123, "123",]`, + []token.Type{token.NUMBER, token.STRING}, + }, + { + `"foo": []`, + []token.Type{}, + }, + { + `"foo": ["123", 123]`, + []token.Type{token.STRING, token.NUMBER}, + }, + { + `"foo": ["123", {}]`, + []token.Type{token.STRING, token.LBRACE}, + }, + } + + for _, l := range literals { + t.Logf("Testing: %s", l.src) + + p := newParser([]byte(l.src)) + item, err := p.objectItem() + if err != nil { + t.Error(err) + } + + list, ok := item.Val.(*ast.ListType) + if !ok { + t.Errorf("node should be of type LiteralType, got: %T", item.Val) + } + + tokens := []token.Type{} + for _, li := range list.List { + switch v := li.(type) { + case *ast.LiteralType: + tokens = append(tokens, v.Token.Type) + case *ast.ObjectType: + tokens = append(tokens, token.LBRACE) + } + } + + equals(t, l.tokens, tokens) + } +} + +func TestObjectType(t *testing.T) { + var literals = []struct { + src string + nodeType []ast.Node + itemLen int + }{ + { + `"foo": {}`, + nil, + 0, + }, + { + `"foo": { + "bar": "fatih" + }`, + []ast.Node{&ast.LiteralType{}}, + 1, + }, + { + `"foo": { + "bar": "fatih", + "baz": ["arslan"] + }`, + []ast.Node{ + &ast.LiteralType{}, + &ast.ListType{}, + }, + 2, + }, + { + `"foo": { + "bar": {} + }`, + []ast.Node{ + &ast.ObjectType{}, + }, + 1, + }, + { + `"foo": { + "bar": {}, + "foo": true + }`, + []ast.Node{ + &ast.ObjectType{}, + &ast.LiteralType{}, + }, + 2, + }, + } + + for _, l := range literals { + t.Logf("Testing:\n%s\n", l.src) + + p := newParser([]byte(l.src)) + // p.enableTrace = true + item, err := p.objectItem() + if err != nil { + t.Error(err) + } + + // we know that the ObjectKey name is foo for all cases, what matters + // is the object + obj, ok := item.Val.(*ast.ObjectType) + if !ok { + t.Errorf("node should be of type LiteralType, got: %T", item.Val) + } + + // check if the total length of items are correct + equals(t, l.itemLen, len(obj.List.Items)) + + // check if the types are correct + for i, item := range obj.List.Items { + equals(t, reflect.TypeOf(l.nodeType[i]), reflect.TypeOf(item.Val)) + } + } +} + +func TestFlattenObjects(t *testing.T) { + var literals = []struct { + src string + nodeType []ast.Node + itemLen int + }{ + { + `{ + "foo": [ + { + "foo": "svh", + "bar": "fatih" + } + ] + }`, + []ast.Node{ + &ast.ObjectType{}, + &ast.LiteralType{}, + &ast.LiteralType{}, + }, + 3, + }, + { + `{ + "variable": { + "foo": {} + } + }`, + []ast.Node{ + &ast.ObjectType{}, + }, + 1, + }, + { + `{ + "empty": [] + }`, + []ast.Node{ + &ast.ListType{}, + }, + 1, + }, + { + `{ + "basic": [1, 2, 3] + }`, + []ast.Node{ + &ast.ListType{}, + }, + 1, + }, + } + + for _, l := range literals { + t.Logf("Testing:\n%s\n", l.src) + + f, err := Parse([]byte(l.src)) + if err != nil { + t.Error(err) + } + + // the first object is always an ObjectList so just assert that one + // so we can use it as such + obj, ok := f.Node.(*ast.ObjectList) + if !ok { + t.Errorf("node should be *ast.ObjectList, got: %T", f.Node) + } + + // check if the types are correct + var i int + for _, item := range obj.Items { + equals(t, reflect.TypeOf(l.nodeType[i]), reflect.TypeOf(item.Val)) + i++ + + if obj, ok := item.Val.(*ast.ObjectType); ok { + for _, item := range obj.List.Items { + equals(t, reflect.TypeOf(l.nodeType[i]), reflect.TypeOf(item.Val)) + i++ + } + } + } + + // check if the number of items is correct + equals(t, l.itemLen, i) + + } +} + +func TestObjectKey(t *testing.T) { + keys := []struct { + exp []token.Type + src string + }{ + {[]token.Type{token.STRING}, `"foo": {}`}, + } + + for _, k := range keys { + p := newParser([]byte(k.src)) + keys, err := p.objectKey() + if err != nil { + t.Fatal(err) + } + + tokens := []token.Type{} + for _, o := range keys { + tokens = append(tokens, o.Token.Type) + } + + equals(t, k.exp, tokens) + } + + errKeys := []struct { + src string + }{ + {`foo 12 {}`}, + {`foo bar = {}`}, + {`foo []`}, + {`12 {}`}, + } + + for _, k := range errKeys { + p := newParser([]byte(k.src)) + _, err := p.objectKey() + if err == nil { + t.Errorf("case '%s' should give an error", k.src) + } + } +} + +// Official HCL tests +func TestParse(t *testing.T) { + cases := []struct { + Name string + Err bool + }{ + { + "array.json", + false, + }, + { + "basic.json", + false, + }, + { + "object.json", + false, + }, + { + "types.json", + false, + }, + { + "bad_input_128.json", + true, + }, + { + "bad_input_tf_8110.json", + true, + }, + { + "good_input_tf_8110.json", + false, + }, + } + + const fixtureDir = "./test-fixtures" + + for _, tc := range cases { + d, err := ioutil.ReadFile(filepath.Join(fixtureDir, tc.Name)) + if err != nil { + t.Fatalf("err: %s", err) + } + + _, err = Parse(d) + if (err != nil) != tc.Err { + t.Fatalf("Input: %s\n\nError: %s", tc.Name, err) + } + } +} + +func TestParse_inline(t *testing.T) { + cases := []struct { + Value string + Err bool + }{ + {"{:{", true}, + } + + for _, tc := range cases { + _, err := Parse([]byte(tc.Value)) + if (err != nil) != tc.Err { + t.Fatalf("Input: %q\n\nError: %s", tc.Value, err) + } + } +} + +// equals fails the test if exp is not equal to act. +func equals(tb testing.TB, exp, act interface{}) { + if !reflect.DeepEqual(exp, act) { + _, file, line, _ := runtime.Caller(1) + fmt.Printf("\033[31m%s:%d:\n\n\texp: %s\n\n\tgot: %s\033[39m\n\n", filepath.Base(file), line, exp, act) + tb.FailNow() + } +} diff --git a/vendor/github.com/hashicorp/hcl/json/parser/test-fixtures/array.json b/vendor/github.com/hashicorp/hcl/json/parser/test-fixtures/array.json new file mode 100644 index 0000000000..e320f17ab2 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/json/parser/test-fixtures/array.json @@ -0,0 +1,4 @@ +{ + "foo": [1, 2, "bar"], + "bar": "baz" +} diff --git a/vendor/github.com/hashicorp/hcl/json/parser/test-fixtures/bad_input_128.json b/vendor/github.com/hashicorp/hcl/json/parser/test-fixtures/bad_input_128.json new file mode 100644 index 0000000000..b5f850c963 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/json/parser/test-fixtures/bad_input_128.json @@ -0,0 +1 @@ +{:{ diff --git a/vendor/github.com/hashicorp/hcl/json/parser/test-fixtures/bad_input_tf_8110.json b/vendor/github.com/hashicorp/hcl/json/parser/test-fixtures/bad_input_tf_8110.json new file mode 100644 index 0000000000..a04385833d --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/json/parser/test-fixtures/bad_input_tf_8110.json @@ -0,0 +1,7 @@ +{ + "variable": { + "poc": { + "default": "${replace("europe-west", "-", " ")}" + } + } +} diff --git a/vendor/github.com/hashicorp/hcl/json/parser/test-fixtures/basic.json b/vendor/github.com/hashicorp/hcl/json/parser/test-fixtures/basic.json new file mode 100644 index 0000000000..b54bde96c1 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/json/parser/test-fixtures/basic.json @@ -0,0 +1,3 @@ +{ + "foo": "bar" +} diff --git a/vendor/github.com/hashicorp/hcl/json/parser/test-fixtures/good_input_tf_8110.json b/vendor/github.com/hashicorp/hcl/json/parser/test-fixtures/good_input_tf_8110.json new file mode 100644 index 0000000000..f21aa090d5 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/json/parser/test-fixtures/good_input_tf_8110.json @@ -0,0 +1,7 @@ +{ + "variable": { + "poc": { + "default": "${replace(\"europe-west\", \"-\", \" \")}" + } + } +} diff --git a/vendor/github.com/hashicorp/hcl/json/parser/test-fixtures/object.json b/vendor/github.com/hashicorp/hcl/json/parser/test-fixtures/object.json new file mode 100644 index 0000000000..72168a3ccb --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/json/parser/test-fixtures/object.json @@ -0,0 +1,5 @@ +{ + "foo": { + "bar": [1,2] + } +} diff --git a/vendor/github.com/hashicorp/hcl/json/parser/test-fixtures/types.json b/vendor/github.com/hashicorp/hcl/json/parser/test-fixtures/types.json new file mode 100644 index 0000000000..9a142a6ca6 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/json/parser/test-fixtures/types.json @@ -0,0 +1,10 @@ +{ + "foo": "bar", + "bar": 7, + "baz": [1,2,3], + "foo": -12, + "bar": 3.14159, + "foo": true, + "bar": false, + "foo": null +} diff --git a/vendor/github.com/hashicorp/hcl/json/scanner/scanner.go b/vendor/github.com/hashicorp/hcl/json/scanner/scanner.go new file mode 100644 index 0000000000..fe3f0f0950 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/json/scanner/scanner.go @@ -0,0 +1,451 @@ +package scanner + +import ( + "bytes" + "fmt" + "os" + "unicode" + "unicode/utf8" + + "github.com/hashicorp/hcl/json/token" +) + +// eof represents a marker rune for the end of the reader. +const eof = rune(0) + +// Scanner defines a lexical scanner +type Scanner struct { + buf *bytes.Buffer // Source buffer for advancing and scanning + src []byte // Source buffer for immutable access + + // Source Position + srcPos token.Pos // current position + prevPos token.Pos // previous position, used for peek() method + + lastCharLen int // length of last character in bytes + lastLineLen int // length of last line in characters (for correct column reporting) + + tokStart int // token text start position + tokEnd int // token text end position + + // Error is called for each error encountered. If no Error + // function is set, the error is reported to os.Stderr. + Error func(pos token.Pos, msg string) + + // ErrorCount is incremented by one for each error encountered. + ErrorCount int + + // tokPos is the start position of most recently scanned token; set by + // Scan. The Filename field is always left untouched by the Scanner. If + // an error is reported (via Error) and Position is invalid, the scanner is + // not inside a token. + tokPos token.Pos +} + +// New creates and initializes a new instance of Scanner using src as +// its source content. +func New(src []byte) *Scanner { + // even though we accept a src, we read from a io.Reader compatible type + // (*bytes.Buffer). So in the future we might easily change it to streaming + // read. + b := bytes.NewBuffer(src) + s := &Scanner{ + buf: b, + src: src, + } + + // srcPosition always starts with 1 + s.srcPos.Line = 1 + return s +} + +// next reads the next rune from the bufferred reader. Returns the rune(0) if +// an error occurs (or io.EOF is returned). +func (s *Scanner) next() rune { + ch, size, err := s.buf.ReadRune() + if err != nil { + // advance for error reporting + s.srcPos.Column++ + s.srcPos.Offset += size + s.lastCharLen = size + return eof + } + + if ch == utf8.RuneError && size == 1 { + s.srcPos.Column++ + s.srcPos.Offset += size + s.lastCharLen = size + s.err("illegal UTF-8 encoding") + return ch + } + + // remember last position + s.prevPos = s.srcPos + + s.srcPos.Column++ + s.lastCharLen = size + s.srcPos.Offset += size + + if ch == '\n' { + s.srcPos.Line++ + s.lastLineLen = s.srcPos.Column + s.srcPos.Column = 0 + } + + // debug + // fmt.Printf("ch: %q, offset:column: %d:%d\n", ch, s.srcPos.Offset, s.srcPos.Column) + return ch +} + +// unread unreads the previous read Rune and updates the source position +func (s *Scanner) unread() { + if err := s.buf.UnreadRune(); err != nil { + panic(err) // this is user fault, we should catch it + } + s.srcPos = s.prevPos // put back last position +} + +// peek returns the next rune without advancing the reader. +func (s *Scanner) peek() rune { + peek, _, err := s.buf.ReadRune() + if err != nil { + return eof + } + + s.buf.UnreadRune() + return peek +} + +// Scan scans the next token and returns the token. +func (s *Scanner) Scan() token.Token { + ch := s.next() + + // skip white space + for isWhitespace(ch) { + ch = s.next() + } + + var tok token.Type + + // token text markings + s.tokStart = s.srcPos.Offset - s.lastCharLen + + // token position, initial next() is moving the offset by one(size of rune + // actually), though we are interested with the starting point + s.tokPos.Offset = s.srcPos.Offset - s.lastCharLen + if s.srcPos.Column > 0 { + // common case: last character was not a '\n' + s.tokPos.Line = s.srcPos.Line + s.tokPos.Column = s.srcPos.Column + } else { + // last character was a '\n' + // (we cannot be at the beginning of the source + // since we have called next() at least once) + s.tokPos.Line = s.srcPos.Line - 1 + s.tokPos.Column = s.lastLineLen + } + + switch { + case isLetter(ch): + lit := s.scanIdentifier() + if lit == "true" || lit == "false" { + tok = token.BOOL + } else if lit == "null" { + tok = token.NULL + } else { + s.err("illegal char") + } + case isDecimal(ch): + tok = s.scanNumber(ch) + default: + switch ch { + case eof: + tok = token.EOF + case '"': + tok = token.STRING + s.scanString() + case '.': + tok = token.PERIOD + ch = s.peek() + if isDecimal(ch) { + tok = token.FLOAT + ch = s.scanMantissa(ch) + ch = s.scanExponent(ch) + } + case '[': + tok = token.LBRACK + case ']': + tok = token.RBRACK + case '{': + tok = token.LBRACE + case '}': + tok = token.RBRACE + case ',': + tok = token.COMMA + case ':': + tok = token.COLON + case '-': + if isDecimal(s.peek()) { + ch := s.next() + tok = s.scanNumber(ch) + } else { + s.err("illegal char") + } + default: + s.err("illegal char: " + string(ch)) + } + } + + // finish token ending + s.tokEnd = s.srcPos.Offset + + // create token literal + var tokenText string + if s.tokStart >= 0 { + tokenText = string(s.src[s.tokStart:s.tokEnd]) + } + s.tokStart = s.tokEnd // ensure idempotency of tokenText() call + + return token.Token{ + Type: tok, + Pos: s.tokPos, + Text: tokenText, + } +} + +// scanNumber scans a HCL number definition starting with the given rune +func (s *Scanner) scanNumber(ch rune) token.Type { + zero := ch == '0' + pos := s.srcPos + + s.scanMantissa(ch) + ch = s.next() // seek forward + if ch == 'e' || ch == 'E' { + ch = s.scanExponent(ch) + return token.FLOAT + } + + if ch == '.' { + ch = s.scanFraction(ch) + if ch == 'e' || ch == 'E' { + ch = s.next() + ch = s.scanExponent(ch) + } + return token.FLOAT + } + + if ch != eof { + s.unread() + } + + // If we have a larger number and this is zero, error + if zero && pos != s.srcPos { + s.err("numbers cannot start with 0") + } + + return token.NUMBER +} + +// scanMantissa scans the mantissa beginning from the rune. It returns the next +// non decimal rune. It's used to determine wheter it's a fraction or exponent. +func (s *Scanner) scanMantissa(ch rune) rune { + scanned := false + for isDecimal(ch) { + ch = s.next() + scanned = true + } + + if scanned && ch != eof { + s.unread() + } + return ch +} + +// scanFraction scans the fraction after the '.' rune +func (s *Scanner) scanFraction(ch rune) rune { + if ch == '.' { + ch = s.peek() // we peek just to see if we can move forward + ch = s.scanMantissa(ch) + } + return ch +} + +// scanExponent scans the remaining parts of an exponent after the 'e' or 'E' +// rune. +func (s *Scanner) scanExponent(ch rune) rune { + if ch == 'e' || ch == 'E' { + ch = s.next() + if ch == '-' || ch == '+' { + ch = s.next() + } + ch = s.scanMantissa(ch) + } + return ch +} + +// scanString scans a quoted string +func (s *Scanner) scanString() { + braces := 0 + for { + // '"' opening already consumed + // read character after quote + ch := s.next() + + if ch == '\n' || ch < 0 || ch == eof { + s.err("literal not terminated") + return + } + + if ch == '"' { + break + } + + // If we're going into a ${} then we can ignore quotes for awhile + if braces == 0 && ch == '$' && s.peek() == '{' { + braces++ + s.next() + } else if braces > 0 && ch == '{' { + braces++ + } + if braces > 0 && ch == '}' { + braces-- + } + + if ch == '\\' { + s.scanEscape() + } + } + + return +} + +// scanEscape scans an escape sequence +func (s *Scanner) scanEscape() rune { + // http://en.cppreference.com/w/cpp/language/escape + ch := s.next() // read character after '/' + switch ch { + case 'a', 'b', 'f', 'n', 'r', 't', 'v', '\\', '"': + // nothing to do + case '0', '1', '2', '3', '4', '5', '6', '7': + // octal notation + ch = s.scanDigits(ch, 8, 3) + case 'x': + // hexademical notation + ch = s.scanDigits(s.next(), 16, 2) + case 'u': + // universal character name + ch = s.scanDigits(s.next(), 16, 4) + case 'U': + // universal character name + ch = s.scanDigits(s.next(), 16, 8) + default: + s.err("illegal char escape") + } + return ch +} + +// scanDigits scans a rune with the given base for n times. For example an +// octal notation \184 would yield in scanDigits(ch, 8, 3) +func (s *Scanner) scanDigits(ch rune, base, n int) rune { + for n > 0 && digitVal(ch) < base { + ch = s.next() + n-- + } + if n > 0 { + s.err("illegal char escape") + } + + // we scanned all digits, put the last non digit char back + s.unread() + return ch +} + +// scanIdentifier scans an identifier and returns the literal string +func (s *Scanner) scanIdentifier() string { + offs := s.srcPos.Offset - s.lastCharLen + ch := s.next() + for isLetter(ch) || isDigit(ch) || ch == '-' { + ch = s.next() + } + + if ch != eof { + s.unread() // we got identifier, put back latest char + } + + return string(s.src[offs:s.srcPos.Offset]) +} + +// recentPosition returns the position of the character immediately after the +// character or token returned by the last call to Scan. +func (s *Scanner) recentPosition() (pos token.Pos) { + pos.Offset = s.srcPos.Offset - s.lastCharLen + switch { + case s.srcPos.Column > 0: + // common case: last character was not a '\n' + pos.Line = s.srcPos.Line + pos.Column = s.srcPos.Column + case s.lastLineLen > 0: + // last character was a '\n' + // (we cannot be at the beginning of the source + // since we have called next() at least once) + pos.Line = s.srcPos.Line - 1 + pos.Column = s.lastLineLen + default: + // at the beginning of the source + pos.Line = 1 + pos.Column = 1 + } + return +} + +// err prints the error of any scanning to s.Error function. If the function is +// not defined, by default it prints them to os.Stderr +func (s *Scanner) err(msg string) { + s.ErrorCount++ + pos := s.recentPosition() + + if s.Error != nil { + s.Error(pos, msg) + return + } + + fmt.Fprintf(os.Stderr, "%s: %s\n", pos, msg) +} + +// isHexadecimal returns true if the given rune is a letter +func isLetter(ch rune) bool { + return 'a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' || ch == '_' || ch >= 0x80 && unicode.IsLetter(ch) +} + +// isHexadecimal returns true if the given rune is a decimal digit +func isDigit(ch rune) bool { + return '0' <= ch && ch <= '9' || ch >= 0x80 && unicode.IsDigit(ch) +} + +// isHexadecimal returns true if the given rune is a decimal number +func isDecimal(ch rune) bool { + return '0' <= ch && ch <= '9' +} + +// isHexadecimal returns true if the given rune is an hexadecimal number +func isHexadecimal(ch rune) bool { + return '0' <= ch && ch <= '9' || 'a' <= ch && ch <= 'f' || 'A' <= ch && ch <= 'F' +} + +// isWhitespace returns true if the rune is a space, tab, newline or carriage return +func isWhitespace(ch rune) bool { + return ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r' +} + +// digitVal returns the integer value of a given octal,decimal or hexadecimal rune +func digitVal(ch rune) int { + switch { + case '0' <= ch && ch <= '9': + return int(ch - '0') + case 'a' <= ch && ch <= 'f': + return int(ch - 'a' + 10) + case 'A' <= ch && ch <= 'F': + return int(ch - 'A' + 10) + } + return 16 // larger than any legal digit val +} diff --git a/vendor/github.com/hashicorp/hcl/json/scanner/scanner_test.go b/vendor/github.com/hashicorp/hcl/json/scanner/scanner_test.go new file mode 100644 index 0000000000..3033a57976 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/json/scanner/scanner_test.go @@ -0,0 +1,362 @@ +package scanner + +import ( + "bytes" + "fmt" + "testing" + + "github.com/hashicorp/hcl/json/token" +) + +var f100 = "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + +type tokenPair struct { + tok token.Type + text string +} + +var tokenLists = map[string][]tokenPair{ + "operator": []tokenPair{ + {token.LBRACK, "["}, + {token.LBRACE, "{"}, + {token.COMMA, ","}, + {token.PERIOD, "."}, + {token.RBRACK, "]"}, + {token.RBRACE, "}"}, + }, + "bool": []tokenPair{ + {token.BOOL, "true"}, + {token.BOOL, "false"}, + }, + "string": []tokenPair{ + {token.STRING, `" "`}, + {token.STRING, `"a"`}, + {token.STRING, `"本"`}, + {token.STRING, `"${file(\"foo\")}"`}, + {token.STRING, `"\a"`}, + {token.STRING, `"\b"`}, + {token.STRING, `"\f"`}, + {token.STRING, `"\n"`}, + {token.STRING, `"\r"`}, + {token.STRING, `"\t"`}, + {token.STRING, `"\v"`}, + {token.STRING, `"\""`}, + {token.STRING, `"\000"`}, + {token.STRING, `"\777"`}, + {token.STRING, `"\x00"`}, + {token.STRING, `"\xff"`}, + {token.STRING, `"\u0000"`}, + {token.STRING, `"\ufA16"`}, + {token.STRING, `"\U00000000"`}, + {token.STRING, `"\U0000ffAB"`}, + {token.STRING, `"` + f100 + `"`}, + }, + "number": []tokenPair{ + {token.NUMBER, "0"}, + {token.NUMBER, "1"}, + {token.NUMBER, "9"}, + {token.NUMBER, "42"}, + {token.NUMBER, "1234567890"}, + {token.NUMBER, "-0"}, + {token.NUMBER, "-1"}, + {token.NUMBER, "-9"}, + {token.NUMBER, "-42"}, + {token.NUMBER, "-1234567890"}, + }, + "float": []tokenPair{ + {token.FLOAT, "0."}, + {token.FLOAT, "1."}, + {token.FLOAT, "42."}, + {token.FLOAT, "01234567890."}, + {token.FLOAT, ".0"}, + {token.FLOAT, ".1"}, + {token.FLOAT, ".42"}, + {token.FLOAT, ".0123456789"}, + {token.FLOAT, "0.0"}, + {token.FLOAT, "1.0"}, + {token.FLOAT, "42.0"}, + {token.FLOAT, "01234567890.0"}, + {token.FLOAT, "0e0"}, + {token.FLOAT, "1e0"}, + {token.FLOAT, "42e0"}, + {token.FLOAT, "01234567890e0"}, + {token.FLOAT, "0E0"}, + {token.FLOAT, "1E0"}, + {token.FLOAT, "42E0"}, + {token.FLOAT, "01234567890E0"}, + {token.FLOAT, "0e+10"}, + {token.FLOAT, "1e-10"}, + {token.FLOAT, "42e+10"}, + {token.FLOAT, "01234567890e-10"}, + {token.FLOAT, "0E+10"}, + {token.FLOAT, "1E-10"}, + {token.FLOAT, "42E+10"}, + {token.FLOAT, "01234567890E-10"}, + {token.FLOAT, "01.8e0"}, + {token.FLOAT, "1.4e0"}, + {token.FLOAT, "42.2e0"}, + {token.FLOAT, "01234567890.12e0"}, + {token.FLOAT, "0.E0"}, + {token.FLOAT, "1.12E0"}, + {token.FLOAT, "42.123E0"}, + {token.FLOAT, "01234567890.213E0"}, + {token.FLOAT, "0.2e+10"}, + {token.FLOAT, "1.2e-10"}, + {token.FLOAT, "42.54e+10"}, + {token.FLOAT, "01234567890.98e-10"}, + {token.FLOAT, "0.1E+10"}, + {token.FLOAT, "1.1E-10"}, + {token.FLOAT, "42.1E+10"}, + {token.FLOAT, "01234567890.1E-10"}, + {token.FLOAT, "-0.0"}, + {token.FLOAT, "-1.0"}, + {token.FLOAT, "-42.0"}, + {token.FLOAT, "-01234567890.0"}, + {token.FLOAT, "-0e0"}, + {token.FLOAT, "-1e0"}, + {token.FLOAT, "-42e0"}, + {token.FLOAT, "-01234567890e0"}, + {token.FLOAT, "-0E0"}, + {token.FLOAT, "-1E0"}, + {token.FLOAT, "-42E0"}, + {token.FLOAT, "-01234567890E0"}, + {token.FLOAT, "-0e+10"}, + {token.FLOAT, "-1e-10"}, + {token.FLOAT, "-42e+10"}, + {token.FLOAT, "-01234567890e-10"}, + {token.FLOAT, "-0E+10"}, + {token.FLOAT, "-1E-10"}, + {token.FLOAT, "-42E+10"}, + {token.FLOAT, "-01234567890E-10"}, + {token.FLOAT, "-01.8e0"}, + {token.FLOAT, "-1.4e0"}, + {token.FLOAT, "-42.2e0"}, + {token.FLOAT, "-01234567890.12e0"}, + {token.FLOAT, "-0.E0"}, + {token.FLOAT, "-1.12E0"}, + {token.FLOAT, "-42.123E0"}, + {token.FLOAT, "-01234567890.213E0"}, + {token.FLOAT, "-0.2e+10"}, + {token.FLOAT, "-1.2e-10"}, + {token.FLOAT, "-42.54e+10"}, + {token.FLOAT, "-01234567890.98e-10"}, + {token.FLOAT, "-0.1E+10"}, + {token.FLOAT, "-1.1E-10"}, + {token.FLOAT, "-42.1E+10"}, + {token.FLOAT, "-01234567890.1E-10"}, + }, +} + +var orderedTokenLists = []string{ + "comment", + "operator", + "bool", + "string", + "number", + "float", +} + +func TestPosition(t *testing.T) { + // create artifical source code + buf := new(bytes.Buffer) + + for _, listName := range orderedTokenLists { + for _, ident := range tokenLists[listName] { + fmt.Fprintf(buf, "\t\t\t\t%s\n", ident.text) + } + } + + s := New(buf.Bytes()) + + pos := token.Pos{"", 4, 1, 5} + s.Scan() + for _, listName := range orderedTokenLists { + + for _, k := range tokenLists[listName] { + curPos := s.tokPos + // fmt.Printf("[%q] s = %+v:%+v\n", k.text, curPos.Offset, curPos.Column) + + if curPos.Offset != pos.Offset { + t.Fatalf("offset = %d, want %d for %q", curPos.Offset, pos.Offset, k.text) + } + if curPos.Line != pos.Line { + t.Fatalf("line = %d, want %d for %q", curPos.Line, pos.Line, k.text) + } + if curPos.Column != pos.Column { + t.Fatalf("column = %d, want %d for %q", curPos.Column, pos.Column, k.text) + } + pos.Offset += 4 + len(k.text) + 1 // 4 tabs + token bytes + newline + pos.Line += countNewlines(k.text) + 1 // each token is on a new line + + s.Error = func(pos token.Pos, msg string) { + t.Errorf("error %q for %q", msg, k.text) + } + + s.Scan() + } + } + // make sure there were no token-internal errors reported by scanner + if s.ErrorCount != 0 { + t.Errorf("%d errors", s.ErrorCount) + } +} + +func TestComment(t *testing.T) { + testTokenList(t, tokenLists["comment"]) +} + +func TestOperator(t *testing.T) { + testTokenList(t, tokenLists["operator"]) +} + +func TestBool(t *testing.T) { + testTokenList(t, tokenLists["bool"]) +} + +func TestIdent(t *testing.T) { + testTokenList(t, tokenLists["ident"]) +} + +func TestString(t *testing.T) { + testTokenList(t, tokenLists["string"]) +} + +func TestNumber(t *testing.T) { + testTokenList(t, tokenLists["number"]) +} + +func TestFloat(t *testing.T) { + testTokenList(t, tokenLists["float"]) +} + +func TestRealExample(t *testing.T) { + complexReal := ` +{ + "variable": { + "foo": { + "default": "bar", + "description": "bar", + "depends_on": ["something"] + } + } +}` + + literals := []struct { + tokenType token.Type + literal string + }{ + {token.LBRACE, `{`}, + {token.STRING, `"variable"`}, + {token.COLON, `:`}, + {token.LBRACE, `{`}, + {token.STRING, `"foo"`}, + {token.COLON, `:`}, + {token.LBRACE, `{`}, + {token.STRING, `"default"`}, + {token.COLON, `:`}, + {token.STRING, `"bar"`}, + {token.COMMA, `,`}, + {token.STRING, `"description"`}, + {token.COLON, `:`}, + {token.STRING, `"bar"`}, + {token.COMMA, `,`}, + {token.STRING, `"depends_on"`}, + {token.COLON, `:`}, + {token.LBRACK, `[`}, + {token.STRING, `"something"`}, + {token.RBRACK, `]`}, + {token.RBRACE, `}`}, + {token.RBRACE, `}`}, + {token.RBRACE, `}`}, + {token.EOF, ``}, + } + + s := New([]byte(complexReal)) + for _, l := range literals { + tok := s.Scan() + if l.tokenType != tok.Type { + t.Errorf("got: %s want %s for %s\n", tok, l.tokenType, tok.String()) + } + + if l.literal != tok.Text { + t.Errorf("got: %s want %s\n", tok, l.literal) + } + } + +} + +func TestError(t *testing.T) { + testError(t, "\x80", "1:1", "illegal UTF-8 encoding", token.ILLEGAL) + testError(t, "\xff", "1:1", "illegal UTF-8 encoding", token.ILLEGAL) + + testError(t, `"ab`+"\x80", "1:4", "illegal UTF-8 encoding", token.STRING) + testError(t, `"abc`+"\xff", "1:5", "illegal UTF-8 encoding", token.STRING) + + testError(t, `01238`, "1:7", "numbers cannot start with 0", token.NUMBER) + testError(t, `01238123`, "1:10", "numbers cannot start with 0", token.NUMBER) + testError(t, `'aa'`, "1:1", "illegal char: '", token.ILLEGAL) + + testError(t, `"`, "1:2", "literal not terminated", token.STRING) + testError(t, `"abc`, "1:5", "literal not terminated", token.STRING) + testError(t, `"abc`+"\n", "1:5", "literal not terminated", token.STRING) +} + +func testError(t *testing.T, src, pos, msg string, tok token.Type) { + s := New([]byte(src)) + + errorCalled := false + s.Error = func(p token.Pos, m string) { + if !errorCalled { + if pos != p.String() { + t.Errorf("pos = %q, want %q for %q", p, pos, src) + } + + if m != msg { + t.Errorf("msg = %q, want %q for %q", m, msg, src) + } + errorCalled = true + } + } + + tk := s.Scan() + if tk.Type != tok { + t.Errorf("tok = %s, want %s for %q", tk, tok, src) + } + if !errorCalled { + t.Errorf("error handler not called for %q", src) + } + if s.ErrorCount == 0 { + t.Errorf("count = %d, want > 0 for %q", s.ErrorCount, src) + } +} + +func testTokenList(t *testing.T, tokenList []tokenPair) { + // create artifical source code + buf := new(bytes.Buffer) + for _, ident := range tokenList { + fmt.Fprintf(buf, "%s\n", ident.text) + } + + s := New(buf.Bytes()) + for _, ident := range tokenList { + tok := s.Scan() + if tok.Type != ident.tok { + t.Errorf("tok = %q want %q for %q\n", tok, ident.tok, ident.text) + } + + if tok.Text != ident.text { + t.Errorf("text = %q want %q", tok.String(), ident.text) + } + + } +} + +func countNewlines(s string) int { + n := 0 + for _, ch := range s { + if ch == '\n' { + n++ + } + } + return n +} diff --git a/vendor/github.com/hashicorp/hcl/json/test-fixtures/array.json b/vendor/github.com/hashicorp/hcl/json/test-fixtures/array.json new file mode 100644 index 0000000000..e320f17ab2 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/json/test-fixtures/array.json @@ -0,0 +1,4 @@ +{ + "foo": [1, 2, "bar"], + "bar": "baz" +} diff --git a/vendor/github.com/hashicorp/hcl/json/test-fixtures/basic.json b/vendor/github.com/hashicorp/hcl/json/test-fixtures/basic.json new file mode 100644 index 0000000000..b54bde96c1 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/json/test-fixtures/basic.json @@ -0,0 +1,3 @@ +{ + "foo": "bar" +} diff --git a/vendor/github.com/hashicorp/hcl/json/test-fixtures/object.json b/vendor/github.com/hashicorp/hcl/json/test-fixtures/object.json new file mode 100644 index 0000000000..72168a3ccb --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/json/test-fixtures/object.json @@ -0,0 +1,5 @@ +{ + "foo": { + "bar": [1,2] + } +} diff --git a/vendor/github.com/hashicorp/hcl/json/test-fixtures/types.json b/vendor/github.com/hashicorp/hcl/json/test-fixtures/types.json new file mode 100644 index 0000000000..9a142a6ca6 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/json/test-fixtures/types.json @@ -0,0 +1,10 @@ +{ + "foo": "bar", + "bar": 7, + "baz": [1,2,3], + "foo": -12, + "bar": 3.14159, + "foo": true, + "bar": false, + "foo": null +} diff --git a/vendor/github.com/hashicorp/hcl/json/token/position.go b/vendor/github.com/hashicorp/hcl/json/token/position.go new file mode 100644 index 0000000000..59c1bb72d4 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/json/token/position.go @@ -0,0 +1,46 @@ +package token + +import "fmt" + +// Pos describes an arbitrary source position +// including the file, line, and column location. +// A Position is valid if the line number is > 0. +type Pos struct { + Filename string // filename, if any + Offset int // offset, starting at 0 + Line int // line number, starting at 1 + Column int // column number, starting at 1 (character count) +} + +// IsValid returns true if the position is valid. +func (p *Pos) IsValid() bool { return p.Line > 0 } + +// String returns a string in one of several forms: +// +// file:line:column valid position with file name +// line:column valid position without file name +// file invalid position with file name +// - invalid position without file name +func (p Pos) String() string { + s := p.Filename + if p.IsValid() { + if s != "" { + s += ":" + } + s += fmt.Sprintf("%d:%d", p.Line, p.Column) + } + if s == "" { + s = "-" + } + return s +} + +// Before reports whether the position p is before u. +func (p Pos) Before(u Pos) bool { + return u.Offset > p.Offset || u.Line > p.Line +} + +// After reports whether the position p is after u. +func (p Pos) After(u Pos) bool { + return u.Offset < p.Offset || u.Line < p.Line +} diff --git a/vendor/github.com/hashicorp/hcl/json/token/token.go b/vendor/github.com/hashicorp/hcl/json/token/token.go new file mode 100644 index 0000000000..95a0c3eee6 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/json/token/token.go @@ -0,0 +1,118 @@ +package token + +import ( + "fmt" + "strconv" + + hcltoken "github.com/hashicorp/hcl/hcl/token" +) + +// Token defines a single HCL token which can be obtained via the Scanner +type Token struct { + Type Type + Pos Pos + Text string +} + +// Type is the set of lexical tokens of the HCL (HashiCorp Configuration Language) +type Type int + +const ( + // Special tokens + ILLEGAL Type = iota + EOF + + identifier_beg + literal_beg + NUMBER // 12345 + FLOAT // 123.45 + BOOL // true,false + STRING // "abc" + NULL // null + literal_end + identifier_end + + operator_beg + LBRACK // [ + LBRACE // { + COMMA // , + PERIOD // . + COLON // : + + RBRACK // ] + RBRACE // } + + operator_end +) + +var tokens = [...]string{ + ILLEGAL: "ILLEGAL", + + EOF: "EOF", + + NUMBER: "NUMBER", + FLOAT: "FLOAT", + BOOL: "BOOL", + STRING: "STRING", + NULL: "NULL", + + LBRACK: "LBRACK", + LBRACE: "LBRACE", + COMMA: "COMMA", + PERIOD: "PERIOD", + COLON: "COLON", + + RBRACK: "RBRACK", + RBRACE: "RBRACE", +} + +// String returns the string corresponding to the token tok. +func (t Type) String() string { + s := "" + if 0 <= t && t < Type(len(tokens)) { + s = tokens[t] + } + if s == "" { + s = "token(" + strconv.Itoa(int(t)) + ")" + } + return s +} + +// IsIdentifier returns true for tokens corresponding to identifiers and basic +// type literals; it returns false otherwise. +func (t Type) IsIdentifier() bool { return identifier_beg < t && t < identifier_end } + +// IsLiteral returns true for tokens corresponding to basic type literals; it +// returns false otherwise. +func (t Type) IsLiteral() bool { return literal_beg < t && t < literal_end } + +// IsOperator returns true for tokens corresponding to operators and +// delimiters; it returns false otherwise. +func (t Type) IsOperator() bool { return operator_beg < t && t < operator_end } + +// String returns the token's literal text. Note that this is only +// applicable for certain token types, such as token.IDENT, +// token.STRING, etc.. +func (t Token) String() string { + return fmt.Sprintf("%s %s %s", t.Pos.String(), t.Type.String(), t.Text) +} + +// HCLToken converts this token to an HCL token. +// +// The token type must be a literal type or this will panic. +func (t Token) HCLToken() hcltoken.Token { + switch t.Type { + case BOOL: + return hcltoken.Token{Type: hcltoken.BOOL, Text: t.Text} + case FLOAT: + return hcltoken.Token{Type: hcltoken.FLOAT, Text: t.Text} + case NULL: + return hcltoken.Token{Type: hcltoken.STRING, Text: ""} + case NUMBER: + return hcltoken.Token{Type: hcltoken.NUMBER, Text: t.Text} + case STRING: + return hcltoken.Token{Type: hcltoken.STRING, Text: t.Text, JSON: true} + default: + panic(fmt.Sprintf("unimplemented HCLToken for type: %s", t.Type)) + } +} diff --git a/vendor/github.com/hashicorp/hcl/json/token/token_test.go b/vendor/github.com/hashicorp/hcl/json/token/token_test.go new file mode 100644 index 0000000000..a83fdd55bb --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/json/token/token_test.go @@ -0,0 +1,34 @@ +package token + +import ( + "testing" +) + +func TestTypeString(t *testing.T) { + var tokens = []struct { + tt Type + str string + }{ + {ILLEGAL, "ILLEGAL"}, + {EOF, "EOF"}, + {NUMBER, "NUMBER"}, + {FLOAT, "FLOAT"}, + {BOOL, "BOOL"}, + {STRING, "STRING"}, + {NULL, "NULL"}, + {LBRACK, "LBRACK"}, + {LBRACE, "LBRACE"}, + {COMMA, "COMMA"}, + {PERIOD, "PERIOD"}, + {RBRACK, "RBRACK"}, + {RBRACE, "RBRACE"}, + } + + for _, token := range tokens { + if token.tt.String() != token.str { + t.Errorf("want: %q got:%q\n", token.str, token.tt) + + } + } + +} diff --git a/vendor/github.com/hashicorp/hcl/lex.go b/vendor/github.com/hashicorp/hcl/lex.go new file mode 100644 index 0000000000..d9993c2928 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/lex.go @@ -0,0 +1,38 @@ +package hcl + +import ( + "unicode" + "unicode/utf8" +) + +type lexModeValue byte + +const ( + lexModeUnknown lexModeValue = iota + lexModeHcl + lexModeJson +) + +// lexMode returns whether we're going to be parsing in JSON +// mode or HCL mode. +func lexMode(v []byte) lexModeValue { + var ( + r rune + w int + offset int + ) + + for { + r, w = utf8.DecodeRune(v[offset:]) + offset += w + if unicode.IsSpace(r) { + continue + } + if r == '{' { + return lexModeJson + } + break + } + + return lexModeHcl +} diff --git a/vendor/github.com/hashicorp/hcl/lex_test.go b/vendor/github.com/hashicorp/hcl/lex_test.go new file mode 100644 index 0000000000..8062764446 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/lex_test.go @@ -0,0 +1,37 @@ +package hcl + +import ( + "testing" +) + +func TestLexMode(t *testing.T) { + cases := []struct { + Input string + Mode lexModeValue + }{ + { + "", + lexModeHcl, + }, + { + "foo", + lexModeHcl, + }, + { + "{}", + lexModeJson, + }, + { + " {}", + lexModeJson, + }, + } + + for i, tc := range cases { + actual := lexMode([]byte(tc.Input)) + + if actual != tc.Mode { + t.Fatalf("%d: %#v", i, actual) + } + } +} diff --git a/vendor/github.com/hashicorp/hcl/parse.go b/vendor/github.com/hashicorp/hcl/parse.go new file mode 100644 index 0000000000..1fca53c4ce --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/parse.go @@ -0,0 +1,39 @@ +package hcl + +import ( + "fmt" + + "github.com/hashicorp/hcl/hcl/ast" + hclParser "github.com/hashicorp/hcl/hcl/parser" + jsonParser "github.com/hashicorp/hcl/json/parser" +) + +// ParseBytes accepts as input byte slice and returns ast tree. +// +// Input can be either JSON or HCL +func ParseBytes(in []byte) (*ast.File, error) { + return parse(in) +} + +// ParseString accepts input as a string and returns ast tree. +func ParseString(input string) (*ast.File, error) { + return parse([]byte(input)) +} + +func parse(in []byte) (*ast.File, error) { + switch lexMode(in) { + case lexModeHcl: + return hclParser.Parse(in) + case lexModeJson: + return jsonParser.Parse(in) + } + + return nil, fmt.Errorf("unknown config format") +} + +// Parse parses the given input and returns the root object. +// +// The input format can be either HCL or JSON. +func Parse(input string) (*ast.File, error) { + return parse([]byte(input)) +} diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/assign_deep.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/assign_deep.hcl new file mode 100644 index 0000000000..dd3151cb7d --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/test-fixtures/assign_deep.hcl @@ -0,0 +1,5 @@ +resource = [{ + foo = [{ + bar = {} + }] +}] diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/basic.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/basic.hcl new file mode 100644 index 0000000000..9499944872 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/test-fixtures/basic.hcl @@ -0,0 +1,2 @@ +foo = "bar" +bar = "${file("bing/bong.txt")}" diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/basic.json b/vendor/github.com/hashicorp/hcl/test-fixtures/basic.json new file mode 100644 index 0000000000..7bdddc84b0 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/test-fixtures/basic.json @@ -0,0 +1,4 @@ +{ + "foo": "bar", + "bar": "${file(\"bing/bong.txt\")}" +} diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/basic_int_string.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/basic_int_string.hcl new file mode 100644 index 0000000000..4e415da20e --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/test-fixtures/basic_int_string.hcl @@ -0,0 +1 @@ +count = "3" diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/basic_squish.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/basic_squish.hcl new file mode 100644 index 0000000000..363697b496 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/test-fixtures/basic_squish.hcl @@ -0,0 +1,3 @@ +foo="bar" +bar="${file("bing/bong.txt")}" +foo-bar="baz" diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/block_assign.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/block_assign.hcl new file mode 100644 index 0000000000..ee8b06fe3c --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/test-fixtures/block_assign.hcl @@ -0,0 +1,2 @@ +environment = "aws" { +} diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/decode_policy.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/decode_policy.hcl new file mode 100644 index 0000000000..5b185cc918 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/test-fixtures/decode_policy.hcl @@ -0,0 +1,15 @@ +key "" { + policy = "read" +} + +key "foo/" { + policy = "write" +} + +key "foo/bar/" { + policy = "read" +} + +key "foo/bar/baz" { + policy = "deny" +} diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/decode_policy.json b/vendor/github.com/hashicorp/hcl/test-fixtures/decode_policy.json new file mode 100644 index 0000000000..151864ee89 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/test-fixtures/decode_policy.json @@ -0,0 +1,19 @@ +{ + "key": { + "": { + "policy": "read" + }, + + "foo/": { + "policy": "write" + }, + + "foo/bar/": { + "policy": "read" + }, + + "foo/bar/baz": { + "policy": "deny" + } + } +} diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.hcl new file mode 100644 index 0000000000..52dcaa1bc3 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.hcl @@ -0,0 +1,10 @@ +variable "foo" { + default = "bar" + description = "bar" +} + +variable "amis" { + default = { + east = "foo" + } +} diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.json b/vendor/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.json new file mode 100644 index 0000000000..49f921ed0b --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.json @@ -0,0 +1,14 @@ +{ + "variable": { + "foo": { + "default": "bar", + "description": "bar" + }, + + "amis": { + "default": { + "east": "foo" + } + } + } +} diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/empty.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/empty.hcl new file mode 100644 index 0000000000..5be1b23154 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/test-fixtures/empty.hcl @@ -0,0 +1 @@ +resource "foo" {} diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/escape.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/escape.hcl new file mode 100644 index 0000000000..f818b15e02 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/test-fixtures/escape.hcl @@ -0,0 +1,6 @@ +foo = "bar\"baz\\n" +bar = "new\nline" +qux = "back\\slash" +qax = "slash\\:colon" +nested = "${HH\\:mm\\:ss}" +nestedquotes = "${"\"stringwrappedinquotes\""}" diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/escape_backslash.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/escape_backslash.hcl new file mode 100644 index 0000000000..bc337fb7cc --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/test-fixtures/escape_backslash.hcl @@ -0,0 +1,5 @@ +output { + one = "${replace(var.sub_domain, ".", "\\.")}" + two = "${replace(var.sub_domain, ".", "\\\\.")}" + many = "${replace(var.sub_domain, ".", "\\\\\\\\.")}" +} diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/flat.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/flat.hcl new file mode 100644 index 0000000000..9bca551f89 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/test-fixtures/flat.hcl @@ -0,0 +1,2 @@ +foo = "bar" +Key = 7 diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/float.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/float.hcl new file mode 100644 index 0000000000..edf355e38a --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/test-fixtures/float.hcl @@ -0,0 +1,2 @@ +a = 1.02 +b = 2 diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/float.json b/vendor/github.com/hashicorp/hcl/test-fixtures/float.json new file mode 100644 index 0000000000..580868043c --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/test-fixtures/float.json @@ -0,0 +1,4 @@ +{ + "a": 1.02, + "b": 2 +} diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/git_crypt.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/git_crypt.hcl new file mode 100644 index 0000000000..f691948e1b Binary files /dev/null and b/vendor/github.com/hashicorp/hcl/test-fixtures/git_crypt.hcl differ diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/interpolate.json b/vendor/github.com/hashicorp/hcl/test-fixtures/interpolate.json new file mode 100644 index 0000000000..cad0151985 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/test-fixtures/interpolate.json @@ -0,0 +1,3 @@ +{ + "default": "${replace(\"europe-west\", \"-\", \" \")}" +} diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/list_of_lists.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/list_of_lists.hcl new file mode 100644 index 0000000000..8af3458499 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/test-fixtures/list_of_lists.hcl @@ -0,0 +1,2 @@ +foo = [["foo"], ["bar"]] + diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/list_of_maps.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/list_of_maps.hcl new file mode 100644 index 0000000000..985a33baee --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/test-fixtures/list_of_maps.hcl @@ -0,0 +1,4 @@ +foo = [ + {somekey1 = "someval1"}, + {somekey2 = "someval2", someextrakey = "someextraval"}, +] diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/multiline.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/multiline.hcl new file mode 100644 index 0000000000..f883bd707b --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/test-fixtures/multiline.hcl @@ -0,0 +1,4 @@ +foo = < 10: + return fmt.Sprintf("%.10q...", i.val) + } + return fmt.Sprintf("%q", i.val) +} + +// itemType identifies the type of lex items. +type itemType int + +const ( + itemError itemType = iota // error occurred; value is text of error + itemEOF + itemKey // a key + itemValue // a value + itemComment // a comment +) + +// defines a constant for EOF +const eof = -1 + +// permitted whitespace characters space, FF and TAB +const whitespace = " \f\t" + +// stateFn represents the state of the scanner as a function that returns the next state. +type stateFn func(*lexer) stateFn + +// lexer holds the state of the scanner. +type lexer struct { + input string // the string being scanned + state stateFn // the next lexing function to enter + pos int // current position in the input + start int // start position of this item + width int // width of last rune read from input + lastPos int // position of most recent item returned by nextItem + runes []rune // scanned runes for this item + items chan item // channel of scanned items +} + +// next returns the next rune in the input. +func (l *lexer) next() rune { + if l.pos >= len(l.input) { + l.width = 0 + return eof + } + r, w := utf8.DecodeRuneInString(l.input[l.pos:]) + l.width = w + l.pos += l.width + return r +} + +// peek returns but does not consume the next rune in the input. +func (l *lexer) peek() rune { + r := l.next() + l.backup() + return r +} + +// backup steps back one rune. Can only be called once per call of next. +func (l *lexer) backup() { + l.pos -= l.width +} + +// emit passes an item back to the client. +func (l *lexer) emit(t itemType) { + i := item{t, l.start, string(l.runes)} + l.items <- i + l.start = l.pos + l.runes = l.runes[:0] +} + +// ignore skips over the pending input before this point. +func (l *lexer) ignore() { + l.start = l.pos +} + +// appends the rune to the current value +func (l *lexer) appendRune(r rune) { + l.runes = append(l.runes, r) +} + +// accept consumes the next rune if it's from the valid set. +func (l *lexer) accept(valid string) bool { + if strings.ContainsRune(valid, l.next()) { + return true + } + l.backup() + return false +} + +// acceptRun consumes a run of runes from the valid set. +func (l *lexer) acceptRun(valid string) { + for strings.ContainsRune(valid, l.next()) { + } + l.backup() +} + +// acceptRunUntil consumes a run of runes up to a terminator. +func (l *lexer) acceptRunUntil(term rune) { + for term != l.next() { + } + l.backup() +} + +// hasText returns true if the current parsed text is not empty. +func (l *lexer) isNotEmpty() bool { + return l.pos > l.start +} + +// lineNumber reports which line we're on, based on the position of +// the previous item returned by nextItem. Doing it this way +// means we don't have to worry about peek double counting. +func (l *lexer) lineNumber() int { + return 1 + strings.Count(l.input[:l.lastPos], "\n") +} + +// errorf returns an error token and terminates the scan by passing +// back a nil pointer that will be the next state, terminating l.nextItem. +func (l *lexer) errorf(format string, args ...interface{}) stateFn { + l.items <- item{itemError, l.start, fmt.Sprintf(format, args...)} + return nil +} + +// nextItem returns the next item from the input. +func (l *lexer) nextItem() item { + i := <-l.items + l.lastPos = i.pos + return i +} + +// lex creates a new scanner for the input string. +func lex(input string) *lexer { + l := &lexer{ + input: input, + items: make(chan item), + runes: make([]rune, 0, 32), + } + go l.run() + return l +} + +// run runs the state machine for the lexer. +func (l *lexer) run() { + for l.state = lexBeforeKey(l); l.state != nil; { + l.state = l.state(l) + } +} + +// state functions + +// lexBeforeKey scans until a key begins. +func lexBeforeKey(l *lexer) stateFn { + switch r := l.next(); { + case isEOF(r): + l.emit(itemEOF) + return nil + + case isEOL(r): + l.ignore() + return lexBeforeKey + + case isComment(r): + return lexComment + + case isWhitespace(r): + l.acceptRun(whitespace) + l.ignore() + return lexKey + + default: + l.backup() + return lexKey + } +} + +// lexComment scans a comment line. The comment character has already been scanned. +func lexComment(l *lexer) stateFn { + l.acceptRun(whitespace) + l.ignore() + for { + switch r := l.next(); { + case isEOF(r): + l.ignore() + l.emit(itemEOF) + return nil + case isEOL(r): + l.emit(itemComment) + return lexBeforeKey + default: + l.appendRune(r) + } + } +} + +// lexKey scans the key up to a delimiter +func lexKey(l *lexer) stateFn { + var r rune + +Loop: + for { + switch r = l.next(); { + + case isEscape(r): + err := l.scanEscapeSequence() + if err != nil { + return l.errorf(err.Error()) + } + + case isEndOfKey(r): + l.backup() + break Loop + + case isEOF(r): + break Loop + + default: + l.appendRune(r) + } + } + + if len(l.runes) > 0 { + l.emit(itemKey) + } + + if isEOF(r) { + l.emit(itemEOF) + return nil + } + + return lexBeforeValue +} + +// lexBeforeValue scans the delimiter between key and value. +// Leading and trailing whitespace is ignored. +// We expect to be just after the key. +func lexBeforeValue(l *lexer) stateFn { + l.acceptRun(whitespace) + l.accept(":=") + l.acceptRun(whitespace) + l.ignore() + return lexValue +} + +// lexValue scans text until the end of the line. We expect to be just after the delimiter. +func lexValue(l *lexer) stateFn { + for { + switch r := l.next(); { + case isEscape(r): + if isEOL(l.peek()) { + l.next() + l.acceptRun(whitespace) + } else { + err := l.scanEscapeSequence() + if err != nil { + return l.errorf(err.Error()) + } + } + + case isEOL(r): + l.emit(itemValue) + l.ignore() + return lexBeforeKey + + case isEOF(r): + l.emit(itemValue) + l.emit(itemEOF) + return nil + + default: + l.appendRune(r) + } + } +} + +// scanEscapeSequence scans either one of the escaped characters +// or a unicode literal. We expect to be after the escape character. +func (l *lexer) scanEscapeSequence() error { + switch r := l.next(); { + + case isEscapedCharacter(r): + l.appendRune(decodeEscapedCharacter(r)) + return nil + + case atUnicodeLiteral(r): + return l.scanUnicodeLiteral() + + case isEOF(r): + return fmt.Errorf("premature EOF") + + // silently drop the escape character and append the rune as is + default: + l.appendRune(r) + return nil + } +} + +// scans a unicode literal in the form \uXXXX. We expect to be after the \u. +func (l *lexer) scanUnicodeLiteral() error { + // scan the digits + d := make([]rune, 4) + for i := 0; i < 4; i++ { + d[i] = l.next() + if d[i] == eof || !strings.ContainsRune("0123456789abcdefABCDEF", d[i]) { + return fmt.Errorf("invalid unicode literal") + } + } + + // decode the digits into a rune + r, err := strconv.ParseInt(string(d), 16, 0) + if err != nil { + return err + } + + l.appendRune(rune(r)) + return nil +} + +// decodeEscapedCharacter returns the unescaped rune. We expect to be after the escape character. +func decodeEscapedCharacter(r rune) rune { + switch r { + case 'f': + return '\f' + case 'n': + return '\n' + case 'r': + return '\r' + case 't': + return '\t' + default: + return r + } +} + +// atUnicodeLiteral reports whether we are at a unicode literal. +// The escape character has already been consumed. +func atUnicodeLiteral(r rune) bool { + return r == 'u' +} + +// isComment reports whether we are at the start of a comment. +func isComment(r rune) bool { + return r == '#' || r == '!' +} + +// isEndOfKey reports whether the rune terminates the current key. +func isEndOfKey(r rune) bool { + return strings.ContainsRune(" \f\t\r\n:=", r) +} + +// isEOF reports whether we are at EOF. +func isEOF(r rune) bool { + return r == eof +} + +// isEOL reports whether we are at a new line character. +func isEOL(r rune) bool { + return r == '\n' || r == '\r' +} + +// isEscape reports whether the rune is the escape character which +// prefixes unicode literals and other escaped characters. +func isEscape(r rune) bool { + return r == '\\' +} + +// isEscapedCharacter reports whether we are at one of the characters that need escaping. +// The escape character has already been consumed. +func isEscapedCharacter(r rune) bool { + return strings.ContainsRune(" :=fnrt", r) +} + +// isWhitespace reports whether the rune is a whitespace character. +func isWhitespace(r rune) bool { + return strings.ContainsRune(whitespace, r) +} diff --git a/vendor/github.com/magiconair/properties/load.go b/vendor/github.com/magiconair/properties/load.go new file mode 100644 index 0000000000..278cc2ea01 --- /dev/null +++ b/vendor/github.com/magiconair/properties/load.go @@ -0,0 +1,241 @@ +// Copyright 2017 Frank Schroeder. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package properties + +import ( + "fmt" + "io/ioutil" + "net/http" + "os" + "strings" +) + +// Encoding specifies encoding of the input data. +type Encoding uint + +const ( + // UTF8 interprets the input data as UTF-8. + UTF8 Encoding = 1 << iota + + // ISO_8859_1 interprets the input data as ISO-8859-1. + ISO_8859_1 +) + +// Load reads a buffer into a Properties struct. +func Load(buf []byte, enc Encoding) (*Properties, error) { + return loadBuf(buf, enc) +} + +// LoadString reads an UTF8 string into a properties struct. +func LoadString(s string) (*Properties, error) { + return loadBuf([]byte(s), UTF8) +} + +// LoadMap creates a new Properties struct from a string map. +func LoadMap(m map[string]string) *Properties { + p := NewProperties() + for k, v := range m { + p.Set(k, v) + } + return p +} + +// LoadFile reads a file into a Properties struct. +func LoadFile(filename string, enc Encoding) (*Properties, error) { + return loadAll([]string{filename}, enc, false) +} + +// LoadFiles reads multiple files in the given order into +// a Properties struct. If 'ignoreMissing' is true then +// non-existent files will not be reported as error. +func LoadFiles(filenames []string, enc Encoding, ignoreMissing bool) (*Properties, error) { + return loadAll(filenames, enc, ignoreMissing) +} + +// LoadURL reads the content of the URL into a Properties struct. +// +// The encoding is determined via the Content-Type header which +// should be set to 'text/plain'. If the 'charset' parameter is +// missing, 'iso-8859-1' or 'latin1' the encoding is set to +// ISO-8859-1. If the 'charset' parameter is set to 'utf-8' the +// encoding is set to UTF-8. A missing content type header is +// interpreted as 'text/plain; charset=utf-8'. +func LoadURL(url string) (*Properties, error) { + return loadAll([]string{url}, UTF8, false) +} + +// LoadURLs reads the content of multiple URLs in the given order into a +// Properties struct. If 'ignoreMissing' is true then a 404 status code will +// not be reported as error. See LoadURL for the Content-Type header +// and the encoding. +func LoadURLs(urls []string, ignoreMissing bool) (*Properties, error) { + return loadAll(urls, UTF8, ignoreMissing) +} + +// LoadAll reads the content of multiple URLs or files in the given order into a +// Properties struct. If 'ignoreMissing' is true then a 404 status code or missing file will +// not be reported as error. Encoding sets the encoding for files. For the URLs please see +// LoadURL for the Content-Type header and the encoding. +func LoadAll(names []string, enc Encoding, ignoreMissing bool) (*Properties, error) { + return loadAll(names, enc, ignoreMissing) +} + +// MustLoadString reads an UTF8 string into a Properties struct and +// panics on error. +func MustLoadString(s string) *Properties { + return must(LoadString(s)) +} + +// MustLoadFile reads a file into a Properties struct and +// panics on error. +func MustLoadFile(filename string, enc Encoding) *Properties { + return must(LoadFile(filename, enc)) +} + +// MustLoadFiles reads multiple files in the given order into +// a Properties struct and panics on error. If 'ignoreMissing' +// is true then non-existent files will not be reported as error. +func MustLoadFiles(filenames []string, enc Encoding, ignoreMissing bool) *Properties { + return must(LoadFiles(filenames, enc, ignoreMissing)) +} + +// MustLoadURL reads the content of a URL into a Properties struct and +// panics on error. +func MustLoadURL(url string) *Properties { + return must(LoadURL(url)) +} + +// MustLoadURLs reads the content of multiple URLs in the given order into a +// Properties struct and panics on error. If 'ignoreMissing' is true then a 404 +// status code will not be reported as error. +func MustLoadURLs(urls []string, ignoreMissing bool) *Properties { + return must(LoadURLs(urls, ignoreMissing)) +} + +// MustLoadAll reads the content of multiple URLs or files in the given order into a +// Properties struct. If 'ignoreMissing' is true then a 404 status code or missing file will +// not be reported as error. Encoding sets the encoding for files. For the URLs please see +// LoadURL for the Content-Type header and the encoding. It panics on error. +func MustLoadAll(names []string, enc Encoding, ignoreMissing bool) *Properties { + return must(LoadAll(names, enc, ignoreMissing)) +} + +func loadBuf(buf []byte, enc Encoding) (*Properties, error) { + p, err := parse(convert(buf, enc)) + if err != nil { + return nil, err + } + return p, p.check() +} + +func loadAll(names []string, enc Encoding, ignoreMissing bool) (*Properties, error) { + result := NewProperties() + for _, name := range names { + n, err := expandName(name) + if err != nil { + return nil, err + } + var p *Properties + if strings.HasPrefix(n, "http://") || strings.HasPrefix(n, "https://") { + p, err = loadURL(n, ignoreMissing) + } else { + p, err = loadFile(n, enc, ignoreMissing) + } + if err != nil { + return nil, err + } + result.Merge(p) + + } + return result, result.check() +} + +func loadFile(filename string, enc Encoding, ignoreMissing bool) (*Properties, error) { + data, err := ioutil.ReadFile(filename) + if err != nil { + if ignoreMissing && os.IsNotExist(err) { + LogPrintf("properties: %s not found. skipping", filename) + return NewProperties(), nil + } + return nil, err + } + p, err := parse(convert(data, enc)) + if err != nil { + return nil, err + } + return p, nil +} + +func loadURL(url string, ignoreMissing bool) (*Properties, error) { + resp, err := http.Get(url) + if err != nil { + return nil, fmt.Errorf("properties: error fetching %q. %s", url, err) + } + if resp.StatusCode == 404 && ignoreMissing { + LogPrintf("properties: %s returned %d. skipping", url, resp.StatusCode) + return NewProperties(), nil + } + if resp.StatusCode != 200 { + return nil, fmt.Errorf("properties: %s returned %d", url, resp.StatusCode) + } + body, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, fmt.Errorf("properties: %s error reading response. %s", url, err) + } + if err = resp.Body.Close(); err != nil { + return nil, fmt.Errorf("properties: %s error reading response. %s", url, err) + } + + ct := resp.Header.Get("Content-Type") + var enc Encoding + switch strings.ToLower(ct) { + case "text/plain", "text/plain; charset=iso-8859-1", "text/plain; charset=latin1": + enc = ISO_8859_1 + case "", "text/plain; charset=utf-8": + enc = UTF8 + default: + return nil, fmt.Errorf("properties: invalid content type %s", ct) + } + + p, err := parse(convert(body, enc)) + if err != nil { + return nil, err + } + return p, nil +} + +func must(p *Properties, err error) *Properties { + if err != nil { + ErrorHandler(err) + } + return p +} + +// expandName expands ${ENV_VAR} expressions in a name. +// If the environment variable does not exist then it will be replaced +// with an empty string. Malformed expressions like "${ENV_VAR" will +// be reported as error. +func expandName(name string) (string, error) { + return expand(name, make(map[string]bool), "${", "}", make(map[string]string)) +} + +// Interprets a byte buffer either as an ISO-8859-1 or UTF-8 encoded string. +// For ISO-8859-1 we can convert each byte straight into a rune since the +// first 256 unicode code points cover ISO-8859-1. +func convert(buf []byte, enc Encoding) string { + switch enc { + case UTF8: + return string(buf) + case ISO_8859_1: + runes := make([]rune, len(buf)) + for i, b := range buf { + runes[i] = rune(b) + } + return string(runes) + default: + ErrorHandler(fmt.Errorf("unsupported encoding %v", enc)) + } + panic("ErrorHandler should exit") +} diff --git a/vendor/github.com/magiconair/properties/load_test.go b/vendor/github.com/magiconair/properties/load_test.go new file mode 100644 index 0000000000..d8770c8a04 --- /dev/null +++ b/vendor/github.com/magiconair/properties/load_test.go @@ -0,0 +1,231 @@ +// Copyright 2017 Frank Schroeder. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package properties + +import ( + "fmt" + "io/ioutil" + "net/http" + "net/http/httptest" + "os" + "strings" + "testing" + + "github.com/magiconair/properties/assert" +) + +func TestLoadFailsWithNotExistingFile(t *testing.T) { + _, err := LoadFile("doesnotexist.properties", ISO_8859_1) + assert.Equal(t, err != nil, true, "") + assert.Matches(t, err.Error(), "open.*no such file or directory") +} + +func TestLoadFilesFailsOnNotExistingFile(t *testing.T) { + _, err := LoadFile("doesnotexist.properties", ISO_8859_1) + assert.Equal(t, err != nil, true, "") + assert.Matches(t, err.Error(), "open.*no such file or directory") +} + +func TestLoadFilesDoesNotFailOnNotExistingFileAndIgnoreMissing(t *testing.T) { + p, err := LoadFiles([]string{"doesnotexist.properties"}, ISO_8859_1, true) + assert.Equal(t, err, nil) + assert.Equal(t, p.Len(), 0) +} + +func TestLoadString(t *testing.T) { + x := "key=äüö" + p1 := MustLoadString(x) + p2 := must(Load([]byte(x), UTF8)) + assert.Equal(t, p1, p2) +} + +func TestLoadMap(t *testing.T) { + // LoadMap does not guarantee the same import order + // of keys every time since map access is randomized. + // Therefore, we need to compare the generated maps. + m := map[string]string{"key": "value", "abc": "def"} + assert.Equal(t, LoadMap(m).Map(), m) +} + +func TestLoadFile(t *testing.T) { + tf := make(tempFiles, 0) + defer tf.removeAll() + + filename := tf.makeFile("key=value") + p := MustLoadFile(filename, ISO_8859_1) + + assert.Equal(t, p.Len(), 1) + assertKeyValues(t, "", p, "key", "value") +} + +func TestLoadFiles(t *testing.T) { + tf := make(tempFiles, 0) + defer tf.removeAll() + + filename := tf.makeFile("key=value") + filename2 := tf.makeFile("key2=value2") + p := MustLoadFiles([]string{filename, filename2}, ISO_8859_1, false) + assertKeyValues(t, "", p, "key", "value", "key2", "value2") +} + +func TestLoadExpandedFile(t *testing.T) { + tf := make(tempFiles, 0) + defer tf.removeAll() + + if err := os.Setenv("_VARX", "some-value"); err != nil { + t.Fatal(err) + } + filename := tf.makeFilePrefix(os.Getenv("_VARX"), "key=value") + filename = strings.Replace(filename, os.Getenv("_VARX"), "${_VARX}", -1) + p := MustLoadFile(filename, ISO_8859_1) + assertKeyValues(t, "", p, "key", "value") +} + +func TestLoadFilesAndIgnoreMissing(t *testing.T) { + tf := make(tempFiles, 0) + defer tf.removeAll() + + filename := tf.makeFile("key=value") + filename2 := tf.makeFile("key2=value2") + p := MustLoadFiles([]string{filename, filename + "foo", filename2, filename2 + "foo"}, ISO_8859_1, true) + assertKeyValues(t, "", p, "key", "value", "key2", "value2") +} + +func TestLoadURL(t *testing.T) { + srv := testServer() + defer srv.Close() + p := MustLoadURL(srv.URL + "/a") + assertKeyValues(t, "", p, "key", "value") +} + +func TestLoadURLs(t *testing.T) { + srv := testServer() + defer srv.Close() + p := MustLoadURLs([]string{srv.URL + "/a", srv.URL + "/b"}, false) + assertKeyValues(t, "", p, "key", "value", "key2", "value2") +} + +func TestLoadURLsAndFailMissing(t *testing.T) { + srv := testServer() + defer srv.Close() + p, err := LoadURLs([]string{srv.URL + "/a", srv.URL + "/c"}, false) + assert.Equal(t, p, (*Properties)(nil)) + assert.Matches(t, err.Error(), ".*returned 404.*") +} + +func TestLoadURLsAndIgnoreMissing(t *testing.T) { + srv := testServer() + defer srv.Close() + p := MustLoadURLs([]string{srv.URL + "/a", srv.URL + "/b", srv.URL + "/c"}, true) + assertKeyValues(t, "", p, "key", "value", "key2", "value2") +} + +func TestLoadURLEncoding(t *testing.T) { + srv := testServer() + defer srv.Close() + + uris := []string{"/none", "/utf8", "/plain", "/latin1", "/iso88591"} + for i, uri := range uris { + p := MustLoadURL(srv.URL + uri) + assert.Equal(t, p.GetString("key", ""), "äöü", fmt.Sprintf("%d", i)) + } +} + +func TestLoadURLFailInvalidEncoding(t *testing.T) { + srv := testServer() + defer srv.Close() + + p, err := LoadURL(srv.URL + "/json") + assert.Equal(t, p, (*Properties)(nil)) + assert.Matches(t, err.Error(), ".*invalid content type.*") +} + +func TestLoadAll(t *testing.T) { + tf := make(tempFiles, 0) + defer tf.removeAll() + + filename := tf.makeFile("key=value") + filename2 := tf.makeFile("key2=value3") + filename3 := tf.makeFile("key=value4") + srv := testServer() + defer srv.Close() + p := MustLoadAll([]string{filename, filename2, srv.URL + "/a", srv.URL + "/b", filename3}, UTF8, false) + assertKeyValues(t, "", p, "key", "value4", "key2", "value2") +} + +type tempFiles []string + +func (tf *tempFiles) removeAll() { + for _, path := range *tf { + err := os.Remove(path) + if err != nil { + fmt.Printf("os.Remove: %v", err) + } + } +} + +func (tf *tempFiles) makeFile(data string) string { + return tf.makeFilePrefix("properties", data) +} + +func (tf *tempFiles) makeFilePrefix(prefix, data string) string { + f, err := ioutil.TempFile("", prefix) + if err != nil { + panic("ioutil.TempFile: " + err.Error()) + } + + // remember the temp file so that we can remove it later + *tf = append(*tf, f.Name()) + + n, err := fmt.Fprint(f, data) + if err != nil { + panic("fmt.Fprintln: " + err.Error()) + } + if n != len(data) { + panic(fmt.Sprintf("Data size mismatch. expected=%d wrote=%d\n", len(data), n)) + } + + err = f.Close() + if err != nil { + panic("f.Close: " + err.Error()) + } + + return f.Name() +} + +func testServer() *httptest.Server { + return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + send := func(data []byte, contentType string) { + w.Header().Set("Content-Type", contentType) + if _, err := w.Write(data); err != nil { + panic(err) + } + } + + utf8 := []byte("key=äöü") + iso88591 := []byte{0x6b, 0x65, 0x79, 0x3d, 0xe4, 0xf6, 0xfc} // key=äöü + + switch r.RequestURI { + case "/a": + send([]byte("key=value"), "") + case "/b": + send([]byte("key2=value2"), "") + case "/none": + send(utf8, "") + case "/utf8": + send(utf8, "text/plain; charset=utf-8") + case "/json": + send(utf8, "application/json; charset=utf-8") + case "/plain": + send(iso88591, "text/plain") + case "/latin1": + send(iso88591, "text/plain; charset=latin1") + case "/iso88591": + send(iso88591, "text/plain; charset=iso-8859-1") + default: + w.WriteHeader(404) + } + })) +} diff --git a/vendor/github.com/magiconair/properties/parser.go b/vendor/github.com/magiconair/properties/parser.go new file mode 100644 index 0000000000..90f555cb93 --- /dev/null +++ b/vendor/github.com/magiconair/properties/parser.go @@ -0,0 +1,95 @@ +// Copyright 2017 Frank Schroeder. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package properties + +import ( + "fmt" + "runtime" +) + +type parser struct { + lex *lexer +} + +func parse(input string) (properties *Properties, err error) { + p := &parser{lex: lex(input)} + defer p.recover(&err) + + properties = NewProperties() + key := "" + comments := []string{} + + for { + token := p.expectOneOf(itemComment, itemKey, itemEOF) + switch token.typ { + case itemEOF: + goto done + case itemComment: + comments = append(comments, token.val) + continue + case itemKey: + key = token.val + if _, ok := properties.m[key]; !ok { + properties.k = append(properties.k, key) + } + } + + token = p.expectOneOf(itemValue, itemEOF) + if len(comments) > 0 { + properties.c[key] = comments + comments = []string{} + } + switch token.typ { + case itemEOF: + properties.m[key] = "" + goto done + case itemValue: + properties.m[key] = token.val + } + } + +done: + return properties, nil +} + +func (p *parser) errorf(format string, args ...interface{}) { + format = fmt.Sprintf("properties: Line %d: %s", p.lex.lineNumber(), format) + panic(fmt.Errorf(format, args...)) +} + +func (p *parser) expect(expected itemType) (token item) { + token = p.lex.nextItem() + if token.typ != expected { + p.unexpected(token) + } + return token +} + +func (p *parser) expectOneOf(expected ...itemType) (token item) { + token = p.lex.nextItem() + for _, v := range expected { + if token.typ == v { + return token + } + } + p.unexpected(token) + panic("unexpected token") +} + +func (p *parser) unexpected(token item) { + p.errorf(token.String()) +} + +// recover is the handler that turns panics into returns from the top level of Parse. +func (p *parser) recover(errp *error) { + e := recover() + if e != nil { + if _, ok := e.(runtime.Error); ok { + panic(e) + } + *errp = e.(error) + } + return +} diff --git a/vendor/github.com/magiconair/properties/properties.go b/vendor/github.com/magiconair/properties/properties.go new file mode 100644 index 0000000000..4f3d5a458f --- /dev/null +++ b/vendor/github.com/magiconair/properties/properties.go @@ -0,0 +1,808 @@ +// Copyright 2017 Frank Schroeder. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package properties + +// BUG(frank): Set() does not check for invalid unicode literals since this is currently handled by the lexer. +// BUG(frank): Write() does not allow to configure the newline character. Therefore, on Windows LF is used. + +import ( + "fmt" + "io" + "log" + "os" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" +) + +// ErrorHandlerFunc defines the type of function which handles failures +// of the MustXXX() functions. An error handler function must exit +// the application after handling the error. +type ErrorHandlerFunc func(error) + +// ErrorHandler is the function which handles failures of the MustXXX() +// functions. The default is LogFatalHandler. +var ErrorHandler ErrorHandlerFunc = LogFatalHandler + +// LogHandlerFunc defines the function prototype for logging errors. +type LogHandlerFunc func(fmt string, args ...interface{}) + +// LogPrintf defines a log handler which uses log.Printf. +var LogPrintf LogHandlerFunc = log.Printf + +// LogFatalHandler handles the error by logging a fatal error and exiting. +func LogFatalHandler(err error) { + log.Fatal(err) +} + +// PanicHandler handles the error by panicking. +func PanicHandler(err error) { + panic(err) +} + +// ----------------------------------------------------------------------------- + +// A Properties contains the key/value pairs from the properties input. +// All values are stored in unexpanded form and are expanded at runtime +type Properties struct { + // Pre-/Postfix for property expansion. + Prefix string + Postfix string + + // DisableExpansion controls the expansion of properties on Get() + // and the check for circular references on Set(). When set to + // true Properties behaves like a simple key/value store and does + // not check for circular references on Get() or on Set(). + DisableExpansion bool + + // Stores the key/value pairs + m map[string]string + + // Stores the comments per key. + c map[string][]string + + // Stores the keys in order of appearance. + k []string +} + +// NewProperties creates a new Properties struct with the default +// configuration for "${key}" expressions. +func NewProperties() *Properties { + return &Properties{ + Prefix: "${", + Postfix: "}", + m: map[string]string{}, + c: map[string][]string{}, + k: []string{}, + } +} + +// Get returns the expanded value for the given key if exists. +// Otherwise, ok is false. +func (p *Properties) Get(key string) (value string, ok bool) { + v, ok := p.m[key] + if p.DisableExpansion { + return v, ok + } + if !ok { + return "", false + } + + expanded, err := p.expand(v) + + // we guarantee that the expanded value is free of + // circular references and malformed expressions + // so we panic if we still get an error here. + if err != nil { + ErrorHandler(fmt.Errorf("%s in %q", err, key+" = "+v)) + } + + return expanded, true +} + +// MustGet returns the expanded value for the given key if exists. +// Otherwise, it panics. +func (p *Properties) MustGet(key string) string { + if v, ok := p.Get(key); ok { + return v + } + ErrorHandler(invalidKeyError(key)) + panic("ErrorHandler should exit") +} + +// ---------------------------------------------------------------------------- + +// ClearComments removes the comments for all keys. +func (p *Properties) ClearComments() { + p.c = map[string][]string{} +} + +// ---------------------------------------------------------------------------- + +// GetComment returns the last comment before the given key or an empty string. +func (p *Properties) GetComment(key string) string { + comments, ok := p.c[key] + if !ok || len(comments) == 0 { + return "" + } + return comments[len(comments)-1] +} + +// ---------------------------------------------------------------------------- + +// GetComments returns all comments that appeared before the given key or nil. +func (p *Properties) GetComments(key string) []string { + if comments, ok := p.c[key]; ok { + return comments + } + return nil +} + +// ---------------------------------------------------------------------------- + +// SetComment sets the comment for the key. +func (p *Properties) SetComment(key, comment string) { + p.c[key] = []string{comment} +} + +// ---------------------------------------------------------------------------- + +// SetComments sets the comments for the key. If the comments are nil then +// all comments for this key are deleted. +func (p *Properties) SetComments(key string, comments []string) { + if comments == nil { + delete(p.c, key) + return + } + p.c[key] = comments +} + +// ---------------------------------------------------------------------------- + +// GetBool checks if the expanded value is one of '1', 'yes', +// 'true' or 'on' if the key exists. The comparison is case-insensitive. +// If the key does not exist the default value is returned. +func (p *Properties) GetBool(key string, def bool) bool { + v, err := p.getBool(key) + if err != nil { + return def + } + return v +} + +// MustGetBool checks if the expanded value is one of '1', 'yes', +// 'true' or 'on' if the key exists. The comparison is case-insensitive. +// If the key does not exist the function panics. +func (p *Properties) MustGetBool(key string) bool { + v, err := p.getBool(key) + if err != nil { + ErrorHandler(err) + } + return v +} + +func (p *Properties) getBool(key string) (value bool, err error) { + if v, ok := p.Get(key); ok { + return boolVal(v), nil + } + return false, invalidKeyError(key) +} + +func boolVal(v string) bool { + v = strings.ToLower(v) + return v == "1" || v == "true" || v == "yes" || v == "on" +} + +// ---------------------------------------------------------------------------- + +// GetDuration parses the expanded value as an time.Duration (in ns) if the +// key exists. If key does not exist or the value cannot be parsed the default +// value is returned. In almost all cases you want to use GetParsedDuration(). +func (p *Properties) GetDuration(key string, def time.Duration) time.Duration { + v, err := p.getInt64(key) + if err != nil { + return def + } + return time.Duration(v) +} + +// MustGetDuration parses the expanded value as an time.Duration (in ns) if +// the key exists. If key does not exist or the value cannot be parsed the +// function panics. In almost all cases you want to use MustGetParsedDuration(). +func (p *Properties) MustGetDuration(key string) time.Duration { + v, err := p.getInt64(key) + if err != nil { + ErrorHandler(err) + } + return time.Duration(v) +} + +// ---------------------------------------------------------------------------- + +// GetParsedDuration parses the expanded value with time.ParseDuration() if the key exists. +// If key does not exist or the value cannot be parsed the default +// value is returned. +func (p *Properties) GetParsedDuration(key string, def time.Duration) time.Duration { + s, ok := p.Get(key) + if !ok { + return def + } + v, err := time.ParseDuration(s) + if err != nil { + return def + } + return v +} + +// MustGetParsedDuration parses the expanded value with time.ParseDuration() if the key exists. +// If key does not exist or the value cannot be parsed the function panics. +func (p *Properties) MustGetParsedDuration(key string) time.Duration { + s, ok := p.Get(key) + if !ok { + ErrorHandler(invalidKeyError(key)) + } + v, err := time.ParseDuration(s) + if err != nil { + ErrorHandler(err) + } + return v +} + +// ---------------------------------------------------------------------------- + +// GetFloat64 parses the expanded value as a float64 if the key exists. +// If key does not exist or the value cannot be parsed the default +// value is returned. +func (p *Properties) GetFloat64(key string, def float64) float64 { + v, err := p.getFloat64(key) + if err != nil { + return def + } + return v +} + +// MustGetFloat64 parses the expanded value as a float64 if the key exists. +// If key does not exist or the value cannot be parsed the function panics. +func (p *Properties) MustGetFloat64(key string) float64 { + v, err := p.getFloat64(key) + if err != nil { + ErrorHandler(err) + } + return v +} + +func (p *Properties) getFloat64(key string) (value float64, err error) { + if v, ok := p.Get(key); ok { + value, err = strconv.ParseFloat(v, 64) + if err != nil { + return 0, err + } + return value, nil + } + return 0, invalidKeyError(key) +} + +// ---------------------------------------------------------------------------- + +// GetInt parses the expanded value as an int if the key exists. +// If key does not exist or the value cannot be parsed the default +// value is returned. If the value does not fit into an int the +// function panics with an out of range error. +func (p *Properties) GetInt(key string, def int) int { + v, err := p.getInt64(key) + if err != nil { + return def + } + return intRangeCheck(key, v) +} + +// MustGetInt parses the expanded value as an int if the key exists. +// If key does not exist or the value cannot be parsed the function panics. +// If the value does not fit into an int the function panics with +// an out of range error. +func (p *Properties) MustGetInt(key string) int { + v, err := p.getInt64(key) + if err != nil { + ErrorHandler(err) + } + return intRangeCheck(key, v) +} + +// ---------------------------------------------------------------------------- + +// GetInt64 parses the expanded value as an int64 if the key exists. +// If key does not exist or the value cannot be parsed the default +// value is returned. +func (p *Properties) GetInt64(key string, def int64) int64 { + v, err := p.getInt64(key) + if err != nil { + return def + } + return v +} + +// MustGetInt64 parses the expanded value as an int if the key exists. +// If key does not exist or the value cannot be parsed the function panics. +func (p *Properties) MustGetInt64(key string) int64 { + v, err := p.getInt64(key) + if err != nil { + ErrorHandler(err) + } + return v +} + +func (p *Properties) getInt64(key string) (value int64, err error) { + if v, ok := p.Get(key); ok { + value, err = strconv.ParseInt(v, 10, 64) + if err != nil { + return 0, err + } + return value, nil + } + return 0, invalidKeyError(key) +} + +// ---------------------------------------------------------------------------- + +// GetUint parses the expanded value as an uint if the key exists. +// If key does not exist or the value cannot be parsed the default +// value is returned. If the value does not fit into an int the +// function panics with an out of range error. +func (p *Properties) GetUint(key string, def uint) uint { + v, err := p.getUint64(key) + if err != nil { + return def + } + return uintRangeCheck(key, v) +} + +// MustGetUint parses the expanded value as an int if the key exists. +// If key does not exist or the value cannot be parsed the function panics. +// If the value does not fit into an int the function panics with +// an out of range error. +func (p *Properties) MustGetUint(key string) uint { + v, err := p.getUint64(key) + if err != nil { + ErrorHandler(err) + } + return uintRangeCheck(key, v) +} + +// ---------------------------------------------------------------------------- + +// GetUint64 parses the expanded value as an uint64 if the key exists. +// If key does not exist or the value cannot be parsed the default +// value is returned. +func (p *Properties) GetUint64(key string, def uint64) uint64 { + v, err := p.getUint64(key) + if err != nil { + return def + } + return v +} + +// MustGetUint64 parses the expanded value as an int if the key exists. +// If key does not exist or the value cannot be parsed the function panics. +func (p *Properties) MustGetUint64(key string) uint64 { + v, err := p.getUint64(key) + if err != nil { + ErrorHandler(err) + } + return v +} + +func (p *Properties) getUint64(key string) (value uint64, err error) { + if v, ok := p.Get(key); ok { + value, err = strconv.ParseUint(v, 10, 64) + if err != nil { + return 0, err + } + return value, nil + } + return 0, invalidKeyError(key) +} + +// ---------------------------------------------------------------------------- + +// GetString returns the expanded value for the given key if exists or +// the default value otherwise. +func (p *Properties) GetString(key, def string) string { + if v, ok := p.Get(key); ok { + return v + } + return def +} + +// MustGetString returns the expanded value for the given key if exists or +// panics otherwise. +func (p *Properties) MustGetString(key string) string { + if v, ok := p.Get(key); ok { + return v + } + ErrorHandler(invalidKeyError(key)) + panic("ErrorHandler should exit") +} + +// ---------------------------------------------------------------------------- + +// Filter returns a new properties object which contains all properties +// for which the key matches the pattern. +func (p *Properties) Filter(pattern string) (*Properties, error) { + re, err := regexp.Compile(pattern) + if err != nil { + return nil, err + } + + return p.FilterRegexp(re), nil +} + +// FilterRegexp returns a new properties object which contains all properties +// for which the key matches the regular expression. +func (p *Properties) FilterRegexp(re *regexp.Regexp) *Properties { + pp := NewProperties() + for _, k := range p.k { + if re.MatchString(k) { + // TODO(fs): we are ignoring the error which flags a circular reference. + // TODO(fs): since we are just copying a subset of keys this cannot happen (fingers crossed) + pp.Set(k, p.m[k]) + } + } + return pp +} + +// FilterPrefix returns a new properties object with a subset of all keys +// with the given prefix. +func (p *Properties) FilterPrefix(prefix string) *Properties { + pp := NewProperties() + for _, k := range p.k { + if strings.HasPrefix(k, prefix) { + // TODO(fs): we are ignoring the error which flags a circular reference. + // TODO(fs): since we are just copying a subset of keys this cannot happen (fingers crossed) + pp.Set(k, p.m[k]) + } + } + return pp +} + +// FilterStripPrefix returns a new properties object with a subset of all keys +// with the given prefix and the prefix removed from the keys. +func (p *Properties) FilterStripPrefix(prefix string) *Properties { + pp := NewProperties() + n := len(prefix) + for _, k := range p.k { + if len(k) > len(prefix) && strings.HasPrefix(k, prefix) { + // TODO(fs): we are ignoring the error which flags a circular reference. + // TODO(fs): since we are modifying keys I am not entirely sure whether we can create a circular reference + // TODO(fs): this function should probably return an error but the signature is fixed + pp.Set(k[n:], p.m[k]) + } + } + return pp +} + +// Len returns the number of keys. +func (p *Properties) Len() int { + return len(p.m) +} + +// Keys returns all keys in the same order as in the input. +func (p *Properties) Keys() []string { + keys := make([]string, len(p.k)) + copy(keys, p.k) + return keys +} + +// Set sets the property key to the corresponding value. +// If a value for key existed before then ok is true and prev +// contains the previous value. If the value contains a +// circular reference or a malformed expression then +// an error is returned. +// An empty key is silently ignored. +func (p *Properties) Set(key, value string) (prev string, ok bool, err error) { + if key == "" { + return "", false, nil + } + + // if expansion is disabled we allow circular references + if p.DisableExpansion { + prev, ok = p.Get(key) + p.m[key] = value + return prev, ok, nil + } + + // to check for a circular reference we temporarily need + // to set the new value. If there is an error then revert + // to the previous state. Only if all tests are successful + // then we add the key to the p.k list. + prev, ok = p.Get(key) + p.m[key] = value + + // now check for a circular reference + _, err = p.expand(value) + if err != nil { + + // revert to the previous state + if ok { + p.m[key] = prev + } else { + delete(p.m, key) + } + + return "", false, err + } + + if !ok { + p.k = append(p.k, key) + } + + return prev, ok, nil +} + +// SetValue sets property key to the default string value +// as defined by fmt.Sprintf("%v"). +func (p *Properties) SetValue(key string, value interface{}) error { + _, _, err := p.Set(key, fmt.Sprintf("%v", value)) + return err +} + +// MustSet sets the property key to the corresponding value. +// If a value for key existed before then ok is true and prev +// contains the previous value. An empty key is silently ignored. +func (p *Properties) MustSet(key, value string) (prev string, ok bool) { + prev, ok, err := p.Set(key, value) + if err != nil { + ErrorHandler(err) + } + return prev, ok +} + +// String returns a string of all expanded 'key = value' pairs. +func (p *Properties) String() string { + var s string + for _, key := range p.k { + value, _ := p.Get(key) + s = fmt.Sprintf("%s%s = %s\n", s, key, value) + } + return s +} + +// Write writes all unexpanded 'key = value' pairs to the given writer. +// Write returns the number of bytes written and any write error encountered. +func (p *Properties) Write(w io.Writer, enc Encoding) (n int, err error) { + return p.WriteComment(w, "", enc) +} + +// WriteComment writes all unexpanced 'key = value' pairs to the given writer. +// If prefix is not empty then comments are written with a blank line and the +// given prefix. The prefix should be either "# " or "! " to be compatible with +// the properties file format. Otherwise, the properties parser will not be +// able to read the file back in. It returns the number of bytes written and +// any write error encountered. +func (p *Properties) WriteComment(w io.Writer, prefix string, enc Encoding) (n int, err error) { + var x int + + for _, key := range p.k { + value := p.m[key] + + if prefix != "" { + if comments, ok := p.c[key]; ok { + // don't print comments if they are all empty + allEmpty := true + for _, c := range comments { + if c != "" { + allEmpty = false + break + } + } + + if !allEmpty { + // add a blank line between entries but not at the top + if len(comments) > 0 && n > 0 { + x, err = fmt.Fprintln(w) + if err != nil { + return + } + n += x + } + + for _, c := range comments { + x, err = fmt.Fprintf(w, "%s%s\n", prefix, encode(c, "", enc)) + if err != nil { + return + } + n += x + } + } + } + } + + x, err = fmt.Fprintf(w, "%s = %s\n", encode(key, " :", enc), encode(value, "", enc)) + if err != nil { + return + } + n += x + } + return +} + +// Map returns a copy of the properties as a map. +func (p *Properties) Map() map[string]string { + m := make(map[string]string) + for k, v := range p.m { + m[k] = v + } + return m +} + +// FilterFunc returns a copy of the properties which includes the values which passed all filters. +func (p *Properties) FilterFunc(filters ...func(k, v string) bool) *Properties { + pp := NewProperties() +outer: + for k, v := range p.m { + for _, f := range filters { + if !f(k, v) { + continue outer + } + pp.Set(k, v) + } + } + return pp +} + +// ---------------------------------------------------------------------------- + +// Delete removes the key and its comments. +func (p *Properties) Delete(key string) { + delete(p.m, key) + delete(p.c, key) + newKeys := []string{} + for _, k := range p.k { + if k != key { + newKeys = append(newKeys, k) + } + } + p.k = newKeys +} + +// Merge merges properties, comments and keys from other *Properties into p +func (p *Properties) Merge(other *Properties) { + for k, v := range other.m { + p.m[k] = v + } + for k, v := range other.c { + p.c[k] = v + } + +outer: + for _, otherKey := range other.k { + for _, key := range p.k { + if otherKey == key { + continue outer + } + } + p.k = append(p.k, otherKey) + } +} + +// ---------------------------------------------------------------------------- + +// check expands all values and returns an error if a circular reference or +// a malformed expression was found. +func (p *Properties) check() error { + for _, value := range p.m { + if _, err := p.expand(value); err != nil { + return err + } + } + return nil +} + +func (p *Properties) expand(input string) (string, error) { + // no pre/postfix -> nothing to expand + if p.Prefix == "" && p.Postfix == "" { + return input, nil + } + + return expand(input, make(map[string]bool), p.Prefix, p.Postfix, p.m) +} + +// expand recursively expands expressions of '(prefix)key(postfix)' to their corresponding values. +// The function keeps track of the keys that were already expanded and stops if it +// detects a circular reference or a malformed expression of the form '(prefix)key'. +func expand(s string, keys map[string]bool, prefix, postfix string, values map[string]string) (string, error) { + start := strings.Index(s, prefix) + if start == -1 { + return s, nil + } + + keyStart := start + len(prefix) + keyLen := strings.Index(s[keyStart:], postfix) + if keyLen == -1 { + return "", fmt.Errorf("malformed expression") + } + + end := keyStart + keyLen + len(postfix) - 1 + key := s[keyStart : keyStart+keyLen] + + // fmt.Printf("s:%q pp:%q start:%d end:%d keyStart:%d keyLen:%d key:%q\n", s, prefix + "..." + postfix, start, end, keyStart, keyLen, key) + + if _, ok := keys[key]; ok { + return "", fmt.Errorf("circular reference") + } + + val, ok := values[key] + if !ok { + val = os.Getenv(key) + } + + // remember that we've seen the key + keys[key] = true + + return expand(s[:start]+val+s[end+1:], keys, prefix, postfix, values) +} + +// encode encodes a UTF-8 string to ISO-8859-1 and escapes some characters. +func encode(s string, special string, enc Encoding) string { + switch enc { + case UTF8: + return encodeUtf8(s, special) + case ISO_8859_1: + return encodeIso(s, special) + default: + panic(fmt.Sprintf("unsupported encoding %v", enc)) + } +} + +func encodeUtf8(s string, special string) string { + v := "" + for pos := 0; pos < len(s); { + r, w := utf8.DecodeRuneInString(s[pos:]) + pos += w + v += escape(r, special) + } + return v +} + +func encodeIso(s string, special string) string { + var r rune + var w int + var v string + for pos := 0; pos < len(s); { + switch r, w = utf8.DecodeRuneInString(s[pos:]); { + case r < 1<<8: // single byte rune -> escape special chars only + v += escape(r, special) + case r < 1<<16: // two byte rune -> unicode literal + v += fmt.Sprintf("\\u%04x", r) + default: // more than two bytes per rune -> can't encode + v += "?" + } + pos += w + } + return v +} + +func escape(r rune, special string) string { + switch r { + case '\f': + return "\\f" + case '\n': + return "\\n" + case '\r': + return "\\r" + case '\t': + return "\\t" + default: + if strings.ContainsRune(special, r) { + return "\\" + string(r) + } + return string(r) + } +} + +func invalidKeyError(key string) error { + return fmt.Errorf("unknown property: %s", key) +} diff --git a/vendor/github.com/magiconair/properties/properties_test.go b/vendor/github.com/magiconair/properties/properties_test.go new file mode 100644 index 0000000000..0eac1f4922 --- /dev/null +++ b/vendor/github.com/magiconair/properties/properties_test.go @@ -0,0 +1,934 @@ +// Copyright 2017 Frank Schroeder. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package properties + +import ( + "bytes" + "flag" + "fmt" + "math" + "os" + "reflect" + "strings" + "testing" + "time" + + "github.com/magiconair/properties/assert" +) + +var verbose = flag.Bool("verbose", false, "Verbose output") + +func init() { + ErrorHandler = PanicHandler +} + +// ---------------------------------------------------------------------------- + +// define test cases in the form of +// {"input", "key1", "value1", "key2", "value2", ...} +var complexTests = [][]string{ + // whitespace prefix + {" key=value", "key", "value"}, // SPACE prefix + {"\fkey=value", "key", "value"}, // FF prefix + {"\tkey=value", "key", "value"}, // TAB prefix + {" \f\tkey=value", "key", "value"}, // mix prefix + + // multiple keys + {"key1=value1\nkey2=value2\n", "key1", "value1", "key2", "value2"}, + {"key1=value1\rkey2=value2\r", "key1", "value1", "key2", "value2"}, + {"key1=value1\r\nkey2=value2\r\n", "key1", "value1", "key2", "value2"}, + + // blank lines + {"\nkey=value\n", "key", "value"}, + {"\rkey=value\r", "key", "value"}, + {"\r\nkey=value\r\n", "key", "value"}, + + // escaped chars in key + {"k\\ ey = value", "k ey", "value"}, + {"k\\:ey = value", "k:ey", "value"}, + {"k\\=ey = value", "k=ey", "value"}, + {"k\\fey = value", "k\fey", "value"}, + {"k\\ney = value", "k\ney", "value"}, + {"k\\rey = value", "k\rey", "value"}, + {"k\\tey = value", "k\tey", "value"}, + + // escaped chars in value + {"key = v\\ alue", "key", "v alue"}, + {"key = v\\:alue", "key", "v:alue"}, + {"key = v\\=alue", "key", "v=alue"}, + {"key = v\\falue", "key", "v\falue"}, + {"key = v\\nalue", "key", "v\nalue"}, + {"key = v\\ralue", "key", "v\ralue"}, + {"key = v\\talue", "key", "v\talue"}, + + // silently dropped escape character + {"k\\zey = value", "kzey", "value"}, + {"key = v\\zalue", "key", "vzalue"}, + + // unicode literals + {"key\\u2318 = value", "key⌘", "value"}, + {"k\\u2318ey = value", "k⌘ey", "value"}, + {"key = value\\u2318", "key", "value⌘"}, + {"key = valu\\u2318e", "key", "valu⌘e"}, + + // multiline values + {"key = valueA,\\\n valueB", "key", "valueA,valueB"}, // SPACE indent + {"key = valueA,\\\n\f\f\fvalueB", "key", "valueA,valueB"}, // FF indent + {"key = valueA,\\\n\t\t\tvalueB", "key", "valueA,valueB"}, // TAB indent + {"key = valueA,\\\n \f\tvalueB", "key", "valueA,valueB"}, // mix indent + + // comments + {"# this is a comment\n! and so is this\nkey1=value1\nkey#2=value#2\n\nkey!3=value!3\n# and another one\n! and the final one", "key1", "value1", "key#2", "value#2", "key!3", "value!3"}, + + // expansion tests + {"key=value\nkey2=${key}", "key", "value", "key2", "value"}, + {"key=value\nkey2=aa${key}", "key", "value", "key2", "aavalue"}, + {"key=value\nkey2=${key}bb", "key", "value", "key2", "valuebb"}, + {"key=value\nkey2=aa${key}bb", "key", "value", "key2", "aavaluebb"}, + {"key=value\nkey2=${key}\nkey3=${key2}", "key", "value", "key2", "value", "key3", "value"}, + {"key=${USER}", "key", os.Getenv("USER")}, + {"key=${USER}\nUSER=value", "key", "value", "USER", "value"}, +} + +// ---------------------------------------------------------------------------- + +var commentTests = []struct { + input, key, value string + comments []string +}{ + {"key=value", "key", "value", nil}, + {"#\nkey=value", "key", "value", []string{""}}, + {"#comment\nkey=value", "key", "value", []string{"comment"}}, + {"# comment\nkey=value", "key", "value", []string{"comment"}}, + {"# comment\nkey=value", "key", "value", []string{"comment"}}, + {"# comment\n\nkey=value", "key", "value", []string{"comment"}}, + {"# comment1\n# comment2\nkey=value", "key", "value", []string{"comment1", "comment2"}}, + {"# comment1\n\n# comment2\n\nkey=value", "key", "value", []string{"comment1", "comment2"}}, + {"!comment\nkey=value", "key", "value", []string{"comment"}}, + {"! comment\nkey=value", "key", "value", []string{"comment"}}, + {"! comment\nkey=value", "key", "value", []string{"comment"}}, + {"! comment\n\nkey=value", "key", "value", []string{"comment"}}, + {"! comment1\n! comment2\nkey=value", "key", "value", []string{"comment1", "comment2"}}, + {"! comment1\n\n! comment2\n\nkey=value", "key", "value", []string{"comment1", "comment2"}}, +} + +// ---------------------------------------------------------------------------- + +var errorTests = []struct { + input, msg string +}{ + // unicode literals + {"key\\u1 = value", "invalid unicode literal"}, + {"key\\u12 = value", "invalid unicode literal"}, + {"key\\u123 = value", "invalid unicode literal"}, + {"key\\u123g = value", "invalid unicode literal"}, + {"key\\u123", "invalid unicode literal"}, + + // circular references + {"key=${key}", "circular reference"}, + {"key1=${key2}\nkey2=${key1}", "circular reference"}, + + // malformed expressions + {"key=${ke", "malformed expression"}, + {"key=valu${ke", "malformed expression"}, +} + +// ---------------------------------------------------------------------------- + +var writeTests = []struct { + input, output, encoding string +}{ + // ISO-8859-1 tests + {"key = value", "key = value\n", "ISO-8859-1"}, + {"key = value \\\n continued", "key = value continued\n", "ISO-8859-1"}, + {"key⌘ = value", "key\\u2318 = value\n", "ISO-8859-1"}, + {"ke\\ \\:y = value", "ke\\ \\:y = value\n", "ISO-8859-1"}, + + // UTF-8 tests + {"key = value", "key = value\n", "UTF-8"}, + {"key = value \\\n continued", "key = value continued\n", "UTF-8"}, + {"key⌘ = value⌘", "key⌘ = value⌘\n", "UTF-8"}, + {"ke\\ \\:y = value", "ke\\ \\:y = value\n", "UTF-8"}, +} + +// ---------------------------------------------------------------------------- + +var writeCommentTests = []struct { + input, output, encoding string +}{ + // ISO-8859-1 tests + {"key = value", "key = value\n", "ISO-8859-1"}, + {"#\nkey = value", "key = value\n", "ISO-8859-1"}, + {"#\n#\n#\nkey = value", "key = value\n", "ISO-8859-1"}, + {"# comment\nkey = value", "# comment\nkey = value\n", "ISO-8859-1"}, + {"\n# comment\nkey = value", "# comment\nkey = value\n", "ISO-8859-1"}, + {"# comment\n\nkey = value", "# comment\nkey = value\n", "ISO-8859-1"}, + {"# comment1\n# comment2\nkey = value", "# comment1\n# comment2\nkey = value\n", "ISO-8859-1"}, + {"#comment1\nkey1 = value1\n#comment2\nkey2 = value2", "# comment1\nkey1 = value1\n\n# comment2\nkey2 = value2\n", "ISO-8859-1"}, + + // UTF-8 tests + {"key = value", "key = value\n", "UTF-8"}, + {"# comment⌘\nkey = value⌘", "# comment⌘\nkey = value⌘\n", "UTF-8"}, + {"\n# comment⌘\nkey = value⌘", "# comment⌘\nkey = value⌘\n", "UTF-8"}, + {"# comment⌘\n\nkey = value⌘", "# comment⌘\nkey = value⌘\n", "UTF-8"}, + {"# comment1⌘\n# comment2⌘\nkey = value⌘", "# comment1⌘\n# comment2⌘\nkey = value⌘\n", "UTF-8"}, + {"#comment1⌘\nkey1 = value1⌘\n#comment2⌘\nkey2 = value2⌘", "# comment1⌘\nkey1 = value1⌘\n\n# comment2⌘\nkey2 = value2⌘\n", "UTF-8"}, +} + +// ---------------------------------------------------------------------------- + +var boolTests = []struct { + input, key string + def, value bool +}{ + // valid values for TRUE + {"key = 1", "key", false, true}, + {"key = on", "key", false, true}, + {"key = On", "key", false, true}, + {"key = ON", "key", false, true}, + {"key = true", "key", false, true}, + {"key = True", "key", false, true}, + {"key = TRUE", "key", false, true}, + {"key = yes", "key", false, true}, + {"key = Yes", "key", false, true}, + {"key = YES", "key", false, true}, + + // valid values for FALSE (all other) + {"key = 0", "key", true, false}, + {"key = off", "key", true, false}, + {"key = false", "key", true, false}, + {"key = no", "key", true, false}, + + // non existent key + {"key = true", "key2", false, false}, +} + +// ---------------------------------------------------------------------------- + +var durationTests = []struct { + input, key string + def, value time.Duration +}{ + // valid values + {"key = 1", "key", 999, 1}, + {"key = 0", "key", 999, 0}, + {"key = -1", "key", 999, -1}, + {"key = 0123", "key", 999, 123}, + + // invalid values + {"key = 0xff", "key", 999, 999}, + {"key = 1.0", "key", 999, 999}, + {"key = a", "key", 999, 999}, + + // non existent key + {"key = 1", "key2", 999, 999}, +} + +// ---------------------------------------------------------------------------- + +var parsedDurationTests = []struct { + input, key string + def, value time.Duration +}{ + // valid values + {"key = -1ns", "key", 999, -1 * time.Nanosecond}, + {"key = 300ms", "key", 999, 300 * time.Millisecond}, + {"key = 5s", "key", 999, 5 * time.Second}, + {"key = 3h", "key", 999, 3 * time.Hour}, + {"key = 2h45m", "key", 999, 2*time.Hour + 45*time.Minute}, + + // invalid values + {"key = 0xff", "key", 999, 999}, + {"key = 1.0", "key", 999, 999}, + {"key = a", "key", 999, 999}, + {"key = 1", "key", 999, 999}, + {"key = 0", "key", 999, 0}, + + // non existent key + {"key = 1", "key2", 999, 999}, +} + +// ---------------------------------------------------------------------------- + +var floatTests = []struct { + input, key string + def, value float64 +}{ + // valid values + {"key = 1.0", "key", 999, 1.0}, + {"key = 0.0", "key", 999, 0.0}, + {"key = -1.0", "key", 999, -1.0}, + {"key = 1", "key", 999, 1}, + {"key = 0", "key", 999, 0}, + {"key = -1", "key", 999, -1}, + {"key = 0123", "key", 999, 123}, + + // invalid values + {"key = 0xff", "key", 999, 999}, + {"key = a", "key", 999, 999}, + + // non existent key + {"key = 1", "key2", 999, 999}, +} + +// ---------------------------------------------------------------------------- + +var int64Tests = []struct { + input, key string + def, value int64 +}{ + // valid values + {"key = 1", "key", 999, 1}, + {"key = 0", "key", 999, 0}, + {"key = -1", "key", 999, -1}, + {"key = 0123", "key", 999, 123}, + + // invalid values + {"key = 0xff", "key", 999, 999}, + {"key = 1.0", "key", 999, 999}, + {"key = a", "key", 999, 999}, + + // non existent key + {"key = 1", "key2", 999, 999}, +} + +// ---------------------------------------------------------------------------- + +var uint64Tests = []struct { + input, key string + def, value uint64 +}{ + // valid values + {"key = 1", "key", 999, 1}, + {"key = 0", "key", 999, 0}, + {"key = 0123", "key", 999, 123}, + + // invalid values + {"key = -1", "key", 999, 999}, + {"key = 0xff", "key", 999, 999}, + {"key = 1.0", "key", 999, 999}, + {"key = a", "key", 999, 999}, + + // non existent key + {"key = 1", "key2", 999, 999}, +} + +// ---------------------------------------------------------------------------- + +var stringTests = []struct { + input, key string + def, value string +}{ + // valid values + {"key = abc", "key", "def", "abc"}, + + // non existent key + {"key = abc", "key2", "def", "def"}, +} + +// ---------------------------------------------------------------------------- + +var keysTests = []struct { + input string + keys []string +}{ + {"", []string{}}, + {"key = abc", []string{"key"}}, + {"key = abc\nkey2=def", []string{"key", "key2"}}, + {"key2 = abc\nkey=def", []string{"key2", "key"}}, + {"key = abc\nkey=def", []string{"key"}}, +} + +// ---------------------------------------------------------------------------- + +var filterTests = []struct { + input string + pattern string + keys []string + err string +}{ + {"", "", []string{}, ""}, + {"", "abc", []string{}, ""}, + {"key=value", "", []string{"key"}, ""}, + {"key=value", "key=", []string{}, ""}, + {"key=value\nfoo=bar", "", []string{"foo", "key"}, ""}, + {"key=value\nfoo=bar", "f", []string{"foo"}, ""}, + {"key=value\nfoo=bar", "fo", []string{"foo"}, ""}, + {"key=value\nfoo=bar", "foo", []string{"foo"}, ""}, + {"key=value\nfoo=bar", "fooo", []string{}, ""}, + {"key=value\nkey2=value2\nfoo=bar", "ey", []string{"key", "key2"}, ""}, + {"key=value\nkey2=value2\nfoo=bar", "key", []string{"key", "key2"}, ""}, + {"key=value\nkey2=value2\nfoo=bar", "^key", []string{"key", "key2"}, ""}, + {"key=value\nkey2=value2\nfoo=bar", "^(key|foo)", []string{"foo", "key", "key2"}, ""}, + {"key=value\nkey2=value2\nfoo=bar", "[ abc", nil, "error parsing regexp.*"}, +} + +// ---------------------------------------------------------------------------- + +var filterPrefixTests = []struct { + input string + prefix string + keys []string +}{ + {"", "", []string{}}, + {"", "abc", []string{}}, + {"key=value", "", []string{"key"}}, + {"key=value", "key=", []string{}}, + {"key=value\nfoo=bar", "", []string{"foo", "key"}}, + {"key=value\nfoo=bar", "f", []string{"foo"}}, + {"key=value\nfoo=bar", "fo", []string{"foo"}}, + {"key=value\nfoo=bar", "foo", []string{"foo"}}, + {"key=value\nfoo=bar", "fooo", []string{}}, + {"key=value\nkey2=value2\nfoo=bar", "key", []string{"key", "key2"}}, +} + +// ---------------------------------------------------------------------------- + +var filterStripPrefixTests = []struct { + input string + prefix string + keys []string +}{ + {"", "", []string{}}, + {"", "abc", []string{}}, + {"key=value", "", []string{"key"}}, + {"key=value", "key=", []string{}}, + {"key=value\nfoo=bar", "", []string{"foo", "key"}}, + {"key=value\nfoo=bar", "f", []string{"foo"}}, + {"key=value\nfoo=bar", "fo", []string{"foo"}}, + {"key=value\nfoo=bar", "foo", []string{"foo"}}, + {"key=value\nfoo=bar", "fooo", []string{}}, + {"key=value\nkey2=value2\nfoo=bar", "key", []string{"key", "key2"}}, +} + +// ---------------------------------------------------------------------------- + +var setTests = []struct { + input string + key, value string + prev string + ok bool + err string + keys []string +}{ + {"", "", "", "", false, "", []string{}}, + {"", "key", "value", "", false, "", []string{"key"}}, + {"key=value", "key2", "value2", "", false, "", []string{"key", "key2"}}, + {"key=value", "abc", "value3", "", false, "", []string{"key", "abc"}}, + {"key=value", "key", "value3", "value", true, "", []string{"key"}}, +} + +// ---------------------------------------------------------------------------- + +// TestBasic tests basic single key/value combinations with all possible +// whitespace, delimiter and newline permutations. +func TestBasic(t *testing.T) { + testWhitespaceAndDelimiterCombinations(t, "key", "") + testWhitespaceAndDelimiterCombinations(t, "key", "value") + testWhitespaceAndDelimiterCombinations(t, "key", "value ") +} + +func TestComplex(t *testing.T) { + for _, test := range complexTests { + testKeyValue(t, test[0], test[1:]...) + } +} + +func TestErrors(t *testing.T) { + for _, test := range errorTests { + _, err := Load([]byte(test.input), ISO_8859_1) + assert.Equal(t, err != nil, true, "want error") + assert.Equal(t, strings.Contains(err.Error(), test.msg), true) + } +} + +func TestDisableExpansion(t *testing.T) { + input := "key=value\nkey2=${key}" + p := mustParse(t, input) + p.DisableExpansion = true + assert.Equal(t, p.MustGet("key"), "value") + assert.Equal(t, p.MustGet("key2"), "${key}") + + // with expansion disabled we can introduce circular references + p.MustSet("keyA", "${keyB}") + p.MustSet("keyB", "${keyA}") + assert.Equal(t, p.MustGet("keyA"), "${keyB}") + assert.Equal(t, p.MustGet("keyB"), "${keyA}") +} + +func TestMustGet(t *testing.T) { + input := "key = value\nkey2 = ghi" + p := mustParse(t, input) + assert.Equal(t, p.MustGet("key"), "value") + assert.Panic(t, func() { p.MustGet("invalid") }, "unknown property: invalid") +} + +func TestGetBool(t *testing.T) { + for _, test := range boolTests { + p := mustParse(t, test.input) + assert.Equal(t, p.Len(), 1) + assert.Equal(t, p.GetBool(test.key, test.def), test.value) + } +} + +func TestMustGetBool(t *testing.T) { + input := "key = true\nkey2 = ghi" + p := mustParse(t, input) + assert.Equal(t, p.MustGetBool("key"), true) + assert.Panic(t, func() { p.MustGetBool("invalid") }, "unknown property: invalid") +} + +func TestGetDuration(t *testing.T) { + for _, test := range durationTests { + p := mustParse(t, test.input) + assert.Equal(t, p.Len(), 1) + assert.Equal(t, p.GetDuration(test.key, test.def), test.value) + } +} + +func TestMustGetDuration(t *testing.T) { + input := "key = 123\nkey2 = ghi" + p := mustParse(t, input) + assert.Equal(t, p.MustGetDuration("key"), time.Duration(123)) + assert.Panic(t, func() { p.MustGetDuration("key2") }, "strconv.ParseInt: parsing.*") + assert.Panic(t, func() { p.MustGetDuration("invalid") }, "unknown property: invalid") +} + +func TestGetParsedDuration(t *testing.T) { + for _, test := range parsedDurationTests { + p := mustParse(t, test.input) + assert.Equal(t, p.Len(), 1) + assert.Equal(t, p.GetParsedDuration(test.key, test.def), test.value) + } +} + +func TestMustGetParsedDuration(t *testing.T) { + input := "key = 123ms\nkey2 = ghi" + p := mustParse(t, input) + assert.Equal(t, p.MustGetParsedDuration("key"), 123*time.Millisecond) + assert.Panic(t, func() { p.MustGetParsedDuration("key2") }, "time: invalid duration ghi") + assert.Panic(t, func() { p.MustGetParsedDuration("invalid") }, "unknown property: invalid") +} + +func TestGetFloat64(t *testing.T) { + for _, test := range floatTests { + p := mustParse(t, test.input) + assert.Equal(t, p.Len(), 1) + assert.Equal(t, p.GetFloat64(test.key, test.def), test.value) + } +} + +func TestMustGetFloat64(t *testing.T) { + input := "key = 123\nkey2 = ghi" + p := mustParse(t, input) + assert.Equal(t, p.MustGetFloat64("key"), float64(123)) + assert.Panic(t, func() { p.MustGetFloat64("key2") }, "strconv.ParseFloat: parsing.*") + assert.Panic(t, func() { p.MustGetFloat64("invalid") }, "unknown property: invalid") +} + +func TestGetInt(t *testing.T) { + for _, test := range int64Tests { + p := mustParse(t, test.input) + assert.Equal(t, p.Len(), 1) + assert.Equal(t, p.GetInt(test.key, int(test.def)), int(test.value)) + } +} + +func TestMustGetInt(t *testing.T) { + input := "key = 123\nkey2 = ghi" + p := mustParse(t, input) + assert.Equal(t, p.MustGetInt("key"), int(123)) + assert.Panic(t, func() { p.MustGetInt("key2") }, "strconv.ParseInt: parsing.*") + assert.Panic(t, func() { p.MustGetInt("invalid") }, "unknown property: invalid") +} + +func TestGetInt64(t *testing.T) { + for _, test := range int64Tests { + p := mustParse(t, test.input) + assert.Equal(t, p.Len(), 1) + assert.Equal(t, p.GetInt64(test.key, test.def), test.value) + } +} + +func TestMustGetInt64(t *testing.T) { + input := "key = 123\nkey2 = ghi" + p := mustParse(t, input) + assert.Equal(t, p.MustGetInt64("key"), int64(123)) + assert.Panic(t, func() { p.MustGetInt64("key2") }, "strconv.ParseInt: parsing.*") + assert.Panic(t, func() { p.MustGetInt64("invalid") }, "unknown property: invalid") +} + +func TestGetUint(t *testing.T) { + for _, test := range uint64Tests { + p := mustParse(t, test.input) + assert.Equal(t, p.Len(), 1) + assert.Equal(t, p.GetUint(test.key, uint(test.def)), uint(test.value)) + } +} + +func TestMustGetUint(t *testing.T) { + input := "key = 123\nkey2 = ghi" + p := mustParse(t, input) + assert.Equal(t, p.MustGetUint("key"), uint(123)) + assert.Panic(t, func() { p.MustGetUint64("key2") }, "strconv.ParseUint: parsing.*") + assert.Panic(t, func() { p.MustGetUint64("invalid") }, "unknown property: invalid") +} + +func TestGetUint64(t *testing.T) { + for _, test := range uint64Tests { + p := mustParse(t, test.input) + assert.Equal(t, p.Len(), 1) + assert.Equal(t, p.GetUint64(test.key, test.def), test.value) + } +} + +func TestMustGetUint64(t *testing.T) { + input := "key = 123\nkey2 = ghi" + p := mustParse(t, input) + assert.Equal(t, p.MustGetUint64("key"), uint64(123)) + assert.Panic(t, func() { p.MustGetUint64("key2") }, "strconv.ParseUint: parsing.*") + assert.Panic(t, func() { p.MustGetUint64("invalid") }, "unknown property: invalid") +} + +func TestGetString(t *testing.T) { + for _, test := range stringTests { + p := mustParse(t, test.input) + assert.Equal(t, p.Len(), 1) + assert.Equal(t, p.GetString(test.key, test.def), test.value) + } +} + +func TestMustGetString(t *testing.T) { + input := `key = value` + p := mustParse(t, input) + assert.Equal(t, p.MustGetString("key"), "value") + assert.Panic(t, func() { p.MustGetString("invalid") }, "unknown property: invalid") +} + +func TestComment(t *testing.T) { + for _, test := range commentTests { + p := mustParse(t, test.input) + assert.Equal(t, p.MustGetString(test.key), test.value) + assert.Equal(t, p.GetComments(test.key), test.comments) + if test.comments != nil { + assert.Equal(t, p.GetComment(test.key), test.comments[len(test.comments)-1]) + } else { + assert.Equal(t, p.GetComment(test.key), "") + } + + // test setting comments + if len(test.comments) > 0 { + // set single comment + p.ClearComments() + assert.Equal(t, len(p.c), 0) + p.SetComment(test.key, test.comments[0]) + assert.Equal(t, p.GetComment(test.key), test.comments[0]) + + // set multiple comments + p.ClearComments() + assert.Equal(t, len(p.c), 0) + p.SetComments(test.key, test.comments) + assert.Equal(t, p.GetComments(test.key), test.comments) + + // clear comments for a key + p.SetComments(test.key, nil) + assert.Equal(t, p.GetComment(test.key), "") + assert.Equal(t, p.GetComments(test.key), ([]string)(nil)) + } + } +} + +func TestFilter(t *testing.T) { + for _, test := range filterTests { + p := mustParse(t, test.input) + pp, err := p.Filter(test.pattern) + if err != nil { + assert.Matches(t, err.Error(), test.err) + continue + } + assert.Equal(t, pp != nil, true, "want properties") + assert.Equal(t, pp.Len(), len(test.keys)) + for _, key := range test.keys { + v1, ok1 := p.Get(key) + v2, ok2 := pp.Get(key) + assert.Equal(t, ok1, true) + assert.Equal(t, ok2, true) + assert.Equal(t, v1, v2) + } + } +} + +func TestFilterPrefix(t *testing.T) { + for _, test := range filterPrefixTests { + p := mustParse(t, test.input) + pp := p.FilterPrefix(test.prefix) + assert.Equal(t, pp != nil, true, "want properties") + assert.Equal(t, pp.Len(), len(test.keys)) + for _, key := range test.keys { + v1, ok1 := p.Get(key) + v2, ok2 := pp.Get(key) + assert.Equal(t, ok1, true) + assert.Equal(t, ok2, true) + assert.Equal(t, v1, v2) + } + } +} + +func TestFilterStripPrefix(t *testing.T) { + for _, test := range filterStripPrefixTests { + p := mustParse(t, test.input) + pp := p.FilterPrefix(test.prefix) + assert.Equal(t, pp != nil, true, "want properties") + assert.Equal(t, pp.Len(), len(test.keys)) + for _, key := range test.keys { + v1, ok1 := p.Get(key) + v2, ok2 := pp.Get(key) + assert.Equal(t, ok1, true) + assert.Equal(t, ok2, true) + assert.Equal(t, v1, v2) + } + } +} + +func TestKeys(t *testing.T) { + for _, test := range keysTests { + p := mustParse(t, test.input) + assert.Equal(t, p.Len(), len(test.keys)) + assert.Equal(t, len(p.Keys()), len(test.keys)) + assert.Equal(t, p.Keys(), test.keys) + } +} + +func TestSet(t *testing.T) { + for _, test := range setTests { + p := mustParse(t, test.input) + prev, ok, err := p.Set(test.key, test.value) + if test.err != "" { + assert.Matches(t, err.Error(), test.err) + continue + } + + assert.Equal(t, err, nil) + assert.Equal(t, ok, test.ok) + if ok { + assert.Equal(t, prev, test.prev) + } + assert.Equal(t, p.Keys(), test.keys) + } +} + +func TestSetValue(t *testing.T) { + tests := []interface{}{ + true, false, + int8(123), int16(123), int32(123), int64(123), int(123), + uint8(123), uint16(123), uint32(123), uint64(123), uint(123), + float32(1.23), float64(1.23), + "abc", + } + + for _, v := range tests { + p := NewProperties() + err := p.SetValue("x", v) + assert.Equal(t, err, nil) + assert.Equal(t, p.GetString("x", ""), fmt.Sprintf("%v", v)) + } +} + +func TestMustSet(t *testing.T) { + input := "key=${key}" + p := mustParse(t, input) + assert.Panic(t, func() { p.MustSet("key", "${key}") }, "circular reference .*") +} + +func TestWrite(t *testing.T) { + for _, test := range writeTests { + p, err := parse(test.input) + + buf := new(bytes.Buffer) + var n int + switch test.encoding { + case "UTF-8": + n, err = p.Write(buf, UTF8) + case "ISO-8859-1": + n, err = p.Write(buf, ISO_8859_1) + } + assert.Equal(t, err, nil) + s := string(buf.Bytes()) + assert.Equal(t, n, len(test.output), fmt.Sprintf("input=%q expected=%q obtained=%q", test.input, test.output, s)) + assert.Equal(t, s, test.output, fmt.Sprintf("input=%q expected=%q obtained=%q", test.input, test.output, s)) + } +} + +func TestWriteComment(t *testing.T) { + for _, test := range writeCommentTests { + p, err := parse(test.input) + + buf := new(bytes.Buffer) + var n int + switch test.encoding { + case "UTF-8": + n, err = p.WriteComment(buf, "# ", UTF8) + case "ISO-8859-1": + n, err = p.WriteComment(buf, "# ", ISO_8859_1) + } + assert.Equal(t, err, nil) + s := string(buf.Bytes()) + assert.Equal(t, n, len(test.output), fmt.Sprintf("input=%q expected=%q obtained=%q", test.input, test.output, s)) + assert.Equal(t, s, test.output, fmt.Sprintf("input=%q expected=%q obtained=%q", test.input, test.output, s)) + } +} + +func TestCustomExpansionExpression(t *testing.T) { + testKeyValuePrePostfix(t, "*[", "]*", "key=value\nkey2=*[key]*", "key", "value", "key2", "value") +} + +func TestPanicOn32BitIntOverflow(t *testing.T) { + is32Bit = true + var min, max int64 = math.MinInt32 - 1, math.MaxInt32 + 1 + input := fmt.Sprintf("min=%d\nmax=%d", min, max) + p := mustParse(t, input) + assert.Equal(t, p.MustGetInt64("min"), min) + assert.Equal(t, p.MustGetInt64("max"), max) + assert.Panic(t, func() { p.MustGetInt("min") }, ".* out of range") + assert.Panic(t, func() { p.MustGetInt("max") }, ".* out of range") +} + +func TestPanicOn32BitUintOverflow(t *testing.T) { + is32Bit = true + var max uint64 = math.MaxUint32 + 1 + input := fmt.Sprintf("max=%d", max) + p := mustParse(t, input) + assert.Equal(t, p.MustGetUint64("max"), max) + assert.Panic(t, func() { p.MustGetUint("max") }, ".* out of range") +} + +func TestDeleteKey(t *testing.T) { + input := "#comments should also be gone\nkey=to-be-deleted\nsecond=key" + p := mustParse(t, input) + assert.Equal(t, len(p.m), 2) + assert.Equal(t, len(p.c), 1) + assert.Equal(t, len(p.k), 2) + p.Delete("key") + assert.Equal(t, len(p.m), 1) + assert.Equal(t, len(p.c), 0) + assert.Equal(t, len(p.k), 1) + assert.Equal(t, p.k[0], "second") + assert.Equal(t, p.m["second"], "key") +} + +func TestDeleteUnknownKey(t *testing.T) { + input := "#comments should also be gone\nkey=to-be-deleted" + p := mustParse(t, input) + assert.Equal(t, len(p.m), 1) + assert.Equal(t, len(p.c), 1) + assert.Equal(t, len(p.k), 1) + p.Delete("wrong-key") + assert.Equal(t, len(p.m), 1) + assert.Equal(t, len(p.c), 1) + assert.Equal(t, len(p.k), 1) +} + +func TestMerge(t *testing.T) { + input1 := "#comment\nkey=value\nkey2=value2" + input2 := "#another comment\nkey=another value\nkey3=value3" + p1 := mustParse(t, input1) + p2 := mustParse(t, input2) + p1.Merge(p2) + assert.Equal(t, len(p1.m), 3) + assert.Equal(t, len(p1.c), 1) + assert.Equal(t, len(p1.k), 3) + assert.Equal(t, p1.MustGet("key"), "another value") + assert.Equal(t, p1.GetComment("key"), "another comment") +} + +func TestMap(t *testing.T) { + input := "key=value\nabc=def" + p := mustParse(t, input) + m := map[string]string{"key": "value", "abc": "def"} + assert.Equal(t, p.Map(), m) +} + +func TestFilterFunc(t *testing.T) { + input := "key=value\nabc=def" + p := mustParse(t, input) + pp := p.FilterFunc(func(k, v string) bool { + return k != "abc" + }) + m := map[string]string{"key": "value"} + assert.Equal(t, pp.Map(), m) +} + +// ---------------------------------------------------------------------------- + +// tests all combinations of delimiters, leading and/or trailing whitespace and newlines. +func testWhitespaceAndDelimiterCombinations(t *testing.T, key, value string) { + whitespace := []string{"", " ", "\f", "\t"} + delimiters := []string{"", " ", "=", ":"} + newlines := []string{"", "\r", "\n", "\r\n"} + for _, dl := range delimiters { + for _, ws1 := range whitespace { + for _, ws2 := range whitespace { + for _, nl := range newlines { + // skip the one case where there is nothing between a key and a value + if ws1 == "" && dl == "" && ws2 == "" && value != "" { + continue + } + + input := fmt.Sprintf("%s%s%s%s%s%s", key, ws1, dl, ws2, value, nl) + testKeyValue(t, input, key, value) + } + } + } + } +} + +// tests whether key/value pairs exist for a given input. +// keyvalues is expected to be an even number of strings of "key", "value", ... +func testKeyValue(t *testing.T, input string, keyvalues ...string) { + testKeyValuePrePostfix(t, "${", "}", input, keyvalues...) +} + +// tests whether key/value pairs exist for a given input. +// keyvalues is expected to be an even number of strings of "key", "value", ... +func testKeyValuePrePostfix(t *testing.T, prefix, postfix, input string, keyvalues ...string) { + p, err := Load([]byte(input), ISO_8859_1) + assert.Equal(t, err, nil) + p.Prefix = prefix + p.Postfix = postfix + assertKeyValues(t, input, p, keyvalues...) +} + +// tests whether key/value pairs exist for a given input. +// keyvalues is expected to be an even number of strings of "key", "value", ... +func assertKeyValues(t *testing.T, input string, p *Properties, keyvalues ...string) { + assert.Equal(t, p != nil, true, "want properties") + assert.Equal(t, 2*p.Len(), len(keyvalues), "Odd number of key/value pairs.") + + for i := 0; i < len(keyvalues); i += 2 { + key, value := keyvalues[i], keyvalues[i+1] + v, ok := p.Get(key) + if !ok { + t.Errorf("No key %q found (input=%q)", key, input) + } + if got, want := v, value; !reflect.DeepEqual(got, want) { + t.Errorf("Value %q does not match %q (input=%q)", v, value, input) + } + } +} + +func mustParse(t *testing.T, s string) *Properties { + p, err := parse(s) + if err != nil { + t.Fatalf("parse failed with %s", err) + } + return p +} + +// prints to stderr if the -verbose flag was given. +func printf(format string, args ...interface{}) { + if *verbose { + fmt.Fprintf(os.Stderr, format, args...) + } +} diff --git a/vendor/github.com/magiconair/properties/rangecheck.go b/vendor/github.com/magiconair/properties/rangecheck.go new file mode 100644 index 0000000000..2e907d540b --- /dev/null +++ b/vendor/github.com/magiconair/properties/rangecheck.go @@ -0,0 +1,31 @@ +// Copyright 2017 Frank Schroeder. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package properties + +import ( + "fmt" + "math" +) + +// make this a var to overwrite it in a test +var is32Bit = ^uint(0) == math.MaxUint32 + +// intRangeCheck checks if the value fits into the int type and +// panics if it does not. +func intRangeCheck(key string, v int64) int { + if is32Bit && (v < math.MinInt32 || v > math.MaxInt32) { + panic(fmt.Sprintf("Value %d for key %s out of range", v, key)) + } + return int(v) +} + +// uintRangeCheck checks if the value fits into the uint type and +// panics if it does not. +func uintRangeCheck(key string, v uint64) uint { + if is32Bit && v > math.MaxUint32 { + panic(fmt.Sprintf("Value %d for key %s out of range", v, key)) + } + return uint(v) +} diff --git a/vendor/github.com/mitchellh/mapstructure/LICENSE b/vendor/github.com/mitchellh/mapstructure/LICENSE new file mode 100644 index 0000000000..f9c841a51e --- /dev/null +++ b/vendor/github.com/mitchellh/mapstructure/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2013 Mitchell Hashimoto + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/github.com/mitchellh/mapstructure/README.md b/vendor/github.com/mitchellh/mapstructure/README.md new file mode 100644 index 0000000000..659d6885fc --- /dev/null +++ b/vendor/github.com/mitchellh/mapstructure/README.md @@ -0,0 +1,46 @@ +# mapstructure + +mapstructure is a Go library for decoding generic map values to structures +and vice versa, while providing helpful error handling. + +This library is most useful when decoding values from some data stream (JSON, +Gob, etc.) where you don't _quite_ know the structure of the underlying data +until you read a part of it. You can therefore read a `map[string]interface{}` +and use this library to decode it into the proper underlying native Go +structure. + +## Installation + +Standard `go get`: + +``` +$ go get github.com/mitchellh/mapstructure +``` + +## Usage & Example + +For usage and examples see the [Godoc](http://godoc.org/github.com/mitchellh/mapstructure). + +The `Decode` function has examples associated with it there. + +## But Why?! + +Go offers fantastic standard libraries for decoding formats such as JSON. +The standard method is to have a struct pre-created, and populate that struct +from the bytes of the encoded format. This is great, but the problem is if +you have configuration or an encoding that changes slightly depending on +specific fields. For example, consider this JSON: + +```json +{ + "type": "person", + "name": "Mitchell" +} +``` + +Perhaps we can't populate a specific structure without first reading +the "type" field from the JSON. We could always do two passes over the +decoding of the JSON (reading the "type" first, and the rest later). +However, it is much simpler to just decode this into a `map[string]interface{}` +structure, read the "type" key, then use something like this library +to decode it into the proper structure. diff --git a/vendor/github.com/mitchellh/mapstructure/decode_hooks.go b/vendor/github.com/mitchellh/mapstructure/decode_hooks.go new file mode 100644 index 0000000000..afcfd5eed6 --- /dev/null +++ b/vendor/github.com/mitchellh/mapstructure/decode_hooks.go @@ -0,0 +1,152 @@ +package mapstructure + +import ( + "errors" + "reflect" + "strconv" + "strings" + "time" +) + +// typedDecodeHook takes a raw DecodeHookFunc (an interface{}) and turns +// it into the proper DecodeHookFunc type, such as DecodeHookFuncType. +func typedDecodeHook(h DecodeHookFunc) DecodeHookFunc { + // Create variables here so we can reference them with the reflect pkg + var f1 DecodeHookFuncType + var f2 DecodeHookFuncKind + + // Fill in the variables into this interface and the rest is done + // automatically using the reflect package. + potential := []interface{}{f1, f2} + + v := reflect.ValueOf(h) + vt := v.Type() + for _, raw := range potential { + pt := reflect.ValueOf(raw).Type() + if vt.ConvertibleTo(pt) { + return v.Convert(pt).Interface() + } + } + + return nil +} + +// DecodeHookExec executes the given decode hook. This should be used +// since it'll naturally degrade to the older backwards compatible DecodeHookFunc +// that took reflect.Kind instead of reflect.Type. +func DecodeHookExec( + raw DecodeHookFunc, + from reflect.Type, to reflect.Type, + data interface{}) (interface{}, error) { + switch f := typedDecodeHook(raw).(type) { + case DecodeHookFuncType: + return f(from, to, data) + case DecodeHookFuncKind: + return f(from.Kind(), to.Kind(), data) + default: + return nil, errors.New("invalid decode hook signature") + } +} + +// ComposeDecodeHookFunc creates a single DecodeHookFunc that +// automatically composes multiple DecodeHookFuncs. +// +// The composed funcs are called in order, with the result of the +// previous transformation. +func ComposeDecodeHookFunc(fs ...DecodeHookFunc) DecodeHookFunc { + return func( + f reflect.Type, + t reflect.Type, + data interface{}) (interface{}, error) { + var err error + for _, f1 := range fs { + data, err = DecodeHookExec(f1, f, t, data) + if err != nil { + return nil, err + } + + // Modify the from kind to be correct with the new data + f = nil + if val := reflect.ValueOf(data); val.IsValid() { + f = val.Type() + } + } + + return data, nil + } +} + +// StringToSliceHookFunc returns a DecodeHookFunc that converts +// string to []string by splitting on the given sep. +func StringToSliceHookFunc(sep string) DecodeHookFunc { + return func( + f reflect.Kind, + t reflect.Kind, + data interface{}) (interface{}, error) { + if f != reflect.String || t != reflect.Slice { + return data, nil + } + + raw := data.(string) + if raw == "" { + return []string{}, nil + } + + return strings.Split(raw, sep), nil + } +} + +// StringToTimeDurationHookFunc returns a DecodeHookFunc that converts +// strings to time.Duration. +func StringToTimeDurationHookFunc() DecodeHookFunc { + return func( + f reflect.Type, + t reflect.Type, + data interface{}) (interface{}, error) { + if f.Kind() != reflect.String { + return data, nil + } + if t != reflect.TypeOf(time.Duration(5)) { + return data, nil + } + + // Convert it by parsing + return time.ParseDuration(data.(string)) + } +} + +// WeaklyTypedHook is a DecodeHookFunc which adds support for weak typing to +// the decoder. +// +// Note that this is significantly different from the WeaklyTypedInput option +// of the DecoderConfig. +func WeaklyTypedHook( + f reflect.Kind, + t reflect.Kind, + data interface{}) (interface{}, error) { + dataVal := reflect.ValueOf(data) + switch t { + case reflect.String: + switch f { + case reflect.Bool: + if dataVal.Bool() { + return "1", nil + } + return "0", nil + case reflect.Float32: + return strconv.FormatFloat(dataVal.Float(), 'f', -1, 64), nil + case reflect.Int: + return strconv.FormatInt(dataVal.Int(), 10), nil + case reflect.Slice: + dataType := dataVal.Type() + elemKind := dataType.Elem().Kind() + if elemKind == reflect.Uint8 { + return string(dataVal.Interface().([]uint8)), nil + } + case reflect.Uint: + return strconv.FormatUint(dataVal.Uint(), 10), nil + } + } + + return data, nil +} diff --git a/vendor/github.com/mitchellh/mapstructure/decode_hooks_test.go b/vendor/github.com/mitchellh/mapstructure/decode_hooks_test.go new file mode 100644 index 0000000000..53289afcfb --- /dev/null +++ b/vendor/github.com/mitchellh/mapstructure/decode_hooks_test.go @@ -0,0 +1,229 @@ +package mapstructure + +import ( + "errors" + "reflect" + "testing" + "time" +) + +func TestComposeDecodeHookFunc(t *testing.T) { + f1 := func( + f reflect.Kind, + t reflect.Kind, + data interface{}) (interface{}, error) { + return data.(string) + "foo", nil + } + + f2 := func( + f reflect.Kind, + t reflect.Kind, + data interface{}) (interface{}, error) { + return data.(string) + "bar", nil + } + + f := ComposeDecodeHookFunc(f1, f2) + + result, err := DecodeHookExec( + f, reflect.TypeOf(""), reflect.TypeOf([]byte("")), "") + if err != nil { + t.Fatalf("bad: %s", err) + } + if result.(string) != "foobar" { + t.Fatalf("bad: %#v", result) + } +} + +func TestComposeDecodeHookFunc_err(t *testing.T) { + f1 := func(reflect.Kind, reflect.Kind, interface{}) (interface{}, error) { + return nil, errors.New("foo") + } + + f2 := func(reflect.Kind, reflect.Kind, interface{}) (interface{}, error) { + panic("NOPE") + } + + f := ComposeDecodeHookFunc(f1, f2) + + _, err := DecodeHookExec( + f, reflect.TypeOf(""), reflect.TypeOf([]byte("")), 42) + if err.Error() != "foo" { + t.Fatalf("bad: %s", err) + } +} + +func TestComposeDecodeHookFunc_kinds(t *testing.T) { + var f2From reflect.Kind + + f1 := func( + f reflect.Kind, + t reflect.Kind, + data interface{}) (interface{}, error) { + return int(42), nil + } + + f2 := func( + f reflect.Kind, + t reflect.Kind, + data interface{}) (interface{}, error) { + f2From = f + return data, nil + } + + f := ComposeDecodeHookFunc(f1, f2) + + _, err := DecodeHookExec( + f, reflect.TypeOf(""), reflect.TypeOf([]byte("")), "") + if err != nil { + t.Fatalf("bad: %s", err) + } + if f2From != reflect.Int { + t.Fatalf("bad: %#v", f2From) + } +} + +func TestStringToSliceHookFunc(t *testing.T) { + f := StringToSliceHookFunc(",") + + strType := reflect.TypeOf("") + sliceType := reflect.TypeOf([]byte("")) + cases := []struct { + f, t reflect.Type + data interface{} + result interface{} + err bool + }{ + {sliceType, sliceType, 42, 42, false}, + {strType, strType, 42, 42, false}, + { + strType, + sliceType, + "foo,bar,baz", + []string{"foo", "bar", "baz"}, + false, + }, + { + strType, + sliceType, + "", + []string{}, + false, + }, + } + + for i, tc := range cases { + actual, err := DecodeHookExec(f, tc.f, tc.t, tc.data) + if tc.err != (err != nil) { + t.Fatalf("case %d: expected err %#v", i, tc.err) + } + if !reflect.DeepEqual(actual, tc.result) { + t.Fatalf( + "case %d: expected %#v, got %#v", + i, tc.result, actual) + } + } +} + +func TestStringToTimeDurationHookFunc(t *testing.T) { + f := StringToTimeDurationHookFunc() + + strType := reflect.TypeOf("") + timeType := reflect.TypeOf(time.Duration(5)) + cases := []struct { + f, t reflect.Type + data interface{} + result interface{} + err bool + }{ + {strType, timeType, "5s", 5 * time.Second, false}, + {strType, timeType, "5", time.Duration(0), true}, + {strType, strType, "5", "5", false}, + } + + for i, tc := range cases { + actual, err := DecodeHookExec(f, tc.f, tc.t, tc.data) + if tc.err != (err != nil) { + t.Fatalf("case %d: expected err %#v", i, tc.err) + } + if !reflect.DeepEqual(actual, tc.result) { + t.Fatalf( + "case %d: expected %#v, got %#v", + i, tc.result, actual) + } + } +} + +func TestWeaklyTypedHook(t *testing.T) { + var f DecodeHookFunc = WeaklyTypedHook + + boolType := reflect.TypeOf(true) + strType := reflect.TypeOf("") + sliceType := reflect.TypeOf([]byte("")) + cases := []struct { + f, t reflect.Type + data interface{} + result interface{} + err bool + }{ + // TO STRING + { + boolType, + strType, + false, + "0", + false, + }, + + { + boolType, + strType, + true, + "1", + false, + }, + + { + reflect.TypeOf(float32(1)), + strType, + float32(7), + "7", + false, + }, + + { + reflect.TypeOf(int(1)), + strType, + int(7), + "7", + false, + }, + + { + sliceType, + strType, + []uint8("foo"), + "foo", + false, + }, + + { + reflect.TypeOf(uint(1)), + strType, + uint(7), + "7", + false, + }, + } + + for i, tc := range cases { + actual, err := DecodeHookExec(f, tc.f, tc.t, tc.data) + if tc.err != (err != nil) { + t.Fatalf("case %d: expected err %#v", i, tc.err) + } + if !reflect.DeepEqual(actual, tc.result) { + t.Fatalf( + "case %d: expected %#v, got %#v", + i, tc.result, actual) + } + } +} diff --git a/vendor/github.com/mitchellh/mapstructure/error.go b/vendor/github.com/mitchellh/mapstructure/error.go new file mode 100644 index 0000000000..47a99e5af3 --- /dev/null +++ b/vendor/github.com/mitchellh/mapstructure/error.go @@ -0,0 +1,50 @@ +package mapstructure + +import ( + "errors" + "fmt" + "sort" + "strings" +) + +// Error implements the error interface and can represents multiple +// errors that occur in the course of a single decode. +type Error struct { + Errors []string +} + +func (e *Error) Error() string { + points := make([]string, len(e.Errors)) + for i, err := range e.Errors { + points[i] = fmt.Sprintf("* %s", err) + } + + sort.Strings(points) + return fmt.Sprintf( + "%d error(s) decoding:\n\n%s", + len(e.Errors), strings.Join(points, "\n")) +} + +// WrappedErrors implements the errwrap.Wrapper interface to make this +// return value more useful with the errwrap and go-multierror libraries. +func (e *Error) WrappedErrors() []error { + if e == nil { + return nil + } + + result := make([]error, len(e.Errors)) + for i, e := range e.Errors { + result[i] = errors.New(e) + } + + return result +} + +func appendErrors(errors []string, err error) []string { + switch e := err.(type) { + case *Error: + return append(errors, e.Errors...) + default: + return append(errors, e.Error()) + } +} diff --git a/vendor/github.com/mitchellh/mapstructure/mapstructure.go b/vendor/github.com/mitchellh/mapstructure/mapstructure.go new file mode 100644 index 0000000000..30a9957c65 --- /dev/null +++ b/vendor/github.com/mitchellh/mapstructure/mapstructure.go @@ -0,0 +1,834 @@ +// Package mapstructure exposes functionality to convert an arbitrary +// map[string]interface{} into a native Go structure. +// +// The Go structure can be arbitrarily complex, containing slices, +// other structs, etc. and the decoder will properly decode nested +// maps and so on into the proper structures in the native Go struct. +// See the examples to see what the decoder is capable of. +package mapstructure + +import ( + "encoding/json" + "errors" + "fmt" + "reflect" + "sort" + "strconv" + "strings" +) + +// DecodeHookFunc is the callback function that can be used for +// data transformations. See "DecodeHook" in the DecoderConfig +// struct. +// +// The type should be DecodeHookFuncType or DecodeHookFuncKind. +// Either is accepted. Types are a superset of Kinds (Types can return +// Kinds) and are generally a richer thing to use, but Kinds are simpler +// if you only need those. +// +// The reason DecodeHookFunc is multi-typed is for backwards compatibility: +// we started with Kinds and then realized Types were the better solution, +// but have a promise to not break backwards compat so we now support +// both. +type DecodeHookFunc interface{} + +// DecodeHookFuncType is a DecodeHookFunc which has complete information about +// the source and target types. +type DecodeHookFuncType func(reflect.Type, reflect.Type, interface{}) (interface{}, error) + +// DecodeHookFuncKind is a DecodeHookFunc which knows only the Kinds of the +// source and target types. +type DecodeHookFuncKind func(reflect.Kind, reflect.Kind, interface{}) (interface{}, error) + +// DecoderConfig is the configuration that is used to create a new decoder +// and allows customization of various aspects of decoding. +type DecoderConfig struct { + // DecodeHook, if set, will be called before any decoding and any + // type conversion (if WeaklyTypedInput is on). This lets you modify + // the values before they're set down onto the resulting struct. + // + // If an error is returned, the entire decode will fail with that + // error. + DecodeHook DecodeHookFunc + + // If ErrorUnused is true, then it is an error for there to exist + // keys in the original map that were unused in the decoding process + // (extra keys). + ErrorUnused bool + + // ZeroFields, if set to true, will zero fields before writing them. + // For example, a map will be emptied before decoded values are put in + // it. If this is false, a map will be merged. + ZeroFields bool + + // If WeaklyTypedInput is true, the decoder will make the following + // "weak" conversions: + // + // - bools to string (true = "1", false = "0") + // - numbers to string (base 10) + // - bools to int/uint (true = 1, false = 0) + // - strings to int/uint (base implied by prefix) + // - int to bool (true if value != 0) + // - string to bool (accepts: 1, t, T, TRUE, true, True, 0, f, F, + // FALSE, false, False. Anything else is an error) + // - empty array = empty map and vice versa + // - negative numbers to overflowed uint values (base 10) + // - slice of maps to a merged map + // - single values are converted to slices if required. Each + // element is weakly decoded. For example: "4" can become []int{4} + // if the target type is an int slice. + // + WeaklyTypedInput bool + + // Metadata is the struct that will contain extra metadata about + // the decoding. If this is nil, then no metadata will be tracked. + Metadata *Metadata + + // Result is a pointer to the struct that will contain the decoded + // value. + Result interface{} + + // The tag name that mapstructure reads for field names. This + // defaults to "mapstructure" + TagName string +} + +// A Decoder takes a raw interface value and turns it into structured +// data, keeping track of rich error information along the way in case +// anything goes wrong. Unlike the basic top-level Decode method, you can +// more finely control how the Decoder behaves using the DecoderConfig +// structure. The top-level Decode method is just a convenience that sets +// up the most basic Decoder. +type Decoder struct { + config *DecoderConfig +} + +// Metadata contains information about decoding a structure that +// is tedious or difficult to get otherwise. +type Metadata struct { + // Keys are the keys of the structure which were successfully decoded + Keys []string + + // Unused is a slice of keys that were found in the raw value but + // weren't decoded since there was no matching field in the result interface + Unused []string +} + +// Decode takes a map and uses reflection to convert it into the +// given Go native structure. val must be a pointer to a struct. +func Decode(m interface{}, rawVal interface{}) error { + config := &DecoderConfig{ + Metadata: nil, + Result: rawVal, + } + + decoder, err := NewDecoder(config) + if err != nil { + return err + } + + return decoder.Decode(m) +} + +// WeakDecode is the same as Decode but is shorthand to enable +// WeaklyTypedInput. See DecoderConfig for more info. +func WeakDecode(input, output interface{}) error { + config := &DecoderConfig{ + Metadata: nil, + Result: output, + WeaklyTypedInput: true, + } + + decoder, err := NewDecoder(config) + if err != nil { + return err + } + + return decoder.Decode(input) +} + +// NewDecoder returns a new decoder for the given configuration. Once +// a decoder has been returned, the same configuration must not be used +// again. +func NewDecoder(config *DecoderConfig) (*Decoder, error) { + val := reflect.ValueOf(config.Result) + if val.Kind() != reflect.Ptr { + return nil, errors.New("result must be a pointer") + } + + val = val.Elem() + if !val.CanAddr() { + return nil, errors.New("result must be addressable (a pointer)") + } + + if config.Metadata != nil { + if config.Metadata.Keys == nil { + config.Metadata.Keys = make([]string, 0) + } + + if config.Metadata.Unused == nil { + config.Metadata.Unused = make([]string, 0) + } + } + + if config.TagName == "" { + config.TagName = "mapstructure" + } + + result := &Decoder{ + config: config, + } + + return result, nil +} + +// Decode decodes the given raw interface to the target pointer specified +// by the configuration. +func (d *Decoder) Decode(raw interface{}) error { + return d.decode("", raw, reflect.ValueOf(d.config.Result).Elem()) +} + +// Decodes an unknown data type into a specific reflection value. +func (d *Decoder) decode(name string, data interface{}, val reflect.Value) error { + if data == nil { + // If the data is nil, then we don't set anything. + return nil + } + + dataVal := reflect.ValueOf(data) + if !dataVal.IsValid() { + // If the data value is invalid, then we just set the value + // to be the zero value. + val.Set(reflect.Zero(val.Type())) + return nil + } + + if d.config.DecodeHook != nil { + // We have a DecodeHook, so let's pre-process the data. + var err error + data, err = DecodeHookExec( + d.config.DecodeHook, + dataVal.Type(), val.Type(), data) + if err != nil { + return fmt.Errorf("error decoding '%s': %s", name, err) + } + } + + var err error + dataKind := getKind(val) + switch dataKind { + case reflect.Bool: + err = d.decodeBool(name, data, val) + case reflect.Interface: + err = d.decodeBasic(name, data, val) + case reflect.String: + err = d.decodeString(name, data, val) + case reflect.Int: + err = d.decodeInt(name, data, val) + case reflect.Uint: + err = d.decodeUint(name, data, val) + case reflect.Float32: + err = d.decodeFloat(name, data, val) + case reflect.Struct: + err = d.decodeStruct(name, data, val) + case reflect.Map: + err = d.decodeMap(name, data, val) + case reflect.Ptr: + err = d.decodePtr(name, data, val) + case reflect.Slice: + err = d.decodeSlice(name, data, val) + case reflect.Func: + err = d.decodeFunc(name, data, val) + default: + // If we reached this point then we weren't able to decode it + return fmt.Errorf("%s: unsupported type: %s", name, dataKind) + } + + // If we reached here, then we successfully decoded SOMETHING, so + // mark the key as used if we're tracking metadata. + if d.config.Metadata != nil && name != "" { + d.config.Metadata.Keys = append(d.config.Metadata.Keys, name) + } + + return err +} + +// This decodes a basic type (bool, int, string, etc.) and sets the +// value to "data" of that type. +func (d *Decoder) decodeBasic(name string, data interface{}, val reflect.Value) error { + dataVal := reflect.ValueOf(data) + if !dataVal.IsValid() { + dataVal = reflect.Zero(val.Type()) + } + + dataValType := dataVal.Type() + if !dataValType.AssignableTo(val.Type()) { + return fmt.Errorf( + "'%s' expected type '%s', got '%s'", + name, val.Type(), dataValType) + } + + val.Set(dataVal) + return nil +} + +func (d *Decoder) decodeString(name string, data interface{}, val reflect.Value) error { + dataVal := reflect.ValueOf(data) + dataKind := getKind(dataVal) + + converted := true + switch { + case dataKind == reflect.String: + val.SetString(dataVal.String()) + case dataKind == reflect.Bool && d.config.WeaklyTypedInput: + if dataVal.Bool() { + val.SetString("1") + } else { + val.SetString("0") + } + case dataKind == reflect.Int && d.config.WeaklyTypedInput: + val.SetString(strconv.FormatInt(dataVal.Int(), 10)) + case dataKind == reflect.Uint && d.config.WeaklyTypedInput: + val.SetString(strconv.FormatUint(dataVal.Uint(), 10)) + case dataKind == reflect.Float32 && d.config.WeaklyTypedInput: + val.SetString(strconv.FormatFloat(dataVal.Float(), 'f', -1, 64)) + case dataKind == reflect.Slice && d.config.WeaklyTypedInput: + dataType := dataVal.Type() + elemKind := dataType.Elem().Kind() + switch { + case elemKind == reflect.Uint8: + val.SetString(string(dataVal.Interface().([]uint8))) + default: + converted = false + } + default: + converted = false + } + + if !converted { + return fmt.Errorf( + "'%s' expected type '%s', got unconvertible type '%s'", + name, val.Type(), dataVal.Type()) + } + + return nil +} + +func (d *Decoder) decodeInt(name string, data interface{}, val reflect.Value) error { + dataVal := reflect.ValueOf(data) + dataKind := getKind(dataVal) + dataType := dataVal.Type() + + switch { + case dataKind == reflect.Int: + val.SetInt(dataVal.Int()) + case dataKind == reflect.Uint: + val.SetInt(int64(dataVal.Uint())) + case dataKind == reflect.Float32: + val.SetInt(int64(dataVal.Float())) + case dataKind == reflect.Bool && d.config.WeaklyTypedInput: + if dataVal.Bool() { + val.SetInt(1) + } else { + val.SetInt(0) + } + case dataKind == reflect.String && d.config.WeaklyTypedInput: + i, err := strconv.ParseInt(dataVal.String(), 0, val.Type().Bits()) + if err == nil { + val.SetInt(i) + } else { + return fmt.Errorf("cannot parse '%s' as int: %s", name, err) + } + case dataType.PkgPath() == "encoding/json" && dataType.Name() == "Number": + jn := data.(json.Number) + i, err := jn.Int64() + if err != nil { + return fmt.Errorf( + "error decoding json.Number into %s: %s", name, err) + } + val.SetInt(i) + default: + return fmt.Errorf( + "'%s' expected type '%s', got unconvertible type '%s'", + name, val.Type(), dataVal.Type()) + } + + return nil +} + +func (d *Decoder) decodeUint(name string, data interface{}, val reflect.Value) error { + dataVal := reflect.ValueOf(data) + dataKind := getKind(dataVal) + + switch { + case dataKind == reflect.Int: + i := dataVal.Int() + if i < 0 && !d.config.WeaklyTypedInput { + return fmt.Errorf("cannot parse '%s', %d overflows uint", + name, i) + } + val.SetUint(uint64(i)) + case dataKind == reflect.Uint: + val.SetUint(dataVal.Uint()) + case dataKind == reflect.Float32: + f := dataVal.Float() + if f < 0 && !d.config.WeaklyTypedInput { + return fmt.Errorf("cannot parse '%s', %f overflows uint", + name, f) + } + val.SetUint(uint64(f)) + case dataKind == reflect.Bool && d.config.WeaklyTypedInput: + if dataVal.Bool() { + val.SetUint(1) + } else { + val.SetUint(0) + } + case dataKind == reflect.String && d.config.WeaklyTypedInput: + i, err := strconv.ParseUint(dataVal.String(), 0, val.Type().Bits()) + if err == nil { + val.SetUint(i) + } else { + return fmt.Errorf("cannot parse '%s' as uint: %s", name, err) + } + default: + return fmt.Errorf( + "'%s' expected type '%s', got unconvertible type '%s'", + name, val.Type(), dataVal.Type()) + } + + return nil +} + +func (d *Decoder) decodeBool(name string, data interface{}, val reflect.Value) error { + dataVal := reflect.ValueOf(data) + dataKind := getKind(dataVal) + + switch { + case dataKind == reflect.Bool: + val.SetBool(dataVal.Bool()) + case dataKind == reflect.Int && d.config.WeaklyTypedInput: + val.SetBool(dataVal.Int() != 0) + case dataKind == reflect.Uint && d.config.WeaklyTypedInput: + val.SetBool(dataVal.Uint() != 0) + case dataKind == reflect.Float32 && d.config.WeaklyTypedInput: + val.SetBool(dataVal.Float() != 0) + case dataKind == reflect.String && d.config.WeaklyTypedInput: + b, err := strconv.ParseBool(dataVal.String()) + if err == nil { + val.SetBool(b) + } else if dataVal.String() == "" { + val.SetBool(false) + } else { + return fmt.Errorf("cannot parse '%s' as bool: %s", name, err) + } + default: + return fmt.Errorf( + "'%s' expected type '%s', got unconvertible type '%s'", + name, val.Type(), dataVal.Type()) + } + + return nil +} + +func (d *Decoder) decodeFloat(name string, data interface{}, val reflect.Value) error { + dataVal := reflect.ValueOf(data) + dataKind := getKind(dataVal) + dataType := dataVal.Type() + + switch { + case dataKind == reflect.Int: + val.SetFloat(float64(dataVal.Int())) + case dataKind == reflect.Uint: + val.SetFloat(float64(dataVal.Uint())) + case dataKind == reflect.Float32: + val.SetFloat(dataVal.Float()) + case dataKind == reflect.Bool && d.config.WeaklyTypedInput: + if dataVal.Bool() { + val.SetFloat(1) + } else { + val.SetFloat(0) + } + case dataKind == reflect.String && d.config.WeaklyTypedInput: + f, err := strconv.ParseFloat(dataVal.String(), val.Type().Bits()) + if err == nil { + val.SetFloat(f) + } else { + return fmt.Errorf("cannot parse '%s' as float: %s", name, err) + } + case dataType.PkgPath() == "encoding/json" && dataType.Name() == "Number": + jn := data.(json.Number) + i, err := jn.Float64() + if err != nil { + return fmt.Errorf( + "error decoding json.Number into %s: %s", name, err) + } + val.SetFloat(i) + default: + return fmt.Errorf( + "'%s' expected type '%s', got unconvertible type '%s'", + name, val.Type(), dataVal.Type()) + } + + return nil +} + +func (d *Decoder) decodeMap(name string, data interface{}, val reflect.Value) error { + valType := val.Type() + valKeyType := valType.Key() + valElemType := valType.Elem() + + // By default we overwrite keys in the current map + valMap := val + + // If the map is nil or we're purposely zeroing fields, make a new map + if valMap.IsNil() || d.config.ZeroFields { + // Make a new map to hold our result + mapType := reflect.MapOf(valKeyType, valElemType) + valMap = reflect.MakeMap(mapType) + } + + // Check input type + dataVal := reflect.Indirect(reflect.ValueOf(data)) + if dataVal.Kind() != reflect.Map { + // In weak mode, we accept a slice of maps as an input... + if d.config.WeaklyTypedInput { + switch dataVal.Kind() { + case reflect.Array, reflect.Slice: + // Special case for BC reasons (covered by tests) + if dataVal.Len() == 0 { + val.Set(valMap) + return nil + } + + for i := 0; i < dataVal.Len(); i++ { + err := d.decode( + fmt.Sprintf("%s[%d]", name, i), + dataVal.Index(i).Interface(), val) + if err != nil { + return err + } + } + + return nil + } + } + + return fmt.Errorf("'%s' expected a map, got '%s'", name, dataVal.Kind()) + } + + // Accumulate errors + errors := make([]string, 0) + + for _, k := range dataVal.MapKeys() { + fieldName := fmt.Sprintf("%s[%s]", name, k) + + // First decode the key into the proper type + currentKey := reflect.Indirect(reflect.New(valKeyType)) + if err := d.decode(fieldName, k.Interface(), currentKey); err != nil { + errors = appendErrors(errors, err) + continue + } + + // Next decode the data into the proper type + v := dataVal.MapIndex(k).Interface() + currentVal := reflect.Indirect(reflect.New(valElemType)) + if err := d.decode(fieldName, v, currentVal); err != nil { + errors = appendErrors(errors, err) + continue + } + + valMap.SetMapIndex(currentKey, currentVal) + } + + // Set the built up map to the value + val.Set(valMap) + + // If we had errors, return those + if len(errors) > 0 { + return &Error{errors} + } + + return nil +} + +func (d *Decoder) decodePtr(name string, data interface{}, val reflect.Value) error { + // Create an element of the concrete (non pointer) type and decode + // into that. Then set the value of the pointer to this type. + valType := val.Type() + valElemType := valType.Elem() + + realVal := val + if realVal.IsNil() || d.config.ZeroFields { + realVal = reflect.New(valElemType) + } + + if err := d.decode(name, data, reflect.Indirect(realVal)); err != nil { + return err + } + + val.Set(realVal) + return nil +} + +func (d *Decoder) decodeFunc(name string, data interface{}, val reflect.Value) error { + // Create an element of the concrete (non pointer) type and decode + // into that. Then set the value of the pointer to this type. + dataVal := reflect.Indirect(reflect.ValueOf(data)) + if val.Type() != dataVal.Type() { + return fmt.Errorf( + "'%s' expected type '%s', got unconvertible type '%s'", + name, val.Type(), dataVal.Type()) + } + val.Set(dataVal) + return nil +} + +func (d *Decoder) decodeSlice(name string, data interface{}, val reflect.Value) error { + dataVal := reflect.Indirect(reflect.ValueOf(data)) + dataValKind := dataVal.Kind() + valType := val.Type() + valElemType := valType.Elem() + sliceType := reflect.SliceOf(valElemType) + + valSlice := val + if valSlice.IsNil() || d.config.ZeroFields { + // Check input type + if dataValKind != reflect.Array && dataValKind != reflect.Slice { + if d.config.WeaklyTypedInput { + switch { + // Empty maps turn into empty slices + case dataValKind == reflect.Map: + if dataVal.Len() == 0 { + val.Set(reflect.MakeSlice(sliceType, 0, 0)) + return nil + } + + // All other types we try to convert to the slice type + // and "lift" it into it. i.e. a string becomes a string slice. + default: + // Just re-try this function with data as a slice. + return d.decodeSlice(name, []interface{}{data}, val) + } + } + + return fmt.Errorf( + "'%s': source data must be an array or slice, got %s", name, dataValKind) + + } + + // Make a new slice to hold our result, same size as the original data. + valSlice = reflect.MakeSlice(sliceType, dataVal.Len(), dataVal.Len()) + } + + // Accumulate any errors + errors := make([]string, 0) + + for i := 0; i < dataVal.Len(); i++ { + currentData := dataVal.Index(i).Interface() + for valSlice.Len() <= i { + valSlice = reflect.Append(valSlice, reflect.Zero(valElemType)) + } + currentField := valSlice.Index(i) + + fieldName := fmt.Sprintf("%s[%d]", name, i) + if err := d.decode(fieldName, currentData, currentField); err != nil { + errors = appendErrors(errors, err) + } + } + + // Finally, set the value to the slice we built up + val.Set(valSlice) + + // If there were errors, we return those + if len(errors) > 0 { + return &Error{errors} + } + + return nil +} + +func (d *Decoder) decodeStruct(name string, data interface{}, val reflect.Value) error { + dataVal := reflect.Indirect(reflect.ValueOf(data)) + + // If the type of the value to write to and the data match directly, + // then we just set it directly instead of recursing into the structure. + if dataVal.Type() == val.Type() { + val.Set(dataVal) + return nil + } + + dataValKind := dataVal.Kind() + if dataValKind != reflect.Map { + return fmt.Errorf("'%s' expected a map, got '%s'", name, dataValKind) + } + + dataValType := dataVal.Type() + if kind := dataValType.Key().Kind(); kind != reflect.String && kind != reflect.Interface { + return fmt.Errorf( + "'%s' needs a map with string keys, has '%s' keys", + name, dataValType.Key().Kind()) + } + + dataValKeys := make(map[reflect.Value]struct{}) + dataValKeysUnused := make(map[interface{}]struct{}) + for _, dataValKey := range dataVal.MapKeys() { + dataValKeys[dataValKey] = struct{}{} + dataValKeysUnused[dataValKey.Interface()] = struct{}{} + } + + errors := make([]string, 0) + + // This slice will keep track of all the structs we'll be decoding. + // There can be more than one struct if there are embedded structs + // that are squashed. + structs := make([]reflect.Value, 1, 5) + structs[0] = val + + // Compile the list of all the fields that we're going to be decoding + // from all the structs. + type field struct { + field reflect.StructField + val reflect.Value + } + fields := []field{} + for len(structs) > 0 { + structVal := structs[0] + structs = structs[1:] + + structType := structVal.Type() + + for i := 0; i < structType.NumField(); i++ { + fieldType := structType.Field(i) + fieldKind := fieldType.Type.Kind() + + // If "squash" is specified in the tag, we squash the field down. + squash := false + tagParts := strings.Split(fieldType.Tag.Get(d.config.TagName), ",") + for _, tag := range tagParts[1:] { + if tag == "squash" { + squash = true + break + } + } + + if squash { + if fieldKind != reflect.Struct { + errors = appendErrors(errors, + fmt.Errorf("%s: unsupported type for squash: %s", fieldType.Name, fieldKind)) + } else { + structs = append(structs, val.FieldByName(fieldType.Name)) + } + continue + } + + // Normal struct field, store it away + fields = append(fields, field{fieldType, structVal.Field(i)}) + } + } + + // for fieldType, field := range fields { + for _, f := range fields { + field, fieldValue := f.field, f.val + fieldName := field.Name + + tagValue := field.Tag.Get(d.config.TagName) + tagValue = strings.SplitN(tagValue, ",", 2)[0] + if tagValue != "" { + fieldName = tagValue + } + + rawMapKey := reflect.ValueOf(fieldName) + rawMapVal := dataVal.MapIndex(rawMapKey) + if !rawMapVal.IsValid() { + // Do a slower search by iterating over each key and + // doing case-insensitive search. + for dataValKey := range dataValKeys { + mK, ok := dataValKey.Interface().(string) + if !ok { + // Not a string key + continue + } + + if strings.EqualFold(mK, fieldName) { + rawMapKey = dataValKey + rawMapVal = dataVal.MapIndex(dataValKey) + break + } + } + + if !rawMapVal.IsValid() { + // There was no matching key in the map for the value in + // the struct. Just ignore. + continue + } + } + + // Delete the key we're using from the unused map so we stop tracking + delete(dataValKeysUnused, rawMapKey.Interface()) + + if !fieldValue.IsValid() { + // This should never happen + panic("field is not valid") + } + + // If we can't set the field, then it is unexported or something, + // and we just continue onwards. + if !fieldValue.CanSet() { + continue + } + + // If the name is empty string, then we're at the root, and we + // don't dot-join the fields. + if name != "" { + fieldName = fmt.Sprintf("%s.%s", name, fieldName) + } + + if err := d.decode(fieldName, rawMapVal.Interface(), fieldValue); err != nil { + errors = appendErrors(errors, err) + } + } + + if d.config.ErrorUnused && len(dataValKeysUnused) > 0 { + keys := make([]string, 0, len(dataValKeysUnused)) + for rawKey := range dataValKeysUnused { + keys = append(keys, rawKey.(string)) + } + sort.Strings(keys) + + err := fmt.Errorf("'%s' has invalid keys: %s", name, strings.Join(keys, ", ")) + errors = appendErrors(errors, err) + } + + if len(errors) > 0 { + return &Error{errors} + } + + // Add the unused keys to the list of unused keys if we're tracking metadata + if d.config.Metadata != nil { + for rawKey := range dataValKeysUnused { + key := rawKey.(string) + if name != "" { + key = fmt.Sprintf("%s.%s", name, key) + } + + d.config.Metadata.Unused = append(d.config.Metadata.Unused, key) + } + } + + return nil +} + +func getKind(val reflect.Value) reflect.Kind { + kind := val.Kind() + + switch { + case kind >= reflect.Int && kind <= reflect.Int64: + return reflect.Int + case kind >= reflect.Uint && kind <= reflect.Uint64: + return reflect.Uint + case kind >= reflect.Float32 && kind <= reflect.Float64: + return reflect.Float32 + default: + return kind + } +} diff --git a/vendor/github.com/mitchellh/mapstructure/mapstructure_benchmark_test.go b/vendor/github.com/mitchellh/mapstructure/mapstructure_benchmark_test.go new file mode 100644 index 0000000000..41d2a41f75 --- /dev/null +++ b/vendor/github.com/mitchellh/mapstructure/mapstructure_benchmark_test.go @@ -0,0 +1,279 @@ +package mapstructure + +import ( + "encoding/json" + "testing" +) + +func Benchmark_Decode(b *testing.B) { + type Person struct { + Name string + Age int + Emails []string + Extra map[string]string + } + + input := map[string]interface{}{ + "name": "Mitchell", + "age": 91, + "emails": []string{"one", "two", "three"}, + "extra": map[string]string{ + "twitter": "mitchellh", + }, + } + + var result Person + for i := 0; i < b.N; i++ { + Decode(input, &result) + } +} + +// decodeViaJSON takes the map data and passes it through encoding/json to convert it into the +// given Go native structure pointed to by v. v must be a pointer to a struct. +func decodeViaJSON(data interface{}, v interface{}) error { + // Perform the task by simply marshalling the input into JSON, + // then unmarshalling it into target native Go struct. + b, err := json.Marshal(data) + if err != nil { + return err + } + return json.Unmarshal(b, v) +} + +func Benchmark_DecodeViaJSON(b *testing.B) { + type Person struct { + Name string + Age int + Emails []string + Extra map[string]string + } + + input := map[string]interface{}{ + "name": "Mitchell", + "age": 91, + "emails": []string{"one", "two", "three"}, + "extra": map[string]string{ + "twitter": "mitchellh", + }, + } + + var result Person + for i := 0; i < b.N; i++ { + decodeViaJSON(input, &result) + } +} + +func Benchmark_DecodeBasic(b *testing.B) { + input := map[string]interface{}{ + "vstring": "foo", + "vint": 42, + "Vuint": 42, + "vbool": true, + "Vfloat": 42.42, + "vsilent": true, + "vdata": 42, + } + + var result Basic + for i := 0; i < b.N; i++ { + Decode(input, &result) + } +} + +func Benchmark_DecodeEmbedded(b *testing.B) { + input := map[string]interface{}{ + "vstring": "foo", + "Basic": map[string]interface{}{ + "vstring": "innerfoo", + }, + "vunique": "bar", + } + + var result Embedded + for i := 0; i < b.N; i++ { + Decode(input, &result) + } +} + +func Benchmark_DecodeTypeConversion(b *testing.B) { + input := map[string]interface{}{ + "IntToFloat": 42, + "IntToUint": 42, + "IntToBool": 1, + "IntToString": 42, + "UintToInt": 42, + "UintToFloat": 42, + "UintToBool": 42, + "UintToString": 42, + "BoolToInt": true, + "BoolToUint": true, + "BoolToFloat": true, + "BoolToString": true, + "FloatToInt": 42.42, + "FloatToUint": 42.42, + "FloatToBool": 42.42, + "FloatToString": 42.42, + "StringToInt": "42", + "StringToUint": "42", + "StringToBool": "1", + "StringToFloat": "42.42", + "SliceToMap": []interface{}{}, + "MapToSlice": map[string]interface{}{}, + } + + var resultStrict TypeConversionResult + for i := 0; i < b.N; i++ { + Decode(input, &resultStrict) + } +} + +func Benchmark_DecodeMap(b *testing.B) { + input := map[string]interface{}{ + "vfoo": "foo", + "vother": map[interface{}]interface{}{ + "foo": "foo", + "bar": "bar", + }, + } + + var result Map + for i := 0; i < b.N; i++ { + Decode(input, &result) + } +} + +func Benchmark_DecodeMapOfStruct(b *testing.B) { + input := map[string]interface{}{ + "value": map[string]interface{}{ + "foo": map[string]string{"vstring": "one"}, + "bar": map[string]string{"vstring": "two"}, + }, + } + + var result MapOfStruct + for i := 0; i < b.N; i++ { + Decode(input, &result) + } +} + +func Benchmark_DecodeSlice(b *testing.B) { + input := map[string]interface{}{ + "vfoo": "foo", + "vbar": []string{"foo", "bar", "baz"}, + } + + var result Slice + for i := 0; i < b.N; i++ { + Decode(input, &result) + } +} + +func Benchmark_DecodeSliceOfStruct(b *testing.B) { + input := map[string]interface{}{ + "value": []map[string]interface{}{ + {"vstring": "one"}, + {"vstring": "two"}, + }, + } + + var result SliceOfStruct + for i := 0; i < b.N; i++ { + Decode(input, &result) + } +} + +func Benchmark_DecodeWeaklyTypedInput(b *testing.B) { + type Person struct { + Name string + Age int + Emails []string + } + + // This input can come from anywhere, but typically comes from + // something like decoding JSON, generated by a weakly typed language + // such as PHP. + input := map[string]interface{}{ + "name": 123, // number => string + "age": "42", // string => number + "emails": map[string]interface{}{}, // empty map => empty array + } + + var result Person + config := &DecoderConfig{ + WeaklyTypedInput: true, + Result: &result, + } + + decoder, err := NewDecoder(config) + if err != nil { + panic(err) + } + + for i := 0; i < b.N; i++ { + decoder.Decode(input) + } +} + +func Benchmark_DecodeMetadata(b *testing.B) { + type Person struct { + Name string + Age int + } + + input := map[string]interface{}{ + "name": "Mitchell", + "age": 91, + "email": "foo@bar.com", + } + + var md Metadata + var result Person + config := &DecoderConfig{ + Metadata: &md, + Result: &result, + } + + decoder, err := NewDecoder(config) + if err != nil { + panic(err) + } + + for i := 0; i < b.N; i++ { + decoder.Decode(input) + } +} + +func Benchmark_DecodeMetadataEmbedded(b *testing.B) { + input := map[string]interface{}{ + "vstring": "foo", + "vunique": "bar", + } + + var md Metadata + var result EmbeddedSquash + config := &DecoderConfig{ + Metadata: &md, + Result: &result, + } + + decoder, err := NewDecoder(config) + if err != nil { + b.Fatalf("err: %s", err) + } + + for i := 0; i < b.N; i++ { + decoder.Decode(input) + } +} + +func Benchmark_DecodeTagged(b *testing.B) { + input := map[string]interface{}{ + "foo": "bar", + "bar": "value", + } + + var result Tagged + for i := 0; i < b.N; i++ { + Decode(input, &result) + } +} diff --git a/vendor/github.com/mitchellh/mapstructure/mapstructure_bugs_test.go b/vendor/github.com/mitchellh/mapstructure/mapstructure_bugs_test.go new file mode 100644 index 0000000000..08e495664f --- /dev/null +++ b/vendor/github.com/mitchellh/mapstructure/mapstructure_bugs_test.go @@ -0,0 +1,260 @@ +package mapstructure + +import "testing" + +// GH-1 +func TestDecode_NilValue(t *testing.T) { + input := map[string]interface{}{ + "vfoo": nil, + "vother": nil, + } + + var result Map + err := Decode(input, &result) + if err != nil { + t.Fatalf("should not error: %s", err) + } + + if result.Vfoo != "" { + t.Fatalf("value should be default: %s", result.Vfoo) + } + + if result.Vother != nil { + t.Fatalf("Vother should be nil: %s", result.Vother) + } +} + +// GH-10 +func TestDecode_mapInterfaceInterface(t *testing.T) { + input := map[interface{}]interface{}{ + "vfoo": nil, + "vother": nil, + } + + var result Map + err := Decode(input, &result) + if err != nil { + t.Fatalf("should not error: %s", err) + } + + if result.Vfoo != "" { + t.Fatalf("value should be default: %s", result.Vfoo) + } + + if result.Vother != nil { + t.Fatalf("Vother should be nil: %s", result.Vother) + } +} + +// #48 +func TestNestedTypePointerWithDefaults(t *testing.T) { + t.Parallel() + + input := map[string]interface{}{ + "vfoo": "foo", + "vbar": map[string]interface{}{ + "vstring": "foo", + "vint": 42, + "vbool": true, + }, + } + + result := NestedPointer{ + Vbar: &Basic{ + Vuint: 42, + }, + } + err := Decode(input, &result) + if err != nil { + t.Fatalf("got an err: %s", err.Error()) + } + + if result.Vfoo != "foo" { + t.Errorf("vfoo value should be 'foo': %#v", result.Vfoo) + } + + if result.Vbar.Vstring != "foo" { + t.Errorf("vstring value should be 'foo': %#v", result.Vbar.Vstring) + } + + if result.Vbar.Vint != 42 { + t.Errorf("vint value should be 42: %#v", result.Vbar.Vint) + } + + if result.Vbar.Vbool != true { + t.Errorf("vbool value should be true: %#v", result.Vbar.Vbool) + } + + if result.Vbar.Vextra != "" { + t.Errorf("vextra value should be empty: %#v", result.Vbar.Vextra) + } + + // this is the error + if result.Vbar.Vuint != 42 { + t.Errorf("vuint value should be 42: %#v", result.Vbar.Vuint) + } + +} + +type NestedSlice struct { + Vfoo string + Vbars []Basic + Vempty []Basic +} + +// #48 +func TestNestedTypeSliceWithDefaults(t *testing.T) { + t.Parallel() + + input := map[string]interface{}{ + "vfoo": "foo", + "vbars": []map[string]interface{}{ + {"vstring": "foo", "vint": 42, "vbool": true}, + {"vint": 42, "vbool": true}, + }, + "vempty": []map[string]interface{}{ + {"vstring": "foo", "vint": 42, "vbool": true}, + {"vint": 42, "vbool": true}, + }, + } + + result := NestedSlice{ + Vbars: []Basic{ + {Vuint: 42}, + {Vstring: "foo"}, + }, + } + err := Decode(input, &result) + if err != nil { + t.Fatalf("got an err: %s", err.Error()) + } + + if result.Vfoo != "foo" { + t.Errorf("vfoo value should be 'foo': %#v", result.Vfoo) + } + + if result.Vbars[0].Vstring != "foo" { + t.Errorf("vstring value should be 'foo': %#v", result.Vbars[0].Vstring) + } + // this is the error + if result.Vbars[0].Vuint != 42 { + t.Errorf("vuint value should be 42: %#v", result.Vbars[0].Vuint) + } +} + +// #48 workaround +func TestNestedTypeWithDefaults(t *testing.T) { + t.Parallel() + + input := map[string]interface{}{ + "vfoo": "foo", + "vbar": map[string]interface{}{ + "vstring": "foo", + "vint": 42, + "vbool": true, + }, + } + + result := Nested{ + Vbar: Basic{ + Vuint: 42, + }, + } + err := Decode(input, &result) + if err != nil { + t.Fatalf("got an err: %s", err.Error()) + } + + if result.Vfoo != "foo" { + t.Errorf("vfoo value should be 'foo': %#v", result.Vfoo) + } + + if result.Vbar.Vstring != "foo" { + t.Errorf("vstring value should be 'foo': %#v", result.Vbar.Vstring) + } + + if result.Vbar.Vint != 42 { + t.Errorf("vint value should be 42: %#v", result.Vbar.Vint) + } + + if result.Vbar.Vbool != true { + t.Errorf("vbool value should be true: %#v", result.Vbar.Vbool) + } + + if result.Vbar.Vextra != "" { + t.Errorf("vextra value should be empty: %#v", result.Vbar.Vextra) + } + + // this is the error + if result.Vbar.Vuint != 42 { + t.Errorf("vuint value should be 42: %#v", result.Vbar.Vuint) + } + +} + +// #67 panic() on extending slices (decodeSlice with disabled ZeroValues) +func TestDecodeSliceToEmptySliceWOZeroing(t *testing.T) { + t.Parallel() + + type TestStruct struct { + Vfoo []string + } + + decode := func(m interface{}, rawVal interface{}) error { + config := &DecoderConfig{ + Metadata: nil, + Result: rawVal, + ZeroFields: false, + } + + decoder, err := NewDecoder(config) + if err != nil { + return err + } + + return decoder.Decode(m) + } + + { + input := map[string]interface{}{ + "vfoo": []string{"1"}, + } + + result := &TestStruct{} + + err := decode(input, &result) + if err != nil { + t.Fatalf("got an err: %s", err.Error()) + } + } + + { + input := map[string]interface{}{ + "vfoo": []string{"1"}, + } + + result := &TestStruct{ + Vfoo: []string{}, + } + + err := decode(input, &result) + if err != nil { + t.Fatalf("got an err: %s", err.Error()) + } + } + + { + input := map[string]interface{}{ + "vfoo": []string{"2", "3"}, + } + + result := &TestStruct{ + Vfoo: []string{"1"}, + } + + err := decode(input, &result) + if err != nil { + t.Fatalf("got an err: %s", err.Error()) + } + } +} diff --git a/vendor/github.com/mitchellh/mapstructure/mapstructure_examples_test.go b/vendor/github.com/mitchellh/mapstructure/mapstructure_examples_test.go new file mode 100644 index 0000000000..f17c214a8a --- /dev/null +++ b/vendor/github.com/mitchellh/mapstructure/mapstructure_examples_test.go @@ -0,0 +1,203 @@ +package mapstructure + +import ( + "fmt" +) + +func ExampleDecode() { + type Person struct { + Name string + Age int + Emails []string + Extra map[string]string + } + + // This input can come from anywhere, but typically comes from + // something like decoding JSON where we're not quite sure of the + // struct initially. + input := map[string]interface{}{ + "name": "Mitchell", + "age": 91, + "emails": []string{"one", "two", "three"}, + "extra": map[string]string{ + "twitter": "mitchellh", + }, + } + + var result Person + err := Decode(input, &result) + if err != nil { + panic(err) + } + + fmt.Printf("%#v", result) + // Output: + // mapstructure.Person{Name:"Mitchell", Age:91, Emails:[]string{"one", "two", "three"}, Extra:map[string]string{"twitter":"mitchellh"}} +} + +func ExampleDecode_errors() { + type Person struct { + Name string + Age int + Emails []string + Extra map[string]string + } + + // This input can come from anywhere, but typically comes from + // something like decoding JSON where we're not quite sure of the + // struct initially. + input := map[string]interface{}{ + "name": 123, + "age": "bad value", + "emails": []int{1, 2, 3}, + } + + var result Person + err := Decode(input, &result) + if err == nil { + panic("should have an error") + } + + fmt.Println(err.Error()) + // Output: + // 5 error(s) decoding: + // + // * 'Age' expected type 'int', got unconvertible type 'string' + // * 'Emails[0]' expected type 'string', got unconvertible type 'int' + // * 'Emails[1]' expected type 'string', got unconvertible type 'int' + // * 'Emails[2]' expected type 'string', got unconvertible type 'int' + // * 'Name' expected type 'string', got unconvertible type 'int' +} + +func ExampleDecode_metadata() { + type Person struct { + Name string + Age int + } + + // This input can come from anywhere, but typically comes from + // something like decoding JSON where we're not quite sure of the + // struct initially. + input := map[string]interface{}{ + "name": "Mitchell", + "age": 91, + "email": "foo@bar.com", + } + + // For metadata, we make a more advanced DecoderConfig so we can + // more finely configure the decoder that is used. In this case, we + // just tell the decoder we want to track metadata. + var md Metadata + var result Person + config := &DecoderConfig{ + Metadata: &md, + Result: &result, + } + + decoder, err := NewDecoder(config) + if err != nil { + panic(err) + } + + if err := decoder.Decode(input); err != nil { + panic(err) + } + + fmt.Printf("Unused keys: %#v", md.Unused) + // Output: + // Unused keys: []string{"email"} +} + +func ExampleDecode_weaklyTypedInput() { + type Person struct { + Name string + Age int + Emails []string + } + + // This input can come from anywhere, but typically comes from + // something like decoding JSON, generated by a weakly typed language + // such as PHP. + input := map[string]interface{}{ + "name": 123, // number => string + "age": "42", // string => number + "emails": map[string]interface{}{}, // empty map => empty array + } + + var result Person + config := &DecoderConfig{ + WeaklyTypedInput: true, + Result: &result, + } + + decoder, err := NewDecoder(config) + if err != nil { + panic(err) + } + + err = decoder.Decode(input) + if err != nil { + panic(err) + } + + fmt.Printf("%#v", result) + // Output: mapstructure.Person{Name:"123", Age:42, Emails:[]string{}} +} + +func ExampleDecode_tags() { + // Note that the mapstructure tags defined in the struct type + // can indicate which fields the values are mapped to. + type Person struct { + Name string `mapstructure:"person_name"` + Age int `mapstructure:"person_age"` + } + + input := map[string]interface{}{ + "person_name": "Mitchell", + "person_age": 91, + } + + var result Person + err := Decode(input, &result) + if err != nil { + panic(err) + } + + fmt.Printf("%#v", result) + // Output: + // mapstructure.Person{Name:"Mitchell", Age:91} +} + +func ExampleDecode_embeddedStruct() { + // Squashing multiple embedded structs is allowed using the squash tag. + // This is demonstrated by creating a composite struct of multiple types + // and decoding into it. In this case, a person can carry with it both + // a Family and a Location, as well as their own FirstName. + type Family struct { + LastName string + } + type Location struct { + City string + } + type Person struct { + Family `mapstructure:",squash"` + Location `mapstructure:",squash"` + FirstName string + } + + input := map[string]interface{}{ + "FirstName": "Mitchell", + "LastName": "Hashimoto", + "City": "San Francisco", + } + + var result Person + err := Decode(input, &result) + if err != nil { + panic(err) + } + + fmt.Printf("%s %s, %s", result.FirstName, result.LastName, result.City) + // Output: + // Mitchell Hashimoto, San Francisco +} diff --git a/vendor/github.com/mitchellh/mapstructure/mapstructure_test.go b/vendor/github.com/mitchellh/mapstructure/mapstructure_test.go new file mode 100644 index 0000000000..547af73318 --- /dev/null +++ b/vendor/github.com/mitchellh/mapstructure/mapstructure_test.go @@ -0,0 +1,1193 @@ +package mapstructure + +import ( + "encoding/json" + "io" + "reflect" + "sort" + "strings" + "testing" +) + +type Basic struct { + Vstring string + Vint int + Vuint uint + Vbool bool + Vfloat float64 + Vextra string + vsilent bool + Vdata interface{} + VjsonInt int + VjsonFloat float64 + VjsonNumber json.Number +} + +type BasicSquash struct { + Test Basic `mapstructure:",squash"` +} + +type Embedded struct { + Basic + Vunique string +} + +type EmbeddedPointer struct { + *Basic + Vunique string +} + +type EmbeddedSquash struct { + Basic `mapstructure:",squash"` + Vunique string +} + +type SliceAlias []string + +type EmbeddedSlice struct { + SliceAlias `mapstructure:"slice_alias"` + Vunique string +} + +type SquashOnNonStructType struct { + InvalidSquashType int `mapstructure:",squash"` +} + +type Map struct { + Vfoo string + Vother map[string]string +} + +type MapOfStruct struct { + Value map[string]Basic +} + +type Nested struct { + Vfoo string + Vbar Basic +} + +type NestedPointer struct { + Vfoo string + Vbar *Basic +} + +type NilInterface struct { + W io.Writer +} + +type Slice struct { + Vfoo string + Vbar []string +} + +type SliceOfStruct struct { + Value []Basic +} + +type Func struct { + Foo func() string +} + +type Tagged struct { + Extra string `mapstructure:"bar,what,what"` + Value string `mapstructure:"foo"` +} + +type TypeConversionResult struct { + IntToFloat float32 + IntToUint uint + IntToBool bool + IntToString string + UintToInt int + UintToFloat float32 + UintToBool bool + UintToString string + BoolToInt int + BoolToUint uint + BoolToFloat float32 + BoolToString string + FloatToInt int + FloatToUint uint + FloatToBool bool + FloatToString string + SliceUint8ToString string + StringToInt int + StringToUint uint + StringToBool bool + StringToFloat float32 + StringToStrSlice []string + StringToIntSlice []int + SliceToMap map[string]interface{} + MapToSlice []interface{} +} + +func TestBasicTypes(t *testing.T) { + t.Parallel() + + input := map[string]interface{}{ + "vstring": "foo", + "vint": 42, + "Vuint": 42, + "vbool": true, + "Vfloat": 42.42, + "vsilent": true, + "vdata": 42, + "vjsonInt": json.Number("1234"), + "vjsonFloat": json.Number("1234.5"), + "vjsonNumber": json.Number("1234.5"), + } + + var result Basic + err := Decode(input, &result) + if err != nil { + t.Errorf("got an err: %s", err.Error()) + t.FailNow() + } + + if result.Vstring != "foo" { + t.Errorf("vstring value should be 'foo': %#v", result.Vstring) + } + + if result.Vint != 42 { + t.Errorf("vint value should be 42: %#v", result.Vint) + } + + if result.Vuint != 42 { + t.Errorf("vuint value should be 42: %#v", result.Vuint) + } + + if result.Vbool != true { + t.Errorf("vbool value should be true: %#v", result.Vbool) + } + + if result.Vfloat != 42.42 { + t.Errorf("vfloat value should be 42.42: %#v", result.Vfloat) + } + + if result.Vextra != "" { + t.Errorf("vextra value should be empty: %#v", result.Vextra) + } + + if result.vsilent != false { + t.Error("vsilent should not be set, it is unexported") + } + + if result.Vdata != 42 { + t.Error("vdata should be valid") + } + + if result.VjsonInt != 1234 { + t.Errorf("vjsonint value should be 1234: %#v", result.VjsonInt) + } + + if result.VjsonFloat != 1234.5 { + t.Errorf("vjsonfloat value should be 1234.5: %#v", result.VjsonFloat) + } + + if !reflect.DeepEqual(result.VjsonNumber, json.Number("1234.5")) { + t.Errorf("vjsonnumber value should be '1234.5': %T, %#v", result.VjsonNumber, result.VjsonNumber) + } +} + +func TestBasic_IntWithFloat(t *testing.T) { + t.Parallel() + + input := map[string]interface{}{ + "vint": float64(42), + } + + var result Basic + err := Decode(input, &result) + if err != nil { + t.Fatalf("got an err: %s", err) + } +} + +func TestBasic_Merge(t *testing.T) { + t.Parallel() + + input := map[string]interface{}{ + "vint": 42, + } + + var result Basic + result.Vuint = 100 + err := Decode(input, &result) + if err != nil { + t.Fatalf("got an err: %s", err) + } + + expected := Basic{ + Vint: 42, + Vuint: 100, + } + if !reflect.DeepEqual(result, expected) { + t.Fatalf("bad: %#v", result) + } +} + +func TestDecode_BasicSquash(t *testing.T) { + t.Parallel() + + input := map[string]interface{}{ + "vstring": "foo", + } + + var result BasicSquash + err := Decode(input, &result) + if err != nil { + t.Fatalf("got an err: %s", err.Error()) + } + + if result.Test.Vstring != "foo" { + t.Errorf("vstring value should be 'foo': %#v", result.Test.Vstring) + } +} + +func TestDecode_Embedded(t *testing.T) { + t.Parallel() + + input := map[string]interface{}{ + "vstring": "foo", + "Basic": map[string]interface{}{ + "vstring": "innerfoo", + }, + "vunique": "bar", + } + + var result Embedded + err := Decode(input, &result) + if err != nil { + t.Fatalf("got an err: %s", err.Error()) + } + + if result.Vstring != "innerfoo" { + t.Errorf("vstring value should be 'innerfoo': %#v", result.Vstring) + } + + if result.Vunique != "bar" { + t.Errorf("vunique value should be 'bar': %#v", result.Vunique) + } +} + +func TestDecode_EmbeddedPointer(t *testing.T) { + t.Parallel() + + input := map[string]interface{}{ + "vstring": "foo", + "Basic": map[string]interface{}{ + "vstring": "innerfoo", + }, + "vunique": "bar", + } + + var result EmbeddedPointer + err := Decode(input, &result) + if err != nil { + t.Fatalf("err: %s", err) + } + + expected := EmbeddedPointer{ + Basic: &Basic{ + Vstring: "innerfoo", + }, + Vunique: "bar", + } + if !reflect.DeepEqual(result, expected) { + t.Fatalf("bad: %#v", result) + } +} + +func TestDecode_EmbeddedSlice(t *testing.T) { + t.Parallel() + + input := map[string]interface{}{ + "slice_alias": []string{"foo", "bar"}, + "vunique": "bar", + } + + var result EmbeddedSlice + err := Decode(input, &result) + if err != nil { + t.Fatalf("got an err: %s", err.Error()) + } + + if !reflect.DeepEqual(result.SliceAlias, SliceAlias([]string{"foo", "bar"})) { + t.Errorf("slice value: %#v", result.SliceAlias) + } + + if result.Vunique != "bar" { + t.Errorf("vunique value should be 'bar': %#v", result.Vunique) + } +} + +func TestDecode_EmbeddedSquash(t *testing.T) { + t.Parallel() + + input := map[string]interface{}{ + "vstring": "foo", + "vunique": "bar", + } + + var result EmbeddedSquash + err := Decode(input, &result) + if err != nil { + t.Fatalf("got an err: %s", err.Error()) + } + + if result.Vstring != "foo" { + t.Errorf("vstring value should be 'foo': %#v", result.Vstring) + } + + if result.Vunique != "bar" { + t.Errorf("vunique value should be 'bar': %#v", result.Vunique) + } +} + +func TestDecode_SquashOnNonStructType(t *testing.T) { + t.Parallel() + + input := map[string]interface{}{ + "InvalidSquashType": 42, + } + + var result SquashOnNonStructType + err := Decode(input, &result) + if err == nil { + t.Fatal("unexpected success decoding invalid squash field type") + } else if !strings.Contains(err.Error(), "unsupported type for squash") { + t.Fatalf("unexpected error message for invalid squash field type: %s", err) + } +} + +func TestDecode_DecodeHook(t *testing.T) { + t.Parallel() + + input := map[string]interface{}{ + "vint": "WHAT", + } + + decodeHook := func(from reflect.Kind, to reflect.Kind, v interface{}) (interface{}, error) { + if from == reflect.String && to != reflect.String { + return 5, nil + } + + return v, nil + } + + var result Basic + config := &DecoderConfig{ + DecodeHook: decodeHook, + Result: &result, + } + + decoder, err := NewDecoder(config) + if err != nil { + t.Fatalf("err: %s", err) + } + + err = decoder.Decode(input) + if err != nil { + t.Fatalf("got an err: %s", err) + } + + if result.Vint != 5 { + t.Errorf("vint should be 5: %#v", result.Vint) + } +} + +func TestDecode_DecodeHookType(t *testing.T) { + t.Parallel() + + input := map[string]interface{}{ + "vint": "WHAT", + } + + decodeHook := func(from reflect.Type, to reflect.Type, v interface{}) (interface{}, error) { + if from.Kind() == reflect.String && + to.Kind() != reflect.String { + return 5, nil + } + + return v, nil + } + + var result Basic + config := &DecoderConfig{ + DecodeHook: decodeHook, + Result: &result, + } + + decoder, err := NewDecoder(config) + if err != nil { + t.Fatalf("err: %s", err) + } + + err = decoder.Decode(input) + if err != nil { + t.Fatalf("got an err: %s", err) + } + + if result.Vint != 5 { + t.Errorf("vint should be 5: %#v", result.Vint) + } +} + +func TestDecode_Nil(t *testing.T) { + t.Parallel() + + var input interface{} + result := Basic{ + Vstring: "foo", + } + + err := Decode(input, &result) + if err != nil { + t.Fatalf("err: %s", err) + } + + if result.Vstring != "foo" { + t.Fatalf("bad: %#v", result.Vstring) + } +} + +func TestDecode_NilInterfaceHook(t *testing.T) { + t.Parallel() + + input := map[string]interface{}{ + "w": "", + } + + decodeHook := func(f, t reflect.Type, v interface{}) (interface{}, error) { + if t.String() == "io.Writer" { + return nil, nil + } + + return v, nil + } + + var result NilInterface + config := &DecoderConfig{ + DecodeHook: decodeHook, + Result: &result, + } + + decoder, err := NewDecoder(config) + if err != nil { + t.Fatalf("err: %s", err) + } + + err = decoder.Decode(input) + if err != nil { + t.Fatalf("got an err: %s", err) + } + + if result.W != nil { + t.Errorf("W should be nil: %#v", result.W) + } +} + +func TestDecode_FuncHook(t *testing.T) { + t.Parallel() + + input := map[string]interface{}{ + "foo": "baz", + } + + decodeHook := func(f, t reflect.Type, v interface{}) (interface{}, error) { + if t.Kind() != reflect.Func { + return v, nil + } + val := v.(string) + return func() string { return val }, nil + } + + var result Func + config := &DecoderConfig{ + DecodeHook: decodeHook, + Result: &result, + } + + decoder, err := NewDecoder(config) + if err != nil { + t.Fatalf("err: %s", err) + } + + err = decoder.Decode(input) + if err != nil { + t.Fatalf("got an err: %s", err) + } + + if result.Foo() != "baz" { + t.Errorf("Foo call result should be 'baz': %s", result.Foo()) + } +} + +func TestDecode_NonStruct(t *testing.T) { + t.Parallel() + + input := map[string]interface{}{ + "foo": "bar", + "bar": "baz", + } + + var result map[string]string + err := Decode(input, &result) + if err != nil { + t.Fatalf("err: %s", err) + } + + if result["foo"] != "bar" { + t.Fatal("foo is not bar") + } +} + +func TestDecode_StructMatch(t *testing.T) { + t.Parallel() + + input := map[string]interface{}{ + "vbar": Basic{ + Vstring: "foo", + }, + } + + var result Nested + err := Decode(input, &result) + if err != nil { + t.Fatalf("got an err: %s", err.Error()) + } + + if result.Vbar.Vstring != "foo" { + t.Errorf("bad: %#v", result) + } +} + +func TestDecode_TypeConversion(t *testing.T) { + input := map[string]interface{}{ + "IntToFloat": 42, + "IntToUint": 42, + "IntToBool": 1, + "IntToString": 42, + "UintToInt": 42, + "UintToFloat": 42, + "UintToBool": 42, + "UintToString": 42, + "BoolToInt": true, + "BoolToUint": true, + "BoolToFloat": true, + "BoolToString": true, + "FloatToInt": 42.42, + "FloatToUint": 42.42, + "FloatToBool": 42.42, + "FloatToString": 42.42, + "SliceUint8ToString": []uint8("foo"), + "StringToInt": "42", + "StringToUint": "42", + "StringToBool": "1", + "StringToFloat": "42.42", + "StringToStrSlice": "A", + "StringToIntSlice": "42", + "SliceToMap": []interface{}{}, + "MapToSlice": map[string]interface{}{}, + } + + expectedResultStrict := TypeConversionResult{ + IntToFloat: 42.0, + IntToUint: 42, + UintToInt: 42, + UintToFloat: 42, + BoolToInt: 0, + BoolToUint: 0, + BoolToFloat: 0, + FloatToInt: 42, + FloatToUint: 42, + } + + expectedResultWeak := TypeConversionResult{ + IntToFloat: 42.0, + IntToUint: 42, + IntToBool: true, + IntToString: "42", + UintToInt: 42, + UintToFloat: 42, + UintToBool: true, + UintToString: "42", + BoolToInt: 1, + BoolToUint: 1, + BoolToFloat: 1, + BoolToString: "1", + FloatToInt: 42, + FloatToUint: 42, + FloatToBool: true, + FloatToString: "42.42", + SliceUint8ToString: "foo", + StringToInt: 42, + StringToUint: 42, + StringToBool: true, + StringToFloat: 42.42, + StringToStrSlice: []string{"A"}, + StringToIntSlice: []int{42}, + SliceToMap: map[string]interface{}{}, + MapToSlice: []interface{}{}, + } + + // Test strict type conversion + var resultStrict TypeConversionResult + err := Decode(input, &resultStrict) + if err == nil { + t.Errorf("should return an error") + } + if !reflect.DeepEqual(resultStrict, expectedResultStrict) { + t.Errorf("expected %v, got: %v", expectedResultStrict, resultStrict) + } + + // Test weak type conversion + var decoder *Decoder + var resultWeak TypeConversionResult + + config := &DecoderConfig{ + WeaklyTypedInput: true, + Result: &resultWeak, + } + + decoder, err = NewDecoder(config) + if err != nil { + t.Fatalf("err: %s", err) + } + + err = decoder.Decode(input) + if err != nil { + t.Fatalf("got an err: %s", err) + } + + if !reflect.DeepEqual(resultWeak, expectedResultWeak) { + t.Errorf("expected \n%#v, got: \n%#v", expectedResultWeak, resultWeak) + } +} + +func TestDecoder_ErrorUnused(t *testing.T) { + t.Parallel() + + input := map[string]interface{}{ + "vstring": "hello", + "foo": "bar", + } + + var result Basic + config := &DecoderConfig{ + ErrorUnused: true, + Result: &result, + } + + decoder, err := NewDecoder(config) + if err != nil { + t.Fatalf("err: %s", err) + } + + err = decoder.Decode(input) + if err == nil { + t.Fatal("expected error") + } +} + +func TestMap(t *testing.T) { + t.Parallel() + + input := map[string]interface{}{ + "vfoo": "foo", + "vother": map[interface{}]interface{}{ + "foo": "foo", + "bar": "bar", + }, + } + + var result Map + err := Decode(input, &result) + if err != nil { + t.Fatalf("got an error: %s", err) + } + + if result.Vfoo != "foo" { + t.Errorf("vfoo value should be 'foo': %#v", result.Vfoo) + } + + if result.Vother == nil { + t.Fatal("vother should not be nil") + } + + if len(result.Vother) != 2 { + t.Error("vother should have two items") + } + + if result.Vother["foo"] != "foo" { + t.Errorf("'foo' key should be foo, got: %#v", result.Vother["foo"]) + } + + if result.Vother["bar"] != "bar" { + t.Errorf("'bar' key should be bar, got: %#v", result.Vother["bar"]) + } +} + +func TestMapMerge(t *testing.T) { + t.Parallel() + + input := map[string]interface{}{ + "vfoo": "foo", + "vother": map[interface{}]interface{}{ + "foo": "foo", + "bar": "bar", + }, + } + + var result Map + result.Vother = map[string]string{"hello": "world"} + err := Decode(input, &result) + if err != nil { + t.Fatalf("got an error: %s", err) + } + + if result.Vfoo != "foo" { + t.Errorf("vfoo value should be 'foo': %#v", result.Vfoo) + } + + expected := map[string]string{ + "foo": "foo", + "bar": "bar", + "hello": "world", + } + if !reflect.DeepEqual(result.Vother, expected) { + t.Errorf("bad: %#v", result.Vother) + } +} + +func TestMapOfStruct(t *testing.T) { + t.Parallel() + + input := map[string]interface{}{ + "value": map[string]interface{}{ + "foo": map[string]string{"vstring": "one"}, + "bar": map[string]string{"vstring": "two"}, + }, + } + + var result MapOfStruct + err := Decode(input, &result) + if err != nil { + t.Fatalf("got an err: %s", err) + } + + if result.Value == nil { + t.Fatal("value should not be nil") + } + + if len(result.Value) != 2 { + t.Error("value should have two items") + } + + if result.Value["foo"].Vstring != "one" { + t.Errorf("foo value should be 'one', got: %s", result.Value["foo"].Vstring) + } + + if result.Value["bar"].Vstring != "two" { + t.Errorf("bar value should be 'two', got: %s", result.Value["bar"].Vstring) + } +} + +func TestNestedType(t *testing.T) { + t.Parallel() + + input := map[string]interface{}{ + "vfoo": "foo", + "vbar": map[string]interface{}{ + "vstring": "foo", + "vint": 42, + "vbool": true, + }, + } + + var result Nested + err := Decode(input, &result) + if err != nil { + t.Fatalf("got an err: %s", err.Error()) + } + + if result.Vfoo != "foo" { + t.Errorf("vfoo value should be 'foo': %#v", result.Vfoo) + } + + if result.Vbar.Vstring != "foo" { + t.Errorf("vstring value should be 'foo': %#v", result.Vbar.Vstring) + } + + if result.Vbar.Vint != 42 { + t.Errorf("vint value should be 42: %#v", result.Vbar.Vint) + } + + if result.Vbar.Vbool != true { + t.Errorf("vbool value should be true: %#v", result.Vbar.Vbool) + } + + if result.Vbar.Vextra != "" { + t.Errorf("vextra value should be empty: %#v", result.Vbar.Vextra) + } +} + +func TestNestedTypePointer(t *testing.T) { + t.Parallel() + + input := map[string]interface{}{ + "vfoo": "foo", + "vbar": &map[string]interface{}{ + "vstring": "foo", + "vint": 42, + "vbool": true, + }, + } + + var result NestedPointer + err := Decode(input, &result) + if err != nil { + t.Fatalf("got an err: %s", err.Error()) + } + + if result.Vfoo != "foo" { + t.Errorf("vfoo value should be 'foo': %#v", result.Vfoo) + } + + if result.Vbar.Vstring != "foo" { + t.Errorf("vstring value should be 'foo': %#v", result.Vbar.Vstring) + } + + if result.Vbar.Vint != 42 { + t.Errorf("vint value should be 42: %#v", result.Vbar.Vint) + } + + if result.Vbar.Vbool != true { + t.Errorf("vbool value should be true: %#v", result.Vbar.Vbool) + } + + if result.Vbar.Vextra != "" { + t.Errorf("vextra value should be empty: %#v", result.Vbar.Vextra) + } +} + +func TestSlice(t *testing.T) { + t.Parallel() + + inputStringSlice := map[string]interface{}{ + "vfoo": "foo", + "vbar": []string{"foo", "bar", "baz"}, + } + + inputStringSlicePointer := map[string]interface{}{ + "vfoo": "foo", + "vbar": &[]string{"foo", "bar", "baz"}, + } + + outputStringSlice := &Slice{ + "foo", + []string{"foo", "bar", "baz"}, + } + + testSliceInput(t, inputStringSlice, outputStringSlice) + testSliceInput(t, inputStringSlicePointer, outputStringSlice) +} + +func TestInvalidSlice(t *testing.T) { + t.Parallel() + + input := map[string]interface{}{ + "vfoo": "foo", + "vbar": 42, + } + + result := Slice{} + err := Decode(input, &result) + if err == nil { + t.Errorf("expected failure") + } +} + +func TestSliceOfStruct(t *testing.T) { + t.Parallel() + + input := map[string]interface{}{ + "value": []map[string]interface{}{ + {"vstring": "one"}, + {"vstring": "two"}, + }, + } + + var result SliceOfStruct + err := Decode(input, &result) + if err != nil { + t.Fatalf("got unexpected error: %s", err) + } + + if len(result.Value) != 2 { + t.Fatalf("expected two values, got %d", len(result.Value)) + } + + if result.Value[0].Vstring != "one" { + t.Errorf("first value should be 'one', got: %s", result.Value[0].Vstring) + } + + if result.Value[1].Vstring != "two" { + t.Errorf("second value should be 'two', got: %s", result.Value[1].Vstring) + } +} + +func TestSliceToMap(t *testing.T) { + t.Parallel() + + input := []map[string]interface{}{ + { + "foo": "bar", + }, + { + "bar": "baz", + }, + } + + var result map[string]interface{} + err := WeakDecode(input, &result) + if err != nil { + t.Fatalf("got an error: %s", err) + } + + expected := map[string]interface{}{ + "foo": "bar", + "bar": "baz", + } + if !reflect.DeepEqual(result, expected) { + t.Errorf("bad: %#v", result) + } +} + +func TestInvalidType(t *testing.T) { + t.Parallel() + + input := map[string]interface{}{ + "vstring": 42, + } + + var result Basic + err := Decode(input, &result) + if err == nil { + t.Fatal("error should exist") + } + + derr, ok := err.(*Error) + if !ok { + t.Fatalf("error should be kind of Error, instead: %#v", err) + } + + if derr.Errors[0] != "'Vstring' expected type 'string', got unconvertible type 'int'" { + t.Errorf("got unexpected error: %s", err) + } + + inputNegIntUint := map[string]interface{}{ + "vuint": -42, + } + + err = Decode(inputNegIntUint, &result) + if err == nil { + t.Fatal("error should exist") + } + + derr, ok = err.(*Error) + if !ok { + t.Fatalf("error should be kind of Error, instead: %#v", err) + } + + if derr.Errors[0] != "cannot parse 'Vuint', -42 overflows uint" { + t.Errorf("got unexpected error: %s", err) + } + + inputNegFloatUint := map[string]interface{}{ + "vuint": -42.0, + } + + err = Decode(inputNegFloatUint, &result) + if err == nil { + t.Fatal("error should exist") + } + + derr, ok = err.(*Error) + if !ok { + t.Fatalf("error should be kind of Error, instead: %#v", err) + } + + if derr.Errors[0] != "cannot parse 'Vuint', -42.000000 overflows uint" { + t.Errorf("got unexpected error: %s", err) + } +} + +func TestMetadata(t *testing.T) { + t.Parallel() + + input := map[string]interface{}{ + "vfoo": "foo", + "vbar": map[string]interface{}{ + "vstring": "foo", + "Vuint": 42, + "foo": "bar", + }, + "bar": "nil", + } + + var md Metadata + var result Nested + config := &DecoderConfig{ + Metadata: &md, + Result: &result, + } + + decoder, err := NewDecoder(config) + if err != nil { + t.Fatalf("err: %s", err) + } + + err = decoder.Decode(input) + if err != nil { + t.Fatalf("err: %s", err.Error()) + } + + expectedKeys := []string{"Vbar", "Vbar.Vstring", "Vbar.Vuint", "Vfoo"} + sort.Strings(md.Keys) + if !reflect.DeepEqual(md.Keys, expectedKeys) { + t.Fatalf("bad keys: %#v", md.Keys) + } + + expectedUnused := []string{"Vbar.foo", "bar"} + if !reflect.DeepEqual(md.Unused, expectedUnused) { + t.Fatalf("bad unused: %#v", md.Unused) + } +} + +func TestMetadata_Embedded(t *testing.T) { + t.Parallel() + + input := map[string]interface{}{ + "vstring": "foo", + "vunique": "bar", + } + + var md Metadata + var result EmbeddedSquash + config := &DecoderConfig{ + Metadata: &md, + Result: &result, + } + + decoder, err := NewDecoder(config) + if err != nil { + t.Fatalf("err: %s", err) + } + + err = decoder.Decode(input) + if err != nil { + t.Fatalf("err: %s", err.Error()) + } + + expectedKeys := []string{"Vstring", "Vunique"} + + sort.Strings(md.Keys) + if !reflect.DeepEqual(md.Keys, expectedKeys) { + t.Fatalf("bad keys: %#v", md.Keys) + } + + expectedUnused := []string{} + if !reflect.DeepEqual(md.Unused, expectedUnused) { + t.Fatalf("bad unused: %#v", md.Unused) + } +} + +func TestNonPtrValue(t *testing.T) { + t.Parallel() + + err := Decode(map[string]interface{}{}, Basic{}) + if err == nil { + t.Fatal("error should exist") + } + + if err.Error() != "result must be a pointer" { + t.Errorf("got unexpected error: %s", err) + } +} + +func TestTagged(t *testing.T) { + t.Parallel() + + input := map[string]interface{}{ + "foo": "bar", + "bar": "value", + } + + var result Tagged + err := Decode(input, &result) + if err != nil { + t.Fatalf("unexpected error: %s", err) + } + + if result.Value != "bar" { + t.Errorf("value should be 'bar', got: %#v", result.Value) + } + + if result.Extra != "value" { + t.Errorf("extra should be 'value', got: %#v", result.Extra) + } +} + +func TestWeakDecode(t *testing.T) { + t.Parallel() + + input := map[string]interface{}{ + "foo": "4", + "bar": "value", + } + + var result struct { + Foo int + Bar string + } + + if err := WeakDecode(input, &result); err != nil { + t.Fatalf("err: %s", err) + } + if result.Foo != 4 { + t.Fatalf("bad: %#v", result) + } + if result.Bar != "value" { + t.Fatalf("bad: %#v", result) + } +} + +func testSliceInput(t *testing.T, input map[string]interface{}, expected *Slice) { + var result Slice + err := Decode(input, &result) + if err != nil { + t.Fatalf("got error: %s", err) + } + + if result.Vfoo != expected.Vfoo { + t.Errorf("Vfoo expected '%s', got '%s'", expected.Vfoo, result.Vfoo) + } + + if result.Vbar == nil { + t.Fatalf("Vbar a slice, got '%#v'", result.Vbar) + } + + if len(result.Vbar) != len(expected.Vbar) { + t.Errorf("Vbar length should be %d, got %d", len(expected.Vbar), len(result.Vbar)) + } + + for i, v := range result.Vbar { + if v != expected.Vbar[i] { + t.Errorf( + "Vbar[%d] should be '%#v', got '%#v'", + i, expected.Vbar[i], v) + } + } +} diff --git a/vendor/github.com/pelletier/go-toml/.gitignore b/vendor/github.com/pelletier/go-toml/.gitignore new file mode 100644 index 0000000000..f1b619018e --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/.gitignore @@ -0,0 +1 @@ +test_program/test_program_bin diff --git a/vendor/github.com/pelletier/go-toml/LICENSE b/vendor/github.com/pelletier/go-toml/LICENSE new file mode 100644 index 0000000000..583bdae628 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2013 - 2017 Thomas Pelletier, Eric Anderton + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/github.com/pelletier/go-toml/README.md b/vendor/github.com/pelletier/go-toml/README.md new file mode 100644 index 0000000000..2681690d5d --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/README.md @@ -0,0 +1,119 @@ +# go-toml + +Go library for the [TOML](https://github.com/mojombo/toml) format. + +This library supports TOML version +[v0.4.0](https://github.com/toml-lang/toml/blob/master/versions/en/toml-v0.4.0.md) + +[![GoDoc](https://godoc.org/github.com/pelletier/go-toml?status.svg)](http://godoc.org/github.com/pelletier/go-toml) +[![license](https://img.shields.io/github/license/pelletier/go-toml.svg)](https://github.com/pelletier/go-toml/blob/master/LICENSE) +[![Build Status](https://travis-ci.org/pelletier/go-toml.svg?branch=master)](https://travis-ci.org/pelletier/go-toml) +[![Coverage Status](https://coveralls.io/repos/github/pelletier/go-toml/badge.svg?branch=master)](https://coveralls.io/github/pelletier/go-toml?branch=master) +[![Go Report Card](https://goreportcard.com/badge/github.com/pelletier/go-toml)](https://goreportcard.com/report/github.com/pelletier/go-toml) + +## Features + +Go-toml provides the following features for using data parsed from TOML documents: + +* Load TOML documents from files and string data +* Easily navigate TOML structure using Tree +* Mashaling and unmarshaling to and from data structures +* Line & column position data for all parsed elements +* [Query support similar to JSON-Path](query/) +* Syntax errors contain line and column numbers + +## Import + +```go +import "github.com/pelletier/go-toml" +``` + +## Usage example + +Read a TOML document: + +```go +config, _ := toml.Load(` +[postgres] +user = "pelletier" +password = "mypassword"`) +// retrieve data directly +user := config.Get("postgres.user").(string) + +// or using an intermediate object +postgresConfig := config.Get("postgres").(*toml.Tree) +password := postgresConfig.Get("password").(string) +``` + +Or use Unmarshal: + +```go +type Postgres struct { + User string + Password string +} +type Config struct { + Postgres Postgres +} + +doc := []byte(` +[postgres] +user = "pelletier" +password = "mypassword"`) + +config := Config{} +toml.Unmarshal(doc, &config) +fmt.Println("user=", config.Postgres.User) +``` + +Or use a query: + +```go +// use a query to gather elements without walking the tree +q, _ := query.Compile("$..[user,password]") +results := q.Execute(config) +for ii, item := range results.Values() { + fmt.Println("Query result %d: %v", ii, item) +} +``` + +## Documentation + +The documentation and additional examples are available at +[godoc.org](http://godoc.org/github.com/pelletier/go-toml). + +## Tools + +Go-toml provides two handy command line tools: + +* `tomll`: Reads TOML files and lint them. + + ``` + go install github.com/pelletier/go-toml/cmd/tomll + tomll --help + ``` +* `tomljson`: Reads a TOML file and outputs its JSON representation. + + ``` + go install github.com/pelletier/go-toml/cmd/tomljson + tomljson --help + ``` + +## Contribute + +Feel free to report bugs and patches using GitHub's pull requests system on +[pelletier/go-toml](https://github.com/pelletier/go-toml). Any feedback would be +much appreciated! + +### Run tests + +You have to make sure two kind of tests run: + +1. The Go unit tests +2. The TOML examples base + +You can run both of them using `./test.sh`. + +## License + +The MIT License (MIT). Read [LICENSE](LICENSE). diff --git a/vendor/github.com/pelletier/go-toml/benchmark.json b/vendor/github.com/pelletier/go-toml/benchmark.json new file mode 100644 index 0000000000..86f99c6a87 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/benchmark.json @@ -0,0 +1,164 @@ +{ + "array": { + "key1": [ + 1, + 2, + 3 + ], + "key2": [ + "red", + "yellow", + "green" + ], + "key3": [ + [ + 1, + 2 + ], + [ + 3, + 4, + 5 + ] + ], + "key4": [ + [ + 1, + 2 + ], + [ + "a", + "b", + "c" + ] + ], + "key5": [ + 1, + 2, + 3 + ], + "key6": [ + 1, + 2 + ] + }, + "boolean": { + "False": false, + "True": true + }, + "datetime": { + "key1": "1979-05-27T07:32:00Z", + "key2": "1979-05-27T00:32:00-07:00", + "key3": "1979-05-27T00:32:00.999999-07:00" + }, + "float": { + "both": { + "key": 6.626e-34 + }, + "exponent": { + "key1": 5e+22, + "key2": 1000000, + "key3": -0.02 + }, + "fractional": { + "key1": 1, + "key2": 3.1415, + "key3": -0.01 + }, + "underscores": { + "key1": 9224617.445991227, + "key2": 1e+100 + } + }, + "fruit": [{ + "name": "apple", + "physical": { + "color": "red", + "shape": "round" + }, + "variety": [{ + "name": "red delicious" + }, + { + "name": "granny smith" + } + ] + }, + { + "name": "banana", + "variety": [{ + "name": "plantain" + }] + } + ], + "integer": { + "key1": 99, + "key2": 42, + "key3": 0, + "key4": -17, + "underscores": { + "key1": 1000, + "key2": 5349221, + "key3": 12345 + } + }, + "products": [{ + "name": "Hammer", + "sku": 738594937 + }, + {}, + { + "color": "gray", + "name": "Nail", + "sku": 284758393 + } + ], + "string": { + "basic": { + "basic": "I'm a string. \"You can quote me\". Name\tJosé\nLocation\tSF." + }, + "literal": { + "multiline": { + "lines": "The first newline is\ntrimmed in raw strings.\n All other whitespace\n is preserved.\n", + "regex2": "I [dw]on't need \\d{2} apples" + }, + "quoted": "Tom \"Dubs\" Preston-Werner", + "regex": "\u003c\\i\\c*\\s*\u003e", + "winpath": "C:\\Users\\nodejs\\templates", + "winpath2": "\\\\ServerX\\admin$\\system32\\" + }, + "multiline": { + "continued": { + "key1": "The quick brown fox jumps over the lazy dog.", + "key2": "The quick brown fox jumps over the lazy dog.", + "key3": "The quick brown fox jumps over the lazy dog." + }, + "key1": "One\nTwo", + "key2": "One\nTwo", + "key3": "One\nTwo" + } + }, + "table": { + "inline": { + "name": { + "first": "Tom", + "last": "Preston-Werner" + }, + "point": { + "x": 1, + "y": 2 + } + }, + "key": "value", + "subtable": { + "key": "another value" + } + }, + "x": { + "y": { + "z": { + "w": {} + } + } + } +} diff --git a/vendor/github.com/pelletier/go-toml/benchmark.sh b/vendor/github.com/pelletier/go-toml/benchmark.sh new file mode 100755 index 0000000000..8b8bb528e7 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/benchmark.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +set -e + +reference_ref=${1:-master} +reference_git=${2:-.} + +if ! `hash benchstat 2>/dev/null`; then + echo "Installing benchstat" + go get golang.org/x/perf/cmd/benchstat + go install golang.org/x/perf/cmd/benchstat +fi + +tempdir=`mktemp -d /tmp/go-toml-benchmark-XXXXXX` +ref_tempdir="${tempdir}/ref" +ref_benchmark="${ref_tempdir}/benchmark-`echo -n ${reference_ref}|tr -s '/' '-'`.txt" +local_benchmark="`pwd`/benchmark-local.txt" + +echo "=== ${reference_ref} (${ref_tempdir})" +git clone ${reference_git} ${ref_tempdir} >/dev/null 2>/dev/null +pushd ${ref_tempdir} >/dev/null +git checkout ${reference_ref} >/dev/null 2>/dev/null +go test -bench=. -benchmem | tee ${ref_benchmark} +popd >/dev/null + +echo "" +echo "=== local" +go test -bench=. -benchmem | tee ${local_benchmark} + +echo "" +echo "=== diff" +benchstat -delta-test=none ${ref_benchmark} ${local_benchmark} \ No newline at end of file diff --git a/vendor/github.com/pelletier/go-toml/benchmark.toml b/vendor/github.com/pelletier/go-toml/benchmark.toml new file mode 100644 index 0000000000..dfd77e0962 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/benchmark.toml @@ -0,0 +1,244 @@ +################################################################################ +## Comment + +# Speak your mind with the hash symbol. They go from the symbol to the end of +# the line. + + +################################################################################ +## Table + +# Tables (also known as hash tables or dictionaries) are collections of +# key/value pairs. They appear in square brackets on a line by themselves. + +[table] + +key = "value" # Yeah, you can do this. + +# Nested tables are denoted by table names with dots in them. Name your tables +# whatever crap you please, just don't use #, ., [ or ]. + +[table.subtable] + +key = "another value" + +# You don't need to specify all the super-tables if you don't want to. TOML +# knows how to do it for you. + +# [x] you +# [x.y] don't +# [x.y.z] need these +[x.y.z.w] # for this to work + + +################################################################################ +## Inline Table + +# Inline tables provide a more compact syntax for expressing tables. They are +# especially useful for grouped data that can otherwise quickly become verbose. +# Inline tables are enclosed in curly braces `{` and `}`. No newlines are +# allowed between the curly braces unless they are valid within a value. + +[table.inline] + +name = { first = "Tom", last = "Preston-Werner" } +point = { x = 1, y = 2 } + + +################################################################################ +## String + +# There are four ways to express strings: basic, multi-line basic, literal, and +# multi-line literal. All strings must contain only valid UTF-8 characters. + +[string.basic] + +basic = "I'm a string. \"You can quote me\". Name\tJos\u00E9\nLocation\tSF." + +[string.multiline] + +# The following strings are byte-for-byte equivalent: +key1 = "One\nTwo" +key2 = """One\nTwo""" +key3 = """ +One +Two""" + +[string.multiline.continued] + +# The following strings are byte-for-byte equivalent: +key1 = "The quick brown fox jumps over the lazy dog." + +key2 = """ +The quick brown \ + + + fox jumps over \ + the lazy dog.""" + +key3 = """\ + The quick brown \ + fox jumps over \ + the lazy dog.\ + """ + +[string.literal] + +# What you see is what you get. +winpath = 'C:\Users\nodejs\templates' +winpath2 = '\\ServerX\admin$\system32\' +quoted = 'Tom "Dubs" Preston-Werner' +regex = '<\i\c*\s*>' + + +[string.literal.multiline] + +regex2 = '''I [dw]on't need \d{2} apples''' +lines = ''' +The first newline is +trimmed in raw strings. + All other whitespace + is preserved. +''' + + +################################################################################ +## Integer + +# Integers are whole numbers. Positive numbers may be prefixed with a plus sign. +# Negative numbers are prefixed with a minus sign. + +[integer] + +key1 = +99 +key2 = 42 +key3 = 0 +key4 = -17 + +[integer.underscores] + +# For large numbers, you may use underscores to enhance readability. Each +# underscore must be surrounded by at least one digit. +key1 = 1_000 +key2 = 5_349_221 +key3 = 1_2_3_4_5 # valid but inadvisable + + +################################################################################ +## Float + +# A float consists of an integer part (which may be prefixed with a plus or +# minus sign) followed by a fractional part and/or an exponent part. + +[float.fractional] + +key1 = +1.0 +key2 = 3.1415 +key3 = -0.01 + +[float.exponent] + +key1 = 5e+22 +key2 = 1e6 +key3 = -2E-2 + +[float.both] + +key = 6.626e-34 + +[float.underscores] + +key1 = 9_224_617.445_991_228_313 +key2 = 1e1_00 + + +################################################################################ +## Boolean + +# Booleans are just the tokens you're used to. Always lowercase. + +[boolean] + +True = true +False = false + + +################################################################################ +## Datetime + +# Datetimes are RFC 3339 dates. + +[datetime] + +key1 = 1979-05-27T07:32:00Z +key2 = 1979-05-27T00:32:00-07:00 +key3 = 1979-05-27T00:32:00.999999-07:00 + + +################################################################################ +## Array + +# Arrays are square brackets with other primitives inside. Whitespace is +# ignored. Elements are separated by commas. Data types may not be mixed. + +[array] + +key1 = [ 1, 2, 3 ] +key2 = [ "red", "yellow", "green" ] +key3 = [ [ 1, 2 ], [3, 4, 5] ] +#key4 = [ [ 1, 2 ], ["a", "b", "c"] ] # this is ok + +# Arrays can also be multiline. So in addition to ignoring whitespace, arrays +# also ignore newlines between the brackets. Terminating commas are ok before +# the closing bracket. + +key5 = [ + 1, 2, 3 +] +key6 = [ + 1, + 2, # this is ok +] + + +################################################################################ +## Array of Tables + +# These can be expressed by using a table name in double brackets. Each table +# with the same double bracketed name will be an element in the array. The +# tables are inserted in the order encountered. + +[[products]] + +name = "Hammer" +sku = 738594937 + +[[products]] + +[[products]] + +name = "Nail" +sku = 284758393 +color = "gray" + + +# You can create nested arrays of tables as well. + +[[fruit]] + name = "apple" + + [fruit.physical] + color = "red" + shape = "round" + + [[fruit.variety]] + name = "red delicious" + + [[fruit.variety]] + name = "granny smith" + +[[fruit]] + name = "banana" + + [[fruit.variety]] + name = "plantain" diff --git a/vendor/github.com/pelletier/go-toml/benchmark.yml b/vendor/github.com/pelletier/go-toml/benchmark.yml new file mode 100644 index 0000000000..0bd19f08a6 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/benchmark.yml @@ -0,0 +1,121 @@ +--- +array: + key1: + - 1 + - 2 + - 3 + key2: + - red + - yellow + - green + key3: + - - 1 + - 2 + - - 3 + - 4 + - 5 + key4: + - - 1 + - 2 + - - a + - b + - c + key5: + - 1 + - 2 + - 3 + key6: + - 1 + - 2 +boolean: + 'False': false + 'True': true +datetime: + key1: '1979-05-27T07:32:00Z' + key2: '1979-05-27T00:32:00-07:00' + key3: '1979-05-27T00:32:00.999999-07:00' +float: + both: + key: 6.626e-34 + exponent: + key1: 5.0e+22 + key2: 1000000 + key3: -0.02 + fractional: + key1: 1 + key2: 3.1415 + key3: -0.01 + underscores: + key1: 9224617.445991227 + key2: 1.0e+100 +fruit: +- name: apple + physical: + color: red + shape: round + variety: + - name: red delicious + - name: granny smith +- name: banana + variety: + - name: plantain +integer: + key1: 99 + key2: 42 + key3: 0 + key4: -17 + underscores: + key1: 1000 + key2: 5349221 + key3: 12345 +products: +- name: Hammer + sku: 738594937 +- {} +- color: gray + name: Nail + sku: 284758393 +string: + basic: + basic: "I'm a string. \"You can quote me\". Name\tJosé\nLocation\tSF." + literal: + multiline: + lines: | + The first newline is + trimmed in raw strings. + All other whitespace + is preserved. + regex2: I [dw]on't need \d{2} apples + quoted: Tom "Dubs" Preston-Werner + regex: "<\\i\\c*\\s*>" + winpath: C:\Users\nodejs\templates + winpath2: "\\\\ServerX\\admin$\\system32\\" + multiline: + continued: + key1: The quick brown fox jumps over the lazy dog. + key2: The quick brown fox jumps over the lazy dog. + key3: The quick brown fox jumps over the lazy dog. + key1: |- + One + Two + key2: |- + One + Two + key3: |- + One + Two +table: + inline: + name: + first: Tom + last: Preston-Werner + point: + x: 1 + y: 2 + key: value + subtable: + key: another value +x: + y: + z: + w: {} diff --git a/vendor/github.com/pelletier/go-toml/benchmark_test.go b/vendor/github.com/pelletier/go-toml/benchmark_test.go new file mode 100644 index 0000000000..e1f209dfac --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/benchmark_test.go @@ -0,0 +1,192 @@ +package toml + +import ( + "bytes" + "encoding/json" + "io/ioutil" + "testing" + "time" + + burntsushi "github.com/BurntSushi/toml" + yaml "gopkg.in/yaml.v2" +) + +type benchmarkDoc struct { + Table struct { + Key string + Subtable struct { + Key string + } + Inline struct { + Name struct { + First string + Last string + } + Point struct { + X int64 + U int64 + } + } + } + String struct { + Basic struct { + Basic string + } + Multiline struct { + Key1 string + Key2 string + Key3 string + Continued struct { + Key1 string + Key2 string + Key3 string + } + } + Literal struct { + Winpath string + Winpath2 string + Quoted string + Regex string + Multiline struct { + Regex2 string + Lines string + } + } + } + Integer struct { + Key1 int64 + Key2 int64 + Key3 int64 + Key4 int64 + Underscores struct { + Key1 int64 + Key2 int64 + Key3 int64 + } + } + Float struct { + Fractional struct { + Key1 float64 + Key2 float64 + Key3 float64 + } + Exponent struct { + Key1 float64 + Key2 float64 + Key3 float64 + } + Both struct { + Key float64 + } + Underscores struct { + Key1 float64 + Key2 float64 + } + } + Boolean struct { + True bool + False bool + } + Datetime struct { + Key1 time.Time + Key2 time.Time + Key3 time.Time + } + Array struct { + Key1 []int64 + Key2 []string + Key3 [][]int64 + // TODO: Key4 not supported by go-toml's Unmarshal + Key5 []int64 + Key6 []int64 + } + Products []struct { + Name string + Sku int64 + Color string + } + Fruit []struct { + Name string + Physical struct { + Color string + Shape string + Variety []struct { + Name string + } + } + } +} + +func BenchmarkParseToml(b *testing.B) { + fileBytes, err := ioutil.ReadFile("benchmark.toml") + if err != nil { + b.Fatal(err) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := LoadReader(bytes.NewReader(fileBytes)) + if err != nil { + b.Fatal(err) + } + } +} + +func BenchmarkUnmarshalToml(b *testing.B) { + bytes, err := ioutil.ReadFile("benchmark.toml") + if err != nil { + b.Fatal(err) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + target := benchmarkDoc{} + err := Unmarshal(bytes, &target) + if err != nil { + b.Fatal(err) + } + } +} + +func BenchmarkUnmarshalBurntSushiToml(b *testing.B) { + bytes, err := ioutil.ReadFile("benchmark.toml") + if err != nil { + b.Fatal(err) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + target := benchmarkDoc{} + err := burntsushi.Unmarshal(bytes, &target) + if err != nil { + b.Fatal(err) + } + } +} + +func BenchmarkUnmarshalJson(b *testing.B) { + bytes, err := ioutil.ReadFile("benchmark.json") + if err != nil { + b.Fatal(err) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + target := benchmarkDoc{} + err := json.Unmarshal(bytes, &target) + if err != nil { + b.Fatal(err) + } + } +} + +func BenchmarkUnmarshalYaml(b *testing.B) { + bytes, err := ioutil.ReadFile("benchmark.yml") + if err != nil { + b.Fatal(err) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + target := benchmarkDoc{} + err := yaml.Unmarshal(bytes, &target) + if err != nil { + b.Fatal(err) + } + } +} diff --git a/vendor/github.com/pelletier/go-toml/cmd/test_program.go b/vendor/github.com/pelletier/go-toml/cmd/test_program.go new file mode 100644 index 0000000000..73077f614b --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/cmd/test_program.go @@ -0,0 +1,91 @@ +package main + +import ( + "encoding/json" + "fmt" + "io/ioutil" + "log" + "os" + "time" + + "github.com/pelletier/go-toml" +) + +func main() { + bytes, err := ioutil.ReadAll(os.Stdin) + if err != nil { + log.Fatalf("Error during TOML read: %s", err) + os.Exit(2) + } + tree, err := toml.Load(string(bytes)) + if err != nil { + log.Fatalf("Error during TOML load: %s", err) + os.Exit(1) + } + + typedTree := translate(*tree) + + if err := json.NewEncoder(os.Stdout).Encode(typedTree); err != nil { + log.Fatalf("Error encoding JSON: %s", err) + os.Exit(3) + } + + os.Exit(0) +} + +func translate(tomlData interface{}) interface{} { + switch orig := tomlData.(type) { + case map[string]interface{}: + typed := make(map[string]interface{}, len(orig)) + for k, v := range orig { + typed[k] = translate(v) + } + return typed + case *toml.Tree: + return translate(*orig) + case toml.Tree: + keys := orig.Keys() + typed := make(map[string]interface{}, len(keys)) + for _, k := range keys { + typed[k] = translate(orig.GetPath([]string{k})) + } + return typed + case []*toml.Tree: + typed := make([]map[string]interface{}, len(orig)) + for i, v := range orig { + typed[i] = translate(v).(map[string]interface{}) + } + return typed + case []map[string]interface{}: + typed := make([]map[string]interface{}, len(orig)) + for i, v := range orig { + typed[i] = translate(v).(map[string]interface{}) + } + return typed + case []interface{}: + typed := make([]interface{}, len(orig)) + for i, v := range orig { + typed[i] = translate(v) + } + return tag("array", typed) + case time.Time: + return tag("datetime", orig.Format("2006-01-02T15:04:05Z")) + case bool: + return tag("bool", fmt.Sprintf("%v", orig)) + case int64: + return tag("integer", fmt.Sprintf("%d", orig)) + case float64: + return tag("float", fmt.Sprintf("%v", orig)) + case string: + return tag("string", orig) + } + + panic(fmt.Sprintf("Unknown type: %T", tomlData)) +} + +func tag(typeName string, data interface{}) map[string]interface{} { + return map[string]interface{}{ + "type": typeName, + "value": data, + } +} diff --git a/vendor/github.com/pelletier/go-toml/cmd/tomljson/main.go b/vendor/github.com/pelletier/go-toml/cmd/tomljson/main.go new file mode 100644 index 0000000000..b2d6fc6735 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/cmd/tomljson/main.go @@ -0,0 +1,72 @@ +// Tomljson reads TOML and converts to JSON. +// +// Usage: +// cat file.toml | tomljson > file.json +// tomljson file1.toml > file.json +package main + +import ( + "encoding/json" + "flag" + "fmt" + "io" + "os" + + "github.com/pelletier/go-toml" +) + +func main() { + flag.Usage = func() { + fmt.Fprintln(os.Stderr, `tomljson can be used in two ways: +Writing to STDIN and reading from STDOUT: + cat file.toml | tomljson > file.json + +Reading from a file name: + tomljson file.toml +`) + } + flag.Parse() + os.Exit(processMain(flag.Args(), os.Stdin, os.Stdout, os.Stderr)) +} + +func processMain(files []string, defaultInput io.Reader, output io.Writer, errorOutput io.Writer) int { + // read from stdin and print to stdout + inputReader := defaultInput + + if len(files) > 0 { + var err error + inputReader, err = os.Open(files[0]) + if err != nil { + printError(err, errorOutput) + return -1 + } + } + s, err := reader(inputReader) + if err != nil { + printError(err, errorOutput) + return -1 + } + io.WriteString(output, s+"\n") + return 0 +} + +func printError(err error, output io.Writer) { + io.WriteString(output, err.Error()+"\n") +} + +func reader(r io.Reader) (string, error) { + tree, err := toml.LoadReader(r) + if err != nil { + return "", err + } + return mapToJSON(tree) +} + +func mapToJSON(tree *toml.Tree) (string, error) { + treeMap := tree.ToMap() + bytes, err := json.MarshalIndent(treeMap, "", " ") + if err != nil { + return "", err + } + return string(bytes[:]), nil +} diff --git a/vendor/github.com/pelletier/go-toml/cmd/tomljson/main_test.go b/vendor/github.com/pelletier/go-toml/cmd/tomljson/main_test.go new file mode 100644 index 0000000000..0b4bdbb11b --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/cmd/tomljson/main_test.go @@ -0,0 +1,82 @@ +package main + +import ( + "bytes" + "io/ioutil" + "os" + "strings" + "testing" +) + +func expectBufferEquality(t *testing.T, name string, buffer *bytes.Buffer, expected string) { + output := buffer.String() + if output != expected { + t.Errorf("incorrect %s:\n%s\n\nexpected %s:\n%s", name, output, name, expected) + t.Log([]rune(output)) + t.Log([]rune(expected)) + } +} + +func expectProcessMainResults(t *testing.T, input string, args []string, exitCode int, expectedOutput string, expectedError string) { + inputReader := strings.NewReader(input) + outputBuffer := new(bytes.Buffer) + errorBuffer := new(bytes.Buffer) + + returnCode := processMain(args, inputReader, outputBuffer, errorBuffer) + + expectBufferEquality(t, "output", outputBuffer, expectedOutput) + expectBufferEquality(t, "error", errorBuffer, expectedError) + + if returnCode != exitCode { + t.Error("incorrect return code:", returnCode, "expected", exitCode) + } +} + +func TestProcessMainReadFromStdin(t *testing.T) { + input := ` + [mytoml] + a = 42` + expectedOutput := `{ + "mytoml": { + "a": 42 + } +} +` + expectedError := `` + expectedExitCode := 0 + + expectProcessMainResults(t, input, []string{}, expectedExitCode, expectedOutput, expectedError) +} + +func TestProcessMainReadFromFile(t *testing.T) { + input := ` + [mytoml] + a = 42` + + tmpfile, err := ioutil.TempFile("", "example.toml") + if err != nil { + t.Fatal(err) + } + if _, err := tmpfile.Write([]byte(input)); err != nil { + t.Fatal(err) + } + + defer os.Remove(tmpfile.Name()) + + expectedOutput := `{ + "mytoml": { + "a": 42 + } +} +` + expectedError := `` + expectedExitCode := 0 + + expectProcessMainResults(t, ``, []string{tmpfile.Name()}, expectedExitCode, expectedOutput, expectedError) +} + +func TestProcessMainReadFromMissingFile(t *testing.T) { + expectedError := `open /this/file/does/not/exist: no such file or directory +` + expectProcessMainResults(t, ``, []string{"/this/file/does/not/exist"}, -1, ``, expectedError) +} diff --git a/vendor/github.com/pelletier/go-toml/cmd/tomll/main.go b/vendor/github.com/pelletier/go-toml/cmd/tomll/main.go new file mode 100644 index 0000000000..36c7e3759c --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/cmd/tomll/main.go @@ -0,0 +1,66 @@ +// Tomll is a linter for TOML +// +// Usage: +// cat file.toml | tomll > file_linted.toml +// tomll file1.toml file2.toml # lint the two files in place +package main + +import ( + "flag" + "fmt" + "io" + "io/ioutil" + "os" + + "github.com/pelletier/go-toml" +) + +func main() { + flag.Usage = func() { + fmt.Fprintln(os.Stderr, `tomll can be used in two ways: +Writing to STDIN and reading from STDOUT: + cat file.toml | tomll > file.toml + +Reading and updating a list of files: + tomll a.toml b.toml c.toml + +When given a list of files, tomll will modify all files in place without asking. +`) + } + flag.Parse() + // read from stdin and print to stdout + if flag.NArg() == 0 { + s, err := lintReader(os.Stdin) + if err != nil { + io.WriteString(os.Stderr, err.Error()) + os.Exit(-1) + } + io.WriteString(os.Stdout, s) + } else { + // otherwise modify a list of files + for _, filename := range flag.Args() { + s, err := lintFile(filename) + if err != nil { + io.WriteString(os.Stderr, err.Error()) + os.Exit(-1) + } + ioutil.WriteFile(filename, []byte(s), 0644) + } + } +} + +func lintFile(filename string) (string, error) { + tree, err := toml.LoadFile(filename) + if err != nil { + return "", err + } + return tree.String(), nil +} + +func lintReader(r io.Reader) (string, error) { + tree, err := toml.LoadReader(r) + if err != nil { + return "", err + } + return tree.String(), nil +} diff --git a/vendor/github.com/pelletier/go-toml/doc.go b/vendor/github.com/pelletier/go-toml/doc.go new file mode 100644 index 0000000000..3c89619e8a --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/doc.go @@ -0,0 +1,23 @@ +// Package toml is a TOML parser and manipulation library. +// +// This version supports the specification as described in +// https://github.com/toml-lang/toml/blob/master/versions/en/toml-v0.4.0.md +// +// Marshaling +// +// Go-toml can marshal and unmarshal TOML documents from and to data +// structures. +// +// TOML document as a tree +// +// Go-toml can operate on a TOML document as a tree. Use one of the Load* +// functions to parse TOML data and obtain a Tree instance, then one of its +// methods to manipulate the tree. +// +// JSONPath-like queries +// +// The package github.com/pelletier/go-toml/query implements a system +// similar to JSONPath to quickly retrive elements of a TOML document using a +// single expression. See the package documentation for more information. +// +package toml diff --git a/vendor/github.com/pelletier/go-toml/doc_test.go b/vendor/github.com/pelletier/go-toml/doc_test.go new file mode 100644 index 0000000000..a48c04b017 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/doc_test.go @@ -0,0 +1,100 @@ +// code examples for godoc + +package toml_test + +import ( + "fmt" + "log" + + toml "github.com/pelletier/go-toml" +) + +func Example_tree() { + config, err := toml.LoadFile("config.toml") + + if err != nil { + fmt.Println("Error ", err.Error()) + } else { + // retrieve data directly + user := config.Get("postgres.user").(string) + password := config.Get("postgres.password").(string) + + // or using an intermediate object + configTree := config.Get("postgres").(*toml.Tree) + user = configTree.Get("user").(string) + password = configTree.Get("password").(string) + fmt.Println("User is", user, " and password is", password) + + // show where elements are in the file + fmt.Printf("User position: %v\n", configTree.GetPosition("user")) + fmt.Printf("Password position: %v\n", configTree.GetPosition("password")) + } +} + +func Example_unmarshal() { + type Employer struct { + Name string + Phone string + } + type Person struct { + Name string + Age int64 + Employer Employer + } + + document := []byte(` + name = "John" + age = 30 + [employer] + name = "Company Inc." + phone = "+1 234 567 89012" + `) + + person := Person{} + toml.Unmarshal(document, &person) + fmt.Println(person.Name, "is", person.Age, "and works at", person.Employer.Name) + // Output: + // John is 30 and works at Company Inc. +} + +func ExampleMarshal() { + type Postgres struct { + User string `toml:"user"` + Password string `toml:"password"` + } + type Config struct { + Postgres Postgres `toml:"postgres"` + } + + config := Config{Postgres{User: "pelletier", Password: "mypassword"}} + b, err := toml.Marshal(config) + if err != nil { + log.Fatal(err) + } + fmt.Println(string(b)) + // Output: + // [postgres] + // password = "mypassword" + // user = "pelletier" +} + +func ExampleUnmarshal() { + type Postgres struct { + User string + Password string + } + type Config struct { + Postgres Postgres + } + + doc := []byte(` + [postgres] + user = "pelletier" + password = "mypassword"`) + + config := Config{} + toml.Unmarshal(doc, &config) + fmt.Println("user=", config.Postgres.User) + // Output: + // user= pelletier +} diff --git a/vendor/github.com/pelletier/go-toml/example-crlf.toml b/vendor/github.com/pelletier/go-toml/example-crlf.toml new file mode 100644 index 0000000000..12950a163d --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/example-crlf.toml @@ -0,0 +1,29 @@ +# This is a TOML document. Boom. + +title = "TOML Example" + +[owner] +name = "Tom Preston-Werner" +organization = "GitHub" +bio = "GitHub Cofounder & CEO\nLikes tater tots and beer." +dob = 1979-05-27T07:32:00Z # First class dates? Why not? + +[database] +server = "192.168.1.1" +ports = [ 8001, 8001, 8002 ] +connection_max = 5000 +enabled = true + +[servers] + + # You can indent as you please. Tabs or spaces. TOML don't care. + [servers.alpha] + ip = "10.0.0.1" + dc = "eqdc10" + + [servers.beta] + ip = "10.0.0.2" + dc = "eqdc10" + +[clients] +data = [ ["gamma", "delta"], [1, 2] ] # just an update to make sure parsers support it diff --git a/vendor/github.com/pelletier/go-toml/example.toml b/vendor/github.com/pelletier/go-toml/example.toml new file mode 100644 index 0000000000..3d902f2820 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/example.toml @@ -0,0 +1,29 @@ +# This is a TOML document. Boom. + +title = "TOML Example" + +[owner] +name = "Tom Preston-Werner" +organization = "GitHub" +bio = "GitHub Cofounder & CEO\nLikes tater tots and beer." +dob = 1979-05-27T07:32:00Z # First class dates? Why not? + +[database] +server = "192.168.1.1" +ports = [ 8001, 8001, 8002 ] +connection_max = 5000 +enabled = true + +[servers] + + # You can indent as you please. Tabs or spaces. TOML don't care. + [servers.alpha] + ip = "10.0.0.1" + dc = "eqdc10" + + [servers.beta] + ip = "10.0.0.2" + dc = "eqdc10" + +[clients] +data = [ ["gamma", "delta"], [1, 2] ] # just an update to make sure parsers support it diff --git a/vendor/github.com/pelletier/go-toml/keysparsing.go b/vendor/github.com/pelletier/go-toml/keysparsing.go new file mode 100644 index 0000000000..d62ca5fd1d --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/keysparsing.go @@ -0,0 +1,94 @@ +// Parsing keys handling both bare and quoted keys. + +package toml + +import ( + "bytes" + "errors" + "fmt" + "unicode" +) + +func parseKey(key string) ([]string, error) { + groups := []string{} + var buffer bytes.Buffer + inQuotes := false + wasInQuotes := false + escapeNext := false + ignoreSpace := true + expectDot := false + + for _, char := range key { + if ignoreSpace { + if char == ' ' { + continue + } + ignoreSpace = false + } + if escapeNext { + buffer.WriteRune(char) + escapeNext = false + continue + } + switch char { + case '\\': + escapeNext = true + continue + case '"': + if inQuotes { + groups = append(groups, buffer.String()) + buffer.Reset() + wasInQuotes = true + } + inQuotes = !inQuotes + expectDot = false + case '.': + if inQuotes { + buffer.WriteRune(char) + } else { + if !wasInQuotes { + if buffer.Len() == 0 { + return nil, errors.New("empty table key") + } + groups = append(groups, buffer.String()) + buffer.Reset() + } + ignoreSpace = true + expectDot = false + wasInQuotes = false + } + case ' ': + if inQuotes { + buffer.WriteRune(char) + } else { + expectDot = true + } + default: + if !inQuotes && !isValidBareChar(char) { + return nil, fmt.Errorf("invalid bare character: %c", char) + } + if !inQuotes && expectDot { + return nil, errors.New("what?") + } + buffer.WriteRune(char) + expectDot = false + } + } + if inQuotes { + return nil, errors.New("mismatched quotes") + } + if escapeNext { + return nil, errors.New("unfinished escape sequence") + } + if buffer.Len() > 0 { + groups = append(groups, buffer.String()) + } + if len(groups) == 0 { + return nil, errors.New("empty key") + } + return groups, nil +} + +func isValidBareChar(r rune) bool { + return isAlphanumeric(r) || r == '-' || unicode.IsNumber(r) +} diff --git a/vendor/github.com/pelletier/go-toml/keysparsing_test.go b/vendor/github.com/pelletier/go-toml/keysparsing_test.go new file mode 100644 index 0000000000..1a9ecccaa9 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/keysparsing_test.go @@ -0,0 +1,56 @@ +package toml + +import ( + "fmt" + "testing" +) + +func testResult(t *testing.T, key string, expected []string) { + parsed, err := parseKey(key) + t.Logf("key=%s expected=%s parsed=%s", key, expected, parsed) + if err != nil { + t.Fatal("Unexpected error:", err) + } + if len(expected) != len(parsed) { + t.Fatal("Expected length", len(expected), "but", len(parsed), "parsed") + } + for index, expectedKey := range expected { + if expectedKey != parsed[index] { + t.Fatal("Expected", expectedKey, "at index", index, "but found", parsed[index]) + } + } +} + +func testError(t *testing.T, key string, expectedError string) { + _, err := parseKey(key) + if fmt.Sprintf("%s", err) != expectedError { + t.Fatalf("Expected error \"%s\", but got \"%s\".", expectedError, err) + } +} + +func TestBareKeyBasic(t *testing.T) { + testResult(t, "test", []string{"test"}) +} + +func TestBareKeyDotted(t *testing.T) { + testResult(t, "this.is.a.key", []string{"this", "is", "a", "key"}) +} + +func TestDottedKeyBasic(t *testing.T) { + testResult(t, "\"a.dotted.key\"", []string{"a.dotted.key"}) +} + +func TestBaseKeyPound(t *testing.T) { + testError(t, "hello#world", "invalid bare character: #") +} + +func TestQuotedKeys(t *testing.T) { + testResult(t, `hello."foo".bar`, []string{"hello", "foo", "bar"}) + testResult(t, `"hello!"`, []string{"hello!"}) +} + +func TestEmptyKey(t *testing.T) { + testError(t, "", "empty key") + testError(t, " ", "empty key") + testResult(t, `""`, []string{""}) +} diff --git a/vendor/github.com/pelletier/go-toml/lexer.go b/vendor/github.com/pelletier/go-toml/lexer.go new file mode 100644 index 0000000000..1b6647d66f --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/lexer.go @@ -0,0 +1,651 @@ +// TOML lexer. +// +// Written using the principles developed by Rob Pike in +// http://www.youtube.com/watch?v=HxaD_trXwRE + +package toml + +import ( + "bytes" + "errors" + "fmt" + "regexp" + "strconv" + "strings" +) + +var dateRegexp *regexp.Regexp + +// Define state functions +type tomlLexStateFn func() tomlLexStateFn + +// Define lexer +type tomlLexer struct { + inputIdx int + input []rune // Textual source + currentTokenStart int + currentTokenStop int + tokens []token + depth int + line int + col int + endbufferLine int + endbufferCol int +} + +// Basic read operations on input + +func (l *tomlLexer) read() rune { + r := l.peek() + if r == '\n' { + l.endbufferLine++ + l.endbufferCol = 1 + } else { + l.endbufferCol++ + } + l.inputIdx++ + return r +} + +func (l *tomlLexer) next() rune { + r := l.read() + + if r != eof { + l.currentTokenStop++ + } + return r +} + +func (l *tomlLexer) ignore() { + l.currentTokenStart = l.currentTokenStop + l.line = l.endbufferLine + l.col = l.endbufferCol +} + +func (l *tomlLexer) skip() { + l.next() + l.ignore() +} + +func (l *tomlLexer) fastForward(n int) { + for i := 0; i < n; i++ { + l.next() + } +} + +func (l *tomlLexer) emitWithValue(t tokenType, value string) { + l.tokens = append(l.tokens, token{ + Position: Position{l.line, l.col}, + typ: t, + val: value, + }) + l.ignore() +} + +func (l *tomlLexer) emit(t tokenType) { + l.emitWithValue(t, string(l.input[l.currentTokenStart:l.currentTokenStop])) +} + +func (l *tomlLexer) peek() rune { + if l.inputIdx >= len(l.input) { + return eof + } + return l.input[l.inputIdx] +} + +func (l *tomlLexer) peekString(size int) string { + maxIdx := len(l.input) + upperIdx := l.inputIdx + size // FIXME: potential overflow + if upperIdx > maxIdx { + upperIdx = maxIdx + } + return string(l.input[l.inputIdx:upperIdx]) +} + +func (l *tomlLexer) follow(next string) bool { + return next == l.peekString(len(next)) +} + +// Error management + +func (l *tomlLexer) errorf(format string, args ...interface{}) tomlLexStateFn { + l.tokens = append(l.tokens, token{ + Position: Position{l.line, l.col}, + typ: tokenError, + val: fmt.Sprintf(format, args...), + }) + return nil +} + +// State functions + +func (l *tomlLexer) lexVoid() tomlLexStateFn { + for { + next := l.peek() + switch next { + case '[': + return l.lexTableKey + case '#': + return l.lexComment(l.lexVoid) + case '=': + return l.lexEqual + case '\r': + fallthrough + case '\n': + l.skip() + continue + } + + if isSpace(next) { + l.skip() + } + + if l.depth > 0 { + return l.lexRvalue + } + + if isKeyStartChar(next) { + return l.lexKey + } + + if next == eof { + l.next() + break + } + } + + l.emit(tokenEOF) + return nil +} + +func (l *tomlLexer) lexRvalue() tomlLexStateFn { + for { + next := l.peek() + switch next { + case '.': + return l.errorf("cannot start float with a dot") + case '=': + return l.lexEqual + case '[': + l.depth++ + return l.lexLeftBracket + case ']': + l.depth-- + return l.lexRightBracket + case '{': + return l.lexLeftCurlyBrace + case '}': + return l.lexRightCurlyBrace + case '#': + return l.lexComment(l.lexRvalue) + case '"': + return l.lexString + case '\'': + return l.lexLiteralString + case ',': + return l.lexComma + case '\r': + fallthrough + case '\n': + l.skip() + if l.depth == 0 { + return l.lexVoid + } + return l.lexRvalue + case '_': + return l.errorf("cannot start number with underscore") + } + + if l.follow("true") { + return l.lexTrue + } + + if l.follow("false") { + return l.lexFalse + } + + if isSpace(next) { + l.skip() + continue + } + + if next == eof { + l.next() + break + } + + possibleDate := l.peekString(35) + dateMatch := dateRegexp.FindString(possibleDate) + if dateMatch != "" { + l.fastForward(len(dateMatch)) + return l.lexDate + } + + if next == '+' || next == '-' || isDigit(next) { + return l.lexNumber + } + + if isAlphanumeric(next) { + return l.lexKey + } + + return l.errorf("no value can start with %c", next) + } + + l.emit(tokenEOF) + return nil +} + +func (l *tomlLexer) lexLeftCurlyBrace() tomlLexStateFn { + l.next() + l.emit(tokenLeftCurlyBrace) + return l.lexRvalue +} + +func (l *tomlLexer) lexRightCurlyBrace() tomlLexStateFn { + l.next() + l.emit(tokenRightCurlyBrace) + return l.lexRvalue +} + +func (l *tomlLexer) lexDate() tomlLexStateFn { + l.emit(tokenDate) + return l.lexRvalue +} + +func (l *tomlLexer) lexTrue() tomlLexStateFn { + l.fastForward(4) + l.emit(tokenTrue) + return l.lexRvalue +} + +func (l *tomlLexer) lexFalse() tomlLexStateFn { + l.fastForward(5) + l.emit(tokenFalse) + return l.lexRvalue +} + +func (l *tomlLexer) lexEqual() tomlLexStateFn { + l.next() + l.emit(tokenEqual) + return l.lexRvalue +} + +func (l *tomlLexer) lexComma() tomlLexStateFn { + l.next() + l.emit(tokenComma) + return l.lexRvalue +} + +func (l *tomlLexer) lexKey() tomlLexStateFn { + growingString := "" + + for r := l.peek(); isKeyChar(r) || r == '\n' || r == '\r'; r = l.peek() { + if r == '"' { + l.next() + str, err := l.lexStringAsString(`"`, false, true) + if err != nil { + return l.errorf(err.Error()) + } + growingString += `"` + str + `"` + l.next() + continue + } else if r == '\n' { + return l.errorf("keys cannot contain new lines") + } else if isSpace(r) { + break + } else if !isValidBareChar(r) { + return l.errorf("keys cannot contain %c character", r) + } + growingString += string(r) + l.next() + } + l.emitWithValue(tokenKey, growingString) + return l.lexVoid +} + +func (l *tomlLexer) lexComment(previousState tomlLexStateFn) tomlLexStateFn { + return func() tomlLexStateFn { + for next := l.peek(); next != '\n' && next != eof; next = l.peek() { + if next == '\r' && l.follow("\r\n") { + break + } + l.next() + } + l.ignore() + return previousState + } +} + +func (l *tomlLexer) lexLeftBracket() tomlLexStateFn { + l.next() + l.emit(tokenLeftBracket) + return l.lexRvalue +} + +func (l *tomlLexer) lexLiteralStringAsString(terminator string, discardLeadingNewLine bool) (string, error) { + growingString := "" + + if discardLeadingNewLine { + if l.follow("\r\n") { + l.skip() + l.skip() + } else if l.peek() == '\n' { + l.skip() + } + } + + // find end of string + for { + if l.follow(terminator) { + return growingString, nil + } + + next := l.peek() + if next == eof { + break + } + growingString += string(l.next()) + } + + return "", errors.New("unclosed string") +} + +func (l *tomlLexer) lexLiteralString() tomlLexStateFn { + l.skip() + + // handle special case for triple-quote + terminator := "'" + discardLeadingNewLine := false + if l.follow("''") { + l.skip() + l.skip() + terminator = "'''" + discardLeadingNewLine = true + } + + str, err := l.lexLiteralStringAsString(terminator, discardLeadingNewLine) + if err != nil { + return l.errorf(err.Error()) + } + + l.emitWithValue(tokenString, str) + l.fastForward(len(terminator)) + l.ignore() + return l.lexRvalue +} + +// Lex a string and return the results as a string. +// Terminator is the substring indicating the end of the token. +// The resulting string does not include the terminator. +func (l *tomlLexer) lexStringAsString(terminator string, discardLeadingNewLine, acceptNewLines bool) (string, error) { + growingString := "" + + if discardLeadingNewLine { + if l.follow("\r\n") { + l.skip() + l.skip() + } else if l.peek() == '\n' { + l.skip() + } + } + + for { + if l.follow(terminator) { + return growingString, nil + } + + if l.follow("\\") { + l.next() + switch l.peek() { + case '\r': + fallthrough + case '\n': + fallthrough + case '\t': + fallthrough + case ' ': + // skip all whitespace chars following backslash + for strings.ContainsRune("\r\n\t ", l.peek()) { + l.next() + } + case '"': + growingString += "\"" + l.next() + case 'n': + growingString += "\n" + l.next() + case 'b': + growingString += "\b" + l.next() + case 'f': + growingString += "\f" + l.next() + case '/': + growingString += "/" + l.next() + case 't': + growingString += "\t" + l.next() + case 'r': + growingString += "\r" + l.next() + case '\\': + growingString += "\\" + l.next() + case 'u': + l.next() + code := "" + for i := 0; i < 4; i++ { + c := l.peek() + if !isHexDigit(c) { + return "", errors.New("unfinished unicode escape") + } + l.next() + code = code + string(c) + } + intcode, err := strconv.ParseInt(code, 16, 32) + if err != nil { + return "", errors.New("invalid unicode escape: \\u" + code) + } + growingString += string(rune(intcode)) + case 'U': + l.next() + code := "" + for i := 0; i < 8; i++ { + c := l.peek() + if !isHexDigit(c) { + return "", errors.New("unfinished unicode escape") + } + l.next() + code = code + string(c) + } + intcode, err := strconv.ParseInt(code, 16, 64) + if err != nil { + return "", errors.New("invalid unicode escape: \\U" + code) + } + growingString += string(rune(intcode)) + default: + return "", errors.New("invalid escape sequence: \\" + string(l.peek())) + } + } else { + r := l.peek() + + if 0x00 <= r && r <= 0x1F && !(acceptNewLines && (r == '\n' || r == '\r')) { + return "", fmt.Errorf("unescaped control character %U", r) + } + l.next() + growingString += string(r) + } + + if l.peek() == eof { + break + } + } + + return "", errors.New("unclosed string") +} + +func (l *tomlLexer) lexString() tomlLexStateFn { + l.skip() + + // handle special case for triple-quote + terminator := `"` + discardLeadingNewLine := false + acceptNewLines := false + if l.follow(`""`) { + l.skip() + l.skip() + terminator = `"""` + discardLeadingNewLine = true + acceptNewLines = true + } + + str, err := l.lexStringAsString(terminator, discardLeadingNewLine, acceptNewLines) + + if err != nil { + return l.errorf(err.Error()) + } + + l.emitWithValue(tokenString, str) + l.fastForward(len(terminator)) + l.ignore() + return l.lexRvalue +} + +func (l *tomlLexer) lexTableKey() tomlLexStateFn { + l.next() + + if l.peek() == '[' { + // token '[[' signifies an array of tables + l.next() + l.emit(tokenDoubleLeftBracket) + return l.lexInsideTableArrayKey + } + // vanilla table key + l.emit(tokenLeftBracket) + return l.lexInsideTableKey +} + +func (l *tomlLexer) lexInsideTableArrayKey() tomlLexStateFn { + for r := l.peek(); r != eof; r = l.peek() { + switch r { + case ']': + if l.currentTokenStop > l.currentTokenStart { + l.emit(tokenKeyGroupArray) + } + l.next() + if l.peek() != ']' { + break + } + l.next() + l.emit(tokenDoubleRightBracket) + return l.lexVoid + case '[': + return l.errorf("table array key cannot contain ']'") + default: + l.next() + } + } + return l.errorf("unclosed table array key") +} + +func (l *tomlLexer) lexInsideTableKey() tomlLexStateFn { + for r := l.peek(); r != eof; r = l.peek() { + switch r { + case ']': + if l.currentTokenStop > l.currentTokenStart { + l.emit(tokenKeyGroup) + } + l.next() + l.emit(tokenRightBracket) + return l.lexVoid + case '[': + return l.errorf("table key cannot contain ']'") + default: + l.next() + } + } + return l.errorf("unclosed table key") +} + +func (l *tomlLexer) lexRightBracket() tomlLexStateFn { + l.next() + l.emit(tokenRightBracket) + return l.lexRvalue +} + +func (l *tomlLexer) lexNumber() tomlLexStateFn { + r := l.peek() + if r == '+' || r == '-' { + l.next() + } + pointSeen := false + expSeen := false + digitSeen := false + for { + next := l.peek() + if next == '.' { + if pointSeen { + return l.errorf("cannot have two dots in one float") + } + l.next() + if !isDigit(l.peek()) { + return l.errorf("float cannot end with a dot") + } + pointSeen = true + } else if next == 'e' || next == 'E' { + expSeen = true + l.next() + r := l.peek() + if r == '+' || r == '-' { + l.next() + } + } else if isDigit(next) { + digitSeen = true + l.next() + } else if next == '_' { + l.next() + } else { + break + } + if pointSeen && !digitSeen { + return l.errorf("cannot start float with a dot") + } + } + + if !digitSeen { + return l.errorf("no digit in that number") + } + if pointSeen || expSeen { + l.emit(tokenFloat) + } else { + l.emit(tokenInteger) + } + return l.lexRvalue +} + +func (l *tomlLexer) run() { + for state := l.lexVoid; state != nil; { + state = state() + } +} + +func init() { + dateRegexp = regexp.MustCompile(`^\d{1,4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,9})?(Z|[+-]\d{2}:\d{2})`) +} + +// Entry point +func lexToml(inputBytes []byte) []token { + runes := bytes.Runes(inputBytes) + l := &tomlLexer{ + input: runes, + tokens: make([]token, 0, 256), + line: 1, + col: 1, + endbufferLine: 1, + endbufferCol: 1, + } + l.run() + return l.tokens +} diff --git a/vendor/github.com/pelletier/go-toml/lexer_test.go b/vendor/github.com/pelletier/go-toml/lexer_test.go new file mode 100644 index 0000000000..313b83c5d1 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/lexer_test.go @@ -0,0 +1,750 @@ +package toml + +import ( + "reflect" + "testing" +) + +func testFlow(t *testing.T, input string, expectedFlow []token) { + tokens := lexToml([]byte(input)) + if !reflect.DeepEqual(tokens, expectedFlow) { + t.Fatal("Different flows. Expected\n", expectedFlow, "\nGot:\n", tokens) + } +} + +func TestValidKeyGroup(t *testing.T) { + testFlow(t, "[hello world]", []token{ + {Position{1, 1}, tokenLeftBracket, "["}, + {Position{1, 2}, tokenKeyGroup, "hello world"}, + {Position{1, 13}, tokenRightBracket, "]"}, + {Position{1, 14}, tokenEOF, ""}, + }) +} + +func TestNestedQuotedUnicodeKeyGroup(t *testing.T) { + testFlow(t, `[ j . "ʞ" . l ]`, []token{ + {Position{1, 1}, tokenLeftBracket, "["}, + {Position{1, 2}, tokenKeyGroup, ` j . "ʞ" . l `}, + {Position{1, 15}, tokenRightBracket, "]"}, + {Position{1, 16}, tokenEOF, ""}, + }) +} + +func TestUnclosedKeyGroup(t *testing.T) { + testFlow(t, "[hello world", []token{ + {Position{1, 1}, tokenLeftBracket, "["}, + {Position{1, 2}, tokenError, "unclosed table key"}, + }) +} + +func TestComment(t *testing.T) { + testFlow(t, "# blahblah", []token{ + {Position{1, 11}, tokenEOF, ""}, + }) +} + +func TestKeyGroupComment(t *testing.T) { + testFlow(t, "[hello world] # blahblah", []token{ + {Position{1, 1}, tokenLeftBracket, "["}, + {Position{1, 2}, tokenKeyGroup, "hello world"}, + {Position{1, 13}, tokenRightBracket, "]"}, + {Position{1, 25}, tokenEOF, ""}, + }) +} + +func TestMultipleKeyGroupsComment(t *testing.T) { + testFlow(t, "[hello world] # blahblah\n[test]", []token{ + {Position{1, 1}, tokenLeftBracket, "["}, + {Position{1, 2}, tokenKeyGroup, "hello world"}, + {Position{1, 13}, tokenRightBracket, "]"}, + {Position{2, 1}, tokenLeftBracket, "["}, + {Position{2, 2}, tokenKeyGroup, "test"}, + {Position{2, 6}, tokenRightBracket, "]"}, + {Position{2, 7}, tokenEOF, ""}, + }) +} + +func TestSimpleWindowsCRLF(t *testing.T) { + testFlow(t, "a=4\r\nb=2", []token{ + {Position{1, 1}, tokenKey, "a"}, + {Position{1, 2}, tokenEqual, "="}, + {Position{1, 3}, tokenInteger, "4"}, + {Position{2, 1}, tokenKey, "b"}, + {Position{2, 2}, tokenEqual, "="}, + {Position{2, 3}, tokenInteger, "2"}, + {Position{2, 4}, tokenEOF, ""}, + }) +} + +func TestBasicKey(t *testing.T) { + testFlow(t, "hello", []token{ + {Position{1, 1}, tokenKey, "hello"}, + {Position{1, 6}, tokenEOF, ""}, + }) +} + +func TestBasicKeyWithUnderscore(t *testing.T) { + testFlow(t, "hello_hello", []token{ + {Position{1, 1}, tokenKey, "hello_hello"}, + {Position{1, 12}, tokenEOF, ""}, + }) +} + +func TestBasicKeyWithDash(t *testing.T) { + testFlow(t, "hello-world", []token{ + {Position{1, 1}, tokenKey, "hello-world"}, + {Position{1, 12}, tokenEOF, ""}, + }) +} + +func TestBasicKeyWithUppercaseMix(t *testing.T) { + testFlow(t, "helloHELLOHello", []token{ + {Position{1, 1}, tokenKey, "helloHELLOHello"}, + {Position{1, 16}, tokenEOF, ""}, + }) +} + +func TestBasicKeyWithInternationalCharacters(t *testing.T) { + testFlow(t, "héllÖ", []token{ + {Position{1, 1}, tokenKey, "héllÖ"}, + {Position{1, 6}, tokenEOF, ""}, + }) +} + +func TestBasicKeyAndEqual(t *testing.T) { + testFlow(t, "hello =", []token{ + {Position{1, 1}, tokenKey, "hello"}, + {Position{1, 7}, tokenEqual, "="}, + {Position{1, 8}, tokenEOF, ""}, + }) +} + +func TestKeyWithSharpAndEqual(t *testing.T) { + testFlow(t, "key#name = 5", []token{ + {Position{1, 1}, tokenError, "keys cannot contain # character"}, + }) +} + +func TestKeyWithSymbolsAndEqual(t *testing.T) { + testFlow(t, "~!@$^&*()_+-`1234567890[]\\|/?><.,;:' = 5", []token{ + {Position{1, 1}, tokenError, "keys cannot contain ~ character"}, + }) +} + +func TestKeyEqualStringEscape(t *testing.T) { + testFlow(t, `foo = "hello\""`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenString, "hello\""}, + {Position{1, 16}, tokenEOF, ""}, + }) +} + +func TestKeyEqualStringUnfinished(t *testing.T) { + testFlow(t, `foo = "bar`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenError, "unclosed string"}, + }) +} + +func TestKeyEqualString(t *testing.T) { + testFlow(t, `foo = "bar"`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenString, "bar"}, + {Position{1, 12}, tokenEOF, ""}, + }) +} + +func TestKeyEqualTrue(t *testing.T) { + testFlow(t, "foo = true", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenTrue, "true"}, + {Position{1, 11}, tokenEOF, ""}, + }) +} + +func TestKeyEqualFalse(t *testing.T) { + testFlow(t, "foo = false", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenFalse, "false"}, + {Position{1, 12}, tokenEOF, ""}, + }) +} + +func TestArrayNestedString(t *testing.T) { + testFlow(t, `a = [ ["hello", "world"] ]`, []token{ + {Position{1, 1}, tokenKey, "a"}, + {Position{1, 3}, tokenEqual, "="}, + {Position{1, 5}, tokenLeftBracket, "["}, + {Position{1, 7}, tokenLeftBracket, "["}, + {Position{1, 9}, tokenString, "hello"}, + {Position{1, 15}, tokenComma, ","}, + {Position{1, 18}, tokenString, "world"}, + {Position{1, 24}, tokenRightBracket, "]"}, + {Position{1, 26}, tokenRightBracket, "]"}, + {Position{1, 27}, tokenEOF, ""}, + }) +} + +func TestArrayNestedInts(t *testing.T) { + testFlow(t, "a = [ [42, 21], [10] ]", []token{ + {Position{1, 1}, tokenKey, "a"}, + {Position{1, 3}, tokenEqual, "="}, + {Position{1, 5}, tokenLeftBracket, "["}, + {Position{1, 7}, tokenLeftBracket, "["}, + {Position{1, 8}, tokenInteger, "42"}, + {Position{1, 10}, tokenComma, ","}, + {Position{1, 12}, tokenInteger, "21"}, + {Position{1, 14}, tokenRightBracket, "]"}, + {Position{1, 15}, tokenComma, ","}, + {Position{1, 17}, tokenLeftBracket, "["}, + {Position{1, 18}, tokenInteger, "10"}, + {Position{1, 20}, tokenRightBracket, "]"}, + {Position{1, 22}, tokenRightBracket, "]"}, + {Position{1, 23}, tokenEOF, ""}, + }) +} + +func TestArrayInts(t *testing.T) { + testFlow(t, "a = [ 42, 21, 10, ]", []token{ + {Position{1, 1}, tokenKey, "a"}, + {Position{1, 3}, tokenEqual, "="}, + {Position{1, 5}, tokenLeftBracket, "["}, + {Position{1, 7}, tokenInteger, "42"}, + {Position{1, 9}, tokenComma, ","}, + {Position{1, 11}, tokenInteger, "21"}, + {Position{1, 13}, tokenComma, ","}, + {Position{1, 15}, tokenInteger, "10"}, + {Position{1, 17}, tokenComma, ","}, + {Position{1, 19}, tokenRightBracket, "]"}, + {Position{1, 20}, tokenEOF, ""}, + }) +} + +func TestMultilineArrayComments(t *testing.T) { + testFlow(t, "a = [1, # wow\n2, # such items\n3, # so array\n]", []token{ + {Position{1, 1}, tokenKey, "a"}, + {Position{1, 3}, tokenEqual, "="}, + {Position{1, 5}, tokenLeftBracket, "["}, + {Position{1, 6}, tokenInteger, "1"}, + {Position{1, 7}, tokenComma, ","}, + {Position{2, 1}, tokenInteger, "2"}, + {Position{2, 2}, tokenComma, ","}, + {Position{3, 1}, tokenInteger, "3"}, + {Position{3, 2}, tokenComma, ","}, + {Position{4, 1}, tokenRightBracket, "]"}, + {Position{4, 2}, tokenEOF, ""}, + }) +} + +func TestNestedArraysComment(t *testing.T) { + toml := ` +someArray = [ +# does not work +["entry1"] +]` + testFlow(t, toml, []token{ + {Position{2, 1}, tokenKey, "someArray"}, + {Position{2, 11}, tokenEqual, "="}, + {Position{2, 13}, tokenLeftBracket, "["}, + {Position{4, 1}, tokenLeftBracket, "["}, + {Position{4, 3}, tokenString, "entry1"}, + {Position{4, 10}, tokenRightBracket, "]"}, + {Position{5, 1}, tokenRightBracket, "]"}, + {Position{5, 2}, tokenEOF, ""}, + }) +} + +func TestKeyEqualArrayBools(t *testing.T) { + testFlow(t, "foo = [true, false, true]", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenLeftBracket, "["}, + {Position{1, 8}, tokenTrue, "true"}, + {Position{1, 12}, tokenComma, ","}, + {Position{1, 14}, tokenFalse, "false"}, + {Position{1, 19}, tokenComma, ","}, + {Position{1, 21}, tokenTrue, "true"}, + {Position{1, 25}, tokenRightBracket, "]"}, + {Position{1, 26}, tokenEOF, ""}, + }) +} + +func TestKeyEqualArrayBoolsWithComments(t *testing.T) { + testFlow(t, "foo = [true, false, true] # YEAH", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenLeftBracket, "["}, + {Position{1, 8}, tokenTrue, "true"}, + {Position{1, 12}, tokenComma, ","}, + {Position{1, 14}, tokenFalse, "false"}, + {Position{1, 19}, tokenComma, ","}, + {Position{1, 21}, tokenTrue, "true"}, + {Position{1, 25}, tokenRightBracket, "]"}, + {Position{1, 33}, tokenEOF, ""}, + }) +} + +func TestDateRegexp(t *testing.T) { + if dateRegexp.FindString("1979-05-27T07:32:00Z") == "" { + t.Error("basic lexing") + } + if dateRegexp.FindString("1979-05-27T00:32:00-07:00") == "" { + t.Error("offset lexing") + } + if dateRegexp.FindString("1979-05-27T00:32:00.999999-07:00") == "" { + t.Error("nano precision lexing") + } +} + +func TestKeyEqualDate(t *testing.T) { + testFlow(t, "foo = 1979-05-27T07:32:00Z", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenDate, "1979-05-27T07:32:00Z"}, + {Position{1, 27}, tokenEOF, ""}, + }) + testFlow(t, "foo = 1979-05-27T00:32:00-07:00", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenDate, "1979-05-27T00:32:00-07:00"}, + {Position{1, 32}, tokenEOF, ""}, + }) + testFlow(t, "foo = 1979-05-27T00:32:00.999999-07:00", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenDate, "1979-05-27T00:32:00.999999-07:00"}, + {Position{1, 39}, tokenEOF, ""}, + }) +} + +func TestFloatEndingWithDot(t *testing.T) { + testFlow(t, "foo = 42.", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenError, "float cannot end with a dot"}, + }) +} + +func TestFloatWithTwoDots(t *testing.T) { + testFlow(t, "foo = 4.2.", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenError, "cannot have two dots in one float"}, + }) +} + +func TestFloatWithExponent1(t *testing.T) { + testFlow(t, "a = 5e+22", []token{ + {Position{1, 1}, tokenKey, "a"}, + {Position{1, 3}, tokenEqual, "="}, + {Position{1, 5}, tokenFloat, "5e+22"}, + {Position{1, 10}, tokenEOF, ""}, + }) +} + +func TestFloatWithExponent2(t *testing.T) { + testFlow(t, "a = 5E+22", []token{ + {Position{1, 1}, tokenKey, "a"}, + {Position{1, 3}, tokenEqual, "="}, + {Position{1, 5}, tokenFloat, "5E+22"}, + {Position{1, 10}, tokenEOF, ""}, + }) +} + +func TestFloatWithExponent3(t *testing.T) { + testFlow(t, "a = -5e+22", []token{ + {Position{1, 1}, tokenKey, "a"}, + {Position{1, 3}, tokenEqual, "="}, + {Position{1, 5}, tokenFloat, "-5e+22"}, + {Position{1, 11}, tokenEOF, ""}, + }) +} + +func TestFloatWithExponent4(t *testing.T) { + testFlow(t, "a = -5e-22", []token{ + {Position{1, 1}, tokenKey, "a"}, + {Position{1, 3}, tokenEqual, "="}, + {Position{1, 5}, tokenFloat, "-5e-22"}, + {Position{1, 11}, tokenEOF, ""}, + }) +} + +func TestFloatWithExponent5(t *testing.T) { + testFlow(t, "a = 6.626e-34", []token{ + {Position{1, 1}, tokenKey, "a"}, + {Position{1, 3}, tokenEqual, "="}, + {Position{1, 5}, tokenFloat, "6.626e-34"}, + {Position{1, 14}, tokenEOF, ""}, + }) +} + +func TestInvalidEsquapeSequence(t *testing.T) { + testFlow(t, `foo = "\x"`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenError, "invalid escape sequence: \\x"}, + }) +} + +func TestNestedArrays(t *testing.T) { + testFlow(t, "foo = [[[]]]", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenLeftBracket, "["}, + {Position{1, 8}, tokenLeftBracket, "["}, + {Position{1, 9}, tokenLeftBracket, "["}, + {Position{1, 10}, tokenRightBracket, "]"}, + {Position{1, 11}, tokenRightBracket, "]"}, + {Position{1, 12}, tokenRightBracket, "]"}, + {Position{1, 13}, tokenEOF, ""}, + }) +} + +func TestKeyEqualNumber(t *testing.T) { + testFlow(t, "foo = 42", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenInteger, "42"}, + {Position{1, 9}, tokenEOF, ""}, + }) + + testFlow(t, "foo = +42", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenInteger, "+42"}, + {Position{1, 10}, tokenEOF, ""}, + }) + + testFlow(t, "foo = -42", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenInteger, "-42"}, + {Position{1, 10}, tokenEOF, ""}, + }) + + testFlow(t, "foo = 4.2", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenFloat, "4.2"}, + {Position{1, 10}, tokenEOF, ""}, + }) + + testFlow(t, "foo = +4.2", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenFloat, "+4.2"}, + {Position{1, 11}, tokenEOF, ""}, + }) + + testFlow(t, "foo = -4.2", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenFloat, "-4.2"}, + {Position{1, 11}, tokenEOF, ""}, + }) + + testFlow(t, "foo = 1_000", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenInteger, "1_000"}, + {Position{1, 12}, tokenEOF, ""}, + }) + + testFlow(t, "foo = 5_349_221", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenInteger, "5_349_221"}, + {Position{1, 16}, tokenEOF, ""}, + }) + + testFlow(t, "foo = 1_2_3_4_5", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenInteger, "1_2_3_4_5"}, + {Position{1, 16}, tokenEOF, ""}, + }) + + testFlow(t, "flt8 = 9_224_617.445_991_228_313", []token{ + {Position{1, 1}, tokenKey, "flt8"}, + {Position{1, 6}, tokenEqual, "="}, + {Position{1, 8}, tokenFloat, "9_224_617.445_991_228_313"}, + {Position{1, 33}, tokenEOF, ""}, + }) + + testFlow(t, "foo = +", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenError, "no digit in that number"}, + }) +} + +func TestMultiline(t *testing.T) { + testFlow(t, "foo = 42\nbar=21", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenInteger, "42"}, + {Position{2, 1}, tokenKey, "bar"}, + {Position{2, 4}, tokenEqual, "="}, + {Position{2, 5}, tokenInteger, "21"}, + {Position{2, 7}, tokenEOF, ""}, + }) +} + +func TestKeyEqualStringUnicodeEscape(t *testing.T) { + testFlow(t, `foo = "hello \u2665"`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenString, "hello ♥"}, + {Position{1, 21}, tokenEOF, ""}, + }) + testFlow(t, `foo = "hello \U000003B4"`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenString, "hello δ"}, + {Position{1, 25}, tokenEOF, ""}, + }) + testFlow(t, `foo = "\uabcd"`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenString, "\uabcd"}, + {Position{1, 15}, tokenEOF, ""}, + }) + testFlow(t, `foo = "\uABCD"`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenString, "\uABCD"}, + {Position{1, 15}, tokenEOF, ""}, + }) + testFlow(t, `foo = "\U000bcdef"`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenString, "\U000bcdef"}, + {Position{1, 19}, tokenEOF, ""}, + }) + testFlow(t, `foo = "\U000BCDEF"`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenString, "\U000BCDEF"}, + {Position{1, 19}, tokenEOF, ""}, + }) + testFlow(t, `foo = "\u2"`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenError, "unfinished unicode escape"}, + }) + testFlow(t, `foo = "\U2"`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenError, "unfinished unicode escape"}, + }) +} + +func TestKeyEqualStringNoEscape(t *testing.T) { + testFlow(t, "foo = \"hello \u0002\"", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenError, "unescaped control character U+0002"}, + }) + testFlow(t, "foo = \"hello \u001F\"", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenError, "unescaped control character U+001F"}, + }) +} + +func TestLiteralString(t *testing.T) { + testFlow(t, `foo = 'C:\Users\nodejs\templates'`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenString, `C:\Users\nodejs\templates`}, + {Position{1, 34}, tokenEOF, ""}, + }) + testFlow(t, `foo = '\\ServerX\admin$\system32\'`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenString, `\\ServerX\admin$\system32\`}, + {Position{1, 35}, tokenEOF, ""}, + }) + testFlow(t, `foo = 'Tom "Dubs" Preston-Werner'`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenString, `Tom "Dubs" Preston-Werner`}, + {Position{1, 34}, tokenEOF, ""}, + }) + testFlow(t, `foo = '<\i\c*\s*>'`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenString, `<\i\c*\s*>`}, + {Position{1, 19}, tokenEOF, ""}, + }) + testFlow(t, `foo = 'C:\Users\nodejs\unfinis`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenError, "unclosed string"}, + }) +} + +func TestMultilineLiteralString(t *testing.T) { + testFlow(t, `foo = '''hello 'literal' world'''`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 10}, tokenString, `hello 'literal' world`}, + {Position{1, 34}, tokenEOF, ""}, + }) + + testFlow(t, "foo = '''\nhello\n'literal'\nworld'''", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{2, 1}, tokenString, "hello\n'literal'\nworld"}, + {Position{4, 9}, tokenEOF, ""}, + }) + testFlow(t, "foo = '''\r\nhello\r\n'literal'\r\nworld'''", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{2, 1}, tokenString, "hello\r\n'literal'\r\nworld"}, + {Position{4, 9}, tokenEOF, ""}, + }) +} + +func TestMultilineString(t *testing.T) { + testFlow(t, `foo = """hello "literal" world"""`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 10}, tokenString, `hello "literal" world`}, + {Position{1, 34}, tokenEOF, ""}, + }) + + testFlow(t, "foo = \"\"\"\r\nhello\\\r\n\"literal\"\\\nworld\"\"\"", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{2, 1}, tokenString, "hello\"literal\"world"}, + {Position{4, 9}, tokenEOF, ""}, + }) + + testFlow(t, "foo = \"\"\"\\\n \\\n \\\n hello\\\nmultiline\\\nworld\"\"\"", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 10}, tokenString, "hellomultilineworld"}, + {Position{6, 9}, tokenEOF, ""}, + }) + + testFlow(t, "key2 = \"\"\"\nThe quick brown \\\n\n\n fox jumps over \\\n the lazy dog.\"\"\"", []token{ + {Position{1, 1}, tokenKey, "key2"}, + {Position{1, 6}, tokenEqual, "="}, + {Position{2, 1}, tokenString, "The quick brown fox jumps over the lazy dog."}, + {Position{6, 21}, tokenEOF, ""}, + }) + + testFlow(t, "key2 = \"\"\"\\\n The quick brown \\\n fox jumps over \\\n the lazy dog.\\\n \"\"\"", []token{ + {Position{1, 1}, tokenKey, "key2"}, + {Position{1, 6}, tokenEqual, "="}, + {Position{1, 11}, tokenString, "The quick brown fox jumps over the lazy dog."}, + {Position{5, 11}, tokenEOF, ""}, + }) + + testFlow(t, `key2 = "Roses are red\nViolets are blue"`, []token{ + {Position{1, 1}, tokenKey, "key2"}, + {Position{1, 6}, tokenEqual, "="}, + {Position{1, 9}, tokenString, "Roses are red\nViolets are blue"}, + {Position{1, 41}, tokenEOF, ""}, + }) + + testFlow(t, "key2 = \"\"\"\nRoses are red\nViolets are blue\"\"\"", []token{ + {Position{1, 1}, tokenKey, "key2"}, + {Position{1, 6}, tokenEqual, "="}, + {Position{2, 1}, tokenString, "Roses are red\nViolets are blue"}, + {Position{3, 20}, tokenEOF, ""}, + }) +} + +func TestUnicodeString(t *testing.T) { + testFlow(t, `foo = "hello ♥ world"`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenString, "hello ♥ world"}, + {Position{1, 22}, tokenEOF, ""}, + }) +} +func TestEscapeInString(t *testing.T) { + testFlow(t, `foo = "\b\f\/"`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenString, "\b\f/"}, + {Position{1, 15}, tokenEOF, ""}, + }) +} + +func TestKeyGroupArray(t *testing.T) { + testFlow(t, "[[foo]]", []token{ + {Position{1, 1}, tokenDoubleLeftBracket, "[["}, + {Position{1, 3}, tokenKeyGroupArray, "foo"}, + {Position{1, 6}, tokenDoubleRightBracket, "]]"}, + {Position{1, 8}, tokenEOF, ""}, + }) +} + +func TestQuotedKey(t *testing.T) { + testFlow(t, "\"a b\" = 42", []token{ + {Position{1, 1}, tokenKey, "\"a b\""}, + {Position{1, 7}, tokenEqual, "="}, + {Position{1, 9}, tokenInteger, "42"}, + {Position{1, 11}, tokenEOF, ""}, + }) +} + +func TestKeyNewline(t *testing.T) { + testFlow(t, "a\n= 4", []token{ + {Position{1, 1}, tokenError, "keys cannot contain new lines"}, + }) +} + +func TestInvalidFloat(t *testing.T) { + testFlow(t, "a=7e1_", []token{ + {Position{1, 1}, tokenKey, "a"}, + {Position{1, 2}, tokenEqual, "="}, + {Position{1, 3}, tokenFloat, "7e1_"}, + {Position{1, 7}, tokenEOF, ""}, + }) +} + +func TestLexUnknownRvalue(t *testing.T) { + testFlow(t, `a = !b`, []token{ + {Position{1, 1}, tokenKey, "a"}, + {Position{1, 3}, tokenEqual, "="}, + {Position{1, 5}, tokenError, "no value can start with !"}, + }) + + testFlow(t, `a = \b`, []token{ + {Position{1, 1}, tokenKey, "a"}, + {Position{1, 3}, tokenEqual, "="}, + {Position{1, 5}, tokenError, `no value can start with \`}, + }) +} + +func BenchmarkLexer(b *testing.B) { + sample := `title = "Hugo: A Fast and Flexible Website Generator" +baseurl = "http://gohugo.io/" +MetaDataFormat = "yaml" +pluralizeListTitles = false + +[params] + description = "Documentation of Hugo, a fast and flexible static site generator built with love by spf13, bep and friends in Go" + author = "Steve Francia (spf13) and friends" + release = "0.22-DEV" + +[[menu.main]] + name = "Download Hugo" + pre = "" + url = "https://github.com/spf13/hugo/releases" + weight = -200 +` + b.ResetTimer() + for i := 0; i < b.N; i++ { + lexToml([]byte(sample)) + } +} diff --git a/vendor/github.com/pelletier/go-toml/marshal.go b/vendor/github.com/pelletier/go-toml/marshal.go new file mode 100644 index 0000000000..1a3176f97a --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/marshal.go @@ -0,0 +1,489 @@ +package toml + +import ( + "bytes" + "errors" + "fmt" + "reflect" + "strings" + "time" +) + +type tomlOpts struct { + name string + include bool + omitempty bool +} + +var timeType = reflect.TypeOf(time.Time{}) +var marshalerType = reflect.TypeOf(new(Marshaler)).Elem() + +// Check if the given marshall type maps to a Tree primitive +func isPrimitive(mtype reflect.Type) bool { + switch mtype.Kind() { + case reflect.Ptr: + return isPrimitive(mtype.Elem()) + case reflect.Bool: + return true + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return true + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + return true + case reflect.Float32, reflect.Float64: + return true + case reflect.String: + return true + case reflect.Struct: + return mtype == timeType || isCustomMarshaler(mtype) + default: + return false + } +} + +// Check if the given marshall type maps to a Tree slice +func isTreeSlice(mtype reflect.Type) bool { + switch mtype.Kind() { + case reflect.Slice: + return !isOtherSlice(mtype) + default: + return false + } +} + +// Check if the given marshall type maps to a non-Tree slice +func isOtherSlice(mtype reflect.Type) bool { + switch mtype.Kind() { + case reflect.Ptr: + return isOtherSlice(mtype.Elem()) + case reflect.Slice: + return isPrimitive(mtype.Elem()) || isOtherSlice(mtype.Elem()) + default: + return false + } +} + +// Check if the given marshall type maps to a Tree +func isTree(mtype reflect.Type) bool { + switch mtype.Kind() { + case reflect.Map: + return true + case reflect.Struct: + return !isPrimitive(mtype) + default: + return false + } +} + +func isCustomMarshaler(mtype reflect.Type) bool { + return mtype.Implements(marshalerType) +} + +func callCustomMarshaler(mval reflect.Value) ([]byte, error) { + return mval.Interface().(Marshaler).MarshalTOML() +} + +// Marshaler is the interface implemented by types that +// can marshal themselves into valid TOML. +type Marshaler interface { + MarshalTOML() ([]byte, error) +} + +/* +Marshal returns the TOML encoding of v. Behavior is similar to the Go json +encoder, except that there is no concept of a Marshaler interface or MarshalTOML +function for sub-structs, and currently only definite types can be marshaled +(i.e. no `interface{}`). + +Note that pointers are automatically assigned the "omitempty" option, as TOML +explicity does not handle null values (saying instead the label should be +dropped). + +Tree structural types and corresponding marshal types: + + *Tree (*)struct, (*)map[string]interface{} + []*Tree (*)[](*)struct, (*)[](*)map[string]interface{} + []interface{} (as interface{}) (*)[]primitive, (*)[]([]interface{}) + interface{} (*)primitive + +Tree primitive types and corresponding marshal types: + + uint64 uint, uint8-uint64, pointers to same + int64 int, int8-uint64, pointers to same + float64 float32, float64, pointers to same + string string, pointers to same + bool bool, pointers to same + time.Time time.Time{}, pointers to same +*/ +func Marshal(v interface{}) ([]byte, error) { + mtype := reflect.TypeOf(v) + if mtype.Kind() != reflect.Struct { + return []byte{}, errors.New("Only a struct can be marshaled to TOML") + } + sval := reflect.ValueOf(v) + if isCustomMarshaler(mtype) { + return callCustomMarshaler(sval) + } + t, err := valueToTree(mtype, sval) + if err != nil { + return []byte{}, err + } + s, err := t.ToTomlString() + return []byte(s), err +} + +// Convert given marshal struct or map value to toml tree +func valueToTree(mtype reflect.Type, mval reflect.Value) (*Tree, error) { + if mtype.Kind() == reflect.Ptr { + return valueToTree(mtype.Elem(), mval.Elem()) + } + tval := newTree() + switch mtype.Kind() { + case reflect.Struct: + for i := 0; i < mtype.NumField(); i++ { + mtypef, mvalf := mtype.Field(i), mval.Field(i) + opts := tomlOptions(mtypef) + if opts.include && (!opts.omitempty || !isZero(mvalf)) { + val, err := valueToToml(mtypef.Type, mvalf) + if err != nil { + return nil, err + } + tval.Set(opts.name, val) + } + } + case reflect.Map: + for _, key := range mval.MapKeys() { + mvalf := mval.MapIndex(key) + val, err := valueToToml(mtype.Elem(), mvalf) + if err != nil { + return nil, err + } + tval.Set(key.String(), val) + } + } + return tval, nil +} + +// Convert given marshal slice to slice of Toml trees +func valueToTreeSlice(mtype reflect.Type, mval reflect.Value) ([]*Tree, error) { + tval := make([]*Tree, mval.Len(), mval.Len()) + for i := 0; i < mval.Len(); i++ { + val, err := valueToTree(mtype.Elem(), mval.Index(i)) + if err != nil { + return nil, err + } + tval[i] = val + } + return tval, nil +} + +// Convert given marshal slice to slice of toml values +func valueToOtherSlice(mtype reflect.Type, mval reflect.Value) (interface{}, error) { + tval := make([]interface{}, mval.Len(), mval.Len()) + for i := 0; i < mval.Len(); i++ { + val, err := valueToToml(mtype.Elem(), mval.Index(i)) + if err != nil { + return nil, err + } + tval[i] = val + } + return tval, nil +} + +// Convert given marshal value to toml value +func valueToToml(mtype reflect.Type, mval reflect.Value) (interface{}, error) { + if mtype.Kind() == reflect.Ptr { + return valueToToml(mtype.Elem(), mval.Elem()) + } + switch { + case isCustomMarshaler(mtype): + return callCustomMarshaler(mval) + case isTree(mtype): + return valueToTree(mtype, mval) + case isTreeSlice(mtype): + return valueToTreeSlice(mtype, mval) + case isOtherSlice(mtype): + return valueToOtherSlice(mtype, mval) + default: + switch mtype.Kind() { + case reflect.Bool: + return mval.Bool(), nil + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return mval.Int(), nil + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + return mval.Uint(), nil + case reflect.Float32, reflect.Float64: + return mval.Float(), nil + case reflect.String: + return mval.String(), nil + case reflect.Struct: + return mval.Interface().(time.Time), nil + default: + return nil, fmt.Errorf("Marshal can't handle %v(%v)", mtype, mtype.Kind()) + } + } +} + +// Unmarshal attempts to unmarshal the Tree into a Go struct pointed by v. +// Neither Unmarshaler interfaces nor UnmarshalTOML functions are supported for +// sub-structs, and only definite types can be unmarshaled. +func (t *Tree) Unmarshal(v interface{}) error { + mtype := reflect.TypeOf(v) + if mtype.Kind() != reflect.Ptr || mtype.Elem().Kind() != reflect.Struct { + return errors.New("Only a pointer to struct can be unmarshaled from TOML") + } + + sval, err := valueFromTree(mtype.Elem(), t) + if err != nil { + return err + } + reflect.ValueOf(v).Elem().Set(sval) + return nil +} + +// Unmarshal parses the TOML-encoded data and stores the result in the value +// pointed to by v. Behavior is similar to the Go json encoder, except that there +// is no concept of an Unmarshaler interface or UnmarshalTOML function for +// sub-structs, and currently only definite types can be unmarshaled to (i.e. no +// `interface{}`). +// +// See Marshal() documentation for types mapping table. +func Unmarshal(data []byte, v interface{}) error { + t, err := LoadReader(bytes.NewReader(data)) + if err != nil { + return err + } + return t.Unmarshal(v) +} + +// Convert toml tree to marshal struct or map, using marshal type +func valueFromTree(mtype reflect.Type, tval *Tree) (reflect.Value, error) { + if mtype.Kind() == reflect.Ptr { + return unwrapPointer(mtype, tval) + } + var mval reflect.Value + switch mtype.Kind() { + case reflect.Struct: + mval = reflect.New(mtype).Elem() + for i := 0; i < mtype.NumField(); i++ { + mtypef := mtype.Field(i) + opts := tomlOptions(mtypef) + if opts.include { + baseKey := opts.name + keysToTry := []string{baseKey, strings.ToLower(baseKey), strings.ToTitle(baseKey)} + for _, key := range keysToTry { + exists := tval.Has(key) + if !exists { + continue + } + val := tval.Get(key) + mvalf, err := valueFromToml(mtypef.Type, val) + if err != nil { + return mval, formatError(err, tval.GetPosition(key)) + } + mval.Field(i).Set(mvalf) + break + } + } + } + case reflect.Map: + mval = reflect.MakeMap(mtype) + for _, key := range tval.Keys() { + val := tval.Get(key) + mvalf, err := valueFromToml(mtype.Elem(), val) + if err != nil { + return mval, formatError(err, tval.GetPosition(key)) + } + mval.SetMapIndex(reflect.ValueOf(key), mvalf) + } + } + return mval, nil +} + +// Convert toml value to marshal struct/map slice, using marshal type +func valueFromTreeSlice(mtype reflect.Type, tval []*Tree) (reflect.Value, error) { + mval := reflect.MakeSlice(mtype, len(tval), len(tval)) + for i := 0; i < len(tval); i++ { + val, err := valueFromTree(mtype.Elem(), tval[i]) + if err != nil { + return mval, err + } + mval.Index(i).Set(val) + } + return mval, nil +} + +// Convert toml value to marshal primitive slice, using marshal type +func valueFromOtherSlice(mtype reflect.Type, tval []interface{}) (reflect.Value, error) { + mval := reflect.MakeSlice(mtype, len(tval), len(tval)) + for i := 0; i < len(tval); i++ { + val, err := valueFromToml(mtype.Elem(), tval[i]) + if err != nil { + return mval, err + } + mval.Index(i).Set(val) + } + return mval, nil +} + +// Convert toml value to marshal value, using marshal type +func valueFromToml(mtype reflect.Type, tval interface{}) (reflect.Value, error) { + if mtype.Kind() == reflect.Ptr { + return unwrapPointer(mtype, tval) + } + switch { + case isTree(mtype): + return valueFromTree(mtype, tval.(*Tree)) + case isTreeSlice(mtype): + return valueFromTreeSlice(mtype, tval.([]*Tree)) + case isOtherSlice(mtype): + return valueFromOtherSlice(mtype, tval.([]interface{})) + default: + switch mtype.Kind() { + case reflect.Bool: + val, ok := tval.(bool) + if !ok { + return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to bool", tval, tval) + } + return reflect.ValueOf(val), nil + case reflect.Int: + val, ok := tval.(int64) + if !ok { + return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to int", tval, tval) + } + return reflect.ValueOf(int(val)), nil + case reflect.Int8: + val, ok := tval.(int64) + if !ok { + return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to int", tval, tval) + } + return reflect.ValueOf(int8(val)), nil + case reflect.Int16: + val, ok := tval.(int64) + if !ok { + return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to int", tval, tval) + } + return reflect.ValueOf(int16(val)), nil + case reflect.Int32: + val, ok := tval.(int64) + if !ok { + return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to int", tval, tval) + } + return reflect.ValueOf(int32(val)), nil + case reflect.Int64: + val, ok := tval.(int64) + if !ok { + return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to int", tval, tval) + } + return reflect.ValueOf(val), nil + case reflect.Uint: + val, ok := tval.(int64) + if !ok { + return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to uint", tval, tval) + } + return reflect.ValueOf(uint(val)), nil + case reflect.Uint8: + val, ok := tval.(int64) + if !ok { + return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to uint", tval, tval) + } + return reflect.ValueOf(uint8(val)), nil + case reflect.Uint16: + val, ok := tval.(int64) + if !ok { + return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to uint", tval, tval) + } + return reflect.ValueOf(uint16(val)), nil + case reflect.Uint32: + val, ok := tval.(int64) + if !ok { + return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to uint", tval, tval) + } + return reflect.ValueOf(uint32(val)), nil + case reflect.Uint64: + val, ok := tval.(int64) + if !ok { + return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to uint", tval, tval) + } + return reflect.ValueOf(uint64(val)), nil + case reflect.Float32: + val, ok := tval.(float64) + if !ok { + return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to float", tval, tval) + } + return reflect.ValueOf(float32(val)), nil + case reflect.Float64: + val, ok := tval.(float64) + if !ok { + return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to float", tval, tval) + } + return reflect.ValueOf(val), nil + case reflect.String: + val, ok := tval.(string) + if !ok { + return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to string", tval, tval) + } + return reflect.ValueOf(val), nil + case reflect.Struct: + val, ok := tval.(time.Time) + if !ok { + return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to time", tval, tval) + } + return reflect.ValueOf(val), nil + default: + return reflect.ValueOf(nil), fmt.Errorf("Unmarshal can't handle %v(%v)", mtype, mtype.Kind()) + } + } +} + +func unwrapPointer(mtype reflect.Type, tval interface{}) (reflect.Value, error) { + val, err := valueFromToml(mtype.Elem(), tval) + if err != nil { + return reflect.ValueOf(nil), err + } + mval := reflect.New(mtype.Elem()) + mval.Elem().Set(val) + return mval, nil +} + +func tomlOptions(vf reflect.StructField) tomlOpts { + tag := vf.Tag.Get("toml") + parse := strings.Split(tag, ",") + result := tomlOpts{vf.Name, true, false} + if parse[0] != "" { + if parse[0] == "-" && len(parse) == 1 { + result.include = false + } else { + result.name = strings.Trim(parse[0], " ") + } + } + if vf.PkgPath != "" { + result.include = false + } + if len(parse) > 1 && strings.Trim(parse[1], " ") == "omitempty" { + result.omitempty = true + } + if vf.Type.Kind() == reflect.Ptr { + result.omitempty = true + } + return result +} + +func isZero(val reflect.Value) bool { + switch val.Type().Kind() { + case reflect.Map: + fallthrough + case reflect.Array: + fallthrough + case reflect.Slice: + return val.Len() == 0 + default: + return reflect.DeepEqual(val.Interface(), reflect.Zero(val.Type()).Interface()) + } +} + +func formatError(err error, pos Position) error { + if err.Error()[0] == '(' { // Error already contains position information + return err + } + return fmt.Errorf("%s: %s", pos, err) +} diff --git a/vendor/github.com/pelletier/go-toml/marshal_test.go b/vendor/github.com/pelletier/go-toml/marshal_test.go new file mode 100644 index 0000000000..dbfc7c1d13 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/marshal_test.go @@ -0,0 +1,600 @@ +package toml + +import ( + "bytes" + "encoding/json" + "fmt" + "io/ioutil" + "reflect" + "testing" + "time" +) + +type basicMarshalTestStruct struct { + String string `toml:"string"` + StringList []string `toml:"strlist"` + Sub basicMarshalTestSubStruct `toml:"subdoc"` + SubList []basicMarshalTestSubStruct `toml:"sublist"` +} + +type basicMarshalTestSubStruct struct { + String2 string +} + +var basicTestData = basicMarshalTestStruct{ + String: "Hello", + StringList: []string{"Howdy", "Hey There"}, + Sub: basicMarshalTestSubStruct{"One"}, + SubList: []basicMarshalTestSubStruct{{"Two"}, {"Three"}}, +} + +var basicTestToml = []byte(`string = "Hello" +strlist = ["Howdy","Hey There"] + +[subdoc] + String2 = "One" + +[[sublist]] + String2 = "Two" + +[[sublist]] + String2 = "Three" +`) + +func TestBasicMarshal(t *testing.T) { + result, err := Marshal(basicTestData) + if err != nil { + t.Fatal(err) + } + expected := basicTestToml + if !bytes.Equal(result, expected) { + t.Errorf("Bad marshal: expected\n-----\n%s\n-----\ngot\n-----\n%s\n-----\n", expected, result) + } +} + +func TestBasicUnmarshal(t *testing.T) { + result := basicMarshalTestStruct{} + err := Unmarshal(basicTestToml, &result) + expected := basicTestData + if err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(result, expected) { + t.Errorf("Bad unmarshal: expected %v, got %v", expected, result) + } +} + +type testDoc struct { + Title string `toml:"title"` + Basics testDocBasics `toml:"basic"` + BasicLists testDocBasicLists `toml:"basic_lists"` + BasicMap map[string]string `toml:"basic_map"` + Subdocs testDocSubs `toml:"subdoc"` + SubDocList []testSubDoc `toml:"subdoclist"` + SubDocPtrs []*testSubDoc `toml:"subdocptrs"` + err int `toml:"shouldntBeHere"` + unexported int `toml:"shouldntBeHere"` + Unexported2 int `toml:"-"` +} + +type testDocBasics struct { + Bool bool `toml:"bool"` + Date time.Time `toml:"date"` + Float float32 `toml:"float"` + Int int `toml:"int"` + Uint uint `toml:"uint"` + String *string `toml:"string"` + unexported int `toml:"shouldntBeHere"` +} + +type testDocBasicLists struct { + Bools []bool `toml:"bools"` + Dates []time.Time `toml:"dates"` + Floats []*float32 `toml:"floats"` + Ints []int `toml:"ints"` + Strings []string `toml:"strings"` + UInts []uint `toml:"uints"` +} + +type testDocSubs struct { + First testSubDoc `toml:"first"` + Second *testSubDoc `toml:"second"` +} + +type testSubDoc struct { + Name string `toml:"name"` + unexported int `toml:"shouldntBeHere"` +} + +var biteMe = "Bite me" +var float1 float32 = 12.3 +var float2 float32 = 45.6 +var float3 float32 = 78.9 +var subdoc = testSubDoc{"Second", 0} + +var docData = testDoc{ + Title: "TOML Marshal Testing", + unexported: 0, + Unexported2: 0, + Basics: testDocBasics{ + Bool: true, + Date: time.Date(1979, 5, 27, 7, 32, 0, 0, time.UTC), + Float: 123.4, + Int: 5000, + Uint: 5001, + String: &biteMe, + unexported: 0, + }, + BasicLists: testDocBasicLists{ + Bools: []bool{true, false, true}, + Dates: []time.Time{ + time.Date(1979, 5, 27, 7, 32, 0, 0, time.UTC), + time.Date(1980, 5, 27, 7, 32, 0, 0, time.UTC), + }, + Floats: []*float32{&float1, &float2, &float3}, + Ints: []int{8001, 8001, 8002}, + Strings: []string{"One", "Two", "Three"}, + UInts: []uint{5002, 5003}, + }, + BasicMap: map[string]string{ + "one": "one", + "two": "two", + }, + Subdocs: testDocSubs{ + First: testSubDoc{"First", 0}, + Second: &subdoc, + }, + SubDocList: []testSubDoc{ + testSubDoc{"List.First", 0}, + testSubDoc{"List.Second", 0}, + }, + SubDocPtrs: []*testSubDoc{&subdoc}, +} + +func TestDocMarshal(t *testing.T) { + result, err := Marshal(docData) + if err != nil { + t.Fatal(err) + } + expected, _ := ioutil.ReadFile("marshal_test.toml") + if !bytes.Equal(result, expected) { + t.Errorf("Bad marshal: expected\n-----\n%s\n-----\ngot\n-----\n%s\n-----\n", expected, result) + } +} + +func TestDocUnmarshal(t *testing.T) { + result := testDoc{} + tomlData, _ := ioutil.ReadFile("marshal_test.toml") + err := Unmarshal(tomlData, &result) + expected := docData + if err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(result, expected) { + resStr, _ := json.MarshalIndent(result, "", " ") + expStr, _ := json.MarshalIndent(expected, "", " ") + t.Errorf("Bad unmarshal: expected\n-----\n%s\n-----\ngot\n-----\n%s\n-----\n", expStr, resStr) + } +} + +func TestDocPartialUnmarshal(t *testing.T) { + result := testDocSubs{} + + tree, _ := LoadFile("marshal_test.toml") + subTree := tree.Get("subdoc").(*Tree) + err := subTree.Unmarshal(&result) + expected := docData.Subdocs + if err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(result, expected) { + resStr, _ := json.MarshalIndent(result, "", " ") + expStr, _ := json.MarshalIndent(expected, "", " ") + t.Errorf("Bad partial unmartial: expected\n-----\n%s\n-----\ngot\n-----\n%s\n-----\n", expStr, resStr) + } +} + +type tomlTypeCheckTest struct { + name string + item interface{} + typ int //0=primitive, 1=otherslice, 2=treeslice, 3=tree +} + +func TestTypeChecks(t *testing.T) { + tests := []tomlTypeCheckTest{ + {"integer", 2, 0}, + {"time", time.Date(2015, 1, 1, 0, 0, 0, 0, time.UTC), 0}, + {"stringlist", []string{"hello", "hi"}, 1}, + {"timelist", []time.Time{time.Date(2015, 1, 1, 0, 0, 0, 0, time.UTC)}, 1}, + {"objectlist", []tomlTypeCheckTest{}, 2}, + {"object", tomlTypeCheckTest{}, 3}, + } + + for _, test := range tests { + expected := []bool{false, false, false, false} + expected[test.typ] = true + result := []bool{ + isPrimitive(reflect.TypeOf(test.item)), + isOtherSlice(reflect.TypeOf(test.item)), + isTreeSlice(reflect.TypeOf(test.item)), + isTree(reflect.TypeOf(test.item)), + } + if !reflect.DeepEqual(expected, result) { + t.Errorf("Bad type check on %q: expected %v, got %v", test.name, expected, result) + } + } +} + +type unexportedMarshalTestStruct struct { + String string `toml:"string"` + StringList []string `toml:"strlist"` + Sub basicMarshalTestSubStruct `toml:"subdoc"` + SubList []basicMarshalTestSubStruct `toml:"sublist"` + unexported int `toml:"shouldntBeHere"` + Unexported2 int `toml:"-"` +} + +var unexportedTestData = unexportedMarshalTestStruct{ + String: "Hello", + StringList: []string{"Howdy", "Hey There"}, + Sub: basicMarshalTestSubStruct{"One"}, + SubList: []basicMarshalTestSubStruct{{"Two"}, {"Three"}}, + unexported: 0, + Unexported2: 0, +} + +var unexportedTestToml = []byte(`string = "Hello" +strlist = ["Howdy","Hey There"] +unexported = 1 +shouldntBeHere = 2 + +[subdoc] + String2 = "One" + +[[sublist]] + String2 = "Two" + +[[sublist]] + String2 = "Three" +`) + +func TestUnexportedUnmarshal(t *testing.T) { + result := unexportedMarshalTestStruct{} + err := Unmarshal(unexportedTestToml, &result) + expected := unexportedTestData + if err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(result, expected) { + t.Errorf("Bad unexported unmarshal: expected %v, got %v", expected, result) + } +} + +type errStruct struct { + Bool bool `toml:"bool"` + Date time.Time `toml:"date"` + Float float64 `toml:"float"` + Int int16 `toml:"int"` + String *string `toml:"string"` +} + +var errTomls = []string{ + "bool = truly\ndate = 1979-05-27T07:32:00Z\nfloat = 123.4\nint = 5000\nstring = \"Bite me\"", + "bool = true\ndate = 1979-05-27T07:3200Z\nfloat = 123.4\nint = 5000\nstring = \"Bite me\"", + "bool = true\ndate = 1979-05-27T07:32:00Z\nfloat = 123a4\nint = 5000\nstring = \"Bite me\"", + "bool = true\ndate = 1979-05-27T07:32:00Z\nfloat = 123.4\nint = j000\nstring = \"Bite me\"", + "bool = true\ndate = 1979-05-27T07:32:00Z\nfloat = 123.4\nint = 5000\nstring = Bite me", + "bool = true\ndate = 1979-05-27T07:32:00Z\nfloat = 123.4\nint = 5000\nstring = Bite me", + "bool = 1\ndate = 1979-05-27T07:32:00Z\nfloat = 123.4\nint = 5000\nstring = \"Bite me\"", + "bool = true\ndate = 1\nfloat = 123.4\nint = 5000\nstring = \"Bite me\"", + "bool = true\ndate = 1979-05-27T07:32:00Z\n\"sorry\"\nint = 5000\nstring = \"Bite me\"", + "bool = true\ndate = 1979-05-27T07:32:00Z\nfloat = 123.4\nint = \"sorry\"\nstring = \"Bite me\"", + "bool = true\ndate = 1979-05-27T07:32:00Z\nfloat = 123.4\nint = 5000\nstring = 1", +} + +type mapErr struct { + Vals map[string]float64 +} + +type intErr struct { + Int1 int + Int2 int8 + Int3 int16 + Int4 int32 + Int5 int64 + UInt1 uint + UInt2 uint8 + UInt3 uint16 + UInt4 uint32 + UInt5 uint64 + Flt1 float32 + Flt2 float64 +} + +var intErrTomls = []string{ + "Int1 = []\nInt2 = 2\nInt3 = 3\nInt4 = 4\nInt5 = 5\nUInt1 = 1\nUInt2 = 2\nUInt3 = 3\nUInt4 = 4\nUInt5 = 5\nFlt1 = 1.0\nFlt2 = 2.0", + "Int1 = 1\nInt2 = []\nInt3 = 3\nInt4 = 4\nInt5 = 5\nUInt1 = 1\nUInt2 = 2\nUInt3 = 3\nUInt4 = 4\nUInt5 = 5\nFlt1 = 1.0\nFlt2 = 2.0", + "Int1 = 1\nInt2 = 2\nInt3 = []\nInt4 = 4\nInt5 = 5\nUInt1 = 1\nUInt2 = 2\nUInt3 = 3\nUInt4 = 4\nUInt5 = 5\nFlt1 = 1.0\nFlt2 = 2.0", + "Int1 = 1\nInt2 = 2\nInt3 = 3\nInt4 = []\nInt5 = 5\nUInt1 = 1\nUInt2 = 2\nUInt3 = 3\nUInt4 = 4\nUInt5 = 5\nFlt1 = 1.0\nFlt2 = 2.0", + "Int1 = 1\nInt2 = 2\nInt3 = 3\nInt4 = 4\nInt5 = []\nUInt1 = 1\nUInt2 = 2\nUInt3 = 3\nUInt4 = 4\nUInt5 = 5\nFlt1 = 1.0\nFlt2 = 2.0", + "Int1 = 1\nInt2 = 2\nInt3 = 3\nInt4 = 4\nInt5 = 5\nUInt1 = []\nUInt2 = 2\nUInt3 = 3\nUInt4 = 4\nUInt5 = 5\nFlt1 = 1.0\nFlt2 = 2.0", + "Int1 = 1\nInt2 = 2\nInt3 = 3\nInt4 = 4\nInt5 = 5\nUInt1 = 1\nUInt2 = []\nUInt3 = 3\nUInt4 = 4\nUInt5 = 5\nFlt1 = 1.0\nFlt2 = 2.0", + "Int1 = 1\nInt2 = 2\nInt3 = 3\nInt4 = 4\nInt5 = 5\nUInt1 = 1\nUInt2 = 2\nUInt3 = []\nUInt4 = 4\nUInt5 = 5\nFlt1 = 1.0\nFlt2 = 2.0", + "Int1 = 1\nInt2 = 2\nInt3 = 3\nInt4 = 4\nInt5 = 5\nUInt1 = 1\nUInt2 = 2\nUInt3 = 3\nUInt4 = []\nUInt5 = 5\nFlt1 = 1.0\nFlt2 = 2.0", + "Int1 = 1\nInt2 = 2\nInt3 = 3\nInt4 = 4\nInt5 = 5\nUInt1 = 1\nUInt2 = 2\nUInt3 = 3\nUInt4 = 4\nUInt5 = []\nFlt1 = 1.0\nFlt2 = 2.0", + "Int1 = 1\nInt2 = 2\nInt3 = 3\nInt4 = 4\nInt5 = 5\nUInt1 = 1\nUInt2 = 2\nUInt3 = 3\nUInt4 = 4\nUInt5 = 5\nFlt1 = []\nFlt2 = 2.0", + "Int1 = 1\nInt2 = 2\nInt3 = 3\nInt4 = 4\nInt5 = 5\nUInt1 = 1\nUInt2 = 2\nUInt3 = 3\nUInt4 = 4\nUInt5 = 5\nFlt1 = 1.0\nFlt2 = []", +} + +func TestErrUnmarshal(t *testing.T) { + for ind, toml := range errTomls { + result := errStruct{} + err := Unmarshal([]byte(toml), &result) + if err == nil { + t.Errorf("Expected err from case %d\n", ind) + } + } + result2 := mapErr{} + err := Unmarshal([]byte("[Vals]\nfred=\"1.2\""), &result2) + if err == nil { + t.Errorf("Expected err from map") + } + for ind, toml := range intErrTomls { + result3 := intErr{} + err := Unmarshal([]byte(toml), &result3) + if err == nil { + t.Errorf("Expected int err from case %d\n", ind) + } + } +} + +type emptyMarshalTestStruct struct { + Title string `toml:"title"` + Bool bool `toml:"bool"` + Int int `toml:"int"` + String string `toml:"string"` + StringList []string `toml:"stringlist"` + Ptr *basicMarshalTestStruct `toml:"ptr"` + Map map[string]string `toml:"map"` +} + +var emptyTestData = emptyMarshalTestStruct{ + Title: "Placeholder", + Bool: false, + Int: 0, + String: "", + StringList: []string{}, + Ptr: nil, + Map: map[string]string{}, +} + +var emptyTestToml = []byte(`bool = false +int = 0 +string = "" +stringlist = [] +title = "Placeholder" + +[map] +`) + +type emptyMarshalTestStruct2 struct { + Title string `toml:"title"` + Bool bool `toml:"bool,omitempty"` + Int int `toml:"int, omitempty"` + String string `toml:"string,omitempty "` + StringList []string `toml:"stringlist,omitempty"` + Ptr *basicMarshalTestStruct `toml:"ptr,omitempty"` + Map map[string]string `toml:"map,omitempty"` +} + +var emptyTestData2 = emptyMarshalTestStruct2{ + Title: "Placeholder", + Bool: false, + Int: 0, + String: "", + StringList: []string{}, + Ptr: nil, + Map: map[string]string{}, +} + +var emptyTestToml2 = []byte(`title = "Placeholder" +`) + +func TestEmptyMarshal(t *testing.T) { + result, err := Marshal(emptyTestData) + if err != nil { + t.Fatal(err) + } + expected := emptyTestToml + if !bytes.Equal(result, expected) { + t.Errorf("Bad empty marshal: expected\n-----\n%s\n-----\ngot\n-----\n%s\n-----\n", expected, result) + } +} + +func TestEmptyMarshalOmit(t *testing.T) { + result, err := Marshal(emptyTestData2) + if err != nil { + t.Fatal(err) + } + expected := emptyTestToml2 + if !bytes.Equal(result, expected) { + t.Errorf("Bad empty omit marshal: expected\n-----\n%s\n-----\ngot\n-----\n%s\n-----\n", expected, result) + } +} + +func TestEmptyUnmarshal(t *testing.T) { + result := emptyMarshalTestStruct{} + err := Unmarshal(emptyTestToml, &result) + expected := emptyTestData + if err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(result, expected) { + t.Errorf("Bad empty unmarshal: expected %v, got %v", expected, result) + } +} + +func TestEmptyUnmarshalOmit(t *testing.T) { + result := emptyMarshalTestStruct2{} + err := Unmarshal(emptyTestToml, &result) + expected := emptyTestData2 + if err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(result, expected) { + t.Errorf("Bad empty omit unmarshal: expected %v, got %v", expected, result) + } +} + +type pointerMarshalTestStruct struct { + Str *string + List *[]string + ListPtr *[]*string + Map *map[string]string + MapPtr *map[string]*string + EmptyStr *string + EmptyList *[]string + EmptyMap *map[string]string + DblPtr *[]*[]*string +} + +var pointerStr = "Hello" +var pointerList = []string{"Hello back"} +var pointerListPtr = []*string{&pointerStr} +var pointerMap = map[string]string{"response": "Goodbye"} +var pointerMapPtr = map[string]*string{"alternate": &pointerStr} +var pointerTestData = pointerMarshalTestStruct{ + Str: &pointerStr, + List: &pointerList, + ListPtr: &pointerListPtr, + Map: &pointerMap, + MapPtr: &pointerMapPtr, + EmptyStr: nil, + EmptyList: nil, + EmptyMap: nil, +} + +var pointerTestToml = []byte(`List = ["Hello back"] +ListPtr = ["Hello"] +Str = "Hello" + +[Map] + response = "Goodbye" + +[MapPtr] + alternate = "Hello" +`) + +func TestPointerMarshal(t *testing.T) { + result, err := Marshal(pointerTestData) + if err != nil { + t.Fatal(err) + } + expected := pointerTestToml + if !bytes.Equal(result, expected) { + t.Errorf("Bad pointer marshal: expected\n-----\n%s\n-----\ngot\n-----\n%s\n-----\n", expected, result) + } +} + +func TestPointerUnmarshal(t *testing.T) { + result := pointerMarshalTestStruct{} + err := Unmarshal(pointerTestToml, &result) + expected := pointerTestData + if err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(result, expected) { + t.Errorf("Bad pointer unmarshal: expected %v, got %v", expected, result) + } +} + +type nestedMarshalTestStruct struct { + String [][]string + //Struct [][]basicMarshalTestSubStruct + StringPtr *[]*[]*string + // StructPtr *[]*[]*basicMarshalTestSubStruct +} + +var str1 = "Three" +var str2 = "Four" +var strPtr = []*string{&str1, &str2} +var strPtr2 = []*[]*string{&strPtr} + +var nestedTestData = nestedMarshalTestStruct{ + String: [][]string{[]string{"Five", "Six"}, []string{"One", "Two"}}, + StringPtr: &strPtr2, +} + +var nestedTestToml = []byte(`String = [["Five","Six"],["One","Two"]] +StringPtr = [["Three","Four"]] +`) + +func TestNestedMarshal(t *testing.T) { + result, err := Marshal(nestedTestData) + if err != nil { + t.Fatal(err) + } + expected := nestedTestToml + if !bytes.Equal(result, expected) { + t.Errorf("Bad nested marshal: expected\n-----\n%s\n-----\ngot\n-----\n%s\n-----\n", expected, result) + } +} + +func TestNestedUnmarshal(t *testing.T) { + result := nestedMarshalTestStruct{} + err := Unmarshal(nestedTestToml, &result) + expected := nestedTestData + if err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(result, expected) { + t.Errorf("Bad nested unmarshal: expected %v, got %v", expected, result) + } +} + +type customMarshalerParent struct { + Self customMarshaler `toml:"me"` + Friends []customMarshaler `toml:"friends"` +} + +type customMarshaler struct { + FirsName string + LastName string +} + +func (c customMarshaler) MarshalTOML() ([]byte, error) { + fullName := fmt.Sprintf("%s %s", c.FirsName, c.LastName) + return []byte(fullName), nil +} + +var customMarshalerData = customMarshaler{FirsName: "Sally", LastName: "Fields"} +var customMarshalerToml = []byte(`Sally Fields`) +var nestedCustomMarshalerData = customMarshalerParent{ + Self: customMarshaler{FirsName: "Maiku", LastName: "Suteda"}, + Friends: []customMarshaler{customMarshalerData}, +} +var nestedCustomMarshalerToml = []byte(`friends = ["Sally Fields"] +me = "Maiku Suteda" +`) + +func TestCustomMarshaler(t *testing.T) { + result, err := Marshal(customMarshalerData) + if err != nil { + t.Fatal(err) + } + expected := customMarshalerToml + if !bytes.Equal(result, expected) { + t.Errorf("Bad custom marshaler: expected\n-----\n%s\n-----\ngot\n-----\n%s\n-----\n", expected, result) + } +} + +func TestNestedCustomMarshaler(t *testing.T) { + result, err := Marshal(nestedCustomMarshalerData) + if err != nil { + t.Fatal(err) + } + expected := nestedCustomMarshalerToml + if !bytes.Equal(result, expected) { + t.Errorf("Bad nested custom marshaler: expected\n-----\n%s\n-----\ngot\n-----\n%s\n-----\n", expected, result) + } +} diff --git a/vendor/github.com/pelletier/go-toml/marshal_test.toml b/vendor/github.com/pelletier/go-toml/marshal_test.toml new file mode 100644 index 0000000000..1c5f98e7a8 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/marshal_test.toml @@ -0,0 +1,38 @@ +title = "TOML Marshal Testing" + +[basic] + bool = true + date = 1979-05-27T07:32:00Z + float = 123.4 + int = 5000 + string = "Bite me" + uint = 5001 + +[basic_lists] + bools = [true,false,true] + dates = [1979-05-27T07:32:00Z,1980-05-27T07:32:00Z] + floats = [12.3,45.6,78.9] + ints = [8001,8001,8002] + strings = ["One","Two","Three"] + uints = [5002,5003] + +[basic_map] + one = "one" + two = "two" + +[subdoc] + + [subdoc.first] + name = "First" + + [subdoc.second] + name = "Second" + +[[subdoclist]] + name = "List.First" + +[[subdoclist]] + name = "List.Second" + +[[subdocptrs]] + name = "Second" diff --git a/vendor/github.com/pelletier/go-toml/parser.go b/vendor/github.com/pelletier/go-toml/parser.go new file mode 100644 index 0000000000..8ee49cb564 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/parser.go @@ -0,0 +1,383 @@ +// TOML Parser. + +package toml + +import ( + "errors" + "fmt" + "reflect" + "regexp" + "strconv" + "strings" + "time" +) + +type tomlParser struct { + flowIdx int + flow []token + tree *Tree + currentTable []string + seenTableKeys []string +} + +type tomlParserStateFn func() tomlParserStateFn + +// Formats and panics an error message based on a token +func (p *tomlParser) raiseError(tok *token, msg string, args ...interface{}) { + panic(tok.Position.String() + ": " + fmt.Sprintf(msg, args...)) +} + +func (p *tomlParser) run() { + for state := p.parseStart; state != nil; { + state = state() + } +} + +func (p *tomlParser) peek() *token { + if p.flowIdx >= len(p.flow) { + return nil + } + return &p.flow[p.flowIdx] +} + +func (p *tomlParser) assume(typ tokenType) { + tok := p.getToken() + if tok == nil { + p.raiseError(tok, "was expecting token %s, but token stream is empty", tok) + } + if tok.typ != typ { + p.raiseError(tok, "was expecting token %s, but got %s instead", typ, tok) + } +} + +func (p *tomlParser) getToken() *token { + tok := p.peek() + if tok == nil { + return nil + } + p.flowIdx++ + return tok +} + +func (p *tomlParser) parseStart() tomlParserStateFn { + tok := p.peek() + + // end of stream, parsing is finished + if tok == nil { + return nil + } + + switch tok.typ { + case tokenDoubleLeftBracket: + return p.parseGroupArray + case tokenLeftBracket: + return p.parseGroup + case tokenKey: + return p.parseAssign + case tokenEOF: + return nil + default: + p.raiseError(tok, "unexpected token") + } + return nil +} + +func (p *tomlParser) parseGroupArray() tomlParserStateFn { + startToken := p.getToken() // discard the [[ + key := p.getToken() + if key.typ != tokenKeyGroupArray { + p.raiseError(key, "unexpected token %s, was expecting a table array key", key) + } + + // get or create table array element at the indicated part in the path + keys, err := parseKey(key.val) + if err != nil { + p.raiseError(key, "invalid table array key: %s", err) + } + p.tree.createSubTree(keys[:len(keys)-1], startToken.Position) // create parent entries + destTree := p.tree.GetPath(keys) + var array []*Tree + if destTree == nil { + array = make([]*Tree, 0) + } else if target, ok := destTree.([]*Tree); ok && target != nil { + array = destTree.([]*Tree) + } else { + p.raiseError(key, "key %s is already assigned and not of type table array", key) + } + p.currentTable = keys + + // add a new tree to the end of the table array + newTree := newTree() + newTree.position = startToken.Position + array = append(array, newTree) + p.tree.SetPath(p.currentTable, array) + + // remove all keys that were children of this table array + prefix := key.val + "." + found := false + for ii := 0; ii < len(p.seenTableKeys); { + tableKey := p.seenTableKeys[ii] + if strings.HasPrefix(tableKey, prefix) { + p.seenTableKeys = append(p.seenTableKeys[:ii], p.seenTableKeys[ii+1:]...) + } else { + found = (tableKey == key.val) + ii++ + } + } + + // keep this key name from use by other kinds of assignments + if !found { + p.seenTableKeys = append(p.seenTableKeys, key.val) + } + + // move to next parser state + p.assume(tokenDoubleRightBracket) + return p.parseStart +} + +func (p *tomlParser) parseGroup() tomlParserStateFn { + startToken := p.getToken() // discard the [ + key := p.getToken() + if key.typ != tokenKeyGroup { + p.raiseError(key, "unexpected token %s, was expecting a table key", key) + } + for _, item := range p.seenTableKeys { + if item == key.val { + p.raiseError(key, "duplicated tables") + } + } + + p.seenTableKeys = append(p.seenTableKeys, key.val) + keys, err := parseKey(key.val) + if err != nil { + p.raiseError(key, "invalid table array key: %s", err) + } + if err := p.tree.createSubTree(keys, startToken.Position); err != nil { + p.raiseError(key, "%s", err) + } + p.assume(tokenRightBracket) + p.currentTable = keys + return p.parseStart +} + +func (p *tomlParser) parseAssign() tomlParserStateFn { + key := p.getToken() + p.assume(tokenEqual) + + value := p.parseRvalue() + var tableKey []string + if len(p.currentTable) > 0 { + tableKey = p.currentTable + } else { + tableKey = []string{} + } + + // find the table to assign, looking out for arrays of tables + var targetNode *Tree + switch node := p.tree.GetPath(tableKey).(type) { + case []*Tree: + targetNode = node[len(node)-1] + case *Tree: + targetNode = node + default: + p.raiseError(key, "Unknown table type for path: %s", + strings.Join(tableKey, ".")) + } + + // assign value to the found table + keyVals, err := parseKey(key.val) + if err != nil { + p.raiseError(key, "%s", err) + } + if len(keyVals) != 1 { + p.raiseError(key, "Invalid key") + } + keyVal := keyVals[0] + localKey := []string{keyVal} + finalKey := append(tableKey, keyVal) + if targetNode.GetPath(localKey) != nil { + p.raiseError(key, "The following key was defined twice: %s", + strings.Join(finalKey, ".")) + } + var toInsert interface{} + + switch value.(type) { + case *Tree, []*Tree: + toInsert = value + default: + toInsert = &tomlValue{value, key.Position} + } + targetNode.values[keyVal] = toInsert + return p.parseStart +} + +var numberUnderscoreInvalidRegexp *regexp.Regexp + +func cleanupNumberToken(value string) (string, error) { + if numberUnderscoreInvalidRegexp.MatchString(value) { + return "", errors.New("invalid use of _ in number") + } + cleanedVal := strings.Replace(value, "_", "", -1) + return cleanedVal, nil +} + +func (p *tomlParser) parseRvalue() interface{} { + tok := p.getToken() + if tok == nil || tok.typ == tokenEOF { + p.raiseError(tok, "expecting a value") + } + + switch tok.typ { + case tokenString: + return tok.val + case tokenTrue: + return true + case tokenFalse: + return false + case tokenInteger: + cleanedVal, err := cleanupNumberToken(tok.val) + if err != nil { + p.raiseError(tok, "%s", err) + } + val, err := strconv.ParseInt(cleanedVal, 10, 64) + if err != nil { + p.raiseError(tok, "%s", err) + } + return val + case tokenFloat: + cleanedVal, err := cleanupNumberToken(tok.val) + if err != nil { + p.raiseError(tok, "%s", err) + } + val, err := strconv.ParseFloat(cleanedVal, 64) + if err != nil { + p.raiseError(tok, "%s", err) + } + return val + case tokenDate: + val, err := time.ParseInLocation(time.RFC3339Nano, tok.val, time.UTC) + if err != nil { + p.raiseError(tok, "%s", err) + } + return val + case tokenLeftBracket: + return p.parseArray() + case tokenLeftCurlyBrace: + return p.parseInlineTable() + case tokenEqual: + p.raiseError(tok, "cannot have multiple equals for the same key") + case tokenError: + p.raiseError(tok, "%s", tok) + } + + p.raiseError(tok, "never reached") + + return nil +} + +func tokenIsComma(t *token) bool { + return t != nil && t.typ == tokenComma +} + +func (p *tomlParser) parseInlineTable() *Tree { + tree := newTree() + var previous *token +Loop: + for { + follow := p.peek() + if follow == nil || follow.typ == tokenEOF { + p.raiseError(follow, "unterminated inline table") + } + switch follow.typ { + case tokenRightCurlyBrace: + p.getToken() + break Loop + case tokenKey: + if !tokenIsComma(previous) && previous != nil { + p.raiseError(follow, "comma expected between fields in inline table") + } + key := p.getToken() + p.assume(tokenEqual) + value := p.parseRvalue() + tree.Set(key.val, value) + case tokenComma: + if previous == nil { + p.raiseError(follow, "inline table cannot start with a comma") + } + if tokenIsComma(previous) { + p.raiseError(follow, "need field between two commas in inline table") + } + p.getToken() + default: + p.raiseError(follow, "unexpected token type in inline table: %s", follow.typ.String()) + } + previous = follow + } + if tokenIsComma(previous) { + p.raiseError(previous, "trailing comma at the end of inline table") + } + return tree +} + +func (p *tomlParser) parseArray() interface{} { + var array []interface{} + arrayType := reflect.TypeOf(nil) + for { + follow := p.peek() + if follow == nil || follow.typ == tokenEOF { + p.raiseError(follow, "unterminated array") + } + if follow.typ == tokenRightBracket { + p.getToken() + break + } + val := p.parseRvalue() + if arrayType == nil { + arrayType = reflect.TypeOf(val) + } + if reflect.TypeOf(val) != arrayType { + p.raiseError(follow, "mixed types in array") + } + array = append(array, val) + follow = p.peek() + if follow == nil || follow.typ == tokenEOF { + p.raiseError(follow, "unterminated array") + } + if follow.typ != tokenRightBracket && follow.typ != tokenComma { + p.raiseError(follow, "missing comma") + } + if follow.typ == tokenComma { + p.getToken() + } + } + // An array of Trees is actually an array of inline + // tables, which is a shorthand for a table array. If the + // array was not converted from []interface{} to []*Tree, + // the two notations would not be equivalent. + if arrayType == reflect.TypeOf(newTree()) { + tomlArray := make([]*Tree, len(array)) + for i, v := range array { + tomlArray[i] = v.(*Tree) + } + return tomlArray + } + return array +} + +func parseToml(flow []token) *Tree { + result := newTree() + result.position = Position{1, 1} + parser := &tomlParser{ + flowIdx: 0, + flow: flow, + tree: result, + currentTable: make([]string, 0), + seenTableKeys: make([]string, 0), + } + parser.run() + return result +} + +func init() { + numberUnderscoreInvalidRegexp = regexp.MustCompile(`([^\d]_|_[^\d]|_$|^_)`) +} diff --git a/vendor/github.com/pelletier/go-toml/parser_test.go b/vendor/github.com/pelletier/go-toml/parser_test.go new file mode 100644 index 0000000000..508cb65f01 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/parser_test.go @@ -0,0 +1,785 @@ +package toml + +import ( + "fmt" + "reflect" + "testing" + "time" + + "github.com/davecgh/go-spew/spew" +) + +func assertSubTree(t *testing.T, path []string, tree *Tree, err error, ref map[string]interface{}) { + if err != nil { + t.Error("Non-nil error:", err.Error()) + return + } + for k, v := range ref { + nextPath := append(path, k) + t.Log("asserting path", nextPath) + // NOTE: directly access key instead of resolve by path + // NOTE: see TestSpecialKV + switch node := tree.GetPath([]string{k}).(type) { + case []*Tree: + t.Log("\tcomparing key", nextPath, "by array iteration") + for idx, item := range node { + assertSubTree(t, nextPath, item, err, v.([]map[string]interface{})[idx]) + } + case *Tree: + t.Log("\tcomparing key", nextPath, "by subtree assestion") + assertSubTree(t, nextPath, node, err, v.(map[string]interface{})) + default: + t.Log("\tcomparing key", nextPath, "by string representation because it's of type", reflect.TypeOf(node)) + if fmt.Sprintf("%v", node) != fmt.Sprintf("%v", v) { + t.Errorf("was expecting %v at %v but got %v", v, k, node) + } + } + } +} + +func assertTree(t *testing.T, tree *Tree, err error, ref map[string]interface{}) { + t.Log("Asserting tree:\n", spew.Sdump(tree)) + assertSubTree(t, []string{}, tree, err, ref) + t.Log("Finished tree assertion.") +} + +func TestCreateSubTree(t *testing.T) { + tree := newTree() + tree.createSubTree([]string{"a", "b", "c"}, Position{}) + tree.Set("a.b.c", 42) + if tree.Get("a.b.c") != 42 { + t.Fail() + } +} + +func TestSimpleKV(t *testing.T) { + tree, err := Load("a = 42") + assertTree(t, tree, err, map[string]interface{}{ + "a": int64(42), + }) + + tree, _ = Load("a = 42\nb = 21") + assertTree(t, tree, err, map[string]interface{}{ + "a": int64(42), + "b": int64(21), + }) +} + +func TestNumberInKey(t *testing.T) { + tree, err := Load("hello2 = 42") + assertTree(t, tree, err, map[string]interface{}{ + "hello2": int64(42), + }) +} + +func TestSimpleNumbers(t *testing.T) { + tree, err := Load("a = +42\nb = -21\nc = +4.2\nd = -2.1") + assertTree(t, tree, err, map[string]interface{}{ + "a": int64(42), + "b": int64(-21), + "c": float64(4.2), + "d": float64(-2.1), + }) +} + +func TestNumbersWithUnderscores(t *testing.T) { + tree, err := Load("a = 1_000") + assertTree(t, tree, err, map[string]interface{}{ + "a": int64(1000), + }) + + tree, err = Load("a = 5_349_221") + assertTree(t, tree, err, map[string]interface{}{ + "a": int64(5349221), + }) + + tree, err = Load("a = 1_2_3_4_5") + assertTree(t, tree, err, map[string]interface{}{ + "a": int64(12345), + }) + + tree, err = Load("flt8 = 9_224_617.445_991_228_313") + assertTree(t, tree, err, map[string]interface{}{ + "flt8": float64(9224617.445991228313), + }) + + tree, err = Load("flt9 = 1e1_00") + assertTree(t, tree, err, map[string]interface{}{ + "flt9": float64(1e100), + }) +} + +func TestFloatsWithExponents(t *testing.T) { + tree, err := Load("a = 5e+22\nb = 5E+22\nc = -5e+22\nd = -5e-22\ne = 6.626e-34") + assertTree(t, tree, err, map[string]interface{}{ + "a": float64(5e+22), + "b": float64(5E+22), + "c": float64(-5e+22), + "d": float64(-5e-22), + "e": float64(6.626e-34), + }) +} + +func TestSimpleDate(t *testing.T) { + tree, err := Load("a = 1979-05-27T07:32:00Z") + assertTree(t, tree, err, map[string]interface{}{ + "a": time.Date(1979, time.May, 27, 7, 32, 0, 0, time.UTC), + }) +} + +func TestDateOffset(t *testing.T) { + tree, err := Load("a = 1979-05-27T00:32:00-07:00") + assertTree(t, tree, err, map[string]interface{}{ + "a": time.Date(1979, time.May, 27, 0, 32, 0, 0, time.FixedZone("", -7*60*60)), + }) +} + +func TestDateNano(t *testing.T) { + tree, err := Load("a = 1979-05-27T00:32:00.999999999-07:00") + assertTree(t, tree, err, map[string]interface{}{ + "a": time.Date(1979, time.May, 27, 0, 32, 0, 999999999, time.FixedZone("", -7*60*60)), + }) +} + +func TestSimpleString(t *testing.T) { + tree, err := Load("a = \"hello world\"") + assertTree(t, tree, err, map[string]interface{}{ + "a": "hello world", + }) +} + +func TestSpaceKey(t *testing.T) { + tree, err := Load("\"a b\" = \"hello world\"") + assertTree(t, tree, err, map[string]interface{}{ + "a b": "hello world", + }) +} + +func TestStringEscapables(t *testing.T) { + tree, err := Load("a = \"a \\n b\"") + assertTree(t, tree, err, map[string]interface{}{ + "a": "a \n b", + }) + + tree, err = Load("a = \"a \\t b\"") + assertTree(t, tree, err, map[string]interface{}{ + "a": "a \t b", + }) + + tree, err = Load("a = \"a \\r b\"") + assertTree(t, tree, err, map[string]interface{}{ + "a": "a \r b", + }) + + tree, err = Load("a = \"a \\\\ b\"") + assertTree(t, tree, err, map[string]interface{}{ + "a": "a \\ b", + }) +} + +func TestEmptyQuotedString(t *testing.T) { + tree, err := Load(`[""] +"" = 1`) + assertTree(t, tree, err, map[string]interface{}{ + "": map[string]interface{}{ + "": int64(1), + }, + }) +} + +func TestBools(t *testing.T) { + tree, err := Load("a = true\nb = false") + assertTree(t, tree, err, map[string]interface{}{ + "a": true, + "b": false, + }) +} + +func TestNestedKeys(t *testing.T) { + tree, err := Load("[a.b.c]\nd = 42") + assertTree(t, tree, err, map[string]interface{}{ + "a": map[string]interface{}{ + "b": map[string]interface{}{ + "c": map[string]interface{}{ + "d": int64(42), + }, + }, + }, + }) +} + +func TestNestedQuotedUnicodeKeys(t *testing.T) { + tree, err := Load("[ j . \"ʞ\" . l ]\nd = 42") + assertTree(t, tree, err, map[string]interface{}{ + "j": map[string]interface{}{ + "ʞ": map[string]interface{}{ + "l": map[string]interface{}{ + "d": int64(42), + }, + }, + }, + }) + + tree, err = Load("[ g . h . i ]\nd = 42") + assertTree(t, tree, err, map[string]interface{}{ + "g": map[string]interface{}{ + "h": map[string]interface{}{ + "i": map[string]interface{}{ + "d": int64(42), + }, + }, + }, + }) + + tree, err = Load("[ d.e.f ]\nk = 42") + assertTree(t, tree, err, map[string]interface{}{ + "d": map[string]interface{}{ + "e": map[string]interface{}{ + "f": map[string]interface{}{ + "k": int64(42), + }, + }, + }, + }) +} + +func TestArrayOne(t *testing.T) { + tree, err := Load("a = [1]") + assertTree(t, tree, err, map[string]interface{}{ + "a": []int64{int64(1)}, + }) +} + +func TestArrayZero(t *testing.T) { + tree, err := Load("a = []") + assertTree(t, tree, err, map[string]interface{}{ + "a": []interface{}{}, + }) +} + +func TestArraySimple(t *testing.T) { + tree, err := Load("a = [42, 21, 10]") + assertTree(t, tree, err, map[string]interface{}{ + "a": []int64{int64(42), int64(21), int64(10)}, + }) + + tree, _ = Load("a = [42, 21, 10,]") + assertTree(t, tree, err, map[string]interface{}{ + "a": []int64{int64(42), int64(21), int64(10)}, + }) +} + +func TestArrayMultiline(t *testing.T) { + tree, err := Load("a = [42,\n21, 10,]") + assertTree(t, tree, err, map[string]interface{}{ + "a": []int64{int64(42), int64(21), int64(10)}, + }) +} + +func TestArrayNested(t *testing.T) { + tree, err := Load("a = [[42, 21], [10]]") + assertTree(t, tree, err, map[string]interface{}{ + "a": [][]int64{{int64(42), int64(21)}, {int64(10)}}, + }) +} + +func TestNestedArrayComment(t *testing.T) { + tree, err := Load(` +someArray = [ +# does not work +["entry1"] +]`) + assertTree(t, tree, err, map[string]interface{}{ + "someArray": [][]string{{"entry1"}}, + }) +} + +func TestNestedEmptyArrays(t *testing.T) { + tree, err := Load("a = [[[]]]") + assertTree(t, tree, err, map[string]interface{}{ + "a": [][][]interface{}{{{}}}, + }) +} + +func TestArrayMixedTypes(t *testing.T) { + _, err := Load("a = [42, 16.0]") + if err.Error() != "(1, 10): mixed types in array" { + t.Error("Bad error message:", err.Error()) + } + + _, err = Load("a = [42, \"hello\"]") + if err.Error() != "(1, 11): mixed types in array" { + t.Error("Bad error message:", err.Error()) + } +} + +func TestArrayNestedStrings(t *testing.T) { + tree, err := Load("data = [ [\"gamma\", \"delta\"], [\"Foo\"] ]") + assertTree(t, tree, err, map[string]interface{}{ + "data": [][]string{{"gamma", "delta"}, {"Foo"}}, + }) +} + +func TestParseUnknownRvalue(t *testing.T) { + _, err := Load("a = !bssss") + if err == nil { + t.Error("Expecting a parse error") + } + + _, err = Load("a = /b") + if err == nil { + t.Error("Expecting a parse error") + } +} + +func TestMissingValue(t *testing.T) { + _, err := Load("a = ") + if err.Error() != "(1, 5): expecting a value" { + t.Error("Bad error message:", err.Error()) + } +} + +func TestUnterminatedArray(t *testing.T) { + _, err := Load("a = [1,") + if err.Error() != "(1, 8): unterminated array" { + t.Error("Bad error message:", err.Error()) + } + + _, err = Load("a = [1") + if err.Error() != "(1, 7): unterminated array" { + t.Error("Bad error message:", err.Error()) + } + + _, err = Load("a = [1 2") + if err.Error() != "(1, 8): missing comma" { + t.Error("Bad error message:", err.Error()) + } +} + +func TestNewlinesInArrays(t *testing.T) { + tree, err := Load("a = [1,\n2,\n3]") + assertTree(t, tree, err, map[string]interface{}{ + "a": []int64{int64(1), int64(2), int64(3)}, + }) +} + +func TestArrayWithExtraComma(t *testing.T) { + tree, err := Load("a = [1,\n2,\n3,\n]") + assertTree(t, tree, err, map[string]interface{}{ + "a": []int64{int64(1), int64(2), int64(3)}, + }) +} + +func TestArrayWithExtraCommaComment(t *testing.T) { + tree, err := Load("a = [1, # wow\n2, # such items\n3, # so array\n]") + assertTree(t, tree, err, map[string]interface{}{ + "a": []int64{int64(1), int64(2), int64(3)}, + }) +} + +func TestSimpleInlineGroup(t *testing.T) { + tree, err := Load("key = {a = 42}") + assertTree(t, tree, err, map[string]interface{}{ + "key": map[string]interface{}{ + "a": int64(42), + }, + }) +} + +func TestDoubleInlineGroup(t *testing.T) { + tree, err := Load("key = {a = 42, b = \"foo\"}") + assertTree(t, tree, err, map[string]interface{}{ + "key": map[string]interface{}{ + "a": int64(42), + "b": "foo", + }, + }) +} + +func TestExampleInlineGroup(t *testing.T) { + tree, err := Load(`name = { first = "Tom", last = "Preston-Werner" } +point = { x = 1, y = 2 }`) + assertTree(t, tree, err, map[string]interface{}{ + "name": map[string]interface{}{ + "first": "Tom", + "last": "Preston-Werner", + }, + "point": map[string]interface{}{ + "x": int64(1), + "y": int64(2), + }, + }) +} + +func TestExampleInlineGroupInArray(t *testing.T) { + tree, err := Load(`points = [{ x = 1, y = 2 }]`) + assertTree(t, tree, err, map[string]interface{}{ + "points": []map[string]interface{}{ + { + "x": int64(1), + "y": int64(2), + }, + }, + }) +} + +func TestInlineTableUnterminated(t *testing.T) { + _, err := Load("foo = {") + if err.Error() != "(1, 8): unterminated inline table" { + t.Error("Bad error message:", err.Error()) + } +} + +func TestInlineTableCommaExpected(t *testing.T) { + _, err := Load("foo = {hello = 53 test = foo}") + if err.Error() != "(1, 19): comma expected between fields in inline table" { + t.Error("Bad error message:", err.Error()) + } +} + +func TestInlineTableCommaStart(t *testing.T) { + _, err := Load("foo = {, hello = 53}") + if err.Error() != "(1, 8): inline table cannot start with a comma" { + t.Error("Bad error message:", err.Error()) + } +} + +func TestInlineTableDoubleComma(t *testing.T) { + _, err := Load("foo = {hello = 53,, foo = 17}") + if err.Error() != "(1, 19): need field between two commas in inline table" { + t.Error("Bad error message:", err.Error()) + } +} + +func TestDuplicateGroups(t *testing.T) { + _, err := Load("[foo]\na=2\n[foo]b=3") + if err.Error() != "(3, 2): duplicated tables" { + t.Error("Bad error message:", err.Error()) + } +} + +func TestDuplicateKeys(t *testing.T) { + _, err := Load("foo = 2\nfoo = 3") + if err.Error() != "(2, 1): The following key was defined twice: foo" { + t.Error("Bad error message:", err.Error()) + } +} + +func TestEmptyIntermediateTable(t *testing.T) { + _, err := Load("[foo..bar]") + if err.Error() != "(1, 2): invalid table array key: empty table key" { + t.Error("Bad error message:", err.Error()) + } +} + +func TestImplicitDeclarationBefore(t *testing.T) { + tree, err := Load("[a.b.c]\nanswer = 42\n[a]\nbetter = 43") + assertTree(t, tree, err, map[string]interface{}{ + "a": map[string]interface{}{ + "b": map[string]interface{}{ + "c": map[string]interface{}{ + "answer": int64(42), + }, + }, + "better": int64(43), + }, + }) +} + +func TestFloatsWithoutLeadingZeros(t *testing.T) { + _, err := Load("a = .42") + if err.Error() != "(1, 5): cannot start float with a dot" { + t.Error("Bad error message:", err.Error()) + } + + _, err = Load("a = -.42") + if err.Error() != "(1, 5): cannot start float with a dot" { + t.Error("Bad error message:", err.Error()) + } +} + +func TestMissingFile(t *testing.T) { + _, err := LoadFile("foo.toml") + if err.Error() != "open foo.toml: no such file or directory" && + err.Error() != "open foo.toml: The system cannot find the file specified." { + t.Error("Bad error message:", err.Error()) + } +} + +func TestParseFile(t *testing.T) { + tree, err := LoadFile("example.toml") + + assertTree(t, tree, err, map[string]interface{}{ + "title": "TOML Example", + "owner": map[string]interface{}{ + "name": "Tom Preston-Werner", + "organization": "GitHub", + "bio": "GitHub Cofounder & CEO\nLikes tater tots and beer.", + "dob": time.Date(1979, time.May, 27, 7, 32, 0, 0, time.UTC), + }, + "database": map[string]interface{}{ + "server": "192.168.1.1", + "ports": []int64{8001, 8001, 8002}, + "connection_max": 5000, + "enabled": true, + }, + "servers": map[string]interface{}{ + "alpha": map[string]interface{}{ + "ip": "10.0.0.1", + "dc": "eqdc10", + }, + "beta": map[string]interface{}{ + "ip": "10.0.0.2", + "dc": "eqdc10", + }, + }, + "clients": map[string]interface{}{ + "data": []interface{}{ + []string{"gamma", "delta"}, + []int64{1, 2}, + }, + }, + }) +} + +func TestParseFileCRLF(t *testing.T) { + tree, err := LoadFile("example-crlf.toml") + + assertTree(t, tree, err, map[string]interface{}{ + "title": "TOML Example", + "owner": map[string]interface{}{ + "name": "Tom Preston-Werner", + "organization": "GitHub", + "bio": "GitHub Cofounder & CEO\nLikes tater tots and beer.", + "dob": time.Date(1979, time.May, 27, 7, 32, 0, 0, time.UTC), + }, + "database": map[string]interface{}{ + "server": "192.168.1.1", + "ports": []int64{8001, 8001, 8002}, + "connection_max": 5000, + "enabled": true, + }, + "servers": map[string]interface{}{ + "alpha": map[string]interface{}{ + "ip": "10.0.0.1", + "dc": "eqdc10", + }, + "beta": map[string]interface{}{ + "ip": "10.0.0.2", + "dc": "eqdc10", + }, + }, + "clients": map[string]interface{}{ + "data": []interface{}{ + []string{"gamma", "delta"}, + []int64{1, 2}, + }, + }, + }) +} + +func TestParseKeyGroupArray(t *testing.T) { + tree, err := Load("[[foo.bar]] a = 42\n[[foo.bar]] a = 69") + assertTree(t, tree, err, map[string]interface{}{ + "foo": map[string]interface{}{ + "bar": []map[string]interface{}{ + {"a": int64(42)}, + {"a": int64(69)}, + }, + }, + }) +} + +func TestParseKeyGroupArrayUnfinished(t *testing.T) { + _, err := Load("[[foo.bar]\na = 42") + if err.Error() != "(1, 10): was expecting token [[, but got unclosed table array key instead" { + t.Error("Bad error message:", err.Error()) + } + + _, err = Load("[[foo.[bar]\na = 42") + if err.Error() != "(1, 3): unexpected token table array key cannot contain ']', was expecting a table array key" { + t.Error("Bad error message:", err.Error()) + } +} + +func TestParseKeyGroupArrayQueryExample(t *testing.T) { + tree, err := Load(` + [[book]] + title = "The Stand" + author = "Stephen King" + [[book]] + title = "For Whom the Bell Tolls" + author = "Ernest Hemmingway" + [[book]] + title = "Neuromancer" + author = "William Gibson" + `) + + assertTree(t, tree, err, map[string]interface{}{ + "book": []map[string]interface{}{ + {"title": "The Stand", "author": "Stephen King"}, + {"title": "For Whom the Bell Tolls", "author": "Ernest Hemmingway"}, + {"title": "Neuromancer", "author": "William Gibson"}, + }, + }) +} + +func TestParseKeyGroupArraySpec(t *testing.T) { + tree, err := Load("[[fruit]]\n name=\"apple\"\n [fruit.physical]\n color=\"red\"\n shape=\"round\"\n [[fruit]]\n name=\"banana\"") + assertTree(t, tree, err, map[string]interface{}{ + "fruit": []map[string]interface{}{ + {"name": "apple", "physical": map[string]interface{}{"color": "red", "shape": "round"}}, + {"name": "banana"}, + }, + }) +} + +func TestTomlValueStringRepresentation(t *testing.T) { + for idx, item := range []struct { + Value interface{} + Expect string + }{ + {int64(12345), "12345"}, + {uint64(50), "50"}, + {float64(123.45), "123.45"}, + {bool(true), "true"}, + {"hello world", "\"hello world\""}, + {"\b\t\n\f\r\"\\", "\"\\b\\t\\n\\f\\r\\\"\\\\\""}, + {"\x05", "\"\\u0005\""}, + {time.Date(1979, time.May, 27, 7, 32, 0, 0, time.UTC), + "1979-05-27T07:32:00Z"}, + {[]interface{}{"gamma", "delta"}, + "[\"gamma\",\"delta\"]"}, + {nil, ""}, + } { + result, err := tomlValueStringRepresentation(item.Value) + if err != nil { + t.Errorf("Test %d - unexpected error: %s", idx, err) + } + if result != item.Expect { + t.Errorf("Test %d - got '%s', expected '%s'", idx, result, item.Expect) + } + } +} + +func TestToStringMapStringString(t *testing.T) { + tree, err := TreeFromMap(map[string]interface{}{"m": map[string]interface{}{"v": "abc"}}) + if err != nil { + t.Fatalf("unexpected error: %s", err) + } + want := "\n[m]\n v = \"abc\"\n" + got := tree.String() + + if got != want { + t.Errorf("want:\n%q\ngot:\n%q", want, got) + } +} + +func assertPosition(t *testing.T, text string, ref map[string]Position) { + tree, err := Load(text) + if err != nil { + t.Errorf("Error loading document text: `%v`", text) + t.Errorf("Error: %v", err) + } + for path, pos := range ref { + testPos := tree.GetPosition(path) + if testPos.Invalid() { + t.Errorf("Failed to query tree path or path has invalid position: %s", path) + } else if pos != testPos { + t.Errorf("Expected position %v, got %v instead", pos, testPos) + } + } +} + +func TestDocumentPositions(t *testing.T) { + assertPosition(t, + "[foo]\nbar=42\nbaz=69", + map[string]Position{ + "": {1, 1}, + "foo": {1, 1}, + "foo.bar": {2, 1}, + "foo.baz": {3, 1}, + }) +} + +func TestDocumentPositionsWithSpaces(t *testing.T) { + assertPosition(t, + " [foo]\n bar=42\n baz=69", + map[string]Position{ + "": {1, 1}, + "foo": {1, 3}, + "foo.bar": {2, 3}, + "foo.baz": {3, 3}, + }) +} + +func TestDocumentPositionsWithGroupArray(t *testing.T) { + assertPosition(t, + "[[foo]]\nbar=42\nbaz=69", + map[string]Position{ + "": {1, 1}, + "foo": {1, 1}, + "foo.bar": {2, 1}, + "foo.baz": {3, 1}, + }) +} + +func TestNestedTreePosition(t *testing.T) { + assertPosition(t, + "[foo.bar]\na=42\nb=69", + map[string]Position{ + "": {1, 1}, + "foo": {1, 1}, + "foo.bar": {1, 1}, + "foo.bar.a": {2, 1}, + "foo.bar.b": {3, 1}, + }) +} + +func TestInvalidGroupArray(t *testing.T) { + _, err := Load("[table#key]\nanswer = 42") + if err == nil { + t.Error("Should error") + } + + _, err = Load("[foo.[bar]\na = 42") + if err.Error() != "(1, 2): unexpected token table key cannot contain ']', was expecting a table key" { + t.Error("Bad error message:", err.Error()) + } +} + +func TestDoubleEqual(t *testing.T) { + _, err := Load("foo= = 2") + if err.Error() != "(1, 6): cannot have multiple equals for the same key" { + t.Error("Bad error message:", err.Error()) + } +} + +func TestGroupArrayReassign(t *testing.T) { + _, err := Load("[hello]\n[[hello]]") + if err.Error() != "(2, 3): key \"hello\" is already assigned and not of type table array" { + t.Error("Bad error message:", err.Error()) + } +} + +func TestInvalidFloatParsing(t *testing.T) { + _, err := Load("a=1e_2") + if err.Error() != "(1, 3): invalid use of _ in number" { + t.Error("Bad error message:", err.Error()) + } + + _, err = Load("a=1e2_") + if err.Error() != "(1, 3): invalid use of _ in number" { + t.Error("Bad error message:", err.Error()) + } + + _, err = Load("a=1__2") + if err.Error() != "(1, 3): invalid use of _ in number" { + t.Error("Bad error message:", err.Error()) + } + + _, err = Load("a=_1_2") + if err.Error() != "(1, 3): cannot start number with underscore" { + t.Error("Bad error message:", err.Error()) + } +} diff --git a/vendor/github.com/pelletier/go-toml/position.go b/vendor/github.com/pelletier/go-toml/position.go new file mode 100644 index 0000000000..c17bff87ba --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/position.go @@ -0,0 +1,29 @@ +// Position support for go-toml + +package toml + +import ( + "fmt" +) + +// Position of a document element within a TOML document. +// +// Line and Col are both 1-indexed positions for the element's line number and +// column number, respectively. Values of zero or less will cause Invalid(), +// to return true. +type Position struct { + Line int // line within the document + Col int // column within the line +} + +// String representation of the position. +// Displays 1-indexed line and column numbers. +func (p Position) String() string { + return fmt.Sprintf("(%d, %d)", p.Line, p.Col) +} + +// Invalid returns whether or not the position is valid (i.e. with negative or +// null values) +func (p Position) Invalid() bool { + return p.Line <= 0 || p.Col <= 0 +} diff --git a/vendor/github.com/pelletier/go-toml/position_test.go b/vendor/github.com/pelletier/go-toml/position_test.go new file mode 100644 index 0000000000..63ad1afc86 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/position_test.go @@ -0,0 +1,29 @@ +// Testing support for go-toml + +package toml + +import ( + "testing" +) + +func TestPositionString(t *testing.T) { + p := Position{123, 456} + expected := "(123, 456)" + value := p.String() + + if value != expected { + t.Errorf("Expected %v, got %v instead", expected, value) + } +} + +func TestInvalid(t *testing.T) { + for i, v := range []Position{ + {0, 1234}, + {1234, 0}, + {0, 0}, + } { + if !v.Invalid() { + t.Errorf("Position at %v is valid: %v", i, v) + } + } +} diff --git a/vendor/github.com/pelletier/go-toml/query/doc.go b/vendor/github.com/pelletier/go-toml/query/doc.go new file mode 100644 index 0000000000..f999fc9651 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/query/doc.go @@ -0,0 +1,175 @@ +// Package query performs JSONPath-like queries on a TOML document. +// +// The query path implementation is based loosely on the JSONPath specification: +// http://goessner.net/articles/JsonPath/. +// +// The idea behind a query path is to allow quick access to any element, or set +// of elements within TOML document, with a single expression. +// +// result, err := query.CompileAndExecute("$.foo.bar.baz", tree) +// +// This is roughly equivalent to: +// +// next := tree.Get("foo") +// if next != nil { +// next = next.Get("bar") +// if next != nil { +// next = next.Get("baz") +// } +// } +// result := next +// +// err is nil if any parsing exception occurs. +// +// If no node in the tree matches the query, result will simply contain an empty list of +// items. +// +// As illustrated above, the query path is much more efficient, especially since +// the structure of the TOML file can vary. Rather than making assumptions about +// a document's structure, a query allows the programmer to make structured +// requests into the document, and get zero or more values as a result. +// +// Query syntax +// +// The syntax of a query begins with a root token, followed by any number +// sub-expressions: +// +// $ +// Root of the TOML tree. This must always come first. +// .name +// Selects child of this node, where 'name' is a TOML key +// name. +// ['name'] +// Selects child of this node, where 'name' is a string +// containing a TOML key name. +// [index] +// Selcts child array element at 'index'. +// ..expr +// Recursively selects all children, filtered by an a union, +// index, or slice expression. +// ..* +// Recursive selection of all nodes at this point in the +// tree. +// .* +// Selects all children of the current node. +// [expr,expr] +// Union operator - a logical 'or' grouping of two or more +// sub-expressions: index, key name, or filter. +// [start:end:step] +// Slice operator - selects array elements from start to +// end-1, at the given step. All three arguments are +// optional. +// [?(filter)] +// Named filter expression - the function 'filter' is +// used to filter children at this node. +// +// Query Indexes And Slices +// +// Index expressions perform no bounds checking, and will contribute no +// values to the result set if the provided index or index range is invalid. +// Negative indexes represent values from the end of the array, counting backwards. +// +// // select the last index of the array named 'foo' +// query.CompileAndExecute("$.foo[-1]", tree) +// +// Slice expressions are supported, by using ':' to separate a start/end index pair. +// +// // select up to the first five elements in the array +// query.CompileAndExecute("$.foo[0:5]", tree) +// +// Slice expressions also allow negative indexes for the start and stop +// arguments. +// +// // select all array elements. +// query.CompileAndExecute("$.foo[0:-1]", tree) +// +// Slice expressions may have an optional stride/step parameter: +// +// // select every other element +// query.CompileAndExecute("$.foo[0:-1:2]", tree) +// +// Slice start and end parameters are also optional: +// +// // these are all equivalent and select all the values in the array +// query.CompileAndExecute("$.foo[:]", tree) +// query.CompileAndExecute("$.foo[0:]", tree) +// query.CompileAndExecute("$.foo[:-1]", tree) +// query.CompileAndExecute("$.foo[0:-1:]", tree) +// query.CompileAndExecute("$.foo[::1]", tree) +// query.CompileAndExecute("$.foo[0::1]", tree) +// query.CompileAndExecute("$.foo[:-1:1]", tree) +// query.CompileAndExecute("$.foo[0:-1:1]", tree) +// +// Query Filters +// +// Query filters are used within a Union [,] or single Filter [] expression. +// A filter only allows nodes that qualify through to the next expression, +// and/or into the result set. +// +// // returns children of foo that are permitted by the 'bar' filter. +// query.CompileAndExecute("$.foo[?(bar)]", tree) +// +// There are several filters provided with the library: +// +// tree +// Allows nodes of type Tree. +// int +// Allows nodes of type int64. +// float +// Allows nodes of type float64. +// string +// Allows nodes of type string. +// time +// Allows nodes of type time.Time. +// bool +// Allows nodes of type bool. +// +// Query Results +// +// An executed query returns a Result object. This contains the nodes +// in the TOML tree that qualify the query expression. Position information +// is also available for each value in the set. +// +// // display the results of a query +// results := query.CompileAndExecute("$.foo.bar.baz", tree) +// for idx, value := results.Values() { +// fmt.Println("%v: %v", results.Positions()[idx], value) +// } +// +// Compiled Queries +// +// Queries may be executed directly on a Tree object, or compiled ahead +// of time and executed discretely. The former is more convienent, but has the +// penalty of having to recompile the query expression each time. +// +// // basic query +// results := query.CompileAndExecute("$.foo.bar.baz", tree) +// +// // compiled query +// query, err := toml.Compile("$.foo.bar.baz") +// results := query.Execute(tree) +// +// // run the compiled query again on a different tree +// moreResults := query.Execute(anotherTree) +// +// User Defined Query Filters +// +// Filter expressions may also be user defined by using the SetFilter() +// function on the Query object. The function must return true/false, which +// signifies if the passed node is kept or discarded, respectively. +// +// // create a query that references a user-defined filter +// query, _ := query.Compile("$[?(bazOnly)]") +// +// // define the filter, and assign it to the query +// query.SetFilter("bazOnly", func(node interface{}) bool{ +// if tree, ok := node.(*Tree); ok { +// return tree.Has("baz") +// } +// return false // reject all other node types +// }) +// +// // run the query +// query.Execute(tree) +// +package query diff --git a/vendor/github.com/pelletier/go-toml/query/lexer.go b/vendor/github.com/pelletier/go-toml/query/lexer.go new file mode 100644 index 0000000000..2dc319408e --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/query/lexer.go @@ -0,0 +1,357 @@ +// TOML JSONPath lexer. +// +// Written using the principles developed by Rob Pike in +// http://www.youtube.com/watch?v=HxaD_trXwRE + +package query + +import ( + "fmt" + "github.com/pelletier/go-toml" + "strconv" + "strings" + "unicode/utf8" +) + +// Lexer state function +type queryLexStateFn func() queryLexStateFn + +// Lexer definition +type queryLexer struct { + input string + start int + pos int + width int + tokens chan token + depth int + line int + col int + stringTerm string +} + +func (l *queryLexer) run() { + for state := l.lexVoid; state != nil; { + state = state() + } + close(l.tokens) +} + +func (l *queryLexer) nextStart() { + // iterate by runes (utf8 characters) + // search for newlines and advance line/col counts + for i := l.start; i < l.pos; { + r, width := utf8.DecodeRuneInString(l.input[i:]) + if r == '\n' { + l.line++ + l.col = 1 + } else { + l.col++ + } + i += width + } + // advance start position to next token + l.start = l.pos +} + +func (l *queryLexer) emit(t tokenType) { + l.tokens <- token{ + Position: toml.Position{Line: l.line, Col: l.col}, + typ: t, + val: l.input[l.start:l.pos], + } + l.nextStart() +} + +func (l *queryLexer) emitWithValue(t tokenType, value string) { + l.tokens <- token{ + Position: toml.Position{Line: l.line, Col: l.col}, + typ: t, + val: value, + } + l.nextStart() +} + +func (l *queryLexer) next() rune { + if l.pos >= len(l.input) { + l.width = 0 + return eof + } + var r rune + r, l.width = utf8.DecodeRuneInString(l.input[l.pos:]) + l.pos += l.width + return r +} + +func (l *queryLexer) ignore() { + l.nextStart() +} + +func (l *queryLexer) backup() { + l.pos -= l.width +} + +func (l *queryLexer) errorf(format string, args ...interface{}) queryLexStateFn { + l.tokens <- token{ + Position: toml.Position{Line: l.line, Col: l.col}, + typ: tokenError, + val: fmt.Sprintf(format, args...), + } + return nil +} + +func (l *queryLexer) peek() rune { + r := l.next() + l.backup() + return r +} + +func (l *queryLexer) accept(valid string) bool { + if strings.ContainsRune(valid, l.next()) { + return true + } + l.backup() + return false +} + +func (l *queryLexer) follow(next string) bool { + return strings.HasPrefix(l.input[l.pos:], next) +} + +func (l *queryLexer) lexVoid() queryLexStateFn { + for { + next := l.peek() + switch next { + case '$': + l.pos++ + l.emit(tokenDollar) + continue + case '.': + if l.follow("..") { + l.pos += 2 + l.emit(tokenDotDot) + } else { + l.pos++ + l.emit(tokenDot) + } + continue + case '[': + l.pos++ + l.emit(tokenLeftBracket) + continue + case ']': + l.pos++ + l.emit(tokenRightBracket) + continue + case ',': + l.pos++ + l.emit(tokenComma) + continue + case '*': + l.pos++ + l.emit(tokenStar) + continue + case '(': + l.pos++ + l.emit(tokenLeftParen) + continue + case ')': + l.pos++ + l.emit(tokenRightParen) + continue + case '?': + l.pos++ + l.emit(tokenQuestion) + continue + case ':': + l.pos++ + l.emit(tokenColon) + continue + case '\'': + l.ignore() + l.stringTerm = string(next) + return l.lexString + case '"': + l.ignore() + l.stringTerm = string(next) + return l.lexString + } + + if isSpace(next) { + l.next() + l.ignore() + continue + } + + if isAlphanumeric(next) { + return l.lexKey + } + + if next == '+' || next == '-' || isDigit(next) { + return l.lexNumber + } + + if l.next() == eof { + break + } + + return l.errorf("unexpected char: '%v'", next) + } + l.emit(tokenEOF) + return nil +} + +func (l *queryLexer) lexKey() queryLexStateFn { + for { + next := l.peek() + if !isAlphanumeric(next) { + l.emit(tokenKey) + return l.lexVoid + } + + if l.next() == eof { + break + } + } + l.emit(tokenEOF) + return nil +} + +func (l *queryLexer) lexString() queryLexStateFn { + l.pos++ + l.ignore() + growingString := "" + + for { + if l.follow(l.stringTerm) { + l.emitWithValue(tokenString, growingString) + l.pos++ + l.ignore() + return l.lexVoid + } + + if l.follow("\\\"") { + l.pos++ + growingString += "\"" + } else if l.follow("\\'") { + l.pos++ + growingString += "'" + } else if l.follow("\\n") { + l.pos++ + growingString += "\n" + } else if l.follow("\\b") { + l.pos++ + growingString += "\b" + } else if l.follow("\\f") { + l.pos++ + growingString += "\f" + } else if l.follow("\\/") { + l.pos++ + growingString += "/" + } else if l.follow("\\t") { + l.pos++ + growingString += "\t" + } else if l.follow("\\r") { + l.pos++ + growingString += "\r" + } else if l.follow("\\\\") { + l.pos++ + growingString += "\\" + } else if l.follow("\\u") { + l.pos += 2 + code := "" + for i := 0; i < 4; i++ { + c := l.peek() + l.pos++ + if !isHexDigit(c) { + return l.errorf("unfinished unicode escape") + } + code = code + string(c) + } + l.pos-- + intcode, err := strconv.ParseInt(code, 16, 32) + if err != nil { + return l.errorf("invalid unicode escape: \\u" + code) + } + growingString += string(rune(intcode)) + } else if l.follow("\\U") { + l.pos += 2 + code := "" + for i := 0; i < 8; i++ { + c := l.peek() + l.pos++ + if !isHexDigit(c) { + return l.errorf("unfinished unicode escape") + } + code = code + string(c) + } + l.pos-- + intcode, err := strconv.ParseInt(code, 16, 32) + if err != nil { + return l.errorf("invalid unicode escape: \\u" + code) + } + growingString += string(rune(intcode)) + } else if l.follow("\\") { + l.pos++ + return l.errorf("invalid escape sequence: \\" + string(l.peek())) + } else { + growingString += string(l.peek()) + } + + if l.next() == eof { + break + } + } + + return l.errorf("unclosed string") +} + +func (l *queryLexer) lexNumber() queryLexStateFn { + l.ignore() + if !l.accept("+") { + l.accept("-") + } + pointSeen := false + digitSeen := false + for { + next := l.next() + if next == '.' { + if pointSeen { + return l.errorf("cannot have two dots in one float") + } + if !isDigit(l.peek()) { + return l.errorf("float cannot end with a dot") + } + pointSeen = true + } else if isDigit(next) { + digitSeen = true + } else { + l.backup() + break + } + if pointSeen && !digitSeen { + return l.errorf("cannot start float with a dot") + } + } + + if !digitSeen { + return l.errorf("no digit in that number") + } + if pointSeen { + l.emit(tokenFloat) + } else { + l.emit(tokenInteger) + } + return l.lexVoid +} + +// Entry point +func lexQuery(input string) chan token { + l := &queryLexer{ + input: input, + tokens: make(chan token), + line: 1, + col: 1, + } + go l.run() + return l.tokens +} diff --git a/vendor/github.com/pelletier/go-toml/query/lexer_test.go b/vendor/github.com/pelletier/go-toml/query/lexer_test.go new file mode 100644 index 0000000000..8ce0501fed --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/query/lexer_test.go @@ -0,0 +1,179 @@ +package query + +import ( + "github.com/pelletier/go-toml" + "testing" +) + +func testQLFlow(t *testing.T, input string, expectedFlow []token) { + ch := lexQuery(input) + for idx, expected := range expectedFlow { + token := <-ch + if token != expected { + t.Log("While testing #", idx, ":", input) + t.Log("compared (got)", token, "to (expected)", expected) + t.Log("\tvalue:", token.val, "<->", expected.val) + t.Log("\tvalue as bytes:", []byte(token.val), "<->", []byte(expected.val)) + t.Log("\ttype:", token.typ.String(), "<->", expected.typ.String()) + t.Log("\tline:", token.Line, "<->", expected.Line) + t.Log("\tcolumn:", token.Col, "<->", expected.Col) + t.Log("compared", token, "to", expected) + t.FailNow() + } + } + + tok, ok := <-ch + if ok { + t.Log("channel is not closed!") + t.Log(len(ch)+1, "tokens remaining:") + + t.Log("token ->", tok) + for token := range ch { + t.Log("token ->", token) + } + t.FailNow() + } +} + +func TestLexSpecialChars(t *testing.T) { + testQLFlow(t, " .$[]..()?*", []token{ + {toml.Position{1, 2}, tokenDot, "."}, + {toml.Position{1, 3}, tokenDollar, "$"}, + {toml.Position{1, 4}, tokenLeftBracket, "["}, + {toml.Position{1, 5}, tokenRightBracket, "]"}, + {toml.Position{1, 6}, tokenDotDot, ".."}, + {toml.Position{1, 8}, tokenLeftParen, "("}, + {toml.Position{1, 9}, tokenRightParen, ")"}, + {toml.Position{1, 10}, tokenQuestion, "?"}, + {toml.Position{1, 11}, tokenStar, "*"}, + {toml.Position{1, 12}, tokenEOF, ""}, + }) +} + +func TestLexString(t *testing.T) { + testQLFlow(t, "'foo\n'", []token{ + {toml.Position{1, 2}, tokenString, "foo\n"}, + {toml.Position{2, 2}, tokenEOF, ""}, + }) +} + +func TestLexDoubleString(t *testing.T) { + testQLFlow(t, `"bar"`, []token{ + {toml.Position{1, 2}, tokenString, "bar"}, + {toml.Position{1, 6}, tokenEOF, ""}, + }) +} + +func TestLexStringEscapes(t *testing.T) { + testQLFlow(t, `"foo \" \' \b \f \/ \t \r \\ \u03A9 \U00012345 \n bar"`, []token{ + {toml.Position{1, 2}, tokenString, "foo \" ' \b \f / \t \r \\ \u03A9 \U00012345 \n bar"}, + {toml.Position{1, 55}, tokenEOF, ""}, + }) +} + +func TestLexStringUnfinishedUnicode4(t *testing.T) { + testQLFlow(t, `"\u000"`, []token{ + {toml.Position{1, 2}, tokenError, "unfinished unicode escape"}, + }) +} + +func TestLexStringUnfinishedUnicode8(t *testing.T) { + testQLFlow(t, `"\U0000"`, []token{ + {toml.Position{1, 2}, tokenError, "unfinished unicode escape"}, + }) +} + +func TestLexStringInvalidEscape(t *testing.T) { + testQLFlow(t, `"\x"`, []token{ + {toml.Position{1, 2}, tokenError, "invalid escape sequence: \\x"}, + }) +} + +func TestLexStringUnfinished(t *testing.T) { + testQLFlow(t, `"bar`, []token{ + {toml.Position{1, 2}, tokenError, "unclosed string"}, + }) +} + +func TestLexKey(t *testing.T) { + testQLFlow(t, "foo", []token{ + {toml.Position{1, 1}, tokenKey, "foo"}, + {toml.Position{1, 4}, tokenEOF, ""}, + }) +} + +func TestLexRecurse(t *testing.T) { + testQLFlow(t, "$..*", []token{ + {toml.Position{1, 1}, tokenDollar, "$"}, + {toml.Position{1, 2}, tokenDotDot, ".."}, + {toml.Position{1, 4}, tokenStar, "*"}, + {toml.Position{1, 5}, tokenEOF, ""}, + }) +} + +func TestLexBracketKey(t *testing.T) { + testQLFlow(t, "$[foo]", []token{ + {toml.Position{1, 1}, tokenDollar, "$"}, + {toml.Position{1, 2}, tokenLeftBracket, "["}, + {toml.Position{1, 3}, tokenKey, "foo"}, + {toml.Position{1, 6}, tokenRightBracket, "]"}, + {toml.Position{1, 7}, tokenEOF, ""}, + }) +} + +func TestLexSpace(t *testing.T) { + testQLFlow(t, "foo bar baz", []token{ + {toml.Position{1, 1}, tokenKey, "foo"}, + {toml.Position{1, 5}, tokenKey, "bar"}, + {toml.Position{1, 9}, tokenKey, "baz"}, + {toml.Position{1, 12}, tokenEOF, ""}, + }) +} + +func TestLexInteger(t *testing.T) { + testQLFlow(t, "100 +200 -300", []token{ + {toml.Position{1, 1}, tokenInteger, "100"}, + {toml.Position{1, 5}, tokenInteger, "+200"}, + {toml.Position{1, 10}, tokenInteger, "-300"}, + {toml.Position{1, 14}, tokenEOF, ""}, + }) +} + +func TestLexFloat(t *testing.T) { + testQLFlow(t, "100.0 +200.0 -300.0", []token{ + {toml.Position{1, 1}, tokenFloat, "100.0"}, + {toml.Position{1, 7}, tokenFloat, "+200.0"}, + {toml.Position{1, 14}, tokenFloat, "-300.0"}, + {toml.Position{1, 20}, tokenEOF, ""}, + }) +} + +func TestLexFloatWithMultipleDots(t *testing.T) { + testQLFlow(t, "4.2.", []token{ + {toml.Position{1, 1}, tokenError, "cannot have two dots in one float"}, + }) +} + +func TestLexFloatLeadingDot(t *testing.T) { + testQLFlow(t, "+.1", []token{ + {toml.Position{1, 1}, tokenError, "cannot start float with a dot"}, + }) +} + +func TestLexFloatWithTrailingDot(t *testing.T) { + testQLFlow(t, "42.", []token{ + {toml.Position{1, 1}, tokenError, "float cannot end with a dot"}, + }) +} + +func TestLexNumberWithoutDigit(t *testing.T) { + testQLFlow(t, "+", []token{ + {toml.Position{1, 1}, tokenError, "no digit in that number"}, + }) +} + +func TestLexUnknown(t *testing.T) { + testQLFlow(t, "^", []token{ + {toml.Position{1, 1}, tokenError, "unexpected char: '94'"}, + }) +} diff --git a/vendor/github.com/pelletier/go-toml/query/match.go b/vendor/github.com/pelletier/go-toml/query/match.go new file mode 100644 index 0000000000..d7bb15a45a --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/query/match.go @@ -0,0 +1,232 @@ +package query + +import ( + "fmt" + "github.com/pelletier/go-toml" +) + +// base match +type matchBase struct { + next pathFn +} + +func (f *matchBase) setNext(next pathFn) { + f.next = next +} + +// terminating functor - gathers results +type terminatingFn struct { + // empty +} + +func newTerminatingFn() *terminatingFn { + return &terminatingFn{} +} + +func (f *terminatingFn) setNext(next pathFn) { + // do nothing +} + +func (f *terminatingFn) call(node interface{}, ctx *queryContext) { + ctx.result.appendResult(node, ctx.lastPosition) +} + +// match single key +type matchKeyFn struct { + matchBase + Name string +} + +func newMatchKeyFn(name string) *matchKeyFn { + return &matchKeyFn{Name: name} +} + +func (f *matchKeyFn) call(node interface{}, ctx *queryContext) { + if array, ok := node.([]*toml.Tree); ok { + for _, tree := range array { + item := tree.Get(f.Name) + if item != nil { + ctx.lastPosition = tree.GetPosition(f.Name) + f.next.call(item, ctx) + } + } + } else if tree, ok := node.(*toml.Tree); ok { + item := tree.Get(f.Name) + if item != nil { + ctx.lastPosition = tree.GetPosition(f.Name) + f.next.call(item, ctx) + } + } +} + +// match single index +type matchIndexFn struct { + matchBase + Idx int +} + +func newMatchIndexFn(idx int) *matchIndexFn { + return &matchIndexFn{Idx: idx} +} + +func (f *matchIndexFn) call(node interface{}, ctx *queryContext) { + if arr, ok := node.([]interface{}); ok { + if f.Idx < len(arr) && f.Idx >= 0 { + if treesArray, ok := node.([]*toml.Tree); ok { + if len(treesArray) > 0 { + ctx.lastPosition = treesArray[0].Position() + } + } + f.next.call(arr[f.Idx], ctx) + } + } +} + +// filter by slicing +type matchSliceFn struct { + matchBase + Start, End, Step int +} + +func newMatchSliceFn(start, end, step int) *matchSliceFn { + return &matchSliceFn{Start: start, End: end, Step: step} +} + +func (f *matchSliceFn) call(node interface{}, ctx *queryContext) { + if arr, ok := node.([]interface{}); ok { + // adjust indexes for negative values, reverse ordering + realStart, realEnd := f.Start, f.End + if realStart < 0 { + realStart = len(arr) + realStart + } + if realEnd < 0 { + realEnd = len(arr) + realEnd + } + if realEnd < realStart { + realEnd, realStart = realStart, realEnd // swap + } + // loop and gather + for idx := realStart; idx < realEnd; idx += f.Step { + if treesArray, ok := node.([]*toml.Tree); ok { + if len(treesArray) > 0 { + ctx.lastPosition = treesArray[0].Position() + } + } + f.next.call(arr[idx], ctx) + } + } +} + +// match anything +type matchAnyFn struct { + matchBase +} + +func newMatchAnyFn() *matchAnyFn { + return &matchAnyFn{} +} + +func (f *matchAnyFn) call(node interface{}, ctx *queryContext) { + if tree, ok := node.(*toml.Tree); ok { + for _, k := range tree.Keys() { + v := tree.Get(k) + ctx.lastPosition = tree.GetPosition(k) + f.next.call(v, ctx) + } + } +} + +// filter through union +type matchUnionFn struct { + Union []pathFn +} + +func (f *matchUnionFn) setNext(next pathFn) { + for _, fn := range f.Union { + fn.setNext(next) + } +} + +func (f *matchUnionFn) call(node interface{}, ctx *queryContext) { + for _, fn := range f.Union { + fn.call(node, ctx) + } +} + +// match every single last node in the tree +type matchRecursiveFn struct { + matchBase +} + +func newMatchRecursiveFn() *matchRecursiveFn { + return &matchRecursiveFn{} +} + +func (f *matchRecursiveFn) call(node interface{}, ctx *queryContext) { + originalPosition := ctx.lastPosition + if tree, ok := node.(*toml.Tree); ok { + var visit func(tree *toml.Tree) + visit = func(tree *toml.Tree) { + for _, k := range tree.Keys() { + v := tree.Get(k) + ctx.lastPosition = tree.GetPosition(k) + f.next.call(v, ctx) + switch node := v.(type) { + case *toml.Tree: + visit(node) + case []*toml.Tree: + for _, subtree := range node { + visit(subtree) + } + } + } + } + ctx.lastPosition = originalPosition + f.next.call(tree, ctx) + visit(tree) + } +} + +// match based on an externally provided functional filter +type matchFilterFn struct { + matchBase + Pos toml.Position + Name string +} + +func newMatchFilterFn(name string, pos toml.Position) *matchFilterFn { + return &matchFilterFn{Name: name, Pos: pos} +} + +func (f *matchFilterFn) call(node interface{}, ctx *queryContext) { + fn, ok := (*ctx.filters)[f.Name] + if !ok { + panic(fmt.Sprintf("%s: query context does not have filter '%s'", + f.Pos.String(), f.Name)) + } + switch castNode := node.(type) { + case *toml.Tree: + for _, k := range castNode.Keys() { + v := castNode.Get(k) + if fn(v) { + ctx.lastPosition = castNode.GetPosition(k) + f.next.call(v, ctx) + } + } + case []*toml.Tree: + for _, v := range castNode { + if fn(v) { + if len(castNode) > 0 { + ctx.lastPosition = castNode[0].Position() + } + f.next.call(v, ctx) + } + } + case []interface{}: + for _, v := range castNode { + if fn(v) { + f.next.call(v, ctx) + } + } + } +} diff --git a/vendor/github.com/pelletier/go-toml/query/match_test.go b/vendor/github.com/pelletier/go-toml/query/match_test.go new file mode 100644 index 0000000000..429b8f6b9a --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/query/match_test.go @@ -0,0 +1,202 @@ +package query + +import ( + "fmt" + "github.com/pelletier/go-toml" + "testing" +) + +// dump path tree to a string +func pathString(root pathFn) string { + result := fmt.Sprintf("%T:", root) + switch fn := root.(type) { + case *terminatingFn: + result += "{}" + case *matchKeyFn: + result += fmt.Sprintf("{%s}", fn.Name) + result += pathString(fn.next) + case *matchIndexFn: + result += fmt.Sprintf("{%d}", fn.Idx) + result += pathString(fn.next) + case *matchSliceFn: + result += fmt.Sprintf("{%d:%d:%d}", + fn.Start, fn.End, fn.Step) + result += pathString(fn.next) + case *matchAnyFn: + result += "{}" + result += pathString(fn.next) + case *matchUnionFn: + result += "{[" + for _, v := range fn.Union { + result += pathString(v) + ", " + } + result += "]}" + case *matchRecursiveFn: + result += "{}" + result += pathString(fn.next) + case *matchFilterFn: + result += fmt.Sprintf("{%s}", fn.Name) + result += pathString(fn.next) + } + return result +} + +func assertPathMatch(t *testing.T, path, ref *Query) bool { + pathStr := pathString(path.root) + refStr := pathString(ref.root) + if pathStr != refStr { + t.Errorf("paths do not match") + t.Log("test:", pathStr) + t.Log("ref: ", refStr) + return false + } + return true +} + +func assertPath(t *testing.T, query string, ref *Query) { + path, _ := parseQuery(lexQuery(query)) + assertPathMatch(t, path, ref) +} + +func buildPath(parts ...pathFn) *Query { + query := newQuery() + for _, v := range parts { + query.appendPath(v) + } + return query +} + +func TestPathRoot(t *testing.T) { + assertPath(t, + "$", + buildPath( + // empty + )) +} + +func TestPathKey(t *testing.T) { + assertPath(t, + "$.foo", + buildPath( + newMatchKeyFn("foo"), + )) +} + +func TestPathBracketKey(t *testing.T) { + assertPath(t, + "$[foo]", + buildPath( + newMatchKeyFn("foo"), + )) +} + +func TestPathBracketStringKey(t *testing.T) { + assertPath(t, + "$['foo']", + buildPath( + newMatchKeyFn("foo"), + )) +} + +func TestPathIndex(t *testing.T) { + assertPath(t, + "$[123]", + buildPath( + newMatchIndexFn(123), + )) +} + +func TestPathSliceStart(t *testing.T) { + assertPath(t, + "$[123:]", + buildPath( + newMatchSliceFn(123, maxInt, 1), + )) +} + +func TestPathSliceStartEnd(t *testing.T) { + assertPath(t, + "$[123:456]", + buildPath( + newMatchSliceFn(123, 456, 1), + )) +} + +func TestPathSliceStartEndColon(t *testing.T) { + assertPath(t, + "$[123:456:]", + buildPath( + newMatchSliceFn(123, 456, 1), + )) +} + +func TestPathSliceStartStep(t *testing.T) { + assertPath(t, + "$[123::7]", + buildPath( + newMatchSliceFn(123, maxInt, 7), + )) +} + +func TestPathSliceEndStep(t *testing.T) { + assertPath(t, + "$[:456:7]", + buildPath( + newMatchSliceFn(0, 456, 7), + )) +} + +func TestPathSliceStep(t *testing.T) { + assertPath(t, + "$[::7]", + buildPath( + newMatchSliceFn(0, maxInt, 7), + )) +} + +func TestPathSliceAll(t *testing.T) { + assertPath(t, + "$[123:456:7]", + buildPath( + newMatchSliceFn(123, 456, 7), + )) +} + +func TestPathAny(t *testing.T) { + assertPath(t, + "$.*", + buildPath( + newMatchAnyFn(), + )) +} + +func TestPathUnion(t *testing.T) { + assertPath(t, + "$[foo, bar, baz]", + buildPath( + &matchUnionFn{[]pathFn{ + newMatchKeyFn("foo"), + newMatchKeyFn("bar"), + newMatchKeyFn("baz"), + }}, + )) +} + +func TestPathRecurse(t *testing.T) { + assertPath(t, + "$..*", + buildPath( + newMatchRecursiveFn(), + )) +} + +func TestPathFilterExpr(t *testing.T) { + assertPath(t, + "$[?('foo'),?(bar)]", + buildPath( + &matchUnionFn{[]pathFn{ + newMatchFilterFn("foo", toml.Position{}), + newMatchFilterFn("bar", toml.Position{}), + }}, + )) +} diff --git a/vendor/github.com/pelletier/go-toml/query/parser.go b/vendor/github.com/pelletier/go-toml/query/parser.go new file mode 100644 index 0000000000..5f69b70d45 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/query/parser.go @@ -0,0 +1,275 @@ +/* + Based on the "jsonpath" spec/concept. + + http://goessner.net/articles/JsonPath/ + https://code.google.com/p/json-path/ +*/ + +package query + +import ( + "fmt" +) + +const maxInt = int(^uint(0) >> 1) + +type queryParser struct { + flow chan token + tokensBuffer []token + query *Query + union []pathFn + err error +} + +type queryParserStateFn func() queryParserStateFn + +// Formats and panics an error message based on a token +func (p *queryParser) parseError(tok *token, msg string, args ...interface{}) queryParserStateFn { + p.err = fmt.Errorf(tok.Position.String()+": "+msg, args...) + return nil // trigger parse to end +} + +func (p *queryParser) run() { + for state := p.parseStart; state != nil; { + state = state() + } +} + +func (p *queryParser) backup(tok *token) { + p.tokensBuffer = append(p.tokensBuffer, *tok) +} + +func (p *queryParser) peek() *token { + if len(p.tokensBuffer) != 0 { + return &(p.tokensBuffer[0]) + } + + tok, ok := <-p.flow + if !ok { + return nil + } + p.backup(&tok) + return &tok +} + +func (p *queryParser) lookahead(types ...tokenType) bool { + result := true + buffer := []token{} + + for _, typ := range types { + tok := p.getToken() + if tok == nil { + result = false + break + } + buffer = append(buffer, *tok) + if tok.typ != typ { + result = false + break + } + } + // add the tokens back to the buffer, and return + p.tokensBuffer = append(p.tokensBuffer, buffer...) + return result +} + +func (p *queryParser) getToken() *token { + if len(p.tokensBuffer) != 0 { + tok := p.tokensBuffer[0] + p.tokensBuffer = p.tokensBuffer[1:] + return &tok + } + tok, ok := <-p.flow + if !ok { + return nil + } + return &tok +} + +func (p *queryParser) parseStart() queryParserStateFn { + tok := p.getToken() + + if tok == nil || tok.typ == tokenEOF { + return nil + } + + if tok.typ != tokenDollar { + return p.parseError(tok, "Expected '$' at start of expression") + } + + return p.parseMatchExpr +} + +// handle '.' prefix, '[]', and '..' +func (p *queryParser) parseMatchExpr() queryParserStateFn { + tok := p.getToken() + switch tok.typ { + case tokenDotDot: + p.query.appendPath(&matchRecursiveFn{}) + // nested parse for '..' + tok := p.getToken() + switch tok.typ { + case tokenKey: + p.query.appendPath(newMatchKeyFn(tok.val)) + return p.parseMatchExpr + case tokenLeftBracket: + return p.parseBracketExpr + case tokenStar: + // do nothing - the recursive predicate is enough + return p.parseMatchExpr + } + + case tokenDot: + // nested parse for '.' + tok := p.getToken() + switch tok.typ { + case tokenKey: + p.query.appendPath(newMatchKeyFn(tok.val)) + return p.parseMatchExpr + case tokenStar: + p.query.appendPath(&matchAnyFn{}) + return p.parseMatchExpr + } + + case tokenLeftBracket: + return p.parseBracketExpr + + case tokenEOF: + return nil // allow EOF at this stage + } + return p.parseError(tok, "expected match expression") +} + +func (p *queryParser) parseBracketExpr() queryParserStateFn { + if p.lookahead(tokenInteger, tokenColon) { + return p.parseSliceExpr + } + if p.peek().typ == tokenColon { + return p.parseSliceExpr + } + return p.parseUnionExpr +} + +func (p *queryParser) parseUnionExpr() queryParserStateFn { + var tok *token + + // this state can be traversed after some sub-expressions + // so be careful when setting up state in the parser + if p.union == nil { + p.union = []pathFn{} + } + +loop: // labeled loop for easy breaking + for { + if len(p.union) > 0 { + // parse delimiter or terminator + tok = p.getToken() + switch tok.typ { + case tokenComma: + // do nothing + case tokenRightBracket: + break loop + default: + return p.parseError(tok, "expected ',' or ']', not '%s'", tok.val) + } + } + + // parse sub expression + tok = p.getToken() + switch tok.typ { + case tokenInteger: + p.union = append(p.union, newMatchIndexFn(tok.Int())) + case tokenKey: + p.union = append(p.union, newMatchKeyFn(tok.val)) + case tokenString: + p.union = append(p.union, newMatchKeyFn(tok.val)) + case tokenQuestion: + return p.parseFilterExpr + default: + return p.parseError(tok, "expected union sub expression, not '%s', %d", tok.val, len(p.union)) + } + } + + // if there is only one sub-expression, use that instead + if len(p.union) == 1 { + p.query.appendPath(p.union[0]) + } else { + p.query.appendPath(&matchUnionFn{p.union}) + } + + p.union = nil // clear out state + return p.parseMatchExpr +} + +func (p *queryParser) parseSliceExpr() queryParserStateFn { + // init slice to grab all elements + start, end, step := 0, maxInt, 1 + + // parse optional start + tok := p.getToken() + if tok.typ == tokenInteger { + start = tok.Int() + tok = p.getToken() + } + if tok.typ != tokenColon { + return p.parseError(tok, "expected ':'") + } + + // parse optional end + tok = p.getToken() + if tok.typ == tokenInteger { + end = tok.Int() + tok = p.getToken() + } + if tok.typ == tokenRightBracket { + p.query.appendPath(newMatchSliceFn(start, end, step)) + return p.parseMatchExpr + } + if tok.typ != tokenColon { + return p.parseError(tok, "expected ']' or ':'") + } + + // parse optional step + tok = p.getToken() + if tok.typ == tokenInteger { + step = tok.Int() + if step < 0 { + return p.parseError(tok, "step must be a positive value") + } + tok = p.getToken() + } + if tok.typ != tokenRightBracket { + return p.parseError(tok, "expected ']'") + } + + p.query.appendPath(newMatchSliceFn(start, end, step)) + return p.parseMatchExpr +} + +func (p *queryParser) parseFilterExpr() queryParserStateFn { + tok := p.getToken() + if tok.typ != tokenLeftParen { + return p.parseError(tok, "expected left-parenthesis for filter expression") + } + tok = p.getToken() + if tok.typ != tokenKey && tok.typ != tokenString { + return p.parseError(tok, "expected key or string for filter function name") + } + name := tok.val + tok = p.getToken() + if tok.typ != tokenRightParen { + return p.parseError(tok, "expected right-parenthesis for filter expression") + } + p.union = append(p.union, newMatchFilterFn(name, tok.Position)) + return p.parseUnionExpr +} + +func parseQuery(flow chan token) (*Query, error) { + parser := &queryParser{ + flow: flow, + tokensBuffer: []token{}, + query: newQuery(), + } + parser.run() + return parser.query, parser.err +} diff --git a/vendor/github.com/pelletier/go-toml/query/parser_test.go b/vendor/github.com/pelletier/go-toml/query/parser_test.go new file mode 100644 index 0000000000..473896a025 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/query/parser_test.go @@ -0,0 +1,482 @@ +package query + +import ( + "fmt" + "github.com/pelletier/go-toml" + "io/ioutil" + "sort" + "strings" + "testing" + "time" +) + +type queryTestNode struct { + value interface{} + position toml.Position +} + +func valueString(root interface{}) string { + result := "" //fmt.Sprintf("%T:", root) + switch node := root.(type) { + case *Result: + items := []string{} + for i, v := range node.Values() { + items = append(items, fmt.Sprintf("%s:%s", + node.Positions()[i].String(), valueString(v))) + } + sort.Strings(items) + result = "[" + strings.Join(items, ", ") + "]" + case queryTestNode: + result = fmt.Sprintf("%s:%s", + node.position.String(), valueString(node.value)) + case []interface{}: + items := []string{} + for _, v := range node { + items = append(items, valueString(v)) + } + sort.Strings(items) + result = "[" + strings.Join(items, ", ") + "]" + case *toml.Tree: + // workaround for unreliable map key ordering + items := []string{} + for _, k := range node.Keys() { + v := node.GetPath([]string{k}) + items = append(items, k+":"+valueString(v)) + } + sort.Strings(items) + result = "{" + strings.Join(items, ", ") + "}" + case map[string]interface{}: + // workaround for unreliable map key ordering + items := []string{} + for k, v := range node { + items = append(items, k+":"+valueString(v)) + } + sort.Strings(items) + result = "{" + strings.Join(items, ", ") + "}" + case int64: + result += fmt.Sprintf("%d", node) + case string: + result += "'" + node + "'" + case float64: + result += fmt.Sprintf("%f", node) + case bool: + result += fmt.Sprintf("%t", node) + case time.Time: + result += fmt.Sprintf("'%v'", node) + } + return result +} + +func assertValue(t *testing.T, result, ref interface{}) { + pathStr := valueString(result) + refStr := valueString(ref) + if pathStr != refStr { + t.Errorf("values do not match") + t.Log("test:", pathStr) + t.Log("ref: ", refStr) + } +} + +func assertQueryPositions(t *testing.T, tomlDoc string, query string, ref []interface{}) { + tree, err := toml.Load(tomlDoc) + if err != nil { + t.Errorf("Non-nil toml parse error: %v", err) + return + } + q, err := Compile(query) + if err != nil { + t.Error(err) + return + } + results := q.Execute(tree) + assertValue(t, results, ref) +} + +func TestQueryRoot(t *testing.T) { + assertQueryPositions(t, + "a = 42", + "$", + []interface{}{ + queryTestNode{ + map[string]interface{}{ + "a": int64(42), + }, toml.Position{1, 1}, + }, + }) +} + +func TestQueryKey(t *testing.T) { + assertQueryPositions(t, + "[foo]\na = 42", + "$.foo.a", + []interface{}{ + queryTestNode{ + int64(42), toml.Position{2, 1}, + }, + }) +} + +func TestQueryKeyString(t *testing.T) { + assertQueryPositions(t, + "[foo]\na = 42", + "$.foo['a']", + []interface{}{ + queryTestNode{ + int64(42), toml.Position{2, 1}, + }, + }) +} + +func TestQueryIndex(t *testing.T) { + assertQueryPositions(t, + "[foo]\na = [1,2,3,4,5,6,7,8,9,0]", + "$.foo.a[5]", + []interface{}{ + queryTestNode{ + int64(6), toml.Position{2, 1}, + }, + }) +} + +func TestQuerySliceRange(t *testing.T) { + assertQueryPositions(t, + "[foo]\na = [1,2,3,4,5,6,7,8,9,0]", + "$.foo.a[0:5]", + []interface{}{ + queryTestNode{ + int64(1), toml.Position{2, 1}, + }, + queryTestNode{ + int64(2), toml.Position{2, 1}, + }, + queryTestNode{ + int64(3), toml.Position{2, 1}, + }, + queryTestNode{ + int64(4), toml.Position{2, 1}, + }, + queryTestNode{ + int64(5), toml.Position{2, 1}, + }, + }) +} + +func TestQuerySliceStep(t *testing.T) { + assertQueryPositions(t, + "[foo]\na = [1,2,3,4,5,6,7,8,9,0]", + "$.foo.a[0:5:2]", + []interface{}{ + queryTestNode{ + int64(1), toml.Position{2, 1}, + }, + queryTestNode{ + int64(3), toml.Position{2, 1}, + }, + queryTestNode{ + int64(5), toml.Position{2, 1}, + }, + }) +} + +func TestQueryAny(t *testing.T) { + assertQueryPositions(t, + "[foo.bar]\na=1\nb=2\n[foo.baz]\na=3\nb=4", + "$.foo.*", + []interface{}{ + queryTestNode{ + map[string]interface{}{ + "a": int64(1), + "b": int64(2), + }, toml.Position{1, 1}, + }, + queryTestNode{ + map[string]interface{}{ + "a": int64(3), + "b": int64(4), + }, toml.Position{4, 1}, + }, + }) +} +func TestQueryUnionSimple(t *testing.T) { + assertQueryPositions(t, + "[foo.bar]\na=1\nb=2\n[baz.foo]\na=3\nb=4\n[gorf.foo]\na=5\nb=6", + "$.*[bar,foo]", + []interface{}{ + queryTestNode{ + map[string]interface{}{ + "a": int64(1), + "b": int64(2), + }, toml.Position{1, 1}, + }, + queryTestNode{ + map[string]interface{}{ + "a": int64(3), + "b": int64(4), + }, toml.Position{4, 1}, + }, + queryTestNode{ + map[string]interface{}{ + "a": int64(5), + "b": int64(6), + }, toml.Position{7, 1}, + }, + }) +} + +func TestQueryRecursionAll(t *testing.T) { + assertQueryPositions(t, + "[foo.bar]\na=1\nb=2\n[baz.foo]\na=3\nb=4\n[gorf.foo]\na=5\nb=6", + "$..*", + []interface{}{ + queryTestNode{ + map[string]interface{}{ + "foo": map[string]interface{}{ + "bar": map[string]interface{}{ + "a": int64(1), + "b": int64(2), + }, + }, + "baz": map[string]interface{}{ + "foo": map[string]interface{}{ + "a": int64(3), + "b": int64(4), + }, + }, + "gorf": map[string]interface{}{ + "foo": map[string]interface{}{ + "a": int64(5), + "b": int64(6), + }, + }, + }, toml.Position{1, 1}, + }, + queryTestNode{ + map[string]interface{}{ + "bar": map[string]interface{}{ + "a": int64(1), + "b": int64(2), + }, + }, toml.Position{1, 1}, + }, + queryTestNode{ + map[string]interface{}{ + "a": int64(1), + "b": int64(2), + }, toml.Position{1, 1}, + }, + queryTestNode{ + int64(1), toml.Position{2, 1}, + }, + queryTestNode{ + int64(2), toml.Position{3, 1}, + }, + queryTestNode{ + map[string]interface{}{ + "foo": map[string]interface{}{ + "a": int64(3), + "b": int64(4), + }, + }, toml.Position{4, 1}, + }, + queryTestNode{ + map[string]interface{}{ + "a": int64(3), + "b": int64(4), + }, toml.Position{4, 1}, + }, + queryTestNode{ + int64(3), toml.Position{5, 1}, + }, + queryTestNode{ + int64(4), toml.Position{6, 1}, + }, + queryTestNode{ + map[string]interface{}{ + "foo": map[string]interface{}{ + "a": int64(5), + "b": int64(6), + }, + }, toml.Position{7, 1}, + }, + queryTestNode{ + map[string]interface{}{ + "a": int64(5), + "b": int64(6), + }, toml.Position{7, 1}, + }, + queryTestNode{ + int64(5), toml.Position{8, 1}, + }, + queryTestNode{ + int64(6), toml.Position{9, 1}, + }, + }) +} + +func TestQueryRecursionUnionSimple(t *testing.T) { + assertQueryPositions(t, + "[foo.bar]\na=1\nb=2\n[baz.foo]\na=3\nb=4\n[gorf.foo]\na=5\nb=6", + "$..['foo','bar']", + []interface{}{ + queryTestNode{ + map[string]interface{}{ + "bar": map[string]interface{}{ + "a": int64(1), + "b": int64(2), + }, + }, toml.Position{1, 1}, + }, + queryTestNode{ + map[string]interface{}{ + "a": int64(3), + "b": int64(4), + }, toml.Position{4, 1}, + }, + queryTestNode{ + map[string]interface{}{ + "a": int64(1), + "b": int64(2), + }, toml.Position{1, 1}, + }, + queryTestNode{ + map[string]interface{}{ + "a": int64(5), + "b": int64(6), + }, toml.Position{7, 1}, + }, + }) +} + +func TestQueryFilterFn(t *testing.T) { + buff, err := ioutil.ReadFile("../example.toml") + if err != nil { + t.Error(err) + return + } + + assertQueryPositions(t, string(buff), + "$..[?(int)]", + []interface{}{ + queryTestNode{ + int64(8001), toml.Position{13, 1}, + }, + queryTestNode{ + int64(8001), toml.Position{13, 1}, + }, + queryTestNode{ + int64(8002), toml.Position{13, 1}, + }, + queryTestNode{ + int64(5000), toml.Position{14, 1}, + }, + }) + + assertQueryPositions(t, string(buff), + "$..[?(string)]", + []interface{}{ + queryTestNode{ + "TOML Example", toml.Position{3, 1}, + }, + queryTestNode{ + "Tom Preston-Werner", toml.Position{6, 1}, + }, + queryTestNode{ + "GitHub", toml.Position{7, 1}, + }, + queryTestNode{ + "GitHub Cofounder & CEO\nLikes tater tots and beer.", + toml.Position{8, 1}, + }, + queryTestNode{ + "192.168.1.1", toml.Position{12, 1}, + }, + queryTestNode{ + "10.0.0.1", toml.Position{21, 3}, + }, + queryTestNode{ + "eqdc10", toml.Position{22, 3}, + }, + queryTestNode{ + "10.0.0.2", toml.Position{25, 3}, + }, + queryTestNode{ + "eqdc10", toml.Position{26, 3}, + }, + }) + + assertQueryPositions(t, string(buff), + "$..[?(float)]", + []interface{}{ + // no float values in document + }) + + tv, _ := time.Parse(time.RFC3339, "1979-05-27T07:32:00Z") + assertQueryPositions(t, string(buff), + "$..[?(tree)]", + []interface{}{ + queryTestNode{ + map[string]interface{}{ + "name": "Tom Preston-Werner", + "organization": "GitHub", + "bio": "GitHub Cofounder & CEO\nLikes tater tots and beer.", + "dob": tv, + }, toml.Position{5, 1}, + }, + queryTestNode{ + map[string]interface{}{ + "server": "192.168.1.1", + "ports": []interface{}{int64(8001), int64(8001), int64(8002)}, + "connection_max": int64(5000), + "enabled": true, + }, toml.Position{11, 1}, + }, + queryTestNode{ + map[string]interface{}{ + "alpha": map[string]interface{}{ + "ip": "10.0.0.1", + "dc": "eqdc10", + }, + "beta": map[string]interface{}{ + "ip": "10.0.0.2", + "dc": "eqdc10", + }, + }, toml.Position{17, 1}, + }, + queryTestNode{ + map[string]interface{}{ + "ip": "10.0.0.1", + "dc": "eqdc10", + }, toml.Position{20, 3}, + }, + queryTestNode{ + map[string]interface{}{ + "ip": "10.0.0.2", + "dc": "eqdc10", + }, toml.Position{24, 3}, + }, + queryTestNode{ + map[string]interface{}{ + "data": []interface{}{ + []interface{}{"gamma", "delta"}, + []interface{}{int64(1), int64(2)}, + }, + }, toml.Position{28, 1}, + }, + }) + + assertQueryPositions(t, string(buff), + "$..[?(time)]", + []interface{}{ + queryTestNode{ + tv, toml.Position{9, 1}, + }, + }) + + assertQueryPositions(t, string(buff), + "$..[?(bool)]", + []interface{}{ + queryTestNode{ + true, toml.Position{15, 1}, + }, + }) +} diff --git a/vendor/github.com/pelletier/go-toml/query/query.go b/vendor/github.com/pelletier/go-toml/query/query.go new file mode 100644 index 0000000000..1c6cd80143 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/query/query.go @@ -0,0 +1,158 @@ +package query + +import ( + "time" + + "github.com/pelletier/go-toml" +) + +// NodeFilterFn represents a user-defined filter function, for use with +// Query.SetFilter(). +// +// The return value of the function must indicate if 'node' is to be included +// at this stage of the TOML path. Returning true will include the node, and +// returning false will exclude it. +// +// NOTE: Care should be taken to write script callbacks such that they are safe +// to use from multiple goroutines. +type NodeFilterFn func(node interface{}) bool + +// Result is the result of Executing a Query. +type Result struct { + items []interface{} + positions []toml.Position +} + +// appends a value/position pair to the result set. +func (r *Result) appendResult(node interface{}, pos toml.Position) { + r.items = append(r.items, node) + r.positions = append(r.positions, pos) +} + +// Values is a set of values within a Result. The order of values is not +// guaranteed to be in document order, and may be different each time a query is +// executed. +func (r Result) Values() []interface{} { + return r.items +} + +// Positions is a set of positions for values within a Result. Each index +// in Positions() corresponds to the entry in Value() of the same index. +func (r Result) Positions() []toml.Position { + return r.positions +} + +// runtime context for executing query paths +type queryContext struct { + result *Result + filters *map[string]NodeFilterFn + lastPosition toml.Position +} + +// generic path functor interface +type pathFn interface { + setNext(next pathFn) + // it is the caller's responsibility to set the ctx.lastPosition before invoking call() + // node can be one of: *toml.Tree, []*toml.Tree, or a scalar + call(node interface{}, ctx *queryContext) +} + +// A Query is the representation of a compiled TOML path. A Query is safe +// for concurrent use by multiple goroutines. +type Query struct { + root pathFn + tail pathFn + filters *map[string]NodeFilterFn +} + +func newQuery() *Query { + return &Query{ + root: nil, + tail: nil, + filters: &defaultFilterFunctions, + } +} + +func (q *Query) appendPath(next pathFn) { + if q.root == nil { + q.root = next + } else { + q.tail.setNext(next) + } + q.tail = next + next.setNext(newTerminatingFn()) // init the next functor +} + +// Compile compiles a TOML path expression. The returned Query can be used +// to match elements within a Tree and its descendants. See Execute. +func Compile(path string) (*Query, error) { + return parseQuery(lexQuery(path)) +} + +// Execute executes a query against a Tree, and returns the result of the query. +func (q *Query) Execute(tree *toml.Tree) *Result { + result := &Result{ + items: []interface{}{}, + positions: []toml.Position{}, + } + if q.root == nil { + result.appendResult(tree, tree.GetPosition("")) + } else { + ctx := &queryContext{ + result: result, + filters: q.filters, + } + ctx.lastPosition = tree.Position() + q.root.call(tree, ctx) + } + return result +} + +// CompileAndExecute is a shorthand for Compile(path) followed by Execute(tree). +func CompileAndExecute(path string, tree *toml.Tree) (*Result, error) { + query, err := Compile(path) + if err != nil { + return nil, err + } + return query.Execute(tree), nil +} + +// SetFilter sets a user-defined filter function. These may be used inside +// "?(..)" query expressions to filter TOML document elements within a query. +func (q *Query) SetFilter(name string, fn NodeFilterFn) { + if q.filters == &defaultFilterFunctions { + // clone the static table + q.filters = &map[string]NodeFilterFn{} + for k, v := range defaultFilterFunctions { + (*q.filters)[k] = v + } + } + (*q.filters)[name] = fn +} + +var defaultFilterFunctions = map[string]NodeFilterFn{ + "tree": func(node interface{}) bool { + _, ok := node.(*toml.Tree) + return ok + }, + "int": func(node interface{}) bool { + _, ok := node.(int64) + return ok + }, + "float": func(node interface{}) bool { + _, ok := node.(float64) + return ok + }, + "string": func(node interface{}) bool { + _, ok := node.(string) + return ok + }, + "time": func(node interface{}) bool { + _, ok := node.(time.Time) + return ok + }, + "bool": func(node interface{}) bool { + _, ok := node.(bool) + return ok + }, +} diff --git a/vendor/github.com/pelletier/go-toml/query/query_test.go b/vendor/github.com/pelletier/go-toml/query/query_test.go new file mode 100644 index 0000000000..903a8dc731 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/query/query_test.go @@ -0,0 +1,157 @@ +package query + +import ( + "fmt" + "testing" + + "github.com/pelletier/go-toml" +) + +func assertArrayContainsInAnyOrder(t *testing.T, array []interface{}, objects ...interface{}) { + if len(array) != len(objects) { + t.Fatalf("array contains %d objects but %d are expected", len(array), len(objects)) + } + + for _, o := range objects { + found := false + for _, a := range array { + if a == o { + found = true + break + } + } + if !found { + t.Fatal(o, "not found in array", array) + } + } +} + +func TestQueryExample(t *testing.T) { + config, _ := toml.Load(` + [[book]] + title = "The Stand" + author = "Stephen King" + [[book]] + title = "For Whom the Bell Tolls" + author = "Ernest Hemmingway" + [[book]] + title = "Neuromancer" + author = "William Gibson" + `) + authors, err := CompileAndExecute("$.book.author", config) + if err != nil { + t.Fatal("unexpected error:", err) + } + names := authors.Values() + if len(names) != 3 { + t.Fatalf("query should return 3 names but returned %d", len(names)) + } + assertArrayContainsInAnyOrder(t, names, "Stephen King", "Ernest Hemmingway", "William Gibson") +} + +func TestQueryReadmeExample(t *testing.T) { + config, _ := toml.Load(` +[postgres] +user = "pelletier" +password = "mypassword" +`) + + query, err := Compile("$..[user,password]") + if err != nil { + t.Fatal("unexpected error:", err) + } + results := query.Execute(config) + values := results.Values() + if len(values) != 2 { + t.Fatalf("query should return 2 values but returned %d", len(values)) + } + assertArrayContainsInAnyOrder(t, values, "pelletier", "mypassword") +} + +func TestQueryPathNotPresent(t *testing.T) { + config, _ := toml.Load(`a = "hello"`) + query, err := Compile("$.foo.bar") + if err != nil { + t.Fatal("unexpected error:", err) + } + results := query.Execute(config) + if err != nil { + t.Fatalf("err should be nil. got %s instead", err) + } + if len(results.items) != 0 { + t.Fatalf("no items should be matched. %d matched instead", len(results.items)) + } +} + +func ExampleNodeFilterFn_filterExample() { + tree, _ := toml.Load(` + [struct_one] + foo = "foo" + bar = "bar" + + [struct_two] + baz = "baz" + gorf = "gorf" + `) + + // create a query that references a user-defined-filter + query, _ := Compile("$[?(bazOnly)]") + + // define the filter, and assign it to the query + query.SetFilter("bazOnly", func(node interface{}) bool { + if tree, ok := node.(*toml.Tree); ok { + return tree.Has("baz") + } + return false // reject all other node types + }) + + // results contain only the 'struct_two' Tree + query.Execute(tree) +} + +func ExampleQuery_queryExample() { + config, _ := toml.Load(` + [[book]] + title = "The Stand" + author = "Stephen King" + [[book]] + title = "For Whom the Bell Tolls" + author = "Ernest Hemmingway" + [[book]] + title = "Neuromancer" + author = "William Gibson" + `) + + // find and print all the authors in the document + query, _ := Compile("$.book.author") + authors := query.Execute(config) + for _, name := range authors.Values() { + fmt.Println(name) + } +} + +func TestTomlQuery(t *testing.T) { + tree, err := toml.Load("[foo.bar]\na=1\nb=2\n[baz.foo]\na=3\nb=4\n[gorf.foo]\na=5\nb=6") + if err != nil { + t.Error(err) + return + } + query, err := Compile("$.foo.bar") + if err != nil { + t.Error(err) + return + } + result := query.Execute(tree) + values := result.Values() + if len(values) != 1 { + t.Errorf("Expected resultset of 1, got %d instead: %v", len(values), values) + } + + if tt, ok := values[0].(*toml.Tree); !ok { + t.Errorf("Expected type of Tree: %T", values[0]) + } else if tt.Get("a") != int64(1) { + t.Errorf("Expected 'a' with a value 1: %v", tt.Get("a")) + } else if tt.Get("b") != int64(2) { + t.Errorf("Expected 'b' with a value 2: %v", tt.Get("b")) + } +} diff --git a/vendor/github.com/pelletier/go-toml/query/tokens.go b/vendor/github.com/pelletier/go-toml/query/tokens.go new file mode 100644 index 0000000000..9ae579de2d --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/query/tokens.go @@ -0,0 +1,106 @@ +package query + +import ( + "fmt" + "github.com/pelletier/go-toml" + "strconv" + "unicode" +) + +// Define tokens +type tokenType int + +const ( + eof = -(iota + 1) +) + +const ( + tokenError tokenType = iota + tokenEOF + tokenKey + tokenString + tokenInteger + tokenFloat + tokenLeftBracket + tokenRightBracket + tokenLeftParen + tokenRightParen + tokenComma + tokenColon + tokenDollar + tokenStar + tokenQuestion + tokenDot + tokenDotDot +) + +var tokenTypeNames = []string{ + "Error", + "EOF", + "Key", + "String", + "Integer", + "Float", + "[", + "]", + "(", + ")", + ",", + ":", + "$", + "*", + "?", + ".", + "..", +} + +type token struct { + toml.Position + typ tokenType + val string +} + +func (tt tokenType) String() string { + idx := int(tt) + if idx < len(tokenTypeNames) { + return tokenTypeNames[idx] + } + return "Unknown" +} + +func (t token) Int() int { + if result, err := strconv.Atoi(t.val); err != nil { + panic(err) + } else { + return result + } +} + +func (t token) String() string { + switch t.typ { + case tokenEOF: + return "EOF" + case tokenError: + return t.val + } + + return fmt.Sprintf("%q", t.val) +} + +func isSpace(r rune) bool { + return r == ' ' || r == '\t' +} + +func isAlphanumeric(r rune) bool { + return unicode.IsLetter(r) || r == '_' +} + +func isDigit(r rune) bool { + return unicode.IsNumber(r) +} + +func isHexDigit(r rune) bool { + return isDigit(r) || + (r >= 'a' && r <= 'f') || + (r >= 'A' && r <= 'F') +} diff --git a/vendor/github.com/pelletier/go-toml/test.sh b/vendor/github.com/pelletier/go-toml/test.sh new file mode 100755 index 0000000000..91a889670f --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/test.sh @@ -0,0 +1,90 @@ +#!/bin/bash +# fail out of the script if anything here fails +set -e + +# set the path to the present working directory +export GOPATH=`pwd` + +function git_clone() { + path=$1 + branch=$2 + version=$3 + if [ ! -d "src/$path" ]; then + mkdir -p src/$path + git clone https://$path.git src/$path + fi + pushd src/$path + git checkout "$branch" + git reset --hard "$version" + popd +} + +# Remove potential previous runs +rm -rf src test_program_bin toml-test + +# Run go vet +go vet ./... + +go get github.com/pelletier/go-buffruneio +go get github.com/davecgh/go-spew/spew +go get gopkg.in/yaml.v2 +go get github.com/BurntSushi/toml + +# get code for BurntSushi TOML validation +# pinning all to 'HEAD' for version 0.3.x work (TODO: pin to commit hash when tests stabilize) +git_clone github.com/BurntSushi/toml master HEAD +git_clone github.com/BurntSushi/toml-test master HEAD #was: 0.2.0 HEAD + +# build the BurntSushi test application +go build -o toml-test github.com/BurntSushi/toml-test + +# vendorize the current lib for testing +# NOTE: this basically mocks an install without having to go back out to github for code +mkdir -p src/github.com/pelletier/go-toml/cmd +mkdir -p src/github.com/pelletier/go-toml/query +cp *.go *.toml src/github.com/pelletier/go-toml +cp -R cmd/* src/github.com/pelletier/go-toml/cmd +cp -R query/* src/github.com/pelletier/go-toml/query +go build -o test_program_bin src/github.com/pelletier/go-toml/cmd/test_program.go + +# Run basic unit tests +go test github.com/pelletier/go-toml -covermode=count -coverprofile=coverage.out +go test github.com/pelletier/go-toml/cmd/tomljson +go test github.com/pelletier/go-toml/query + +# run the entire BurntSushi test suite +if [[ $# -eq 0 ]] ; then + echo "Running all BurntSushi tests" + ./toml-test ./test_program_bin | tee test_out +else + # run a specific test + test=$1 + test_path='src/github.com/BurntSushi/toml-test/tests' + valid_test="$test_path/valid/$test" + invalid_test="$test_path/invalid/$test" + + if [ -e "$valid_test.toml" ]; then + echo "Valid Test TOML for $test:" + echo "====" + cat "$valid_test.toml" + + echo "Valid Test JSON for $test:" + echo "====" + cat "$valid_test.json" + + echo "Go-TOML Output for $test:" + echo "====" + cat "$valid_test.toml" | ./test_program_bin + fi + + if [ -e "$invalid_test.toml" ]; then + echo "Invalid Test TOML for $test:" + echo "====" + cat "$invalid_test.toml" + + echo "Go-TOML Output for $test:" + echo "====" + echo "go-toml Output:" + cat "$invalid_test.toml" | ./test_program_bin + fi +fi diff --git a/vendor/github.com/pelletier/go-toml/token.go b/vendor/github.com/pelletier/go-toml/token.go new file mode 100644 index 0000000000..5581fe0bcc --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/token.go @@ -0,0 +1,140 @@ +package toml + +import ( + "fmt" + "strconv" + "unicode" +) + +// Define tokens +type tokenType int + +const ( + eof = -(iota + 1) +) + +const ( + tokenError tokenType = iota + tokenEOF + tokenComment + tokenKey + tokenString + tokenInteger + tokenTrue + tokenFalse + tokenFloat + tokenEqual + tokenLeftBracket + tokenRightBracket + tokenLeftCurlyBrace + tokenRightCurlyBrace + tokenLeftParen + tokenRightParen + tokenDoubleLeftBracket + tokenDoubleRightBracket + tokenDate + tokenKeyGroup + tokenKeyGroupArray + tokenComma + tokenColon + tokenDollar + tokenStar + tokenQuestion + tokenDot + tokenDotDot + tokenEOL +) + +var tokenTypeNames = []string{ + "Error", + "EOF", + "Comment", + "Key", + "String", + "Integer", + "True", + "False", + "Float", + "=", + "[", + "]", + "{", + "}", + "(", + ")", + "]]", + "[[", + "Date", + "KeyGroup", + "KeyGroupArray", + ",", + ":", + "$", + "*", + "?", + ".", + "..", + "EOL", +} + +type token struct { + Position + typ tokenType + val string +} + +func (tt tokenType) String() string { + idx := int(tt) + if idx < len(tokenTypeNames) { + return tokenTypeNames[idx] + } + return "Unknown" +} + +func (t token) Int() int { + if result, err := strconv.Atoi(t.val); err != nil { + panic(err) + } else { + return result + } +} + +func (t token) String() string { + switch t.typ { + case tokenEOF: + return "EOF" + case tokenError: + return t.val + } + + return fmt.Sprintf("%q", t.val) +} + +func isSpace(r rune) bool { + return r == ' ' || r == '\t' +} + +func isAlphanumeric(r rune) bool { + return unicode.IsLetter(r) || r == '_' +} + +func isKeyChar(r rune) bool { + // Keys start with the first character that isn't whitespace or [ and end + // with the last non-whitespace character before the equals sign. Keys + // cannot contain a # character." + return !(r == '\r' || r == '\n' || r == eof || r == '=') +} + +func isKeyStartChar(r rune) bool { + return !(isSpace(r) || r == '\r' || r == '\n' || r == eof || r == '[') +} + +func isDigit(r rune) bool { + return unicode.IsNumber(r) +} + +func isHexDigit(r rune) bool { + return isDigit(r) || + (r >= 'a' && r <= 'f') || + (r >= 'A' && r <= 'F') +} diff --git a/vendor/github.com/pelletier/go-toml/token_test.go b/vendor/github.com/pelletier/go-toml/token_test.go new file mode 100644 index 0000000000..20b560d510 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/token_test.go @@ -0,0 +1,67 @@ +package toml + +import "testing" + +func TestTokenStringer(t *testing.T) { + var tests = []struct { + tt tokenType + expect string + }{ + {tokenError, "Error"}, + {tokenEOF, "EOF"}, + {tokenComment, "Comment"}, + {tokenKey, "Key"}, + {tokenString, "String"}, + {tokenInteger, "Integer"}, + {tokenTrue, "True"}, + {tokenFalse, "False"}, + {tokenFloat, "Float"}, + {tokenEqual, "="}, + {tokenLeftBracket, "["}, + {tokenRightBracket, "]"}, + {tokenLeftCurlyBrace, "{"}, + {tokenRightCurlyBrace, "}"}, + {tokenLeftParen, "("}, + {tokenRightParen, ")"}, + {tokenDoubleLeftBracket, "]]"}, + {tokenDoubleRightBracket, "[["}, + {tokenDate, "Date"}, + {tokenKeyGroup, "KeyGroup"}, + {tokenKeyGroupArray, "KeyGroupArray"}, + {tokenComma, ","}, + {tokenColon, ":"}, + {tokenDollar, "$"}, + {tokenStar, "*"}, + {tokenQuestion, "?"}, + {tokenDot, "."}, + {tokenDotDot, ".."}, + {tokenEOL, "EOL"}, + {tokenEOL + 1, "Unknown"}, + } + + for i, test := range tests { + got := test.tt.String() + if got != test.expect { + t.Errorf("[%d] invalid string of token type; got %q, expected %q", i, got, test.expect) + } + } +} + +func TestTokenString(t *testing.T) { + var tests = []struct { + tok token + expect string + }{ + {token{Position{1, 1}, tokenEOF, ""}, "EOF"}, + {token{Position{1, 1}, tokenError, "Δt"}, "Δt"}, + {token{Position{1, 1}, tokenString, "bar"}, `"bar"`}, + {token{Position{1, 1}, tokenString, "123456789012345"}, `"123456789012345"`}, + } + + for i, test := range tests { + got := test.tok.String() + if got != test.expect { + t.Errorf("[%d] invalid of string token; got %q, expected %q", i, got, test.expect) + } + } +} diff --git a/vendor/github.com/pelletier/go-toml/toml.go b/vendor/github.com/pelletier/go-toml/toml.go new file mode 100644 index 0000000000..64f19ed30c --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/toml.go @@ -0,0 +1,292 @@ +package toml + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "os" + "runtime" + "strings" +) + +type tomlValue struct { + value interface{} // string, int64, uint64, float64, bool, time.Time, [] of any of this list + position Position +} + +// Tree is the result of the parsing of a TOML file. +type Tree struct { + values map[string]interface{} // string -> *tomlValue, *Tree, []*Tree + position Position +} + +func newTree() *Tree { + return &Tree{ + values: make(map[string]interface{}), + position: Position{}, + } +} + +// TreeFromMap initializes a new Tree object using the given map. +func TreeFromMap(m map[string]interface{}) (*Tree, error) { + result, err := toTree(m) + if err != nil { + return nil, err + } + return result.(*Tree), nil +} + +// Position returns the position of the tree. +func (t *Tree) Position() Position { + return t.position +} + +// Has returns a boolean indicating if the given key exists. +func (t *Tree) Has(key string) bool { + if key == "" { + return false + } + return t.HasPath(strings.Split(key, ".")) +} + +// HasPath returns true if the given path of keys exists, false otherwise. +func (t *Tree) HasPath(keys []string) bool { + return t.GetPath(keys) != nil +} + +// Keys returns the keys of the toplevel tree (does not recurse). +func (t *Tree) Keys() []string { + keys := make([]string, len(t.values)) + i := 0 + for k := range t.values { + keys[i] = k + i++ + } + return keys +} + +// Get the value at key in the Tree. +// Key is a dot-separated path (e.g. a.b.c). +// Returns nil if the path does not exist in the tree. +// If keys is of length zero, the current tree is returned. +func (t *Tree) Get(key string) interface{} { + if key == "" { + return t + } + comps, err := parseKey(key) + if err != nil { + return nil + } + return t.GetPath(comps) +} + +// GetPath returns the element in the tree indicated by 'keys'. +// If keys is of length zero, the current tree is returned. +func (t *Tree) GetPath(keys []string) interface{} { + if len(keys) == 0 { + return t + } + subtree := t + for _, intermediateKey := range keys[:len(keys)-1] { + value, exists := subtree.values[intermediateKey] + if !exists { + return nil + } + switch node := value.(type) { + case *Tree: + subtree = node + case []*Tree: + // go to most recent element + if len(node) == 0 { + return nil + } + subtree = node[len(node)-1] + default: + return nil // cannot navigate through other node types + } + } + // branch based on final node type + switch node := subtree.values[keys[len(keys)-1]].(type) { + case *tomlValue: + return node.value + default: + return node + } +} + +// GetPosition returns the position of the given key. +func (t *Tree) GetPosition(key string) Position { + if key == "" { + return t.position + } + return t.GetPositionPath(strings.Split(key, ".")) +} + +// GetPositionPath returns the element in the tree indicated by 'keys'. +// If keys is of length zero, the current tree is returned. +func (t *Tree) GetPositionPath(keys []string) Position { + if len(keys) == 0 { + return t.position + } + subtree := t + for _, intermediateKey := range keys[:len(keys)-1] { + value, exists := subtree.values[intermediateKey] + if !exists { + return Position{0, 0} + } + switch node := value.(type) { + case *Tree: + subtree = node + case []*Tree: + // go to most recent element + if len(node) == 0 { + return Position{0, 0} + } + subtree = node[len(node)-1] + default: + return Position{0, 0} + } + } + // branch based on final node type + switch node := subtree.values[keys[len(keys)-1]].(type) { + case *tomlValue: + return node.position + case *Tree: + return node.position + case []*Tree: + // go to most recent element + if len(node) == 0 { + return Position{0, 0} + } + return node[len(node)-1].position + default: + return Position{0, 0} + } +} + +// GetDefault works like Get but with a default value +func (t *Tree) GetDefault(key string, def interface{}) interface{} { + val := t.Get(key) + if val == nil { + return def + } + return val +} + +// Set an element in the tree. +// Key is a dot-separated path (e.g. a.b.c). +// Creates all necessary intermediate trees, if needed. +func (t *Tree) Set(key string, value interface{}) { + t.SetPath(strings.Split(key, "."), value) +} + +// SetPath sets an element in the tree. +// Keys is an array of path elements (e.g. {"a","b","c"}). +// Creates all necessary intermediate trees, if needed. +func (t *Tree) SetPath(keys []string, value interface{}) { + subtree := t + for _, intermediateKey := range keys[:len(keys)-1] { + nextTree, exists := subtree.values[intermediateKey] + if !exists { + nextTree = newTree() + subtree.values[intermediateKey] = nextTree // add new element here + } + switch node := nextTree.(type) { + case *Tree: + subtree = node + case []*Tree: + // go to most recent element + if len(node) == 0 { + // create element if it does not exist + subtree.values[intermediateKey] = append(node, newTree()) + } + subtree = node[len(node)-1] + } + } + + var toInsert interface{} + + switch value.(type) { + case *Tree: + toInsert = value + case []*Tree: + toInsert = value + case *tomlValue: + toInsert = value + default: + toInsert = &tomlValue{value: value} + } + + subtree.values[keys[len(keys)-1]] = toInsert +} + +// createSubTree takes a tree and a key and create the necessary intermediate +// subtrees to create a subtree at that point. In-place. +// +// e.g. passing a.b.c will create (assuming tree is empty) tree[a], tree[a][b] +// and tree[a][b][c] +// +// Returns nil on success, error object on failure +func (t *Tree) createSubTree(keys []string, pos Position) error { + subtree := t + for _, intermediateKey := range keys { + nextTree, exists := subtree.values[intermediateKey] + if !exists { + tree := newTree() + tree.position = pos + subtree.values[intermediateKey] = tree + nextTree = tree + } + + switch node := nextTree.(type) { + case []*Tree: + subtree = node[len(node)-1] + case *Tree: + subtree = node + default: + return fmt.Errorf("unknown type for path %s (%s): %T (%#v)", + strings.Join(keys, "."), intermediateKey, nextTree, nextTree) + } + } + return nil +} + +// LoadBytes creates a Tree from a []byte. +func LoadBytes(b []byte) (tree *Tree, err error) { + defer func() { + if r := recover(); r != nil { + if _, ok := r.(runtime.Error); ok { + panic(r) + } + err = errors.New(r.(string)) + } + }() + tree = parseToml(lexToml(b)) + return +} + +// LoadReader creates a Tree from any io.Reader. +func LoadReader(reader io.Reader) (tree *Tree, err error) { + inputBytes, err := ioutil.ReadAll(reader) + if err != nil { + return + } + tree, err = LoadBytes(inputBytes) + return +} + +// Load creates a Tree from a string. +func Load(content string) (tree *Tree, err error) { + return LoadBytes([]byte(content)) +} + +// LoadFile creates a Tree from a file. +func LoadFile(path string) (tree *Tree, err error) { + file, err := os.Open(path) + if err != nil { + return nil, err + } + defer file.Close() + return LoadReader(file) +} diff --git a/vendor/github.com/pelletier/go-toml/toml_test.go b/vendor/github.com/pelletier/go-toml/toml_test.go new file mode 100644 index 0000000000..ab9c242535 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/toml_test.go @@ -0,0 +1,106 @@ +// Testing support for go-toml + +package toml + +import ( + "testing" +) + +func TestTomlHas(t *testing.T) { + tree, _ := Load(` + [test] + key = "value" + `) + + if !tree.Has("test.key") { + t.Errorf("Has - expected test.key to exists") + } + + if tree.Has("") { + t.Errorf("Should return false if the key is not provided") + } +} + +func TestTomlGet(t *testing.T) { + tree, _ := Load(` + [test] + key = "value" + `) + + if tree.Get("") != tree { + t.Errorf("Get should return the tree itself when given an empty path") + } + + if tree.Get("test.key") != "value" { + t.Errorf("Get should return the value") + } + if tree.Get(`\`) != nil { + t.Errorf("should return nil when the key is malformed") + } +} + +func TestTomlGetDefault(t *testing.T) { + tree, _ := Load(` + [test] + key = "value" + `) + + if tree.GetDefault("", "hello") != tree { + t.Error("GetDefault should return the tree itself when given an empty path") + } + + if tree.GetDefault("test.key", "hello") != "value" { + t.Error("Get should return the value") + } + + if tree.GetDefault("whatever", "hello") != "hello" { + t.Error("GetDefault should return the default value if the key does not exist") + } +} + +func TestTomlHasPath(t *testing.T) { + tree, _ := Load(` + [test] + key = "value" + `) + + if !tree.HasPath([]string{"test", "key"}) { + t.Errorf("HasPath - expected test.key to exists") + } +} + +func TestTomlGetPath(t *testing.T) { + node := newTree() + //TODO: set other node data + + for idx, item := range []struct { + Path []string + Expected *Tree + }{ + { // empty path test + []string{}, + node, + }, + } { + result := node.GetPath(item.Path) + if result != item.Expected { + t.Errorf("GetPath[%d] %v - expected %v, got %v instead.", idx, item.Path, item.Expected, result) + } + } + + tree, _ := Load("[foo.bar]\na=1\nb=2\n[baz.foo]\na=3\nb=4\n[gorf.foo]\na=5\nb=6") + if tree.GetPath([]string{"whatever"}) != nil { + t.Error("GetPath should return nil when the key does not exist") + } +} + +func TestTomlFromMap(t *testing.T) { + simpleMap := map[string]interface{}{"hello": 42} + tree, err := TreeFromMap(simpleMap) + if err != nil { + t.Fatal("unexpected error:", err) + } + if tree.Get("hello") != int64(42) { + t.Fatal("hello should be 42, not", tree.Get("hello")) + } +} diff --git a/vendor/github.com/pelletier/go-toml/tomltree_create.go b/vendor/github.com/pelletier/go-toml/tomltree_create.go new file mode 100644 index 0000000000..19d1c0dc66 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/tomltree_create.go @@ -0,0 +1,142 @@ +package toml + +import ( + "fmt" + "reflect" + "time" +) + +var kindToType = [reflect.String + 1]reflect.Type{ + reflect.Bool: reflect.TypeOf(true), + reflect.String: reflect.TypeOf(""), + reflect.Float32: reflect.TypeOf(float64(1)), + reflect.Float64: reflect.TypeOf(float64(1)), + reflect.Int: reflect.TypeOf(int64(1)), + reflect.Int8: reflect.TypeOf(int64(1)), + reflect.Int16: reflect.TypeOf(int64(1)), + reflect.Int32: reflect.TypeOf(int64(1)), + reflect.Int64: reflect.TypeOf(int64(1)), + reflect.Uint: reflect.TypeOf(uint64(1)), + reflect.Uint8: reflect.TypeOf(uint64(1)), + reflect.Uint16: reflect.TypeOf(uint64(1)), + reflect.Uint32: reflect.TypeOf(uint64(1)), + reflect.Uint64: reflect.TypeOf(uint64(1)), +} + +// typeFor returns a reflect.Type for a reflect.Kind, or nil if none is found. +// supported values: +// string, bool, int64, uint64, float64, time.Time, int, int8, int16, int32, uint, uint8, uint16, uint32, float32 +func typeFor(k reflect.Kind) reflect.Type { + if k > 0 && int(k) < len(kindToType) { + return kindToType[k] + } + return nil +} + +func simpleValueCoercion(object interface{}) (interface{}, error) { + switch original := object.(type) { + case string, bool, int64, uint64, float64, time.Time: + return original, nil + case int: + return int64(original), nil + case int8: + return int64(original), nil + case int16: + return int64(original), nil + case int32: + return int64(original), nil + case uint: + return uint64(original), nil + case uint8: + return uint64(original), nil + case uint16: + return uint64(original), nil + case uint32: + return uint64(original), nil + case float32: + return float64(original), nil + case fmt.Stringer: + return original.String(), nil + default: + return nil, fmt.Errorf("cannot convert type %T to Tree", object) + } +} + +func sliceToTree(object interface{}) (interface{}, error) { + // arrays are a bit tricky, since they can represent either a + // collection of simple values, which is represented by one + // *tomlValue, or an array of tables, which is represented by an + // array of *Tree. + + // holding the assumption that this function is called from toTree only when value.Kind() is Array or Slice + value := reflect.ValueOf(object) + insideType := value.Type().Elem() + length := value.Len() + if length > 0 { + insideType = reflect.ValueOf(value.Index(0).Interface()).Type() + } + if insideType.Kind() == reflect.Map { + // this is considered as an array of tables + tablesArray := make([]*Tree, 0, length) + for i := 0; i < length; i++ { + table := value.Index(i) + tree, err := toTree(table.Interface()) + if err != nil { + return nil, err + } + tablesArray = append(tablesArray, tree.(*Tree)) + } + return tablesArray, nil + } + + sliceType := typeFor(insideType.Kind()) + if sliceType == nil { + sliceType = insideType + } + + arrayValue := reflect.MakeSlice(reflect.SliceOf(sliceType), 0, length) + + for i := 0; i < length; i++ { + val := value.Index(i).Interface() + simpleValue, err := simpleValueCoercion(val) + if err != nil { + return nil, err + } + arrayValue = reflect.Append(arrayValue, reflect.ValueOf(simpleValue)) + } + return &tomlValue{arrayValue.Interface(), Position{}}, nil +} + +func toTree(object interface{}) (interface{}, error) { + value := reflect.ValueOf(object) + + if value.Kind() == reflect.Map { + values := map[string]interface{}{} + keys := value.MapKeys() + for _, key := range keys { + if key.Kind() != reflect.String { + if _, ok := key.Interface().(string); !ok { + return nil, fmt.Errorf("map key needs to be a string, not %T (%v)", key.Interface(), key.Kind()) + } + } + + v := value.MapIndex(key) + newValue, err := toTree(v.Interface()) + if err != nil { + return nil, err + } + values[key.String()] = newValue + } + return &Tree{values, Position{}}, nil + } + + if value.Kind() == reflect.Array || value.Kind() == reflect.Slice { + return sliceToTree(object) + } + + simpleValue, err := simpleValueCoercion(object) + if err != nil { + return nil, err + } + return &tomlValue{simpleValue, Position{}}, nil +} diff --git a/vendor/github.com/pelletier/go-toml/tomltree_create_test.go b/vendor/github.com/pelletier/go-toml/tomltree_create_test.go new file mode 100644 index 0000000000..1ca108a524 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/tomltree_create_test.go @@ -0,0 +1,126 @@ +package toml + +import ( + "strconv" + "testing" + "time" +) + +type customString string + +type stringer struct{} + +func (s stringer) String() string { + return "stringer" +} + +func validate(t *testing.T, path string, object interface{}) { + switch o := object.(type) { + case *Tree: + for key, tree := range o.values { + validate(t, path+"."+key, tree) + } + case []*Tree: + for index, tree := range o { + validate(t, path+"."+strconv.Itoa(index), tree) + } + case *tomlValue: + switch o.value.(type) { + case int64, uint64, bool, string, float64, time.Time, + []int64, []uint64, []bool, []string, []float64, []time.Time: + default: + t.Fatalf("tomlValue at key %s containing incorrect type %T", path, o.value) + } + default: + t.Fatalf("value at key %s is of incorrect type %T", path, object) + } + t.Logf("validation ok %s as %T", path, object) +} + +func validateTree(t *testing.T, tree *Tree) { + validate(t, "", tree) +} + +func TestTreeCreateToTree(t *testing.T) { + data := map[string]interface{}{ + "a_string": "bar", + "an_int": 42, + "time": time.Now(), + "int8": int8(2), + "int16": int16(2), + "int32": int32(2), + "uint8": uint8(2), + "uint16": uint16(2), + "uint32": uint32(2), + "float32": float32(2), + "a_bool": false, + "stringer": stringer{}, + "nested": map[string]interface{}{ + "foo": "bar", + }, + "array": []string{"a", "b", "c"}, + "array_uint": []uint{uint(1), uint(2)}, + "array_table": []map[string]interface{}{map[string]interface{}{"sub_map": 52}}, + "array_times": []time.Time{time.Now(), time.Now()}, + "map_times": map[string]time.Time{"now": time.Now()}, + "custom_string_map_key": map[customString]interface{}{customString("custom"): "custom"}, + } + tree, err := TreeFromMap(data) + if err != nil { + t.Fatal("unexpected error:", err) + } + validateTree(t, tree) +} + +func TestTreeCreateToTreeInvalidLeafType(t *testing.T) { + _, err := TreeFromMap(map[string]interface{}{"foo": t}) + expected := "cannot convert type *testing.T to Tree" + if err.Error() != expected { + t.Fatalf("expected error %s, got %s", expected, err.Error()) + } +} + +func TestTreeCreateToTreeInvalidMapKeyType(t *testing.T) { + _, err := TreeFromMap(map[string]interface{}{"foo": map[int]interface{}{2: 1}}) + expected := "map key needs to be a string, not int (int)" + if err.Error() != expected { + t.Fatalf("expected error %s, got %s", expected, err.Error()) + } +} + +func TestTreeCreateToTreeInvalidArrayMemberType(t *testing.T) { + _, err := TreeFromMap(map[string]interface{}{"foo": []*testing.T{t}}) + expected := "cannot convert type *testing.T to Tree" + if err.Error() != expected { + t.Fatalf("expected error %s, got %s", expected, err.Error()) + } +} + +func TestTreeCreateToTreeInvalidTableGroupType(t *testing.T) { + _, err := TreeFromMap(map[string]interface{}{"foo": []map[string]interface{}{map[string]interface{}{"hello": t}}}) + expected := "cannot convert type *testing.T to Tree" + if err.Error() != expected { + t.Fatalf("expected error %s, got %s", expected, err.Error()) + } +} + +func TestRoundTripArrayOfTables(t *testing.T) { + orig := "\n[[stuff]]\n name = \"foo\"\n things = [\"a\",\"b\"]\n" + tree, err := Load(orig) + if err != nil { + t.Fatalf("unexpected error: %s", err) + } + + m := tree.ToMap() + + tree, err = TreeFromMap(m) + if err != nil { + t.Fatalf("unexpected error: %s", err) + } + want := orig + got := tree.String() + + if got != want { + t.Errorf("want:\n%s\ngot:\n%s", want, got) + } +} diff --git a/vendor/github.com/pelletier/go-toml/tomltree_write.go b/vendor/github.com/pelletier/go-toml/tomltree_write.go new file mode 100644 index 0000000000..ca763ed586 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/tomltree_write.go @@ -0,0 +1,233 @@ +package toml + +import ( + "bytes" + "fmt" + "io" + "math" + "reflect" + "sort" + "strconv" + "strings" + "time" +) + +// encodes a string to a TOML-compliant string value +func encodeTomlString(value string) string { + var b bytes.Buffer + + for _, rr := range value { + switch rr { + case '\b': + b.WriteString(`\b`) + case '\t': + b.WriteString(`\t`) + case '\n': + b.WriteString(`\n`) + case '\f': + b.WriteString(`\f`) + case '\r': + b.WriteString(`\r`) + case '"': + b.WriteString(`\"`) + case '\\': + b.WriteString(`\\`) + default: + intRr := uint16(rr) + if intRr < 0x001F { + b.WriteString(fmt.Sprintf("\\u%0.4X", intRr)) + } else { + b.WriteRune(rr) + } + } + } + return b.String() +} + +func tomlValueStringRepresentation(v interface{}) (string, error) { + switch value := v.(type) { + case uint64: + return strconv.FormatUint(value, 10), nil + case int64: + return strconv.FormatInt(value, 10), nil + case float64: + // Ensure a round float does contain a decimal point. Otherwise feeding + // the output back to the parser would convert to an integer. + if math.Trunc(value) == value { + return strconv.FormatFloat(value, 'f', 1, 32), nil + } + return strconv.FormatFloat(value, 'f', -1, 32), nil + case string: + return "\"" + encodeTomlString(value) + "\"", nil + case []byte: + b, _ := v.([]byte) + return tomlValueStringRepresentation(string(b)) + case bool: + if value { + return "true", nil + } + return "false", nil + case time.Time: + return value.Format(time.RFC3339), nil + case nil: + return "", nil + } + + rv := reflect.ValueOf(v) + + if rv.Kind() == reflect.Slice { + values := []string{} + for i := 0; i < rv.Len(); i++ { + item := rv.Index(i).Interface() + itemRepr, err := tomlValueStringRepresentation(item) + if err != nil { + return "", err + } + values = append(values, itemRepr) + } + return "[" + strings.Join(values, ",") + "]", nil + } + return "", fmt.Errorf("unsupported value type %T: %v", v, v) +} + +func (t *Tree) writeTo(w io.Writer, indent, keyspace string, bytesCount int64) (int64, error) { + simpleValuesKeys := make([]string, 0) + complexValuesKeys := make([]string, 0) + + for k := range t.values { + v := t.values[k] + switch v.(type) { + case *Tree, []*Tree: + complexValuesKeys = append(complexValuesKeys, k) + default: + simpleValuesKeys = append(simpleValuesKeys, k) + } + } + + sort.Strings(simpleValuesKeys) + sort.Strings(complexValuesKeys) + + for _, k := range simpleValuesKeys { + v, ok := t.values[k].(*tomlValue) + if !ok { + return bytesCount, fmt.Errorf("invalid value type at %s: %T", k, t.values[k]) + } + + repr, err := tomlValueStringRepresentation(v.value) + if err != nil { + return bytesCount, err + } + + writtenBytesCount, err := writeStrings(w, indent, k, " = ", repr, "\n") + bytesCount += int64(writtenBytesCount) + if err != nil { + return bytesCount, err + } + } + + for _, k := range complexValuesKeys { + v := t.values[k] + + combinedKey := k + if keyspace != "" { + combinedKey = keyspace + "." + combinedKey + } + + switch node := v.(type) { + // node has to be of those two types given how keys are sorted above + case *Tree: + writtenBytesCount, err := writeStrings(w, "\n", indent, "[", combinedKey, "]\n") + bytesCount += int64(writtenBytesCount) + if err != nil { + return bytesCount, err + } + bytesCount, err = node.writeTo(w, indent+" ", combinedKey, bytesCount) + if err != nil { + return bytesCount, err + } + case []*Tree: + for _, subTree := range node { + writtenBytesCount, err := writeStrings(w, "\n", indent, "[[", combinedKey, "]]\n") + bytesCount += int64(writtenBytesCount) + if err != nil { + return bytesCount, err + } + + bytesCount, err = subTree.writeTo(w, indent+" ", combinedKey, bytesCount) + if err != nil { + return bytesCount, err + } + } + } + } + + return bytesCount, nil +} + +func writeStrings(w io.Writer, s ...string) (int, error) { + var n int + for i := range s { + b, err := io.WriteString(w, s[i]) + n += b + if err != nil { + return n, err + } + } + return n, nil +} + +// WriteTo encode the Tree as Toml and writes it to the writer w. +// Returns the number of bytes written in case of success, or an error if anything happened. +func (t *Tree) WriteTo(w io.Writer) (int64, error) { + return t.writeTo(w, "", "", 0) +} + +// ToTomlString generates a human-readable representation of the current tree. +// Output spans multiple lines, and is suitable for ingest by a TOML parser. +// If the conversion cannot be performed, ToString returns a non-nil error. +func (t *Tree) ToTomlString() (string, error) { + var buf bytes.Buffer + _, err := t.WriteTo(&buf) + if err != nil { + return "", err + } + return buf.String(), nil +} + +// String generates a human-readable representation of the current tree. +// Alias of ToString. Present to implement the fmt.Stringer interface. +func (t *Tree) String() string { + result, _ := t.ToTomlString() + return result +} + +// ToMap recursively generates a representation of the tree using Go built-in structures. +// The following types are used: +// +// * bool +// * float64 +// * int64 +// * string +// * uint64 +// * time.Time +// * map[string]interface{} (where interface{} is any of this list) +// * []interface{} (where interface{} is any of this list) +func (t *Tree) ToMap() map[string]interface{} { + result := map[string]interface{}{} + + for k, v := range t.values { + switch node := v.(type) { + case []*Tree: + var array []interface{} + for _, item := range node { + array = append(array, item.ToMap()) + } + result[k] = array + case *Tree: + result[k] = node.ToMap() + case *tomlValue: + result[k] = node.value + } + } + return result +} diff --git a/vendor/github.com/pelletier/go-toml/tomltree_write_test.go b/vendor/github.com/pelletier/go-toml/tomltree_write_test.go new file mode 100644 index 0000000000..c2a1ce3b74 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/tomltree_write_test.go @@ -0,0 +1,358 @@ +package toml + +import ( + "bytes" + "errors" + "fmt" + "reflect" + "strings" + "testing" + "time" +) + +type failingWriter struct { + failAt int + written int + buffer bytes.Buffer +} + +func (f *failingWriter) Write(p []byte) (n int, err error) { + count := len(p) + toWrite := f.failAt - (count + f.written) + if toWrite < 0 { + toWrite = 0 + } + if toWrite > count { + f.written += count + f.buffer.Write(p) + return count, nil + } + + f.buffer.Write(p[:toWrite]) + f.written = f.failAt + return toWrite, fmt.Errorf("failingWriter failed after writting %d bytes", f.written) +} + +func assertErrorString(t *testing.T, expected string, err error) { + expectedErr := errors.New(expected) + if err == nil || err.Error() != expectedErr.Error() { + t.Errorf("expecting error %s, but got %s instead", expected, err) + } +} + +func TestTreeWriteToEmptyTable(t *testing.T) { + doc := `[[empty-tables]] +[[empty-tables]]` + + toml, err := Load(doc) + if err != nil { + t.Fatal("Unexpected Load error:", err) + } + tomlString, err := toml.ToTomlString() + if err != nil { + t.Fatal("Unexpected ToTomlString error:", err) + } + + expected := ` +[[empty-tables]] + +[[empty-tables]] +` + + if tomlString != expected { + t.Fatalf("Expected:\n%s\nGot:\n%s", expected, tomlString) + } +} + +func TestTreeWriteToTomlString(t *testing.T) { + toml, err := Load(`name = { first = "Tom", last = "Preston-Werner" } +points = { x = 1, y = 2 }`) + + if err != nil { + t.Fatal("Unexpected error:", err) + } + + tomlString, _ := toml.ToTomlString() + reparsedTree, err := Load(tomlString) + + assertTree(t, reparsedTree, err, map[string]interface{}{ + "name": map[string]interface{}{ + "first": "Tom", + "last": "Preston-Werner", + }, + "points": map[string]interface{}{ + "x": int64(1), + "y": int64(2), + }, + }) +} + +func TestTreeWriteToTomlStringSimple(t *testing.T) { + tree, err := Load("[foo]\n\n[[foo.bar]]\na = 42\n\n[[foo.bar]]\na = 69\n") + if err != nil { + t.Errorf("Test failed to parse: %v", err) + return + } + result, err := tree.ToTomlString() + if err != nil { + t.Errorf("Unexpected error: %s", err) + } + expected := "\n[foo]\n\n [[foo.bar]]\n a = 42\n\n [[foo.bar]]\n a = 69\n" + if result != expected { + t.Errorf("Expected got '%s', expected '%s'", result, expected) + } +} + +func TestTreeWriteToTomlStringKeysOrders(t *testing.T) { + for i := 0; i < 100; i++ { + tree, _ := Load(` + foobar = true + bar = "baz" + foo = 1 + [qux] + foo = 1 + bar = "baz2"`) + + stringRepr, _ := tree.ToTomlString() + + t.Log("Intermediate string representation:") + t.Log(stringRepr) + + r := strings.NewReader(stringRepr) + toml, err := LoadReader(r) + + if err != nil { + t.Fatal("Unexpected error:", err) + } + + assertTree(t, toml, err, map[string]interface{}{ + "foobar": true, + "bar": "baz", + "foo": 1, + "qux": map[string]interface{}{ + "foo": 1, + "bar": "baz2", + }, + }) + } +} + +func testMaps(t *testing.T, actual, expected map[string]interface{}) { + if !reflect.DeepEqual(actual, expected) { + t.Fatal("trees aren't equal.\n", "Expected:\n", expected, "\nActual:\n", actual) + } +} + +func TestTreeWriteToMapSimple(t *testing.T) { + tree, _ := Load("a = 42\nb = 17") + + expected := map[string]interface{}{ + "a": int64(42), + "b": int64(17), + } + + testMaps(t, tree.ToMap(), expected) +} + +func TestTreeWriteToInvalidTreeSimpleValue(t *testing.T) { + tree := Tree{values: map[string]interface{}{"foo": int8(1)}} + _, err := tree.ToTomlString() + assertErrorString(t, "invalid value type at foo: int8", err) +} + +func TestTreeWriteToInvalidTreeTomlValue(t *testing.T) { + tree := Tree{values: map[string]interface{}{"foo": &tomlValue{int8(1), Position{}}}} + _, err := tree.ToTomlString() + assertErrorString(t, "unsupported value type int8: 1", err) +} + +func TestTreeWriteToInvalidTreeTomlValueArray(t *testing.T) { + tree := Tree{values: map[string]interface{}{"foo": &tomlValue{[]interface{}{int8(1)}, Position{}}}} + _, err := tree.ToTomlString() + assertErrorString(t, "unsupported value type int8: 1", err) +} + +func TestTreeWriteToFailingWriterInSimpleValue(t *testing.T) { + toml, _ := Load(`a = 2`) + writer := failingWriter{failAt: 0, written: 0} + _, err := toml.WriteTo(&writer) + assertErrorString(t, "failingWriter failed after writting 0 bytes", err) +} + +func TestTreeWriteToFailingWriterInTable(t *testing.T) { + toml, _ := Load(` +[b] +a = 2`) + writer := failingWriter{failAt: 2, written: 0} + _, err := toml.WriteTo(&writer) + assertErrorString(t, "failingWriter failed after writting 2 bytes", err) + + writer = failingWriter{failAt: 13, written: 0} + _, err = toml.WriteTo(&writer) + assertErrorString(t, "failingWriter failed after writting 13 bytes", err) +} + +func TestTreeWriteToFailingWriterInArray(t *testing.T) { + toml, _ := Load(` +[[b]] +a = 2`) + writer := failingWriter{failAt: 2, written: 0} + _, err := toml.WriteTo(&writer) + assertErrorString(t, "failingWriter failed after writting 2 bytes", err) + + writer = failingWriter{failAt: 15, written: 0} + _, err = toml.WriteTo(&writer) + assertErrorString(t, "failingWriter failed after writting 15 bytes", err) +} + +func TestTreeWriteToMapExampleFile(t *testing.T) { + tree, _ := LoadFile("example.toml") + expected := map[string]interface{}{ + "title": "TOML Example", + "owner": map[string]interface{}{ + "name": "Tom Preston-Werner", + "organization": "GitHub", + "bio": "GitHub Cofounder & CEO\nLikes tater tots and beer.", + "dob": time.Date(1979, time.May, 27, 7, 32, 0, 0, time.UTC), + }, + "database": map[string]interface{}{ + "server": "192.168.1.1", + "ports": []interface{}{int64(8001), int64(8001), int64(8002)}, + "connection_max": int64(5000), + "enabled": true, + }, + "servers": map[string]interface{}{ + "alpha": map[string]interface{}{ + "ip": "10.0.0.1", + "dc": "eqdc10", + }, + "beta": map[string]interface{}{ + "ip": "10.0.0.2", + "dc": "eqdc10", + }, + }, + "clients": map[string]interface{}{ + "data": []interface{}{ + []interface{}{"gamma", "delta"}, + []interface{}{int64(1), int64(2)}, + }, + }, + } + testMaps(t, tree.ToMap(), expected) +} + +func TestTreeWriteToMapWithTablesInMultipleChunks(t *testing.T) { + tree, _ := Load(` + [[menu.main]] + a = "menu 1" + b = "menu 2" + [[menu.main]] + c = "menu 3" + d = "menu 4"`) + expected := map[string]interface{}{ + "menu": map[string]interface{}{ + "main": []interface{}{ + map[string]interface{}{"a": "menu 1", "b": "menu 2"}, + map[string]interface{}{"c": "menu 3", "d": "menu 4"}, + }, + }, + } + treeMap := tree.ToMap() + + testMaps(t, treeMap, expected) +} + +func TestTreeWriteToMapWithArrayOfInlineTables(t *testing.T) { + tree, _ := Load(` + [params] + language_tabs = [ + { key = "shell", name = "Shell" }, + { key = "ruby", name = "Ruby" }, + { key = "python", name = "Python" } + ]`) + + expected := map[string]interface{}{ + "params": map[string]interface{}{ + "language_tabs": []interface{}{ + map[string]interface{}{ + "key": "shell", + "name": "Shell", + }, + map[string]interface{}{ + "key": "ruby", + "name": "Ruby", + }, + map[string]interface{}{ + "key": "python", + "name": "Python", + }, + }, + }, + } + + treeMap := tree.ToMap() + testMaps(t, treeMap, expected) +} + +func TestTreeWriteToFloat(t *testing.T) { + tree, err := Load(`a = 3.0`) + if err != nil { + t.Fatal(err) + } + str, err := tree.ToTomlString() + if err != nil { + t.Fatal(err) + } + expected := `a = 3.0` + if strings.TrimSpace(str) != strings.TrimSpace(expected) { + t.Fatalf("Expected:\n%s\nGot:\n%s", expected, str) + } +} + +func BenchmarkTreeToTomlString(b *testing.B) { + toml, err := Load(sampleHard) + if err != nil { + b.Fatal("Unexpected error:", err) + } + + for i := 0; i < b.N; i++ { + _, err := toml.ToTomlString() + if err != nil { + b.Fatal(err) + } + } +} + +var sampleHard = `# Test file for TOML +# Only this one tries to emulate a TOML file written by a user of the kind of parser writers probably hate +# This part you'll really hate + +[the] +test_string = "You'll hate me after this - #" # " Annoying, isn't it? + + [the.hard] + test_array = [ "] ", " # "] # ] There you go, parse this! + test_array2 = [ "Test #11 ]proved that", "Experiment #9 was a success" ] + # You didn't think it'd as easy as chucking out the last #, did you? + another_test_string = " Same thing, but with a string #" + harder_test_string = " And when \"'s are in the string, along with # \"" # "and comments are there too" + # Things will get harder + + [the.hard."bit#"] + "what?" = "You don't think some user won't do that?" + multi_line_array = [ + "]", + # ] Oh yes I did + ] + +# Each of the following keygroups/key value pairs should produce an error. Uncomment to them to test + +#[error] if you didn't catch this, your parser is broken +#string = "Anything other than tabs, spaces and newline after a keygroup or key value pair has ended should produce an error unless it is a comment" like this +#array = [ +# "This might most likely happen in multiline arrays", +# Like here, +# "or here, +# and here" +# ] End of array comment, forgot the # +#number = 3.14 pi <--again forgot the # ` diff --git a/vendor/github.com/spf13/afero/LICENSE.txt b/vendor/github.com/spf13/afero/LICENSE.txt new file mode 100644 index 0000000000..298f0e2665 --- /dev/null +++ b/vendor/github.com/spf13/afero/LICENSE.txt @@ -0,0 +1,174 @@ + 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. diff --git a/vendor/github.com/spf13/afero/README.md b/vendor/github.com/spf13/afero/README.md new file mode 100644 index 0000000000..0c9b04b53f --- /dev/null +++ b/vendor/github.com/spf13/afero/README.md @@ -0,0 +1,452 @@ +![afero logo-sm](https://cloud.githubusercontent.com/assets/173412/11490338/d50e16dc-97a5-11e5-8b12-019a300d0fcb.png) + +A FileSystem Abstraction System for Go + +[![Build Status](https://travis-ci.org/spf13/afero.svg)](https://travis-ci.org/spf13/afero) [![Build status](https://ci.appveyor.com/api/projects/status/github/spf13/afero?branch=master&svg=true)](https://ci.appveyor.com/project/spf13/afero) [![GoDoc](https://godoc.org/github.com/spf13/afero?status.svg)](https://godoc.org/github.com/spf13/afero) [![Join the chat at https://gitter.im/spf13/afero](https://badges.gitter.im/Dev%20Chat.svg)](https://gitter.im/spf13/afero?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + +# Overview + +Afero is an filesystem framework providing a simple, uniform and universal API +interacting with any filesystem, as an abstraction layer providing interfaces, +types and methods. Afero has an exceptionally clean interface and simple design +without needless constructors or initialization methods. + +Afero is also a library providing a base set of interoperable backend +filesystems that make it easy to work with afero while retaining all the power +and benefit of the os and ioutil packages. + +Afero provides significant improvements over using the os package alone, most +notably the ability to create mock and testing filesystems without relying on the disk. + +It is suitable for use in a any situation where you would consider using the OS +package as it provides an additional abstraction that makes it easy to use a +memory backed file system during testing. It also adds support for the http +filesystem for full interoperability. + + +## Afero Features + +* A single consistent API for accessing a variety of filesystems +* Interoperation between a variety of file system types +* A set of interfaces to encourage and enforce interoperability between backends +* An atomic cross platform memory backed file system +* Support for compositional (union) file systems by combining multiple file systems acting as one +* Specialized backends which modify existing filesystems (Read Only, Regexp filtered) +* A set of utility functions ported from io, ioutil & hugo to be afero aware + + +# Using Afero + +Afero is easy to use and easier to adopt. + +A few different ways you could use Afero: + +* Use the interfaces alone to define you own file system. +* Wrap for the OS packages. +* Define different filesystems for different parts of your application. +* Use Afero for mock filesystems while testing + +## Step 1: Install Afero + +First use go get to install the latest version of the library. + + $ go get github.com/spf13/afero + +Next include Afero in your application. +```go +import "github.com/spf13/afero" +``` + +## Step 2: Declare a backend + +First define a package variable and set it to a pointer to a filesystem. +```go +var AppFs = afero.NewMemMapFs() + +or + +var AppFs = afero.NewOsFs() +``` +It is important to note that if you repeat the composite literal you +will be using a completely new and isolated filesystem. In the case of +OsFs it will still use the same underlying filesystem but will reduce +the ability to drop in other filesystems as desired. + +## Step 3: Use it like you would the OS package + +Throughout your application use any function and method like you normally +would. + +So if my application before had: +```go +os.Open('/tmp/foo') +``` +We would replace it with: +```go +AppFs.Open('/tmp/foo') +``` + +`AppFs` being the variable we defined above. + + +## List of all available functions + +File System Methods Available: +```go +Chmod(name string, mode os.FileMode) : error +Chtimes(name string, atime time.Time, mtime time.Time) : error +Create(name string) : File, error +Mkdir(name string, perm os.FileMode) : error +MkdirAll(path string, perm os.FileMode) : error +Name() : string +Open(name string) : File, error +OpenFile(name string, flag int, perm os.FileMode) : File, error +Remove(name string) : error +RemoveAll(path string) : error +Rename(oldname, newname string) : error +Stat(name string) : os.FileInfo, error +``` +File Interfaces and Methods Available: +```go +io.Closer +io.Reader +io.ReaderAt +io.Seeker +io.Writer +io.WriterAt + +Name() : string +Readdir(count int) : []os.FileInfo, error +Readdirnames(n int) : []string, error +Stat() : os.FileInfo, error +Sync() : error +Truncate(size int64) : error +WriteString(s string) : ret int, err error +``` +In some applications it may make sense to define a new package that +simply exports the file system variable for easy access from anywhere. + +## Using Afero's utility functions + +Afero provides a set of functions to make it easier to use the underlying file systems. +These functions have been primarily ported from io & ioutil with some developed for Hugo. + +The afero utilities support all afero compatible backends. + +The list of utilities includes: + +```go +DirExists(path string) (bool, error) +Exists(path string) (bool, error) +FileContainsBytes(filename string, subslice []byte) (bool, error) +GetTempDir(subPath string) string +IsDir(path string) (bool, error) +IsEmpty(path string) (bool, error) +ReadDir(dirname string) ([]os.FileInfo, error) +ReadFile(filename string) ([]byte, error) +SafeWriteReader(path string, r io.Reader) (err error) +TempDir(dir, prefix string) (name string, err error) +TempFile(dir, prefix string) (f File, err error) +Walk(root string, walkFn filepath.WalkFunc) error +WriteFile(filename string, data []byte, perm os.FileMode) error +WriteReader(path string, r io.Reader) (err error) +``` +For a complete list see [Afero's GoDoc](https://godoc.org/github.com/spf13/afero) + +They are available under two different approaches to use. You can either call +them directly where the first parameter of each function will be the file +system, or you can declare a new `Afero`, a custom type used to bind these +functions as methods to a given filesystem. + +### Calling utilities directly + +```go +fs := new(afero.MemMapFs) +f, err := afero.TempFile(fs,"", "ioutil-test") + +``` + +### Calling via Afero + +```go +fs := afero.NewMemMapFs() +afs := &afero.Afero{Fs: fs} +f, err := afs.TempFile("", "ioutil-test") +``` + +## Using Afero for Testing + +There is a large benefit to using a mock filesystem for testing. It has a +completely blank state every time it is initialized and can be easily +reproducible regardless of OS. You could create files to your heart’s content +and the file access would be fast while also saving you from all the annoying +issues with deleting temporary files, Windows file locking, etc. The MemMapFs +backend is perfect for testing. + +* Much faster than performing I/O operations on disk +* Avoid security issues and permissions +* Far more control. 'rm -rf /' with confidence +* Test setup is far more easier to do +* No test cleanup needed + +One way to accomplish this is to define a variable as mentioned above. +In your application this will be set to afero.NewOsFs() during testing you +can set it to afero.NewMemMapFs(). + +It wouldn't be uncommon to have each test initialize a blank slate memory +backend. To do this I would define my `appFS = afero.NewOsFs()` somewhere +appropriate in my application code. This approach ensures that Tests are order +independent, with no test relying on the state left by an earlier test. + +Then in my tests I would initialize a new MemMapFs for each test: +```go +func TestExist(t *testing.T) { + appFS := afero.NewMemMapFs() + // create test files and directories + appFS.MkdirAll("src/a", 0755) + afero.WriteFile(appFS, "src/a/b", []byte("file b"), 0644) + afero.WriteFile(appFS, "src/c", []byte("file c"), 0644) + name := "src/c" + _, err := appFS.Stat(name) + if os.IsNotExist(err) { + t.Errorf("file \"%s\" does not exist.\n", name) + } +} +``` + +# Available Backends + +## Operating System Native + +### OsFs + +The first is simply a wrapper around the native OS calls. This makes it +very easy to use as all of the calls are the same as the existing OS +calls. It also makes it trivial to have your code use the OS during +operation and a mock filesystem during testing or as needed. + +```go +appfs := afero.NewOsFs() +appfs.MkdirAll("src/a", 0755)) +``` + +## Memory Backed Storage + +### MemMapFs + +Afero also provides a fully atomic memory backed filesystem perfect for use in +mocking and to speed up unnecessary disk io when persistence isn’t +necessary. It is fully concurrent and will work within go routines +safely. + +```go +mm := afero.NewMemMapFs() +mm.MkdirAll("src/a", 0755)) +``` + +#### InMemoryFile + +As part of MemMapFs, Afero also provides an atomic, fully concurrent memory +backed file implementation. This can be used in other memory backed file +systems with ease. Plans are to add a radix tree memory stored file +system using InMemoryFile. + +## Network Interfaces + +### SftpFs + +Afero has experimental support for secure file transfer protocol (sftp). Which can +be used to perform file operations over a encrypted channel. + +## Filtering Backends + +### BasePathFs + +The BasePathFs restricts all operations to a given path within an Fs. +The given file name to the operations on this Fs will be prepended with +the base path before calling the source Fs. + +```go +bp := afero.NewBasePathFs(afero.NewOsFs(), "/base/path") +``` + +### ReadOnlyFs + +A thin wrapper around the source Fs providing a read only view. + +```go +fs := afero.NewReadOnlyFs(afero.NewOsFs()) +_, err := fs.Create("/file.txt") +// err = syscall.EPERM +``` + +# RegexpFs + +A filtered view on file names, any file NOT matching +the passed regexp will be treated as non-existing. +Files not matching the regexp provided will not be created. +Directories are not filtered. + +```go +fs := afero.NewRegexpFs(afero.NewMemMapFs(), regexp.MustCompile(`\.txt$`)) +_, err := fs.Create("/file.html") +// err = syscall.ENOENT +``` + +### HttpFs + +Afero provides an http compatible backend which can wrap any of the existing +backends. + +The Http package requires a slightly specific version of Open which +returns an http.File type. + +Afero provides an httpFs file system which satisfies this requirement. +Any Afero FileSystem can be used as an httpFs. + +```go +httpFs := afero.NewHttpFs() +fileserver := http.FileServer(httpFs.Dir())) +http.Handle("/", fileserver) +``` + +## Composite Backends + +Afero provides the ability have two filesystems (or more) act as a single +file system. + +### CacheOnReadFs + +The CacheOnReadFs will lazily make copies of any accessed files from the base +layer into the overlay. Subsequent reads will be pulled from the overlay +directly permitting the request is within the cache duration of when it was +created in the overlay. + +If the base filesystem is writeable, any changes to files will be +done first to the base, then to the overlay layer. Write calls to open file +handles like `Write()` or `Truncate()` to the overlay first. + +To writing files to the overlay only, you can use the overlay Fs directly (not +via the union Fs). + +Cache files in the layer for the given time.Duration, a cache duration of 0 +means "forever" meaning the file will not be re-requested from the base ever. + +A read-only base will make the overlay also read-only but still copy files +from the base to the overlay when they're not present (or outdated) in the +caching layer. + +```go +base := afero.NewOsFs() +layer := afero.NewMemMapFs() +ufs := afero.NewCacheOnReadFs(base, layer, 100 * time.Second) +``` + +### CopyOnWriteFs() + +The CopyOnWriteFs is a read only base file system with a potentially +writeable layer on top. + +Read operations will first look in the overlay and if not found there, will +serve the file from the base. + +Changes to the file system will only be made in the overlay. + +Any attempt to modify a file found only in the base will copy the file to the +overlay layer before modification (including opening a file with a writable +handle). + +Removing and Renaming files present only in the base layer is not currently +permitted. If a file is present in the base layer and the overlay, only the +overlay will be removed/renamed. + +```go + base := afero.NewOsFs() + roBase := afero.NewReadOnlyFs(base) + ufs := afero.NewCopyOnWriteFs(roBase, afero.NewMemMapFs()) + + fh, _ = ufs.Create("/home/test/file2.txt") + fh.WriteString("This is a test") + fh.Close() +``` + +In this example all write operations will only occur in memory (MemMapFs) +leaving the base filesystem (OsFs) untouched. + + +## Desired/possible backends + +The following is a short list of possible backends we hope someone will +implement: + +* SSH +* ZIP +* TAR +* S3 + +# About the project + +## What's in the name + +Afero comes from the latin roots Ad-Facere. + +**"Ad"** is a prefix meaning "to". + +**"Facere"** is a form of the root "faciō" making "make or do". + +The literal meaning of afero is "to make" or "to do" which seems very fitting +for a library that allows one to make files and directories and do things with them. + +The English word that shares the same roots as Afero is "affair". Affair shares +the same concept but as a noun it means "something that is made or done" or "an +object of a particular type". + +It's also nice that unlike some of my other libraries (hugo, cobra, viper) it +Googles very well. + +## Release Notes + +* **0.10.0** 2015.12.10 + * Full compatibility with Windows + * Introduction of afero utilities + * Test suite rewritten to work cross platform + * Normalize paths for MemMapFs + * Adding Sync to the file interface + * **Breaking Change** Walk and ReadDir have changed parameter order + * Moving types used by MemMapFs to a subpackage + * General bugfixes and improvements +* **0.9.0** 2015.11.05 + * New Walk function similar to filepath.Walk + * MemMapFs.OpenFile handles O_CREATE, O_APPEND, O_TRUNC + * MemMapFs.Remove now really deletes the file + * InMemoryFile.Readdir and Readdirnames work correctly + * InMemoryFile functions lock it for concurrent access + * Test suite improvements +* **0.8.0** 2014.10.28 + * First public version + * Interfaces feel ready for people to build using + * Interfaces satisfy all known uses + * MemMapFs passes the majority of the OS test suite + * OsFs passes the majority of the OS test suite + +## Contributing + +1. Fork it +2. Create your feature branch (`git checkout -b my-new-feature`) +3. Commit your changes (`git commit -am 'Add some feature'`) +4. Push to the branch (`git push origin my-new-feature`) +5. Create new Pull Request + +## Contributors + +Names in no particular order: + +* [spf13](https://github.com/spf13) +* [jaqx0r](https://github.com/jaqx0r) +* [mbertschler](https://github.com/mbertschler) +* [xor-gate](https://github.com/xor-gate) + +## License + +Afero is released under the Apache 2.0 license. See +[LICENSE.txt](https://github.com/spf13/afero/blob/master/LICENSE.txt) diff --git a/vendor/github.com/spf13/afero/afero.go b/vendor/github.com/spf13/afero/afero.go new file mode 100644 index 0000000000..f5b5e127cd --- /dev/null +++ b/vendor/github.com/spf13/afero/afero.go @@ -0,0 +1,108 @@ +// Copyright © 2014 Steve Francia . +// Copyright 2013 tsuru authors. All rights reserved. +// +// 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 afero provides types and methods for interacting with the filesystem, +// as an abstraction layer. + +// Afero also provides a few implementations that are mostly interoperable. One that +// uses the operating system filesystem, one that uses memory to store files +// (cross platform) and an interface that should be implemented if you want to +// provide your own filesystem. + +package afero + +import ( + "errors" + "io" + "os" + "time" +) + +type Afero struct { + Fs +} + +// File represents a file in the filesystem. +type File interface { + io.Closer + io.Reader + io.ReaderAt + io.Seeker + io.Writer + io.WriterAt + + Name() string + Readdir(count int) ([]os.FileInfo, error) + Readdirnames(n int) ([]string, error) + Stat() (os.FileInfo, error) + Sync() error + Truncate(size int64) error + WriteString(s string) (ret int, err error) +} + +// Fs is the filesystem interface. +// +// Any simulated or real filesystem should implement this interface. +type Fs interface { + // Create creates a file in the filesystem, returning the file and an + // error, if any happens. + Create(name string) (File, error) + + // Mkdir creates a directory in the filesystem, return an error if any + // happens. + Mkdir(name string, perm os.FileMode) error + + // MkdirAll creates a directory path and all parents that does not exist + // yet. + MkdirAll(path string, perm os.FileMode) error + + // Open opens a file, returning it or an error, if any happens. + Open(name string) (File, error) + + // OpenFile opens a file using the given flags and the given mode. + OpenFile(name string, flag int, perm os.FileMode) (File, error) + + // Remove removes a file identified by name, returning an error, if any + // happens. + Remove(name string) error + + // RemoveAll removes a directory path and any children it contains. It + // does not fail if the path does not exist (return nil). + RemoveAll(path string) error + + // Rename renames a file. + Rename(oldname, newname string) error + + // Stat returns a FileInfo describing the named file, or an error, if any + // happens. + Stat(name string) (os.FileInfo, error) + + // The name of this FileSystem + Name() string + + //Chmod changes the mode of the named file to mode. + Chmod(name string, mode os.FileMode) error + + //Chtimes changes the access and modification times of the named file + Chtimes(name string, atime time.Time, mtime time.Time) error +} + +var ( + ErrFileClosed = errors.New("File is closed") + ErrOutOfRange = errors.New("Out of range") + ErrTooLarge = errors.New("Too large") + ErrFileNotFound = os.ErrNotExist + ErrFileExists = os.ErrExist + ErrDestinationExists = os.ErrExist +) diff --git a/vendor/github.com/spf13/afero/afero_test.go b/vendor/github.com/spf13/afero/afero_test.go new file mode 100644 index 0000000000..526afa9758 --- /dev/null +++ b/vendor/github.com/spf13/afero/afero_test.go @@ -0,0 +1,699 @@ +// Copyright © 2014 Steve Francia . +// Copyright 2009 The Go Authors. All rights reserved. +// +// 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 afero + +import ( + "bytes" + "fmt" + "io" + "io/ioutil" + "os" + "path/filepath" + "runtime" + "strings" + "syscall" + "testing" +) + +var testName = "test.txt" +var Fss = []Fs{&MemMapFs{}, &OsFs{}} + +var testRegistry map[Fs][]string = make(map[Fs][]string) + +func testDir(fs Fs) string { + name, err := TempDir(fs, "", "afero") + if err != nil { + panic(fmt.Sprint("unable to work with test dir", err)) + } + testRegistry[fs] = append(testRegistry[fs], name) + + return name +} + +func tmpFile(fs Fs) File { + x, err := TempFile(fs, "", "afero") + + if err != nil { + panic(fmt.Sprint("unable to work with temp file", err)) + } + + testRegistry[fs] = append(testRegistry[fs], x.Name()) + + return x +} + +//Read with length 0 should not return EOF. +func TestRead0(t *testing.T) { + for _, fs := range Fss { + f := tmpFile(fs) + defer f.Close() + f.WriteString("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.") + + var b []byte + // b := make([]byte, 0) + n, err := f.Read(b) + if n != 0 || err != nil { + t.Errorf("%v: Read(0) = %d, %v, want 0, nil", fs.Name(), n, err) + } + f.Seek(0, 0) + b = make([]byte, 100) + n, err = f.Read(b) + if n <= 0 || err != nil { + t.Errorf("%v: Read(100) = %d, %v, want >0, nil", fs.Name(), n, err) + } + } +} + +func TestOpenFile(t *testing.T) { + defer removeAllTestFiles(t) + for _, fs := range Fss { + tmp := testDir(fs) + path := filepath.Join(tmp, testName) + + f, err := fs.OpenFile(path, os.O_RDWR|os.O_CREATE, 0600) + if err != nil { + t.Error(fs.Name(), "OpenFile (O_CREATE) failed:", err) + continue + } + io.WriteString(f, "initial") + f.Close() + + f, err = fs.OpenFile(path, os.O_WRONLY|os.O_APPEND, 0600) + if err != nil { + t.Error(fs.Name(), "OpenFile (O_APPEND) failed:", err) + continue + } + io.WriteString(f, "|append") + f.Close() + + f, err = fs.OpenFile(path, os.O_RDONLY, 0600) + contents, _ := ioutil.ReadAll(f) + expectedContents := "initial|append" + if string(contents) != expectedContents { + t.Errorf("%v: appending, expected '%v', got: '%v'", fs.Name(), expectedContents, string(contents)) + } + f.Close() + + f, err = fs.OpenFile(path, os.O_RDWR|os.O_TRUNC, 0600) + if err != nil { + t.Error(fs.Name(), "OpenFile (O_TRUNC) failed:", err) + continue + } + contents, _ = ioutil.ReadAll(f) + if string(contents) != "" { + t.Errorf("%v: expected truncated file, got: '%v'", fs.Name(), string(contents)) + } + f.Close() + } +} + +func TestCreate(t *testing.T) { + defer removeAllTestFiles(t) + for _, fs := range Fss { + tmp := testDir(fs) + path := filepath.Join(tmp, testName) + + f, err := fs.Create(path) + if err != nil { + t.Error(fs.Name(), "Create failed:", err) + f.Close() + continue + } + io.WriteString(f, "initial") + f.Close() + + f, err = fs.Create(path) + if err != nil { + t.Error(fs.Name(), "Create failed:", err) + f.Close() + continue + } + secondContent := "second create" + io.WriteString(f, secondContent) + f.Close() + + f, err = fs.Open(path) + if err != nil { + t.Error(fs.Name(), "Open failed:", err) + f.Close() + continue + } + buf, err := ReadAll(f) + if err != nil { + t.Error(fs.Name(), "ReadAll failed:", err) + f.Close() + continue + } + if string(buf) != secondContent { + t.Error(fs.Name(), "Content should be", "\""+secondContent+"\" but is \""+string(buf)+"\"") + f.Close() + continue + } + f.Close() + } +} + +func TestMemFileRead(t *testing.T) { + f := tmpFile(new(MemMapFs)) + // f := MemFileCreate("testfile") + f.WriteString("abcd") + f.Seek(0, 0) + b := make([]byte, 8) + n, err := f.Read(b) + if n != 4 { + t.Errorf("didn't read all bytes: %v %v %v", n, err, b) + } + if err != nil { + t.Errorf("err is not nil: %v %v %v", n, err, b) + } + n, err = f.Read(b) + if n != 0 { + t.Errorf("read more bytes: %v %v %v", n, err, b) + } + if err != io.EOF { + t.Errorf("error is not EOF: %v %v %v", n, err, b) + } +} + +func TestRename(t *testing.T) { + defer removeAllTestFiles(t) + for _, fs := range Fss { + tDir := testDir(fs) + from := filepath.Join(tDir, "/renamefrom") + to := filepath.Join(tDir, "/renameto") + exists := filepath.Join(tDir, "/renameexists") + file, err := fs.Create(from) + if err != nil { + t.Fatalf("%s: open %q failed: %v", fs.Name(), to, err) + } + if err = file.Close(); err != nil { + t.Errorf("%s: close %q failed: %v", fs.Name(), to, err) + } + file, err = fs.Create(exists) + if err != nil { + t.Fatalf("%s: open %q failed: %v", fs.Name(), to, err) + } + if err = file.Close(); err != nil { + t.Errorf("%s: close %q failed: %v", fs.Name(), to, err) + } + err = fs.Rename(from, to) + if err != nil { + t.Fatalf("%s: rename %q, %q failed: %v", fs.Name(), to, from, err) + } + file, err = fs.Create(from) + if err != nil { + t.Fatalf("%s: open %q failed: %v", fs.Name(), to, err) + } + if err = file.Close(); err != nil { + t.Errorf("%s: close %q failed: %v", fs.Name(), to, err) + } + err = fs.Rename(from, exists) + if err != nil { + t.Errorf("%s: rename %q, %q failed: %v", fs.Name(), exists, from, err) + } + names, err := readDirNames(fs, tDir) + if err != nil { + t.Errorf("%s: readDirNames error: %v", fs.Name(), err) + } + found := false + for _, e := range names { + if e == "renamefrom" { + t.Error("File is still called renamefrom") + } + if e == "renameto" { + found = true + } + } + if !found { + t.Error("File was not renamed to renameto") + } + + _, err = fs.Stat(to) + if err != nil { + t.Errorf("%s: stat %q failed: %v", fs.Name(), to, err) + } + } +} + +func TestRemove(t *testing.T) { + for _, fs := range Fss { + + x, err := TempFile(fs, "", "afero") + if err != nil { + t.Error(fmt.Sprint("unable to work with temp file", err)) + } + + path := x.Name() + x.Close() + + tDir := filepath.Dir(path) + + err = fs.Remove(path) + if err != nil { + t.Errorf("%v: Remove() failed: %v", fs.Name(), err) + continue + } + + _, err = fs.Stat(path) + if !os.IsNotExist(err) { + t.Errorf("%v: Remove() didn't remove file", fs.Name()) + continue + } + + // Deleting non-existent file should raise error + err = fs.Remove(path) + if !os.IsNotExist(err) { + t.Errorf("%v: Remove() didn't raise error for non-existent file", fs.Name()) + } + + f, err := fs.Open(tDir) + if err != nil { + t.Error("TestDir should still exist:", err) + } + + names, err := f.Readdirnames(-1) + if err != nil { + t.Error("Readdirnames failed:", err) + } + + for _, e := range names { + if e == testName { + t.Error("File was not removed from parent directory") + } + } + } +} + +func TestTruncate(t *testing.T) { + defer removeAllTestFiles(t) + for _, fs := range Fss { + f := tmpFile(fs) + defer f.Close() + + checkSize(t, f, 0) + f.Write([]byte("hello, world\n")) + checkSize(t, f, 13) + f.Truncate(10) + checkSize(t, f, 10) + f.Truncate(1024) + checkSize(t, f, 1024) + f.Truncate(0) + checkSize(t, f, 0) + _, err := f.Write([]byte("surprise!")) + if err == nil { + checkSize(t, f, 13+9) // wrote at offset past where hello, world was. + } + } +} + +func TestSeek(t *testing.T) { + defer removeAllTestFiles(t) + for _, fs := range Fss { + f := tmpFile(fs) + defer f.Close() + + const data = "hello, world\n" + io.WriteString(f, data) + + type test struct { + in int64 + whence int + out int64 + } + var tests = []test{ + {0, 1, int64(len(data))}, + {0, 0, 0}, + {5, 0, 5}, + {0, 2, int64(len(data))}, + {0, 0, 0}, + {-1, 2, int64(len(data)) - 1}, + {1 << 33, 0, 1 << 33}, + {1 << 33, 2, 1<<33 + int64(len(data))}, + } + for i, tt := range tests { + off, err := f.Seek(tt.in, tt.whence) + if off != tt.out || err != nil { + if e, ok := err.(*os.PathError); ok && e.Err == syscall.EINVAL && tt.out > 1<<32 { + // Reiserfs rejects the big seeks. + // http://code.google.com/p/go/issues/detail?id=91 + break + } + t.Errorf("#%d: Seek(%v, %v) = %v, %v want %v, nil", i, tt.in, tt.whence, off, err, tt.out) + } + } + } +} + +func TestReadAt(t *testing.T) { + defer removeAllTestFiles(t) + for _, fs := range Fss { + f := tmpFile(fs) + defer f.Close() + + const data = "hello, world\n" + io.WriteString(f, data) + + b := make([]byte, 5) + n, err := f.ReadAt(b, 7) + if err != nil || n != len(b) { + t.Fatalf("ReadAt 7: %d, %v", n, err) + } + if string(b) != "world" { + t.Fatalf("ReadAt 7: have %q want %q", string(b), "world") + } + } +} + +func TestWriteAt(t *testing.T) { + defer removeAllTestFiles(t) + for _, fs := range Fss { + f := tmpFile(fs) + defer f.Close() + + const data = "hello, world\n" + io.WriteString(f, data) + + n, err := f.WriteAt([]byte("WORLD"), 7) + if err != nil || n != 5 { + t.Fatalf("WriteAt 7: %d, %v", n, err) + } + + f2, err := fs.Open(f.Name()) + if err != nil { + t.Fatalf("%v: ReadFile %s: %v", fs.Name(), f.Name(), err) + } + defer f2.Close() + buf := new(bytes.Buffer) + buf.ReadFrom(f2) + b := buf.Bytes() + if string(b) != "hello, WORLD\n" { + t.Fatalf("after write: have %q want %q", string(b), "hello, WORLD\n") + } + + } +} + +func setupTestDir(t *testing.T, fs Fs) string { + path := testDir(fs) + return setupTestFiles(t, fs, path) +} + +func setupTestDirRoot(t *testing.T, fs Fs) string { + path := testDir(fs) + setupTestFiles(t, fs, path) + return path +} + +func setupTestDirReusePath(t *testing.T, fs Fs, path string) string { + testRegistry[fs] = append(testRegistry[fs], path) + return setupTestFiles(t, fs, path) +} + +func setupTestFiles(t *testing.T, fs Fs, path string) string { + testSubDir := filepath.Join(path, "more", "subdirectories", "for", "testing", "we") + err := fs.MkdirAll(testSubDir, 0700) + if err != nil && !os.IsExist(err) { + t.Fatal(err) + } + + f, err := fs.Create(filepath.Join(testSubDir, "testfile1")) + if err != nil { + t.Fatal(err) + } + f.WriteString("Testfile 1 content") + f.Close() + + f, err = fs.Create(filepath.Join(testSubDir, "testfile2")) + if err != nil { + t.Fatal(err) + } + f.WriteString("Testfile 2 content") + f.Close() + + f, err = fs.Create(filepath.Join(testSubDir, "testfile3")) + if err != nil { + t.Fatal(err) + } + f.WriteString("Testfile 3 content") + f.Close() + + f, err = fs.Create(filepath.Join(testSubDir, "testfile4")) + if err != nil { + t.Fatal(err) + } + f.WriteString("Testfile 4 content") + f.Close() + return testSubDir +} + +func TestReaddirnames(t *testing.T) { + defer removeAllTestFiles(t) + for _, fs := range Fss { + testSubDir := setupTestDir(t, fs) + tDir := filepath.Dir(testSubDir) + + root, err := fs.Open(tDir) + if err != nil { + t.Fatal(fs.Name(), tDir, err) + } + defer root.Close() + + namesRoot, err := root.Readdirnames(-1) + if err != nil { + t.Fatal(fs.Name(), namesRoot, err) + } + + sub, err := fs.Open(testSubDir) + if err != nil { + t.Fatal(err) + } + defer sub.Close() + + namesSub, err := sub.Readdirnames(-1) + if err != nil { + t.Fatal(fs.Name(), namesSub, err) + } + + findNames(fs, t, tDir, testSubDir, namesRoot, namesSub) + } +} + +func TestReaddirSimple(t *testing.T) { + defer removeAllTestFiles(t) + for _, fs := range Fss { + testSubDir := setupTestDir(t, fs) + tDir := filepath.Dir(testSubDir) + + root, err := fs.Open(tDir) + if err != nil { + t.Fatal(err) + } + defer root.Close() + + rootInfo, err := root.Readdir(1) + if err != nil { + t.Log(myFileInfo(rootInfo)) + t.Error(err) + } + + rootInfo, err = root.Readdir(5) + if err != io.EOF { + t.Log(myFileInfo(rootInfo)) + t.Error(err) + } + + sub, err := fs.Open(testSubDir) + if err != nil { + t.Fatal(err) + } + defer sub.Close() + + subInfo, err := sub.Readdir(5) + if err != nil { + t.Log(myFileInfo(subInfo)) + t.Error(err) + } + } +} + +func TestReaddir(t *testing.T) { + defer removeAllTestFiles(t) + for num := 0; num < 6; num++ { + outputs := make([]string, len(Fss)) + infos := make([]string, len(Fss)) + for i, fs := range Fss { + testSubDir := setupTestDir(t, fs) + //tDir := filepath.Dir(testSubDir) + root, err := fs.Open(testSubDir) + if err != nil { + t.Fatal(err) + } + defer root.Close() + + for j := 0; j < 6; j++ { + info, err := root.Readdir(num) + outputs[i] += fmt.Sprintf("%v Error: %v\n", myFileInfo(info), err) + infos[i] += fmt.Sprintln(len(info), err) + } + } + + fail := false + for i, o := range infos { + if i == 0 { + continue + } + if o != infos[i-1] { + fail = true + break + } + } + if fail { + t.Log("Readdir outputs not equal for Readdir(", num, ")") + for i, o := range outputs { + t.Log(Fss[i].Name()) + t.Log(o) + } + t.Fail() + } + } +} + +type myFileInfo []os.FileInfo + +func (m myFileInfo) String() string { + out := "Fileinfos:\n" + for _, e := range m { + out += " " + e.Name() + "\n" + } + return out +} + +func TestReaddirAll(t *testing.T) { + defer removeAllTestFiles(t) + for _, fs := range Fss { + testSubDir := setupTestDir(t, fs) + tDir := filepath.Dir(testSubDir) + + root, err := fs.Open(tDir) + if err != nil { + t.Fatal(err) + } + defer root.Close() + + rootInfo, err := root.Readdir(-1) + if err != nil { + t.Fatal(err) + } + var namesRoot = []string{} + for _, e := range rootInfo { + namesRoot = append(namesRoot, e.Name()) + } + + sub, err := fs.Open(testSubDir) + if err != nil { + t.Fatal(err) + } + defer sub.Close() + + subInfo, err := sub.Readdir(-1) + if err != nil { + t.Fatal(err) + } + var namesSub = []string{} + for _, e := range subInfo { + namesSub = append(namesSub, e.Name()) + } + + findNames(fs, t, tDir, testSubDir, namesRoot, namesSub) + } +} + +func findNames(fs Fs, t *testing.T, tDir, testSubDir string, root, sub []string) { + var foundRoot bool + for _, e := range root { + f, err := fs.Open(filepath.Join(tDir, e)) + if err != nil { + t.Error("Open", filepath.Join(tDir, e), ":", err) + } + defer f.Close() + + if equal(e, "we") { + foundRoot = true + } + } + if !foundRoot { + t.Logf("Names root: %v", root) + t.Logf("Names sub: %v", sub) + t.Error("Didn't find subdirectory we") + } + + var found1, found2 bool + for _, e := range sub { + f, err := fs.Open(filepath.Join(testSubDir, e)) + if err != nil { + t.Error("Open", filepath.Join(testSubDir, e), ":", err) + } + defer f.Close() + + if equal(e, "testfile1") { + found1 = true + } + if equal(e, "testfile2") { + found2 = true + } + } + + if !found1 { + t.Logf("Names root: %v", root) + t.Logf("Names sub: %v", sub) + t.Error("Didn't find testfile1") + } + if !found2 { + t.Logf("Names root: %v", root) + t.Logf("Names sub: %v", sub) + t.Error("Didn't find testfile2") + } +} + +func removeAllTestFiles(t *testing.T) { + for fs, list := range testRegistry { + for _, path := range list { + if err := fs.RemoveAll(path); err != nil { + t.Error(fs.Name(), err) + } + } + } + testRegistry = make(map[Fs][]string) +} + +func equal(name1, name2 string) (r bool) { + switch runtime.GOOS { + case "windows": + r = strings.ToLower(name1) == strings.ToLower(name2) + default: + r = name1 == name2 + } + return +} + +func checkSize(t *testing.T, f File, size int64) { + dir, err := f.Stat() + if err != nil { + t.Fatalf("Stat %q (looking for size %d): %s", f.Name(), size, err) + } + if dir.Size() != size { + t.Errorf("Stat %q: size %d want %d", f.Name(), dir.Size(), size) + } +} diff --git a/vendor/github.com/spf13/afero/appveyor.yml b/vendor/github.com/spf13/afero/appveyor.yml new file mode 100644 index 0000000000..a633ad500c --- /dev/null +++ b/vendor/github.com/spf13/afero/appveyor.yml @@ -0,0 +1,15 @@ +version: '{build}' +clone_folder: C:\gopath\src\github.com\spf13\afero +environment: + GOPATH: C:\gopath +build_script: +- cmd: >- + go version + + go env + + go get -v github.com/spf13/afero/... + + go build github.com/spf13/afero +test_script: +- cmd: go test -race -v github.com/spf13/afero/... diff --git a/vendor/github.com/spf13/afero/basepath.go b/vendor/github.com/spf13/afero/basepath.go new file mode 100644 index 0000000000..5e4fc2ec05 --- /dev/null +++ b/vendor/github.com/spf13/afero/basepath.go @@ -0,0 +1,145 @@ +package afero + +import ( + "errors" + "os" + "path/filepath" + "runtime" + "strings" + "time" +) + +// The BasePathFs restricts all operations to a given path within an Fs. +// The given file name to the operations on this Fs will be prepended with +// the base path before calling the base Fs. +// Any file name (after filepath.Clean()) outside this base path will be +// treated as non existing file. +// +// Note that it does not clean the error messages on return, so you may +// reveal the real path on errors. +type BasePathFs struct { + source Fs + path string +} + +func NewBasePathFs(source Fs, path string) Fs { + return &BasePathFs{source: source, path: path} +} + +// on a file outside the base path it returns the given file name and an error, +// else the given file with the base path prepended +func (b *BasePathFs) RealPath(name string) (path string, err error) { + if err := validateBasePathName(name); err != nil { + return "", err + } + + bpath := filepath.Clean(b.path) + path = filepath.Clean(filepath.Join(bpath, name)) + if !strings.HasPrefix(path, bpath) { + return name, os.ErrNotExist + } + + return path, nil +} + +func validateBasePathName(name string) error { + if runtime.GOOS != "windows" { + // Not much to do here; + // the virtual file paths all look absolute on *nix. + return nil + } + + // On Windows a common mistake would be to provide an absolute OS path + // We could strip out the base part, but that would not be very portable. + if filepath.IsAbs(name) { + return &os.PathError{Op: "realPath", Path: name, Err: errors.New("got a real OS path instead of a virtual")} + } + + return nil +} + +func (b *BasePathFs) Chtimes(name string, atime, mtime time.Time) (err error) { + if name, err = b.RealPath(name); err != nil { + return &os.PathError{Op: "chtimes", Path: name, Err: err} + } + return b.source.Chtimes(name, atime, mtime) +} + +func (b *BasePathFs) Chmod(name string, mode os.FileMode) (err error) { + if name, err = b.RealPath(name); err != nil { + return &os.PathError{Op: "chmod", Path: name, Err: err} + } + return b.source.Chmod(name, mode) +} + +func (b *BasePathFs) Name() string { + return "BasePathFs" +} + +func (b *BasePathFs) Stat(name string) (fi os.FileInfo, err error) { + if name, err = b.RealPath(name); err != nil { + return nil, &os.PathError{Op: "stat", Path: name, Err: err} + } + return b.source.Stat(name) +} + +func (b *BasePathFs) Rename(oldname, newname string) (err error) { + if oldname, err = b.RealPath(oldname); err != nil { + return &os.PathError{Op: "rename", Path: oldname, Err: err} + } + if newname, err = b.RealPath(newname); err != nil { + return &os.PathError{Op: "rename", Path: newname, Err: err} + } + return b.source.Rename(oldname, newname) +} + +func (b *BasePathFs) RemoveAll(name string) (err error) { + if name, err = b.RealPath(name); err != nil { + return &os.PathError{Op: "remove_all", Path: name, Err: err} + } + return b.source.RemoveAll(name) +} + +func (b *BasePathFs) Remove(name string) (err error) { + if name, err = b.RealPath(name); err != nil { + return &os.PathError{Op: "remove", Path: name, Err: err} + } + return b.source.Remove(name) +} + +func (b *BasePathFs) OpenFile(name string, flag int, mode os.FileMode) (f File, err error) { + if name, err = b.RealPath(name); err != nil { + return nil, &os.PathError{Op: "openfile", Path: name, Err: err} + } + return b.source.OpenFile(name, flag, mode) +} + +func (b *BasePathFs) Open(name string) (f File, err error) { + if name, err = b.RealPath(name); err != nil { + return nil, &os.PathError{Op: "open", Path: name, Err: err} + } + return b.source.Open(name) +} + +func (b *BasePathFs) Mkdir(name string, mode os.FileMode) (err error) { + if name, err = b.RealPath(name); err != nil { + return &os.PathError{Op: "mkdir", Path: name, Err: err} + } + return b.source.Mkdir(name, mode) +} + +func (b *BasePathFs) MkdirAll(name string, mode os.FileMode) (err error) { + if name, err = b.RealPath(name); err != nil { + return &os.PathError{Op: "mkdir", Path: name, Err: err} + } + return b.source.MkdirAll(name, mode) +} + +func (b *BasePathFs) Create(name string) (f File, err error) { + if name, err = b.RealPath(name); err != nil { + return nil, &os.PathError{Op: "create", Path: name, Err: err} + } + return b.source.Create(name) +} + +// vim: ts=4 sw=4 noexpandtab nolist syn=go diff --git a/vendor/github.com/spf13/afero/basepath_test.go b/vendor/github.com/spf13/afero/basepath_test.go new file mode 100644 index 0000000000..abc22b9f64 --- /dev/null +++ b/vendor/github.com/spf13/afero/basepath_test.go @@ -0,0 +1,142 @@ +package afero + +import ( + "os" + "path/filepath" + "runtime" + "testing" +) + +func TestBasePath(t *testing.T) { + baseFs := &MemMapFs{} + baseFs.MkdirAll("/base/path/tmp", 0777) + bp := NewBasePathFs(baseFs, "/base/path") + + if _, err := bp.Create("/tmp/foo"); err != nil { + t.Errorf("Failed to set real path") + } + + if fh, err := bp.Create("../tmp/bar"); err == nil { + t.Errorf("succeeded in creating %s ...", fh.Name()) + } +} + +func TestBasePathRoot(t *testing.T) { + baseFs := &MemMapFs{} + baseFs.MkdirAll("/base/path/foo/baz", 0777) + baseFs.MkdirAll("/base/path/boo/", 0777) + bp := NewBasePathFs(baseFs, "/base/path") + + rd, err := ReadDir(bp, string(os.PathSeparator)) + + if len(rd) != 2 { + t.Errorf("base path doesn't respect root") + } + + if err != nil { + t.Error(err) + } +} + +func TestRealPath(t *testing.T) { + fs := NewOsFs() + baseDir, err := TempDir(fs, "", "base") + if err != nil { + t.Fatal("error creating tempDir", err) + } + defer fs.RemoveAll(baseDir) + anotherDir, err := TempDir(fs, "", "another") + if err != nil { + t.Fatal("error creating tempDir", err) + } + defer fs.RemoveAll(anotherDir) + + bp := NewBasePathFs(fs, baseDir).(*BasePathFs) + + subDir := filepath.Join(baseDir, "s1") + + realPath, err := bp.RealPath("/s1") + + if err != nil { + t.Errorf("Got error %s", err) + } + + if realPath != subDir { + t.Errorf("Expected \n%s got \n%s", subDir, realPath) + } + + if runtime.GOOS == "windows" { + _, err = bp.RealPath(anotherDir) + + if err == nil { + t.Errorf("Expected error") + } + + } else { + // on *nix we have no way of just looking at the path and tell that anotherDir + // is not inside the base file system. + // The user will receive an os.ErrNotExist later. + surrealPath, err := bp.RealPath(anotherDir) + + if err != nil { + t.Errorf("Got error %s", err) + } + + excpected := filepath.Join(baseDir, anotherDir) + + if surrealPath != excpected { + t.Errorf("Expected \n%s got \n%s", excpected, surrealPath) + } + } + +} + +func TestNestedBasePaths(t *testing.T) { + type dirSpec struct { + Dir1, Dir2, Dir3 string + } + dirSpecs := []dirSpec{ + dirSpec{Dir1: "/", Dir2: "/", Dir3: "/"}, + dirSpec{Dir1: "/", Dir2: "/path2", Dir3: "/"}, + dirSpec{Dir1: "/path1/dir", Dir2: "/path2/dir/", Dir3: "/path3/dir"}, + dirSpec{Dir1: "C:/path1", Dir2: "path2/dir", Dir3: "/path3/dir/"}, + } + + for _, ds := range dirSpecs { + memFs := NewMemMapFs() + level1Fs := NewBasePathFs(memFs, ds.Dir1) + level2Fs := NewBasePathFs(level1Fs, ds.Dir2) + level3Fs := NewBasePathFs(level2Fs, ds.Dir3) + + type spec struct { + BaseFs Fs + FileName string + } + specs := []spec{ + spec{BaseFs: level3Fs, FileName: "f.txt"}, + spec{BaseFs: level2Fs, FileName: "f.txt"}, + spec{BaseFs: level1Fs, FileName: "f.txt"}, + } + + for _, s := range specs { + if err := s.BaseFs.MkdirAll(s.FileName, 0755); err != nil { + t.Errorf("Got error %s", err.Error()) + } + if _, err := s.BaseFs.Stat(s.FileName); err != nil { + t.Errorf("Got error %s", err.Error()) + } + + if s.BaseFs == level3Fs { + pathToExist := filepath.Join(ds.Dir3, s.FileName) + if _, err := level2Fs.Stat(pathToExist); err != nil { + t.Errorf("Got error %s (path %s)", err.Error(), pathToExist) + } + } else if s.BaseFs == level2Fs { + pathToExist := filepath.Join(ds.Dir2, ds.Dir3, s.FileName) + if _, err := level1Fs.Stat(pathToExist); err != nil { + t.Errorf("Got error %s (path %s)", err.Error(), pathToExist) + } + } + } + } +} diff --git a/vendor/github.com/spf13/afero/cacheOnReadFs.go b/vendor/github.com/spf13/afero/cacheOnReadFs.go new file mode 100644 index 0000000000..b026e0de83 --- /dev/null +++ b/vendor/github.com/spf13/afero/cacheOnReadFs.go @@ -0,0 +1,290 @@ +package afero + +import ( + "os" + "syscall" + "time" +) + +// If the cache duration is 0, cache time will be unlimited, i.e. once +// a file is in the layer, the base will never be read again for this file. +// +// For cache times greater than 0, the modification time of a file is +// checked. Note that a lot of file system implementations only allow a +// resolution of a second for timestamps... or as the godoc for os.Chtimes() +// states: "The underlying filesystem may truncate or round the values to a +// less precise time unit." +// +// This caching union will forward all write calls also to the base file +// system first. To prevent writing to the base Fs, wrap it in a read-only +// filter - Note: this will also make the overlay read-only, for writing files +// in the overlay, use the overlay Fs directly, not via the union Fs. +type CacheOnReadFs struct { + base Fs + layer Fs + cacheTime time.Duration +} + +func NewCacheOnReadFs(base Fs, layer Fs, cacheTime time.Duration) Fs { + return &CacheOnReadFs{base: base, layer: layer, cacheTime: cacheTime} +} + +type cacheState int + +const ( + // not present in the overlay, unknown if it exists in the base: + cacheMiss cacheState = iota + // present in the overlay and in base, base file is newer: + cacheStale + // present in the overlay - with cache time == 0 it may exist in the base, + // with cacheTime > 0 it exists in the base and is same age or newer in the + // overlay + cacheHit + // happens if someone writes directly to the overlay without + // going through this union + cacheLocal +) + +func (u *CacheOnReadFs) cacheStatus(name string) (state cacheState, fi os.FileInfo, err error) { + var lfi, bfi os.FileInfo + lfi, err = u.layer.Stat(name) + if err == nil { + if u.cacheTime == 0 { + return cacheHit, lfi, nil + } + if lfi.ModTime().Add(u.cacheTime).Before(time.Now()) { + bfi, err = u.base.Stat(name) + if err != nil { + return cacheLocal, lfi, nil + } + if bfi.ModTime().After(lfi.ModTime()) { + return cacheStale, bfi, nil + } + } + return cacheHit, lfi, nil + } + + if err == syscall.ENOENT || os.IsNotExist(err) { + return cacheMiss, nil, nil + } + + return cacheMiss, nil, err +} + +func (u *CacheOnReadFs) copyToLayer(name string) error { + return copyToLayer(u.base, u.layer, name) +} + +func (u *CacheOnReadFs) Chtimes(name string, atime, mtime time.Time) error { + st, _, err := u.cacheStatus(name) + if err != nil { + return err + } + switch st { + case cacheLocal: + case cacheHit: + err = u.base.Chtimes(name, atime, mtime) + case cacheStale, cacheMiss: + if err := u.copyToLayer(name); err != nil { + return err + } + err = u.base.Chtimes(name, atime, mtime) + } + if err != nil { + return err + } + return u.layer.Chtimes(name, atime, mtime) +} + +func (u *CacheOnReadFs) Chmod(name string, mode os.FileMode) error { + st, _, err := u.cacheStatus(name) + if err != nil { + return err + } + switch st { + case cacheLocal: + case cacheHit: + err = u.base.Chmod(name, mode) + case cacheStale, cacheMiss: + if err := u.copyToLayer(name); err != nil { + return err + } + err = u.base.Chmod(name, mode) + } + if err != nil { + return err + } + return u.layer.Chmod(name, mode) +} + +func (u *CacheOnReadFs) Stat(name string) (os.FileInfo, error) { + st, fi, err := u.cacheStatus(name) + if err != nil { + return nil, err + } + switch st { + case cacheMiss: + return u.base.Stat(name) + default: // cacheStale has base, cacheHit and cacheLocal the layer os.FileInfo + return fi, nil + } +} + +func (u *CacheOnReadFs) Rename(oldname, newname string) error { + st, _, err := u.cacheStatus(oldname) + if err != nil { + return err + } + switch st { + case cacheLocal: + case cacheHit: + err = u.base.Rename(oldname, newname) + case cacheStale, cacheMiss: + if err := u.copyToLayer(oldname); err != nil { + return err + } + err = u.base.Rename(oldname, newname) + } + if err != nil { + return err + } + return u.layer.Rename(oldname, newname) +} + +func (u *CacheOnReadFs) Remove(name string) error { + st, _, err := u.cacheStatus(name) + if err != nil { + return err + } + switch st { + case cacheLocal: + case cacheHit, cacheStale, cacheMiss: + err = u.base.Remove(name) + } + if err != nil { + return err + } + return u.layer.Remove(name) +} + +func (u *CacheOnReadFs) RemoveAll(name string) error { + st, _, err := u.cacheStatus(name) + if err != nil { + return err + } + switch st { + case cacheLocal: + case cacheHit, cacheStale, cacheMiss: + err = u.base.RemoveAll(name) + } + if err != nil { + return err + } + return u.layer.RemoveAll(name) +} + +func (u *CacheOnReadFs) OpenFile(name string, flag int, perm os.FileMode) (File, error) { + st, _, err := u.cacheStatus(name) + if err != nil { + return nil, err + } + switch st { + case cacheLocal, cacheHit: + default: + if err := u.copyToLayer(name); err != nil { + return nil, err + } + } + if flag&(os.O_WRONLY|syscall.O_RDWR|os.O_APPEND|os.O_CREATE|os.O_TRUNC) != 0 { + bfi, err := u.base.OpenFile(name, flag, perm) + if err != nil { + return nil, err + } + lfi, err := u.layer.OpenFile(name, flag, perm) + if err != nil { + bfi.Close() // oops, what if O_TRUNC was set and file opening in the layer failed...? + return nil, err + } + return &UnionFile{base: bfi, layer: lfi}, nil + } + return u.layer.OpenFile(name, flag, perm) +} + +func (u *CacheOnReadFs) Open(name string) (File, error) { + st, fi, err := u.cacheStatus(name) + if err != nil { + return nil, err + } + + switch st { + case cacheLocal: + return u.layer.Open(name) + + case cacheMiss: + bfi, err := u.base.Stat(name) + if err != nil { + return nil, err + } + if bfi.IsDir() { + return u.base.Open(name) + } + if err := u.copyToLayer(name); err != nil { + return nil, err + } + return u.layer.Open(name) + + case cacheStale: + if !fi.IsDir() { + if err := u.copyToLayer(name); err != nil { + return nil, err + } + return u.layer.Open(name) + } + case cacheHit: + if !fi.IsDir() { + return u.layer.Open(name) + } + } + // the dirs from cacheHit, cacheStale fall down here: + bfile, _ := u.base.Open(name) + lfile, err := u.layer.Open(name) + if err != nil && bfile == nil { + return nil, err + } + return &UnionFile{base: bfile, layer: lfile}, nil +} + +func (u *CacheOnReadFs) Mkdir(name string, perm os.FileMode) error { + err := u.base.Mkdir(name, perm) + if err != nil { + return err + } + return u.layer.MkdirAll(name, perm) // yes, MkdirAll... we cannot assume it exists in the cache +} + +func (u *CacheOnReadFs) Name() string { + return "CacheOnReadFs" +} + +func (u *CacheOnReadFs) MkdirAll(name string, perm os.FileMode) error { + err := u.base.MkdirAll(name, perm) + if err != nil { + return err + } + return u.layer.MkdirAll(name, perm) +} + +func (u *CacheOnReadFs) Create(name string) (File, error) { + bfh, err := u.base.Create(name) + if err != nil { + return nil, err + } + lfh, err := u.layer.Create(name) + if err != nil { + // oops, see comment about OS_TRUNC above, should we remove? then we have to + // remember if the file did not exist before + bfh.Close() + return nil, err + } + return &UnionFile{base: bfh, layer: lfh}, nil +} diff --git a/vendor/github.com/spf13/afero/composite_test.go b/vendor/github.com/spf13/afero/composite_test.go new file mode 100644 index 0000000000..8e44611dcb --- /dev/null +++ b/vendor/github.com/spf13/afero/composite_test.go @@ -0,0 +1,404 @@ +package afero + +import ( + "bytes" + "fmt" + "io/ioutil" + "os" + "testing" + "time" +) + +var tempDirs []string + +func NewTempOsBaseFs(t *testing.T) Fs { + name, err := TempDir(NewOsFs(), "", "") + if err != nil { + t.Error("error creating tempDir", err) + } + + tempDirs = append(tempDirs, name) + + return NewBasePathFs(NewOsFs(), name) +} + +func CleanupTempDirs(t *testing.T) { + osfs := NewOsFs() + type ev struct { + path string + e error + } + + errs := []ev{} + + for _, x := range tempDirs { + err := osfs.RemoveAll(x) + if err != nil { + errs = append(errs, ev{path: x, e: err}) + } + } + + for _, e := range errs { + fmt.Println("error removing tempDir", e.path, e.e) + } + + if len(errs) > 0 { + t.Error("error cleaning up tempDirs") + } + tempDirs = []string{} +} + +func TestUnionCreateExisting(t *testing.T) { + base := &MemMapFs{} + roBase := &ReadOnlyFs{source: base} + + ufs := NewCopyOnWriteFs(roBase, &MemMapFs{}) + + base.MkdirAll("/home/test", 0777) + fh, _ := base.Create("/home/test/file.txt") + fh.WriteString("This is a test") + fh.Close() + + fh, err := ufs.OpenFile("/home/test/file.txt", os.O_RDWR, 0666) + if err != nil { + t.Errorf("Failed to open file r/w: %s", err) + } + + _, err = fh.Write([]byte("####")) + if err != nil { + t.Errorf("Failed to write file: %s", err) + } + fh.Seek(0, 0) + data, err := ioutil.ReadAll(fh) + if err != nil { + t.Errorf("Failed to read file: %s", err) + } + if string(data) != "#### is a test" { + t.Errorf("Got wrong data") + } + fh.Close() + + fh, _ = base.Open("/home/test/file.txt") + data, err = ioutil.ReadAll(fh) + if string(data) != "This is a test" { + t.Errorf("Got wrong data in base file") + } + fh.Close() + + fh, err = ufs.Create("/home/test/file.txt") + switch err { + case nil: + if fi, _ := fh.Stat(); fi.Size() != 0 { + t.Errorf("Create did not truncate file") + } + fh.Close() + default: + t.Errorf("Create failed on existing file") + } + +} + +func TestUnionMergeReaddir(t *testing.T) { + base := &MemMapFs{} + roBase := &ReadOnlyFs{source: base} + + ufs := &CopyOnWriteFs{base: roBase, layer: &MemMapFs{}} + + base.MkdirAll("/home/test", 0777) + fh, _ := base.Create("/home/test/file.txt") + fh.WriteString("This is a test") + fh.Close() + + fh, _ = ufs.Create("/home/test/file2.txt") + fh.WriteString("This is a test") + fh.Close() + + fh, _ = ufs.Open("/home/test") + files, err := fh.Readdirnames(-1) + if err != nil { + t.Errorf("Readdirnames failed") + } + if len(files) != 2 { + t.Errorf("Got wrong number of files: %v", files) + } +} + +func TestExistingDirectoryCollisionReaddir(t *testing.T) { + base := &MemMapFs{} + roBase := &ReadOnlyFs{source: base} + overlay := &MemMapFs{} + + ufs := &CopyOnWriteFs{base: roBase, layer: overlay} + + base.MkdirAll("/home/test", 0777) + fh, _ := base.Create("/home/test/file.txt") + fh.WriteString("This is a test") + fh.Close() + + overlay.MkdirAll("home/test", 0777) + fh, _ = overlay.Create("/home/test/file2.txt") + fh.WriteString("This is a test") + fh.Close() + + fh, _ = ufs.Create("/home/test/file3.txt") + fh.WriteString("This is a test") + fh.Close() + + fh, _ = ufs.Open("/home/test") + files, err := fh.Readdirnames(-1) + if err != nil { + t.Errorf("Readdirnames failed") + } + if len(files) != 3 { + t.Errorf("Got wrong number of files in union: %v", files) + } + + fh, _ = overlay.Open("/home/test") + files, err = fh.Readdirnames(-1) + if err != nil { + t.Errorf("Readdirnames failed") + } + if len(files) != 2 { + t.Errorf("Got wrong number of files in overlay: %v", files) + } +} + +func TestNestedDirBaseReaddir(t *testing.T) { + base := &MemMapFs{} + roBase := &ReadOnlyFs{source: base} + overlay := &MemMapFs{} + + ufs := &CopyOnWriteFs{base: roBase, layer: overlay} + + base.MkdirAll("/home/test/foo/bar", 0777) + fh, _ := base.Create("/home/test/file.txt") + fh.WriteString("This is a test") + fh.Close() + + fh, _ = base.Create("/home/test/foo/file2.txt") + fh.WriteString("This is a test") + fh.Close() + fh, _ = base.Create("/home/test/foo/bar/file3.txt") + fh.WriteString("This is a test") + fh.Close() + + overlay.MkdirAll("/", 0777) + + // Opening something only in the base + fh, _ = ufs.Open("/home/test/foo") + list, err := fh.Readdir(-1) + if err != nil { + t.Errorf("Readdir failed %s", err) + } + if len(list) != 2 { + for _, x := range list { + fmt.Println(x.Name()) + } + t.Errorf("Got wrong number of files in union: %v", len(list)) + } +} + +func TestNestedDirOverlayReaddir(t *testing.T) { + base := &MemMapFs{} + roBase := &ReadOnlyFs{source: base} + overlay := &MemMapFs{} + + ufs := &CopyOnWriteFs{base: roBase, layer: overlay} + + base.MkdirAll("/", 0777) + overlay.MkdirAll("/home/test/foo/bar", 0777) + fh, _ := overlay.Create("/home/test/file.txt") + fh.WriteString("This is a test") + fh.Close() + fh, _ = overlay.Create("/home/test/foo/file2.txt") + fh.WriteString("This is a test") + fh.Close() + fh, _ = overlay.Create("/home/test/foo/bar/file3.txt") + fh.WriteString("This is a test") + fh.Close() + + // Opening nested dir only in the overlay + fh, _ = ufs.Open("/home/test/foo") + list, err := fh.Readdir(-1) + if err != nil { + t.Errorf("Readdir failed %s", err) + } + if len(list) != 2 { + for _, x := range list { + fmt.Println(x.Name()) + } + t.Errorf("Got wrong number of files in union: %v", len(list)) + } +} + +func TestNestedDirOverlayOsFsReaddir(t *testing.T) { + defer CleanupTempDirs(t) + base := NewTempOsBaseFs(t) + roBase := &ReadOnlyFs{source: base} + overlay := NewTempOsBaseFs(t) + + ufs := &CopyOnWriteFs{base: roBase, layer: overlay} + + base.MkdirAll("/", 0777) + overlay.MkdirAll("/home/test/foo/bar", 0777) + fh, _ := overlay.Create("/home/test/file.txt") + fh.WriteString("This is a test") + fh.Close() + fh, _ = overlay.Create("/home/test/foo/file2.txt") + fh.WriteString("This is a test") + fh.Close() + fh, _ = overlay.Create("/home/test/foo/bar/file3.txt") + fh.WriteString("This is a test") + fh.Close() + + // Opening nested dir only in the overlay + fh, _ = ufs.Open("/home/test/foo") + list, err := fh.Readdir(-1) + fh.Close() + if err != nil { + t.Errorf("Readdir failed %s", err) + } + if len(list) != 2 { + for _, x := range list { + fmt.Println(x.Name()) + } + t.Errorf("Got wrong number of files in union: %v", len(list)) + } +} + +func TestCopyOnWriteFsWithOsFs(t *testing.T) { + defer CleanupTempDirs(t) + base := NewTempOsBaseFs(t) + roBase := &ReadOnlyFs{source: base} + overlay := NewTempOsBaseFs(t) + + ufs := &CopyOnWriteFs{base: roBase, layer: overlay} + + base.MkdirAll("/home/test", 0777) + fh, _ := base.Create("/home/test/file.txt") + fh.WriteString("This is a test") + fh.Close() + + overlay.MkdirAll("home/test", 0777) + fh, _ = overlay.Create("/home/test/file2.txt") + fh.WriteString("This is a test") + fh.Close() + + fh, _ = ufs.Create("/home/test/file3.txt") + fh.WriteString("This is a test") + fh.Close() + + fh, _ = ufs.Open("/home/test") + files, err := fh.Readdirnames(-1) + fh.Close() + if err != nil { + t.Errorf("Readdirnames failed") + } + if len(files) != 3 { + t.Errorf("Got wrong number of files in union: %v", files) + } + + fh, _ = overlay.Open("/home/test") + files, err = fh.Readdirnames(-1) + fh.Close() + if err != nil { + t.Errorf("Readdirnames failed") + } + if len(files) != 2 { + t.Errorf("Got wrong number of files in overlay: %v", files) + } +} + +func TestUnionCacheWrite(t *testing.T) { + base := &MemMapFs{} + layer := &MemMapFs{} + + ufs := NewCacheOnReadFs(base, layer, 0) + + base.Mkdir("/data", 0777) + + fh, err := ufs.Create("/data/file.txt") + if err != nil { + t.Errorf("Failed to create file") + } + _, err = fh.Write([]byte("This is a test")) + if err != nil { + t.Errorf("Failed to write file") + } + + fh.Seek(0, os.SEEK_SET) + buf := make([]byte, 4) + _, err = fh.Read(buf) + fh.Write([]byte(" IS A")) + fh.Close() + + baseData, _ := ReadFile(base, "/data/file.txt") + layerData, _ := ReadFile(layer, "/data/file.txt") + if string(baseData) != string(layerData) { + t.Errorf("Different data: %s <=> %s", baseData, layerData) + } +} + +func TestUnionCacheExpire(t *testing.T) { + base := &MemMapFs{} + layer := &MemMapFs{} + ufs := &CacheOnReadFs{base: base, layer: layer, cacheTime: 1 * time.Second} + + base.Mkdir("/data", 0777) + + fh, err := ufs.Create("/data/file.txt") + if err != nil { + t.Errorf("Failed to create file") + } + _, err = fh.Write([]byte("This is a test")) + if err != nil { + t.Errorf("Failed to write file") + } + fh.Close() + + fh, _ = base.Create("/data/file.txt") + // sleep some time, so we really get a different time.Now() on write... + time.Sleep(2 * time.Second) + fh.WriteString("Another test") + fh.Close() + + data, _ := ReadFile(ufs, "/data/file.txt") + if string(data) != "Another test" { + t.Errorf("cache time failed: <%s>", data) + } +} + +func TestCacheOnReadFsNotInLayer(t *testing.T) { + base := NewMemMapFs() + layer := NewMemMapFs() + fs := NewCacheOnReadFs(base, layer, 0) + + fh, err := base.Create("/file.txt") + if err != nil { + t.Fatal("unable to create file: ", err) + } + + txt := []byte("This is a test") + fh.Write(txt) + fh.Close() + + fh, err = fs.Open("/file.txt") + if err != nil { + t.Fatal("could not open file: ", err) + } + + b, err := ReadAll(fh) + fh.Close() + + if err != nil { + t.Fatal("could not read file: ", err) + } else if !bytes.Equal(txt, b) { + t.Fatalf("wanted file text %q, got %q", txt, b) + } + + fh, err = layer.Open("/file.txt") + if err != nil { + t.Fatal("could not open file from layer: ", err) + } + fh.Close() +} diff --git a/vendor/github.com/spf13/afero/const_bsds.go b/vendor/github.com/spf13/afero/const_bsds.go new file mode 100644 index 0000000000..5728243d96 --- /dev/null +++ b/vendor/github.com/spf13/afero/const_bsds.go @@ -0,0 +1,22 @@ +// Copyright © 2016 Steve Francia . +// +// 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. + +// +build darwin openbsd freebsd netbsd dragonfly + +package afero + +import ( + "syscall" +) + +const BADFD = syscall.EBADF diff --git a/vendor/github.com/spf13/afero/const_win_unix.go b/vendor/github.com/spf13/afero/const_win_unix.go new file mode 100644 index 0000000000..968fc2783e --- /dev/null +++ b/vendor/github.com/spf13/afero/const_win_unix.go @@ -0,0 +1,25 @@ +// Copyright © 2016 Steve Francia . +// +// 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. +// +build !darwin +// +build !openbsd +// +build !freebsd +// +build !dragonfly +// +build !netbsd + +package afero + +import ( + "syscall" +) + +const BADFD = syscall.EBADFD diff --git a/vendor/github.com/spf13/afero/copyOnWriteFs.go b/vendor/github.com/spf13/afero/copyOnWriteFs.go new file mode 100644 index 0000000000..f2ebcd2266 --- /dev/null +++ b/vendor/github.com/spf13/afero/copyOnWriteFs.go @@ -0,0 +1,253 @@ +package afero + +import ( + "fmt" + "os" + "path/filepath" + "syscall" + "time" +) + +// The CopyOnWriteFs is a union filesystem: a read only base file system with +// a possibly writeable layer on top. Changes to the file system will only +// be made in the overlay: Changing an existing file in the base layer which +// is not present in the overlay will copy the file to the overlay ("changing" +// includes also calls to e.g. Chtimes() and Chmod()). +// +// Reading directories is currently only supported via Open(), not OpenFile(). +type CopyOnWriteFs struct { + base Fs + layer Fs +} + +func NewCopyOnWriteFs(base Fs, layer Fs) Fs { + return &CopyOnWriteFs{base: base, layer: layer} +} + +// Returns true if the file is not in the overlay +func (u *CopyOnWriteFs) isBaseFile(name string) (bool, error) { + if _, err := u.layer.Stat(name); err == nil { + return false, nil + } + _, err := u.base.Stat(name) + if err != nil { + if oerr, ok := err.(*os.PathError); ok { + if oerr.Err == os.ErrNotExist || oerr.Err == syscall.ENOENT || oerr.Err == syscall.ENOTDIR { + return false, nil + } + } + if err == syscall.ENOENT { + return false, nil + } + } + return true, err +} + +func (u *CopyOnWriteFs) copyToLayer(name string) error { + return copyToLayer(u.base, u.layer, name) +} + +func (u *CopyOnWriteFs) Chtimes(name string, atime, mtime time.Time) error { + b, err := u.isBaseFile(name) + if err != nil { + return err + } + if b { + if err := u.copyToLayer(name); err != nil { + return err + } + } + return u.layer.Chtimes(name, atime, mtime) +} + +func (u *CopyOnWriteFs) Chmod(name string, mode os.FileMode) error { + b, err := u.isBaseFile(name) + if err != nil { + return err + } + if b { + if err := u.copyToLayer(name); err != nil { + return err + } + } + return u.layer.Chmod(name, mode) +} + +func (u *CopyOnWriteFs) Stat(name string) (os.FileInfo, error) { + fi, err := u.layer.Stat(name) + if err != nil { + origErr := err + if e, ok := err.(*os.PathError); ok { + err = e.Err + } + if err == os.ErrNotExist || err == syscall.ENOENT || err == syscall.ENOTDIR { + return u.base.Stat(name) + } + return nil, origErr + } + return fi, nil +} + +// Renaming files present only in the base layer is not permitted +func (u *CopyOnWriteFs) Rename(oldname, newname string) error { + b, err := u.isBaseFile(oldname) + if err != nil { + return err + } + if b { + return syscall.EPERM + } + return u.layer.Rename(oldname, newname) +} + +// Removing files present only in the base layer is not permitted. If +// a file is present in the base layer and the overlay, only the overlay +// will be removed. +func (u *CopyOnWriteFs) Remove(name string) error { + err := u.layer.Remove(name) + switch err { + case syscall.ENOENT: + _, err = u.base.Stat(name) + if err == nil { + return syscall.EPERM + } + return syscall.ENOENT + default: + return err + } +} + +func (u *CopyOnWriteFs) RemoveAll(name string) error { + err := u.layer.RemoveAll(name) + switch err { + case syscall.ENOENT: + _, err = u.base.Stat(name) + if err == nil { + return syscall.EPERM + } + return syscall.ENOENT + default: + return err + } +} + +func (u *CopyOnWriteFs) OpenFile(name string, flag int, perm os.FileMode) (File, error) { + b, err := u.isBaseFile(name) + if err != nil { + return nil, err + } + + if flag&(os.O_WRONLY|os.O_RDWR|os.O_APPEND|os.O_CREATE|os.O_TRUNC) != 0 { + if b { + if err = u.copyToLayer(name); err != nil { + return nil, err + } + return u.layer.OpenFile(name, flag, perm) + } + + dir := filepath.Dir(name) + isaDir, err := IsDir(u.base, dir) + if err != nil && !os.IsNotExist(err) { + return nil, err + } + if isaDir { + if err = u.layer.MkdirAll(dir, 0777); err != nil { + return nil, err + } + return u.layer.OpenFile(name, flag, perm) + } + + isaDir, err = IsDir(u.layer, dir) + if err != nil { + return nil, err + } + if isaDir { + return u.layer.OpenFile(name, flag, perm) + } + + return nil, &os.PathError{Op: "open", Path: name, Err: syscall.ENOTDIR} // ...or os.ErrNotExist? + } + if b { + return u.base.OpenFile(name, flag, perm) + } + return u.layer.OpenFile(name, flag, perm) +} + +// This function handles the 9 different possibilities caused +// by the union which are the intersection of the following... +// layer: doesn't exist, exists as a file, and exists as a directory +// base: doesn't exist, exists as a file, and exists as a directory +func (u *CopyOnWriteFs) Open(name string) (File, error) { + // Since the overlay overrides the base we check that first + b, err := u.isBaseFile(name) + if err != nil { + return nil, err + } + + // If overlay doesn't exist, return the base (base state irrelevant) + if b { + return u.base.Open(name) + } + + // If overlay is a file, return it (base state irrelevant) + dir, err := IsDir(u.layer, name) + if err != nil { + return nil, err + } + if !dir { + return u.layer.Open(name) + } + + // Overlay is a directory, base state now matters. + // Base state has 3 states to check but 2 outcomes: + // A. It's a file or non-readable in the base (return just the overlay) + // B. It's an accessible directory in the base (return a UnionFile) + + // If base is file or nonreadable, return overlay + dir, err = IsDir(u.base, name) + if !dir || err != nil { + return u.layer.Open(name) + } + + // Both base & layer are directories + // Return union file (if opens are without error) + bfile, bErr := u.base.Open(name) + lfile, lErr := u.layer.Open(name) + + // If either have errors at this point something is very wrong. Return nil and the errors + if bErr != nil || lErr != nil { + return nil, fmt.Errorf("BaseErr: %v\nOverlayErr: %v", bErr, lErr) + } + + return &UnionFile{base: bfile, layer: lfile}, nil +} + +func (u *CopyOnWriteFs) Mkdir(name string, perm os.FileMode) error { + dir, err := IsDir(u.base, name) + if err != nil { + return u.layer.MkdirAll(name, perm) + } + if dir { + return syscall.EEXIST + } + return u.layer.MkdirAll(name, perm) +} + +func (u *CopyOnWriteFs) Name() string { + return "CopyOnWriteFs" +} + +func (u *CopyOnWriteFs) MkdirAll(name string, perm os.FileMode) error { + dir, err := IsDir(u.base, name) + if err != nil { + return u.layer.MkdirAll(name, perm) + } + if dir { + return syscall.EEXIST + } + return u.layer.MkdirAll(name, perm) +} + +func (u *CopyOnWriteFs) Create(name string) (File, error) { + return u.OpenFile(name, os.O_CREATE|os.O_TRUNC|os.O_RDWR, 0666) +} diff --git a/vendor/github.com/spf13/afero/copyOnWriteFs_test.go b/vendor/github.com/spf13/afero/copyOnWriteFs_test.go new file mode 100644 index 0000000000..c6f2c6d625 --- /dev/null +++ b/vendor/github.com/spf13/afero/copyOnWriteFs_test.go @@ -0,0 +1,39 @@ +package afero + +import "testing" + +func TestCopyOnWrite(t *testing.T) { + var fs Fs + var err error + base := NewOsFs() + roBase := NewReadOnlyFs(base) + ufs := NewCopyOnWriteFs(roBase, NewMemMapFs()) + fs = ufs + err = fs.MkdirAll("nonexistent/directory/", 0744) + if err != nil { + t.Error(err) + return + } + _, err = fs.Create("nonexistent/directory/newfile") + if err != nil { + t.Error(err) + return + } + +} + +func TestCopyOnWriteFileInMemMapBase(t *testing.T) { + base := &MemMapFs{} + layer := &MemMapFs{} + + if err := WriteFile(base, "base.txt", []byte("base"), 0755); err != nil { + t.Fatalf("Failed to write file: %s", err) + } + + ufs := NewCopyOnWriteFs(base, layer) + + _, err := ufs.Stat("base.txt") + if err != nil { + t.Fatal(err) + } +} diff --git a/vendor/github.com/spf13/afero/httpFs.go b/vendor/github.com/spf13/afero/httpFs.go new file mode 100644 index 0000000000..c42193688c --- /dev/null +++ b/vendor/github.com/spf13/afero/httpFs.go @@ -0,0 +1,110 @@ +// Copyright © 2014 Steve Francia . +// +// 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 afero + +import ( + "errors" + "net/http" + "os" + "path" + "path/filepath" + "strings" + "time" +) + +type httpDir struct { + basePath string + fs HttpFs +} + +func (d httpDir) Open(name string) (http.File, error) { + if filepath.Separator != '/' && strings.IndexRune(name, filepath.Separator) >= 0 || + strings.Contains(name, "\x00") { + return nil, errors.New("http: invalid character in file path") + } + dir := string(d.basePath) + if dir == "" { + dir = "." + } + + f, err := d.fs.Open(filepath.Join(dir, filepath.FromSlash(path.Clean("/"+name)))) + if err != nil { + return nil, err + } + return f, nil +} + +type HttpFs struct { + source Fs +} + +func NewHttpFs(source Fs) *HttpFs { + return &HttpFs{source: source} +} + +func (h HttpFs) Dir(s string) *httpDir { + return &httpDir{basePath: s, fs: h} +} + +func (h HttpFs) Name() string { return "h HttpFs" } + +func (h HttpFs) Create(name string) (File, error) { + return h.source.Create(name) +} + +func (h HttpFs) Chmod(name string, mode os.FileMode) error { + return h.source.Chmod(name, mode) +} + +func (h HttpFs) Chtimes(name string, atime time.Time, mtime time.Time) error { + return h.source.Chtimes(name, atime, mtime) +} + +func (h HttpFs) Mkdir(name string, perm os.FileMode) error { + return h.source.Mkdir(name, perm) +} + +func (h HttpFs) MkdirAll(path string, perm os.FileMode) error { + return h.source.MkdirAll(path, perm) +} + +func (h HttpFs) Open(name string) (http.File, error) { + f, err := h.source.Open(name) + if err == nil { + if httpfile, ok := f.(http.File); ok { + return httpfile, nil + } + } + return nil, err +} + +func (h HttpFs) OpenFile(name string, flag int, perm os.FileMode) (File, error) { + return h.source.OpenFile(name, flag, perm) +} + +func (h HttpFs) Remove(name string) error { + return h.source.Remove(name) +} + +func (h HttpFs) RemoveAll(path string) error { + return h.source.RemoveAll(path) +} + +func (h HttpFs) Rename(oldname, newname string) error { + return h.source.Rename(oldname, newname) +} + +func (h HttpFs) Stat(name string) (os.FileInfo, error) { + return h.source.Stat(name) +} diff --git a/vendor/github.com/spf13/afero/ioutil.go b/vendor/github.com/spf13/afero/ioutil.go new file mode 100644 index 0000000000..5c3a3d8fff --- /dev/null +++ b/vendor/github.com/spf13/afero/ioutil.go @@ -0,0 +1,230 @@ +// Copyright ©2015 The Go Authors +// Copyright ©2015 Steve Francia +// +// 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 afero + +import ( + "bytes" + "io" + "os" + "path/filepath" + "sort" + "strconv" + "sync" + "time" +) + +// byName implements sort.Interface. +type byName []os.FileInfo + +func (f byName) Len() int { return len(f) } +func (f byName) Less(i, j int) bool { return f[i].Name() < f[j].Name() } +func (f byName) Swap(i, j int) { f[i], f[j] = f[j], f[i] } + +// ReadDir reads the directory named by dirname and returns +// a list of sorted directory entries. +func (a Afero) ReadDir(dirname string) ([]os.FileInfo, error) { + return ReadDir(a.Fs, dirname) +} + +func ReadDir(fs Fs, dirname string) ([]os.FileInfo, error) { + f, err := fs.Open(dirname) + if err != nil { + return nil, err + } + list, err := f.Readdir(-1) + f.Close() + if err != nil { + return nil, err + } + sort.Sort(byName(list)) + return list, nil +} + +// ReadFile reads the file named by filename and returns the contents. +// A successful call returns err == nil, not err == EOF. Because ReadFile +// reads the whole file, it does not treat an EOF from Read as an error +// to be reported. +func (a Afero) ReadFile(filename string) ([]byte, error) { + return ReadFile(a.Fs, filename) +} + +func ReadFile(fs Fs, filename string) ([]byte, error) { + f, err := fs.Open(filename) + if err != nil { + return nil, err + } + defer f.Close() + // It's a good but not certain bet that FileInfo will tell us exactly how much to + // read, so let's try it but be prepared for the answer to be wrong. + var n int64 + + if fi, err := f.Stat(); err == nil { + // Don't preallocate a huge buffer, just in case. + if size := fi.Size(); size < 1e9 { + n = size + } + } + // As initial capacity for readAll, use n + a little extra in case Size is zero, + // and to avoid another allocation after Read has filled the buffer. The readAll + // call will read into its allocated internal buffer cheaply. If the size was + // wrong, we'll either waste some space off the end or reallocate as needed, but + // in the overwhelmingly common case we'll get it just right. + return readAll(f, n+bytes.MinRead) +} + +// readAll reads from r until an error or EOF and returns the data it read +// from the internal buffer allocated with a specified capacity. +func readAll(r io.Reader, capacity int64) (b []byte, err error) { + buf := bytes.NewBuffer(make([]byte, 0, capacity)) + // If the buffer overflows, we will get bytes.ErrTooLarge. + // Return that as an error. Any other panic remains. + defer func() { + e := recover() + if e == nil { + return + } + if panicErr, ok := e.(error); ok && panicErr == bytes.ErrTooLarge { + err = panicErr + } else { + panic(e) + } + }() + _, err = buf.ReadFrom(r) + return buf.Bytes(), err +} + +// ReadAll reads from r until an error or EOF and returns the data it read. +// A successful call returns err == nil, not err == EOF. Because ReadAll is +// defined to read from src until EOF, it does not treat an EOF from Read +// as an error to be reported. +func ReadAll(r io.Reader) ([]byte, error) { + return readAll(r, bytes.MinRead) +} + +// WriteFile writes data to a file named by filename. +// If the file does not exist, WriteFile creates it with permissions perm; +// otherwise WriteFile truncates it before writing. +func (a Afero) WriteFile(filename string, data []byte, perm os.FileMode) error { + return WriteFile(a.Fs, filename, data, perm) +} + +func WriteFile(fs Fs, filename string, data []byte, perm os.FileMode) error { + f, err := fs.OpenFile(filename, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, perm) + if err != nil { + return err + } + n, err := f.Write(data) + if err == nil && n < len(data) { + err = io.ErrShortWrite + } + if err1 := f.Close(); err == nil { + err = err1 + } + return err +} + +// Random number state. +// We generate random temporary file names so that there's a good +// chance the file doesn't exist yet - keeps the number of tries in +// TempFile to a minimum. +var rand uint32 +var randmu sync.Mutex + +func reseed() uint32 { + return uint32(time.Now().UnixNano() + int64(os.Getpid())) +} + +func nextSuffix() string { + randmu.Lock() + r := rand + if r == 0 { + r = reseed() + } + r = r*1664525 + 1013904223 // constants from Numerical Recipes + rand = r + randmu.Unlock() + return strconv.Itoa(int(1e9 + r%1e9))[1:] +} + +// TempFile creates a new temporary file in the directory dir +// with a name beginning with prefix, opens the file for reading +// and writing, and returns the resulting *File. +// If dir is the empty string, TempFile uses the default directory +// for temporary files (see os.TempDir). +// Multiple programs calling TempFile simultaneously +// will not choose the same file. The caller can use f.Name() +// to find the pathname of the file. It is the caller's responsibility +// to remove the file when no longer needed. +func (a Afero) TempFile(dir, prefix string) (f File, err error) { + return TempFile(a.Fs, dir, prefix) +} + +func TempFile(fs Fs, dir, prefix string) (f File, err error) { + if dir == "" { + dir = os.TempDir() + } + + nconflict := 0 + for i := 0; i < 10000; i++ { + name := filepath.Join(dir, prefix+nextSuffix()) + f, err = fs.OpenFile(name, os.O_RDWR|os.O_CREATE|os.O_EXCL, 0600) + if os.IsExist(err) { + if nconflict++; nconflict > 10 { + randmu.Lock() + rand = reseed() + randmu.Unlock() + } + continue + } + break + } + return +} + +// TempDir creates a new temporary directory in the directory dir +// with a name beginning with prefix and returns the path of the +// new directory. If dir is the empty string, TempDir uses the +// default directory for temporary files (see os.TempDir). +// Multiple programs calling TempDir simultaneously +// will not choose the same directory. It is the caller's responsibility +// to remove the directory when no longer needed. +func (a Afero) TempDir(dir, prefix string) (name string, err error) { + return TempDir(a.Fs, dir, prefix) +} +func TempDir(fs Fs, dir, prefix string) (name string, err error) { + if dir == "" { + dir = os.TempDir() + } + + nconflict := 0 + for i := 0; i < 10000; i++ { + try := filepath.Join(dir, prefix+nextSuffix()) + err = fs.Mkdir(try, 0700) + if os.IsExist(err) { + if nconflict++; nconflict > 10 { + randmu.Lock() + rand = reseed() + randmu.Unlock() + } + continue + } + if err == nil { + name = try + } + break + } + return +} diff --git a/vendor/github.com/spf13/afero/ioutil_test.go b/vendor/github.com/spf13/afero/ioutil_test.go new file mode 100644 index 0000000000..e7c9f06987 --- /dev/null +++ b/vendor/github.com/spf13/afero/ioutil_test.go @@ -0,0 +1,112 @@ +// ©2015 The Go Authors +// Copyright ©2015 Steve Francia +// +// 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 afero + +import "testing" + +func checkSizePath(t *testing.T, path string, size int64) { + dir, err := testFS.Stat(path) + if err != nil { + t.Fatalf("Stat %q (looking for size %d): %s", path, size, err) + } + if dir.Size() != size { + t.Errorf("Stat %q: size %d want %d", path, dir.Size(), size) + } +} + +func TestReadFile(t *testing.T) { + testFS = &MemMapFs{} + fsutil := &Afero{Fs: testFS} + + testFS.Create("this_exists.go") + filename := "rumpelstilzchen" + contents, err := fsutil.ReadFile(filename) + if err == nil { + t.Fatalf("ReadFile %s: error expected, none found", filename) + } + + filename = "this_exists.go" + contents, err = fsutil.ReadFile(filename) + if err != nil { + t.Fatalf("ReadFile %s: %v", filename, err) + } + + checkSizePath(t, filename, int64(len(contents))) +} + +func TestWriteFile(t *testing.T) { + testFS = &MemMapFs{} + fsutil := &Afero{Fs: testFS} + f, err := fsutil.TempFile("", "ioutil-test") + if err != nil { + t.Fatal(err) + } + filename := f.Name() + data := "Programming today is a race between software engineers striving to " + + "build bigger and better idiot-proof programs, and the Universe trying " + + "to produce bigger and better idiots. So far, the Universe is winning." + + if err := fsutil.WriteFile(filename, []byte(data), 0644); err != nil { + t.Fatalf("WriteFile %s: %v", filename, err) + } + + contents, err := fsutil.ReadFile(filename) + if err != nil { + t.Fatalf("ReadFile %s: %v", filename, err) + } + + if string(contents) != data { + t.Fatalf("contents = %q\nexpected = %q", string(contents), data) + } + + // cleanup + f.Close() + testFS.Remove(filename) // ignore error +} + +func TestReadDir(t *testing.T) { + testFS = &MemMapFs{} + testFS.Mkdir("/i-am-a-dir", 0777) + testFS.Create("/this_exists.go") + dirname := "rumpelstilzchen" + _, err := ReadDir(testFS, dirname) + if err == nil { + t.Fatalf("ReadDir %s: error expected, none found", dirname) + } + + dirname = ".." + list, err := ReadDir(testFS, dirname) + if err != nil { + t.Fatalf("ReadDir %s: %v", dirname, err) + } + + foundFile := false + foundSubDir := false + for _, dir := range list { + switch { + case !dir.IsDir() && dir.Name() == "this_exists.go": + foundFile = true + case dir.IsDir() && dir.Name() == "i-am-a-dir": + foundSubDir = true + } + } + if !foundFile { + t.Fatalf("ReadDir %s: this_exists.go file not found", dirname) + } + if !foundSubDir { + t.Fatalf("ReadDir %s: i-am-a-dir directory not found", dirname) + } +} diff --git a/vendor/github.com/spf13/afero/match.go b/vendor/github.com/spf13/afero/match.go new file mode 100644 index 0000000000..08b3b7e014 --- /dev/null +++ b/vendor/github.com/spf13/afero/match.go @@ -0,0 +1,110 @@ +// Copyright © 2014 Steve Francia . +// Copyright 2009 The Go Authors. All rights reserved. + +// 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 afero + +import ( + "path/filepath" + "sort" + "strings" +) + +// Glob returns the names of all files matching pattern or nil +// if there is no matching file. The syntax of patterns is the same +// as in Match. The pattern may describe hierarchical names such as +// /usr/*/bin/ed (assuming the Separator is '/'). +// +// Glob ignores file system errors such as I/O errors reading directories. +// The only possible returned error is ErrBadPattern, when pattern +// is malformed. +// +// This was adapted from (http://golang.org/pkg/path/filepath) and uses several +// built-ins from that package. +func Glob(fs Fs, pattern string) (matches []string, err error) { + if !hasMeta(pattern) { + // afero does not support Lstat directly. + if _, err = lstatIfOs(fs, pattern); err != nil { + return nil, nil + } + return []string{pattern}, nil + } + + dir, file := filepath.Split(pattern) + switch dir { + case "": + dir = "." + case string(filepath.Separator): + // nothing + default: + dir = dir[0 : len(dir)-1] // chop off trailing separator + } + + if !hasMeta(dir) { + return glob(fs, dir, file, nil) + } + + var m []string + m, err = Glob(fs, dir) + if err != nil { + return + } + for _, d := range m { + matches, err = glob(fs, d, file, matches) + if err != nil { + return + } + } + return +} + +// glob searches for files matching pattern in the directory dir +// and appends them to matches. If the directory cannot be +// opened, it returns the existing matches. New matches are +// added in lexicographical order. +func glob(fs Fs, dir, pattern string, matches []string) (m []string, e error) { + m = matches + fi, err := fs.Stat(dir) + if err != nil { + return + } + if !fi.IsDir() { + return + } + d, err := fs.Open(dir) + if err != nil { + return + } + defer d.Close() + + names, _ := d.Readdirnames(-1) + sort.Strings(names) + + for _, n := range names { + matched, err := filepath.Match(pattern, n) + if err != nil { + return m, err + } + if matched { + m = append(m, filepath.Join(dir, n)) + } + } + return +} + +// hasMeta reports whether path contains any of the magic characters +// recognized by Match. +func hasMeta(path string) bool { + // TODO(niemeyer): Should other magic characters be added here? + return strings.IndexAny(path, "*?[") >= 0 +} diff --git a/vendor/github.com/spf13/afero/match_test.go b/vendor/github.com/spf13/afero/match_test.go new file mode 100644 index 0000000000..21e1faecdb --- /dev/null +++ b/vendor/github.com/spf13/afero/match_test.go @@ -0,0 +1,183 @@ +// Copyright © 2014 Steve Francia . +// Copyright 2009 The Go Authors. All rights reserved. +// +// 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 afero + +import ( + "os" + "path/filepath" + "runtime" + "testing" +) + +// contains returns true if vector contains the string s. +func contains(vector []string, s string) bool { + for _, elem := range vector { + if elem == s { + return true + } + } + return false +} + +func setupGlobDirRoot(t *testing.T, fs Fs) string { + path := testDir(fs) + setupGlobFiles(t, fs, path) + return path +} + +func setupGlobDirReusePath(t *testing.T, fs Fs, path string) string { + testRegistry[fs] = append(testRegistry[fs], path) + return setupGlobFiles(t, fs, path) +} + +func setupGlobFiles(t *testing.T, fs Fs, path string) string { + testSubDir := filepath.Join(path, "globs", "bobs") + err := fs.MkdirAll(testSubDir, 0700) + if err != nil && !os.IsExist(err) { + t.Fatal(err) + } + + f, err := fs.Create(filepath.Join(testSubDir, "/matcher")) + if err != nil { + t.Fatal(err) + } + f.WriteString("Testfile 1 content") + f.Close() + + f, err = fs.Create(filepath.Join(testSubDir, "/../submatcher")) + if err != nil { + t.Fatal(err) + } + f.WriteString("Testfile 2 content") + f.Close() + + f, err = fs.Create(filepath.Join(testSubDir, "/../../match")) + if err != nil { + t.Fatal(err) + } + f.WriteString("Testfile 3 content") + f.Close() + + return testSubDir +} + +func TestGlob(t *testing.T) { + defer removeAllTestFiles(t) + var testDir string + for i, fs := range Fss { + if i == 0 { + testDir = setupGlobDirRoot(t, fs) + } else { + setupGlobDirReusePath(t, fs, testDir) + } + } + + var globTests = []struct { + pattern, result string + }{ + {testDir + "/globs/bobs/matcher", testDir + "/globs/bobs/matcher"}, + {testDir + "/globs/*/mat?her", testDir + "/globs/bobs/matcher"}, + {testDir + "/globs/bobs/../*", testDir + "/globs/submatcher"}, + {testDir + "/match", testDir + "/match"}, + } + + for _, fs := range Fss { + + for _, tt := range globTests { + pattern := tt.pattern + result := tt.result + if runtime.GOOS == "windows" { + pattern = filepath.Clean(pattern) + result = filepath.Clean(result) + } + matches, err := Glob(fs, pattern) + if err != nil { + t.Errorf("Glob error for %q: %s", pattern, err) + continue + } + if !contains(matches, result) { + t.Errorf("Glob(%#q) = %#v want %v", pattern, matches, result) + } + } + for _, pattern := range []string{"no_match", "../*/no_match"} { + matches, err := Glob(fs, pattern) + if err != nil { + t.Errorf("Glob error for %q: %s", pattern, err) + continue + } + if len(matches) != 0 { + t.Errorf("Glob(%#q) = %#v want []", pattern, matches) + } + } + + } +} + +func TestGlobSymlink(t *testing.T) { + defer removeAllTestFiles(t) + + fs := &OsFs{} + testDir := setupGlobDirRoot(t, fs) + + err := os.Symlink("target", filepath.Join(testDir, "symlink")) + if err != nil { + t.Skipf("skipping on %s", runtime.GOOS) + } + + var globSymlinkTests = []struct { + path, dest string + brokenLink bool + }{ + {"test1", "link1", false}, + {"test2", "link2", true}, + } + + for _, tt := range globSymlinkTests { + path := filepath.Join(testDir, tt.path) + dest := filepath.Join(testDir, tt.dest) + f, err := fs.Create(path) + if err != nil { + t.Fatal(err) + } + if err := f.Close(); err != nil { + t.Fatal(err) + } + err = os.Symlink(path, dest) + if err != nil { + t.Fatal(err) + } + if tt.brokenLink { + // Break the symlink. + fs.Remove(path) + } + matches, err := Glob(fs, dest) + if err != nil { + t.Errorf("GlobSymlink error for %q: %s", dest, err) + } + if !contains(matches, dest) { + t.Errorf("Glob(%#q) = %#v want %v", dest, matches, dest) + } + } +} + + +func TestGlobError(t *testing.T) { + for _, fs := range Fss { + _, err := Glob(fs, "[7]") + if err != nil { + t.Error("expected error for bad pattern; got none") + } + } +} diff --git a/vendor/github.com/spf13/afero/mem/dir.go b/vendor/github.com/spf13/afero/mem/dir.go new file mode 100644 index 0000000000..e104013f45 --- /dev/null +++ b/vendor/github.com/spf13/afero/mem/dir.go @@ -0,0 +1,37 @@ +// Copyright © 2014 Steve Francia . +// +// 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 mem + +type Dir interface { + Len() int + Names() []string + Files() []*FileData + Add(*FileData) + Remove(*FileData) +} + +func RemoveFromMemDir(dir *FileData, f *FileData) { + dir.memDir.Remove(f) +} + +func AddToMemDir(dir *FileData, f *FileData) { + dir.memDir.Add(f) +} + +func InitializeDir(d *FileData) { + if d.memDir == nil { + d.dir = true + d.memDir = &DirMap{} + } +} diff --git a/vendor/github.com/spf13/afero/mem/dirmap.go b/vendor/github.com/spf13/afero/mem/dirmap.go new file mode 100644 index 0000000000..03a57ee5b5 --- /dev/null +++ b/vendor/github.com/spf13/afero/mem/dirmap.go @@ -0,0 +1,43 @@ +// Copyright © 2015 Steve Francia . +// +// 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 mem + +import "sort" + +type DirMap map[string]*FileData + +func (m DirMap) Len() int { return len(m) } +func (m DirMap) Add(f *FileData) { m[f.name] = f } +func (m DirMap) Remove(f *FileData) { delete(m, f.name) } +func (m DirMap) Files() (files []*FileData) { + for _, f := range m { + files = append(files, f) + } + sort.Sort(filesSorter(files)) + return files +} + +// implement sort.Interface for []*FileData +type filesSorter []*FileData + +func (s filesSorter) Len() int { return len(s) } +func (s filesSorter) Swap(i, j int) { s[i], s[j] = s[j], s[i] } +func (s filesSorter) Less(i, j int) bool { return s[i].name < s[j].name } + +func (m DirMap) Names() (names []string) { + for x := range m { + names = append(names, x) + } + return names +} diff --git a/vendor/github.com/spf13/afero/mem/file.go b/vendor/github.com/spf13/afero/mem/file.go new file mode 100644 index 0000000000..5401a3b7c0 --- /dev/null +++ b/vendor/github.com/spf13/afero/mem/file.go @@ -0,0 +1,311 @@ +// Copyright © 2015 Steve Francia . +// Copyright 2013 tsuru authors. All rights reserved. +// +// 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 mem + +import ( + "bytes" + "errors" + "io" + "os" + "path/filepath" + "sync" + "sync/atomic" +) + +import "time" + +const FilePathSeparator = string(filepath.Separator) + +type File struct { + // atomic requires 64-bit alignment for struct field access + at int64 + readDirCount int64 + closed bool + readOnly bool + fileData *FileData +} + +func NewFileHandle(data *FileData) *File { + return &File{fileData: data} +} + +func NewReadOnlyFileHandle(data *FileData) *File { + return &File{fileData: data, readOnly: true} +} + +func (f File) Data() *FileData { + return f.fileData +} + +type FileData struct { + sync.Mutex + name string + data []byte + memDir Dir + dir bool + mode os.FileMode + modtime time.Time +} + +func (d *FileData) Name() string { + d.Lock() + defer d.Unlock() + return d.name +} + +func CreateFile(name string) *FileData { + return &FileData{name: name, mode: os.ModeTemporary, modtime: time.Now()} +} + +func CreateDir(name string) *FileData { + return &FileData{name: name, memDir: &DirMap{}, dir: true} +} + +func ChangeFileName(f *FileData, newname string) { + f.Lock() + f.name = newname + f.Unlock() +} + +func SetMode(f *FileData, mode os.FileMode) { + f.Lock() + f.mode = mode + f.Unlock() +} + +func SetModTime(f *FileData, mtime time.Time) { + f.Lock() + setModTime(f, mtime) + f.Unlock() +} + +func setModTime(f *FileData, mtime time.Time) { + f.modtime = mtime +} + +func GetFileInfo(f *FileData) *FileInfo { + return &FileInfo{f} +} + +func (f *File) Open() error { + atomic.StoreInt64(&f.at, 0) + atomic.StoreInt64(&f.readDirCount, 0) + f.fileData.Lock() + f.closed = false + f.fileData.Unlock() + return nil +} + +func (f *File) Close() error { + f.fileData.Lock() + f.closed = true + if !f.readOnly { + setModTime(f.fileData, time.Now()) + } + f.fileData.Unlock() + return nil +} + +func (f *File) Name() string { + return f.fileData.Name() +} + +func (f *File) Stat() (os.FileInfo, error) { + return &FileInfo{f.fileData}, nil +} + +func (f *File) Sync() error { + return nil +} + +func (f *File) Readdir(count int) (res []os.FileInfo, err error) { + var outLength int64 + + f.fileData.Lock() + files := f.fileData.memDir.Files()[f.readDirCount:] + if count > 0 { + if len(files) < count { + outLength = int64(len(files)) + } else { + outLength = int64(count) + } + if len(files) == 0 { + err = io.EOF + } + } else { + outLength = int64(len(files)) + } + f.readDirCount += outLength + f.fileData.Unlock() + + res = make([]os.FileInfo, outLength) + for i := range res { + res[i] = &FileInfo{files[i]} + } + + return res, err +} + +func (f *File) Readdirnames(n int) (names []string, err error) { + fi, err := f.Readdir(n) + names = make([]string, len(fi)) + for i, f := range fi { + _, names[i] = filepath.Split(f.Name()) + } + return names, err +} + +func (f *File) Read(b []byte) (n int, err error) { + f.fileData.Lock() + defer f.fileData.Unlock() + if f.closed == true { + return 0, ErrFileClosed + } + if len(b) > 0 && int(f.at) == len(f.fileData.data) { + return 0, io.EOF + } + if len(f.fileData.data)-int(f.at) >= len(b) { + n = len(b) + } else { + n = len(f.fileData.data) - int(f.at) + } + copy(b, f.fileData.data[f.at:f.at+int64(n)]) + atomic.AddInt64(&f.at, int64(n)) + return +} + +func (f *File) ReadAt(b []byte, off int64) (n int, err error) { + atomic.StoreInt64(&f.at, off) + return f.Read(b) +} + +func (f *File) Truncate(size int64) error { + if f.closed == true { + return ErrFileClosed + } + if f.readOnly { + return &os.PathError{Op: "truncate", Path: f.fileData.name, Err: errors.New("file handle is read only")} + } + if size < 0 { + return ErrOutOfRange + } + if size > int64(len(f.fileData.data)) { + diff := size - int64(len(f.fileData.data)) + f.fileData.data = append(f.fileData.data, bytes.Repeat([]byte{00}, int(diff))...) + } else { + f.fileData.data = f.fileData.data[0:size] + } + setModTime(f.fileData, time.Now()) + return nil +} + +func (f *File) Seek(offset int64, whence int) (int64, error) { + if f.closed == true { + return 0, ErrFileClosed + } + switch whence { + case 0: + atomic.StoreInt64(&f.at, offset) + case 1: + atomic.AddInt64(&f.at, int64(offset)) + case 2: + atomic.StoreInt64(&f.at, int64(len(f.fileData.data))+offset) + } + return f.at, nil +} + +func (f *File) Write(b []byte) (n int, err error) { + if f.readOnly { + return 0, &os.PathError{Op: "write", Path: f.fileData.name, Err: errors.New("file handle is read only")} + } + n = len(b) + cur := atomic.LoadInt64(&f.at) + f.fileData.Lock() + defer f.fileData.Unlock() + diff := cur - int64(len(f.fileData.data)) + var tail []byte + if n+int(cur) < len(f.fileData.data) { + tail = f.fileData.data[n+int(cur):] + } + if diff > 0 { + f.fileData.data = append(bytes.Repeat([]byte{00}, int(diff)), b...) + f.fileData.data = append(f.fileData.data, tail...) + } else { + f.fileData.data = append(f.fileData.data[:cur], b...) + f.fileData.data = append(f.fileData.data, tail...) + } + setModTime(f.fileData, time.Now()) + + atomic.StoreInt64(&f.at, int64(len(f.fileData.data))) + return +} + +func (f *File) WriteAt(b []byte, off int64) (n int, err error) { + atomic.StoreInt64(&f.at, off) + return f.Write(b) +} + +func (f *File) WriteString(s string) (ret int, err error) { + return f.Write([]byte(s)) +} + +func (f *File) Info() *FileInfo { + return &FileInfo{f.fileData} +} + +type FileInfo struct { + *FileData +} + +// Implements os.FileInfo +func (s *FileInfo) Name() string { + s.Lock() + _, name := filepath.Split(s.name) + s.Unlock() + return name +} +func (s *FileInfo) Mode() os.FileMode { + s.Lock() + defer s.Unlock() + return s.mode +} +func (s *FileInfo) ModTime() time.Time { + s.Lock() + defer s.Unlock() + return s.modtime +} +func (s *FileInfo) IsDir() bool { + s.Lock() + defer s.Unlock() + return s.dir +} +func (s *FileInfo) Sys() interface{} { return nil } +func (s *FileInfo) Size() int64 { + if s.IsDir() { + return int64(42) + } + s.Lock() + defer s.Unlock() + return int64(len(s.data)) +} + +var ( + ErrFileClosed = errors.New("File is closed") + ErrOutOfRange = errors.New("Out of range") + ErrTooLarge = errors.New("Too large") + ErrFileNotFound = os.ErrNotExist + ErrFileExists = os.ErrExist + ErrDestinationExists = os.ErrExist +) diff --git a/vendor/github.com/spf13/afero/mem/file_test.go b/vendor/github.com/spf13/afero/mem/file_test.go new file mode 100644 index 0000000000..5769067a73 --- /dev/null +++ b/vendor/github.com/spf13/afero/mem/file_test.go @@ -0,0 +1,154 @@ +package mem + +import ( + "testing" + "time" +) + +func TestFileDataNameRace(t *testing.T) { + t.Parallel() + const someName = "someName" + const someOtherName = "someOtherName" + d := FileData{ + name: someName, + } + + if d.Name() != someName { + t.Errorf("Failed to read correct Name, was %v", d.Name()) + } + + ChangeFileName(&d, someOtherName) + if d.Name() != someOtherName { + t.Errorf("Failed to set Name, was %v", d.Name()) + } + + go func() { + ChangeFileName(&d, someName) + }() + + if d.Name() != someName && d.Name() != someOtherName { + t.Errorf("Failed to read either Name, was %v", d.Name()) + } +} + +func TestFileDataModTimeRace(t *testing.T) { + t.Parallel() + someTime := time.Now() + someOtherTime := someTime.Add(1 * time.Minute) + + d := FileData{ + modtime: someTime, + } + + s := FileInfo{ + FileData: &d, + } + + if s.ModTime() != someTime { + t.Errorf("Failed to read correct value, was %v", s.ModTime()) + } + + SetModTime(&d, someOtherTime) + if s.ModTime() != someOtherTime { + t.Errorf("Failed to set ModTime, was %v", s.ModTime()) + } + + go func() { + SetModTime(&d, someTime) + }() + + if s.ModTime() != someTime && s.ModTime() != someOtherTime { + t.Errorf("Failed to read either modtime, was %v", s.ModTime()) + } +} + +func TestFileDataModeRace(t *testing.T) { + t.Parallel() + const someMode = 0777 + const someOtherMode = 0660 + + d := FileData{ + mode: someMode, + } + + s := FileInfo{ + FileData: &d, + } + + if s.Mode() != someMode { + t.Errorf("Failed to read correct value, was %v", s.Mode()) + } + + SetMode(&d, someOtherMode) + if s.Mode() != someOtherMode { + t.Errorf("Failed to set Mode, was %v", s.Mode()) + } + + go func() { + SetMode(&d, someMode) + }() + + if s.Mode() != someMode && s.Mode() != someOtherMode { + t.Errorf("Failed to read either mode, was %v", s.Mode()) + } +} + +func TestFileDataIsDirRace(t *testing.T) { + t.Parallel() + + d := FileData{ + dir: true, + } + + s := FileInfo{ + FileData: &d, + } + + if s.IsDir() != true { + t.Errorf("Failed to read correct value, was %v", s.IsDir()) + } + + go func() { + s.Lock() + d.dir = false + s.Unlock() + }() + + //just logging the value to trigger a read: + t.Logf("Value is %v", s.IsDir()) +} + +func TestFileDataSizeRace(t *testing.T) { + t.Parallel() + + const someData = "Hello" + const someOtherDataSize = "Hello World" + + d := FileData{ + data: []byte(someData), + dir: false, + } + + s := FileInfo{ + FileData: &d, + } + + if s.Size() != int64(len(someData)) { + t.Errorf("Failed to read correct value, was %v", s.Size()) + } + + go func() { + s.Lock() + d.data = []byte(someOtherDataSize) + s.Unlock() + }() + + //just logging the value to trigger a read: + t.Logf("Value is %v", s.Size()) + + //Testing the Dir size case + d.dir = true + if s.Size() != int64(42) { + t.Errorf("Failed to read correct value for dir, was %v", s.Size()) + } +} diff --git a/vendor/github.com/spf13/afero/memmap.go b/vendor/github.com/spf13/afero/memmap.go new file mode 100644 index 0000000000..09498e70fb --- /dev/null +++ b/vendor/github.com/spf13/afero/memmap.go @@ -0,0 +1,365 @@ +// Copyright © 2014 Steve Francia . +// +// 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 afero + +import ( + "fmt" + "log" + "os" + "path/filepath" + "strings" + "sync" + "time" + + "github.com/spf13/afero/mem" +) + +type MemMapFs struct { + mu sync.RWMutex + data map[string]*mem.FileData + init sync.Once +} + +func NewMemMapFs() Fs { + return &MemMapFs{} +} + +func (m *MemMapFs) getData() map[string]*mem.FileData { + m.init.Do(func() { + m.data = make(map[string]*mem.FileData) + // Root should always exist, right? + // TODO: what about windows? + m.data[FilePathSeparator] = mem.CreateDir(FilePathSeparator) + }) + return m.data +} + +func (*MemMapFs) Name() string { return "MemMapFS" } + +func (m *MemMapFs) Create(name string) (File, error) { + name = normalizePath(name) + m.mu.Lock() + file := mem.CreateFile(name) + m.getData()[name] = file + m.registerWithParent(file) + m.mu.Unlock() + return mem.NewFileHandle(file), nil +} + +func (m *MemMapFs) unRegisterWithParent(fileName string) error { + f, err := m.lockfreeOpen(fileName) + if err != nil { + return err + } + parent := m.findParent(f) + if parent == nil { + log.Panic("parent of ", f.Name(), " is nil") + } + + parent.Lock() + mem.RemoveFromMemDir(parent, f) + parent.Unlock() + return nil +} + +func (m *MemMapFs) findParent(f *mem.FileData) *mem.FileData { + pdir, _ := filepath.Split(f.Name()) + pdir = filepath.Clean(pdir) + pfile, err := m.lockfreeOpen(pdir) + if err != nil { + return nil + } + return pfile +} + +func (m *MemMapFs) registerWithParent(f *mem.FileData) { + if f == nil { + return + } + parent := m.findParent(f) + if parent == nil { + pdir := filepath.Dir(filepath.Clean(f.Name())) + err := m.lockfreeMkdir(pdir, 0777) + if err != nil { + //log.Println("Mkdir error:", err) + return + } + parent, err = m.lockfreeOpen(pdir) + if err != nil { + //log.Println("Open after Mkdir error:", err) + return + } + } + + parent.Lock() + mem.InitializeDir(parent) + mem.AddToMemDir(parent, f) + parent.Unlock() +} + +func (m *MemMapFs) lockfreeMkdir(name string, perm os.FileMode) error { + name = normalizePath(name) + x, ok := m.getData()[name] + if ok { + // Only return ErrFileExists if it's a file, not a directory. + i := mem.FileInfo{FileData: x} + if !i.IsDir() { + return ErrFileExists + } + } else { + item := mem.CreateDir(name) + m.getData()[name] = item + m.registerWithParent(item) + } + return nil +} + +func (m *MemMapFs) Mkdir(name string, perm os.FileMode) error { + name = normalizePath(name) + + m.mu.RLock() + _, ok := m.getData()[name] + m.mu.RUnlock() + if ok { + return &os.PathError{Op: "mkdir", Path: name, Err: ErrFileExists} + } + + m.mu.Lock() + item := mem.CreateDir(name) + m.getData()[name] = item + m.registerWithParent(item) + m.mu.Unlock() + + m.Chmod(name, perm|os.ModeDir) + + return nil +} + +func (m *MemMapFs) MkdirAll(path string, perm os.FileMode) error { + err := m.Mkdir(path, perm) + if err != nil { + if err.(*os.PathError).Err == ErrFileExists { + return nil + } + return err + } + return nil +} + +// Handle some relative paths +func normalizePath(path string) string { + path = filepath.Clean(path) + + switch path { + case ".": + return FilePathSeparator + case "..": + return FilePathSeparator + default: + return path + } +} + +func (m *MemMapFs) Open(name string) (File, error) { + f, err := m.open(name) + if f != nil { + return mem.NewReadOnlyFileHandle(f), err + } + return nil, err +} + +func (m *MemMapFs) openWrite(name string) (File, error) { + f, err := m.open(name) + if f != nil { + return mem.NewFileHandle(f), err + } + return nil, err +} + +func (m *MemMapFs) open(name string) (*mem.FileData, error) { + name = normalizePath(name) + + m.mu.RLock() + f, ok := m.getData()[name] + m.mu.RUnlock() + if !ok { + return nil, &os.PathError{Op: "open", Path: name, Err: ErrFileNotFound} + } + return f, nil +} + +func (m *MemMapFs) lockfreeOpen(name string) (*mem.FileData, error) { + name = normalizePath(name) + f, ok := m.getData()[name] + if ok { + return f, nil + } else { + return nil, ErrFileNotFound + } +} + +func (m *MemMapFs) OpenFile(name string, flag int, perm os.FileMode) (File, error) { + chmod := false + file, err := m.openWrite(name) + if os.IsNotExist(err) && (flag&os.O_CREATE > 0) { + file, err = m.Create(name) + chmod = true + } + if err != nil { + return nil, err + } + if flag == os.O_RDONLY { + file = mem.NewReadOnlyFileHandle(file.(*mem.File).Data()) + } + if flag&os.O_APPEND > 0 { + _, err = file.Seek(0, os.SEEK_END) + if err != nil { + file.Close() + return nil, err + } + } + if flag&os.O_TRUNC > 0 && flag&(os.O_RDWR|os.O_WRONLY) > 0 { + err = file.Truncate(0) + if err != nil { + file.Close() + return nil, err + } + } + if chmod { + m.Chmod(name, perm) + } + return file, nil +} + +func (m *MemMapFs) Remove(name string) error { + name = normalizePath(name) + + m.mu.Lock() + defer m.mu.Unlock() + + if _, ok := m.getData()[name]; ok { + err := m.unRegisterWithParent(name) + if err != nil { + return &os.PathError{Op: "remove", Path: name, Err: err} + } + delete(m.getData(), name) + } else { + return &os.PathError{Op: "remove", Path: name, Err: os.ErrNotExist} + } + return nil +} + +func (m *MemMapFs) RemoveAll(path string) error { + path = normalizePath(path) + m.mu.Lock() + m.unRegisterWithParent(path) + m.mu.Unlock() + + m.mu.RLock() + defer m.mu.RUnlock() + + for p, _ := range m.getData() { + if strings.HasPrefix(p, path) { + m.mu.RUnlock() + m.mu.Lock() + delete(m.getData(), p) + m.mu.Unlock() + m.mu.RLock() + } + } + return nil +} + +func (m *MemMapFs) Rename(oldname, newname string) error { + oldname = normalizePath(oldname) + newname = normalizePath(newname) + + if oldname == newname { + return nil + } + + m.mu.RLock() + defer m.mu.RUnlock() + if _, ok := m.getData()[oldname]; ok { + m.mu.RUnlock() + m.mu.Lock() + m.unRegisterWithParent(oldname) + fileData := m.getData()[oldname] + delete(m.getData(), oldname) + mem.ChangeFileName(fileData, newname) + m.getData()[newname] = fileData + m.registerWithParent(fileData) + m.mu.Unlock() + m.mu.RLock() + } else { + return &os.PathError{Op: "rename", Path: oldname, Err: ErrFileNotFound} + } + return nil +} + +func (m *MemMapFs) Stat(name string) (os.FileInfo, error) { + f, err := m.Open(name) + if err != nil { + return nil, err + } + fi := mem.GetFileInfo(f.(*mem.File).Data()) + return fi, nil +} + +func (m *MemMapFs) Chmod(name string, mode os.FileMode) error { + name = normalizePath(name) + + m.mu.RLock() + f, ok := m.getData()[name] + m.mu.RUnlock() + if !ok { + return &os.PathError{Op: "chmod", Path: name, Err: ErrFileNotFound} + } + + m.mu.Lock() + mem.SetMode(f, mode) + m.mu.Unlock() + + return nil +} + +func (m *MemMapFs) Chtimes(name string, atime time.Time, mtime time.Time) error { + name = normalizePath(name) + + m.mu.RLock() + f, ok := m.getData()[name] + m.mu.RUnlock() + if !ok { + return &os.PathError{Op: "chtimes", Path: name, Err: ErrFileNotFound} + } + + m.mu.Lock() + mem.SetModTime(f, mtime) + m.mu.Unlock() + + return nil +} + +func (m *MemMapFs) List() { + for _, x := range m.data { + y := mem.FileInfo{FileData: x} + fmt.Println(x.Name(), y.Size()) + } +} + +// func debugMemMapList(fs Fs) { +// if x, ok := fs.(*MemMapFs); ok { +// x.List() +// } +// } diff --git a/vendor/github.com/spf13/afero/memmap_test.go b/vendor/github.com/spf13/afero/memmap_test.go new file mode 100644 index 0000000000..09d8680f67 --- /dev/null +++ b/vendor/github.com/spf13/afero/memmap_test.go @@ -0,0 +1,421 @@ +package afero + +import ( + "fmt" + "os" + "path/filepath" + "runtime" + "testing" + "time" +) + +func TestNormalizePath(t *testing.T) { + type test struct { + input string + expected string + } + + data := []test{ + {".", FilePathSeparator}, + {"./", FilePathSeparator}, + {"..", FilePathSeparator}, + {"../", FilePathSeparator}, + {"./..", FilePathSeparator}, + {"./../", FilePathSeparator}, + } + + for i, d := range data { + cpath := normalizePath(d.input) + if d.expected != cpath { + t.Errorf("Test %d failed. Expected %q got %q", i, d.expected, cpath) + } + } +} + +func TestPathErrors(t *testing.T) { + path := filepath.Join(".", "some", "path") + path2 := filepath.Join(".", "different", "path") + fs := NewMemMapFs() + perm := os.FileMode(0755) + + // relevant functions: + // func (m *MemMapFs) Chmod(name string, mode os.FileMode) error + // func (m *MemMapFs) Chtimes(name string, atime time.Time, mtime time.Time) error + // func (m *MemMapFs) Create(name string) (File, error) + // func (m *MemMapFs) Mkdir(name string, perm os.FileMode) error + // func (m *MemMapFs) MkdirAll(path string, perm os.FileMode) error + // func (m *MemMapFs) Open(name string) (File, error) + // func (m *MemMapFs) OpenFile(name string, flag int, perm os.FileMode) (File, error) + // func (m *MemMapFs) Remove(name string) error + // func (m *MemMapFs) Rename(oldname, newname string) error + // func (m *MemMapFs) Stat(name string) (os.FileInfo, error) + + err := fs.Chmod(path, perm) + checkPathError(t, err, "Chmod") + + err = fs.Chtimes(path, time.Now(), time.Now()) + checkPathError(t, err, "Chtimes") + + // fs.Create doesn't return an error + + err = fs.Mkdir(path2, perm) + if err != nil { + t.Error(err) + } + err = fs.Mkdir(path2, perm) + checkPathError(t, err, "Mkdir") + + err = fs.MkdirAll(path2, perm) + if err != nil { + t.Error("MkdirAll:", err) + } + + _, err = fs.Open(path) + checkPathError(t, err, "Open") + + _, err = fs.OpenFile(path, os.O_RDWR, perm) + checkPathError(t, err, "OpenFile") + + err = fs.Remove(path) + checkPathError(t, err, "Remove") + + err = fs.RemoveAll(path) + if err != nil { + t.Error("RemoveAll:", err) + } + + err = fs.Rename(path, path2) + checkPathError(t, err, "Rename") + + _, err = fs.Stat(path) + checkPathError(t, err, "Stat") +} + +func checkPathError(t *testing.T, err error, op string) { + pathErr, ok := err.(*os.PathError) + if !ok { + t.Error(op+":", err, "is not a os.PathError") + return + } + _, ok = pathErr.Err.(*os.PathError) + if ok { + t.Error(op+":", err, "contains another os.PathError") + } +} + +// Ensure Permissions are set on OpenFile/Mkdir/MkdirAll +func TestPermSet(t *testing.T) { + const fileName = "/myFileTest" + const dirPath = "/myDirTest" + const dirPathAll = "/my/path/to/dir" + + const fileMode = os.FileMode(0765) + // directories will also have the directory bit set + const dirMode = fileMode | os.ModeDir + + fs := NewMemMapFs() + + // Test Openfile + f, err := fs.OpenFile(fileName, os.O_CREATE, fileMode) + if err != nil { + t.Errorf("OpenFile Create failed: %s", err) + return + } + f.Close() + + s, err := fs.Stat(fileName) + if err != nil { + t.Errorf("Stat failed: %s", err) + return + } + if s.Mode().String() != fileMode.String() { + t.Errorf("Permissions Incorrect: %s != %s", s.Mode().String(), fileMode.String()) + return + } + + // Test Mkdir + err = fs.Mkdir(dirPath, dirMode) + if err != nil { + t.Errorf("MkDir Create failed: %s", err) + return + } + s, err = fs.Stat(dirPath) + if err != nil { + t.Errorf("Stat failed: %s", err) + return + } + // sets File + if s.Mode().String() != dirMode.String() { + t.Errorf("Permissions Incorrect: %s != %s", s.Mode().String(), dirMode.String()) + return + } + + // Test MkdirAll + err = fs.MkdirAll(dirPathAll, dirMode) + if err != nil { + t.Errorf("MkDir Create failed: %s", err) + return + } + s, err = fs.Stat(dirPathAll) + if err != nil { + t.Errorf("Stat failed: %s", err) + return + } + if s.Mode().String() != dirMode.String() { + t.Errorf("Permissions Incorrect: %s != %s", s.Mode().String(), dirMode.String()) + return + } +} + +// Fails if multiple file objects use the same file.at counter in MemMapFs +func TestMultipleOpenFiles(t *testing.T) { + defer removeAllTestFiles(t) + const fileName = "afero-demo2.txt" + + var data = make([][]byte, len(Fss)) + + for i, fs := range Fss { + dir := testDir(fs) + path := filepath.Join(dir, fileName) + fh1, err := fs.Create(path) + if err != nil { + t.Error("fs.Create failed: " + err.Error()) + } + _, err = fh1.Write([]byte("test")) + if err != nil { + t.Error("fh.Write failed: " + err.Error()) + } + _, err = fh1.Seek(0, os.SEEK_SET) + if err != nil { + t.Error(err) + } + + fh2, err := fs.OpenFile(path, os.O_RDWR, 0777) + if err != nil { + t.Error("fs.OpenFile failed: " + err.Error()) + } + _, err = fh2.Seek(0, os.SEEK_END) + if err != nil { + t.Error(err) + } + _, err = fh2.Write([]byte("data")) + if err != nil { + t.Error(err) + } + err = fh2.Close() + if err != nil { + t.Error(err) + } + + _, err = fh1.Write([]byte("data")) + if err != nil { + t.Error(err) + } + err = fh1.Close() + if err != nil { + t.Error(err) + } + // the file now should contain "datadata" + data[i], err = ReadFile(fs, path) + if err != nil { + t.Error(err) + } + } + + for i, fs := range Fss { + if i == 0 { + continue + } + if string(data[0]) != string(data[i]) { + t.Errorf("%s and %s don't behave the same\n"+ + "%s: \"%s\"\n%s: \"%s\"\n", + Fss[0].Name(), fs.Name(), Fss[0].Name(), data[0], fs.Name(), data[i]) + } + } +} + +// Test if file.Write() fails when opened as read only +func TestReadOnly(t *testing.T) { + defer removeAllTestFiles(t) + const fileName = "afero-demo.txt" + + for _, fs := range Fss { + dir := testDir(fs) + path := filepath.Join(dir, fileName) + + f, err := fs.Create(path) + if err != nil { + t.Error(fs.Name()+":", "fs.Create failed: "+err.Error()) + } + _, err = f.Write([]byte("test")) + if err != nil { + t.Error(fs.Name()+":", "Write failed: "+err.Error()) + } + f.Close() + + f, err = fs.Open(path) + if err != nil { + t.Error("fs.Open failed: " + err.Error()) + } + _, err = f.Write([]byte("data")) + if err == nil { + t.Error(fs.Name()+":", "No write error") + } + f.Close() + + f, err = fs.OpenFile(path, os.O_RDONLY, 0644) + if err != nil { + t.Error("fs.Open failed: " + err.Error()) + } + _, err = f.Write([]byte("data")) + if err == nil { + t.Error(fs.Name()+":", "No write error") + } + f.Close() + } +} + +func TestWriteCloseTime(t *testing.T) { + defer removeAllTestFiles(t) + const fileName = "afero-demo.txt" + + for _, fs := range Fss { + dir := testDir(fs) + path := filepath.Join(dir, fileName) + + f, err := fs.Create(path) + if err != nil { + t.Error(fs.Name()+":", "fs.Create failed: "+err.Error()) + } + f.Close() + + f, err = fs.Create(path) + if err != nil { + t.Error(fs.Name()+":", "fs.Create failed: "+err.Error()) + } + fi, err := f.Stat() + if err != nil { + t.Error(fs.Name()+":", "Stat failed: "+err.Error()) + } + timeBefore := fi.ModTime() + + // sorry for the delay, but we have to make sure time advances, + // also on non Un*x systems... + switch runtime.GOOS { + case "windows": + time.Sleep(2 * time.Second) + case "darwin": + time.Sleep(1 * time.Second) + default: // depending on the FS, this may work with < 1 second, on my old ext3 it does not + time.Sleep(1 * time.Second) + } + + _, err = f.Write([]byte("test")) + if err != nil { + t.Error(fs.Name()+":", "Write failed: "+err.Error()) + } + f.Close() + fi, err = fs.Stat(path) + if err != nil { + t.Error(fs.Name()+":", "fs.Stat failed: "+err.Error()) + } + if fi.ModTime().Equal(timeBefore) { + t.Error(fs.Name()+":", "ModTime was not set on Close()") + } + } +} + +// This test should be run with the race detector on: +// go test -race -v -timeout 10s -run TestRacingDeleteAndClose +func TestRacingDeleteAndClose(t *testing.T) { + fs := NewMemMapFs() + pathname := "testfile" + f, err := fs.Create(pathname) + if err != nil { + t.Fatal(err) + } + + in := make(chan bool) + + go func() { + <-in + f.Close() + }() + go func() { + <-in + fs.Remove(pathname) + }() + close(in) +} + +// This test should be run with the race detector on: +// go test -run TestMemFsDataRace -race +func TestMemFsDataRace(t *testing.T) { + const dir = "test_dir" + fs := NewMemMapFs() + + if err := fs.MkdirAll(dir, 0777); err != nil { + t.Fatal(err) + } + + const n = 1000 + done := make(chan struct{}) + + go func() { + defer close(done) + for i := 0; i < n; i++ { + fname := filepath.Join(dir, fmt.Sprintf("%d.txt", i)) + if err := WriteFile(fs, fname, []byte(""), 0777); err != nil { + panic(err) + } + if err := fs.Remove(fname); err != nil { + panic(err) + } + } + }() + +loop: + for { + select { + case <-done: + break loop + default: + _, err := ReadDir(fs, dir) + if err != nil { + t.Fatal(err) + } + } + } +} + +func TestMemFsDirMode(t *testing.T) { + fs := NewMemMapFs() + err := fs.Mkdir("/testDir1", 0644) + if err != nil { + t.Error(err) + } + err = fs.MkdirAll("/sub/testDir2", 0644) + if err != nil { + t.Error(err) + } + info, err := fs.Stat("/testDir1") + if err != nil { + t.Error(err) + } + if !info.IsDir() { + t.Error("should be a directory") + } + if !info.Mode().IsDir() { + t.Error("FileMode is not directory") + } + info, err = fs.Stat("/sub/testDir2") + if err != nil { + t.Error(err) + } + if !info.IsDir() { + t.Error("should be a directory") + } + if !info.Mode().IsDir() { + t.Error("FileMode is not directory") + } +} diff --git a/vendor/github.com/spf13/afero/os.go b/vendor/github.com/spf13/afero/os.go new file mode 100644 index 0000000000..6b8bce1c50 --- /dev/null +++ b/vendor/github.com/spf13/afero/os.go @@ -0,0 +1,94 @@ +// Copyright © 2014 Steve Francia . +// Copyright 2013 tsuru authors. All rights reserved. +// +// 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 afero + +import ( + "os" + "time" +) + +// OsFs is a Fs implementation that uses functions provided by the os package. +// +// For details in any method, check the documentation of the os package +// (http://golang.org/pkg/os/). +type OsFs struct{} + +func NewOsFs() Fs { + return &OsFs{} +} + +func (OsFs) Name() string { return "OsFs" } + +func (OsFs) Create(name string) (File, error) { + f, e := os.Create(name) + if f == nil { + // while this looks strange, we need to return a bare nil (of type nil) not + // a nil value of type *os.File or nil won't be nil + return nil, e + } + return f, e +} + +func (OsFs) Mkdir(name string, perm os.FileMode) error { + return os.Mkdir(name, perm) +} + +func (OsFs) MkdirAll(path string, perm os.FileMode) error { + return os.MkdirAll(path, perm) +} + +func (OsFs) Open(name string) (File, error) { + f, e := os.Open(name) + if f == nil { + // while this looks strange, we need to return a bare nil (of type nil) not + // a nil value of type *os.File or nil won't be nil + return nil, e + } + return f, e +} + +func (OsFs) OpenFile(name string, flag int, perm os.FileMode) (File, error) { + f, e := os.OpenFile(name, flag, perm) + if f == nil { + // while this looks strange, we need to return a bare nil (of type nil) not + // a nil value of type *os.File or nil won't be nil + return nil, e + } + return f, e +} + +func (OsFs) Remove(name string) error { + return os.Remove(name) +} + +func (OsFs) RemoveAll(path string) error { + return os.RemoveAll(path) +} + +func (OsFs) Rename(oldname, newname string) error { + return os.Rename(oldname, newname) +} + +func (OsFs) Stat(name string) (os.FileInfo, error) { + return os.Stat(name) +} + +func (OsFs) Chmod(name string, mode os.FileMode) error { + return os.Chmod(name, mode) +} + +func (OsFs) Chtimes(name string, atime time.Time, mtime time.Time) error { + return os.Chtimes(name, atime, mtime) +} diff --git a/vendor/github.com/spf13/afero/path.go b/vendor/github.com/spf13/afero/path.go new file mode 100644 index 0000000000..1d90e46dd0 --- /dev/null +++ b/vendor/github.com/spf13/afero/path.go @@ -0,0 +1,108 @@ +// Copyright ©2015 The Go Authors +// Copyright ©2015 Steve Francia +// +// 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 afero + +import ( + "os" + "path/filepath" + "sort" +) + +// readDirNames reads the directory named by dirname and returns +// a sorted list of directory entries. +// adapted from https://golang.org/src/path/filepath/path.go +func readDirNames(fs Fs, dirname string) ([]string, error) { + f, err := fs.Open(dirname) + if err != nil { + return nil, err + } + names, err := f.Readdirnames(-1) + f.Close() + if err != nil { + return nil, err + } + sort.Strings(names) + return names, nil +} + +// walk recursively descends path, calling walkFn +// adapted from https://golang.org/src/path/filepath/path.go +func walk(fs Fs, path string, info os.FileInfo, walkFn filepath.WalkFunc) error { + err := walkFn(path, info, nil) + if err != nil { + if info.IsDir() && err == filepath.SkipDir { + return nil + } + return err + } + + if !info.IsDir() { + return nil + } + + names, err := readDirNames(fs, path) + if err != nil { + return walkFn(path, info, err) + } + + for _, name := range names { + filename := filepath.Join(path, name) + fileInfo, err := lstatIfOs(fs, filename) + if err != nil { + if err := walkFn(filename, fileInfo, err); err != nil && err != filepath.SkipDir { + return err + } + } else { + err = walk(fs, filename, fileInfo, walkFn) + if err != nil { + if !fileInfo.IsDir() || err != filepath.SkipDir { + return err + } + } + } + } + return nil +} + +// if the filesystem is OsFs use Lstat, else use fs.Stat +func lstatIfOs(fs Fs, path string) (info os.FileInfo, err error) { + _, ok := fs.(*OsFs) + if ok { + info, err = os.Lstat(path) + } else { + info, err = fs.Stat(path) + } + return +} + +// Walk walks the file tree rooted at root, calling walkFn for each file or +// directory in the tree, including root. All errors that arise visiting files +// and directories are filtered by walkFn. The files are walked in lexical +// order, which makes the output deterministic but means that for very +// large directories Walk can be inefficient. +// Walk does not follow symbolic links. + +func (a Afero) Walk(root string, walkFn filepath.WalkFunc) error { + return Walk(a.Fs, root, walkFn) +} + +func Walk(fs Fs, root string, walkFn filepath.WalkFunc) error { + info, err := lstatIfOs(fs, root) + if err != nil { + return walkFn(root, nil, err) + } + return walk(fs, root, info, walkFn) +} diff --git a/vendor/github.com/spf13/afero/path_test.go b/vendor/github.com/spf13/afero/path_test.go new file mode 100644 index 0000000000..104a6bcbe3 --- /dev/null +++ b/vendor/github.com/spf13/afero/path_test.go @@ -0,0 +1,69 @@ +// Copyright © 2014 Steve Francia . +// Copyright 2009 The Go Authors. All rights reserved. +// +// 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 afero + +import ( + "fmt" + "os" + "testing" +) + +func TestWalk(t *testing.T) { + defer removeAllTestFiles(t) + var testDir string + for i, fs := range Fss { + if i == 0 { + testDir = setupTestDirRoot(t, fs) + } else { + setupTestDirReusePath(t, fs, testDir) + } + } + + outputs := make([]string, len(Fss)) + for i, fs := range Fss { + walkFn := func(path string, info os.FileInfo, err error) error { + if err != nil { + t.Error("walkFn err:", err) + } + var size int64 + if !info.IsDir() { + size = info.Size() + } + outputs[i] += fmt.Sprintln(path, info.Name(), size, info.IsDir(), err) + return nil + } + err := Walk(fs, testDir, walkFn) + if err != nil { + t.Error(err) + } + } + fail := false + for i, o := range outputs { + if i == 0 { + continue + } + if o != outputs[i-1] { + fail = true + break + } + } + if fail { + t.Log("Walk outputs not equal!") + for i, o := range outputs { + t.Log(Fss[i].Name() + "\n" + o) + } + t.Fail() + } +} diff --git a/vendor/github.com/spf13/afero/readonlyfs.go b/vendor/github.com/spf13/afero/readonlyfs.go new file mode 100644 index 0000000000..f1fa55bcf4 --- /dev/null +++ b/vendor/github.com/spf13/afero/readonlyfs.go @@ -0,0 +1,70 @@ +package afero + +import ( + "os" + "syscall" + "time" +) + +type ReadOnlyFs struct { + source Fs +} + +func NewReadOnlyFs(source Fs) Fs { + return &ReadOnlyFs{source: source} +} + +func (r *ReadOnlyFs) ReadDir(name string) ([]os.FileInfo, error) { + return ReadDir(r.source, name) +} + +func (r *ReadOnlyFs) Chtimes(n string, a, m time.Time) error { + return syscall.EPERM +} + +func (r *ReadOnlyFs) Chmod(n string, m os.FileMode) error { + return syscall.EPERM +} + +func (r *ReadOnlyFs) Name() string { + return "ReadOnlyFilter" +} + +func (r *ReadOnlyFs) Stat(name string) (os.FileInfo, error) { + return r.source.Stat(name) +} + +func (r *ReadOnlyFs) Rename(o, n string) error { + return syscall.EPERM +} + +func (r *ReadOnlyFs) RemoveAll(p string) error { + return syscall.EPERM +} + +func (r *ReadOnlyFs) Remove(n string) error { + return syscall.EPERM +} + +func (r *ReadOnlyFs) OpenFile(name string, flag int, perm os.FileMode) (File, error) { + if flag&(os.O_WRONLY|syscall.O_RDWR|os.O_APPEND|os.O_CREATE|os.O_TRUNC) != 0 { + return nil, syscall.EPERM + } + return r.source.OpenFile(name, flag, perm) +} + +func (r *ReadOnlyFs) Open(n string) (File, error) { + return r.source.Open(n) +} + +func (r *ReadOnlyFs) Mkdir(n string, p os.FileMode) error { + return syscall.EPERM +} + +func (r *ReadOnlyFs) MkdirAll(n string, p os.FileMode) error { + return syscall.EPERM +} + +func (r *ReadOnlyFs) Create(n string) (File, error) { + return nil, syscall.EPERM +} diff --git a/vendor/github.com/spf13/afero/regexpfs.go b/vendor/github.com/spf13/afero/regexpfs.go new file mode 100644 index 0000000000..9d92dbc051 --- /dev/null +++ b/vendor/github.com/spf13/afero/regexpfs.go @@ -0,0 +1,214 @@ +package afero + +import ( + "os" + "regexp" + "syscall" + "time" +) + +// The RegexpFs filters files (not directories) by regular expression. Only +// files matching the given regexp will be allowed, all others get a ENOENT error ( +// "No such file or directory"). +// +type RegexpFs struct { + re *regexp.Regexp + source Fs +} + +func NewRegexpFs(source Fs, re *regexp.Regexp) Fs { + return &RegexpFs{source: source, re: re} +} + +type RegexpFile struct { + f File + re *regexp.Regexp +} + +func (r *RegexpFs) matchesName(name string) error { + if r.re == nil { + return nil + } + if r.re.MatchString(name) { + return nil + } + return syscall.ENOENT +} + +func (r *RegexpFs) dirOrMatches(name string) error { + dir, err := IsDir(r.source, name) + if err != nil { + return err + } + if dir { + return nil + } + return r.matchesName(name) +} + +func (r *RegexpFs) Chtimes(name string, a, m time.Time) error { + if err := r.dirOrMatches(name); err != nil { + return err + } + return r.source.Chtimes(name, a, m) +} + +func (r *RegexpFs) Chmod(name string, mode os.FileMode) error { + if err := r.dirOrMatches(name); err != nil { + return err + } + return r.source.Chmod(name, mode) +} + +func (r *RegexpFs) Name() string { + return "RegexpFs" +} + +func (r *RegexpFs) Stat(name string) (os.FileInfo, error) { + if err := r.dirOrMatches(name); err != nil { + return nil, err + } + return r.source.Stat(name) +} + +func (r *RegexpFs) Rename(oldname, newname string) error { + dir, err := IsDir(r.source, oldname) + if err != nil { + return err + } + if dir { + return nil + } + if err := r.matchesName(oldname); err != nil { + return err + } + if err := r.matchesName(newname); err != nil { + return err + } + return r.source.Rename(oldname, newname) +} + +func (r *RegexpFs) RemoveAll(p string) error { + dir, err := IsDir(r.source, p) + if err != nil { + return err + } + if !dir { + if err := r.matchesName(p); err != nil { + return err + } + } + return r.source.RemoveAll(p) +} + +func (r *RegexpFs) Remove(name string) error { + if err := r.dirOrMatches(name); err != nil { + return err + } + return r.source.Remove(name) +} + +func (r *RegexpFs) OpenFile(name string, flag int, perm os.FileMode) (File, error) { + if err := r.dirOrMatches(name); err != nil { + return nil, err + } + return r.source.OpenFile(name, flag, perm) +} + +func (r *RegexpFs) Open(name string) (File, error) { + dir, err := IsDir(r.source, name) + if err != nil { + return nil, err + } + if !dir { + if err := r.matchesName(name); err != nil { + return nil, err + } + } + f, err := r.source.Open(name) + return &RegexpFile{f: f, re: r.re}, nil +} + +func (r *RegexpFs) Mkdir(n string, p os.FileMode) error { + return r.source.Mkdir(n, p) +} + +func (r *RegexpFs) MkdirAll(n string, p os.FileMode) error { + return r.source.MkdirAll(n, p) +} + +func (r *RegexpFs) Create(name string) (File, error) { + if err := r.matchesName(name); err != nil { + return nil, err + } + return r.source.Create(name) +} + +func (f *RegexpFile) Close() error { + return f.f.Close() +} + +func (f *RegexpFile) Read(s []byte) (int, error) { + return f.f.Read(s) +} + +func (f *RegexpFile) ReadAt(s []byte, o int64) (int, error) { + return f.f.ReadAt(s, o) +} + +func (f *RegexpFile) Seek(o int64, w int) (int64, error) { + return f.f.Seek(o, w) +} + +func (f *RegexpFile) Write(s []byte) (int, error) { + return f.f.Write(s) +} + +func (f *RegexpFile) WriteAt(s []byte, o int64) (int, error) { + return f.f.WriteAt(s, o) +} + +func (f *RegexpFile) Name() string { + return f.f.Name() +} + +func (f *RegexpFile) Readdir(c int) (fi []os.FileInfo, err error) { + var rfi []os.FileInfo + rfi, err = f.f.Readdir(c) + if err != nil { + return nil, err + } + for _, i := range rfi { + if i.IsDir() || f.re.MatchString(i.Name()) { + fi = append(fi, i) + } + } + return fi, nil +} + +func (f *RegexpFile) Readdirnames(c int) (n []string, err error) { + fi, err := f.Readdir(c) + if err != nil { + return nil, err + } + for _, s := range fi { + n = append(n, s.Name()) + } + return n, nil +} + +func (f *RegexpFile) Stat() (os.FileInfo, error) { + return f.f.Stat() +} + +func (f *RegexpFile) Sync() error { + return f.f.Sync() +} + +func (f *RegexpFile) Truncate(s int64) error { + return f.f.Truncate(s) +} + +func (f *RegexpFile) WriteString(s string) (int, error) { + return f.f.WriteString(s) +} diff --git a/vendor/github.com/spf13/afero/ro_regexp_test.go b/vendor/github.com/spf13/afero/ro_regexp_test.go new file mode 100644 index 0000000000..ef8a35d0d9 --- /dev/null +++ b/vendor/github.com/spf13/afero/ro_regexp_test.go @@ -0,0 +1,96 @@ +package afero + +import ( + "regexp" + "testing" +) + +func TestFilterReadOnly(t *testing.T) { + fs := &ReadOnlyFs{source: &MemMapFs{}} + _, err := fs.Create("/file.txt") + if err == nil { + t.Errorf("Did not fail to create file") + } + // t.Logf("ERR=%s", err) +} + +func TestFilterReadonlyRemoveAndRead(t *testing.T) { + mfs := &MemMapFs{} + fh, err := mfs.Create("/file.txt") + fh.Write([]byte("content here")) + fh.Close() + + fs := NewReadOnlyFs(mfs) + err = fs.Remove("/file.txt") + if err == nil { + t.Errorf("Did not fail to remove file") + } + + fh, err = fs.Open("/file.txt") + if err != nil { + t.Errorf("Failed to open file: %s", err) + } + + buf := make([]byte, len("content here")) + _, err = fh.Read(buf) + fh.Close() + if string(buf) != "content here" { + t.Errorf("Failed to read file: %s", err) + } + + err = mfs.Remove("/file.txt") + if err != nil { + t.Errorf("Failed to remove file") + } + + fh, err = fs.Open("/file.txt") + if err == nil { + fh.Close() + t.Errorf("File still present") + } +} + +func TestFilterRegexp(t *testing.T) { + fs := NewRegexpFs(&MemMapFs{}, regexp.MustCompile(`\.txt$`)) + _, err := fs.Create("/file.html") + if err == nil { + + t.Errorf("Did not fail to create file") + } + // t.Logf("ERR=%s", err) +} + +func TestFilterRORegexpChain(t *testing.T) { + rofs := &ReadOnlyFs{source: &MemMapFs{}} + fs := &RegexpFs{re: regexp.MustCompile(`\.txt$`), source: rofs} + _, err := fs.Create("/file.txt") + if err == nil { + t.Errorf("Did not fail to create file") + } + // t.Logf("ERR=%s", err) +} + +func TestFilterRegexReadDir(t *testing.T) { + mfs := &MemMapFs{} + fs1 := &RegexpFs{re: regexp.MustCompile(`\.txt$`), source: mfs} + fs := &RegexpFs{re: regexp.MustCompile(`^a`), source: fs1} + + mfs.MkdirAll("/dir/sub", 0777) + for _, name := range []string{"afile.txt", "afile.html", "bfile.txt"} { + for _, dir := range []string{"/dir/", "/dir/sub/"} { + fh, _ := mfs.Create(dir + name) + fh.Close() + } + } + + files, _ := ReadDir(fs, "/dir") + if len(files) != 2 { // afile.txt, sub + t.Errorf("Got wrong number of files: %#v", files) + } + + f, _ := fs.Open("/dir/sub") + names, _ := f.Readdirnames(-1) + if len(names) != 1 { + t.Errorf("Got wrong number of names: %v", names) + } +} diff --git a/vendor/github.com/spf13/afero/sftpfs/file.go b/vendor/github.com/spf13/afero/sftpfs/file.go new file mode 100644 index 0000000000..e4ccb55c0c --- /dev/null +++ b/vendor/github.com/spf13/afero/sftpfs/file.go @@ -0,0 +1,95 @@ +// Copyright © 2015 Jerry Jacobs . +// +// 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 sftpfs + +import ( + "github.com/pkg/sftp" + "os" +) + +type File struct { + fd *sftp.File +} + +func FileOpen(s *sftp.Client, name string) (*File, error) { + fd, err := s.Open(name) + if err != nil { + return &File{}, err + } + return &File{fd: fd}, nil +} + +func FileCreate(s *sftp.Client, name string) (*File, error) { + fd, err := s.Create(name) + if err != nil { + return &File{}, err + } + return &File{fd: fd}, nil +} + +func (f *File) Close() error { + return f.fd.Close() +} + +func (f *File) Name() string { + return f.fd.Name() +} + +func (f *File) Stat() (os.FileInfo, error) { + return f.fd.Stat() +} + +func (f *File) Sync() error { + return nil +} + +func (f *File) Truncate(size int64) error { + return f.fd.Truncate(size) +} + +func (f *File) Read(b []byte) (n int, err error) { + return f.fd.Read(b) +} + +// TODO +func (f *File) ReadAt(b []byte, off int64) (n int, err error) { + return 0, nil +} + +// TODO +func (f *File) Readdir(count int) (res []os.FileInfo, err error) { + return nil, nil +} + +// TODO +func (f *File) Readdirnames(n int) (names []string, err error) { + return nil, nil +} + +func (f *File) Seek(offset int64, whence int) (int64, error) { + return f.fd.Seek(offset, whence) +} + +func (f *File) Write(b []byte) (n int, err error) { + return f.fd.Write(b) +} + +// TODO +func (f *File) WriteAt(b []byte, off int64) (n int, err error) { + return 0, nil +} + +func (f *File) WriteString(s string) (ret int, err error) { + return f.fd.Write([]byte(s)) +} diff --git a/vendor/github.com/spf13/afero/sftpfs/sftp.go b/vendor/github.com/spf13/afero/sftpfs/sftp.go new file mode 100644 index 0000000000..28721da761 --- /dev/null +++ b/vendor/github.com/spf13/afero/sftpfs/sftp.go @@ -0,0 +1,129 @@ +// Copyright © 2015 Jerry Jacobs . +// +// 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 sftpfs + +import ( + "os" + "time" + + "github.com/pkg/sftp" + "github.com/spf13/afero" +) + +// Fs is a afero.Fs implementation that uses functions provided by the sftp package. +// +// For details in any method, check the documentation of the sftp package +// (github.com/pkg/sftp). +type Fs struct { + client *sftp.Client +} + +func New(client *sftp.Client) afero.Fs { + return &Fs{client: client} +} + +func (s Fs) Name() string { return "sftpfs" } + +func (s Fs) Create(name string) (afero.File, error) { + return FileCreate(s.client, name) +} + +func (s Fs) Mkdir(name string, perm os.FileMode) error { + err := s.client.Mkdir(name) + if err != nil { + return err + } + return s.client.Chmod(name, perm) +} + +func (s Fs) MkdirAll(path string, perm os.FileMode) error { + // Fast path: if we can tell whether path is a directory or file, stop with success or error. + dir, err := s.Stat(path) + if err == nil { + if dir.IsDir() { + return nil + } + return err + } + + // Slow path: make sure parent exists and then call Mkdir for path. + i := len(path) + for i > 0 && os.IsPathSeparator(path[i-1]) { // Skip trailing path separator. + i-- + } + + j := i + for j > 0 && !os.IsPathSeparator(path[j-1]) { // Scan backward over element. + j-- + } + + if j > 1 { + // Create parent + err = s.MkdirAll(path[0:j-1], perm) + if err != nil { + return err + } + } + + // Parent now exists; invoke Mkdir and use its result. + err = s.Mkdir(path, perm) + if err != nil { + // Handle arguments like "foo/." by + // double-checking that directory doesn't exist. + dir, err1 := s.Lstat(path) + if err1 == nil && dir.IsDir() { + return nil + } + return err + } + return nil +} + +func (s Fs) Open(name string) (afero.File, error) { + return FileOpen(s.client, name) +} + +func (s Fs) OpenFile(name string, flag int, perm os.FileMode) (afero.File, error) { + return nil, nil +} + +func (s Fs) Remove(name string) error { + return s.client.Remove(name) +} + +func (s Fs) RemoveAll(path string) error { + // TODO have a look at os.RemoveAll + // https://github.com/golang/go/blob/master/src/os/path.go#L66 + return nil +} + +func (s Fs) Rename(oldname, newname string) error { + return s.client.Rename(oldname, newname) +} + +func (s Fs) Stat(name string) (os.FileInfo, error) { + return s.client.Stat(name) +} + +func (s Fs) Lstat(p string) (os.FileInfo, error) { + return s.client.Lstat(p) +} + +func (s Fs) Chmod(name string, mode os.FileMode) error { + return s.client.Chmod(name, mode) +} + +func (s Fs) Chtimes(name string, atime time.Time, mtime time.Time) error { + return s.client.Chtimes(name, atime, mtime) +} diff --git a/vendor/github.com/spf13/afero/sftpfs/sftp_test_go b/vendor/github.com/spf13/afero/sftpfs/sftp_test_go new file mode 100644 index 0000000000..bb00535d8d --- /dev/null +++ b/vendor/github.com/spf13/afero/sftpfs/sftp_test_go @@ -0,0 +1,286 @@ +// Copyright © 2015 Jerry Jacobs . +// +// 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 afero + +import ( + "testing" + "os" + "log" + "fmt" + "net" + "flag" + "time" + "io/ioutil" + "crypto/rsa" + _rand "crypto/rand" + "encoding/pem" + "crypto/x509" + + "golang.org/x/crypto/ssh" + "github.com/pkg/sftp" +) + +type SftpFsContext struct { + sshc *ssh.Client + sshcfg *ssh.ClientConfig + sftpc *sftp.Client +} + +// TODO we only connect with hardcoded user+pass for now +// it should be possible to use $HOME/.ssh/id_rsa to login into the stub sftp server +func SftpConnect(user, password, host string) (*SftpFsContext, error) { +/* + pemBytes, err := ioutil.ReadFile(os.Getenv("HOME") + "/.ssh/id_rsa") + if err != nil { + return nil,err + } + + signer, err := ssh.ParsePrivateKey(pemBytes) + if err != nil { + return nil,err + } + + sshcfg := &ssh.ClientConfig{ + User: user, + Auth: []ssh.AuthMethod{ + ssh.Password(password), + ssh.PublicKeys(signer), + }, + } +*/ + + sshcfg := &ssh.ClientConfig{ + User: user, + Auth: []ssh.AuthMethod{ + ssh.Password(password), + }, + } + + sshc, err := ssh.Dial("tcp", host, sshcfg) + if err != nil { + return nil,err + } + + sftpc, err := sftp.NewClient(sshc) + if err != nil { + return nil,err + } + + ctx := &SftpFsContext{ + sshc: sshc, + sshcfg: sshcfg, + sftpc: sftpc, + } + + return ctx,nil +} + +func (ctx *SftpFsContext) Disconnect() error { + ctx.sftpc.Close() + ctx.sshc.Close() + return nil +} + +// TODO for such a weird reason rootpath is "." when writing "file1" with afero sftp backend +func RunSftpServer(rootpath string) { + var ( + readOnly bool + debugLevelStr string + debugLevel int + debugStderr bool + rootDir string + ) + + flag.BoolVar(&readOnly, "R", false, "read-only server") + flag.BoolVar(&debugStderr, "e", true, "debug to stderr") + flag.StringVar(&debugLevelStr, "l", "none", "debug level") + flag.StringVar(&rootDir, "root", rootpath, "root directory") + flag.Parse() + + debugStream := ioutil.Discard + if debugStderr { + debugStream = os.Stderr + debugLevel = 1 + } + + // An SSH server is represented by a ServerConfig, which holds + // certificate details and handles authentication of ServerConns. + config := &ssh.ServerConfig{ + PasswordCallback: func(c ssh.ConnMetadata, pass []byte) (*ssh.Permissions, error) { + // Should use constant-time compare (or better, salt+hash) in + // a production setting. + fmt.Fprintf(debugStream, "Login: %s\n", c.User()) + if c.User() == "test" && string(pass) == "test" { + return nil, nil + } + return nil, fmt.Errorf("password rejected for %q", c.User()) + }, + } + + privateBytes, err := ioutil.ReadFile("./test/id_rsa") + if err != nil { + log.Fatal("Failed to load private key", err) + } + + private, err := ssh.ParsePrivateKey(privateBytes) + if err != nil { + log.Fatal("Failed to parse private key", err) + } + + config.AddHostKey(private) + + // Once a ServerConfig has been configured, connections can be + // accepted. + listener, err := net.Listen("tcp", "0.0.0.0:2022") + if err != nil { + log.Fatal("failed to listen for connection", err) + } + fmt.Printf("Listening on %v\n", listener.Addr()) + + nConn, err := listener.Accept() + if err != nil { + log.Fatal("failed to accept incoming connection", err) + } + + // Before use, a handshake must be performed on the incoming + // net.Conn. + _, chans, reqs, err := ssh.NewServerConn(nConn, config) + if err != nil { + log.Fatal("failed to handshake", err) + } + fmt.Fprintf(debugStream, "SSH server established\n") + + // The incoming Request channel must be serviced. + go ssh.DiscardRequests(reqs) + + // Service the incoming Channel channel. + for newChannel := range chans { + // Channels have a type, depending on the application level + // protocol intended. In the case of an SFTP session, this is "subsystem" + // with a payload string of "sftp" + fmt.Fprintf(debugStream, "Incoming channel: %s\n", newChannel.ChannelType()) + if newChannel.ChannelType() != "session" { + newChannel.Reject(ssh.UnknownChannelType, "unknown channel type") + fmt.Fprintf(debugStream, "Unknown channel type: %s\n", newChannel.ChannelType()) + continue + } + channel, requests, err := newChannel.Accept() + if err != nil { + log.Fatal("could not accept channel.", err) + } + fmt.Fprintf(debugStream, "Channel accepted\n") + + // Sessions have out-of-band requests such as "shell", + // "pty-req" and "env". Here we handle only the + // "subsystem" request. + go func(in <-chan *ssh.Request) { + for req := range in { + fmt.Fprintf(debugStream, "Request: %v\n", req.Type) + ok := false + switch req.Type { + case "subsystem": + fmt.Fprintf(debugStream, "Subsystem: %s\n", req.Payload[4:]) + if string(req.Payload[4:]) == "sftp" { + ok = true + } + } + fmt.Fprintf(debugStream, " - accepted: %v\n", ok) + req.Reply(ok, nil) + } + }(requests) + + server, err := sftp.NewServer(channel, channel, debugStream, debugLevel, readOnly, rootpath) + if err != nil { + log.Fatal(err) + } + if err := server.Serve(); err != nil { + log.Fatal("sftp server completed with error:", err) + } + } +} + +// MakeSSHKeyPair make a pair of public and private keys for SSH access. +// Public key is encoded in the format for inclusion in an OpenSSH authorized_keys file. +// Private Key generated is PEM encoded +func MakeSSHKeyPair(bits int, pubKeyPath, privateKeyPath string) error { + privateKey, err := rsa.GenerateKey(_rand.Reader, bits) + if err != nil { + return err + } + + // generate and write private key as PEM + privateKeyFile, err := os.Create(privateKeyPath) + defer privateKeyFile.Close() + if err != nil { + return err + } + + privateKeyPEM := &pem.Block{Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(privateKey)} + if err := pem.Encode(privateKeyFile, privateKeyPEM); err != nil { + return err + } + + // generate and write public key + pub, err := ssh.NewPublicKey(&privateKey.PublicKey) + if err != nil { + return err + } + + return ioutil.WriteFile(pubKeyPath, ssh.MarshalAuthorizedKey(pub), 0655) +} + +func TestSftpCreate(t *testing.T) { + os.Mkdir("./test", 0777) + MakeSSHKeyPair(1024, "./test/id_rsa.pub", "./test/id_rsa") + + go RunSftpServer("./test/") + time.Sleep(5 * time.Second) + + ctx, err := SftpConnect("test", "test", "localhost:2022") + if err != nil { + t.Fatal(err) + } + defer ctx.Disconnect() + + var AppFs Fs = SftpFs{ + SftpClient: ctx.sftpc, + } + + AppFs.MkdirAll("test/dir1/dir2/dir3", os.FileMode(0777)) + AppFs.Mkdir("test/foo", os.FileMode(0000)) + AppFs.Chmod("test/foo", os.FileMode(0700)) + AppFs.Mkdir("test/bar", os.FileMode(0777)) + + file, err := AppFs.Create("file1") + if err != nil { + t.Error(err) + } + defer file.Close() + + file.Write([]byte("hello\t")) + file.WriteString("world!\n") + + f1, err := AppFs.Open("file1") + if err != nil { + log.Fatalf("open: %v", err) + } + defer f1.Close() + + b := make([]byte, 100) + + _, err = f1.Read(b) + fmt.Println(string(b)) + + // TODO check here if "hello\tworld\n" is in buffer b +} diff --git a/vendor/github.com/spf13/afero/unionFile.go b/vendor/github.com/spf13/afero/unionFile.go new file mode 100644 index 0000000000..99f9e5db27 --- /dev/null +++ b/vendor/github.com/spf13/afero/unionFile.go @@ -0,0 +1,274 @@ +package afero + +import ( + "io" + "os" + "path/filepath" + "syscall" +) + +// The UnionFile implements the afero.File interface and will be returned +// when reading a directory present at least in the overlay or opening a file +// for writing. +// +// The calls to +// Readdir() and Readdirnames() merge the file os.FileInfo / names from the +// base and the overlay - for files present in both layers, only those +// from the overlay will be used. +// +// When opening files for writing (Create() / OpenFile() with the right flags) +// the operations will be done in both layers, starting with the overlay. A +// successful read in the overlay will move the cursor position in the base layer +// by the number of bytes read. +type UnionFile struct { + base File + layer File + off int + files []os.FileInfo +} + +func (f *UnionFile) Close() error { + // first close base, so we have a newer timestamp in the overlay. If we'd close + // the overlay first, we'd get a cacheStale the next time we access this file + // -> cache would be useless ;-) + if f.base != nil { + f.base.Close() + } + if f.layer != nil { + return f.layer.Close() + } + return BADFD +} + +func (f *UnionFile) Read(s []byte) (int, error) { + if f.layer != nil { + n, err := f.layer.Read(s) + if (err == nil || err == io.EOF) && f.base != nil { + // advance the file position also in the base file, the next + // call may be a write at this position (or a seek with SEEK_CUR) + if _, seekErr := f.base.Seek(int64(n), os.SEEK_CUR); seekErr != nil { + // only overwrite err in case the seek fails: we need to + // report an eventual io.EOF to the caller + err = seekErr + } + } + return n, err + } + if f.base != nil { + return f.base.Read(s) + } + return 0, BADFD +} + +func (f *UnionFile) ReadAt(s []byte, o int64) (int, error) { + if f.layer != nil { + n, err := f.layer.ReadAt(s, o) + if (err == nil || err == io.EOF) && f.base != nil { + _, err = f.base.Seek(o+int64(n), os.SEEK_SET) + } + return n, err + } + if f.base != nil { + return f.base.ReadAt(s, o) + } + return 0, BADFD +} + +func (f *UnionFile) Seek(o int64, w int) (pos int64, err error) { + if f.layer != nil { + pos, err = f.layer.Seek(o, w) + if (err == nil || err == io.EOF) && f.base != nil { + _, err = f.base.Seek(o, w) + } + return pos, err + } + if f.base != nil { + return f.base.Seek(o, w) + } + return 0, BADFD +} + +func (f *UnionFile) Write(s []byte) (n int, err error) { + if f.layer != nil { + n, err = f.layer.Write(s) + if err == nil && f.base != nil { // hmm, do we have fixed size files where a write may hit the EOF mark? + _, err = f.base.Write(s) + } + return n, err + } + if f.base != nil { + return f.base.Write(s) + } + return 0, BADFD +} + +func (f *UnionFile) WriteAt(s []byte, o int64) (n int, err error) { + if f.layer != nil { + n, err = f.layer.WriteAt(s, o) + if err == nil && f.base != nil { + _, err = f.base.WriteAt(s, o) + } + return n, err + } + if f.base != nil { + return f.base.WriteAt(s, o) + } + return 0, BADFD +} + +func (f *UnionFile) Name() string { + if f.layer != nil { + return f.layer.Name() + } + return f.base.Name() +} + +// Readdir will weave the two directories together and +// return a single view of the overlayed directories +func (f *UnionFile) Readdir(c int) (ofi []os.FileInfo, err error) { + if f.off == 0 { + var files = make(map[string]os.FileInfo) + var rfi []os.FileInfo + if f.layer != nil { + rfi, err = f.layer.Readdir(-1) + if err != nil { + return nil, err + } + for _, fi := range rfi { + files[fi.Name()] = fi + } + } + + if f.base != nil { + rfi, err = f.base.Readdir(-1) + if err != nil { + return nil, err + } + for _, fi := range rfi { + if _, exists := files[fi.Name()]; !exists { + files[fi.Name()] = fi + } + } + } + for _, fi := range files { + f.files = append(f.files, fi) + } + } + if c == -1 { + return f.files[f.off:], nil + } + defer func() { f.off += c }() + return f.files[f.off:c], nil +} + +func (f *UnionFile) Readdirnames(c int) ([]string, error) { + rfi, err := f.Readdir(c) + if err != nil { + return nil, err + } + var names []string + for _, fi := range rfi { + names = append(names, fi.Name()) + } + return names, nil +} + +func (f *UnionFile) Stat() (os.FileInfo, error) { + if f.layer != nil { + return f.layer.Stat() + } + if f.base != nil { + return f.base.Stat() + } + return nil, BADFD +} + +func (f *UnionFile) Sync() (err error) { + if f.layer != nil { + err = f.layer.Sync() + if err == nil && f.base != nil { + err = f.base.Sync() + } + return err + } + if f.base != nil { + return f.base.Sync() + } + return BADFD +} + +func (f *UnionFile) Truncate(s int64) (err error) { + if f.layer != nil { + err = f.layer.Truncate(s) + if err == nil && f.base != nil { + err = f.base.Truncate(s) + } + return err + } + if f.base != nil { + return f.base.Truncate(s) + } + return BADFD +} + +func (f *UnionFile) WriteString(s string) (n int, err error) { + if f.layer != nil { + n, err = f.layer.WriteString(s) + if err == nil && f.base != nil { + _, err = f.base.WriteString(s) + } + return n, err + } + if f.base != nil { + return f.base.WriteString(s) + } + return 0, BADFD +} + +func copyToLayer(base Fs, layer Fs, name string) error { + bfh, err := base.Open(name) + if err != nil { + return err + } + defer bfh.Close() + + // First make sure the directory exists + exists, err := Exists(layer, filepath.Dir(name)) + if err != nil { + return err + } + if !exists { + err = layer.MkdirAll(filepath.Dir(name), 0777) // FIXME? + if err != nil { + return err + } + } + + // Create the file on the overlay + lfh, err := layer.Create(name) + if err != nil { + return err + } + n, err := io.Copy(lfh, bfh) + if err != nil { + // If anything fails, clean up the file + layer.Remove(name) + lfh.Close() + return err + } + + bfi, err := bfh.Stat() + if err != nil || bfi.Size() != n { + layer.Remove(name) + lfh.Close() + return syscall.EIO + } + + err = lfh.Close() + if err != nil { + layer.Remove(name) + lfh.Close() + return err + } + return layer.Chtimes(name, bfi.ModTime(), bfi.ModTime()) +} diff --git a/vendor/github.com/spf13/afero/util.go b/vendor/github.com/spf13/afero/util.go new file mode 100644 index 0000000000..7463887fd8 --- /dev/null +++ b/vendor/github.com/spf13/afero/util.go @@ -0,0 +1,331 @@ +// Copyright ©2015 Steve Francia +// Portions Copyright ©2015 The Hugo Authors +// Portions Copyright 2016-present Bjørn Erik Pedersen +// +// 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 afero + +import ( + "bytes" + "fmt" + "io" + "log" + "os" + "path/filepath" + "strings" + "unicode" + + "golang.org/x/text/transform" + "golang.org/x/text/unicode/norm" +) + +// Filepath separator defined by os.Separator. +const FilePathSeparator = string(filepath.Separator) + +// Takes a reader and a path and writes the content +func (a Afero) WriteReader(path string, r io.Reader) (err error) { + return WriteReader(a.Fs, path, r) +} + +func WriteReader(fs Fs, path string, r io.Reader) (err error) { + dir, _ := filepath.Split(path) + ospath := filepath.FromSlash(dir) + + if ospath != "" { + err = fs.MkdirAll(ospath, 0777) // rwx, rw, r + if err != nil { + if err != os.ErrExist { + log.Panicln(err) + } + } + } + + file, err := fs.Create(path) + if err != nil { + return + } + defer file.Close() + + _, err = io.Copy(file, r) + return +} + +// Same as WriteReader but checks to see if file/directory already exists. +func (a Afero) SafeWriteReader(path string, r io.Reader) (err error) { + return SafeWriteReader(a.Fs, path, r) +} + +func SafeWriteReader(fs Fs, path string, r io.Reader) (err error) { + dir, _ := filepath.Split(path) + ospath := filepath.FromSlash(dir) + + if ospath != "" { + err = fs.MkdirAll(ospath, 0777) // rwx, rw, r + if err != nil { + return + } + } + + exists, err := Exists(fs, path) + if err != nil { + return + } + if exists { + return fmt.Errorf("%v already exists", path) + } + + file, err := fs.Create(path) + if err != nil { + return + } + defer file.Close() + + _, err = io.Copy(file, r) + return +} + +func (a Afero) GetTempDir(subPath string) string { + return GetTempDir(a.Fs, subPath) +} + +// GetTempDir returns the default temp directory with trailing slash +// if subPath is not empty then it will be created recursively with mode 777 rwx rwx rwx +func GetTempDir(fs Fs, subPath string) string { + addSlash := func(p string) string { + if FilePathSeparator != p[len(p)-1:] { + p = p + FilePathSeparator + } + return p + } + dir := addSlash(os.TempDir()) + + if subPath != "" { + // preserve windows backslash :-( + if FilePathSeparator == "\\" { + subPath = strings.Replace(subPath, "\\", "____", -1) + } + dir = dir + UnicodeSanitize((subPath)) + if FilePathSeparator == "\\" { + dir = strings.Replace(dir, "____", "\\", -1) + } + + if exists, _ := Exists(fs, dir); exists { + return addSlash(dir) + } + + err := fs.MkdirAll(dir, 0777) + if err != nil { + panic(err) + } + dir = addSlash(dir) + } + return dir +} + +// Rewrite string to remove non-standard path characters +func UnicodeSanitize(s string) string { + source := []rune(s) + target := make([]rune, 0, len(source)) + + for _, r := range source { + if unicode.IsLetter(r) || + unicode.IsDigit(r) || + unicode.IsMark(r) || + r == '.' || + r == '/' || + r == '\\' || + r == '_' || + r == '-' || + r == '%' || + r == ' ' || + r == '#' { + target = append(target, r) + } + } + + return string(target) +} + +// Transform characters with accents into plain forms. +func NeuterAccents(s string) string { + t := transform.Chain(norm.NFD, transform.RemoveFunc(isMn), norm.NFC) + result, _, _ := transform.String(t, string(s)) + + return result +} + +func isMn(r rune) bool { + return unicode.Is(unicode.Mn, r) // Mn: nonspacing marks +} + +func (a Afero) FileContainsBytes(filename string, subslice []byte) (bool, error) { + return FileContainsBytes(a.Fs, filename, subslice) +} + +// Check if a file contains a specified byte slice. +func FileContainsBytes(fs Fs, filename string, subslice []byte) (bool, error) { + f, err := fs.Open(filename) + if err != nil { + return false, err + } + defer f.Close() + + return readerContainsAny(f, subslice), nil +} + +func (a Afero) FileContainsAnyBytes(filename string, subslices [][]byte) (bool, error) { + return FileContainsAnyBytes(a.Fs, filename, subslices) +} + +// Check if a file contains any of the specified byte slices. +func FileContainsAnyBytes(fs Fs, filename string, subslices [][]byte) (bool, error) { + f, err := fs.Open(filename) + if err != nil { + return false, err + } + defer f.Close() + + return readerContainsAny(f, subslices...), nil +} + +// readerContains reports whether any of the subslices is within r. +func readerContainsAny(r io.Reader, subslices ...[]byte) bool { + + if r == nil || len(subslices) == 0 { + return false + } + + largestSlice := 0 + + for _, sl := range subslices { + if len(sl) > largestSlice { + largestSlice = len(sl) + } + } + + if largestSlice == 0 { + return false + } + + bufflen := largestSlice * 4 + halflen := bufflen / 2 + buff := make([]byte, bufflen) + var err error + var n, i int + + for { + i++ + if i == 1 { + n, err = io.ReadAtLeast(r, buff[:halflen], halflen) + } else { + if i != 2 { + // shift left to catch overlapping matches + copy(buff[:], buff[halflen:]) + } + n, err = io.ReadAtLeast(r, buff[halflen:], halflen) + } + + if n > 0 { + for _, sl := range subslices { + if bytes.Contains(buff, sl) { + return true + } + } + } + + if err != nil { + break + } + } + return false +} + +func (a Afero) DirExists(path string) (bool, error) { + return DirExists(a.Fs, path) +} + +// DirExists checks if a path exists and is a directory. +func DirExists(fs Fs, path string) (bool, error) { + fi, err := fs.Stat(path) + if err == nil && fi.IsDir() { + return true, nil + } + if os.IsNotExist(err) { + return false, nil + } + return false, err +} + +func (a Afero) IsDir(path string) (bool, error) { + return IsDir(a.Fs, path) +} + +// IsDir checks if a given path is a directory. +func IsDir(fs Fs, path string) (bool, error) { + fi, err := fs.Stat(path) + if err != nil { + return false, err + } + return fi.IsDir(), nil +} + +func (a Afero) IsEmpty(path string) (bool, error) { + return IsEmpty(a.Fs, path) +} + +// IsEmpty checks if a given file or directory is empty. +func IsEmpty(fs Fs, path string) (bool, error) { + if b, _ := Exists(fs, path); !b { + return false, fmt.Errorf("%q path does not exist", path) + } + fi, err := fs.Stat(path) + if err != nil { + return false, err + } + if fi.IsDir() { + f, err := fs.Open(path) + if err != nil { + return false, err + } + defer f.Close() + list, err := f.Readdir(-1) + return len(list) == 0, nil + } + return fi.Size() == 0, nil +} + +func (a Afero) Exists(path string) (bool, error) { + return Exists(a.Fs, path) +} + +// Check if a file or directory exists. +func Exists(fs Fs, path string) (bool, error) { + _, err := fs.Stat(path) + if err == nil { + return true, nil + } + if os.IsNotExist(err) { + return false, nil + } + return false, err +} + +func FullBaseFsPath(basePathFs *BasePathFs, relativePath string) string { + combinedPath := filepath.Join(basePathFs.path, relativePath) + if parent, ok := basePathFs.source.(*BasePathFs); ok { + return FullBaseFsPath(parent, combinedPath) + } + + return combinedPath +} diff --git a/vendor/github.com/spf13/afero/util_test.go b/vendor/github.com/spf13/afero/util_test.go new file mode 100644 index 0000000000..b5852f1840 --- /dev/null +++ b/vendor/github.com/spf13/afero/util_test.go @@ -0,0 +1,450 @@ +// Copyright ©2015 Steve Francia +// Portions Copyright ©2015 The Hugo 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 afero + +import ( + "fmt" + "os" + "path/filepath" + "strconv" + "strings" + "testing" + "time" +) + +var testFS = new(MemMapFs) + +func TestDirExists(t *testing.T) { + type test struct { + input string + expected bool + } + + // First create a couple directories so there is something in the filesystem + //testFS := new(MemMapFs) + testFS.MkdirAll("/foo/bar", 0777) + + data := []test{ + {".", true}, + {"./", true}, + {"..", true}, + {"../", true}, + {"./..", true}, + {"./../", true}, + {"/foo/", true}, + {"/foo", true}, + {"/foo/bar", true}, + {"/foo/bar/", true}, + {"/", true}, + {"/some-really-random-directory-name", false}, + {"/some/really/random/directory/name", false}, + {"./some-really-random-local-directory-name", false}, + {"./some/really/random/local/directory/name", false}, + } + + for i, d := range data { + exists, _ := DirExists(testFS, filepath.FromSlash(d.input)) + if d.expected != exists { + t.Errorf("Test %d %q failed. Expected %t got %t", i, d.input, d.expected, exists) + } + } +} + +func TestIsDir(t *testing.T) { + testFS = new(MemMapFs) + + type test struct { + input string + expected bool + } + data := []test{ + {"./", true}, + {"/", true}, + {"./this-directory-does-not-existi", false}, + {"/this-absolute-directory/does-not-exist", false}, + } + + for i, d := range data { + + exists, _ := IsDir(testFS, d.input) + if d.expected != exists { + t.Errorf("Test %d failed. Expected %t got %t", i, d.expected, exists) + } + } +} + +func TestIsEmpty(t *testing.T) { + testFS = new(MemMapFs) + + zeroSizedFile, _ := createZeroSizedFileInTempDir() + defer deleteFileInTempDir(zeroSizedFile) + nonZeroSizedFile, _ := createNonZeroSizedFileInTempDir() + defer deleteFileInTempDir(nonZeroSizedFile) + emptyDirectory, _ := createEmptyTempDir() + defer deleteTempDir(emptyDirectory) + nonEmptyZeroLengthFilesDirectory, _ := createTempDirWithZeroLengthFiles() + defer deleteTempDir(nonEmptyZeroLengthFilesDirectory) + nonEmptyNonZeroLengthFilesDirectory, _ := createTempDirWithNonZeroLengthFiles() + defer deleteTempDir(nonEmptyNonZeroLengthFilesDirectory) + nonExistentFile := os.TempDir() + "/this-file-does-not-exist.txt" + nonExistentDir := os.TempDir() + "/this/direcotry/does/not/exist/" + + fileDoesNotExist := fmt.Errorf("%q path does not exist", nonExistentFile) + dirDoesNotExist := fmt.Errorf("%q path does not exist", nonExistentDir) + + type test struct { + input string + expectedResult bool + expectedErr error + } + + data := []test{ + {zeroSizedFile.Name(), true, nil}, + {nonZeroSizedFile.Name(), false, nil}, + {emptyDirectory, true, nil}, + {nonEmptyZeroLengthFilesDirectory, false, nil}, + {nonEmptyNonZeroLengthFilesDirectory, false, nil}, + {nonExistentFile, false, fileDoesNotExist}, + {nonExistentDir, false, dirDoesNotExist}, + } + for i, d := range data { + exists, err := IsEmpty(testFS, d.input) + if d.expectedResult != exists { + t.Errorf("Test %d %q failed exists. Expected result %t got %t", i, d.input, d.expectedResult, exists) + } + if d.expectedErr != nil { + if d.expectedErr.Error() != err.Error() { + t.Errorf("Test %d failed with err. Expected %q(%#v) got %q(%#v)", i, d.expectedErr, d.expectedErr, err, err) + } + } else { + if d.expectedErr != err { + t.Errorf("Test %d failed. Expected error %q(%#v) got %q(%#v)", i, d.expectedErr, d.expectedErr, err, err) + } + } + } +} + +func TestReaderContains(t *testing.T) { + for i, this := range []struct { + v1 string + v2 [][]byte + expect bool + }{ + {"abc", [][]byte{[]byte("a")}, true}, + {"abc", [][]byte{[]byte("b")}, true}, + {"abcdefg", [][]byte{[]byte("efg")}, true}, + {"abc", [][]byte{[]byte("d")}, false}, + {"abc", [][]byte{[]byte("d"), []byte("e")}, false}, + {"abc", [][]byte{[]byte("d"), []byte("a")}, true}, + {"abc", [][]byte{[]byte("b"), []byte("e")}, true}, + {"", nil, false}, + {"", [][]byte{[]byte("a")}, false}, + {"a", [][]byte{[]byte("")}, false}, + {"", [][]byte{[]byte("")}, false}} { + result := readerContainsAny(strings.NewReader(this.v1), this.v2...) + if result != this.expect { + t.Errorf("[%d] readerContains: got %t but expected %t", i, result, this.expect) + } + } + + if readerContainsAny(nil, []byte("a")) { + t.Error("readerContains with nil reader") + } + + if readerContainsAny(nil, nil) { + t.Error("readerContains with nil arguments") + } +} + +func createZeroSizedFileInTempDir() (File, error) { + filePrefix := "_path_test_" + f, e := TempFile(testFS, "", filePrefix) // dir is os.TempDir() + if e != nil { + // if there was an error no file was created. + // => no requirement to delete the file + return nil, e + } + return f, nil +} + +func createNonZeroSizedFileInTempDir() (File, error) { + f, err := createZeroSizedFileInTempDir() + if err != nil { + // no file ?? + } + byteString := []byte("byteString") + err = WriteFile(testFS, f.Name(), byteString, 0644) + if err != nil { + // delete the file + deleteFileInTempDir(f) + return nil, err + } + return f, nil +} + +func deleteFileInTempDir(f File) { + err := testFS.Remove(f.Name()) + if err != nil { + // now what? + } +} + +func createEmptyTempDir() (string, error) { + dirPrefix := "_dir_prefix_" + d, e := TempDir(testFS, "", dirPrefix) // will be in os.TempDir() + if e != nil { + // no directory to delete - it was never created + return "", e + } + return d, nil +} + +func createTempDirWithZeroLengthFiles() (string, error) { + d, dirErr := createEmptyTempDir() + if dirErr != nil { + //now what? + } + filePrefix := "_path_test_" + _, fileErr := TempFile(testFS, d, filePrefix) // dir is os.TempDir() + if fileErr != nil { + // if there was an error no file was created. + // but we need to remove the directory to clean-up + deleteTempDir(d) + return "", fileErr + } + // the dir now has one, zero length file in it + return d, nil + +} + +func createTempDirWithNonZeroLengthFiles() (string, error) { + d, dirErr := createEmptyTempDir() + if dirErr != nil { + //now what? + } + filePrefix := "_path_test_" + f, fileErr := TempFile(testFS, d, filePrefix) // dir is os.TempDir() + if fileErr != nil { + // if there was an error no file was created. + // but we need to remove the directory to clean-up + deleteTempDir(d) + return "", fileErr + } + byteString := []byte("byteString") + fileErr = WriteFile(testFS, f.Name(), byteString, 0644) + if fileErr != nil { + // delete the file + deleteFileInTempDir(f) + // also delete the directory + deleteTempDir(d) + return "", fileErr + } + + // the dir now has one, zero length file in it + return d, nil + +} + +func TestExists(t *testing.T) { + zeroSizedFile, _ := createZeroSizedFileInTempDir() + defer deleteFileInTempDir(zeroSizedFile) + nonZeroSizedFile, _ := createNonZeroSizedFileInTempDir() + defer deleteFileInTempDir(nonZeroSizedFile) + emptyDirectory, _ := createEmptyTempDir() + defer deleteTempDir(emptyDirectory) + nonExistentFile := os.TempDir() + "/this-file-does-not-exist.txt" + nonExistentDir := os.TempDir() + "/this/direcotry/does/not/exist/" + + type test struct { + input string + expectedResult bool + expectedErr error + } + + data := []test{ + {zeroSizedFile.Name(), true, nil}, + {nonZeroSizedFile.Name(), true, nil}, + {emptyDirectory, true, nil}, + {nonExistentFile, false, nil}, + {nonExistentDir, false, nil}, + } + for i, d := range data { + exists, err := Exists(testFS, d.input) + if d.expectedResult != exists { + t.Errorf("Test %d failed. Expected result %t got %t", i, d.expectedResult, exists) + } + if d.expectedErr != err { + t.Errorf("Test %d failed. Expected %q got %q", i, d.expectedErr, err) + } + } + +} + +func TestSafeWriteToDisk(t *testing.T) { + emptyFile, _ := createZeroSizedFileInTempDir() + defer deleteFileInTempDir(emptyFile) + tmpDir, _ := createEmptyTempDir() + defer deleteTempDir(tmpDir) + + randomString := "This is a random string!" + reader := strings.NewReader(randomString) + + fileExists := fmt.Errorf("%v already exists", emptyFile.Name()) + + type test struct { + filename string + expectedErr error + } + + now := time.Now().Unix() + nowStr := strconv.FormatInt(now, 10) + data := []test{ + {emptyFile.Name(), fileExists}, + {tmpDir + "/" + nowStr, nil}, + } + + for i, d := range data { + e := SafeWriteReader(testFS, d.filename, reader) + if d.expectedErr != nil { + if d.expectedErr.Error() != e.Error() { + t.Errorf("Test %d failed. Expected error %q but got %q", i, d.expectedErr.Error(), e.Error()) + } + } else { + if d.expectedErr != e { + t.Errorf("Test %d failed. Expected %q but got %q", i, d.expectedErr, e) + } + contents, _ := ReadFile(testFS, d.filename) + if randomString != string(contents) { + t.Errorf("Test %d failed. Expected contents %q but got %q", i, randomString, string(contents)) + } + } + reader.Seek(0, 0) + } +} + +func TestWriteToDisk(t *testing.T) { + emptyFile, _ := createZeroSizedFileInTempDir() + defer deleteFileInTempDir(emptyFile) + tmpDir, _ := createEmptyTempDir() + defer deleteTempDir(tmpDir) + + randomString := "This is a random string!" + reader := strings.NewReader(randomString) + + type test struct { + filename string + expectedErr error + } + + now := time.Now().Unix() + nowStr := strconv.FormatInt(now, 10) + data := []test{ + {emptyFile.Name(), nil}, + {tmpDir + "/" + nowStr, nil}, + } + + for i, d := range data { + e := WriteReader(testFS, d.filename, reader) + if d.expectedErr != e { + t.Errorf("Test %d failed. WriteToDisk Error Expected %q but got %q", i, d.expectedErr, e) + } + contents, e := ReadFile(testFS, d.filename) + if e != nil { + t.Errorf("Test %d failed. Could not read file %s. Reason: %s\n", i, d.filename, e) + } + if randomString != string(contents) { + t.Errorf("Test %d failed. Expected contents %q but got %q", i, randomString, string(contents)) + } + reader.Seek(0, 0) + } +} + +func TestGetTempDir(t *testing.T) { + dir := os.TempDir() + if FilePathSeparator != dir[len(dir)-1:] { + dir = dir + FilePathSeparator + } + testDir := "hugoTestFolder" + FilePathSeparator + tests := []struct { + input string + expected string + }{ + {"", dir}, + {testDir + " Foo bar ", dir + testDir + " Foo bar " + FilePathSeparator}, + {testDir + "Foo.Bar/foo_Bar-Foo", dir + testDir + "Foo.Bar/foo_Bar-Foo" + FilePathSeparator}, + {testDir + "fOO,bar:foo%bAR", dir + testDir + "fOObarfoo%bAR" + FilePathSeparator}, + {testDir + "FOo/BaR.html", dir + testDir + "FOo/BaR.html" + FilePathSeparator}, + {testDir + "трям/трям", dir + testDir + "трям/трям" + FilePathSeparator}, + {testDir + "은행", dir + testDir + "은행" + FilePathSeparator}, + {testDir + "Банковский кассир", dir + testDir + "Банковский кассир" + FilePathSeparator}, + } + + for _, test := range tests { + output := GetTempDir(new(MemMapFs), test.input) + if output != test.expected { + t.Errorf("Expected %#v, got %#v\n", test.expected, output) + } + } +} + +// This function is very dangerous. Don't use it. +func deleteTempDir(d string) { + err := os.RemoveAll(d) + if err != nil { + // now what? + } +} + +func TestFullBaseFsPath(t *testing.T) { + type dirSpec struct { + Dir1, Dir2, Dir3 string + } + dirSpecs := []dirSpec{ + dirSpec{Dir1: "/", Dir2: "/", Dir3: "/"}, + dirSpec{Dir1: "/", Dir2: "/path2", Dir3: "/"}, + dirSpec{Dir1: "/path1/dir", Dir2: "/path2/dir/", Dir3: "/path3/dir"}, + dirSpec{Dir1: "C:/path1", Dir2: "path2/dir", Dir3: "/path3/dir/"}, + } + + for _, ds := range dirSpecs { + memFs := NewMemMapFs() + level1Fs := NewBasePathFs(memFs, ds.Dir1) + level2Fs := NewBasePathFs(level1Fs, ds.Dir2) + level3Fs := NewBasePathFs(level2Fs, ds.Dir3) + + type spec struct { + BaseFs Fs + FileName string + ExpectedPath string + } + specs := []spec{ + spec{BaseFs: level3Fs, FileName: "f.txt", ExpectedPath: filepath.Join(ds.Dir1, ds.Dir2, ds.Dir3, "f.txt")}, + spec{BaseFs: level3Fs, FileName: "", ExpectedPath: filepath.Join(ds.Dir1, ds.Dir2, ds.Dir3, "")}, + spec{BaseFs: level2Fs, FileName: "f.txt", ExpectedPath: filepath.Join(ds.Dir1, ds.Dir2, "f.txt")}, + spec{BaseFs: level2Fs, FileName: "", ExpectedPath: filepath.Join(ds.Dir1, ds.Dir2, "")}, + spec{BaseFs: level1Fs, FileName: "f.txt", ExpectedPath: filepath.Join(ds.Dir1, "f.txt")}, + spec{BaseFs: level1Fs, FileName: "", ExpectedPath: filepath.Join(ds.Dir1, "")}, + } + + for _, s := range specs { + if actualPath := FullBaseFsPath(s.BaseFs.(*BasePathFs), s.FileName); actualPath != s.ExpectedPath { + t.Errorf("Expected \n%s got \n%s", s.ExpectedPath, actualPath) + } + } + } +} diff --git a/vendor/github.com/spf13/cast/.gitignore b/vendor/github.com/spf13/cast/.gitignore new file mode 100644 index 0000000000..53053a8ac5 --- /dev/null +++ b/vendor/github.com/spf13/cast/.gitignore @@ -0,0 +1,25 @@ +# 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 + +*.bench diff --git a/vendor/github.com/spf13/cast/LICENSE b/vendor/github.com/spf13/cast/LICENSE new file mode 100644 index 0000000000..4527efb9c0 --- /dev/null +++ b/vendor/github.com/spf13/cast/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Steve Francia + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/vendor/github.com/spf13/cast/Makefile b/vendor/github.com/spf13/cast/Makefile new file mode 100644 index 0000000000..7ccf8930b5 --- /dev/null +++ b/vendor/github.com/spf13/cast/Makefile @@ -0,0 +1,38 @@ +# A Self-Documenting Makefile: http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html + +.PHONY: check fmt lint test test-race vet test-cover-html help +.DEFAULT_GOAL := help + +check: test-race fmt vet lint ## Run tests and linters + +test: ## Run tests + go test ./... + +test-race: ## Run tests with race detector + go test -race ./... + +fmt: ## Run gofmt linter + @for d in `go list` ; do \ + if [ "`gofmt -l -s $$GOPATH/src/$$d | tee /dev/stderr`" ]; then \ + echo "^ improperly formatted go files" && echo && exit 1; \ + fi \ + done + +lint: ## Run golint linter + @for d in `go list` ; do \ + if [ "`golint $$d | tee /dev/stderr`" ]; then \ + echo "^ golint errors!" && echo && exit 1; \ + fi \ + done + +vet: ## Run go vet linter + @if [ "`go vet | tee /dev/stderr`" ]; then \ + echo "^ go vet errors!" && echo && exit 1; \ + fi + +test-cover-html: ## Generate test coverage report + go test -coverprofile=coverage.out -covermode=count + go tool cover -func=coverage.out + +help: + @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' diff --git a/vendor/github.com/spf13/cast/README.md b/vendor/github.com/spf13/cast/README.md new file mode 100644 index 0000000000..e6939397dd --- /dev/null +++ b/vendor/github.com/spf13/cast/README.md @@ -0,0 +1,75 @@ +cast +==== +[![GoDoc](https://godoc.org/github.com/spf13/cast?status.svg)](https://godoc.org/github.com/spf13/cast) +[![Build Status](https://api.travis-ci.org/spf13/cast.svg?branch=master)](https://travis-ci.org/spf13/cast) +[![Go Report Card](https://goreportcard.com/badge/github.com/spf13/cast)](https://goreportcard.com/report/github.com/spf13/cast) + +Easy and safe casting from one type to another in Go + +Don’t Panic! ... Cast + +## What is Cast? + +Cast is a library to convert between different go types in a consistent and easy way. + +Cast provides simple functions to easily convert a number to a string, an +interface into a bool, etc. Cast does this intelligently when an obvious +conversion is possible. It doesn’t make any attempts to guess what you meant, +for example you can only convert a string to an int when it is a string +representation of an int such as “8”. Cast was developed for use in +[Hugo](http://hugo.spf13.com), a website engine which uses YAML, TOML or JSON +for meta data. + +## Why use Cast? + +When working with dynamic data in Go you often need to cast or convert the data +from one type into another. Cast goes beyond just using type assertion (though +it uses that when possible) to provide a very straightforward and convenient +library. + +If you are working with interfaces to handle things like dynamic content +you’ll need an easy way to convert an interface into a given type. This +is the library for you. + +If you are taking in data from YAML, TOML or JSON or other formats which lack +full types, then Cast is the library for you. + +## Usage + +Cast provides a handful of To_____ methods. These methods will always return +the desired type. **If input is provided that will not convert to that type, the +0 or nil value for that type will be returned**. + +Cast also provides identical methods To_____E. These return the same result as +the To_____ methods, plus an additional error which tells you if it successfully +converted. Using these methods you can tell the difference between when the +input matched the zero value or when the conversion failed and the zero value +was returned. + +The following examples are merely a sample of what is available. Please review +the code for a complete set. + +### Example ‘ToString’: + + cast.ToString("mayonegg") // "mayonegg" + cast.ToString(8) // "8" + cast.ToString(8.31) // "8.31" + cast.ToString([]byte("one time")) // "one time" + cast.ToString(nil) // "" + + var foo interface{} = "one more time" + cast.ToString(foo) // "one more time" + + +### Example ‘ToInt’: + + cast.ToInt(8) // 8 + cast.ToInt(8.31) // 8 + cast.ToInt("8") // 8 + cast.ToInt(true) // 1 + cast.ToInt(false) // 0 + + var eight interface{} = 8 + cast.ToInt(eight) // 8 + cast.ToInt(nil) // 0 + diff --git a/vendor/github.com/spf13/cast/cast.go b/vendor/github.com/spf13/cast/cast.go new file mode 100644 index 0000000000..8b8c208bef --- /dev/null +++ b/vendor/github.com/spf13/cast/cast.go @@ -0,0 +1,159 @@ +// Copyright © 2014 Steve Francia . +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file. + +// Package cast provides easy and safe casting in Go. +package cast + +import "time" + +// ToBool casts an interface to a bool type. +func ToBool(i interface{}) bool { + v, _ := ToBoolE(i) + return v +} + +// ToTime casts an interface to a time.Time type. +func ToTime(i interface{}) time.Time { + v, _ := ToTimeE(i) + return v +} + +// ToDuration casts an interface to a time.Duration type. +func ToDuration(i interface{}) time.Duration { + v, _ := ToDurationE(i) + return v +} + +// ToFloat64 casts an interface to a float64 type. +func ToFloat64(i interface{}) float64 { + v, _ := ToFloat64E(i) + return v +} + +// ToFloat32 casts an interface to a float32 type. +func ToFloat32(i interface{}) float32 { + v, _ := ToFloat32E(i) + return v +} + +// ToInt64 casts an interface to an int64 type. +func ToInt64(i interface{}) int64 { + v, _ := ToInt64E(i) + return v +} + +// ToInt32 casts an interface to an int32 type. +func ToInt32(i interface{}) int32 { + v, _ := ToInt32E(i) + return v +} + +// ToInt16 casts an interface to an int16 type. +func ToInt16(i interface{}) int16 { + v, _ := ToInt16E(i) + return v +} + +// ToInt8 casts an interface to an int8 type. +func ToInt8(i interface{}) int8 { + v, _ := ToInt8E(i) + return v +} + +// ToInt casts an interface to an int type. +func ToInt(i interface{}) int { + v, _ := ToIntE(i) + return v +} + +// ToUint casts an interface to a uint type. +func ToUint(i interface{}) uint { + v, _ := ToUintE(i) + return v +} + +// ToUint64 casts an interface to a uint64 type. +func ToUint64(i interface{}) uint64 { + v, _ := ToUint64E(i) + return v +} + +// ToUint32 casts an interface to a uint32 type. +func ToUint32(i interface{}) uint32 { + v, _ := ToUint32E(i) + return v +} + +// ToUint16 casts an interface to a uint16 type. +func ToUint16(i interface{}) uint16 { + v, _ := ToUint16E(i) + return v +} + +// ToUint8 casts an interface to a uint8 type. +func ToUint8(i interface{}) uint8 { + v, _ := ToUint8E(i) + return v +} + +// ToString casts an interface to a string type. +func ToString(i interface{}) string { + v, _ := ToStringE(i) + return v +} + +// ToStringMapString casts an interface to a map[string]string type. +func ToStringMapString(i interface{}) map[string]string { + v, _ := ToStringMapStringE(i) + return v +} + +// ToStringMapStringSlice casts an interface to a map[string][]string type. +func ToStringMapStringSlice(i interface{}) map[string][]string { + v, _ := ToStringMapStringSliceE(i) + return v +} + +// ToStringMapBool casts an interface to a map[string]bool type. +func ToStringMapBool(i interface{}) map[string]bool { + v, _ := ToStringMapBoolE(i) + return v +} + +// ToStringMap casts an interface to a map[string]interface{} type. +func ToStringMap(i interface{}) map[string]interface{} { + v, _ := ToStringMapE(i) + return v +} + +// ToSlice casts an interface to a []interface{} type. +func ToSlice(i interface{}) []interface{} { + v, _ := ToSliceE(i) + return v +} + +// ToBoolSlice casts an interface to a []bool type. +func ToBoolSlice(i interface{}) []bool { + v, _ := ToBoolSliceE(i) + return v +} + +// ToStringSlice casts an interface to a []string type. +func ToStringSlice(i interface{}) []string { + v, _ := ToStringSliceE(i) + return v +} + +// ToIntSlice casts an interface to a []int type. +func ToIntSlice(i interface{}) []int { + v, _ := ToIntSliceE(i) + return v +} + +// ToDurationSlice casts an interface to a []time.Duration type. +func ToDurationSlice(i interface{}) []time.Duration { + v, _ := ToDurationSliceE(i) + return v +} diff --git a/vendor/github.com/spf13/cast/cast_test.go b/vendor/github.com/spf13/cast/cast_test.go new file mode 100644 index 0000000000..404fe7680c --- /dev/null +++ b/vendor/github.com/spf13/cast/cast_test.go @@ -0,0 +1,1183 @@ +// Copyright © 2014 Steve Francia . +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file. + +package cast + +import ( + "fmt" + "html/template" + "testing" + "time" + + "github.com/stretchr/testify/assert" +) + +func TestToUintE(t *testing.T) { + tests := []struct { + input interface{} + expect uint + iserr bool + }{ + {int(8), 8, false}, + {int8(8), 8, false}, + {int16(8), 8, false}, + {int32(8), 8, false}, + {int64(8), 8, false}, + {uint(8), 8, false}, + {uint8(8), 8, false}, + {uint16(8), 8, false}, + {uint32(8), 8, false}, + {uint64(8), 8, false}, + {float32(8.31), 8, false}, + {float64(8.31), 8, false}, + {true, 1, false}, + {false, 0, false}, + {"8", 8, false}, + {nil, 0, false}, + // errors + {int(-8), 0, true}, + {int8(-8), 0, true}, + {int16(-8), 0, true}, + {int32(-8), 0, true}, + {int64(-8), 0, true}, + {float32(-8.31), 0, true}, + {float64(-8.31), 0, true}, + {"-8", 0, true}, + {"test", 0, true}, + {testing.T{}, 0, true}, + } + + for i, test := range tests { + errmsg := fmt.Sprintf("i = %d", i) // assert helper message + + v, err := ToUintE(test.input) + if test.iserr { + assert.Error(t, err, errmsg) + continue + } + + assert.NoError(t, err, errmsg) + assert.Equal(t, test.expect, v, errmsg) + + // Non-E test: + v = ToUint(test.input) + assert.Equal(t, test.expect, v, errmsg) + } +} + +func TestToUint64E(t *testing.T) { + tests := []struct { + input interface{} + expect uint64 + iserr bool + }{ + {int(8), 8, false}, + {int8(8), 8, false}, + {int16(8), 8, false}, + {int32(8), 8, false}, + {int64(8), 8, false}, + {uint(8), 8, false}, + {uint8(8), 8, false}, + {uint16(8), 8, false}, + {uint32(8), 8, false}, + {uint64(8), 8, false}, + {float32(8.31), 8, false}, + {float64(8.31), 8, false}, + {true, 1, false}, + {false, 0, false}, + {"8", 8, false}, + {nil, 0, false}, + // errors + {int(-8), 0, true}, + {int8(-8), 0, true}, + {int16(-8), 0, true}, + {int32(-8), 0, true}, + {int64(-8), 0, true}, + {float32(-8.31), 0, true}, + {float64(-8.31), 0, true}, + {"-8", 0, true}, + {"test", 0, true}, + {testing.T{}, 0, true}, + } + + for i, test := range tests { + errmsg := fmt.Sprintf("i = %d", i) // assert helper message + + v, err := ToUint64E(test.input) + if test.iserr { + assert.Error(t, err, errmsg) + continue + } + + assert.NoError(t, err, errmsg) + assert.Equal(t, test.expect, v, errmsg) + + // Non-E test: + v = ToUint64(test.input) + assert.Equal(t, test.expect, v, errmsg) + } +} + +func TestToUint32E(t *testing.T) { + tests := []struct { + input interface{} + expect uint32 + iserr bool + }{ + {int(8), 8, false}, + {int8(8), 8, false}, + {int16(8), 8, false}, + {int32(8), 8, false}, + {int64(8), 8, false}, + {uint(8), 8, false}, + {uint8(8), 8, false}, + {uint16(8), 8, false}, + {uint32(8), 8, false}, + {uint64(8), 8, false}, + {float32(8.31), 8, false}, + {float64(8.31), 8, false}, + {true, 1, false}, + {false, 0, false}, + {"8", 8, false}, + {nil, 0, false}, + {int(-8), 0, true}, + {int8(-8), 0, true}, + {int16(-8), 0, true}, + {int32(-8), 0, true}, + {int64(-8), 0, true}, + {float32(-8.31), 0, true}, + {float64(-8.31), 0, true}, + {"-8", 0, true}, + // errors + {"test", 0, true}, + {testing.T{}, 0, true}, + } + + for i, test := range tests { + errmsg := fmt.Sprintf("i = %d", i) // assert helper message + + v, err := ToUint32E(test.input) + if test.iserr { + assert.Error(t, err, errmsg) + continue + } + + assert.NoError(t, err, errmsg) + assert.Equal(t, test.expect, v, errmsg) + + // Non-E test: + v = ToUint32(test.input) + assert.Equal(t, test.expect, v, errmsg) + } +} + +func TestToUint16E(t *testing.T) { + tests := []struct { + input interface{} + expect uint16 + iserr bool + }{ + {int(8), 8, false}, + {int8(8), 8, false}, + {int16(8), 8, false}, + {int32(8), 8, false}, + {int64(8), 8, false}, + {uint(8), 8, false}, + {uint8(8), 8, false}, + {uint16(8), 8, false}, + {uint32(8), 8, false}, + {uint64(8), 8, false}, + {float32(8.31), 8, false}, + {float64(8.31), 8, false}, + {true, 1, false}, + {false, 0, false}, + {"8", 8, false}, + {nil, 0, false}, + // errors + {int(-8), 0, true}, + {int8(-8), 0, true}, + {int16(-8), 0, true}, + {int32(-8), 0, true}, + {int64(-8), 0, true}, + {float32(-8.31), 0, true}, + {float64(-8.31), 0, true}, + {"-8", 0, true}, + {"test", 0, true}, + {testing.T{}, 0, true}, + } + + for i, test := range tests { + errmsg := fmt.Sprintf("i = %d", i) // assert helper message + + v, err := ToUint16E(test.input) + if test.iserr { + assert.Error(t, err, errmsg) + continue + } + + assert.NoError(t, err, errmsg) + assert.Equal(t, test.expect, v, errmsg) + + // Non-E test + v = ToUint16(test.input) + assert.Equal(t, test.expect, v, errmsg) + } +} + +func TestToUint8E(t *testing.T) { + tests := []struct { + input interface{} + expect uint8 + iserr bool + }{ + {int(8), 8, false}, + {int8(8), 8, false}, + {int16(8), 8, false}, + {int32(8), 8, false}, + {int64(8), 8, false}, + {uint(8), 8, false}, + {uint8(8), 8, false}, + {uint16(8), 8, false}, + {uint32(8), 8, false}, + {uint64(8), 8, false}, + {float32(8.31), 8, false}, + {float64(8.31), 8, false}, + {true, 1, false}, + {false, 0, false}, + {"8", 8, false}, + {nil, 0, false}, + // errors + {int(-8), 0, true}, + {int8(-8), 0, true}, + {int16(-8), 0, true}, + {int32(-8), 0, true}, + {int64(-8), 0, true}, + {float32(-8.31), 0, true}, + {float64(-8.31), 0, true}, + {"-8", 0, true}, + {"test", 0, true}, + {testing.T{}, 0, true}, + } + + for i, test := range tests { + errmsg := fmt.Sprintf("i = %d", i) // assert helper message + + v, err := ToUint8E(test.input) + if test.iserr { + assert.Error(t, err, errmsg) + continue + } + + assert.NoError(t, err, errmsg) + assert.Equal(t, test.expect, v, errmsg) + + // Non-E test + v = ToUint8(test.input) + assert.Equal(t, test.expect, v, errmsg) + } +} + +func TestToIntE(t *testing.T) { + tests := []struct { + input interface{} + expect int + iserr bool + }{ + {int(8), 8, false}, + {int8(8), 8, false}, + {int16(8), 8, false}, + {int32(8), 8, false}, + {int64(8), 8, false}, + {uint(8), 8, false}, + {uint8(8), 8, false}, + {uint16(8), 8, false}, + {uint32(8), 8, false}, + {uint64(8), 8, false}, + {float32(8.31), 8, false}, + {float64(8.31), 8, false}, + {true, 1, false}, + {false, 0, false}, + {"8", 8, false}, + {nil, 0, false}, + // errors + {"test", 0, true}, + {testing.T{}, 0, true}, + } + + for i, test := range tests { + errmsg := fmt.Sprintf("i = %d", i) // assert helper message + + v, err := ToIntE(test.input) + if test.iserr { + assert.Error(t, err, errmsg) + continue + } + + assert.NoError(t, err, errmsg) + assert.Equal(t, test.expect, v, errmsg) + + // Non-E test + v = ToInt(test.input) + assert.Equal(t, test.expect, v, errmsg) + } +} + +func TestToInt64E(t *testing.T) { + tests := []struct { + input interface{} + expect int64 + iserr bool + }{ + {int(8), 8, false}, + {int8(8), 8, false}, + {int16(8), 8, false}, + {int32(8), 8, false}, + {int64(8), 8, false}, + {uint(8), 8, false}, + {uint8(8), 8, false}, + {uint16(8), 8, false}, + {uint32(8), 8, false}, + {uint64(8), 8, false}, + {float32(8.31), 8, false}, + {float64(8.31), 8, false}, + {true, 1, false}, + {false, 0, false}, + {"8", 8, false}, + {nil, 0, false}, + // errors + {"test", 0, true}, + {testing.T{}, 0, true}, + } + + for i, test := range tests { + errmsg := fmt.Sprintf("i = %d", i) // assert helper message + + v, err := ToInt64E(test.input) + if test.iserr { + assert.Error(t, err, errmsg) + continue + } + + assert.NoError(t, err, errmsg) + assert.Equal(t, test.expect, v, errmsg) + + // Non-E test + v = ToInt64(test.input) + assert.Equal(t, test.expect, v, errmsg) + } +} + +func TestToInt32E(t *testing.T) { + tests := []struct { + input interface{} + expect int32 + iserr bool + }{ + {int(8), 8, false}, + {int8(8), 8, false}, + {int16(8), 8, false}, + {int32(8), 8, false}, + {int64(8), 8, false}, + {uint(8), 8, false}, + {uint8(8), 8, false}, + {uint16(8), 8, false}, + {uint32(8), 8, false}, + {uint64(8), 8, false}, + {float32(8.31), 8, false}, + {float64(8.31), 8, false}, + {true, 1, false}, + {false, 0, false}, + {"8", 8, false}, + {nil, 0, false}, + // errors + {"test", 0, true}, + {testing.T{}, 0, true}, + } + + for i, test := range tests { + errmsg := fmt.Sprintf("i = %d", i) // assert helper message + + v, err := ToInt32E(test.input) + if test.iserr { + assert.Error(t, err, errmsg) + continue + } + + assert.NoError(t, err, errmsg) + assert.Equal(t, test.expect, v, errmsg) + + // Non-E test + v = ToInt32(test.input) + assert.Equal(t, test.expect, v, errmsg) + } +} + +func TestToInt16E(t *testing.T) { + tests := []struct { + input interface{} + expect int16 + iserr bool + }{ + {int(8), 8, false}, + {int8(8), 8, false}, + {int16(8), 8, false}, + {int32(8), 8, false}, + {int64(8), 8, false}, + {uint(8), 8, false}, + {uint8(8), 8, false}, + {uint16(8), 8, false}, + {uint32(8), 8, false}, + {uint64(8), 8, false}, + {float32(8.31), 8, false}, + {float64(8.31), 8, false}, + {true, 1, false}, + {false, 0, false}, + {"8", 8, false}, + {nil, 0, false}, + // errors + {"test", 0, true}, + {testing.T{}, 0, true}, + } + + for i, test := range tests { + errmsg := fmt.Sprintf("i = %d", i) // assert helper message + + v, err := ToInt16E(test.input) + if test.iserr { + assert.Error(t, err, errmsg) + continue + } + + assert.NoError(t, err, errmsg) + assert.Equal(t, test.expect, v, errmsg) + + // Non-E test + v = ToInt16(test.input) + assert.Equal(t, test.expect, v, errmsg) + } +} + +func TestToInt8E(t *testing.T) { + tests := []struct { + input interface{} + expect int8 + iserr bool + }{ + {int(8), 8, false}, + {int8(8), 8, false}, + {int16(8), 8, false}, + {int32(8), 8, false}, + {int64(8), 8, false}, + {uint(8), 8, false}, + {uint8(8), 8, false}, + {uint16(8), 8, false}, + {uint32(8), 8, false}, + {uint64(8), 8, false}, + {float32(8.31), 8, false}, + {float64(8.31), 8, false}, + {true, 1, false}, + {false, 0, false}, + {"8", 8, false}, + {nil, 0, false}, + // errors + {"test", 0, true}, + {testing.T{}, 0, true}, + } + + for i, test := range tests { + errmsg := fmt.Sprintf("i = %d", i) // assert helper message + + v, err := ToInt8E(test.input) + if test.iserr { + assert.Error(t, err, errmsg) + continue + } + + assert.NoError(t, err, errmsg) + assert.Equal(t, test.expect, v, errmsg) + + // Non-E test + v = ToInt8(test.input) + assert.Equal(t, test.expect, v, errmsg) + } +} + +func TestToFloat64E(t *testing.T) { + tests := []struct { + input interface{} + expect float64 + iserr bool + }{ + {int(8), 8, false}, + {int8(8), 8, false}, + {int16(8), 8, false}, + {int32(8), 8, false}, + {int64(8), 8, false}, + {uint(8), 8, false}, + {uint8(8), 8, false}, + {uint16(8), 8, false}, + {uint32(8), 8, false}, + {uint64(8), 8, false}, + {float32(8), 8, false}, + {float64(8.31), 8.31, false}, + {"8", 8, false}, + {true, 1, false}, + {false, 0, false}, + // errors + {"test", 0, true}, + {testing.T{}, 0, true}, + } + + for i, test := range tests { + errmsg := fmt.Sprintf("i = %d", i) // assert helper message + + v, err := ToFloat64E(test.input) + if test.iserr { + assert.Error(t, err, errmsg) + continue + } + + assert.NoError(t, err, errmsg) + assert.Equal(t, test.expect, v, errmsg) + + // Non-E test + v = ToFloat64(test.input) + assert.Equal(t, test.expect, v, errmsg) + } +} + +func TestToFloat32E(t *testing.T) { + tests := []struct { + input interface{} + expect float32 + iserr bool + }{ + {int(8), 8, false}, + {int8(8), 8, false}, + {int16(8), 8, false}, + {int32(8), 8, false}, + {int64(8), 8, false}, + {uint(8), 8, false}, + {uint8(8), 8, false}, + {uint16(8), 8, false}, + {uint32(8), 8, false}, + {uint64(8), 8, false}, + {float32(8.31), 8.31, false}, + {float64(8.31), 8.31, false}, + {"8", 8, false}, + {true, 1, false}, + {false, 0, false}, + // errors + {"test", 0, true}, + {testing.T{}, 0, true}, + } + + for i, test := range tests { + errmsg := fmt.Sprintf("i = %d", i) // assert helper message + + v, err := ToFloat32E(test.input) + if test.iserr { + assert.Error(t, err, errmsg) + continue + } + + assert.NoError(t, err, errmsg) + assert.Equal(t, test.expect, v, errmsg) + + // Non-E test + v = ToFloat32(test.input) + assert.Equal(t, test.expect, v, errmsg) + } +} + +func TestToStringE(t *testing.T) { + type Key struct { + k string + } + key := &Key{"foo"} + + tests := []struct { + input interface{} + expect string + iserr bool + }{ + {int(8), "8", false}, + {int8(8), "8", false}, + {int16(8), "8", false}, + {int32(8), "8", false}, + {int64(8), "8", false}, + {uint(8), "8", false}, + {uint8(8), "8", false}, + {uint16(8), "8", false}, + {uint32(8), "8", false}, + {uint64(8), "8", false}, + {float32(8.31), "8.31", false}, + {float64(8.31), "8.31", false}, + {true, "true", false}, + {false, "false", false}, + {nil, "", false}, + {[]byte("one time"), "one time", false}, + {"one more time", "one more time", false}, + {template.HTML("one time"), "one time", false}, + {template.URL("http://somehost.foo"), "http://somehost.foo", false}, + {template.JS("(1+2)"), "(1+2)", false}, + {template.CSS("a"), "a", false}, + {template.HTMLAttr("a"), "a", false}, + // errors + {testing.T{}, "", true}, + {key, "", true}, + } + + for i, test := range tests { + errmsg := fmt.Sprintf("i = %d", i) // assert helper message + + v, err := ToStringE(test.input) + if test.iserr { + assert.Error(t, err, errmsg) + continue + } + + assert.NoError(t, err, errmsg) + assert.Equal(t, test.expect, v, errmsg) + + // Non-E test + v = ToString(test.input) + assert.Equal(t, test.expect, v, errmsg) + } +} + +type foo struct { + val string +} + +func (x foo) String() string { + return x.val +} + +func TestStringerToString(t *testing.T) { + var x foo + x.val = "bar" + assert.Equal(t, "bar", ToString(x)) +} + +type fu struct { + val string +} + +func (x fu) Error() string { + return x.val +} + +func TestErrorToString(t *testing.T) { + var x fu + x.val = "bar" + assert.Equal(t, "bar", ToString(x)) +} + +func TestStringMapStringSliceE(t *testing.T) { + // ToStringMapString inputs/outputs + var stringMapString = map[string]string{"key 1": "value 1", "key 2": "value 2", "key 3": "value 3"} + var stringMapInterface = map[string]interface{}{"key 1": "value 1", "key 2": "value 2", "key 3": "value 3"} + var interfaceMapString = map[interface{}]string{"key 1": "value 1", "key 2": "value 2", "key 3": "value 3"} + var interfaceMapInterface = map[interface{}]interface{}{"key 1": "value 1", "key 2": "value 2", "key 3": "value 3"} + + // ToStringMapStringSlice inputs/outputs + var stringMapStringSlice = map[string][]string{"key 1": {"value 1", "value 2", "value 3"}, "key 2": {"value 1", "value 2", "value 3"}, "key 3": {"value 1", "value 2", "value 3"}} + var stringMapInterfaceSlice = map[string][]interface{}{"key 1": {"value 1", "value 2", "value 3"}, "key 2": {"value 1", "value 2", "value 3"}, "key 3": {"value 1", "value 2", "value 3"}} + var stringMapInterfaceInterfaceSlice = map[string]interface{}{"key 1": []interface{}{"value 1", "value 2", "value 3"}, "key 2": []interface{}{"value 1", "value 2", "value 3"}, "key 3": []interface{}{"value 1", "value 2", "value 3"}} + var stringMapStringSingleSliceFieldsResult = map[string][]string{"key 1": {"value", "1"}, "key 2": {"value", "2"}, "key 3": {"value", "3"}} + var interfaceMapStringSlice = map[interface{}][]string{"key 1": {"value 1", "value 2", "value 3"}, "key 2": {"value 1", "value 2", "value 3"}, "key 3": {"value 1", "value 2", "value 3"}} + var interfaceMapInterfaceSlice = map[interface{}][]interface{}{"key 1": {"value 1", "value 2", "value 3"}, "key 2": {"value 1", "value 2", "value 3"}, "key 3": {"value 1", "value 2", "value 3"}} + + var stringMapStringSliceMultiple = map[string][]string{"key 1": {"value 1", "value 2", "value 3"}, "key 2": {"value 1", "value 2", "value 3"}, "key 3": {"value 1", "value 2", "value 3"}} + var stringMapStringSliceSingle = map[string][]string{"key 1": {"value 1"}, "key 2": {"value 2"}, "key 3": {"value 3"}} + + var stringMapInterface1 = map[string]interface{}{"key 1": []string{"value 1"}, "key 2": []string{"value 2"}} + var stringMapInterfaceResult1 = map[string][]string{"key 1": {"value 1"}, "key 2": {"value 2"}} + + type Key struct { + k string + } + + tests := []struct { + input interface{} + expect map[string][]string + iserr bool + }{ + {stringMapStringSlice, stringMapStringSlice, false}, + {stringMapInterfaceSlice, stringMapStringSlice, false}, + {stringMapInterfaceInterfaceSlice, stringMapStringSlice, false}, + {stringMapStringSliceMultiple, stringMapStringSlice, false}, + {stringMapStringSliceMultiple, stringMapStringSlice, false}, + {stringMapString, stringMapStringSliceSingle, false}, + {stringMapInterface, stringMapStringSliceSingle, false}, + {stringMapInterface1, stringMapInterfaceResult1, false}, + {interfaceMapStringSlice, stringMapStringSlice, false}, + {interfaceMapInterfaceSlice, stringMapStringSlice, false}, + {interfaceMapString, stringMapStringSingleSliceFieldsResult, false}, + {interfaceMapInterface, stringMapStringSingleSliceFieldsResult, false}, + // errors + {nil, nil, true}, + {testing.T{}, nil, true}, + {map[interface{}]interface{}{"foo": testing.T{}}, nil, true}, + {map[interface{}]interface{}{Key{"foo"}: "bar"}, nil, true}, // ToStringE(Key{"foo"}) should fail + } + + for i, test := range tests { + errmsg := fmt.Sprintf("i = %d", i) // assert helper message + + v, err := ToStringMapStringSliceE(test.input) + if test.iserr { + assert.Error(t, err, errmsg) + continue + } + + assert.NoError(t, err, errmsg) + assert.Equal(t, test.expect, v, errmsg) + + // Non-E test + v = ToStringMapStringSlice(test.input) + assert.Equal(t, test.expect, v, errmsg) + } +} + +func TestToStringMapE(t *testing.T) { + tests := []struct { + input interface{} + expect map[string]interface{} + iserr bool + }{ + {map[interface{}]interface{}{"tag": "tags", "group": "groups"}, map[string]interface{}{"tag": "tags", "group": "groups"}, false}, + {map[string]interface{}{"tag": "tags", "group": "groups"}, map[string]interface{}{"tag": "tags", "group": "groups"}, false}, + // errors + {nil, nil, true}, + {testing.T{}, nil, true}, + } + + for i, test := range tests { + errmsg := fmt.Sprintf("i = %d", i) // assert helper message + + v, err := ToStringMapE(test.input) + if test.iserr { + assert.Error(t, err, errmsg) + continue + } + + assert.NoError(t, err, errmsg) + assert.Equal(t, test.expect, v, errmsg) + + // Non-E test + v = ToStringMap(test.input) + assert.Equal(t, test.expect, v, errmsg) + } +} + +func TestToStringMapBoolE(t *testing.T) { + tests := []struct { + input interface{} + expect map[string]bool + iserr bool + }{ + {map[interface{}]interface{}{"v1": true, "v2": false}, map[string]bool{"v1": true, "v2": false}, false}, + {map[string]interface{}{"v1": true, "v2": false}, map[string]bool{"v1": true, "v2": false}, false}, + {map[string]bool{"v1": true, "v2": false}, map[string]bool{"v1": true, "v2": false}, false}, + // errors + {nil, nil, true}, + {testing.T{}, nil, true}, + } + + for i, test := range tests { + errmsg := fmt.Sprintf("i = %d", i) // assert helper message + + v, err := ToStringMapBoolE(test.input) + if test.iserr { + assert.Error(t, err, errmsg) + continue + } + + assert.NoError(t, err, errmsg) + assert.Equal(t, test.expect, v, errmsg) + + // Non-E test + v = ToStringMapBool(test.input) + assert.Equal(t, test.expect, v, errmsg) + } +} + +func TestToStringMapStringE(t *testing.T) { + var stringMapString = map[string]string{"key 1": "value 1", "key 2": "value 2", "key 3": "value 3"} + var stringMapInterface = map[string]interface{}{"key 1": "value 1", "key 2": "value 2", "key 3": "value 3"} + var interfaceMapString = map[interface{}]string{"key 1": "value 1", "key 2": "value 2", "key 3": "value 3"} + var interfaceMapInterface = map[interface{}]interface{}{"key 1": "value 1", "key 2": "value 2", "key 3": "value 3"} + + tests := []struct { + input interface{} + expect map[string]string + iserr bool + }{ + {stringMapString, stringMapString, false}, + {stringMapInterface, stringMapString, false}, + {interfaceMapString, stringMapString, false}, + {interfaceMapInterface, stringMapString, false}, + // errors + {nil, nil, true}, + {testing.T{}, nil, true}, + } + + for i, test := range tests { + errmsg := fmt.Sprintf("i = %d", i) // assert helper message + + v, err := ToStringMapStringE(test.input) + if test.iserr { + assert.Error(t, err, errmsg) + continue + } + + assert.NoError(t, err, errmsg) + assert.Equal(t, test.expect, v, errmsg) + + // Non-E test + v = ToStringMapString(test.input) + assert.Equal(t, test.expect, v, errmsg) + } +} + +func TestToBoolSliceE(t *testing.T) { + tests := []struct { + input interface{} + expect []bool + iserr bool + }{ + {[]bool{true, false, true}, []bool{true, false, true}, false}, + {[]interface{}{true, false, true}, []bool{true, false, true}, false}, + {[]int{1, 0, 1}, []bool{true, false, true}, false}, + {[]string{"true", "false", "true"}, []bool{true, false, true}, false}, + // errors + {nil, nil, true}, + {testing.T{}, nil, true}, + {[]string{"foo", "bar"}, nil, true}, + } + + for i, test := range tests { + errmsg := fmt.Sprintf("i = %d", i) // assert helper message + + v, err := ToBoolSliceE(test.input) + if test.iserr { + assert.Error(t, err, errmsg) + continue + } + + assert.NoError(t, err, errmsg) + assert.Equal(t, test.expect, v, errmsg) + + // Non-E test + v = ToBoolSlice(test.input) + assert.Equal(t, test.expect, v, errmsg) + } +} + +func TestToIntSliceE(t *testing.T) { + tests := []struct { + input interface{} + expect []int + iserr bool + }{ + {[]int{1, 3}, []int{1, 3}, false}, + {[]interface{}{1.2, 3.2}, []int{1, 3}, false}, + {[]string{"2", "3"}, []int{2, 3}, false}, + {[2]string{"2", "3"}, []int{2, 3}, false}, + // errors + {nil, nil, true}, + {testing.T{}, nil, true}, + {[]string{"foo", "bar"}, nil, true}, + } + + for i, test := range tests { + errmsg := fmt.Sprintf("i = %d", i) // assert helper message + + v, err := ToIntSliceE(test.input) + if test.iserr { + assert.Error(t, err, errmsg) + continue + } + + assert.NoError(t, err, errmsg) + assert.Equal(t, test.expect, v, errmsg) + + // Non-E test + v = ToIntSlice(test.input) + assert.Equal(t, test.expect, v, errmsg) + } +} + +func TestToSliceE(t *testing.T) { + tests := []struct { + input interface{} + expect []interface{} + iserr bool + }{ + {[]interface{}{1, 3}, []interface{}{1, 3}, false}, + {[]map[string]interface{}{{"k1": 1}, {"k2": 2}}, []interface{}{map[string]interface{}{"k1": 1}, map[string]interface{}{"k2": 2}}, false}, + // errors + {nil, nil, true}, + {testing.T{}, nil, true}, + } + + for i, test := range tests { + errmsg := fmt.Sprintf("i = %d", i) // assert helper message + + v, err := ToSliceE(test.input) + if test.iserr { + assert.Error(t, err, errmsg) + continue + } + + assert.NoError(t, err, errmsg) + assert.Equal(t, test.expect, v, errmsg) + + // Non-E test + v = ToSlice(test.input) + assert.Equal(t, test.expect, v, errmsg) + } +} + +func TestToStringSliceE(t *testing.T) { + tests := []struct { + input interface{} + expect []string + iserr bool + }{ + {[]string{"a", "b"}, []string{"a", "b"}, false}, + {[]interface{}{1, 3}, []string{"1", "3"}, false}, + {interface{}(1), []string{"1"}, false}, + // errors + {nil, nil, true}, + {testing.T{}, nil, true}, + } + + for i, test := range tests { + errmsg := fmt.Sprintf("i = %d", i) // assert helper message + + v, err := ToStringSliceE(test.input) + if test.iserr { + assert.Error(t, err, errmsg) + continue + } + + assert.NoError(t, err, errmsg) + assert.Equal(t, test.expect, v, errmsg) + + // Non-E test + v = ToStringSlice(test.input) + assert.Equal(t, test.expect, v, errmsg) + } +} + +func TestToDurationSliceE(t *testing.T) { + tests := []struct { + input interface{} + expect []time.Duration + iserr bool + }{ + {[]string{"1s", "1m"}, []time.Duration{time.Second, time.Minute}, false}, + {[]int{1, 2}, []time.Duration{1, 2}, false}, + {[]interface{}{1, 3}, []time.Duration{1, 3}, false}, + // errors + {nil, nil, true}, + {testing.T{}, nil, true}, + } + + for i, test := range tests { + errmsg := fmt.Sprintf("i = %d", i) // assert helper message + + v, err := ToDurationSliceE(test.input) + if test.iserr { + assert.Error(t, err, errmsg) + continue + } + + assert.NoError(t, err, errmsg) + assert.Equal(t, test.expect, v, errmsg) + + // Non-E test + v = ToDurationSlice(test.input) + assert.Equal(t, test.expect, v, errmsg) + } +} + +func TestToBoolE(t *testing.T) { + tests := []struct { + input interface{} + expect bool + iserr bool + }{ + {0, false, false}, + {nil, false, false}, + {"false", false, false}, + {"FALSE", false, false}, + {"False", false, false}, + {"f", false, false}, + {"F", false, false}, + {false, false, false}, + + {"true", true, false}, + {"TRUE", true, false}, + {"True", true, false}, + {"t", true, false}, + {"T", true, false}, + {1, true, false}, + {true, true, false}, + {-1, true, false}, + + // errors + {"test", false, true}, + {testing.T{}, false, true}, + } + + for i, test := range tests { + errmsg := fmt.Sprintf("i = %d", i) // assert helper message + + v, err := ToBoolE(test.input) + if test.iserr { + assert.Error(t, err, errmsg) + continue + } + + assert.NoError(t, err, errmsg) + assert.Equal(t, test.expect, v, errmsg) + + // Non-E test + v = ToBool(test.input) + assert.Equal(t, test.expect, v, errmsg) + } +} + +func BenchmarkTooBool(b *testing.B) { + for i := 0; i < b.N; i++ { + if !ToBool(true) { + b.Fatal("ToBool returned false") + } + } +} + +func TestIndirectPointers(t *testing.T) { + x := 13 + y := &x + z := &y + + assert.Equal(t, ToInt(y), 13) + assert.Equal(t, ToInt(z), 13) +} + +func TestToTimeEE(t *testing.T) { + tests := []struct { + input interface{} + expect time.Time + iserr bool + }{ + {"2009-11-10 23:00:00 +0000 UTC", time.Date(2009, 11, 10, 23, 0, 0, 0, time.UTC), false}, // Time.String() + {"Tue Nov 10 23:00:00 2009", time.Date(2009, 11, 10, 23, 0, 0, 0, time.UTC), false}, // ANSIC + {"Tue Nov 10 23:00:00 UTC 2009", time.Date(2009, 11, 10, 23, 0, 0, 0, time.UTC), false}, // UnixDate + {"Tue Nov 10 23:00:00 +0000 2009", time.Date(2009, 11, 10, 23, 0, 0, 0, time.UTC), false}, // RubyDate + {"10 Nov 09 23:00 UTC", time.Date(2009, 11, 10, 23, 0, 0, 0, time.UTC), false}, // RFC822 + {"10 Nov 09 23:00 +0000", time.Date(2009, 11, 10, 23, 0, 0, 0, time.UTC), false}, // RFC822Z + {"Tuesday, 10-Nov-09 23:00:00 UTC", time.Date(2009, 11, 10, 23, 0, 0, 0, time.UTC), false}, // RFC850 + {"Tue, 10 Nov 2009 23:00:00 UTC", time.Date(2009, 11, 10, 23, 0, 0, 0, time.UTC), false}, // RFC1123 + {"Tue, 10 Nov 2009 23:00:00 +0000", time.Date(2009, 11, 10, 23, 0, 0, 0, time.UTC), false}, // RFC1123Z + {"2009-11-10T23:00:00Z", time.Date(2009, 11, 10, 23, 0, 0, 0, time.UTC), false}, // RFC3339 + {"2009-11-10T23:00:00Z", time.Date(2009, 11, 10, 23, 0, 0, 0, time.UTC), false}, // RFC3339Nano + {"11:00PM", time.Date(0, 1, 1, 23, 0, 0, 0, time.UTC), false}, // Kitchen + {"Nov 10 23:00:00", time.Date(0, 11, 10, 23, 0, 0, 0, time.UTC), false}, // Stamp + {"Nov 10 23:00:00.000", time.Date(0, 11, 10, 23, 0, 0, 0, time.UTC), false}, // StampMilli + {"Nov 10 23:00:00.000000", time.Date(0, 11, 10, 23, 0, 0, 0, time.UTC), false}, // StampMicro + {"Nov 10 23:00:00.000000000", time.Date(0, 11, 10, 23, 0, 0, 0, time.UTC), false}, // StampNano + {"2016-03-06 15:28:01-00:00", time.Date(2016, 3, 6, 15, 28, 1, 0, time.UTC), false}, // RFC3339 without T + {"2016-03-06 15:28:01", time.Date(2016, 3, 6, 15, 28, 1, 0, time.UTC), false}, + {"2016-03-06 15:28:01 -0000", time.Date(2016, 3, 6, 15, 28, 1, 0, time.UTC), false}, + {"2016-03-06 15:28:01 -00:00", time.Date(2016, 3, 6, 15, 28, 1, 0, time.UTC), false}, + {"2006-01-02", time.Date(2006, 1, 2, 0, 0, 0, 0, time.UTC), false}, + {"02 Jan 2006", time.Date(2006, 1, 2, 0, 0, 0, 0, time.UTC), false}, + {1472574600, time.Date(2016, 8, 30, 16, 30, 0, 0, time.UTC), false}, + {int(1482597504), time.Date(2016, 12, 24, 16, 38, 24, 0, time.UTC), false}, + {int64(1234567890), time.Date(2009, 2, 13, 23, 31, 30, 0, time.UTC), false}, + {int32(1234567890), time.Date(2009, 2, 13, 23, 31, 30, 0, time.UTC), false}, + {uint(1482597504), time.Date(2016, 12, 24, 16, 38, 24, 0, time.UTC), false}, + {uint64(1234567890), time.Date(2009, 2, 13, 23, 31, 30, 0, time.UTC), false}, + {uint32(1234567890), time.Date(2009, 2, 13, 23, 31, 30, 0, time.UTC), false}, + {time.Date(2009, 2, 13, 23, 31, 30, 0, time.UTC), time.Date(2009, 2, 13, 23, 31, 30, 0, time.UTC), false}, + // errors + {"2006", time.Time{}, true}, + {testing.T{}, time.Time{}, true}, + } + + for i, test := range tests { + errmsg := fmt.Sprintf("i = %d", i) // assert helper message + + v, err := ToTimeE(test.input) + if test.iserr { + assert.Error(t, err, errmsg) + continue + } + + assert.NoError(t, err, errmsg) + assert.Equal(t, test.expect, v.UTC(), errmsg) + + // Non-E test + v = ToTime(test.input) + assert.Equal(t, test.expect, v.UTC(), errmsg) + } +} + +func TestToDurationE(t *testing.T) { + var td time.Duration = 5 + + tests := []struct { + input interface{} + expect time.Duration + iserr bool + }{ + {time.Duration(5), td, false}, + {int(5), td, false}, + {int64(5), td, false}, + {int32(5), td, false}, + {int16(5), td, false}, + {int8(5), td, false}, + {uint(5), td, false}, + {uint64(5), td, false}, + {uint32(5), td, false}, + {uint16(5), td, false}, + {uint8(5), td, false}, + {float64(5), td, false}, + {float32(5), td, false}, + {string("5"), td, false}, + {string("5ns"), td, false}, + {string("5us"), time.Microsecond * td, false}, + {string("5µs"), time.Microsecond * td, false}, + {string("5ms"), time.Millisecond * td, false}, + {string("5s"), time.Second * td, false}, + {string("5m"), time.Minute * td, false}, + {string("5h"), time.Hour * td, false}, + // errors + {"test", 0, true}, + {testing.T{}, 0, true}, + } + + for i, test := range tests { + errmsg := fmt.Sprintf("i = %d", i) // assert helper message + + v, err := ToDurationE(test.input) + if test.iserr { + assert.Error(t, err, errmsg) + continue + } + + assert.NoError(t, err, errmsg) + assert.Equal(t, test.expect, v, errmsg) + + // Non-E test + v = ToDuration(test.input) + assert.Equal(t, test.expect, v, errmsg) + } +} diff --git a/vendor/github.com/spf13/cast/caste.go b/vendor/github.com/spf13/cast/caste.go new file mode 100644 index 0000000000..81511fe52d --- /dev/null +++ b/vendor/github.com/spf13/cast/caste.go @@ -0,0 +1,1146 @@ +// Copyright © 2014 Steve Francia . +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file. + +package cast + +import ( + "errors" + "fmt" + "html/template" + "reflect" + "strconv" + "strings" + "time" +) + +var errNegativeNotAllowed = errors.New("unable to cast negative value") + +// ToTimeE casts an interface to a time.Time type. +func ToTimeE(i interface{}) (tim time.Time, err error) { + i = indirect(i) + + switch v := i.(type) { + case time.Time: + return v, nil + case string: + return StringToDate(v) + case int: + return time.Unix(int64(v), 0), nil + case int64: + return time.Unix(v, 0), nil + case int32: + return time.Unix(int64(v), 0), nil + case uint: + return time.Unix(int64(v), 0), nil + case uint64: + return time.Unix(int64(v), 0), nil + case uint32: + return time.Unix(int64(v), 0), nil + default: + return time.Time{}, fmt.Errorf("unable to cast %#v of type %T to Time", i, i) + } +} + +// ToDurationE casts an interface to a time.Duration type. +func ToDurationE(i interface{}) (d time.Duration, err error) { + i = indirect(i) + + switch s := i.(type) { + case time.Duration: + return s, nil + case int, int64, int32, int16, int8, uint, uint64, uint32, uint16, uint8: + d = time.Duration(ToInt64(s)) + return + case float32, float64: + d = time.Duration(ToFloat64(s)) + return + case string: + if strings.ContainsAny(s, "nsuµmh") { + d, err = time.ParseDuration(s) + } else { + d, err = time.ParseDuration(s + "ns") + } + return + default: + err = fmt.Errorf("unable to cast %#v of type %T to Duration", i, i) + return + } +} + +// ToBoolE casts an interface to a bool type. +func ToBoolE(i interface{}) (bool, error) { + i = indirect(i) + + switch b := i.(type) { + case bool: + return b, nil + case nil: + return false, nil + case int: + if i.(int) != 0 { + return true, nil + } + return false, nil + case string: + return strconv.ParseBool(i.(string)) + default: + return false, fmt.Errorf("unable to cast %#v of type %T to bool", i, i) + } +} + +// ToFloat64E casts an interface to a float64 type. +func ToFloat64E(i interface{}) (float64, error) { + i = indirect(i) + + switch s := i.(type) { + case float64: + return s, nil + case float32: + return float64(s), nil + case int: + return float64(s), nil + case int64: + return float64(s), nil + case int32: + return float64(s), nil + case int16: + return float64(s), nil + case int8: + return float64(s), nil + case uint: + return float64(s), nil + case uint64: + return float64(s), nil + case uint32: + return float64(s), nil + case uint16: + return float64(s), nil + case uint8: + return float64(s), nil + case string: + v, err := strconv.ParseFloat(s, 64) + if err == nil { + return v, nil + } + return 0, fmt.Errorf("unable to cast %#v of type %T to float64", i, i) + case bool: + if s { + return 1, nil + } + return 0, nil + default: + return 0, fmt.Errorf("unable to cast %#v of type %T to float64", i, i) + } +} + +// ToFloat32E casts an interface to a float32 type. +func ToFloat32E(i interface{}) (float32, error) { + i = indirect(i) + + switch s := i.(type) { + case float64: + return float32(s), nil + case float32: + return s, nil + case int: + return float32(s), nil + case int64: + return float32(s), nil + case int32: + return float32(s), nil + case int16: + return float32(s), nil + case int8: + return float32(s), nil + case uint: + return float32(s), nil + case uint64: + return float32(s), nil + case uint32: + return float32(s), nil + case uint16: + return float32(s), nil + case uint8: + return float32(s), nil + case string: + v, err := strconv.ParseFloat(s, 32) + if err == nil { + return float32(v), nil + } + return 0, fmt.Errorf("unable to cast %#v of type %T to float32", i, i) + case bool: + if s { + return 1, nil + } + return 0, nil + default: + return 0, fmt.Errorf("unable to cast %#v of type %T to float32", i, i) + } +} + +// ToInt64E casts an interface to an int64 type. +func ToInt64E(i interface{}) (int64, error) { + i = indirect(i) + + switch s := i.(type) { + case int: + return int64(s), nil + case int64: + return s, nil + case int32: + return int64(s), nil + case int16: + return int64(s), nil + case int8: + return int64(s), nil + case uint: + return int64(s), nil + case uint64: + return int64(s), nil + case uint32: + return int64(s), nil + case uint16: + return int64(s), nil + case uint8: + return int64(s), nil + case float64: + return int64(s), nil + case float32: + return int64(s), nil + case string: + v, err := strconv.ParseInt(s, 0, 0) + if err == nil { + return v, nil + } + return 0, fmt.Errorf("unable to cast %#v of type %T to int64", i, i) + case bool: + if s { + return 1, nil + } + return 0, nil + case nil: + return 0, nil + default: + return 0, fmt.Errorf("unable to cast %#v of type %T to int64", i, i) + } +} + +// ToInt32E casts an interface to an int32 type. +func ToInt32E(i interface{}) (int32, error) { + i = indirect(i) + + switch s := i.(type) { + case int: + return int32(s), nil + case int64: + return int32(s), nil + case int32: + return s, nil + case int16: + return int32(s), nil + case int8: + return int32(s), nil + case uint: + return int32(s), nil + case uint64: + return int32(s), nil + case uint32: + return int32(s), nil + case uint16: + return int32(s), nil + case uint8: + return int32(s), nil + case float64: + return int32(s), nil + case float32: + return int32(s), nil + case string: + v, err := strconv.ParseInt(s, 0, 0) + if err == nil { + return int32(v), nil + } + return 0, fmt.Errorf("unable to cast %#v of type %T to int32", i, i) + case bool: + if s { + return 1, nil + } + return 0, nil + case nil: + return 0, nil + default: + return 0, fmt.Errorf("unable to cast %#v of type %T to int32", i, i) + } +} + +// ToInt16E casts an interface to an int16 type. +func ToInt16E(i interface{}) (int16, error) { + i = indirect(i) + + switch s := i.(type) { + case int: + return int16(s), nil + case int64: + return int16(s), nil + case int32: + return int16(s), nil + case int16: + return s, nil + case int8: + return int16(s), nil + case uint: + return int16(s), nil + case uint64: + return int16(s), nil + case uint32: + return int16(s), nil + case uint16: + return int16(s), nil + case uint8: + return int16(s), nil + case float64: + return int16(s), nil + case float32: + return int16(s), nil + case string: + v, err := strconv.ParseInt(s, 0, 0) + if err == nil { + return int16(v), nil + } + return 0, fmt.Errorf("unable to cast %#v of type %T to int16", i, i) + case bool: + if s { + return 1, nil + } + return 0, nil + case nil: + return 0, nil + default: + return 0, fmt.Errorf("unable to cast %#v of type %T to int16", i, i) + } +} + +// ToInt8E casts an interface to an int8 type. +func ToInt8E(i interface{}) (int8, error) { + i = indirect(i) + + switch s := i.(type) { + case int: + return int8(s), nil + case int64: + return int8(s), nil + case int32: + return int8(s), nil + case int16: + return int8(s), nil + case int8: + return s, nil + case uint: + return int8(s), nil + case uint64: + return int8(s), nil + case uint32: + return int8(s), nil + case uint16: + return int8(s), nil + case uint8: + return int8(s), nil + case float64: + return int8(s), nil + case float32: + return int8(s), nil + case string: + v, err := strconv.ParseInt(s, 0, 0) + if err == nil { + return int8(v), nil + } + return 0, fmt.Errorf("unable to cast %#v of type %T to int8", i, i) + case bool: + if s { + return 1, nil + } + return 0, nil + case nil: + return 0, nil + default: + return 0, fmt.Errorf("unable to cast %#v of type %T to int8", i, i) + } +} + +// ToIntE casts an interface to an int type. +func ToIntE(i interface{}) (int, error) { + i = indirect(i) + + switch s := i.(type) { + case int: + return s, nil + case int64: + return int(s), nil + case int32: + return int(s), nil + case int16: + return int(s), nil + case int8: + return int(s), nil + case uint: + return int(s), nil + case uint64: + return int(s), nil + case uint32: + return int(s), nil + case uint16: + return int(s), nil + case uint8: + return int(s), nil + case float64: + return int(s), nil + case float32: + return int(s), nil + case string: + v, err := strconv.ParseInt(s, 0, 0) + if err == nil { + return int(v), nil + } + return 0, fmt.Errorf("unable to cast %#v of type %T to int", i, i) + case bool: + if s { + return 1, nil + } + return 0, nil + case nil: + return 0, nil + default: + return 0, fmt.Errorf("unable to cast %#v of type %T to int", i, i) + } +} + +// ToUintE casts an interface to a uint type. +func ToUintE(i interface{}) (uint, error) { + i = indirect(i) + + switch s := i.(type) { + case string: + v, err := strconv.ParseUint(s, 0, 0) + if err == nil { + return uint(v), nil + } + return 0, fmt.Errorf("unable to cast %#v to uint: %s", i, err) + case int: + if s < 0 { + return 0, errNegativeNotAllowed + } + return uint(s), nil + case int64: + if s < 0 { + return 0, errNegativeNotAllowed + } + return uint(s), nil + case int32: + if s < 0 { + return 0, errNegativeNotAllowed + } + return uint(s), nil + case int16: + if s < 0 { + return 0, errNegativeNotAllowed + } + return uint(s), nil + case int8: + if s < 0 { + return 0, errNegativeNotAllowed + } + return uint(s), nil + case uint: + return s, nil + case uint64: + return uint(s), nil + case uint32: + return uint(s), nil + case uint16: + return uint(s), nil + case uint8: + return uint(s), nil + case float64: + if s < 0 { + return 0, errNegativeNotAllowed + } + return uint(s), nil + case float32: + if s < 0 { + return 0, errNegativeNotAllowed + } + return uint(s), nil + case bool: + if s { + return 1, nil + } + return 0, nil + case nil: + return 0, nil + default: + return 0, fmt.Errorf("unable to cast %#v of type %T to uint", i, i) + } +} + +// ToUint64E casts an interface to a uint64 type. +func ToUint64E(i interface{}) (uint64, error) { + i = indirect(i) + + switch s := i.(type) { + case string: + v, err := strconv.ParseUint(s, 0, 64) + if err == nil { + return v, nil + } + return 0, fmt.Errorf("unable to cast %#v to uint64: %s", i, err) + case int: + if s < 0 { + return 0, errNegativeNotAllowed + } + return uint64(s), nil + case int64: + if s < 0 { + return 0, errNegativeNotAllowed + } + return uint64(s), nil + case int32: + if s < 0 { + return 0, errNegativeNotAllowed + } + return uint64(s), nil + case int16: + if s < 0 { + return 0, errNegativeNotAllowed + } + return uint64(s), nil + case int8: + if s < 0 { + return 0, errNegativeNotAllowed + } + return uint64(s), nil + case uint: + return uint64(s), nil + case uint64: + return s, nil + case uint32: + return uint64(s), nil + case uint16: + return uint64(s), nil + case uint8: + return uint64(s), nil + case float32: + if s < 0 { + return 0, errNegativeNotAllowed + } + return uint64(s), nil + case float64: + if s < 0 { + return 0, errNegativeNotAllowed + } + return uint64(s), nil + case bool: + if s { + return 1, nil + } + return 0, nil + case nil: + return 0, nil + default: + return 0, fmt.Errorf("unable to cast %#v of type %T to uint64", i, i) + } +} + +// ToUint32E casts an interface to a uint32 type. +func ToUint32E(i interface{}) (uint32, error) { + i = indirect(i) + + switch s := i.(type) { + case string: + v, err := strconv.ParseUint(s, 0, 32) + if err == nil { + return uint32(v), nil + } + return 0, fmt.Errorf("unable to cast %#v to uint32: %s", i, err) + case int: + if s < 0 { + return 0, errNegativeNotAllowed + } + return uint32(s), nil + case int64: + if s < 0 { + return 0, errNegativeNotAllowed + } + return uint32(s), nil + case int32: + if s < 0 { + return 0, errNegativeNotAllowed + } + return uint32(s), nil + case int16: + if s < 0 { + return 0, errNegativeNotAllowed + } + return uint32(s), nil + case int8: + if s < 0 { + return 0, errNegativeNotAllowed + } + return uint32(s), nil + case uint: + return uint32(s), nil + case uint64: + return uint32(s), nil + case uint32: + return s, nil + case uint16: + return uint32(s), nil + case uint8: + return uint32(s), nil + case float64: + if s < 0 { + return 0, errNegativeNotAllowed + } + return uint32(s), nil + case float32: + if s < 0 { + return 0, errNegativeNotAllowed + } + return uint32(s), nil + case bool: + if s { + return 1, nil + } + return 0, nil + case nil: + return 0, nil + default: + return 0, fmt.Errorf("unable to cast %#v of type %T to uint32", i, i) + } +} + +// ToUint16E casts an interface to a uint16 type. +func ToUint16E(i interface{}) (uint16, error) { + i = indirect(i) + + switch s := i.(type) { + case string: + v, err := strconv.ParseUint(s, 0, 16) + if err == nil { + return uint16(v), nil + } + return 0, fmt.Errorf("unable to cast %#v to uint16: %s", i, err) + case int: + if s < 0 { + return 0, errNegativeNotAllowed + } + return uint16(s), nil + case int64: + if s < 0 { + return 0, errNegativeNotAllowed + } + return uint16(s), nil + case int32: + if s < 0 { + return 0, errNegativeNotAllowed + } + return uint16(s), nil + case int16: + if s < 0 { + return 0, errNegativeNotAllowed + } + return uint16(s), nil + case int8: + if s < 0 { + return 0, errNegativeNotAllowed + } + return uint16(s), nil + case uint: + return uint16(s), nil + case uint64: + return uint16(s), nil + case uint32: + return uint16(s), nil + case uint16: + return s, nil + case uint8: + return uint16(s), nil + case float64: + if s < 0 { + return 0, errNegativeNotAllowed + } + return uint16(s), nil + case float32: + if s < 0 { + return 0, errNegativeNotAllowed + } + return uint16(s), nil + case bool: + if s { + return 1, nil + } + return 0, nil + case nil: + return 0, nil + default: + return 0, fmt.Errorf("unable to cast %#v of type %T to uint16", i, i) + } +} + +// ToUint8E casts an interface to a uint type. +func ToUint8E(i interface{}) (uint8, error) { + i = indirect(i) + + switch s := i.(type) { + case string: + v, err := strconv.ParseUint(s, 0, 8) + if err == nil { + return uint8(v), nil + } + return 0, fmt.Errorf("unable to cast %#v to uint8: %s", i, err) + case int: + if s < 0 { + return 0, errNegativeNotAllowed + } + return uint8(s), nil + case int64: + if s < 0 { + return 0, errNegativeNotAllowed + } + return uint8(s), nil + case int32: + if s < 0 { + return 0, errNegativeNotAllowed + } + return uint8(s), nil + case int16: + if s < 0 { + return 0, errNegativeNotAllowed + } + return uint8(s), nil + case int8: + if s < 0 { + return 0, errNegativeNotAllowed + } + return uint8(s), nil + case uint: + return uint8(s), nil + case uint64: + return uint8(s), nil + case uint32: + return uint8(s), nil + case uint16: + return uint8(s), nil + case uint8: + return s, nil + case float64: + if s < 0 { + return 0, errNegativeNotAllowed + } + return uint8(s), nil + case float32: + if s < 0 { + return 0, errNegativeNotAllowed + } + return uint8(s), nil + case bool: + if s { + return 1, nil + } + return 0, nil + case nil: + return 0, nil + default: + return 0, fmt.Errorf("unable to cast %#v of type %T to uint8", i, i) + } +} + +// From html/template/content.go +// Copyright 2011 The Go Authors. All rights reserved. +// indirect returns the value, after dereferencing as many times +// as necessary to reach the base type (or nil). +func indirect(a interface{}) interface{} { + if a == nil { + return nil + } + if t := reflect.TypeOf(a); t.Kind() != reflect.Ptr { + // Avoid creating a reflect.Value if it's not a pointer. + return a + } + v := reflect.ValueOf(a) + for v.Kind() == reflect.Ptr && !v.IsNil() { + v = v.Elem() + } + return v.Interface() +} + +// From html/template/content.go +// Copyright 2011 The Go Authors. All rights reserved. +// indirectToStringerOrError returns the value, after dereferencing as many times +// as necessary to reach the base type (or nil) or an implementation of fmt.Stringer +// or error, +func indirectToStringerOrError(a interface{}) interface{} { + if a == nil { + return nil + } + + var errorType = reflect.TypeOf((*error)(nil)).Elem() + var fmtStringerType = reflect.TypeOf((*fmt.Stringer)(nil)).Elem() + + v := reflect.ValueOf(a) + for !v.Type().Implements(fmtStringerType) && !v.Type().Implements(errorType) && v.Kind() == reflect.Ptr && !v.IsNil() { + v = v.Elem() + } + return v.Interface() +} + +// ToStringE casts an interface to a string type. +func ToStringE(i interface{}) (string, error) { + i = indirectToStringerOrError(i) + + switch s := i.(type) { + case string: + return s, nil + case bool: + return strconv.FormatBool(s), nil + case float64: + return strconv.FormatFloat(s, 'f', -1, 64), nil + case float32: + return strconv.FormatFloat(float64(s), 'f', -1, 32), nil + case int: + return strconv.Itoa(s), nil + case int64: + return strconv.FormatInt(s, 10), nil + case int32: + return strconv.Itoa(int(s)), nil + case int16: + return strconv.FormatInt(int64(s), 10), nil + case int8: + return strconv.FormatInt(int64(s), 10), nil + case uint: + return strconv.FormatInt(int64(s), 10), nil + case uint64: + return strconv.FormatInt(int64(s), 10), nil + case uint32: + return strconv.FormatInt(int64(s), 10), nil + case uint16: + return strconv.FormatInt(int64(s), 10), nil + case uint8: + return strconv.FormatInt(int64(s), 10), nil + case []byte: + return string(s), nil + case template.HTML: + return string(s), nil + case template.URL: + return string(s), nil + case template.JS: + return string(s), nil + case template.CSS: + return string(s), nil + case template.HTMLAttr: + return string(s), nil + case nil: + return "", nil + case fmt.Stringer: + return s.String(), nil + case error: + return s.Error(), nil + default: + return "", fmt.Errorf("unable to cast %#v of type %T to string", i, i) + } +} + +// ToStringMapStringE casts an interface to a map[string]string type. +func ToStringMapStringE(i interface{}) (map[string]string, error) { + var m = map[string]string{} + + switch v := i.(type) { + case map[string]string: + return v, nil + case map[string]interface{}: + for k, val := range v { + m[ToString(k)] = ToString(val) + } + return m, nil + case map[interface{}]string: + for k, val := range v { + m[ToString(k)] = ToString(val) + } + return m, nil + case map[interface{}]interface{}: + for k, val := range v { + m[ToString(k)] = ToString(val) + } + return m, nil + default: + return m, fmt.Errorf("unable to cast %#v of type %T to map[string]string", i, i) + } +} + +// ToStringMapStringSliceE casts an interface to a map[string][]string type. +func ToStringMapStringSliceE(i interface{}) (map[string][]string, error) { + var m = map[string][]string{} + + switch v := i.(type) { + case map[string][]string: + return v, nil + case map[string][]interface{}: + for k, val := range v { + m[ToString(k)] = ToStringSlice(val) + } + return m, nil + case map[string]string: + for k, val := range v { + m[ToString(k)] = []string{val} + } + case map[string]interface{}: + for k, val := range v { + switch vt := val.(type) { + case []interface{}: + m[ToString(k)] = ToStringSlice(vt) + case []string: + m[ToString(k)] = vt + default: + m[ToString(k)] = []string{ToString(val)} + } + } + return m, nil + case map[interface{}][]string: + for k, val := range v { + m[ToString(k)] = ToStringSlice(val) + } + return m, nil + case map[interface{}]string: + for k, val := range v { + m[ToString(k)] = ToStringSlice(val) + } + return m, nil + case map[interface{}][]interface{}: + for k, val := range v { + m[ToString(k)] = ToStringSlice(val) + } + return m, nil + case map[interface{}]interface{}: + for k, val := range v { + key, err := ToStringE(k) + if err != nil { + return m, fmt.Errorf("unable to cast %#v of type %T to map[string][]string", i, i) + } + value, err := ToStringSliceE(val) + if err != nil { + return m, fmt.Errorf("unable to cast %#v of type %T to map[string][]string", i, i) + } + m[key] = value + } + default: + return m, fmt.Errorf("unable to cast %#v of type %T to map[string][]string", i, i) + } + return m, nil +} + +// ToStringMapBoolE casts an interface to a map[string]bool type. +func ToStringMapBoolE(i interface{}) (map[string]bool, error) { + var m = map[string]bool{} + + switch v := i.(type) { + case map[interface{}]interface{}: + for k, val := range v { + m[ToString(k)] = ToBool(val) + } + return m, nil + case map[string]interface{}: + for k, val := range v { + m[ToString(k)] = ToBool(val) + } + return m, nil + case map[string]bool: + return v, nil + default: + return m, fmt.Errorf("unable to cast %#v of type %T to map[string]bool", i, i) + } +} + +// ToStringMapE casts an interface to a map[string]interface{} type. +func ToStringMapE(i interface{}) (map[string]interface{}, error) { + var m = map[string]interface{}{} + + switch v := i.(type) { + case map[interface{}]interface{}: + for k, val := range v { + m[ToString(k)] = val + } + return m, nil + case map[string]interface{}: + return v, nil + default: + return m, fmt.Errorf("unable to cast %#v of type %T to map[string]interface{}", i, i) + } +} + +// ToSliceE casts an interface to a []interface{} type. +func ToSliceE(i interface{}) ([]interface{}, error) { + var s []interface{} + + switch v := i.(type) { + case []interface{}: + return append(s, v...), nil + case []map[string]interface{}: + for _, u := range v { + s = append(s, u) + } + return s, nil + default: + return s, fmt.Errorf("unable to cast %#v of type %T to []interface{}", i, i) + } +} + +// ToBoolSliceE casts an interface to a []bool type. +func ToBoolSliceE(i interface{}) ([]bool, error) { + if i == nil { + return []bool{}, fmt.Errorf("unable to cast %#v of type %T to []bool", i, i) + } + + switch v := i.(type) { + case []bool: + return v, nil + } + + kind := reflect.TypeOf(i).Kind() + switch kind { + case reflect.Slice, reflect.Array: + s := reflect.ValueOf(i) + a := make([]bool, s.Len()) + for j := 0; j < s.Len(); j++ { + val, err := ToBoolE(s.Index(j).Interface()) + if err != nil { + return []bool{}, fmt.Errorf("unable to cast %#v of type %T to []bool", i, i) + } + a[j] = val + } + return a, nil + default: + return []bool{}, fmt.Errorf("unable to cast %#v of type %T to []bool", i, i) + } +} + +// ToStringSliceE casts an interface to a []string type. +func ToStringSliceE(i interface{}) ([]string, error) { + var a []string + + switch v := i.(type) { + case []interface{}: + for _, u := range v { + a = append(a, ToString(u)) + } + return a, nil + case []string: + return v, nil + case string: + return strings.Fields(v), nil + case interface{}: + str, err := ToStringE(v) + if err != nil { + return a, fmt.Errorf("unable to cast %#v of type %T to []string", i, i) + } + return []string{str}, nil + default: + return a, fmt.Errorf("unable to cast %#v of type %T to []string", i, i) + } +} + +// ToIntSliceE casts an interface to a []int type. +func ToIntSliceE(i interface{}) ([]int, error) { + if i == nil { + return []int{}, fmt.Errorf("unable to cast %#v of type %T to []int", i, i) + } + + switch v := i.(type) { + case []int: + return v, nil + } + + kind := reflect.TypeOf(i).Kind() + switch kind { + case reflect.Slice, reflect.Array: + s := reflect.ValueOf(i) + a := make([]int, s.Len()) + for j := 0; j < s.Len(); j++ { + val, err := ToIntE(s.Index(j).Interface()) + if err != nil { + return []int{}, fmt.Errorf("unable to cast %#v of type %T to []int", i, i) + } + a[j] = val + } + return a, nil + default: + return []int{}, fmt.Errorf("unable to cast %#v of type %T to []int", i, i) + } +} + +// ToDurationSliceE casts an interface to a []time.Duration type. +func ToDurationSliceE(i interface{}) ([]time.Duration, error) { + if i == nil { + return []time.Duration{}, fmt.Errorf("unable to cast %#v of type %T to []time.Duration", i, i) + } + + switch v := i.(type) { + case []time.Duration: + return v, nil + } + + kind := reflect.TypeOf(i).Kind() + switch kind { + case reflect.Slice, reflect.Array: + s := reflect.ValueOf(i) + a := make([]time.Duration, s.Len()) + for j := 0; j < s.Len(); j++ { + val, err := ToDurationE(s.Index(j).Interface()) + if err != nil { + return []time.Duration{}, fmt.Errorf("unable to cast %#v of type %T to []time.Duration", i, i) + } + a[j] = val + } + return a, nil + default: + return []time.Duration{}, fmt.Errorf("unable to cast %#v of type %T to []time.Duration", i, i) + } +} + +// StringToDate attempts to parse a string into a time.Time type using a +// predefined list of formats. If no suitable format is found, an error is +// returned. +func StringToDate(s string) (time.Time, error) { + return parseDateWith(s, []string{ + time.RFC3339, + "2006-01-02T15:04:05", // iso8601 without timezone + time.RFC1123Z, + time.RFC1123, + time.RFC822Z, + time.RFC822, + time.RFC850, + time.ANSIC, + time.UnixDate, + time.RubyDate, + "2006-01-02 15:04:05.999999999 -0700 MST", // Time.String() + "2006-01-02", + "02 Jan 2006", + "2006-01-02 15:04:05 -07:00", + "2006-01-02 15:04:05 -0700", + "2006-01-02 15:04:05Z07:00", // RFC3339 without T + "2006-01-02 15:04:05", + time.Kitchen, + time.Stamp, + time.StampMilli, + time.StampMicro, + time.StampNano, + }) +} + +func parseDateWith(s string, dates []string) (d time.Time, e error) { + for _, dateType := range dates { + if d, e = time.Parse(dateType, s); e == nil { + return + } + } + return d, fmt.Errorf("unable to parse date: %s", s) +} diff --git a/vendor/github.com/spf13/jwalterweatherman/.gitignore b/vendor/github.com/spf13/jwalterweatherman/.gitignore new file mode 100644 index 0000000000..00268614f0 --- /dev/null +++ b/vendor/github.com/spf13/jwalterweatherman/.gitignore @@ -0,0 +1,22 @@ +# 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 diff --git a/vendor/github.com/spf13/jwalterweatherman/LICENSE b/vendor/github.com/spf13/jwalterweatherman/LICENSE new file mode 100644 index 0000000000..4527efb9c0 --- /dev/null +++ b/vendor/github.com/spf13/jwalterweatherman/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Steve Francia + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/vendor/github.com/spf13/jwalterweatherman/README.md b/vendor/github.com/spf13/jwalterweatherman/README.md new file mode 100644 index 0000000000..350a9683db --- /dev/null +++ b/vendor/github.com/spf13/jwalterweatherman/README.md @@ -0,0 +1,148 @@ +jWalterWeatherman +================= + +Seamless printing to the terminal (stdout) and logging to a io.Writer +(file) that’s as easy to use as fmt.Println. + +![and_that__s_why_you_always_leave_a_note_by_jonnyetc-d57q7um](https://cloud.githubusercontent.com/assets/173412/11002937/ccd01654-847d-11e5-828e-12ebaf582eaf.jpg) +Graphic by [JonnyEtc](http://jonnyetc.deviantart.com/art/And-That-s-Why-You-Always-Leave-a-Note-315311422) + +JWW is primarily a wrapper around the excellent standard log library. It +provides a few advantages over using the standard log library alone. + +1. Ready to go out of the box. +2. One library for both printing to the terminal and logging (to files). +3. Really easy to log to either a temp file or a file you specify. + + +I really wanted a very straightforward library that could seamlessly do +the following things. + +1. Replace all the println, printf, etc statements thought my code with + something more useful +2. Allow the user to easily control what levels are printed to stdout +3. Allow the user to easily control what levels are logged +4. Provide an easy mechanism (like fmt.Println) to print info to the user + which can be easily logged as well +5. Due to 2 & 3 provide easy verbose mode for output and logs +6. Not have any unnecessary initialization cruft. Just use it. + +# Usage + +## Step 1. Use it +Put calls throughout your source based on type of feedback. +No initialization or setup needs to happen. Just start calling things. + +Available Loggers are: + + * TRACE + * DEBUG + * INFO + * WARN + * ERROR + * CRITICAL + * FATAL + +These each are loggers based on the log standard library and follow the +standard usage. Eg. + +```go + import ( + jww "github.com/spf13/jwalterweatherman" + ) + + ... + + if err != nil { + + // This is a pretty serious error and the user should know about + // it. It will be printed to the terminal as well as logged under the + // default thresholds. + + jww.ERROR.Println(err) + } + + if err2 != nil { + // This error isn’t going to materially change the behavior of the + // application, but it’s something that may not be what the user + // expects. Under the default thresholds, Warn will be logged, but + // not printed to the terminal. + + jww.WARN.Println(err2) + } + + // Information that’s relevant to what’s happening, but not very + // important for the user. Under the default thresholds this will be + // discarded. + + jww.INFO.Printf("information %q", response) + +``` + +NOTE: You can also use the library in a non-global setting by creating an instance of a Notebook: + +```go +notepad = jww.NewNotepad(jww.LevelInfo, jww.LevelTrace, os.Stdout, ioutil.Discard, "", log.Ldate|log.Ltime) +notepad.WARN.Println("Some warning"") +``` + +_Why 7 levels?_ + +Maybe you think that 7 levels are too much for any application... and you +are probably correct. Just because there are seven levels doesn’t mean +that you should be using all 7 levels. Pick the right set for your needs. +Remember they only have to mean something to your project. + +## Step 2. Optionally configure JWW + +Under the default thresholds : + + * Debug, Trace & Info goto /dev/null + * Warn and above is logged (when a log file/io.Writer is provided) + * Error and above is printed to the terminal (stdout) + +### Changing the thresholds + +The threshold can be changed at any time, but will only affect calls that +execute after the change was made. + +This is very useful if your application has a verbose mode. Of course you +can decide what verbose means to you or even have multiple levels of +verbosity. + + +```go + import ( + jww "github.com/spf13/jwalterweatherman" + ) + + if Verbose { + jww.SetLogThreshold(jww.LevelTrace) + jww.SetStdoutThreshold(jww.LevelInfo) + } +``` + +Note that JWW's own internal output uses log levels as well, so set the log +level before making any other calls if you want to see what it's up to. + + +### Setting a log file + +JWW can log to any `io.Writer`: + + +```go + + jww.SetLogOutput(customWriter) + +``` + + +# More information + +This is an early release. I’ve been using it for a while and this is the +third interface I’ve tried. I like this one pretty well, but no guarantees +that it won’t change a bit. + +I wrote this for use in [hugo](http://hugo.spf13.com). If you are looking +for a static website engine that’s super fast please checkout Hugo. diff --git a/vendor/github.com/spf13/jwalterweatherman/default_notepad.go b/vendor/github.com/spf13/jwalterweatherman/default_notepad.go new file mode 100644 index 0000000000..bcb763403c --- /dev/null +++ b/vendor/github.com/spf13/jwalterweatherman/default_notepad.go @@ -0,0 +1,113 @@ +// Copyright © 2016 Steve Francia . +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file. + +package jwalterweatherman + +import ( + "io" + "io/ioutil" + "log" + "os" +) + +var ( + TRACE *log.Logger + DEBUG *log.Logger + INFO *log.Logger + WARN *log.Logger + ERROR *log.Logger + CRITICAL *log.Logger + FATAL *log.Logger + + LOG *log.Logger + FEEDBACK *Feedback + + defaultNotepad *Notepad +) + +func reloadDefaultNotepad() { + TRACE = defaultNotepad.TRACE + DEBUG = defaultNotepad.DEBUG + INFO = defaultNotepad.INFO + WARN = defaultNotepad.WARN + ERROR = defaultNotepad.ERROR + CRITICAL = defaultNotepad.CRITICAL + FATAL = defaultNotepad.FATAL + + LOG = defaultNotepad.LOG + FEEDBACK = defaultNotepad.FEEDBACK +} + +func init() { + defaultNotepad = NewNotepad(LevelError, LevelWarn, os.Stdout, ioutil.Discard, "", log.Ldate|log.Ltime) + reloadDefaultNotepad() +} + +// SetLogThreshold set the log threshold for the default notepad. Trace by default. +func SetLogThreshold(threshold Threshold) { + defaultNotepad.SetLogThreshold(threshold) + reloadDefaultNotepad() +} + +// SetLogOutput set the log output for the default notepad. Discarded by default. +func SetLogOutput(handle io.Writer) { + defaultNotepad.SetLogOutput(handle) + reloadDefaultNotepad() +} + +// SetStdoutThreshold set the standard output threshold for the default notepad. +// Info by default. +func SetStdoutThreshold(threshold Threshold) { + defaultNotepad.SetStdoutThreshold(threshold) + reloadDefaultNotepad() +} + +// SetPrefix set the prefix for the default logger. Empty by default. +func SetPrefix(prefix string) { + defaultNotepad.SetPrefix(prefix) + reloadDefaultNotepad() +} + +// SetFlags set the flags for the default logger. "log.Ldate | log.Ltime" by default. +func SetFlags(flags int) { + defaultNotepad.SetFlags(flags) + reloadDefaultNotepad() +} + +// Level returns the current global log threshold. +func LogThreshold() Threshold { + return defaultNotepad.logThreshold +} + +// Level returns the current global output threshold. +func StdoutThreshold() Threshold { + return defaultNotepad.stdoutThreshold +} + +// GetStdoutThreshold returns the defined Treshold for the log logger. +func GetLogThreshold() Threshold { + return defaultNotepad.GetLogThreshold() +} + +// GetStdoutThreshold returns the Treshold for the stdout logger. +func GetStdoutThreshold() Threshold { + return defaultNotepad.GetStdoutThreshold() +} + +// LogCountForLevel returns the number of log invocations for a given threshold. +func LogCountForLevel(l Threshold) uint64 { + return defaultNotepad.LogCountForLevel(l) +} + +// LogCountForLevelsGreaterThanorEqualTo returns the number of log invocations +// greater than or equal to a given threshold. +func LogCountForLevelsGreaterThanorEqualTo(threshold Threshold) uint64 { + return defaultNotepad.LogCountForLevelsGreaterThanorEqualTo(threshold) +} + +// ResetLogCounters resets the invocation counters for all levels. +func ResetLogCounters() { + defaultNotepad.ResetLogCounters() +} diff --git a/vendor/github.com/spf13/jwalterweatherman/default_notepad_test.go b/vendor/github.com/spf13/jwalterweatherman/default_notepad_test.go new file mode 100644 index 0000000000..2670c8d961 --- /dev/null +++ b/vendor/github.com/spf13/jwalterweatherman/default_notepad_test.go @@ -0,0 +1,102 @@ +// Copyright © 2016 Steve Francia . +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file. + +package jwalterweatherman + +import ( + "bytes" + "io/ioutil" + "sync" + "testing" + + "github.com/stretchr/testify/require" +) + +func TestThresholds(t *testing.T) { + SetStdoutThreshold(LevelError) + require.Equal(t, StdoutThreshold(), LevelError) + SetLogThreshold(LevelCritical) + require.Equal(t, LogThreshold(), LevelCritical) + require.NotEqual(t, StdoutThreshold(), LevelCritical) + SetStdoutThreshold(LevelWarn) + require.Equal(t, StdoutThreshold(), LevelWarn) +} + +func TestDefaultLogging(t *testing.T) { + var outputBuf, logBuf bytes.Buffer + + defaultNotepad.logHandle = &logBuf + defaultNotepad.outHandle = &outputBuf + + SetLogThreshold(LevelWarn) + SetStdoutThreshold(LevelError) + + FATAL.Println("fatal err") + CRITICAL.Println("critical err") + ERROR.Println("an error") + WARN.Println("a warning") + INFO.Println("information") + DEBUG.Println("debugging info") + TRACE.Println("trace") + + require.Contains(t, logBuf.String(), "fatal err") + require.Contains(t, logBuf.String(), "critical err") + require.Contains(t, logBuf.String(), "an error") + require.Contains(t, logBuf.String(), "a warning") + require.NotContains(t, logBuf.String(), "information") + require.NotContains(t, logBuf.String(), "debugging info") + require.NotContains(t, logBuf.String(), "trace") + + require.Contains(t, outputBuf.String(), "fatal err") + require.Contains(t, outputBuf.String(), "critical err") + require.Contains(t, outputBuf.String(), "an error") + require.NotContains(t, outputBuf.String(), "a warning") + require.NotContains(t, outputBuf.String(), "information") + require.NotContains(t, outputBuf.String(), "debugging info") + require.NotContains(t, outputBuf.String(), "trace") +} + +func TestLogCounter(t *testing.T) { + defaultNotepad.logHandle = ioutil.Discard + defaultNotepad.outHandle = ioutil.Discard + + SetLogThreshold(LevelTrace) + SetStdoutThreshold(LevelTrace) + + FATAL.Println("fatal err") + CRITICAL.Println("critical err") + WARN.Println("a warning") + WARN.Println("another warning") + INFO.Println("information") + DEBUG.Println("debugging info") + TRACE.Println("trace") + + wg := &sync.WaitGroup{} + + for i := 0; i < 10; i++ { + wg.Add(1) + go func() { + defer wg.Done() + for j := 0; j < 10; j++ { + ERROR.Println("error", j) + // check for data races + require.True(t, LogCountForLevel(LevelError) > uint64(j)) + require.True(t, LogCountForLevelsGreaterThanorEqualTo(LevelError) > uint64(j)) + } + }() + + } + + wg.Wait() + + require.Equal(t, uint64(1), LogCountForLevel(LevelFatal)) + require.Equal(t, uint64(1), LogCountForLevel(LevelCritical)) + require.Equal(t, uint64(2), LogCountForLevel(LevelWarn)) + require.Equal(t, uint64(1), LogCountForLevel(LevelInfo)) + require.Equal(t, uint64(1), LogCountForLevel(LevelDebug)) + require.Equal(t, uint64(1), LogCountForLevel(LevelTrace)) + require.Equal(t, uint64(100), LogCountForLevel(LevelError)) + require.Equal(t, uint64(102), LogCountForLevelsGreaterThanorEqualTo(LevelError)) +} diff --git a/vendor/github.com/spf13/jwalterweatherman/log_counter.go b/vendor/github.com/spf13/jwalterweatherman/log_counter.go new file mode 100644 index 0000000000..11423ac41e --- /dev/null +++ b/vendor/github.com/spf13/jwalterweatherman/log_counter.go @@ -0,0 +1,55 @@ +// Copyright © 2016 Steve Francia . +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file. + +package jwalterweatherman + +import ( + "sync/atomic" +) + +type logCounter struct { + counter uint64 +} + +func (c *logCounter) incr() { + atomic.AddUint64(&c.counter, 1) +} + +func (c *logCounter) resetCounter() { + atomic.StoreUint64(&c.counter, 0) +} + +func (c *logCounter) getCount() uint64 { + return atomic.LoadUint64(&c.counter) +} + +func (c *logCounter) Write(p []byte) (n int, err error) { + c.incr() + return len(p), nil +} + +// LogCountForLevel returns the number of log invocations for a given threshold. +func (n *Notepad) LogCountForLevel(l Threshold) uint64 { + return n.logCounters[l].getCount() +} + +// LogCountForLevelsGreaterThanorEqualTo returns the number of log invocations +// greater than or equal to a given threshold. +func (n *Notepad) LogCountForLevelsGreaterThanorEqualTo(threshold Threshold) uint64 { + var cnt uint64 + + for i := int(threshold); i < len(n.logCounters); i++ { + cnt += n.LogCountForLevel(Threshold(i)) + } + + return cnt +} + +// ResetLogCounters resets the invocation counters for all levels. +func (n *Notepad) ResetLogCounters() { + for _, np := range n.logCounters { + np.resetCounter() + } +} diff --git a/vendor/github.com/spf13/jwalterweatherman/notepad.go b/vendor/github.com/spf13/jwalterweatherman/notepad.go new file mode 100644 index 0000000000..ae5aaf7114 --- /dev/null +++ b/vendor/github.com/spf13/jwalterweatherman/notepad.go @@ -0,0 +1,194 @@ +// Copyright © 2016 Steve Francia . +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file. + +package jwalterweatherman + +import ( + "fmt" + "io" + "log" +) + +type Threshold int + +func (t Threshold) String() string { + return prefixes[t] +} + +const ( + LevelTrace Threshold = iota + LevelDebug + LevelInfo + LevelWarn + LevelError + LevelCritical + LevelFatal +) + +var prefixes map[Threshold]string = map[Threshold]string{ + LevelTrace: "TRACE", + LevelDebug: "DEBUG", + LevelInfo: "INFO", + LevelWarn: "WARN", + LevelError: "ERROR", + LevelCritical: "CRITICAL", + LevelFatal: "FATAL", +} + +// Notepad is where you leave a note! +type Notepad struct { + TRACE *log.Logger + DEBUG *log.Logger + INFO *log.Logger + WARN *log.Logger + ERROR *log.Logger + CRITICAL *log.Logger + FATAL *log.Logger + + LOG *log.Logger + FEEDBACK *Feedback + + loggers [7]**log.Logger + logHandle io.Writer + outHandle io.Writer + logThreshold Threshold + stdoutThreshold Threshold + prefix string + flags int + + // One per Threshold + logCounters [7]*logCounter +} + +// NewNotepad create a new notepad. +func NewNotepad(outThreshold Threshold, logThreshold Threshold, outHandle, logHandle io.Writer, prefix string, flags int) *Notepad { + n := &Notepad{} + + n.loggers = [7]**log.Logger{&n.TRACE, &n.DEBUG, &n.INFO, &n.WARN, &n.ERROR, &n.CRITICAL, &n.FATAL} + n.outHandle = outHandle + n.logHandle = logHandle + n.stdoutThreshold = outThreshold + n.logThreshold = logThreshold + + if len(prefix) != 0 { + n.prefix = "[" + prefix + "] " + } else { + n.prefix = "" + } + + n.flags = flags + + n.LOG = log.New(n.logHandle, + "LOG: ", + n.flags) + n.FEEDBACK = &Feedback{out: log.New(outHandle, "", 0), log: n.LOG} + + n.init() + return n +} + +// init creates the loggers for each level depending on the notepad thresholds. +func (n *Notepad) init() { + logAndOut := io.MultiWriter(n.outHandle, n.logHandle) + + for t, logger := range n.loggers { + threshold := Threshold(t) + counter := &logCounter{} + n.logCounters[t] = counter + prefix := n.prefix + threshold.String() + " " + + switch { + case threshold >= n.logThreshold && threshold >= n.stdoutThreshold: + *logger = log.New(io.MultiWriter(counter, logAndOut), prefix, n.flags) + + case threshold >= n.logThreshold: + *logger = log.New(io.MultiWriter(counter, n.logHandle), prefix, n.flags) + + case threshold >= n.stdoutThreshold: + *logger = log.New(io.MultiWriter(counter, n.outHandle), prefix, n.flags) + + default: + // counter doesn't care about prefix and flags, so don't use them + // for performance. + *logger = log.New(counter, "", 0) + } + } +} + +// SetLogThreshold changes the threshold above which messages are written to the +// log file. +func (n *Notepad) SetLogThreshold(threshold Threshold) { + n.logThreshold = threshold + n.init() +} + +// SetLogOutput changes the file where log messages are written. +func (n *Notepad) SetLogOutput(handle io.Writer) { + n.logHandle = handle + n.init() +} + +// GetStdoutThreshold returns the defined Treshold for the log logger. +func (n *Notepad) GetLogThreshold() Threshold { + return n.logThreshold +} + +// SetStdoutThreshold changes the threshold above which messages are written to the +// standard output. +func (n *Notepad) SetStdoutThreshold(threshold Threshold) { + n.stdoutThreshold = threshold + n.init() +} + +// GetStdoutThreshold returns the Treshold for the stdout logger. +func (n *Notepad) GetStdoutThreshold() Threshold { + return n.stdoutThreshold +} + +// SetPrefix changes the prefix used by the notepad. Prefixes are displayed between +// brackets at the beginning of the line. An empty prefix won't be displayed at all. +func (n *Notepad) SetPrefix(prefix string) { + if len(prefix) != 0 { + n.prefix = "[" + prefix + "] " + } else { + n.prefix = "" + } + n.init() +} + +// SetFlags choose which flags the logger will display (after prefix and message +// level). See the package log for more informations on this. +func (n *Notepad) SetFlags(flags int) { + n.flags = flags + n.init() +} + +// Feedback writes plainly to the outHandle while +// logging with the standard extra information (date, file, etc). +type Feedback struct { + out *log.Logger + log *log.Logger +} + +func (fb *Feedback) Println(v ...interface{}) { + fb.output(fmt.Sprintln(v...)) +} + +func (fb *Feedback) Printf(format string, v ...interface{}) { + fb.output(fmt.Sprintf(format, v...)) +} + +func (fb *Feedback) Print(v ...interface{}) { + fb.output(fmt.Sprint(v...)) +} + +func (fb *Feedback) output(s string) { + if fb.out != nil { + fb.out.Output(2, s) + } + if fb.log != nil { + fb.log.Output(2, s) + } +} diff --git a/vendor/github.com/spf13/jwalterweatherman/notepad_test.go b/vendor/github.com/spf13/jwalterweatherman/notepad_test.go new file mode 100644 index 0000000000..69ad6f8fc6 --- /dev/null +++ b/vendor/github.com/spf13/jwalterweatherman/notepad_test.go @@ -0,0 +1,50 @@ +// Copyright © 2016 Steve Francia . +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file. + +package jwalterweatherman + +import ( + "bytes" + "testing" + + "github.com/stretchr/testify/require" +) + +func TestNotepad(t *testing.T) { + var logHandle, outHandle bytes.Buffer + + n := NewNotepad(LevelCritical, LevelError, &outHandle, &logHandle, "TestNotePad", 0) + + require.Equal(t, LevelCritical, n.GetStdoutThreshold()) + require.Equal(t, LevelError, n.GetLogThreshold()) + + n.DEBUG.Println("Some debug") + n.ERROR.Println("Some error") + n.CRITICAL.Println("Some critical error") + + require.Contains(t, logHandle.String(), "[TestNotePad] ERROR Some error") + require.NotContains(t, logHandle.String(), "Some debug") + require.NotContains(t, outHandle.String(), "Some error") + require.Contains(t, outHandle.String(), "Some critical error") + + require.Equal(t, n.LogCountForLevel(LevelError), uint64(1)) + require.Equal(t, n.LogCountForLevel(LevelDebug), uint64(1)) + require.Equal(t, n.LogCountForLevel(LevelTrace), uint64(0)) +} + +func TestThresholdString(t *testing.T) { + require.Equal(t, LevelError.String(), "ERROR") + require.Equal(t, LevelTrace.String(), "TRACE") +} + +func BenchmarkLogPrintOnlyToCounter(b *testing.B) { + var logHandle, outHandle bytes.Buffer + n := NewNotepad(LevelCritical, LevelCritical, &outHandle, &logHandle, "TestNotePad", 0) + + b.ResetTimer() + for i := 0; i < b.N; i++ { + n.INFO.Print("Test") + } +} diff --git a/vendor/github.com/spf13/viper/.gitignore b/vendor/github.com/spf13/viper/.gitignore new file mode 100644 index 0000000000..352a34a566 --- /dev/null +++ b/vendor/github.com/spf13/viper/.gitignore @@ -0,0 +1,24 @@ +# 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 +*.bench \ No newline at end of file diff --git a/vendor/github.com/spf13/viper/LICENSE b/vendor/github.com/spf13/viper/LICENSE new file mode 100644 index 0000000000..4527efb9c0 --- /dev/null +++ b/vendor/github.com/spf13/viper/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Steve Francia + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/vendor/github.com/spf13/viper/README.md b/vendor/github.com/spf13/viper/README.md new file mode 100644 index 0000000000..848d92d6b8 --- /dev/null +++ b/vendor/github.com/spf13/viper/README.md @@ -0,0 +1,643 @@ +![viper logo](https://cloud.githubusercontent.com/assets/173412/10886745/998df88a-8151-11e5-9448-4736db51020d.png) + +Go configuration with fangs! + +Many Go projects are built using Viper including: + +* [Hugo](http://gohugo.io) +* [EMC RexRay](http://rexray.readthedocs.org/en/stable/) +* [Imgur’s Incus](https://github.com/Imgur/incus) +* [Nanobox](https://github.com/nanobox-io/nanobox)/[Nanopack](https://github.com/nanopack) +* [Docker Notary](https://github.com/docker/Notary) +* [BloomApi](https://www.bloomapi.com/) +* [doctl](https://github.com/digitalocean/doctl) +* [Clairctl](https://github.com/jgsqware/clairctl) + +[![Build Status](https://travis-ci.org/spf13/viper.svg)](https://travis-ci.org/spf13/viper) [![Join the chat at https://gitter.im/spf13/viper](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/spf13/viper?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![GoDoc](https://godoc.org/github.com/spf13/viper?status.svg)](https://godoc.org/github.com/spf13/viper) + + +## What is Viper? + +Viper is a complete configuration solution for Go applications including 12-Factor apps. It is designed +to work within an application, and can handle all types of configuration needs +and formats. It supports: + +* setting defaults +* reading from JSON, TOML, YAML, HCL, and Java properties config files +* live watching and re-reading of config files (optional) +* reading from environment variables +* reading from remote config systems (etcd or Consul), and watching changes +* reading from command line flags +* reading from buffer +* setting explicit values + +Viper can be thought of as a registry for all of your applications +configuration needs. + +## Why Viper? + +When building a modern application, you don’t want to worry about +configuration file formats; you want to focus on building awesome software. +Viper is here to help with that. + +Viper does the following for you: + +1. Find, load, and unmarshal a configuration file in JSON, TOML, YAML, HCL, or Java properties formats. +2. Provide a mechanism to set default values for your different + configuration options. +3. Provide a mechanism to set override values for options specified through + command line flags. +4. Provide an alias system to easily rename parameters without breaking existing + code. +5. Make it easy to tell the difference between when a user has provided a + command line or config file which is the same as the default. + +Viper uses the following precedence order. Each item takes precedence over the +item below it: + + * explicit call to Set + * flag + * env + * config + * key/value store + * default + +Viper configuration keys are case insensitive. + +## Putting Values into Viper + +### Establishing Defaults + +A good configuration system will support default values. A default value is not +required for a key, but it’s useful in the event that a key hasn’t been set via +config file, environment variable, remote configuration or flag. + +Examples: + +```go +viper.SetDefault("ContentDir", "content") +viper.SetDefault("LayoutDir", "layouts") +viper.SetDefault("Taxonomies", map[string]string{"tag": "tags", "category": "categories"}) +``` + +### Reading Config Files + +Viper requires minimal configuration so it knows where to look for config files. +Viper supports JSON, TOML, YAML, HCL, and Java Properties files. Viper can search multiple paths, but +currently a single Viper instance only supports a single configuration file. +Viper does not default to any configuration search paths leaving defaults decision +to an application. + +Here is an example of how to use Viper to search for and read a configuration file. +None of the specific paths are required, but at least one path should be provided +where a configuration file is expected. + +```go +viper.SetConfigName("config") // name of config file (without extension) +viper.AddConfigPath("/etc/appname/") // path to look for the config file in +viper.AddConfigPath("$HOME/.appname") // call multiple times to add many search paths +viper.AddConfigPath(".") // optionally look for config in the working directory +err := viper.ReadInConfig() // Find and read the config file +if err != nil { // Handle errors reading the config file + panic(fmt.Errorf("Fatal error config file: %s \n", err)) +} +``` + +### Watching and re-reading config files + +Viper supports the ability to have your application live read a config file while running. + +Gone are the days of needing to restart a server to have a config take effect, +viper powered applications can read an update to a config file while running and +not miss a beat. + +Simply tell the viper instance to watchConfig. +Optionally you can provide a function for Viper to run each time a change occurs. + +**Make sure you add all of the configPaths prior to calling `WatchConfig()`** + +```go +viper.WatchConfig() +viper.OnConfigChange(func(e fsnotify.Event) { + fmt.Println("Config file changed:", e.Name) +}) +``` + +### Reading Config from io.Reader + +Viper predefines many configuration sources such as files, environment +variables, flags, and remote K/V store, but you are not bound to them. You can +also implement your own required configuration source and feed it to viper. + +```go +viper.SetConfigType("yaml") // or viper.SetConfigType("YAML") + +// any approach to require this configuration into your program. +var yamlExample = []byte(` +Hacker: true +name: steve +hobbies: +- skateboarding +- snowboarding +- go +clothing: + jacket: leather + trousers: denim +age: 35 +eyes : brown +beard: true +`) + +viper.ReadConfig(bytes.NewBuffer(yamlExample)) + +viper.Get("name") // this would be "steve" +``` + +### Setting Overrides + +These could be from a command line flag, or from your own application logic. + +```go +viper.Set("Verbose", true) +viper.Set("LogFile", LogFile) +``` + +### Registering and Using Aliases + +Aliases permit a single value to be referenced by multiple keys + +```go +viper.RegisterAlias("loud", "Verbose") + +viper.Set("verbose", true) // same result as next line +viper.Set("loud", true) // same result as prior line + +viper.GetBool("loud") // true +viper.GetBool("verbose") // true +``` + +### Working with Environment Variables + +Viper has full support for environment variables. This enables 12 factor +applications out of the box. There are four methods that exist to aid working +with ENV: + + * `AutomaticEnv()` + * `BindEnv(string...) : error` + * `SetEnvPrefix(string)` + * `SetEnvReplacer(string...) *strings.Replacer` + +_When working with ENV variables, it’s important to recognize that Viper +treats ENV variables as case sensitive._ + +Viper provides a mechanism to try to ensure that ENV variables are unique. By +using `SetEnvPrefix`, you can tell Viper to use add a prefix while reading from +the environment variables. Both `BindEnv` and `AutomaticEnv` will use this +prefix. + +`BindEnv` takes one or two parameters. The first parameter is the key name, the +second is the name of the environment variable. The name of the environment +variable is case sensitive. If the ENV variable name is not provided, then +Viper will automatically assume that the key name matches the ENV variable name, +but the ENV variable is IN ALL CAPS. When you explicitly provide the ENV +variable name, it **does not** automatically add the prefix. + +One important thing to recognize when working with ENV variables is that the +value will be read each time it is accessed. Viper does not fix the value when +the `BindEnv` is called. + +`AutomaticEnv` is a powerful helper especially when combined with +`SetEnvPrefix`. When called, Viper will check for an environment variable any +time a `viper.Get` request is made. It will apply the following rules. It will +check for a environment variable with a name matching the key uppercased and +prefixed with the `EnvPrefix` if set. + +`SetEnvReplacer` allows you to use a `strings.Replacer` object to rewrite Env +keys to an extent. This is useful if you want to use `-` or something in your +`Get()` calls, but want your environmental variables to use `_` delimiters. An +example of using it can be found in `viper_test.go`. + +#### Env example + +```go +SetEnvPrefix("spf") // will be uppercased automatically +BindEnv("id") + +os.Setenv("SPF_ID", "13") // typically done outside of the app + +id := Get("id") // 13 +``` + +### Working with Flags + +Viper has the ability to bind to flags. Specifically, Viper supports `Pflags` +as used in the [Cobra](https://github.com/spf13/cobra) library. + +Like `BindEnv`, the value is not set when the binding method is called, but when +it is accessed. This means you can bind as early as you want, even in an +`init()` function. + +For individual flags, the `BindPFlag()` method provides this functionality. + +Example: + +```go +serverCmd.Flags().Int("port", 1138, "Port to run Application server on") +viper.BindPFlag("port", serverCmd.Flags().Lookup("port")) +``` + +You can also bind an existing set of pflags (pflag.FlagSet): + +Example: + +```go +pflag.Int("flagname", 1234, "help message for flagname") + +pflag.Parse() +viper.BindPFlags(pflag.CommandLine) + +i := viper.GetInt("flagname") // retrieve values from viper instead of pflag +``` + +The use of [pflag](https://github.com/spf13/pflag/) in Viper does not preclude +the use of other packages that use the [flag](https://golang.org/pkg/flag/) +package from the standard library. The pflag package can handle the flags +defined for the flag package by importing these flags. This is accomplished +by a calling a convenience function provided by the pflag package called +AddGoFlagSet(). + +Example: + +```go +package main + +import ( + "flag" + "github.com/spf13/pflag" +) + +func main() { + + // using standard library "flag" package + flag.Int("flagname", 1234, "help message for flagname") + + pflag.CommandLine.AddGoFlagSet(flag.CommandLine) + pflag.Parse() + viper.BindPFlags(pflag.CommandLine) + + i := viper.GetInt("flagname") // retrieve value from viper + + ... +} +``` + +#### Flag interfaces + +Viper provides two Go interfaces to bind other flag systems if you don’t use `Pflags`. + +`FlagValue` represents a single flag. This is a very simple example on how to implement this interface: + +```go +type myFlag struct {} +func (f myFlag) HasChanged() bool { return false } +func (f myFlag) Name() string { return "my-flag-name" } +func (f myFlag) ValueString() string { return "my-flag-value" } +func (f myFlag) ValueType() string { return "string" } +``` + +Once your flag implements this interface, you can simply tell Viper to bind it: + +```go +viper.BindFlagValue("my-flag-name", myFlag{}) +``` + +`FlagValueSet` represents a group of flags. This is a very simple example on how to implement this interface: + +```go +type myFlagSet struct { + flags []myFlag +} + +func (f myFlagSet) VisitAll(fn func(FlagValue)) { + for _, flag := range flags { + fn(flag) + } +} +``` + +Once your flag set implements this interface, you can simply tell Viper to bind it: + +```go +fSet := myFlagSet{ + flags: []myFlag{myFlag{}, myFlag{}}, +} +viper.BindFlagValues("my-flags", fSet) +``` + +### Remote Key/Value Store Support + +To enable remote support in Viper, do a blank import of the `viper/remote` +package: + +`import _ "github.com/spf13/viper/remote"` + +Viper will read a config string (as JSON, TOML, YAML or HCL) retrieved from a path +in a Key/Value store such as etcd or Consul. These values take precedence over +default values, but are overridden by configuration values retrieved from disk, +flags, or environment variables. + +Viper uses [crypt](https://github.com/xordataexchange/crypt) to retrieve +configuration from the K/V store, which means that you can store your +configuration values encrypted and have them automatically decrypted if you have +the correct gpg keyring. Encryption is optional. + +You can use remote configuration in conjunction with local configuration, or +independently of it. + +`crypt` has a command-line helper that you can use to put configurations in your +K/V store. `crypt` defaults to etcd on http://127.0.0.1:4001. + +```bash +$ go get github.com/xordataexchange/crypt/bin/crypt +$ crypt set -plaintext /config/hugo.json /Users/hugo/settings/config.json +``` + +Confirm that your value was set: + +```bash +$ crypt get -plaintext /config/hugo.json +``` + +See the `crypt` documentation for examples of how to set encrypted values, or +how to use Consul. + +### Remote Key/Value Store Example - Unencrypted + +```go +viper.AddRemoteProvider("etcd", "http://127.0.0.1:4001","/config/hugo.json") +viper.SetConfigType("json") // because there is no file extension in a stream of bytes, supported extensions are "json", "toml", "yaml", "yml", "properties", "props", "prop" +err := viper.ReadRemoteConfig() +``` + +### Remote Key/Value Store Example - Encrypted + +```go +viper.AddSecureRemoteProvider("etcd","http://127.0.0.1:4001","/config/hugo.json","/etc/secrets/mykeyring.gpg") +viper.SetConfigType("json") // because there is no file extension in a stream of bytes, supported extensions are "json", "toml", "yaml", "yml", "properties", "props", "prop" +err := viper.ReadRemoteConfig() +``` + +### Watching Changes in etcd - Unencrypted + +```go +// alternatively, you can create a new viper instance. +var runtime_viper = viper.New() + +runtime_viper.AddRemoteProvider("etcd", "http://127.0.0.1:4001", "/config/hugo.yml") +runtime_viper.SetConfigType("yaml") // because there is no file extension in a stream of bytes, supported extensions are "json", "toml", "yaml", "yml", "properties", "props", "prop" + +// read from remote config the first time. +err := runtime_viper.ReadRemoteConfig() + +// unmarshal config +runtime_viper.Unmarshal(&runtime_conf) + +// open a goroutine to watch remote changes forever +go func(){ + for { + time.Sleep(time.Second * 5) // delay after each request + + // currently, only tested with etcd support + err := runtime_viper.WatchRemoteConfig() + if err != nil { + log.Errorf("unable to read remote config: %v", err) + continue + } + + // unmarshal new config into our runtime config struct. you can also use channel + // to implement a signal to notify the system of the changes + runtime_viper.Unmarshal(&runtime_conf) + } +}() +``` + +## Getting Values From Viper + +In Viper, there are a few ways to get a value depending on the value’s type. +The following functions and methods exist: + + * `Get(key string) : interface{}` + * `GetBool(key string) : bool` + * `GetFloat64(key string) : float64` + * `GetInt(key string) : int` + * `GetString(key string) : string` + * `GetStringMap(key string) : map[string]interface{}` + * `GetStringMapString(key string) : map[string]string` + * `GetStringSlice(key string) : []string` + * `GetTime(key string) : time.Time` + * `GetDuration(key string) : time.Duration` + * `IsSet(key string) : bool` + +One important thing to recognize is that each Get function will return a zero +value if it’s not found. To check if a given key exists, the `IsSet()` method +has been provided. + +Example: +```go +viper.GetString("logfile") // case-insensitive Setting & Getting +if viper.GetBool("verbose") { + fmt.Println("verbose enabled") +} +``` +### Accessing nested keys + +The accessor methods also accept formatted paths to deeply nested keys. For +example, if the following JSON file is loaded: + +```json +{ + "host": { + "address": "localhost", + "port": 5799 + }, + "datastore": { + "metric": { + "host": "127.0.0.1", + "port": 3099 + }, + "warehouse": { + "host": "198.0.0.1", + "port": 2112 + } + } +} + +``` + +Viper can access a nested field by passing a `.` delimited path of keys: + +```go +GetString("datastore.metric.host") // (returns "127.0.0.1") +``` + +This obeys the precedence rules established above; the search for the path +will cascade through the remaining configuration registries until found. + +For example, given this configuration file, both `datastore.metric.host` and +`datastore.metric.port` are already defined (and may be overridden). If in addition +`datastore.metric.protocol` was defined in the defaults, Viper would also find it. + +However, if `datastore.metric` was overridden (by a flag, an environment variable, +the `Set()` method, …) with an immediate value, then all sub-keys of +`datastore.metric` become undefined, they are “shadowed” by the higher-priority +configuration level. + +Lastly, if there exists a key that matches the delimited key path, its value +will be returned instead. E.g. + +```json +{ + "datastore.metric.host": "0.0.0.0", + "host": { + "address": "localhost", + "port": 5799 + }, + "datastore": { + "metric": { + "host": "127.0.0.1", + "port": 3099 + }, + "warehouse": { + "host": "198.0.0.1", + "port": 2112 + } + } +} + +GetString("datastore.metric.host") // returns "0.0.0.0" +``` + +### Extract sub-tree + +Extract sub-tree from Viper. + +For example, `viper` represents: + +```json +app: + cache1: + max-items: 100 + item-size: 64 + cache2: + max-items: 200 + item-size: 80 +``` + +After executing: + +```go +subv := viper.Sub("app.cache1") +``` + +`subv` represents: + +```json +max-items: 100 +item-size: 64 +``` + +Suppose we have: + +```go +func NewCache(cfg *Viper) *Cache {...} +``` + +which creates a cache based on config information formatted as `subv`. +Now it’s easy to create these 2 caches separately as: + +```go +cfg1 := viper.Sub("app.cache1") +cache1 := NewCache(cfg1) + +cfg2 := viper.Sub("app.cache2") +cache2 := NewCache(cfg2) +``` + +### Unmarshaling + +You also have the option of Unmarshaling all or a specific value to a struct, map, +etc. + +There are two methods to do this: + + * `Unmarshal(rawVal interface{}) : error` + * `UnmarshalKey(key string, rawVal interface{}) : error` + +Example: + +```go +type config struct { + Port int + Name string + PathMap string `mapstructure:"path_map"` +} + +var C config + +err := Unmarshal(&C) +if err != nil { + t.Fatalf("unable to decode into struct, %v", err) +} +``` + +## Viper or Vipers? + +Viper comes ready to use out of the box. There is no configuration or +initialization needed to begin using Viper. Since most applications will want +to use a single central repository for their configuration, the viper package +provides this. It is similar to a singleton. + +In all of the examples above, they demonstrate using viper in its singleton +style approach. + +### Working with multiple vipers + +You can also create many different vipers for use in your application. Each will +have its own unique set of configurations and values. Each can read from a +different config file, key value store, etc. All of the functions that viper +package supports are mirrored as methods on a viper. + +Example: + +```go +x := viper.New() +y := viper.New() + +x.SetDefault("ContentDir", "content") +y.SetDefault("ContentDir", "foobar") + +//... +``` + +When working with multiple vipers, it is up to the user to keep track of the +different vipers. + +## Q & A + +Q: Why not INI files? + +A: Ini files are pretty awful. There’s no standard format, and they are hard to +validate. Viper is designed to work with JSON, TOML or YAML files. If someone +really wants to add this feature, I’d be happy to merge it. It’s easy to specify +which formats your application will permit. + +Q: Why is it called “Viper”? + +A: Viper is designed to be a [companion](http://en.wikipedia.org/wiki/Viper_(G.I._Joe)) +to [Cobra](https://github.com/spf13/cobra). While both can operate completely +independently, together they make a powerful pair to handle much of your +application foundation needs. + +Q: Why is it called “Cobra”? + +A: Is there a better name for a [commander](http://en.wikipedia.org/wiki/Cobra_Commander)? diff --git a/vendor/github.com/spf13/viper/flags.go b/vendor/github.com/spf13/viper/flags.go new file mode 100644 index 0000000000..dd32f4e1c2 --- /dev/null +++ b/vendor/github.com/spf13/viper/flags.go @@ -0,0 +1,57 @@ +package viper + +import "github.com/spf13/pflag" + +// FlagValueSet is an interface that users can implement +// to bind a set of flags to viper. +type FlagValueSet interface { + VisitAll(fn func(FlagValue)) +} + +// FlagValue is an interface that users can implement +// to bind different flags to viper. +type FlagValue interface { + HasChanged() bool + Name() string + ValueString() string + ValueType() string +} + +// pflagValueSet is a wrapper around *pflag.ValueSet +// that implements FlagValueSet. +type pflagValueSet struct { + flags *pflag.FlagSet +} + +// VisitAll iterates over all *pflag.Flag inside the *pflag.FlagSet. +func (p pflagValueSet) VisitAll(fn func(flag FlagValue)) { + p.flags.VisitAll(func(flag *pflag.Flag) { + fn(pflagValue{flag}) + }) +} + +// pflagValue is a wrapper aroung *pflag.flag +// that implements FlagValue +type pflagValue struct { + flag *pflag.Flag +} + +// HasChanges returns whether the flag has changes or not. +func (p pflagValue) HasChanged() bool { + return p.flag.Changed +} + +// Name returns the name of the flag. +func (p pflagValue) Name() string { + return p.flag.Name +} + +// ValueString returns the value of the flag as a string. +func (p pflagValue) ValueString() string { + return p.flag.Value.String() +} + +// ValueType returns the type of the flag as a string. +func (p pflagValue) ValueType() string { + return p.flag.Value.Type() +} diff --git a/vendor/github.com/spf13/viper/flags_test.go b/vendor/github.com/spf13/viper/flags_test.go new file mode 100644 index 0000000000..0b976b6052 --- /dev/null +++ b/vendor/github.com/spf13/viper/flags_test.go @@ -0,0 +1,65 @@ +package viper + +import ( + "testing" + + "github.com/spf13/pflag" + "github.com/stretchr/testify/assert" +) + +func TestBindFlagValueSet(t *testing.T) { + flagSet := pflag.NewFlagSet("test", pflag.ContinueOnError) + + var testValues = map[string]*string{ + "host": nil, + "port": nil, + "endpoint": nil, + } + + var mutatedTestValues = map[string]string{ + "host": "localhost", + "port": "6060", + "endpoint": "/public", + } + + for name := range testValues { + testValues[name] = flagSet.String(name, "", "test") + } + + flagValueSet := pflagValueSet{flagSet} + + err := BindFlagValues(flagValueSet) + if err != nil { + t.Fatalf("error binding flag set, %v", err) + } + + flagSet.VisitAll(func(flag *pflag.Flag) { + flag.Value.Set(mutatedTestValues[flag.Name]) + flag.Changed = true + }) + + for name, expected := range mutatedTestValues { + assert.Equal(t, Get(name), expected) + } +} + +func TestBindFlagValue(t *testing.T) { + var testString = "testing" + var testValue = newStringValue(testString, &testString) + + flag := &pflag.Flag{ + Name: "testflag", + Value: testValue, + Changed: false, + } + + flagValue := pflagValue{flag} + BindFlagValue("testvalue", flagValue) + + assert.Equal(t, testString, Get("testvalue")) + + flag.Value.Set("testing_mutate") + flag.Changed = true //hack for pflag usage + + assert.Equal(t, "testing_mutate", Get("testvalue")) +} diff --git a/vendor/github.com/spf13/viper/nohup.out b/vendor/github.com/spf13/viper/nohup.out new file mode 100644 index 0000000000..8973bf27b5 --- /dev/null +++ b/vendor/github.com/spf13/viper/nohup.out @@ -0,0 +1 @@ +QProcess::start: Process is already running diff --git a/vendor/github.com/spf13/viper/overrides_test.go b/vendor/github.com/spf13/viper/overrides_test.go new file mode 100644 index 0000000000..dd2aa9b0db --- /dev/null +++ b/vendor/github.com/spf13/viper/overrides_test.go @@ -0,0 +1,173 @@ +package viper + +import ( + "fmt" + "strings" + "testing" + + "github.com/spf13/cast" + "github.com/stretchr/testify/assert" +) + +type layer int + +const ( + defaultLayer layer = iota + 1 + overrideLayer +) + +func TestNestedOverrides(t *testing.T) { + assert := assert.New(t) + var v *Viper + + // Case 0: value overridden by a value + overrideDefault(assert, "tom", 10, "tom", 20) // "tom" is first given 10 as default value, then overridden by 20 + override(assert, "tom", 10, "tom", 20) // "tom" is first given value 10, then overridden by 20 + overrideDefault(assert, "tom.age", 10, "tom.age", 20) + override(assert, "tom.age", 10, "tom.age", 20) + overrideDefault(assert, "sawyer.tom.age", 10, "sawyer.tom.age", 20) + override(assert, "sawyer.tom.age", 10, "sawyer.tom.age", 20) + + // Case 1: key:value overridden by a value + v = overrideDefault(assert, "tom.age", 10, "tom", "boy") // "tom.age" is first given 10 as default value, then "tom" is overridden by "boy" + assert.Nil(v.Get("tom.age")) // "tom.age" should not exist anymore + v = override(assert, "tom.age", 10, "tom", "boy") + assert.Nil(v.Get("tom.age")) + + // Case 2: value overridden by a key:value + overrideDefault(assert, "tom", "boy", "tom.age", 10) // "tom" is first given "boy" as default value, then "tom" is overridden by map{"age":10} + override(assert, "tom.age", 10, "tom", "boy") + + // Case 3: key:value overridden by a key:value + v = overrideDefault(assert, "tom.size", 4, "tom.age", 10) + assert.Equal(4, v.Get("tom.size")) // value should still be reachable + v = override(assert, "tom.size", 4, "tom.age", 10) + assert.Equal(4, v.Get("tom.size")) + deepCheckValue(assert, v, overrideLayer, []string{"tom", "size"}, 4) + + // Case 4: key:value overridden by a map + v = overrideDefault(assert, "tom.size", 4, "tom", map[string]interface{}{"age": 10}) // "tom.size" is first given "4" as default value, then "tom" is overridden by map{"age":10} + assert.Equal(4, v.Get("tom.size")) // "tom.size" should still be reachable + assert.Equal(10, v.Get("tom.age")) // new value should be there + deepCheckValue(assert, v, overrideLayer, []string{"tom", "age"}, 10) // new value should be there + v = override(assert, "tom.size", 4, "tom", map[string]interface{}{"age": 10}) + assert.Nil(v.Get("tom.size")) + assert.Equal(10, v.Get("tom.age")) + deepCheckValue(assert, v, overrideLayer, []string{"tom", "age"}, 10) + + // Case 5: array overridden by a value + overrideDefault(assert, "tom", []int{10, 20}, "tom", 30) + override(assert, "tom", []int{10, 20}, "tom", 30) + overrideDefault(assert, "tom.age", []int{10, 20}, "tom.age", 30) + override(assert, "tom.age", []int{10, 20}, "tom.age", 30) + + // Case 6: array overridden by an array + overrideDefault(assert, "tom", []int{10, 20}, "tom", []int{30, 40}) + override(assert, "tom", []int{10, 20}, "tom", []int{30, 40}) + overrideDefault(assert, "tom.age", []int{10, 20}, "tom.age", []int{30, 40}) + v = override(assert, "tom.age", []int{10, 20}, "tom.age", []int{30, 40}) + // explicit array merge: + s, ok := v.Get("tom.age").([]int) + if assert.True(ok, "tom[\"age\"] is not a slice") { + v.Set("tom.age", append(s, []int{50, 60}...)) + assert.Equal([]int{30, 40, 50, 60}, v.Get("tom.age")) + deepCheckValue(assert, v, overrideLayer, []string{"tom", "age"}, []int{30, 40, 50, 60}) + } +} + +func overrideDefault(assert *assert.Assertions, firstPath string, firstValue interface{}, secondPath string, secondValue interface{}) *Viper { + return overrideFromLayer(defaultLayer, assert, firstPath, firstValue, secondPath, secondValue) +} +func override(assert *assert.Assertions, firstPath string, firstValue interface{}, secondPath string, secondValue interface{}) *Viper { + return overrideFromLayer(overrideLayer, assert, firstPath, firstValue, secondPath, secondValue) +} + +// overrideFromLayer performs the sequential override and low-level checks. +// +// First assignment is made on layer l for path firstPath with value firstValue, +// the second one on the override layer (i.e., with the Set() function) +// for path secondPath with value secondValue. +// +// firstPath and secondPath can include an arbitrary number of dots to indicate +// a nested element. +// +// After each assignment, the value is checked, retrieved both by its full path +// and by its key sequence (successive maps). +func overrideFromLayer(l layer, assert *assert.Assertions, firstPath string, firstValue interface{}, secondPath string, secondValue interface{}) *Viper { + v := New() + firstKeys := strings.Split(firstPath, v.keyDelim) + if assert == nil || + len(firstKeys) == 0 || len(firstKeys[0]) == 0 { + return v + } + + // Set and check first value + switch l { + case defaultLayer: + v.SetDefault(firstPath, firstValue) + case overrideLayer: + v.Set(firstPath, firstValue) + default: + return v + } + assert.Equal(firstValue, v.Get(firstPath)) + deepCheckValue(assert, v, l, firstKeys, firstValue) + + // Override and check new value + secondKeys := strings.Split(secondPath, v.keyDelim) + if len(secondKeys) == 0 || len(secondKeys[0]) == 0 { + return v + } + v.Set(secondPath, secondValue) + assert.Equal(secondValue, v.Get(secondPath)) + deepCheckValue(assert, v, overrideLayer, secondKeys, secondValue) + + return v +} + +// deepCheckValue checks that all given keys correspond to a valid path in the +// configuration map of the given layer, and that the final value equals the one given +func deepCheckValue(assert *assert.Assertions, v *Viper, l layer, keys []string, value interface{}) { + if assert == nil || v == nil || + len(keys) == 0 || len(keys[0]) == 0 { + return + } + + // init + var val interface{} + var ms string + switch l { + case defaultLayer: + val = v.defaults + ms = "v.defaults" + case overrideLayer: + val = v.override + ms = "v.override" + } + + // loop through map + var m map[string]interface{} + err := false + for _, k := range keys { + if val == nil { + assert.Fail(fmt.Sprintf("%s is not a map[string]interface{}", ms)) + return + } + + // deep scan of the map to get the final value + switch val.(type) { + case map[interface{}]interface{}: + m = cast.ToStringMap(val) + case map[string]interface{}: + m = val.(map[string]interface{}) + default: + assert.Fail(fmt.Sprintf("%s is not a map[string]interface{}", ms)) + return + } + ms = ms + "[\"" + k + "\"]" + val = m[k] + } + if !err { + assert.Equal(value, val) + } +} diff --git a/vendor/github.com/spf13/viper/remote/remote.go b/vendor/github.com/spf13/viper/remote/remote.go new file mode 100644 index 0000000000..68a35d692c --- /dev/null +++ b/vendor/github.com/spf13/viper/remote/remote.go @@ -0,0 +1,104 @@ +// Copyright © 2015 Steve Francia . +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file. + +// Package remote integrates the remote features of Viper. +package remote + +import ( + "bytes" + "github.com/spf13/viper" + crypt "github.com/xordataexchange/crypt/config" + "io" + "os" +) + +type remoteConfigProvider struct{} + +func (rc remoteConfigProvider) Get(rp viper.RemoteProvider) (io.Reader, error) { + cm, err := getConfigManager(rp) + if err != nil { + return nil, err + } + b, err := cm.Get(rp.Path()) + if err != nil { + return nil, err + } + return bytes.NewReader(b), nil +} + +func (rc remoteConfigProvider) Watch(rp viper.RemoteProvider) (io.Reader, error) { + cm, err := getConfigManager(rp) + if err != nil { + return nil, err + } + resp, err := cm.Get(rp.Path()) + if err != nil { + return nil, err + } + + return bytes.NewReader(resp), nil +} + +func (rc remoteConfigProvider) WatchChannel(rp viper.RemoteProvider) (<-chan *viper.RemoteResponse, chan bool) { + cm, err := getConfigManager(rp) + if err != nil { + return nil, nil + } + quit := make(chan bool) + quitwc := make(chan bool) + viperResponsCh := make(chan *viper.RemoteResponse) + cryptoResponseCh := cm.Watch(rp.Path(), quit) + // need this function to convert the Channel response form crypt.Response to viper.Response + go func(cr <-chan *crypt.Response, vr chan<- *viper.RemoteResponse, quitwc <-chan bool, quit chan<- bool) { + for { + select { + case <-quitwc: + quit <- true + return + case resp := <-cr: + vr <- &viper.RemoteResponse{ + Error: resp.Error, + Value: resp.Value, + } + + } + + } + }(cryptoResponseCh, viperResponsCh, quitwc, quit) + + return viperResponsCh, quitwc +} + +func getConfigManager(rp viper.RemoteProvider) (crypt.ConfigManager, error) { + var cm crypt.ConfigManager + var err error + + if rp.SecretKeyring() != "" { + kr, err := os.Open(rp.SecretKeyring()) + defer kr.Close() + if err != nil { + return nil, err + } + if rp.Provider() == "etcd" { + cm, err = crypt.NewEtcdConfigManager([]string{rp.Endpoint()}, kr) + } else { + cm, err = crypt.NewConsulConfigManager([]string{rp.Endpoint()}, kr) + } + } else { + if rp.Provider() == "etcd" { + cm, err = crypt.NewStandardEtcdConfigManager([]string{rp.Endpoint()}) + } else { + cm, err = crypt.NewStandardConsulConfigManager([]string{rp.Endpoint()}) + } + } + if err != nil { + return nil, err + } + return cm, nil +} + +func init() { + viper.RemoteConfig = &remoteConfigProvider{} +} diff --git a/vendor/github.com/spf13/viper/util.go b/vendor/github.com/spf13/viper/util.go new file mode 100644 index 0000000000..3ebada91ab --- /dev/null +++ b/vendor/github.com/spf13/viper/util.go @@ -0,0 +1,282 @@ +// Copyright © 2014 Steve Francia . +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file. + +// Viper is a application configuration system. +// It believes that applications can be configured a variety of ways +// via flags, ENVIRONMENT variables, configuration files retrieved +// from the file system, or a remote key/value store. + +package viper + +import ( + "bytes" + "encoding/json" + "fmt" + "io" + "os" + "path/filepath" + "runtime" + "strings" + "unicode" + + "github.com/hashicorp/hcl" + "github.com/magiconair/properties" + toml "github.com/pelletier/go-toml" + "github.com/spf13/cast" + jww "github.com/spf13/jwalterweatherman" + "gopkg.in/yaml.v2" +) + +// ConfigParseError denotes failing to parse configuration file. +type ConfigParseError struct { + err error +} + +// Error returns the formatted configuration error. +func (pe ConfigParseError) Error() string { + return fmt.Sprintf("While parsing config: %s", pe.err.Error()) +} + +// toCaseInsensitiveValue checks if the value is a map; +// if so, create a copy and lower-case the keys recursively. +func toCaseInsensitiveValue(value interface{}) interface{} { + switch v := value.(type) { + case map[interface{}]interface{}: + value = copyAndInsensitiviseMap(cast.ToStringMap(v)) + case map[string]interface{}: + value = copyAndInsensitiviseMap(v) + } + + return value +} + +// copyAndInsensitiviseMap behaves like insensitiviseMap, but creates a copy of +// any map it makes case insensitive. +func copyAndInsensitiviseMap(m map[string]interface{}) map[string]interface{} { + nm := make(map[string]interface{}) + + for key, val := range m { + lkey := strings.ToLower(key) + switch v := val.(type) { + case map[interface{}]interface{}: + nm[lkey] = copyAndInsensitiviseMap(cast.ToStringMap(v)) + case map[string]interface{}: + nm[lkey] = copyAndInsensitiviseMap(v) + default: + nm[lkey] = v + } + } + + return nm +} + +func insensitiviseMap(m map[string]interface{}) { + for key, val := range m { + switch val.(type) { + case map[interface{}]interface{}: + // nested map: cast and recursively insensitivise + val = cast.ToStringMap(val) + insensitiviseMap(val.(map[string]interface{})) + case map[string]interface{}: + // nested map: recursively insensitivise + insensitiviseMap(val.(map[string]interface{})) + } + + lower := strings.ToLower(key) + if key != lower { + // remove old key (not lower-cased) + delete(m, key) + } + // update map + m[lower] = val + } +} + +func absPathify(inPath string) string { + jww.INFO.Println("Trying to resolve absolute path to", inPath) + + if strings.HasPrefix(inPath, "$HOME") { + inPath = userHomeDir() + inPath[5:] + } + + if strings.HasPrefix(inPath, "$") { + end := strings.Index(inPath, string(os.PathSeparator)) + inPath = os.Getenv(inPath[1:end]) + inPath[end:] + } + + if filepath.IsAbs(inPath) { + return filepath.Clean(inPath) + } + + p, err := filepath.Abs(inPath) + if err == nil { + return filepath.Clean(p) + } + + jww.ERROR.Println("Couldn't discover absolute path") + jww.ERROR.Println(err) + return "" +} + +// Check if File / Directory Exists +func exists(path string) (bool, error) { + _, err := v.fs.Stat(path) + if err == nil { + return true, nil + } + if os.IsNotExist(err) { + return false, nil + } + return false, err +} + +func stringInSlice(a string, list []string) bool { + for _, b := range list { + if b == a { + return true + } + } + return false +} + +func userHomeDir() string { + if runtime.GOOS == "windows" { + home := os.Getenv("HOMEDRIVE") + os.Getenv("HOMEPATH") + if home == "" { + home = os.Getenv("USERPROFILE") + } + return home + } + return os.Getenv("HOME") +} + +func unmarshallConfigReader(in io.Reader, c map[string]interface{}, configType string) error { + buf := new(bytes.Buffer) + buf.ReadFrom(in) + + switch strings.ToLower(configType) { + case "yaml", "yml": + if err := yaml.Unmarshal(buf.Bytes(), &c); err != nil { + return ConfigParseError{err} + } + + case "json": + if err := json.Unmarshal(buf.Bytes(), &c); err != nil { + return ConfigParseError{err} + } + + case "hcl": + obj, err := hcl.Parse(string(buf.Bytes())) + if err != nil { + return ConfigParseError{err} + } + if err = hcl.DecodeObject(&c, obj); err != nil { + return ConfigParseError{err} + } + + case "toml": + tree, err := toml.LoadReader(buf) + if err != nil { + return ConfigParseError{err} + } + tmap := tree.ToMap() + for k, v := range tmap { + c[k] = v + } + + case "properties", "props", "prop": + var p *properties.Properties + var err error + if p, err = properties.Load(buf.Bytes(), properties.UTF8); err != nil { + return ConfigParseError{err} + } + for _, key := range p.Keys() { + value, _ := p.Get(key) + // recursively build nested maps + path := strings.Split(key, ".") + lastKey := strings.ToLower(path[len(path)-1]) + deepestMap := deepSearch(c, path[0:len(path)-1]) + // set innermost value + deepestMap[lastKey] = value + } + } + + insensitiviseMap(c) + return nil +} + +func safeMul(a, b uint) uint { + c := a * b + if a > 1 && b > 1 && c/b != a { + return 0 + } + return c +} + +// parseSizeInBytes converts strings like 1GB or 12 mb into an unsigned integer number of bytes +func parseSizeInBytes(sizeStr string) uint { + sizeStr = strings.TrimSpace(sizeStr) + lastChar := len(sizeStr) - 1 + multiplier := uint(1) + + if lastChar > 0 { + if sizeStr[lastChar] == 'b' || sizeStr[lastChar] == 'B' { + if lastChar > 1 { + switch unicode.ToLower(rune(sizeStr[lastChar-1])) { + case 'k': + multiplier = 1 << 10 + sizeStr = strings.TrimSpace(sizeStr[:lastChar-1]) + case 'm': + multiplier = 1 << 20 + sizeStr = strings.TrimSpace(sizeStr[:lastChar-1]) + case 'g': + multiplier = 1 << 30 + sizeStr = strings.TrimSpace(sizeStr[:lastChar-1]) + default: + multiplier = 1 + sizeStr = strings.TrimSpace(sizeStr[:lastChar]) + } + } + } + } + + size := cast.ToInt(sizeStr) + if size < 0 { + size = 0 + } + + return safeMul(uint(size), multiplier) +} + +// deepSearch scans deep maps, following the key indexes listed in the +// sequence "path". +// The last value is expected to be another map, and is returned. +// +// In case intermediate keys do not exist, or map to a non-map value, +// a new map is created and inserted, and the search continues from there: +// the initial map "m" may be modified! +func deepSearch(m map[string]interface{}, path []string) map[string]interface{} { + for _, k := range path { + m2, ok := m[k] + if !ok { + // intermediate key does not exist + // => create it and continue from there + m3 := make(map[string]interface{}) + m[k] = m3 + m = m3 + continue + } + m3, ok := m2.(map[string]interface{}) + if !ok { + // intermediate key is a value + // => replace with a new map + m3 = make(map[string]interface{}) + m[k] = m3 + } + // continue search from here + m = m3 + } + return m +} diff --git a/vendor/github.com/spf13/viper/util_test.go b/vendor/github.com/spf13/viper/util_test.go new file mode 100644 index 0000000000..0af80bb635 --- /dev/null +++ b/vendor/github.com/spf13/viper/util_test.go @@ -0,0 +1,54 @@ +// Copyright © 2016 Steve Francia . +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file. + +// Viper is a application configuration system. +// It believes that applications can be configured a variety of ways +// via flags, ENVIRONMENT variables, configuration files retrieved +// from the file system, or a remote key/value store. + +package viper + +import ( + "reflect" + "testing" +) + +func TestCopyAndInsensitiviseMap(t *testing.T) { + var ( + given = map[string]interface{}{ + "Foo": 32, + "Bar": map[interface{}]interface { + }{ + "ABc": "A", + "cDE": "B"}, + } + expected = map[string]interface{}{ + "foo": 32, + "bar": map[string]interface { + }{ + "abc": "A", + "cde": "B"}, + } + ) + + got := copyAndInsensitiviseMap(given) + + if !reflect.DeepEqual(got, expected) { + t.Fatalf("Got %q\nexpected\n%q", got, expected) + } + + if _, ok := given["foo"]; ok { + t.Fatal("Input map changed") + } + + if _, ok := given["bar"]; ok { + t.Fatal("Input map changed") + } + + m := given["Bar"].(map[interface{}]interface{}) + if _, ok := m["ABc"]; !ok { + t.Fatal("Input map changed") + } +} diff --git a/vendor/github.com/spf13/viper/viper.go b/vendor/github.com/spf13/viper/viper.go new file mode 100644 index 0000000000..2a221e53cb --- /dev/null +++ b/vendor/github.com/spf13/viper/viper.go @@ -0,0 +1,1571 @@ +// Copyright © 2014 Steve Francia . +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file. + +// Viper is a application configuration system. +// It believes that applications can be configured a variety of ways +// via flags, ENVIRONMENT variables, configuration files retrieved +// from the file system, or a remote key/value store. + +// Each item takes precedence over the item below it: + +// overrides +// flag +// env +// config +// key/value store +// default + +package viper + +import ( + "bytes" + "encoding/csv" + "fmt" + "io" + "log" + "os" + "path/filepath" + "reflect" + "strings" + "time" + + "github.com/fsnotify/fsnotify" + "github.com/mitchellh/mapstructure" + "github.com/spf13/afero" + "github.com/spf13/cast" + jww "github.com/spf13/jwalterweatherman" + "github.com/spf13/pflag" +) + +var v *Viper + +type RemoteResponse struct { + Value []byte + Error error +} + +func init() { + v = New() +} + +type remoteConfigFactory interface { + Get(rp RemoteProvider) (io.Reader, error) + Watch(rp RemoteProvider) (io.Reader, error) + WatchChannel(rp RemoteProvider) (<-chan *RemoteResponse, chan bool) +} + +// RemoteConfig is optional, see the remote package +var RemoteConfig remoteConfigFactory + +// UnsupportedConfigError denotes encountering an unsupported +// configuration filetype. +type UnsupportedConfigError string + +// Error returns the formatted configuration error. +func (str UnsupportedConfigError) Error() string { + return fmt.Sprintf("Unsupported Config Type %q", string(str)) +} + +// UnsupportedRemoteProviderError denotes encountering an unsupported remote +// provider. Currently only etcd and Consul are supported. +type UnsupportedRemoteProviderError string + +// Error returns the formatted remote provider error. +func (str UnsupportedRemoteProviderError) Error() string { + return fmt.Sprintf("Unsupported Remote Provider Type %q", string(str)) +} + +// RemoteConfigError denotes encountering an error while trying to +// pull the configuration from the remote provider. +type RemoteConfigError string + +// Error returns the formatted remote provider error +func (rce RemoteConfigError) Error() string { + return fmt.Sprintf("Remote Configurations Error: %s", string(rce)) +} + +// ConfigFileNotFoundError denotes failing to find configuration file. +type ConfigFileNotFoundError struct { + name, locations string +} + +// Error returns the formatted configuration error. +func (fnfe ConfigFileNotFoundError) Error() string { + return fmt.Sprintf("Config File %q Not Found in %q", fnfe.name, fnfe.locations) +} + +// Viper is a prioritized configuration registry. It +// maintains a set of configuration sources, fetches +// values to populate those, and provides them according +// to the source's priority. +// The priority of the sources is the following: +// 1. overrides +// 2. flags +// 3. env. variables +// 4. config file +// 5. key/value store +// 6. defaults +// +// For example, if values from the following sources were loaded: +// +// Defaults : { +// "secret": "", +// "user": "default", +// "endpoint": "https://localhost" +// } +// Config : { +// "user": "root" +// "secret": "defaultsecret" +// } +// Env : { +// "secret": "somesecretkey" +// } +// +// The resulting config will have the following values: +// +// { +// "secret": "somesecretkey", +// "user": "root", +// "endpoint": "https://localhost" +// } +type Viper struct { + // Delimiter that separates a list of keys + // used to access a nested value in one go + keyDelim string + + // A set of paths to look for the config file in + configPaths []string + + // The filesystem to read config from. + fs afero.Fs + + // A set of remote providers to search for the configuration + remoteProviders []*defaultRemoteProvider + + // Name of file to look for inside the path + configName string + configFile string + configType string + envPrefix string + + automaticEnvApplied bool + envKeyReplacer *strings.Replacer + + config map[string]interface{} + override map[string]interface{} + defaults map[string]interface{} + kvstore map[string]interface{} + pflags map[string]FlagValue + env map[string]string + aliases map[string]string + typeByDefValue bool + + onConfigChange func(fsnotify.Event) +} + +// New returns an initialized Viper instance. +func New() *Viper { + v := new(Viper) + v.keyDelim = "." + v.configName = "config" + v.fs = afero.NewOsFs() + v.config = make(map[string]interface{}) + v.override = make(map[string]interface{}) + v.defaults = make(map[string]interface{}) + v.kvstore = make(map[string]interface{}) + v.pflags = make(map[string]FlagValue) + v.env = make(map[string]string) + v.aliases = make(map[string]string) + v.typeByDefValue = false + + return v +} + +// Intended for testing, will reset all to default settings. +// In the public interface for the viper package so applications +// can use it in their testing as well. +func Reset() { + v = New() + SupportedExts = []string{"json", "toml", "yaml", "yml", "hcl"} + SupportedRemoteProviders = []string{"etcd", "consul"} +} + +type defaultRemoteProvider struct { + provider string + endpoint string + path string + secretKeyring string +} + +func (rp defaultRemoteProvider) Provider() string { + return rp.provider +} + +func (rp defaultRemoteProvider) Endpoint() string { + return rp.endpoint +} + +func (rp defaultRemoteProvider) Path() string { + return rp.path +} + +func (rp defaultRemoteProvider) SecretKeyring() string { + return rp.secretKeyring +} + +// RemoteProvider stores the configuration necessary +// to connect to a remote key/value store. +// Optional secretKeyring to unencrypt encrypted values +// can be provided. +type RemoteProvider interface { + Provider() string + Endpoint() string + Path() string + SecretKeyring() string +} + +// SupportedExts are universally supported extensions. +var SupportedExts = []string{"json", "toml", "yaml", "yml", "properties", "props", "prop", "hcl"} + +// SupportedRemoteProviders are universally supported remote providers. +var SupportedRemoteProviders = []string{"etcd", "consul"} + +func OnConfigChange(run func(in fsnotify.Event)) { v.OnConfigChange(run) } +func (v *Viper) OnConfigChange(run func(in fsnotify.Event)) { + v.onConfigChange = run +} + +func WatchConfig() { v.WatchConfig() } +func (v *Viper) WatchConfig() { + go func() { + watcher, err := fsnotify.NewWatcher() + if err != nil { + log.Fatal(err) + } + defer watcher.Close() + + // we have to watch the entire directory to pick up renames/atomic saves in a cross-platform way + filename, err := v.getConfigFile() + if err != nil { + log.Println("error:", err) + return + } + + configFile := filepath.Clean(filename) + configDir, _ := filepath.Split(configFile) + + done := make(chan bool) + go func() { + for { + select { + case event := <-watcher.Events: + // we only care about the config file + if filepath.Clean(event.Name) == configFile { + if event.Op&fsnotify.Write == fsnotify.Write || event.Op&fsnotify.Create == fsnotify.Create { + err := v.ReadInConfig() + if err != nil { + log.Println("error:", err) + } + v.onConfigChange(event) + } + } + case err := <-watcher.Errors: + log.Println("error:", err) + } + } + }() + + watcher.Add(configDir) + <-done + }() +} + +// SetConfigFile explicitly defines the path, name and extension of the config file. +// Viper will use this and not check any of the config paths. +func SetConfigFile(in string) { v.SetConfigFile(in) } +func (v *Viper) SetConfigFile(in string) { + if in != "" { + v.configFile = in + } +} + +// SetEnvPrefix defines a prefix that ENVIRONMENT variables will use. +// E.g. if your prefix is "spf", the env registry will look for env +// variables that start with "SPF_". +func SetEnvPrefix(in string) { v.SetEnvPrefix(in) } +func (v *Viper) SetEnvPrefix(in string) { + if in != "" { + v.envPrefix = in + } +} + +func (v *Viper) mergeWithEnvPrefix(in string) string { + if v.envPrefix != "" { + return strings.ToUpper(v.envPrefix + "_" + in) + } + + return strings.ToUpper(in) +} + +// TODO: should getEnv logic be moved into find(). Can generalize the use of +// rewriting keys many things, Ex: Get('someKey') -> some_key +// (camel case to snake case for JSON keys perhaps) + +// getEnv is a wrapper around os.Getenv which replaces characters in the original +// key. This allows env vars which have different keys than the config object +// keys. +func (v *Viper) getEnv(key string) string { + if v.envKeyReplacer != nil { + key = v.envKeyReplacer.Replace(key) + } + return os.Getenv(key) +} + +// ConfigFileUsed returns the file used to populate the config registry. +func ConfigFileUsed() string { return v.ConfigFileUsed() } +func (v *Viper) ConfigFileUsed() string { return v.configFile } + +// AddConfigPath adds a path for Viper to search for the config file in. +// Can be called multiple times to define multiple search paths. +func AddConfigPath(in string) { v.AddConfigPath(in) } +func (v *Viper) AddConfigPath(in string) { + if in != "" { + absin := absPathify(in) + jww.INFO.Println("adding", absin, "to paths to search") + if !stringInSlice(absin, v.configPaths) { + v.configPaths = append(v.configPaths, absin) + } + } +} + +// AddRemoteProvider adds a remote configuration source. +// Remote Providers are searched in the order they are added. +// provider is a string value, "etcd" or "consul" are currently supported. +// endpoint is the url. etcd requires http://ip:port consul requires ip:port +// path is the path in the k/v store to retrieve configuration +// To retrieve a config file called myapp.json from /configs/myapp.json +// you should set path to /configs and set config name (SetConfigName()) to +// "myapp" +func AddRemoteProvider(provider, endpoint, path string) error { + return v.AddRemoteProvider(provider, endpoint, path) +} +func (v *Viper) AddRemoteProvider(provider, endpoint, path string) error { + if !stringInSlice(provider, SupportedRemoteProviders) { + return UnsupportedRemoteProviderError(provider) + } + if provider != "" && endpoint != "" { + jww.INFO.Printf("adding %s:%s to remote provider list", provider, endpoint) + rp := &defaultRemoteProvider{ + endpoint: endpoint, + provider: provider, + path: path, + } + if !v.providerPathExists(rp) { + v.remoteProviders = append(v.remoteProviders, rp) + } + } + return nil +} + +// AddSecureRemoteProvider adds a remote configuration source. +// Secure Remote Providers are searched in the order they are added. +// provider is a string value, "etcd" or "consul" are currently supported. +// endpoint is the url. etcd requires http://ip:port consul requires ip:port +// secretkeyring is the filepath to your openpgp secret keyring. e.g. /etc/secrets/myring.gpg +// path is the path in the k/v store to retrieve configuration +// To retrieve a config file called myapp.json from /configs/myapp.json +// you should set path to /configs and set config name (SetConfigName()) to +// "myapp" +// Secure Remote Providers are implemented with github.com/xordataexchange/crypt +func AddSecureRemoteProvider(provider, endpoint, path, secretkeyring string) error { + return v.AddSecureRemoteProvider(provider, endpoint, path, secretkeyring) +} + +func (v *Viper) AddSecureRemoteProvider(provider, endpoint, path, secretkeyring string) error { + if !stringInSlice(provider, SupportedRemoteProviders) { + return UnsupportedRemoteProviderError(provider) + } + if provider != "" && endpoint != "" { + jww.INFO.Printf("adding %s:%s to remote provider list", provider, endpoint) + rp := &defaultRemoteProvider{ + endpoint: endpoint, + provider: provider, + path: path, + secretKeyring: secretkeyring, + } + if !v.providerPathExists(rp) { + v.remoteProviders = append(v.remoteProviders, rp) + } + } + return nil +} + +func (v *Viper) providerPathExists(p *defaultRemoteProvider) bool { + for _, y := range v.remoteProviders { + if reflect.DeepEqual(y, p) { + return true + } + } + return false +} + +// searchMap recursively searches for a value for path in source map. +// Returns nil if not found. +// Note: This assumes that the path entries and map keys are lower cased. +func (v *Viper) searchMap(source map[string]interface{}, path []string) interface{} { + if len(path) == 0 { + return source + } + + next, ok := source[path[0]] + if ok { + // Fast path + if len(path) == 1 { + return next + } + + // Nested case + switch next.(type) { + case map[interface{}]interface{}: + return v.searchMap(cast.ToStringMap(next), path[1:]) + case map[string]interface{}: + // Type assertion is safe here since it is only reached + // if the type of `next` is the same as the type being asserted + return v.searchMap(next.(map[string]interface{}), path[1:]) + default: + // got a value but nested key expected, return "nil" for not found + return nil + } + } + return nil +} + +// searchMapWithPathPrefixes recursively searches for a value for path in source map. +// +// While searchMap() considers each path element as a single map key, this +// function searches for, and prioritizes, merged path elements. +// e.g., if in the source, "foo" is defined with a sub-key "bar", and "foo.bar" +// is also defined, this latter value is returned for path ["foo", "bar"]. +// +// This should be useful only at config level (other maps may not contain dots +// in their keys). +// +// Note: This assumes that the path entries and map keys are lower cased. +func (v *Viper) searchMapWithPathPrefixes(source map[string]interface{}, path []string) interface{} { + if len(path) == 0 { + return source + } + + // search for path prefixes, starting from the longest one + for i := len(path); i > 0; i-- { + prefixKey := strings.ToLower(strings.Join(path[0:i], v.keyDelim)) + + next, ok := source[prefixKey] + if ok { + // Fast path + if i == len(path) { + return next + } + + // Nested case + var val interface{} + switch next.(type) { + case map[interface{}]interface{}: + val = v.searchMapWithPathPrefixes(cast.ToStringMap(next), path[i:]) + case map[string]interface{}: + // Type assertion is safe here since it is only reached + // if the type of `next` is the same as the type being asserted + val = v.searchMapWithPathPrefixes(next.(map[string]interface{}), path[i:]) + default: + // got a value but nested key expected, do nothing and look for next prefix + } + if val != nil { + return val + } + } + } + + // not found + return nil +} + +// isPathShadowedInDeepMap makes sure the given path is not shadowed somewhere +// on its path in the map. +// e.g., if "foo.bar" has a value in the given map, it “shadows” +// "foo.bar.baz" in a lower-priority map +func (v *Viper) isPathShadowedInDeepMap(path []string, m map[string]interface{}) string { + var parentVal interface{} + for i := 1; i < len(path); i++ { + parentVal = v.searchMap(m, path[0:i]) + if parentVal == nil { + // not found, no need to add more path elements + return "" + } + switch parentVal.(type) { + case map[interface{}]interface{}: + continue + case map[string]interface{}: + continue + default: + // parentVal is a regular value which shadows "path" + return strings.Join(path[0:i], v.keyDelim) + } + } + return "" +} + +// isPathShadowedInFlatMap makes sure the given path is not shadowed somewhere +// in a sub-path of the map. +// e.g., if "foo.bar" has a value in the given map, it “shadows” +// "foo.bar.baz" in a lower-priority map +func (v *Viper) isPathShadowedInFlatMap(path []string, mi interface{}) string { + // unify input map + var m map[string]interface{} + switch mi.(type) { + case map[string]string, map[string]FlagValue: + m = cast.ToStringMap(mi) + default: + return "" + } + + // scan paths + var parentKey string + for i := 1; i < len(path); i++ { + parentKey = strings.Join(path[0:i], v.keyDelim) + if _, ok := m[parentKey]; ok { + return parentKey + } + } + return "" +} + +// isPathShadowedInAutoEnv makes sure the given path is not shadowed somewhere +// in the environment, when automatic env is on. +// e.g., if "foo.bar" has a value in the environment, it “shadows” +// "foo.bar.baz" in a lower-priority map +func (v *Viper) isPathShadowedInAutoEnv(path []string) string { + var parentKey string + var val string + for i := 1; i < len(path); i++ { + parentKey = strings.Join(path[0:i], v.keyDelim) + if val = v.getEnv(v.mergeWithEnvPrefix(parentKey)); val != "" { + return parentKey + } + } + return "" +} + +// SetTypeByDefaultValue enables or disables the inference of a key value's +// type when the Get function is used based upon a key's default value as +// opposed to the value returned based on the normal fetch logic. +// +// For example, if a key has a default value of []string{} and the same key +// is set via an environment variable to "a b c", a call to the Get function +// would return a string slice for the key if the key's type is inferred by +// the default value and the Get function would return: +// +// []string {"a", "b", "c"} +// +// Otherwise the Get function would return: +// +// "a b c" +func SetTypeByDefaultValue(enable bool) { v.SetTypeByDefaultValue(enable) } +func (v *Viper) SetTypeByDefaultValue(enable bool) { + v.typeByDefValue = enable +} + +// GetViper gets the global Viper instance. +func GetViper() *Viper { + return v +} + +// Get can retrieve any value given the key to use. +// Get is case-insensitive for a key. +// Get has the behavior of returning the value associated with the first +// place from where it is set. Viper will check in the following order: +// override, flag, env, config file, key/value store, default +// +// Get returns an interface. For a specific value use one of the Get____ methods. +func Get(key string) interface{} { return v.Get(key) } +func (v *Viper) Get(key string) interface{} { + lcaseKey := strings.ToLower(key) + val := v.find(lcaseKey) + if val == nil { + return nil + } + + if v.typeByDefValue { + // TODO(bep) this branch isn't covered by a single test. + valType := val + path := strings.Split(lcaseKey, v.keyDelim) + defVal := v.searchMap(v.defaults, path) + if defVal != nil { + valType = defVal + } + + switch valType.(type) { + case bool: + return cast.ToBool(val) + case string: + return cast.ToString(val) + case int64, int32, int16, int8, int: + return cast.ToInt(val) + case float64, float32: + return cast.ToFloat64(val) + case time.Time: + return cast.ToTime(val) + case time.Duration: + return cast.ToDuration(val) + case []string: + return cast.ToStringSlice(val) + } + } + + return val +} + +// Sub returns new Viper instance representing a sub tree of this instance. +// Sub is case-insensitive for a key. +func Sub(key string) *Viper { return v.Sub(key) } +func (v *Viper) Sub(key string) *Viper { + subv := New() + data := v.Get(key) + if data == nil { + return nil + } + + if reflect.TypeOf(data).Kind() == reflect.Map { + subv.config = cast.ToStringMap(data) + return subv + } + return nil +} + +// GetString returns the value associated with the key as a string. +func GetString(key string) string { return v.GetString(key) } +func (v *Viper) GetString(key string) string { + return cast.ToString(v.Get(key)) +} + +// GetBool returns the value associated with the key as a boolean. +func GetBool(key string) bool { return v.GetBool(key) } +func (v *Viper) GetBool(key string) bool { + return cast.ToBool(v.Get(key)) +} + +// GetInt returns the value associated with the key as an integer. +func GetInt(key string) int { return v.GetInt(key) } +func (v *Viper) GetInt(key string) int { + return cast.ToInt(v.Get(key)) +} + +// GetInt64 returns the value associated with the key as an integer. +func GetInt64(key string) int64 { return v.GetInt64(key) } +func (v *Viper) GetInt64(key string) int64 { + return cast.ToInt64(v.Get(key)) +} + +// GetFloat64 returns the value associated with the key as a float64. +func GetFloat64(key string) float64 { return v.GetFloat64(key) } +func (v *Viper) GetFloat64(key string) float64 { + return cast.ToFloat64(v.Get(key)) +} + +// GetTime returns the value associated with the key as time. +func GetTime(key string) time.Time { return v.GetTime(key) } +func (v *Viper) GetTime(key string) time.Time { + return cast.ToTime(v.Get(key)) +} + +// GetDuration returns the value associated with the key as a duration. +func GetDuration(key string) time.Duration { return v.GetDuration(key) } +func (v *Viper) GetDuration(key string) time.Duration { + return cast.ToDuration(v.Get(key)) +} + +// GetStringSlice returns the value associated with the key as a slice of strings. +func GetStringSlice(key string) []string { return v.GetStringSlice(key) } +func (v *Viper) GetStringSlice(key string) []string { + return cast.ToStringSlice(v.Get(key)) +} + +// GetStringMap returns the value associated with the key as a map of interfaces. +func GetStringMap(key string) map[string]interface{} { return v.GetStringMap(key) } +func (v *Viper) GetStringMap(key string) map[string]interface{} { + return cast.ToStringMap(v.Get(key)) +} + +// GetStringMapString returns the value associated with the key as a map of strings. +func GetStringMapString(key string) map[string]string { return v.GetStringMapString(key) } +func (v *Viper) GetStringMapString(key string) map[string]string { + return cast.ToStringMapString(v.Get(key)) +} + +// GetStringMapStringSlice returns the value associated with the key as a map to a slice of strings. +func GetStringMapStringSlice(key string) map[string][]string { return v.GetStringMapStringSlice(key) } +func (v *Viper) GetStringMapStringSlice(key string) map[string][]string { + return cast.ToStringMapStringSlice(v.Get(key)) +} + +// GetSizeInBytes returns the size of the value associated with the given key +// in bytes. +func GetSizeInBytes(key string) uint { return v.GetSizeInBytes(key) } +func (v *Viper) GetSizeInBytes(key string) uint { + sizeStr := cast.ToString(v.Get(key)) + return parseSizeInBytes(sizeStr) +} + +// UnmarshalKey takes a single key and unmarshals it into a Struct. +func UnmarshalKey(key string, rawVal interface{}) error { return v.UnmarshalKey(key, rawVal) } +func (v *Viper) UnmarshalKey(key string, rawVal interface{}) error { + err := decode(v.Get(key), defaultDecoderConfig(rawVal)) + + if err != nil { + return err + } + + v.insensitiviseMaps() + + return nil +} + +// Unmarshal unmarshals the config into a Struct. Make sure that the tags +// on the fields of the structure are properly set. +func Unmarshal(rawVal interface{}) error { return v.Unmarshal(rawVal) } +func (v *Viper) Unmarshal(rawVal interface{}) error { + err := decode(v.AllSettings(), defaultDecoderConfig(rawVal)) + + if err != nil { + return err + } + + v.insensitiviseMaps() + + return nil +} + +// defaultDecoderConfig returns default mapsstructure.DecoderConfig with suppot +// of time.Duration values +func defaultDecoderConfig(output interface{}) *mapstructure.DecoderConfig { + return &mapstructure.DecoderConfig{ + Metadata: nil, + Result: output, + WeaklyTypedInput: true, + DecodeHook: mapstructure.StringToTimeDurationHookFunc(), + } +} + +// A wrapper around mapstructure.Decode that mimics the WeakDecode functionality +func decode(input interface{}, config *mapstructure.DecoderConfig) error { + decoder, err := mapstructure.NewDecoder(config) + if err != nil { + return err + } + return decoder.Decode(input) +} + +// UnmarshalExact unmarshals the config into a Struct, erroring if a field is nonexistent +// in the destination struct. +func (v *Viper) UnmarshalExact(rawVal interface{}) error { + config := defaultDecoderConfig(rawVal) + config.ErrorUnused = true + + err := decode(v.AllSettings(), config) + + if err != nil { + return err + } + + v.insensitiviseMaps() + + return nil +} + +// BindPFlags binds a full flag set to the configuration, using each flag's long +// name as the config key. +func BindPFlags(flags *pflag.FlagSet) error { return v.BindPFlags(flags) } +func (v *Viper) BindPFlags(flags *pflag.FlagSet) error { + return v.BindFlagValues(pflagValueSet{flags}) +} + +// BindPFlag binds a specific key to a pflag (as used by cobra). +// Example (where serverCmd is a Cobra instance): +// +// serverCmd.Flags().Int("port", 1138, "Port to run Application server on") +// Viper.BindPFlag("port", serverCmd.Flags().Lookup("port")) +// +func BindPFlag(key string, flag *pflag.Flag) error { return v.BindPFlag(key, flag) } +func (v *Viper) BindPFlag(key string, flag *pflag.Flag) error { + return v.BindFlagValue(key, pflagValue{flag}) +} + +// BindFlagValues binds a full FlagValue set to the configuration, using each flag's long +// name as the config key. +func BindFlagValues(flags FlagValueSet) error { return v.BindFlagValues(flags) } +func (v *Viper) BindFlagValues(flags FlagValueSet) (err error) { + flags.VisitAll(func(flag FlagValue) { + if err = v.BindFlagValue(flag.Name(), flag); err != nil { + return + } + }) + return nil +} + +// BindFlagValue binds a specific key to a FlagValue. +// Example (where serverCmd is a Cobra instance): +// +// serverCmd.Flags().Int("port", 1138, "Port to run Application server on") +// Viper.BindFlagValue("port", serverCmd.Flags().Lookup("port")) +// +func BindFlagValue(key string, flag FlagValue) error { return v.BindFlagValue(key, flag) } +func (v *Viper) BindFlagValue(key string, flag FlagValue) error { + if flag == nil { + return fmt.Errorf("flag for %q is nil", key) + } + v.pflags[strings.ToLower(key)] = flag + return nil +} + +// BindEnv binds a Viper key to a ENV variable. +// ENV variables are case sensitive. +// If only a key is provided, it will use the env key matching the key, uppercased. +// EnvPrefix will be used when set when env name is not provided. +func BindEnv(input ...string) error { return v.BindEnv(input...) } +func (v *Viper) BindEnv(input ...string) error { + var key, envkey string + if len(input) == 0 { + return fmt.Errorf("BindEnv missing key to bind to") + } + + key = strings.ToLower(input[0]) + + if len(input) == 1 { + envkey = v.mergeWithEnvPrefix(key) + } else { + envkey = input[1] + } + + v.env[key] = envkey + + return nil +} + +// Given a key, find the value. +// Viper will check in the following order: +// flag, env, config file, key/value store, default. +// Viper will check to see if an alias exists first. +// Note: this assumes a lower-cased key given. +func (v *Viper) find(lcaseKey string) interface{} { + + var ( + val interface{} + exists bool + path = strings.Split(lcaseKey, v.keyDelim) + nested = len(path) > 1 + ) + + // compute the path through the nested maps to the nested value + if nested && v.isPathShadowedInDeepMap(path, castMapStringToMapInterface(v.aliases)) != "" { + return nil + } + + // if the requested key is an alias, then return the proper key + lcaseKey = v.realKey(lcaseKey) + path = strings.Split(lcaseKey, v.keyDelim) + nested = len(path) > 1 + + // Set() override first + val = v.searchMap(v.override, path) + if val != nil { + return val + } + if nested && v.isPathShadowedInDeepMap(path, v.override) != "" { + return nil + } + + // PFlag override next + flag, exists := v.pflags[lcaseKey] + if exists && flag.HasChanged() { + switch flag.ValueType() { + case "int", "int8", "int16", "int32", "int64": + return cast.ToInt(flag.ValueString()) + case "bool": + return cast.ToBool(flag.ValueString()) + case "stringSlice": + s := strings.TrimPrefix(flag.ValueString(), "[") + s = strings.TrimSuffix(s, "]") + res, _ := readAsCSV(s) + return res + default: + return flag.ValueString() + } + } + if nested && v.isPathShadowedInFlatMap(path, v.pflags) != "" { + return nil + } + + // Env override next + if v.automaticEnvApplied { + // even if it hasn't been registered, if automaticEnv is used, + // check any Get request + if val = v.getEnv(v.mergeWithEnvPrefix(lcaseKey)); val != "" { + return val + } + if nested && v.isPathShadowedInAutoEnv(path) != "" { + return nil + } + } + envkey, exists := v.env[lcaseKey] + if exists { + if val = v.getEnv(envkey); val != "" { + return val + } + } + if nested && v.isPathShadowedInFlatMap(path, v.env) != "" { + return nil + } + + // Config file next + val = v.searchMapWithPathPrefixes(v.config, path) + if val != nil { + return val + } + if nested && v.isPathShadowedInDeepMap(path, v.config) != "" { + return nil + } + + // K/V store next + val = v.searchMap(v.kvstore, path) + if val != nil { + return val + } + if nested && v.isPathShadowedInDeepMap(path, v.kvstore) != "" { + return nil + } + + // Default next + val = v.searchMap(v.defaults, path) + if val != nil { + return val + } + if nested && v.isPathShadowedInDeepMap(path, v.defaults) != "" { + return nil + } + + // last chance: if no other value is returned and a flag does exist for the value, + // get the flag's value even if the flag's value has not changed + if flag, exists := v.pflags[lcaseKey]; exists { + switch flag.ValueType() { + case "int", "int8", "int16", "int32", "int64": + return cast.ToInt(flag.ValueString()) + case "bool": + return cast.ToBool(flag.ValueString()) + case "stringSlice": + s := strings.TrimPrefix(flag.ValueString(), "[") + s = strings.TrimSuffix(s, "]") + res, _ := readAsCSV(s) + return res + default: + return flag.ValueString() + } + } + // last item, no need to check shadowing + + return nil +} + +func readAsCSV(val string) ([]string, error) { + if val == "" { + return []string{}, nil + } + stringReader := strings.NewReader(val) + csvReader := csv.NewReader(stringReader) + return csvReader.Read() +} + +// IsSet checks to see if the key has been set in any of the data locations. +// IsSet is case-insensitive for a key. +func IsSet(key string) bool { return v.IsSet(key) } +func (v *Viper) IsSet(key string) bool { + lcaseKey := strings.ToLower(key) + val := v.find(lcaseKey) + return val != nil +} + +// AutomaticEnv has Viper check ENV variables for all. +// keys set in config, default & flags +func AutomaticEnv() { v.AutomaticEnv() } +func (v *Viper) AutomaticEnv() { + v.automaticEnvApplied = true +} + +// SetEnvKeyReplacer sets the strings.Replacer on the viper object +// Useful for mapping an environmental variable to a key that does +// not match it. +func SetEnvKeyReplacer(r *strings.Replacer) { v.SetEnvKeyReplacer(r) } +func (v *Viper) SetEnvKeyReplacer(r *strings.Replacer) { + v.envKeyReplacer = r +} + +// Aliases provide another accessor for the same key. +// This enables one to change a name without breaking the application +func RegisterAlias(alias string, key string) { v.RegisterAlias(alias, key) } +func (v *Viper) RegisterAlias(alias string, key string) { + v.registerAlias(alias, strings.ToLower(key)) +} + +func (v *Viper) registerAlias(alias string, key string) { + alias = strings.ToLower(alias) + if alias != key && alias != v.realKey(key) { + _, exists := v.aliases[alias] + + if !exists { + // if we alias something that exists in one of the maps to another + // name, we'll never be able to get that value using the original + // name, so move the config value to the new realkey. + if val, ok := v.config[alias]; ok { + delete(v.config, alias) + v.config[key] = val + } + if val, ok := v.kvstore[alias]; ok { + delete(v.kvstore, alias) + v.kvstore[key] = val + } + if val, ok := v.defaults[alias]; ok { + delete(v.defaults, alias) + v.defaults[key] = val + } + if val, ok := v.override[alias]; ok { + delete(v.override, alias) + v.override[key] = val + } + v.aliases[alias] = key + } + } else { + jww.WARN.Println("Creating circular reference alias", alias, key, v.realKey(key)) + } +} + +func (v *Viper) realKey(key string) string { + newkey, exists := v.aliases[key] + if exists { + jww.DEBUG.Println("Alias", key, "to", newkey) + return v.realKey(newkey) + } + return key +} + +// InConfig checks to see if the given key (or an alias) is in the config file. +func InConfig(key string) bool { return v.InConfig(key) } +func (v *Viper) InConfig(key string) bool { + // if the requested key is an alias, then return the proper key + key = v.realKey(key) + + _, exists := v.config[key] + return exists +} + +// SetDefault sets the default value for this key. +// SetDefault is case-insensitive for a key. +// Default only used when no value is provided by the user via flag, config or ENV. +func SetDefault(key string, value interface{}) { v.SetDefault(key, value) } +func (v *Viper) SetDefault(key string, value interface{}) { + // If alias passed in, then set the proper default + key = v.realKey(strings.ToLower(key)) + value = toCaseInsensitiveValue(value) + + path := strings.Split(key, v.keyDelim) + lastKey := strings.ToLower(path[len(path)-1]) + deepestMap := deepSearch(v.defaults, path[0:len(path)-1]) + + // set innermost value + deepestMap[lastKey] = value +} + +// Set sets the value for the key in the override regiser. +// Set is case-insensitive for a key. +// Will be used instead of values obtained via +// flags, config file, ENV, default, or key/value store. +func Set(key string, value interface{}) { v.Set(key, value) } +func (v *Viper) Set(key string, value interface{}) { + // If alias passed in, then set the proper override + key = v.realKey(strings.ToLower(key)) + value = toCaseInsensitiveValue(value) + + path := strings.Split(key, v.keyDelim) + lastKey := strings.ToLower(path[len(path)-1]) + deepestMap := deepSearch(v.override, path[0:len(path)-1]) + + // set innermost value + deepestMap[lastKey] = value +} + +// ReadInConfig will discover and load the configuration file from disk +// and key/value stores, searching in one of the defined paths. +func ReadInConfig() error { return v.ReadInConfig() } +func (v *Viper) ReadInConfig() error { + jww.INFO.Println("Attempting to read in config file") + filename, err := v.getConfigFile() + if err != nil { + return err + } + + if !stringInSlice(v.getConfigType(), SupportedExts) { + return UnsupportedConfigError(v.getConfigType()) + } + + file, err := afero.ReadFile(v.fs, filename) + if err != nil { + return err + } + + config := make(map[string]interface{}) + + err = v.unmarshalReader(bytes.NewReader(file), config) + if err != nil { + return err + } + + v.config = config + return nil +} + +// MergeInConfig merges a new configuration with an existing config. +func MergeInConfig() error { return v.MergeInConfig() } +func (v *Viper) MergeInConfig() error { + jww.INFO.Println("Attempting to merge in config file") + filename, err := v.getConfigFile() + if err != nil { + return err + } + + if !stringInSlice(v.getConfigType(), SupportedExts) { + return UnsupportedConfigError(v.getConfigType()) + } + + file, err := afero.ReadFile(v.fs, filename) + if err != nil { + return err + } + + return v.MergeConfig(bytes.NewReader(file)) +} + +// ReadConfig will read a configuration file, setting existing keys to nil if the +// key does not exist in the file. +func ReadConfig(in io.Reader) error { return v.ReadConfig(in) } +func (v *Viper) ReadConfig(in io.Reader) error { + v.config = make(map[string]interface{}) + return v.unmarshalReader(in, v.config) +} + +// MergeConfig merges a new configuration with an existing config. +func MergeConfig(in io.Reader) error { return v.MergeConfig(in) } +func (v *Viper) MergeConfig(in io.Reader) error { + if v.config == nil { + v.config = make(map[string]interface{}) + } + cfg := make(map[string]interface{}) + if err := v.unmarshalReader(in, cfg); err != nil { + return err + } + mergeMaps(cfg, v.config, nil) + return nil +} + +func keyExists(k string, m map[string]interface{}) string { + lk := strings.ToLower(k) + for mk := range m { + lmk := strings.ToLower(mk) + if lmk == lk { + return mk + } + } + return "" +} + +func castToMapStringInterface( + src map[interface{}]interface{}) map[string]interface{} { + tgt := map[string]interface{}{} + for k, v := range src { + tgt[fmt.Sprintf("%v", k)] = v + } + return tgt +} + +func castMapStringToMapInterface(src map[string]string) map[string]interface{} { + tgt := map[string]interface{}{} + for k, v := range src { + tgt[k] = v + } + return tgt +} + +func castMapFlagToMapInterface(src map[string]FlagValue) map[string]interface{} { + tgt := map[string]interface{}{} + for k, v := range src { + tgt[k] = v + } + return tgt +} + +// mergeMaps merges two maps. The `itgt` parameter is for handling go-yaml's +// insistence on parsing nested structures as `map[interface{}]interface{}` +// instead of using a `string` as the key for nest structures beyond one level +// deep. Both map types are supported as there is a go-yaml fork that uses +// `map[string]interface{}` instead. +func mergeMaps( + src, tgt map[string]interface{}, itgt map[interface{}]interface{}) { + for sk, sv := range src { + tk := keyExists(sk, tgt) + if tk == "" { + jww.TRACE.Printf("tk=\"\", tgt[%s]=%v", sk, sv) + tgt[sk] = sv + if itgt != nil { + itgt[sk] = sv + } + continue + } + + tv, ok := tgt[tk] + if !ok { + jww.TRACE.Printf("tgt[%s] != ok, tgt[%s]=%v", tk, sk, sv) + tgt[sk] = sv + if itgt != nil { + itgt[sk] = sv + } + continue + } + + svType := reflect.TypeOf(sv) + tvType := reflect.TypeOf(tv) + if svType != tvType { + jww.ERROR.Printf( + "svType != tvType; key=%s, st=%v, tt=%v, sv=%v, tv=%v", + sk, svType, tvType, sv, tv) + continue + } + + jww.TRACE.Printf("processing key=%s, st=%v, tt=%v, sv=%v, tv=%v", + sk, svType, tvType, sv, tv) + + switch ttv := tv.(type) { + case map[interface{}]interface{}: + jww.TRACE.Printf("merging maps (must convert)") + tsv := sv.(map[interface{}]interface{}) + ssv := castToMapStringInterface(tsv) + stv := castToMapStringInterface(ttv) + mergeMaps(ssv, stv, ttv) + case map[string]interface{}: + jww.TRACE.Printf("merging maps") + mergeMaps(sv.(map[string]interface{}), ttv, nil) + default: + jww.TRACE.Printf("setting value") + tgt[tk] = sv + if itgt != nil { + itgt[tk] = sv + } + } + } +} + +// ReadRemoteConfig attempts to get configuration from a remote source +// and read it in the remote configuration registry. +func ReadRemoteConfig() error { return v.ReadRemoteConfig() } +func (v *Viper) ReadRemoteConfig() error { + return v.getKeyValueConfig() +} + +func WatchRemoteConfig() error { return v.WatchRemoteConfig() } +func (v *Viper) WatchRemoteConfig() error { + return v.watchKeyValueConfig() +} + +func (v *Viper) WatchRemoteConfigOnChannel() error { + return v.watchKeyValueConfigOnChannel() +} + +// Unmarshal a Reader into a map. +// Should probably be an unexported function. +func unmarshalReader(in io.Reader, c map[string]interface{}) error { + return v.unmarshalReader(in, c) +} + +func (v *Viper) unmarshalReader(in io.Reader, c map[string]interface{}) error { + return unmarshallConfigReader(in, c, v.getConfigType()) +} + +func (v *Viper) insensitiviseMaps() { + insensitiviseMap(v.config) + insensitiviseMap(v.defaults) + insensitiviseMap(v.override) + insensitiviseMap(v.kvstore) +} + +// Retrieve the first found remote configuration. +func (v *Viper) getKeyValueConfig() error { + if RemoteConfig == nil { + return RemoteConfigError("Enable the remote features by doing a blank import of the viper/remote package: '_ github.com/spf13/viper/remote'") + } + + for _, rp := range v.remoteProviders { + val, err := v.getRemoteConfig(rp) + if err != nil { + continue + } + v.kvstore = val + return nil + } + return RemoteConfigError("No Files Found") +} + +func (v *Viper) getRemoteConfig(provider RemoteProvider) (map[string]interface{}, error) { + reader, err := RemoteConfig.Get(provider) + if err != nil { + return nil, err + } + err = v.unmarshalReader(reader, v.kvstore) + return v.kvstore, err +} + +// Retrieve the first found remote configuration. +func (v *Viper) watchKeyValueConfigOnChannel() error { + for _, rp := range v.remoteProviders { + respc, _ := RemoteConfig.WatchChannel(rp) + //Todo: Add quit channel + go func(rc <-chan *RemoteResponse) { + for { + b := <-rc + reader := bytes.NewReader(b.Value) + v.unmarshalReader(reader, v.kvstore) + } + }(respc) + return nil + } + return RemoteConfigError("No Files Found") +} + +// Retrieve the first found remote configuration. +func (v *Viper) watchKeyValueConfig() error { + for _, rp := range v.remoteProviders { + val, err := v.watchRemoteConfig(rp) + if err != nil { + continue + } + v.kvstore = val + return nil + } + return RemoteConfigError("No Files Found") +} + +func (v *Viper) watchRemoteConfig(provider RemoteProvider) (map[string]interface{}, error) { + reader, err := RemoteConfig.Watch(provider) + if err != nil { + return nil, err + } + err = v.unmarshalReader(reader, v.kvstore) + return v.kvstore, err +} + +// AllKeys returns all keys holding a value, regardless of where they are set. +// Nested keys are returned with a v.keyDelim (= ".") separator +func AllKeys() []string { return v.AllKeys() } +func (v *Viper) AllKeys() []string { + m := map[string]bool{} + // add all paths, by order of descending priority to ensure correct shadowing + m = v.flattenAndMergeMap(m, castMapStringToMapInterface(v.aliases), "") + m = v.flattenAndMergeMap(m, v.override, "") + m = v.mergeFlatMap(m, castMapFlagToMapInterface(v.pflags)) + m = v.mergeFlatMap(m, castMapStringToMapInterface(v.env)) + m = v.flattenAndMergeMap(m, v.config, "") + m = v.flattenAndMergeMap(m, v.kvstore, "") + m = v.flattenAndMergeMap(m, v.defaults, "") + + // convert set of paths to list + a := []string{} + for x := range m { + a = append(a, x) + } + return a +} + +// flattenAndMergeMap recursively flattens the given map into a map[string]bool +// of key paths (used as a set, easier to manipulate than a []string): +// - each path is merged into a single key string, delimited with v.keyDelim (= ".") +// - if a path is shadowed by an earlier value in the initial shadow map, +// it is skipped. +// The resulting set of paths is merged to the given shadow set at the same time. +func (v *Viper) flattenAndMergeMap(shadow map[string]bool, m map[string]interface{}, prefix string) map[string]bool { + if shadow != nil && prefix != "" && shadow[prefix] { + // prefix is shadowed => nothing more to flatten + return shadow + } + if shadow == nil { + shadow = make(map[string]bool) + } + + var m2 map[string]interface{} + if prefix != "" { + prefix += v.keyDelim + } + for k, val := range m { + fullKey := prefix + k + switch val.(type) { + case map[string]interface{}: + m2 = val.(map[string]interface{}) + case map[interface{}]interface{}: + m2 = cast.ToStringMap(val) + default: + // immediate value + shadow[strings.ToLower(fullKey)] = true + continue + } + // recursively merge to shadow map + shadow = v.flattenAndMergeMap(shadow, m2, fullKey) + } + return shadow +} + +// mergeFlatMap merges the given maps, excluding values of the second map +// shadowed by values from the first map. +func (v *Viper) mergeFlatMap(shadow map[string]bool, m map[string]interface{}) map[string]bool { + // scan keys +outer: + for k, _ := range m { + path := strings.Split(k, v.keyDelim) + // scan intermediate paths + var parentKey string + for i := 1; i < len(path); i++ { + parentKey = strings.Join(path[0:i], v.keyDelim) + if shadow[parentKey] { + // path is shadowed, continue + continue outer + } + } + // add key + shadow[strings.ToLower(k)] = true + } + return shadow +} + +// AllSettings merges all settings and returns them as a map[string]interface{}. +func AllSettings() map[string]interface{} { return v.AllSettings() } +func (v *Viper) AllSettings() map[string]interface{} { + m := map[string]interface{}{} + // start from the list of keys, and construct the map one value at a time + for _, k := range v.AllKeys() { + value := v.Get(k) + if value == nil { + // should not happen, since AllKeys() returns only keys holding a value, + // check just in case anything changes + continue + } + path := strings.Split(k, v.keyDelim) + lastKey := strings.ToLower(path[len(path)-1]) + deepestMap := deepSearch(m, path[0:len(path)-1]) + // set innermost value + deepestMap[lastKey] = value + } + return m +} + +// SetFs sets the filesystem to use to read configuration. +func SetFs(fs afero.Fs) { v.SetFs(fs) } +func (v *Viper) SetFs(fs afero.Fs) { + v.fs = fs +} + +// SetConfigName sets name for the config file. +// Does not include extension. +func SetConfigName(in string) { v.SetConfigName(in) } +func (v *Viper) SetConfigName(in string) { + if in != "" { + v.configName = in + v.configFile = "" + } +} + +// SetConfigType sets the type of the configuration returned by the +// remote source, e.g. "json". +func SetConfigType(in string) { v.SetConfigType(in) } +func (v *Viper) SetConfigType(in string) { + if in != "" { + v.configType = in + } +} + +func (v *Viper) getConfigType() string { + if v.configType != "" { + return v.configType + } + + cf, err := v.getConfigFile() + if err != nil { + return "" + } + + ext := filepath.Ext(cf) + + if len(ext) > 1 { + return ext[1:] + } + + return "" +} + +func (v *Viper) getConfigFile() (string, error) { + // if explicitly set, then use it + if v.configFile != "" { + return v.configFile, nil + } + + cf, err := v.findConfigFile() + if err != nil { + return "", err + } + + v.configFile = cf + return v.getConfigFile() +} + +func (v *Viper) searchInPath(in string) (filename string) { + jww.DEBUG.Println("Searching for config in ", in) + for _, ext := range SupportedExts { + jww.DEBUG.Println("Checking for", filepath.Join(in, v.configName+"."+ext)) + if b, _ := exists(filepath.Join(in, v.configName+"."+ext)); b { + jww.DEBUG.Println("Found: ", filepath.Join(in, v.configName+"."+ext)) + return filepath.Join(in, v.configName+"."+ext) + } + } + + return "" +} + +// Search all configPaths for any config file. +// Returns the first path that exists (and is a config file). +func (v *Viper) findConfigFile() (string, error) { + jww.INFO.Println("Searching for config in ", v.configPaths) + + for _, cp := range v.configPaths { + file := v.searchInPath(cp) + if file != "" { + return file, nil + } + } + return "", ConfigFileNotFoundError{v.configName, fmt.Sprintf("%s", v.configPaths)} +} + +// Debug prints all configuration registries for debugging +// purposes. +func Debug() { v.Debug() } +func (v *Viper) Debug() { + fmt.Printf("Aliases:\n%#v\n", v.aliases) + fmt.Printf("Override:\n%#v\n", v.override) + fmt.Printf("PFlags:\n%#v\n", v.pflags) + fmt.Printf("Env:\n%#v\n", v.env) + fmt.Printf("Key/Value Store:\n%#v\n", v.kvstore) + fmt.Printf("Config:\n%#v\n", v.config) + fmt.Printf("Defaults:\n%#v\n", v.defaults) +} diff --git a/vendor/github.com/spf13/viper/viper_test.go b/vendor/github.com/spf13/viper/viper_test.go new file mode 100644 index 0000000000..774ca1168c --- /dev/null +++ b/vendor/github.com/spf13/viper/viper_test.go @@ -0,0 +1,1221 @@ +// Copyright © 2014 Steve Francia . +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file. + +package viper + +import ( + "bytes" + "fmt" + "io" + "io/ioutil" + "os" + "path" + "reflect" + "sort" + "strings" + "testing" + "time" + + "github.com/spf13/cast" + + "github.com/spf13/pflag" + "github.com/stretchr/testify/assert" +) + +var yamlExample = []byte(`Hacker: true +name: steve +hobbies: +- skateboarding +- snowboarding +- go +clothing: + jacket: leather + trousers: denim + pants: + size: large +age: 35 +eyes : brown +beard: true +`) + +var yamlExampleWithExtras = []byte(`Existing: true +Bogus: true +`) + +type testUnmarshalExtra struct { + Existing bool +} + +var tomlExample = []byte(` +title = "TOML Example" + +[owner] +organization = "MongoDB" +Bio = "MongoDB Chief Developer Advocate & Hacker at Large" +dob = 1979-05-27T07:32:00Z # First class dates? Why not?`) + +var jsonExample = []byte(`{ +"id": "0001", +"type": "donut", +"name": "Cake", +"ppu": 0.55, +"batters": { + "batter": [ + { "type": "Regular" }, + { "type": "Chocolate" }, + { "type": "Blueberry" }, + { "type": "Devil's Food" } + ] + } +}`) + +var hclExample = []byte(` +id = "0001" +type = "donut" +name = "Cake" +ppu = 0.55 +foos { + foo { + key = 1 + } + foo { + key = 2 + } + foo { + key = 3 + } + foo { + key = 4 + } +}`) + +var propertiesExample = []byte(` +p_id: 0001 +p_type: donut +p_name: Cake +p_ppu: 0.55 +p_batters.batter.type: Regular +`) + +var remoteExample = []byte(`{ +"id":"0002", +"type":"cronut", +"newkey":"remote" +}`) + +func initConfigs() { + Reset() + var r io.Reader + SetConfigType("yaml") + r = bytes.NewReader(yamlExample) + unmarshalReader(r, v.config) + + SetConfigType("json") + r = bytes.NewReader(jsonExample) + unmarshalReader(r, v.config) + + SetConfigType("hcl") + r = bytes.NewReader(hclExample) + unmarshalReader(r, v.config) + + SetConfigType("properties") + r = bytes.NewReader(propertiesExample) + unmarshalReader(r, v.config) + + SetConfigType("toml") + r = bytes.NewReader(tomlExample) + unmarshalReader(r, v.config) + + SetConfigType("json") + remote := bytes.NewReader(remoteExample) + unmarshalReader(remote, v.kvstore) +} + +func initConfig(typ, config string) { + Reset() + SetConfigType(typ) + r := strings.NewReader(config) + + if err := unmarshalReader(r, v.config); err != nil { + panic(err) + } +} + +func initYAML() { + initConfig("yaml", string(yamlExample)) +} + +func initJSON() { + Reset() + SetConfigType("json") + r := bytes.NewReader(jsonExample) + + unmarshalReader(r, v.config) +} + +func initProperties() { + Reset() + SetConfigType("properties") + r := bytes.NewReader(propertiesExample) + + unmarshalReader(r, v.config) +} + +func initTOML() { + Reset() + SetConfigType("toml") + r := bytes.NewReader(tomlExample) + + unmarshalReader(r, v.config) +} + +func initHcl() { + Reset() + SetConfigType("hcl") + r := bytes.NewReader(hclExample) + + unmarshalReader(r, v.config) +} + +// make directories for testing +func initDirs(t *testing.T) (string, string, func()) { + + var ( + testDirs = []string{`a a`, `b`, `c\c`, `D_`} + config = `improbable` + ) + + root, err := ioutil.TempDir("", "") + + cleanup := true + defer func() { + if cleanup { + os.Chdir("..") + os.RemoveAll(root) + } + }() + + assert.Nil(t, err) + + err = os.Chdir(root) + assert.Nil(t, err) + + for _, dir := range testDirs { + err = os.Mkdir(dir, 0750) + assert.Nil(t, err) + + err = ioutil.WriteFile( + path.Join(dir, config+".toml"), + []byte("key = \"value is "+dir+"\"\n"), + 0640) + assert.Nil(t, err) + } + + cleanup = false + return root, config, func() { + os.Chdir("..") + os.RemoveAll(root) + } +} + +//stubs for PFlag Values +type stringValue string + +func newStringValue(val string, p *string) *stringValue { + *p = val + return (*stringValue)(p) +} + +func (s *stringValue) Set(val string) error { + *s = stringValue(val) + return nil +} + +func (s *stringValue) Type() string { + return "string" +} + +func (s *stringValue) String() string { + return fmt.Sprintf("%s", *s) +} + +func TestBasics(t *testing.T) { + SetConfigFile("/tmp/config.yaml") + filename, err := v.getConfigFile() + assert.Equal(t, "/tmp/config.yaml", filename) + assert.NoError(t, err) +} + +func TestDefault(t *testing.T) { + SetDefault("age", 45) + assert.Equal(t, 45, Get("age")) + + SetDefault("clothing.jacket", "slacks") + assert.Equal(t, "slacks", Get("clothing.jacket")) + + SetConfigType("yaml") + err := ReadConfig(bytes.NewBuffer(yamlExample)) + + assert.NoError(t, err) + assert.Equal(t, "leather", Get("clothing.jacket")) +} + +func TestUnmarshalling(t *testing.T) { + SetConfigType("yaml") + r := bytes.NewReader(yamlExample) + + unmarshalReader(r, v.config) + assert.True(t, InConfig("name")) + assert.False(t, InConfig("state")) + assert.Equal(t, "steve", Get("name")) + assert.Equal(t, []interface{}{"skateboarding", "snowboarding", "go"}, Get("hobbies")) + assert.Equal(t, map[string]interface{}{"jacket": "leather", "trousers": "denim", "pants": map[string]interface{}{"size": "large"}}, Get("clothing")) + assert.Equal(t, 35, Get("age")) +} + +func TestUnmarshalExact(t *testing.T) { + vip := New() + target := &testUnmarshalExtra{} + vip.SetConfigType("yaml") + r := bytes.NewReader(yamlExampleWithExtras) + vip.ReadConfig(r) + err := vip.UnmarshalExact(target) + if err == nil { + t.Fatal("UnmarshalExact should error when populating a struct from a conf that contains unused fields") + } +} + +func TestOverrides(t *testing.T) { + Set("age", 40) + assert.Equal(t, 40, Get("age")) +} + +func TestDefaultPost(t *testing.T) { + assert.NotEqual(t, "NYC", Get("state")) + SetDefault("state", "NYC") + assert.Equal(t, "NYC", Get("state")) +} + +func TestAliases(t *testing.T) { + RegisterAlias("years", "age") + assert.Equal(t, 40, Get("years")) + Set("years", 45) + assert.Equal(t, 45, Get("age")) +} + +func TestAliasInConfigFile(t *testing.T) { + // the config file specifies "beard". If we make this an alias for + // "hasbeard", we still want the old config file to work with beard. + RegisterAlias("beard", "hasbeard") + assert.Equal(t, true, Get("hasbeard")) + Set("hasbeard", false) + assert.Equal(t, false, Get("beard")) +} + +func TestYML(t *testing.T) { + initYAML() + assert.Equal(t, "steve", Get("name")) +} + +func TestJSON(t *testing.T) { + initJSON() + assert.Equal(t, "0001", Get("id")) +} + +func TestProperties(t *testing.T) { + initProperties() + assert.Equal(t, "0001", Get("p_id")) +} + +func TestTOML(t *testing.T) { + initTOML() + assert.Equal(t, "TOML Example", Get("title")) +} + +func TestHCL(t *testing.T) { + initHcl() + assert.Equal(t, "0001", Get("id")) + assert.Equal(t, 0.55, Get("ppu")) + assert.Equal(t, "donut", Get("type")) + assert.Equal(t, "Cake", Get("name")) + Set("id", "0002") + assert.Equal(t, "0002", Get("id")) + assert.NotEqual(t, "cronut", Get("type")) +} + +func TestRemotePrecedence(t *testing.T) { + initJSON() + + remote := bytes.NewReader(remoteExample) + assert.Equal(t, "0001", Get("id")) + unmarshalReader(remote, v.kvstore) + assert.Equal(t, "0001", Get("id")) + assert.NotEqual(t, "cronut", Get("type")) + assert.Equal(t, "remote", Get("newkey")) + Set("newkey", "newvalue") + assert.NotEqual(t, "remote", Get("newkey")) + assert.Equal(t, "newvalue", Get("newkey")) + Set("newkey", "remote") +} + +func TestEnv(t *testing.T) { + initJSON() + + BindEnv("id") + BindEnv("f", "FOOD") + + os.Setenv("ID", "13") + os.Setenv("FOOD", "apple") + os.Setenv("NAME", "crunk") + + assert.Equal(t, "13", Get("id")) + assert.Equal(t, "apple", Get("f")) + assert.Equal(t, "Cake", Get("name")) + + AutomaticEnv() + + assert.Equal(t, "crunk", Get("name")) + +} + +func TestEnvPrefix(t *testing.T) { + initJSON() + + SetEnvPrefix("foo") // will be uppercased automatically + BindEnv("id") + BindEnv("f", "FOOD") // not using prefix + + os.Setenv("FOO_ID", "13") + os.Setenv("FOOD", "apple") + os.Setenv("FOO_NAME", "crunk") + + assert.Equal(t, "13", Get("id")) + assert.Equal(t, "apple", Get("f")) + assert.Equal(t, "Cake", Get("name")) + + AutomaticEnv() + + assert.Equal(t, "crunk", Get("name")) +} + +func TestAutoEnv(t *testing.T) { + Reset() + + AutomaticEnv() + os.Setenv("FOO_BAR", "13") + assert.Equal(t, "13", Get("foo_bar")) +} + +func TestAutoEnvWithPrefix(t *testing.T) { + Reset() + + AutomaticEnv() + SetEnvPrefix("Baz") + os.Setenv("BAZ_BAR", "13") + assert.Equal(t, "13", Get("bar")) +} + +func TestSetEnvReplacer(t *testing.T) { + Reset() + + AutomaticEnv() + os.Setenv("REFRESH_INTERVAL", "30s") + + replacer := strings.NewReplacer("-", "_") + SetEnvKeyReplacer(replacer) + + assert.Equal(t, "30s", Get("refresh-interval")) +} + +func TestAllKeys(t *testing.T) { + initConfigs() + + ks := sort.StringSlice{"title", "newkey", "owner.organization", "owner.dob", "owner.bio", "name", "beard", "ppu", "batters.batter", "hobbies", "clothing.jacket", "clothing.trousers", "clothing.pants.size", "age", "hacker", "id", "type", "eyes", "p_id", "p_ppu", "p_batters.batter.type", "p_type", "p_name", "foos"} + dob, _ := time.Parse(time.RFC3339, "1979-05-27T07:32:00Z") + all := map[string]interface{}{"owner": map[string]interface{}{"organization": "MongoDB", "bio": "MongoDB Chief Developer Advocate & Hacker at Large", "dob": dob}, "title": "TOML Example", "ppu": 0.55, "eyes": "brown", "clothing": map[string]interface{}{"trousers": "denim", "jacket": "leather", "pants": map[string]interface{}{"size": "large"}}, "id": "0001", "batters": map[string]interface{}{"batter": []interface{}{map[string]interface{}{"type": "Regular"}, map[string]interface{}{"type": "Chocolate"}, map[string]interface{}{"type": "Blueberry"}, map[string]interface{}{"type": "Devil's Food"}}}, "hacker": true, "beard": true, "hobbies": []interface{}{"skateboarding", "snowboarding", "go"}, "age": 35, "type": "donut", "newkey": "remote", "name": "Cake", "p_id": "0001", "p_ppu": "0.55", "p_name": "Cake", "p_batters": map[string]interface{}{"batter": map[string]interface{}{"type": "Regular"}}, "p_type": "donut", "foos": []map[string]interface{}{map[string]interface{}{"foo": []map[string]interface{}{map[string]interface{}{"key": 1}, map[string]interface{}{"key": 2}, map[string]interface{}{"key": 3}, map[string]interface{}{"key": 4}}}}} + + var allkeys sort.StringSlice + allkeys = AllKeys() + allkeys.Sort() + ks.Sort() + + assert.Equal(t, ks, allkeys) + assert.Equal(t, all, AllSettings()) +} + +func TestAllKeysWithEnv(t *testing.T) { + v := New() + + // bind and define environment variables (including a nested one) + v.BindEnv("id") + v.BindEnv("foo.bar") + v.SetEnvKeyReplacer(strings.NewReplacer(".", "_")) + os.Setenv("ID", "13") + os.Setenv("FOO_BAR", "baz") + + expectedKeys := sort.StringSlice{"id", "foo.bar"} + expectedKeys.Sort() + keys := sort.StringSlice(v.AllKeys()) + keys.Sort() + assert.Equal(t, expectedKeys, keys) +} + +func TestAliasesOfAliases(t *testing.T) { + Set("Title", "Checking Case") + RegisterAlias("Foo", "Bar") + RegisterAlias("Bar", "Title") + assert.Equal(t, "Checking Case", Get("FOO")) +} + +func TestRecursiveAliases(t *testing.T) { + RegisterAlias("Baz", "Roo") + RegisterAlias("Roo", "baz") +} + +func TestUnmarshal(t *testing.T) { + SetDefault("port", 1313) + Set("name", "Steve") + Set("duration", "1s1ms") + + type config struct { + Port int + Name string + Duration time.Duration + } + + var C config + + err := Unmarshal(&C) + if err != nil { + t.Fatalf("unable to decode into struct, %v", err) + } + + assert.Equal(t, &config{Name: "Steve", Port: 1313, Duration: time.Second + time.Millisecond}, &C) + + Set("port", 1234) + err = Unmarshal(&C) + if err != nil { + t.Fatalf("unable to decode into struct, %v", err) + } + assert.Equal(t, &config{Name: "Steve", Port: 1234, Duration: time.Second + time.Millisecond}, &C) +} + +func TestBindPFlags(t *testing.T) { + v := New() // create independent Viper object + flagSet := pflag.NewFlagSet("test", pflag.ContinueOnError) + + var testValues = map[string]*string{ + "host": nil, + "port": nil, + "endpoint": nil, + } + + var mutatedTestValues = map[string]string{ + "host": "localhost", + "port": "6060", + "endpoint": "/public", + } + + for name := range testValues { + testValues[name] = flagSet.String(name, "", "test") + } + + err := v.BindPFlags(flagSet) + if err != nil { + t.Fatalf("error binding flag set, %v", err) + } + + flagSet.VisitAll(func(flag *pflag.Flag) { + flag.Value.Set(mutatedTestValues[flag.Name]) + flag.Changed = true + }) + + for name, expected := range mutatedTestValues { + assert.Equal(t, expected, v.Get(name)) + } + +} + +func TestBindPFlagsStringSlice(t *testing.T) { + for _, testValue := range []struct { + Expected []string + Value string + }{ + {[]string{}, ""}, + {[]string{"jeden"}, "jeden"}, + {[]string{"dwa", "trzy"}, "dwa,trzy"}, + {[]string{"cztery", "piec , szesc"}, "cztery,\"piec , szesc\""}} { + + for _, changed := range []bool{true, false} { + v := New() // create independent Viper object + flagSet := pflag.NewFlagSet("test", pflag.ContinueOnError) + flagSet.StringSlice("stringslice", testValue.Expected, "test") + flagSet.Visit(func(f *pflag.Flag) { + if len(testValue.Value) > 0 { + f.Value.Set(testValue.Value) + f.Changed = changed + } + }) + + err := v.BindPFlags(flagSet) + if err != nil { + t.Fatalf("error binding flag set, %v", err) + } + + type TestStr struct { + StringSlice []string + } + val := &TestStr{} + if err := v.Unmarshal(val); err != nil { + t.Fatalf("%+#v cannot unmarshal: %s", testValue.Value, err) + } + assert.Equal(t, testValue.Expected, val.StringSlice) + } + } +} + +func TestBindPFlag(t *testing.T) { + var testString = "testing" + var testValue = newStringValue(testString, &testString) + + flag := &pflag.Flag{ + Name: "testflag", + Value: testValue, + Changed: false, + } + + BindPFlag("testvalue", flag) + + assert.Equal(t, testString, Get("testvalue")) + + flag.Value.Set("testing_mutate") + flag.Changed = true //hack for pflag usage + + assert.Equal(t, "testing_mutate", Get("testvalue")) + +} + +func TestBoundCaseSensitivity(t *testing.T) { + assert.Equal(t, "brown", Get("eyes")) + + BindEnv("eYEs", "TURTLE_EYES") + os.Setenv("TURTLE_EYES", "blue") + + assert.Equal(t, "blue", Get("eyes")) + + var testString = "green" + var testValue = newStringValue(testString, &testString) + + flag := &pflag.Flag{ + Name: "eyeballs", + Value: testValue, + Changed: true, + } + + BindPFlag("eYEs", flag) + assert.Equal(t, "green", Get("eyes")) + +} + +func TestSizeInBytes(t *testing.T) { + input := map[string]uint{ + "": 0, + "b": 0, + "12 bytes": 0, + "200000000000gb": 0, + "12 b": 12, + "43 MB": 43 * (1 << 20), + "10mb": 10 * (1 << 20), + "1gb": 1 << 30, + } + + for str, expected := range input { + assert.Equal(t, expected, parseSizeInBytes(str), str) + } +} + +func TestFindsNestedKeys(t *testing.T) { + initConfigs() + dob, _ := time.Parse(time.RFC3339, "1979-05-27T07:32:00Z") + + Set("super", map[string]interface{}{ + "deep": map[string]interface{}{ + "nested": "value", + }, + }) + + expected := map[string]interface{}{ + "super": map[string]interface{}{ + "deep": map[string]interface{}{ + "nested": "value", + }, + }, + "super.deep": map[string]interface{}{ + "nested": "value", + }, + "super.deep.nested": "value", + "owner.organization": "MongoDB", + "batters.batter": []interface{}{ + map[string]interface{}{ + "type": "Regular", + }, + map[string]interface{}{ + "type": "Chocolate", + }, + map[string]interface{}{ + "type": "Blueberry", + }, + map[string]interface{}{ + "type": "Devil's Food", + }, + }, + "hobbies": []interface{}{ + "skateboarding", "snowboarding", "go", + }, + "title": "TOML Example", + "newkey": "remote", + "batters": map[string]interface{}{ + "batter": []interface{}{ + map[string]interface{}{ + "type": "Regular", + }, + map[string]interface{}{ + "type": "Chocolate", + }, map[string]interface{}{ + "type": "Blueberry", + }, map[string]interface{}{ + "type": "Devil's Food", + }, + }, + }, + "eyes": "brown", + "age": 35, + "owner": map[string]interface{}{ + "organization": "MongoDB", + "bio": "MongoDB Chief Developer Advocate & Hacker at Large", + "dob": dob, + }, + "owner.bio": "MongoDB Chief Developer Advocate & Hacker at Large", + "type": "donut", + "id": "0001", + "name": "Cake", + "hacker": true, + "ppu": 0.55, + "clothing": map[string]interface{}{ + "jacket": "leather", + "trousers": "denim", + "pants": map[string]interface{}{ + "size": "large", + }, + }, + "clothing.jacket": "leather", + "clothing.pants.size": "large", + "clothing.trousers": "denim", + "owner.dob": dob, + "beard": true, + "foos": []map[string]interface{}{ + map[string]interface{}{ + "foo": []map[string]interface{}{ + map[string]interface{}{ + "key": 1, + }, + map[string]interface{}{ + "key": 2, + }, + map[string]interface{}{ + "key": 3, + }, + map[string]interface{}{ + "key": 4, + }, + }, + }, + }, + } + + for key, expectedValue := range expected { + + assert.Equal(t, expectedValue, v.Get(key)) + } + +} + +func TestReadBufConfig(t *testing.T) { + v := New() + v.SetConfigType("yaml") + v.ReadConfig(bytes.NewBuffer(yamlExample)) + t.Log(v.AllKeys()) + + assert.True(t, v.InConfig("name")) + assert.False(t, v.InConfig("state")) + assert.Equal(t, "steve", v.Get("name")) + assert.Equal(t, []interface{}{"skateboarding", "snowboarding", "go"}, v.Get("hobbies")) + assert.Equal(t, map[string]interface{}{"jacket": "leather", "trousers": "denim", "pants": map[string]interface{}{"size": "large"}}, v.Get("clothing")) + assert.Equal(t, 35, v.Get("age")) +} + +func TestIsSet(t *testing.T) { + v := New() + v.SetConfigType("yaml") + v.ReadConfig(bytes.NewBuffer(yamlExample)) + assert.True(t, v.IsSet("clothing.jacket")) + assert.False(t, v.IsSet("clothing.jackets")) + assert.False(t, v.IsSet("helloworld")) + v.Set("helloworld", "fubar") + assert.True(t, v.IsSet("helloworld")) +} + +func TestDirsSearch(t *testing.T) { + + root, config, cleanup := initDirs(t) + defer cleanup() + + v := New() + v.SetConfigName(config) + v.SetDefault(`key`, `default`) + + entries, err := ioutil.ReadDir(root) + for _, e := range entries { + if e.IsDir() { + v.AddConfigPath(e.Name()) + } + } + + err = v.ReadInConfig() + assert.Nil(t, err) + + assert.Equal(t, `value is `+path.Base(v.configPaths[0]), v.GetString(`key`)) +} + +func TestWrongDirsSearchNotFound(t *testing.T) { + + _, config, cleanup := initDirs(t) + defer cleanup() + + v := New() + v.SetConfigName(config) + v.SetDefault(`key`, `default`) + + v.AddConfigPath(`whattayoutalkingbout`) + v.AddConfigPath(`thispathaintthere`) + + err := v.ReadInConfig() + assert.Equal(t, reflect.TypeOf(ConfigFileNotFoundError{"", ""}), reflect.TypeOf(err)) + + // Even though config did not load and the error might have + // been ignored by the client, the default still loads + assert.Equal(t, `default`, v.GetString(`key`)) +} + +func TestWrongDirsSearchNotFoundForMerge(t *testing.T) { + + _, config, cleanup := initDirs(t) + defer cleanup() + + v := New() + v.SetConfigName(config) + v.SetDefault(`key`, `default`) + + v.AddConfigPath(`whattayoutalkingbout`) + v.AddConfigPath(`thispathaintthere`) + + err := v.MergeInConfig() + assert.Equal(t, reflect.TypeOf(ConfigFileNotFoundError{"", ""}), reflect.TypeOf(err)) + + // Even though config did not load and the error might have + // been ignored by the client, the default still loads + assert.Equal(t, `default`, v.GetString(`key`)) +} + +func TestSub(t *testing.T) { + v := New() + v.SetConfigType("yaml") + v.ReadConfig(bytes.NewBuffer(yamlExample)) + + subv := v.Sub("clothing") + assert.Equal(t, v.Get("clothing.pants.size"), subv.Get("pants.size")) + + subv = v.Sub("clothing.pants") + assert.Equal(t, v.Get("clothing.pants.size"), subv.Get("size")) + + subv = v.Sub("clothing.pants.size") + assert.Equal(t, (*Viper)(nil), subv) + + subv = v.Sub("missing.key") + assert.Equal(t, (*Viper)(nil), subv) +} + +var yamlMergeExampleTgt = []byte(` +hello: + pop: 37890 + lagrenum: 765432101234567 + world: + - us + - uk + - fr + - de +`) + +var yamlMergeExampleSrc = []byte(` +hello: + pop: 45000 + lagrenum: 7654321001234567 + universe: + - mw + - ad +fu: bar +`) + +func TestMergeConfig(t *testing.T) { + v := New() + v.SetConfigType("yml") + if err := v.ReadConfig(bytes.NewBuffer(yamlMergeExampleTgt)); err != nil { + t.Fatal(err) + } + + if pop := v.GetInt("hello.pop"); pop != 37890 { + t.Fatalf("pop != 37890, = %d", pop) + } + + if pop := v.GetInt("hello.lagrenum"); pop != 765432101234567 { + t.Fatalf("lagrenum != 765432101234567, = %d", pop) + } + + if pop := v.GetInt64("hello.lagrenum"); pop != int64(765432101234567) { + t.Fatalf("int64 lagrenum != 765432101234567, = %d", pop) + } + + if world := v.GetStringSlice("hello.world"); len(world) != 4 { + t.Fatalf("len(world) != 4, = %d", len(world)) + } + + if fu := v.GetString("fu"); fu != "" { + t.Fatalf("fu != \"\", = %s", fu) + } + + if err := v.MergeConfig(bytes.NewBuffer(yamlMergeExampleSrc)); err != nil { + t.Fatal(err) + } + + if pop := v.GetInt("hello.pop"); pop != 45000 { + t.Fatalf("pop != 45000, = %d", pop) + } + + if pop := v.GetInt("hello.lagrenum"); pop != 7654321001234567 { + t.Fatalf("lagrenum != 7654321001234567, = %d", pop) + } + + if pop := v.GetInt64("hello.lagrenum"); pop != int64(7654321001234567) { + t.Fatalf("int64 lagrenum != 7654321001234567, = %d", pop) + } + + if world := v.GetStringSlice("hello.world"); len(world) != 4 { + t.Fatalf("len(world) != 4, = %d", len(world)) + } + + if universe := v.GetStringSlice("hello.universe"); len(universe) != 2 { + t.Fatalf("len(universe) != 2, = %d", len(universe)) + } + + if fu := v.GetString("fu"); fu != "bar" { + t.Fatalf("fu != \"bar\", = %s", fu) + } +} + +func TestMergeConfigNoMerge(t *testing.T) { + v := New() + v.SetConfigType("yml") + if err := v.ReadConfig(bytes.NewBuffer(yamlMergeExampleTgt)); err != nil { + t.Fatal(err) + } + + if pop := v.GetInt("hello.pop"); pop != 37890 { + t.Fatalf("pop != 37890, = %d", pop) + } + + if world := v.GetStringSlice("hello.world"); len(world) != 4 { + t.Fatalf("len(world) != 4, = %d", len(world)) + } + + if fu := v.GetString("fu"); fu != "" { + t.Fatalf("fu != \"\", = %s", fu) + } + + if err := v.ReadConfig(bytes.NewBuffer(yamlMergeExampleSrc)); err != nil { + t.Fatal(err) + } + + if pop := v.GetInt("hello.pop"); pop != 45000 { + t.Fatalf("pop != 45000, = %d", pop) + } + + if world := v.GetStringSlice("hello.world"); len(world) != 0 { + t.Fatalf("len(world) != 0, = %d", len(world)) + } + + if universe := v.GetStringSlice("hello.universe"); len(universe) != 2 { + t.Fatalf("len(universe) != 2, = %d", len(universe)) + } + + if fu := v.GetString("fu"); fu != "bar" { + t.Fatalf("fu != \"bar\", = %s", fu) + } +} + +func TestUnmarshalingWithAliases(t *testing.T) { + v := New() + v.SetDefault("ID", 1) + v.Set("name", "Steve") + v.Set("lastname", "Owen") + + v.RegisterAlias("UserID", "ID") + v.RegisterAlias("Firstname", "name") + v.RegisterAlias("Surname", "lastname") + + type config struct { + ID int + FirstName string + Surname string + } + + var C config + err := v.Unmarshal(&C) + if err != nil { + t.Fatalf("unable to decode into struct, %v", err) + } + + assert.Equal(t, &config{ID: 1, FirstName: "Steve", Surname: "Owen"}, &C) +} + +func TestSetConfigNameClearsFileCache(t *testing.T) { + SetConfigFile("/tmp/config.yaml") + SetConfigName("default") + f, err := v.getConfigFile() + if err == nil { + t.Fatalf("config file cache should have been cleared") + } + assert.Empty(t, f) +} + +func TestShadowedNestedValue(t *testing.T) { + + config := `name: steve +clothing: + jacket: leather + trousers: denim + pants: + size: large +` + initConfig("yaml", config) + + assert.Equal(t, "steve", GetString("name")) + + polyester := "polyester" + SetDefault("clothing.shirt", polyester) + SetDefault("clothing.jacket.price", 100) + + assert.Equal(t, "leather", GetString("clothing.jacket")) + assert.Nil(t, Get("clothing.jacket.price")) + assert.Equal(t, polyester, GetString("clothing.shirt")) + + clothingSettings := AllSettings()["clothing"].(map[string]interface{}) + assert.Equal(t, "leather", clothingSettings["jacket"]) + assert.Equal(t, polyester, clothingSettings["shirt"]) +} + +func TestDotParameter(t *testing.T) { + initJSON() + // shoud take precedence over batters defined in jsonExample + r := bytes.NewReader([]byte(`{ "batters.batter": [ { "type": "Small" } ] }`)) + unmarshalReader(r, v.config) + + actual := Get("batters.batter") + expected := []interface{}{map[string]interface{}{"type": "Small"}} + assert.Equal(t, expected, actual) +} + +func TestCaseInsensitive(t *testing.T) { + for _, config := range []struct { + typ string + content string + }{ + {"yaml", ` +aBcD: 1 +eF: + gH: 2 + iJk: 3 + Lm: + nO: 4 + P: + Q: 5 + R: 6 +`}, + {"json", `{ + "aBcD": 1, + "eF": { + "iJk": 3, + "Lm": { + "P": { + "Q": 5, + "R": 6 + }, + "nO": 4 + }, + "gH": 2 + } +}`}, + {"toml", `aBcD = 1 +[eF] +gH = 2 +iJk = 3 +[eF.Lm] +nO = 4 +[eF.Lm.P] +Q = 5 +R = 6 +`}, + } { + doTestCaseInsensitive(t, config.typ, config.content) + } +} + +func TestCaseInsensitiveSet(t *testing.T) { + Reset() + m1 := map[string]interface{}{ + "Foo": 32, + "Bar": map[interface{}]interface { + }{ + "ABc": "A", + "cDE": "B"}, + } + + m2 := map[string]interface{}{ + "Foo": 52, + "Bar": map[interface{}]interface { + }{ + "bCd": "A", + "eFG": "B"}, + } + + Set("Given1", m1) + Set("Number1", 42) + + SetDefault("Given2", m2) + SetDefault("Number2", 52) + + // Verify SetDefault + if v := Get("number2"); v != 52 { + t.Fatalf("Expected 52 got %q", v) + } + + if v := Get("given2.foo"); v != 52 { + t.Fatalf("Expected 52 got %q", v) + } + + if v := Get("given2.bar.bcd"); v != "A" { + t.Fatalf("Expected A got %q", v) + } + + if _, ok := m2["Foo"]; !ok { + t.Fatal("Input map changed") + } + + // Verify Set + if v := Get("number1"); v != 42 { + t.Fatalf("Expected 42 got %q", v) + } + + if v := Get("given1.foo"); v != 32 { + t.Fatalf("Expected 32 got %q", v) + } + + if v := Get("given1.bar.abc"); v != "A" { + t.Fatalf("Expected A got %q", v) + } + + if _, ok := m1["Foo"]; !ok { + t.Fatal("Input map changed") + } +} + +func TestParseNested(t *testing.T) { + type duration struct { + Delay time.Duration + } + + type item struct { + Name string + Delay time.Duration + Nested duration + } + + config := `[[parent]] + delay="100ms" + [parent.nested] + delay="200ms" +` + initConfig("toml", config) + + var items []item + err := v.UnmarshalKey("parent", &items) + if err != nil { + t.Fatalf("unable to decode into struct, %v", err) + } + + assert.Equal(t, 1, len(items)) + assert.Equal(t, 100*time.Millisecond, items[0].Delay) + assert.Equal(t, 200*time.Millisecond, items[0].Nested.Delay) +} + +func doTestCaseInsensitive(t *testing.T, typ, config string) { + initConfig(typ, config) + Set("RfD", true) + assert.Equal(t, true, Get("rfd")) + assert.Equal(t, true, Get("rFD")) + assert.Equal(t, 1, cast.ToInt(Get("abcd"))) + assert.Equal(t, 1, cast.ToInt(Get("Abcd"))) + assert.Equal(t, 2, cast.ToInt(Get("ef.gh"))) + assert.Equal(t, 3, cast.ToInt(Get("ef.ijk"))) + assert.Equal(t, 4, cast.ToInt(Get("ef.lm.no"))) + assert.Equal(t, 5, cast.ToInt(Get("ef.lm.p.q"))) + +} + +func BenchmarkGetBool(b *testing.B) { + key := "BenchmarkGetBool" + v = New() + v.Set(key, true) + + for i := 0; i < b.N; i++ { + if !v.GetBool(key) { + b.Fatal("GetBool returned false") + } + } +} + +func BenchmarkGet(b *testing.B) { + key := "BenchmarkGet" + v = New() + v.Set(key, true) + + for i := 0; i < b.N; i++ { + if !v.Get(key).(bool) { + b.Fatal("Get returned false") + } + } +} + +// This is the "perfect result" for the above. +func BenchmarkGetBoolFromMap(b *testing.B) { + m := make(map[string]bool) + key := "BenchmarkGetBool" + m[key] = true + + for i := 0; i < b.N; i++ { + if !m[key] { + b.Fatal("Map value was false") + } + } +} diff --git a/vendor/google.golang.org/genproto/CONTRIBUTING.md b/vendor/google.golang.org/genproto/CONTRIBUTING.md new file mode 100644 index 0000000000..2827b7d3fa --- /dev/null +++ b/vendor/google.golang.org/genproto/CONTRIBUTING.md @@ -0,0 +1,27 @@ +Want to contribute? Great! First, read this page (including the small print at the end). + +### Before you contribute +Before we can use your code, you must sign the +[Google Individual Contributor License Agreement] +(https://cla.developers.google.com/about/google-individual) +(CLA), which you can do online. The CLA is necessary mainly because you own the +copyright to your changes, even after your contribution becomes part of our +codebase, so we need your permission to use and distribute your code. We also +need to be sure of various other things—for instance that you'll tell us if you +know that your code infringes on other people's patents. You don't have to sign +the CLA until after you've submitted your code for review and a member has +approved it, but you must do it before we can put your code into our codebase. +Before you start working on a larger contribution, you should get in touch with +us first through the issue tracker with your idea so that we can help out and +possibly guide you. Coordinating up front makes it much easier to avoid +frustration later on. + +### Code reviews +All submissions, including submissions by project members, require review. We +use Github pull requests for this purpose. + +### The small print +Contributions made by corporations are covered by a different agreement than +the one above, the +[Software Grant and Corporate Contributor License Agreement] +(https://cla.developers.google.com/about/google-corporate). diff --git a/vendor/google.golang.org/genproto/LICENSE b/vendor/google.golang.org/genproto/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/vendor/google.golang.org/genproto/LICENSE @@ -0,0 +1,202 @@ + + 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/google.golang.org/genproto/README.md b/vendor/google.golang.org/genproto/README.md new file mode 100644 index 0000000000..51d0bae5f7 --- /dev/null +++ b/vendor/google.golang.org/genproto/README.md @@ -0,0 +1,28 @@ +Go generated proto packages +=========================== + +[![Build Status](https://travis-ci.org/google/go-genproto.svg?branch=master)](https://travis-ci.org/google/go-genproto) +[![GoDoc](https://godoc.org/google.golang.org/genproto?status.svg)](https://godoc.org/google.golang.org/genproto) + +> **IMPORTANT** This repository is currently experimental. The structure +> of the contained packages is subject to change. Please see the original +> source repositories (listed below) to find out the status of the each +> protocol buffer's associated service. + +This repository contains the generated Go packages for common protocol buffer +types, and the generated [gRPC][1] code necessary for interacting with Google's gRPC +APIs. + +There are two sources for the proto files used in this repository: + +1. [google/protobuf][2]: the code in the `protobuf` and `ptypes` subdirectories + is derived from this repo. The messages in `protobuf` are used to describe + protocol buffer messages themselves. The messages under `ptypes` define the + common well-known types. +2. [googleapis/googleapis][3]: the code in the `googleapis` is derived from this + repo. The packages here contain types specifically for interacting with Google + APIs. + +[1]: http://grpc.io +[2]: https://github.com/google/protobuf/ +[3]: https://github.com/googleapis/googleapis/ diff --git a/vendor/google.golang.org/genproto/googleapis/api/annotations/annotations.pb.go b/vendor/google.golang.org/genproto/googleapis/api/annotations/annotations.pb.go new file mode 100644 index 0000000000..53d57f67a5 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/api/annotations/annotations.pb.go @@ -0,0 +1,64 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/api/annotations.proto + +/* +Package annotations is a generated protocol buffer package. + +It is generated from these files: + google/api/annotations.proto + google/api/http.proto + +It has these top-level messages: + Http + HttpRule + CustomHttpPattern +*/ +package annotations + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import google_protobuf "github.com/golang/protobuf/protoc-gen-go/descriptor" + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +var E_Http = &proto.ExtensionDesc{ + ExtendedType: (*google_protobuf.MethodOptions)(nil), + ExtensionType: (*HttpRule)(nil), + Field: 72295728, + Name: "google.api.http", + Tag: "bytes,72295728,opt,name=http", + Filename: "google/api/annotations.proto", +} + +func init() { + proto.RegisterExtension(E_Http) +} + +func init() { proto.RegisterFile("google/api/annotations.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 208 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x49, 0xcf, 0xcf, 0x4f, + 0xcf, 0x49, 0xd5, 0x4f, 0x2c, 0xc8, 0xd4, 0x4f, 0xcc, 0xcb, 0xcb, 0x2f, 0x49, 0x2c, 0xc9, 0xcc, + 0xcf, 0x2b, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x82, 0xc8, 0xea, 0x25, 0x16, 0x64, + 0x4a, 0x89, 0x22, 0xa9, 0xcc, 0x28, 0x29, 0x29, 0x80, 0x28, 0x91, 0x52, 0x80, 0x0a, 0x83, 0x79, + 0x49, 0xa5, 0x69, 0xfa, 0x29, 0xa9, 0xc5, 0xc9, 0x45, 0x99, 0x05, 0x25, 0xf9, 0x45, 0x10, 0x15, + 0x56, 0xde, 0x5c, 0x2c, 0x20, 0xf5, 0x42, 0x72, 0x7a, 0x50, 0xd3, 0x60, 0x4a, 0xf5, 0x7c, 0x53, + 0x4b, 0x32, 0xf2, 0x53, 0xfc, 0x0b, 0xc0, 0x56, 0x4a, 0x6c, 0x38, 0xb5, 0x47, 0x49, 0x81, 0x51, + 0x83, 0xdb, 0x48, 0x44, 0x0f, 0x61, 0xad, 0x9e, 0x47, 0x49, 0x49, 0x41, 0x50, 0x69, 0x4e, 0x6a, + 0x10, 0xd8, 0x10, 0xa7, 0x3c, 0x2e, 0xbe, 0xe4, 0xfc, 0x5c, 0x24, 0x05, 0x4e, 0x02, 0x8e, 0x08, + 0x67, 0x07, 0x80, 0x4c, 0x0e, 0x60, 0x8c, 0x72, 0x84, 0xca, 0xa7, 0xe7, 0xe7, 0x24, 0xe6, 0xa5, + 0xeb, 0xe5, 0x17, 0xa5, 0xeb, 0xa7, 0xa7, 0xe6, 0x81, 0xed, 0xd5, 0x87, 0x48, 0x25, 0x16, 0x64, + 0x16, 0xa3, 0x7b, 0xda, 0x1a, 0x89, 0xbd, 0x88, 0x89, 0xc5, 0xdd, 0x31, 0xc0, 0x33, 0x89, 0x0d, + 0xac, 0xc9, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0xe3, 0x29, 0x19, 0x62, 0x28, 0x01, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/api/annotations/http.pb.go b/vendor/google.golang.org/genproto/googleapis/api/annotations/http.pb.go new file mode 100644 index 0000000000..f91c604620 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/api/annotations/http.pb.go @@ -0,0 +1,566 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/api/http.proto + +package annotations + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Defines the HTTP configuration for a service. It contains a list of +// [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method +// to one or more HTTP REST API methods. +type Http struct { + // A list of HTTP configuration rules that apply to individual API methods. + // + // **NOTE:** All service configuration rules follow "last one wins" order. + Rules []*HttpRule `protobuf:"bytes,1,rep,name=rules" json:"rules,omitempty"` +} + +func (m *Http) Reset() { *m = Http{} } +func (m *Http) String() string { return proto.CompactTextString(m) } +func (*Http) ProtoMessage() {} +func (*Http) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +func (m *Http) GetRules() []*HttpRule { + if m != nil { + return m.Rules + } + return nil +} + +// `HttpRule` defines the mapping of an RPC method to one or more HTTP +// REST APIs. The mapping determines what portions of the request +// message are populated from the path, query parameters, or body of +// the HTTP request. The mapping is typically specified as an +// `google.api.http` annotation, see "google/api/annotations.proto" +// for details. +// +// The mapping consists of a field specifying the path template and +// method kind. The path template can refer to fields in the request +// message, as in the example below which describes a REST GET +// operation on a resource collection of messages: +// +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http).get = "/v1/messages/{message_id}/{sub.subfield}"; +// } +// } +// message GetMessageRequest { +// message SubMessage { +// string subfield = 1; +// } +// string message_id = 1; // mapped to the URL +// SubMessage sub = 2; // `sub.subfield` is url-mapped +// } +// message Message { +// string text = 1; // content of the resource +// } +// +// The same http annotation can alternatively be expressed inside the +// `GRPC API Configuration` YAML file. +// +// http: +// rules: +// - selector: .Messaging.GetMessage +// get: /v1/messages/{message_id}/{sub.subfield} +// +// This definition enables an automatic, bidrectional mapping of HTTP +// JSON to RPC. Example: +// +// HTTP | RPC +// -----|----- +// `GET /v1/messages/123456/foo` | `GetMessage(message_id: "123456" sub: SubMessage(subfield: "foo"))` +// +// In general, not only fields but also field paths can be referenced +// from a path pattern. Fields mapped to the path pattern cannot be +// repeated and must have a primitive (non-message) type. +// +// Any fields in the request message which are not bound by the path +// pattern automatically become (optional) HTTP query +// parameters. Assume the following definition of the request message: +// +// +// message GetMessageRequest { +// message SubMessage { +// string subfield = 1; +// } +// string message_id = 1; // mapped to the URL +// int64 revision = 2; // becomes a parameter +// SubMessage sub = 3; // `sub.subfield` becomes a parameter +// } +// +// +// This enables a HTTP JSON to RPC mapping as below: +// +// HTTP | RPC +// -----|----- +// `GET /v1/messages/123456?revision=2&sub.subfield=foo` | `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: "foo"))` +// +// Note that fields which are mapped to HTTP parameters must have a +// primitive type or a repeated primitive type. Message types are not +// allowed. In the case of a repeated type, the parameter can be +// repeated in the URL, as in `...?param=A¶m=B`. +// +// For HTTP method kinds which allow a request body, the `body` field +// specifies the mapping. Consider a REST update method on the +// message resource collection: +// +// +// service Messaging { +// rpc UpdateMessage(UpdateMessageRequest) returns (Message) { +// option (google.api.http) = { +// put: "/v1/messages/{message_id}" +// body: "message" +// }; +// } +// } +// message UpdateMessageRequest { +// string message_id = 1; // mapped to the URL +// Message message = 2; // mapped to the body +// } +// +// +// The following HTTP JSON to RPC mapping is enabled, where the +// representation of the JSON in the request body is determined by +// protos JSON encoding: +// +// HTTP | RPC +// -----|----- +// `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" message { text: "Hi!" })` +// +// The special name `*` can be used in the body mapping to define that +// every field not bound by the path template should be mapped to the +// request body. This enables the following alternative definition of +// the update method: +// +// service Messaging { +// rpc UpdateMessage(Message) returns (Message) { +// option (google.api.http) = { +// put: "/v1/messages/{message_id}" +// body: "*" +// }; +// } +// } +// message Message { +// string message_id = 1; +// string text = 2; +// } +// +// +// The following HTTP JSON to RPC mapping is enabled: +// +// HTTP | RPC +// -----|----- +// `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" text: "Hi!")` +// +// Note that when using `*` in the body mapping, it is not possible to +// have HTTP parameters, as all fields not bound by the path end in +// the body. This makes this option more rarely used in practice of +// defining REST APIs. The common usage of `*` is in custom methods +// which don't use the URL at all for transferring data. +// +// It is possible to define multiple HTTP methods for one RPC by using +// the `additional_bindings` option. Example: +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http) = { +// get: "/v1/messages/{message_id}" +// additional_bindings { +// get: "/v1/users/{user_id}/messages/{message_id}" +// } +// }; +// } +// } +// message GetMessageRequest { +// string message_id = 1; +// string user_id = 2; +// } +// +// +// This enables the following two alternative HTTP JSON to RPC +// mappings: +// +// HTTP | RPC +// -----|----- +// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` +// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: "123456")` +// +// # Rules for HTTP mapping +// +// The rules for mapping HTTP path, query parameters, and body fields +// to the request message are as follows: +// +// 1. The `body` field specifies either `*` or a field path, or is +// omitted. If omitted, it assumes there is no HTTP body. +// 2. Leaf fields (recursive expansion of nested messages in the +// request) can be classified into three types: +// (a) Matched in the URL template. +// (b) Covered by body (if body is `*`, everything except (a) fields; +// else everything under the body field) +// (c) All other fields. +// 3. URL query parameters found in the HTTP request are mapped to (c) fields. +// 4. Any body sent with an HTTP request can contain only (b) fields. +// +// The syntax of the path template is as follows: +// +// Template = "/" Segments [ Verb ] ; +// Segments = Segment { "/" Segment } ; +// Segment = "*" | "**" | LITERAL | Variable ; +// Variable = "{" FieldPath [ "=" Segments ] "}" ; +// FieldPath = IDENT { "." IDENT } ; +// Verb = ":" LITERAL ; +// +// The syntax `*` matches a single path segment. It follows the semantics of +// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String +// Expansion. +// +// The syntax `**` matches zero or more path segments. It follows the semantics +// of [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.3 Reserved +// Expansion. NOTE: it must be the last segment in the path except the Verb. +// +// The syntax `LITERAL` matches literal text in the URL path. +// +// The syntax `Variable` matches the entire path as specified by its template; +// this nested template must not contain further variables. If a variable +// matches a single path segment, its template may be omitted, e.g. `{var}` +// is equivalent to `{var=*}`. +// +// NOTE: the field paths in variables and in the `body` must not refer to +// repeated fields or map fields. +// +// Use CustomHttpPattern to specify any HTTP method that is not included in the +// `pattern` field, such as HEAD, or "*" to leave the HTTP method unspecified for +// a given URL path rule. The wild-card rule is useful for services that provide +// content to Web (HTML) clients. +type HttpRule struct { + // Selects methods to which this rule applies. + // + // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + Selector string `protobuf:"bytes,1,opt,name=selector" json:"selector,omitempty"` + // Determines the URL pattern is matched by this rules. This pattern can be + // used with any of the {get|put|post|delete|patch} methods. A custom method + // can be defined using the 'custom' field. + // + // Types that are valid to be assigned to Pattern: + // *HttpRule_Get + // *HttpRule_Put + // *HttpRule_Post + // *HttpRule_Delete + // *HttpRule_Patch + // *HttpRule_Custom + Pattern isHttpRule_Pattern `protobuf_oneof:"pattern"` + // The name of the request field whose value is mapped to the HTTP body, or + // `*` for mapping all fields not captured by the path pattern to the HTTP + // body. NOTE: the referred field must not be a repeated field and must be + // present at the top-level of request message type. + Body string `protobuf:"bytes,7,opt,name=body" json:"body,omitempty"` + // Additional HTTP bindings for the selector. Nested bindings must + // not contain an `additional_bindings` field themselves (that is, + // the nesting may only be one level deep). + AdditionalBindings []*HttpRule `protobuf:"bytes,11,rep,name=additional_bindings,json=additionalBindings" json:"additional_bindings,omitempty"` +} + +func (m *HttpRule) Reset() { *m = HttpRule{} } +func (m *HttpRule) String() string { return proto.CompactTextString(m) } +func (*HttpRule) ProtoMessage() {} +func (*HttpRule) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} } + +type isHttpRule_Pattern interface { + isHttpRule_Pattern() +} + +type HttpRule_Get struct { + Get string `protobuf:"bytes,2,opt,name=get,oneof"` +} +type HttpRule_Put struct { + Put string `protobuf:"bytes,3,opt,name=put,oneof"` +} +type HttpRule_Post struct { + Post string `protobuf:"bytes,4,opt,name=post,oneof"` +} +type HttpRule_Delete struct { + Delete string `protobuf:"bytes,5,opt,name=delete,oneof"` +} +type HttpRule_Patch struct { + Patch string `protobuf:"bytes,6,opt,name=patch,oneof"` +} +type HttpRule_Custom struct { + Custom *CustomHttpPattern `protobuf:"bytes,8,opt,name=custom,oneof"` +} + +func (*HttpRule_Get) isHttpRule_Pattern() {} +func (*HttpRule_Put) isHttpRule_Pattern() {} +func (*HttpRule_Post) isHttpRule_Pattern() {} +func (*HttpRule_Delete) isHttpRule_Pattern() {} +func (*HttpRule_Patch) isHttpRule_Pattern() {} +func (*HttpRule_Custom) isHttpRule_Pattern() {} + +func (m *HttpRule) GetPattern() isHttpRule_Pattern { + if m != nil { + return m.Pattern + } + return nil +} + +func (m *HttpRule) GetSelector() string { + if m != nil { + return m.Selector + } + return "" +} + +func (m *HttpRule) GetGet() string { + if x, ok := m.GetPattern().(*HttpRule_Get); ok { + return x.Get + } + return "" +} + +func (m *HttpRule) GetPut() string { + if x, ok := m.GetPattern().(*HttpRule_Put); ok { + return x.Put + } + return "" +} + +func (m *HttpRule) GetPost() string { + if x, ok := m.GetPattern().(*HttpRule_Post); ok { + return x.Post + } + return "" +} + +func (m *HttpRule) GetDelete() string { + if x, ok := m.GetPattern().(*HttpRule_Delete); ok { + return x.Delete + } + return "" +} + +func (m *HttpRule) GetPatch() string { + if x, ok := m.GetPattern().(*HttpRule_Patch); ok { + return x.Patch + } + return "" +} + +func (m *HttpRule) GetCustom() *CustomHttpPattern { + if x, ok := m.GetPattern().(*HttpRule_Custom); ok { + return x.Custom + } + return nil +} + +func (m *HttpRule) GetBody() string { + if m != nil { + return m.Body + } + return "" +} + +func (m *HttpRule) GetAdditionalBindings() []*HttpRule { + if m != nil { + return m.AdditionalBindings + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*HttpRule) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _HttpRule_OneofMarshaler, _HttpRule_OneofUnmarshaler, _HttpRule_OneofSizer, []interface{}{ + (*HttpRule_Get)(nil), + (*HttpRule_Put)(nil), + (*HttpRule_Post)(nil), + (*HttpRule_Delete)(nil), + (*HttpRule_Patch)(nil), + (*HttpRule_Custom)(nil), + } +} + +func _HttpRule_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*HttpRule) + // pattern + switch x := m.Pattern.(type) { + case *HttpRule_Get: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeStringBytes(x.Get) + case *HttpRule_Put: + b.EncodeVarint(3<<3 | proto.WireBytes) + b.EncodeStringBytes(x.Put) + case *HttpRule_Post: + b.EncodeVarint(4<<3 | proto.WireBytes) + b.EncodeStringBytes(x.Post) + case *HttpRule_Delete: + b.EncodeVarint(5<<3 | proto.WireBytes) + b.EncodeStringBytes(x.Delete) + case *HttpRule_Patch: + b.EncodeVarint(6<<3 | proto.WireBytes) + b.EncodeStringBytes(x.Patch) + case *HttpRule_Custom: + b.EncodeVarint(8<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Custom); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("HttpRule.Pattern has unexpected type %T", x) + } + return nil +} + +func _HttpRule_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*HttpRule) + switch tag { + case 2: // pattern.get + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Pattern = &HttpRule_Get{x} + return true, err + case 3: // pattern.put + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Pattern = &HttpRule_Put{x} + return true, err + case 4: // pattern.post + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Pattern = &HttpRule_Post{x} + return true, err + case 5: // pattern.delete + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Pattern = &HttpRule_Delete{x} + return true, err + case 6: // pattern.patch + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Pattern = &HttpRule_Patch{x} + return true, err + case 8: // pattern.custom + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(CustomHttpPattern) + err := b.DecodeMessage(msg) + m.Pattern = &HttpRule_Custom{msg} + return true, err + default: + return false, nil + } +} + +func _HttpRule_OneofSizer(msg proto.Message) (n int) { + m := msg.(*HttpRule) + // pattern + switch x := m.Pattern.(type) { + case *HttpRule_Get: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Get))) + n += len(x.Get) + case *HttpRule_Put: + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Put))) + n += len(x.Put) + case *HttpRule_Post: + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Post))) + n += len(x.Post) + case *HttpRule_Delete: + n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Delete))) + n += len(x.Delete) + case *HttpRule_Patch: + n += proto.SizeVarint(6<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Patch))) + n += len(x.Patch) + case *HttpRule_Custom: + s := proto.Size(x.Custom) + n += proto.SizeVarint(8<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// A custom pattern is used for defining custom HTTP verb. +type CustomHttpPattern struct { + // The name of this custom HTTP verb. + Kind string `protobuf:"bytes,1,opt,name=kind" json:"kind,omitempty"` + // The path matched by this custom verb. + Path string `protobuf:"bytes,2,opt,name=path" json:"path,omitempty"` +} + +func (m *CustomHttpPattern) Reset() { *m = CustomHttpPattern{} } +func (m *CustomHttpPattern) String() string { return proto.CompactTextString(m) } +func (*CustomHttpPattern) ProtoMessage() {} +func (*CustomHttpPattern) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} } + +func (m *CustomHttpPattern) GetKind() string { + if m != nil { + return m.Kind + } + return "" +} + +func (m *CustomHttpPattern) GetPath() string { + if m != nil { + return m.Path + } + return "" +} + +func init() { + proto.RegisterType((*Http)(nil), "google.api.Http") + proto.RegisterType((*HttpRule)(nil), "google.api.HttpRule") + proto.RegisterType((*CustomHttpPattern)(nil), "google.api.CustomHttpPattern") +} + +func init() { proto.RegisterFile("google/api/http.proto", fileDescriptor1) } + +var fileDescriptor1 = []byte{ + // 359 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0xcf, 0x6a, 0xe3, 0x30, + 0x10, 0xc6, 0xd7, 0x89, 0xe3, 0x24, 0x13, 0x58, 0x58, 0x6d, 0x76, 0x11, 0x85, 0x42, 0xc8, 0x29, + 0xf4, 0x60, 0x43, 0x7a, 0xe8, 0x21, 0xa7, 0xb8, 0x94, 0xa6, 0xb7, 0xe0, 0x63, 0x2f, 0x45, 0xb1, + 0x85, 0xa2, 0xd6, 0x91, 0x84, 0x3d, 0x3e, 0xf4, 0x75, 0xfa, 0x0e, 0x7d, 0xb7, 0x1e, 0x8b, 0xfe, + 0xa4, 0x09, 0x14, 0x7a, 0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f9, 0x61, 0x3e, 0xe4, 0x74, + 0x20, 0x0f, 0xfe, 0x7c, 0x0c, 0x43, 0xe3, 0xeb, 0xcd, 0x57, 0xf0, 0xe7, 0x5b, 0x13, 0xb6, 0xf4, + 0x8b, 0x54, 0x55, 0x98, 0x9d, 0x8b, 0x2d, 0x33, 0x0c, 0xf7, 0x7e, 0x70, 0x85, 0x8b, 0xf3, 0x67, + 0xf8, 0x5d, 0xea, 0xc3, 0x59, 0xd9, 0x7c, 0xec, 0xae, 0xb1, 0x1b, 0xdd, 0x46, 0x8f, 0xeb, 0x90, + 0x10, 0xba, 0x66, 0x4a, 0xa4, 0xba, 0x11, 0x99, 0xe0, 0xca, 0xed, 0x3b, 0xf3, 0x29, 0x66, 0x64, + 0xeb, 0x7e, 0x02, 0x53, 0x4a, 0x23, 0xb3, 0x6d, 0xb6, 0xab, 0xb3, 0xf8, 0x23, 0x8a, 0xde, 0x7a, + 0xf1, 0xfd, 0x7a, 0xfb, 0xb0, 0x4b, 0xdc, 0xb9, 0xeb, 0xcf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x68, + 0x15, 0x60, 0x5b, 0x40, 0x02, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/api/authorization_config.pb.go b/vendor/google.golang.org/genproto/googleapis/api/authorization_config.pb.go new file mode 100644 index 0000000000..8062b9619c --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/api/authorization_config.pb.go @@ -0,0 +1,80 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/api/experimental/authorization_config.proto + +/* +Package api is a generated protocol buffer package. + +It is generated from these files: + google/api/experimental/authorization_config.proto + google/api/experimental/experimental.proto + +It has these top-level messages: + AuthorizationConfig + Experimental +*/ +package api + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Configuration of authorization. +// +// This section determines the authorization provider, if unspecified, then no +// authorization check will be done. +// +// Example: +// +// experimental: +// authorization: +// provider: firebaserules.googleapis.com +type AuthorizationConfig struct { + // The name of the authorization provider, such as + // firebaserules.googleapis.com. + Provider string `protobuf:"bytes,1,opt,name=provider" json:"provider,omitempty"` +} + +func (m *AuthorizationConfig) Reset() { *m = AuthorizationConfig{} } +func (m *AuthorizationConfig) String() string { return proto.CompactTextString(m) } +func (*AuthorizationConfig) ProtoMessage() {} +func (*AuthorizationConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *AuthorizationConfig) GetProvider() string { + if m != nil { + return m.Provider + } + return "" +} + +func init() { + proto.RegisterType((*AuthorizationConfig)(nil), "google.api.AuthorizationConfig") +} + +func init() { proto.RegisterFile("google/api/experimental/authorization_config.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 180 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x32, 0x4a, 0xcf, 0xcf, 0x4f, + 0xcf, 0x49, 0xd5, 0x4f, 0x2c, 0xc8, 0xd4, 0x4f, 0xad, 0x28, 0x48, 0x2d, 0xca, 0xcc, 0x4d, 0xcd, + 0x2b, 0x49, 0xcc, 0xd1, 0x4f, 0x2c, 0x2d, 0xc9, 0xc8, 0x2f, 0xca, 0xac, 0x4a, 0x2c, 0xc9, 0xcc, + 0xcf, 0x8b, 0x4f, 0xce, 0xcf, 0x4b, 0xcb, 0x4c, 0xd7, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, + 0x82, 0xe8, 0xd1, 0x4b, 0x2c, 0xc8, 0x54, 0x32, 0xe4, 0x12, 0x76, 0x44, 0x56, 0xe9, 0x0c, 0x56, + 0x28, 0x24, 0xc5, 0xc5, 0x51, 0x50, 0x94, 0x5f, 0x96, 0x99, 0x92, 0x5a, 0x24, 0xc1, 0xa8, 0xc0, + 0xa8, 0xc1, 0x19, 0x04, 0xe7, 0x3b, 0x25, 0x71, 0xf1, 0x25, 0xe7, 0xe7, 0xea, 0x21, 0x0c, 0x71, + 0x92, 0xc0, 0x62, 0x44, 0x00, 0xc8, 0xaa, 0x00, 0xc6, 0x28, 0x5d, 0xa8, 0xba, 0xf4, 0xfc, 0x9c, + 0xc4, 0xbc, 0x74, 0xbd, 0xfc, 0xa2, 0x74, 0xfd, 0xf4, 0xd4, 0x3c, 0xb0, 0x43, 0xf4, 0x21, 0x52, + 0x89, 0x05, 0x99, 0xc5, 0x20, 0xf7, 0x5b, 0x27, 0x16, 0x64, 0x2e, 0x62, 0x62, 0x71, 0x77, 0x0c, + 0xf0, 0x4c, 0x62, 0x03, 0x2b, 0x30, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x52, 0x27, 0x0c, 0xba, + 0xdf, 0x00, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/api/configchange/config_change.pb.go b/vendor/google.golang.org/genproto/googleapis/api/configchange/config_change.pb.go new file mode 100644 index 0000000000..cf4150007b --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/api/configchange/config_change.pb.go @@ -0,0 +1,189 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/api/config_change.proto + +/* +Package configchange is a generated protocol buffer package. + +It is generated from these files: + google/api/config_change.proto + +It has these top-level messages: + ConfigChange + Advice +*/ +package configchange + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Classifies set of possible modifications to an object in the service +// configuration. +type ChangeType int32 + +const ( + // No value was provided. + ChangeType_CHANGE_TYPE_UNSPECIFIED ChangeType = 0 + // The changed object exists in the 'new' service configuration, but not + // in the 'old' service configuration. + ChangeType_ADDED ChangeType = 1 + // The changed object exists in the 'old' service configuration, but not + // in the 'new' service configuration. + ChangeType_REMOVED ChangeType = 2 + // The changed object exists in both service configurations, but its value + // is different. + ChangeType_MODIFIED ChangeType = 3 +) + +var ChangeType_name = map[int32]string{ + 0: "CHANGE_TYPE_UNSPECIFIED", + 1: "ADDED", + 2: "REMOVED", + 3: "MODIFIED", +} +var ChangeType_value = map[string]int32{ + "CHANGE_TYPE_UNSPECIFIED": 0, + "ADDED": 1, + "REMOVED": 2, + "MODIFIED": 3, +} + +func (x ChangeType) String() string { + return proto.EnumName(ChangeType_name, int32(x)) +} +func (ChangeType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +// Output generated from semantically comparing two versions of a service +// configuration. +// +// Includes detailed information about a field that have changed with +// applicable advice about potential consequences for the change, such as +// backwards-incompatibility. +type ConfigChange struct { + // Object hierarchy path to the change, with levels separated by a '.' + // character. For repeated fields, an applicable unique identifier field is + // used for the index (usually selector, name, or id). For maps, the term + // 'key' is used. If the field has no unique identifier, the numeric index + // is used. + // Examples: + // - visibility.rules[selector=="google.LibraryService.CreateBook"].restriction + // - quota.metric_rules[selector=="google"].metric_costs[key=="reads"].value + // - logging.producer_destinations[0] + Element string `protobuf:"bytes,1,opt,name=element" json:"element,omitempty"` + // Value of the changed object in the old Service configuration, + // in JSON format. This field will not be populated if ChangeType == ADDED. + OldValue string `protobuf:"bytes,2,opt,name=old_value,json=oldValue" json:"old_value,omitempty"` + // Value of the changed object in the new Service configuration, + // in JSON format. This field will not be populated if ChangeType == REMOVED. + NewValue string `protobuf:"bytes,3,opt,name=new_value,json=newValue" json:"new_value,omitempty"` + // The type for this change, either ADDED, REMOVED, or MODIFIED. + ChangeType ChangeType `protobuf:"varint,4,opt,name=change_type,json=changeType,enum=google.api.ChangeType" json:"change_type,omitempty"` + // Collection of advice provided for this change, useful for determining the + // possible impact of this change. + Advices []*Advice `protobuf:"bytes,5,rep,name=advices" json:"advices,omitempty"` +} + +func (m *ConfigChange) Reset() { *m = ConfigChange{} } +func (m *ConfigChange) String() string { return proto.CompactTextString(m) } +func (*ConfigChange) ProtoMessage() {} +func (*ConfigChange) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *ConfigChange) GetElement() string { + if m != nil { + return m.Element + } + return "" +} + +func (m *ConfigChange) GetOldValue() string { + if m != nil { + return m.OldValue + } + return "" +} + +func (m *ConfigChange) GetNewValue() string { + if m != nil { + return m.NewValue + } + return "" +} + +func (m *ConfigChange) GetChangeType() ChangeType { + if m != nil { + return m.ChangeType + } + return ChangeType_CHANGE_TYPE_UNSPECIFIED +} + +func (m *ConfigChange) GetAdvices() []*Advice { + if m != nil { + return m.Advices + } + return nil +} + +// Generated advice about this change, used for providing more +// information about how a change will affect the existing service. +type Advice struct { + // Useful description for why this advice was applied and what actions should + // be taken to mitigate any implied risks. + Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` +} + +func (m *Advice) Reset() { *m = Advice{} } +func (m *Advice) String() string { return proto.CompactTextString(m) } +func (*Advice) ProtoMessage() {} +func (*Advice) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *Advice) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func init() { + proto.RegisterType((*ConfigChange)(nil), "google.api.ConfigChange") + proto.RegisterType((*Advice)(nil), "google.api.Advice") + proto.RegisterEnum("google.api.ChangeType", ChangeType_name, ChangeType_value) +} + +func init() { proto.RegisterFile("google/api/config_change.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 338 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x91, 0xcd, 0x4e, 0xc2, 0x40, + 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, 0xa6, 0xbe, 0x90, 0x09, 0x7a, 0x42, 0x36, 0xf1, + 0x9a, 0xc9, 0x8c, 0x09, 0x7e, 0x0c, 0x5b, 0xfc, 0x1a, 0xcc, 0x01, 0xce, 0x3b, 0x51, 0x17, 0xae, + 0xdd, 0x27, 0x67, 0x36, 0xf6, 0xa3, 0xc5, 0x6b, 0xe0, 0x47, 0x2f, 0xb3, 0xe7, 0xc0, 0x77, 0x27, + 0x8f, 0x13, 0xdf, 0xeb, 0x5c, 0xa0, 0x26, 0x54, 0x1d, 0xcf, 0xf3, 0xbd, 0x8e, 0x86, 0x74, 0xa8, + 0x87, 0xfe, 0x74, 0xbe, 0xf4, 0xbd, 0x4e, 0x09, 0xb5, 0xa0, 0x31, 0x9d, 0x7b, 0xca, 0x55, 0x1e, + 0x7d, 0x41, 0x3b, 0x16, 0xab, 0x42, 0xbc, 0xd1, 0x65, 0xb1, 0xd7, 0xe0, 0xd0, 0x7c, 0xa0, 0xbd, + 0xb9, 0x47, 0x03, 0x15, 0x29, 0xe6, 0xd4, 0x12, 0x6b, 0x6a, 0x53, 0xc2, 0xf3, 0xbb, 0xd8, 0x0a, + 0x61, 0xc9, 0x36, 0x85, 0xd3, 0xa9, 0x36, 0x1e, 0x8a, 0xe2, 0xa7, 0x54, 0x19, 0x3b, 0xc1, 0xe4, + 0xbd, 0x96, 0x8f, 0xdd, 0xfd, 0x05, 0x00, 0x00, 0xff, 0xff, 0x46, 0x8b, 0xd3, 0xf5, 0xf0, 0x01, + 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/api/distribution/distribution.pb.go b/vendor/google.golang.org/genproto/googleapis/api/distribution/distribution.pb.go new file mode 100644 index 0000000000..68b702a13a --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/api/distribution/distribution.pb.go @@ -0,0 +1,506 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/api/distribution.proto + +/* +Package distribution is a generated protocol buffer package. + +It is generated from these files: + google/api/distribution.proto + +It has these top-level messages: + Distribution +*/ +package distribution + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import _ "github.com/golang/protobuf/ptypes/any" +import _ "github.com/golang/protobuf/ptypes/timestamp" + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Distribution contains summary statistics for a population of values and, +// optionally, a histogram representing the distribution of those values across +// a specified set of histogram buckets. +// +// The summary statistics are the count, mean, sum of the squared deviation from +// the mean, the minimum, and the maximum of the set of population of values. +// +// The histogram is based on a sequence of buckets and gives a count of values +// that fall into each bucket. The boundaries of the buckets are given either +// explicitly or by specifying parameters for a method of computing them +// (buckets of fixed width or buckets of exponentially increasing width). +// +// Although it is not forbidden, it is generally a bad idea to include +// non-finite values (infinities or NaNs) in the population of values, as this +// will render the `mean` and `sum_of_squared_deviation` fields meaningless. +type Distribution struct { + // The number of values in the population. Must be non-negative. + Count int64 `protobuf:"varint,1,opt,name=count" json:"count,omitempty"` + // The arithmetic mean of the values in the population. If `count` is zero + // then this field must be zero. + Mean float64 `protobuf:"fixed64,2,opt,name=mean" json:"mean,omitempty"` + // The sum of squared deviations from the mean of the values in the + // population. For values x_i this is: + // + // Sum[i=1..n]((x_i - mean)^2) + // + // Knuth, "The Art of Computer Programming", Vol. 2, page 323, 3rd edition + // describes Welford's method for accumulating this sum in one pass. + // + // If `count` is zero then this field must be zero. + SumOfSquaredDeviation float64 `protobuf:"fixed64,3,opt,name=sum_of_squared_deviation,json=sumOfSquaredDeviation" json:"sum_of_squared_deviation,omitempty"` + // If specified, contains the range of the population values. The field + // must not be present if the `count` is zero. + Range *Distribution_Range `protobuf:"bytes,4,opt,name=range" json:"range,omitempty"` + // Defines the histogram bucket boundaries. + BucketOptions *Distribution_BucketOptions `protobuf:"bytes,6,opt,name=bucket_options,json=bucketOptions" json:"bucket_options,omitempty"` + // If `bucket_options` is given, then the sum of the values in `bucket_counts` + // must equal the value in `count`. If `bucket_options` is not given, no + // `bucket_counts` fields may be given. + // + // Bucket counts are given in order under the numbering scheme described + // above (the underflow bucket has number 0; the finite buckets, if any, + // have numbers 1 through N-2; the overflow bucket has number N-1). + // + // The size of `bucket_counts` must be no greater than N as defined in + // `bucket_options`. + // + // Any suffix of trailing zero bucket_count fields may be omitted. + BucketCounts []int64 `protobuf:"varint,7,rep,packed,name=bucket_counts,json=bucketCounts" json:"bucket_counts,omitempty"` +} + +func (m *Distribution) Reset() { *m = Distribution{} } +func (m *Distribution) String() string { return proto.CompactTextString(m) } +func (*Distribution) ProtoMessage() {} +func (*Distribution) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *Distribution) GetCount() int64 { + if m != nil { + return m.Count + } + return 0 +} + +func (m *Distribution) GetMean() float64 { + if m != nil { + return m.Mean + } + return 0 +} + +func (m *Distribution) GetSumOfSquaredDeviation() float64 { + if m != nil { + return m.SumOfSquaredDeviation + } + return 0 +} + +func (m *Distribution) GetRange() *Distribution_Range { + if m != nil { + return m.Range + } + return nil +} + +func (m *Distribution) GetBucketOptions() *Distribution_BucketOptions { + if m != nil { + return m.BucketOptions + } + return nil +} + +func (m *Distribution) GetBucketCounts() []int64 { + if m != nil { + return m.BucketCounts + } + return nil +} + +// The range of the population values. +type Distribution_Range struct { + // The minimum of the population values. + Min float64 `protobuf:"fixed64,1,opt,name=min" json:"min,omitempty"` + // The maximum of the population values. + Max float64 `protobuf:"fixed64,2,opt,name=max" json:"max,omitempty"` +} + +func (m *Distribution_Range) Reset() { *m = Distribution_Range{} } +func (m *Distribution_Range) String() string { return proto.CompactTextString(m) } +func (*Distribution_Range) ProtoMessage() {} +func (*Distribution_Range) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 0} } + +func (m *Distribution_Range) GetMin() float64 { + if m != nil { + return m.Min + } + return 0 +} + +func (m *Distribution_Range) GetMax() float64 { + if m != nil { + return m.Max + } + return 0 +} + +// A Distribution may optionally contain a histogram of the values in the +// population. The histogram is given in `bucket_counts` as counts of values +// that fall into one of a sequence of non-overlapping buckets. The sequence +// of buckets is described by `bucket_options`. +// +// A bucket specifies an inclusive lower bound and exclusive upper bound for +// the values that are counted for that bucket. The upper bound of a bucket +// is strictly greater than the lower bound. +// +// The sequence of N buckets for a Distribution consists of an underflow +// bucket (number 0), zero or more finite buckets (number 1 through N - 2) and +// an overflow bucket (number N - 1). The buckets are contiguous: the lower +// bound of bucket i (i > 0) is the same as the upper bound of bucket i - 1. +// The buckets span the whole range of finite values: lower bound of the +// underflow bucket is -infinity and the upper bound of the overflow bucket is +// +infinity. The finite buckets are so-called because both bounds are +// finite. +// +// `BucketOptions` describes bucket boundaries in one of three ways. Two +// describe the boundaries by giving parameters for a formula to generate +// boundaries and one gives the bucket boundaries explicitly. +// +// If `bucket_boundaries` is not given, then no `bucket_counts` may be given. +type Distribution_BucketOptions struct { + // Exactly one of these three fields must be set. + // + // Types that are valid to be assigned to Options: + // *Distribution_BucketOptions_LinearBuckets + // *Distribution_BucketOptions_ExponentialBuckets + // *Distribution_BucketOptions_ExplicitBuckets + Options isDistribution_BucketOptions_Options `protobuf_oneof:"options"` +} + +func (m *Distribution_BucketOptions) Reset() { *m = Distribution_BucketOptions{} } +func (m *Distribution_BucketOptions) String() string { return proto.CompactTextString(m) } +func (*Distribution_BucketOptions) ProtoMessage() {} +func (*Distribution_BucketOptions) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 1} } + +type isDistribution_BucketOptions_Options interface { + isDistribution_BucketOptions_Options() +} + +type Distribution_BucketOptions_LinearBuckets struct { + LinearBuckets *Distribution_BucketOptions_Linear `protobuf:"bytes,1,opt,name=linear_buckets,json=linearBuckets,oneof"` +} +type Distribution_BucketOptions_ExponentialBuckets struct { + ExponentialBuckets *Distribution_BucketOptions_Exponential `protobuf:"bytes,2,opt,name=exponential_buckets,json=exponentialBuckets,oneof"` +} +type Distribution_BucketOptions_ExplicitBuckets struct { + ExplicitBuckets *Distribution_BucketOptions_Explicit `protobuf:"bytes,3,opt,name=explicit_buckets,json=explicitBuckets,oneof"` +} + +func (*Distribution_BucketOptions_LinearBuckets) isDistribution_BucketOptions_Options() {} +func (*Distribution_BucketOptions_ExponentialBuckets) isDistribution_BucketOptions_Options() {} +func (*Distribution_BucketOptions_ExplicitBuckets) isDistribution_BucketOptions_Options() {} + +func (m *Distribution_BucketOptions) GetOptions() isDistribution_BucketOptions_Options { + if m != nil { + return m.Options + } + return nil +} + +func (m *Distribution_BucketOptions) GetLinearBuckets() *Distribution_BucketOptions_Linear { + if x, ok := m.GetOptions().(*Distribution_BucketOptions_LinearBuckets); ok { + return x.LinearBuckets + } + return nil +} + +func (m *Distribution_BucketOptions) GetExponentialBuckets() *Distribution_BucketOptions_Exponential { + if x, ok := m.GetOptions().(*Distribution_BucketOptions_ExponentialBuckets); ok { + return x.ExponentialBuckets + } + return nil +} + +func (m *Distribution_BucketOptions) GetExplicitBuckets() *Distribution_BucketOptions_Explicit { + if x, ok := m.GetOptions().(*Distribution_BucketOptions_ExplicitBuckets); ok { + return x.ExplicitBuckets + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Distribution_BucketOptions) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _Distribution_BucketOptions_OneofMarshaler, _Distribution_BucketOptions_OneofUnmarshaler, _Distribution_BucketOptions_OneofSizer, []interface{}{ + (*Distribution_BucketOptions_LinearBuckets)(nil), + (*Distribution_BucketOptions_ExponentialBuckets)(nil), + (*Distribution_BucketOptions_ExplicitBuckets)(nil), + } +} + +func _Distribution_BucketOptions_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Distribution_BucketOptions) + // options + switch x := m.Options.(type) { + case *Distribution_BucketOptions_LinearBuckets: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.LinearBuckets); err != nil { + return err + } + case *Distribution_BucketOptions_ExponentialBuckets: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ExponentialBuckets); err != nil { + return err + } + case *Distribution_BucketOptions_ExplicitBuckets: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ExplicitBuckets); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("Distribution_BucketOptions.Options has unexpected type %T", x) + } + return nil +} + +func _Distribution_BucketOptions_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Distribution_BucketOptions) + switch tag { + case 1: // options.linear_buckets + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Distribution_BucketOptions_Linear) + err := b.DecodeMessage(msg) + m.Options = &Distribution_BucketOptions_LinearBuckets{msg} + return true, err + case 2: // options.exponential_buckets + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Distribution_BucketOptions_Exponential) + err := b.DecodeMessage(msg) + m.Options = &Distribution_BucketOptions_ExponentialBuckets{msg} + return true, err + case 3: // options.explicit_buckets + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Distribution_BucketOptions_Explicit) + err := b.DecodeMessage(msg) + m.Options = &Distribution_BucketOptions_ExplicitBuckets{msg} + return true, err + default: + return false, nil + } +} + +func _Distribution_BucketOptions_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Distribution_BucketOptions) + // options + switch x := m.Options.(type) { + case *Distribution_BucketOptions_LinearBuckets: + s := proto.Size(x.LinearBuckets) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Distribution_BucketOptions_ExponentialBuckets: + s := proto.Size(x.ExponentialBuckets) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Distribution_BucketOptions_ExplicitBuckets: + s := proto.Size(x.ExplicitBuckets) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Specify a sequence of buckets that all have the same width (except +// overflow and underflow). Each bucket represents a constant absolute +// uncertainty on the specific value in the bucket. +// +// Defines `num_finite_buckets + 2` (= N) buckets with these boundaries for +// bucket `i`: +// +// Upper bound (0 <= i < N-1): offset + (width * i). +// Lower bound (1 <= i < N): offset + (width * (i - 1)). +type Distribution_BucketOptions_Linear struct { + // Must be greater than 0. + NumFiniteBuckets int32 `protobuf:"varint,1,opt,name=num_finite_buckets,json=numFiniteBuckets" json:"num_finite_buckets,omitempty"` + // Must be greater than 0. + Width float64 `protobuf:"fixed64,2,opt,name=width" json:"width,omitempty"` + // Lower bound of the first bucket. + Offset float64 `protobuf:"fixed64,3,opt,name=offset" json:"offset,omitempty"` +} + +func (m *Distribution_BucketOptions_Linear) Reset() { *m = Distribution_BucketOptions_Linear{} } +func (m *Distribution_BucketOptions_Linear) String() string { return proto.CompactTextString(m) } +func (*Distribution_BucketOptions_Linear) ProtoMessage() {} +func (*Distribution_BucketOptions_Linear) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{0, 1, 0} +} + +func (m *Distribution_BucketOptions_Linear) GetNumFiniteBuckets() int32 { + if m != nil { + return m.NumFiniteBuckets + } + return 0 +} + +func (m *Distribution_BucketOptions_Linear) GetWidth() float64 { + if m != nil { + return m.Width + } + return 0 +} + +func (m *Distribution_BucketOptions_Linear) GetOffset() float64 { + if m != nil { + return m.Offset + } + return 0 +} + +// Specify a sequence of buckets that have a width that is proportional to +// the value of the lower bound. Each bucket represents a constant relative +// uncertainty on a specific value in the bucket. +// +// Defines `num_finite_buckets + 2` (= N) buckets with these boundaries for +// bucket i: +// +// Upper bound (0 <= i < N-1): scale * (growth_factor ^ i). +// Lower bound (1 <= i < N): scale * (growth_factor ^ (i - 1)). +type Distribution_BucketOptions_Exponential struct { + // Must be greater than 0. + NumFiniteBuckets int32 `protobuf:"varint,1,opt,name=num_finite_buckets,json=numFiniteBuckets" json:"num_finite_buckets,omitempty"` + // Must be greater than 1. + GrowthFactor float64 `protobuf:"fixed64,2,opt,name=growth_factor,json=growthFactor" json:"growth_factor,omitempty"` + // Must be greater than 0. + Scale float64 `protobuf:"fixed64,3,opt,name=scale" json:"scale,omitempty"` +} + +func (m *Distribution_BucketOptions_Exponential) Reset() { + *m = Distribution_BucketOptions_Exponential{} +} +func (m *Distribution_BucketOptions_Exponential) String() string { return proto.CompactTextString(m) } +func (*Distribution_BucketOptions_Exponential) ProtoMessage() {} +func (*Distribution_BucketOptions_Exponential) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{0, 1, 1} +} + +func (m *Distribution_BucketOptions_Exponential) GetNumFiniteBuckets() int32 { + if m != nil { + return m.NumFiniteBuckets + } + return 0 +} + +func (m *Distribution_BucketOptions_Exponential) GetGrowthFactor() float64 { + if m != nil { + return m.GrowthFactor + } + return 0 +} + +func (m *Distribution_BucketOptions_Exponential) GetScale() float64 { + if m != nil { + return m.Scale + } + return 0 +} + +// A set of buckets with arbitrary widths. +// +// Defines `size(bounds) + 1` (= N) buckets with these boundaries for +// bucket i: +// +// Upper bound (0 <= i < N-1): bounds[i] +// Lower bound (1 <= i < N); bounds[i - 1] +// +// There must be at least one element in `bounds`. If `bounds` has only one +// element, there are no finite buckets, and that single element is the +// common boundary of the overflow and underflow buckets. +type Distribution_BucketOptions_Explicit struct { + // The values must be monotonically increasing. + Bounds []float64 `protobuf:"fixed64,1,rep,packed,name=bounds" json:"bounds,omitempty"` +} + +func (m *Distribution_BucketOptions_Explicit) Reset() { *m = Distribution_BucketOptions_Explicit{} } +func (m *Distribution_BucketOptions_Explicit) String() string { return proto.CompactTextString(m) } +func (*Distribution_BucketOptions_Explicit) ProtoMessage() {} +func (*Distribution_BucketOptions_Explicit) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{0, 1, 2} +} + +func (m *Distribution_BucketOptions_Explicit) GetBounds() []float64 { + if m != nil { + return m.Bounds + } + return nil +} + +func init() { + proto.RegisterType((*Distribution)(nil), "google.api.Distribution") + proto.RegisterType((*Distribution_Range)(nil), "google.api.Distribution.Range") + proto.RegisterType((*Distribution_BucketOptions)(nil), "google.api.Distribution.BucketOptions") + proto.RegisterType((*Distribution_BucketOptions_Linear)(nil), "google.api.Distribution.BucketOptions.Linear") + proto.RegisterType((*Distribution_BucketOptions_Exponential)(nil), "google.api.Distribution.BucketOptions.Exponential") + proto.RegisterType((*Distribution_BucketOptions_Explicit)(nil), "google.api.Distribution.BucketOptions.Explicit") +} + +func init() { proto.RegisterFile("google/api/distribution.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 544 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0x5d, 0x6f, 0xd3, 0x30, + 0x14, 0x5d, 0x96, 0xb5, 0x85, 0xdb, 0x0f, 0x8a, 0x19, 0x28, 0x44, 0x7c, 0x54, 0x9b, 0x84, 0x2a, + 0x01, 0x89, 0x54, 0x90, 0x78, 0xe0, 0xad, 0x1b, 0x53, 0x1f, 0x40, 0x9b, 0x8c, 0xc4, 0x03, 0x42, + 0x8a, 0x9c, 0xc4, 0xc9, 0x0c, 0x89, 0x1d, 0x62, 0x67, 0x2b, 0xef, 0xfc, 0x29, 0xfe, 0x1d, 0x8a, + 0xed, 0x6e, 0x19, 0x08, 0xa9, 0xbc, 0xf9, 0xde, 0x73, 0x7c, 0xce, 0xb9, 0x57, 0x71, 0xe0, 0x71, + 0x2e, 0x44, 0x5e, 0xd0, 0x90, 0x54, 0x2c, 0x4c, 0x99, 0x54, 0x35, 0x8b, 0x1b, 0xc5, 0x04, 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e1, 0x1f, 0xc0, 0xad, + 0xcd, 0xf0, 0x6d, 0xb6, 0x58, 0x34, 0x3c, 0x6d, 0x8d, 0xdc, 0x36, 0x9b, 0xa9, 0x96, 0xb7, 0x61, + 0x60, 0x3f, 0xe5, 0xe5, 0x57, 0x98, 0x24, 0xa2, 0xec, 0x6c, 0x75, 0x79, 0xb7, 0xbb, 0xd6, 0xb3, + 0xf6, 0xad, 0x9e, 0x39, 0x9f, 0x8f, 0x2c, 0x21, 0x17, 0x05, 0xe1, 0x79, 0x20, 0xea, 0x3c, 0xcc, + 0x29, 0xd7, 0x2f, 0x39, 0x34, 0x10, 0xa9, 0x98, 0xfc, 0xeb, 0x8f, 0xf2, 0xb6, 0x5b, 0xc4, 0x7d, + 0xcd, 0x7f, 0xf5, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x88, 0x8e, 0xc5, 0x4b, 0x80, 0x04, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/api/experimental.pb.go b/vendor/google.golang.org/genproto/googleapis/api/experimental.pb.go new file mode 100644 index 0000000000..a88df3d140 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/api/experimental.pb.go @@ -0,0 +1,56 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/api/experimental/experimental.proto + +package api + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Experimental service configuration. These configuration options can +// only be used by whitelisted users. +type Experimental struct { + // Authorization configuration. + Authorization *AuthorizationConfig `protobuf:"bytes,8,opt,name=authorization" json:"authorization,omitempty"` +} + +func (m *Experimental) Reset() { *m = Experimental{} } +func (m *Experimental) String() string { return proto.CompactTextString(m) } +func (*Experimental) ProtoMessage() {} +func (*Experimental) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +func (m *Experimental) GetAuthorization() *AuthorizationConfig { + if m != nil { + return m.Authorization + } + return nil +} + +func init() { + proto.RegisterType((*Experimental)(nil), "google.api.Experimental") +} + +func init() { proto.RegisterFile("google/api/experimental/experimental.proto", fileDescriptor1) } + +var fileDescriptor1 = []byte{ + // 204 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x4a, 0xcf, 0xcf, 0x4f, + 0xcf, 0x49, 0xd5, 0x4f, 0x2c, 0xc8, 0xd4, 0x4f, 0xad, 0x28, 0x48, 0x2d, 0xca, 0xcc, 0x4d, 0xcd, + 0x2b, 0x49, 0xcc, 0x41, 0xe1, 0xe8, 0x15, 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0x71, 0x41, 0xd4, 0xea, + 0x25, 0x16, 0x64, 0x4a, 0xc9, 0x20, 0xe9, 0x4b, 0xcc, 0xcb, 0xcb, 0x2f, 0x49, 0x2c, 0xc9, 0xcc, + 0xcf, 0x2b, 0x86, 0xa8, 0x94, 0x32, 0xc2, 0x65, 0x6a, 0x62, 0x69, 0x49, 0x46, 0x7e, 0x51, 0x66, + 0x15, 0x58, 0x75, 0x7c, 0x72, 0x7e, 0x5e, 0x5a, 0x66, 0x3a, 0x44, 0x8f, 0x52, 0x28, 0x17, 0x8f, + 0x2b, 0x92, 0x52, 0x21, 0x57, 0x2e, 0x5e, 0x14, 0xd5, 0x12, 0x1c, 0x0a, 0x8c, 0x1a, 0xdc, 0x46, + 0xf2, 0x7a, 0x08, 0x57, 0xe8, 0x39, 0x22, 0x2b, 0x70, 0x06, 0x9b, 0x16, 0x84, 0xaa, 0xcb, 0x29, + 0x9a, 0x8b, 0x2f, 0x39, 0x3f, 0x17, 0x49, 0x93, 0x93, 0x20, 0xb2, 0x35, 0x01, 0x20, 0xbb, 0x03, + 0x18, 0xa3, 0x74, 0xa1, 0x0a, 0xd2, 0xf3, 0x73, 0x12, 0xf3, 0xd2, 0xf5, 0xf2, 0x8b, 0xd2, 0xf5, + 0xd3, 0x53, 0xf3, 0xc0, 0x2e, 0xd3, 0x87, 0x48, 0x25, 0x16, 0x64, 0x16, 0x83, 0x3c, 0x64, 0x9d, + 0x58, 0x90, 0xb9, 0x88, 0x89, 0xc5, 0xdd, 0x31, 0xc0, 0x33, 0x89, 0x0d, 0xac, 0xc0, 0x18, 0x10, + 0x00, 0x00, 0xff, 0xff, 0xa0, 0x95, 0x20, 0xe5, 0x46, 0x01, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/api/httpbody/httpbody.pb.go b/vendor/google.golang.org/genproto/googleapis/api/httpbody/httpbody.pb.go new file mode 100644 index 0000000000..c3e12e5ebd --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/api/httpbody/httpbody.pb.go @@ -0,0 +1,114 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/api/httpbody.proto + +/* +Package httpbody is a generated protocol buffer package. + +It is generated from these files: + google/api/httpbody.proto + +It has these top-level messages: + HttpBody +*/ +package httpbody + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Message that represents an arbitrary HTTP body. It should only be used for +// payload formats that can't be represented as JSON, such as raw binary or +// an HTML page. +// +// +// This message can be used both in streaming and non-streaming API methods in +// the request as well as the response. +// +// It can be used as a top-level request field, which is convenient if one +// wants to extract parameters from either the URL or HTTP template into the +// request fields and also want access to the raw HTTP body. +// +// Example: +// +// message GetResourceRequest { +// // A unique request id. +// string request_id = 1; +// +// // The raw HTTP body is bound to this field. +// google.api.HttpBody http_body = 2; +// } +// +// service ResourceService { +// rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); +// rpc UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty); +// } +// +// Example with streaming methods: +// +// service CaldavService { +// rpc GetCalendar(stream google.api.HttpBody) +// returns (stream google.api.HttpBody); +// rpc UpdateCalendar(stream google.api.HttpBody) +// returns (stream google.api.HttpBody); +// } +// +// Use of this type only changes how the request and response bodies are +// handled, all other features will continue to work unchanged. +type HttpBody struct { + // The HTTP Content-Type string representing the content type of the body. + ContentType string `protobuf:"bytes,1,opt,name=content_type,json=contentType" json:"content_type,omitempty"` + // HTTP body binary data. + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` +} + +func (m *HttpBody) Reset() { *m = HttpBody{} } +func (m *HttpBody) String() string { return proto.CompactTextString(m) } +func (*HttpBody) ProtoMessage() {} +func (*HttpBody) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *HttpBody) GetContentType() string { + if m != nil { + return m.ContentType + } + return "" +} + +func (m *HttpBody) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +func init() { + proto.RegisterType((*HttpBody)(nil), "google.api.HttpBody") +} + +func init() { proto.RegisterFile("google/api/httpbody.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 181 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4c, 0xcf, 0xcf, 0x4f, + 0xcf, 0x49, 0xd5, 0x4f, 0x2c, 0xc8, 0xd4, 0xcf, 0x28, 0x29, 0x29, 0x48, 0xca, 0x4f, 0xa9, 0xd4, + 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x82, 0x48, 0xe9, 0x25, 0x16, 0x64, 0x2a, 0x39, 0x72, + 0x71, 0x78, 0x94, 0x94, 0x14, 0x38, 0xe5, 0xa7, 0x54, 0x0a, 0x29, 0x72, 0xf1, 0x24, 0xe7, 0xe7, + 0x95, 0xa4, 0xe6, 0x95, 0xc4, 0x97, 0x54, 0x16, 0xa4, 0x4a, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x06, + 0x71, 0x43, 0xc5, 0x42, 0x2a, 0x0b, 0x52, 0x85, 0x84, 0xb8, 0x58, 0x52, 0x12, 0x4b, 0x12, 0x25, + 0x98, 0x14, 0x18, 0x35, 0x78, 0x82, 0xc0, 0x6c, 0xa7, 0x54, 0x2e, 0xbe, 0xe4, 0xfc, 0x5c, 0x3d, + 0x84, 0xa1, 0x4e, 0xbc, 0x30, 0x23, 0x03, 0x40, 0xf6, 0x05, 0x30, 0x46, 0x59, 0x43, 0x25, 0xd3, + 0xf3, 0x73, 0x12, 0xf3, 0xd2, 0xf5, 0xf2, 0x8b, 0xd2, 0xf5, 0xd3, 0x53, 0xf3, 0xc0, 0xae, 0xd1, + 0x87, 0x48, 0x25, 0x16, 0x64, 0x16, 0xa3, 0xb8, 0xd5, 0x1a, 0xc6, 0x58, 0xc4, 0xc4, 0xe2, 0xee, + 0x18, 0xe0, 0x99, 0xc4, 0x06, 0x56, 0x6e, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x0e, 0x3a, 0xdf, + 0x30, 0xd9, 0x00, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/api/label/label.pb.go b/vendor/google.golang.org/genproto/googleapis/api/label/label.pb.go new file mode 100644 index 0000000000..790f6c0715 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/api/label/label.pb.go @@ -0,0 +1,119 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/api/label.proto + +/* +Package label is a generated protocol buffer package. + +It is generated from these files: + google/api/label.proto + +It has these top-level messages: + LabelDescriptor +*/ +package label + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Value types that can be used as label values. +type LabelDescriptor_ValueType int32 + +const ( + // A variable-length string. This is the default. + LabelDescriptor_STRING LabelDescriptor_ValueType = 0 + // Boolean; true or false. + LabelDescriptor_BOOL LabelDescriptor_ValueType = 1 + // A 64-bit signed integer. + LabelDescriptor_INT64 LabelDescriptor_ValueType = 2 +) + +var LabelDescriptor_ValueType_name = map[int32]string{ + 0: "STRING", + 1: "BOOL", + 2: "INT64", +} +var LabelDescriptor_ValueType_value = map[string]int32{ + "STRING": 0, + "BOOL": 1, + "INT64": 2, +} + +func (x LabelDescriptor_ValueType) String() string { + return proto.EnumName(LabelDescriptor_ValueType_name, int32(x)) +} +func (LabelDescriptor_ValueType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 0} } + +// A description of a label. +type LabelDescriptor struct { + // The label key. + Key string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` + // The type of data that can be assigned to the label. + ValueType LabelDescriptor_ValueType `protobuf:"varint,2,opt,name=value_type,json=valueType,enum=google.api.LabelDescriptor_ValueType" json:"value_type,omitempty"` + // A human-readable description for the label. + Description string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` +} + +func (m *LabelDescriptor) Reset() { *m = LabelDescriptor{} } +func (m *LabelDescriptor) String() string { return proto.CompactTextString(m) } +func (*LabelDescriptor) ProtoMessage() {} +func (*LabelDescriptor) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *LabelDescriptor) GetKey() string { + if m != nil { + return m.Key + } + return "" +} + +func (m *LabelDescriptor) GetValueType() LabelDescriptor_ValueType { + if m != nil { + return m.ValueType + } + return LabelDescriptor_STRING +} + +func (m *LabelDescriptor) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func init() { + proto.RegisterType((*LabelDescriptor)(nil), "google.api.LabelDescriptor") + proto.RegisterEnum("google.api.LabelDescriptor_ValueType", LabelDescriptor_ValueType_name, LabelDescriptor_ValueType_value) +} + +func init() { proto.RegisterFile("google/api/label.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 252 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4b, 0xcf, 0xcf, 0x4f, + 0xcf, 0x49, 0xd5, 0x4f, 0x2c, 0xc8, 0xd4, 0xcf, 0x49, 0x4c, 0x4a, 0xcd, 0xd1, 0x2b, 0x28, 0xca, + 0x2f, 0xc9, 0x17, 0xe2, 0x82, 0x88, 0xeb, 0x25, 0x16, 0x64, 0x2a, 0xed, 0x64, 0xe4, 0xe2, 0xf7, + 0x01, 0xc9, 0xb9, 0xa4, 0x16, 0x27, 0x17, 0x65, 0x16, 0x94, 0xe4, 0x17, 0x09, 0x09, 0x70, 0x31, + 0x67, 0xa7, 0x56, 0x4a, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x06, 0x81, 0x98, 0x42, 0x2e, 0x5c, 0x5c, + 0x65, 0x89, 0x39, 0xa5, 0xa9, 0xf1, 0x25, 0x95, 0x05, 0xa9, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0x7c, + 0x46, 0xaa, 0x7a, 0x08, 0x63, 0xf4, 0xd0, 0x8c, 0xd0, 0x0b, 0x03, 0xa9, 0x0e, 0xa9, 0x2c, 0x48, + 0x0d, 0xe2, 0x2c, 0x83, 0x31, 0x85, 0x14, 0xb8, 0xb8, 0x53, 0xa0, 0x4a, 0x32, 0xf3, 0xf3, 0x24, + 0x98, 0xc1, 0xe6, 0x23, 0x0b, 0x29, 0xe9, 0x70, 0x71, 0xc2, 0x75, 0x0a, 0x71, 0x71, 0xb1, 0x05, + 0x87, 0x04, 0x79, 0xfa, 0xb9, 0x0b, 0x30, 0x08, 0x71, 0x70, 0xb1, 0x38, 0xf9, 0xfb, 0xfb, 0x08, + 0x30, 0x0a, 0x71, 0x72, 0xb1, 0x7a, 0xfa, 0x85, 0x98, 0x99, 0x08, 0x30, 0x39, 0xc5, 0x73, 0xf1, + 0x25, 0xe7, 0xe7, 0x22, 0x39, 0xc3, 0x89, 0x0b, 0xec, 0x8e, 0x00, 0x90, 0x2f, 0x03, 0x18, 0xa3, + 0x4c, 0xa1, 0x32, 0xe9, 0xf9, 0x39, 0x89, 0x79, 0xe9, 0x7a, 0xf9, 0x45, 0xe9, 0xfa, 0xe9, 0xa9, + 0x79, 0xe0, 0x30, 0xd0, 0x87, 0x48, 0x25, 0x16, 0x64, 0x16, 0x23, 0x82, 0xc7, 0x1a, 0x4c, 0xfe, + 0x60, 0x64, 0x5c, 0xc4, 0xc4, 0xe2, 0xee, 0x18, 0xe0, 0x99, 0xc4, 0x06, 0x56, 0x6b, 0x0c, 0x08, + 0x00, 0x00, 0xff, 0xff, 0x57, 0x04, 0xaa, 0x1f, 0x49, 0x01, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/api/metric/metric.pb.go b/vendor/google.golang.org/genproto/googleapis/api/metric/metric.pb.go new file mode 100644 index 0000000000..df451ac5cc --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/api/metric/metric.pb.go @@ -0,0 +1,358 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/api/metric.proto + +/* +Package metric is a generated protocol buffer package. + +It is generated from these files: + google/api/metric.proto + +It has these top-level messages: + MetricDescriptor + Metric +*/ +package metric + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import google_api "google.golang.org/genproto/googleapis/api/label" + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// The kind of measurement. It describes how the data is reported. +type MetricDescriptor_MetricKind int32 + +const ( + // Do not use this default value. + MetricDescriptor_METRIC_KIND_UNSPECIFIED MetricDescriptor_MetricKind = 0 + // An instantaneous measurement of a value. + MetricDescriptor_GAUGE MetricDescriptor_MetricKind = 1 + // The change in a value during a time interval. + MetricDescriptor_DELTA MetricDescriptor_MetricKind = 2 + // A value accumulated over a time interval. Cumulative + // measurements in a time series should have the same start time + // and increasing end times, until an event resets the cumulative + // value to zero and sets a new start time for the following + // points. + MetricDescriptor_CUMULATIVE MetricDescriptor_MetricKind = 3 +) + +var MetricDescriptor_MetricKind_name = map[int32]string{ + 0: "METRIC_KIND_UNSPECIFIED", + 1: "GAUGE", + 2: "DELTA", + 3: "CUMULATIVE", +} +var MetricDescriptor_MetricKind_value = map[string]int32{ + "METRIC_KIND_UNSPECIFIED": 0, + "GAUGE": 1, + "DELTA": 2, + "CUMULATIVE": 3, +} + +func (x MetricDescriptor_MetricKind) String() string { + return proto.EnumName(MetricDescriptor_MetricKind_name, int32(x)) +} +func (MetricDescriptor_MetricKind) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{0, 0} +} + +// The value type of a metric. +type MetricDescriptor_ValueType int32 + +const ( + // Do not use this default value. + MetricDescriptor_VALUE_TYPE_UNSPECIFIED MetricDescriptor_ValueType = 0 + // The value is a boolean. + // This value type can be used only if the metric kind is `GAUGE`. + MetricDescriptor_BOOL MetricDescriptor_ValueType = 1 + // The value is a signed 64-bit integer. + MetricDescriptor_INT64 MetricDescriptor_ValueType = 2 + // The value is a double precision floating point number. + MetricDescriptor_DOUBLE MetricDescriptor_ValueType = 3 + // The value is a text string. + // This value type can be used only if the metric kind is `GAUGE`. + MetricDescriptor_STRING MetricDescriptor_ValueType = 4 + // The value is a [`Distribution`][google.api.Distribution]. + MetricDescriptor_DISTRIBUTION MetricDescriptor_ValueType = 5 + // The value is money. + MetricDescriptor_MONEY MetricDescriptor_ValueType = 6 +) + +var MetricDescriptor_ValueType_name = map[int32]string{ + 0: "VALUE_TYPE_UNSPECIFIED", + 1: "BOOL", + 2: "INT64", + 3: "DOUBLE", + 4: "STRING", + 5: "DISTRIBUTION", + 6: "MONEY", +} +var MetricDescriptor_ValueType_value = map[string]int32{ + "VALUE_TYPE_UNSPECIFIED": 0, + "BOOL": 1, + "INT64": 2, + "DOUBLE": 3, + "STRING": 4, + "DISTRIBUTION": 5, + "MONEY": 6, +} + +func (x MetricDescriptor_ValueType) String() string { + return proto.EnumName(MetricDescriptor_ValueType_name, int32(x)) +} +func (MetricDescriptor_ValueType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{0, 1} +} + +// Defines a metric type and its schema. Once a metric descriptor is created, +// deleting or altering it stops data collection and makes the metric type's +// existing data unusable. +type MetricDescriptor struct { + // The resource name of the metric descriptor. Depending on the + // implementation, the name typically includes: (1) the parent resource name + // that defines the scope of the metric type or of its data; and (2) the + // metric's URL-encoded type, which also appears in the `type` field of this + // descriptor. For example, following is the resource name of a custom + // metric within the GCP project `my-project-id`: + // + // "projects/my-project-id/metricDescriptors/custom.googleapis.com%2Finvoice%2Fpaid%2Famount" + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The metric type, including its DNS name prefix. The type is not + // URL-encoded. All user-defined custom metric types have the DNS name + // `custom.googleapis.com`. Metric types should use a natural hierarchical + // grouping. For example: + // + // "custom.googleapis.com/invoice/paid/amount" + // "appengine.googleapis.com/http/server/response_latencies" + Type string `protobuf:"bytes,8,opt,name=type" json:"type,omitempty"` + // The set of labels that can be used to describe a specific + // instance of this metric type. For example, the + // `appengine.googleapis.com/http/server/response_latencies` metric + // type has a label for the HTTP response code, `response_code`, so + // you can look at latencies for successful responses or just + // for responses that failed. + Labels []*google_api.LabelDescriptor `protobuf:"bytes,2,rep,name=labels" json:"labels,omitempty"` + // Whether the metric records instantaneous values, changes to a value, etc. + // Some combinations of `metric_kind` and `value_type` might not be supported. + MetricKind MetricDescriptor_MetricKind `protobuf:"varint,3,opt,name=metric_kind,json=metricKind,enum=google.api.MetricDescriptor_MetricKind" json:"metric_kind,omitempty"` + // Whether the measurement is an integer, a floating-point number, etc. + // Some combinations of `metric_kind` and `value_type` might not be supported. + ValueType MetricDescriptor_ValueType `protobuf:"varint,4,opt,name=value_type,json=valueType,enum=google.api.MetricDescriptor_ValueType" json:"value_type,omitempty"` + // The unit in which the metric value is reported. It is only applicable + // if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The + // supported units are a subset of [The Unified Code for Units of + // Measure](http://unitsofmeasure.org/ucum.html) standard: + // + // **Basic units (UNIT)** + // + // * `bit` bit + // * `By` byte + // * `s` second + // * `min` minute + // * `h` hour + // * `d` day + // + // **Prefixes (PREFIX)** + // + // * `k` kilo (10**3) + // * `M` mega (10**6) + // * `G` giga (10**9) + // * `T` tera (10**12) + // * `P` peta (10**15) + // * `E` exa (10**18) + // * `Z` zetta (10**21) + // * `Y` yotta (10**24) + // * `m` milli (10**-3) + // * `u` micro (10**-6) + // * `n` nano (10**-9) + // * `p` pico (10**-12) + // * `f` femto (10**-15) + // * `a` atto (10**-18) + // * `z` zepto (10**-21) + // * `y` yocto (10**-24) + // * `Ki` kibi (2**10) + // * `Mi` mebi (2**20) + // * `Gi` gibi (2**30) + // * `Ti` tebi (2**40) + // + // **Grammar** + // + // The grammar includes the dimensionless unit `1`, such as `1/s`. + // + // The grammar also includes these connectors: + // + // * `/` division (as an infix operator, e.g. `1/s`). + // * `.` multiplication (as an infix operator, e.g. `GBy.d`) + // + // The grammar for a unit is as follows: + // + // Expression = Component { "." Component } { "/" Component } ; + // + // Component = [ PREFIX ] UNIT [ Annotation ] + // | Annotation + // | "1" + // ; + // + // Annotation = "{" NAME "}" ; + // + // Notes: + // + // * `Annotation` is just a comment if it follows a `UNIT` and is + // equivalent to `1` if it is used alone. For examples, + // `{requests}/s == 1/s`, `By{transmitted}/s == By/s`. + // * `NAME` is a sequence of non-blank printable ASCII characters not + // containing '{' or '}'. + Unit string `protobuf:"bytes,5,opt,name=unit" json:"unit,omitempty"` + // A detailed description of the metric, which can be used in documentation. + Description string `protobuf:"bytes,6,opt,name=description" json:"description,omitempty"` + // A concise name for the metric, which can be displayed in user interfaces. + // Use sentence case without an ending period, for example "Request count". + DisplayName string `protobuf:"bytes,7,opt,name=display_name,json=displayName" json:"display_name,omitempty"` +} + +func (m *MetricDescriptor) Reset() { *m = MetricDescriptor{} } +func (m *MetricDescriptor) String() string { return proto.CompactTextString(m) } +func (*MetricDescriptor) ProtoMessage() {} +func (*MetricDescriptor) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *MetricDescriptor) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *MetricDescriptor) GetType() string { + if m != nil { + return m.Type + } + return "" +} + +func (m *MetricDescriptor) GetLabels() []*google_api.LabelDescriptor { + if m != nil { + return m.Labels + } + return nil +} + +func (m *MetricDescriptor) GetMetricKind() MetricDescriptor_MetricKind { + if m != nil { + return m.MetricKind + } + return MetricDescriptor_METRIC_KIND_UNSPECIFIED +} + +func (m *MetricDescriptor) GetValueType() MetricDescriptor_ValueType { + if m != nil { + return m.ValueType + } + return MetricDescriptor_VALUE_TYPE_UNSPECIFIED +} + +func (m *MetricDescriptor) GetUnit() string { + if m != nil { + return m.Unit + } + return "" +} + +func (m *MetricDescriptor) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *MetricDescriptor) GetDisplayName() string { + if m != nil { + return m.DisplayName + } + return "" +} + +// A specific metric, identified by specifying values for all of the +// labels of a [`MetricDescriptor`][google.api.MetricDescriptor]. +type Metric struct { + // An existing metric type, see [google.api.MetricDescriptor][google.api.MetricDescriptor]. + // For example, `custom.googleapis.com/invoice/paid/amount`. + Type string `protobuf:"bytes,3,opt,name=type" json:"type,omitempty"` + // The set of label values that uniquely identify this metric. All + // labels listed in the `MetricDescriptor` must be assigned values. + Labels map[string]string `protobuf:"bytes,2,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *Metric) Reset() { *m = Metric{} } +func (m *Metric) String() string { return proto.CompactTextString(m) } +func (*Metric) ProtoMessage() {} +func (*Metric) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *Metric) GetType() string { + if m != nil { + return m.Type + } + return "" +} + +func (m *Metric) GetLabels() map[string]string { + if m != nil { + return m.Labels + } + return nil +} + +func init() { + proto.RegisterType((*MetricDescriptor)(nil), "google.api.MetricDescriptor") + proto.RegisterType((*Metric)(nil), "google.api.Metric") + proto.RegisterEnum("google.api.MetricDescriptor_MetricKind", MetricDescriptor_MetricKind_name, MetricDescriptor_MetricKind_value) + proto.RegisterEnum("google.api.MetricDescriptor_ValueType", MetricDescriptor_ValueType_name, MetricDescriptor_ValueType_value) +} + +func init() { proto.RegisterFile("google/api/metric.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 506 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x53, 0x4d, 0x6f, 0xda, 0x40, + 0x10, 0xad, 0x3f, 0x70, 0xc3, 0x10, 0xa1, 0xd5, 0xaa, 0x4a, 0x2c, 0x22, 0x55, 0x94, 0x43, 0xcb, + 0x09, 0xa4, 0xa4, 0x4a, 0xbf, 0x4e, 0x80, 0xb7, 0xd4, 0x8a, 0xb1, 0x91, 0x63, 0x23, 0xa5, 0x17, + 0xcb, 0x81, 0x95, 0x65, 0xc5, 0xd8, 0xae, 0x71, 0x22, 0xf9, 0x57, 0xf4, 0x17, 0xf4, 0xd2, 0x5f, + 0x5a, 0xed, 0xae, 0x03, 0x16, 0x95, 0x72, 0xe2, 0xed, 0x9b, 0x37, 0x6f, 0x67, 0x96, 0x67, 0x38, + 0x8f, 0xb2, 0x2c, 0x4a, 0xe8, 0x38, 0xcc, 0xe3, 0xf1, 0x96, 0x96, 0x45, 0xbc, 0x1e, 0xe5, 0x45, + 0x56, 0x66, 0x18, 0x44, 0x61, 0x14, 0xe6, 0x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xd1, 0x38, 0xa2, 0x29, 0x8f, 0xfb, 0x58, 0x94, 0xc2, 0x3c, 0xde, 0x35, 0x3e, 0x97, 0x6f, + 0xe2, 0xe7, 0xaf, 0xac, 0xce, 0x27, 0x4b, 0xf3, 0x5e, 0xe3, 0xd2, 0xab, 0x7f, 0x01, 0x00, 0x00, + 0xff, 0xff, 0x18, 0x04, 0x05, 0x82, 0x58, 0x03, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/api/monitoredres/monitored_resource.pb.go b/vendor/google.golang.org/genproto/googleapis/api/monitoredres/monitored_resource.pb.go new file mode 100644 index 0000000000..3ce7eb74d3 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/api/monitoredres/monitored_resource.pb.go @@ -0,0 +1,180 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/api/monitored_resource.proto + +/* +Package monitoredres is a generated protocol buffer package. + +It is generated from these files: + google/api/monitored_resource.proto + +It has these top-level messages: + MonitoredResourceDescriptor + MonitoredResource +*/ +package monitoredres + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import google_api "google.golang.org/genproto/googleapis/api/label" + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// An object that describes the schema of a [MonitoredResource][google.api.MonitoredResource] object using a +// type name and a set of labels. For example, the monitored resource +// descriptor for Google Compute Engine VM instances has a type of +// `"gce_instance"` and specifies the use of the labels `"instance_id"` and +// `"zone"` to identify particular VM instances. +// +// Different APIs can support different monitored resource types. APIs generally +// provide a `list` method that returns the monitored resource descriptors used +// by the API. +type MonitoredResourceDescriptor struct { + // Optional. The resource name of the monitored resource descriptor: + // `"projects/{project_id}/monitoredResourceDescriptors/{type}"` where + // {type} is the value of the `type` field in this object and + // {project_id} is a project ID that provides API-specific context for + // accessing the type. APIs that do not use project information can use the + // resource name format `"monitoredResourceDescriptors/{type}"`. + Name string `protobuf:"bytes,5,opt,name=name" json:"name,omitempty"` + // Required. The monitored resource type. For example, the type + // `"cloudsql_database"` represents databases in Google Cloud SQL. + // The maximum length of this value is 256 characters. + Type string `protobuf:"bytes,1,opt,name=type" json:"type,omitempty"` + // Optional. A concise name for the monitored resource type that might be + // displayed in user interfaces. It should be a Title Cased Noun Phrase, + // without any article or other determiners. For example, + // `"Google Cloud SQL Database"`. + DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName" json:"display_name,omitempty"` + // Optional. A detailed description of the monitored resource type that might + // be used in documentation. + Description string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` + // Required. A set of labels used to describe instances of this monitored + // resource type. For example, an individual Google Cloud SQL database is + // identified by values for the labels `"database_id"` and `"zone"`. + Labels []*google_api.LabelDescriptor `protobuf:"bytes,4,rep,name=labels" json:"labels,omitempty"` +} + +func (m *MonitoredResourceDescriptor) Reset() { *m = MonitoredResourceDescriptor{} } +func (m *MonitoredResourceDescriptor) String() string { return proto.CompactTextString(m) } +func (*MonitoredResourceDescriptor) ProtoMessage() {} +func (*MonitoredResourceDescriptor) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *MonitoredResourceDescriptor) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *MonitoredResourceDescriptor) GetType() string { + if m != nil { + return m.Type + } + return "" +} + +func (m *MonitoredResourceDescriptor) GetDisplayName() string { + if m != nil { + return m.DisplayName + } + return "" +} + +func (m *MonitoredResourceDescriptor) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *MonitoredResourceDescriptor) GetLabels() []*google_api.LabelDescriptor { + if m != nil { + return m.Labels + } + return nil +} + +// An object representing a resource that can be used for monitoring, logging, +// billing, or other purposes. Examples include virtual machine instances, +// databases, and storage devices such as disks. The `type` field identifies a +// [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor] object that describes the resource's +// schema. Information in the `labels` field identifies the actual resource and +// its attributes according to the schema. For example, a particular Compute +// Engine VM instance could be represented by the following object, because the +// [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor] for `"gce_instance"` has labels +// `"instance_id"` and `"zone"`: +// +// { "type": "gce_instance", +// "labels": { "instance_id": "12345678901234", +// "zone": "us-central1-a" }} +type MonitoredResource struct { + // Required. The monitored resource type. This field must match + // the `type` field of a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor] object. For + // example, the type of a Cloud SQL database is `"cloudsql_database"`. + Type string `protobuf:"bytes,1,opt,name=type" json:"type,omitempty"` + // Required. Values for all of the labels listed in the associated monitored + // resource descriptor. For example, Cloud SQL databases use the labels + // `"database_id"` and `"zone"`. + Labels map[string]string `protobuf:"bytes,2,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *MonitoredResource) Reset() { *m = MonitoredResource{} } +func (m *MonitoredResource) String() string { return proto.CompactTextString(m) } +func (*MonitoredResource) ProtoMessage() {} +func (*MonitoredResource) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *MonitoredResource) GetType() string { + if m != nil { + return m.Type + } + return "" +} + +func (m *MonitoredResource) GetLabels() map[string]string { + if m != nil { + return m.Labels + } + return nil +} + +func init() { + proto.RegisterType((*MonitoredResourceDescriptor)(nil), "google.api.MonitoredResourceDescriptor") + proto.RegisterType((*MonitoredResource)(nil), "google.api.MonitoredResource") +} + +func init() { proto.RegisterFile("google/api/monitored_resource.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 321 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x51, 0x4b, 0x4b, 0x3b, 0x31, + 0x10, 0x27, 0xdb, 0x07, 0xfc, 0x67, 0xff, 0x88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 0x39, 0xe3, + 0xf8, 0xc7, 0x3e, 0x72, 0xf6, 0x67, 0x75, 0xfb, 0x3d, 0x0b, 0x1f, 0x68, 0xee, 0x64, 0xa9, 0xab, + 0x6d, 0x58, 0xf7, 0x12, 0xe2, 0x1a, 0x4c, 0x0f, 0xa1, 0xf1, 0xca, 0xab, 0x10, 0x62, 0x4b, 0x7a, + 0x0c, 0xad, 0x37, 0x56, 0x6c, 0xb6, 0x1f, 0xe0, 0x1f, 0x57, 0xd1, 0x05, 0x99, 0x54, 0x70, 0xb0, + 0xc4, 0x75, 0x2d, 0x72, 0xd2, 0xd9, 0xcb, 0x9c, 0xda, 0x9b, 0x4c, 0xc9, 0xcb, 0x4d, 0x60, 0xe5, + 0x58, 0x30, 0x99, 0xa7, 0xa8, 0xf3, 0x2c, 0xe7, 0xd2, 0x5d, 0x2c, 0xf3, 0x2d, 0xa6, 0x84, 0xf9, + 0x7d, 0x7d, 0xcd, 0xcd, 0x75, 0xfd, 0xf1, 0x45, 0xc8, 0x7b, 0xd4, 0xbc, 0x1f, 0x4f, 0x1f, 0x16, + 0x6d, 0xa7, 0x1c, 0x7d, 0x07, 0x00, 0x00, 0xff, 0xff, 0xf8, 0xfb, 0xfb, 0x11, 0x36, 0x02, 0x00, + 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/auth.pb.go b/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/auth.pb.go new file mode 100644 index 0000000000..f0b7e90e2f --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/auth.pb.go @@ -0,0 +1,392 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/api/auth.proto + +/* +Package serviceconfig is a generated protocol buffer package. + +It is generated from these files: + google/api/auth.proto + google/api/backend.proto + google/api/billing.proto + google/api/consumer.proto + google/api/context.proto + google/api/control.proto + google/api/documentation.proto + google/api/endpoint.proto + google/api/log.proto + google/api/logging.proto + google/api/monitoring.proto + google/api/quota.proto + google/api/service.proto + google/api/source_info.proto + google/api/system_parameter.proto + google/api/usage.proto + +It has these top-level messages: + Authentication + AuthenticationRule + AuthProvider + OAuthRequirements + AuthRequirement + Backend + BackendRule + Billing + ProjectProperties + Property + Context + ContextRule + Control + Documentation + DocumentationRule + Page + Endpoint + LogDescriptor + Logging + Monitoring + Quota + MetricRule + QuotaLimit + Service + SourceInfo + SystemParameters + SystemParameterRule + SystemParameter + Usage + UsageRule +*/ +package serviceconfig + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// `Authentication` defines the authentication configuration for an API. +// +// Example for an API targeted for external use: +// +// name: calendar.googleapis.com +// authentication: +// providers: +// - id: google_calendar_auth +// jwks_uri: https://www.googleapis.com/oauth2/v1/certs +// issuer: https://securetoken.google.com +// rules: +// - selector: "*" +// requirements: +// provider_id: google_calendar_auth +type Authentication struct { + // A list of authentication rules that apply to individual API methods. + // + // **NOTE:** All service configuration rules follow "last one wins" order. + Rules []*AuthenticationRule `protobuf:"bytes,3,rep,name=rules" json:"rules,omitempty"` + // Defines a set of authentication providers that a service supports. + Providers []*AuthProvider `protobuf:"bytes,4,rep,name=providers" json:"providers,omitempty"` +} + +func (m *Authentication) Reset() { *m = Authentication{} } +func (m *Authentication) String() string { return proto.CompactTextString(m) } +func (*Authentication) ProtoMessage() {} +func (*Authentication) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *Authentication) GetRules() []*AuthenticationRule { + if m != nil { + return m.Rules + } + return nil +} + +func (m *Authentication) GetProviders() []*AuthProvider { + if m != nil { + return m.Providers + } + return nil +} + +// Authentication rules for the service. +// +// By default, if a method has any authentication requirements, every request +// must include a valid credential matching one of the requirements. +// It's an error to include more than one kind of credential in a single +// request. +// +// If a method doesn't have any auth requirements, request credentials will be +// ignored. +type AuthenticationRule struct { + // Selects the methods to which this rule applies. + // + // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + Selector string `protobuf:"bytes,1,opt,name=selector" json:"selector,omitempty"` + // The requirements for OAuth credentials. + Oauth *OAuthRequirements `protobuf:"bytes,2,opt,name=oauth" json:"oauth,omitempty"` + // Whether to allow requests without a credential. The credential can be + // an OAuth token, Google cookies (first-party auth) or EndUserCreds. + // + // For requests without credentials, if the service control environment is + // specified, each incoming request **must** be associated with a service + // consumer. This can be done by passing an API key that belongs to a consumer + // project. + AllowWithoutCredential bool `protobuf:"varint,5,opt,name=allow_without_credential,json=allowWithoutCredential" json:"allow_without_credential,omitempty"` + // Requirements for additional authentication providers. + Requirements []*AuthRequirement `protobuf:"bytes,7,rep,name=requirements" json:"requirements,omitempty"` +} + +func (m *AuthenticationRule) Reset() { *m = AuthenticationRule{} } +func (m *AuthenticationRule) String() string { return proto.CompactTextString(m) } +func (*AuthenticationRule) ProtoMessage() {} +func (*AuthenticationRule) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *AuthenticationRule) GetSelector() string { + if m != nil { + return m.Selector + } + return "" +} + +func (m *AuthenticationRule) GetOauth() *OAuthRequirements { + if m != nil { + return m.Oauth + } + return nil +} + +func (m *AuthenticationRule) GetAllowWithoutCredential() bool { + if m != nil { + return m.AllowWithoutCredential + } + return false +} + +func (m *AuthenticationRule) GetRequirements() []*AuthRequirement { + if m != nil { + return m.Requirements + } + return nil +} + +// Configuration for an anthentication provider, including support for +// [JSON Web Token (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). +type AuthProvider struct { + // The unique identifier of the auth provider. It will be referred to by + // `AuthRequirement.provider_id`. + // + // Example: "bookstore_auth". + Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + // Identifies the principal that issued the JWT. See + // https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.1 + // Usually a URL or an email address. + // + // Example: https://securetoken.google.com + // Example: 1234567-compute@developer.gserviceaccount.com + Issuer string `protobuf:"bytes,2,opt,name=issuer" json:"issuer,omitempty"` + // URL of the provider's public key set to validate signature of the JWT. See + // [OpenID Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata). + // Optional if the key set document: + // - can be retrieved from + // [OpenID Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html + // of the issuer. + // - can be inferred from the email domain of the issuer (e.g. a Google service account). + // + // Example: https://www.googleapis.com/oauth2/v1/certs + JwksUri string `protobuf:"bytes,3,opt,name=jwks_uri,json=jwksUri" json:"jwks_uri,omitempty"` + // The list of JWT + // [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). + // that are allowed to access. A JWT containing any of these audiences will + // be accepted. When this setting is absent, only JWTs with audience + // "https://[Service_name][google.api.Service.name]/[API_name][google.protobuf.Api.name]" + // will be accepted. For example, if no audiences are in the setting, + // LibraryService API will only accept JWTs with the following audience + // "https://library-example.googleapis.com/google.example.library.v1.LibraryService". + // + // Example: + // + // audiences: bookstore_android.apps.googleusercontent.com, + // bookstore_web.apps.googleusercontent.com + Audiences string `protobuf:"bytes,4,opt,name=audiences" json:"audiences,omitempty"` + // Redirect URL if JWT token is required but no present or is expired. + // Implement authorizationUrl of securityDefinitions in OpenAPI spec. + AuthorizationUrl string `protobuf:"bytes,5,opt,name=authorization_url,json=authorizationUrl" json:"authorization_url,omitempty"` +} + +func (m *AuthProvider) Reset() { *m = AuthProvider{} } +func (m *AuthProvider) String() string { return proto.CompactTextString(m) } +func (*AuthProvider) ProtoMessage() {} +func (*AuthProvider) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *AuthProvider) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *AuthProvider) GetIssuer() string { + if m != nil { + return m.Issuer + } + return "" +} + +func (m *AuthProvider) GetJwksUri() string { + if m != nil { + return m.JwksUri + } + return "" +} + +func (m *AuthProvider) GetAudiences() string { + if m != nil { + return m.Audiences + } + return "" +} + +func (m *AuthProvider) GetAuthorizationUrl() string { + if m != nil { + return m.AuthorizationUrl + } + return "" +} + +// OAuth scopes are a way to define data and permissions on data. For example, +// there are scopes defined for "Read-only access to Google Calendar" and +// "Access to Cloud Platform". Users can consent to a scope for an application, +// giving it permission to access that data on their behalf. +// +// OAuth scope specifications should be fairly coarse grained; a user will need +// to see and understand the text description of what your scope means. +// +// In most cases: use one or at most two OAuth scopes for an entire family of +// products. If your product has multiple APIs, you should probably be sharing +// the OAuth scope across all of those APIs. +// +// When you need finer grained OAuth consent screens: talk with your product +// management about how developers will use them in practice. +// +// Please note that even though each of the canonical scopes is enough for a +// request to be accepted and passed to the backend, a request can still fail +// due to the backend requiring additional scopes or permissions. +type OAuthRequirements struct { + // The list of publicly documented OAuth scopes that are allowed access. An + // OAuth token containing any of these scopes will be accepted. + // + // Example: + // + // canonical_scopes: https://www.googleapis.com/auth/calendar, + // https://www.googleapis.com/auth/calendar.read + CanonicalScopes string `protobuf:"bytes,1,opt,name=canonical_scopes,json=canonicalScopes" json:"canonical_scopes,omitempty"` +} + +func (m *OAuthRequirements) Reset() { *m = OAuthRequirements{} } +func (m *OAuthRequirements) String() string { return proto.CompactTextString(m) } +func (*OAuthRequirements) ProtoMessage() {} +func (*OAuthRequirements) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *OAuthRequirements) GetCanonicalScopes() string { + if m != nil { + return m.CanonicalScopes + } + return "" +} + +// User-defined authentication requirements, including support for +// [JSON Web Token (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). +type AuthRequirement struct { + // [id][google.api.AuthProvider.id] from authentication provider. + // + // Example: + // + // provider_id: bookstore_auth + ProviderId string `protobuf:"bytes,1,opt,name=provider_id,json=providerId" json:"provider_id,omitempty"` + // NOTE: This will be deprecated soon, once AuthProvider.audiences is + // implemented and accepted in all the runtime components. + // + // The list of JWT + // [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). + // that are allowed to access. A JWT containing any of these audiences will + // be accepted. When this setting is absent, only JWTs with audience + // "https://[Service_name][google.api.Service.name]/[API_name][google.protobuf.Api.name]" + // will be accepted. For example, if no audiences are in the setting, + // LibraryService API will only accept JWTs with the following audience + // "https://library-example.googleapis.com/google.example.library.v1.LibraryService". + // + // Example: + // + // audiences: bookstore_android.apps.googleusercontent.com, + // bookstore_web.apps.googleusercontent.com + Audiences string `protobuf:"bytes,2,opt,name=audiences" json:"audiences,omitempty"` +} + +func (m *AuthRequirement) Reset() { *m = AuthRequirement{} } +func (m *AuthRequirement) String() string { return proto.CompactTextString(m) } +func (*AuthRequirement) ProtoMessage() {} +func (*AuthRequirement) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *AuthRequirement) GetProviderId() string { + if m != nil { + return m.ProviderId + } + return "" +} + +func (m *AuthRequirement) GetAudiences() string { + if m != nil { + return m.Audiences + } + return "" +} + +func init() { + proto.RegisterType((*Authentication)(nil), "google.api.Authentication") + proto.RegisterType((*AuthenticationRule)(nil), "google.api.AuthenticationRule") + proto.RegisterType((*AuthProvider)(nil), "google.api.AuthProvider") + proto.RegisterType((*OAuthRequirements)(nil), "google.api.OAuthRequirements") + proto.RegisterType((*AuthRequirement)(nil), "google.api.AuthRequirement") +} + +func init() { proto.RegisterFile("google/api/auth.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 465 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x52, 0x5f, 0x6b, 0x13, 0x4f, + 0x14, 0x65, 0x93, 0xa6, 0xcd, 0xde, 0x94, 0xb4, 0x1d, 0xf8, 0x95, 0xfd, 0xd5, 0xaa, 0x21, 0x4f, + 0x11, 0x61, 0x03,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3, + 0x26, 0x3f, 0x87, 0x8b, 0xe8, 0xcb, 0xfb, 0x06, 0x28, 0x50, 0x31, 0x5d, 0xa4, 0x68, 0x8a, 0x79, + 0x21, 0x74, 0xf8, 0xce, 0xf3, 0x1a, 0x62, 0xa5, 0xb4, 0xe1, 0xbf, 0x5b, 0x61, 0xee, 0x24, 0x17, + 0x1c, 0xf5, 0x37, 0x59, 0xbc, 0xee, 0x54, 0x7f, 0x7a, 0x3b, 0x1f, 0x2e, 0x16, 0x57, 0x5f, 0x77, + 0x83, 0xf0, 0xfc, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe5, 0xa3, 0x9d, 0xc6, 0x4a, 0x03, 0x00, + 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/backend.pb.go b/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/backend.pb.go new file mode 100644 index 0000000000..5704d9b0a1 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/backend.pb.go @@ -0,0 +1,98 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/api/backend.proto + +package serviceconfig + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// `Backend` defines the backend configuration for a service. +type Backend struct { + // A list of API backend rules that apply to individual API methods. + // + // **NOTE:** All service configuration rules follow "last one wins" order. + Rules []*BackendRule `protobuf:"bytes,1,rep,name=rules" json:"rules,omitempty"` +} + +func (m *Backend) Reset() { *m = Backend{} } +func (m *Backend) String() string { return proto.CompactTextString(m) } +func (*Backend) ProtoMessage() {} +func (*Backend) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +func (m *Backend) GetRules() []*BackendRule { + if m != nil { + return m.Rules + } + return nil +} + +// A backend rule provides configuration for an individual API element. +type BackendRule struct { + // Selects the methods to which this rule applies. + // + // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + Selector string `protobuf:"bytes,1,opt,name=selector" json:"selector,omitempty"` + // The address of the API backend. + Address string `protobuf:"bytes,2,opt,name=address" json:"address,omitempty"` + // The number of seconds to wait for a response from a request. The + // default depends on the deployment context. + Deadline float64 `protobuf:"fixed64,3,opt,name=deadline" json:"deadline,omitempty"` +} + +func (m *BackendRule) Reset() { *m = BackendRule{} } +func (m *BackendRule) String() string { return proto.CompactTextString(m) } +func (*BackendRule) ProtoMessage() {} +func (*BackendRule) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} } + +func (m *BackendRule) GetSelector() string { + if m != nil { + return m.Selector + } + return "" +} + +func (m *BackendRule) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *BackendRule) GetDeadline() float64 { + if m != nil { + return m.Deadline + } + return 0 +} + +func init() { + proto.RegisterType((*Backend)(nil), "google.api.Backend") + proto.RegisterType((*BackendRule)(nil), "google.api.BackendRule") +} + +func init() { proto.RegisterFile("google/api/backend.proto", fileDescriptor1) } + +var fileDescriptor1 = []byte{ + // 227 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x90, 0x31, 0x4f, 0x03, 0x21, + 0x18, 0x86, 0x43, 0xab, 0x56, 0xbf, 0x1a, 0x87, 0x5b, 0x24, 0x4e, 0x97, 0x4e, 0xb7, 0xc8, 0x25, + 0xba, 0x98, 0x38, 0x79, 0x89, 0x31, 0x6e, 0x17, 0x46, 0x17, 0x43, 0xe1, 0x93, 0x10, 0x91, 0x8f, + 0x40, 0xeb, 0x0f, 0xf2, 0x97, 0x9a, 0xc2, 0x59, 0xdb, 0xf1, 0xe1, 0x79, 0xdf, 0xc0, 0x0b, 0x70, + 0x4b, 0x64, 0x3d, 0xf6, 0x2a, 0xba, 0x7e, 0xad, 0xf4, 0x27, 0x06, 0x23, 0x62, 0xa2, 0x0d, 0x35, + 0x50, 0x8d, 0x50, 0xd1, 0xad, 0x1e, 0x60, 0x31, 0x54, 0xd9, 0xdc, 0xc2, 0x69, 0xda, 0x7a, 0xcc, + 0x9c, 0xb5, 0xf3, 0x6e, 0x79, 0x77, 0x2d, 0xfe, 0x63, 0x62, 0xca, 0xc8, 0xad, 0x47, 0x59, 0x53, + 0xab, 0x77, 0x58, 0x1e, 0x9c, 0x36, 0x37, 0x70, 0x9e, 0xd1, 0xa3, 0xde, 0x50, 0xe2, 0xac, 0x65, + 0xdd, 0x85, 0xdc, 0x73, 0xc3, 0x61, 0xa1, 0x8c, 0x49, 0x98, 0x33, 0x9f, 0x15, 0xf5, 0x87, 0xbb, + 0x96, 0x41, 0x65, 0xbc, 0x0b, 0xc8, 0xe7, 0x2d, 0xeb, 0x98, 0xdc, 0xf3, 0x10, 0xe0, 0x4a, 0xd3, + 0xd7, 0xc1, 0x2b, 0x86, 0xcb, 0xe9, 0xc2, 0x71, 0x37, 0x63, 0x64, 0x6f, 0xcf, 0x93, 0xb3, 0xe4, + 0x55, 0xb0, 0x82, 0x92, 0xed, 0x2d, 0x86, 0x32, 0xb2, 0xaf, 0x4a, 0x45, 0x97, 0xcb, 0x0f, 0x64, + 0x4c, 0xdf, 0x4e, 0xa3, 0xa6, 0xf0, 0xe1, 0xec, 0xe3, 0x11, 0xfd, 0xcc, 0x4e, 0x5e, 0x9e, 0xc6, + 0xd7, 0xf5, 0x59, 0x29, 0xde, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x7e, 0x93, 0x9e, 0x00, 0x39, + 0x01, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/billing.pb.go b/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/billing.pb.go new file mode 100644 index 0000000000..81def6a6ad --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/billing.pb.go @@ -0,0 +1,113 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/api/billing.proto + +package serviceconfig + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import _ "google.golang.org/genproto/googleapis/api/metric" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Billing related configuration of the service. +// +// The following example shows how to configure monitored resources and metrics +// for billing: +// monitored_resources: +// - type: library.googleapis.com/branch +// labels: +// - key: /city +// description: The city where the library branch is located in. +// - key: /name +// description: The name of the branch. +// metrics: +// - name: library.googleapis.com/book/borrowed_count +// metric_kind: DELTA +// value_type: INT64 +// billing: +// consumer_destinations: +// - monitored_resource: library.googleapis.com/branch +// metrics: +// - library.googleapis.com/book/borrowed_count +type Billing struct { + // Billing configurations for sending metrics to the consumer project. + // There can be multiple consumer destinations per service, each one must have + // a different monitored resource type. A metric can be used in at most + // one consumer destination. + ConsumerDestinations []*Billing_BillingDestination `protobuf:"bytes,8,rep,name=consumer_destinations,json=consumerDestinations" json:"consumer_destinations,omitempty"` +} + +func (m *Billing) Reset() { *m = Billing{} } +func (m *Billing) String() string { return proto.CompactTextString(m) } +func (*Billing) ProtoMessage() {} +func (*Billing) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} } + +func (m *Billing) GetConsumerDestinations() []*Billing_BillingDestination { + if m != nil { + return m.ConsumerDestinations + } + return nil +} + +// Configuration of a specific billing destination (Currently only support +// bill against consumer project). +type Billing_BillingDestination struct { + // The monitored resource type. The type must be defined in + // [Service.monitored_resources][google.api.Service.monitored_resources] section. + MonitoredResource string `protobuf:"bytes,1,opt,name=monitored_resource,json=monitoredResource" json:"monitored_resource,omitempty"` + // Names of the metrics to report to this billing destination. + // Each name must be defined in [Service.metrics][google.api.Service.metrics] section. + Metrics []string `protobuf:"bytes,2,rep,name=metrics" json:"metrics,omitempty"` +} + +func (m *Billing_BillingDestination) Reset() { *m = Billing_BillingDestination{} } +func (m *Billing_BillingDestination) String() string { return proto.CompactTextString(m) } +func (*Billing_BillingDestination) ProtoMessage() {} +func (*Billing_BillingDestination) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0, 0} } + +func (m *Billing_BillingDestination) GetMonitoredResource() string { + if m != nil { + return m.MonitoredResource + } + return "" +} + +func (m *Billing_BillingDestination) GetMetrics() []string { + if m != nil { + return m.Metrics + } + return nil +} + +func init() { + proto.RegisterType((*Billing)(nil), "google.api.Billing") + proto.RegisterType((*Billing_BillingDestination)(nil), "google.api.Billing.BillingDestination") +} + +func init() { proto.RegisterFile("google/api/billing.proto", fileDescriptor2) } + +var fileDescriptor2 = []byte{ + // 265 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x90, 0xc1, 0x4a, 0xc4, 0x30, + 0x10, 0x86, 0xe9, 0xae, 0xb8, 0x6e, 0x14, 0xc1, 0xa0, 0x58, 0x8a, 0x87, 0xe2, 0x41, 0x7a, 0xb1, + 0x05, 0x3d, 0x7a, 0xb2, 0x28, 0xe2, 0xad, 0xf4, 0xa8, 0xc8, 0x92, 0xcd, 0x8e, 0x61, 0xa0, 0x9d, + 0x29, 0x49, 0xd6, 0x07, 0xf2, 0x5d, 0x7c, 0x2f, 0xb1, 0x69, 0xdd, 0x8a, 0xa7, 0x30, 0xf9, 0xfe, + 0xf9, 0x67, 0xe6, 0x17, 0xb1, 0x61, 0x36, 0x0d, 0x14, 0xaa, 0xc3, 0x62, 0x8d, 0x4d, 0x83, 0x64, + 0xf2, 0xce, 0xb2, 0x67, 0x29, 0x02, 0xc9, 0x55, 0x87, 0xc9, 0xc5, 0x44, 0xa5, 0x88, 0xd8, 0x2b, + 0x8f, 0x4c, 0x2e, 0x28, 0x93, 0xf3, 0x09, 0x6d, 0xc1, 0x5b, 0xd4, 0x01, 0x5c, 0x7e, 0x45, 0x62, + 0x51, 0x06, 0x53, 0xf9, 0x2a, 0xce, 0x34, 0x93, 0xdb, 0xb6, 0x60, 0x57, 0x1b, 0x70, 0x1e, 0x29, + 0x78, 0xc4, 0x07, 0xe9, 0x3c, 0x3b, 0xbc, 0xb9, 0xca, 0x77, 0xe3, 0xf2, 0xa1, 0x67, 0x7c, 0x1f, + 0x76, 0xf2, 0xfa, 0x74, 0x34, 0x99, 0x7c, 0xba, 0xe4, 0x4d, 0xc8, 0xff, 0x5a, 0x79, 0x2d, 0x64, + 0xcb, 0x84, 0x9e, 0x2d, 0x6c, 0x56, 0x16, 0x1c, 0x6f, 0xad, 0x86, 0x38, 0x4a, 0xa3, 0x6c, 0x59, + 0x9f, 0xfc, 0x92, 0x7a, 0x00, 0x32, 0x16, 0x8b, 0xb0, 0xbd, 0x8b, 0x67, 0xe9, 0x3c, 0x5b, 0xd6, + 0x63, 0x59, 0x92, 0x38, 0xd6, 0xdc, 0x4e, 0x36, 0x2c, 0x8f, 0x86, 0x71, 0xd5, 0xcf, 0x9d, 0x55, + 0xf4, 0xf2, 0x38, 0x30, 0xc3, 0x8d, 0x22, 0x93, 0xb3, 0x35, 0x85, 0x01, 0xea, 0x53, 0x28, 0x02, + 0x52, 0x1d, 0xba, 0x3e, 0x21, 0x07, 0xf6, 0x03, 0x35, 0x68, 0xa6, 0x77, 0x34, 0x77, 0x7f, 0xaa, + 0xcf, 0xd9, 0xde, 0xd3, 0x7d, 0xf5, 0xbc, 0xde, 0xef, 0x1b, 0x6f, 0xbf, 0x03, 0x00, 0x00, 0xff, + 0xff, 0xca, 0x8b, 0xb4, 0x63, 0x9d, 0x01, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/consumer.pb.go b/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/consumer.pb.go new file mode 100644 index 0000000000..3e92ac506d --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/consumer.pb.go @@ -0,0 +1,158 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/api/consumer.proto + +package serviceconfig + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Supported data type of the property values +type Property_PropertyType int32 + +const ( + // The type is unspecified, and will result in an error. + Property_UNSPECIFIED Property_PropertyType = 0 + // The type is `int64`. + Property_INT64 Property_PropertyType = 1 + // The type is `bool`. + Property_BOOL Property_PropertyType = 2 + // The type is `string`. + Property_STRING Property_PropertyType = 3 + // The type is 'double'. + Property_DOUBLE Property_PropertyType = 4 +) + +var Property_PropertyType_name = map[int32]string{ + 0: "UNSPECIFIED", + 1: "INT64", + 2: "BOOL", + 3: "STRING", + 4: "DOUBLE", +} +var Property_PropertyType_value = map[string]int32{ + "UNSPECIFIED": 0, + "INT64": 1, + "BOOL": 2, + "STRING": 3, + "DOUBLE": 4, +} + +func (x Property_PropertyType) String() string { + return proto.EnumName(Property_PropertyType_name, int32(x)) +} +func (Property_PropertyType) EnumDescriptor() ([]byte, []int) { return fileDescriptor3, []int{1, 0} } + +// A descriptor for defining project properties for a service. One service may +// have many consumer projects, and the service may want to behave differently +// depending on some properties on the project. For example, a project may be +// associated with a school, or a business, or a government agency, a business +// type property on the project may affect how a service responds to the client. +// This descriptor defines which properties are allowed to be set on a project. +// +// Example: +// +// project_properties: +// properties: +// - name: NO_WATERMARK +// type: BOOL +// description: Allows usage of the API without watermarks. +// - name: EXTENDED_TILE_CACHE_PERIOD +// type: INT64 +type ProjectProperties struct { + // List of per consumer project-specific properties. + Properties []*Property `protobuf:"bytes,1,rep,name=properties" json:"properties,omitempty"` +} + +func (m *ProjectProperties) Reset() { *m = ProjectProperties{} } +func (m *ProjectProperties) String() string { return proto.CompactTextString(m) } +func (*ProjectProperties) ProtoMessage() {} +func (*ProjectProperties) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} } + +func (m *ProjectProperties) GetProperties() []*Property { + if m != nil { + return m.Properties + } + return nil +} + +// Defines project properties. +// +// API services can define properties that can be assigned to consumer projects +// so that backends can perform response customization without having to make +// additional calls or maintain additional storage. For example, Maps API +// defines properties that controls map tile cache period, or whether to embed a +// watermark in a result. +// +// These values can be set via API producer console. Only API providers can +// define and set these properties. +type Property struct { + // The name of the property (a.k.a key). + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The type of this property. + Type Property_PropertyType `protobuf:"varint,2,opt,name=type,enum=google.api.Property_PropertyType" json:"type,omitempty"` + // The description of the property + Description string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` +} + +func (m *Property) Reset() { *m = Property{} } +func (m *Property) String() string { return proto.CompactTextString(m) } +func (*Property) ProtoMessage() {} +func (*Property) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{1} } + +func (m *Property) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Property) GetType() Property_PropertyType { + if m != nil { + return m.Type + } + return Property_UNSPECIFIED +} + +func (m *Property) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func init() { + proto.RegisterType((*ProjectProperties)(nil), "google.api.ProjectProperties") + proto.RegisterType((*Property)(nil), "google.api.Property") + proto.RegisterEnum("google.api.Property_PropertyType", Property_PropertyType_name, Property_PropertyType_value) +} + +func init() { proto.RegisterFile("google/api/consumer.proto", fileDescriptor3) } + +var fileDescriptor3 = []byte{ + // 299 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0x4f, 0x4f, 0xf2, 0x40, + 0x10, 0xc6, 0xdf, 0x85, 0xbe, 0x04, 0x06, 0xc5, 0xba, 0xf1, 0x50, 0x6f, 0x95, 0x13, 0xa7, 0x36, + 0x41, 0xf4, 0xe2, 0xad, 0x50, 0x4d, 0x13, 0x02, 0x4d, 0x81, 0x8b, 0xb7, 0x5a, 0xc7, 0x75, 0x0d, + 0xec, 0x6c, 0xb6, 0xd5, 0x84, 0x0f, 0xe8, 0xf7, 0x32, 0x2c, 0x88, 0x35, 0xf1, 0xf6, 0xc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00, 0x30, 0xdd, 0xf1, 0x4b, 0xd9, 0x63, 0x7c, 0x30, 0x05, 0xad, 0x73, 0x25, 0x02, + 0x32, 0x22, 0x14, 0xa8, 0x2c, 0xdd, 0x70, 0x6f, 0xe5, 0x5a, 0x96, 0x96, 0x7d, 0x89, 0xe6, 0x43, + 0x16, 0x58, 0x90, 0x7a, 0x91, 0xe2, 0xee, 0xd7, 0xf5, 0xd4, 0xb2, 0x8d, 0xeb, 0xaf, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xb7, 0xa4, 0x04, 0x2c, 0xac, 0x01, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/context.pb.go b/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/context.pb.go new file mode 100644 index 0000000000..f22859b080 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/context.pb.go @@ -0,0 +1,114 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/api/context.proto + +package serviceconfig + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// `Context` defines which contexts an API requests. +// +// Example: +// +// context: +// rules: +// - selector: "*" +// requested: +// - google.rpc.context.ProjectContext +// - google.rpc.context.OriginContext +// +// The above specifies that all methods in the API request +// `google.rpc.context.ProjectContext` and +// `google.rpc.context.OriginContext`. +// +// Available context types are defined in package +// `google.rpc.context`. +type Context struct { + // A list of RPC context rules that apply to individual API methods. + // + // **NOTE:** All service configuration rules follow "last one wins" order. + Rules []*ContextRule `protobuf:"bytes,1,rep,name=rules" json:"rules,omitempty"` +} + +func (m *Context) Reset() { *m = Context{} } +func (m *Context) String() string { return proto.CompactTextString(m) } +func (*Context) ProtoMessage() {} +func (*Context) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{0} } + +func (m *Context) GetRules() []*ContextRule { + if m != nil { + return m.Rules + } + return nil +} + +// A context rule provides information about the context for an individual API +// element. +type ContextRule struct { + // Selects the methods to which this rule applies. + // + // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + Selector string `protobuf:"bytes,1,opt,name=selector" json:"selector,omitempty"` + // A list of full type names of requested contexts. + Requested []string `protobuf:"bytes,2,rep,name=requested" json:"requested,omitempty"` + // A list of full type names of provided contexts. + Provided []string `protobuf:"bytes,3,rep,name=provided" json:"provided,omitempty"` +} + +func (m *ContextRule) Reset() { *m = ContextRule{} } +func (m *ContextRule) String() string { return proto.CompactTextString(m) } +func (*ContextRule) ProtoMessage() {} +func (*ContextRule) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{1} } + +func (m *ContextRule) GetSelector() string { + if m != nil { + return m.Selector + } + return "" +} + +func (m *ContextRule) GetRequested() []string { + if m != nil { + return m.Requested + } + return nil +} + +func (m *ContextRule) GetProvided() []string { + if m != nil { + return m.Provided + } + return nil +} + +func init() { + proto.RegisterType((*Context)(nil), "google.api.Context") + proto.RegisterType((*ContextRule)(nil), "google.api.ContextRule") +} + +func init() { proto.RegisterFile("google/api/context.proto", fileDescriptor4) } + +var fileDescriptor4 = []byte{ + // 231 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x90, 0x4f, 0x4b, 0xc4, 0x30, + 0x14, 0xc4, 0xe9, 0xd6, 0x7f, 0x7d, 0x2b, 0x1e, 0x7a, 0x31, 0x88, 0x87, 0xb2, 0xa7, 0x5e, 0x4c, + 0x41, 0x2f, 0x82, 0x27, 0x57, 0x44, 0xbc, 0x95, 0x1e, 0xbd, 0xc5, 0xf4, 0x19, 0x02, 0x31, 0x2f, + 0x26, 0xe9, 0xe2, 0xe7, 0xf1, 0x93, 0xca, 0x26, 0x65, 0xff, 0x1c, 0x67, 0x7e, 0x33, 0x24, 0xf3, + 0x80, 0x29, 0x22, 0x65, 0xb0, 0x13, 0x4e, 0x77, 0x92, 0x6c, 0xc4, 0xdf, 0xc8, 0x9d, 0xa7, 0x48, + 0x35, 0x64, 0xc2, 0x85, 0xd3, 0xab, 0x47, 0x38, 0x7f, 0xc9, 0xb0, 0xbe, 0x83, 0x53, 0x3f, 0x19, + 0x0c, 0xac, 0x68, 0xca, 0x76, 0x79, 0x7f, 0xcd, 0xf7, 0x31, 0x3e, 0x67, 0x86, 0xc9, 0xe0, 0x90, + 0x53, 0x2b, 0x09, 0xcb, 0x03, 0xb7, 0xbe, 0x81, 0x8b, 0x80, 0x06, 0x65, 0x24, 0xcf, 0x8a, 0xa6, + 0x68, 0xab, 0x61, 0xa7, 0xeb, 0x5b, 0xa8, 0x3c, 0xfe, 0x4c, 0x18, 0x22, 0x8e, 0x6c, 0xd1, 0x94, + 0x6d, 0x35, 0xec, 0x8d, 0x6d, 0xd3, 0x79, 0xda, 0xe8, 0x11, 0x47, 0x56, 0x26, 0xb8, 0xd3, 0x6b, + 0x0b, 0x57, 0x92, 0xbe, 0x0f, 0x7e, 0xb2, 0xbe, 0x9c, 0x1f, 0xed, 0xb7, 0x53, 0xfa, 0xe2, 0xe3, + 0x75, 0x66, 0x8a, 0x8c, 0xb0, 0x8a, 0x93, 0x57, 0x9d, 0x42, 0x9b, 0x86, 0x76, 0x19, 0x09, 0xa7, + 0x43, 0xba, 0x42, 0x40, 0xbf, 0xd1, 0x12, 0x25, 0xd9, 0x2f, 0xad, 0x9e, 0x8e, 0xd4, 0xdf, 0xe2, + 0xe4, 0xed, 0xb9, 0x7f, 0xff, 0x3c, 0x4b, 0xc5, 0x87, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb5, + 0x18, 0x98, 0x7a, 0x3d, 0x01, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/control.pb.go b/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/control.pb.go new file mode 100644 index 0000000000..1f4d8678c7 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/control.pb.go @@ -0,0 +1,55 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/api/control.proto + +package serviceconfig + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Selects and configures the service controller used by the service. The +// service controller handles features like abuse, quota, billing, logging, +// monitoring, etc. +type Control struct { + // The service control environment to use. If empty, no control plane + // feature (like quota and billing) will be enabled. + Environment string `protobuf:"bytes,1,opt,name=environment" json:"environment,omitempty"` +} + +func (m *Control) Reset() { *m = Control{} } +func (m *Control) String() string { return proto.CompactTextString(m) } +func (*Control) ProtoMessage() {} +func (*Control) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{0} } + +func (m *Control) GetEnvironment() string { + if m != nil { + return m.Environment + } + return "" +} + +func init() { + proto.RegisterType((*Control)(nil), "google.api.Control") +} + +func init() { proto.RegisterFile("google/api/control.proto", fileDescriptor5) } + +var fileDescriptor5 = []byte{ + // 165 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x48, 0xcf, 0xcf, 0x4f, + 0xcf, 0x49, 0xd5, 0x4f, 0x2c, 0xc8, 0xd4, 0x4f, 0xce, 0xcf, 0x2b, 0x29, 0xca, 0xcf, 0xd1, 0x2b, + 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x82, 0xc8, 0xe8, 0x25, 0x16, 0x64, 0x2a, 0x69, 0x73, 0xb1, + 0x3b, 0x43, 0x24, 0x85, 0x14, 0xb8, 0xb8, 0x53, 0xf3, 0xca, 0x32, 0x8b, 0xf2, 0xf3, 0x72, 0x53, + 0xf3, 0x4a, 0x24, 0x18, 0x15, 0x18, 0x35, 0x38, 0x83, 0x90, 0x85, 0x9c, 0xf2, 0xb8, 0xf8, 0x92, + 0xf3, 0x73, 0xf5, 0x10, 0xda, 0x9d, 0x78, 0xa0, 0x9a, 0x03, 0x40, 0x06, 0x07, 0x30, 0x46, 0xb9, + 0x42, 0xe5, 0xd2, 0xf3, 0x73, 0x12, 0xf3, 0xd2, 0xf5, 0xf2, 0x8b, 0xd2, 0xf5, 0xd3, 0x53, 0xf3, + 0xc0, 0xd6, 0xea, 0x43, 0xa4, 0x12, 0x0b, 0x32, 0x8b, 0xc1, 0x6e, 0x2a, 0x4e, 0x2d, 0x2a, 0xcb, + 0x4c, 0x4e, 0x4d, 0xce, 0xcf, 0x4b, 0xcb, 0x4c, 0xb7, 0x46, 0xe1, 0x2d, 0x62, 0x62, 0x71, 0x77, + 0x0c, 0xf0, 0x4c, 0x62, 0x03, 0x6b, 0x34, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x44, 0x6e, 0x78, + 0xbd, 0xcb, 0x00, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/documentation.pb.go b/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/documentation.pb.go new file mode 100644 index 0000000000..99a568cff7 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/documentation.pb.go @@ -0,0 +1,267 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/api/documentation.proto + +package serviceconfig + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// `Documentation` provides the information for describing a service. +// +// Example: +//
documentation:
+//   summary: >
+//     The Google Calendar API gives access
+//     to most calendar features.
+//   pages:
+//   - name: Overview
+//     content: (== include google/foo/overview.md ==)
+//   - name: Tutorial
+//     content: (== include google/foo/tutorial.md ==)
+//     subpages;
+//     - name: Java
+//       content: (== include google/foo/tutorial_java.md ==)
+//   rules:
+//   - selector: google.calendar.Calendar.Get
+//     description: >
+//       ...
+//   - selector: google.calendar.Calendar.Put
+//     description: >
+//       ...
+// 
+// Documentation is provided in markdown syntax. In addition to +// standard markdown features, definition lists, tables and fenced +// code blocks are supported. Section headers can be provided and are +// interpreted relative to the section nesting of the context where +// a documentation fragment is embedded. +// +// Documentation from the IDL is merged with documentation defined +// via the config at normalization time, where documentation provided +// by config rules overrides IDL provided. +// +// A number of constructs specific to the API platform are supported +// in documentation text. +// +// In order to reference a proto element, the following +// notation can be used: +//
[fully.qualified.proto.name][]
+// To override the display text used for the link, this can be used: +//
[display text][fully.qualified.proto.name]
+// Text can be excluded from doc using the following notation: +//
(-- internal comment --)
+// Comments can be made conditional using a visibility label. The below +// text will be only rendered if the `BETA` label is available: +//
(--BETA: comment for BETA users --)
+// A few directives are available in documentation. Note that +// directives must appear on a single line to be properly +// identified. The `include` directive includes a markdown file from +// an external source: +//
(== include path/to/file ==)
+// The `resource_for` directive marks a message to be the resource of +// a collection in REST view. If it is not specified, tools attempt +// to infer the resource from the operations in a collection: +//
(== resource_for v1.shelves.books ==)
+// The directive `suppress_warning` does not directly affect documentation +// and is documented together with service config validation. +type Documentation struct { + // A short summary of what the service does. Can only be provided by + // plain text. + Summary string `protobuf:"bytes,1,opt,name=summary" json:"summary,omitempty"` + // The top level pages for the documentation set. + Pages []*Page `protobuf:"bytes,5,rep,name=pages" json:"pages,omitempty"` + // A list of documentation rules that apply to individual API elements. + // + // **NOTE:** All service configuration rules follow "last one wins" order. + Rules []*DocumentationRule `protobuf:"bytes,3,rep,name=rules" json:"rules,omitempty"` + // The URL to the root of documentation. + DocumentationRootUrl string `protobuf:"bytes,4,opt,name=documentation_root_url,json=documentationRootUrl" json:"documentation_root_url,omitempty"` + // Declares a single overview page. For example: + //
documentation:
+	//   summary: ...
+	//   overview: (== include overview.md ==)
+	// 
+ // This is a shortcut for the following declaration (using pages style): + //
documentation:
+	//   summary: ...
+	//   pages:
+	//   - name: Overview
+	//     content: (== include overview.md ==)
+	// 
+ // Note: you cannot specify both `overview` field and `pages` field. + Overview string `protobuf:"bytes,2,opt,name=overview" json:"overview,omitempty"` +} + +func (m *Documentation) Reset() { *m = Documentation{} } +func (m *Documentation) String() string { return proto.CompactTextString(m) } +func (*Documentation) ProtoMessage() {} +func (*Documentation) Descriptor() ([]byte, []int) { return fileDescriptor6, []int{0} } + +func (m *Documentation) GetSummary() string { + if m != nil { + return m.Summary + } + return "" +} + +func (m *Documentation) GetPages() []*Page { + if m != nil { + return m.Pages + } + return nil +} + +func (m *Documentation) GetRules() []*DocumentationRule { + if m != nil { + return m.Rules + } + return nil +} + +func (m *Documentation) GetDocumentationRootUrl() string { + if m != nil { + return m.DocumentationRootUrl + } + return "" +} + +func (m *Documentation) GetOverview() string { + if m != nil { + return m.Overview + } + return "" +} + +// A documentation rule provides information about individual API elements. +type DocumentationRule struct { + // The selector is a comma-separated list of patterns. Each pattern is a + // qualified name of the element which may end in "*", indicating a wildcard. + // Wildcards are only allowed at the end and for a whole component of the + // qualified name, i.e. "foo.*" is ok, but not "foo.b*" or "foo.*.bar". To + // specify a default for all applicable elements, the whole pattern "*" + // is used. + Selector string `protobuf:"bytes,1,opt,name=selector" json:"selector,omitempty"` + // Description of the selected API(s). + Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` + // Deprecation description of the selected element(s). It can be provided if an + // element is marked as `deprecated`. + DeprecationDescription string `protobuf:"bytes,3,opt,name=deprecation_description,json=deprecationDescription" json:"deprecation_description,omitempty"` +} + +func (m *DocumentationRule) Reset() { *m = DocumentationRule{} } +func (m *DocumentationRule) String() string { return proto.CompactTextString(m) } +func (*DocumentationRule) ProtoMessage() {} +func (*DocumentationRule) Descriptor() ([]byte, []int) { return fileDescriptor6, []int{1} } + +func (m *DocumentationRule) GetSelector() string { + if m != nil { + return m.Selector + } + return "" +} + +func (m *DocumentationRule) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *DocumentationRule) GetDeprecationDescription() string { + if m != nil { + return m.DeprecationDescription + } + return "" +} + +// Represents a documentation page. A page can contain subpages to represent +// nested documentation set structure. +type Page struct { + // The name of the page. It will be used as an identity of the page to + // generate URI of the page, text of the link to this page in navigation, + // etc. The full page name (start from the root page name to this page + // concatenated with `.`) can be used as reference to the page in your + // documentation. For example: + //
pages:
+	// - name: Tutorial
+	//   content: (== include tutorial.md ==)
+	//   subpages:
+	//   - name: Java
+	//     content: (== include tutorial_java.md ==)
+	// 
+ // You can reference `Java` page using Markdown reference link syntax: + // `[Java][Tutorial.Java]`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The Markdown content of the page. You can use (== include {path} ==) + // to include content from a Markdown file. + Content string `protobuf:"bytes,2,opt,name=content" json:"content,omitempty"` + // Subpages of this page. The order of subpages specified here will be + // honored in the generated docset. + Subpages []*Page `protobuf:"bytes,3,rep,name=subpages" json:"subpages,omitempty"` +} + +func (m *Page) Reset() { *m = Page{} } +func (m *Page) String() string { return proto.CompactTextString(m) } +func (*Page) ProtoMessage() {} +func (*Page) Descriptor() ([]byte, []int) { return fileDescriptor6, []int{2} } + +func (m *Page) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Page) GetContent() string { + if m != nil { + return m.Content + } + return "" +} + +func (m *Page) GetSubpages() []*Page { + if m != nil { + return m.Subpages + } + return nil +} + +func init() { + proto.RegisterType((*Documentation)(nil), "google.api.Documentation") + proto.RegisterType((*DocumentationRule)(nil), "google.api.DocumentationRule") + proto.RegisterType((*Page)(nil), "google.api.Page") +} + +func init() { proto.RegisterFile("google/api/documentation.proto", fileDescriptor6) } + +var fileDescriptor6 = []byte{ + // 356 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xc1, 0x6a, 0xe3, 0x30, + 0x14, 0x45, 0x71, 0xec, 0xcc, 0x64, 0x5e, 0x98, 0x61, 0x46, 0x0c, 0x19, 0x33, 0xd0, 0x12, 0xb2, + 0x28, 0x59, 0x14, 0x1b, 0x9a, 0x42, 0x17, 0x5d, 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 0xb7, 0x68, 0x84, + 0xce, 0xca, 0x1a, 0x6f, 0x37, 0xec, 0xfe, 0x62, 0x57, 0xf0, 0x6f, 0x8b, 0xa5, 0x46, 0xd1, 0xcc, + 0xd8, 0xa5, 0x7d, 0x47, 0x4f, 0x3a, 0xf6, 0xea, 0xe8, 0xce, 0x36, 0x10, 0xd4, 0x15, 0x31, 0x06, + 0x81, 0xe2, 0x05, 0xb6, 0xd1, 0xee, 0xbb, 0x6e, 0x5c, 0x90, 0xb2, 0xa8, 0x6c, 0x1b, 0xb9, 0x97, + 0xec, 0x1c, 0x46, 0xa6, 0xda, 0x34, 0xa5, 0xfb, 0x5f, 0x94, 0x7e, 0x20, 0x96, 0x16, 0x7e, 0x09, + 0x2a, 0x3a, 0xc0, 0x92, 0xf5, 0xce, 0x9f, 0xd4, 0xb7, 0x9f, 0x78, 0x8f, 0xb7, 0x2d, 0x21, 0x29, + 0xe7, 0x4a, 0x46, 0xa4, 0x65, 0x2c, 0x51, 0xb9, 0xb7, 0x11, 0x37, 0x16, 0x2f, 0x33, 0xe3, 0x9e, + 0x8f, 0xa9, 0xbb, 0x14, 0x28, 0x48, 0x3d, 0x65, 0xf2, 0xba, 0xa7, 0xde, 0x06, 0xc1, 0xdd, 0x4d, + 0x72, 0xbf, 0xf9, 0xe6, 0x16, 0x2e, 0x3e, 0x02, 0x00, 0x00, 0xff, 0xff, 0x3e, 0x04, 0x32, 0xbf, + 0x76, 0x02, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/endpoint.pb.go b/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/endpoint.pb.go new file mode 100644 index 0000000000..4bca1828b2 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/endpoint.pb.go @@ -0,0 +1,130 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/api/endpoint.proto + +package serviceconfig + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// `Endpoint` describes a network endpoint that serves a set of APIs. +// A service may expose any number of endpoints, and all endpoints share the +// same service configuration, such as quota configuration and monitoring +// configuration. +// +// Example service configuration: +// +// name: library-example.googleapis.com +// endpoints: +// # Below entry makes 'google.example.library.v1.Library' +// # API be served from endpoint address library-example.googleapis.com. +// # It also allows HTTP OPTIONS calls to be passed to the backend, for +// # it to decide whether the subsequent cross-origin request is +// # allowed to proceed. +// - name: library-example.googleapis.com +// allow_cors: true +type Endpoint struct { + // The canonical name of this endpoint. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // DEPRECATED: This field is no longer supported. Instead of using aliases, + // please specify multiple [google.api.Endpoint][google.api.Endpoint] for each of the intented + // alias. + // + // Additional names that this endpoint will be hosted on. + Aliases []string `protobuf:"bytes,2,rep,name=aliases" json:"aliases,omitempty"` + // The list of APIs served by this endpoint. + Apis []string `protobuf:"bytes,3,rep,name=apis" json:"apis,omitempty"` + // The list of features enabled on this endpoint. + Features []string `protobuf:"bytes,4,rep,name=features" json:"features,omitempty"` + // The specification of an Internet routable address of API frontend that will + // handle requests to this [API Endpoint](https://cloud.google.com/apis/design/glossary). + // It should be either a valid IPv4 address or a fully-qualified domain name. + // For example, "8.8.8.8" or "myservice.appspot.com". + Target string `protobuf:"bytes,101,opt,name=target" json:"target,omitempty"` + // Allowing + // [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing), aka + // cross-domain traffic, would allow the backends served from this endpoint to + // receive and respond to HTTP OPTIONS requests. The response will be used by + // the browser to determine whether the subsequent cross-origin request is + // allowed to proceed. + AllowCors bool `protobuf:"varint,5,opt,name=allow_cors,json=allowCors" json:"allow_cors,omitempty"` +} + +func (m *Endpoint) Reset() { *m = Endpoint{} } +func (m *Endpoint) String() string { return proto.CompactTextString(m) } +func (*Endpoint) ProtoMessage() {} +func (*Endpoint) Descriptor() ([]byte, []int) { return fileDescriptor7, []int{0} } + +func (m *Endpoint) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Endpoint) GetAliases() []string { + if m != nil { + return m.Aliases + } + return nil +} + +func (m *Endpoint) GetApis() []string { + if m != nil { + return m.Apis + } + return nil +} + +func (m *Endpoint) GetFeatures() []string { + if m != nil { + return m.Features + } + return nil +} + +func (m *Endpoint) GetTarget() string { + if m != nil { + return m.Target + } + return "" +} + +func (m *Endpoint) GetAllowCors() bool { + if m != nil { + return m.AllowCors + } + return false +} + +func init() { + proto.RegisterType((*Endpoint)(nil), "google.api.Endpoint") +} + +func init() { proto.RegisterFile("google/api/endpoint.proto", fileDescriptor7) } + +var fileDescriptor7 = []byte{ + // 253 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x90, 0x41, 0x4b, 0xc4, 0x30, + 0x10, 0x85, 0xe9, 0x6e, 0x5d, 0xdb, 0x01, 0x3d, 0xe4, 0x20, 0x71, 0x51, 0x28, 0x9e, 0x7a, 0x6a, + 0x0f, 0x1e, 0x3d, 0xb9, 0xb2, 0x88, 0xb7, 0xd2, 0xa3, 0x17, 0x19, 0xeb, 0x6c, 0x08, 0x64, 0x33, + 0x21, 0x89, 0xfa, 0x73, 0x04, 0x7f, 0xa9, 0x34, 0xed, 0xaa, 0x7b, 0x9b, 0xef, 0xbd, 0x37, 0x61, + 0x5e, 0xe0, 0x52, 0x31, 0x2b, 0x43, 0x2d, 0x3a, 0xdd, 0x92, 0x7d, 0x73, 0xac, 0x6d, 0x6c, 0x9c, + 0xe7, 0xc8, 0x02, 0x26, 0xab, 0x41, 0xa7, 0xd7, 0x57, 0xff, 0x62, 0x68, 0x2d, 0x47, 0x8c, 0x9a, + 0x6d, 0x98, 0x92, 0x37, 0x5f, 0x19, 0x14, 0xdb, 0x79, 0x59, 0x08, 0xc8, 0x2d, 0xee, 0x49, 0x66, + 0x55, 0x56, 0x97, 0x7d, 0x9a, 0x85, 0x84, 0x53, 0x34, 0x1a, 0x03, 0x05, 0xb9, 0xa8, 0x96, 0x75, + 0xd9, 0x1f, 0x70, 0x4c, 0xa3, 0xd3, 0x41, 0x2e, 0x93, 0x9c, 0x66, 0xb1, 0x86, 0x62, 0x47, 0x18, + 0xdf, 0x3d, 0x05, 0x99, 0x27, 0xfd, 0x97, 0xc5, 0x05, 0xac, 0x22, 0x7a, 0x45, 0x51, 0x52, 0x7a, + 0x7f, 0x26, 0x71, 0x0d, 0x80, 0xc6, 0xf0, 0xe7, 0xcb, 0xc0, 0x3e, 0xc8, 0x93, 0x2a, 0xab, 0x8b, + 0xbe, 0x4c, 0xca, 0x03, 0xfb, 0xb0, 0x61, 0x38, 0x1f, 0x78, 0xdf, 0xfc, 0x35, 0xda, 0x9c, 0x1d, + 0x0e, 0xee, 0xc6, 0x0a, 0x5d, 0xf6, 0xbc, 0x9d, 0x4d, 0xc5, 0x06, 0xad, 0x6a, 0xd8, 0xab, 0x56, + 0x91, 0x4d, 0x05, 0xdb, 0xc9, 0x1a, 0x8f, 0x4b, 0x3f, 0x10, 0xc8, 0x7f, 0xe8, 0x81, 0x06, 0xb6, + 0x3b, 0xad, 0xee, 0x8e, 0xe8, 0x7b, 0x91, 0x3f, 0xde, 0x77, 0x4f, 0xaf, 0xab, 0xb4, 0x78, 0xfb, + 0x13, 0x00, 0x00, 0xff, 0xff, 0x34, 0x0e, 0xdd, 0x70, 0x60, 0x01, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/log.pb.go b/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/log.pb.go new file mode 100644 index 0000000000..09ed8bd83a --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/log.pb.go @@ -0,0 +1,98 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/api/log.proto + +package serviceconfig + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import google_api2 "google.golang.org/genproto/googleapis/api/label" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// A description of a log type. Example in YAML format: +// +// - name: library.googleapis.com/activity_history +// description: The history of borrowing and returning library items. +// display_name: Activity +// labels: +// - key: /customer_id +// description: Identifier of a library customer +type LogDescriptor struct { + // The name of the log. It must be less than 512 characters long and can + // include the following characters: upper- and lower-case alphanumeric + // characters [A-Za-z0-9], and punctuation characters including + // slash, underscore, hyphen, period [/_-.]. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The set of labels that are available to describe a specific log entry. + // Runtime requests that contain labels not specified here are + // considered invalid. + Labels []*google_api2.LabelDescriptor `protobuf:"bytes,2,rep,name=labels" json:"labels,omitempty"` + // A human-readable description of this log. This information appears in + // the documentation and can contain details. + Description string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` + // The human-readable name for this log. This information appears on + // the user interface and should be concise. + DisplayName string `protobuf:"bytes,4,opt,name=display_name,json=displayName" json:"display_name,omitempty"` +} + +func (m *LogDescriptor) Reset() { *m = LogDescriptor{} } +func (m *LogDescriptor) String() string { return proto.CompactTextString(m) } +func (*LogDescriptor) ProtoMessage() {} +func (*LogDescriptor) Descriptor() ([]byte, []int) { return fileDescriptor8, []int{0} } + +func (m *LogDescriptor) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *LogDescriptor) GetLabels() []*google_api2.LabelDescriptor { + if m != nil { + return m.Labels + } + return nil +} + +func (m *LogDescriptor) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *LogDescriptor) GetDisplayName() string { + if m != nil { + return m.DisplayName + } + return "" +} + +func init() { + proto.RegisterType((*LogDescriptor)(nil), "google.api.LogDescriptor") +} + +func init() { proto.RegisterFile("google/api/log.proto", fileDescriptor8) } + +var fileDescriptor8 = []byte{ + // 238 bytes of a gzipped FileDescriptorProto + 0x1f, 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9, 0xde, 0x9f, 0x07, 0x4e, 0x62, 0xc1, 0x91, 0x91, 0x40, + 0x15, 0xa1, 0x4b, 0x97, 0x55, 0x7d, 0x09, 0x3c, 0xc7, 0x74, 0x74, 0xc4, 0xf0, 0xcd, 0x2d, 0xb6, + 0xe2, 0x3e, 0x99, 0x1e, 0x8e, 0x7e, 0x7f, 0x93, 0xfc, 0xe5, 0xb1, 0x79, 0xdd, 0xcc, 0x52, 0xe3, + 0xf2, 0x3f, 0x00, 0x00, 0xff, 0xff, 0x25, 0x6c, 0x32, 0xff, 0x4e, 0x01, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/logging.pb.go b/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/logging.pb.go new file mode 100644 index 0000000000..b62778aebf --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/logging.pb.go @@ -0,0 +1,135 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/api/logging.proto + +package serviceconfig + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Logging configuration of the service. +// +// The following example shows how to configure logs to be sent to the +// producer and consumer projects. In the example, the `activity_history` +// log is sent to both the producer and consumer projects, whereas the +// `purchase_history` log is only sent to the producer project. +// +// monitored_resources: +// - type: library.googleapis.com/branch +// labels: +// - key: /city +// description: The city where the library branch is located in. +// - key: /name +// description: The name of the branch. +// logs: +// - name: activity_history +// labels: +// - key: /customer_id +// - name: purchase_history +// logging: +// producer_destinations: +// - monitored_resource: library.googleapis.com/branch +// logs: +// - activity_history +// - purchase_history +// consumer_destinations: +// - monitored_resource: library.googleapis.com/branch +// logs: +// - activity_history +type Logging struct { + // Logging configurations for sending logs to the producer project. + // There can be multiple producer destinations, each one must have a + // different monitored resource type. A log can be used in at most + // one producer destination. + ProducerDestinations []*Logging_LoggingDestination `protobuf:"bytes,1,rep,name=producer_destinations,json=producerDestinations" json:"producer_destinations,omitempty"` + // Logging configurations for sending logs to the consumer project. + // There can be multiple consumer destinations, each one must have a + // different monitored resource type. A log can be used in at most + // one consumer destination. + ConsumerDestinations []*Logging_LoggingDestination `protobuf:"bytes,2,rep,name=consumer_destinations,json=consumerDestinations" json:"consumer_destinations,omitempty"` +} + +func (m *Logging) Reset() { *m = Logging{} } +func (m *Logging) String() string { return proto.CompactTextString(m) } +func (*Logging) ProtoMessage() {} +func (*Logging) Descriptor() ([]byte, []int) { return fileDescriptor9, []int{0} } + +func (m *Logging) GetProducerDestinations() []*Logging_LoggingDestination { + if m != nil { + return m.ProducerDestinations + } + return nil +} + +func (m *Logging) GetConsumerDestinations() []*Logging_LoggingDestination { + if m != nil { + return m.ConsumerDestinations + } + return nil +} + +// Configuration of a specific logging destination (the producer project +// or the consumer project). +type Logging_LoggingDestination struct { + // The monitored resource type. The type must be defined in the + // [Service.monitored_resources][google.api.Service.monitored_resources] section. + MonitoredResource string `protobuf:"bytes,3,opt,name=monitored_resource,json=monitoredResource" json:"monitored_resource,omitempty"` + // Names of the logs to be sent to this destination. Each name must + // be defined in the [Service.logs][google.api.Service.logs] section. If the log name is + // not a domain scoped name, it will be automatically prefixed with + // the service name followed by "/". + Logs []string `protobuf:"bytes,1,rep,name=logs" json:"logs,omitempty"` +} + +func (m *Logging_LoggingDestination) Reset() { *m = Logging_LoggingDestination{} } +func (m *Logging_LoggingDestination) String() string { return proto.CompactTextString(m) } +func (*Logging_LoggingDestination) ProtoMessage() {} +func (*Logging_LoggingDestination) Descriptor() ([]byte, []int) { return fileDescriptor9, []int{0, 0} } + +func (m *Logging_LoggingDestination) GetMonitoredResource() string { + if m != nil { + return m.MonitoredResource + } + return "" +} + +func (m *Logging_LoggingDestination) GetLogs() []string { + if m != nil { + return m.Logs + } + return nil +} + +func init() { + proto.RegisterType((*Logging)(nil), "google.api.Logging") + proto.RegisterType((*Logging_LoggingDestination)(nil), "google.api.Logging.LoggingDestination") +} + +func init() { proto.RegisterFile("google/api/logging.proto", fileDescriptor9) } + +var fileDescriptor9 = []byte{ + // 270 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x90, 0x4f, 0x4b, 0xc4, 0x30, + 0x10, 0xc5, 0x69, 0x77, 0x51, 0x36, 0x8a, 0x60, 0x50, 0x28, 0x8b, 0x87, 0xc5, 0x83, 0xec, 0xc5, + 0x14, 0xf4, 0xe8, 0xc9, 0x45, 0x11, 0xc1, 0x43, 0xe9, 0x45, 0xd0, 0xc3, 0x12, 0xd3, 0x38, 0x04, + 0xda, 0x99, 0x90, 0xa4, 0x7e, 0x1a, 0x4f, 0x7e, 0x52, 0xd9, 0xa6, 0x75, 0xab, 0x9e, 0xf6, 0x94, + 0x3f, 0xef, 0xbd, 0x5f, 0x32, 0x8f, 0x65, 0x40, 0x04, 0xb5, 0xce, 0xa5, 0x35, 0x79, 0x4d, 0x00, + 0x06, 0x41, 0x58, 0x47, 0x81, 0x38, 0x8b, 0x8a, 0x90, 0xd6, 0xcc, 0xcf, 0x46, 0x2e, 0x89, 0x48, + 0x41, 0x06, 0x43, 0xe8, 0xa3, 0xf3, 0xfc, 0x33, 0x65, 0xfb, 0x4f, 0x31, 0xcb, 0x5f, 0xd9, 0xa9, + 0x75, 0x54, 0xb5, 0x4a, 0xbb, 0x75, 0xa5, 0x7d, 0x30, 0x18, 0xad, 0x59, 0xb2, 0x98, 0x2c, 0x0f, + 0xae, 0x2e, 0xc4, 0x96, 0x2a, 0xfa, 0xcc, 0xb0, 0xde, 0x6d, 0xed, 0xe5, 0xc9, 0x00, 0x19, 0x5d, + 0xfa, 0x0d, 0x5c, 0x11, 0xfa, 0xb6, 0xf9, 0x0b, 0x4f, 0x77, 0x83, 0x0f, 0x90, 0x31, 0x7c, 0xfe, + 0xcc, 0xf8, 0x7f, 0x2f, 0xbf, 0x64, 0xbc, 0x21, 0x34, 0x81, 0x9c, 0xae, 0xd6, 0x4e, 0x7b, 0x6a, + 0x9d, 0xd2, 0xd9, 0x64, 0x91, 0x2c, 0x67, 0xe5, 0xf1, 0x8f, 0x52, 0xf6, 0x02, 0xe7, 0x6c, 0x5a, + 0x13, 0xc4, 0x69, 0x67, 0x65, 0xb7, 0x5f, 0x21, 0x3b, 0x52, 0xd4, 0x8c, 0xfe, 0xb6, 0x3a, 0xec, + 0x1f, 0x2a, 0x36, 0xf5, 0x15, 0xc9, 0xcb, 0x7d, 0xaf, 0x01, 0xd5, 0x12, 0x41, 0x90, 0x83, 0x1c, + 0x34, 0x76, 0xe5, 0xe6, 0x51, 0x92, 0xd6, 0xf8, 0xae, 0x7d, 0xaf, 0xdd, 0x87, 0x51, 0x5a, 0x11, + 0xbe, 0x1b, 0xb8, 0xf9, 0x75, 0xfa, 0x4a, 0xa7, 0x0f, 0xb7, 0xc5, 0xe3, 0xdb, 0x5e, 0x17, 0xbc, + 0xfe, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x73, 0x4f, 0x86, 0x6e, 0xdb, 0x01, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/monitoring.pb.go b/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/monitoring.pb.go new file mode 100644 index 0000000000..3ebb6e1413 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/monitoring.pb.go @@ -0,0 +1,143 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/api/monitoring.proto + +package serviceconfig + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Monitoring configuration of the service. +// +// The example below shows how to configure monitored resources and metrics +// for monitoring. In the example, a monitored resource and two metrics are +// defined. The `library.googleapis.com/book/returned_count` metric is sent +// to both producer and consumer projects, whereas the +// `library.googleapis.com/book/overdue_count` metric is only sent to the +// consumer project. +// +// monitored_resources: +// - type: library.googleapis.com/branch +// labels: +// - key: /city +// description: The city where the library branch is located in. +// - key: /name +// description: The name of the branch. +// metrics: +// - name: library.googleapis.com/book/returned_count +// metric_kind: DELTA +// value_type: INT64 +// labels: +// - key: /customer_id +// - name: library.googleapis.com/book/overdue_count +// metric_kind: GAUGE +// value_type: INT64 +// labels: +// - key: /customer_id +// monitoring: +// producer_destinations: +// - monitored_resource: library.googleapis.com/branch +// metrics: +// - library.googleapis.com/book/returned_count +// consumer_destinations: +// - monitored_resource: library.googleapis.com/branch +// metrics: +// - library.googleapis.com/book/returned_count +// - library.googleapis.com/book/overdue_count +type Monitoring struct { + // Monitoring configurations for sending metrics to the producer project. + // There can be multiple producer destinations, each one must have a + // different monitored resource type. A metric can be used in at most + // one producer destination. + ProducerDestinations []*Monitoring_MonitoringDestination `protobuf:"bytes,1,rep,name=producer_destinations,json=producerDestinations" json:"producer_destinations,omitempty"` + // Monitoring configurations for sending metrics to the consumer project. + // There can be multiple consumer destinations, each one must have a + // different monitored resource type. A metric can be used in at most + // one consumer destination. + ConsumerDestinations []*Monitoring_MonitoringDestination `protobuf:"bytes,2,rep,name=consumer_destinations,json=consumerDestinations" json:"consumer_destinations,omitempty"` +} + +func (m *Monitoring) Reset() { *m = Monitoring{} } +func (m *Monitoring) String() string { return proto.CompactTextString(m) } +func (*Monitoring) ProtoMessage() {} +func (*Monitoring) Descriptor() ([]byte, []int) { return fileDescriptor10, []int{0} } + +func (m *Monitoring) GetProducerDestinations() []*Monitoring_MonitoringDestination { + if m != nil { + return m.ProducerDestinations + } + return nil +} + +func (m *Monitoring) GetConsumerDestinations() []*Monitoring_MonitoringDestination { + if m != nil { + return m.ConsumerDestinations + } + return nil +} + +// Configuration of a specific monitoring destination (the producer project +// or the consumer project). +type Monitoring_MonitoringDestination struct { + // The monitored resource type. The type must be defined in + // [Service.monitored_resources][google.api.Service.monitored_resources] section. + MonitoredResource string `protobuf:"bytes,1,opt,name=monitored_resource,json=monitoredResource" json:"monitored_resource,omitempty"` + // Names of the metrics to report to this monitoring destination. + // Each name must be defined in [Service.metrics][google.api.Service.metrics] section. + Metrics []string `protobuf:"bytes,2,rep,name=metrics" json:"metrics,omitempty"` +} + +func (m *Monitoring_MonitoringDestination) Reset() { *m = Monitoring_MonitoringDestination{} } +func (m *Monitoring_MonitoringDestination) String() string { return proto.CompactTextString(m) } +func (*Monitoring_MonitoringDestination) ProtoMessage() {} +func (*Monitoring_MonitoringDestination) Descriptor() ([]byte, []int) { + return fileDescriptor10, []int{0, 0} +} + +func (m *Monitoring_MonitoringDestination) GetMonitoredResource() string { + if m != nil { + return m.MonitoredResource + } + return "" +} + +func (m *Monitoring_MonitoringDestination) GetMetrics() []string { + if m != nil { + return m.Metrics + } + return nil +} + +func init() { + proto.RegisterType((*Monitoring)(nil), "google.api.Monitoring") + proto.RegisterType((*Monitoring_MonitoringDestination)(nil), "google.api.Monitoring.MonitoringDestination") +} + +func init() { proto.RegisterFile("google/api/monitoring.proto", fileDescriptor10) } + +var fileDescriptor10 = []byte{ + // 271 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x51, 0xcd, 0x4a, 0xc4, 0x30, + 0x10, 0xa6, 0x55, 0x94, 0x8d, 0xa0, 0x58, 0x5c, 0x28, 0xab, 0x87, 0xc5, 0xd3, 0x1e, 0xb4, 0x05, + 0x3d, 0x7a, 0x72, 0x51, 0xc4, 0x83, 0x50, 0x7a, 0xf4, 0xb2, 0xc6, 0x74, 0x0c, 0x03, 0xdb, 0x99, + 0x9a, 0xa4, 0x3e, 0x90, 0xcf, 0xe0, 0x03, 0xca, 0x36, 0xed, 0x36, 0x8a, 0x27, 0x6f, 0x99, 0x7c, + 0x7f, 0xc3, 0x37, 0xe2, 0x54, 0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, 0x3c, 0xbe, 0xee, 0x75, 0xc2, + 0xeb, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x51, 0x35, 0xf3, 0xe2, 0xf9, 0x01, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/quota.pb.go b/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/quota.pb.go new file mode 100644 index 0000000000..ac5ab09753 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/quota.pb.go @@ -0,0 +1,391 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/api/quota.proto + +package serviceconfig + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Quota configuration helps to achieve fairness and budgeting in service +// usage. +// +// The quota configuration works this way: +// - The service configuration defines a set of metrics. +// - For API calls, the quota.metric_rules maps methods to metrics with +// corresponding costs. +// - The quota.limits defines limits on the metrics, which will be used for +// quota checks at runtime. +// +// An example quota configuration in yaml format: +// +// quota: +// limits: +// +// - name: apiWriteQpsPerProject +// metric: library.googleapis.com/write_calls +// unit: "1/min/{project}" # rate limit for consumer projects +// values: +// STANDARD: 10000 +// +// # The metric rules bind all methods to the read_calls metric, +// # except for the UpdateBook and DeleteBook methods. These two methods +// # are mapped to the write_calls metric, with the UpdateBook method +// # consuming at twice rate as the DeleteBook method. +// metric_rules: +// - selector: "*" +// metric_costs: +// library.googleapis.com/read_calls: 1 +// - selector: google.example.library.v1.LibraryService.UpdateBook +// metric_costs: +// library.googleapis.com/write_calls: 2 +// - selector: google.example.library.v1.LibraryService.DeleteBook +// metric_costs: +// library.googleapis.com/write_calls: 1 +// +// Corresponding Metric definition: +// +// metrics: +// - name: library.googleapis.com/read_calls +// display_name: Read requests +// metric_kind: DELTA +// value_type: INT64 +// +// - name: library.googleapis.com/write_calls +// display_name: Write requests +// metric_kind: DELTA +// value_type: INT64 +// +type Quota struct { + // List of `QuotaLimit` definitions for the service. + // + // Used by metric-based quotas only. + Limits []*QuotaLimit `protobuf:"bytes,3,rep,name=limits" json:"limits,omitempty"` + // List of `MetricRule` definitions, each one mapping a selected method to one + // or more metrics. + // + // Used by metric-based quotas only. + MetricRules []*MetricRule `protobuf:"bytes,4,rep,name=metric_rules,json=metricRules" json:"metric_rules,omitempty"` +} + +func (m *Quota) Reset() { *m = Quota{} } +func (m *Quota) String() string { return proto.CompactTextString(m) } +func (*Quota) ProtoMessage() {} +func (*Quota) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{0} } + +func (m *Quota) GetLimits() []*QuotaLimit { + if m != nil { + return m.Limits + } + return nil +} + +func (m *Quota) GetMetricRules() []*MetricRule { + if m != nil { + return m.MetricRules + } + return nil +} + +// Bind API methods to metrics. Binding a method to a metric causes that +// metric's configured quota, billing, and monitoring behaviors to apply to the +// method call. +// +// Used by metric-based quotas only. +type MetricRule struct { + // Selects the methods to which this rule applies. + // + // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + Selector string `protobuf:"bytes,1,opt,name=selector" json:"selector,omitempty"` + // Metrics to update when the selected methods are called, and the associated + // cost applied to each metric. + // + // The key of the map is the metric name, and the values are the amount + // increased for the metric against which the quota limits are defined. + // The value must not be negative. + MetricCosts map[string]int64 `protobuf:"bytes,2,rep,name=metric_costs,json=metricCosts" json:"metric_costs,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` +} + +func (m *MetricRule) Reset() { *m = MetricRule{} } +func (m *MetricRule) String() string { return proto.CompactTextString(m) } +func (*MetricRule) ProtoMessage() {} +func (*MetricRule) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{1} } + +func (m *MetricRule) GetSelector() string { + if m != nil { + return m.Selector + } + return "" +} + +func (m *MetricRule) GetMetricCosts() map[string]int64 { + if m != nil { + return m.MetricCosts + } + return nil +} + +// `QuotaLimit` defines a specific limit that applies over a specified duration +// for a limit type. There can be at most one limit for a duration and limit +// type combination defined within a `QuotaGroup`. +type QuotaLimit struct { + // Name of the quota limit. The name is used to refer to the limit when + // overriding the default limit on per-consumer basis. + // + // For group-based quota limits, the name must be unique within the quota + // group. If a name is not provided, it will be generated from the limit_by + // and duration fields. + // + // For metric-based quota limits, the name must be provided, and it must be + // unique within the service. The name can only include alphanumeric + // characters as well as '-'. + // + // The maximum length of the limit name is 64 characters. + // + // The name of a limit is used as a unique identifier for this limit. + // Therefore, once a limit has been put into use, its name should be + // immutable. You can use the display_name field to provide a user-friendly + // name for the limit. The display name can be evolved over time without + // affecting the identity of the limit. + Name string `protobuf:"bytes,6,opt,name=name" json:"name,omitempty"` + // Optional. User-visible, extended description for this quota limit. + // Should be used only when more context is needed to understand this limit + // than provided by the limit's display name (see: `display_name`). + Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` + // Default number of tokens that can be consumed during the specified + // duration. This is the number of tokens assigned when a client + // application developer activates the service for his/her project. + // + // Specifying a value of 0 will block all requests. This can be used if you + // are provisioning quota to selected consumers and blocking others. + // Similarly, a value of -1 will indicate an unlimited quota. No other + // negative values are allowed. + // + // Used by group-based quotas only. + DefaultLimit int64 `protobuf:"varint,3,opt,name=default_limit,json=defaultLimit" json:"default_limit,omitempty"` + // Maximum number of tokens that can be consumed during the specified + // duration. Client application developers can override the default limit up + // to this maximum. If specified, this value cannot be set to a value less + // than the default limit. If not specified, it is set to the default limit. + // + // To allow clients to apply overrides with no upper bound, set this to -1, + // indicating unlimited maximum quota. + // + // Used by group-based quotas only. + MaxLimit int64 `protobuf:"varint,4,opt,name=max_limit,json=maxLimit" json:"max_limit,omitempty"` + // Free tier value displayed in the Developers Console for this limit. + // The free tier is the number of tokens that will be subtracted from the + // billed amount when billing is enabled. + // This field can only be set on a limit with duration "1d", in a billable + // group; it is invalid on any other limit. If this field is not set, it + // defaults to 0, indicating that there is no free tier for this service. + // + // Used by group-based quotas only. + FreeTier int64 `protobuf:"varint,7,opt,name=free_tier,json=freeTier" json:"free_tier,omitempty"` + // Duration of this limit in textual notation. Example: "100s", "24h", "1d". + // For duration longer than a day, only multiple of days is supported. We + // support only "100s" and "1d" for now. Additional support will be added in + // the future. "0" indicates indefinite duration. + // + // Used by group-based quotas only. + Duration string `protobuf:"bytes,5,opt,name=duration" json:"duration,omitempty"` + // The name of the metric this quota limit applies to. The quota limits with + // the same metric will be checked together during runtime. The metric must be + // defined within the service config. + // + // Used by metric-based quotas only. + Metric string `protobuf:"bytes,8,opt,name=metric" json:"metric,omitempty"` + // Specify the unit of the quota limit. It uses the same syntax as + // [Metric.unit][]. The supported unit kinds are determined by the quota + // backend system. + // + // The [Google Service Control](https://cloud.google.com/service-control) + // supports the following unit components: + // * One of the time intevals: + // * "/min" for quota every minute. + // * "/d" for quota every 24 hours, starting 00:00 US Pacific Time. + // * Otherwise the quota won't be reset by time, such as storage limit. + // * One and only one of the granted containers: + // * "/{organization}" quota for an organization. + // * "/{project}" quota for a project. + // * "/{folder}" quota for a folder. + // * "/{resource}" quota for a universal resource. + // * Zero or more quota segmentation dimension. Not all combos are valid. + // * "/{region}" quota for every region. Not to be used with time intervals. + // * Otherwise the resources granted on the target is not segmented. + // * "/{zone}" quota for every zone. Not to be used with time intervals. + // * Otherwise the resources granted on the target is not segmented. + // * "/{resource}" quota for a resource associated with a project or org. + // + // Here are some examples: + // * "1/min/{project}" for quota per minute per project. + // * "1/min/{user}" for quota per minute per user. + // * "1/min/{organization}" for quota per minute per organization. + // + // Note: the order of unit components is insignificant. + // The "1" at the beginning is required to follow the metric unit syntax. + // + // Used by metric-based quotas only. + Unit string `protobuf:"bytes,9,opt,name=unit" json:"unit,omitempty"` + // Tiered limit values. Also allows for regional or zone overrides for these + // values if "/{region}" or "/{zone}" is specified in the unit field. + // + // Currently supported tiers from low to high: + // VERY_LOW, LOW, STANDARD, HIGH, VERY_HIGH + // + // To apply different limit values for users according to their tiers, specify + // the values for the tiers you want to differentiate. For example: + // {LOW:100, STANDARD:500, HIGH:1000, VERY_HIGH:5000} + // + // The limit value for each tier is optional except for the tier STANDARD. + // The limit value for an unspecified tier falls to the value of its next + // tier towards tier STANDARD. For the above example, the limit value for tier + // STANDARD is 500. + // + // To apply the same limit value for all users, just specify limit value for + // tier STANDARD. For example: {STANDARD:500}. + // + // To apply a regional overide for a tier, add a map entry with key + // "/", where is a region name. Similarly, for a zone + // override, add a map entry with key "/{zone}". + // Further, a wildcard can be used at the end of a zone name in order to + // specify zone level overrides. For example: + // LOW: 10, STANDARD: 50, HIGH: 100, + // LOW/us-central1: 20, STANDARD/us-central1: 60, HIGH/us-central1: 200, + // LOW/us-central1-*: 10, STANDARD/us-central1-*: 20, HIGH/us-central1-*: 80 + // + // The regional overrides tier set for each region must be the same as + // the tier set for default limit values. Same rule applies for zone overrides + // tier as well. + // + // Used by metric-based quotas only. + Values map[string]int64 `protobuf:"bytes,10,rep,name=values" json:"values,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` + // User-visible display name for this limit. + // Optional. If not set, the UI will provide a default display name based on + // the quota configuration. This field can be used to override the default + // display name generated from the configuration. + DisplayName string `protobuf:"bytes,12,opt,name=display_name,json=displayName" json:"display_name,omitempty"` +} + +func (m *QuotaLimit) Reset() { *m = QuotaLimit{} } +func (m *QuotaLimit) String() string { return proto.CompactTextString(m) } +func (*QuotaLimit) ProtoMessage() {} +func (*QuotaLimit) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{2} } + +func (m *QuotaLimit) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *QuotaLimit) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *QuotaLimit) GetDefaultLimit() int64 { + if m != nil { + return m.DefaultLimit + } + return 0 +} + +func (m *QuotaLimit) GetMaxLimit() int64 { + if m != nil { + return m.MaxLimit + } + return 0 +} + +func (m *QuotaLimit) GetFreeTier() int64 { + if m != nil { + return m.FreeTier + } + return 0 +} + +func (m *QuotaLimit) GetDuration() string { + if m != nil { + return m.Duration + } + return "" +} + +func (m *QuotaLimit) GetMetric() string { + if m != nil { + return m.Metric + } + return "" +} + +func (m *QuotaLimit) GetUnit() string { + if m != nil { + return m.Unit + } + return "" +} + +func (m *QuotaLimit) GetValues() map[string]int64 { + if m != nil { + return m.Values + } + return nil +} + +func (m *QuotaLimit) GetDisplayName() string { + if m != nil { + return m.DisplayName + } + return "" +} + +func init() { + proto.RegisterType((*Quota)(nil), "google.api.Quota") + proto.RegisterType((*MetricRule)(nil), "google.api.MetricRule") + proto.RegisterType((*QuotaLimit)(nil), "google.api.QuotaLimit") +} + +func init() { proto.RegisterFile("google/api/quota.proto", fileDescriptor11) } + +var fileDescriptor11 = []byte{ + // 466 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0xc1, 0x8e, 0xd3, 0x30, + 0x10, 0x55, 0x9a, 0xb6, 0xb4, 0xd3, 0x82, 0x56, 0x16, 0xaa, 0xac, 0xc2, 0xa1, 0x94, 0x03, 0x3d, + 0xa5, 0x12, 0x5c, 0xd8, 0x45, 0x42, 0x62, 0xd1, 0x0a, 0x81, 0x00, 0x95, 0x08, 0x71, 0xe0, 0x52, + 0x99, 0x74, 0x1a, 0x59, 0x38, 0x71, 0xb0, 0x9d, 0xd5, 0xf6, 0xcc, 0x9f, 0xf0, 0x0d, 0x7c, 0x20, + 0xf2, 0xd8, 0xdb, 0x16, 0xd8, 0xcb, 0xde, 0x66, 0xe6, 0xbd, 0xe7, 0x17, 0x3f, 0x4f, 0x60, 0x52, + 0x6a, 0x5d, 0x2a, 0x5c, 0x8a, 0x46, 0x2e, 0x7f, 0xb4, 0xda, 0x89, 0xac, 0x31, 0xda, 0x69, 0x06, + 0x61, 0x9e, 0x89, 0x46, 0x4e, 0x1f, 0x1e, 0x71, 0x44, 0x5d, 0x6b, 0x27, 0x9c, 0xd4,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71, 0x15, 0x09, 0x5d, 0x22, 0x0c, 0x2a, 0x71, 0xb5, 0x07, 0xb7, + 0x06, 0x71, 0xed, 0x24, 0x1a, 0x7e, 0x27, 0x80, 0x7e, 0xf0, 0x59, 0xa2, 0xf1, 0x59, 0x6e, 0x5a, + 0x43, 0x2f, 0xcc, 0x7b, 0x21, 0xcb, 0xeb, 0x9e, 0x4d, 0xa0, 0x1f, 0xe2, 0xe0, 0x03, 0x42, 0x62, + 0xe7, 0x2f, 0xd2, 0xd6, 0xd2, 0xf1, 0x61, 0xb8, 0x88, 0xaf, 0xd9, 0x19, 0xf4, 0xe9, 0xe2, 0x96, + 0x03, 0x25, 0x3e, 0xbf, 0x79, 0x1b, 0xb2, 0x2f, 0x44, 0x0a, 0x61, 0x47, 0x05, 0x7b, 0x04, 0xe3, + 0x8d, 0xb4, 0x8d, 0x12, 0xbb, 0x35, 0x05, 0x34, 0x8e, 0x29, 0x84, 0xd9, 0x47, 0x51, 0xe1, 0xf4, + 0x14, 0x46, 0x47, 0xca, 0xdb, 0xbc, 0xc2, 0xb9, 0x82, 0x7b, 0x85, 0xae, 0x8e, 0x3e, 0xe7, 0x3c, + 0x3c, 0xca, 0xca, 0xaf, 0xf3, 0x2a, 0xf9, 0x7a, 0x11, 0x91, 0x52, 0x2b, 0x51, 0x97, 0x99, 0x36, + 0xe5, 0xb2, 0xc4, 0x9a, 0x96, 0x7d, 0x19, 0x20, 0xd1, 0x48, 0x4b, 0x7f, 0x83, 0x45, 0x73, 0x29, + 0x0b, 0x2c, 0x74, 0xbd, 0x95, 0xe5, 0x8b, 0xbf, 0xba, 0x5f, 0x9d, 0xee, 0x9b, 0x57, 0xab, 0xb7, + 0xdf, 0xfa, 0x24, 0x7c, 0xf6, 0x27, 0x00, 0x00, 0xff, 0xff, 0x90, 0x7e, 0xf5, 0xab, 0x69, 0x03, + 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/service.pb.go b/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/service.pb.go new file mode 100644 index 0000000000..cad0545a0d --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/service.pb.go @@ -0,0 +1,376 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/api/service.proto + +package serviceconfig + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_api5 "google.golang.org/genproto/googleapis/api" +import google_api "google.golang.org/genproto/googleapis/api/annotations" +import _ "google.golang.org/genproto/googleapis/api/label" +import google_api3 "google.golang.org/genproto/googleapis/api/metric" +import google_api6 "google.golang.org/genproto/googleapis/api/monitoredres" +import _ "github.com/golang/protobuf/ptypes/any" +import google_protobuf4 "google.golang.org/genproto/protobuf/api" +import google_protobuf3 "google.golang.org/genproto/protobuf/ptype" +import google_protobuf5 "github.com/golang/protobuf/ptypes/wrappers" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// `Service` is the root object of Google service configuration schema. It +// describes basic information about a service, such as the name and the +// title, and delegates other aspects to sub-sections. Each sub-section is +// either a proto message or a repeated proto message that configures a +// specific aspect, such as auth. See each proto message definition for details. +// +// Example: +// +// type: google.api.Service +// config_version: 3 +// name: calendar.googleapis.com +// title: Google Calendar API +// apis: +// - name: google.calendar.v3.Calendar +// authentication: +// providers: +// - id: google_calendar_auth +// jwks_uri: https://www.googleapis.com/oauth2/v1/certs +// issuer: https://securetoken.google.com +// rules: +// - selector: "*" +// requirements: +// provider_id: google_calendar_auth +type Service struct { + // The semantic version of the service configuration. The config version + // affects the interpretation of the service configuration. For example, + // certain features are enabled by default for certain config versions. + // The latest config version is `3`. + ConfigVersion *google_protobuf5.UInt32Value `protobuf:"bytes,20,opt,name=config_version,json=configVersion" json:"config_version,omitempty"` + // The DNS address at which this service is available, + // e.g. `calendar.googleapis.com`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // A unique ID for a specific instance of this message, typically assigned + // by the client for tracking purpose. If empty, the server may choose to + // generate one instead. + Id string `protobuf:"bytes,33,opt,name=id" json:"id,omitempty"` + // The product title for this service. + Title string `protobuf:"bytes,2,opt,name=title" json:"title,omitempty"` + // The Google project that owns this service. + ProducerProjectId string `protobuf:"bytes,22,opt,name=producer_project_id,json=producerProjectId" json:"producer_project_id,omitempty"` + // A list of API interfaces exported by this service. Only the `name` field + // of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by the configuration + // author, as the remaining fields will be derived from the IDL during the + // normalization process. It is an error to specify an API interface here + // which cannot be resolved against the associated IDL files. + Apis []*google_protobuf4.Api `protobuf:"bytes,3,rep,name=apis" json:"apis,omitempty"` + // A list of all proto message types included in this API service. + // Types referenced directly or indirectly by the `apis` are + // automatically included. Messages which are not referenced but + // shall be included, such as types used by the `google.protobuf.Any` type, + // should be listed here by name. Example: + // + // types: + // - name: google.protobuf.Int32 + Types []*google_protobuf3.Type `protobuf:"bytes,4,rep,name=types" json:"types,omitempty"` + // A list of all enum types included in this API service. Enums + // referenced directly or indirectly by the `apis` are automatically + // included. Enums which are not referenced but shall be included + // should be listed here by name. Example: + // + // enums: + // - name: google.someapi.v1.SomeEnum + Enums []*google_protobuf3.Enum `protobuf:"bytes,5,rep,name=enums" json:"enums,omitempty"` + // Additional API documentation. + Documentation *Documentation `protobuf:"bytes,6,opt,name=documentation" json:"documentation,omitempty"` + // API backend configuration. + Backend *Backend `protobuf:"bytes,8,opt,name=backend" json:"backend,omitempty"` + // HTTP configuration. + Http *google_api.Http `protobuf:"bytes,9,opt,name=http" json:"http,omitempty"` + // Quota configuration. + Quota *Quota `protobuf:"bytes,10,opt,name=quota" json:"quota,omitempty"` + // Auth configuration. + Authentication *Authentication `protobuf:"bytes,11,opt,name=authentication" json:"authentication,omitempty"` + // Context configuration. + Context *Context `protobuf:"bytes,12,opt,name=context" json:"context,omitempty"` + // Configuration controlling usage of this service. + Usage *Usage `protobuf:"bytes,15,opt,name=usage" json:"usage,omitempty"` + // Configuration for network endpoints. If this is empty, then an endpoint + // with the same name as the service is automatically generated to service all + // defined APIs. + Endpoints []*Endpoint `protobuf:"bytes,18,rep,name=endpoints" json:"endpoints,omitempty"` + // Configuration for the service control plane. + Control *Control `protobuf:"bytes,21,opt,name=control" json:"control,omitempty"` + // Defines the logs used by this service. + Logs []*LogDescriptor `protobuf:"bytes,23,rep,name=logs" json:"logs,omitempty"` + // Defines the metrics used by this service. + Metrics []*google_api3.MetricDescriptor `protobuf:"bytes,24,rep,name=metrics" json:"metrics,omitempty"` + // Defines the monitored resources used by this service. This is required + // by the [Service.monitoring][google.api.Service.monitoring] and [Service.logging][google.api.Service.logging] configurations. + MonitoredResources []*google_api6.MonitoredResourceDescriptor `protobuf:"bytes,25,rep,name=monitored_resources,json=monitoredResources" json:"monitored_resources,omitempty"` + // Billing configuration. + Billing *Billing `protobuf:"bytes,26,opt,name=billing" json:"billing,omitempty"` + // Logging configuration. + Logging *Logging `protobuf:"bytes,27,opt,name=logging" json:"logging,omitempty"` + // Monitoring configuration. + Monitoring *Monitoring `protobuf:"bytes,28,opt,name=monitoring" json:"monitoring,omitempty"` + // System parameter configuration. + SystemParameters *SystemParameters `protobuf:"bytes,29,opt,name=system_parameters,json=systemParameters" json:"system_parameters,omitempty"` + // Output only. The source information for this configuration if available. + SourceInfo *SourceInfo `protobuf:"bytes,37,opt,name=source_info,json=sourceInfo" json:"source_info,omitempty"` + // Experimental configuration. + Experimental *google_api5.Experimental `protobuf:"bytes,101,opt,name=experimental" json:"experimental,omitempty"` +} + +func (m *Service) Reset() { *m = Service{} } +func (m *Service) String() string { return proto.CompactTextString(m) } +func (*Service) ProtoMessage() {} +func (*Service) Descriptor() ([]byte, []int) { return fileDescriptor12, []int{0} } + +func (m *Service) GetConfigVersion() *google_protobuf5.UInt32Value { + if m != nil { + return m.ConfigVersion + } + return nil +} + +func (m *Service) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Service) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *Service) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *Service) GetProducerProjectId() string { + if m != nil { + return m.ProducerProjectId + } + return "" +} + +func (m *Service) GetApis() []*google_protobuf4.Api { + if m != nil { + return m.Apis + } + return nil +} + +func (m *Service) GetTypes() []*google_protobuf3.Type { + if m != nil { + return m.Types + } + return nil +} + +func (m *Service) GetEnums() []*google_protobuf3.Enum { + if m != nil { + return m.Enums + } + return nil +} + +func (m *Service) GetDocumentation() *Documentation { + if m != nil { + return m.Documentation + } + return nil +} + +func (m *Service) GetBackend() *Backend { + if m != nil { + return m.Backend + } + return nil +} + +func (m *Service) GetHttp() *google_api.Http { + if m != nil { + return m.Http + } + return nil +} + +func (m *Service) GetQuota() *Quota { + if m != nil { + return m.Quota + } + return nil +} + +func (m *Service) GetAuthentication() *Authentication { + if m != nil { + return m.Authentication + } + return nil +} + +func (m *Service) GetContext() *Context { + if m != nil { + return m.Context + } + return nil +} + +func (m *Service) GetUsage() *Usage { + if m != nil { + return m.Usage + } + return nil +} + +func (m *Service) GetEndpoints() []*Endpoint { + if m != nil { + return m.Endpoints + } + return nil +} + +func (m *Service) GetControl() *Control { + if m != nil { + return m.Control + } + return nil +} + +func (m *Service) GetLogs() []*LogDescriptor { + if m != nil { + return m.Logs + } + return nil +} + +func (m *Service) GetMetrics() []*google_api3.MetricDescriptor { + if m != nil { + return m.Metrics + } + return nil +} + +func (m *Service) GetMonitoredResources() []*google_api6.MonitoredResourceDescriptor { + if m != nil { + return m.MonitoredResources + } + return nil +} + +func (m *Service) GetBilling() *Billing { + if m != nil { + return m.Billing + } + return nil +} + +func (m *Service) GetLogging() *Logging { + if m != nil { + return m.Logging + } + return nil +} + +func (m *Service) GetMonitoring() *Monitoring { + if m != nil { + return m.Monitoring + } + return nil +} + +func (m *Service) GetSystemParameters() *SystemParameters { + if m != nil { + return m.SystemParameters + } + return nil +} + +func (m *Service) GetSourceInfo() *SourceInfo { + if m != nil { + return m.SourceInfo + } + return nil +} + +func (m *Service) GetExperimental() *google_api5.Experimental { + if m != nil { + return m.Experimental + } + return nil +} + +func init() { + proto.RegisterType((*Service)(nil), "google.api.Service") +} + +func init() { proto.RegisterFile("google/api/service.proto", fileDescriptor12) } + +var fileDescriptor12 = []byte{ + // 825 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x96, 0xdf, 0x6e, 0xdb, 0x36, + 0x14, 0x87, 0x61, 0xd7, 0x6e, 0x16, 0x3a, 0xcd, 0x1a, 0xc6, 0x49, 0x19, 0xd7, 0x1b, 0xd2, 0xfd, + 0x41, 0x8d, 0x0d, 0x95, 0x01, 0x17, 0xe8, 0x2e, 0x36, 0x60, 0x88, 0xdb, 0x60, 0x33, 0xd0, 0x01, + 0x1e, 0xb3, 0x16, 0xc3, 0x6e, 0x0c, 0x5a, 0xa2, 0x55, 0x6e, 0x12, 0xc9, 0x91, 0x54, 0x17, 0x3f, + 0xc7, 0xde, 0x60, 0x4f, 0x3a, 0x88, 0xa4, 0x62, 0xca, 0x52, 0xee, 0x22, 0x7e, 0xdf, 0x39, 0x38, + 0x14, 0xa9, 0x9f, 0x03, 0x50, 0x2a, 0x44, 0x9a, 0xd1, 0x29, 0x91, 0x6c, 0xaa, 0xa9, 0xfa, 0xc8, + 0x62, 0x1a, 0x49, 0x25, 0x8c, 0x80, 0xc0, 0x91, 0x88, 0x48, 0x36, 0x1a, 0x07, 0x16, 0xe1, 0x5c, + 0x18, 0x62, 0x98, 0xe0, 0xda, 0x99, 0xa3, 0xb3, 0x90, 0x16, 0xe6, 0x83, 0x5f, 0x0e, 0x5b, 0xaf, + 0x49, 0xfc, 0x17, 0xe5, 0x49, 0x1b, 0x61, 0x59, 0xc6, 0x78, 0xda, 0x42, 0x62, 0xc1, 0x0d, 0xbd, + 0x35, 0xf7, 0x10, 0x25, 0x32, 0x4f, 0x3e, 0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c, 0xbc, + 0x9c, 0xbd, 0x27, 0x59, 0x41, 0xf1, 0x23, 0x57, 0xf3, 0xde, 0x95, 0x40, 0x08, 0x7a, 0x9c, 0xe4, + 0x14, 0x75, 0x2e, 0x3b, 0x93, 0x43, 0x6c, 0xff, 0x86, 0xc7, 0xa0, 0xcb, 0x12, 0xf4, 0xcc, 0xae, + 0x74, 0x59, 0x02, 0x87, 0xa0, 0x6f, 0x98, 0xc9, 0x28, 0xea, 0xda, 0x25, 0xf7, 0x00, 0x23, 0x70, + 0x2a, 0x95, 0x48, 0x8a, 0x98, 0xaa, 0x95, 0x54, 0xe2, 0x4f, 0x1a, 0x9b, 0x15, 0x4b, 0xd0, 0xb9, + 0x75, 0x4e, 0x2a, 0xb4, 0x74, 0x64, 0x91, 0xc0, 0x09, 0xe8, 0x11, 0xc9, 0x34, 0x7a, 0x70, 0xf9, + 0x60, 0x32, 0x98, 0x0d, 0x1b, 0x43, 0x5e, 0x49, 0x86, 0xad, 0x01, 0xbf, 0x05, 0xfd, 0xf2, 0x95, + 0x68, 0xd4, 0xb3, 0xea, 0x59, 0x43, 0xfd, 0x6d, 0x2b, 0x29, 0x76, 0x4e, 0x29, 0x53, 0x5e, 0xe4, + 0x1a, 0xf5, 0xef, 0x91, 0xaf, 0x79, 0x91, 0x63, 0xe7, 0xc0, 0x1f, 0xc1, 0xa3, 0xda, 0x97, 0x83, + 0x1e, 0xda, 0x37, 0x76, 0x11, 0xed, 0x32, 0x20, 0x7a, 0x13, 0x0a, 0xb8, 0xee, 0xc3, 0x17, 0xe0, + 0xc0, 0x7f, 0xe2, 0xe8, 0x13, 0x5b, 0x7a, 0x1a, 0x96, 0xce, 0x1d, 0xc2, 0x95, 0x03, 0xbf, 0x02, + 0xbd, 0xf2, 0x13, 0x42, 0x87, 0xd6, 0x7d, 0x1c, 0xba, 0x3f, 0x1b, 0x23, 0xb1, 0xa5, 0xf0, 0x39, + 0xe8, 0xdb, 0xeb, 0x8a, 0x80, 0xd5, 0x4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 0xe0, 0x64, 0x3f, + 0xf7, 0x34, 0xfa, 0xac, 0x1e, 0x25, 0x65, 0xf9, 0x8d, 0x95, 0x96, 0x77, 0x0e, 0x7e, 0xac, 0xf7, + 0x56, 0xe0, 0x77, 0x60, 0x10, 0x04, 0x2c, 0xfa, 0xba, 0x39, 0xc3, 0x8d, 0xc5, 0x0b, 0xbe, 0x11, + 0x18, 0xe8, 0xbb, 0xbf, 0xe1, 0x0f, 0xe0, 0x28, 0xfc, 0x29, 0x42, 0xd4, 0x56, 0xa2, 0xda, 0x05, + 0x0a, 0x38, 0xae, 0xd9, 0x73, 0x5e, 0x26, 0x61, 0x1e, 0xc8, 0xf3, 0x23, 0x1f, 0x92, 0xcb, 0x32, + 0x05, 0x96, 0x9d, 0x3f, 0xae, 0x3d, 0x4b, 0x45, 0x46, 0x78, 0x1a, 0x09, 0x95, 0x4e, 0x53, 0xca, + 0x6d, 0x46, 0x4c, 0x1d, 0x2a, 0x93, 0x27, 0xfc, 0xef, 0xc0, 0xc5, 0xe4, 0xf7, 0xb5, 0xa7, 0xff, + 0xba, 0xbd, 0x9f, 0xae, 0x96, 0x8b, 0xf5, 0x43, 0x5b, 0xf8, 0xf2, 0xff, 0x00, 0x00, 0x00, 0xff, + 0xff, 0xfe, 0x6c, 0x4b, 0xf7, 0x55, 0x08, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/source_info.pb.go b/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/source_info.pb.go new file mode 100644 index 0000000000..127808447e --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/source_info.pb.go @@ -0,0 +1,55 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/api/source_info.proto + +package serviceconfig + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import google_protobuf1 "github.com/golang/protobuf/ptypes/any" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Source information used to create a Service Config +type SourceInfo struct { + // All files used during config generation. + SourceFiles []*google_protobuf1.Any `protobuf:"bytes,1,rep,name=source_files,json=sourceFiles" json:"source_files,omitempty"` +} + +func (m *SourceInfo) Reset() { *m = SourceInfo{} } +func (m *SourceInfo) String() string { return proto.CompactTextString(m) } +func (*SourceInfo) ProtoMessage() {} +func (*SourceInfo) Descriptor() ([]byte, []int) { return fileDescriptor13, []int{0} } + +func (m *SourceInfo) GetSourceFiles() []*google_protobuf1.Any { + if m != nil { + return m.SourceFiles + } + return nil +} + +func init() { + proto.RegisterType((*SourceInfo)(nil), "google.api.SourceInfo") +} + +func init() { proto.RegisterFile("google/api/source_info.proto", fileDescriptor13) } + +var fileDescriptor13 = []byte{ + // 198 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x49, 0xcf, 0xcf, 0x4f, + 0xcf, 0x49, 0xd5, 0x4f, 0x2c, 0xc8, 0xd4, 0x2f, 0xce, 0x2f, 0x2d, 0x4a, 0x4e, 0x8d, 0xcf, 0xcc, + 0x4b, 0xcb, 0xd7, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x82, 0xc8, 0xea, 0x25, 0x16, 0x64, + 0x4a, 0x49, 0x42, 0x55, 0x82, 0x65, 0x92, 0x4a, 0xd3, 0xf4, 0x13, 0xf3, 0x2a, 0x21, 0xca, 0x94, + 0x5c, 0xb9, 0xb8, 0x82, 0xc1, 0x7a, 0x3d, 0xf3, 0xd2, 0xf2, 0x85, 0xcc, 0xb9, 0x78, 0xa0, 0x26, + 0xa5, 0x65, 0xe6, 0xa4, 0x16, 0x4b, 0x30, 0x2a, 0x30, 0x6b, 0x70, 0x1b, 0x89, 0xe8, 0x41, 0xcd, + 0x82, 0xe9, 0xd7, 0x73, 0xcc, 0xab, 0x0c, 0xe2, 0x86, 0xa8, 0x74, 0x03, 0x29, 0x74, 0x2a, 0xe4, + 0xe2, 0x4b, 0xce, 0xcf, 0xd5, 0x43, 0xd8, 0xe9, 0xc4, 0x8f, 0x30, 0x36, 0x00, 0xa4, 0x2d, 0x80, + 0x31, 0xca, 0x15, 0x2a, 0x9d, 0x9e, 0x9f, 0x93, 0x98, 0x97, 0xae, 0x97, 0x5f, 0x94, 0xae, 0x9f, + 0x9e, 0x9a, 0x07, 0x36, 0x54, 0x1f, 0x22, 0x95, 0x58, 0x90, 0x59, 0x0c, 0xf1, 0x4f, 0x6a, 0x51, + 0x59, 0x66, 0x72, 0x6a, 0x72, 0x7e, 0x5e, 0x5a, 0x66, 0xba, 0x35, 0x0a, 0x6f, 0x11, 0x13, 0x8b, + 0xbb, 0x63, 0x80, 0x67, 0x12, 0x1b, 0x58, 0xa3, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xd4, 0x78, + 0x5d, 0xab, 0x07, 0x01, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/system_parameter.pb.go b/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/system_parameter.pb.go new file mode 100644 index 0000000000..b3a598532c --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/system_parameter.pb.go @@ -0,0 +1,169 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/api/system_parameter.proto + +package serviceconfig + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// ### System parameter configuration +// +// A system parameter is a special kind of parameter defined by the API +// system, not by an individual API. It is typically mapped to an HTTP header +// and/or a URL query parameter. This configuration specifies which methods +// change the names of the system parameters. +type SystemParameters struct { + // Define system parameters. + // + // The parameters defined here will override the default parameters + // implemented by the system. If this field is missing from the service + // config, default system parameters will be used. Default system parameters + // and names is implementation-dependent. + // + // Example: define api key for all methods + // + // system_parameters + // rules: + // - selector: "*" + // parameters: + // - name: api_key + // url_query_parameter: api_key + // + // + // Example: define 2 api key names for a specific method. + // + // system_parameters + // rules: + // - selector: "/ListShelves" + // parameters: + // - name: api_key + // http_header: Api-Key1 + // - name: api_key + // http_header: Api-Key2 + // + // **NOTE:** All service configuration rules follow "last one wins" order. + Rules []*SystemParameterRule `protobuf:"bytes,1,rep,name=rules" json:"rules,omitempty"` +} + +func (m *SystemParameters) Reset() { *m = SystemParameters{} } +func (m *SystemParameters) String() string { return proto.CompactTextString(m) } +func (*SystemParameters) ProtoMessage() {} +func (*SystemParameters) Descriptor() ([]byte, []int) { return fileDescriptor14, []int{0} } + +func (m *SystemParameters) GetRules() []*SystemParameterRule { + if m != nil { + return m.Rules + } + return nil +} + +// Define a system parameter rule mapping system parameter definitions to +// methods. +type SystemParameterRule struct { + // Selects the methods to which this rule applies. Use '*' to indicate all + // methods in all APIs. + // + // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + Selector string `protobuf:"bytes,1,opt,name=selector" json:"selector,omitempty"` + // Define parameters. Multiple names may be defined for a parameter. + // For a given method call, only one of them should be used. If multiple + // names are used the behavior is implementation-dependent. + // If none of the specified names are present the behavior is + // parameter-dependent. + Parameters []*SystemParameter `protobuf:"bytes,2,rep,name=parameters" json:"parameters,omitempty"` +} + +func (m *SystemParameterRule) Reset() { *m = SystemParameterRule{} } +func (m *SystemParameterRule) String() string { return proto.CompactTextString(m) } +func (*SystemParameterRule) ProtoMessage() {} +func (*SystemParameterRule) Descriptor() ([]byte, []int) { return fileDescriptor14, []int{1} } + +func (m *SystemParameterRule) GetSelector() string { + if m != nil { + return m.Selector + } + return "" +} + +func (m *SystemParameterRule) GetParameters() []*SystemParameter { + if m != nil { + return m.Parameters + } + return nil +} + +// Define a parameter's name and location. The parameter may be passed as either +// an HTTP header or a URL query parameter, and if both are passed the behavior +// is implementation-dependent. +type SystemParameter struct { + // Define the name of the parameter, such as "api_key" . It is case sensitive. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Define the HTTP header name to use for the parameter. It is case + // insensitive. + HttpHeader string `protobuf:"bytes,2,opt,name=http_header,json=httpHeader" json:"http_header,omitempty"` + // Define the URL query parameter name to use for the parameter. It is case + // sensitive. + UrlQueryParameter string `protobuf:"bytes,3,opt,name=url_query_parameter,json=urlQueryParameter" json:"url_query_parameter,omitempty"` +} + +func (m *SystemParameter) Reset() { *m = SystemParameter{} } +func (m *SystemParameter) String() string { return proto.CompactTextString(m) } +func (*SystemParameter) ProtoMessage() {} +func (*SystemParameter) Descriptor() ([]byte, []int) { return fileDescriptor14, []int{2} } + +func (m *SystemParameter) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *SystemParameter) GetHttpHeader() string { + if m != nil { + return m.HttpHeader + } + return "" +} + +func (m *SystemParameter) GetUrlQueryParameter() string { + if m != nil { + return m.UrlQueryParameter + } + return "" +} + +func init() { + proto.RegisterType((*SystemParameters)(nil), "google.api.SystemParameters") + proto.RegisterType((*SystemParameterRule)(nil), "google.api.SystemParameterRule") + proto.RegisterType((*SystemParameter)(nil), "google.api.SystemParameter") +} + +func init() { proto.RegisterFile("google/api/system_parameter.proto", fileDescriptor14) } + +var fileDescriptor14 = []byte{ + // 286 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x91, 0xbf, 0x4e, 0xc3, 0x30, + 0x10, 0x87, 0x95, 0xb6, 0x20, 0xb8, 0x4a, 0xfc, 0x71, 0x19, 0x22, 0x18, 0x5a, 0x3a, 0x75, 0x72, + 0x24, 0x10, 0x53, 0x27, 0x2a, 0x21, 0xe8, 0x16, 0xca, 0xc6, 0x12, 0x99, 0x70, 0xb8, 0x91, 0x9c, + 0xd8, 0x9c, 0x9d, 0x48, 0x7d, 0x1d, 0x9e, 0x14, 0xc5, 0x29, 0x69, 0x89, 0x10, 0x9b, 0xef, 0xbe, + 0xcf, 0xfa, 0x9d, 0xee, 0xe0, 0x5a, 0x6a, 0x2d, 0x15, 0x46, 0xc2, 0x64, 0x91, 0xdd, 0x58, 0x87, + 0x79, 0x62, 0x04, 0x89, 0x1c, 0x1d, 0x12, 0x37, 0xa4, 0x9d, 0x66, 0xd0, 0x28, 0x5c, 0x98, 0x6c, + 0xba, 0x84, 0xb3, 0x17, 0x6f, 0xc5, 0x3f, 0x92, 0x65, 0x77, 0x70, 0x40, 0xa5, 0x42, 0x1b, 0x06, + 0x93, 0xfe, 0x6c, 0x78, 0x33, 0xe6, 0x3b, 0x9f, 0x77, 0xe4, 0x55, 0xa9, 0x70, 0xd5, 0xd8, 0xd3, + 0x02, 0x46, 0x7f, 0x50, 0x76, 0x09, 0x47, 0x16, 0x15, 0xa6, 0x4e, 0x53, 0x18, 0x4c, 0x82, 0xd9, + 0xf1, 0xaa, 0xad, 0xd9, 0x1c, 0xa0, 0x1d, 0xce, 0x86, 0x3d, 0x1f, 0x77, 0xf5, 0x5f, 0xdc, 0x9e, + 0x3e, 0xad, 0xe0, 0xb4, 0x83, 0x19, 0x83, 0x41, 0x21, 0x72, 0xdc, 0xe6, 0xf8, 0x37, 0x1b, 0xc3, + 0x70, 0xed, 0x9c, 0x49, 0xd6, 0x28, 0xde, 0x91, 0xc2, 0x9e, 0x47, 0x50, 0xb7, 0x9e, 0x7c, 0x87, + 0x71, 0x18, 0x95, 0xa4, 0x92, 0xcf, 0x12, 0x69, 0xb3, 0xdb, 0x55, 0xd8, 0xf7, 0xe2, 0x79, 0x49, + 0xea, 0xb9, 0x26, 0x6d, 0xc8, 0xa2, 0x82, 0x93, 0x54, 0xe7, 0x7b, 0x53, 0x2e, 0x2e, 0x3a, 0x73, + 0xc4, 0xf5, 0x9a, 0xe3, 0xe0, 0xf5, 0x61, 0xeb, 0x48, 0xad, 0x44, 0x21, 0xb9, 0x26, 0x19, 0x49, + 0x2c, 0xfc, 0x11, 0xa2, 0x06, 0x09, 0x93, 0xd9, 0xe6, 0x54, 0x48, 0x55, 0x96, 0x62, 0xaa, 0x8b, + 0x8f, 0x4c, 0xce, 0x7f, 0x55, 0x5f, 0xbd, 0xc1, 0xe3, 0x7d, 0xbc, 0x7c, 0x3b, 0xf4, 0x1f, 0x6f, + 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x5e, 0xdf, 0x2e, 0x09, 0xe2, 0x01, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/usage.pb.go b/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/usage.pb.go new file mode 100644 index 0000000000..1e7d710bfb --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/usage.pb.go @@ -0,0 +1,157 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/api/usage.proto + +package serviceconfig + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Configuration controlling usage of a service. +type Usage struct { + // Requirements that must be satisfied before a consumer project can use the + // service. Each requirement is of the form /; + // for example 'serviceusage.googleapis.com/billing-enabled'. + Requirements []string `protobuf:"bytes,1,rep,name=requirements" json:"requirements,omitempty"` + // A list of usage rules that apply to individual API methods. + // + // **NOTE:** All service configuration rules follow "last one wins" order. + Rules []*UsageRule `protobuf:"bytes,6,rep,name=rules" json:"rules,omitempty"` + // The full resource name of a channel used for sending notifications to the + // service producer. + // + // Google Service Management currently only supports + // [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification + // channel. To use Google Cloud Pub/Sub as the channel, this must be the name + // of a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name format + // documented in https://cloud.google.com/pubsub/docs/overview. + ProducerNotificationChannel string `protobuf:"bytes,7,opt,name=producer_notification_channel,json=producerNotificationChannel" json:"producer_notification_channel,omitempty"` +} + +func (m *Usage) Reset() { *m = Usage{} } +func (m *Usage) String() string { return proto.CompactTextString(m) } +func (*Usage) ProtoMessage() {} +func (*Usage) Descriptor() ([]byte, []int) { return fileDescriptor15, []int{0} } + +func (m *Usage) GetRequirements() []string { + if m != nil { + return m.Requirements + } + return nil +} + +func (m *Usage) GetRules() []*UsageRule { + if m != nil { + return m.Rules + } + return nil +} + +func (m *Usage) GetProducerNotificationChannel() string { + if m != nil { + return m.ProducerNotificationChannel + } + return "" +} + +// Usage configuration rules for the service. +// +// NOTE: Under development. +// +// +// Use this rule to configure unregistered calls for the service. Unregistered +// calls are calls that do not contain consumer project identity. +// (Example: calls that do not contain an API key). +// By default, API methods do not allow unregistered calls, and each method call +// must be identified by a consumer project identity. Use this rule to +// allow/disallow unregistered calls. +// +// Example of an API that wants to allow unregistered calls for entire service. +// +// usage: +// rules: +// - selector: "*" +// allow_unregistered_calls: true +// +// Example of a method that wants to allow unregistered calls. +// +// usage: +// rules: +// - selector: "google.example.library.v1.LibraryService.CreateBook" +// allow_unregistered_calls: true +type UsageRule struct { + // Selects the methods to which this rule applies. Use '*' to indicate all + // methods in all APIs. + // + // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + Selector string `protobuf:"bytes,1,opt,name=selector" json:"selector,omitempty"` + // True, if the method allows unregistered calls; false otherwise. + AllowUnregisteredCalls bool `protobuf:"varint,2,opt,name=allow_unregistered_calls,json=allowUnregisteredCalls" json:"allow_unregistered_calls,omitempty"` + // True, if the method should skip service control. If so, no control plane + // feature (like quota and billing) will be enabled. + SkipServiceControl bool `protobuf:"varint,3,opt,name=skip_service_control,json=skipServiceControl" json:"skip_service_control,omitempty"` +} + +func (m *UsageRule) Reset() { *m = UsageRule{} } +func (m *UsageRule) String() string { return proto.CompactTextString(m) } +func (*UsageRule) ProtoMessage() {} +func (*UsageRule) Descriptor() ([]byte, []int) { return fileDescriptor15, []int{1} } + +func (m *UsageRule) GetSelector() string { + if m != nil { + return m.Selector + } + return "" +} + +func (m *UsageRule) GetAllowUnregisteredCalls() bool { + if m != nil { + return m.AllowUnregisteredCalls + } + return false +} + +func (m *UsageRule) GetSkipServiceControl() bool { + if m != nil { + return m.SkipServiceControl + } + return false +} + +func init() { + proto.RegisterType((*Usage)(nil), "google.api.Usage") + proto.RegisterType((*UsageRule)(nil), "google.api.UsageRule") +} + +func init() { proto.RegisterFile("google/api/usage.proto", fileDescriptor15) } + +var fileDescriptor15 = []byte{ + // 331 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x91, 0xc1, 0x4b, 0xfb, 0x30, + 0x14, 0xc7, 0xe9, 0xf6, 0xdb, 0x7e, 0x5b, 0x14, 0x0f, 0x41, 0x47, 0x99, 0x0a, 0x65, 0xa7, 0x82, + 0xd0, 0x8a, 0x5e, 0x04, 0x4f, 0x6e, 0x88, 0x78, 0x91, 0x51, 0xd9, 0xc5, 0x4b, 0x89, 0xd9, 0x5b, + 0x0c, 0x66, 0x79, 0x35, 0x49, 0xf5, 0x0f, 0xf1, 0xea, 0xc9, 0xbf, 0x54, 0x9a, 0xcc, 0xd9, 0x1d, + 0xdf, 0xfb, 0x7c, 0xbe, 0xef, 0xb5, 0x2f, 0x64, 0x24, 0x10, 0x85, 0x82, 0x9c, 0x55, 0x32, 0xaf, + 0x2d, 0x13, 0x90, 0x55, 0x06, 0x1d, 0x52, 0x12, 0xfa, 0x19, 0xab, 0xe4, 0xf8, 0xa4, 0xe5, 0x30, + 0xad, 0xd1, 0x31, 0x27, 0x51, 0xdb, 0x60, 0x4e, 0xbe, 0x22, 0xd2, 0x5b, 0x34, 0x49, 0x3a, 0x21, + 0xfb, 0x06, 0xde, 0x6a, 0x69, 0x60, 0x0d, 0xda, 0xd9, 0x38, 0x4a, 0xba, 0xe9, 0xb0, 0xd8, 0xe9, + 0xd1, 0x33, 0xd2, 0x33, 0xb5, 0x02, 0x1b, 0xf7, 0x93, 0x6e, 0xba, 0x77, 0x71, 0x94, 0xfd, 0xed, + 0xc9, 0xfc, 0x94, 0xa2, 0x56, 0x50, 0x04, 0x87, 0x4e, 0xc9, 0x69, 0x65, 0x70, 0x59, 0x73, 0x30, + 0xa5, 0x46, 0x27, 0x57, 0x92, 0xfb, 0xd5, 0x25, 0x7f, 0x61, 0x5a, 0x83, 0x8a, 0xff, 0x27, 0x51, + 0x3a, 0x2c, 0x8e, 0x7f, 0xa5, 0x87, 0x96, 0x33, 0x0b, 0xca, 0xe4, 0x33, 0x22, 0xc3, 0xed, 0x60, + 0x3a, 0x26, 0x03, 0x0b, 0x0a, 0xb8, 0x43, 0x13, 0x47, 0x3e, 0xbc, 0xad, 0xe9, 0x15, 0x89, 0x99, + 0x52, 0xf8, 0x51, 0xd6, 0xda, 0x80, 0x90, 0xd6, 0x81, 0x81, 0x65, 0xc9, 0x99, 0x52, 0x36, 0xee, + 0x24, 0x51, 0x3a, 0x28, 0x46, 0x9e, 0x2f, 0x5a, 0x78, 0xd6, 0x50, 0x7a, 0x4e, 0x0e, 0xed, 0xab, + 0xac, 0x4a, 0x0b, 0xe6, 0x5d, 0x72, 0x28, 0x39, 0x6a, 0x67, 0x50, 0xc5, 0x5d, 0x9f, 0xa2, 0x0d, + 0x7b, 0x0c, 0x68, 0x16, 0xc8, 0x54, 0x91, 0x03, 0x8e, 0xeb, 0xd6, 0xcf, 0x4f, 0x89, 0xff, 0xc8, + 0x79, 0x73, 0xd2, 0x79, 0xf4, 0x74, 0xbb, 0x21, 0x02, 0x15, 0xd3, 0x22, 0x43, 0x23, 0x72, 0x01, + 0xda, 0x1f, 0x3c, 0x0f, 0x88, 0x55, 0xd2, 0xfa, 0x17, 0xd9, 0x2c, 0xe5, 0xa8, 0x57, 0x52, 0x5c, + 0xef, 0x54, 0xdf, 0x9d, 0x7f, 0x77, 0x37, 0xf3, 0xfb, 0xe7, 0xbe, 0x0f, 0x5e, 0xfe, 0x04, 0x00, + 0x00, 0xff, 0xff, 0x9c, 0x4b, 0x8c, 0x57, 0xed, 0x01, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/api/servicecontrol/v1/check_error.pb.go b/vendor/google.golang.org/genproto/googleapis/api/servicecontrol/v1/check_error.pb.go new file mode 100644 index 0000000000..cadea87775 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/api/servicecontrol/v1/check_error.pb.go @@ -0,0 +1,207 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/api/servicecontrol/v1/check_error.proto + +/* +Package servicecontrol is a generated protocol buffer package. + +It is generated from these files: + google/api/servicecontrol/v1/check_error.proto + google/api/servicecontrol/v1/distribution.proto + google/api/servicecontrol/v1/log_entry.proto + google/api/servicecontrol/v1/metric_value.proto + google/api/servicecontrol/v1/operation.proto + google/api/servicecontrol/v1/quota_controller.proto + google/api/servicecontrol/v1/service_controller.proto + +It has these top-level messages: + CheckError + Distribution + LogEntry + MetricValue + MetricValueSet + Operation + AllocateQuotaRequest + QuotaOperation + AllocateQuotaResponse + QuotaError + CheckRequest + CheckResponse + ReportRequest + ReportResponse +*/ +package servicecontrol + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Error codes for Check responses. +type CheckError_Code int32 + +const ( + // This is never used in `CheckResponse`. + CheckError_ERROR_CODE_UNSPECIFIED CheckError_Code = 0 + // The consumer's project id was not found. + // Same as [google.rpc.Code.NOT_FOUND][]. + CheckError_NOT_FOUND CheckError_Code = 5 + // The consumer doesn't have access to the specified resource. + // Same as [google.rpc.Code.PERMISSION_DENIED][]. + CheckError_PERMISSION_DENIED CheckError_Code = 7 + // Quota check failed. Same as [google.rpc.Code.RESOURCE_EXHAUSTED][]. + CheckError_RESOURCE_EXHAUSTED CheckError_Code = 8 + // The consumer hasn't activated the service. + CheckError_SERVICE_NOT_ACTIVATED CheckError_Code = 104 + // The consumer cannot access the service because billing is disabled. + CheckError_BILLING_DISABLED CheckError_Code = 107 + // The consumer's project has been marked as deleted (soft deletion). + CheckError_PROJECT_DELETED CheckError_Code = 108 + // The consumer's project number or id does not represent a valid project. + CheckError_PROJECT_INVALID CheckError_Code = 114 + // The IP address of the consumer is invalid for the specific consumer + // project. + CheckError_IP_ADDRESS_BLOCKED CheckError_Code = 109 + // The referer address of the consumer request is invalid for the specific + // consumer project. + CheckError_REFERER_BLOCKED CheckError_Code = 110 + // The client application of the consumer request is invalid for the + // specific consumer project. + CheckError_CLIENT_APP_BLOCKED CheckError_Code = 111 + // The consumer's API key is invalid. + CheckError_API_KEY_INVALID CheckError_Code = 105 + // The consumer's API Key has expired. + CheckError_API_KEY_EXPIRED CheckError_Code = 112 + // The consumer's API Key was not found in config record. + CheckError_API_KEY_NOT_FOUND CheckError_Code = 113 + // The backend server for looking up project id/number is unavailable. + CheckError_NAMESPACE_LOOKUP_UNAVAILABLE CheckError_Code = 300 + // The backend server for checking service status is unavailable. + CheckError_SERVICE_STATUS_UNAVAILABLE CheckError_Code = 301 + // The backend server for checking billing status is unavailable. + CheckError_BILLING_STATUS_UNAVAILABLE CheckError_Code = 302 +) + +var CheckError_Code_name = map[int32]string{ + 0: "ERROR_CODE_UNSPECIFIED", + 5: "NOT_FOUND", + 7: "PERMISSION_DENIED", + 8: "RESOURCE_EXHAUSTED", + 104: "SERVICE_NOT_ACTIVATED", + 107: "BILLING_DISABLED", + 108: "PROJECT_DELETED", + 114: "PROJECT_INVALID", + 109: "IP_ADDRESS_BLOCKED", + 110: "REFERER_BLOCKED", + 111: "CLIENT_APP_BLOCKED", + 105: "API_KEY_INVALID", + 112: "API_KEY_EXPIRED", + 113: "API_KEY_NOT_FOUND", + 300: "NAMESPACE_LOOKUP_UNAVAILABLE", + 301: "SERVICE_STATUS_UNAVAILABLE", + 302: "BILLING_STATUS_UNAVAILABLE", +} +var CheckError_Code_value = map[string]int32{ + "ERROR_CODE_UNSPECIFIED": 0, + "NOT_FOUND": 5, + "PERMISSION_DENIED": 7, + "RESOURCE_EXHAUSTED": 8, + "SERVICE_NOT_ACTIVATED": 104, + "BILLING_DISABLED": 107, + "PROJECT_DELETED": 108, + "PROJECT_INVALID": 114, + "IP_ADDRESS_BLOCKED": 109, + "REFERER_BLOCKED": 110, + "CLIENT_APP_BLOCKED": 111, + "API_KEY_INVALID": 105, + "API_KEY_EXPIRED": 112, + "API_KEY_NOT_FOUND": 113, + "NAMESPACE_LOOKUP_UNAVAILABLE": 300, + "SERVICE_STATUS_UNAVAILABLE": 301, + "BILLING_STATUS_UNAVAILABLE": 302, +} + +func (x CheckError_Code) String() string { + return proto.EnumName(CheckError_Code_name, int32(x)) +} +func (CheckError_Code) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 0} } + +// Defines the errors to be returned in +// [google.api.servicecontrol.v1.CheckResponse.check_errors][google.api.servicecontrol.v1.CheckResponse.check_errors]. +type CheckError struct { + // The error code. + Code CheckError_Code `protobuf:"varint,1,opt,name=code,enum=google.api.servicecontrol.v1.CheckError_Code" json:"code,omitempty"` + // Free-form text providing details on the error cause of the error. + Detail string `protobuf:"bytes,2,opt,name=detail" json:"detail,omitempty"` +} + +func (m *CheckError) Reset() { *m = CheckError{} } +func (m *CheckError) String() string { return proto.CompactTextString(m) } +func (*CheckError) ProtoMessage() {} +func (*CheckError) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *CheckError) GetCode() CheckError_Code { + if m != nil { + return m.Code + } + return CheckError_ERROR_CODE_UNSPECIFIED +} + +func (m *CheckError) GetDetail() string { + if m != nil { + return m.Detail + } + return "" +} + +func init() { + proto.RegisterType((*CheckError)(nil), "google.api.servicecontrol.v1.CheckError") + proto.RegisterEnum("google.api.servicecontrol.v1.CheckError_Code", CheckError_Code_name, CheckError_Code_value) +} + +func init() { proto.RegisterFile("google/api/servicecontrol/v1/check_error.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 484 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0xdd, 0x6e, 0xd3, 0x3e, + 0x18, 0xc6, 0xff, 0xe9, 0xbf, 0x0c, 0x66, 0x09, 0x16, 0x0c, 0xab, 0x46, 0x55, 0x89, 0xb2, 0xa3, + 0x9d, 0x90, 0x68, 0x70, 0xc8, 0x91, 0x6b, 0xbf, 0x05, 0xaf, 0x59, 0x62, 0xd9, 0x49, 0x35, 0x38, + 0xb1, 0x42, 0x1a, 0x65, 0xd1, 0xba, 0xb8, 0xa4, 0x51, 0xaf, 0x80, 0x0b, 0xe0, 0x2a, 0x38, 0x02, + 0xae, 0x8f, 0x43, 0xe4, 0x76, 0xfd, 0x92, 0xa6, 0x1d, 0xfa, 0x79, 0x7f, 0xcf, 0x63, 0xbd, 0x1f, + 0xc8, 0x2b, 0x8c, 0x29, 0xa6, 0xb9, 0x9f, 0xce, 0x4a, 0x7f, 0x9e, 0xd7, 0x8b, 0x32, 0xcb, 0x33, + 0x53, 0x35, 0xb5, 0x99, 0xfa, 0x8b, 0x73, 0x3f, 0xbb, 0xce, 0xb3, 0x1b, 0x9d, 0xd7, 0xb5, 0xa9, + 0xbd, 0x59, 0x6d, 0x1a, 0x83, 0x7b, 0x2b, 0xde, 0x4b, 0x67, 0xa5, 0xb7, 0xcf, 0x7b, 0x8b, 0xf3, + 0x6e, 0x6f, 0x27, 0x2d, 0xad, 0x2a, 0xd3, 0xa4, 0x4d, 0x69, 0xaa, 0xf9, 0xca, 0x7b, 0xfa, 0xa3, + 0x8d, 0x10, 0xb5, 0x89, 0x60, 0x03, 0x31, 0x41, 0xed, 0xcc, 0x4c, 0xf2, 0x13, 0xa7, 0xef, 0x9c, + 0x3d, 0x7b, 0x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c4, 0x46, 0x37, 0x16, 0x26, 0x82, 0xeb, + 0x11, 0x7c, 0xde, 0x24, 0x97, 0xbb, 0x22, 0x5c, 0x09, 0x2e, 0x81, 0xb9, 0x33, 0xdb, 0xf8, 0x5a, + 0xdc, 0xce, 0xe3, 0x1b, 0x7e, 0x83, 0x7a, 0x21, 0xb9, 0x04, 0x25, 0x08, 0x05, 0x1d, 0x44, 0xd1, + 0x28, 0x11, 0x3a, 0x09, 0xc9, 0x98, 0xf0, 0xc0, 0xb6, 0xe4, 0xfe, 0x6a, 0xe1, 0xd7, 0xa8, 0xbb, + 0x9e, 0x81, 0x8a, 0x49, 0x9c, 0xa8, 0x3d, 0xe0, 0xf7, 0x12, 0x58, 0x4f, 0xe2, 0x1e, 0xe0, 0x4f, + 0x6b, 0xf0, 0xdd, 0x41, 0xfd, 0xcc, 0xdc, 0x3e, 0xb8, 0xfb, 0xc1, 0xd1, 0x76, 0xf9, 0xc2, 0x1e, + 0x92, 0x70, 0xbe, 0x5c, 0xdc, 0x19, 0x0a, 0x33, 0x4d, 0xab, 0xc2, 0x33, 0x75, 0xe1, 0x17, 0x79, + 0xb5, 0x3c, 0x33, 0x7f, 0x55, 0x4a, 0x67, 0xe5, 0xfc, 0xfe, 0xab, 0xfe, 0xb0, 0xaf, 0xfc, 0x75, + 0x9c, 0xaf, 0x07, 0x4b, 0xe7, 0xfb, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x7d, 0x65, 0x26, 0xbf, + 0x0e, 0x03, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/api/servicecontrol/v1/distribution.pb.go b/vendor/google.golang.org/genproto/googleapis/api/servicecontrol/v1/distribution.pb.go new file mode 100644 index 0000000000..a4193182be --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/api/servicecontrol/v1/distribution.pb.go @@ -0,0 +1,430 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/api/servicecontrol/v1/distribution.proto + +package servicecontrol + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Distribution represents a frequency distribution of double-valued sample +// points. It contains the size of the population of sample points plus +// additional optional information: +// +// - the arithmetic mean of the samples +// - the minimum and maximum of the samples +// - the sum-squared-deviation of the samples, used to compute variance +// - a histogram of the values of the sample points +type Distribution struct { + // The total number of samples in the distribution. Must be >= 0. + Count int64 `protobuf:"varint,1,opt,name=count" json:"count,omitempty"` + // The arithmetic mean of the samples in the distribution. If `count` is + // zero then this field must be zero. + Mean float64 `protobuf:"fixed64,2,opt,name=mean" json:"mean,omitempty"` + // The minimum of the population of values. Ignored if `count` is zero. + Minimum float64 `protobuf:"fixed64,3,opt,name=minimum" json:"minimum,omitempty"` + // The maximum of the population of values. Ignored if `count` is zero. + Maximum float64 `protobuf:"fixed64,4,opt,name=maximum" json:"maximum,omitempty"` + // The sum of squared deviations from the mean: + // Sum[i=1..count]((x_i - mean)^2) + // where each x_i is a sample values. If `count` is zero then this field + // must be zero, otherwise validation of the request fails. + SumOfSquaredDeviation float64 `protobuf:"fixed64,5,opt,name=sum_of_squared_deviation,json=sumOfSquaredDeviation" json:"sum_of_squared_deviation,omitempty"` + // The number of samples in each histogram bucket. `bucket_counts` are + // optional. If present, they must sum to the `count` value. + // + // The buckets are defined below in `bucket_option`. There are N buckets. + // `bucket_counts[0]` is the number of samples in the underflow bucket. + // `bucket_counts[1]` to `bucket_counts[N-1]` are the numbers of samples + // in each of the finite buckets. And `bucket_counts[N] is the number + // of samples in the overflow bucket. See the comments of `bucket_option` + // below for more details. + // + // Any suffix of trailing zeros may be omitted. + BucketCounts []int64 `protobuf:"varint,6,rep,packed,name=bucket_counts,json=bucketCounts" json:"bucket_counts,omitempty"` + // Defines the buckets in the histogram. `bucket_option` and `bucket_counts` + // must be both set, or both unset. + // + // Buckets are numbered in the range of [0, N], with a total of N+1 buckets. + // There must be at least two buckets (a single-bucket histogram gives + // no information that isn't already provided by `count`). + // + // The first bucket is the underflow bucket which has a lower bound + // of -inf. The last bucket is the overflow bucket which has an + // upper bound of +inf. All other buckets (if any) are called "finite" + // buckets because they have finite lower and upper bounds. As described + // below, there are three ways to define the finite buckets. + // + // (1) Buckets with constant width. + // (2) Buckets with exponentially growing widths. + // (3) Buckets with arbitrary user-provided widths. + // + // In all cases, the buckets cover the entire real number line (-inf, + // +inf). Bucket upper bounds are exclusive and lower bounds are + // inclusive. The upper bound of the underflow bucket is equal to the + // lower bound of the smallest finite bucket; the lower bound of the + // overflow bucket is equal to the upper bound of the largest finite + // bucket. + // + // Types that are valid to be assigned to BucketOption: + // *Distribution_LinearBuckets_ + // *Distribution_ExponentialBuckets_ + // *Distribution_ExplicitBuckets_ + BucketOption isDistribution_BucketOption `protobuf_oneof:"bucket_option"` +} + +func (m *Distribution) Reset() { *m = Distribution{} } +func (m *Distribution) String() string { return proto.CompactTextString(m) } +func (*Distribution) ProtoMessage() {} +func (*Distribution) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +type isDistribution_BucketOption interface { + isDistribution_BucketOption() +} + +type Distribution_LinearBuckets_ struct { + LinearBuckets *Distribution_LinearBuckets `protobuf:"bytes,7,opt,name=linear_buckets,json=linearBuckets,oneof"` +} +type Distribution_ExponentialBuckets_ struct { + ExponentialBuckets *Distribution_ExponentialBuckets `protobuf:"bytes,8,opt,name=exponential_buckets,json=exponentialBuckets,oneof"` +} +type Distribution_ExplicitBuckets_ struct { + ExplicitBuckets *Distribution_ExplicitBuckets `protobuf:"bytes,9,opt,name=explicit_buckets,json=explicitBuckets,oneof"` +} + +func (*Distribution_LinearBuckets_) isDistribution_BucketOption() {} +func (*Distribution_ExponentialBuckets_) isDistribution_BucketOption() {} +func (*Distribution_ExplicitBuckets_) isDistribution_BucketOption() {} + +func (m *Distribution) GetBucketOption() isDistribution_BucketOption { + if m != nil { + return m.BucketOption + } + return nil +} + +func (m *Distribution) GetCount() int64 { + if m != nil { + return m.Count + } + return 0 +} + +func (m *Distribution) GetMean() float64 { + if m != nil { + return m.Mean + } + return 0 +} + +func (m *Distribution) GetMinimum() float64 { + if m != nil { + return m.Minimum + } + return 0 +} + +func (m *Distribution) GetMaximum() float64 { + if m != nil { + return m.Maximum + } + return 0 +} + +func (m *Distribution) GetSumOfSquaredDeviation() float64 { + if m != nil { + return m.SumOfSquaredDeviation + } + return 0 +} + +func (m *Distribution) GetBucketCounts() []int64 { + if m != nil { + return m.BucketCounts + } + return nil +} + +func (m *Distribution) GetLinearBuckets() *Distribution_LinearBuckets { + if x, ok := m.GetBucketOption().(*Distribution_LinearBuckets_); ok { + return x.LinearBuckets + } + return nil +} + +func (m *Distribution) GetExponentialBuckets() *Distribution_ExponentialBuckets { + if x, ok := m.GetBucketOption().(*Distribution_ExponentialBuckets_); ok { + return x.ExponentialBuckets + } + return nil +} + +func (m *Distribution) GetExplicitBuckets() *Distribution_ExplicitBuckets { + if x, ok := m.GetBucketOption().(*Distribution_ExplicitBuckets_); ok { + return x.ExplicitBuckets + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Distribution) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _Distribution_OneofMarshaler, _Distribution_OneofUnmarshaler, _Distribution_OneofSizer, []interface{}{ + (*Distribution_LinearBuckets_)(nil), + (*Distribution_ExponentialBuckets_)(nil), + (*Distribution_ExplicitBuckets_)(nil), + } +} + +func _Distribution_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Distribution) + // bucket_option + switch x := m.BucketOption.(type) { + case *Distribution_LinearBuckets_: + b.EncodeVarint(7<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.LinearBuckets); err != nil { + return err + } + case *Distribution_ExponentialBuckets_: + b.EncodeVarint(8<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ExponentialBuckets); err != nil { + return err + } + case *Distribution_ExplicitBuckets_: + b.EncodeVarint(9<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ExplicitBuckets); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("Distribution.BucketOption has unexpected type %T", x) + } + return nil +} + +func _Distribution_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Distribution) + switch tag { + case 7: // bucket_option.linear_buckets + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Distribution_LinearBuckets) + err := b.DecodeMessage(msg) + m.BucketOption = &Distribution_LinearBuckets_{msg} + return true, err + case 8: // bucket_option.exponential_buckets + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Distribution_ExponentialBuckets) + err := b.DecodeMessage(msg) + m.BucketOption = &Distribution_ExponentialBuckets_{msg} + return true, err + case 9: // bucket_option.explicit_buckets + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Distribution_ExplicitBuckets) + err := b.DecodeMessage(msg) + m.BucketOption = &Distribution_ExplicitBuckets_{msg} + return true, err + default: + return false, nil + } +} + +func _Distribution_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Distribution) + // bucket_option + switch x := m.BucketOption.(type) { + case *Distribution_LinearBuckets_: + s := proto.Size(x.LinearBuckets) + n += proto.SizeVarint(7<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Distribution_ExponentialBuckets_: + s := proto.Size(x.ExponentialBuckets) + n += proto.SizeVarint(8<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Distribution_ExplicitBuckets_: + s := proto.Size(x.ExplicitBuckets) + n += proto.SizeVarint(9<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Describing buckets with constant width. +type Distribution_LinearBuckets struct { + // The number of finite buckets. With the underflow and overflow buckets, + // the total number of buckets is `num_finite_buckets` + 2. + // See comments on `bucket_options` for details. + NumFiniteBuckets int32 `protobuf:"varint,1,opt,name=num_finite_buckets,json=numFiniteBuckets" json:"num_finite_buckets,omitempty"` + // The i'th linear bucket covers the interval + // [offset + (i-1) * width, offset + i * width) + // where i ranges from 1 to num_finite_buckets, inclusive. + // Must be strictly positive. + Width float64 `protobuf:"fixed64,2,opt,name=width" json:"width,omitempty"` + // The i'th linear bucket covers the interval + // [offset + (i-1) * width, offset + i * width) + // where i ranges from 1 to num_finite_buckets, inclusive. + Offset float64 `protobuf:"fixed64,3,opt,name=offset" json:"offset,omitempty"` +} + +func (m *Distribution_LinearBuckets) Reset() { *m = Distribution_LinearBuckets{} } +func (m *Distribution_LinearBuckets) String() string { return proto.CompactTextString(m) } +func (*Distribution_LinearBuckets) ProtoMessage() {} +func (*Distribution_LinearBuckets) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0, 0} } + +func (m *Distribution_LinearBuckets) GetNumFiniteBuckets() int32 { + if m != nil { + return m.NumFiniteBuckets + } + return 0 +} + +func (m *Distribution_LinearBuckets) GetWidth() float64 { + if m != nil { + return m.Width + } + return 0 +} + +func (m *Distribution_LinearBuckets) GetOffset() float64 { + if m != nil { + return m.Offset + } + return 0 +} + +// Describing buckets with exponentially growing width. +type Distribution_ExponentialBuckets struct { + // The number of finite buckets. With the underflow and overflow buckets, + // the total number of buckets is `num_finite_buckets` + 2. + // See comments on `bucket_options` for details. + NumFiniteBuckets int32 `protobuf:"varint,1,opt,name=num_finite_buckets,json=numFiniteBuckets" json:"num_finite_buckets,omitempty"` + // The i'th exponential bucket covers the interval + // [scale * growth_factor^(i-1), scale * growth_factor^i) + // where i ranges from 1 to num_finite_buckets inclusive. + // Must be larger than 1.0. + GrowthFactor float64 `protobuf:"fixed64,2,opt,name=growth_factor,json=growthFactor" json:"growth_factor,omitempty"` + // The i'th exponential bucket covers the interval + // [scale * growth_factor^(i-1), scale * growth_factor^i) + // where i ranges from 1 to num_finite_buckets inclusive. + // Must be > 0. + Scale float64 `protobuf:"fixed64,3,opt,name=scale" json:"scale,omitempty"` +} + +func (m *Distribution_ExponentialBuckets) Reset() { *m = Distribution_ExponentialBuckets{} } +func (m *Distribution_ExponentialBuckets) String() string { return proto.CompactTextString(m) } +func (*Distribution_ExponentialBuckets) ProtoMessage() {} +func (*Distribution_ExponentialBuckets) Descriptor() ([]byte, []int) { + return fileDescriptor1, []int{0, 1} +} + +func (m *Distribution_ExponentialBuckets) GetNumFiniteBuckets() int32 { + if m != nil { + return m.NumFiniteBuckets + } + return 0 +} + +func (m *Distribution_ExponentialBuckets) GetGrowthFactor() float64 { + if m != nil { + return m.GrowthFactor + } + return 0 +} + +func (m *Distribution_ExponentialBuckets) GetScale() float64 { + if m != nil { + return m.Scale + } + return 0 +} + +// Describing buckets with arbitrary user-provided width. +type Distribution_ExplicitBuckets struct { + // 'bound' is a list of strictly increasing boundaries between + // buckets. Note that a list of length N-1 defines N buckets because + // of fenceposting. See comments on `bucket_options` for details. + // + // The i'th finite bucket covers the interval + // [bound[i-1], bound[i]) + // where i ranges from 1 to bound_size() - 1. Note that there are no + // finite buckets at all if 'bound' only contains a single element; in + // that special case the single bound defines the boundary between the + // underflow and overflow buckets. + // + // bucket number lower bound upper bound + // i == 0 (underflow) -inf bound[i] + // 0 < i < bound_size() bound[i-1] bound[i] + // i == bound_size() (overflow) bound[i-1] +inf + Bounds []float64 `protobuf:"fixed64,1,rep,packed,name=bounds" json:"bounds,omitempty"` +} + +func (m *Distribution_ExplicitBuckets) Reset() { *m = Distribution_ExplicitBuckets{} } +func (m *Distribution_ExplicitBuckets) String() string { return proto.CompactTextString(m) } +func (*Distribution_ExplicitBuckets) ProtoMessage() {} +func (*Distribution_ExplicitBuckets) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0, 2} } + +func (m *Distribution_ExplicitBuckets) GetBounds() []float64 { + if m != nil { + return m.Bounds + } + return nil +} + +func init() { + proto.RegisterType((*Distribution)(nil), "google.api.servicecontrol.v1.Distribution") + proto.RegisterType((*Distribution_LinearBuckets)(nil), "google.api.servicecontrol.v1.Distribution.LinearBuckets") + proto.RegisterType((*Distribution_ExponentialBuckets)(nil), "google.api.servicecontrol.v1.Distribution.ExponentialBuckets") + proto.RegisterType((*Distribution_ExplicitBuckets)(nil), "google.api.servicecontrol.v1.Distribution.ExplicitBuckets") +} + +func init() { proto.RegisterFile("google/api/servicecontrol/v1/distribution.proto", fileDescriptor1) } + +var fileDescriptor1 = []byte{ + // 486 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x93, 0x4d, 0x6f, 0xd3, 0x40, + 0x10, 0x86, 0x31, 0x6e, 0x52, 0x18, 0x12, 0x52, 0x96, 0x82, 0xac, 0x88, 0x83, 0x45, 0x2f, 0x41, + 0x42, 0xb6, 0x0a, 0x07, 0x10, 0x88, 0x4b, 0x28, 0x15, 0x42, 0x48, 0x54, 0xe6, 0xc6, 0xc5, 0xda, + 0xd8, 0x6b, 0x77, 0x55, 0x7b, 0xc7, 0xec, 0x47, 0x9a, 0x0b, 0x57, 0x7e, 0x0f, 0x3f, 0x8f, 0x23, + 0xf2, 0xae, 0xf3, 0x45, 0xab, 0x48, 0xb9, 0xf9, 0x7d, 0xc7, 0x33, 0xcf, 0xec, 0x68, 0x06, 0xe2, + 0x12, 0xb1, 0xac, 0x58, 0x4c, 0x1b, 0x1e, 0x2b, 0x26, 0xe7, 0x3c, 0x63, 0x19, 0x0a, 0x2d, 0xb1, + 0x8a, 0xe7, 0xa7, 0x71, 0xce, 0x95, 0x96, 0x7c, 0x66, 0x34, 0x47, 0x11, 0x35, 0x12, 0x35, 0x92, + 0x67, 0x2e, 0x21, 0xa2, 0x0d, 0x8f, 0xb6, 0x13, 0xa2, 0xf9, 0xe9, 0xf3, 0x3f, 0x7d, 0x18, 0x9c, + 0x6d, 0x24, 0x91, 0x63, 0xe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d, 0xaf, 0x60, 0xb8, 0xf5, 0x78, + 0xf2, 0x12, 0x88, 0x30, 0x75, 0x5a, 0x70, 0xc1, 0x35, 0x5b, 0xb1, 0xdb, 0xbd, 0xe8, 0x25, 0x47, + 0xc2, 0xd4, 0xe7, 0x36, 0xb0, 0xfc, 0xfb, 0x18, 0x7a, 0xd7, 0x3c, 0xd7, 0x97, 0xdd, 0x8e, 0x38, + 0x41, 0x9e, 0x42, 0x1f, 0x8b, 0x42, 0x31, 0xdd, 0xed, 0x48, 0xa7, 0xc6, 0xbf, 0x80, 0xdc, 0x9c, + 0xc0, 0x9e, 0xc4, 0x13, 0x18, 0x96, 0x12, 0xaf, 0xf5, 0x65, 0x5a, 0xd0, 0x4c, 0xa3, 0xec, 0xc8, + 0x03, 0x67, 0x9e, 0x5b, 0xaf, 0x6d, 0x4b, 0x65, 0xb4, 0x62, 0x1d, 0xdf, 0x89, 0xf1, 0x0b, 0x18, + 0xfd, 0x37, 0x91, 0xb6, 0xd3, 0x19, 0x1a, 0x91, 0xb7, 0x3c, 0xbf, 0xed, 0xd4, 0xa9, 0xe9, 0x68, + 0xb5, 0x79, 0xd8, 0xb4, 0xa3, 0x9c, 0xfe, 0xf6, 0x20, 0xcc, 0xb0, 0xde, 0x39, 0xfc, 0xe9, 0xa3, + 0xcd, 0xe9, 0x5f, 0xb4, 0x87, 0x78, 0xe1, 0xfd, 0xf8, 0xd2, 0xa5, 0x94, 0x58, 0x51, 0x51, 0x46, + 0x28, 0xcb, 0xb8, 0x64, 0xc2, 0x9e, 0x69, 0x77, 0xd6, 0xb4, 0xe1, 0xea, 0xf6, 0xd3, 0x7e, 0xbf, + 0xed, 0xfc, 0xf5, 0xbc, 0x59, 0xdf, 0x66, 0xbe, 0xfe, 0x17, 0x00, 0x00, 0xff, 0xff, 0x14, 0x52, + 0xaf, 0xef, 0x13, 0x04, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/api/servicecontrol/v1/log_entry.pb.go b/vendor/google.golang.org/genproto/googleapis/api/servicecontrol/v1/log_entry.pb.go new file mode 100644 index 0000000000..727a19b6e8 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/api/servicecontrol/v1/log_entry.pb.go @@ -0,0 +1,258 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/api/servicecontrol/v1/log_entry.proto + +package servicecontrol + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_logging_type "google.golang.org/genproto/googleapis/logging/type" +import google_protobuf1 "github.com/golang/protobuf/ptypes/any" +import google_protobuf2 "github.com/golang/protobuf/ptypes/struct" +import google_protobuf3 "github.com/golang/protobuf/ptypes/timestamp" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// An individual log entry. +type LogEntry struct { + // Required. The log to which this log entry belongs. Examples: `"syslog"`, + // `"book_log"`. + Name string `protobuf:"bytes,10,opt,name=name" json:"name,omitempty"` + // The time the event described by the log entry occurred. If + // omitted, defaults to operation start time. + Timestamp *google_protobuf3.Timestamp `protobuf:"bytes,11,opt,name=timestamp" json:"timestamp,omitempty"` + // The severity of the log entry. The default value is + // `LogSeverity.DEFAULT`. + Severity google_logging_type.LogSeverity `protobuf:"varint,12,opt,name=severity,enum=google.logging.type.LogSeverity" json:"severity,omitempty"` + // A unique ID for the log entry used for deduplication. If omitted, + // the implementation will generate one based on operation_id. + InsertId string `protobuf:"bytes,4,opt,name=insert_id,json=insertId" json:"insert_id,omitempty"` + // A set of user-defined (key, value) data that provides additional + // information about the log entry. + Labels map[string]string `protobuf:"bytes,13,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // The log entry payload, which can be one of multiple types. + // + // Types that are valid to be assigned to Payload: + // *LogEntry_ProtoPayload + // *LogEntry_TextPayload + // *LogEntry_StructPayload + Payload isLogEntry_Payload `protobuf_oneof:"payload"` +} + +func (m *LogEntry) Reset() { *m = LogEntry{} } +func (m *LogEntry) String() string { return proto.CompactTextString(m) } +func (*LogEntry) ProtoMessage() {} +func (*LogEntry) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} } + +type isLogEntry_Payload interface { + isLogEntry_Payload() +} + +type LogEntry_ProtoPayload struct { + ProtoPayload *google_protobuf1.Any `protobuf:"bytes,2,opt,name=proto_payload,json=protoPayload,oneof"` +} +type LogEntry_TextPayload struct { + TextPayload string `protobuf:"bytes,3,opt,name=text_payload,json=textPayload,oneof"` +} +type LogEntry_StructPayload struct { + StructPayload *google_protobuf2.Struct `protobuf:"bytes,6,opt,name=struct_payload,json=structPayload,oneof"` +} + +func (*LogEntry_ProtoPayload) isLogEntry_Payload() {} +func (*LogEntry_TextPayload) isLogEntry_Payload() {} +func (*LogEntry_StructPayload) isLogEntry_Payload() {} + +func (m *LogEntry) GetPayload() isLogEntry_Payload { + if m != nil { + return m.Payload + } + return nil +} + +func (m *LogEntry) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *LogEntry) GetTimestamp() *google_protobuf3.Timestamp { + if m != nil { + return m.Timestamp + } + return nil +} + +func (m *LogEntry) GetSeverity() google_logging_type.LogSeverity { + if m != nil { + return m.Severity + } + return google_logging_type.LogSeverity_DEFAULT +} + +func (m *LogEntry) GetInsertId() string { + if m != nil { + return m.InsertId + } + return "" +} + +func (m *LogEntry) GetLabels() map[string]string { + if m != nil { + return m.Labels + } + return nil +} + +func (m *LogEntry) GetProtoPayload() *google_protobuf1.Any { + if x, ok := m.GetPayload().(*LogEntry_ProtoPayload); ok { + return x.ProtoPayload + } + return nil +} + +func (m *LogEntry) GetTextPayload() string { + if x, ok := m.GetPayload().(*LogEntry_TextPayload); ok { + return x.TextPayload + } + return "" +} + +func (m *LogEntry) GetStructPayload() *google_protobuf2.Struct { + if x, ok := m.GetPayload().(*LogEntry_StructPayload); ok { + return x.StructPayload + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*LogEntry) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _LogEntry_OneofMarshaler, _LogEntry_OneofUnmarshaler, _LogEntry_OneofSizer, []interface{}{ + (*LogEntry_ProtoPayload)(nil), + (*LogEntry_TextPayload)(nil), + (*LogEntry_StructPayload)(nil), + } +} + +func _LogEntry_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*LogEntry) + // payload + switch x := m.Payload.(type) { + case *LogEntry_ProtoPayload: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ProtoPayload); err != nil { + return err + } + case *LogEntry_TextPayload: + b.EncodeVarint(3<<3 | proto.WireBytes) + b.EncodeStringBytes(x.TextPayload) + case *LogEntry_StructPayload: + b.EncodeVarint(6<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.StructPayload); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("LogEntry.Payload has unexpected type %T", x) + } + return nil +} + +func _LogEntry_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*LogEntry) + switch tag { + case 2: // payload.proto_payload + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(google_protobuf1.Any) + err := b.DecodeMessage(msg) + m.Payload = &LogEntry_ProtoPayload{msg} + return true, err + case 3: // payload.text_payload + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Payload = &LogEntry_TextPayload{x} + return true, err + case 6: // payload.struct_payload + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(google_protobuf2.Struct) + err := b.DecodeMessage(msg) + m.Payload = &LogEntry_StructPayload{msg} + return true, err + default: + return false, nil + } +} + +func _LogEntry_OneofSizer(msg proto.Message) (n int) { + m := msg.(*LogEntry) + // payload + switch x := m.Payload.(type) { + case *LogEntry_ProtoPayload: + s := proto.Size(x.ProtoPayload) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *LogEntry_TextPayload: + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.TextPayload))) + n += len(x.TextPayload) + case *LogEntry_StructPayload: + s := proto.Size(x.StructPayload) + n += proto.SizeVarint(6<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +func init() { + proto.RegisterType((*LogEntry)(nil), "google.api.servicecontrol.v1.LogEntry") +} + +func init() { proto.RegisterFile("google/api/servicecontrol/v1/log_entry.proto", fileDescriptor2) } + +var fileDescriptor2 = []byte{ + // 454 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x93, 0x4f, 0x8f, 0xd3, 0x30, + 0x10, 0xc5, 0x9b, 0xed, 0x52, 0x1a, 0xa7, 0x5d, 0x21, 0x6b, 0x25, 0x42, 0xa8, 0x44, 0x04, 0x12, + 0xea, 0x01, 0x39, 0xda, 0x72, 0x59, 0x58, 0x0e, 0x50, 0x09, 0xa9, 0xac, 0x7a, 0x58, 0x65, 0x39, + 0x71, 0xa9, 0xdc, 0xd6, 0x58, 0x16, 0xae, 0x27, 0x4a, 0xdc, 0x88, 0x9c, 0xf8, 0xbc, 0x7c, 0x0b, + 0x94, 0xb1, 0x53, 0xf6, 0x9f, 0xf6, 0xe6, 0xf1, 0xfb, 0xbd, 0x99, 0x79, 0x8e, 0x42, 0xde, 0x49, + 0x00, 0xa9, 0x45, 0xc6, 0x0b, 0x95, 0x55, 0xa2, 0xac, 0xd5, 0x46, 0x6c, 0xc0, 0xd8, 0x12, 0x74, + 0x56, 0x9f, 0x65, 0x1a, 0xe4, 0x4a, 0x18, 0x5b, 0x36, 0x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0x26, 0x3c, 0xe7, 0xbe, 0x03, 0xbd, 0x20, 0x63, 0xcc, 0xb1, 0x2a, 0x78, 0xa3, 0x81, 0x6f, 0xe3, + 0x23, 0x0c, 0x79, 0x7a, 0x2f, 0xe4, 0x17, 0xd3, 0x2c, 0x7a, 0xf9, 0x08, 0xeb, 0x2b, 0xc7, 0xd2, + 0x37, 0x64, 0x64, 0xc5, 0x6f, 0x7b, 0xf0, 0xf6, 0xdb, 0x45, 0x17, 0xbd, 0x3c, 0x6a, 0x6f, 0x3b, + 0xe8, 0x33, 0x39, 0x71, 0x1f, 0xe5, 0x80, 0x0d, 0x70, 0xc4, 0xf3, 0x7b, 0x23, 0xae, 0x11, 0x5b, + 0xf4, 0xf2, 0xb1, 0x33, 0xf8, 0x0e, 0xc9, 0x07, 0x12, 0xdd, 0x58, 0x9d, 0x3e, 0x23, 0xfd, 0x5f, + 0xa2, 0x89, 0x03, 0x7c, 0x95, 0xf6, 0x48, 0x4f, 0xc9, 0x93, 0x9a, 0xeb, 0xbd, 0xc0, 0xe5, 0xc3, + 0xdc, 0x15, 0x1f, 0x8f, 0xce, 0x83, 0x79, 0x48, 0x9e, 0xfa, 0xa9, 0xf3, 0x3f, 0x24, 0xdd, 0xc0, + 0xee, 0xd1, 0xa7, 0x9a, 0x8f, 0xbb, 0xb7, 0xba, 0xc2, 0x98, 0xc1, 0x8f, 0x4b, 0x8f, 0x4b, 0xd0, + 0xdc, 0x48, 0x06, 0xa5, 0xcc, 0xa4, 0x30, 0xb8, 0x71, 0xe6, 0x24, 0x5e, 0xa8, 0xea, 0xe1, 0x7f, + 0xe5, 0xe2, 0xf6, 0xcd, 0x7a, 0x80, 0xb6, 0xf7, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x67, 0x50, + 0x6e, 0x13, 0x61, 0x03, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/api/servicecontrol/v1/metric_value.pb.go b/vendor/google.golang.org/genproto/googleapis/api/servicecontrol/v1/metric_value.pb.go new file mode 100644 index 0000000000..ab7ccb1e3c --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/api/servicecontrol/v1/metric_value.pb.go @@ -0,0 +1,324 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/api/servicecontrol/v1/metric_value.proto + +package servicecontrol + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf3 "github.com/golang/protobuf/ptypes/timestamp" +import _ "google.golang.org/genproto/googleapis/type/money" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Represents a single metric value. +type MetricValue struct { + // The labels describing the metric value. + // See comments on [google.api.servicecontrol.v1.Operation.labels][google.api.servicecontrol.v1.Operation.labels] for + // the overriding relationship. + Labels map[string]string `protobuf:"bytes,1,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // The start of the time period over which this metric value's measurement + // applies. The time period has different semantics for different metric + // types (cumulative, delta, and gauge). See the metric definition + // documentation in the service configuration for details. + StartTime *google_protobuf3.Timestamp `protobuf:"bytes,2,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + // The end of the time period over which this metric value's measurement + // applies. + EndTime *google_protobuf3.Timestamp `protobuf:"bytes,3,opt,name=end_time,json=endTime" json:"end_time,omitempty"` + // The value. The type of value used in the request must + // agree with the metric definition in the service configuration, otherwise + // the MetricValue is rejected. + // + // Types that are valid to be assigned to Value: + // *MetricValue_BoolValue + // *MetricValue_Int64Value + // *MetricValue_DoubleValue + // *MetricValue_StringValue + // *MetricValue_DistributionValue + Value isMetricValue_Value `protobuf_oneof:"value"` +} + +func (m *MetricValue) Reset() { *m = MetricValue{} } +func (m *MetricValue) String() string { return proto.CompactTextString(m) } +func (*MetricValue) ProtoMessage() {} +func (*MetricValue) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} } + +type isMetricValue_Value interface { + isMetricValue_Value() +} + +type MetricValue_BoolValue struct { + BoolValue bool `protobuf:"varint,4,opt,name=bool_value,json=boolValue,oneof"` +} +type MetricValue_Int64Value struct { + Int64Value int64 `protobuf:"varint,5,opt,name=int64_value,json=int64Value,oneof"` +} +type MetricValue_DoubleValue struct { + DoubleValue float64 `protobuf:"fixed64,6,opt,name=double_value,json=doubleValue,oneof"` +} +type MetricValue_StringValue struct { + StringValue string `protobuf:"bytes,7,opt,name=string_value,json=stringValue,oneof"` +} +type MetricValue_DistributionValue struct { + DistributionValue *Distribution `protobuf:"bytes,8,opt,name=distribution_value,json=distributionValue,oneof"` +} + +func (*MetricValue_BoolValue) isMetricValue_Value() {} +func (*MetricValue_Int64Value) isMetricValue_Value() {} +func (*MetricValue_DoubleValue) isMetricValue_Value() {} +func (*MetricValue_StringValue) isMetricValue_Value() {} +func (*MetricValue_DistributionValue) isMetricValue_Value() {} + +func (m *MetricValue) GetValue() isMetricValue_Value { + if m != nil { + return m.Value + } + return nil +} + +func (m *MetricValue) GetLabels() map[string]string { + if m != nil { + return m.Labels + } + return nil +} + +func (m *MetricValue) GetStartTime() *google_protobuf3.Timestamp { + if m != nil { + return m.StartTime + } + return nil +} + +func (m *MetricValue) GetEndTime() *google_protobuf3.Timestamp { + if m != nil { + return m.EndTime + } + return nil +} + +func (m *MetricValue) GetBoolValue() bool { + if x, ok := m.GetValue().(*MetricValue_BoolValue); ok { + return x.BoolValue + } + return false +} + +func (m *MetricValue) GetInt64Value() int64 { + if x, ok := m.GetValue().(*MetricValue_Int64Value); ok { + return x.Int64Value + } + return 0 +} + +func (m *MetricValue) GetDoubleValue() float64 { + if x, ok := m.GetValue().(*MetricValue_DoubleValue); ok { + return x.DoubleValue + } + return 0 +} + +func (m *MetricValue) GetStringValue() string { + if x, ok := m.GetValue().(*MetricValue_StringValue); ok { + return x.StringValue + } + return "" +} + +func (m *MetricValue) GetDistributionValue() *Distribution { + if x, ok := m.GetValue().(*MetricValue_DistributionValue); ok { + return x.DistributionValue + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*MetricValue) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _MetricValue_OneofMarshaler, _MetricValue_OneofUnmarshaler, _MetricValue_OneofSizer, []interface{}{ + (*MetricValue_BoolValue)(nil), + (*MetricValue_Int64Value)(nil), + (*MetricValue_DoubleValue)(nil), + (*MetricValue_StringValue)(nil), + (*MetricValue_DistributionValue)(nil), + } +} + +func _MetricValue_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*MetricValue) + // value + switch x := m.Value.(type) { + case *MetricValue_BoolValue: + t := uint64(0) + if x.BoolValue { + t = 1 + } + b.EncodeVarint(4<<3 | proto.WireVarint) + b.EncodeVarint(t) + case *MetricValue_Int64Value: + b.EncodeVarint(5<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.Int64Value)) + case *MetricValue_DoubleValue: + b.EncodeVarint(6<<3 | proto.WireFixed64) + b.EncodeFixed64(math.Float64bits(x.DoubleValue)) + case *MetricValue_StringValue: + b.EncodeVarint(7<<3 | proto.WireBytes) + b.EncodeStringBytes(x.StringValue) + case *MetricValue_DistributionValue: + b.EncodeVarint(8<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.DistributionValue); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("MetricValue.Value has unexpected type %T", x) + } + return nil +} + +func _MetricValue_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*MetricValue) + switch tag { + case 4: // value.bool_value + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Value = &MetricValue_BoolValue{x != 0} + return true, err + case 5: // value.int64_value + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Value = &MetricValue_Int64Value{int64(x)} + return true, err + case 6: // value.double_value + if wire != proto.WireFixed64 { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeFixed64() + m.Value = &MetricValue_DoubleValue{math.Float64frombits(x)} + return true, err + case 7: // value.string_value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Value = &MetricValue_StringValue{x} + return true, err + case 8: // value.distribution_value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Distribution) + err := b.DecodeMessage(msg) + m.Value = &MetricValue_DistributionValue{msg} + return true, err + default: + return false, nil + } +} + +func _MetricValue_OneofSizer(msg proto.Message) (n int) { + m := msg.(*MetricValue) + // value + switch x := m.Value.(type) { + case *MetricValue_BoolValue: + n += proto.SizeVarint(4<<3 | proto.WireVarint) + n += 1 + case *MetricValue_Int64Value: + n += proto.SizeVarint(5<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.Int64Value)) + case *MetricValue_DoubleValue: + n += proto.SizeVarint(6<<3 | proto.WireFixed64) + n += 8 + case *MetricValue_StringValue: + n += proto.SizeVarint(7<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.StringValue))) + n += len(x.StringValue) + case *MetricValue_DistributionValue: + s := proto.Size(x.DistributionValue) + n += proto.SizeVarint(8<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Represents a set of metric values in the same metric. +// Each metric value in the set should have a unique combination of start time, +// end time, and label values. +type MetricValueSet struct { + // The metric name defined in the service configuration. + MetricName string `protobuf:"bytes,1,opt,name=metric_name,json=metricName" json:"metric_name,omitempty"` + // The values in this metric. + MetricValues []*MetricValue `protobuf:"bytes,2,rep,name=metric_values,json=metricValues" json:"metric_values,omitempty"` +} + +func (m *MetricValueSet) Reset() { *m = MetricValueSet{} } +func (m *MetricValueSet) String() string { return proto.CompactTextString(m) } +func (*MetricValueSet) ProtoMessage() {} +func (*MetricValueSet) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{1} } + +func (m *MetricValueSet) GetMetricName() string { + if m != nil { + return m.MetricName + } + return "" +} + +func (m *MetricValueSet) GetMetricValues() []*MetricValue { + if m != nil { + return m.MetricValues + } + return nil +} + +func init() { + proto.RegisterType((*MetricValue)(nil), "google.api.servicecontrol.v1.MetricValue") + proto.RegisterType((*MetricValueSet)(nil), "google.api.servicecontrol.v1.MetricValueSet") +} + +func init() { proto.RegisterFile("google/api/servicecontrol/v1/metric_value.proto", fileDescriptor3) } + +var fileDescriptor3 = []byte{ + // 482 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0xcf, 0x8b, 0xd3, 0x40, + 0x14, 0xc7, 0x3b, 0x8d, 0xdb, 0x1f, 0x2f, 0xab, 0x68, 0x14, 0x0c, 0x65, 0xa1, 0x71, 0xbd, 0x44, + 0x0f, 0x13, 0x76, 0x75, 0xc5, 0xd5, 0x5b, 0x51, 0x28, 0xe2, 0x2e, 0x4b, 0x14, 0x0f, 0x7a, 0x58, + 0x26, 0xed, 0x33, 0x0c, 0x26, 0x33, 0x21, 0x33, 0x2d, 0xf4, 0xe8, 0xcd, 0x3f, 0xd9, 0x8b, 0x20, + 0xf3, 0xa3, 0x9a, 0x82, 0xd4, 0xbd, 0xe5, 0x7d, 0xf3, 0xfd, 0xbc, 0x7c, 0x27, 0xef, 0x0d, 0x64, + 0xa5, 0x94, 0x65, 0x85, 0x19, 0x6b, 0x78, 0xa6, 0xb0, 0x5d, 0xf3, 0x05, 0x2e, 0xa4, 0xd0, 0xad, + 0xac, 0xb2, 0xf5, 0x49, 0x56, 0xa3, 0x6e, 0xf9, 0xe2, 0x7a, 0xcd, 0xaa, 0x15, 0xd2, 0xa6, 0x95, + 0x5a, 0x46, 0x47, 0x0e, 0xa0, 0xac, 0xe1, 0x74, 0x17, 0xa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a, 0xf5, 0x8f, 0xc9, 0xcc, 0x41, 0x94, 0xde, 0x34, 0x4c, 0x48, 0x3a, 0x36, 0x26, 0xa7, 0x3a, + 0xd3, 0x17, 0x88, 0xba, 0xe3, 0xf2, 0xd6, 0x91, 0x3d, 0xce, 0xd3, 0xfd, 0xbf, 0xf6, 0x4d, 0x87, + 0x9b, 0xf7, 0xf2, 0x7b, 0xdd, 0x3e, 0xb6, 0xf9, 0xe4, 0x1c, 0xc2, 0xce, 0x3f, 0x8f, 0xee, 0x42, + 0xf0, 0x0d, 0x37, 0x31, 0x31, 0x39, 0x72, 0xf3, 0x18, 0x3d, 0x80, 0x03, 0xf7, 0xc1, 0xbe, 0xd5, + 0x5c, 0xf1, 0xaa, 0xff, 0x92, 0xcc, 0x86, 0xfe, 0xcd, 0xf1, 0x77, 0x02, 0x77, 0x3a, 0x43, 0xfc, + 0x80, 0x3a, 0x9a, 0x42, 0xe8, 0xf7, 0x59, 0xb0, 0x1a, 0x7d, 0x3f, 0x70, 0xd2, 0x25, 0xab, 0x31, + 0xba, 0x84, 0xdb, 0xdd, 0x85, 0x57, 0x71, 0xdf, 0xae, 0xca, 0x93, 0x1b, 0xaf, 0x4a, 0x7e, 0x58, + 0xff, 0x2d, 0xd4, 0xec, 0x07, 0x81, 0x64, 0x21, 0xeb, 0xbd, 0xf8, 0xec, 0xfe, 0x6e, 0xca, 0x2b, + 0xb3, 0x02, 0x57, 0xe4, 0xf3, 0x3b, 0x0f, 0x95, 0xb2, 0x62, 0xa2, 0xa4, 0xb2, 0x2d, 0xb3, 0x12, + 0x85, 0x5d, 0x10, 0x7f, 0x8b, 0x58, 0xc3, 0xd5, 0xbf, 0x6f, 0xd2, 0xeb, 0x5d, 0xe5, 0x27, 0x21, + 0xc5, 0xc0, 0x92, 0xcf, 0x7e, 0x07, 0x00, 0x00, 0xff, 0xff, 0xdb, 0x00, 0x1a, 0xde, 0xef, 0x03, + 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/api/servicecontrol/v1/operation.pb.go b/vendor/google.golang.org/genproto/googleapis/api/servicecontrol/v1/operation.pb.go new file mode 100644 index 0000000000..f94c2e7b17 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/api/servicecontrol/v1/operation.pb.go @@ -0,0 +1,215 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/api/servicecontrol/v1/operation.proto + +package servicecontrol + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf3 "github.com/golang/protobuf/ptypes/timestamp" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Defines the importance of the data contained in the operation. +type Operation_Importance int32 + +const ( + // The API implementation may cache and aggregate the data. + // The data may be lost when rare and unexpected system failures occur. + Operation_LOW Operation_Importance = 0 + // The API implementation doesn't cache and aggregate the data. + // If the method returns successfully, it's guaranteed that the data has + // been persisted in durable storage. + Operation_HIGH Operation_Importance = 1 +) + +var Operation_Importance_name = map[int32]string{ + 0: "LOW", + 1: "HIGH", +} +var Operation_Importance_value = map[string]int32{ + "LOW": 0, + "HIGH": 1, +} + +func (x Operation_Importance) String() string { + return proto.EnumName(Operation_Importance_name, int32(x)) +} +func (Operation_Importance) EnumDescriptor() ([]byte, []int) { return fileDescriptor4, []int{0, 0} } + +// Represents information regarding an operation. +type Operation struct { + // Identity of the operation. This must be unique within the scope of the + // service that generated the operation. If the service calls + // Check() and Report() on the same operation, the two calls should carry + // the same id. + // + // UUID version 4 is recommended, though not required. + // In scenarios where an operation is computed from existing information + // and an idempotent id is desirable for deduplication purpose, UUID version 5 + // is recommended. See RFC 4122 for details. + OperationId string `protobuf:"bytes,1,opt,name=operation_id,json=operationId" json:"operation_id,omitempty"` + // Fully qualified name of the operation. Reserved for future use. + OperationName string `protobuf:"bytes,2,opt,name=operation_name,json=operationName" json:"operation_name,omitempty"` + // Identity of the consumer who is using the service. + // This field should be filled in for the operations initiated by a + // consumer, but not for service-initiated operations that are + // not related to a specific consumer. + // + // This can be in one of the following formats: + // project:, + // project_number:, + // api_key:. + ConsumerId string `protobuf:"bytes,3,opt,name=consumer_id,json=consumerId" json:"consumer_id,omitempty"` + // Required. Start time of the operation. + StartTime *google_protobuf3.Timestamp `protobuf:"bytes,4,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + // End time of the operation. + // Required when the operation is used in [ServiceController.Report][google.api.servicecontrol.v1.ServiceController.Report], + // but optional when the operation is used in [ServiceController.Check][google.api.servicecontrol.v1.ServiceController.Check]. + EndTime *google_protobuf3.Timestamp `protobuf:"bytes,5,opt,name=end_time,json=endTime" json:"end_time,omitempty"` + // Labels describing the operation. Only the following labels are allowed: + // + // - Labels describing monitored resources as defined in + // the service configuration. + // - Default labels of metric values. When specified, labels defined in the + // metric value override these default. + // - The following labels defined by Google Cloud Platform: + // - `cloud.googleapis.com/location` describing the location where the + // operation happened, + // - `servicecontrol.googleapis.com/user_agent` describing the user agent + // of the API request, + // - `servicecontrol.googleapis.com/service_agent` describing the service + // used to handle the API request (e.g. ESP), + // - `servicecontrol.googleapis.com/platform` describing the platform + // where the API is served (e.g. GAE, GCE, GKE). + Labels map[string]string `protobuf:"bytes,6,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // Represents information about this operation. Each MetricValueSet + // corresponds to a metric defined in the service configuration. + // The data type used in the MetricValueSet must agree with + // the data type specified in the metric definition. + // + // Within a single operation, it is not allowed to have more than one + // MetricValue instances that have the same metric names and identical + // label value combinations. If a request has such duplicated MetricValue + // instances, the entire request is rejected with + // an invalid argument error. + MetricValueSets []*MetricValueSet `protobuf:"bytes,7,rep,name=metric_value_sets,json=metricValueSets" json:"metric_value_sets,omitempty"` + // Represents information to be logged. + LogEntries []*LogEntry `protobuf:"bytes,8,rep,name=log_entries,json=logEntries" json:"log_entries,omitempty"` + // DO NOT USE. This is an experimental field. + Importance Operation_Importance `protobuf:"varint,11,opt,name=importance,enum=google.api.servicecontrol.v1.Operation_Importance" json:"importance,omitempty"` +} + +func (m *Operation) Reset() { *m = Operation{} } +func (m *Operation) String() string { return proto.CompactTextString(m) } +func (*Operation) ProtoMessage() {} +func (*Operation) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{0} } + +func (m *Operation) GetOperationId() string { + if m != nil { + return m.OperationId + } + return "" +} + +func (m *Operation) GetOperationName() string { + if m != nil { + return m.OperationName + } + return "" +} + +func (m *Operation) GetConsumerId() string { + if m != nil { + return m.ConsumerId + } + return "" +} + +func (m *Operation) GetStartTime() *google_protobuf3.Timestamp { + if m != nil { + return m.StartTime + } + return nil +} + +func (m *Operation) GetEndTime() *google_protobuf3.Timestamp { + if m != nil { + return m.EndTime + } + return nil +} + +func (m *Operation) GetLabels() map[string]string { + if m != nil { + return m.Labels + } + return nil +} + +func (m *Operation) GetMetricValueSets() []*MetricValueSet { + if m != nil { + return m.MetricValueSets + } + return nil +} + +func (m *Operation) GetLogEntries() []*LogEntry { + if m != nil { + return m.LogEntries + } + return nil +} + +func (m *Operation) GetImportance() Operation_Importance { + if m != nil { + return m.Importance + } + return Operation_LOW +} + +func init() { + proto.RegisterType((*Operation)(nil), "google.api.servicecontrol.v1.Operation") + proto.RegisterEnum("google.api.servicecontrol.v1.Operation_Importance", Operation_Importance_name, Operation_Importance_value) +} + +func init() { proto.RegisterFile("google/api/servicecontrol/v1/operation.proto", fileDescriptor4) } + +var fileDescriptor4 = []byte{ + // 483 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0xcf, 0x6b, 0x13, 0x41, + 0x14, 0xc7, 0x9d, 0xa6, 0xf9, 0xf5, 0x56, 0x63, 0x1c, 0x3c, 0x2c, 0xa1, 0x90, 0x58, 0x50, 0x72, + 0x28, 0xb3, 0x34, 0x45, 0xb0, 0x7a, 0x2b,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0x18, + 0xe0, 0xce, 0x94, 0x76, 0xa1, 0xb5, 0xb8, 0xfe, 0x3a, 0x7c, 0x40, 0x7b, 0x70, 0x78, 0x35, 0xbf, + 0xbc, 0x1a, 0x92, 0x8b, 0x5f, 0x04, 0x26, 0x91, 0x4a, 0x1b, 0x13, 0x5e, 0x0c, 0xea, 0x88, 0x37, + 0xf9, 0xaa, 0x6f, 0xc8, 0xf7, 0x77, 0xa5, 0x3e, 0x56, 0x09, 0x97, 0x31, 0x53, 0x3a, 0x0e, 0x62, + 0x94, 0xee, 0x22, 0x94, 0xcf, 0x85, 0x67, 0xc2, 0xfc, 0xfb, 0xc9, 0xbc, 0xd9, 0xef, 0xfc, 0x21, + 0x64, 0xd5, 0x71, 0xe4, 0xd9, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x8d, 0x9c, 0xc2, 0x5d, 0x03, + 0x04, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/api/servicecontrol/v1/quota_controller.pb.go b/vendor/google.golang.org/genproto/googleapis/api/servicecontrol/v1/quota_controller.pb.go new file mode 100644 index 0000000000..70f9c50001 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/api/servicecontrol/v1/quota_controller.pb.go @@ -0,0 +1,489 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/api/servicecontrol/v1/quota_controller.proto + +package servicecontrol + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Supported quota modes. +type QuotaOperation_QuotaMode int32 + +const ( + // Guard against implicit default. Must not be used. + QuotaOperation_UNSPECIFIED QuotaOperation_QuotaMode = 0 + // For AllocateQuota request, allocates quota for the amount specified in + // the service configuration or specified using the quota metrics. If the + // amount is higher than the available quota, allocation error will be + // returned and no quota will be allocated. + QuotaOperation_NORMAL QuotaOperation_QuotaMode = 1 + // The operation allocates quota for the amount specified in the service + // configuration or specified using the quota metrics. If the amount is + // higher than the available quota, request does not fail but all available + // quota will be allocated. + QuotaOperation_BEST_EFFORT QuotaOperation_QuotaMode = 2 + // For AllocateQuota request, only checks if there is enough quota + // available and does not change the available quota. No lock is placed on + // the available quota either. + QuotaOperation_CHECK_ONLY QuotaOperation_QuotaMode = 3 +) + +var QuotaOperation_QuotaMode_name = map[int32]string{ + 0: "UNSPECIFIED", + 1: "NORMAL", + 2: "BEST_EFFORT", + 3: "CHECK_ONLY", +} +var QuotaOperation_QuotaMode_value = map[string]int32{ + "UNSPECIFIED": 0, + "NORMAL": 1, + "BEST_EFFORT": 2, + "CHECK_ONLY": 3, +} + +func (x QuotaOperation_QuotaMode) String() string { + return proto.EnumName(QuotaOperation_QuotaMode_name, int32(x)) +} +func (QuotaOperation_QuotaMode) EnumDescriptor() ([]byte, []int) { return fileDescriptor5, []int{1, 0} } + +// Error codes related to project config validations are deprecated since the +// quota controller methods do not perform these validations. Instead services +// have to call the Check method, without quota_properties field, to perform +// these validations before calling the quota controller methods. These +// methods check only for project deletion to be wipe out compliant. +type QuotaError_Code int32 + +const ( + // This is never used. + QuotaError_UNSPECIFIED QuotaError_Code = 0 + // Quota allocation failed. + // Same as [google.rpc.Code.RESOURCE_EXHAUSTED][]. + QuotaError_RESOURCE_EXHAUSTED QuotaError_Code = 8 + // Consumer cannot access the service because the service requires active + // billing. + QuotaError_BILLING_NOT_ACTIVE QuotaError_Code = 107 + // Consumer's project has been marked as deleted (soft deletion). + QuotaError_PROJECT_DELETED QuotaError_Code = 108 + // Specified API key is invalid. + QuotaError_API_KEY_INVALID QuotaError_Code = 105 + // Specified API Key has expired. + QuotaError_API_KEY_EXPIRED QuotaError_Code = 112 +) + +var QuotaError_Code_name = map[int32]string{ + 0: "UNSPECIFIED", + 8: "RESOURCE_EXHAUSTED", + 107: "BILLING_NOT_ACTIVE", + 108: "PROJECT_DELETED", + 105: "API_KEY_INVALID", + 112: "API_KEY_EXPIRED", +} +var QuotaError_Code_value = map[string]int32{ + "UNSPECIFIED": 0, + "RESOURCE_EXHAUSTED": 8, + "BILLING_NOT_ACTIVE": 107, + "PROJECT_DELETED": 108, + "API_KEY_INVALID": 105, + "API_KEY_EXPIRED": 112, +} + +func (x QuotaError_Code) String() string { + return proto.EnumName(QuotaError_Code_name, int32(x)) +} +func (QuotaError_Code) EnumDescriptor() ([]byte, []int) { return fileDescriptor5, []int{3, 0} } + +// Request message for the AllocateQuota method. +type AllocateQuotaRequest struct { + // Name of the service as specified in the service configuration. For example, + // `"pubsub.googleapis.com"`. + // + // See [google.api.Service][google.api.Service] for the definition of a service name. + ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName" json:"service_name,omitempty"` + // Operation that describes the quota allocation. + AllocateOperation *QuotaOperation `protobuf:"bytes,2,opt,name=allocate_operation,json=allocateOperation" json:"allocate_operation,omitempty"` + // Specifies which version of service configuration should be used to process + // the request. If unspecified or no matching version can be found, the latest + // one will be used. + ServiceConfigId string `protobuf:"bytes,4,opt,name=service_config_id,json=serviceConfigId" json:"service_config_id,omitempty"` +} + +func (m *AllocateQuotaRequest) Reset() { *m = AllocateQuotaRequest{} } +func (m *AllocateQuotaRequest) String() string { return proto.CompactTextString(m) } +func (*AllocateQuotaRequest) ProtoMessage() {} +func (*AllocateQuotaRequest) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{0} } + +func (m *AllocateQuotaRequest) GetServiceName() string { + if m != nil { + return m.ServiceName + } + return "" +} + +func (m *AllocateQuotaRequest) GetAllocateOperation() *QuotaOperation { + if m != nil { + return m.AllocateOperation + } + return nil +} + +func (m *AllocateQuotaRequest) GetServiceConfigId() string { + if m != nil { + return m.ServiceConfigId + } + return "" +} + +// Represents information regarding a quota operation. +type QuotaOperation struct { + // Identity of the operation. This is expected to be unique within the scope + // of the service that generated the operation, and guarantees idempotency in + // case of retries. + // + // UUID version 4 is recommended, though not required. In scenarios where an + // operation is computed from existing information and an idempotent id is + // desirable for deduplication purpose, UUID version 5 is recommended. See + // RFC 4122 for details. + OperationId string `protobuf:"bytes,1,opt,name=operation_id,json=operationId" json:"operation_id,omitempty"` + // Fully qualified name of the API method for which this quota operation is + // requested. This name is used for matching quota rules or metric rules and + // billing status rules defined in service configuration. This field is not + // required if the quota operation is performed on non-API resources. + // + // Example of an RPC method name: + // google.example.library.v1.LibraryService.CreateShelf + MethodName string `protobuf:"bytes,2,opt,name=method_name,json=methodName" json:"method_name,omitempty"` + // Identity of the consumer for whom this quota operation is being performed. + // + // This can be in one of the following formats: + // project:, + // project_number:, + // api_key:. + ConsumerId string `protobuf:"bytes,3,opt,name=consumer_id,json=consumerId" json:"consumer_id,omitempty"` + // Labels describing the operation. + Labels map[string]string `protobuf:"bytes,4,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // Represents information about this operation. Each MetricValueSet + // corresponds to a metric defined in the service configuration. + // The data type used in the MetricValueSet must agree with + // the data type specified in the metric definition. + // + // Within a single operation, it is not allowed to have more than one + // MetricValue instances that have the same metric names and identical + // label value combinations. If a request has such duplicated MetricValue + // instances, the entire request is rejected with + // an invalid argument error. + QuotaMetrics []*MetricValueSet `protobuf:"bytes,5,rep,name=quota_metrics,json=quotaMetrics" json:"quota_metrics,omitempty"` + // Quota mode for this operation. + QuotaMode QuotaOperation_QuotaMode `protobuf:"varint,6,opt,name=quota_mode,json=quotaMode,enum=google.api.servicecontrol.v1.QuotaOperation_QuotaMode" json:"quota_mode,omitempty"` +} + +func (m *QuotaOperation) Reset() { *m = QuotaOperation{} } +func (m *QuotaOperation) String() string { return proto.CompactTextString(m) } +func (*QuotaOperation) ProtoMessage() {} +func (*QuotaOperation) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{1} } + +func (m *QuotaOperation) GetOperationId() string { + if m != nil { + return m.OperationId + } + return "" +} + +func (m *QuotaOperation) GetMethodName() string { + if m != nil { + return m.MethodName + } + return "" +} + +func (m *QuotaOperation) GetConsumerId() string { + if m != nil { + return m.ConsumerId + } + return "" +} + +func (m *QuotaOperation) GetLabels() map[string]string { + if m != nil { + return m.Labels + } + return nil +} + +func (m *QuotaOperation) GetQuotaMetrics() []*MetricValueSet { + if m != nil { + return m.QuotaMetrics + } + return nil +} + +func (m *QuotaOperation) GetQuotaMode() QuotaOperation_QuotaMode { + if m != nil { + return m.QuotaMode + } + return QuotaOperation_UNSPECIFIED +} + +// Response message for the AllocateQuota method. +type AllocateQuotaResponse struct { + // The same operation_id value used in the AllocateQuotaRequest. Used for + // logging and diagnostics purposes. + OperationId string `protobuf:"bytes,1,opt,name=operation_id,json=operationId" json:"operation_id,omitempty"` + // Indicates the decision of the allocate. + AllocateErrors []*QuotaError `protobuf:"bytes,2,rep,name=allocate_errors,json=allocateErrors" json:"allocate_errors,omitempty"` + // Quota metrics to indicate the result of allocation. Depending on the + // request, one or more of the following metrics will be included: + // + // 1. Per quota group or per quota metric incremental usage will be specified + // using the following delta metric : + // "serviceruntime.googleapis.com/api/consumer/quota_used_count" + // + // 2. The quota limit reached condition will be specified using the following + // boolean metric : + // "serviceruntime.googleapis.com/quota/exceeded" + QuotaMetrics []*MetricValueSet `protobuf:"bytes,3,rep,name=quota_metrics,json=quotaMetrics" json:"quota_metrics,omitempty"` + // ID of the actual config used to process the request. + ServiceConfigId string `protobuf:"bytes,4,opt,name=service_config_id,json=serviceConfigId" json:"service_config_id,omitempty"` +} + +func (m *AllocateQuotaResponse) Reset() { *m = AllocateQuotaResponse{} } +func (m *AllocateQuotaResponse) String() string { return proto.CompactTextString(m) } +func (*AllocateQuotaResponse) ProtoMessage() {} +func (*AllocateQuotaResponse) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{2} } + +func (m *AllocateQuotaResponse) GetOperationId() string { + if m != nil { + return m.OperationId + } + return "" +} + +func (m *AllocateQuotaResponse) GetAllocateErrors() []*QuotaError { + if m != nil { + return m.AllocateErrors + } + return nil +} + +func (m *AllocateQuotaResponse) GetQuotaMetrics() []*MetricValueSet { + if m != nil { + return m.QuotaMetrics + } + return nil +} + +func (m *AllocateQuotaResponse) GetServiceConfigId() string { + if m != nil { + return m.ServiceConfigId + } + return "" +} + +// Represents error information for [QuotaOperation][google.api.servicecontrol.v1.QuotaOperation]. +type QuotaError struct { + // Error code. + Code QuotaError_Code `protobuf:"varint,1,opt,name=code,enum=google.api.servicecontrol.v1.QuotaError_Code" json:"code,omitempty"` + // Subject to whom this error applies. See the specific enum for more details + // on this field. For example, "clientip:" or + // "project:". + Subject string `protobuf:"bytes,2,opt,name=subject" json:"subject,omitempty"` + // Free-form text that provides details on the cause of the error. + Description string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` +} + +func (m *QuotaError) Reset() { *m = QuotaError{} } +func (m *QuotaError) String() string { return proto.CompactTextString(m) } +func (*QuotaError) ProtoMessage() {} +func (*QuotaError) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{3} } + +func (m *QuotaError) GetCode() QuotaError_Code { + if m != nil { + return m.Code + } + return QuotaError_UNSPECIFIED +} + +func (m *QuotaError) GetSubject() string { + if m != nil { + return m.Subject + } + return "" +} + +func (m *QuotaError) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func init() { + proto.RegisterType((*AllocateQuotaRequest)(nil), "google.api.servicecontrol.v1.AllocateQuotaRequest") + proto.RegisterType((*QuotaOperation)(nil), "google.api.servicecontrol.v1.QuotaOperation") + proto.RegisterType((*AllocateQuotaResponse)(nil), "google.api.servicecontrol.v1.AllocateQuotaResponse") + proto.RegisterType((*QuotaError)(nil), "google.api.servicecontrol.v1.QuotaError") + proto.RegisterEnum("google.api.servicecontrol.v1.QuotaOperation_QuotaMode", QuotaOperation_QuotaMode_name, QuotaOperation_QuotaMode_value) + proto.RegisterEnum("google.api.servicecontrol.v1.QuotaError_Code", QuotaError_Code_name, QuotaError_Code_value) +} + +// 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 + +// Client API for QuotaController service + +type QuotaControllerClient interface { + // Attempts to allocate quota for the specified consumer. It should be called + // before the operation is executed. + // + // This method requires the `servicemanagement.services.quota` + // permission on the specified service. For more information, see + // [Cloud IAM](https://cloud.google.com/iam). + // + // **NOTE:** The client **must** fail-open on server errors `INTERNAL`, + // `UNKNOWN`, `DEADLINE_EXCEEDED`, and `UNAVAILABLE`. To ensure system + // reliability, the server may inject these errors to prohibit any hard + // dependency on the quota functionality. + AllocateQuota(ctx context.Context, in *AllocateQuotaRequest, opts ...grpc.CallOption) (*AllocateQuotaResponse, error) +} + +type quotaControllerClient struct { + cc *grpc.ClientConn +} + +func NewQuotaControllerClient(cc *grpc.ClientConn) QuotaControllerClient { + return "aControllerClient{cc} +} + +func (c *quotaControllerClient) AllocateQuota(ctx context.Context, in *AllocateQuotaRequest, opts ...grpc.CallOption) (*AllocateQuotaResponse, error) { + out := new(AllocateQuotaResponse) + err := grpc.Invoke(ctx, "/google.api.servicecontrol.v1.QuotaController/AllocateQuota", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for QuotaController service + +type QuotaControllerServer interface { + // Attempts to allocate quota for the specified consumer. It should be called + // before the operation is executed. + // + // This method requires the `servicemanagement.services.quota` + // permission on the specified service. For more information, see + // [Cloud IAM](https://cloud.google.com/iam). + // + // **NOTE:** The client **must** fail-open on server errors `INTERNAL`, + // `UNKNOWN`, `DEADLINE_EXCEEDED`, and `UNAVAILABLE`. To ensure system + // reliability, the server may inject these errors to prohibit any hard + // dependency on the quota functionality. + AllocateQuota(context.Context, *AllocateQuotaRequest) (*AllocateQuotaResponse, error) +} + +func RegisterQuotaControllerServer(s *grpc.Server, srv QuotaControllerServer) { + s.RegisterService(&_QuotaController_serviceDesc, srv) +} + +func _QuotaController_AllocateQuota_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AllocateQuotaRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QuotaControllerServer).AllocateQuota(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.api.servicecontrol.v1.QuotaController/AllocateQuota", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QuotaControllerServer).AllocateQuota(ctx, req.(*AllocateQuotaRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _QuotaController_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.api.servicecontrol.v1.QuotaController", + HandlerType: (*QuotaControllerServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "AllocateQuota", + Handler: _QuotaController_AllocateQuota_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/api/servicecontrol/v1/quota_controller.proto", +} + +func init() { + proto.RegisterFile("google/api/servicecontrol/v1/quota_controller.proto", fileDescriptor5) +} + +var fileDescriptor5 = []byte{ + // 775 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xc1, 0x6e, 0xea, 0x46, + 0x14, 0xed, 0x18, 0x42, 0x9b, 0xeb, 0x04, 0x9c, 0x69, 0x5a, 0x59, 0x28, 0x52, 0x28, 0x2b, 0x1a, + 0xb5, 0x46, 0x21, 0x55, 0x95, 0xa6, 0x2b, 0x30, 0x93, 0xc6, 0x09, 0x01, 0x62, 0x20, 0x4a, 0xda, + 0x85, 0xe5, 0xd8, 0x53, 0xea, 0xc6, 0x78, 0x1c, 0xdb, 0x20, 0x45, 0x55, 0x37, 0x5d, 0x54, 0xaa, + 0xd4, 0x5d, 0xfb, 0x1d, 0xfd, 0x88, 0xfc, 0x42, 0x7f, 0xe1, 0xfd, 0xc3, 0x7b, 0xcb, 0x27, 0x8f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0xdd, 0x18, 0xac, 0x77, 0x35, 0xe3, 0x82, 0xdc, 0x1a, 0x5a, 0xfb, 0xba, 0xde, + 0xd2, 0x9a, 0x92, 0x33, 0x0f, 0x92, 0x9b, 0xae, 0xa6, 0x93, 0xa6, 0xe4, 0xd7, 0x9e, 0x10, 0x14, + 0x78, 0x7a, 0xea, 0x6c, 0xd6, 0xe2, 0xff, 0x10, 0x6c, 0x2f, 0x74, 0x0e, 0xae, 0xad, 0xae, 0xcf, + 0xb2, 0x29, 0x59, 0x3c, 0x5a, 0x8b, 0x93, 0xb4, 0x66, 0xf9, 0x9b, 0x3f, 0xfe, 0x7f, 0xf5, 0x8f, + 0xa0, 0x94, 0xbf, 0x8c, 0x67, 0x72, 0x4a, 0x0a, 0xab, 0xbf, 0xcd, 0x8f, 0xdb, 0xdf, 0x4f, 0xcc, + 0x79, 0xea, 0x09, 0x3a, 0x68, 0xfc, 0x85, 0xa0, 0x64, 0xb1, 0xd1, 0xca, 0x03, 0x1b, 0xbb, 0xcf, + 0xd2, 0xec, 0xc6, 0x43, 0xbe, 0x8b, 0x7e, 0x3c, 0x4f, 0x59, 0x43, 0xe6, 0x9a, 0xde, 0x50, 0x61, + 0xc1, 0xb0, 0x3a, 0xa4, 0x1e, 0x7f, 0x02, 0xd2, 0x27, 0xc3, 0xf4, 0x9d, 0x70, 0xf9, 0xb3, 0xf1, + 0xfd, 0x22, 0xf2, 0x06, 0xa1, 0xbb, 0x1c, 0x67, 0x1e, 0xbd, 0x0d, 0x00, 0x00, 0xff, 0xff, 0xbb, + 0x98, 0x03, 0x4f, 0xe0, 0x06, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/api/servicecontrol/v1/service_controller.pb.go b/vendor/google.golang.org/genproto/googleapis/api/servicecontrol/v1/service_controller.pb.go new file mode 100644 index 0000000000..e3ecc9c976 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/api/servicecontrol/v1/service_controller.pb.go @@ -0,0 +1,488 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/api/servicecontrol/v1/service_controller.proto + +package servicecontrol + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_rpc "google.golang.org/genproto/googleapis/rpc/status" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Request message for the Check method. +type CheckRequest struct { + // The service name as specified in its service configuration. For example, + // `"pubsub.googleapis.com"`. + // + // See + // [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service) + // for the definition of a service name. + ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName" json:"service_name,omitempty"` + // The operation to be checked. + Operation *Operation `protobuf:"bytes,2,opt,name=operation" json:"operation,omitempty"` + // Specifies which version of service configuration should be used to process + // the request. + // + // If unspecified or no matching version can be found, the + // latest one will be used. + ServiceConfigId string `protobuf:"bytes,4,opt,name=service_config_id,json=serviceConfigId" json:"service_config_id,omitempty"` +} + +func (m *CheckRequest) Reset() { *m = CheckRequest{} } +func (m *CheckRequest) String() string { return proto.CompactTextString(m) } +func (*CheckRequest) ProtoMessage() {} +func (*CheckRequest) Descriptor() ([]byte, []int) { return fileDescriptor6, []int{0} } + +func (m *CheckRequest) GetServiceName() string { + if m != nil { + return m.ServiceName + } + return "" +} + +func (m *CheckRequest) GetOperation() *Operation { + if m != nil { + return m.Operation + } + return nil +} + +func (m *CheckRequest) GetServiceConfigId() string { + if m != nil { + return m.ServiceConfigId + } + return "" +} + +// Response message for the Check method. +type CheckResponse struct { + // The same operation_id value used in the [CheckRequest][google.api.servicecontrol.v1.CheckRequest]. + // Used for logging and diagnostics purposes. + OperationId string `protobuf:"bytes,1,opt,name=operation_id,json=operationId" json:"operation_id,omitempty"` + // Indicate the decision of the check. + // + // If no check errors are present, the service should process the operation. + // Otherwise the service should use the list of errors to determine the + // appropriate action. + CheckErrors []*CheckError `protobuf:"bytes,2,rep,name=check_errors,json=checkErrors" json:"check_errors,omitempty"` + // The actual config id used to process the request. + ServiceConfigId string `protobuf:"bytes,5,opt,name=service_config_id,json=serviceConfigId" json:"service_config_id,omitempty"` + // Feedback data returned from the server during processing a Check request. + CheckInfo *CheckResponse_CheckInfo `protobuf:"bytes,6,opt,name=check_info,json=checkInfo" json:"check_info,omitempty"` +} + +func (m *CheckResponse) Reset() { *m = CheckResponse{} } +func (m *CheckResponse) String() string { return proto.CompactTextString(m) } +func (*CheckResponse) ProtoMessage() {} +func (*CheckResponse) Descriptor() ([]byte, []int) { return fileDescriptor6, []int{1} } + +func (m *CheckResponse) GetOperationId() string { + if m != nil { + return m.OperationId + } + return "" +} + +func (m *CheckResponse) GetCheckErrors() []*CheckError { + if m != nil { + return m.CheckErrors + } + return nil +} + +func (m *CheckResponse) GetServiceConfigId() string { + if m != nil { + return m.ServiceConfigId + } + return "" +} + +func (m *CheckResponse) GetCheckInfo() *CheckResponse_CheckInfo { + if m != nil { + return m.CheckInfo + } + return nil +} + +type CheckResponse_CheckInfo struct { + // Consumer info of this check. + ConsumerInfo *CheckResponse_ConsumerInfo `protobuf:"bytes,2,opt,name=consumer_info,json=consumerInfo" json:"consumer_info,omitempty"` +} + +func (m *CheckResponse_CheckInfo) Reset() { *m = CheckResponse_CheckInfo{} } +func (m *CheckResponse_CheckInfo) String() string { return proto.CompactTextString(m) } +func (*CheckResponse_CheckInfo) ProtoMessage() {} +func (*CheckResponse_CheckInfo) Descriptor() ([]byte, []int) { return fileDescriptor6, []int{1, 0} } + +func (m *CheckResponse_CheckInfo) GetConsumerInfo() *CheckResponse_ConsumerInfo { + if m != nil { + return m.ConsumerInfo + } + return nil +} + +// `ConsumerInfo` provides information about the consumer project. +type CheckResponse_ConsumerInfo struct { + // The Google cloud project number, e.g. 1234567890. A value of 0 indicates + // no project number is found. + ProjectNumber int64 `protobuf:"varint,1,opt,name=project_number,json=projectNumber" json:"project_number,omitempty"` +} + +func (m *CheckResponse_ConsumerInfo) Reset() { *m = CheckResponse_ConsumerInfo{} } +func (m *CheckResponse_ConsumerInfo) String() string { return proto.CompactTextString(m) } +func (*CheckResponse_ConsumerInfo) ProtoMessage() {} +func (*CheckResponse_ConsumerInfo) Descriptor() ([]byte, []int) { return fileDescriptor6, []int{1, 1} } + +func (m *CheckResponse_ConsumerInfo) GetProjectNumber() int64 { + if m != nil { + return m.ProjectNumber + } + return 0 +} + +// Request message for the Report method. +type ReportRequest struct { + // The service name as specified in its service configuration. For example, + // `"pubsub.googleapis.com"`. + // + // See + // [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service) + // for the definition of a service name. + ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName" json:"service_name,omitempty"` + // Operations to be reported. + // + // Typically the service should report one operation per request. + // Putting multiple operations into a single request is allowed, but should + // be used only when multiple operations are natually available at the time + // of the report. + // + // If multiple operations are in a single request, the total request size + // should be no larger than 1MB. See [ReportResponse.report_errors][google.api.servicecontrol.v1.ReportResponse.report_errors] for + // partial failure behavior. + Operations []*Operation `protobuf:"bytes,2,rep,name=operations" json:"operations,omitempty"` + // Specifies which version of service config should be used to process the + // request. + // + // If unspecified or no matching version can be found, the + // latest one will be used. + ServiceConfigId string `protobuf:"bytes,3,opt,name=service_config_id,json=serviceConfigId" json:"service_config_id,omitempty"` +} + +func (m *ReportRequest) Reset() { *m = ReportRequest{} } +func (m *ReportRequest) String() string { return proto.CompactTextString(m) } +func (*ReportRequest) ProtoMessage() {} +func (*ReportRequest) Descriptor() ([]byte, []int) { return fileDescriptor6, []int{2} } + +func (m *ReportRequest) GetServiceName() string { + if m != nil { + return m.ServiceName + } + return "" +} + +func (m *ReportRequest) GetOperations() []*Operation { + if m != nil { + return m.Operations + } + return nil +} + +func (m *ReportRequest) GetServiceConfigId() string { + if m != nil { + return m.ServiceConfigId + } + return "" +} + +// Response message for the Report method. +type ReportResponse struct { + // Partial failures, one for each `Operation` in the request that failed + // processing. There are three possible combinations of the RPC status: + // + // 1. The combination of a successful RPC status and an empty `report_errors` + // list indicates a complete success where all `Operations` in the + // request are processed successfully. + // 2. The combination of a successful RPC status and a non-empty + // `report_errors` list indicates a partial success where some + // `Operations` in the request succeeded. Each + // `Operation` that failed processing has a corresponding item + // in this list. + // 3. A failed RPC status indicates a general non-deterministic failure. + // When this happens, it's impossible to know which of the + // 'Operations' in the request succeeded or failed. + ReportErrors []*ReportResponse_ReportError `protobuf:"bytes,1,rep,name=report_errors,json=reportErrors" json:"report_errors,omitempty"` + // The actual config id used to process the request. + ServiceConfigId string `protobuf:"bytes,2,opt,name=service_config_id,json=serviceConfigId" json:"service_config_id,omitempty"` +} + +func (m *ReportResponse) Reset() { *m = ReportResponse{} } +func (m *ReportResponse) String() string { return proto.CompactTextString(m) } +func (*ReportResponse) ProtoMessage() {} +func (*ReportResponse) Descriptor() ([]byte, []int) { return fileDescriptor6, []int{3} } + +func (m *ReportResponse) GetReportErrors() []*ReportResponse_ReportError { + if m != nil { + return m.ReportErrors + } + return nil +} + +func (m *ReportResponse) GetServiceConfigId() string { + if m != nil { + return m.ServiceConfigId + } + return "" +} + +// Represents the processing error of one [Operation][google.api.servicecontrol.v1.Operation] in the request. +type ReportResponse_ReportError struct { + // The [Operation.operation_id][google.api.servicecontrol.v1.Operation.operation_id] value from the request. + OperationId string `protobuf:"bytes,1,opt,name=operation_id,json=operationId" json:"operation_id,omitempty"` + // Details of the error when processing the [Operation][google.api.servicecontrol.v1.Operation]. + Status *google_rpc.Status `protobuf:"bytes,2,opt,name=status" json:"status,omitempty"` +} + +func (m *ReportResponse_ReportError) Reset() { *m = ReportResponse_ReportError{} } +func (m *ReportResponse_ReportError) String() string { return proto.CompactTextString(m) } +func (*ReportResponse_ReportError) ProtoMessage() {} +func (*ReportResponse_ReportError) Descriptor() ([]byte, []int) { return fileDescriptor6, []int{3, 0} } + +func (m *ReportResponse_ReportError) GetOperationId() string { + if m != nil { + return m.OperationId + } + return "" +} + +func (m *ReportResponse_ReportError) GetStatus() *google_rpc.Status { + if m != nil { + return m.Status + } + return nil +} + +func init() { + proto.RegisterType((*CheckRequest)(nil), "google.api.servicecontrol.v1.CheckRequest") + proto.RegisterType((*CheckResponse)(nil), "google.api.servicecontrol.v1.CheckResponse") + proto.RegisterType((*CheckResponse_CheckInfo)(nil), "google.api.servicecontrol.v1.CheckResponse.CheckInfo") + proto.RegisterType((*CheckResponse_ConsumerInfo)(nil), "google.api.servicecontrol.v1.CheckResponse.ConsumerInfo") + proto.RegisterType((*ReportRequest)(nil), "google.api.servicecontrol.v1.ReportRequest") + proto.RegisterType((*ReportResponse)(nil), "google.api.servicecontrol.v1.ReportResponse") + proto.RegisterType((*ReportResponse_ReportError)(nil), "google.api.servicecontrol.v1.ReportResponse.ReportError") +} + +// 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 + +// Client API for ServiceController service + +type ServiceControllerClient interface { + // Checks an operation with Google Service Control to decide whether + // the given operation should proceed. It should be called before the + // operation is executed. + // + // If feasible, the client should cache the check results and reuse them for + // 60 seconds. In case of server errors, the client can rely on the cached + // results for longer time. + // + // NOTE: the [CheckRequest][google.api.servicecontrol.v1.CheckRequest] has the size limit of 64KB. + // + // This method requires the `servicemanagement.services.check` permission + // on the specified service. For more information, see + // [Google Cloud IAM](https://cloud.google.com/iam). + Check(ctx context.Context, in *CheckRequest, opts ...grpc.CallOption) (*CheckResponse, error) + // Reports operation results to Google Service Control, such as logs and + // metrics. It should be called after an operation is completed. + // + // If feasible, the client should aggregate reporting data for up to 5 + // seconds to reduce API traffic. Limiting aggregation to 5 seconds is to + // reduce data loss during client crashes. Clients should carefully choose + // the aggregation time window to avoid data loss risk more than 0.01% + // for business and compliance reasons. + // + // NOTE: the [ReportRequest][google.api.servicecontrol.v1.ReportRequest] has the size limit of 1MB. + // + // This method requires the `servicemanagement.services.report` permission + // on the specified service. For more information, see + // [Google Cloud IAM](https://cloud.google.com/iam). + Report(ctx context.Context, in *ReportRequest, opts ...grpc.CallOption) (*ReportResponse, error) +} + +type serviceControllerClient struct { + cc *grpc.ClientConn +} + +func NewServiceControllerClient(cc *grpc.ClientConn) ServiceControllerClient { + return &serviceControllerClient{cc} +} + +func (c *serviceControllerClient) Check(ctx context.Context, in *CheckRequest, opts ...grpc.CallOption) (*CheckResponse, error) { + out := new(CheckResponse) + err := grpc.Invoke(ctx, "/google.api.servicecontrol.v1.ServiceController/Check", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceControllerClient) Report(ctx context.Context, in *ReportRequest, opts ...grpc.CallOption) (*ReportResponse, error) { + out := new(ReportResponse) + err := grpc.Invoke(ctx, "/google.api.servicecontrol.v1.ServiceController/Report", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for ServiceController service + +type ServiceControllerServer interface { + // Checks an operation with Google Service Control to decide whether + // the given operation should proceed. It should be called before the + // operation is executed. + // + // If feasible, the client should cache the check results and reuse them for + // 60 seconds. In case of server errors, the client can rely on the cached + // results for longer time. + // + // NOTE: the [CheckRequest][google.api.servicecontrol.v1.CheckRequest] has the size limit of 64KB. + // + // This method requires the `servicemanagement.services.check` permission + // on the specified service. For more information, see + // [Google Cloud IAM](https://cloud.google.com/iam). + Check(context.Context, *CheckRequest) (*CheckResponse, error) + // Reports operation results to Google Service Control, such as logs and + // metrics. It should be called after an operation is completed. + // + // If feasible, the client should aggregate reporting data for up to 5 + // seconds to reduce API traffic. Limiting aggregation to 5 seconds is to + // reduce data loss during client crashes. Clients should carefully choose + // the aggregation time window to avoid data loss risk more than 0.01% + // for business and compliance reasons. + // + // NOTE: the [ReportRequest][google.api.servicecontrol.v1.ReportRequest] has the size limit of 1MB. + // + // This method requires the `servicemanagement.services.report` permission + // on the specified service. For more information, see + // [Google Cloud IAM](https://cloud.google.com/iam). + Report(context.Context, *ReportRequest) (*ReportResponse, error) +} + +func RegisterServiceControllerServer(s *grpc.Server, srv ServiceControllerServer) { + s.RegisterService(&_ServiceController_serviceDesc, srv) +} + +func _ServiceController_Check_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CheckRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceControllerServer).Check(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.api.servicecontrol.v1.ServiceController/Check", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceControllerServer).Check(ctx, req.(*CheckRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ServiceController_Report_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ReportRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceControllerServer).Report(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.api.servicecontrol.v1.ServiceController/Report", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceControllerServer).Report(ctx, req.(*ReportRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _ServiceController_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.api.servicecontrol.v1.ServiceController", + HandlerType: (*ServiceControllerServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Check", + Handler: _ServiceController_Check_Handler, + }, + { + MethodName: "Report", + Handler: _ServiceController_Report_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/api/servicecontrol/v1/service_controller.proto", +} + +func init() { + proto.RegisterFile("google/api/servicecontrol/v1/service_controller.proto", fileDescriptor6) +} + +var fileDescriptor6 = []byte{ + // 619 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0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, 0xc2, 0xa7, 0xa5, 0x14, 0x27, 0xff, 0xff, 0xd1, 0xdd, 0x8b, + 0xc5, 0xb2, 0xbd, 0x40, 0xaf, 0x9e, 0xe9, 0xbc, 0x80, 0x4f, 0x7c, 0x16, 0x38, 0x5c, 0x04, 0x6e, + 0x40, 0x99, 0x5c, 0xc5, 0xae, 0xba, 0xf2, 0xa3, 0x30, 0x2e, 0x5e, 0xea, 0x4f, 0x96, 0x91, 0x9f, + 0x08, 0x7d, 0x31, 0x36, 0xce, 0x9e, 0x0e, 0x7a, 0x57, 0x55, 0x59, 0xe0, 0xd1, 0xef, 0x00, 0x00, + 0x00, 0xff, 0xff, 0x5e, 0x28, 0x7b, 0xe6, 0xb7, 0x06, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/api/servicemanagement/v1/resources.pb.go b/vendor/google.golang.org/genproto/googleapis/api/servicemanagement/v1/resources.pb.go new file mode 100644 index 0000000000..9490647631 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/api/servicemanagement/v1/resources.pb.go @@ -0,0 +1,802 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/api/servicemanagement/v1/resources.proto + +/* +Package servicemanagement is a generated protocol buffer package. + +It is generated from these files: + google/api/servicemanagement/v1/resources.proto + google/api/servicemanagement/v1/servicemanager.proto + +It has these top-level messages: + ManagedService + OperationMetadata + Diagnostic + ConfigSource + ConfigFile + ConfigRef + ChangeReport + Rollout + ListServicesRequest + ListServicesResponse + GetServiceRequest + CreateServiceRequest + DeleteServiceRequest + UndeleteServiceRequest + UndeleteServiceResponse + GetServiceConfigRequest + ListServiceConfigsRequest + ListServiceConfigsResponse + CreateServiceConfigRequest + SubmitConfigSourceRequest + SubmitConfigSourceResponse + CreateServiceRolloutRequest + ListServiceRolloutsRequest + ListServiceRolloutsResponse + GetServiceRolloutRequest + EnableServiceRequest + DisableServiceRequest + GenerateConfigReportRequest + GenerateConfigReportResponse +*/ +package servicemanagement + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_api2 "google.golang.org/genproto/googleapis/api/configchange" +import _ "google.golang.org/genproto/googleapis/api/serviceconfig" +import _ "google.golang.org/genproto/googleapis/longrunning" +import _ "github.com/golang/protobuf/ptypes/any" +import _ "google.golang.org/genproto/protobuf/field_mask" +import _ "github.com/golang/protobuf/ptypes/struct" +import google_protobuf9 "github.com/golang/protobuf/ptypes/timestamp" +import _ "google.golang.org/genproto/googleapis/rpc/status" + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Code describes the status of one operation step. +type OperationMetadata_Status int32 + +const ( + // Unspecifed code. + OperationMetadata_STATUS_UNSPECIFIED OperationMetadata_Status = 0 + // The step has completed without errors. + OperationMetadata_DONE OperationMetadata_Status = 1 + // The step has not started yet. + OperationMetadata_NOT_STARTED OperationMetadata_Status = 2 + // The step is in progress. + OperationMetadata_IN_PROGRESS OperationMetadata_Status = 3 + // The step has completed with errors. + OperationMetadata_FAILED OperationMetadata_Status = 4 + // The step has completed with cancellation. + OperationMetadata_CANCELLED OperationMetadata_Status = 5 +) + +var OperationMetadata_Status_name = map[int32]string{ + 0: "STATUS_UNSPECIFIED", + 1: "DONE", + 2: "NOT_STARTED", + 3: "IN_PROGRESS", + 4: "FAILED", + 5: "CANCELLED", +} +var OperationMetadata_Status_value = map[string]int32{ + "STATUS_UNSPECIFIED": 0, + "DONE": 1, + "NOT_STARTED": 2, + "IN_PROGRESS": 3, + "FAILED": 4, + "CANCELLED": 5, +} + +func (x OperationMetadata_Status) String() string { + return proto.EnumName(OperationMetadata_Status_name, int32(x)) +} +func (OperationMetadata_Status) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{1, 0} } + +// The kind of diagnostic information possible. +type Diagnostic_Kind int32 + +const ( + // Warnings and errors + Diagnostic_WARNING Diagnostic_Kind = 0 + // Only errors + Diagnostic_ERROR Diagnostic_Kind = 1 +) + +var Diagnostic_Kind_name = map[int32]string{ + 0: "WARNING", + 1: "ERROR", +} +var Diagnostic_Kind_value = map[string]int32{ + "WARNING": 0, + "ERROR": 1, +} + +func (x Diagnostic_Kind) String() string { + return proto.EnumName(Diagnostic_Kind_name, int32(x)) +} +func (Diagnostic_Kind) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{2, 0} } + +type ConfigFile_FileType int32 + +const ( + // Unknown file type. + ConfigFile_FILE_TYPE_UNSPECIFIED ConfigFile_FileType = 0 + // YAML-specification of service. + ConfigFile_SERVICE_CONFIG_YAML ConfigFile_FileType = 1 + // OpenAPI specification, serialized in JSON. + ConfigFile_OPEN_API_JSON ConfigFile_FileType = 2 + // OpenAPI specification, serialized in YAML. + ConfigFile_OPEN_API_YAML ConfigFile_FileType = 3 + // FileDescriptorSet, generated by protoc. + // + // To generate, use protoc with imports and source info included. + // For an example test.proto file, the following command would put the value + // in a new file named out.pb. + // + // $protoc --include_imports --include_source_info test.proto -o out.pb + ConfigFile_FILE_DESCRIPTOR_SET_PROTO ConfigFile_FileType = 4 +) + +var ConfigFile_FileType_name = map[int32]string{ + 0: "FILE_TYPE_UNSPECIFIED", + 1: "SERVICE_CONFIG_YAML", + 2: "OPEN_API_JSON", + 3: "OPEN_API_YAML", + 4: "FILE_DESCRIPTOR_SET_PROTO", +} +var ConfigFile_FileType_value = map[string]int32{ + "FILE_TYPE_UNSPECIFIED": 0, + "SERVICE_CONFIG_YAML": 1, + "OPEN_API_JSON": 2, + "OPEN_API_YAML": 3, + "FILE_DESCRIPTOR_SET_PROTO": 4, +} + +func (x ConfigFile_FileType) String() string { + return proto.EnumName(ConfigFile_FileType_name, int32(x)) +} +func (ConfigFile_FileType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{4, 0} } + +// Status of a Rollout. +type Rollout_RolloutStatus int32 + +const ( + // No status specified. + Rollout_ROLLOUT_STATUS_UNSPECIFIED Rollout_RolloutStatus = 0 + // The Rollout is in progress. + Rollout_IN_PROGRESS Rollout_RolloutStatus = 1 + // The Rollout has completed successfully. + Rollout_SUCCESS Rollout_RolloutStatus = 2 + // The Rollout has been cancelled. This can happen if you have overlapping + // Rollout pushes, and the previous ones will be cancelled. + Rollout_CANCELLED Rollout_RolloutStatus = 3 + // The Rollout has failed. It is typically caused by configuration errors. + Rollout_FAILED Rollout_RolloutStatus = 4 + // The Rollout has not started yet and is pending for execution. + Rollout_PENDING Rollout_RolloutStatus = 5 +) + +var Rollout_RolloutStatus_name = map[int32]string{ + 0: "ROLLOUT_STATUS_UNSPECIFIED", + 1: "IN_PROGRESS", + 2: "SUCCESS", + 3: "CANCELLED", + 4: "FAILED", + 5: "PENDING", +} +var Rollout_RolloutStatus_value = map[string]int32{ + "ROLLOUT_STATUS_UNSPECIFIED": 0, + "IN_PROGRESS": 1, + "SUCCESS": 2, + "CANCELLED": 3, + "FAILED": 4, + "PENDING": 5, +} + +func (x Rollout_RolloutStatus) String() string { + return proto.EnumName(Rollout_RolloutStatus_name, int32(x)) +} +func (Rollout_RolloutStatus) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{7, 0} } + +// The full representation of a Service that is managed by +// Google Service Management. +type ManagedService struct { + // The name of the service. See the [overview](/service-management/overview) + // for naming requirements. + ServiceName string `protobuf:"bytes,2,opt,name=service_name,json=serviceName" json:"service_name,omitempty"` + // ID of the project that produces and owns this service. + ProducerProjectId string `protobuf:"bytes,3,opt,name=producer_project_id,json=producerProjectId" json:"producer_project_id,omitempty"` +} + +func (m *ManagedService) Reset() { *m = ManagedService{} } +func (m *ManagedService) String() string { return proto.CompactTextString(m) } +func (*ManagedService) ProtoMessage() {} +func (*ManagedService) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *ManagedService) GetServiceName() string { + if m != nil { + return m.ServiceName + } + return "" +} + +func (m *ManagedService) GetProducerProjectId() string { + if m != nil { + return m.ProducerProjectId + } + return "" +} + +// The metadata associated with a long running operation resource. +type OperationMetadata struct { + // The full name of the resources that this operation is directly + // associated with. + ResourceNames []string `protobuf:"bytes,1,rep,name=resource_names,json=resourceNames" json:"resource_names,omitempty"` + // Detailed status information for each step. The order is undetermined. + Steps []*OperationMetadata_Step `protobuf:"bytes,2,rep,name=steps" json:"steps,omitempty"` + // Percentage of completion of this operation, ranging from 0 to 100. + ProgressPercentage int32 `protobuf:"varint,3,opt,name=progress_percentage,json=progressPercentage" json:"progress_percentage,omitempty"` + // The start time of the operation. + StartTime *google_protobuf9.Timestamp `protobuf:"bytes,4,opt,name=start_time,json=startTime" json:"start_time,omitempty"` +} + +func (m *OperationMetadata) Reset() { *m = OperationMetadata{} } +func (m *OperationMetadata) String() string { return proto.CompactTextString(m) } +func (*OperationMetadata) ProtoMessage() {} +func (*OperationMetadata) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *OperationMetadata) GetResourceNames() []string { + if m != nil { + return m.ResourceNames + } + return nil +} + +func (m *OperationMetadata) GetSteps() []*OperationMetadata_Step { + if m != nil { + return m.Steps + } + return nil +} + +func (m *OperationMetadata) GetProgressPercentage() int32 { + if m != nil { + return m.ProgressPercentage + } + return 0 +} + +func (m *OperationMetadata) GetStartTime() *google_protobuf9.Timestamp { + if m != nil { + return m.StartTime + } + return nil +} + +// Represents the status of one operation step. +type OperationMetadata_Step struct { + // The short description of the step. + Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` + // The status code. + Status OperationMetadata_Status `protobuf:"varint,4,opt,name=status,enum=google.api.servicemanagement.v1.OperationMetadata_Status" json:"status,omitempty"` +} + +func (m *OperationMetadata_Step) Reset() { *m = OperationMetadata_Step{} } +func (m *OperationMetadata_Step) String() string { return proto.CompactTextString(m) } +func (*OperationMetadata_Step) ProtoMessage() {} +func (*OperationMetadata_Step) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1, 0} } + +func (m *OperationMetadata_Step) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *OperationMetadata_Step) GetStatus() OperationMetadata_Status { + if m != nil { + return m.Status + } + return OperationMetadata_STATUS_UNSPECIFIED +} + +// Represents a diagnostic message (error or warning) +type Diagnostic struct { + // File name and line number of the error or warning. + Location string `protobuf:"bytes,1,opt,name=location" json:"location,omitempty"` + // The kind of diagnostic information provided. + Kind Diagnostic_Kind `protobuf:"varint,2,opt,name=kind,enum=google.api.servicemanagement.v1.Diagnostic_Kind" json:"kind,omitempty"` + // Message describing the error or warning. + Message string `protobuf:"bytes,3,opt,name=message" json:"message,omitempty"` +} + +func (m *Diagnostic) Reset() { *m = Diagnostic{} } +func (m *Diagnostic) String() string { return proto.CompactTextString(m) } +func (*Diagnostic) ProtoMessage() {} +func (*Diagnostic) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *Diagnostic) GetLocation() string { + if m != nil { + return m.Location + } + return "" +} + +func (m *Diagnostic) GetKind() Diagnostic_Kind { + if m != nil { + return m.Kind + } + return Diagnostic_WARNING +} + +func (m *Diagnostic) GetMessage() string { + if m != nil { + return m.Message + } + return "" +} + +// Represents a source file which is used to generate the service configuration +// defined by `google.api.Service`. +type ConfigSource struct { + // A unique ID for a specific instance of this message, typically assigned + // by the client for tracking purpose. If empty, the server may choose to + // generate one instead. + Id string `protobuf:"bytes,5,opt,name=id" json:"id,omitempty"` + // Set of source configuration files that are used to generate a service + // configuration (`google.api.Service`). + Files []*ConfigFile `protobuf:"bytes,2,rep,name=files" json:"files,omitempty"` +} + +func (m *ConfigSource) Reset() { *m = ConfigSource{} } +func (m *ConfigSource) String() string { return proto.CompactTextString(m) } +func (*ConfigSource) ProtoMessage() {} +func (*ConfigSource) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *ConfigSource) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *ConfigSource) GetFiles() []*ConfigFile { + if m != nil { + return m.Files + } + return nil +} + +// Generic specification of a source configuration file +type ConfigFile struct { + // The file name of the configuration file (full or relative path). + FilePath string `protobuf:"bytes,1,opt,name=file_path,json=filePath" json:"file_path,omitempty"` + // The bytes that constitute the file. + FileContents []byte `protobuf:"bytes,3,opt,name=file_contents,json=fileContents,proto3" json:"file_contents,omitempty"` + // The type of configuration file this represents. + FileType ConfigFile_FileType `protobuf:"varint,4,opt,name=file_type,json=fileType,enum=google.api.servicemanagement.v1.ConfigFile_FileType" json:"file_type,omitempty"` +} + +func (m *ConfigFile) Reset() { *m = ConfigFile{} } +func (m *ConfigFile) String() string { return proto.CompactTextString(m) } +func (*ConfigFile) ProtoMessage() {} +func (*ConfigFile) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *ConfigFile) GetFilePath() string { + if m != nil { + return m.FilePath + } + return "" +} + +func (m *ConfigFile) GetFileContents() []byte { + if m != nil { + return m.FileContents + } + return nil +} + +func (m *ConfigFile) GetFileType() ConfigFile_FileType { + if m != nil { + return m.FileType + } + return ConfigFile_FILE_TYPE_UNSPECIFIED +} + +// Represents a service configuration with its name and id. +type ConfigRef struct { + // Resource name of a service config. It must have the following + // format: "services/{service name}/configs/{config id}". + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *ConfigRef) Reset() { *m = ConfigRef{} } +func (m *ConfigRef) String() string { return proto.CompactTextString(m) } +func (*ConfigRef) ProtoMessage() {} +func (*ConfigRef) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *ConfigRef) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Change report associated with a particular service configuration. +// +// It contains a list of ConfigChanges based on the comparison between +// two service configurations. +type ChangeReport struct { + // List of changes between two service configurations. + // The changes will be alphabetically sorted based on the identifier + // of each change. + // A ConfigChange identifier is a dot separated path to the configuration. + // Example: visibility.rules[selector='LibraryService.CreateBook'].restriction + ConfigChanges []*google_api2.ConfigChange `protobuf:"bytes,1,rep,name=config_changes,json=configChanges" json:"config_changes,omitempty"` +} + +func (m *ChangeReport) Reset() { *m = ChangeReport{} } +func (m *ChangeReport) String() string { return proto.CompactTextString(m) } +func (*ChangeReport) ProtoMessage() {} +func (*ChangeReport) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *ChangeReport) GetConfigChanges() []*google_api2.ConfigChange { + if m != nil { + return m.ConfigChanges + } + return nil +} + +// A rollout resource that defines how service configuration versions are pushed +// to control plane systems. Typically, you create a new version of the +// service config, and then create a Rollout to push the service config. +type Rollout struct { + // Optional unique identifier of this Rollout. Only lower case letters, digits + // and '-' are allowed. + // + // If not specified by client, the server will generate one. The generated id + // will have the form of , where "date" is the create + // date in ISO 8601 format. "revision number" is a monotonically increasing + // positive number that is reset every day for each service. + // An example of the generated rollout_id is '2016-02-16r1' + RolloutId string `protobuf:"bytes,1,opt,name=rollout_id,json=rolloutId" json:"rollout_id,omitempty"` + // Creation time of the rollout. Readonly. + CreateTime *google_protobuf9.Timestamp `protobuf:"bytes,2,opt,name=create_time,json=createTime" json:"create_time,omitempty"` + // The user who created the Rollout. Readonly. + CreatedBy string `protobuf:"bytes,3,opt,name=created_by,json=createdBy" json:"created_by,omitempty"` + // The status of this rollout. Readonly. In case of a failed rollout, + // the system will automatically rollback to the current Rollout + // version. Readonly. + Status Rollout_RolloutStatus `protobuf:"varint,4,opt,name=status,enum=google.api.servicemanagement.v1.Rollout_RolloutStatus" json:"status,omitempty"` + // Strategy that defines which versions of service configurations should be + // pushed + // and how they should be used at runtime. + // + // Types that are valid to be assigned to Strategy: + // *Rollout_TrafficPercentStrategy_ + // *Rollout_DeleteServiceStrategy_ + Strategy isRollout_Strategy `protobuf_oneof:"strategy"` + // The name of the service associated with this Rollout. + ServiceName string `protobuf:"bytes,8,opt,name=service_name,json=serviceName" json:"service_name,omitempty"` +} + +func (m *Rollout) Reset() { *m = Rollout{} } +func (m *Rollout) String() string { return proto.CompactTextString(m) } +func (*Rollout) ProtoMessage() {} +func (*Rollout) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +type isRollout_Strategy interface { + isRollout_Strategy() +} + +type Rollout_TrafficPercentStrategy_ struct { + TrafficPercentStrategy *Rollout_TrafficPercentStrategy `protobuf:"bytes,5,opt,name=traffic_percent_strategy,json=trafficPercentStrategy,oneof"` +} +type Rollout_DeleteServiceStrategy_ struct { + DeleteServiceStrategy *Rollout_DeleteServiceStrategy `protobuf:"bytes,200,opt,name=delete_service_strategy,json=deleteServiceStrategy,oneof"` +} + +func (*Rollout_TrafficPercentStrategy_) isRollout_Strategy() {} +func (*Rollout_DeleteServiceStrategy_) isRollout_Strategy() {} + +func (m *Rollout) GetStrategy() isRollout_Strategy { + if m != nil { + return m.Strategy + } + return nil +} + +func (m *Rollout) GetRolloutId() string { + if m != nil { + return m.RolloutId + } + return "" +} + +func (m *Rollout) GetCreateTime() *google_protobuf9.Timestamp { + if m != nil { + return m.CreateTime + } + return nil +} + +func (m *Rollout) GetCreatedBy() string { + if m != nil { + return m.CreatedBy + } + return "" +} + +func (m *Rollout) GetStatus() Rollout_RolloutStatus { + if m != nil { + return m.Status + } + return Rollout_ROLLOUT_STATUS_UNSPECIFIED +} + +func (m *Rollout) GetTrafficPercentStrategy() *Rollout_TrafficPercentStrategy { + if x, ok := m.GetStrategy().(*Rollout_TrafficPercentStrategy_); ok { + return x.TrafficPercentStrategy + } + return nil +} + +func (m *Rollout) GetDeleteServiceStrategy() *Rollout_DeleteServiceStrategy { + if x, ok := m.GetStrategy().(*Rollout_DeleteServiceStrategy_); ok { + return x.DeleteServiceStrategy + } + return nil +} + +func (m *Rollout) GetServiceName() string { + if m != nil { + return m.ServiceName + } + return "" +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Rollout) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _Rollout_OneofMarshaler, _Rollout_OneofUnmarshaler, _Rollout_OneofSizer, []interface{}{ + (*Rollout_TrafficPercentStrategy_)(nil), + (*Rollout_DeleteServiceStrategy_)(nil), + } +} + +func _Rollout_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Rollout) + // strategy + switch x := m.Strategy.(type) { + case *Rollout_TrafficPercentStrategy_: + b.EncodeVarint(5<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.TrafficPercentStrategy); err != nil { + return err + } + case *Rollout_DeleteServiceStrategy_: + b.EncodeVarint(200<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.DeleteServiceStrategy); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("Rollout.Strategy has unexpected type %T", x) + } + return nil +} + +func _Rollout_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Rollout) + switch tag { + case 5: // strategy.traffic_percent_strategy + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Rollout_TrafficPercentStrategy) + err := b.DecodeMessage(msg) + m.Strategy = &Rollout_TrafficPercentStrategy_{msg} + return true, err + case 200: // strategy.delete_service_strategy + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Rollout_DeleteServiceStrategy) + err := b.DecodeMessage(msg) + m.Strategy = &Rollout_DeleteServiceStrategy_{msg} + return true, err + default: + return false, nil + } +} + +func _Rollout_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Rollout) + // strategy + switch x := m.Strategy.(type) { + case *Rollout_TrafficPercentStrategy_: + s := proto.Size(x.TrafficPercentStrategy) + n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Rollout_DeleteServiceStrategy_: + s := proto.Size(x.DeleteServiceStrategy) + n += proto.SizeVarint(200<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Strategy that specifies how Google Service Control should select +// different +// versions of service configurations based on traffic percentage. +// +// One example of how to gradually rollout a new service configuration using +// this +// strategy: +// Day 1 +// +// Rollout { +// id: "example.googleapis.com/rollout_20160206" +// traffic_percent_strategy { +// percentages: { +// "example.googleapis.com/20160201": 70.00 +// "example.googleapis.com/20160206": 30.00 +// } +// } +// } +// +// Day 2 +// +// Rollout { +// id: "example.googleapis.com/rollout_20160207" +// traffic_percent_strategy: { +// percentages: { +// "example.googleapis.com/20160206": 100.00 +// } +// } +// } +type Rollout_TrafficPercentStrategy struct { + // Maps service configuration IDs to their corresponding traffic percentage. + // Key is the service configuration ID, Value is the traffic percentage + // which must be greater than 0.0 and the sum must equal to 100.0. + Percentages map[string]float64 `protobuf:"bytes,1,rep,name=percentages" json:"percentages,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"fixed64,2,opt,name=value"` +} + +func (m *Rollout_TrafficPercentStrategy) Reset() { *m = Rollout_TrafficPercentStrategy{} } +func (m *Rollout_TrafficPercentStrategy) String() string { return proto.CompactTextString(m) } +func (*Rollout_TrafficPercentStrategy) ProtoMessage() {} +func (*Rollout_TrafficPercentStrategy) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{7, 0} +} + +func (m *Rollout_TrafficPercentStrategy) GetPercentages() map[string]float64 { + if m != nil { + return m.Percentages + } + return nil +} + +// Strategy used to delete a service. This strategy is a placeholder only +// used by the system generated rollout to delete a service. +type Rollout_DeleteServiceStrategy struct { +} + +func (m *Rollout_DeleteServiceStrategy) Reset() { *m = Rollout_DeleteServiceStrategy{} } +func (m *Rollout_DeleteServiceStrategy) String() string { return proto.CompactTextString(m) } +func (*Rollout_DeleteServiceStrategy) ProtoMessage() {} +func (*Rollout_DeleteServiceStrategy) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{7, 1} +} + +func init() { + proto.RegisterType((*ManagedService)(nil), "google.api.servicemanagement.v1.ManagedService") + proto.RegisterType((*OperationMetadata)(nil), "google.api.servicemanagement.v1.OperationMetadata") + proto.RegisterType((*OperationMetadata_Step)(nil), "google.api.servicemanagement.v1.OperationMetadata.Step") + proto.RegisterType((*Diagnostic)(nil), "google.api.servicemanagement.v1.Diagnostic") + proto.RegisterType((*ConfigSource)(nil), "google.api.servicemanagement.v1.ConfigSource") + proto.RegisterType((*ConfigFile)(nil), "google.api.servicemanagement.v1.ConfigFile") + proto.RegisterType((*ConfigRef)(nil), "google.api.servicemanagement.v1.ConfigRef") + proto.RegisterType((*ChangeReport)(nil), "google.api.servicemanagement.v1.ChangeReport") + proto.RegisterType((*Rollout)(nil), "google.api.servicemanagement.v1.Rollout") + proto.RegisterType((*Rollout_TrafficPercentStrategy)(nil), "google.api.servicemanagement.v1.Rollout.TrafficPercentStrategy") + proto.RegisterType((*Rollout_DeleteServiceStrategy)(nil), "google.api.servicemanagement.v1.Rollout.DeleteServiceStrategy") + proto.RegisterEnum("google.api.servicemanagement.v1.OperationMetadata_Status", OperationMetadata_Status_name, OperationMetadata_Status_value) + proto.RegisterEnum("google.api.servicemanagement.v1.Diagnostic_Kind", Diagnostic_Kind_name, Diagnostic_Kind_value) + proto.RegisterEnum("google.api.servicemanagement.v1.ConfigFile_FileType", ConfigFile_FileType_name, ConfigFile_FileType_value) + proto.RegisterEnum("google.api.servicemanagement.v1.Rollout_RolloutStatus", Rollout_RolloutStatus_name, Rollout_RolloutStatus_value) +} + +func init() { proto.RegisterFile("google/api/servicemanagement/v1/resources.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 1166 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xef, 0x8e, 0xdb, 0x44, + 0x10, 0xaf, 0xf3, 0xe7, 0xee, 0x32, 0xb9, 0x0b, 0xee, 0x96, 0xf6, 0xd2, 0xd0, 0x3f, 0xc1, 0x15, + 0xd2, 0x49, 0x48, 0x0e, 0x0d, 0x08, 0x28, 0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, 0x3a, + 0xf7, 0x98, 0xd0, 0x3e, 0x5c, 0xd7, 0xb2, 0x70, 0x46, 0x33, 0x46, 0x66, 0x89, 0x30, 0x38, 0x14, + 0x06, 0x69, 0xe2, 0xf5, 0x32, 0x46, 0xd8, 0x5c, 0x04, 0xa5, 0x78, 0xd0, 0x3a, 0xe3, 0x29, 0xf2, + 0xed, 0xe2, 0x44, 0xe8, 0x43, 0xd8, 0x17, 0x87, 0x73, 0x23, 0x32, 0xa3, 0xed, 0x4a, 0x57, 0x3a, + 0x6a, 0xe0, 0xa6, 0xc0, 0x0c, 0x32, 0xa3, 0x48, 0x85, 0x5b, 0x49, 0x1a, 0xfb, 0x73, 0x8f, 0xa6, + 0x6e, 0x92, 0xc6, 0x3f, 0x52, 0x8f, 0xb9, 0xa1, 0xdf, 0xae, 0x72, 0xcb, 0x9b, 0xa5, 0xca, 0x2a, + 0x34, 0xba, 0xaf, 0xfc, 0x55, 0x85, 0x9b, 0x66, 0x99, 0x8e, 0x33, 0xca, 0x88, 0x4f, 0x18, 0x41, + 0x1f, 0x41, 0xab, 0xbc, 0x40, 0xee, 0x29, 0x6b, 0x4b, 0xdd, 0xea, 0x51, 0x03, 0x1f, 0x94, 0x68, + 0xee, 0x2b, 0x43, 0x67, 0x50, 0xcf, 0x18, 0x4d, 0xb2, 0x76, 0xa5, 0x5b, 0x3d, 0x6a, 0xf6, 0xbf, + 0x50, 0xb7, 0x5c, 0xb2, 0xba, 0xe1, 0x49, 0xb5, 0x19, 0x4d, 0x70, 0xc1, 0x82, 0x7a, 0x3c, 0xf6, + 0x20, 0xa5, 0x59, 0xe6, 0x26, 0x34, 0xf5, 0x68, 0xc4, 0x48, 0x40, 0x79, 0xec, 0x75, 0x8c, 0x4a, + 0x95, 0x75, 0xa9, 0x41, 0x4f, 0x00, 0x32, 0x46, 0x52, 0xe6, 0xe6, 0x39, 0x6d, 0xd7, 0xba, 0xd2, + 0x51, 0xb3, 0xdf, 0x29, 0x83, 0x28, 0x13, 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1, + 0x33, 0xf0, 0xe9, 0x06, 0xf8, 0x4b, 0xa5, 0x76, 0x3a, 0xb0, 0xcf, 0x5e, 0xed, 0x70, 0x8e, 0x4f, + 0xff, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x2d, 0x64, 0x4d, 0x1e, 0x49, 0x0a, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/api/servicemanagement/v1/servicemanager.pb.go b/vendor/google.golang.org/genproto/googleapis/api/servicemanagement/v1/servicemanager.pb.go new file mode 100644 index 0000000000..cbd3fb2e52 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/api/servicemanagement/v1/servicemanager.pb.go @@ -0,0 +1,1514 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/api/servicemanagement/v1/servicemanager.proto + +package servicemanagement + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import _ "google.golang.org/genproto/googleapis/api/serviceconfig" +import google_api22 "google.golang.org/genproto/googleapis/api/serviceconfig" +import google_longrunning "google.golang.org/genproto/googleapis/longrunning" +import google_protobuf1 "github.com/golang/protobuf/ptypes/any" +import _ "google.golang.org/genproto/protobuf/field_mask" +import _ "github.com/golang/protobuf/ptypes/struct" +import _ "google.golang.org/genproto/googleapis/rpc/status" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +type GetServiceConfigRequest_ConfigView int32 + +const ( + // Server response includes all fields except SourceInfo. + GetServiceConfigRequest_BASIC GetServiceConfigRequest_ConfigView = 0 + // Server response includes all fields including SourceInfo. + // SourceFiles are of type 'google.api.servicemanagement.v1.ConfigFile' + // and are only available for configs created using the + // SubmitConfigSource method. + GetServiceConfigRequest_FULL GetServiceConfigRequest_ConfigView = 1 +) + +var GetServiceConfigRequest_ConfigView_name = map[int32]string{ + 0: "BASIC", + 1: "FULL", +} +var GetServiceConfigRequest_ConfigView_value = map[string]int32{ + "BASIC": 0, + "FULL": 1, +} + +func (x GetServiceConfigRequest_ConfigView) String() string { + return proto.EnumName(GetServiceConfigRequest_ConfigView_name, int32(x)) +} +func (GetServiceConfigRequest_ConfigView) EnumDescriptor() ([]byte, []int) { + return fileDescriptor1, []int{7, 0} +} + +// Request message for `ListServices` method. +type ListServicesRequest struct { + // Include services produced by the specified project. + ProducerProjectId string `protobuf:"bytes,1,opt,name=producer_project_id,json=producerProjectId" json:"producer_project_id,omitempty"` + // Requested size of the next page of data. + PageSize int32 `protobuf:"varint,5,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // Token identifying which result to start with; returned by a previous list + // call. + PageToken string `protobuf:"bytes,6,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` + // Include services consumed by the specified consumer. + // + // The Google Service Management implementation accepts the following + // forms: + // - project: + ConsumerId string `protobuf:"bytes,7,opt,name=consumer_id,json=consumerId" json:"consumer_id,omitempty"` +} + +func (m *ListServicesRequest) Reset() { *m = ListServicesRequest{} } +func (m *ListServicesRequest) String() string { return proto.CompactTextString(m) } +func (*ListServicesRequest) ProtoMessage() {} +func (*ListServicesRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +func (m *ListServicesRequest) GetProducerProjectId() string { + if m != nil { + return m.ProducerProjectId + } + return "" +} + +func (m *ListServicesRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListServicesRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +func (m *ListServicesRequest) GetConsumerId() string { + if m != nil { + return m.ConsumerId + } + return "" +} + +// Response message for `ListServices` method. +type ListServicesResponse struct { + // The returned services will only have the name field set. + Services []*ManagedService `protobuf:"bytes,1,rep,name=services" json:"services,omitempty"` + // Token that can be passed to `ListServices` to resume a paginated query. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListServicesResponse) Reset() { *m = ListServicesResponse{} } +func (m *ListServicesResponse) String() string { return proto.CompactTextString(m) } +func (*ListServicesResponse) ProtoMessage() {} +func (*ListServicesResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} } + +func (m *ListServicesResponse) GetServices() []*ManagedService { + if m != nil { + return m.Services + } + return nil +} + +func (m *ListServicesResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// Request message for `GetService` method. +type GetServiceRequest struct { + // The name of the service. See the `ServiceManager` overview for naming + // requirements. For example: `example.googleapis.com`. + ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName" json:"service_name,omitempty"` +} + +func (m *GetServiceRequest) Reset() { *m = GetServiceRequest{} } +func (m *GetServiceRequest) String() string { return proto.CompactTextString(m) } +func (*GetServiceRequest) ProtoMessage() {} +func (*GetServiceRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} } + +func (m *GetServiceRequest) GetServiceName() string { + if m != nil { + return m.ServiceName + } + return "" +} + +// Request message for CreateService method. +type CreateServiceRequest struct { + // Initial values for the service resource. + Service *ManagedService `protobuf:"bytes,1,opt,name=service" json:"service,omitempty"` +} + +func (m *CreateServiceRequest) Reset() { *m = CreateServiceRequest{} } +func (m *CreateServiceRequest) String() string { return proto.CompactTextString(m) } +func (*CreateServiceRequest) ProtoMessage() {} +func (*CreateServiceRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{3} } + +func (m *CreateServiceRequest) GetService() *ManagedService { + if m != nil { + return m.Service + } + return nil +} + +// Request message for DeleteService method. +type DeleteServiceRequest struct { + // The name of the service. See the [overview](/service-management/overview) + // for naming requirements. For example: `example.googleapis.com`. + ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName" json:"service_name,omitempty"` +} + +func (m *DeleteServiceRequest) Reset() { *m = DeleteServiceRequest{} } +func (m *DeleteServiceRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteServiceRequest) ProtoMessage() {} +func (*DeleteServiceRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{4} } + +func (m *DeleteServiceRequest) GetServiceName() string { + if m != nil { + return m.ServiceName + } + return "" +} + +// Request message for UndeleteService method. +type UndeleteServiceRequest struct { + // The name of the service. See the [overview](/service-management/overview) + // for naming requirements. For example: `example.googleapis.com`. + ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName" json:"service_name,omitempty"` +} + +func (m *UndeleteServiceRequest) Reset() { *m = UndeleteServiceRequest{} } +func (m *UndeleteServiceRequest) String() string { return proto.CompactTextString(m) } +func (*UndeleteServiceRequest) ProtoMessage() {} +func (*UndeleteServiceRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{5} } + +func (m *UndeleteServiceRequest) GetServiceName() string { + if m != nil { + return m.ServiceName + } + return "" +} + +// Response message for UndeleteService method. +type UndeleteServiceResponse struct { + // Revived service resource. + Service *ManagedService `protobuf:"bytes,1,opt,name=service" json:"service,omitempty"` +} + +func (m *UndeleteServiceResponse) Reset() { *m = UndeleteServiceResponse{} } +func (m *UndeleteServiceResponse) String() string { return proto.CompactTextString(m) } +func (*UndeleteServiceResponse) ProtoMessage() {} +func (*UndeleteServiceResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{6} } + +func (m *UndeleteServiceResponse) GetService() *ManagedService { + if m != nil { + return m.Service + } + return nil +} + +// Request message for GetServiceConfig method. +type GetServiceConfigRequest struct { + // The name of the service. See the [overview](/service-management/overview) + // for naming requirements. For example: `example.googleapis.com`. + ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName" json:"service_name,omitempty"` + // The id of the service configuration resource. + ConfigId string `protobuf:"bytes,2,opt,name=config_id,json=configId" json:"config_id,omitempty"` + // Specifies which parts of the Service Config should be returned in the + // response. + View GetServiceConfigRequest_ConfigView `protobuf:"varint,3,opt,name=view,enum=google.api.servicemanagement.v1.GetServiceConfigRequest_ConfigView" json:"view,omitempty"` +} + +func (m *GetServiceConfigRequest) Reset() { *m = GetServiceConfigRequest{} } +func (m *GetServiceConfigRequest) String() string { return proto.CompactTextString(m) } +func (*GetServiceConfigRequest) ProtoMessage() {} +func (*GetServiceConfigRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{7} } + +func (m *GetServiceConfigRequest) GetServiceName() string { + if m != nil { + return m.ServiceName + } + return "" +} + +func (m *GetServiceConfigRequest) GetConfigId() string { + if m != nil { + return m.ConfigId + } + return "" +} + +func (m *GetServiceConfigRequest) GetView() GetServiceConfigRequest_ConfigView { + if m != nil { + return m.View + } + return GetServiceConfigRequest_BASIC +} + +// Request message for ListServiceConfigs method. +type ListServiceConfigsRequest struct { + // The name of the service. See the [overview](/service-management/overview) + // for naming requirements. For example: `example.googleapis.com`. + ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName" json:"service_name,omitempty"` + // The token of the page to retrieve. + PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` + // The max number of items to include in the response list. + PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` +} + +func (m *ListServiceConfigsRequest) Reset() { *m = ListServiceConfigsRequest{} } +func (m *ListServiceConfigsRequest) String() string { return proto.CompactTextString(m) } +func (*ListServiceConfigsRequest) ProtoMessage() {} +func (*ListServiceConfigsRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{8} } + +func (m *ListServiceConfigsRequest) GetServiceName() string { + if m != nil { + return m.ServiceName + } + return "" +} + +func (m *ListServiceConfigsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +func (m *ListServiceConfigsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +// Response message for ListServiceConfigs method. +type ListServiceConfigsResponse struct { + // The list of service configuration resources. + ServiceConfigs []*google_api22.Service `protobuf:"bytes,1,rep,name=service_configs,json=serviceConfigs" json:"service_configs,omitempty"` + // The token of the next page of results. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListServiceConfigsResponse) Reset() { *m = ListServiceConfigsResponse{} } +func (m *ListServiceConfigsResponse) String() string { return proto.CompactTextString(m) } +func (*ListServiceConfigsResponse) ProtoMessage() {} +func (*ListServiceConfigsResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{9} } + +func (m *ListServiceConfigsResponse) GetServiceConfigs() []*google_api22.Service { + if m != nil { + return m.ServiceConfigs + } + return nil +} + +func (m *ListServiceConfigsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// Request message for CreateServiceConfig method. +type CreateServiceConfigRequest struct { + // The name of the service. See the [overview](/service-management/overview) + // for naming requirements. For example: `example.googleapis.com`. + ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName" json:"service_name,omitempty"` + // The service configuration resource. + ServiceConfig *google_api22.Service `protobuf:"bytes,2,opt,name=service_config,json=serviceConfig" json:"service_config,omitempty"` +} + +func (m *CreateServiceConfigRequest) Reset() { *m = CreateServiceConfigRequest{} } +func (m *CreateServiceConfigRequest) String() string { return proto.CompactTextString(m) } +func (*CreateServiceConfigRequest) ProtoMessage() {} +func (*CreateServiceConfigRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{10} } + +func (m *CreateServiceConfigRequest) GetServiceName() string { + if m != nil { + return m.ServiceName + } + return "" +} + +func (m *CreateServiceConfigRequest) GetServiceConfig() *google_api22.Service { + if m != nil { + return m.ServiceConfig + } + return nil +} + +// Request message for SubmitConfigSource method. +type SubmitConfigSourceRequest struct { + // The name of the service. See the [overview](/service-management/overview) + // for naming requirements. For example: `example.googleapis.com`. + ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName" json:"service_name,omitempty"` + // The source configuration for the service. + ConfigSource *ConfigSource `protobuf:"bytes,2,opt,name=config_source,json=configSource" json:"config_source,omitempty"` + // Optional. If set, this will result in the generation of a + // `google.api.Service` configuration based on the `ConfigSource` provided, + // but the generated config and the sources will NOT be persisted. + ValidateOnly bool `protobuf:"varint,3,opt,name=validate_only,json=validateOnly" json:"validate_only,omitempty"` +} + +func (m *SubmitConfigSourceRequest) Reset() { *m = SubmitConfigSourceRequest{} } +func (m *SubmitConfigSourceRequest) String() string { return proto.CompactTextString(m) } +func (*SubmitConfigSourceRequest) ProtoMessage() {} +func (*SubmitConfigSourceRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{11} } + +func (m *SubmitConfigSourceRequest) GetServiceName() string { + if m != nil { + return m.ServiceName + } + return "" +} + +func (m *SubmitConfigSourceRequest) GetConfigSource() *ConfigSource { + if m != nil { + return m.ConfigSource + } + return nil +} + +func (m *SubmitConfigSourceRequest) GetValidateOnly() bool { + if m != nil { + return m.ValidateOnly + } + return false +} + +// Response message for SubmitConfigSource method. +type SubmitConfigSourceResponse struct { + // The generated service configuration. + ServiceConfig *google_api22.Service `protobuf:"bytes,1,opt,name=service_config,json=serviceConfig" json:"service_config,omitempty"` +} + +func (m *SubmitConfigSourceResponse) Reset() { *m = SubmitConfigSourceResponse{} } +func (m *SubmitConfigSourceResponse) String() string { return proto.CompactTextString(m) } +func (*SubmitConfigSourceResponse) ProtoMessage() {} +func (*SubmitConfigSourceResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{12} } + +func (m *SubmitConfigSourceResponse) GetServiceConfig() *google_api22.Service { + if m != nil { + return m.ServiceConfig + } + return nil +} + +// Request message for 'CreateServiceRollout' +type CreateServiceRolloutRequest struct { + // The name of the service. See the [overview](/service-management/overview) + // for naming requirements. For example: `example.googleapis.com`. + ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName" json:"service_name,omitempty"` + // The rollout resource. The `service_name` field is output only. + Rollout *Rollout `protobuf:"bytes,2,opt,name=rollout" json:"rollout,omitempty"` +} + +func (m *CreateServiceRolloutRequest) Reset() { *m = CreateServiceRolloutRequest{} } +func (m *CreateServiceRolloutRequest) String() string { return proto.CompactTextString(m) } +func (*CreateServiceRolloutRequest) ProtoMessage() {} +func (*CreateServiceRolloutRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{13} } + +func (m *CreateServiceRolloutRequest) GetServiceName() string { + if m != nil { + return m.ServiceName + } + return "" +} + +func (m *CreateServiceRolloutRequest) GetRollout() *Rollout { + if m != nil { + return m.Rollout + } + return nil +} + +// Request message for 'ListServiceRollouts' +type ListServiceRolloutsRequest struct { + // The name of the service. See the [overview](/service-management/overview) + // for naming requirements. For example: `example.googleapis.com`. + ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName" json:"service_name,omitempty"` + // The token of the page to retrieve. + PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` + // The max number of items to include in the response list. + PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // Use `filter` to return subset of rollouts. + // The following filters are supported: + // -- To limit the results to only those in + // [status](google.api.servicemanagement.v1.RolloutStatus) 'SUCCESS', + // use filter='status=SUCCESS' + // -- To limit the results to those in + // [status](google.api.servicemanagement.v1.RolloutStatus) 'CANCELLED' + // or 'FAILED', use filter='status=CANCELLED OR status=FAILED' + Filter string `protobuf:"bytes,4,opt,name=filter" json:"filter,omitempty"` +} + +func (m *ListServiceRolloutsRequest) Reset() { *m = ListServiceRolloutsRequest{} } +func (m *ListServiceRolloutsRequest) String() string { return proto.CompactTextString(m) } +func (*ListServiceRolloutsRequest) ProtoMessage() {} +func (*ListServiceRolloutsRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{14} } + +func (m *ListServiceRolloutsRequest) GetServiceName() string { + if m != nil { + return m.ServiceName + } + return "" +} + +func (m *ListServiceRolloutsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +func (m *ListServiceRolloutsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListServiceRolloutsRequest) GetFilter() string { + if m != nil { + return m.Filter + } + return "" +} + +// Response message for ListServiceRollouts method. +type ListServiceRolloutsResponse struct { + // The list of rollout resources. + Rollouts []*Rollout `protobuf:"bytes,1,rep,name=rollouts" json:"rollouts,omitempty"` + // The token of the next page of results. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListServiceRolloutsResponse) Reset() { *m = ListServiceRolloutsResponse{} } +func (m *ListServiceRolloutsResponse) String() string { return proto.CompactTextString(m) } +func (*ListServiceRolloutsResponse) ProtoMessage() {} +func (*ListServiceRolloutsResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{15} } + +func (m *ListServiceRolloutsResponse) GetRollouts() []*Rollout { + if m != nil { + return m.Rollouts + } + return nil +} + +func (m *ListServiceRolloutsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// Request message for GetServiceRollout method. +type GetServiceRolloutRequest struct { + // The name of the service. See the [overview](/service-management/overview) + // for naming requirements. For example: `example.googleapis.com`. + ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName" json:"service_name,omitempty"` + // The id of the rollout resource. + RolloutId string `protobuf:"bytes,2,opt,name=rollout_id,json=rolloutId" json:"rollout_id,omitempty"` +} + +func (m *GetServiceRolloutRequest) Reset() { *m = GetServiceRolloutRequest{} } +func (m *GetServiceRolloutRequest) String() string { return proto.CompactTextString(m) } +func (*GetServiceRolloutRequest) ProtoMessage() {} +func (*GetServiceRolloutRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{16} } + +func (m *GetServiceRolloutRequest) GetServiceName() string { + if m != nil { + return m.ServiceName + } + return "" +} + +func (m *GetServiceRolloutRequest) GetRolloutId() string { + if m != nil { + return m.RolloutId + } + return "" +} + +// Request message for EnableService method. +type EnableServiceRequest struct { + // Name of the service to enable. Specifying an unknown service name will + // cause the request to fail. + ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName" json:"service_name,omitempty"` + // The identity of consumer resource which service enablement will be + // applied to. + // + // The Google Service Management implementation accepts the following + // forms: + // - "project:" + // + // Note: this is made compatible with + // google.api.servicecontrol.v1.Operation.consumer_id. + ConsumerId string `protobuf:"bytes,2,opt,name=consumer_id,json=consumerId" json:"consumer_id,omitempty"` +} + +func (m *EnableServiceRequest) Reset() { *m = EnableServiceRequest{} } +func (m *EnableServiceRequest) String() string { return proto.CompactTextString(m) } +func (*EnableServiceRequest) ProtoMessage() {} +func (*EnableServiceRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{17} } + +func (m *EnableServiceRequest) GetServiceName() string { + if m != nil { + return m.ServiceName + } + return "" +} + +func (m *EnableServiceRequest) GetConsumerId() string { + if m != nil { + return m.ConsumerId + } + return "" +} + +// Request message for DisableService method. +type DisableServiceRequest struct { + // Name of the service to disable. Specifying an unknown service name + // will cause the request to fail. + ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName" json:"service_name,omitempty"` + // The identity of consumer resource which service disablement will be + // applied to. + // + // The Google Service Management implementation accepts the following + // forms: + // - "project:" + // + // Note: this is made compatible with + // google.api.servicecontrol.v1.Operation.consumer_id. + ConsumerId string `protobuf:"bytes,2,opt,name=consumer_id,json=consumerId" json:"consumer_id,omitempty"` +} + +func (m *DisableServiceRequest) Reset() { *m = DisableServiceRequest{} } +func (m *DisableServiceRequest) String() string { return proto.CompactTextString(m) } +func (*DisableServiceRequest) ProtoMessage() {} +func (*DisableServiceRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{18} } + +func (m *DisableServiceRequest) GetServiceName() string { + if m != nil { + return m.ServiceName + } + return "" +} + +func (m *DisableServiceRequest) GetConsumerId() string { + if m != nil { + return m.ConsumerId + } + return "" +} + +// Request message for GenerateConfigReport method. +type GenerateConfigReportRequest struct { + // Service configuration for which we want to generate the report. + // For this version of API, the supported types are + // [google.api.servicemanagement.v1.ConfigRef][google.api.servicemanagement.v1.ConfigRef], + // [google.api.servicemanagement.v1.ConfigSource][google.api.servicemanagement.v1.ConfigSource], + // and [google.api.Service][google.api.Service] + NewConfig *google_protobuf1.Any `protobuf:"bytes,1,opt,name=new_config,json=newConfig" json:"new_config,omitempty"` + // Service configuration against which the comparison will be done. + // For this version of API, the supported types are + // [google.api.servicemanagement.v1.ConfigRef][google.api.servicemanagement.v1.ConfigRef], + // [google.api.servicemanagement.v1.ConfigSource][google.api.servicemanagement.v1.ConfigSource], + // and [google.api.Service][google.api.Service] + OldConfig *google_protobuf1.Any `protobuf:"bytes,2,opt,name=old_config,json=oldConfig" json:"old_config,omitempty"` +} + +func (m *GenerateConfigReportRequest) Reset() { *m = GenerateConfigReportRequest{} } +func (m *GenerateConfigReportRequest) String() string { return proto.CompactTextString(m) } +func (*GenerateConfigReportRequest) ProtoMessage() {} +func (*GenerateConfigReportRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{19} } + +func (m *GenerateConfigReportRequest) GetNewConfig() *google_protobuf1.Any { + if m != nil { + return m.NewConfig + } + return nil +} + +func (m *GenerateConfigReportRequest) GetOldConfig() *google_protobuf1.Any { + if m != nil { + return m.OldConfig + } + return nil +} + +// Response message for GenerateConfigReport method. +type GenerateConfigReportResponse struct { + // Name of the service this report belongs to. + ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName" json:"service_name,omitempty"` + // ID of the service configuration this report belongs to. + Id string `protobuf:"bytes,2,opt,name=id" json:"id,omitempty"` + // list of ChangeReport, each corresponding to comparison between two + // service configurations. + ChangeReports []*ChangeReport `protobuf:"bytes,3,rep,name=change_reports,json=changeReports" json:"change_reports,omitempty"` + // Errors / Linter warnings associated with the service definition this + // report + // belongs to. + Diagnostics []*Diagnostic `protobuf:"bytes,4,rep,name=diagnostics" json:"diagnostics,omitempty"` +} + +func (m *GenerateConfigReportResponse) Reset() { *m = GenerateConfigReportResponse{} } +func (m *GenerateConfigReportResponse) String() string { return proto.CompactTextString(m) } +func (*GenerateConfigReportResponse) ProtoMessage() {} +func (*GenerateConfigReportResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{20} } + +func (m *GenerateConfigReportResponse) GetServiceName() string { + if m != nil { + return m.ServiceName + } + return "" +} + +func (m *GenerateConfigReportResponse) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *GenerateConfigReportResponse) GetChangeReports() []*ChangeReport { + if m != nil { + return m.ChangeReports + } + return nil +} + +func (m *GenerateConfigReportResponse) GetDiagnostics() []*Diagnostic { + if m != nil { + return m.Diagnostics + } + return nil +} + +func init() { + proto.RegisterType((*ListServicesRequest)(nil), "google.api.servicemanagement.v1.ListServicesRequest") + proto.RegisterType((*ListServicesResponse)(nil), "google.api.servicemanagement.v1.ListServicesResponse") + proto.RegisterType((*GetServiceRequest)(nil), "google.api.servicemanagement.v1.GetServiceRequest") + proto.RegisterType((*CreateServiceRequest)(nil), "google.api.servicemanagement.v1.CreateServiceRequest") + proto.RegisterType((*DeleteServiceRequest)(nil), "google.api.servicemanagement.v1.DeleteServiceRequest") + proto.RegisterType((*UndeleteServiceRequest)(nil), "google.api.servicemanagement.v1.UndeleteServiceRequest") + proto.RegisterType((*UndeleteServiceResponse)(nil), "google.api.servicemanagement.v1.UndeleteServiceResponse") + proto.RegisterType((*GetServiceConfigRequest)(nil), "google.api.servicemanagement.v1.GetServiceConfigRequest") + proto.RegisterType((*ListServiceConfigsRequest)(nil), "google.api.servicemanagement.v1.ListServiceConfigsRequest") + proto.RegisterType((*ListServiceConfigsResponse)(nil), "google.api.servicemanagement.v1.ListServiceConfigsResponse") + proto.RegisterType((*CreateServiceConfigRequest)(nil), "google.api.servicemanagement.v1.CreateServiceConfigRequest") + proto.RegisterType((*SubmitConfigSourceRequest)(nil), "google.api.servicemanagement.v1.SubmitConfigSourceRequest") + proto.RegisterType((*SubmitConfigSourceResponse)(nil), "google.api.servicemanagement.v1.SubmitConfigSourceResponse") + proto.RegisterType((*CreateServiceRolloutRequest)(nil), "google.api.servicemanagement.v1.CreateServiceRolloutRequest") + proto.RegisterType((*ListServiceRolloutsRequest)(nil), "google.api.servicemanagement.v1.ListServiceRolloutsRequest") + proto.RegisterType((*ListServiceRolloutsResponse)(nil), "google.api.servicemanagement.v1.ListServiceRolloutsResponse") + proto.RegisterType((*GetServiceRolloutRequest)(nil), "google.api.servicemanagement.v1.GetServiceRolloutRequest") + proto.RegisterType((*EnableServiceRequest)(nil), "google.api.servicemanagement.v1.EnableServiceRequest") + proto.RegisterType((*DisableServiceRequest)(nil), "google.api.servicemanagement.v1.DisableServiceRequest") + proto.RegisterType((*GenerateConfigReportRequest)(nil), "google.api.servicemanagement.v1.GenerateConfigReportRequest") + proto.RegisterType((*GenerateConfigReportResponse)(nil), "google.api.servicemanagement.v1.GenerateConfigReportResponse") + proto.RegisterEnum("google.api.servicemanagement.v1.GetServiceConfigRequest_ConfigView", GetServiceConfigRequest_ConfigView_name, GetServiceConfigRequest_ConfigView_value) +} + +// 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 + +// Client API for ServiceManager service + +type ServiceManagerClient interface { + // Lists managed services. + // + // Returns all public services. For authenticated users, also returns all + // services the calling user has "servicemanagement.services.get" permission + // for. + // + // **BETA:** If the caller specifies the `consumer_id`, it returns only the + // services enabled on the consumer. The `consumer_id` must have the format + // of "project:{PROJECT-ID}". + ListServices(ctx context.Context, in *ListServicesRequest, opts ...grpc.CallOption) (*ListServicesResponse, error) + // Gets a managed service. Authentication is required unless the service is + // public. + GetService(ctx context.Context, in *GetServiceRequest, opts ...grpc.CallOption) (*ManagedService, error) + // Creates a new managed service. + // Please note one producer project can own no more than 20 services. + // + // Operation + CreateService(ctx context.Context, in *CreateServiceRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Deletes a managed service. This method will change the service to the + // `Soft-Delete` state for 30 days. Within this period, service producers may + // call [UndeleteService][google.api.servicemanagement.v1.ServiceManager.UndeleteService] to restore the service. + // After 30 days, the service will be permanently deleted. + // + // Operation + DeleteService(ctx context.Context, in *DeleteServiceRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Revives a previously deleted managed service. The method restores the + // service using the configuration at the time the service was deleted. + // The target service must exist and must have been deleted within the + // last 30 days. + // + // Operation + UndeleteService(ctx context.Context, in *UndeleteServiceRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Lists the history of the service configuration for a managed service, + // from the newest to the oldest. + ListServiceConfigs(ctx context.Context, in *ListServiceConfigsRequest, opts ...grpc.CallOption) (*ListServiceConfigsResponse, error) + // Gets a service configuration (version) for a managed service. + GetServiceConfig(ctx context.Context, in *GetServiceConfigRequest, opts ...grpc.CallOption) (*google_api22.Service, error) + // Creates a new service configuration (version) for a managed service. + // This method only stores the service configuration. To roll out the service + // configuration to backend systems please call + // [CreateServiceRollout][google.api.servicemanagement.v1.ServiceManager.CreateServiceRollout]. + CreateServiceConfig(ctx context.Context, in *CreateServiceConfigRequest, opts ...grpc.CallOption) (*google_api22.Service, error) + // Creates a new service configuration (version) for a managed service based + // on + // user-supplied configuration source files (for example: OpenAPI + // Specification). This method stores the source configurations as well as the + // generated service configuration. To rollout the service configuration to + // other services, + // please call [CreateServiceRollout][google.api.servicemanagement.v1.ServiceManager.CreateServiceRollout]. + // + // Operation + SubmitConfigSource(ctx context.Context, in *SubmitConfigSourceRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Lists the history of the service configuration rollouts for a managed + // service, from the newest to the oldest. + ListServiceRollouts(ctx context.Context, in *ListServiceRolloutsRequest, opts ...grpc.CallOption) (*ListServiceRolloutsResponse, error) + // Gets a service configuration [rollout][google.api.servicemanagement.v1.Rollout]. + GetServiceRollout(ctx context.Context, in *GetServiceRolloutRequest, opts ...grpc.CallOption) (*Rollout, error) + // Creates a new service configuration rollout. Based on rollout, the + // Google Service Management will roll out the service configurations to + // different backend services. For example, the logging configuration will be + // pushed to Google Cloud Logging. + // + // Please note that any previous pending and running Rollouts and associated + // Operations will be automatically cancelled so that the latest Rollout will + // not be blocked by previous Rollouts. + // + // Operation + CreateServiceRollout(ctx context.Context, in *CreateServiceRolloutRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Generates and returns a report (errors, warnings and changes from + // existing configurations) associated with + // GenerateConfigReportRequest.new_value + // + // If GenerateConfigReportRequest.old_value is specified, + // GenerateConfigReportRequest will contain a single ChangeReport based on the + // comparison between GenerateConfigReportRequest.new_value and + // GenerateConfigReportRequest.old_value. + // If GenerateConfigReportRequest.old_value is not specified, this method + // will compare GenerateConfigReportRequest.new_value with the last pushed + // service configuration. + GenerateConfigReport(ctx context.Context, in *GenerateConfigReportRequest, opts ...grpc.CallOption) (*GenerateConfigReportResponse, error) + // Enables a [service][google.api.servicemanagement.v1.ManagedService] for a project, so it can be used + // for the project. See + // [Cloud Auth Guide](https://cloud.google.com/docs/authentication) for + // more information. + // + // Operation + EnableService(ctx context.Context, in *EnableServiceRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Disables a [service][google.api.servicemanagement.v1.ManagedService] for a project, so it can no longer be + // be used for the project. It prevents accidental usage that may cause + // unexpected billing charges or security leaks. + // + // Operation + DisableService(ctx context.Context, in *DisableServiceRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) +} + +type serviceManagerClient struct { + cc *grpc.ClientConn +} + +func NewServiceManagerClient(cc *grpc.ClientConn) ServiceManagerClient { + return &serviceManagerClient{cc} +} + +func (c *serviceManagerClient) ListServices(ctx context.Context, in *ListServicesRequest, opts ...grpc.CallOption) (*ListServicesResponse, error) { + out := new(ListServicesResponse) + err := grpc.Invoke(ctx, "/google.api.servicemanagement.v1.ServiceManager/ListServices", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceManagerClient) GetService(ctx context.Context, in *GetServiceRequest, opts ...grpc.CallOption) (*ManagedService, error) { + out := new(ManagedService) + err := grpc.Invoke(ctx, "/google.api.servicemanagement.v1.ServiceManager/GetService", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceManagerClient) CreateService(ctx context.Context, in *CreateServiceRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.api.servicemanagement.v1.ServiceManager/CreateService", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceManagerClient) DeleteService(ctx context.Context, in *DeleteServiceRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.api.servicemanagement.v1.ServiceManager/DeleteService", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceManagerClient) UndeleteService(ctx context.Context, in *UndeleteServiceRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.api.servicemanagement.v1.ServiceManager/UndeleteService", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceManagerClient) ListServiceConfigs(ctx context.Context, in *ListServiceConfigsRequest, opts ...grpc.CallOption) (*ListServiceConfigsResponse, error) { + out := new(ListServiceConfigsResponse) + err := grpc.Invoke(ctx, "/google.api.servicemanagement.v1.ServiceManager/ListServiceConfigs", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceManagerClient) GetServiceConfig(ctx context.Context, in *GetServiceConfigRequest, opts ...grpc.CallOption) (*google_api22.Service, error) { + out := new(google_api22.Service) + err := grpc.Invoke(ctx, "/google.api.servicemanagement.v1.ServiceManager/GetServiceConfig", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceManagerClient) CreateServiceConfig(ctx context.Context, in *CreateServiceConfigRequest, opts ...grpc.CallOption) (*google_api22.Service, error) { + out := new(google_api22.Service) + err := grpc.Invoke(ctx, "/google.api.servicemanagement.v1.ServiceManager/CreateServiceConfig", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceManagerClient) SubmitConfigSource(ctx context.Context, in *SubmitConfigSourceRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.api.servicemanagement.v1.ServiceManager/SubmitConfigSource", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceManagerClient) ListServiceRollouts(ctx context.Context, in *ListServiceRolloutsRequest, opts ...grpc.CallOption) (*ListServiceRolloutsResponse, error) { + out := new(ListServiceRolloutsResponse) + err := grpc.Invoke(ctx, "/google.api.servicemanagement.v1.ServiceManager/ListServiceRollouts", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceManagerClient) GetServiceRollout(ctx context.Context, in *GetServiceRolloutRequest, opts ...grpc.CallOption) (*Rollout, error) { + out := new(Rollout) + err := grpc.Invoke(ctx, "/google.api.servicemanagement.v1.ServiceManager/GetServiceRollout", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceManagerClient) CreateServiceRollout(ctx context.Context, in *CreateServiceRolloutRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.api.servicemanagement.v1.ServiceManager/CreateServiceRollout", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceManagerClient) GenerateConfigReport(ctx context.Context, in *GenerateConfigReportRequest, opts ...grpc.CallOption) (*GenerateConfigReportResponse, error) { + out := new(GenerateConfigReportResponse) + err := grpc.Invoke(ctx, "/google.api.servicemanagement.v1.ServiceManager/GenerateConfigReport", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceManagerClient) EnableService(ctx context.Context, in *EnableServiceRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.api.servicemanagement.v1.ServiceManager/EnableService", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceManagerClient) DisableService(ctx context.Context, in *DisableServiceRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.api.servicemanagement.v1.ServiceManager/DisableService", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for ServiceManager service + +type ServiceManagerServer interface { + // Lists managed services. + // + // Returns all public services. For authenticated users, also returns all + // services the calling user has "servicemanagement.services.get" permission + // for. + // + // **BETA:** If the caller specifies the `consumer_id`, it returns only the + // services enabled on the consumer. The `consumer_id` must have the format + // of "project:{PROJECT-ID}". + ListServices(context.Context, *ListServicesRequest) (*ListServicesResponse, error) + // Gets a managed service. Authentication is required unless the service is + // public. + GetService(context.Context, *GetServiceRequest) (*ManagedService, error) + // Creates a new managed service. + // Please note one producer project can own no more than 20 services. + // + // Operation + CreateService(context.Context, *CreateServiceRequest) (*google_longrunning.Operation, error) + // Deletes a managed service. This method will change the service to the + // `Soft-Delete` state for 30 days. Within this period, service producers may + // call [UndeleteService][google.api.servicemanagement.v1.ServiceManager.UndeleteService] to restore the service. + // After 30 days, the service will be permanently deleted. + // + // Operation + DeleteService(context.Context, *DeleteServiceRequest) (*google_longrunning.Operation, error) + // Revives a previously deleted managed service. The method restores the + // service using the configuration at the time the service was deleted. + // The target service must exist and must have been deleted within the + // last 30 days. + // + // Operation + UndeleteService(context.Context, *UndeleteServiceRequest) (*google_longrunning.Operation, error) + // Lists the history of the service configuration for a managed service, + // from the newest to the oldest. + ListServiceConfigs(context.Context, *ListServiceConfigsRequest) (*ListServiceConfigsResponse, error) + // Gets a service configuration (version) for a managed service. + GetServiceConfig(context.Context, *GetServiceConfigRequest) (*google_api22.Service, error) + // Creates a new service configuration (version) for a managed service. + // This method only stores the service configuration. To roll out the service + // configuration to backend systems please call + // [CreateServiceRollout][google.api.servicemanagement.v1.ServiceManager.CreateServiceRollout]. + CreateServiceConfig(context.Context, *CreateServiceConfigRequest) (*google_api22.Service, error) + // Creates a new service configuration (version) for a managed service based + // on + // user-supplied configuration source files (for example: OpenAPI + // Specification). This method stores the source configurations as well as the + // generated service configuration. To rollout the service configuration to + // other services, + // please call [CreateServiceRollout][google.api.servicemanagement.v1.ServiceManager.CreateServiceRollout]. + // + // Operation + SubmitConfigSource(context.Context, *SubmitConfigSourceRequest) (*google_longrunning.Operation, error) + // Lists the history of the service configuration rollouts for a managed + // service, from the newest to the oldest. + ListServiceRollouts(context.Context, *ListServiceRolloutsRequest) (*ListServiceRolloutsResponse, error) + // Gets a service configuration [rollout][google.api.servicemanagement.v1.Rollout]. + GetServiceRollout(context.Context, *GetServiceRolloutRequest) (*Rollout, error) + // Creates a new service configuration rollout. Based on rollout, the + // Google Service Management will roll out the service configurations to + // different backend services. For example, the logging configuration will be + // pushed to Google Cloud Logging. + // + // Please note that any previous pending and running Rollouts and associated + // Operations will be automatically cancelled so that the latest Rollout will + // not be blocked by previous Rollouts. + // + // Operation + CreateServiceRollout(context.Context, *CreateServiceRolloutRequest) (*google_longrunning.Operation, error) + // Generates and returns a report (errors, warnings and changes from + // existing configurations) associated with + // GenerateConfigReportRequest.new_value + // + // If GenerateConfigReportRequest.old_value is specified, + // GenerateConfigReportRequest will contain a single ChangeReport based on the + // comparison between GenerateConfigReportRequest.new_value and + // GenerateConfigReportRequest.old_value. + // If GenerateConfigReportRequest.old_value is not specified, this method + // will compare GenerateConfigReportRequest.new_value with the last pushed + // service configuration. + GenerateConfigReport(context.Context, *GenerateConfigReportRequest) (*GenerateConfigReportResponse, error) + // Enables a [service][google.api.servicemanagement.v1.ManagedService] for a project, so it can be used + // for the project. See + // [Cloud Auth Guide](https://cloud.google.com/docs/authentication) for + // more information. + // + // Operation + EnableService(context.Context, *EnableServiceRequest) (*google_longrunning.Operation, error) + // Disables a [service][google.api.servicemanagement.v1.ManagedService] for a project, so it can no longer be + // be used for the project. It prevents accidental usage that may cause + // unexpected billing charges or security leaks. + // + // Operation + DisableService(context.Context, *DisableServiceRequest) (*google_longrunning.Operation, error) +} + +func RegisterServiceManagerServer(s *grpc.Server, srv ServiceManagerServer) { + s.RegisterService(&_ServiceManager_serviceDesc, srv) +} + +func _ServiceManager_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.(ServiceManagerServer).ListServices(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.api.servicemanagement.v1.ServiceManager/ListServices", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceManagerServer).ListServices(ctx, req.(*ListServicesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ServiceManager_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.(ServiceManagerServer).GetService(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.api.servicemanagement.v1.ServiceManager/GetService", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceManagerServer).GetService(ctx, req.(*GetServiceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ServiceManager_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.(ServiceManagerServer).CreateService(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.api.servicemanagement.v1.ServiceManager/CreateService", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceManagerServer).CreateService(ctx, req.(*CreateServiceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ServiceManager_DeleteService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteServiceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceManagerServer).DeleteService(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.api.servicemanagement.v1.ServiceManager/DeleteService", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceManagerServer).DeleteService(ctx, req.(*DeleteServiceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ServiceManager_UndeleteService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UndeleteServiceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceManagerServer).UndeleteService(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.api.servicemanagement.v1.ServiceManager/UndeleteService", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceManagerServer).UndeleteService(ctx, req.(*UndeleteServiceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ServiceManager_ListServiceConfigs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListServiceConfigsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceManagerServer).ListServiceConfigs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.api.servicemanagement.v1.ServiceManager/ListServiceConfigs", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceManagerServer).ListServiceConfigs(ctx, req.(*ListServiceConfigsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ServiceManager_GetServiceConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetServiceConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceManagerServer).GetServiceConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.api.servicemanagement.v1.ServiceManager/GetServiceConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceManagerServer).GetServiceConfig(ctx, req.(*GetServiceConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ServiceManager_CreateServiceConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateServiceConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceManagerServer).CreateServiceConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.api.servicemanagement.v1.ServiceManager/CreateServiceConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceManagerServer).CreateServiceConfig(ctx, req.(*CreateServiceConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ServiceManager_SubmitConfigSource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SubmitConfigSourceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceManagerServer).SubmitConfigSource(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.api.servicemanagement.v1.ServiceManager/SubmitConfigSource", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceManagerServer).SubmitConfigSource(ctx, req.(*SubmitConfigSourceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ServiceManager_ListServiceRollouts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListServiceRolloutsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceManagerServer).ListServiceRollouts(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.api.servicemanagement.v1.ServiceManager/ListServiceRollouts", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceManagerServer).ListServiceRollouts(ctx, req.(*ListServiceRolloutsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ServiceManager_GetServiceRollout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetServiceRolloutRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceManagerServer).GetServiceRollout(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.api.servicemanagement.v1.ServiceManager/GetServiceRollout", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceManagerServer).GetServiceRollout(ctx, req.(*GetServiceRolloutRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ServiceManager_CreateServiceRollout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateServiceRolloutRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceManagerServer).CreateServiceRollout(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.api.servicemanagement.v1.ServiceManager/CreateServiceRollout", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceManagerServer).CreateServiceRollout(ctx, req.(*CreateServiceRolloutRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ServiceManager_GenerateConfigReport_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GenerateConfigReportRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceManagerServer).GenerateConfigReport(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.api.servicemanagement.v1.ServiceManager/GenerateConfigReport", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceManagerServer).GenerateConfigReport(ctx, req.(*GenerateConfigReportRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ServiceManager_EnableService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EnableServiceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceManagerServer).EnableService(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.api.servicemanagement.v1.ServiceManager/EnableService", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceManagerServer).EnableService(ctx, req.(*EnableServiceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ServiceManager_DisableService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DisableServiceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceManagerServer).DisableService(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.api.servicemanagement.v1.ServiceManager/DisableService", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceManagerServer).DisableService(ctx, req.(*DisableServiceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _ServiceManager_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.api.servicemanagement.v1.ServiceManager", + HandlerType: (*ServiceManagerServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListServices", + Handler: _ServiceManager_ListServices_Handler, + }, + { + MethodName: "GetService", + Handler: _ServiceManager_GetService_Handler, + }, + { + MethodName: "CreateService", + Handler: _ServiceManager_CreateService_Handler, + }, + { + MethodName: "DeleteService", + Handler: _ServiceManager_DeleteService_Handler, + }, + { + MethodName: "UndeleteService", + Handler: _ServiceManager_UndeleteService_Handler, + }, + { + MethodName: "ListServiceConfigs", + Handler: _ServiceManager_ListServiceConfigs_Handler, + }, + { + MethodName: "GetServiceConfig", + Handler: _ServiceManager_GetServiceConfig_Handler, + }, + { + MethodName: "CreateServiceConfig", + Handler: _ServiceManager_CreateServiceConfig_Handler, + }, + { + MethodName: "SubmitConfigSource", + Handler: _ServiceManager_SubmitConfigSource_Handler, + }, + { + MethodName: "ListServiceRollouts", + Handler: _ServiceManager_ListServiceRollouts_Handler, + }, + { + MethodName: "GetServiceRollout", + Handler: _ServiceManager_GetServiceRollout_Handler, + }, + { + MethodName: "CreateServiceRollout", + Handler: _ServiceManager_CreateServiceRollout_Handler, + }, + { + MethodName: "GenerateConfigReport", + Handler: _ServiceManager_GenerateConfigReport_Handler, + }, + { + MethodName: "EnableService", + Handler: _ServiceManager_EnableService_Handler, + }, + { + MethodName: "DisableService", + Handler: _ServiceManager_DisableService_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/api/servicemanagement/v1/servicemanager.proto", +} + +func init() { + proto.RegisterFile("google/api/servicemanagement/v1/servicemanager.proto", fileDescriptor1) +} + +var fileDescriptor1 = []byte{ + // 1420 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0x4f, 0x6f, 0x1b, 0x45, + 0x14, 0x67, 0x9c, 0xb4, 0x4d, 0x5e, 0x62, 0xb7, 0x9d, 0xb8, 0x8d, 0xeb, 0x34, 0x6a, 0xba, 0x81, + 0x12, 0xa5, 0xd4, 0xab, 0xa4, 0xff, 0xa8, 0x53, 0x0e, 0x4d, 0x02, 0x55, 0x44, 0x4b, 0x23, 0xa7, + 0x05, 0x54, 0x90, 0xac, 0xcd, 0xee, 0x64, 0xbb, 0x74, 0x3d, 0x63,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8, 0x5c, 0xdf, 0xe3, 0xac, 0x6a, 0x05, + 0x9e, 0xab, 0x68, 0x7e, 0xf9, 0x1b, 0x04, 0xb3, 0x26, 0x6b, 0x24, 0x91, 0x59, 0x9e, 0x50, 0x55, + 0xdd, 0x7a, 0x5b, 0xf8, 0xae, 0xa3, 0x87, 0xeb, 0x12, 0x67, 0x33, 0xd7, 0xa0, 0x76, 0x85, 0x79, + 0xb6, 0x6e, 0x13, 0x2a, 0x64, 0xb1, 0xfc, 0x5f, 0x6a, 0x34, 0x1d, 0x7e, 0xe8, 0x3f, 0xd3, 0xa5, + 0x1e, 0xe3, 0xcb, 0xdc, 0xf0, 0xed, 0x5b, 0x1b, 0x77, 0x37, 0x8f, 0x0a, 0x1f, 0x97, 0xff, 0x09, + 0x00, 0x00, 0xff, 0xff, 0x50, 0x43, 0x0b, 0xb9, 0x1c, 0x16, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/appengine/legacy/audit_data.pb.go b/vendor/google.golang.org/genproto/googleapis/appengine/legacy/audit_data.pb.go new file mode 100644 index 0000000000..48c409a999 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/appengine/legacy/audit_data.pb.go @@ -0,0 +1,83 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/appengine/legacy/audit_data.proto + +/* +Package legacy is a generated protocol buffer package. + +It is generated from these files: + google/appengine/legacy/audit_data.proto + +It has these top-level messages: + AuditData +*/ +package legacy + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Admin Console legacy audit log. +type AuditData struct { + // Text description of the admin event. + // This is the "Event" column in Admin Console's Admin Logs. + EventMessage string `protobuf:"bytes,1,opt,name=event_message,json=eventMessage" json:"event_message,omitempty"` + // Arbitrary event data. + // This is the "Result" column in Admin Console's Admin Logs. + EventData map[string]string `protobuf:"bytes,2,rep,name=event_data,json=eventData" json:"event_data,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *AuditData) Reset() { *m = AuditData{} } +func (m *AuditData) String() string { return proto.CompactTextString(m) } +func (*AuditData) ProtoMessage() {} +func (*AuditData) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *AuditData) GetEventMessage() string { + if m != nil { + return m.EventMessage + } + return "" +} + +func (m *AuditData) GetEventData() map[string]string { + if m != nil { + return m.EventData + } + return nil +} + +func init() { + proto.RegisterType((*AuditData)(nil), "google.appengine.legacy.AuditData") +} + +func init() { proto.RegisterFile("google/appengine/legacy/audit_data.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 247 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x90, 0x4f, 0x4b, 0x03, 0x31, + 0x10, 0xc5, 0xc9, 0x16, 0x85, 0x1d, 0xb5, 0x48, 0x10, 0x5c, 0xf4, 0x52, 0xf4, 0xb2, 0xa7, 0x04, + 0xf5, 0x22, 0xfe, 0x39, 0x58, 0xec, 0x51, 0x58, 0x7a, 0xf4, 0x52, 0xc6, 0x76, 0x18, 0x16, 0xb7, + 0x49, 0xd8, 0x4d, 0x0b, 0xfb, 0xed, 0xfc, 0x68, 0x92, 0xa4, 0x2e, 0x48, 0xe9, 0x29, 0x33, 0x6f, + 0x7e, 0x99, 0x79, 0x3c, 0x28, 0xd9, 0x5a, 0x6e, 0x48, 0xa3, 0x73, 0x64, 0xb8, 0x36, 0xa4, 0x1b, + 0x62, 0x5c, 0xf6, 0x1a, 0x37, 0xab, 0xda, 0x2f, 0x56, 0xe8, 0x51, 0xb9, 0xd6, 0x7a, 0x2b, 0x2f, + 0x13, 0xa9, 0x06, 0x52, 0x25, 0xf2, 0xe6, 0x47, 0x40, 0xfe, 0x16, 0xe8, 0x77, 0xf4, 0x28, 0x6f, + 0xe1, 0x8c, 0xb6, 0x64, 0xfc, 0x62, 0x4d, 0x5d, 0x87, 0x4c, 0x85, 0x98, 0x88, 0x32, 0x9f, 0x9f, + 0x46, 0xf1, 0x23, 0x69, 0xb2, 0x02, 0x48, 0x50, 0xd8, 0x5f, 0x64, 0x93, 0x51, 0x79, 0x72, 0x7f, + 0xa7, 0x0e, 0x1c, 0x50, 0xc3, 0x72, 0x35, 0x0b, 0x9f, 0x42, 0x35, 0x33, 0xbe, 0xed, 0xe7, 0x39, + 0xfd, 0xf5, 0x57, 0x2f, 0x30, 0xfe, 0x3f, 0x94, 0xe7, 0x30, 0xfa, 0xa6, 0x7e, 0x77, 0x3e, 0x94, + 0xf2, 0x02, 0x8e, 0xb6, 0xd8, 0x6c, 0xa8, 0xc8, 0xa2, 0x96, 0x9a, 0xa7, 0xec, 0x51, 0x4c, 0x0d, + 0x5c, 0x2f, 0xed, 0xfa, 0x90, 0x81, 0xe9, 0x78, 0x70, 0x50, 0x85, 0x28, 0x2a, 0xf1, 0xf9, 0xba, + 0x43, 0xd9, 0x36, 0x68, 0x58, 0xd9, 0x96, 0x35, 0x93, 0x89, 0x41, 0xe9, 0x34, 0x42, 0x57, 0x77, + 0x7b, 0xa9, 0x3e, 0xa7, 0xe7, 0xeb, 0x38, 0x92, 0x0f, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x4e, + 0x5d, 0x14, 0xaa, 0x7e, 0x01, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/appengine/logging/v1/request_log.pb.go b/vendor/google.golang.org/genproto/googleapis/appengine/logging/v1/request_log.pb.go new file mode 100644 index 0000000000..7fb8990eb1 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/appengine/logging/v1/request_log.pb.go @@ -0,0 +1,538 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/appengine/logging/v1/request_log.proto + +/* +Package logging is a generated protocol buffer package. + +It is generated from these files: + google/appengine/logging/v1/request_log.proto + +It has these top-level messages: + LogLine + SourceLocation + SourceReference + RequestLog +*/ +package logging + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import google_logging_type "google.golang.org/genproto/googleapis/logging/type" +import google_protobuf1 "github.com/golang/protobuf/ptypes/duration" +import google_protobuf2 "github.com/golang/protobuf/ptypes/timestamp" + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Application log line emitted while processing a request. +type LogLine struct { + // Approximate time when this log entry was made. + Time *google_protobuf2.Timestamp `protobuf:"bytes,1,opt,name=time" json:"time,omitempty"` + // Severity of this log entry. + Severity google_logging_type.LogSeverity `protobuf:"varint,2,opt,name=severity,enum=google.logging.type.LogSeverity" json:"severity,omitempty"` + // App-provided log message. + LogMessage string `protobuf:"bytes,3,opt,name=log_message,json=logMessage" json:"log_message,omitempty"` + // Where in the source code this log message was written. + SourceLocation *SourceLocation `protobuf:"bytes,4,opt,name=source_location,json=sourceLocation" json:"source_location,omitempty"` +} + +func (m *LogLine) Reset() { *m = LogLine{} } +func (m *LogLine) String() string { return proto.CompactTextString(m) } +func (*LogLine) ProtoMessage() {} +func (*LogLine) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *LogLine) GetTime() *google_protobuf2.Timestamp { + if m != nil { + return m.Time + } + return nil +} + +func (m *LogLine) GetSeverity() google_logging_type.LogSeverity { + if m != nil { + return m.Severity + } + return google_logging_type.LogSeverity_DEFAULT +} + +func (m *LogLine) GetLogMessage() string { + if m != nil { + return m.LogMessage + } + return "" +} + +func (m *LogLine) GetSourceLocation() *SourceLocation { + if m != nil { + return m.SourceLocation + } + return nil +} + +// Specifies a location in a source code file. +type SourceLocation struct { + // Source file name. Depending on the runtime environment, this might be a + // simple name or a fully-qualified name. + File string `protobuf:"bytes,1,opt,name=file" json:"file,omitempty"` + // Line within the source file. + Line int64 `protobuf:"varint,2,opt,name=line" json:"line,omitempty"` + // Human-readable name of the function or method being invoked, with optional + // context such as the class or package name. This information is used in + // contexts such as the logs viewer, where a file and line number are less + // meaningful. The format can vary by language. For example: + // `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function` + // (Python). + FunctionName string `protobuf:"bytes,3,opt,name=function_name,json=functionName" json:"function_name,omitempty"` +} + +func (m *SourceLocation) Reset() { *m = SourceLocation{} } +func (m *SourceLocation) String() string { return proto.CompactTextString(m) } +func (*SourceLocation) ProtoMessage() {} +func (*SourceLocation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *SourceLocation) GetFile() string { + if m != nil { + return m.File + } + return "" +} + +func (m *SourceLocation) GetLine() int64 { + if m != nil { + return m.Line + } + return 0 +} + +func (m *SourceLocation) GetFunctionName() string { + if m != nil { + return m.FunctionName + } + return "" +} + +// A reference to a particular snapshot of the source tree used to build and +// deploy an application. +type SourceReference struct { + // Optional. A URI string identifying the repository. + // Example: "https://github.com/GoogleCloudPlatform/kubernetes.git" + Repository string `protobuf:"bytes,1,opt,name=repository" json:"repository,omitempty"` + // The canonical and persistent identifier of the deployed revision. + // Example (git): "0035781c50ec7aa23385dc841529ce8a4b70db1b" + RevisionId string `protobuf:"bytes,2,opt,name=revision_id,json=revisionId" json:"revision_id,omitempty"` +} + +func (m *SourceReference) Reset() { *m = SourceReference{} } +func (m *SourceReference) String() string { return proto.CompactTextString(m) } +func (*SourceReference) ProtoMessage() {} +func (*SourceReference) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *SourceReference) GetRepository() string { + if m != nil { + return m.Repository + } + return "" +} + +func (m *SourceReference) GetRevisionId() string { + if m != nil { + return m.RevisionId + } + return "" +} + +// Complete log information about a single HTTP request to an App Engine +// application. +type RequestLog struct { + // Application that handled this request. + AppId string `protobuf:"bytes,1,opt,name=app_id,json=appId" json:"app_id,omitempty"` + // Module of the application that handled this request. + ModuleId string `protobuf:"bytes,37,opt,name=module_id,json=moduleId" json:"module_id,omitempty"` + // Version of the application that handled this request. + VersionId string `protobuf:"bytes,2,opt,name=version_id,json=versionId" json:"version_id,omitempty"` + // Globally unique identifier for a request, which is based on the request + // start time. Request IDs for requests which started later will compare + // greater as strings than those for requests which started earlier. + RequestId string `protobuf:"bytes,3,opt,name=request_id,json=requestId" json:"request_id,omitempty"` + // Origin IP address. + Ip string `protobuf:"bytes,4,opt,name=ip" json:"ip,omitempty"` + // Time when the request started. + StartTime *google_protobuf2.Timestamp `protobuf:"bytes,6,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + // Time when the request finished. + EndTime *google_protobuf2.Timestamp `protobuf:"bytes,7,opt,name=end_time,json=endTime" json:"end_time,omitempty"` + // Latency of the request. + Latency *google_protobuf1.Duration `protobuf:"bytes,8,opt,name=latency" json:"latency,omitempty"` + // Number of CPU megacycles used to process request. + MegaCycles int64 `protobuf:"varint,9,opt,name=mega_cycles,json=megaCycles" json:"mega_cycles,omitempty"` + // Request method. Example: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`, `"DELETE"`. + Method string `protobuf:"bytes,10,opt,name=method" json:"method,omitempty"` + // Contains the path and query portion of the URL that was requested. For + // example, if the URL was "http://example.com/app?name=val", the resource + // would be "/app?name=val". The fragment identifier, which is identified by + // the `#` character, is not included. + Resource string `protobuf:"bytes,11,opt,name=resource" json:"resource,omitempty"` + // HTTP version of request. Example: `"HTTP/1.1"`. + HttpVersion string `protobuf:"bytes,12,opt,name=http_version,json=httpVersion" json:"http_version,omitempty"` + // HTTP response status code. Example: 200, 404. + Status int32 `protobuf:"varint,13,opt,name=status" json:"status,omitempty"` + // Size in bytes sent back to client by request. + ResponseSize int64 `protobuf:"varint,14,opt,name=response_size,json=responseSize" json:"response_size,omitempty"` + // Referrer URL of request. + Referrer string `protobuf:"bytes,15,opt,name=referrer" json:"referrer,omitempty"` + // User agent that made the request. + UserAgent string `protobuf:"bytes,16,opt,name=user_agent,json=userAgent" json:"user_agent,omitempty"` + // The logged-in user who made the request. + // + // Most likely, this is the part of the user's email before the `@` sign. The + // field value is the same for different requests from the same user, but + // different users can have similar names. This information is also + // available to the application via the App Engine Users API. + // + // This field will be populated starting with App Engine 1.9.21. + Nickname string `protobuf:"bytes,40,opt,name=nickname" json:"nickname,omitempty"` + // File or class that handled the request. + UrlMapEntry string `protobuf:"bytes,17,opt,name=url_map_entry,json=urlMapEntry" json:"url_map_entry,omitempty"` + // Internet host and port number of the resource being requested. + Host string `protobuf:"bytes,20,opt,name=host" json:"host,omitempty"` + // An indication of the relative cost of serving this request. + Cost float64 `protobuf:"fixed64,21,opt,name=cost" json:"cost,omitempty"` + // Queue name of the request, in the case of an offline request. + TaskQueueName string `protobuf:"bytes,22,opt,name=task_queue_name,json=taskQueueName" json:"task_queue_name,omitempty"` + // Task name of the request, in the case of an offline request. + TaskName string `protobuf:"bytes,23,opt,name=task_name,json=taskName" json:"task_name,omitempty"` + // Whether this was a loading request for the instance. + WasLoadingRequest bool `protobuf:"varint,24,opt,name=was_loading_request,json=wasLoadingRequest" json:"was_loading_request,omitempty"` + // Time this request spent in the pending request queue. + PendingTime *google_protobuf1.Duration `protobuf:"bytes,25,opt,name=pending_time,json=pendingTime" json:"pending_time,omitempty"` + // If the instance processing this request belongs to a manually scaled + // module, then this is the 0-based index of the instance. Otherwise, this + // value is -1. + InstanceIndex int32 `protobuf:"varint,26,opt,name=instance_index,json=instanceIndex" json:"instance_index,omitempty"` + // Whether this request is finished or active. + Finished bool `protobuf:"varint,27,opt,name=finished" json:"finished,omitempty"` + // Whether this is the first `RequestLog` entry for this request. If an + // active request has several `RequestLog` entries written to Stackdriver + // Logging, then this field will be set for one of them. + First bool `protobuf:"varint,42,opt,name=first" json:"first,omitempty"` + // An identifier for the instance that handled the request. + InstanceId string `protobuf:"bytes,28,opt,name=instance_id,json=instanceId" json:"instance_id,omitempty"` + // A list of log lines emitted by the application while serving this request. + Line []*LogLine `protobuf:"bytes,29,rep,name=line" json:"line,omitempty"` + // App Engine release version. + AppEngineRelease string `protobuf:"bytes,38,opt,name=app_engine_release,json=appEngineRelease" json:"app_engine_release,omitempty"` + // Stackdriver Trace identifier for this request. + TraceId string `protobuf:"bytes,39,opt,name=trace_id,json=traceId" json:"trace_id,omitempty"` + // Source code for the application that handled this request. There can be + // more than one source reference per deployed application if source code is + // distributed among multiple repositories. + SourceReference []*SourceReference `protobuf:"bytes,41,rep,name=source_reference,json=sourceReference" json:"source_reference,omitempty"` +} + +func (m *RequestLog) Reset() { *m = RequestLog{} } +func (m *RequestLog) String() string { return proto.CompactTextString(m) } +func (*RequestLog) ProtoMessage() {} +func (*RequestLog) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *RequestLog) GetAppId() string { + if m != nil { + return m.AppId + } + return "" +} + +func (m *RequestLog) GetModuleId() string { + if m != nil { + return m.ModuleId + } + return "" +} + +func (m *RequestLog) GetVersionId() string { + if m != nil { + return m.VersionId + } + return "" +} + +func (m *RequestLog) GetRequestId() string { + if m != nil { + return m.RequestId + } + return "" +} + +func (m *RequestLog) GetIp() string { + if m != nil { + return m.Ip + } + return "" +} + +func (m *RequestLog) GetStartTime() *google_protobuf2.Timestamp { + if m != nil { + return m.StartTime + } + return nil +} + +func (m *RequestLog) GetEndTime() *google_protobuf2.Timestamp { + if m != nil { + return m.EndTime + } + return nil +} + +func (m *RequestLog) GetLatency() *google_protobuf1.Duration { + if m != nil { + return m.Latency + } + return nil +} + +func (m *RequestLog) GetMegaCycles() int64 { + if m != nil { + return m.MegaCycles + } + return 0 +} + +func (m *RequestLog) GetMethod() string { + if m != nil { + return m.Method + } + return "" +} + +func (m *RequestLog) GetResource() string { + if m != nil { + return m.Resource + } + return "" +} + +func (m *RequestLog) GetHttpVersion() string { + if m != nil { + return m.HttpVersion + } + return "" +} + +func (m *RequestLog) GetStatus() int32 { + if m != nil { + return m.Status + } + return 0 +} + +func (m *RequestLog) GetResponseSize() int64 { + if m != nil { + return m.ResponseSize + } + return 0 +} + +func (m *RequestLog) GetReferrer() string { + if m != nil { + return m.Referrer + } + return "" +} + +func (m *RequestLog) GetUserAgent() string { + if m != nil { + return m.UserAgent + } + return "" +} + +func (m *RequestLog) GetNickname() string { + if m != nil { + return m.Nickname + } + return "" +} + +func (m *RequestLog) GetUrlMapEntry() string { + if m != nil { + return m.UrlMapEntry + } + return "" +} + +func (m *RequestLog) GetHost() string { + if m != nil { + return m.Host + } + return "" +} + +func (m *RequestLog) GetCost() float64 { + if m != nil { + return m.Cost + } + return 0 +} + +func (m *RequestLog) GetTaskQueueName() string { + if m != nil { + return m.TaskQueueName + } + return "" +} + +func (m *RequestLog) GetTaskName() string { + if m != nil { + return m.TaskName + } + return "" +} + +func (m *RequestLog) GetWasLoadingRequest() bool { + if m != nil { + return m.WasLoadingRequest + } + return false +} + +func (m *RequestLog) GetPendingTime() *google_protobuf1.Duration { + if m != nil { + return m.PendingTime + } + return nil +} + +func (m *RequestLog) GetInstanceIndex() int32 { + if m != nil { + return m.InstanceIndex + } + return 0 +} + +func (m *RequestLog) GetFinished() bool { + if m != nil { + return m.Finished + } + return false +} + +func (m *RequestLog) GetFirst() bool { + if m != nil { + return m.First + } + return false +} + +func (m *RequestLog) GetInstanceId() string { + if m != nil { + return m.InstanceId + } + return "" +} + +func (m *RequestLog) GetLine() []*LogLine { + if m != nil { + return m.Line + } + return nil +} + +func (m *RequestLog) GetAppEngineRelease() string { + if m != nil { + return m.AppEngineRelease + } + return "" +} + +func (m *RequestLog) GetTraceId() string { + if m != nil { + return m.TraceId + } + return "" +} + +func (m *RequestLog) GetSourceReference() []*SourceReference { + if m != nil { + return m.SourceReference + } + return nil +} + +func init() { + proto.RegisterType((*LogLine)(nil), "google.appengine.logging.v1.LogLine") + proto.RegisterType((*SourceLocation)(nil), "google.appengine.logging.v1.SourceLocation") + proto.RegisterType((*SourceReference)(nil), "google.appengine.logging.v1.SourceReference") + proto.RegisterType((*RequestLog)(nil), "google.appengine.logging.v1.RequestLog") +} + +func init() { proto.RegisterFile("google/appengine/logging/v1/request_log.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 921 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0x7f, 0x6f, 0x1c, 0x35, + 0x10, 0xd5, 0xe6, 0xe7, 0x9d, 0x2f, 0xb9, 0xa4, 0xa6, 0x2d, 0x4e, 0x42, 0x9b, 0x23, 0xd0, 0x70, + 0x40, 0xd9, 0x53, 0x53, 0x21, 0x81, 0xe8, 0x3f, 0x04, 0xfa, 0xc7, 0x49, 0x57, 0x54, 0x36, 0x15, + 0x48, 0x48, 0x68, 0xe5, 0xee, 0xce, 0x6d, 0xac, 0xee, 0xda, 0xae, 0xed, 0xbd, 0xf6, 0xfa, 0x41, + 0xf8, 0x98, 0x7c, 0x06, 0xe4, 0xb1, 0xf7, 0x4a, 0x00, 0x25, 0xfc, 0xb7, 0xf3, 0xe6, 0xbd, 0xf1, + 0xd8, 0x7e, 0x9e, 0x25, 0x5f, 0x55, 0x4a, 0x55, 0x35, 0x4c, 0xb8, 0xd6, 0x20, 0x2b, 0x21, 0x61, + 0x52, 0xab, 0xaa, 0x12, 0xb2, 0x9a, 0x2c, 0x1e, 0x4d, 0x0c, 0xbc, 0x6e, 0xc1, 0xba, 0xbc, 0x56, + 0x55, 0xaa, 0x8d, 0x72, 0x8a, 0x1e, 0x05, 0x7a, 0xba, 0xa2, 0xa7, 0x91, 0x9e, 0x2e, 0x1e, 0x1d, + 0x9e, 0xc6, 0x5a, 0x5d, 0x05, 0xb7, 0xd4, 0x18, 0xe4, 0x16, 0x16, 0x60, 0x84, 0x5b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, 0xdc, 0x5f, 0xd1, 0xf3, 0xe4, 0xb7, 0xf3, 0xc8, 0xaf, + 0x54, 0xcd, 0x65, 0x95, 0x2a, 0x53, 0x4d, 0x2a, 0x90, 0x78, 0x81, 0x93, 0x90, 0xe2, 0x5a, 0xd8, + 0xff, 0xfc, 0x8d, 0x7e, 0x17, 0x3f, 0x5f, 0x6e, 0x21, 0xfd, 0xf1, 0x5f, 0x01, 0x00, 0x00, 0xff, + 0xff, 0x05, 0xf7, 0x68, 0xa8, 0x74, 0x07, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/appengine/v1/app_yaml.pb.go b/vendor/google.golang.org/genproto/googleapis/appengine/v1/app_yaml.pb.go new file mode 100644 index 0000000000..af25606a9b --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/appengine/v1/app_yaml.pb.go @@ -0,0 +1,900 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/appengine/v1/app_yaml.proto + +/* +Package appengine is a generated protocol buffer package. + +It is generated from these files: + google/appengine/v1/app_yaml.proto + google/appengine/v1/appengine.proto + google/appengine/v1/application.proto + google/appengine/v1/audit_data.proto + google/appengine/v1/deploy.proto + google/appengine/v1/instance.proto + google/appengine/v1/location.proto + google/appengine/v1/operation.proto + google/appengine/v1/service.proto + google/appengine/v1/version.proto + +It has these top-level messages: + ApiConfigHandler + ErrorHandler + UrlMap + StaticFilesHandler + ScriptHandler + ApiEndpointHandler + HealthCheck + Library + GetApplicationRequest + RepairApplicationRequest + ListServicesRequest + ListServicesResponse + GetServiceRequest + UpdateServiceRequest + DeleteServiceRequest + ListVersionsRequest + ListVersionsResponse + GetVersionRequest + CreateVersionRequest + UpdateVersionRequest + DeleteVersionRequest + ListInstancesRequest + ListInstancesResponse + GetInstanceRequest + DeleteInstanceRequest + DebugInstanceRequest + Application + UrlDispatchRule + AuditData + UpdateServiceMethod + CreateVersionMethod + Deployment + FileInfo + ContainerInfo + ZipInfo + Instance + LocationMetadata + OperationMetadataV1 + Service + TrafficSplit + Version + AutomaticScaling + BasicScaling + ManualScaling + CpuUtilization + RequestUtilization + DiskUtilization + NetworkUtilization + Network + Resources +*/ +package appengine + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf1 "github.com/golang/protobuf/ptypes/duration" + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Actions to take when the user is not logged in. +type AuthFailAction int32 + +const ( + // Not specified. `AUTH_FAIL_ACTION_REDIRECT` is assumed. + AuthFailAction_AUTH_FAIL_ACTION_UNSPECIFIED AuthFailAction = 0 + // Redirects user to "accounts.google.com". The user is redirected back to the + // application URL after signing in or creating an account. + AuthFailAction_AUTH_FAIL_ACTION_REDIRECT AuthFailAction = 1 + // Rejects request with a `401` HTTP status code and an error + // message. + AuthFailAction_AUTH_FAIL_ACTION_UNAUTHORIZED AuthFailAction = 2 +) + +var AuthFailAction_name = map[int32]string{ + 0: "AUTH_FAIL_ACTION_UNSPECIFIED", + 1: "AUTH_FAIL_ACTION_REDIRECT", + 2: "AUTH_FAIL_ACTION_UNAUTHORIZED", +} +var AuthFailAction_value = map[string]int32{ + "AUTH_FAIL_ACTION_UNSPECIFIED": 0, + "AUTH_FAIL_ACTION_REDIRECT": 1, + "AUTH_FAIL_ACTION_UNAUTHORIZED": 2, +} + +func (x AuthFailAction) String() string { + return proto.EnumName(AuthFailAction_name, int32(x)) +} +func (AuthFailAction) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +// Methods to restrict access to a URL based on login status. +type LoginRequirement int32 + +const ( + // Not specified. `LOGIN_OPTIONAL` is assumed. + LoginRequirement_LOGIN_UNSPECIFIED LoginRequirement = 0 + // Does not require that the user is signed in. + LoginRequirement_LOGIN_OPTIONAL LoginRequirement = 1 + // If the user is not signed in, the `auth_fail_action` is taken. + // In addition, if the user is not an administrator for the + // application, they are given an error message regardless of + // `auth_fail_action`. If the user is an administrator, the handler + // proceeds. + LoginRequirement_LOGIN_ADMIN LoginRequirement = 2 + // If the user has signed in, the handler proceeds normally. Otherwise, the + // auth_fail_action is taken. + LoginRequirement_LOGIN_REQUIRED LoginRequirement = 3 +) + +var LoginRequirement_name = map[int32]string{ + 0: "LOGIN_UNSPECIFIED", + 1: "LOGIN_OPTIONAL", + 2: "LOGIN_ADMIN", + 3: "LOGIN_REQUIRED", +} +var LoginRequirement_value = map[string]int32{ + "LOGIN_UNSPECIFIED": 0, + "LOGIN_OPTIONAL": 1, + "LOGIN_ADMIN": 2, + "LOGIN_REQUIRED": 3, +} + +func (x LoginRequirement) String() string { + return proto.EnumName(LoginRequirement_name, int32(x)) +} +func (LoginRequirement) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +// Methods to enforce security (HTTPS) on a URL. +type SecurityLevel int32 + +const ( + // Not specified. + SecurityLevel_SECURE_UNSPECIFIED SecurityLevel = 0 + // Both HTTP and HTTPS requests with URLs that match the handler succeed + // without redirects. The application can examine the request to determine + // which protocol was used, and respond accordingly. + SecurityLevel_SECURE_DEFAULT SecurityLevel = 0 + // Requests for a URL that match this handler that use HTTPS are automatically + // redirected to the HTTP equivalent URL. + SecurityLevel_SECURE_NEVER SecurityLevel = 1 + // Both HTTP and HTTPS requests with URLs that match the handler succeed + // without redirects. The application can examine the request to determine + // which protocol was used and respond accordingly. + SecurityLevel_SECURE_OPTIONAL SecurityLevel = 2 + // Requests for a URL that match this handler that do not use HTTPS are + // automatically redirected to the HTTPS URL with the same path. Query + // parameters are reserved for the redirect. + SecurityLevel_SECURE_ALWAYS SecurityLevel = 3 +) + +var SecurityLevel_name = map[int32]string{ + 0: "SECURE_UNSPECIFIED", + // Duplicate value: 0: "SECURE_DEFAULT", + 1: "SECURE_NEVER", + 2: "SECURE_OPTIONAL", + 3: "SECURE_ALWAYS", +} +var SecurityLevel_value = map[string]int32{ + "SECURE_UNSPECIFIED": 0, + "SECURE_DEFAULT": 0, + "SECURE_NEVER": 1, + "SECURE_OPTIONAL": 2, + "SECURE_ALWAYS": 3, +} + +func (x SecurityLevel) String() string { + return proto.EnumName(SecurityLevel_name, int32(x)) +} +func (SecurityLevel) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +// Error codes. +type ErrorHandler_ErrorCode int32 + +const ( + // Not specified. ERROR_CODE_DEFAULT is assumed. + ErrorHandler_ERROR_CODE_UNSPECIFIED ErrorHandler_ErrorCode = 0 + // All other error types. + ErrorHandler_ERROR_CODE_DEFAULT ErrorHandler_ErrorCode = 0 + // Application has exceeded a resource quota. + ErrorHandler_ERROR_CODE_OVER_QUOTA ErrorHandler_ErrorCode = 1 + // Client blocked by the application's Denial of Service protection + // configuration. + ErrorHandler_ERROR_CODE_DOS_API_DENIAL ErrorHandler_ErrorCode = 2 + // Deadline reached before the application responds. + ErrorHandler_ERROR_CODE_TIMEOUT ErrorHandler_ErrorCode = 3 +) + +var ErrorHandler_ErrorCode_name = map[int32]string{ + 0: "ERROR_CODE_UNSPECIFIED", + // Duplicate value: 0: "ERROR_CODE_DEFAULT", + 1: "ERROR_CODE_OVER_QUOTA", + 2: "ERROR_CODE_DOS_API_DENIAL", + 3: "ERROR_CODE_TIMEOUT", +} +var ErrorHandler_ErrorCode_value = map[string]int32{ + "ERROR_CODE_UNSPECIFIED": 0, + "ERROR_CODE_DEFAULT": 0, + "ERROR_CODE_OVER_QUOTA": 1, + "ERROR_CODE_DOS_API_DENIAL": 2, + "ERROR_CODE_TIMEOUT": 3, +} + +func (x ErrorHandler_ErrorCode) String() string { + return proto.EnumName(ErrorHandler_ErrorCode_name, int32(x)) +} +func (ErrorHandler_ErrorCode) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{1, 0} } + +// Redirect codes. +type UrlMap_RedirectHttpResponseCode int32 + +const ( + // Not specified. `302` is assumed. + UrlMap_REDIRECT_HTTP_RESPONSE_CODE_UNSPECIFIED UrlMap_RedirectHttpResponseCode = 0 + // `301 Moved Permanently` code. + UrlMap_REDIRECT_HTTP_RESPONSE_CODE_301 UrlMap_RedirectHttpResponseCode = 1 + // `302 Moved Temporarily` code. + UrlMap_REDIRECT_HTTP_RESPONSE_CODE_302 UrlMap_RedirectHttpResponseCode = 2 + // `303 See Other` code. + UrlMap_REDIRECT_HTTP_RESPONSE_CODE_303 UrlMap_RedirectHttpResponseCode = 3 + // `307 Temporary Redirect` code. + UrlMap_REDIRECT_HTTP_RESPONSE_CODE_307 UrlMap_RedirectHttpResponseCode = 4 +) + +var UrlMap_RedirectHttpResponseCode_name = map[int32]string{ + 0: "REDIRECT_HTTP_RESPONSE_CODE_UNSPECIFIED", + 1: "REDIRECT_HTTP_RESPONSE_CODE_301", + 2: "REDIRECT_HTTP_RESPONSE_CODE_302", + 3: "REDIRECT_HTTP_RESPONSE_CODE_303", + 4: "REDIRECT_HTTP_RESPONSE_CODE_307", +} +var UrlMap_RedirectHttpResponseCode_value = map[string]int32{ + "REDIRECT_HTTP_RESPONSE_CODE_UNSPECIFIED": 0, + "REDIRECT_HTTP_RESPONSE_CODE_301": 1, + "REDIRECT_HTTP_RESPONSE_CODE_302": 2, + "REDIRECT_HTTP_RESPONSE_CODE_303": 3, + "REDIRECT_HTTP_RESPONSE_CODE_307": 4, +} + +func (x UrlMap_RedirectHttpResponseCode) String() string { + return proto.EnumName(UrlMap_RedirectHttpResponseCode_name, int32(x)) +} +func (UrlMap_RedirectHttpResponseCode) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{2, 0} +} + +// [Google Cloud Endpoints](https://cloud.google.com/appengine/docs/python/endpoints/) +// configuration for API handlers. +type ApiConfigHandler struct { + // Action to take when users access resources that require + // authentication. Defaults to `redirect`. + AuthFailAction AuthFailAction `protobuf:"varint,1,opt,name=auth_fail_action,json=authFailAction,enum=google.appengine.v1.AuthFailAction" json:"auth_fail_action,omitempty"` + // Level of login required to access this resource. Defaults to + // `optional`. + Login LoginRequirement `protobuf:"varint,2,opt,name=login,enum=google.appengine.v1.LoginRequirement" json:"login,omitempty"` + // Path to the script from the application root directory. + Script string `protobuf:"bytes,3,opt,name=script" json:"script,omitempty"` + // Security (HTTPS) enforcement for this URL. + SecurityLevel SecurityLevel `protobuf:"varint,4,opt,name=security_level,json=securityLevel,enum=google.appengine.v1.SecurityLevel" json:"security_level,omitempty"` + // URL to serve the endpoint at. + Url string `protobuf:"bytes,5,opt,name=url" json:"url,omitempty"` +} + +func (m *ApiConfigHandler) Reset() { *m = ApiConfigHandler{} } +func (m *ApiConfigHandler) String() string { return proto.CompactTextString(m) } +func (*ApiConfigHandler) ProtoMessage() {} +func (*ApiConfigHandler) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *ApiConfigHandler) GetAuthFailAction() AuthFailAction { + if m != nil { + return m.AuthFailAction + } + return AuthFailAction_AUTH_FAIL_ACTION_UNSPECIFIED +} + +func (m *ApiConfigHandler) GetLogin() LoginRequirement { + if m != nil { + return m.Login + } + return LoginRequirement_LOGIN_UNSPECIFIED +} + +func (m *ApiConfigHandler) GetScript() string { + if m != nil { + return m.Script + } + return "" +} + +func (m *ApiConfigHandler) GetSecurityLevel() SecurityLevel { + if m != nil { + return m.SecurityLevel + } + return SecurityLevel_SECURE_UNSPECIFIED +} + +func (m *ApiConfigHandler) GetUrl() string { + if m != nil { + return m.Url + } + return "" +} + +// Custom static error page to be served when an error occurs. +type ErrorHandler struct { + // Error condition this handler applies to. + ErrorCode ErrorHandler_ErrorCode `protobuf:"varint,1,opt,name=error_code,json=errorCode,enum=google.appengine.v1.ErrorHandler_ErrorCode" json:"error_code,omitempty"` + // Static file content to be served for this error. + StaticFile string `protobuf:"bytes,2,opt,name=static_file,json=staticFile" json:"static_file,omitempty"` + // MIME type of file. Defaults to `text/html`. + MimeType string `protobuf:"bytes,3,opt,name=mime_type,json=mimeType" json:"mime_type,omitempty"` +} + +func (m *ErrorHandler) Reset() { *m = ErrorHandler{} } +func (m *ErrorHandler) String() string { return proto.CompactTextString(m) } +func (*ErrorHandler) ProtoMessage() {} +func (*ErrorHandler) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *ErrorHandler) GetErrorCode() ErrorHandler_ErrorCode { + if m != nil { + return m.ErrorCode + } + return ErrorHandler_ERROR_CODE_UNSPECIFIED +} + +func (m *ErrorHandler) GetStaticFile() string { + if m != nil { + return m.StaticFile + } + return "" +} + +func (m *ErrorHandler) GetMimeType() string { + if m != nil { + return m.MimeType + } + return "" +} + +// URL pattern and description of how the URL should be handled. App Engine can +// handle URLs by executing application code or by serving static files +// uploaded with the version, such as images, CSS, or JavaScript. +type UrlMap struct { + // URL prefix. Uses regular expression syntax, which means regexp + // special characters must be escaped, but should not contain groupings. + // All URLs that begin with this prefix are handled by this handler, using the + // portion of the URL after the prefix as part of the file path. + UrlRegex string `protobuf:"bytes,1,opt,name=url_regex,json=urlRegex" json:"url_regex,omitempty"` + // Type of handler for this URL pattern. + // + // Types that are valid to be assigned to HandlerType: + // *UrlMap_StaticFiles + // *UrlMap_Script + // *UrlMap_ApiEndpoint + HandlerType isUrlMap_HandlerType `protobuf_oneof:"handler_type"` + // Security (HTTPS) enforcement for this URL. + SecurityLevel SecurityLevel `protobuf:"varint,5,opt,name=security_level,json=securityLevel,enum=google.appengine.v1.SecurityLevel" json:"security_level,omitempty"` + // Level of login required to access this resource. + Login LoginRequirement `protobuf:"varint,6,opt,name=login,enum=google.appengine.v1.LoginRequirement" json:"login,omitempty"` + // Action to take when users access resources that require + // authentication. Defaults to `redirect`. + AuthFailAction AuthFailAction `protobuf:"varint,7,opt,name=auth_fail_action,json=authFailAction,enum=google.appengine.v1.AuthFailAction" json:"auth_fail_action,omitempty"` + // `30x` code to use when performing redirects for the `secure` field. + // Defaults to `302`. + RedirectHttpResponseCode UrlMap_RedirectHttpResponseCode `protobuf:"varint,8,opt,name=redirect_http_response_code,json=redirectHttpResponseCode,enum=google.appengine.v1.UrlMap_RedirectHttpResponseCode" json:"redirect_http_response_code,omitempty"` +} + +func (m *UrlMap) Reset() { *m = UrlMap{} } +func (m *UrlMap) String() string { return proto.CompactTextString(m) } +func (*UrlMap) ProtoMessage() {} +func (*UrlMap) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +type isUrlMap_HandlerType interface { + isUrlMap_HandlerType() +} + +type UrlMap_StaticFiles struct { + StaticFiles *StaticFilesHandler `protobuf:"bytes,2,opt,name=static_files,json=staticFiles,oneof"` +} +type UrlMap_Script struct { + Script *ScriptHandler `protobuf:"bytes,3,opt,name=script,oneof"` +} +type UrlMap_ApiEndpoint struct { + ApiEndpoint *ApiEndpointHandler `protobuf:"bytes,4,opt,name=api_endpoint,json=apiEndpoint,oneof"` +} + +func (*UrlMap_StaticFiles) isUrlMap_HandlerType() {} +func (*UrlMap_Script) isUrlMap_HandlerType() {} +func (*UrlMap_ApiEndpoint) isUrlMap_HandlerType() {} + +func (m *UrlMap) GetHandlerType() isUrlMap_HandlerType { + if m != nil { + return m.HandlerType + } + return nil +} + +func (m *UrlMap) GetUrlRegex() string { + if m != nil { + return m.UrlRegex + } + return "" +} + +func (m *UrlMap) GetStaticFiles() *StaticFilesHandler { + if x, ok := m.GetHandlerType().(*UrlMap_StaticFiles); ok { + return x.StaticFiles + } + return nil +} + +func (m *UrlMap) GetScript() *ScriptHandler { + if x, ok := m.GetHandlerType().(*UrlMap_Script); ok { + return x.Script + } + return nil +} + +func (m *UrlMap) GetApiEndpoint() *ApiEndpointHandler { + if x, ok := m.GetHandlerType().(*UrlMap_ApiEndpoint); ok { + return x.ApiEndpoint + } + return nil +} + +func (m *UrlMap) GetSecurityLevel() SecurityLevel { + if m != nil { + return m.SecurityLevel + } + return SecurityLevel_SECURE_UNSPECIFIED +} + +func (m *UrlMap) GetLogin() LoginRequirement { + if m != nil { + return m.Login + } + return LoginRequirement_LOGIN_UNSPECIFIED +} + +func (m *UrlMap) GetAuthFailAction() AuthFailAction { + if m != nil { + return m.AuthFailAction + } + return AuthFailAction_AUTH_FAIL_ACTION_UNSPECIFIED +} + +func (m *UrlMap) GetRedirectHttpResponseCode() UrlMap_RedirectHttpResponseCode { + if m != nil { + return m.RedirectHttpResponseCode + } + return UrlMap_REDIRECT_HTTP_RESPONSE_CODE_UNSPECIFIED +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*UrlMap) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _UrlMap_OneofMarshaler, _UrlMap_OneofUnmarshaler, _UrlMap_OneofSizer, []interface{}{ + (*UrlMap_StaticFiles)(nil), + (*UrlMap_Script)(nil), + (*UrlMap_ApiEndpoint)(nil), + } +} + +func _UrlMap_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*UrlMap) + // handler_type + switch x := m.HandlerType.(type) { + case *UrlMap_StaticFiles: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.StaticFiles); err != nil { + return err + } + case *UrlMap_Script: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Script); err != nil { + return err + } + case *UrlMap_ApiEndpoint: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ApiEndpoint); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("UrlMap.HandlerType has unexpected type %T", x) + } + return nil +} + +func _UrlMap_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*UrlMap) + switch tag { + case 2: // handler_type.static_files + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(StaticFilesHandler) + err := b.DecodeMessage(msg) + m.HandlerType = &UrlMap_StaticFiles{msg} + return true, err + case 3: // handler_type.script + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ScriptHandler) + err := b.DecodeMessage(msg) + m.HandlerType = &UrlMap_Script{msg} + return true, err + case 4: // handler_type.api_endpoint + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ApiEndpointHandler) + err := b.DecodeMessage(msg) + m.HandlerType = &UrlMap_ApiEndpoint{msg} + return true, err + default: + return false, nil + } +} + +func _UrlMap_OneofSizer(msg proto.Message) (n int) { + m := msg.(*UrlMap) + // handler_type + switch x := m.HandlerType.(type) { + case *UrlMap_StaticFiles: + s := proto.Size(x.StaticFiles) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *UrlMap_Script: + s := proto.Size(x.Script) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *UrlMap_ApiEndpoint: + s := proto.Size(x.ApiEndpoint) + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Files served directly to the user for a given URL, such as images, CSS +// stylesheets, or JavaScript source files. Static file handlers describe which +// files in the application directory are static files, and which URLs serve +// them. +type StaticFilesHandler struct { + // Path to the static files matched by the URL pattern, from the + // application root directory. The path can refer to text matched in groupings + // in the URL pattern. + Path string `protobuf:"bytes,1,opt,name=path" json:"path,omitempty"` + // Regular expression that matches the file paths for all files that should be + // referenced by this handler. + UploadPathRegex string `protobuf:"bytes,2,opt,name=upload_path_regex,json=uploadPathRegex" json:"upload_path_regex,omitempty"` + // HTTP headers to use for all responses from these URLs. + HttpHeaders map[string]string `protobuf:"bytes,3,rep,name=http_headers,json=httpHeaders" json:"http_headers,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // MIME type used to serve all files served by this handler. + // + // Defaults to file-specific MIME types, which are derived from each file's + // filename extension. + MimeType string `protobuf:"bytes,4,opt,name=mime_type,json=mimeType" json:"mime_type,omitempty"` + // Time a static file served by this handler should be cached + // by web proxies and browsers. + Expiration *google_protobuf1.Duration `protobuf:"bytes,5,opt,name=expiration" json:"expiration,omitempty"` + // Whether this handler should match the request if the file + // referenced by the handler does not exist. + RequireMatchingFile bool `protobuf:"varint,6,opt,name=require_matching_file,json=requireMatchingFile" json:"require_matching_file,omitempty"` + // Whether files should also be uploaded as code data. By default, files + // declared in static file handlers are uploaded as static + // data and are only served to end users; they cannot be read by the + // application. If enabled, uploads are charged against both your code and + // static data storage resource quotas. + ApplicationReadable bool `protobuf:"varint,7,opt,name=application_readable,json=applicationReadable" json:"application_readable,omitempty"` +} + +func (m *StaticFilesHandler) Reset() { *m = StaticFilesHandler{} } +func (m *StaticFilesHandler) String() string { return proto.CompactTextString(m) } +func (*StaticFilesHandler) ProtoMessage() {} +func (*StaticFilesHandler) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *StaticFilesHandler) GetPath() string { + if m != nil { + return m.Path + } + return "" +} + +func (m *StaticFilesHandler) GetUploadPathRegex() string { + if m != nil { + return m.UploadPathRegex + } + return "" +} + +func (m *StaticFilesHandler) GetHttpHeaders() map[string]string { + if m != nil { + return m.HttpHeaders + } + return nil +} + +func (m *StaticFilesHandler) GetMimeType() string { + if m != nil { + return m.MimeType + } + return "" +} + +func (m *StaticFilesHandler) GetExpiration() *google_protobuf1.Duration { + if m != nil { + return m.Expiration + } + return nil +} + +func (m *StaticFilesHandler) GetRequireMatchingFile() bool { + if m != nil { + return m.RequireMatchingFile + } + return false +} + +func (m *StaticFilesHandler) GetApplicationReadable() bool { + if m != nil { + return m.ApplicationReadable + } + return false +} + +// Executes a script to handle the request that matches the URL pattern. +type ScriptHandler struct { + // Path to the script from the application root directory. + ScriptPath string `protobuf:"bytes,1,opt,name=script_path,json=scriptPath" json:"script_path,omitempty"` +} + +func (m *ScriptHandler) Reset() { *m = ScriptHandler{} } +func (m *ScriptHandler) String() string { return proto.CompactTextString(m) } +func (*ScriptHandler) ProtoMessage() {} +func (*ScriptHandler) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *ScriptHandler) GetScriptPath() string { + if m != nil { + return m.ScriptPath + } + return "" +} + +// Uses Google Cloud Endpoints to handle requests. +type ApiEndpointHandler struct { + // Path to the script from the application root directory. + ScriptPath string `protobuf:"bytes,1,opt,name=script_path,json=scriptPath" json:"script_path,omitempty"` +} + +func (m *ApiEndpointHandler) Reset() { *m = ApiEndpointHandler{} } +func (m *ApiEndpointHandler) String() string { return proto.CompactTextString(m) } +func (*ApiEndpointHandler) ProtoMessage() {} +func (*ApiEndpointHandler) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *ApiEndpointHandler) GetScriptPath() string { + if m != nil { + return m.ScriptPath + } + return "" +} + +// Health checking configuration for VM instances. Unhealthy instances +// are killed and replaced with new instances. Only applicable for +// instances in App Engine flexible environment. +type HealthCheck struct { + // Whether to explicitly disable health checks for this instance. + DisableHealthCheck bool `protobuf:"varint,1,opt,name=disable_health_check,json=disableHealthCheck" json:"disable_health_check,omitempty"` + // Host header to send when performing an HTTP health check. + // Example: "myapp.appspot.com" + Host string `protobuf:"bytes,2,opt,name=host" json:"host,omitempty"` + // Number of consecutive successful health checks required before receiving + // traffic. + HealthyThreshold uint32 `protobuf:"varint,3,opt,name=healthy_threshold,json=healthyThreshold" json:"healthy_threshold,omitempty"` + // Number of consecutive failed health checks required before removing + // traffic. + UnhealthyThreshold uint32 `protobuf:"varint,4,opt,name=unhealthy_threshold,json=unhealthyThreshold" json:"unhealthy_threshold,omitempty"` + // Number of consecutive failed health checks required before an instance is + // restarted. + RestartThreshold uint32 `protobuf:"varint,5,opt,name=restart_threshold,json=restartThreshold" json:"restart_threshold,omitempty"` + // Interval between health checks. + CheckInterval *google_protobuf1.Duration `protobuf:"bytes,6,opt,name=check_interval,json=checkInterval" json:"check_interval,omitempty"` + // Time before the health check is considered failed. + Timeout *google_protobuf1.Duration `protobuf:"bytes,7,opt,name=timeout" json:"timeout,omitempty"` +} + +func (m *HealthCheck) Reset() { *m = HealthCheck{} } +func (m *HealthCheck) String() string { return proto.CompactTextString(m) } +func (*HealthCheck) ProtoMessage() {} +func (*HealthCheck) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *HealthCheck) GetDisableHealthCheck() bool { + if m != nil { + return m.DisableHealthCheck + } + return false +} + +func (m *HealthCheck) GetHost() string { + if m != nil { + return m.Host + } + return "" +} + +func (m *HealthCheck) GetHealthyThreshold() uint32 { + if m != nil { + return m.HealthyThreshold + } + return 0 +} + +func (m *HealthCheck) GetUnhealthyThreshold() uint32 { + if m != nil { + return m.UnhealthyThreshold + } + return 0 +} + +func (m *HealthCheck) GetRestartThreshold() uint32 { + if m != nil { + return m.RestartThreshold + } + return 0 +} + +func (m *HealthCheck) GetCheckInterval() *google_protobuf1.Duration { + if m != nil { + return m.CheckInterval + } + return nil +} + +func (m *HealthCheck) GetTimeout() *google_protobuf1.Duration { + if m != nil { + return m.Timeout + } + return nil +} + +// Third-party Python runtime library that is required by the application. +type Library struct { + // Name of the library. Example: "django". + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Version of the library to select, or "latest". + Version string `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"` +} + +func (m *Library) Reset() { *m = Library{} } +func (m *Library) String() string { return proto.CompactTextString(m) } +func (*Library) ProtoMessage() {} +func (*Library) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *Library) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Library) GetVersion() string { + if m != nil { + return m.Version + } + return "" +} + +func init() { + proto.RegisterType((*ApiConfigHandler)(nil), "google.appengine.v1.ApiConfigHandler") + proto.RegisterType((*ErrorHandler)(nil), "google.appengine.v1.ErrorHandler") + proto.RegisterType((*UrlMap)(nil), "google.appengine.v1.UrlMap") + proto.RegisterType((*StaticFilesHandler)(nil), "google.appengine.v1.StaticFilesHandler") + proto.RegisterType((*ScriptHandler)(nil), "google.appengine.v1.ScriptHandler") + proto.RegisterType((*ApiEndpointHandler)(nil), "google.appengine.v1.ApiEndpointHandler") + proto.RegisterType((*HealthCheck)(nil), "google.appengine.v1.HealthCheck") + proto.RegisterType((*Library)(nil), "google.appengine.v1.Library") + proto.RegisterEnum("google.appengine.v1.AuthFailAction", AuthFailAction_name, AuthFailAction_value) + proto.RegisterEnum("google.appengine.v1.LoginRequirement", LoginRequirement_name, LoginRequirement_value) + proto.RegisterEnum("google.appengine.v1.SecurityLevel", SecurityLevel_name, SecurityLevel_value) + proto.RegisterEnum("google.appengine.v1.ErrorHandler_ErrorCode", ErrorHandler_ErrorCode_name, ErrorHandler_ErrorCode_value) + proto.RegisterEnum("google.appengine.v1.UrlMap_RedirectHttpResponseCode", UrlMap_RedirectHttpResponseCode_name, UrlMap_RedirectHttpResponseCode_value) +} + +func init() { proto.RegisterFile("google/appengine/v1/app_yaml.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 1232 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xdd, 0x6e, 0x13, 0x47, + 0x14, 0xc6, 0x76, 0x7e, 0x8f, 0x1d, 0xb3, 0x99, 0x00, 0x75, 0x02, 0x94, 0xd4, 0xa8, 0x02, 0x25, + 0x92, 0x4d, 0x92, 0x56, 0xd0, 0x82, 0xaa, 0x2e, 0xf6, 0xa6, 0xde, 0xca, 0x89, 0xcd, 0xd8, 0xa6, + 0x82, 0x5e, 0x8c, 0x26, 0xf6, 0xc4, 0x3b, 0x62, 0xbd, 0xbb, 0x9d, 0x1d, 0x47, 0xf8, 0x39, 0xaa, + 0xbe, 0x07, 0xb7, 0x7d, 0x90, 0x5e, 0xf5, 0x65, 0xaa, 0x99, 0x1d, 0xff, 0x25, 0x0e, 0xa9, 0xb8, + 0x9b, 0x73, 0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 0x67, 0x47, 0xd1, 0x3b, 0x3a, 0xf0, 0x9b, 0xaa, 0x96, + 0xcd, 0xd4, 0xfb, 0x57, 0x06, 0xd4, 0x0f, 0x7d, 0x1a, 0xf4, 0x4b, 0xa1, 0xe8, 0x97, 0xfb, 0x2c, + 0xd0, 0x95, 0x2e, 0x27, 0x26, 0x1a, 0xf1, 0x78, 0xee, 0x3f, 0xfa, 0xe5, 0x44, 0x38, 0x5b, 0xd1, + 0xc0, 0xa3, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x96, 0x5d, 0x26, 0x6c, 0x6f, 0x0b, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/appengine/v1/appengine.pb.go b/vendor/google.golang.org/genproto/googleapis/appengine/v1/appengine.pb.go new file mode 100644 index 0000000000..d4ce9eedf0 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/appengine/v1/appengine.pb.go @@ -0,0 +1,1359 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/appengine/v1/appengine.proto + +package appengine + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import _ "google.golang.org/genproto/googleapis/iam/v1" +import _ "google.golang.org/genproto/googleapis/iam/v1" +import google_longrunning "google.golang.org/genproto/googleapis/longrunning" +import _ "github.com/golang/protobuf/ptypes/empty" +import google_protobuf5 "google.golang.org/genproto/protobuf/field_mask" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Fields that should be returned when [Version][google.appengine.v1.Version] resources +// are retreived. +type VersionView int32 + +const ( + // Basic version information including scaling and inbound services, + // but not detailed deployment information. + VersionView_BASIC VersionView = 0 + // The information from `BASIC`, plus detailed information about the + // deployment. This format is required when creating resources, but + // is not returned in `Get` or `List` by default. + VersionView_FULL VersionView = 1 +) + +var VersionView_name = map[int32]string{ + 0: "BASIC", + 1: "FULL", +} +var VersionView_value = map[string]int32{ + "BASIC": 0, + "FULL": 1, +} + +func (x VersionView) String() string { + return proto.EnumName(VersionView_name, int32(x)) +} +func (VersionView) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +// Request message for `Applications.GetApplication`. +type GetApplicationRequest struct { + // Name of the Application resource to get. Example: `apps/myapp`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetApplicationRequest) Reset() { *m = GetApplicationRequest{} } +func (m *GetApplicationRequest) String() string { return proto.CompactTextString(m) } +func (*GetApplicationRequest) ProtoMessage() {} +func (*GetApplicationRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +func (m *GetApplicationRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Request message for 'Applications.RepairApplication'. +type RepairApplicationRequest struct { + // Name of the application to repair. Example: `apps/myapp` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *RepairApplicationRequest) Reset() { *m = RepairApplicationRequest{} } +func (m *RepairApplicationRequest) String() string { return proto.CompactTextString(m) } +func (*RepairApplicationRequest) ProtoMessage() {} +func (*RepairApplicationRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} } + +func (m *RepairApplicationRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Request message for `Services.ListServices`. +type ListServicesRequest struct { + // Name of the parent Application resource. Example: `apps/myapp`. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // Maximum results to return per page. + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // Continuation token for fetching the next page of results. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListServicesRequest) Reset() { *m = ListServicesRequest{} } +func (m *ListServicesRequest) String() string { return proto.CompactTextString(m) } +func (*ListServicesRequest) ProtoMessage() {} +func (*ListServicesRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} } + +func (m *ListServicesRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *ListServicesRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListServicesRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// Response message for `Services.ListServices`. +type ListServicesResponse struct { + // The services belonging to the requested application. + Services []*Service `protobuf:"bytes,1,rep,name=services" json:"services,omitempty"` + // Continuation token for fetching the next page of results. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListServicesResponse) Reset() { *m = ListServicesResponse{} } +func (m *ListServicesResponse) String() string { return proto.CompactTextString(m) } +func (*ListServicesResponse) ProtoMessage() {} +func (*ListServicesResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{3} } + +func (m *ListServicesResponse) GetServices() []*Service { + if m != nil { + return m.Services + } + return nil +} + +func (m *ListServicesResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// Request message for `Services.GetService`. +type GetServiceRequest struct { + // Name of the resource requested. Example: `apps/myapp/services/default`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetServiceRequest) Reset() { *m = GetServiceRequest{} } +func (m *GetServiceRequest) String() string { return proto.CompactTextString(m) } +func (*GetServiceRequest) ProtoMessage() {} +func (*GetServiceRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{4} } + +func (m *GetServiceRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Request message for `Services.UpdateService`. +type UpdateServiceRequest struct { + // Name of the resource to update. Example: `apps/myapp/services/default`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // A Service resource containing the updated service. Only fields set in the + // field mask will be updated. + Service *Service `protobuf:"bytes,2,opt,name=service" json:"service,omitempty"` + // Standard field mask for the set of fields to be updated. + UpdateMask *google_protobuf5.FieldMask `protobuf:"bytes,3,opt,name=update_mask,json=updateMask" json:"update_mask,omitempty"` + // Set to `true` to gradually shift traffic from one version to another + // single version. By default, traffic is shifted immediately. + // For gradual traffic migration, the target version + // must be located within instances that are configured for both + // [warmup requests](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#inboundservicetype) + // and + // [automatic scaling](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#automaticscaling). + // You must specify the + // [`shardBy`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services#shardby) + // field in the Service resource. Gradual traffic migration is not + // supported in the App Engine flexible environment. For examples, see + // [Migrating and Splitting Traffic](https://cloud.google.com/appengine/docs/admin-api/migrating-splitting-traffic). + MigrateTraffic bool `protobuf:"varint,4,opt,name=migrate_traffic,json=migrateTraffic" json:"migrate_traffic,omitempty"` +} + +func (m *UpdateServiceRequest) Reset() { *m = UpdateServiceRequest{} } +func (m *UpdateServiceRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateServiceRequest) ProtoMessage() {} +func (*UpdateServiceRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{5} } + +func (m *UpdateServiceRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *UpdateServiceRequest) GetService() *Service { + if m != nil { + return m.Service + } + return nil +} + +func (m *UpdateServiceRequest) GetUpdateMask() *google_protobuf5.FieldMask { + if m != nil { + return m.UpdateMask + } + return nil +} + +func (m *UpdateServiceRequest) GetMigrateTraffic() bool { + if m != nil { + return m.MigrateTraffic + } + return false +} + +// Request message for `Services.DeleteService`. +type DeleteServiceRequest struct { + // Name of the resource requested. Example: `apps/myapp/services/default`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *DeleteServiceRequest) Reset() { *m = DeleteServiceRequest{} } +func (m *DeleteServiceRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteServiceRequest) ProtoMessage() {} +func (*DeleteServiceRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{6} } + +func (m *DeleteServiceRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Request message for `Versions.ListVersions`. +type ListVersionsRequest struct { + // Name of the parent Service resource. Example: + // `apps/myapp/services/default`. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // Controls the set of fields returned in the `List` response. + View VersionView `protobuf:"varint,2,opt,name=view,enum=google.appengine.v1.VersionView" json:"view,omitempty"` + // Maximum results to return per page. + PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // Continuation token for fetching the next page of results. + PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListVersionsRequest) Reset() { *m = ListVersionsRequest{} } +func (m *ListVersionsRequest) String() string { return proto.CompactTextString(m) } +func (*ListVersionsRequest) ProtoMessage() {} +func (*ListVersionsRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{7} } + +func (m *ListVersionsRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *ListVersionsRequest) GetView() VersionView { + if m != nil { + return m.View + } + return VersionView_BASIC +} + +func (m *ListVersionsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListVersionsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// Response message for `Versions.ListVersions`. +type ListVersionsResponse struct { + // The versions belonging to the requested service. + Versions []*Version `protobuf:"bytes,1,rep,name=versions" json:"versions,omitempty"` + // Continuation token for fetching the next page of results. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListVersionsResponse) Reset() { *m = ListVersionsResponse{} } +func (m *ListVersionsResponse) String() string { return proto.CompactTextString(m) } +func (*ListVersionsResponse) ProtoMessage() {} +func (*ListVersionsResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{8} } + +func (m *ListVersionsResponse) GetVersions() []*Version { + if m != nil { + return m.Versions + } + return nil +} + +func (m *ListVersionsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// Request message for `Versions.GetVersion`. +type GetVersionRequest struct { + // Name of the resource requested. Example: + // `apps/myapp/services/default/versions/v1`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Controls the set of fields returned in the `Get` response. + View VersionView `protobuf:"varint,2,opt,name=view,enum=google.appengine.v1.VersionView" json:"view,omitempty"` +} + +func (m *GetVersionRequest) Reset() { *m = GetVersionRequest{} } +func (m *GetVersionRequest) String() string { return proto.CompactTextString(m) } +func (*GetVersionRequest) ProtoMessage() {} +func (*GetVersionRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{9} } + +func (m *GetVersionRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *GetVersionRequest) GetView() VersionView { + if m != nil { + return m.View + } + return VersionView_BASIC +} + +// Request message for `Versions.CreateVersion`. +type CreateVersionRequest struct { + // Name of the parent resource to create this version under. Example: + // `apps/myapp/services/default`. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // Application deployment configuration. + Version *Version `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"` +} + +func (m *CreateVersionRequest) Reset() { *m = CreateVersionRequest{} } +func (m *CreateVersionRequest) String() string { return proto.CompactTextString(m) } +func (*CreateVersionRequest) ProtoMessage() {} +func (*CreateVersionRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{10} } + +func (m *CreateVersionRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *CreateVersionRequest) GetVersion() *Version { + if m != nil { + return m.Version + } + return nil +} + +// Request message for `Versions.UpdateVersion`. +type UpdateVersionRequest struct { + // Name of the resource to update. Example: + // `apps/myapp/services/default/versions/1`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // A Version containing the updated resource. Only fields set in the field + // mask will be updated. + Version *Version `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"` + // Standard field mask for the set of fields to be updated. + UpdateMask *google_protobuf5.FieldMask `protobuf:"bytes,3,opt,name=update_mask,json=updateMask" json:"update_mask,omitempty"` +} + +func (m *UpdateVersionRequest) Reset() { *m = UpdateVersionRequest{} } +func (m *UpdateVersionRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateVersionRequest) ProtoMessage() {} +func (*UpdateVersionRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{11} } + +func (m *UpdateVersionRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *UpdateVersionRequest) GetVersion() *Version { + if m != nil { + return m.Version + } + return nil +} + +func (m *UpdateVersionRequest) GetUpdateMask() *google_protobuf5.FieldMask { + if m != nil { + return m.UpdateMask + } + return nil +} + +// Request message for `Versions.DeleteVersion`. +type DeleteVersionRequest struct { + // Name of the resource requested. Example: + // `apps/myapp/services/default/versions/v1`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *DeleteVersionRequest) Reset() { *m = DeleteVersionRequest{} } +func (m *DeleteVersionRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteVersionRequest) ProtoMessage() {} +func (*DeleteVersionRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{12} } + +func (m *DeleteVersionRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Request message for `Instances.ListInstances`. +type ListInstancesRequest struct { + // Name of the parent Version resource. Example: + // `apps/myapp/services/default/versions/v1`. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // Maximum results to return per page. + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // Continuation token for fetching the next page of results. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListInstancesRequest) Reset() { *m = ListInstancesRequest{} } +func (m *ListInstancesRequest) String() string { return proto.CompactTextString(m) } +func (*ListInstancesRequest) ProtoMessage() {} +func (*ListInstancesRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{13} } + +func (m *ListInstancesRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *ListInstancesRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListInstancesRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// Response message for `Instances.ListInstances`. +type ListInstancesResponse struct { + // The instances belonging to the requested version. + Instances []*Instance `protobuf:"bytes,1,rep,name=instances" json:"instances,omitempty"` + // Continuation token for fetching the next page of results. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListInstancesResponse) Reset() { *m = ListInstancesResponse{} } +func (m *ListInstancesResponse) String() string { return proto.CompactTextString(m) } +func (*ListInstancesResponse) ProtoMessage() {} +func (*ListInstancesResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{14} } + +func (m *ListInstancesResponse) GetInstances() []*Instance { + if m != nil { + return m.Instances + } + return nil +} + +func (m *ListInstancesResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// Request message for `Instances.GetInstance`. +type GetInstanceRequest struct { + // Name of the resource requested. Example: + // `apps/myapp/services/default/versions/v1/instances/instance-1`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetInstanceRequest) Reset() { *m = GetInstanceRequest{} } +func (m *GetInstanceRequest) String() string { return proto.CompactTextString(m) } +func (*GetInstanceRequest) ProtoMessage() {} +func (*GetInstanceRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{15} } + +func (m *GetInstanceRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Request message for `Instances.DeleteInstance`. +type DeleteInstanceRequest struct { + // Name of the resource requested. Example: + // `apps/myapp/services/default/versions/v1/instances/instance-1`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *DeleteInstanceRequest) Reset() { *m = DeleteInstanceRequest{} } +func (m *DeleteInstanceRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteInstanceRequest) ProtoMessage() {} +func (*DeleteInstanceRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{16} } + +func (m *DeleteInstanceRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Request message for `Instances.DebugInstance`. +type DebugInstanceRequest struct { + // Name of the resource requested. Example: + // `apps/myapp/services/default/versions/v1/instances/instance-1`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *DebugInstanceRequest) Reset() { *m = DebugInstanceRequest{} } +func (m *DebugInstanceRequest) String() string { return proto.CompactTextString(m) } +func (*DebugInstanceRequest) ProtoMessage() {} +func (*DebugInstanceRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{17} } + +func (m *DebugInstanceRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func init() { + proto.RegisterType((*GetApplicationRequest)(nil), "google.appengine.v1.GetApplicationRequest") + proto.RegisterType((*RepairApplicationRequest)(nil), "google.appengine.v1.RepairApplicationRequest") + proto.RegisterType((*ListServicesRequest)(nil), "google.appengine.v1.ListServicesRequest") + proto.RegisterType((*ListServicesResponse)(nil), "google.appengine.v1.ListServicesResponse") + proto.RegisterType((*GetServiceRequest)(nil), "google.appengine.v1.GetServiceRequest") + proto.RegisterType((*UpdateServiceRequest)(nil), "google.appengine.v1.UpdateServiceRequest") + proto.RegisterType((*DeleteServiceRequest)(nil), "google.appengine.v1.DeleteServiceRequest") + proto.RegisterType((*ListVersionsRequest)(nil), "google.appengine.v1.ListVersionsRequest") + proto.RegisterType((*ListVersionsResponse)(nil), "google.appengine.v1.ListVersionsResponse") + proto.RegisterType((*GetVersionRequest)(nil), "google.appengine.v1.GetVersionRequest") + proto.RegisterType((*CreateVersionRequest)(nil), "google.appengine.v1.CreateVersionRequest") + proto.RegisterType((*UpdateVersionRequest)(nil), "google.appengine.v1.UpdateVersionRequest") + proto.RegisterType((*DeleteVersionRequest)(nil), "google.appengine.v1.DeleteVersionRequest") + proto.RegisterType((*ListInstancesRequest)(nil), "google.appengine.v1.ListInstancesRequest") + proto.RegisterType((*ListInstancesResponse)(nil), "google.appengine.v1.ListInstancesResponse") + proto.RegisterType((*GetInstanceRequest)(nil), "google.appengine.v1.GetInstanceRequest") + proto.RegisterType((*DeleteInstanceRequest)(nil), "google.appengine.v1.DeleteInstanceRequest") + proto.RegisterType((*DebugInstanceRequest)(nil), "google.appengine.v1.DebugInstanceRequest") + proto.RegisterEnum("google.appengine.v1.VersionView", VersionView_name, VersionView_value) +} + +// 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 + +// Client API for Instances service + +type InstancesClient interface { + // Lists the instances of a version. + ListInstances(ctx context.Context, in *ListInstancesRequest, opts ...grpc.CallOption) (*ListInstancesResponse, error) + // Gets instance information. + GetInstance(ctx context.Context, in *GetInstanceRequest, opts ...grpc.CallOption) (*Instance, error) + // Stops a running instance. + DeleteInstance(ctx context.Context, in *DeleteInstanceRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Enables debugging on a VM instance. This allows you to use the SSH + // command to connect to the virtual machine where the instance lives. + // While in "debug mode", the instance continues to serve live traffic. + // You should delete the instance when you are done debugging and then + // allow the system to take over and determine if another instance + // should be started. + // + // Only applicable for instances in App Engine flexible environment. + DebugInstance(ctx context.Context, in *DebugInstanceRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) +} + +type instancesClient struct { + cc *grpc.ClientConn +} + +func NewInstancesClient(cc *grpc.ClientConn) InstancesClient { + return &instancesClient{cc} +} + +func (c *instancesClient) ListInstances(ctx context.Context, in *ListInstancesRequest, opts ...grpc.CallOption) (*ListInstancesResponse, error) { + out := new(ListInstancesResponse) + err := grpc.Invoke(ctx, "/google.appengine.v1.Instances/ListInstances", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *instancesClient) GetInstance(ctx context.Context, in *GetInstanceRequest, opts ...grpc.CallOption) (*Instance, error) { + out := new(Instance) + err := grpc.Invoke(ctx, "/google.appengine.v1.Instances/GetInstance", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *instancesClient) DeleteInstance(ctx context.Context, in *DeleteInstanceRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.appengine.v1.Instances/DeleteInstance", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *instancesClient) DebugInstance(ctx context.Context, in *DebugInstanceRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.appengine.v1.Instances/DebugInstance", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for Instances service + +type InstancesServer interface { + // Lists the instances of a version. + ListInstances(context.Context, *ListInstancesRequest) (*ListInstancesResponse, error) + // Gets instance information. + GetInstance(context.Context, *GetInstanceRequest) (*Instance, error) + // Stops a running instance. + DeleteInstance(context.Context, *DeleteInstanceRequest) (*google_longrunning.Operation, error) + // Enables debugging on a VM instance. This allows you to use the SSH + // command to connect to the virtual machine where the instance lives. + // While in "debug mode", the instance continues to serve live traffic. + // You should delete the instance when you are done debugging and then + // allow the system to take over and determine if another instance + // should be started. + // + // Only applicable for instances in App Engine flexible environment. + DebugInstance(context.Context, *DebugInstanceRequest) (*google_longrunning.Operation, error) +} + +func RegisterInstancesServer(s *grpc.Server, srv InstancesServer) { + s.RegisterService(&_Instances_serviceDesc, srv) +} + +func _Instances_ListInstances_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListInstancesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InstancesServer).ListInstances(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.appengine.v1.Instances/ListInstances", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InstancesServer).ListInstances(ctx, req.(*ListInstancesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Instances_GetInstance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetInstanceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InstancesServer).GetInstance(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.appengine.v1.Instances/GetInstance", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InstancesServer).GetInstance(ctx, req.(*GetInstanceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Instances_DeleteInstance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteInstanceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InstancesServer).DeleteInstance(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.appengine.v1.Instances/DeleteInstance", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InstancesServer).DeleteInstance(ctx, req.(*DeleteInstanceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Instances_DebugInstance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DebugInstanceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InstancesServer).DebugInstance(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.appengine.v1.Instances/DebugInstance", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InstancesServer).DebugInstance(ctx, req.(*DebugInstanceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Instances_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.appengine.v1.Instances", + HandlerType: (*InstancesServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListInstances", + Handler: _Instances_ListInstances_Handler, + }, + { + MethodName: "GetInstance", + Handler: _Instances_GetInstance_Handler, + }, + { + MethodName: "DeleteInstance", + Handler: _Instances_DeleteInstance_Handler, + }, + { + MethodName: "DebugInstance", + Handler: _Instances_DebugInstance_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/appengine/v1/appengine.proto", +} + +// Client API for Versions service + +type VersionsClient interface { + // Lists the versions of a service. + ListVersions(ctx context.Context, in *ListVersionsRequest, opts ...grpc.CallOption) (*ListVersionsResponse, error) + // Gets the specified Version resource. + // By default, only a `BASIC_VIEW` will be returned. + // Specify the `FULL_VIEW` parameter to get the full resource. + GetVersion(ctx context.Context, in *GetVersionRequest, opts ...grpc.CallOption) (*Version, error) + // Deploys code and resource files to a new version. + CreateVersion(ctx context.Context, in *CreateVersionRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Updates the specified Version resource. + // You can specify the following fields depending on the App Engine + // environment and type of scaling that the version resource uses: + // + // * [`serving_status`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status): + // For Version resources that use basic scaling, manual scaling, or run in + // the App Engine flexible environment. + // * [`instance_class`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.instance_class): + // For Version resources that run in the App Engine standard environment. + // * [`automatic_scaling.min_idle_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): + // For Version resources that use automatic scaling and run in the App + // Engine standard environment. + // * [`automatic_scaling.max_idle_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): + // For Version resources that use automatic scaling and run in the App + // Engine standard environment. + UpdateVersion(ctx context.Context, in *UpdateVersionRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Deletes an existing Version resource. + DeleteVersion(ctx context.Context, in *DeleteVersionRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) +} + +type versionsClient struct { + cc *grpc.ClientConn +} + +func NewVersionsClient(cc *grpc.ClientConn) VersionsClient { + return &versionsClient{cc} +} + +func (c *versionsClient) ListVersions(ctx context.Context, in *ListVersionsRequest, opts ...grpc.CallOption) (*ListVersionsResponse, error) { + out := new(ListVersionsResponse) + err := grpc.Invoke(ctx, "/google.appengine.v1.Versions/ListVersions", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *versionsClient) GetVersion(ctx context.Context, in *GetVersionRequest, opts ...grpc.CallOption) (*Version, error) { + out := new(Version) + err := grpc.Invoke(ctx, "/google.appengine.v1.Versions/GetVersion", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *versionsClient) CreateVersion(ctx context.Context, in *CreateVersionRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.appengine.v1.Versions/CreateVersion", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *versionsClient) UpdateVersion(ctx context.Context, in *UpdateVersionRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.appengine.v1.Versions/UpdateVersion", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *versionsClient) DeleteVersion(ctx context.Context, in *DeleteVersionRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.appengine.v1.Versions/DeleteVersion", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for Versions service + +type VersionsServer interface { + // Lists the versions of a service. + ListVersions(context.Context, *ListVersionsRequest) (*ListVersionsResponse, error) + // Gets the specified Version resource. + // By default, only a `BASIC_VIEW` will be returned. + // Specify the `FULL_VIEW` parameter to get the full resource. + GetVersion(context.Context, *GetVersionRequest) (*Version, error) + // Deploys code and resource files to a new version. + CreateVersion(context.Context, *CreateVersionRequest) (*google_longrunning.Operation, error) + // Updates the specified Version resource. + // You can specify the following fields depending on the App Engine + // environment and type of scaling that the version resource uses: + // + // * [`serving_status`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status): + // For Version resources that use basic scaling, manual scaling, or run in + // the App Engine flexible environment. + // * [`instance_class`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.instance_class): + // For Version resources that run in the App Engine standard environment. + // * [`automatic_scaling.min_idle_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): + // For Version resources that use automatic scaling and run in the App + // Engine standard environment. + // * [`automatic_scaling.max_idle_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): + // For Version resources that use automatic scaling and run in the App + // Engine standard environment. + UpdateVersion(context.Context, *UpdateVersionRequest) (*google_longrunning.Operation, error) + // Deletes an existing Version resource. + DeleteVersion(context.Context, *DeleteVersionRequest) (*google_longrunning.Operation, error) +} + +func RegisterVersionsServer(s *grpc.Server, srv VersionsServer) { + s.RegisterService(&_Versions_serviceDesc, srv) +} + +func _Versions_ListVersions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListVersionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VersionsServer).ListVersions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.appengine.v1.Versions/ListVersions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VersionsServer).ListVersions(ctx, req.(*ListVersionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Versions_GetVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetVersionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VersionsServer).GetVersion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.appengine.v1.Versions/GetVersion", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VersionsServer).GetVersion(ctx, req.(*GetVersionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Versions_CreateVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateVersionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VersionsServer).CreateVersion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.appengine.v1.Versions/CreateVersion", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VersionsServer).CreateVersion(ctx, req.(*CreateVersionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Versions_UpdateVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateVersionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VersionsServer).UpdateVersion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.appengine.v1.Versions/UpdateVersion", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VersionsServer).UpdateVersion(ctx, req.(*UpdateVersionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Versions_DeleteVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteVersionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VersionsServer).DeleteVersion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.appengine.v1.Versions/DeleteVersion", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VersionsServer).DeleteVersion(ctx, req.(*DeleteVersionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Versions_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.appengine.v1.Versions", + HandlerType: (*VersionsServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListVersions", + Handler: _Versions_ListVersions_Handler, + }, + { + MethodName: "GetVersion", + Handler: _Versions_GetVersion_Handler, + }, + { + MethodName: "CreateVersion", + Handler: _Versions_CreateVersion_Handler, + }, + { + MethodName: "UpdateVersion", + Handler: _Versions_UpdateVersion_Handler, + }, + { + MethodName: "DeleteVersion", + Handler: _Versions_DeleteVersion_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/appengine/v1/appengine.proto", +} + +// Client API for Services service + +type ServicesClient interface { + // Lists all the services in the application. + ListServices(ctx context.Context, in *ListServicesRequest, opts ...grpc.CallOption) (*ListServicesResponse, error) + // Gets the current configuration of the specified service. + GetService(ctx context.Context, in *GetServiceRequest, opts ...grpc.CallOption) (*Service, error) + // Updates the configuration of the specified service. + UpdateService(ctx context.Context, in *UpdateServiceRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Deletes the specified service and all enclosed versions. + DeleteService(ctx context.Context, in *DeleteServiceRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) +} + +type servicesClient struct { + cc *grpc.ClientConn +} + +func NewServicesClient(cc *grpc.ClientConn) ServicesClient { + return &servicesClient{cc} +} + +func (c *servicesClient) ListServices(ctx context.Context, in *ListServicesRequest, opts ...grpc.CallOption) (*ListServicesResponse, error) { + out := new(ListServicesResponse) + err := grpc.Invoke(ctx, "/google.appengine.v1.Services/ListServices", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *servicesClient) GetService(ctx context.Context, in *GetServiceRequest, opts ...grpc.CallOption) (*Service, error) { + out := new(Service) + err := grpc.Invoke(ctx, "/google.appengine.v1.Services/GetService", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *servicesClient) UpdateService(ctx context.Context, in *UpdateServiceRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.appengine.v1.Services/UpdateService", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *servicesClient) DeleteService(ctx context.Context, in *DeleteServiceRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.appengine.v1.Services/DeleteService", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for Services service + +type ServicesServer interface { + // Lists all the services in the application. + ListServices(context.Context, *ListServicesRequest) (*ListServicesResponse, error) + // Gets the current configuration of the specified service. + GetService(context.Context, *GetServiceRequest) (*Service, error) + // Updates the configuration of the specified service. + UpdateService(context.Context, *UpdateServiceRequest) (*google_longrunning.Operation, error) + // Deletes the specified service and all enclosed versions. + DeleteService(context.Context, *DeleteServiceRequest) (*google_longrunning.Operation, error) +} + +func RegisterServicesServer(s *grpc.Server, srv ServicesServer) { + s.RegisterService(&_Services_serviceDesc, srv) +} + +func _Services_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.(ServicesServer).ListServices(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.appengine.v1.Services/ListServices", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServicesServer).ListServices(ctx, req.(*ListServicesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Services_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.(ServicesServer).GetService(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.appengine.v1.Services/GetService", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServicesServer).GetService(ctx, req.(*GetServiceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Services_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.(ServicesServer).UpdateService(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.appengine.v1.Services/UpdateService", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServicesServer).UpdateService(ctx, req.(*UpdateServiceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Services_DeleteService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteServiceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServicesServer).DeleteService(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.appengine.v1.Services/DeleteService", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServicesServer).DeleteService(ctx, req.(*DeleteServiceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Services_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.appengine.v1.Services", + HandlerType: (*ServicesServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListServices", + Handler: _Services_ListServices_Handler, + }, + { + MethodName: "GetService", + Handler: _Services_GetService_Handler, + }, + { + MethodName: "UpdateService", + Handler: _Services_UpdateService_Handler, + }, + { + MethodName: "DeleteService", + Handler: _Services_DeleteService_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/appengine/v1/appengine.proto", +} + +// Client API for Applications service + +type ApplicationsClient interface { + // Gets information about an application. + GetApplication(ctx context.Context, in *GetApplicationRequest, opts ...grpc.CallOption) (*Application, error) + // Recreates the required App Engine features for the application in your + // project, for example a Cloud Storage bucket or App Engine service account. + // Use this method if you receive an error message about a missing feature, + // for example "*Error retrieving the App Engine service account*". + RepairApplication(ctx context.Context, in *RepairApplicationRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) +} + +type applicationsClient struct { + cc *grpc.ClientConn +} + +func NewApplicationsClient(cc *grpc.ClientConn) ApplicationsClient { + return &applicationsClient{cc} +} + +func (c *applicationsClient) GetApplication(ctx context.Context, in *GetApplicationRequest, opts ...grpc.CallOption) (*Application, error) { + out := new(Application) + err := grpc.Invoke(ctx, "/google.appengine.v1.Applications/GetApplication", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *applicationsClient) RepairApplication(ctx context.Context, in *RepairApplicationRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.appengine.v1.Applications/RepairApplication", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for Applications service + +type ApplicationsServer interface { + // Gets information about an application. + GetApplication(context.Context, *GetApplicationRequest) (*Application, error) + // Recreates the required App Engine features for the application in your + // project, for example a Cloud Storage bucket or App Engine service account. + // Use this method if you receive an error message about a missing feature, + // for example "*Error retrieving the App Engine service account*". + RepairApplication(context.Context, *RepairApplicationRequest) (*google_longrunning.Operation, error) +} + +func RegisterApplicationsServer(s *grpc.Server, srv ApplicationsServer) { + s.RegisterService(&_Applications_serviceDesc, srv) +} + +func _Applications_GetApplication_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetApplicationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ApplicationsServer).GetApplication(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.appengine.v1.Applications/GetApplication", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ApplicationsServer).GetApplication(ctx, req.(*GetApplicationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Applications_RepairApplication_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RepairApplicationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ApplicationsServer).RepairApplication(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.appengine.v1.Applications/RepairApplication", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ApplicationsServer).RepairApplication(ctx, req.(*RepairApplicationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Applications_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.appengine.v1.Applications", + HandlerType: (*ApplicationsServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetApplication", + Handler: _Applications_GetApplication_Handler, + }, + { + MethodName: "RepairApplication", + Handler: _Applications_RepairApplication_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/appengine/v1/appengine.proto", +} + +func init() { proto.RegisterFile("google/appengine/v1/appengine.proto", fileDescriptor1) } + +var fileDescriptor1 = []byte{ + // 1134 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0xdf, 0x6f, 0xdb, 0x54, + 0x14, 0xc6, 0x6d, 0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x7e, 0x13, 0xa0, 0x11, 0x4f, + 0x23, 0x4a, 0x17, 0x24, 0x35, 0xd7, 0x11, 0xb5, 0x99, 0x86, 0xa4, 0xfb, 0x05, 0x6f, 0x48, 0x38, + 0x35, 0xf9, 0x5c, 0xd4, 0xde, 0x08, 0xb0, 0x1c, 0x33, 0x4d, 0x46, 0x56, 0xd3, 0x8c, 0x55, 0x44, + 0xec, 0x01, 0x25, 0xf6, 0x99, 0xf4, 0xf1, 0x39, 0x88, 0xf5, 0x4e, 0xfc, 0x80, 0x3d, 0x41, 0x56, + 0xff, 0x5e, 0x82, 0x2a, 0x2f, 0x11, 0xe8, 0x57, 0x01, 0x2e, 0xcd, 0xd6, 0x0c, 0xd4, 0xc9, 0x34, + 0x56, 0xa2, 0xee, 0x89, 0x5b, 0x25, 0x90, 0xcc, 0x81, 0x0a, 0x25, 0xbe, 0x85, 0xda, 0xb9, 0x0e, + 0x9c, 0x86, 0xdc, 0xd1, 0x4b, 0x01, 0x20, 0x2a, 0x28, 0xe8, 0x46, 0x96, 0xe9, 0xe2, 0x5f, 0x41, + 0x31, 0xf7, 0x0b, 0x9c, 0x60, 0x51, 0x28, 0xdf, 0x14, 0xbd, 0x16, 0x60, 0x39, 0x56, 0x77, 0x32, + 0x72, 0x99, 0x56, 0x9b, 0x8a, 0x72, 0x79, 0x8f, 0x92, 0x51, 0xa5, 0xb2, 0x92, 0xf4, 0xc2, 0xfa, + 0xe1, 0xb3, 0x8a, 0x15, 0xa9, 0x0c, 0x56, 0x69, 0x85, 0xac, 0x24, 0x2b, 0xb5, 0xac, 0x44, 0x11, + 0xab, 0x5f, 0xa8, 0xef, 0x67, 0x2a, 0x53, 0xa6, 0xef, 0xe7, 0xab, 0x57, 0x11, 0x2b, 0x96, 0x38, + 0xb9, 0x2c, 0x2b, 0xf5, 0xf7, 0x0a, 0x54, 0x79, 0x07, 0x8d, 0x7e, 0x66, 0x16, 0x0f, 0x07, 0xb2, + 0x2d, 0x9e, 0x68, 0xf0,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 0x0f, 0xc7, 0x17, 0x28, 0xf0, 0xce, + 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x89, 0x36, 0x22, 0x8f, 0x3d, 0x11, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/appengine/v1/application.pb.go b/vendor/google.golang.org/genproto/googleapis/appengine/v1/application.pb.go new file mode 100644 index 0000000000..e029d64d05 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/appengine/v1/application.pb.go @@ -0,0 +1,222 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/appengine/v1/application.proto + +package appengine + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf1 "github.com/golang/protobuf/ptypes/duration" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// An Application resource contains the top-level configuration of an App +// Engine application. +type Application struct { + // Full path to the Application resource in the API. + // Example: `apps/myapp`. + // + // @OutputOnly + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Identifier of the Application resource. This identifier is equivalent + // to the project ID of the Google Cloud Platform project where you want to + // deploy your application. + // Example: `myapp`. + Id string `protobuf:"bytes,2,opt,name=id" json:"id,omitempty"` + // HTTP path dispatch rules for requests to the application that do not + // explicitly target a service or version. Rules are order-dependent. + // + // @OutputOnly + DispatchRules []*UrlDispatchRule `protobuf:"bytes,3,rep,name=dispatch_rules,json=dispatchRules" json:"dispatch_rules,omitempty"` + // Google Apps authentication domain that controls which users can access + // this application. + // + // Defaults to open access for any Google Account. + AuthDomain string `protobuf:"bytes,6,opt,name=auth_domain,json=authDomain" json:"auth_domain,omitempty"` + // Location from which this application will be run. Application instances + // will run out of data centers in the chosen location, which is also where + // all of the application's end user content is stored. + // + // Defaults to `us-central`. + // + // Options are: + // + // `us-central` - Central US + // + // `europe-west` - Western Europe + // + // `us-east1` - Eastern US + LocationId string `protobuf:"bytes,7,opt,name=location_id,json=locationId" json:"location_id,omitempty"` + // Google Cloud Storage bucket that can be used for storing files + // associated with this application. This bucket is associated with the + // application and can be used by the gcloud deployment commands. + // + // @OutputOnly + CodeBucket string `protobuf:"bytes,8,opt,name=code_bucket,json=codeBucket" json:"code_bucket,omitempty"` + // Cookie expiration policy for this application. + // + // @OutputOnly + DefaultCookieExpiration *google_protobuf1.Duration `protobuf:"bytes,9,opt,name=default_cookie_expiration,json=defaultCookieExpiration" json:"default_cookie_expiration,omitempty"` + // Hostname used to reach this application, as resolved by App Engine. + // + // @OutputOnly + DefaultHostname string `protobuf:"bytes,11,opt,name=default_hostname,json=defaultHostname" json:"default_hostname,omitempty"` + // Google Cloud Storage bucket that can be used by this application to store + // content. + // + // @OutputOnly + DefaultBucket string `protobuf:"bytes,12,opt,name=default_bucket,json=defaultBucket" json:"default_bucket,omitempty"` +} + +func (m *Application) Reset() { *m = Application{} } +func (m *Application) String() string { return proto.CompactTextString(m) } +func (*Application) ProtoMessage() {} +func (*Application) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} } + +func (m *Application) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Application) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *Application) GetDispatchRules() []*UrlDispatchRule { + if m != nil { + return m.DispatchRules + } + return nil +} + +func (m *Application) GetAuthDomain() string { + if m != nil { + return m.AuthDomain + } + return "" +} + +func (m *Application) GetLocationId() string { + if m != nil { + return m.LocationId + } + return "" +} + +func (m *Application) GetCodeBucket() string { + if m != nil { + return m.CodeBucket + } + return "" +} + +func (m *Application) GetDefaultCookieExpiration() *google_protobuf1.Duration { + if m != nil { + return m.DefaultCookieExpiration + } + return nil +} + +func (m *Application) GetDefaultHostname() string { + if m != nil { + return m.DefaultHostname + } + return "" +} + +func (m *Application) GetDefaultBucket() string { + if m != nil { + return m.DefaultBucket + } + return "" +} + +// Rules to match an HTTP request and dispatch that request to a service. +type UrlDispatchRule struct { + // Domain name to match against. The wildcard "`*`" is supported if + // specified before a period: "`*.`". + // + // Defaults to matching all domains: "`*`". + Domain string `protobuf:"bytes,1,opt,name=domain" json:"domain,omitempty"` + // Pathname within the host. Must start with a "`/`". A + // single "`*`" can be included at the end of the path. The sum + // of the lengths of the domain and path may not exceed 100 + // characters. + Path string `protobuf:"bytes,2,opt,name=path" json:"path,omitempty"` + // Resource ID of a service in this application that should + // serve the matched request. The service must already + // exist. Example: `default`. + Service string `protobuf:"bytes,3,opt,name=service" json:"service,omitempty"` +} + +func (m *UrlDispatchRule) Reset() { *m = UrlDispatchRule{} } +func (m *UrlDispatchRule) String() string { return proto.CompactTextString(m) } +func (*UrlDispatchRule) ProtoMessage() {} +func (*UrlDispatchRule) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{1} } + +func (m *UrlDispatchRule) GetDomain() string { + if m != nil { + return m.Domain + } + return "" +} + +func (m *UrlDispatchRule) GetPath() string { + if m != nil { + return m.Path + } + return "" +} + +func (m *UrlDispatchRule) GetService() string { + if m != nil { + return m.Service + } + return "" +} + +func init() { + proto.RegisterType((*Application)(nil), "google.appengine.v1.Application") + proto.RegisterType((*UrlDispatchRule)(nil), "google.appengine.v1.UrlDispatchRule") +} + +func init() { proto.RegisterFile("google/appengine/v1/application.proto", fileDescriptor2) } + +var fileDescriptor2 = []byte{ + // 409 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0x5f, 0x6b, 0xdb, 0x30, + 0x14, 0xc5, 0x71, 0x3c, 0x92, 0x45, 0x5e, 0xfe, 0xa0, 0xc1, 0xa2, 0x84, 0xb1, 0x85, 0xb0, 0x40, + 0xf6, 0x62, 0x93, 0xec, 0x71, 0x7b, 0x59, 0x9a, 0x42, 0x4b, 0x5f, 0x82, 0x21, 0x14, 0xfa, 0x62, + 0x14, 0x4b, 0xb1, 0x45, 0x14, 0xc9, 0xd8, 0x72, 0xe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+ 0xa4, 0xb5, 0x56, 0xe0, 0x0e, 0x8c, 0x09, 0x3d, 0xe0, 0x92, 0xab, 0x28, 0x96, 0xf2, 0xc8, 0x68, + 0x44, 0x9f, 0x33, 0x66, 0x62, 0x40, 0xdd, 0xa9, 0xb3, 0xf0, 0x56, 0xe3, 0x7a, 0xf4, 0x3a, 0x27, + 0x7f, 0x63, 0x73, 0x0a, 0x47, 0xd6, 0x7b, 0xa3, 0xad, 0xb7, 0x8d, 0x13, 0xfe, 0x06, 0xc3, 0xfa, + 0xd9, 0x54, 0x16, 0x4a, 0xc7, 0xe6, 0xe9, 0xe6, 0x03, 0xab, 0xdf, 0x59, 0x19, 0xce, 0x41, 0xbf, + 0x46, 0xed, 0x94, 0x5f, 0x34, 0xd8, 0xb3, 0xaa, 0x19, 0x74, 0xf6, 0x08, 0x06, 0x1f, 0xd2, 0x82, + 0xdf, 0x40, 0xdb, 0x26, 0x63, 0x36, 0x62, 0xab, 0x6a, 0x4f, 0x19, 0x56, 0xa9, 0xdd, 0x8a, 0x3e, + 0x43, 0x04, 0x3a, 0x05, 0xcd, 0xcf, 0x2c, 0xa6, 0xc8, 0xd5, 0x72, 0x5d, 0xae, 0x8f, 0x60, 0x14, + 0xcb, 0xd3, 0xb5, 0xf5, 0xac, 0x87, 0x17, 0xdb, 0xdf, 0x56, 0x1f, 0xbf, 0x75, 0x9e, 0xfe, 0x59, + 0x30, 0x91, 0x1c, 0x8b, 0xc4, 0x97, 0x79, 0x12, 0x24, 0x54, 0xe8, 0x68, 0x02, 0x73, 0x85, 0x33, + 0x56, 0xbc, 0xfb, 0x5b, 0xff, 0x36, 0xc5, 0xbe, 0xad, 0xc1, 0x3f, 0xaf, 0x01, 0x00, 0x00, 0xff, + 0xff, 0x7a, 0x51, 0x2e, 0x3c, 0xd5, 0x02, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/appengine/v1/audit_data.pb.go b/vendor/google.golang.org/genproto/googleapis/appengine/v1/audit_data.pb.go new file mode 100644 index 0000000000..3bd16a7480 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/appengine/v1/audit_data.pb.go @@ -0,0 +1,208 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/appengine/v1/audit_data.proto + +package appengine + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/iam/v1" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// App Engine admin service audit log. +type AuditData struct { + // Detailed information about methods that require it. Does not include + // simple Get, List or Delete methods because all significant information + // (resource name, number of returned elements for List operations) is already + // included in parent audit log message. + // + // Types that are valid to be assigned to Method: + // *AuditData_UpdateService + // *AuditData_CreateVersion + Method isAuditData_Method `protobuf_oneof:"method"` +} + +func (m *AuditData) Reset() { *m = AuditData{} } +func (m *AuditData) String() string { return proto.CompactTextString(m) } +func (*AuditData) ProtoMessage() {} +func (*AuditData) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} } + +type isAuditData_Method interface { + isAuditData_Method() +} + +type AuditData_UpdateService struct { + UpdateService *UpdateServiceMethod `protobuf:"bytes,1,opt,name=update_service,json=updateService,oneof"` +} +type AuditData_CreateVersion struct { + CreateVersion *CreateVersionMethod `protobuf:"bytes,2,opt,name=create_version,json=createVersion,oneof"` +} + +func (*AuditData_UpdateService) isAuditData_Method() {} +func (*AuditData_CreateVersion) isAuditData_Method() {} + +func (m *AuditData) GetMethod() isAuditData_Method { + if m != nil { + return m.Method + } + return nil +} + +func (m *AuditData) GetUpdateService() *UpdateServiceMethod { + if x, ok := m.GetMethod().(*AuditData_UpdateService); ok { + return x.UpdateService + } + return nil +} + +func (m *AuditData) GetCreateVersion() *CreateVersionMethod { + if x, ok := m.GetMethod().(*AuditData_CreateVersion); ok { + return x.CreateVersion + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*AuditData) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _AuditData_OneofMarshaler, _AuditData_OneofUnmarshaler, _AuditData_OneofSizer, []interface{}{ + (*AuditData_UpdateService)(nil), + (*AuditData_CreateVersion)(nil), + } +} + +func _AuditData_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*AuditData) + // method + switch x := m.Method.(type) { + case *AuditData_UpdateService: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.UpdateService); err != nil { + return err + } + case *AuditData_CreateVersion: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.CreateVersion); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("AuditData.Method has unexpected type %T", x) + } + return nil +} + +func _AuditData_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*AuditData) + switch tag { + case 1: // method.update_service + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(UpdateServiceMethod) + err := b.DecodeMessage(msg) + m.Method = &AuditData_UpdateService{msg} + return true, err + case 2: // method.create_version + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(CreateVersionMethod) + err := b.DecodeMessage(msg) + m.Method = &AuditData_CreateVersion{msg} + return true, err + default: + return false, nil + } +} + +func _AuditData_OneofSizer(msg proto.Message) (n int) { + m := msg.(*AuditData) + // method + switch x := m.Method.(type) { + case *AuditData_UpdateService: + s := proto.Size(x.UpdateService) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *AuditData_CreateVersion: + s := proto.Size(x.CreateVersion) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Detailed information about UpdateService call. +type UpdateServiceMethod struct { + // Update service request. + Request *UpdateServiceRequest `protobuf:"bytes,1,opt,name=request" json:"request,omitempty"` +} + +func (m *UpdateServiceMethod) Reset() { *m = UpdateServiceMethod{} } +func (m *UpdateServiceMethod) String() string { return proto.CompactTextString(m) } +func (*UpdateServiceMethod) ProtoMessage() {} +func (*UpdateServiceMethod) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{1} } + +func (m *UpdateServiceMethod) GetRequest() *UpdateServiceRequest { + if m != nil { + return m.Request + } + return nil +} + +// Detailed information about CreateVersion call. +type CreateVersionMethod struct { + // Create version request. + Request *CreateVersionRequest `protobuf:"bytes,1,opt,name=request" json:"request,omitempty"` +} + +func (m *CreateVersionMethod) Reset() { *m = CreateVersionMethod{} } +func (m *CreateVersionMethod) String() string { return proto.CompactTextString(m) } +func (*CreateVersionMethod) ProtoMessage() {} +func (*CreateVersionMethod) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{2} } + +func (m *CreateVersionMethod) GetRequest() *CreateVersionRequest { + if m != nil { + return m.Request + } + return nil +} + +func init() { + proto.RegisterType((*AuditData)(nil), "google.appengine.v1.AuditData") + proto.RegisterType((*UpdateServiceMethod)(nil), "google.appengine.v1.UpdateServiceMethod") + proto.RegisterType((*CreateVersionMethod)(nil), "google.appengine.v1.CreateVersionMethod") +} + +func init() { proto.RegisterFile("google/appengine/v1/audit_data.proto", fileDescriptor3) } + +var fileDescriptor3 = []byte{ + // 290 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xb1, 0x4e, 0xc3, 0x30, + 0x10, 0x86, 0x09, 0x43, 0x01, 0x23, 0x3a, 0xa4, 0x03, 0x55, 0x07, 0x84, 0x0a, 0x43, 0x59, 0x1c, + 0x15, 0x46, 0x58, 0x48, 0x19, 0x58, 0x90, 0x4a, 0x10, 0x0c, 0x5d, 0xa2, 0x23, 0x39, 0x19, 0x4b, + 0x49, 0x6c, 0x1c, 0x27, 0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 0xe4, 0x38, 0x13, 0xa5, 0x2f, 0x18, + 0x0f, 0xfb, 0x6b, 0x2c, 0xcd, 0x81, 0x96, 0xc1, 0xea, 0xa6, 0xc3, 0x98, 0x28, 0xa0, 0x62, 0x54, + 0x28, 0x16, 0x31, 0xac, 0xec, 0xf9, 0x22, 0xb7, 0x02, 0xc9, 0xeb, 0x8d, 0x67, 0x70, 0xdd, 0x7f, + 0xbc, 0x0e, 0x2c, 0x78, 0xf5, 0x15, 0x00, 0x00, 0xff, 0xff, 0xdb, 0x56, 0x80, 0x49, 0x69, 0x02, + 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/appengine/v1/deploy.pb.go b/vendor/google.golang.org/genproto/googleapis/appengine/v1/deploy.pb.go new file mode 100644 index 0000000000..46ce408d92 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/appengine/v1/deploy.pb.go @@ -0,0 +1,183 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/appengine/v1/deploy.proto + +package appengine + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Code and application artifacts used to deploy a version to App Engine. +type Deployment struct { + // Manifest of the files stored in Google Cloud Storage that are included + // as part of this version. All files must be readable using the + // credentials supplied with this call. + Files map[string]*FileInfo `protobuf:"bytes,1,rep,name=files" json:"files,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // A Docker image that App Engine uses to run the version. + // Only applicable for instances in App Engine flexible environment. + Container *ContainerInfo `protobuf:"bytes,2,opt,name=container" json:"container,omitempty"` + // The zip file for this deployment, if this is a zip deployment. + Zip *ZipInfo `protobuf:"bytes,3,opt,name=zip" json:"zip,omitempty"` +} + +func (m *Deployment) Reset() { *m = Deployment{} } +func (m *Deployment) String() string { return proto.CompactTextString(m) } +func (*Deployment) ProtoMessage() {} +func (*Deployment) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{0} } + +func (m *Deployment) GetFiles() map[string]*FileInfo { + if m != nil { + return m.Files + } + return nil +} + +func (m *Deployment) GetContainer() *ContainerInfo { + if m != nil { + return m.Container + } + return nil +} + +func (m *Deployment) GetZip() *ZipInfo { + if m != nil { + return m.Zip + } + return nil +} + +// Single source file that is part of the version to be deployed. Each source +// file that is deployed must be specified separately. +type FileInfo struct { + // URL source to use to fetch this file. Must be a URL to a resource in + // Google Cloud Storage in the form + // 'http(s)://storage.googleapis.com/\/\'. + SourceUrl string `protobuf:"bytes,1,opt,name=source_url,json=sourceUrl" json:"source_url,omitempty"` + // The SHA1 hash of the file, in hex. + Sha1Sum string `protobuf:"bytes,2,opt,name=sha1_sum,json=sha1Sum" json:"sha1_sum,omitempty"` + // The MIME type of the file. + // + // Defaults to the value from Google Cloud Storage. + MimeType string `protobuf:"bytes,3,opt,name=mime_type,json=mimeType" json:"mime_type,omitempty"` +} + +func (m *FileInfo) Reset() { *m = FileInfo{} } +func (m *FileInfo) String() string { return proto.CompactTextString(m) } +func (*FileInfo) ProtoMessage() {} +func (*FileInfo) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{1} } + +func (m *FileInfo) GetSourceUrl() string { + if m != nil { + return m.SourceUrl + } + return "" +} + +func (m *FileInfo) GetSha1Sum() string { + if m != nil { + return m.Sha1Sum + } + return "" +} + +func (m *FileInfo) GetMimeType() string { + if m != nil { + return m.MimeType + } + return "" +} + +// Docker image that is used to start a VM container for the version you +// deploy. +type ContainerInfo struct { + // URI to the hosted container image in a Docker repository. The URI must be + // fully qualified and include a tag or digest. + // Examples: "gcr.io/my-project/image:tag" or "gcr.io/my-project/image@digest" + Image string `protobuf:"bytes,1,opt,name=image" json:"image,omitempty"` +} + +func (m *ContainerInfo) Reset() { *m = ContainerInfo{} } +func (m *ContainerInfo) String() string { return proto.CompactTextString(m) } +func (*ContainerInfo) ProtoMessage() {} +func (*ContainerInfo) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{2} } + +func (m *ContainerInfo) GetImage() string { + if m != nil { + return m.Image + } + return "" +} + +type ZipInfo struct { + // URL of the zip file to deploy from. Must be a URL to a resource in + // Google Cloud Storage in the form + // 'http(s)://storage.googleapis.com/\/\'. + SourceUrl string `protobuf:"bytes,3,opt,name=source_url,json=sourceUrl" json:"source_url,omitempty"` + // An estimate of the number of files in a zip for a zip deployment. + // If set, must be greater than or equal to the actual number of files. + // Used for optimizing performance; if not provided, deployment may be slow. + FilesCount int32 `protobuf:"varint,4,opt,name=files_count,json=filesCount" json:"files_count,omitempty"` +} + +func (m *ZipInfo) Reset() { *m = ZipInfo{} } +func (m *ZipInfo) String() string { return proto.CompactTextString(m) } +func (*ZipInfo) ProtoMessage() {} +func (*ZipInfo) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{3} } + +func (m *ZipInfo) GetSourceUrl() string { + if m != nil { + return m.SourceUrl + } + return "" +} + +func (m *ZipInfo) GetFilesCount() int32 { + if m != nil { + return m.FilesCount + } + return 0 +} + +func init() { + proto.RegisterType((*Deployment)(nil), "google.appengine.v1.Deployment") + proto.RegisterType((*FileInfo)(nil), "google.appengine.v1.FileInfo") + proto.RegisterType((*ContainerInfo)(nil), "google.appengine.v1.ContainerInfo") + proto.RegisterType((*ZipInfo)(nil), "google.appengine.v1.ZipInfo") +} + +func init() { proto.RegisterFile("google/appengine/v1/deploy.proto", fileDescriptor4) } + +var fileDescriptor4 = []byte{ + // 394 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xd1, 0xab, 0xd3, 0x30, + 0x14, 0xc6, 0xe9, 0x6a, 0xbd, 0xeb, 0x29, 0x82, 0x44, 0xc1, 0x7a, 0xbd, 0x17, 0x4b, 0x41, 0x28, + 0x3e, 0xa4, 0xec, 0xde, 0x17, 0x51, 0x1f, 0x2e, 0x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0x76, 0x32, + 0xd1, 0x24, 0xd8, 0x48, 0xc7, 0xbe, 0x9f, 0xbd, 0xf3, 0x52, 0x02, 0xf3, 0x83, 0x8c, 0x6e, 0x01, + 0x3a, 0xd9, 0xb7, 0x15, 0x2d, 0xfb, 0xb6, 0x1e, 0xd3, 0x43, 0xa7, 0x7c, 0x6f, 0x6b, 0xf4, 0x12, + 0xe6, 0xdd, 0x6f, 0xb2, 0x28, 0xbb, 0xbe, 0xb1, 0xc7, 0x84, 0xc5, 0x95, 0xa9, 0xbf, 0xf6, 0x0d, + 0x7a, 0x05, 0x61, 0xc3, 0x1b, 0x5a, 0xea, 0x41, 0x51, 0x7b, 0xa9, 0xb0, 0x98, 0x1b, 0xe1, 0xdb, + 0xa0, 0x68, 0xfa, 0x06, 0x9e, 0x9c, 0xbd, 0x03, 0x7a, 0x0e, 0x01, 0x6f, 0x08, 0xa3, 0xe3, 0x11, + 0xae, 0x48, 0xd7, 0x70, 0x35, 0x5e, 0xf9, 0xa2, 0x11, 0xff, 0xb2, 0x91, 0xd7, 0x10, 0xd9, 0x39, + 0x94, 0x95, 0xec, 0x85, 0x8e, 0x1f, 0x25, 0x5e, 0x16, 0x14, 0x60, 0xa5, 0x95, 0x51, 0x96, 0x3b, + 0x78, 0x51, 0xc9, 0x66, 0xea, 0x0d, 0x96, 0x91, 0x1b, 0xec, 0xc6, 0x2c, 0xc6, 0xc6, 0xdb, 0x7e, + 0x1c, 0x19, 0x26, 0x6b, 0x22, 0x18, 0x96, 0x2d, 0xcb, 0x19, 0x15, 0x76, 0x6d, 0x72, 0xf7, 0x8b, + 0x28, 0xde, 0x9d, 0xad, 0xe3, 0x87, 0x63, 0xf1, 0xf3, 0xb1, 0x05, 0xef, 0xff, 0x07, 0x00, 0x00, + 0xff, 0xff, 0x6e, 0xeb, 0x52, 0x5a, 0xb6, 0x02, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/appengine/v1/instance.pb.go b/vendor/google.golang.org/genproto/googleapis/appengine/v1/instance.pb.go new file mode 100644 index 0000000000..d2948ac12d --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/appengine/v1/instance.pb.go @@ -0,0 +1,266 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/appengine/v1/instance.proto + +package appengine + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf2 "github.com/golang/protobuf/ptypes/timestamp" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Availability of the instance. +type Instance_Availability int32 + +const ( + Instance_UNSPECIFIED Instance_Availability = 0 + Instance_RESIDENT Instance_Availability = 1 + Instance_DYNAMIC Instance_Availability = 2 +) + +var Instance_Availability_name = map[int32]string{ + 0: "UNSPECIFIED", + 1: "RESIDENT", + 2: "DYNAMIC", +} +var Instance_Availability_value = map[string]int32{ + "UNSPECIFIED": 0, + "RESIDENT": 1, + "DYNAMIC": 2, +} + +func (x Instance_Availability) String() string { + return proto.EnumName(Instance_Availability_name, int32(x)) +} +func (Instance_Availability) EnumDescriptor() ([]byte, []int) { return fileDescriptor5, []int{0, 0} } + +// An Instance resource is the computing unit that App Engine uses to +// automatically scale an application. +type Instance struct { + // Full path to the Instance resource in the API. + // Example: `apps/myapp/services/default/versions/v1/instances/instance-1`. + // + // @OutputOnly + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Relative name of the instance within the version. + // Example: `instance-1`. + // + // @OutputOnly + Id string `protobuf:"bytes,2,opt,name=id" json:"id,omitempty"` + // App Engine release this instance is running on. + // + // @OutputOnly + AppEngineRelease string `protobuf:"bytes,3,opt,name=app_engine_release,json=appEngineRelease" json:"app_engine_release,omitempty"` + // Availability of the instance. + // + // @OutputOnly + Availability Instance_Availability `protobuf:"varint,4,opt,name=availability,enum=google.appengine.v1.Instance_Availability" json:"availability,omitempty"` + // Name of the virtual machine where this instance lives. Only applicable + // for instances in App Engine flexible environment. + // + // @OutputOnly + VmName string `protobuf:"bytes,5,opt,name=vm_name,json=vmName" json:"vm_name,omitempty"` + // Zone where the virtual machine is located. Only applicable for instances + // in App Engine flexible environment. + // + // @OutputOnly + VmZoneName string `protobuf:"bytes,6,opt,name=vm_zone_name,json=vmZoneName" json:"vm_zone_name,omitempty"` + // Virtual machine ID of this instance. Only applicable for instances in + // App Engine flexible environment. + // + // @OutputOnly + VmId string `protobuf:"bytes,7,opt,name=vm_id,json=vmId" json:"vm_id,omitempty"` + // Time that this instance was started. + // + // @OutputOnly + StartTime *google_protobuf2.Timestamp `protobuf:"bytes,8,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + // Number of requests since this instance was started. + // + // @OutputOnly + Requests int32 `protobuf:"varint,9,opt,name=requests" json:"requests,omitempty"` + // Number of errors since this instance was started. + // + // @OutputOnly + Errors int32 `protobuf:"varint,10,opt,name=errors" json:"errors,omitempty"` + // Average queries per second (QPS) over the last minute. + // + // @OutputOnly + Qps float32 `protobuf:"fixed32,11,opt,name=qps" json:"qps,omitempty"` + // Average latency (ms) over the last minute. + // + // @OutputOnly + AverageLatency int32 `protobuf:"varint,12,opt,name=average_latency,json=averageLatency" json:"average_latency,omitempty"` + // Total memory in use (bytes). + // + // @OutputOnly + MemoryUsage int64 `protobuf:"varint,13,opt,name=memory_usage,json=memoryUsage" json:"memory_usage,omitempty"` + // Status of the virtual machine where this instance lives. Only applicable + // for instances in App Engine flexible environment. + // + // @OutputOnly + VmStatus string `protobuf:"bytes,14,opt,name=vm_status,json=vmStatus" json:"vm_status,omitempty"` + // Whether this instance is in debug mode. Only applicable for instances in + // App Engine flexible environment. + // + // @OutputOnly + VmDebugEnabled bool `protobuf:"varint,15,opt,name=vm_debug_enabled,json=vmDebugEnabled" json:"vm_debug_enabled,omitempty"` +} + +func (m *Instance) Reset() { *m = Instance{} } +func (m *Instance) String() string { return proto.CompactTextString(m) } +func (*Instance) ProtoMessage() {} +func (*Instance) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{0} } + +func (m *Instance) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Instance) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *Instance) GetAppEngineRelease() string { + if m != nil { + return m.AppEngineRelease + } + return "" +} + +func (m *Instance) GetAvailability() Instance_Availability { + if m != nil { + return m.Availability + } + return Instance_UNSPECIFIED +} + +func (m *Instance) GetVmName() string { + if m != nil { + return m.VmName + } + return "" +} + +func (m *Instance) GetVmZoneName() string { + if m != nil { + return m.VmZoneName + } + return "" +} + +func (m *Instance) GetVmId() string { + if m != nil { + return m.VmId + } + return "" +} + +func (m *Instance) GetStartTime() *google_protobuf2.Timestamp { + if m != nil { + return m.StartTime + } + return nil +} + +func (m *Instance) GetRequests() int32 { + if m != nil { + return m.Requests + } + return 0 +} + +func (m *Instance) GetErrors() int32 { + if m != nil { + return m.Errors + } + return 0 +} + +func (m *Instance) GetQps() float32 { + if m != nil { + return m.Qps + } + return 0 +} + +func (m *Instance) GetAverageLatency() int32 { + if m != nil { + return m.AverageLatency + } + return 0 +} + +func (m *Instance) GetMemoryUsage() int64 { + if m != nil { + return m.MemoryUsage + } + return 0 +} + +func (m *Instance) GetVmStatus() string { + if m != nil { + return m.VmStatus + } + return "" +} + +func (m *Instance) GetVmDebugEnabled() bool { + if m != nil { + return m.VmDebugEnabled + } + return false +} + +func init() { + proto.RegisterType((*Instance)(nil), "google.appengine.v1.Instance") + proto.RegisterEnum("google.appengine.v1.Instance_Availability", Instance_Availability_name, Instance_Availability_value) +} + +func init() { proto.RegisterFile("google/appengine/v1/instance.proto", fileDescriptor5) } + +var fileDescriptor5 = []byte{ + // 521 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x53, 0x5d, 0x6b, 0xdb, 0x3c, + 0x14, 0x7e, 0x9d, 0xb6, 0xa9, 0x73, 0xe2, 0x26, 0x46, 0x85, 0xb7, 0x22, 0x1b, 0xcc, 0xcb, 0xcd, + 0xcc, 0x18, 0x36, 0xed, 0xae, 0xf6, 0x71, 0xd3, 0x36, 0x1e, 0x18, 0xb6, 0x10, 0x9c, 0xf6, 0x62, + 0xbd, 0x31, 0x4a, 0xac, 0x79, 0x02, 0x4b, 0x72, 0x2d, 0x45, 0x90, 0xfd, 0xc6, 0xfd, 0xa8, 0x61, + 0x39, 0x09, 0x2d, 0xf4, 0xce, 0xcf, 0xc7, 0x41, 0xcf, 0x79, 0x0e, 0x86, 0x69, 0x29, 0x65, 0x59, + 0xd1, 0x98, 0xd4, 0x35, 0x15, 0x25, 0x13, 0x34, 0x36, 0x97, 0x31, 0x13, 0x4a, 0x13, 0xb1, 0xa6, + 0x51, 0xdd, 0x48, 0x2d, 0xd1, 0x79, 0xe7, 0x89, 0x0e, 0x9e, 0xc8, 0x5c, 0x4e, 0x5e, 0x1f, 0x06, + 0x59, 0x4c, 0x84, 0x90, 0x9a, 0x68, 0x26, 0x85, 0xea, 0x46, 0x26, 0x6f, 0x76, 0xaa, 0x45, 0xab, + 0xcd, 0xaf, 0x58, 0x33, 0x4e, 0x95, 0x26, 0xbc, 0xee, 0x0c, 0xd3, 0xbf, 0xc7, 0xe0, 0xa6, 0xbb, + 0x67, 0x10, 0x82, 0x63, 0x41, 0x38, 0xc5, 0x4e, 0xe0, 0x84, 0x83, 0xcc, 0x7e, 0xa3, 0x11, 0xf4, + 0x58, 0x81, 0x7b, 0x96, 0xe9, 0xb1, 0x02, 0x7d, 0x00, 0x44, 0xea, 0x3a, 0xef, 0x02, 0xe4, 0x0d, + 0xad, 0x28, 0x51, 0x14, 0x1f, 0x59, 0xdd, 0x27, 0x75, 0x9d, 0x58, 0x21, 0xeb, 0x78, 0x34, 0x07, + 0x8f, 0x18, 0xc2, 0x2a, 0xb2, 0x62, 0x15, 0xd3, 0x5b, 0x7c, 0x1c, 0x38, 0xe1, 0xe8, 0xea, 0x7d, + 0xf4, 0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x16, 0xa3, 0x10, 0x7c, 0xc3, 0xf3, 0x82, 0xae, 0x36, 0x65, + 0x4e, 0x05, 0x59, 0x55, 0xb4, 0xc0, 0xe3, 0xc0, 0x09, 0xdd, 0x6c, 0x64, 0xf8, 0xac, 0xa5, 0x93, + 0x8e, 0x9d, 0x7e, 0x06, 0xef, 0xe9, 0x05, 0xd0, 0x18, 0x86, 0xf7, 0xf3, 0xe5, 0x22, 0xb9, 0x4d, + 0xbf, 0xa5, 0xc9, 0xcc, 0xff, 0x0f, 0x79, 0xe0, 0x66, 0xc9, 0x32, 0x9d, 0x25, 0xf3, 0x3b, 0xdf, + 0x41, 0x43, 0x38, 0x9d, 0xfd, 0x9c, 0x5f, 0xff, 0x48, 0x6f, 0xfd, 0xde, 0xcd, 0x6f, 0xb8, 0x58, + 0x4b, 0xfe, 0xd2, 0x79, 0x6f, 0xce, 0xf6, 0xf7, 0x5d, 0xb4, 0xb5, 0x2e, 0x9c, 0x87, 0xaf, 0x3b, + 0x57, 0x29, 0x2b, 0x22, 0xca, 0x48, 0x36, 0x65, 0x5c, 0x52, 0x61, 0x4b, 0x8f, 0x3b, 0x89, 0xd4, + 0x4c, 0x3d, 0xfb, 0x23, 0xbe, 0x1c, 0xc0, 0xaa, 0x6f, 0x8d, 0x1f, 0xff, 0x05, 0x00, 0x00, 0xff, + 0xff, 0x97, 0xe7, 0x7d, 0x88, 0x39, 0x03, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/appengine/v1/location.pb.go b/vendor/google.golang.org/genproto/googleapis/appengine/v1/location.pb.go new file mode 100644 index 0000000000..83d2efd2ba --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/appengine/v1/location.pb.go @@ -0,0 +1,71 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/appengine/v1/location.proto + +package appengine + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import _ "google.golang.org/genproto/googleapis/type/latlng" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Metadata for the given [google.cloud.location.Location][google.cloud.location.Location]. +type LocationMetadata struct { + // App Engine Standard Environment is available in the given location. + // + // @OutputOnly + StandardEnvironmentAvailable bool `protobuf:"varint,2,opt,name=standard_environment_available,json=standardEnvironmentAvailable" json:"standard_environment_available,omitempty"` + // App Engine Flexible Environment is available in the given location. + // + // @OutputOnly + FlexibleEnvironmentAvailable bool `protobuf:"varint,4,opt,name=flexible_environment_available,json=flexibleEnvironmentAvailable" json:"flexible_environment_available,omitempty"` +} + +func (m *LocationMetadata) Reset() { *m = LocationMetadata{} } +func (m *LocationMetadata) String() string { return proto.CompactTextString(m) } +func (*LocationMetadata) ProtoMessage() {} +func (*LocationMetadata) Descriptor() ([]byte, []int) { return fileDescriptor6, []int{0} } + +func (m *LocationMetadata) GetStandardEnvironmentAvailable() bool { + if m != nil { + return m.StandardEnvironmentAvailable + } + return false +} + +func (m *LocationMetadata) GetFlexibleEnvironmentAvailable() bool { + if m != nil { + return m.FlexibleEnvironmentAvailable + } + return false +} + +func init() { + proto.RegisterType((*LocationMetadata)(nil), "google.appengine.v1.LocationMetadata") +} + +func init() { proto.RegisterFile("google/appengine/v1/location.proto", fileDescriptor6) } + +var fileDescriptor6 = []byte{ + // 236 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x90, 0x41, 0x4b, 0xc3, 0x40, + 0x10, 0x85, 0x89, 0x88, 0x48, 0x40, 0x90, 0x7a, 0xb0, 0x94, 0x22, 0xd2, 0x93, 0xa7, 0x5d, 0x8a, + 0x47, 0xbd, 0x58, 0xf4, 0xa6, 0x50, 0x3c, 0x7a, 0x29, 0x93, 0x66, 0x1c, 0x17, 0xa6, 0x33, 0x4b, + 0x32, 0x04, 0xfd, 0x33, 0xfe, 0x56, 0x69, 0x36, 0x1b, 0x11, 0xea, 0x71, 0x79, 0xdf, 0xfb, 0xd8, + 0x37, 0xe5, 0x82, 0x54, 0x89, 0xd1, 0x43, 0x8c, 0x28, 0x14, 0x04, 0x7d, 0xb7, 0xf4, 0xac, 0x5b, + 0xb0, 0xa0, 0xe2, 0x62, 0xa3, 0xa6, 0x93, 0x8b, 0xc4, 0xb8, 0x91, 0x71, 0xdd, 0x72, 0x36, 0x1f, + 0x8b, 0xc1, 0x83, 0x88, 0x5a, 0xdf, 0x68, 0x53, 0x65, 0x36, 0x1d, 0x52, 0xfb, 0x8a, 0xe8, 0x19, + 0x8c, 0x85, 0x52, 0xb2, 0xf8, 0x2e, 0xca, 0xf3, 0xe7, 0xc1, 0xff, 0x82, 0x06, 0x35, 0x18, 0x4c, + 0x1e, 0xcb, 0xab, 0xd6, 0x40, 0x6a, 0x68, 0xea, 0x0d, 0x4a, 0x17, 0x1a, 0x95, 0x1d, 0x8a, 0x6d, + 0xa0, 0x83, 0xc0, 0x50, 0x31, 0x4e, 0x8f, 0xae, 0x8b, 0x9b, 0xd3, 0xd7, 0x79, 0xa6, 0x9e, 0x7e, + 0xa1, 0x87, 0xcc, 0xec, 0x2d, 0xef, 0x8c, 0x9f, 0xa1, 0x62, 0xfc, 0xc7, 0x72, 0x9c, 0x2c, 0x99, + 0x3a, 0x64, 0x59, 0x7d, 0x94, 0x97, 0x5b, 0xdd, 0xb9, 0x03, 0x9b, 0x57, 0x67, 0xf9, 0xe3, 0xeb, + 0xfd, 0x94, 0x75, 0xf1, 0x76, 0x3f, 0x50, 0xa4, 0x0c, 0x42, 0x4e, 0x1b, 0xf2, 0x84, 0xd2, 0x0f, + 0xf5, 0x29, 0x82, 0x18, 0xda, 0x3f, 0xc7, 0xbd, 0x1b, 0x1f, 0xd5, 0x49, 0x0f, 0xde, 0xfe, 0x04, + 0x00, 0x00, 0xff, 0xff, 0x93, 0x9b, 0x7c, 0xf8, 0x84, 0x01, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/appengine/v1/operation.pb.go b/vendor/google.golang.org/genproto/googleapis/appengine/v1/operation.pb.go new file mode 100644 index 0000000000..2000f6fc3d --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/appengine/v1/operation.pb.go @@ -0,0 +1,108 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/appengine/v1/operation.proto + +package appengine + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf2 "github.com/golang/protobuf/ptypes/timestamp" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Metadata for the given [google.longrunning.Operation][google.longrunning.Operation]. +type OperationMetadataV1 struct { + // API method that initiated this operation. Example: + // `google.appengine.v1.Versions.CreateVersion`. + // + // @OutputOnly + Method string `protobuf:"bytes,1,opt,name=method" json:"method,omitempty"` + // Time that this operation was created. + // + // @OutputOnly + InsertTime *google_protobuf2.Timestamp `protobuf:"bytes,2,opt,name=insert_time,json=insertTime" json:"insert_time,omitempty"` + // Time that this operation completed. + // + // @OutputOnly + EndTime *google_protobuf2.Timestamp `protobuf:"bytes,3,opt,name=end_time,json=endTime" json:"end_time,omitempty"` + // User who requested this operation. + // + // @OutputOnly + User string `protobuf:"bytes,4,opt,name=user" json:"user,omitempty"` + // Name of the resource that this operation is acting on. Example: + // `apps/myapp/services/default`. + // + // @OutputOnly + Target string `protobuf:"bytes,5,opt,name=target" json:"target,omitempty"` +} + +func (m *OperationMetadataV1) Reset() { *m = OperationMetadataV1{} } +func (m *OperationMetadataV1) String() string { return proto.CompactTextString(m) } +func (*OperationMetadataV1) ProtoMessage() {} +func (*OperationMetadataV1) Descriptor() ([]byte, []int) { return fileDescriptor7, []int{0} } + +func (m *OperationMetadataV1) GetMethod() string { + if m != nil { + return m.Method + } + return "" +} + +func (m *OperationMetadataV1) GetInsertTime() *google_protobuf2.Timestamp { + if m != nil { + return m.InsertTime + } + return nil +} + +func (m *OperationMetadataV1) GetEndTime() *google_protobuf2.Timestamp { + if m != nil { + return m.EndTime + } + return nil +} + +func (m *OperationMetadataV1) GetUser() string { + if m != nil { + return m.User + } + return "" +} + +func (m *OperationMetadataV1) GetTarget() string { + if m != nil { + return m.Target + } + return "" +} + +func init() { + proto.RegisterType((*OperationMetadataV1)(nil), "google.appengine.v1.OperationMetadataV1") +} + +func init() { proto.RegisterFile("google/appengine/v1/operation.proto", fileDescriptor7) } + +var fileDescriptor7 = []byte{ + // 271 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x91, 0x41, 0x4b, 0x03, 0x31, + 0x10, 0x85, 0x59, 0xad, 0x55, 0x53, 0xf0, 0xb0, 0x05, 0x5d, 0x16, 0xc1, 0xa2, 0x97, 0x9e, 0x12, + 0x56, 0xf1, 0x54, 0x4f, 0xbd, 0x8b, 0xa5, 0x88, 0x07, 0x2f, 0x92, 0xba, 0x63, 0x0c, 0x74, 0x67, + 0x42, 0x32, 0xed, 0xbf, 0xf4, 0x3f, 0xc9, 0x26, 0xbb, 0x0b, 0x82, 0xd0, 0x5b, 0x5e, 0xe6, 0x7d, + 0x79, 0x2f, 0x89, 0xb8, 0x33, 0x44, 0x66, 0x0b, 0x4a, 0x3b, 0x07, 0x68, 0x2c, 0x82, 0xda, 0x57, + 0x8a, 0x1c, 0x78, 0xcd, 0x96, 0x50, 0x3a, 0x4f, 0x4c, 0xf9, 0x34, 0x99, 0xe4, 0x60, 0x92, 0xfb, + 0xaa, 0xbc, 0x1e, 0x48, 0xab, 0x34, 0x22, 0x71, 0x24, 0x42, 0x42, 0xca, 0x9b, 0x6e, 0x1a, 0xd5, + 0x66, 0xf7, 0xa5, 0xd8, 0x36, 0x10, 0x58, 0x37, 0x2e, 0x19, 0x6e, 0x7f, 0x32, 0x31, 0x7d, 0xe9, + 0x73, 0x9e, 0x81, 0x75, 0xad, 0x59, 0xbf, 0x55, 0xf9, 0xa5, 0x18, 0x37, 0xc0, 0xdf, 0x54, 0x17, + 0xd9, 0x2c, 0x9b, 0x9f, 0xaf, 0x3b, 0x95, 0x2f, 0xc4, 0xc4, 0x62, 0x00, 0xcf, 0x1f, 0xed, 0x49, + 0xc5, 0xd1, 0x2c, 0x9b, 0x4f, 0xee, 0x4b, 0xd9, 0x35, 0xeb, 0x63, 0xe4, 0x6b, 0x1f, 0xb3, 0x16, + 0xc9, 0xde, 0x6e, 0xe4, 0x8f, 0xe2, 0x0c, 0xb0, 0x4e, 0xe4, 0xf1, 0x41, 0xf2, 0x14, 0xb0, 0x8e, + 0x58, 0x2e, 0x46, 0xbb, 0x00, 0xbe, 0x18, 0xc5, 0x26, 0x71, 0xdd, 0xf6, 0x63, 0xed, 0x0d, 0x70, + 0x71, 0x92, 0xfa, 0x25, 0xb5, 0xb4, 0xe2, 0xea, 0x93, 0x1a, 0xf9, 0xcf, 0x4b, 0x2d, 0x2f, 0x86, + 0x7b, 0xae, 0xda, 0xb0, 0x55, 0xf6, 0xfe, 0xd4, 0xd9, 0x0c, 0x6d, 0x35, 0x1a, 0x49, 0xde, 0x28, + 0x03, 0x18, 0xab, 0xa8, 0x34, 0xd2, 0xce, 0x86, 0x3f, 0x9f, 0xb2, 0x18, 0xc4, 0x66, 0x1c, 0x8d, + 0x0f, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x1d, 0x8e, 0xb2, 0x00, 0xbc, 0x01, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/appengine/v1/service.pb.go b/vendor/google.golang.org/genproto/googleapis/appengine/v1/service.pb.go new file mode 100644 index 0000000000..0ccbde7792 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/appengine/v1/service.pb.go @@ -0,0 +1,165 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/appengine/v1/service.proto + +package appengine + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Available sharding mechanisms. +type TrafficSplit_ShardBy int32 + +const ( + // Diversion method unspecified. + TrafficSplit_UNSPECIFIED TrafficSplit_ShardBy = 0 + // Diversion based on a specially named cookie, "GOOGAPPUID." The cookie + // must be set by the application itself or no diversion will occur. + TrafficSplit_COOKIE TrafficSplit_ShardBy = 1 + // Diversion based on applying the modulus operation to a fingerprint + // of the IP address. + TrafficSplit_IP TrafficSplit_ShardBy = 2 +) + +var TrafficSplit_ShardBy_name = map[int32]string{ + 0: "UNSPECIFIED", + 1: "COOKIE", + 2: "IP", +} +var TrafficSplit_ShardBy_value = map[string]int32{ + "UNSPECIFIED": 0, + "COOKIE": 1, + "IP": 2, +} + +func (x TrafficSplit_ShardBy) String() string { + return proto.EnumName(TrafficSplit_ShardBy_name, int32(x)) +} +func (TrafficSplit_ShardBy) EnumDescriptor() ([]byte, []int) { return fileDescriptor8, []int{1, 0} } + +// A Service resource is a logical component of an application that can share +// state and communicate in a secure fashion with other services. +// For example, an application that handles customer requests might +// include separate services to handle tasks such as backend data +// analysis or API requests from mobile devices. Each service has a +// collection of versions that define a specific set of code used to +// implement the functionality of that service. +type Service struct { + // Full path to the Service resource in the API. + // Example: `apps/myapp/services/default`. + // + // @OutputOnly + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Relative name of the service within the application. + // Example: `default`. + // + // @OutputOnly + Id string `protobuf:"bytes,2,opt,name=id" json:"id,omitempty"` + // Mapping that defines fractional HTTP traffic diversion to + // different versions within the service. + Split *TrafficSplit `protobuf:"bytes,3,opt,name=split" json:"split,omitempty"` +} + +func (m *Service) Reset() { *m = Service{} } +func (m *Service) String() string { return proto.CompactTextString(m) } +func (*Service) ProtoMessage() {} +func (*Service) Descriptor() ([]byte, []int) { return fileDescriptor8, []int{0} } + +func (m *Service) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Service) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *Service) GetSplit() *TrafficSplit { + if m != nil { + return m.Split + } + return nil +} + +// Traffic routing configuration for versions within a single service. Traffic +// splits define how traffic directed to the service is assigned to versions. +type TrafficSplit struct { + // Mechanism used to determine which version a request is sent to. + // The traffic selection algorithm will + // be stable for either type until allocations are changed. + ShardBy TrafficSplit_ShardBy `protobuf:"varint,1,opt,name=shard_by,json=shardBy,enum=google.appengine.v1.TrafficSplit_ShardBy" json:"shard_by,omitempty"` + // Mapping from version IDs within the service to fractional + // (0.000, 1] allocations of traffic for that version. Each version can + // be specified only once, but some versions in the service may not + // have any traffic allocation. Services that have traffic allocated + // cannot be deleted until either the service is deleted or + // their traffic allocation is removed. Allocations must sum to 1. + // Up to two decimal place precision is supported for IP-based splits and + // up to three decimal places is supported for cookie-based splits. + Allocations map[string]float64 `protobuf:"bytes,2,rep,name=allocations" json:"allocations,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"fixed64,2,opt,name=value"` +} + +func (m *TrafficSplit) Reset() { *m = TrafficSplit{} } +func (m *TrafficSplit) String() string { return proto.CompactTextString(m) } +func (*TrafficSplit) ProtoMessage() {} +func (*TrafficSplit) Descriptor() ([]byte, []int) { return fileDescriptor8, []int{1} } + +func (m *TrafficSplit) GetShardBy() TrafficSplit_ShardBy { + if m != nil { + return m.ShardBy + } + return TrafficSplit_UNSPECIFIED +} + +func (m *TrafficSplit) GetAllocations() map[string]float64 { + if m != nil { + return m.Allocations + } + return nil +} + +func init() { + proto.RegisterType((*Service)(nil), "google.appengine.v1.Service") + proto.RegisterType((*TrafficSplit)(nil), "google.appengine.v1.TrafficSplit") + proto.RegisterEnum("google.appengine.v1.TrafficSplit_ShardBy", TrafficSplit_ShardBy_name, TrafficSplit_ShardBy_value) +} + +func init() { proto.RegisterFile("google/appengine/v1/service.proto", fileDescriptor8) } + +var fileDescriptor8 = []byte{ + // 356 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0x51, 0x8b, 0xda, 0x40, + 0x10, 0xc7, 0x9b, 0xb5, 0x6a, 0x3b, 0x11, 0x1b, 0xb6, 0x85, 0x06, 0xe9, 0x83, 0xfa, 0x64, 0x5f, + 0x36, 0x98, 0x3e, 0xb4, 0xb4, 0xa5, 0x50, 0x35, 0x85, 0x50, 0x38, 0x43, 0xe2, 0xbd, 0xdc, 0xcb, + 0xb1, 0xc6, 0x75, 0x6f, 0xb9, 0xb8, 0x1b, 0x92, 0x5c, 0x20, 0x5f, 0xe5, 0x3e, 0xed, 0x91, 0x6c, + 0xf0, 0xbc, 0x43, 0xf0, 0x6d, 0x66, 0xf2, 0xfb, 0xff, 0x67, 0x32, 0xb3, 0x30, 0xe1, 0x4a, 0xf1, + 0x84, 0x39, 0x34, 0x4d, 0x99, 0xe4, 0x42, 0x32, 0xa7, 0x9c, 0x3b, 0x39, 0xcb, 0x4a, 0x11, 0x33, + 0x92, 0x66, 0xaa, 0x50, 0xf8, 0xa3, 0x46, 0xc8, 0x11, 0x21, 0xe5, 0x7c, 0xf4, 0xe5, 0xa8, 0x13, + 0x0e, 0x95, 0x52, 0x15, 0xb4, 0x10, 0x4a, 0xe6, 0x5a, 0x32, 0xdd, 0x43, 0x3f, 0xd2, 0x1e, 0x18, + 0xc3, 0x5b, 0x49, 0x0f, 0xcc, 0x36, 0xc6, 0xc6, 0xec, 0x7d, 0xd8, 0xc4, 0x78, 0x08, 0x48, 0xec, + 0x6c, 0xd4, 0x54, 0x90, 0xd8, 0xe1, 0xef, 0xd0, 0xcd, 0xd3, 0x44, 0x14, 0x76, 0x67, 0x6c, 0xcc, + 0x4c, 0x77, 0x42, 0xce, 0x74, 0x24, 0x9b, 0x8c, 0xee, 0xf7, 0x22, 0x8e, 0x6a, 0x30, 0xd4, 0xfc, + 0xf4, 0x11, 0xc1, 0xe0, 0xb4, 0x8e, 0x57, 0xf0, 0x2e, 0xbf, 0xa3, 0xd9, 0xee, 0x76, 0x5b, 0x35, + 0x1d, 0x87, 0xee, 0xd7, 0x8b, 0x66, 0x24, 0xaa, 0x15, 0x8b, 0x2a, 0xec, 0xe7, 0x3a, 0xc0, 0x1b, + 0x30, 0x69, 0x92, 0xa8, 0x58, 0xff, 0x93, 0x8d, 0xc6, 0x9d, 0x99, 0xe9, 0xba, 0x97, 0x8d, 0xfe, + 0x3e, 0x8b, 0x3c, 0x59, 0x64, 0x55, 0x78, 0x6a, 0x33, 0xfa, 0x03, 0xd6, 0x6b, 0x00, 0x5b, 0xd0, + 0xb9, 0x67, 0x55, 0xbb, 0x9c, 0x3a, 0xc4, 0x9f, 0xa0, 0x5b, 0xd2, 0xe4, 0x81, 0x35, 0xeb, 0x31, + 0x42, 0x9d, 0xfc, 0x44, 0x3f, 0x8c, 0x29, 0x81, 0x7e, 0x3b, 0x29, 0xfe, 0x00, 0xe6, 0xf5, 0x55, + 0x14, 0x78, 0x4b, 0xff, 0x9f, 0xef, 0xad, 0xac, 0x37, 0x18, 0xa0, 0xb7, 0x5c, 0xaf, 0xff, 0xfb, + 0x9e, 0x65, 0xe0, 0x1e, 0x20, 0x3f, 0xb0, 0xd0, 0x82, 0xc3, 0xe7, 0x58, 0x1d, 0xce, 0x4d, 0xbd, + 0x18, 0xb4, 0xd7, 0x09, 0xea, 0x6b, 0x05, 0xc6, 0xcd, 0xef, 0x16, 0xe2, 0x2a, 0xa1, 0x92, 0x13, + 0x95, 0x71, 0x87, 0x33, 0xd9, 0xdc, 0xd2, 0xd1, 0x9f, 0x68, 0x2a, 0xf2, 0x17, 0x8f, 0xe4, 0xd7, + 0x31, 0xd9, 0xf6, 0x1a, 0xf0, 0xdb, 0x53, 0x00, 0x00, 0x00, 0xff, 0xff, 0x5f, 0xbc, 0x13, 0xf4, + 0x4c, 0x02, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/appengine/v1/version.pb.go b/vendor/google.golang.org/genproto/googleapis/appengine/v1/version.pb.go new file mode 100644 index 0000000000..21f86bf1e5 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/appengine/v1/version.pb.go @@ -0,0 +1,1072 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/appengine/v1/version.proto + +package appengine + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf1 "github.com/golang/protobuf/ptypes/duration" +import google_protobuf2 "github.com/golang/protobuf/ptypes/timestamp" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Available inbound services. +type InboundServiceType int32 + +const ( + // Not specified. + InboundServiceType_INBOUND_SERVICE_UNSPECIFIED InboundServiceType = 0 + // Allows an application to receive mail. + InboundServiceType_INBOUND_SERVICE_MAIL InboundServiceType = 1 + // Allows an application to receive email-bound notifications. + InboundServiceType_INBOUND_SERVICE_MAIL_BOUNCE InboundServiceType = 2 + // Allows an application to receive error stanzas. + InboundServiceType_INBOUND_SERVICE_XMPP_ERROR InboundServiceType = 3 + // Allows an application to receive instant messages. + InboundServiceType_INBOUND_SERVICE_XMPP_MESSAGE InboundServiceType = 4 + // Allows an application to receive user subscription POSTs. + InboundServiceType_INBOUND_SERVICE_XMPP_SUBSCRIBE InboundServiceType = 5 + // Allows an application to receive a user's chat presence. + InboundServiceType_INBOUND_SERVICE_XMPP_PRESENCE InboundServiceType = 6 + // Registers an application for notifications when a client connects or + // disconnects from a channel. + InboundServiceType_INBOUND_SERVICE_CHANNEL_PRESENCE InboundServiceType = 7 + // Enables warmup requests. + InboundServiceType_INBOUND_SERVICE_WARMUP InboundServiceType = 9 +) + +var InboundServiceType_name = map[int32]string{ + 0: "INBOUND_SERVICE_UNSPECIFIED", + 1: "INBOUND_SERVICE_MAIL", + 2: "INBOUND_SERVICE_MAIL_BOUNCE", + 3: "INBOUND_SERVICE_XMPP_ERROR", + 4: "INBOUND_SERVICE_XMPP_MESSAGE", + 5: "INBOUND_SERVICE_XMPP_SUBSCRIBE", + 6: "INBOUND_SERVICE_XMPP_PRESENCE", + 7: "INBOUND_SERVICE_CHANNEL_PRESENCE", + 9: "INBOUND_SERVICE_WARMUP", +} +var InboundServiceType_value = map[string]int32{ + "INBOUND_SERVICE_UNSPECIFIED": 0, + "INBOUND_SERVICE_MAIL": 1, + "INBOUND_SERVICE_MAIL_BOUNCE": 2, + "INBOUND_SERVICE_XMPP_ERROR": 3, + "INBOUND_SERVICE_XMPP_MESSAGE": 4, + "INBOUND_SERVICE_XMPP_SUBSCRIBE": 5, + "INBOUND_SERVICE_XMPP_PRESENCE": 6, + "INBOUND_SERVICE_CHANNEL_PRESENCE": 7, + "INBOUND_SERVICE_WARMUP": 9, +} + +func (x InboundServiceType) String() string { + return proto.EnumName(InboundServiceType_name, int32(x)) +} +func (InboundServiceType) EnumDescriptor() ([]byte, []int) { return fileDescriptor9, []int{0} } + +// Run states of a version. +type ServingStatus int32 + +const ( + // Not specified. + ServingStatus_SERVING_STATUS_UNSPECIFIED ServingStatus = 0 + // Currently serving. Instances are created according to the + // scaling settings of the version. + ServingStatus_SERVING ServingStatus = 1 + // Disabled. No instances will be created and the scaling + // settings are ignored until the state of the version changes + // to `SERVING`. + ServingStatus_STOPPED ServingStatus = 2 +) + +var ServingStatus_name = map[int32]string{ + 0: "SERVING_STATUS_UNSPECIFIED", + 1: "SERVING", + 2: "STOPPED", +} +var ServingStatus_value = map[string]int32{ + "SERVING_STATUS_UNSPECIFIED": 0, + "SERVING": 1, + "STOPPED": 2, +} + +func (x ServingStatus) String() string { + return proto.EnumName(ServingStatus_name, int32(x)) +} +func (ServingStatus) EnumDescriptor() ([]byte, []int) { return fileDescriptor9, []int{1} } + +// A Version resource is a specific set of source code and configuration files +// that are deployed into a service. +type Version struct { + // Full path to the Version resource in the API. Example: + // `apps/myapp/services/default/versions/v1`. + // + // @OutputOnly + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Relative name of the version within the service. Example: `v1`. + // Version names can contain only lowercase letters, numbers, or hyphens. + // Reserved names: "default", "latest", and any name with the prefix "ah-". + Id string `protobuf:"bytes,2,opt,name=id" json:"id,omitempty"` + // Controls how instances are created. + // + // Defaults to `AutomaticScaling`. + // + // Types that are valid to be assigned to Scaling: + // *Version_AutomaticScaling + // *Version_BasicScaling + // *Version_ManualScaling + Scaling isVersion_Scaling `protobuf_oneof:"scaling"` + // Before an application can receive email or XMPP messages, the application + // must be configured to enable the service. + InboundServices []InboundServiceType `protobuf:"varint,6,rep,packed,name=inbound_services,json=inboundServices,enum=google.appengine.v1.InboundServiceType" json:"inbound_services,omitempty"` + // Instance class that is used to run this version. Valid values are: + // * AutomaticScaling: `F1`, `F2`, `F4`, `F4_1G` + // * ManualScaling or BasicScaling: `B1`, `B2`, `B4`, `B8`, `B4_1G` + // + // Defaults to `F1` for AutomaticScaling and `B1` for ManualScaling or + // BasicScaling. + InstanceClass string `protobuf:"bytes,7,opt,name=instance_class,json=instanceClass" json:"instance_class,omitempty"` + // Extra network settings. Only applicable for VM runtimes. + Network *Network `protobuf:"bytes,8,opt,name=network" json:"network,omitempty"` + // Machine resources for this version. Only applicable for VM runtimes. + Resources *Resources `protobuf:"bytes,9,opt,name=resources" json:"resources,omitempty"` + // Desired runtime. Example: `python27`. + Runtime string `protobuf:"bytes,10,opt,name=runtime" json:"runtime,omitempty"` + // Whether multiple requests can be dispatched to this version at once. + Threadsafe bool `protobuf:"varint,11,opt,name=threadsafe" json:"threadsafe,omitempty"` + // Whether to deploy this version in a container on a virtual machine. + Vm bool `protobuf:"varint,12,opt,name=vm" json:"vm,omitempty"` + // Metadata settings that are supplied to this version to enable + // beta runtime features. + BetaSettings map[string]string `protobuf:"bytes,13,rep,name=beta_settings,json=betaSettings" json:"beta_settings,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // App Engine execution environment for this version. + // + // Defaults to `standard`. + Env string `protobuf:"bytes,14,opt,name=env" json:"env,omitempty"` + // Current serving status of this version. Only the versions with a + // `SERVING` status create instances and can be billed. + // + // `SERVING_STATUS_UNSPECIFIED` is an invalid value. Defaults to `SERVING`. + ServingStatus ServingStatus `protobuf:"varint,15,opt,name=serving_status,json=servingStatus,enum=google.appengine.v1.ServingStatus" json:"serving_status,omitempty"` + // Email address of the user who created this version. + // + // @OutputOnly + CreatedBy string `protobuf:"bytes,16,opt,name=created_by,json=createdBy" json:"created_by,omitempty"` + // Time that this version was created. + // + // @OutputOnly + CreateTime *google_protobuf2.Timestamp `protobuf:"bytes,17,opt,name=create_time,json=createTime" json:"create_time,omitempty"` + // Total size in bytes of all the files that are included in this version + // and curerntly hosted on the App Engine disk. + // + // @OutputOnly + DiskUsageBytes int64 `protobuf:"varint,18,opt,name=disk_usage_bytes,json=diskUsageBytes" json:"disk_usage_bytes,omitempty"` + // An ordered list of URL-matching patterns that should be applied to incoming + // requests. The first matching URL handles the request and other request + // handlers are not attempted. + // + // Only returned in `GET` requests if `view=FULL` is set. + Handlers []*UrlMap `protobuf:"bytes,100,rep,name=handlers" json:"handlers,omitempty"` + // Custom static error pages. Limited to 10KB per page. + // + // Only returned in `GET` requests if `view=FULL` is set. + ErrorHandlers []*ErrorHandler `protobuf:"bytes,101,rep,name=error_handlers,json=errorHandlers" json:"error_handlers,omitempty"` + // Configuration for third-party Python runtime libraries that are required + // by the application. + // + // Only returned in `GET` requests if `view=FULL` is set. + Libraries []*Library `protobuf:"bytes,102,rep,name=libraries" json:"libraries,omitempty"` + // Serving configuration for + // [Google Cloud Endpoints](https://cloud.google.com/appengine/docs/python/endpoints/). + // + // Only returned in `GET` requests if `view=FULL` is set. + ApiConfig *ApiConfigHandler `protobuf:"bytes,103,opt,name=api_config,json=apiConfig" json:"api_config,omitempty"` + // Environment variables available to the application. + // + // Only returned in `GET` requests if `view=FULL` is set. + EnvVariables map[string]string `protobuf:"bytes,104,rep,name=env_variables,json=envVariables" json:"env_variables,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // Duration that static files should be cached by web proxies and browsers. + // Only applicable if the corresponding + // [StaticFilesHandler](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#staticfileshandler) + // does not specify its own expiration time. + // + // Only returned in `GET` requests if `view=FULL` is set. + DefaultExpiration *google_protobuf1.Duration `protobuf:"bytes,105,opt,name=default_expiration,json=defaultExpiration" json:"default_expiration,omitempty"` + // Configures health checking for VM instances. Unhealthy instances are + // stopped and replaced with new instances. Only applicable for VM + // runtimes. + // + // Only returned in `GET` requests if `view=FULL` is set. + HealthCheck *HealthCheck `protobuf:"bytes,106,opt,name=health_check,json=healthCheck" json:"health_check,omitempty"` + // Files that match this pattern will not be built into this version. + // Only applicable for Go runtimes. + // + // Only returned in `GET` requests if `view=FULL` is set. + NobuildFilesRegex string `protobuf:"bytes,107,opt,name=nobuild_files_regex,json=nobuildFilesRegex" json:"nobuild_files_regex,omitempty"` + // Code and application artifacts that make up this version. + // + // Only returned in `GET` requests if `view=FULL` is set. + Deployment *Deployment `protobuf:"bytes,108,opt,name=deployment" json:"deployment,omitempty"` + // Serving URL for this version. Example: + // "https://myversion-dot-myservice-dot-myapp.appspot.com" + // + // @OutputOnly + VersionUrl string `protobuf:"bytes,109,opt,name=version_url,json=versionUrl" json:"version_url,omitempty"` +} + +func (m *Version) Reset() { *m = Version{} } +func (m *Version) String() string { return proto.CompactTextString(m) } +func (*Version) ProtoMessage() {} +func (*Version) Descriptor() ([]byte, []int) { return fileDescriptor9, []int{0} } + +type isVersion_Scaling interface { + isVersion_Scaling() +} + +type Version_AutomaticScaling struct { + AutomaticScaling *AutomaticScaling `protobuf:"bytes,3,opt,name=automatic_scaling,json=automaticScaling,oneof"` +} +type Version_BasicScaling struct { + BasicScaling *BasicScaling `protobuf:"bytes,4,opt,name=basic_scaling,json=basicScaling,oneof"` +} +type Version_ManualScaling struct { + ManualScaling *ManualScaling `protobuf:"bytes,5,opt,name=manual_scaling,json=manualScaling,oneof"` +} + +func (*Version_AutomaticScaling) isVersion_Scaling() {} +func (*Version_BasicScaling) isVersion_Scaling() {} +func (*Version_ManualScaling) isVersion_Scaling() {} + +func (m *Version) GetScaling() isVersion_Scaling { + if m != nil { + return m.Scaling + } + return nil +} + +func (m *Version) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Version) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *Version) GetAutomaticScaling() *AutomaticScaling { + if x, ok := m.GetScaling().(*Version_AutomaticScaling); ok { + return x.AutomaticScaling + } + return nil +} + +func (m *Version) GetBasicScaling() *BasicScaling { + if x, ok := m.GetScaling().(*Version_BasicScaling); ok { + return x.BasicScaling + } + return nil +} + +func (m *Version) GetManualScaling() *ManualScaling { + if x, ok := m.GetScaling().(*Version_ManualScaling); ok { + return x.ManualScaling + } + return nil +} + +func (m *Version) GetInboundServices() []InboundServiceType { + if m != nil { + return m.InboundServices + } + return nil +} + +func (m *Version) GetInstanceClass() string { + if m != nil { + return m.InstanceClass + } + return "" +} + +func (m *Version) GetNetwork() *Network { + if m != nil { + return m.Network + } + return nil +} + +func (m *Version) GetResources() *Resources { + if m != nil { + return m.Resources + } + return nil +} + +func (m *Version) GetRuntime() string { + if m != nil { + return m.Runtime + } + return "" +} + +func (m *Version) GetThreadsafe() bool { + if m != nil { + return m.Threadsafe + } + return false +} + +func (m *Version) GetVm() bool { + if m != nil { + return m.Vm + } + return false +} + +func (m *Version) GetBetaSettings() map[string]string { + if m != nil { + return m.BetaSettings + } + return nil +} + +func (m *Version) GetEnv() string { + if m != nil { + return m.Env + } + return "" +} + +func (m *Version) GetServingStatus() ServingStatus { + if m != nil { + return m.ServingStatus + } + return ServingStatus_SERVING_STATUS_UNSPECIFIED +} + +func (m *Version) GetCreatedBy() string { + if m != nil { + return m.CreatedBy + } + return "" +} + +func (m *Version) GetCreateTime() *google_protobuf2.Timestamp { + if m != nil { + return m.CreateTime + } + return nil +} + +func (m *Version) GetDiskUsageBytes() int64 { + if m != nil { + return m.DiskUsageBytes + } + return 0 +} + +func (m *Version) GetHandlers() []*UrlMap { + if m != nil { + return m.Handlers + } + return nil +} + +func (m *Version) GetErrorHandlers() []*ErrorHandler { + if m != nil { + return m.ErrorHandlers + } + return nil +} + +func (m *Version) GetLibraries() []*Library { + if m != nil { + return m.Libraries + } + return nil +} + +func (m *Version) GetApiConfig() *ApiConfigHandler { + if m != nil { + return m.ApiConfig + } + return nil +} + +func (m *Version) GetEnvVariables() map[string]string { + if m != nil { + return m.EnvVariables + } + return nil +} + +func (m *Version) GetDefaultExpiration() *google_protobuf1.Duration { + if m != nil { + return m.DefaultExpiration + } + return nil +} + +func (m *Version) GetHealthCheck() *HealthCheck { + if m != nil { + return m.HealthCheck + } + return nil +} + +func (m *Version) GetNobuildFilesRegex() string { + if m != nil { + return m.NobuildFilesRegex + } + return "" +} + +func (m *Version) GetDeployment() *Deployment { + if m != nil { + return m.Deployment + } + return nil +} + +func (m *Version) GetVersionUrl() string { + if m != nil { + return m.VersionUrl + } + return "" +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Version) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _Version_OneofMarshaler, _Version_OneofUnmarshaler, _Version_OneofSizer, []interface{}{ + (*Version_AutomaticScaling)(nil), + (*Version_BasicScaling)(nil), + (*Version_ManualScaling)(nil), + } +} + +func _Version_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Version) + // scaling + switch x := m.Scaling.(type) { + case *Version_AutomaticScaling: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.AutomaticScaling); err != nil { + return err + } + case *Version_BasicScaling: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BasicScaling); err != nil { + return err + } + case *Version_ManualScaling: + b.EncodeVarint(5<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ManualScaling); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("Version.Scaling has unexpected type %T", x) + } + return nil +} + +func _Version_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Version) + switch tag { + case 3: // scaling.automatic_scaling + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(AutomaticScaling) + err := b.DecodeMessage(msg) + m.Scaling = &Version_AutomaticScaling{msg} + return true, err + case 4: // scaling.basic_scaling + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(BasicScaling) + err := b.DecodeMessage(msg) + m.Scaling = &Version_BasicScaling{msg} + return true, err + case 5: // scaling.manual_scaling + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ManualScaling) + err := b.DecodeMessage(msg) + m.Scaling = &Version_ManualScaling{msg} + return true, err + default: + return false, nil + } +} + +func _Version_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Version) + // scaling + switch x := m.Scaling.(type) { + case *Version_AutomaticScaling: + s := proto.Size(x.AutomaticScaling) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Version_BasicScaling: + s := proto.Size(x.BasicScaling) + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Version_ManualScaling: + s := proto.Size(x.ManualScaling) + n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Automatic scaling is based on request rate, response latencies, and other +// application metrics. +type AutomaticScaling struct { + // Amount of time that the + // [Autoscaler](https://cloud.google.com/compute/docs/autoscaler/) + // should wait between changes to the number of virtual machines. + // Only applicable for VM runtimes. + CoolDownPeriod *google_protobuf1.Duration `protobuf:"bytes,1,opt,name=cool_down_period,json=coolDownPeriod" json:"cool_down_period,omitempty"` + // Target scaling by CPU usage. + CpuUtilization *CpuUtilization `protobuf:"bytes,2,opt,name=cpu_utilization,json=cpuUtilization" json:"cpu_utilization,omitempty"` + // Number of concurrent requests an automatic scaling instance can accept + // before the scheduler spawns a new instance. + // + // Defaults to a runtime-specific value. + MaxConcurrentRequests int32 `protobuf:"varint,3,opt,name=max_concurrent_requests,json=maxConcurrentRequests" json:"max_concurrent_requests,omitempty"` + // Maximum number of idle instances that should be maintained for this + // version. + MaxIdleInstances int32 `protobuf:"varint,4,opt,name=max_idle_instances,json=maxIdleInstances" json:"max_idle_instances,omitempty"` + // Maximum number of instances that should be started to handle requests. + MaxTotalInstances int32 `protobuf:"varint,5,opt,name=max_total_instances,json=maxTotalInstances" json:"max_total_instances,omitempty"` + // Maximum amount of time that a request should wait in the pending queue + // before starting a new instance to handle it. + MaxPendingLatency *google_protobuf1.Duration `protobuf:"bytes,6,opt,name=max_pending_latency,json=maxPendingLatency" json:"max_pending_latency,omitempty"` + // Minimum number of idle instances that should be maintained for + // this version. Only applicable for the default version of a service. + MinIdleInstances int32 `protobuf:"varint,7,opt,name=min_idle_instances,json=minIdleInstances" json:"min_idle_instances,omitempty"` + // Minimum number of instances that should be maintained for this version. + MinTotalInstances int32 `protobuf:"varint,8,opt,name=min_total_instances,json=minTotalInstances" json:"min_total_instances,omitempty"` + // Minimum amount of time a request should wait in the pending queue before + // starting a new instance to handle it. + MinPendingLatency *google_protobuf1.Duration `protobuf:"bytes,9,opt,name=min_pending_latency,json=minPendingLatency" json:"min_pending_latency,omitempty"` + // Target scaling by request utilization. + RequestUtilization *RequestUtilization `protobuf:"bytes,10,opt,name=request_utilization,json=requestUtilization" json:"request_utilization,omitempty"` + // Target scaling by disk usage. + DiskUtilization *DiskUtilization `protobuf:"bytes,11,opt,name=disk_utilization,json=diskUtilization" json:"disk_utilization,omitempty"` + // Target scaling by network usage. + NetworkUtilization *NetworkUtilization `protobuf:"bytes,12,opt,name=network_utilization,json=networkUtilization" json:"network_utilization,omitempty"` +} + +func (m *AutomaticScaling) Reset() { *m = AutomaticScaling{} } +func (m *AutomaticScaling) String() string { return proto.CompactTextString(m) } +func (*AutomaticScaling) ProtoMessage() {} +func (*AutomaticScaling) Descriptor() ([]byte, []int) { return fileDescriptor9, []int{1} } + +func (m *AutomaticScaling) GetCoolDownPeriod() *google_protobuf1.Duration { + if m != nil { + return m.CoolDownPeriod + } + return nil +} + +func (m *AutomaticScaling) GetCpuUtilization() *CpuUtilization { + if m != nil { + return m.CpuUtilization + } + return nil +} + +func (m *AutomaticScaling) GetMaxConcurrentRequests() int32 { + if m != nil { + return m.MaxConcurrentRequests + } + return 0 +} + +func (m *AutomaticScaling) GetMaxIdleInstances() int32 { + if m != nil { + return m.MaxIdleInstances + } + return 0 +} + +func (m *AutomaticScaling) GetMaxTotalInstances() int32 { + if m != nil { + return m.MaxTotalInstances + } + return 0 +} + +func (m *AutomaticScaling) GetMaxPendingLatency() *google_protobuf1.Duration { + if m != nil { + return m.MaxPendingLatency + } + return nil +} + +func (m *AutomaticScaling) GetMinIdleInstances() int32 { + if m != nil { + return m.MinIdleInstances + } + return 0 +} + +func (m *AutomaticScaling) GetMinTotalInstances() int32 { + if m != nil { + return m.MinTotalInstances + } + return 0 +} + +func (m *AutomaticScaling) GetMinPendingLatency() *google_protobuf1.Duration { + if m != nil { + return m.MinPendingLatency + } + return nil +} + +func (m *AutomaticScaling) GetRequestUtilization() *RequestUtilization { + if m != nil { + return m.RequestUtilization + } + return nil +} + +func (m *AutomaticScaling) GetDiskUtilization() *DiskUtilization { + if m != nil { + return m.DiskUtilization + } + return nil +} + +func (m *AutomaticScaling) GetNetworkUtilization() *NetworkUtilization { + if m != nil { + return m.NetworkUtilization + } + return nil +} + +// A service with basic scaling will create an instance when the application +// receives a request. The instance will be turned down when the app becomes +// idle. Basic scaling is ideal for work that is intermittent or driven by +// user activity. +type BasicScaling struct { + // Duration of time after the last request that an instance must wait before + // the instance is shut down. + IdleTimeout *google_protobuf1.Duration `protobuf:"bytes,1,opt,name=idle_timeout,json=idleTimeout" json:"idle_timeout,omitempty"` + // Maximum number of instances to create for this version. + MaxInstances int32 `protobuf:"varint,2,opt,name=max_instances,json=maxInstances" json:"max_instances,omitempty"` +} + +func (m *BasicScaling) Reset() { *m = BasicScaling{} } +func (m *BasicScaling) String() string { return proto.CompactTextString(m) } +func (*BasicScaling) ProtoMessage() {} +func (*BasicScaling) Descriptor() ([]byte, []int) { return fileDescriptor9, []int{2} } + +func (m *BasicScaling) GetIdleTimeout() *google_protobuf1.Duration { + if m != nil { + return m.IdleTimeout + } + return nil +} + +func (m *BasicScaling) GetMaxInstances() int32 { + if m != nil { + return m.MaxInstances + } + return 0 +} + +// A service with manual scaling runs continuously, allowing you to perform +// complex initialization and rely on the state of its memory over time. +type ManualScaling struct { + // Number of instances to assign to the service at the start. This number + // can later be altered by using the + // [Modules API](https://cloud.google.com/appengine/docs/python/modules/functions) + // `set_num_instances()` function. + Instances int32 `protobuf:"varint,1,opt,name=instances" json:"instances,omitempty"` +} + +func (m *ManualScaling) Reset() { *m = ManualScaling{} } +func (m *ManualScaling) String() string { return proto.CompactTextString(m) } +func (*ManualScaling) ProtoMessage() {} +func (*ManualScaling) Descriptor() ([]byte, []int) { return fileDescriptor9, []int{3} } + +func (m *ManualScaling) GetInstances() int32 { + if m != nil { + return m.Instances + } + return 0 +} + +// Target scaling by CPU usage. +type CpuUtilization struct { + // Period of time over which CPU utilization is calculated. + AggregationWindowLength *google_protobuf1.Duration `protobuf:"bytes,1,opt,name=aggregation_window_length,json=aggregationWindowLength" json:"aggregation_window_length,omitempty"` + // Target CPU utilization ratio to maintain when scaling. Must be between 0 + // and 1. + TargetUtilization float64 `protobuf:"fixed64,2,opt,name=target_utilization,json=targetUtilization" json:"target_utilization,omitempty"` +} + +func (m *CpuUtilization) Reset() { *m = CpuUtilization{} } +func (m *CpuUtilization) String() string { return proto.CompactTextString(m) } +func (*CpuUtilization) ProtoMessage() {} +func (*CpuUtilization) Descriptor() ([]byte, []int) { return fileDescriptor9, []int{4} } + +func (m *CpuUtilization) GetAggregationWindowLength() *google_protobuf1.Duration { + if m != nil { + return m.AggregationWindowLength + } + return nil +} + +func (m *CpuUtilization) GetTargetUtilization() float64 { + if m != nil { + return m.TargetUtilization + } + return 0 +} + +// Target scaling by request utilization. Only applicable for VM runtimes. +type RequestUtilization struct { + // Target requests per second. + TargetRequestCountPerSecond int32 `protobuf:"varint,1,opt,name=target_request_count_per_second,json=targetRequestCountPerSecond" json:"target_request_count_per_second,omitempty"` + // Target number of concurrent requests. + TargetConcurrentRequests int32 `protobuf:"varint,2,opt,name=target_concurrent_requests,json=targetConcurrentRequests" json:"target_concurrent_requests,omitempty"` +} + +func (m *RequestUtilization) Reset() { *m = RequestUtilization{} } +func (m *RequestUtilization) String() string { return proto.CompactTextString(m) } +func (*RequestUtilization) ProtoMessage() {} +func (*RequestUtilization) Descriptor() ([]byte, []int) { return fileDescriptor9, []int{5} } + +func (m *RequestUtilization) GetTargetRequestCountPerSecond() int32 { + if m != nil { + return m.TargetRequestCountPerSecond + } + return 0 +} + +func (m *RequestUtilization) GetTargetConcurrentRequests() int32 { + if m != nil { + return m.TargetConcurrentRequests + } + return 0 +} + +// Target scaling by disk usage. Only applicable for VM runtimes. +type DiskUtilization struct { + // Target bytes written per second. + TargetWriteBytesPerSecond int32 `protobuf:"varint,14,opt,name=target_write_bytes_per_second,json=targetWriteBytesPerSecond" json:"target_write_bytes_per_second,omitempty"` + // Target ops written per second. + TargetWriteOpsPerSecond int32 `protobuf:"varint,15,opt,name=target_write_ops_per_second,json=targetWriteOpsPerSecond" json:"target_write_ops_per_second,omitempty"` + // Target bytes read per second. + TargetReadBytesPerSecond int32 `protobuf:"varint,16,opt,name=target_read_bytes_per_second,json=targetReadBytesPerSecond" json:"target_read_bytes_per_second,omitempty"` + // Target ops read per seconds. + TargetReadOpsPerSecond int32 `protobuf:"varint,17,opt,name=target_read_ops_per_second,json=targetReadOpsPerSecond" json:"target_read_ops_per_second,omitempty"` +} + +func (m *DiskUtilization) Reset() { *m = DiskUtilization{} } +func (m *DiskUtilization) String() string { return proto.CompactTextString(m) } +func (*DiskUtilization) ProtoMessage() {} +func (*DiskUtilization) Descriptor() ([]byte, []int) { return fileDescriptor9, []int{6} } + +func (m *DiskUtilization) GetTargetWriteBytesPerSecond() int32 { + if m != nil { + return m.TargetWriteBytesPerSecond + } + return 0 +} + +func (m *DiskUtilization) GetTargetWriteOpsPerSecond() int32 { + if m != nil { + return m.TargetWriteOpsPerSecond + } + return 0 +} + +func (m *DiskUtilization) GetTargetReadBytesPerSecond() int32 { + if m != nil { + return m.TargetReadBytesPerSecond + } + return 0 +} + +func (m *DiskUtilization) GetTargetReadOpsPerSecond() int32 { + if m != nil { + return m.TargetReadOpsPerSecond + } + return 0 +} + +// Target scaling by network usage. Only applicable for VM runtimes. +type NetworkUtilization struct { + // Target bytes sent per second. + TargetSentBytesPerSecond int32 `protobuf:"varint,1,opt,name=target_sent_bytes_per_second,json=targetSentBytesPerSecond" json:"target_sent_bytes_per_second,omitempty"` + // Target packets sent per second. + TargetSentPacketsPerSecond int32 `protobuf:"varint,11,opt,name=target_sent_packets_per_second,json=targetSentPacketsPerSecond" json:"target_sent_packets_per_second,omitempty"` + // Target bytes received per second. + TargetReceivedBytesPerSecond int32 `protobuf:"varint,12,opt,name=target_received_bytes_per_second,json=targetReceivedBytesPerSecond" json:"target_received_bytes_per_second,omitempty"` + // Target packets received per second. + TargetReceivedPacketsPerSecond int32 `protobuf:"varint,13,opt,name=target_received_packets_per_second,json=targetReceivedPacketsPerSecond" json:"target_received_packets_per_second,omitempty"` +} + +func (m *NetworkUtilization) Reset() { *m = NetworkUtilization{} } +func (m *NetworkUtilization) String() string { return proto.CompactTextString(m) } +func (*NetworkUtilization) ProtoMessage() {} +func (*NetworkUtilization) Descriptor() ([]byte, []int) { return fileDescriptor9, []int{7} } + +func (m *NetworkUtilization) GetTargetSentBytesPerSecond() int32 { + if m != nil { + return m.TargetSentBytesPerSecond + } + return 0 +} + +func (m *NetworkUtilization) GetTargetSentPacketsPerSecond() int32 { + if m != nil { + return m.TargetSentPacketsPerSecond + } + return 0 +} + +func (m *NetworkUtilization) GetTargetReceivedBytesPerSecond() int32 { + if m != nil { + return m.TargetReceivedBytesPerSecond + } + return 0 +} + +func (m *NetworkUtilization) GetTargetReceivedPacketsPerSecond() int32 { + if m != nil { + return m.TargetReceivedPacketsPerSecond + } + return 0 +} + +// Extra network settings. Only applicable for VM runtimes. +type Network struct { + // List of ports, or port pairs, to forward from the virtual machine to the + // application container. + ForwardedPorts []string `protobuf:"bytes,1,rep,name=forwarded_ports,json=forwardedPorts" json:"forwarded_ports,omitempty"` + // Tag to apply to the VM instance during creation. + InstanceTag string `protobuf:"bytes,2,opt,name=instance_tag,json=instanceTag" json:"instance_tag,omitempty"` + // Google Cloud Platform network where the virtual machines are created. + // Specify the short name, not the resource path. + // + // Defaults to `default`. + Name string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"` +} + +func (m *Network) Reset() { *m = Network{} } +func (m *Network) String() string { return proto.CompactTextString(m) } +func (*Network) ProtoMessage() {} +func (*Network) Descriptor() ([]byte, []int) { return fileDescriptor9, []int{8} } + +func (m *Network) GetForwardedPorts() []string { + if m != nil { + return m.ForwardedPorts + } + return nil +} + +func (m *Network) GetInstanceTag() string { + if m != nil { + return m.InstanceTag + } + return "" +} + +func (m *Network) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Machine resources for a version. +type Resources struct { + // Number of CPU cores needed. + Cpu float64 `protobuf:"fixed64,1,opt,name=cpu" json:"cpu,omitempty"` + // Disk size (GB) needed. + DiskGb float64 `protobuf:"fixed64,2,opt,name=disk_gb,json=diskGb" json:"disk_gb,omitempty"` + // Memory (GB) needed. + MemoryGb float64 `protobuf:"fixed64,3,opt,name=memory_gb,json=memoryGb" json:"memory_gb,omitempty"` +} + +func (m *Resources) Reset() { *m = Resources{} } +func (m *Resources) String() string { return proto.CompactTextString(m) } +func (*Resources) ProtoMessage() {} +func (*Resources) Descriptor() ([]byte, []int) { return fileDescriptor9, []int{9} } + +func (m *Resources) GetCpu() float64 { + if m != nil { + return m.Cpu + } + return 0 +} + +func (m *Resources) GetDiskGb() float64 { + if m != nil { + return m.DiskGb + } + return 0 +} + +func (m *Resources) GetMemoryGb() float64 { + if m != nil { + return m.MemoryGb + } + return 0 +} + +func init() { + proto.RegisterType((*Version)(nil), "google.appengine.v1.Version") + proto.RegisterType((*AutomaticScaling)(nil), "google.appengine.v1.AutomaticScaling") + proto.RegisterType((*BasicScaling)(nil), "google.appengine.v1.BasicScaling") + proto.RegisterType((*ManualScaling)(nil), "google.appengine.v1.ManualScaling") + proto.RegisterType((*CpuUtilization)(nil), "google.appengine.v1.CpuUtilization") + proto.RegisterType((*RequestUtilization)(nil), "google.appengine.v1.RequestUtilization") + proto.RegisterType((*DiskUtilization)(nil), "google.appengine.v1.DiskUtilization") + proto.RegisterType((*NetworkUtilization)(nil), "google.appengine.v1.NetworkUtilization") + proto.RegisterType((*Network)(nil), "google.appengine.v1.Network") + proto.RegisterType((*Resources)(nil), "google.appengine.v1.Resources") + proto.RegisterEnum("google.appengine.v1.InboundServiceType", InboundServiceType_name, InboundServiceType_value) + proto.RegisterEnum("google.appengine.v1.ServingStatus", ServingStatus_name, ServingStatus_value) +} + +func init() { proto.RegisterFile("google/appengine/v1/version.proto", fileDescriptor9) } + +var fileDescriptor9 = []byte{ + // 1767 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x58, 0x5d, 0x73, 0xdb, 0xc6, + 0x15, 0x0d, 0x29, 0x4b, 0x14, 0x2f, 0x3f, 0x04, 0xad, 0xd3, 0x08, 0x96, 0x64, 0x89, 0x66, 0x92, + 0xb1, 0x26, 0xd3, 0x50, 0x13, 0x77, 0x26, 0xed, 0x38, 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, 0xf8, 0x58, 0x50, 0xdb, 0x8a, 0x6c, 0xec, 0x51, 0xe6, 0xea, 0x1b, 0xad, 0xd2, 0x49, 0xed, + 0xd5, 0xd7, 0x9d, 0x82, 0x2c, 0x74, 0xce, 0x32, 0xb4, 0x99, 0x80, 0x2f, 0x3e, 0x33, 0x34, 0xbc, + 0x12, 0x43, 0x17, 0xd0, 0x98, 0xe0, 0x28, 0xa7, 0xf8, 0x44, 0x29, 0xbe, 0x28, 0x54, 0xec, 0x4a, + 0xe4, 0x42, 0xad, 0x3e, 0xc9, 0x8d, 0xd1, 0x9f, 0xa0, 0xe9, 0x63, 0x16, 0x63, 0x6f, 0x2e, 0xb5, + 0xa9, 0xa4, 0xda, 0x85, 0x52, 0x57, 0x0a, 0xba, 0xd0, 0x6a, 0xf8, 0xf9, 0x00, 0x32, 0x40, 0xa3, + 0x6c, 0x12, 0xc4, 0xcc, 0xb1, 0x22, 0xc2, 0xa7, 0xd4, 0x26, 0x91, 0xbe, 0xd5, 0xda, 0x38, 0x69, + 0xbe, 0x7a, 0x59, 0x28, 0x37, 0x48, 0xc0, 0x66, 0x82, 0x1d, 0xcd, 0x42, 0x62, 0xec, 0xd0, 0xa5, + 0x58, 0x84, 0xbe, 0x86, 0x26, 0x65, 0x91, 0xc0, 0xcc, 0x26, 0x96, 0xed, 0xe1, 0x28, 0xd2, 0x2b, + 0x2a, 0xb9, 0x8d, 0x2c, 0xda, 0x93, 0x41, 0xf4, 0x3d, 0x54, 0x18, 0x11, 0x0f, 0x01, 0xbf, 0xd7, + 0xb7, 0xd5, 0x03, 0x1c, 0x16, 0xae, 0x78, 0x9d, 0x60, 0x8c, 0x0c, 0x8c, 0xde, 0x40, 0x95, 0x93, + 0x28, 0x88, 0xb9, 0xf4, 0x5a, 0x55, 0xcc, 0xa3, 0x42, 0xa6, 0x91, 0xa1, 0x8c, 0x05, 0x01, 0xe9, + 0x50, 0xe1, 0x31, 0x93, 0x35, 0xa2, 0x83, 0x72, 0x95, 0x0d, 0xd1, 0x11, 0x80, 0xb8, 0xe3, 0x04, + 0x3b, 0x11, 0xbe, 0x25, 0x7a, 0xad, 0x55, 0x3a, 0xd9, 0x36, 0x72, 0x11, 0x59, 0x27, 0x53, 0x5f, + 0xaf, 0xab, 0x78, 0x79, 0xea, 0x23, 0x13, 0x1a, 0x13, 0x22, 0xb0, 0x15, 0x11, 0x21, 0x28, 0x73, + 0x23, 0xbd, 0xd1, 0xda, 0x38, 0xa9, 0xbd, 0xea, 0x14, 0x7a, 0x49, 0x0b, 0xb0, 0xd3, 0x25, 0x02, + 0x9b, 0x29, 0xa1, 0xcf, 0x04, 0x9f, 0x19, 0xf5, 0x49, 0x2e, 0x84, 0x34, 0xd8, 0x20, 0x6c, 0xaa, + 0x37, 0x95, 0x35, 0xf9, 0x13, 0x0d, 0xa0, 0xa9, 0x76, 0x86, 0xb9, 0x56, 0x24, 0xb0, 0x88, 0x23, + 0x7d, 0xa7, 0x55, 0x3a, 0x69, 0xfe, 0xc2, 0x76, 0x9b, 0x09, 0xd4, 0x54, 0x48, 0xa3, 0x11, 0xe5, + 0x87, 0xe8, 0x39, 0x80, 0xcd, 0x09, 0x16, 0xc4, 0xb1, 0x26, 0x33, 0x5d, 0x53, 0x6b, 0x54, 0xd3, + 0x48, 0x77, 0x86, 0x7e, 0x80, 0x5a, 0x32, 0xb0, 0x54, 0x7a, 0x76, 0x55, 0x6a, 0xf7, 0xb3, 0x65, + 0xb2, 0xf3, 0xd5, 0x19, 0x65, 0xe7, 0xcb, 0x48, 0xd5, 0x64, 0x00, 0x9d, 0x80, 0xe6, 0xd0, 0xe8, + 0xde, 0x8a, 0x23, 0xec, 0x12, 0x6b, 0x32, 0x13, 0x24, 0xd2, 0x51, 0xab, 0x74, 0xb2, 0x61, 0x34, + 0x65, 0x7c, 0x2c, 0xc3, 0x5d, 0x19, 0x45, 0xbf, 0x85, 0xed, 0x3b, 0xcc, 0x1c, 0x8f, 0xf0, 0x48, + 0x77, 0x54, 0xca, 0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, 0xa4, 0xad, 0x06, 0x95, 0x74, 0x5e, 0x2b, 0xa9, 0xc1, 0xe8, + 0x66, 0x38, 0xec, 0x9f, 0x6b, 0xe5, 0xae, 0x0b, 0x7b, 0x76, 0xe0, 0x17, 0xdd, 0x4f, 0xdd, 0x7a, + 0xfa, 0x1a, 0x3e, 0x94, 0xfd, 0x79, 0x58, 0xfa, 0xf3, 0x9b, 0x14, 0xe4, 0x06, 0x1e, 0x66, 0x6e, + 0x27, 0xe0, 0xee, 0xa9, 0x4b, 0x98, 0xea, 0xde, 0xa7, 0xc9, 0x14, 0x0e, 0x69, 0xb4, 0xf4, 0xcf, + 0xc6, 0x0f, 0xf3, 0xc1, 0x64, 0x4b, 0x01, 0x7f, 0xf3, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2f, + 0xe1, 0xd6, 0xfa, 0x7b, 0x11, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/assistant/embedded/v1alpha1/embedded_assistant.pb.go b/vendor/google.golang.org/genproto/googleapis/assistant/embedded/v1alpha1/embedded_assistant.pb.go new file mode 100644 index 0000000000..f3917faf97 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/assistant/embedded/v1alpha1/embedded_assistant.pb.go @@ -0,0 +1,969 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/assistant/embedded/v1alpha1/embedded_assistant.proto + +/* +Package embedded is a generated protocol buffer package. + +It is generated from these files: + google/assistant/embedded/v1alpha1/embedded_assistant.proto + +It has these top-level messages: + ConverseConfig + AudioInConfig + AudioOutConfig + ConverseState + AudioOut + ConverseResult + ConverseRequest + ConverseResponse +*/ +package embedded + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_rpc "google.golang.org/genproto/googleapis/rpc/status" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Audio encoding of the data sent in the audio message. +// Audio must be one-channel (mono). The only language supported is "en-US". +type AudioInConfig_Encoding int32 + +const ( + // Not specified. Will return result [google.rpc.Code.INVALID_ARGUMENT][]. + AudioInConfig_ENCODING_UNSPECIFIED AudioInConfig_Encoding = 0 + // Uncompressed 16-bit signed little-endian samples (Linear PCM). + // This encoding includes no header, only the raw audio bytes. + AudioInConfig_LINEAR16 AudioInConfig_Encoding = 1 + // [`FLAC`](https://xiph.org/flac/documentation.html) (Free Lossless Audio + // Codec) is the recommended encoding because it is + // lossless--therefore recognition is not compromised--and + // requires only about half the bandwidth of `LINEAR16`. This encoding + // includes the `FLAC` stream header followed by audio data. It supports + // 16-bit and 24-bit samples, however, not all fields in `STREAMINFO` are + // supported. + AudioInConfig_FLAC AudioInConfig_Encoding = 2 +) + +var AudioInConfig_Encoding_name = map[int32]string{ + 0: "ENCODING_UNSPECIFIED", + 1: "LINEAR16", + 2: "FLAC", +} +var AudioInConfig_Encoding_value = map[string]int32{ + "ENCODING_UNSPECIFIED": 0, + "LINEAR16": 1, + "FLAC": 2, +} + +func (x AudioInConfig_Encoding) String() string { + return proto.EnumName(AudioInConfig_Encoding_name, int32(x)) +} +func (AudioInConfig_Encoding) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{1, 0} } + +// Audio encoding of the data returned in the audio message. All encodings are +// raw audio bytes with no header, except as indicated below. +type AudioOutConfig_Encoding int32 + +const ( + // Not specified. Will return result [google.rpc.Code.INVALID_ARGUMENT][]. + AudioOutConfig_ENCODING_UNSPECIFIED AudioOutConfig_Encoding = 0 + // Uncompressed 16-bit signed little-endian samples (Linear PCM). + AudioOutConfig_LINEAR16 AudioOutConfig_Encoding = 1 + // MP3 audio encoding. The sample rate is encoded in the payload. + AudioOutConfig_MP3 AudioOutConfig_Encoding = 2 + // Opus-encoded audio wrapped in an ogg container. The result will be a + // file which can be played natively on Android and in some browsers (such + // as Chrome). The quality of the encoding is considerably higher than MP3 + // while using the same bitrate. The sample rate is encoded in the payload. + AudioOutConfig_OPUS_IN_OGG AudioOutConfig_Encoding = 3 +) + +var AudioOutConfig_Encoding_name = map[int32]string{ + 0: "ENCODING_UNSPECIFIED", + 1: "LINEAR16", + 2: "MP3", + 3: "OPUS_IN_OGG", +} +var AudioOutConfig_Encoding_value = map[string]int32{ + "ENCODING_UNSPECIFIED": 0, + "LINEAR16": 1, + "MP3": 2, + "OPUS_IN_OGG": 3, +} + +func (x AudioOutConfig_Encoding) String() string { + return proto.EnumName(AudioOutConfig_Encoding_name, int32(x)) +} +func (AudioOutConfig_Encoding) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{2, 0} } + +// Possible states of the microphone after a `Converse` RPC completes. +type ConverseResult_MicrophoneMode int32 + +const ( + // No mode specified. + ConverseResult_MICROPHONE_MODE_UNSPECIFIED ConverseResult_MicrophoneMode = 0 + // The service is not expecting a follow-on question from the user. + // The microphone should remain off until the user re-activates it. + ConverseResult_CLOSE_MICROPHONE ConverseResult_MicrophoneMode = 1 + // The service is expecting a follow-on question from the user. The + // microphone should be re-opened when the `AudioOut` playback completes + // (by starting a new `Converse` RPC call to send the new audio). + ConverseResult_DIALOG_FOLLOW_ON ConverseResult_MicrophoneMode = 2 +) + +var ConverseResult_MicrophoneMode_name = map[int32]string{ + 0: "MICROPHONE_MODE_UNSPECIFIED", + 1: "CLOSE_MICROPHONE", + 2: "DIALOG_FOLLOW_ON", +} +var ConverseResult_MicrophoneMode_value = map[string]int32{ + "MICROPHONE_MODE_UNSPECIFIED": 0, + "CLOSE_MICROPHONE": 1, + "DIALOG_FOLLOW_ON": 2, +} + +func (x ConverseResult_MicrophoneMode) String() string { + return proto.EnumName(ConverseResult_MicrophoneMode_name, int32(x)) +} +func (ConverseResult_MicrophoneMode) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{5, 0} +} + +// Indicates the type of event. +type ConverseResponse_EventType int32 + +const ( + // No event specified. + ConverseResponse_EVENT_TYPE_UNSPECIFIED ConverseResponse_EventType = 0 + // This event indicates that the server has detected the end of the user's + // speech utterance and expects no additional speech. Therefore, the server + // will not process additional audio (although it may subsequently return + // additional results). The client should stop sending additional audio + // data, half-close the gRPC connection, and wait for any additional results + // until the server closes the gRPC connection. + ConverseResponse_END_OF_UTTERANCE ConverseResponse_EventType = 1 +) + +var ConverseResponse_EventType_name = map[int32]string{ + 0: "EVENT_TYPE_UNSPECIFIED", + 1: "END_OF_UTTERANCE", +} +var ConverseResponse_EventType_value = map[string]int32{ + "EVENT_TYPE_UNSPECIFIED": 0, + "END_OF_UTTERANCE": 1, +} + +func (x ConverseResponse_EventType) String() string { + return proto.EnumName(ConverseResponse_EventType_name, int32(x)) +} +func (ConverseResponse_EventType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{7, 0} +} + +// Specifies how to process the `ConverseRequest` messages. +type ConverseConfig struct { + // *Required* Specifies how to process the subsequent incoming audio. + AudioInConfig *AudioInConfig `protobuf:"bytes,1,opt,name=audio_in_config,json=audioInConfig" json:"audio_in_config,omitempty"` + // *Required* Specifies how to format the audio that will be returned. + AudioOutConfig *AudioOutConfig `protobuf:"bytes,2,opt,name=audio_out_config,json=audioOutConfig" json:"audio_out_config,omitempty"` + // *Required* Represents the current dialog state. + ConverseState *ConverseState `protobuf:"bytes,3,opt,name=converse_state,json=converseState" json:"converse_state,omitempty"` +} + +func (m *ConverseConfig) Reset() { *m = ConverseConfig{} } +func (m *ConverseConfig) String() string { return proto.CompactTextString(m) } +func (*ConverseConfig) ProtoMessage() {} +func (*ConverseConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *ConverseConfig) GetAudioInConfig() *AudioInConfig { + if m != nil { + return m.AudioInConfig + } + return nil +} + +func (m *ConverseConfig) GetAudioOutConfig() *AudioOutConfig { + if m != nil { + return m.AudioOutConfig + } + return nil +} + +func (m *ConverseConfig) GetConverseState() *ConverseState { + if m != nil { + return m.ConverseState + } + return nil +} + +// Specifies how to process the `audio_in` data that will be provided in +// subsequent requests. For recommended settings, see the Google Assistant SDK +// [best practices](https://developers.google.com/assistant/sdk/develop/grpc/best-practices/audio). +type AudioInConfig struct { + // *Required* Encoding of audio data sent in all `audio_in` messages. + Encoding AudioInConfig_Encoding `protobuf:"varint,1,opt,name=encoding,enum=google.assistant.embedded.v1alpha1.AudioInConfig_Encoding" json:"encoding,omitempty"` + // *Required* Sample rate (in Hertz) of the audio data sent in all `audio_in` + // messages. Valid values are from 16000-24000, but 16000 is optimal. + // For best results, set the sampling rate of the audio source to 16000 Hz. + // If that's not possible, use the native sample rate of the audio source + // (instead of re-sampling). + SampleRateHertz int32 `protobuf:"varint,2,opt,name=sample_rate_hertz,json=sampleRateHertz" json:"sample_rate_hertz,omitempty"` +} + +func (m *AudioInConfig) Reset() { *m = AudioInConfig{} } +func (m *AudioInConfig) String() string { return proto.CompactTextString(m) } +func (*AudioInConfig) ProtoMessage() {} +func (*AudioInConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *AudioInConfig) GetEncoding() AudioInConfig_Encoding { + if m != nil { + return m.Encoding + } + return AudioInConfig_ENCODING_UNSPECIFIED +} + +func (m *AudioInConfig) GetSampleRateHertz() int32 { + if m != nil { + return m.SampleRateHertz + } + return 0 +} + +// Specifies the desired format for the server to use when it returns +// `audio_out` messages. +type AudioOutConfig struct { + // *Required* The encoding of audio data to be returned in all `audio_out` + // messages. + Encoding AudioOutConfig_Encoding `protobuf:"varint,1,opt,name=encoding,enum=google.assistant.embedded.v1alpha1.AudioOutConfig_Encoding" json:"encoding,omitempty"` + // *Required* The sample rate in Hertz of the audio data returned in + // `audio_out` messages. Valid values are: 16000-24000. + SampleRateHertz int32 `protobuf:"varint,2,opt,name=sample_rate_hertz,json=sampleRateHertz" json:"sample_rate_hertz,omitempty"` + // *Required* Current volume setting of the device's audio output. + // Valid values are 1 to 100 (corresponding to 1% to 100%). + VolumePercentage int32 `protobuf:"varint,3,opt,name=volume_percentage,json=volumePercentage" json:"volume_percentage,omitempty"` +} + +func (m *AudioOutConfig) Reset() { *m = AudioOutConfig{} } +func (m *AudioOutConfig) String() string { return proto.CompactTextString(m) } +func (*AudioOutConfig) ProtoMessage() {} +func (*AudioOutConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *AudioOutConfig) GetEncoding() AudioOutConfig_Encoding { + if m != nil { + return m.Encoding + } + return AudioOutConfig_ENCODING_UNSPECIFIED +} + +func (m *AudioOutConfig) GetSampleRateHertz() int32 { + if m != nil { + return m.SampleRateHertz + } + return 0 +} + +func (m *AudioOutConfig) GetVolumePercentage() int32 { + if m != nil { + return m.VolumePercentage + } + return 0 +} + +// Provides information about the current dialog state. +type ConverseState struct { + // *Required* The `conversation_state` value returned in the prior + // `ConverseResponse`. Omit (do not set the field) if there was no prior + // `ConverseResponse`. If there was a prior `ConverseResponse`, do not omit + // this field; doing so will end that conversation (and this new request will + // start a new conversation). + ConversationState []byte `protobuf:"bytes,1,opt,name=conversation_state,json=conversationState,proto3" json:"conversation_state,omitempty"` +} + +func (m *ConverseState) Reset() { *m = ConverseState{} } +func (m *ConverseState) String() string { return proto.CompactTextString(m) } +func (*ConverseState) ProtoMessage() {} +func (*ConverseState) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *ConverseState) GetConversationState() []byte { + if m != nil { + return m.ConversationState + } + return nil +} + +// The audio containing the assistant's response to the query. Sequential chunks +// of audio data are received in sequential `ConverseResponse` messages. +type AudioOut struct { + // *Output-only* The audio data containing the assistant's response to the + // query. Sequential chunks of audio data are received in sequential + // `ConverseResponse` messages. + AudioData []byte `protobuf:"bytes,1,opt,name=audio_data,json=audioData,proto3" json:"audio_data,omitempty"` +} + +func (m *AudioOut) Reset() { *m = AudioOut{} } +func (m *AudioOut) String() string { return proto.CompactTextString(m) } +func (*AudioOut) ProtoMessage() {} +func (*AudioOut) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *AudioOut) GetAudioData() []byte { + if m != nil { + return m.AudioData + } + return nil +} + +// The semantic result for the user's spoken query. +type ConverseResult struct { + // *Output-only* The recognized transcript of what the user said. + SpokenRequestText string `protobuf:"bytes,1,opt,name=spoken_request_text,json=spokenRequestText" json:"spoken_request_text,omitempty"` + // *Output-only* The text of the assistant's spoken response. This is only + // returned for an IFTTT action. + SpokenResponseText string `protobuf:"bytes,2,opt,name=spoken_response_text,json=spokenResponseText" json:"spoken_response_text,omitempty"` + // *Output-only* State information for subsequent `ConverseRequest`. This + // value should be saved in the client and returned in the + // `conversation_state` with the next `ConverseRequest`. (The client does not + // need to interpret or otherwise use this value.) There is no need to save + // this information across device restarts. + ConversationState []byte `protobuf:"bytes,3,opt,name=conversation_state,json=conversationState,proto3" json:"conversation_state,omitempty"` + // *Output-only* Specifies the mode of the microphone after this `Converse` + // RPC is processed. + MicrophoneMode ConverseResult_MicrophoneMode `protobuf:"varint,4,opt,name=microphone_mode,json=microphoneMode,enum=google.assistant.embedded.v1alpha1.ConverseResult_MicrophoneMode" json:"microphone_mode,omitempty"` + // *Output-only* Updated volume level. The value will be 0 or omitted + // (indicating no change) unless a voice command such as "Increase the volume" + // or "Set volume level 4" was recognized, in which case the value will be + // between 1 and 100 (corresponding to the new volume level of 1% to 100%). + // Typically, a client should use this volume level when playing the + // `audio_out` data, and retain this value as the current volume level and + // supply it in the `AudioOutConfig` of the next `ConverseRequest`. (Some + // clients may also implement other ways to allow the current volume level to + // be changed, for example, by providing a knob that the user can turn.) + VolumePercentage int32 `protobuf:"varint,5,opt,name=volume_percentage,json=volumePercentage" json:"volume_percentage,omitempty"` +} + +func (m *ConverseResult) Reset() { *m = ConverseResult{} } +func (m *ConverseResult) String() string { return proto.CompactTextString(m) } +func (*ConverseResult) ProtoMessage() {} +func (*ConverseResult) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *ConverseResult) GetSpokenRequestText() string { + if m != nil { + return m.SpokenRequestText + } + return "" +} + +func (m *ConverseResult) GetSpokenResponseText() string { + if m != nil { + return m.SpokenResponseText + } + return "" +} + +func (m *ConverseResult) GetConversationState() []byte { + if m != nil { + return m.ConversationState + } + return nil +} + +func (m *ConverseResult) GetMicrophoneMode() ConverseResult_MicrophoneMode { + if m != nil { + return m.MicrophoneMode + } + return ConverseResult_MICROPHONE_MODE_UNSPECIFIED +} + +func (m *ConverseResult) GetVolumePercentage() int32 { + if m != nil { + return m.VolumePercentage + } + return 0 +} + +// The top-level message sent by the client. Clients must send at least two, and +// typically numerous `ConverseRequest` messages. The first message must +// contain a `config` message and must not contain `audio_in` data. All +// subsequent messages must contain `audio_in` data and must not contain a +// `config` message. +type ConverseRequest struct { + // Exactly one of these fields must be specified in each `ConverseRequest`. + // + // Types that are valid to be assigned to ConverseRequest: + // *ConverseRequest_Config + // *ConverseRequest_AudioIn + ConverseRequest isConverseRequest_ConverseRequest `protobuf_oneof:"converse_request"` +} + +func (m *ConverseRequest) Reset() { *m = ConverseRequest{} } +func (m *ConverseRequest) String() string { return proto.CompactTextString(m) } +func (*ConverseRequest) ProtoMessage() {} +func (*ConverseRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +type isConverseRequest_ConverseRequest interface { + isConverseRequest_ConverseRequest() +} + +type ConverseRequest_Config struct { + Config *ConverseConfig `protobuf:"bytes,1,opt,name=config,oneof"` +} +type ConverseRequest_AudioIn struct { + AudioIn []byte `protobuf:"bytes,2,opt,name=audio_in,json=audioIn,proto3,oneof"` +} + +func (*ConverseRequest_Config) isConverseRequest_ConverseRequest() {} +func (*ConverseRequest_AudioIn) isConverseRequest_ConverseRequest() {} + +func (m *ConverseRequest) GetConverseRequest() isConverseRequest_ConverseRequest { + if m != nil { + return m.ConverseRequest + } + return nil +} + +func (m *ConverseRequest) GetConfig() *ConverseConfig { + if x, ok := m.GetConverseRequest().(*ConverseRequest_Config); ok { + return x.Config + } + return nil +} + +func (m *ConverseRequest) GetAudioIn() []byte { + if x, ok := m.GetConverseRequest().(*ConverseRequest_AudioIn); ok { + return x.AudioIn + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*ConverseRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _ConverseRequest_OneofMarshaler, _ConverseRequest_OneofUnmarshaler, _ConverseRequest_OneofSizer, []interface{}{ + (*ConverseRequest_Config)(nil), + (*ConverseRequest_AudioIn)(nil), + } +} + +func _ConverseRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*ConverseRequest) + // converse_request + switch x := m.ConverseRequest.(type) { + case *ConverseRequest_Config: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Config); err != nil { + return err + } + case *ConverseRequest_AudioIn: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeRawBytes(x.AudioIn) + case nil: + default: + return fmt.Errorf("ConverseRequest.ConverseRequest has unexpected type %T", x) + } + return nil +} + +func _ConverseRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*ConverseRequest) + switch tag { + case 1: // converse_request.config + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ConverseConfig) + err := b.DecodeMessage(msg) + m.ConverseRequest = &ConverseRequest_Config{msg} + return true, err + case 2: // converse_request.audio_in + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.ConverseRequest = &ConverseRequest_AudioIn{x} + return true, err + default: + return false, nil + } +} + +func _ConverseRequest_OneofSizer(msg proto.Message) (n int) { + m := msg.(*ConverseRequest) + // converse_request + switch x := m.ConverseRequest.(type) { + case *ConverseRequest_Config: + s := proto.Size(x.Config) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *ConverseRequest_AudioIn: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.AudioIn))) + n += len(x.AudioIn) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// The top-level message received by the client. A series of one or more +// `ConverseResponse` messages are streamed back to the client. +type ConverseResponse struct { + // Exactly one of these fields will be populated in each `ConverseResponse`. + // + // Types that are valid to be assigned to ConverseResponse: + // *ConverseResponse_Error + // *ConverseResponse_EventType_ + // *ConverseResponse_AudioOut + // *ConverseResponse_Result + ConverseResponse isConverseResponse_ConverseResponse `protobuf_oneof:"converse_response"` +} + +func (m *ConverseResponse) Reset() { *m = ConverseResponse{} } +func (m *ConverseResponse) String() string { return proto.CompactTextString(m) } +func (*ConverseResponse) ProtoMessage() {} +func (*ConverseResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +type isConverseResponse_ConverseResponse interface { + isConverseResponse_ConverseResponse() +} + +type ConverseResponse_Error struct { + Error *google_rpc.Status `protobuf:"bytes,1,opt,name=error,oneof"` +} +type ConverseResponse_EventType_ struct { + EventType ConverseResponse_EventType `protobuf:"varint,2,opt,name=event_type,json=eventType,enum=google.assistant.embedded.v1alpha1.ConverseResponse_EventType,oneof"` +} +type ConverseResponse_AudioOut struct { + AudioOut *AudioOut `protobuf:"bytes,3,opt,name=audio_out,json=audioOut,oneof"` +} +type ConverseResponse_Result struct { + Result *ConverseResult `protobuf:"bytes,5,opt,name=result,oneof"` +} + +func (*ConverseResponse_Error) isConverseResponse_ConverseResponse() {} +func (*ConverseResponse_EventType_) isConverseResponse_ConverseResponse() {} +func (*ConverseResponse_AudioOut) isConverseResponse_ConverseResponse() {} +func (*ConverseResponse_Result) isConverseResponse_ConverseResponse() {} + +func (m *ConverseResponse) GetConverseResponse() isConverseResponse_ConverseResponse { + if m != nil { + return m.ConverseResponse + } + return nil +} + +func (m *ConverseResponse) GetError() *google_rpc.Status { + if x, ok := m.GetConverseResponse().(*ConverseResponse_Error); ok { + return x.Error + } + return nil +} + +func (m *ConverseResponse) GetEventType() ConverseResponse_EventType { + if x, ok := m.GetConverseResponse().(*ConverseResponse_EventType_); ok { + return x.EventType + } + return ConverseResponse_EVENT_TYPE_UNSPECIFIED +} + +func (m *ConverseResponse) GetAudioOut() *AudioOut { + if x, ok := m.GetConverseResponse().(*ConverseResponse_AudioOut); ok { + return x.AudioOut + } + return nil +} + +func (m *ConverseResponse) GetResult() *ConverseResult { + if x, ok := m.GetConverseResponse().(*ConverseResponse_Result); ok { + return x.Result + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*ConverseResponse) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _ConverseResponse_OneofMarshaler, _ConverseResponse_OneofUnmarshaler, _ConverseResponse_OneofSizer, []interface{}{ + (*ConverseResponse_Error)(nil), + (*ConverseResponse_EventType_)(nil), + (*ConverseResponse_AudioOut)(nil), + (*ConverseResponse_Result)(nil), + } +} + +func _ConverseResponse_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*ConverseResponse) + // converse_response + switch x := m.ConverseResponse.(type) { + case *ConverseResponse_Error: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Error); err != nil { + return err + } + case *ConverseResponse_EventType_: + b.EncodeVarint(2<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.EventType)) + case *ConverseResponse_AudioOut: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.AudioOut); err != nil { + return err + } + case *ConverseResponse_Result: + b.EncodeVarint(5<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Result); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("ConverseResponse.ConverseResponse has unexpected type %T", x) + } + return nil +} + +func _ConverseResponse_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*ConverseResponse) + switch tag { + case 1: // converse_response.error + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(google_rpc.Status) + err := b.DecodeMessage(msg) + m.ConverseResponse = &ConverseResponse_Error{msg} + return true, err + case 2: // converse_response.event_type + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.ConverseResponse = &ConverseResponse_EventType_{ConverseResponse_EventType(x)} + return true, err + case 3: // converse_response.audio_out + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(AudioOut) + err := b.DecodeMessage(msg) + m.ConverseResponse = &ConverseResponse_AudioOut{msg} + return true, err + case 5: // converse_response.result + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ConverseResult) + err := b.DecodeMessage(msg) + m.ConverseResponse = &ConverseResponse_Result{msg} + return true, err + default: + return false, nil + } +} + +func _ConverseResponse_OneofSizer(msg proto.Message) (n int) { + m := msg.(*ConverseResponse) + // converse_response + switch x := m.ConverseResponse.(type) { + case *ConverseResponse_Error: + s := proto.Size(x.Error) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *ConverseResponse_EventType_: + n += proto.SizeVarint(2<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.EventType)) + case *ConverseResponse_AudioOut: + s := proto.Size(x.AudioOut) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *ConverseResponse_Result: + s := proto.Size(x.Result) + n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +func init() { + proto.RegisterType((*ConverseConfig)(nil), "google.assistant.embedded.v1alpha1.ConverseConfig") + proto.RegisterType((*AudioInConfig)(nil), "google.assistant.embedded.v1alpha1.AudioInConfig") + proto.RegisterType((*AudioOutConfig)(nil), "google.assistant.embedded.v1alpha1.AudioOutConfig") + proto.RegisterType((*ConverseState)(nil), "google.assistant.embedded.v1alpha1.ConverseState") + proto.RegisterType((*AudioOut)(nil), "google.assistant.embedded.v1alpha1.AudioOut") + proto.RegisterType((*ConverseResult)(nil), "google.assistant.embedded.v1alpha1.ConverseResult") + proto.RegisterType((*ConverseRequest)(nil), "google.assistant.embedded.v1alpha1.ConverseRequest") + proto.RegisterType((*ConverseResponse)(nil), "google.assistant.embedded.v1alpha1.ConverseResponse") + proto.RegisterEnum("google.assistant.embedded.v1alpha1.AudioInConfig_Encoding", AudioInConfig_Encoding_name, AudioInConfig_Encoding_value) + proto.RegisterEnum("google.assistant.embedded.v1alpha1.AudioOutConfig_Encoding", AudioOutConfig_Encoding_name, AudioOutConfig_Encoding_value) + proto.RegisterEnum("google.assistant.embedded.v1alpha1.ConverseResult_MicrophoneMode", ConverseResult_MicrophoneMode_name, ConverseResult_MicrophoneMode_value) + proto.RegisterEnum("google.assistant.embedded.v1alpha1.ConverseResponse_EventType", ConverseResponse_EventType_name, ConverseResponse_EventType_value) +} + +// 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 + +// Client API for EmbeddedAssistant service + +type EmbeddedAssistantClient interface { + // Initiates or continues a conversation with the embedded assistant service. + // Each call performs one round-trip, sending an audio request to the service + // and receiving the audio response. Uses bidirectional streaming to receive + // results, such as the `END_OF_UTTERANCE` event, while sending audio. + // + // A conversation is one or more gRPC connections, each consisting of several + // streamed requests and responses. + // For example, the user says *Add to my shopping list* and the assistant + // responds *What do you want to add?*. The sequence of streamed requests and + // responses in the first gRPC message could be: + // + // * ConverseRequest.config + // * ConverseRequest.audio_in + // * ConverseRequest.audio_in + // * ConverseRequest.audio_in + // * ConverseRequest.audio_in + // * ConverseResponse.event_type.END_OF_UTTERANCE + // * ConverseResponse.result.microphone_mode.DIALOG_FOLLOW_ON + // * ConverseResponse.audio_out + // * ConverseResponse.audio_out + // * ConverseResponse.audio_out + // + // The user then says *bagels* and the assistant responds + // *OK, I've added bagels to your shopping list*. This is sent as another gRPC + // connection call to the `Converse` method, again with streamed requests and + // responses, such as: + // + // * ConverseRequest.config + // * ConverseRequest.audio_in + // * ConverseRequest.audio_in + // * ConverseRequest.audio_in + // * ConverseResponse.event_type.END_OF_UTTERANCE + // * ConverseResponse.result.microphone_mode.CLOSE_MICROPHONE + // * ConverseResponse.audio_out + // * ConverseResponse.audio_out + // * ConverseResponse.audio_out + // * ConverseResponse.audio_out + // + // Although the precise order of responses is not guaranteed, sequential + // ConverseResponse.audio_out messages will always contain sequential portions + // of audio. + Converse(ctx context.Context, opts ...grpc.CallOption) (EmbeddedAssistant_ConverseClient, error) +} + +type embeddedAssistantClient struct { + cc *grpc.ClientConn +} + +func NewEmbeddedAssistantClient(cc *grpc.ClientConn) EmbeddedAssistantClient { + return &embeddedAssistantClient{cc} +} + +func (c *embeddedAssistantClient) Converse(ctx context.Context, opts ...grpc.CallOption) (EmbeddedAssistant_ConverseClient, error) { + stream, err := grpc.NewClientStream(ctx, &_EmbeddedAssistant_serviceDesc.Streams[0], c.cc, "/google.assistant.embedded.v1alpha1.EmbeddedAssistant/Converse", opts...) + if err != nil { + return nil, err + } + x := &embeddedAssistantConverseClient{stream} + return x, nil +} + +type EmbeddedAssistant_ConverseClient interface { + Send(*ConverseRequest) error + Recv() (*ConverseResponse, error) + grpc.ClientStream +} + +type embeddedAssistantConverseClient struct { + grpc.ClientStream +} + +func (x *embeddedAssistantConverseClient) Send(m *ConverseRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *embeddedAssistantConverseClient) Recv() (*ConverseResponse, error) { + m := new(ConverseResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// Server API for EmbeddedAssistant service + +type EmbeddedAssistantServer interface { + // Initiates or continues a conversation with the embedded assistant service. + // Each call performs one round-trip, sending an audio request to the service + // and receiving the audio response. Uses bidirectional streaming to receive + // results, such as the `END_OF_UTTERANCE` event, while sending audio. + // + // A conversation is one or more gRPC connections, each consisting of several + // streamed requests and responses. + // For example, the user says *Add to my shopping list* and the assistant + // responds *What do you want to add?*. The sequence of streamed requests and + // responses in the first gRPC message could be: + // + // * ConverseRequest.config + // * ConverseRequest.audio_in + // * ConverseRequest.audio_in + // * ConverseRequest.audio_in + // * ConverseRequest.audio_in + // * ConverseResponse.event_type.END_OF_UTTERANCE + // * ConverseResponse.result.microphone_mode.DIALOG_FOLLOW_ON + // * ConverseResponse.audio_out + // * ConverseResponse.audio_out + // * ConverseResponse.audio_out + // + // The user then says *bagels* and the assistant responds + // *OK, I've added bagels to your shopping list*. This is sent as another gRPC + // connection call to the `Converse` method, again with streamed requests and + // responses, such as: + // + // * ConverseRequest.config + // * ConverseRequest.audio_in + // * ConverseRequest.audio_in + // * ConverseRequest.audio_in + // * ConverseResponse.event_type.END_OF_UTTERANCE + // * ConverseResponse.result.microphone_mode.CLOSE_MICROPHONE + // * ConverseResponse.audio_out + // * ConverseResponse.audio_out + // * ConverseResponse.audio_out + // * ConverseResponse.audio_out + // + // Although the precise order of responses is not guaranteed, sequential + // ConverseResponse.audio_out messages will always contain sequential portions + // of audio. + Converse(EmbeddedAssistant_ConverseServer) error +} + +func RegisterEmbeddedAssistantServer(s *grpc.Server, srv EmbeddedAssistantServer) { + s.RegisterService(&_EmbeddedAssistant_serviceDesc, srv) +} + +func _EmbeddedAssistant_Converse_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(EmbeddedAssistantServer).Converse(&embeddedAssistantConverseServer{stream}) +} + +type EmbeddedAssistant_ConverseServer interface { + Send(*ConverseResponse) error + Recv() (*ConverseRequest, error) + grpc.ServerStream +} + +type embeddedAssistantConverseServer struct { + grpc.ServerStream +} + +func (x *embeddedAssistantConverseServer) Send(m *ConverseResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *embeddedAssistantConverseServer) Recv() (*ConverseRequest, error) { + m := new(ConverseRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +var _EmbeddedAssistant_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.assistant.embedded.v1alpha1.EmbeddedAssistant", + HandlerType: (*EmbeddedAssistantServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "Converse", + Handler: _EmbeddedAssistant_Converse_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "google/assistant/embedded/v1alpha1/embedded_assistant.proto", +} + +func init() { + proto.RegisterFile("google/assistant/embedded/v1alpha1/embedded_assistant.proto", fileDescriptor0) +} + +var fileDescriptor0 = []byte{ + // 892 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0x51, 0x73, 0xdb, 0x44, + 0x10, 0xb6, 0xec, 0xa6, 0xb5, 0xb7, 0x89, 0x2c, 0x5f, 0x33, 0x90, 0x49, 0x61, 0x60, 0xf4, 0xc0, + 0x94, 0x02, 0x72, 0xe3, 0x30, 0x3c, 0x10, 0xe8, 0x8c, 0x63, 0x2b, 0xb1, 0xc1, 0x96, 0x3c, 0x67, + 0xa7, 0xa5, 0x0c, 0xcc, 0xcd, 0x55, 0x3e, 0x1c, 0x81, 0x7d, 0x27, 0xa4, 0x73, 0xa6, 0xe1, 0x07, + 0xf0, 0xd8, 0xe1, 0x95, 0x67, 0x7e, 0x11, 0xff, 0x88, 0xd1, 0x9d, 0xa4, 0xd8, 0x90, 0x42, 0x1c, + 0x1e, 0x6f, 0xf7, 0xbe, 0x4f, 0xbb, 0xdf, 0x7e, 0xb7, 0x23, 0x38, 0x9a, 0x09, 0x31, 0x9b, 0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4, 0x38, 0xfe, 0xd5, 0x80, 0x0f, 0x02, + 0xb1, 0xb8, 0x01, 0xfe, 0xd8, 0x2c, 0x0a, 0x1e, 0xa5, 0xff, 0x00, 0x23, 0xe3, 0xdb, 0xaf, 0x32, + 0xd4, 0x4c, 0xcc, 0x29, 0x9f, 0x39, 0x22, 0x9e, 0x35, 0x67, 0x8c, 0xab, 0x3f, 0x84, 0xa6, 0x4e, + 0xd1, 0x28, 0x4c, 0xfe, 0xed, 0xe7, 0xe5, 0x28, 0x8f, 0xbc, 0xbc, 0xab, 0x60, 0x87, 0x7f, 0x05, + 0x00, 0x00, 0xff, 0xff, 0xec, 0x7a, 0x68, 0xfa, 0xf2, 0x08, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/bigtable/admin/cluster/v1/bigtable_cluster_data.pb.go b/vendor/google.golang.org/genproto/googleapis/bigtable/admin/cluster/v1/bigtable_cluster_data.pb.go new file mode 100644 index 0000000000..90fbe3020c --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/bigtable/admin/cluster/v1/bigtable_cluster_data.pb.go @@ -0,0 +1,252 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/bigtable/admin/cluster/v1/bigtable_cluster_data.proto + +/* +Package cluster is a generated protocol buffer package. + +It is generated from these files: + google/bigtable/admin/cluster/v1/bigtable_cluster_data.proto + google/bigtable/admin/cluster/v1/bigtable_cluster_service.proto + google/bigtable/admin/cluster/v1/bigtable_cluster_service_messages.proto + +It has these top-level messages: + Zone + Cluster + ListZonesRequest + ListZonesResponse + GetClusterRequest + ListClustersRequest + ListClustersResponse + CreateClusterRequest + CreateClusterMetadata + UpdateClusterMetadata + DeleteClusterRequest + UndeleteClusterRequest + UndeleteClusterMetadata + V2OperationMetadata +*/ +package cluster + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_longrunning "google.golang.org/genproto/googleapis/longrunning" +import _ "github.com/golang/protobuf/ptypes/timestamp" + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +type StorageType int32 + +const ( + // The storage type used is unspecified. + StorageType_STORAGE_UNSPECIFIED StorageType = 0 + // Data will be stored in SSD, providing low and consistent latencies. + StorageType_STORAGE_SSD StorageType = 1 + // Data will be stored in HDD, providing high and less predictable + // latencies. + StorageType_STORAGE_HDD StorageType = 2 +) + +var StorageType_name = map[int32]string{ + 0: "STORAGE_UNSPECIFIED", + 1: "STORAGE_SSD", + 2: "STORAGE_HDD", +} +var StorageType_value = map[string]int32{ + "STORAGE_UNSPECIFIED": 0, + "STORAGE_SSD": 1, + "STORAGE_HDD": 2, +} + +func (x StorageType) String() string { + return proto.EnumName(StorageType_name, int32(x)) +} +func (StorageType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +// Possible states of a zone. +type Zone_Status int32 + +const ( + // The state of the zone is unknown or unspecified. + Zone_UNKNOWN Zone_Status = 0 + // The zone is in a good state. + Zone_OK Zone_Status = 1 + // The zone is down for planned maintenance. + Zone_PLANNED_MAINTENANCE Zone_Status = 2 + // The zone is down for emergency or unplanned maintenance. + Zone_EMERGENCY_MAINENANCE Zone_Status = 3 +) + +var Zone_Status_name = map[int32]string{ + 0: "UNKNOWN", + 1: "OK", + 2: "PLANNED_MAINTENANCE", + 3: "EMERGENCY_MAINENANCE", +} +var Zone_Status_value = map[string]int32{ + "UNKNOWN": 0, + "OK": 1, + "PLANNED_MAINTENANCE": 2, + "EMERGENCY_MAINENANCE": 3, +} + +func (x Zone_Status) String() string { + return proto.EnumName(Zone_Status_name, int32(x)) +} +func (Zone_Status) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 0} } + +// A physical location in which a particular project can allocate Cloud BigTable +// resources. +type Zone struct { + // A permanent unique identifier for the zone. + // Values are of the form projects//zones/[a-z][-a-z0-9]* + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The name of this zone as it appears in UIs. + DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName" json:"display_name,omitempty"` + // The current state of this zone. + Status Zone_Status `protobuf:"varint,3,opt,name=status,enum=google.bigtable.admin.cluster.v1.Zone_Status" json:"status,omitempty"` +} + +func (m *Zone) Reset() { *m = Zone{} } +func (m *Zone) String() string { return proto.CompactTextString(m) } +func (*Zone) ProtoMessage() {} +func (*Zone) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *Zone) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Zone) GetDisplayName() string { + if m != nil { + return m.DisplayName + } + return "" +} + +func (m *Zone) GetStatus() Zone_Status { + if m != nil { + return m.Status + } + return Zone_UNKNOWN +} + +// An isolated set of Cloud BigTable resources on which tables can be hosted. +type Cluster struct { + // A permanent unique identifier for the cluster. For technical reasons, the + // zone in which the cluster resides is included here. + // Values are of the form + // projects//zones//clusters/[a-z][-a-z0-9]* + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The operation currently running on the cluster, if any. + // This cannot be set directly, only through CreateCluster, UpdateCluster, + // or UndeleteCluster. Calls to these methods will be rejected if + // "current_operation" is already set. + CurrentOperation *google_longrunning.Operation `protobuf:"bytes,3,opt,name=current_operation,json=currentOperation" json:"current_operation,omitempty"` + // The descriptive name for this cluster as it appears in UIs. + // Must be unique per zone. + DisplayName string `protobuf:"bytes,4,opt,name=display_name,json=displayName" json:"display_name,omitempty"` + // The number of serve nodes allocated to this cluster. + ServeNodes int32 `protobuf:"varint,5,opt,name=serve_nodes,json=serveNodes" json:"serve_nodes,omitempty"` + // What storage type to use for tables in this cluster. Only configurable at + // cluster creation time. If unspecified, STORAGE_SSD will be used. + DefaultStorageType StorageType `protobuf:"varint,8,opt,name=default_storage_type,json=defaultStorageType,enum=google.bigtable.admin.cluster.v1.StorageType" json:"default_storage_type,omitempty"` +} + +func (m *Cluster) Reset() { *m = Cluster{} } +func (m *Cluster) String() string { return proto.CompactTextString(m) } +func (*Cluster) ProtoMessage() {} +func (*Cluster) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *Cluster) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Cluster) GetCurrentOperation() *google_longrunning.Operation { + if m != nil { + return m.CurrentOperation + } + return nil +} + +func (m *Cluster) GetDisplayName() string { + if m != nil { + return m.DisplayName + } + return "" +} + +func (m *Cluster) GetServeNodes() int32 { + if m != nil { + return m.ServeNodes + } + return 0 +} + +func (m *Cluster) GetDefaultStorageType() StorageType { + if m != nil { + return m.DefaultStorageType + } + return StorageType_STORAGE_UNSPECIFIED +} + +func init() { + proto.RegisterType((*Zone)(nil), "google.bigtable.admin.cluster.v1.Zone") + proto.RegisterType((*Cluster)(nil), "google.bigtable.admin.cluster.v1.Cluster") + proto.RegisterEnum("google.bigtable.admin.cluster.v1.StorageType", StorageType_name, StorageType_value) + proto.RegisterEnum("google.bigtable.admin.cluster.v1.Zone_Status", Zone_Status_name, Zone_Status_value) +} + +func init() { + proto.RegisterFile("google/bigtable/admin/cluster/v1/bigtable_cluster_data.proto", fileDescriptor0) +} + +var fileDescriptor0 = []byte{ + // 493 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0xd1, 0x6e, 0xd3, 0x3c, + 0x1c, 0xc5, 0x97, 0xae, 0xeb, 0xbe, 0xcf, 0x41, 0x10, 0xcc, 0x24, 0xa2, 0x09, 0xb4, 0x52, 0xb8, + 0xa8, 0x90, 0x70, 0xb4, 0x71, 0x09, 0x37, 0x6d, 0x63, 0xba, 0x32, 0xe6, 0x56, 0x49, 0x27, 0xc4, + 0x6e, 0x2c, 0xb7, 0xf5, 0xac,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c, 0xad, + 0x91, 0xa6, 0x71, 0xe0, 0xed, 0x0b, 0x97, 0x71, 0x1c, 0x34, 0xfa, 0xdf, 0x3d, 0xf0, 0x66, 0xae, + 0x96, 0x0f, 0xfe, 0xa4, 0x7e, 0xd8, 0x77, 0x96, 0xfb, 0x23, 0x62, 0x66, 0xd8, 0x64, 0xf3, 0xec, + 0x26, 0xde, 0xed, 0xd0, 0xd1, 0x42, 0xe5, 0x4c, 0x0a, 0xa4, 0x4a, 0x11, 0x09, 0x2e, 0xed, 0xa3, + 0x8c, 0x6a, 0x8b, 0x15, 0x99, 0xfe, 0xfb, 0xb7, 0xf5, 0xc1, 0x2d, 0x67, 0x2d, 0xcb, 0xbc, 0xff, + 0x15, 0x00, 0x00, 0xff, 0xff, 0xc9, 0x27, 0x25, 0xa6, 0x8e, 0x03, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/bigtable/admin/cluster/v1/bigtable_cluster_service.pb.go b/vendor/google.golang.org/genproto/googleapis/bigtable/admin/cluster/v1/bigtable_cluster_service.pb.go new file mode 100644 index 0000000000..bfc7f2fc7b --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/bigtable/admin/cluster/v1/bigtable_cluster_service.pb.go @@ -0,0 +1,472 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/bigtable/admin/cluster/v1/bigtable_cluster_service.proto + +package cluster + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_longrunning "google.golang.org/genproto/googleapis/longrunning" +import google_protobuf2 "github.com/golang/protobuf/ptypes/empty" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// 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 + +// Client API for BigtableClusterService service + +type BigtableClusterServiceClient interface { + // Lists the supported zones for the given project. + ListZones(ctx context.Context, in *ListZonesRequest, opts ...grpc.CallOption) (*ListZonesResponse, error) + // Gets information about a particular cluster. + GetCluster(ctx context.Context, in *GetClusterRequest, opts ...grpc.CallOption) (*Cluster, error) + // Lists all clusters in the given project, along with any zones for which + // cluster information could not be retrieved. + ListClusters(ctx context.Context, in *ListClustersRequest, opts ...grpc.CallOption) (*ListClustersResponse, error) + // Creates a cluster and begins preparing it to begin serving. The returned + // cluster embeds as its "current_operation" a long-running operation which + // can be used to track the progress of turning up the new cluster. + // Immediately upon completion of this request: + // * The cluster will be readable via the API, with all requested attributes + // but no allocated resources. + // Until completion of the embedded operation: + // * Cancelling the operation will render the cluster immediately unreadable + // via the API. + // * All other attempts to modify or delete the cluster will be rejected. + // Upon completion of the embedded operation: + // * Billing for all successfully-allocated resources will begin (some types + // may have lower than the requested levels). + // * New tables can be created in the cluster. + // * The cluster's allocated resource levels will be readable via the API. + // The embedded operation's "metadata" field type is + // [CreateClusterMetadata][google.bigtable.admin.cluster.v1.CreateClusterMetadata] The embedded operation's "response" field type is + // [Cluster][google.bigtable.admin.cluster.v1.Cluster], if successful. + CreateCluster(ctx context.Context, in *CreateClusterRequest, opts ...grpc.CallOption) (*Cluster, error) + // Updates a cluster, and begins allocating or releasing resources as + // requested. The returned cluster embeds as its "current_operation" a + // long-running operation which can be used to track the progress of updating + // the cluster. + // Immediately upon completion of this request: + // * For resource types where a decrease in the cluster's allocation has been + // requested, billing will be based on the newly-requested level. + // Until completion of the embedded operation: + // * Cancelling the operation will set its metadata's "cancelled_at_time", + // and begin restoring resources to their pre-request values. The operation + // is guaranteed to succeed at undoing all resource changes, after which + // point it will terminate with a CANCELLED status. + // * All other attempts to modify or delete the cluster will be rejected. + // * Reading the cluster via the API will continue to give the pre-request + // resource levels. + // Upon completion of the embedded operation: + // * Billing will begin for all successfully-allocated resources (some types + // may have lower than the requested levels). + // * All newly-reserved resources will be available for serving the cluster's + // tables. + // * The cluster's new resource levels will be readable via the API. + // [UpdateClusterMetadata][google.bigtable.admin.cluster.v1.UpdateClusterMetadata] The embedded operation's "response" field type is + // [Cluster][google.bigtable.admin.cluster.v1.Cluster], if successful. + UpdateCluster(ctx context.Context, in *Cluster, opts ...grpc.CallOption) (*Cluster, error) + // Marks a cluster and all of its tables for permanent deletion in 7 days. + // Immediately upon completion of the request: + // * Billing will cease for all of the cluster's reserved resources. + // * The cluster's "delete_time" field will be set 7 days in the future. + // Soon afterward: + // * All tables within the cluster will become unavailable. + // Prior to the cluster's "delete_time": + // * The cluster can be recovered with a call to UndeleteCluster. + // * All other attempts to modify or delete the cluster will be rejected. + // At the cluster's "delete_time": + // * The cluster and *all of its tables* will immediately and irrevocably + // disappear from the API, and their data will be permanently deleted. + DeleteCluster(ctx context.Context, in *DeleteClusterRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) + // Cancels the scheduled deletion of an cluster and begins preparing it to + // resume serving. The returned operation will also be embedded as the + // cluster's "current_operation". + // Immediately upon completion of this request: + // * The cluster's "delete_time" field will be unset, protecting it from + // automatic deletion. + // Until completion of the returned operation: + // * The operation cannot be cancelled. + // Upon completion of the returned operation: + // * Billing for the cluster's resources will resume. + // * All tables within the cluster will be available. + // [UndeleteClusterMetadata][google.bigtable.admin.cluster.v1.UndeleteClusterMetadata] The embedded operation's "response" field type is + // [Cluster][google.bigtable.admin.cluster.v1.Cluster], if successful. + UndeleteCluster(ctx context.Context, in *UndeleteClusterRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) +} + +type bigtableClusterServiceClient struct { + cc *grpc.ClientConn +} + +func NewBigtableClusterServiceClient(cc *grpc.ClientConn) BigtableClusterServiceClient { + return &bigtableClusterServiceClient{cc} +} + +func (c *bigtableClusterServiceClient) ListZones(ctx context.Context, in *ListZonesRequest, opts ...grpc.CallOption) (*ListZonesResponse, error) { + out := new(ListZonesResponse) + err := grpc.Invoke(ctx, "/google.bigtable.admin.cluster.v1.BigtableClusterService/ListZones", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bigtableClusterServiceClient) GetCluster(ctx context.Context, in *GetClusterRequest, opts ...grpc.CallOption) (*Cluster, error) { + out := new(Cluster) + err := grpc.Invoke(ctx, "/google.bigtable.admin.cluster.v1.BigtableClusterService/GetCluster", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bigtableClusterServiceClient) ListClusters(ctx context.Context, in *ListClustersRequest, opts ...grpc.CallOption) (*ListClustersResponse, error) { + out := new(ListClustersResponse) + err := grpc.Invoke(ctx, "/google.bigtable.admin.cluster.v1.BigtableClusterService/ListClusters", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bigtableClusterServiceClient) CreateCluster(ctx context.Context, in *CreateClusterRequest, opts ...grpc.CallOption) (*Cluster, error) { + out := new(Cluster) + err := grpc.Invoke(ctx, "/google.bigtable.admin.cluster.v1.BigtableClusterService/CreateCluster", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bigtableClusterServiceClient) UpdateCluster(ctx context.Context, in *Cluster, opts ...grpc.CallOption) (*Cluster, error) { + out := new(Cluster) + err := grpc.Invoke(ctx, "/google.bigtable.admin.cluster.v1.BigtableClusterService/UpdateCluster", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bigtableClusterServiceClient) DeleteCluster(ctx context.Context, in *DeleteClusterRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) { + out := new(google_protobuf2.Empty) + err := grpc.Invoke(ctx, "/google.bigtable.admin.cluster.v1.BigtableClusterService/DeleteCluster", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bigtableClusterServiceClient) UndeleteCluster(ctx context.Context, in *UndeleteClusterRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.bigtable.admin.cluster.v1.BigtableClusterService/UndeleteCluster", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for BigtableClusterService service + +type BigtableClusterServiceServer interface { + // Lists the supported zones for the given project. + ListZones(context.Context, *ListZonesRequest) (*ListZonesResponse, error) + // Gets information about a particular cluster. + GetCluster(context.Context, *GetClusterRequest) (*Cluster, error) + // Lists all clusters in the given project, along with any zones for which + // cluster information could not be retrieved. + ListClusters(context.Context, *ListClustersRequest) (*ListClustersResponse, error) + // Creates a cluster and begins preparing it to begin serving. The returned + // cluster embeds as its "current_operation" a long-running operation which + // can be used to track the progress of turning up the new cluster. + // Immediately upon completion of this request: + // * The cluster will be readable via the API, with all requested attributes + // but no allocated resources. + // Until completion of the embedded operation: + // * Cancelling the operation will render the cluster immediately unreadable + // via the API. + // * All other attempts to modify or delete the cluster will be rejected. + // Upon completion of the embedded operation: + // * Billing for all successfully-allocated resources will begin (some types + // may have lower than the requested levels). + // * New tables can be created in the cluster. + // * The cluster's allocated resource levels will be readable via the API. + // The embedded operation's "metadata" field type is + // [CreateClusterMetadata][google.bigtable.admin.cluster.v1.CreateClusterMetadata] The embedded operation's "response" field type is + // [Cluster][google.bigtable.admin.cluster.v1.Cluster], if successful. + CreateCluster(context.Context, *CreateClusterRequest) (*Cluster, error) + // Updates a cluster, and begins allocating or releasing resources as + // requested. The returned cluster embeds as its "current_operation" a + // long-running operation which can be used to track the progress of updating + // the cluster. + // Immediately upon completion of this request: + // * For resource types where a decrease in the cluster's allocation has been + // requested, billing will be based on the newly-requested level. + // Until completion of the embedded operation: + // * Cancelling the operation will set its metadata's "cancelled_at_time", + // and begin restoring resources to their pre-request values. The operation + // is guaranteed to succeed at undoing all resource changes, after which + // point it will terminate with a CANCELLED status. + // * All other attempts to modify or delete the cluster will be rejected. + // * Reading the cluster via the API will continue to give the pre-request + // resource levels. + // Upon completion of the embedded operation: + // * Billing will begin for all successfully-allocated resources (some types + // may have lower than the requested levels). + // * All newly-reserved resources will be available for serving the cluster's + // tables. + // * The cluster's new resource levels will be readable via the API. + // [UpdateClusterMetadata][google.bigtable.admin.cluster.v1.UpdateClusterMetadata] The embedded operation's "response" field type is + // [Cluster][google.bigtable.admin.cluster.v1.Cluster], if successful. + UpdateCluster(context.Context, *Cluster) (*Cluster, error) + // Marks a cluster and all of its tables for permanent deletion in 7 days. + // Immediately upon completion of the request: + // * Billing will cease for all of the cluster's reserved resources. + // * The cluster's "delete_time" field will be set 7 days in the future. + // Soon afterward: + // * All tables within the cluster will become unavailable. + // Prior to the cluster's "delete_time": + // * The cluster can be recovered with a call to UndeleteCluster. + // * All other attempts to modify or delete the cluster will be rejected. + // At the cluster's "delete_time": + // * The cluster and *all of its tables* will immediately and irrevocably + // disappear from the API, and their data will be permanently deleted. + DeleteCluster(context.Context, *DeleteClusterRequest) (*google_protobuf2.Empty, error) + // Cancels the scheduled deletion of an cluster and begins preparing it to + // resume serving. The returned operation will also be embedded as the + // cluster's "current_operation". + // Immediately upon completion of this request: + // * The cluster's "delete_time" field will be unset, protecting it from + // automatic deletion. + // Until completion of the returned operation: + // * The operation cannot be cancelled. + // Upon completion of the returned operation: + // * Billing for the cluster's resources will resume. + // * All tables within the cluster will be available. + // [UndeleteClusterMetadata][google.bigtable.admin.cluster.v1.UndeleteClusterMetadata] The embedded operation's "response" field type is + // [Cluster][google.bigtable.admin.cluster.v1.Cluster], if successful. + UndeleteCluster(context.Context, *UndeleteClusterRequest) (*google_longrunning.Operation, error) +} + +func RegisterBigtableClusterServiceServer(s *grpc.Server, srv BigtableClusterServiceServer) { + s.RegisterService(&_BigtableClusterService_serviceDesc, srv) +} + +func _BigtableClusterService_ListZones_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListZonesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BigtableClusterServiceServer).ListZones(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.bigtable.admin.cluster.v1.BigtableClusterService/ListZones", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BigtableClusterServiceServer).ListZones(ctx, req.(*ListZonesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BigtableClusterService_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.(BigtableClusterServiceServer).GetCluster(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.bigtable.admin.cluster.v1.BigtableClusterService/GetCluster", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BigtableClusterServiceServer).GetCluster(ctx, req.(*GetClusterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BigtableClusterService_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.(BigtableClusterServiceServer).ListClusters(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.bigtable.admin.cluster.v1.BigtableClusterService/ListClusters", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BigtableClusterServiceServer).ListClusters(ctx, req.(*ListClustersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BigtableClusterService_CreateCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateClusterRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BigtableClusterServiceServer).CreateCluster(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.bigtable.admin.cluster.v1.BigtableClusterService/CreateCluster", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BigtableClusterServiceServer).CreateCluster(ctx, req.(*CreateClusterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BigtableClusterService_UpdateCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Cluster) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BigtableClusterServiceServer).UpdateCluster(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.bigtable.admin.cluster.v1.BigtableClusterService/UpdateCluster", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BigtableClusterServiceServer).UpdateCluster(ctx, req.(*Cluster)) + } + return interceptor(ctx, in, info, handler) +} + +func _BigtableClusterService_DeleteCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteClusterRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BigtableClusterServiceServer).DeleteCluster(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.bigtable.admin.cluster.v1.BigtableClusterService/DeleteCluster", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BigtableClusterServiceServer).DeleteCluster(ctx, req.(*DeleteClusterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BigtableClusterService_UndeleteCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UndeleteClusterRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BigtableClusterServiceServer).UndeleteCluster(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.bigtable.admin.cluster.v1.BigtableClusterService/UndeleteCluster", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BigtableClusterServiceServer).UndeleteCluster(ctx, req.(*UndeleteClusterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _BigtableClusterService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.bigtable.admin.cluster.v1.BigtableClusterService", + HandlerType: (*BigtableClusterServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListZones", + Handler: _BigtableClusterService_ListZones_Handler, + }, + { + MethodName: "GetCluster", + Handler: _BigtableClusterService_GetCluster_Handler, + }, + { + MethodName: "ListClusters", + Handler: _BigtableClusterService_ListClusters_Handler, + }, + { + MethodName: "CreateCluster", + Handler: _BigtableClusterService_CreateCluster_Handler, + }, + { + MethodName: "UpdateCluster", + Handler: _BigtableClusterService_UpdateCluster_Handler, + }, + { + MethodName: "DeleteCluster", + Handler: _BigtableClusterService_DeleteCluster_Handler, + }, + { + MethodName: "UndeleteCluster", + Handler: _BigtableClusterService_UndeleteCluster_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/bigtable/admin/cluster/v1/bigtable_cluster_service.proto", +} + +func init() { + proto.RegisterFile("google/bigtable/admin/cluster/v1/bigtable_cluster_service.proto", fileDescriptor1) +} + +var fileDescriptor1 = []byte{ + // 515 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0x4f, 0x6b, 0x14, 0x31, + 0x18, 0xc6, 0x89, 0x07, 0xa1, 0xc1, 0x45, 0xc8, 0xa1, 0x87, 0x6d, 0x0b, 0x32, 0x15, 0xb1, 0x23, + 0x26, 0x6e, 0x17, 0xc5, 0xbf, 0x08, 0x5b, 0xa5, 0x1e, 0x04, 0x8b, 0xd2, 0x4b, 0x2f, 0x4b, 0x76, + 0xe7, 0x35, 0x8c, 0xcc, 0x24, 0x31, 0xc9, 0x2c, 0xa8, 0xf4, 0xe2, 0xcd, 0x93, 0x88, 0x27, 0x3d, + 0x78, 0xeb, 0xdd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0xea, 0x1f, 0x49, + 0xe4, 0xda, 0x8a, 0xca, 0x53, 0x43, 0x87, 0xbe, 0x88, 0x43, 0x27, 0xb9, 0xe7, 0xf1, 0x86, 0xc9, + 0xa0, 0x75, 0x6a, 0x55, 0xf0, 0x19, 0x7d, 0x46, 0xf8, 0xea, 0x54, 0x95, 0x2b, 0xc9, 0x46, 0x9b, + 0xcb, 0x27, 0x96, 0x3d, 0xa8, 0x93, 0x3a, 0x40, 0x47, 0xfb, 0xa1, 0x83, 0x50, 0x05, 0x97, 0x82, + 0x2a, 0x23, 0x98, 0x00, 0xe9, 0x73, 0x64, 0xcd, 0x12, 0xd7, 0xb9, 0xfd, 0xff, 0xfc, 0x7d, 0x10, + 0x1e, 0x27, 0x17, 0xbd, 0x66, 0xf8, 0x27, 0x00, 0x00, 0xff, 0xff, 0x50, 0x92, 0x91, 0x86, 0x71, + 0x06, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/bigtable/admin/cluster/v1/bigtable_cluster_service_messages.pb.go b/vendor/google.golang.org/genproto/googleapis/bigtable/admin/cluster/v1/bigtable_cluster_service_messages.pb.go new file mode 100644 index 0000000000..1f993aa20b --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/bigtable/admin/cluster/v1/bigtable_cluster_service_messages.pb.go @@ -0,0 +1,376 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/bigtable/admin/cluster/v1/bigtable_cluster_service_messages.proto + +package cluster + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import google_protobuf3 "github.com/golang/protobuf/ptypes/timestamp" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Request message for BigtableClusterService.ListZones. +type ListZonesRequest struct { + // The unique name of the project for which a list of supported zones is + // requested. + // Values are of the form projects/ + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *ListZonesRequest) Reset() { *m = ListZonesRequest{} } +func (m *ListZonesRequest) String() string { return proto.CompactTextString(m) } +func (*ListZonesRequest) ProtoMessage() {} +func (*ListZonesRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} } + +func (m *ListZonesRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Response message for BigtableClusterService.ListZones. +type ListZonesResponse struct { + // The list of requested zones. + Zones []*Zone `protobuf:"bytes,1,rep,name=zones" json:"zones,omitempty"` +} + +func (m *ListZonesResponse) Reset() { *m = ListZonesResponse{} } +func (m *ListZonesResponse) String() string { return proto.CompactTextString(m) } +func (*ListZonesResponse) ProtoMessage() {} +func (*ListZonesResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{1} } + +func (m *ListZonesResponse) GetZones() []*Zone { + if m != nil { + return m.Zones + } + return nil +} + +// Request message for BigtableClusterService.GetCluster. +type GetClusterRequest struct { + // The unique name of the requested cluster. + // Values are of the form projects//zones//clusters/ + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetClusterRequest) Reset() { *m = GetClusterRequest{} } +func (m *GetClusterRequest) String() string { return proto.CompactTextString(m) } +func (*GetClusterRequest) ProtoMessage() {} +func (*GetClusterRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{2} } + +func (m *GetClusterRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Request message for BigtableClusterService.ListClusters. +type ListClustersRequest struct { + // The unique name of the project for which a list of clusters is requested. + // Values are of the form projects/ + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *ListClustersRequest) Reset() { *m = ListClustersRequest{} } +func (m *ListClustersRequest) String() string { return proto.CompactTextString(m) } +func (*ListClustersRequest) ProtoMessage() {} +func (*ListClustersRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{3} } + +func (m *ListClustersRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Response message for BigtableClusterService.ListClusters. +type ListClustersResponse struct { + // The list of requested Clusters. + Clusters []*Cluster `protobuf:"bytes,1,rep,name=clusters" json:"clusters,omitempty"` + // The zones for which clusters could not be retrieved. + FailedZones []*Zone `protobuf:"bytes,2,rep,name=failed_zones,json=failedZones" json:"failed_zones,omitempty"` +} + +func (m *ListClustersResponse) Reset() { *m = ListClustersResponse{} } +func (m *ListClustersResponse) String() string { return proto.CompactTextString(m) } +func (*ListClustersResponse) ProtoMessage() {} +func (*ListClustersResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{4} } + +func (m *ListClustersResponse) GetClusters() []*Cluster { + if m != nil { + return m.Clusters + } + return nil +} + +func (m *ListClustersResponse) GetFailedZones() []*Zone { + if m != nil { + return m.FailedZones + } + return nil +} + +// Request message for BigtableClusterService.CreateCluster. +type CreateClusterRequest struct { + // The unique name of the zone in which to create the cluster. + // Values are of the form projects//zones/ + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The id to be used when referring to the new cluster within its zone, + // e.g. just the "test-cluster" section of the full name + // "projects//zones//clusters/test-cluster". + ClusterId string `protobuf:"bytes,2,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The cluster to create. + // The "name", "delete_time", and "current_operation" fields must be left + // blank. + Cluster *Cluster `protobuf:"bytes,3,opt,name=cluster" json:"cluster,omitempty"` +} + +func (m *CreateClusterRequest) Reset() { *m = CreateClusterRequest{} } +func (m *CreateClusterRequest) String() string { return proto.CompactTextString(m) } +func (*CreateClusterRequest) ProtoMessage() {} +func (*CreateClusterRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{5} } + +func (m *CreateClusterRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *CreateClusterRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *CreateClusterRequest) GetCluster() *Cluster { + if m != nil { + return m.Cluster + } + return nil +} + +// Metadata type for the operation returned by +// BigtableClusterService.CreateCluster. +type CreateClusterMetadata struct { + // The request which prompted the creation of this operation. + OriginalRequest *CreateClusterRequest `protobuf:"bytes,1,opt,name=original_request,json=originalRequest" json:"original_request,omitempty"` + // The time at which original_request was received. + RequestTime *google_protobuf3.Timestamp `protobuf:"bytes,2,opt,name=request_time,json=requestTime" json:"request_time,omitempty"` + // The time at which this operation failed or was completed successfully. + FinishTime *google_protobuf3.Timestamp `protobuf:"bytes,3,opt,name=finish_time,json=finishTime" json:"finish_time,omitempty"` +} + +func (m *CreateClusterMetadata) Reset() { *m = CreateClusterMetadata{} } +func (m *CreateClusterMetadata) String() string { return proto.CompactTextString(m) } +func (*CreateClusterMetadata) ProtoMessage() {} +func (*CreateClusterMetadata) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{6} } + +func (m *CreateClusterMetadata) GetOriginalRequest() *CreateClusterRequest { + if m != nil { + return m.OriginalRequest + } + return nil +} + +func (m *CreateClusterMetadata) GetRequestTime() *google_protobuf3.Timestamp { + if m != nil { + return m.RequestTime + } + return nil +} + +func (m *CreateClusterMetadata) GetFinishTime() *google_protobuf3.Timestamp { + if m != nil { + return m.FinishTime + } + return nil +} + +// Metadata type for the operation returned by +// BigtableClusterService.UpdateCluster. +type UpdateClusterMetadata struct { + // The request which prompted the creation of this operation. + OriginalRequest *Cluster `protobuf:"bytes,1,opt,name=original_request,json=originalRequest" json:"original_request,omitempty"` + // The time at which original_request was received. + RequestTime *google_protobuf3.Timestamp `protobuf:"bytes,2,opt,name=request_time,json=requestTime" json:"request_time,omitempty"` + // The time at which this operation was cancelled. If set, this operation is + // in the process of undoing itself (which is guaranteed to succeed) and + // cannot be cancelled again. + CancelTime *google_protobuf3.Timestamp `protobuf:"bytes,3,opt,name=cancel_time,json=cancelTime" json:"cancel_time,omitempty"` + // The time at which this operation failed or was completed successfully. + FinishTime *google_protobuf3.Timestamp `protobuf:"bytes,4,opt,name=finish_time,json=finishTime" json:"finish_time,omitempty"` +} + +func (m *UpdateClusterMetadata) Reset() { *m = UpdateClusterMetadata{} } +func (m *UpdateClusterMetadata) String() string { return proto.CompactTextString(m) } +func (*UpdateClusterMetadata) ProtoMessage() {} +func (*UpdateClusterMetadata) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{7} } + +func (m *UpdateClusterMetadata) GetOriginalRequest() *Cluster { + if m != nil { + return m.OriginalRequest + } + return nil +} + +func (m *UpdateClusterMetadata) GetRequestTime() *google_protobuf3.Timestamp { + if m != nil { + return m.RequestTime + } + return nil +} + +func (m *UpdateClusterMetadata) GetCancelTime() *google_protobuf3.Timestamp { + if m != nil { + return m.CancelTime + } + return nil +} + +func (m *UpdateClusterMetadata) GetFinishTime() *google_protobuf3.Timestamp { + if m != nil { + return m.FinishTime + } + return nil +} + +// Request message for BigtableClusterService.DeleteCluster. +type DeleteClusterRequest struct { + // The unique name of the cluster to be deleted. + // Values are of the form projects//zones//clusters/ + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *DeleteClusterRequest) Reset() { *m = DeleteClusterRequest{} } +func (m *DeleteClusterRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteClusterRequest) ProtoMessage() {} +func (*DeleteClusterRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{8} } + +func (m *DeleteClusterRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Request message for BigtableClusterService.UndeleteCluster. +type UndeleteClusterRequest struct { + // The unique name of the cluster to be un-deleted. + // Values are of the form projects//zones//clusters/ + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *UndeleteClusterRequest) Reset() { *m = UndeleteClusterRequest{} } +func (m *UndeleteClusterRequest) String() string { return proto.CompactTextString(m) } +func (*UndeleteClusterRequest) ProtoMessage() {} +func (*UndeleteClusterRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{9} } + +func (m *UndeleteClusterRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Metadata type for the operation returned by +// BigtableClusterService.UndeleteCluster. +type UndeleteClusterMetadata struct { + // The time at which the original request was received. + RequestTime *google_protobuf3.Timestamp `protobuf:"bytes,1,opt,name=request_time,json=requestTime" json:"request_time,omitempty"` + // The time at which this operation failed or was completed successfully. + FinishTime *google_protobuf3.Timestamp `protobuf:"bytes,2,opt,name=finish_time,json=finishTime" json:"finish_time,omitempty"` +} + +func (m *UndeleteClusterMetadata) Reset() { *m = UndeleteClusterMetadata{} } +func (m *UndeleteClusterMetadata) String() string { return proto.CompactTextString(m) } +func (*UndeleteClusterMetadata) ProtoMessage() {} +func (*UndeleteClusterMetadata) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{10} } + +func (m *UndeleteClusterMetadata) GetRequestTime() *google_protobuf3.Timestamp { + if m != nil { + return m.RequestTime + } + return nil +} + +func (m *UndeleteClusterMetadata) GetFinishTime() *google_protobuf3.Timestamp { + if m != nil { + return m.FinishTime + } + return nil +} + +// Metadata type for operations initiated by the V2 BigtableAdmin service. +// More complete information for such operations is available via the V2 API. +type V2OperationMetadata struct { +} + +func (m *V2OperationMetadata) Reset() { *m = V2OperationMetadata{} } +func (m *V2OperationMetadata) String() string { return proto.CompactTextString(m) } +func (*V2OperationMetadata) ProtoMessage() {} +func (*V2OperationMetadata) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{11} } + +func init() { + proto.RegisterType((*ListZonesRequest)(nil), "google.bigtable.admin.cluster.v1.ListZonesRequest") + proto.RegisterType((*ListZonesResponse)(nil), "google.bigtable.admin.cluster.v1.ListZonesResponse") + proto.RegisterType((*GetClusterRequest)(nil), "google.bigtable.admin.cluster.v1.GetClusterRequest") + proto.RegisterType((*ListClustersRequest)(nil), "google.bigtable.admin.cluster.v1.ListClustersRequest") + proto.RegisterType((*ListClustersResponse)(nil), "google.bigtable.admin.cluster.v1.ListClustersResponse") + proto.RegisterType((*CreateClusterRequest)(nil), "google.bigtable.admin.cluster.v1.CreateClusterRequest") + proto.RegisterType((*CreateClusterMetadata)(nil), "google.bigtable.admin.cluster.v1.CreateClusterMetadata") + proto.RegisterType((*UpdateClusterMetadata)(nil), "google.bigtable.admin.cluster.v1.UpdateClusterMetadata") + proto.RegisterType((*DeleteClusterRequest)(nil), "google.bigtable.admin.cluster.v1.DeleteClusterRequest") + proto.RegisterType((*UndeleteClusterRequest)(nil), "google.bigtable.admin.cluster.v1.UndeleteClusterRequest") + proto.RegisterType((*UndeleteClusterMetadata)(nil), "google.bigtable.admin.cluster.v1.UndeleteClusterMetadata") + proto.RegisterType((*V2OperationMetadata)(nil), "google.bigtable.admin.cluster.v1.V2OperationMetadata") +} + +func init() { + proto.RegisterFile("google/bigtable/admin/cluster/v1/bigtable_cluster_service_messages.proto", fileDescriptor2) +} + +var fileDescriptor2 = []byte{ + // 541 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0x4d, 0x6f, 0xd3, 0x40, + 0x10, 0xd5, 0x26, 0xe5, 0xa3, 0xe3, 0x4a, 0xb4, 0x6e, 0x02, 0x51, 0x24, 0x44, 0x64, 0x50, 0x69, + 0x11, 0xb2, 0xd5, 0x20, 0x71, 0x69, 0xb9, 0x24, 0xa0, 0x52, 0x89, 0x8a, 0x12, 0x5a, 0x0e, 0xbd, + 0x58, 0x9b, 0x78, 0x62, 0x56, 0xb2, 0x77, 0x8d, 0x77, 0x93, 0x03, 0x3f, 0x82, 0x1b, 0xfc, 0x04, + 0xc4, 0x2f, 0xe4, 0x8c, 0xec, 0xdd, 0x8d, 0x68, 0x95, 0xd6, 0xb1, 0x10, 0xb7, 0xdd, 0x99, 0xf7, + 0x66, 0xde, 0x9b, 0x1d, 0x69, 0xe1, 0x6d, 0x2c, 0x44, 0x9c, 0x60, 0x30, 0x66, 0xb1, 0xa2, 0xe3, + 0x04, 0x03, 0x1a, 0xa5, 0x8c, 0x07, 0x93, 0x64, 0x26, 0x15, 0xe6, 0xc1, 0x7c, 0x7f, 0x91, 0x09, + 0x4d, 0x2c, 0x94, 0x98, 0xcf, 0xd9, 0x04, 0xc3, 0x14, 0xa5,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 0x8f, 0xfa, 0x1b, 0x38, 0x31, 0xbf, 0xc0, 0x69, 0xd1, 0xfd, 0x94, + 0x5c, 0x1c, 0x99, 0x42, 0xb1, 0x48, 0x28, 0x8f, 0x7d, 0x91, 0xc7, 0x41, 0x8c, 0xbc, 0xd4, 0x16, + 0xe8, 0x14, 0xcd, 0x98, 0xbc, 0xfe, 0x0f, 0x38, 0x30, 0xc7, 0xf1, 0xed, 0x92, 0xf3, 0xe2, 0x4f, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xc1, 0x75, 0x68, 0x13, 0xa2, 0x06, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/bigtable/admin/table/v1/bigtable_table_data.pb.go b/vendor/google.golang.org/genproto/googleapis/bigtable/admin/table/v1/bigtable_table_data.pb.go new file mode 100644 index 0000000000..2c6183d8e5 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/bigtable/admin/table/v1/bigtable_table_data.pb.go @@ -0,0 +1,451 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/bigtable/admin/table/v1/bigtable_table_data.proto + +/* +Package table is a generated protocol buffer package. + +It is generated from these files: + google/bigtable/admin/table/v1/bigtable_table_data.proto + google/bigtable/admin/table/v1/bigtable_table_service.proto + google/bigtable/admin/table/v1/bigtable_table_service_messages.proto + +It has these top-level messages: + Table + ColumnFamily + GcRule + CreateTableRequest + ListTablesRequest + ListTablesResponse + GetTableRequest + DeleteTableRequest + RenameTableRequest + CreateColumnFamilyRequest + DeleteColumnFamilyRequest + BulkDeleteRowsRequest +*/ +package table + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import google_longrunning "google.golang.org/genproto/googleapis/longrunning" +import google_protobuf3 "github.com/golang/protobuf/ptypes/duration" + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +type Table_TimestampGranularity int32 + +const ( + Table_MILLIS Table_TimestampGranularity = 0 +) + +var Table_TimestampGranularity_name = map[int32]string{ + 0: "MILLIS", +} +var Table_TimestampGranularity_value = map[string]int32{ + "MILLIS": 0, +} + +func (x Table_TimestampGranularity) String() string { + return proto.EnumName(Table_TimestampGranularity_name, int32(x)) +} +func (Table_TimestampGranularity) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{0, 0} +} + +// A collection of user data indexed by row, column, and timestamp. +// Each table is served using the resources of its parent cluster. +type Table struct { + // A unique identifier of the form + // /tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]* + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // If this Table is in the process of being created, the Operation used to + // track its progress. As long as this operation is present, the Table will + // not accept any Table Admin or Read/Write requests. + CurrentOperation *google_longrunning.Operation `protobuf:"bytes,2,opt,name=current_operation,json=currentOperation" json:"current_operation,omitempty"` + // The column families configured for this table, mapped by column family id. + ColumnFamilies map[string]*ColumnFamily `protobuf:"bytes,3,rep,name=column_families,json=columnFamilies" json:"column_families,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // The granularity (e.g. MILLIS, MICROS) at which timestamps are stored in + // this table. Timestamps not matching the granularity will be rejected. + // Cannot be changed once the table is created. + Granularity Table_TimestampGranularity `protobuf:"varint,4,opt,name=granularity,enum=google.bigtable.admin.table.v1.Table_TimestampGranularity" json:"granularity,omitempty"` +} + +func (m *Table) Reset() { *m = Table{} } +func (m *Table) String() string { return proto.CompactTextString(m) } +func (*Table) ProtoMessage() {} +func (*Table) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *Table) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Table) GetCurrentOperation() *google_longrunning.Operation { + if m != nil { + return m.CurrentOperation + } + return nil +} + +func (m *Table) GetColumnFamilies() map[string]*ColumnFamily { + if m != nil { + return m.ColumnFamilies + } + return nil +} + +func (m *Table) GetGranularity() Table_TimestampGranularity { + if m != nil { + return m.Granularity + } + return Table_MILLIS +} + +// A set of columns within a table which share a common configuration. +type ColumnFamily struct { + // A unique identifier of the form /columnFamilies/[-_.a-zA-Z0-9]+ + // The last segment is the same as the "name" field in + // google.bigtable.v1.Family. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Garbage collection expression specified by the following grammar: + // GC = EXPR + // | "" ; + // EXPR = EXPR, "||", EXPR (* lowest precedence *) + // | EXPR, "&&", EXPR + // | "(", EXPR, ")" (* highest precedence *) + // | PROP ; + // PROP = "version() >", NUM32 + // | "age() >", NUM64, [ UNIT ] ; + // NUM32 = non-zero-digit { digit } ; (* # NUM32 <= 2^32 - 1 *) + // NUM64 = non-zero-digit { digit } ; (* # NUM64 <= 2^63 - 1 *) + // UNIT = "d" | "h" | "m" (* d=days, h=hours, m=minutes, else micros *) + // GC expressions can be up to 500 characters in length + // + // The different types of PROP are defined as follows: + // version() - cell index, counting from most recent and starting at 1 + // age() - age of the cell (current time minus cell timestamp) + // + // Example: "version() > 3 || (age() > 3d && version() > 1)" + // drop cells beyond the most recent three, and drop cells older than three + // days unless they're the most recent cell in the row/column + // + // Garbage collection executes opportunistically in the background, and so + // it's possible for reads to return a cell even if it matches the active GC + // expression for its family. + GcExpression string `protobuf:"bytes,2,opt,name=gc_expression,json=gcExpression" json:"gc_expression,omitempty"` + // Garbage collection rule specified as a protobuf. + // Supersedes `gc_expression`. + // Must serialize to at most 500 bytes. + // + // NOTE: Garbage collection executes opportunistically in the background, and + // so it's possible for reads to return a cell even if it matches the active + // GC expression for its family. + GcRule *GcRule `protobuf:"bytes,3,opt,name=gc_rule,json=gcRule" json:"gc_rule,omitempty"` +} + +func (m *ColumnFamily) Reset() { *m = ColumnFamily{} } +func (m *ColumnFamily) String() string { return proto.CompactTextString(m) } +func (*ColumnFamily) ProtoMessage() {} +func (*ColumnFamily) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *ColumnFamily) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ColumnFamily) GetGcExpression() string { + if m != nil { + return m.GcExpression + } + return "" +} + +func (m *ColumnFamily) GetGcRule() *GcRule { + if m != nil { + return m.GcRule + } + return nil +} + +// Rule for determining which cells to delete during garbage collection. +type GcRule struct { + // Types that are valid to be assigned to Rule: + // *GcRule_MaxNumVersions + // *GcRule_MaxAge + // *GcRule_Intersection_ + // *GcRule_Union_ + Rule isGcRule_Rule `protobuf_oneof:"rule"` +} + +func (m *GcRule) Reset() { *m = GcRule{} } +func (m *GcRule) String() string { return proto.CompactTextString(m) } +func (*GcRule) ProtoMessage() {} +func (*GcRule) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +type isGcRule_Rule interface { + isGcRule_Rule() +} + +type GcRule_MaxNumVersions struct { + MaxNumVersions int32 `protobuf:"varint,1,opt,name=max_num_versions,json=maxNumVersions,oneof"` +} +type GcRule_MaxAge struct { + MaxAge *google_protobuf3.Duration `protobuf:"bytes,2,opt,name=max_age,json=maxAge,oneof"` +} +type GcRule_Intersection_ struct { + Intersection *GcRule_Intersection `protobuf:"bytes,3,opt,name=intersection,oneof"` +} +type GcRule_Union_ struct { + Union *GcRule_Union `protobuf:"bytes,4,opt,name=union,oneof"` +} + +func (*GcRule_MaxNumVersions) isGcRule_Rule() {} +func (*GcRule_MaxAge) isGcRule_Rule() {} +func (*GcRule_Intersection_) isGcRule_Rule() {} +func (*GcRule_Union_) isGcRule_Rule() {} + +func (m *GcRule) GetRule() isGcRule_Rule { + if m != nil { + return m.Rule + } + return nil +} + +func (m *GcRule) GetMaxNumVersions() int32 { + if x, ok := m.GetRule().(*GcRule_MaxNumVersions); ok { + return x.MaxNumVersions + } + return 0 +} + +func (m *GcRule) GetMaxAge() *google_protobuf3.Duration { + if x, ok := m.GetRule().(*GcRule_MaxAge); ok { + return x.MaxAge + } + return nil +} + +func (m *GcRule) GetIntersection() *GcRule_Intersection { + if x, ok := m.GetRule().(*GcRule_Intersection_); ok { + return x.Intersection + } + return nil +} + +func (m *GcRule) GetUnion() *GcRule_Union { + if x, ok := m.GetRule().(*GcRule_Union_); ok { + return x.Union + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*GcRule) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _GcRule_OneofMarshaler, _GcRule_OneofUnmarshaler, _GcRule_OneofSizer, []interface{}{ + (*GcRule_MaxNumVersions)(nil), + (*GcRule_MaxAge)(nil), + (*GcRule_Intersection_)(nil), + (*GcRule_Union_)(nil), + } +} + +func _GcRule_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*GcRule) + // rule + switch x := m.Rule.(type) { + case *GcRule_MaxNumVersions: + b.EncodeVarint(1<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.MaxNumVersions)) + case *GcRule_MaxAge: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.MaxAge); err != nil { + return err + } + case *GcRule_Intersection_: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Intersection); err != nil { + return err + } + case *GcRule_Union_: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Union); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("GcRule.Rule has unexpected type %T", x) + } + return nil +} + +func _GcRule_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*GcRule) + switch tag { + case 1: // rule.max_num_versions + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Rule = &GcRule_MaxNumVersions{int32(x)} + return true, err + case 2: // rule.max_age + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(google_protobuf3.Duration) + err := b.DecodeMessage(msg) + m.Rule = &GcRule_MaxAge{msg} + return true, err + case 3: // rule.intersection + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(GcRule_Intersection) + err := b.DecodeMessage(msg) + m.Rule = &GcRule_Intersection_{msg} + return true, err + case 4: // rule.union + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(GcRule_Union) + err := b.DecodeMessage(msg) + m.Rule = &GcRule_Union_{msg} + return true, err + default: + return false, nil + } +} + +func _GcRule_OneofSizer(msg proto.Message) (n int) { + m := msg.(*GcRule) + // rule + switch x := m.Rule.(type) { + case *GcRule_MaxNumVersions: + n += proto.SizeVarint(1<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.MaxNumVersions)) + case *GcRule_MaxAge: + s := proto.Size(x.MaxAge) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *GcRule_Intersection_: + s := proto.Size(x.Intersection) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *GcRule_Union_: + s := proto.Size(x.Union) + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// A GcRule which deletes cells matching all of the given rules. +type GcRule_Intersection struct { + // Only delete cells which would be deleted by every element of `rules`. + Rules []*GcRule `protobuf:"bytes,1,rep,name=rules" json:"rules,omitempty"` +} + +func (m *GcRule_Intersection) Reset() { *m = GcRule_Intersection{} } +func (m *GcRule_Intersection) String() string { return proto.CompactTextString(m) } +func (*GcRule_Intersection) ProtoMessage() {} +func (*GcRule_Intersection) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2, 0} } + +func (m *GcRule_Intersection) GetRules() []*GcRule { + if m != nil { + return m.Rules + } + return nil +} + +// A GcRule which deletes cells matching any of the given rules. +type GcRule_Union struct { + // Delete cells which would be deleted by any element of `rules`. + Rules []*GcRule `protobuf:"bytes,1,rep,name=rules" json:"rules,omitempty"` +} + +func (m *GcRule_Union) Reset() { *m = GcRule_Union{} } +func (m *GcRule_Union) String() string { return proto.CompactTextString(m) } +func (*GcRule_Union) ProtoMessage() {} +func (*GcRule_Union) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2, 1} } + +func (m *GcRule_Union) GetRules() []*GcRule { + if m != nil { + return m.Rules + } + return nil +} + +func init() { + proto.RegisterType((*Table)(nil), "google.bigtable.admin.table.v1.Table") + proto.RegisterType((*ColumnFamily)(nil), "google.bigtable.admin.table.v1.ColumnFamily") + proto.RegisterType((*GcRule)(nil), "google.bigtable.admin.table.v1.GcRule") + proto.RegisterType((*GcRule_Intersection)(nil), "google.bigtable.admin.table.v1.GcRule.Intersection") + proto.RegisterType((*GcRule_Union)(nil), "google.bigtable.admin.table.v1.GcRule.Union") + proto.RegisterEnum("google.bigtable.admin.table.v1.Table_TimestampGranularity", Table_TimestampGranularity_name, Table_TimestampGranularity_value) +} + +func init() { + proto.RegisterFile("google/bigtable/admin/table/v1/bigtable_table_data.proto", fileDescriptor0) +} + +var fileDescriptor0 = []byte{ + // 579 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x94, 0x61, 0x6b, 0xd3, 0x40, + 0x18, 0xc7, 0x9b, 0xa5, 0xed, 0xd8, 0xb3, 0x3a, 0xeb, 0x29, 0x52, 0x0b, 0x4a, 0xc9, 0x40, 0x8a, + 0xc8, 0x85, 0x6d, 0xbe, 0x98, 0x53, 0x10, 0xbb, 0xcd, 0x6d, 0x32, 0x75, 0xc4, 0x29, 0x28, 0x42, + 0xb8, 0x66, 0xb7, 0x23, 0x98, 0xbb, 0x2b, 0x97, 0x5c, 0x69, 0x5f, 0xfb, 0xc6, 0x8f, 0xe2, 0xa7, + 0xf0, 0xb3, 0x49, 0xee, 0x2e, 0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x7b, + 0xee, 0xd0, 0x1e, 0x36, 0xa2, 0x36, 0x27, 0xb3, 0x97, 0x8c, 0xa2, 0x4f, 0xd0, 0x49, 0x45, 0x41, + 0x55, 0x4e, 0x13, 0x73, 0x2a, 0xad, 0xe5, 0xad, 0xeb, 0x59, 0xc6, 0x47, 0x35, 0xe9, 0x61, 0x23, + 0xba, 0x80, 0x42, 0x7b, 0xd0, 0xd2, 0xa2, 0x64, 0x36, 0xaf, 0x37, 0x3e, 0xc7, 0xfc, 0x20, 0x2c, + 0xcc, 0x8a, 0xfb, 0xc7, 0xd0, 0xa9, 0xef, 0x82, 0x9e, 0x43, 0xab, 0xec, 0x6d, 0xd9, 0x07, 0xff, + 0x1f, 0x9a, 0x6b, 0x45, 0xfd, 0x7d, 0x68, 0x19, 0xfe, 0xff, 0x61, 0x46, 0x6d, 0x68, 0x96, 0xc1, + 0xe8, 0x9b, 0x07, 0x41, 0x22, 0xf9, 0x15, 0xe2, 0xd1, 0xdd, 0x91, 0x5b, 0x30, 0x9f, 0xc8, 0x1e, + 0x29, 0xc8, 0x49, 0x39, 0x92, 0x13, 0xef, 0xf3, 0xae, 0x53, 0x32, 0x99, 0x11, 0xc1, 0xb0, 0x54, + 0x2c, 0x64, 0x54, 0x98, 0x81, 0x85, 0x76, 0x89, 0x4c, 0xd2, 0xfc, 0x4f, 0x7f, 0xbd, 0x67, 0x26, + 0x18, 0xb7, 0x4d, 0xfd, 0xd6, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd7, 0x80, 0x76, 0xdc, 0x24, + 0x05, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/bigtable/admin/table/v1/bigtable_table_service.pb.go b/vendor/google.golang.org/genproto/googleapis/bigtable/admin/table/v1/bigtable_table_service.pb.go new file mode 100644 index 0000000000..3d5049ab35 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/bigtable/admin/table/v1/bigtable_table_service.pb.go @@ -0,0 +1,423 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/bigtable/admin/table/v1/bigtable_table_service.proto + +package table + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf2 "github.com/golang/protobuf/ptypes/empty" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// 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 + +// Client API for BigtableTableService service + +type BigtableTableServiceClient interface { + // Creates a new table, to be served from a specified cluster. + // The table can be created with a full set of initial column families, + // specified in the request. + CreateTable(ctx context.Context, in *CreateTableRequest, opts ...grpc.CallOption) (*Table, error) + // Lists the names of all tables served from a specified cluster. + ListTables(ctx context.Context, in *ListTablesRequest, opts ...grpc.CallOption) (*ListTablesResponse, error) + // Gets the schema of the specified table, including its column families. + GetTable(ctx context.Context, in *GetTableRequest, opts ...grpc.CallOption) (*Table, error) + // Permanently deletes a specified table and all of its data. + DeleteTable(ctx context.Context, in *DeleteTableRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) + // Changes the name of a specified table. + // Cannot be used to move tables between clusters, zones, or projects. + RenameTable(ctx context.Context, in *RenameTableRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) + // Creates a new column family within a specified table. + CreateColumnFamily(ctx context.Context, in *CreateColumnFamilyRequest, opts ...grpc.CallOption) (*ColumnFamily, error) + // Changes the configuration of a specified column family. + UpdateColumnFamily(ctx context.Context, in *ColumnFamily, opts ...grpc.CallOption) (*ColumnFamily, error) + // Permanently deletes a specified column family and all of its data. + DeleteColumnFamily(ctx context.Context, in *DeleteColumnFamilyRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) + // Delete all rows in a table corresponding to a particular prefix + BulkDeleteRows(ctx context.Context, in *BulkDeleteRowsRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) +} + +type bigtableTableServiceClient struct { + cc *grpc.ClientConn +} + +func NewBigtableTableServiceClient(cc *grpc.ClientConn) BigtableTableServiceClient { + return &bigtableTableServiceClient{cc} +} + +func (c *bigtableTableServiceClient) CreateTable(ctx context.Context, in *CreateTableRequest, opts ...grpc.CallOption) (*Table, error) { + out := new(Table) + err := grpc.Invoke(ctx, "/google.bigtable.admin.table.v1.BigtableTableService/CreateTable", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bigtableTableServiceClient) ListTables(ctx context.Context, in *ListTablesRequest, opts ...grpc.CallOption) (*ListTablesResponse, error) { + out := new(ListTablesResponse) + err := grpc.Invoke(ctx, "/google.bigtable.admin.table.v1.BigtableTableService/ListTables", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bigtableTableServiceClient) GetTable(ctx context.Context, in *GetTableRequest, opts ...grpc.CallOption) (*Table, error) { + out := new(Table) + err := grpc.Invoke(ctx, "/google.bigtable.admin.table.v1.BigtableTableService/GetTable", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bigtableTableServiceClient) DeleteTable(ctx context.Context, in *DeleteTableRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) { + out := new(google_protobuf2.Empty) + err := grpc.Invoke(ctx, "/google.bigtable.admin.table.v1.BigtableTableService/DeleteTable", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bigtableTableServiceClient) RenameTable(ctx context.Context, in *RenameTableRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) { + out := new(google_protobuf2.Empty) + err := grpc.Invoke(ctx, "/google.bigtable.admin.table.v1.BigtableTableService/RenameTable", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bigtableTableServiceClient) CreateColumnFamily(ctx context.Context, in *CreateColumnFamilyRequest, opts ...grpc.CallOption) (*ColumnFamily, error) { + out := new(ColumnFamily) + err := grpc.Invoke(ctx, "/google.bigtable.admin.table.v1.BigtableTableService/CreateColumnFamily", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bigtableTableServiceClient) UpdateColumnFamily(ctx context.Context, in *ColumnFamily, opts ...grpc.CallOption) (*ColumnFamily, error) { + out := new(ColumnFamily) + err := grpc.Invoke(ctx, "/google.bigtable.admin.table.v1.BigtableTableService/UpdateColumnFamily", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bigtableTableServiceClient) DeleteColumnFamily(ctx context.Context, in *DeleteColumnFamilyRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) { + out := new(google_protobuf2.Empty) + err := grpc.Invoke(ctx, "/google.bigtable.admin.table.v1.BigtableTableService/DeleteColumnFamily", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bigtableTableServiceClient) BulkDeleteRows(ctx context.Context, in *BulkDeleteRowsRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) { + out := new(google_protobuf2.Empty) + err := grpc.Invoke(ctx, "/google.bigtable.admin.table.v1.BigtableTableService/BulkDeleteRows", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for BigtableTableService service + +type BigtableTableServiceServer interface { + // Creates a new table, to be served from a specified cluster. + // The table can be created with a full set of initial column families, + // specified in the request. + CreateTable(context.Context, *CreateTableRequest) (*Table, error) + // Lists the names of all tables served from a specified cluster. + ListTables(context.Context, *ListTablesRequest) (*ListTablesResponse, error) + // Gets the schema of the specified table, including its column families. + GetTable(context.Context, *GetTableRequest) (*Table, error) + // Permanently deletes a specified table and all of its data. + DeleteTable(context.Context, *DeleteTableRequest) (*google_protobuf2.Empty, error) + // Changes the name of a specified table. + // Cannot be used to move tables between clusters, zones, or projects. + RenameTable(context.Context, *RenameTableRequest) (*google_protobuf2.Empty, error) + // Creates a new column family within a specified table. + CreateColumnFamily(context.Context, *CreateColumnFamilyRequest) (*ColumnFamily, error) + // Changes the configuration of a specified column family. + UpdateColumnFamily(context.Context, *ColumnFamily) (*ColumnFamily, error) + // Permanently deletes a specified column family and all of its data. + DeleteColumnFamily(context.Context, *DeleteColumnFamilyRequest) (*google_protobuf2.Empty, error) + // Delete all rows in a table corresponding to a particular prefix + BulkDeleteRows(context.Context, *BulkDeleteRowsRequest) (*google_protobuf2.Empty, error) +} + +func RegisterBigtableTableServiceServer(s *grpc.Server, srv BigtableTableServiceServer) { + s.RegisterService(&_BigtableTableService_serviceDesc, srv) +} + +func _BigtableTableService_CreateTable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateTableRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BigtableTableServiceServer).CreateTable(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.bigtable.admin.table.v1.BigtableTableService/CreateTable", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BigtableTableServiceServer).CreateTable(ctx, req.(*CreateTableRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BigtableTableService_ListTables_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListTablesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BigtableTableServiceServer).ListTables(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.bigtable.admin.table.v1.BigtableTableService/ListTables", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BigtableTableServiceServer).ListTables(ctx, req.(*ListTablesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BigtableTableService_GetTable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetTableRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BigtableTableServiceServer).GetTable(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.bigtable.admin.table.v1.BigtableTableService/GetTable", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BigtableTableServiceServer).GetTable(ctx, req.(*GetTableRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BigtableTableService_DeleteTable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteTableRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BigtableTableServiceServer).DeleteTable(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.bigtable.admin.table.v1.BigtableTableService/DeleteTable", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BigtableTableServiceServer).DeleteTable(ctx, req.(*DeleteTableRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BigtableTableService_RenameTable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RenameTableRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BigtableTableServiceServer).RenameTable(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.bigtable.admin.table.v1.BigtableTableService/RenameTable", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BigtableTableServiceServer).RenameTable(ctx, req.(*RenameTableRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BigtableTableService_CreateColumnFamily_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateColumnFamilyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BigtableTableServiceServer).CreateColumnFamily(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.bigtable.admin.table.v1.BigtableTableService/CreateColumnFamily", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BigtableTableServiceServer).CreateColumnFamily(ctx, req.(*CreateColumnFamilyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BigtableTableService_UpdateColumnFamily_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ColumnFamily) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BigtableTableServiceServer).UpdateColumnFamily(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.bigtable.admin.table.v1.BigtableTableService/UpdateColumnFamily", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BigtableTableServiceServer).UpdateColumnFamily(ctx, req.(*ColumnFamily)) + } + return interceptor(ctx, in, info, handler) +} + +func _BigtableTableService_DeleteColumnFamily_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteColumnFamilyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BigtableTableServiceServer).DeleteColumnFamily(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.bigtable.admin.table.v1.BigtableTableService/DeleteColumnFamily", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BigtableTableServiceServer).DeleteColumnFamily(ctx, req.(*DeleteColumnFamilyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BigtableTableService_BulkDeleteRows_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BulkDeleteRowsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BigtableTableServiceServer).BulkDeleteRows(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.bigtable.admin.table.v1.BigtableTableService/BulkDeleteRows", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BigtableTableServiceServer).BulkDeleteRows(ctx, req.(*BulkDeleteRowsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _BigtableTableService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.bigtable.admin.table.v1.BigtableTableService", + HandlerType: (*BigtableTableServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateTable", + Handler: _BigtableTableService_CreateTable_Handler, + }, + { + MethodName: "ListTables", + Handler: _BigtableTableService_ListTables_Handler, + }, + { + MethodName: "GetTable", + Handler: _BigtableTableService_GetTable_Handler, + }, + { + MethodName: "DeleteTable", + Handler: _BigtableTableService_DeleteTable_Handler, + }, + { + MethodName: "RenameTable", + Handler: _BigtableTableService_RenameTable_Handler, + }, + { + MethodName: "CreateColumnFamily", + Handler: _BigtableTableService_CreateColumnFamily_Handler, + }, + { + MethodName: "UpdateColumnFamily", + Handler: _BigtableTableService_UpdateColumnFamily_Handler, + }, + { + MethodName: "DeleteColumnFamily", + Handler: _BigtableTableService_DeleteColumnFamily_Handler, + }, + { + MethodName: "BulkDeleteRows", + Handler: _BigtableTableService_BulkDeleteRows_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/bigtable/admin/table/v1/bigtable_table_service.proto", +} + +func init() { + proto.RegisterFile("google/bigtable/admin/table/v1/bigtable_table_service.proto", fileDescriptor1) +} + +var fileDescriptor1 = []byte{ + // 560 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x95, 0xbf, 0x6f, 0xd4, 0x30, + 0x14, 0xc7, 0x65, 0x06, 0x84, 0x7c, 0x88, 0xc1, 0x42, 0x0c, 0x07, 0x62, 0x88, 0xc4, 0x12, 0xa1, + 0x58, 0xb9, 0x82, 0x68, 0xaf, 0xaa, 0x84, 0x72, 0xd7, 0x56, 0xa2, 0x20, 0x95, 0x03, 0x16, 0x96, + 0xca, 0xc9, 0x3d, 0xa2, 0x40, 0x62, 0x87, 0xd8, 0x39, 0x54, 0x50, 0x17, 0x16, 0xfe, 0x00, 0x58, + 0x61, 0x62, 0x64, 0x82, 0x1d, 0x76, 0x56, 0xfe, 0x05, 0xfe, 0x10, 0x14, 0x3b, 0xa1, 0x69, 0xf9, + 0xe1, 0x73, 0xd5, 0x25, 0xe7, 0xb3, 0xbf, 0xdf, 0xf7, 0x3e, 0xcf, 0x7e, 0x96, 0xf1, 0x7a, 0x2a, + 0x44, 0x9a, 0x03, 0x8d, 0xb3, 0x54, 0xb1, 0x38, 0x07, 0xca, 0xe6, 0x45, 0xc6, 0xa9, 0x19, 0x2f, + 0xc2, 0xdf, 0xf3, 0x7b, 0xe6, 0x2b, 0xa1, 0x5a, 0x64, 0x09, 0x04, 0x65, 0x25, 0x94, 0x20, 0x57, + 0x8d, 0x39, 0xe8, 0x44, 0x81, 0x36, 0x07, 0x66, 0xbc, 0x08, 0x87, 0x57, 0xda, 0xe0, 0xac, 0xcc, + 0x28, 0xe3, 0x5c, 0x28, 0xa6, 0x32, 0xc1, 0xa5, 0x71, 0x0f, 0x57, 0xdd, 0x52, 0xcf, 0x99, 0x62, + 0xad, 0x73, 0x7a, 0x22, 0xe8, 0xbd, 0x02, 0xa4, 0x64, 0x29, 0x74, 0xf9, 0x2f, 0xb7, 0x51, 0xf4, + 0xbf, 0xb8, 0x7e, 0x42, 0xa1, 0x28, 0xd5, 0xbe, 0x59, 0x1c, 0x7d, 0x3d, 0x8f, 0x2f, 0x46, 0x6d, + 0x98, 0x87, 0xcd, 0xe7, 0x81, 0x09, 0x42, 0x3e, 0x22, 0x3c, 0x98, 0x54, 0xc0, 0x94, 0x99, 0x26, + 0xa3, 0xe0, 0xff, 0x9b, 0x10, 0xf4, 0xc4, 0x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0xdd, 0x6a, 0xed, + 0x99, 0xbc, 0x1d, 0x5d, 0xc4, 0xa6, 0x77, 0xdb, 0xb9, 0x08, 0x9a, 0x1c, 0xc6, 0xc9, 0xcc, 0x9d, + 0xfa, 0x86, 0x30, 0x79, 0x54, 0xce, 0x8f, 0x17, 0xe3, 0x44, 0xe4, 0xc8, 0x7f, 0x4f, 0xf3, 0x6f, + 0x0f, 0x23, 0x57, 0xfe, 0x63, 0xf8, 0xcd, 0xa9, 0x20, 0x9f, 0x7c, 0x41, 0x98, 0x98, 0xce, 0x74, + 0x3b, 0x8e, 0x3f, 0x3d, 0xb6, 0xee, 0xb9, 0xa3, 0xc1, 0xa7, 0xfe, 0x29, 0x80, 0x93, 0xcf, 0x08, + 0x5f, 0x88, 0xea, 0xfc, 0x99, 0xa1, 0x98, 0x89, 0x17, 0x92, 0xdc, 0xb4, 0x11, 0x1f, 0xd5, 0xdb, + 0x68, 0xef, 0x6b, 0xda, 0x1d, 0x6f, 0x4b, 0xd3, 0x9a, 0x57, 0xc3, 0xa9, 0xe3, 0xe3, 0x23, 0xe9, + 0xc6, 0xc8, 0x8f, 0xde, 0x20, 0xec, 0x25, 0xa2, 0xb0, 0x70, 0x46, 0xc3, 0xbf, 0x3d, 0x32, 0x72, + 0xb7, 0xc1, 0xdb, 0x45, 0x8f, 0x27, 0xad, 0x3b, 0x15, 0x39, 0xe3, 0x69, 0x20, 0xaa, 0x94, 0xa6, + 0xc0, 0x35, 0x3c, 0x35, 0x4b, 0xac, 0xcc, 0xe4, 0xbf, 0xde, 0xc1, 0x75, 0x3d, 0x88, 0xcf, 0x6a, + 0xfd, 0xca, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x03, 0x65, 0xb4, 0xe0, 0xeb, 0x07, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/bigtable/admin/table/v1/bigtable_table_service_messages.pb.go b/vendor/google.golang.org/genproto/googleapis/bigtable/admin/table/v1/bigtable_table_service_messages.pb.go new file mode 100644 index 0000000000..9d9ad71ed7 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/bigtable/admin/table/v1/bigtable_table_service_messages.pb.go @@ -0,0 +1,400 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/bigtable/admin/table/v1/bigtable_table_service_messages.proto + +package table + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +type CreateTableRequest struct { + // The unique name of the cluster in which to create the new table. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The name by which the new table should be referred to within the cluster, + // e.g. "foobar" rather than "/tables/foobar". + TableId string `protobuf:"bytes,2,opt,name=table_id,json=tableId" json:"table_id,omitempty"` + // The Table to create. The `name` field of the Table and all of its + // ColumnFamilies must be left blank, and will be populated in the response. + Table *Table `protobuf:"bytes,3,opt,name=table" json:"table,omitempty"` + // The optional list of row keys that will be used to initially split the + // table into several tablets (Tablets are similar to HBase regions). + // Given two split keys, "s1" and "s2", three tablets will be created, + // spanning the key ranges: [, s1), [s1, s2), [s2, ). + // + // Example: + // * Row keys := ["a", "apple", "custom", "customer_1", "customer_2", + // "other", "zz"] + // * initial_split_keys := ["apple", "customer_1", "customer_2", "other"] + // * Key assignment: + // - Tablet 1 [, apple) => {"a"}. + // - Tablet 2 [apple, customer_1) => {"apple", "custom"}. + // - Tablet 3 [customer_1, customer_2) => {"customer_1"}. + // - Tablet 4 [customer_2, other) => {"customer_2"}. + // - Tablet 5 [other, ) => {"other", "zz"}. + InitialSplitKeys []string `protobuf:"bytes,4,rep,name=initial_split_keys,json=initialSplitKeys" json:"initial_split_keys,omitempty"` +} + +func (m *CreateTableRequest) Reset() { *m = CreateTableRequest{} } +func (m *CreateTableRequest) String() string { return proto.CompactTextString(m) } +func (*CreateTableRequest) ProtoMessage() {} +func (*CreateTableRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} } + +func (m *CreateTableRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *CreateTableRequest) GetTableId() string { + if m != nil { + return m.TableId + } + return "" +} + +func (m *CreateTableRequest) GetTable() *Table { + if m != nil { + return m.Table + } + return nil +} + +func (m *CreateTableRequest) GetInitialSplitKeys() []string { + if m != nil { + return m.InitialSplitKeys + } + return nil +} + +type ListTablesRequest struct { + // The unique name of the cluster for which tables should be listed. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *ListTablesRequest) Reset() { *m = ListTablesRequest{} } +func (m *ListTablesRequest) String() string { return proto.CompactTextString(m) } +func (*ListTablesRequest) ProtoMessage() {} +func (*ListTablesRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{1} } + +func (m *ListTablesRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +type ListTablesResponse struct { + // The tables present in the requested cluster. + // At present, only the names of the tables are populated. + Tables []*Table `protobuf:"bytes,1,rep,name=tables" json:"tables,omitempty"` +} + +func (m *ListTablesResponse) Reset() { *m = ListTablesResponse{} } +func (m *ListTablesResponse) String() string { return proto.CompactTextString(m) } +func (*ListTablesResponse) ProtoMessage() {} +func (*ListTablesResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{2} } + +func (m *ListTablesResponse) GetTables() []*Table { + if m != nil { + return m.Tables + } + return nil +} + +type GetTableRequest struct { + // The unique name of the requested table. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetTableRequest) Reset() { *m = GetTableRequest{} } +func (m *GetTableRequest) String() string { return proto.CompactTextString(m) } +func (*GetTableRequest) ProtoMessage() {} +func (*GetTableRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{3} } + +func (m *GetTableRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +type DeleteTableRequest struct { + // The unique name of the table to be deleted. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *DeleteTableRequest) Reset() { *m = DeleteTableRequest{} } +func (m *DeleteTableRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteTableRequest) ProtoMessage() {} +func (*DeleteTableRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{4} } + +func (m *DeleteTableRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +type RenameTableRequest struct { + // The current unique name of the table. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The new name by which the table should be referred to within its containing + // cluster, e.g. "foobar" rather than "/tables/foobar". + NewId string `protobuf:"bytes,2,opt,name=new_id,json=newId" json:"new_id,omitempty"` +} + +func (m *RenameTableRequest) Reset() { *m = RenameTableRequest{} } +func (m *RenameTableRequest) String() string { return proto.CompactTextString(m) } +func (*RenameTableRequest) ProtoMessage() {} +func (*RenameTableRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{5} } + +func (m *RenameTableRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *RenameTableRequest) GetNewId() string { + if m != nil { + return m.NewId + } + return "" +} + +type CreateColumnFamilyRequest struct { + // The unique name of the table in which to create the new column family. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The name by which the new column family should be referred to within the + // table, e.g. "foobar" rather than "/columnFamilies/foobar". + ColumnFamilyId string `protobuf:"bytes,2,opt,name=column_family_id,json=columnFamilyId" json:"column_family_id,omitempty"` + // The column family to create. The `name` field must be left blank. + ColumnFamily *ColumnFamily `protobuf:"bytes,3,opt,name=column_family,json=columnFamily" json:"column_family,omitempty"` +} + +func (m *CreateColumnFamilyRequest) Reset() { *m = CreateColumnFamilyRequest{} } +func (m *CreateColumnFamilyRequest) String() string { return proto.CompactTextString(m) } +func (*CreateColumnFamilyRequest) ProtoMessage() {} +func (*CreateColumnFamilyRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{6} } + +func (m *CreateColumnFamilyRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *CreateColumnFamilyRequest) GetColumnFamilyId() string { + if m != nil { + return m.ColumnFamilyId + } + return "" +} + +func (m *CreateColumnFamilyRequest) GetColumnFamily() *ColumnFamily { + if m != nil { + return m.ColumnFamily + } + return nil +} + +type DeleteColumnFamilyRequest struct { + // The unique name of the column family to be deleted. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *DeleteColumnFamilyRequest) Reset() { *m = DeleteColumnFamilyRequest{} } +func (m *DeleteColumnFamilyRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteColumnFamilyRequest) ProtoMessage() {} +func (*DeleteColumnFamilyRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{7} } + +func (m *DeleteColumnFamilyRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +type BulkDeleteRowsRequest struct { + // The unique name of the table on which to perform the bulk delete + TableName string `protobuf:"bytes,1,opt,name=table_name,json=tableName" json:"table_name,omitempty"` + // Types that are valid to be assigned to Target: + // *BulkDeleteRowsRequest_RowKeyPrefix + // *BulkDeleteRowsRequest_DeleteAllDataFromTable + Target isBulkDeleteRowsRequest_Target `protobuf_oneof:"target"` +} + +func (m *BulkDeleteRowsRequest) Reset() { *m = BulkDeleteRowsRequest{} } +func (m *BulkDeleteRowsRequest) String() string { return proto.CompactTextString(m) } +func (*BulkDeleteRowsRequest) ProtoMessage() {} +func (*BulkDeleteRowsRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{8} } + +type isBulkDeleteRowsRequest_Target interface { + isBulkDeleteRowsRequest_Target() +} + +type BulkDeleteRowsRequest_RowKeyPrefix struct { + RowKeyPrefix []byte `protobuf:"bytes,2,opt,name=row_key_prefix,json=rowKeyPrefix,proto3,oneof"` +} +type BulkDeleteRowsRequest_DeleteAllDataFromTable struct { + DeleteAllDataFromTable bool `protobuf:"varint,3,opt,name=delete_all_data_from_table,json=deleteAllDataFromTable,oneof"` +} + +func (*BulkDeleteRowsRequest_RowKeyPrefix) isBulkDeleteRowsRequest_Target() {} +func (*BulkDeleteRowsRequest_DeleteAllDataFromTable) isBulkDeleteRowsRequest_Target() {} + +func (m *BulkDeleteRowsRequest) GetTarget() isBulkDeleteRowsRequest_Target { + if m != nil { + return m.Target + } + return nil +} + +func (m *BulkDeleteRowsRequest) GetTableName() string { + if m != nil { + return m.TableName + } + return "" +} + +func (m *BulkDeleteRowsRequest) GetRowKeyPrefix() []byte { + if x, ok := m.GetTarget().(*BulkDeleteRowsRequest_RowKeyPrefix); ok { + return x.RowKeyPrefix + } + return nil +} + +func (m *BulkDeleteRowsRequest) GetDeleteAllDataFromTable() bool { + if x, ok := m.GetTarget().(*BulkDeleteRowsRequest_DeleteAllDataFromTable); ok { + return x.DeleteAllDataFromTable + } + return false +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*BulkDeleteRowsRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _BulkDeleteRowsRequest_OneofMarshaler, _BulkDeleteRowsRequest_OneofUnmarshaler, _BulkDeleteRowsRequest_OneofSizer, []interface{}{ + (*BulkDeleteRowsRequest_RowKeyPrefix)(nil), + (*BulkDeleteRowsRequest_DeleteAllDataFromTable)(nil), + } +} + +func _BulkDeleteRowsRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*BulkDeleteRowsRequest) + // target + switch x := m.Target.(type) { + case *BulkDeleteRowsRequest_RowKeyPrefix: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeRawBytes(x.RowKeyPrefix) + case *BulkDeleteRowsRequest_DeleteAllDataFromTable: + t := uint64(0) + if x.DeleteAllDataFromTable { + t = 1 + } + b.EncodeVarint(3<<3 | proto.WireVarint) + b.EncodeVarint(t) + case nil: + default: + return fmt.Errorf("BulkDeleteRowsRequest.Target has unexpected type %T", x) + } + return nil +} + +func _BulkDeleteRowsRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*BulkDeleteRowsRequest) + switch tag { + case 2: // target.row_key_prefix + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.Target = &BulkDeleteRowsRequest_RowKeyPrefix{x} + return true, err + case 3: // target.delete_all_data_from_table + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Target = &BulkDeleteRowsRequest_DeleteAllDataFromTable{x != 0} + return true, err + default: + return false, nil + } +} + +func _BulkDeleteRowsRequest_OneofSizer(msg proto.Message) (n int) { + m := msg.(*BulkDeleteRowsRequest) + // target + switch x := m.Target.(type) { + case *BulkDeleteRowsRequest_RowKeyPrefix: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.RowKeyPrefix))) + n += len(x.RowKeyPrefix) + case *BulkDeleteRowsRequest_DeleteAllDataFromTable: + n += proto.SizeVarint(3<<3 | proto.WireVarint) + n += 1 + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +func init() { + proto.RegisterType((*CreateTableRequest)(nil), "google.bigtable.admin.table.v1.CreateTableRequest") + proto.RegisterType((*ListTablesRequest)(nil), "google.bigtable.admin.table.v1.ListTablesRequest") + proto.RegisterType((*ListTablesResponse)(nil), "google.bigtable.admin.table.v1.ListTablesResponse") + proto.RegisterType((*GetTableRequest)(nil), "google.bigtable.admin.table.v1.GetTableRequest") + proto.RegisterType((*DeleteTableRequest)(nil), "google.bigtable.admin.table.v1.DeleteTableRequest") + proto.RegisterType((*RenameTableRequest)(nil), "google.bigtable.admin.table.v1.RenameTableRequest") + proto.RegisterType((*CreateColumnFamilyRequest)(nil), "google.bigtable.admin.table.v1.CreateColumnFamilyRequest") + proto.RegisterType((*DeleteColumnFamilyRequest)(nil), "google.bigtable.admin.table.v1.DeleteColumnFamilyRequest") + proto.RegisterType((*BulkDeleteRowsRequest)(nil), "google.bigtable.admin.table.v1.BulkDeleteRowsRequest") +} + +func init() { + proto.RegisterFile("google/bigtable/admin/table/v1/bigtable_table_service_messages.proto", fileDescriptor2) +} + +var fileDescriptor2 = []byte{ + // 514 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0xc1, 0x6e, 0xd3, 0x40, + 0x10, 0xad, 0x49, 0x1b, 0x92, 0x21, 0x94, 0xb2, 0x52, 0x51, 0x52, 0x09, 0x14, 0x56, 0x2a, 0xe4, + 0x50, 0xd9, 0x2a, 0x5c, 0x90, 0x0a, 0x42, 0x24, 0x51, 0x69, 0x54, 0x40, 0xc1, 0xe1, 0xc4, 0xc5, + 0xda, 0xc4, 0x13, 0x6b, 0xd5, 0xb5, 0x37, 0xec, 0x6e, 0x12, 0xf2, 0x13, 0x7c, 0x06, 0x27, 0xc4, + 0x37, 0x22, 0xef, 0x9a, 0x26, 0x3d, 0x10, 0x97, 0x8b, 0x35, 0x9e, 0x79, 0xf3, 0x66, 0xf6, 0xcd, + 0x0c, 0xf4, 0x13, 0x29, 0x13, 0x81, 0xc1, 0x98, 0x27, 0x86, 0x8d, 0x05, 0x06, 0x2c, 0x4e, 0x79, + 0x16, 0x38, 0x7b, 0x71, 0x7a, 0xed, 0x8f, 0xdc, 0x57, 0xa3, 0x5a, 0xf0, 0x09, 0x46, 0x29, 0x6a, + 0xcd, 0x12, 0xd4, 0xfe, 0x4c, 0x49, 0x23, 0xc9, 0x13, 0xc7, 0xe2, 0xff, 0x45, 0xfb, 0x96, 0xc5, + 0x77, 0xf6, 0xe2, 0xf4, 0xe8, 0xd5, 0xff, 0x55, 0x89, 0x99, 0x61, 0x8e, 0x99, 0xfe, 0xf6, 0x80, + 0xf4, 0x14, 0x32, 0x83, 0x5f, 0xf2, 0x50, 0x88, 0xdf, 0xe6, 0xa8, 0x0d, 0x21, 0xb0, 0x9b, 0xb1, + 0x14, 0x9b, 0x5e, 0xdb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9b, 0xa4, 0x34, 0x80, 0x96, 0x53, 0xe6, 0x96, + 0xdd, 0xd2, 0x9f, 0x1e, 0x1c, 0x76, 0xe7, 0xe2, 0xca, 0x65, 0x85, 0x72, 0x79, 0x3d, 0xf4, 0xc7, + 0x00, 0x6e, 0x1f, 0x37, 0x72, 0xea, 0xd6, 0xf3, 0x29, 0x7f, 0xe6, 0x33, 0xd8, 0x57, 0x72, 0x99, + 0x2f, 0x53, 0x34, 0x53, 0x38, 0xe5, 0xdf, 0xed, 0x23, 0x1b, 0x17, 0x3b, 0x61, 0x43, 0xc9, 0xe5, + 0x25, 0xae, 0x86, 0xd6, 0x4b, 0x5e, 0xc3, 0x51, 0x6c, 0xb9, 0x23, 0x26, 0x84, 0x3d, 0x8d, 0x68, + 0xaa, 0x64, 0x1a, 0xad, 0x17, 0xba, 0x76, 0xb1, 0x13, 0x3e, 0x72, 0x98, 0x77, 0x42, 0xf4, 0x99, + 0x61, 0xe7, 0x4a, 0xa6, 0x76, 0x60, 0xdd, 0x5a, 0xbe, 0x4f, 0x2a, 0x41, 0xd3, 0xfd, 0xe1, 0x01, + 0x9d, 0xc8, 0xb4, 0x44, 0x9b, 0xee, 0xd3, 0x6e, 0x11, 0xb0, 0xf9, 0x23, 0x77, 0xef, 0x1f, 0x8b, + 0x73, 0x1f, 0xe6, 0x37, 0x39, 0xf4, 0xbe, 0xf6, 0x0a, 0x92, 0x44, 0x0a, 0x96, 0x25, 0xbe, 0x54, + 0x49, 0x90, 0x60, 0x66, 0x2f, 0x36, 0x70, 0x21, 0x36, 0xe3, 0xfa, 0x5f, 0xe7, 0x7e, 0x66, 0x8d, + 0x71, 0xd5, 0xe2, 0x5f, 0xfe, 0x09, 0x00, 0x00, 0xff, 0xff, 0xf7, 0x08, 0x29, 0x16, 0x83, 0x04, + 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/bigtable/admin/v2/bigtable_instance_admin.pb.go b/vendor/google.golang.org/genproto/googleapis/bigtable/admin/v2/bigtable_instance_admin.pb.go new file mode 100644 index 0000000000..62f859169c --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/bigtable/admin/v2/bigtable_instance_admin.pb.go @@ -0,0 +1,962 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto + +/* +Package admin is a generated protocol buffer package. + +It is generated from these files: + google/bigtable/admin/v2/bigtable_instance_admin.proto + google/bigtable/admin/v2/bigtable_table_admin.proto + google/bigtable/admin/v2/common.proto + google/bigtable/admin/v2/instance.proto + google/bigtable/admin/v2/table.proto + +It has these top-level messages: + CreateInstanceRequest + GetInstanceRequest + ListInstancesRequest + ListInstancesResponse + DeleteInstanceRequest + CreateClusterRequest + GetClusterRequest + ListClustersRequest + ListClustersResponse + DeleteClusterRequest + CreateInstanceMetadata + CreateClusterMetadata + UpdateClusterMetadata + CreateTableRequest + DropRowRangeRequest + ListTablesRequest + ListTablesResponse + GetTableRequest + DeleteTableRequest + ModifyColumnFamiliesRequest + Instance + Cluster + Table + ColumnFamily + GcRule +*/ +package admin + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_longrunning "google.golang.org/genproto/googleapis/longrunning" +import google_protobuf3 "github.com/golang/protobuf/ptypes/empty" +import google_protobuf1 "github.com/golang/protobuf/ptypes/timestamp" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Request message for BigtableInstanceAdmin.CreateInstance. +type CreateInstanceRequest struct { + // The unique name of the project in which to create the new instance. + // Values are of the form `projects/`. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // The ID to be used when referring to the new instance within its project, + // e.g., just `myinstance` rather than + // `projects/myproject/instances/myinstance`. + InstanceId string `protobuf:"bytes,2,opt,name=instance_id,json=instanceId" json:"instance_id,omitempty"` + // The instance to create. + // Fields marked `OutputOnly` must be left blank. + Instance *Instance `protobuf:"bytes,3,opt,name=instance" json:"instance,omitempty"` + // The clusters to be created within the instance, mapped by desired + // cluster ID, e.g., just `mycluster` rather than + // `projects/myproject/instances/myinstance/clusters/mycluster`. + // Fields marked `OutputOnly` must be left blank. + // Currently exactly one cluster must be specified. + Clusters map[string]*Cluster `protobuf:"bytes,4,rep,name=clusters" json:"clusters,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *CreateInstanceRequest) Reset() { *m = CreateInstanceRequest{} } +func (m *CreateInstanceRequest) String() string { return proto.CompactTextString(m) } +func (*CreateInstanceRequest) ProtoMessage() {} +func (*CreateInstanceRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *CreateInstanceRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *CreateInstanceRequest) GetInstanceId() string { + if m != nil { + return m.InstanceId + } + return "" +} + +func (m *CreateInstanceRequest) GetInstance() *Instance { + if m != nil { + return m.Instance + } + return nil +} + +func (m *CreateInstanceRequest) GetClusters() map[string]*Cluster { + if m != nil { + return m.Clusters + } + return nil +} + +// Request message for BigtableInstanceAdmin.GetInstance. +type GetInstanceRequest struct { + // The unique name of the requested instance. Values are of the form + // `projects//instances/`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetInstanceRequest) Reset() { *m = GetInstanceRequest{} } +func (m *GetInstanceRequest) String() string { return proto.CompactTextString(m) } +func (*GetInstanceRequest) ProtoMessage() {} +func (*GetInstanceRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *GetInstanceRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Request message for BigtableInstanceAdmin.ListInstances. +type ListInstancesRequest struct { + // The unique name of the project for which a list of instances is requested. + // Values are of the form `projects/`. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // The value of `next_page_token` returned by a previous call. + PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListInstancesRequest) Reset() { *m = ListInstancesRequest{} } +func (m *ListInstancesRequest) String() string { return proto.CompactTextString(m) } +func (*ListInstancesRequest) ProtoMessage() {} +func (*ListInstancesRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *ListInstancesRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *ListInstancesRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// Response message for BigtableInstanceAdmin.ListInstances. +type ListInstancesResponse struct { + // The list of requested instances. + Instances []*Instance `protobuf:"bytes,1,rep,name=instances" json:"instances,omitempty"` + // Locations from which Instance information could not be retrieved, + // due to an outage or some other transient condition. + // Instances whose Clusters are all in one of the failed locations + // may be missing from `instances`, and Instances with at least one + // Cluster in a failed location may only have partial information returned. + FailedLocations []string `protobuf:"bytes,2,rep,name=failed_locations,json=failedLocations" json:"failed_locations,omitempty"` + // Set if not all instances could be returned in a single response. + // Pass this value to `page_token` in another request to get the next + // page of results. + NextPageToken string `protobuf:"bytes,3,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListInstancesResponse) Reset() { *m = ListInstancesResponse{} } +func (m *ListInstancesResponse) String() string { return proto.CompactTextString(m) } +func (*ListInstancesResponse) ProtoMessage() {} +func (*ListInstancesResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *ListInstancesResponse) GetInstances() []*Instance { + if m != nil { + return m.Instances + } + return nil +} + +func (m *ListInstancesResponse) GetFailedLocations() []string { + if m != nil { + return m.FailedLocations + } + return nil +} + +func (m *ListInstancesResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// Request message for BigtableInstanceAdmin.DeleteInstance. +type DeleteInstanceRequest struct { + // The unique name of the instance to be deleted. + // Values are of the form `projects//instances/`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *DeleteInstanceRequest) Reset() { *m = DeleteInstanceRequest{} } +func (m *DeleteInstanceRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteInstanceRequest) ProtoMessage() {} +func (*DeleteInstanceRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *DeleteInstanceRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Request message for BigtableInstanceAdmin.CreateCluster. +type CreateClusterRequest struct { + // The unique name of the instance in which to create the new cluster. + // Values are of the form + // `projects//instances/`. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // The ID to be used when referring to the new cluster within its instance, + // e.g., just `mycluster` rather than + // `projects/myproject/instances/myinstance/clusters/mycluster`. + ClusterId string `protobuf:"bytes,2,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The cluster to be created. + // Fields marked `OutputOnly` must be left blank. + Cluster *Cluster `protobuf:"bytes,3,opt,name=cluster" json:"cluster,omitempty"` +} + +func (m *CreateClusterRequest) Reset() { *m = CreateClusterRequest{} } +func (m *CreateClusterRequest) String() string { return proto.CompactTextString(m) } +func (*CreateClusterRequest) ProtoMessage() {} +func (*CreateClusterRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *CreateClusterRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *CreateClusterRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *CreateClusterRequest) GetCluster() *Cluster { + if m != nil { + return m.Cluster + } + return nil +} + +// Request message for BigtableInstanceAdmin.GetCluster. +type GetClusterRequest struct { + // The unique name of the requested cluster. Values are of the form + // `projects//instances//clusters/`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetClusterRequest) Reset() { *m = GetClusterRequest{} } +func (m *GetClusterRequest) String() string { return proto.CompactTextString(m) } +func (*GetClusterRequest) ProtoMessage() {} +func (*GetClusterRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *GetClusterRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Request message for BigtableInstanceAdmin.ListClusters. +type ListClustersRequest struct { + // The unique name of the instance for which a list of clusters is requested. + // Values are of the form `projects//instances/`. + // Use ` = '-'` to list Clusters for all Instances in a project, + // e.g., `projects/myproject/instances/-`. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // The value of `next_page_token` returned by a previous call. + PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListClustersRequest) Reset() { *m = ListClustersRequest{} } +func (m *ListClustersRequest) String() string { return proto.CompactTextString(m) } +func (*ListClustersRequest) ProtoMessage() {} +func (*ListClustersRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *ListClustersRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *ListClustersRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// Response message for BigtableInstanceAdmin.ListClusters. +type ListClustersResponse struct { + // The list of requested clusters. + Clusters []*Cluster `protobuf:"bytes,1,rep,name=clusters" json:"clusters,omitempty"` + // Locations from which Cluster information could not be retrieved, + // due to an outage or some other transient condition. + // Clusters from these locations may be missing from `clusters`, + // or may only have partial information returned. + FailedLocations []string `protobuf:"bytes,2,rep,name=failed_locations,json=failedLocations" json:"failed_locations,omitempty"` + // Set if not all clusters could be returned in a single response. + // Pass this value to `page_token` in another request to get the next + // page of results. + NextPageToken string `protobuf:"bytes,3,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListClustersResponse) Reset() { *m = ListClustersResponse{} } +func (m *ListClustersResponse) String() string { return proto.CompactTextString(m) } +func (*ListClustersResponse) ProtoMessage() {} +func (*ListClustersResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *ListClustersResponse) GetClusters() []*Cluster { + if m != nil { + return m.Clusters + } + return nil +} + +func (m *ListClustersResponse) GetFailedLocations() []string { + if m != nil { + return m.FailedLocations + } + return nil +} + +func (m *ListClustersResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// Request message for BigtableInstanceAdmin.DeleteCluster. +type DeleteClusterRequest struct { + // The unique name of the cluster to be deleted. Values are of the form + // `projects//instances//clusters/`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *DeleteClusterRequest) Reset() { *m = DeleteClusterRequest{} } +func (m *DeleteClusterRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteClusterRequest) ProtoMessage() {} +func (*DeleteClusterRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *DeleteClusterRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// The metadata for the Operation returned by CreateInstance. +type CreateInstanceMetadata struct { + // The request that prompted the initiation of this CreateInstance operation. + OriginalRequest *CreateInstanceRequest `protobuf:"bytes,1,opt,name=original_request,json=originalRequest" json:"original_request,omitempty"` + // The time at which the original request was received. + RequestTime *google_protobuf1.Timestamp `protobuf:"bytes,2,opt,name=request_time,json=requestTime" json:"request_time,omitempty"` + // The time at which the operation failed or was completed successfully. + FinishTime *google_protobuf1.Timestamp `protobuf:"bytes,3,opt,name=finish_time,json=finishTime" json:"finish_time,omitempty"` +} + +func (m *CreateInstanceMetadata) Reset() { *m = CreateInstanceMetadata{} } +func (m *CreateInstanceMetadata) String() string { return proto.CompactTextString(m) } +func (*CreateInstanceMetadata) ProtoMessage() {} +func (*CreateInstanceMetadata) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *CreateInstanceMetadata) GetOriginalRequest() *CreateInstanceRequest { + if m != nil { + return m.OriginalRequest + } + return nil +} + +func (m *CreateInstanceMetadata) GetRequestTime() *google_protobuf1.Timestamp { + if m != nil { + return m.RequestTime + } + return nil +} + +func (m *CreateInstanceMetadata) GetFinishTime() *google_protobuf1.Timestamp { + if m != nil { + return m.FinishTime + } + return nil +} + +// The metadata for the Operation returned by CreateCluster. +type CreateClusterMetadata struct { + // The request that prompted the initiation of this CreateCluster operation. + OriginalRequest *CreateClusterRequest `protobuf:"bytes,1,opt,name=original_request,json=originalRequest" json:"original_request,omitempty"` + // The time at which the original request was received. + RequestTime *google_protobuf1.Timestamp `protobuf:"bytes,2,opt,name=request_time,json=requestTime" json:"request_time,omitempty"` + // The time at which the operation failed or was completed successfully. + FinishTime *google_protobuf1.Timestamp `protobuf:"bytes,3,opt,name=finish_time,json=finishTime" json:"finish_time,omitempty"` +} + +func (m *CreateClusterMetadata) Reset() { *m = CreateClusterMetadata{} } +func (m *CreateClusterMetadata) String() string { return proto.CompactTextString(m) } +func (*CreateClusterMetadata) ProtoMessage() {} +func (*CreateClusterMetadata) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } + +func (m *CreateClusterMetadata) GetOriginalRequest() *CreateClusterRequest { + if m != nil { + return m.OriginalRequest + } + return nil +} + +func (m *CreateClusterMetadata) GetRequestTime() *google_protobuf1.Timestamp { + if m != nil { + return m.RequestTime + } + return nil +} + +func (m *CreateClusterMetadata) GetFinishTime() *google_protobuf1.Timestamp { + if m != nil { + return m.FinishTime + } + return nil +} + +// The metadata for the Operation returned by UpdateCluster. +type UpdateClusterMetadata struct { + // The request that prompted the initiation of this UpdateCluster operation. + OriginalRequest *Cluster `protobuf:"bytes,1,opt,name=original_request,json=originalRequest" json:"original_request,omitempty"` + // The time at which the original request was received. + RequestTime *google_protobuf1.Timestamp `protobuf:"bytes,2,opt,name=request_time,json=requestTime" json:"request_time,omitempty"` + // The time at which the operation failed or was completed successfully. + FinishTime *google_protobuf1.Timestamp `protobuf:"bytes,3,opt,name=finish_time,json=finishTime" json:"finish_time,omitempty"` +} + +func (m *UpdateClusterMetadata) Reset() { *m = UpdateClusterMetadata{} } +func (m *UpdateClusterMetadata) String() string { return proto.CompactTextString(m) } +func (*UpdateClusterMetadata) ProtoMessage() {} +func (*UpdateClusterMetadata) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } + +func (m *UpdateClusterMetadata) GetOriginalRequest() *Cluster { + if m != nil { + return m.OriginalRequest + } + return nil +} + +func (m *UpdateClusterMetadata) GetRequestTime() *google_protobuf1.Timestamp { + if m != nil { + return m.RequestTime + } + return nil +} + +func (m *UpdateClusterMetadata) GetFinishTime() *google_protobuf1.Timestamp { + if m != nil { + return m.FinishTime + } + return nil +} + +func init() { + proto.RegisterType((*CreateInstanceRequest)(nil), "google.bigtable.admin.v2.CreateInstanceRequest") + proto.RegisterType((*GetInstanceRequest)(nil), "google.bigtable.admin.v2.GetInstanceRequest") + proto.RegisterType((*ListInstancesRequest)(nil), "google.bigtable.admin.v2.ListInstancesRequest") + proto.RegisterType((*ListInstancesResponse)(nil), "google.bigtable.admin.v2.ListInstancesResponse") + proto.RegisterType((*DeleteInstanceRequest)(nil), "google.bigtable.admin.v2.DeleteInstanceRequest") + proto.RegisterType((*CreateClusterRequest)(nil), "google.bigtable.admin.v2.CreateClusterRequest") + proto.RegisterType((*GetClusterRequest)(nil), "google.bigtable.admin.v2.GetClusterRequest") + proto.RegisterType((*ListClustersRequest)(nil), "google.bigtable.admin.v2.ListClustersRequest") + proto.RegisterType((*ListClustersResponse)(nil), "google.bigtable.admin.v2.ListClustersResponse") + proto.RegisterType((*DeleteClusterRequest)(nil), "google.bigtable.admin.v2.DeleteClusterRequest") + proto.RegisterType((*CreateInstanceMetadata)(nil), "google.bigtable.admin.v2.CreateInstanceMetadata") + proto.RegisterType((*CreateClusterMetadata)(nil), "google.bigtable.admin.v2.CreateClusterMetadata") + proto.RegisterType((*UpdateClusterMetadata)(nil), "google.bigtable.admin.v2.UpdateClusterMetadata") +} + +// 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 + +// Client API for BigtableInstanceAdmin service + +type BigtableInstanceAdminClient interface { + // Create an instance within a project. + CreateInstance(ctx context.Context, in *CreateInstanceRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Gets information about an instance. + GetInstance(ctx context.Context, in *GetInstanceRequest, opts ...grpc.CallOption) (*Instance, error) + // Lists information about instances in a project. + ListInstances(ctx context.Context, in *ListInstancesRequest, opts ...grpc.CallOption) (*ListInstancesResponse, error) + // Updates an instance within a project. + UpdateInstance(ctx context.Context, in *Instance, opts ...grpc.CallOption) (*Instance, error) + // Delete an instance from a project. + DeleteInstance(ctx context.Context, in *DeleteInstanceRequest, opts ...grpc.CallOption) (*google_protobuf3.Empty, error) + // Creates a cluster within an instance. + CreateCluster(ctx context.Context, in *CreateClusterRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Gets information about a cluster. + GetCluster(ctx context.Context, in *GetClusterRequest, opts ...grpc.CallOption) (*Cluster, error) + // Lists information about clusters in an instance. + ListClusters(ctx context.Context, in *ListClustersRequest, opts ...grpc.CallOption) (*ListClustersResponse, error) + // Updates a cluster within an instance. + UpdateCluster(ctx context.Context, in *Cluster, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Deletes a cluster from an instance. + DeleteCluster(ctx context.Context, in *DeleteClusterRequest, opts ...grpc.CallOption) (*google_protobuf3.Empty, error) +} + +type bigtableInstanceAdminClient struct { + cc *grpc.ClientConn +} + +func NewBigtableInstanceAdminClient(cc *grpc.ClientConn) BigtableInstanceAdminClient { + return &bigtableInstanceAdminClient{cc} +} + +func (c *bigtableInstanceAdminClient) CreateInstance(ctx context.Context, in *CreateInstanceRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.bigtable.admin.v2.BigtableInstanceAdmin/CreateInstance", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bigtableInstanceAdminClient) GetInstance(ctx context.Context, in *GetInstanceRequest, opts ...grpc.CallOption) (*Instance, error) { + out := new(Instance) + err := grpc.Invoke(ctx, "/google.bigtable.admin.v2.BigtableInstanceAdmin/GetInstance", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bigtableInstanceAdminClient) ListInstances(ctx context.Context, in *ListInstancesRequest, opts ...grpc.CallOption) (*ListInstancesResponse, error) { + out := new(ListInstancesResponse) + err := grpc.Invoke(ctx, "/google.bigtable.admin.v2.BigtableInstanceAdmin/ListInstances", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bigtableInstanceAdminClient) UpdateInstance(ctx context.Context, in *Instance, opts ...grpc.CallOption) (*Instance, error) { + out := new(Instance) + err := grpc.Invoke(ctx, "/google.bigtable.admin.v2.BigtableInstanceAdmin/UpdateInstance", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bigtableInstanceAdminClient) DeleteInstance(ctx context.Context, in *DeleteInstanceRequest, opts ...grpc.CallOption) (*google_protobuf3.Empty, error) { + out := new(google_protobuf3.Empty) + err := grpc.Invoke(ctx, "/google.bigtable.admin.v2.BigtableInstanceAdmin/DeleteInstance", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bigtableInstanceAdminClient) CreateCluster(ctx context.Context, in *CreateClusterRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.bigtable.admin.v2.BigtableInstanceAdmin/CreateCluster", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bigtableInstanceAdminClient) GetCluster(ctx context.Context, in *GetClusterRequest, opts ...grpc.CallOption) (*Cluster, error) { + out := new(Cluster) + err := grpc.Invoke(ctx, "/google.bigtable.admin.v2.BigtableInstanceAdmin/GetCluster", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bigtableInstanceAdminClient) ListClusters(ctx context.Context, in *ListClustersRequest, opts ...grpc.CallOption) (*ListClustersResponse, error) { + out := new(ListClustersResponse) + err := grpc.Invoke(ctx, "/google.bigtable.admin.v2.BigtableInstanceAdmin/ListClusters", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bigtableInstanceAdminClient) UpdateCluster(ctx context.Context, in *Cluster, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.bigtable.admin.v2.BigtableInstanceAdmin/UpdateCluster", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bigtableInstanceAdminClient) DeleteCluster(ctx context.Context, in *DeleteClusterRequest, opts ...grpc.CallOption) (*google_protobuf3.Empty, error) { + out := new(google_protobuf3.Empty) + err := grpc.Invoke(ctx, "/google.bigtable.admin.v2.BigtableInstanceAdmin/DeleteCluster", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for BigtableInstanceAdmin service + +type BigtableInstanceAdminServer interface { + // Create an instance within a project. + CreateInstance(context.Context, *CreateInstanceRequest) (*google_longrunning.Operation, error) + // Gets information about an instance. + GetInstance(context.Context, *GetInstanceRequest) (*Instance, error) + // Lists information about instances in a project. + ListInstances(context.Context, *ListInstancesRequest) (*ListInstancesResponse, error) + // Updates an instance within a project. + UpdateInstance(context.Context, *Instance) (*Instance, error) + // Delete an instance from a project. + DeleteInstance(context.Context, *DeleteInstanceRequest) (*google_protobuf3.Empty, error) + // Creates a cluster within an instance. + CreateCluster(context.Context, *CreateClusterRequest) (*google_longrunning.Operation, error) + // Gets information about a cluster. + GetCluster(context.Context, *GetClusterRequest) (*Cluster, error) + // Lists information about clusters in an instance. + ListClusters(context.Context, *ListClustersRequest) (*ListClustersResponse, error) + // Updates a cluster within an instance. + UpdateCluster(context.Context, *Cluster) (*google_longrunning.Operation, error) + // Deletes a cluster from an instance. + DeleteCluster(context.Context, *DeleteClusterRequest) (*google_protobuf3.Empty, error) +} + +func RegisterBigtableInstanceAdminServer(s *grpc.Server, srv BigtableInstanceAdminServer) { + s.RegisterService(&_BigtableInstanceAdmin_serviceDesc, srv) +} + +func _BigtableInstanceAdmin_CreateInstance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateInstanceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BigtableInstanceAdminServer).CreateInstance(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.bigtable.admin.v2.BigtableInstanceAdmin/CreateInstance", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BigtableInstanceAdminServer).CreateInstance(ctx, req.(*CreateInstanceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BigtableInstanceAdmin_GetInstance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetInstanceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BigtableInstanceAdminServer).GetInstance(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.bigtable.admin.v2.BigtableInstanceAdmin/GetInstance", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BigtableInstanceAdminServer).GetInstance(ctx, req.(*GetInstanceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BigtableInstanceAdmin_ListInstances_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListInstancesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BigtableInstanceAdminServer).ListInstances(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.bigtable.admin.v2.BigtableInstanceAdmin/ListInstances", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BigtableInstanceAdminServer).ListInstances(ctx, req.(*ListInstancesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BigtableInstanceAdmin_UpdateInstance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Instance) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BigtableInstanceAdminServer).UpdateInstance(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.bigtable.admin.v2.BigtableInstanceAdmin/UpdateInstance", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BigtableInstanceAdminServer).UpdateInstance(ctx, req.(*Instance)) + } + return interceptor(ctx, in, info, handler) +} + +func _BigtableInstanceAdmin_DeleteInstance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteInstanceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BigtableInstanceAdminServer).DeleteInstance(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.bigtable.admin.v2.BigtableInstanceAdmin/DeleteInstance", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BigtableInstanceAdminServer).DeleteInstance(ctx, req.(*DeleteInstanceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BigtableInstanceAdmin_CreateCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateClusterRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BigtableInstanceAdminServer).CreateCluster(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.bigtable.admin.v2.BigtableInstanceAdmin/CreateCluster", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BigtableInstanceAdminServer).CreateCluster(ctx, req.(*CreateClusterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BigtableInstanceAdmin_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.(BigtableInstanceAdminServer).GetCluster(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.bigtable.admin.v2.BigtableInstanceAdmin/GetCluster", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BigtableInstanceAdminServer).GetCluster(ctx, req.(*GetClusterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BigtableInstanceAdmin_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.(BigtableInstanceAdminServer).ListClusters(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.bigtable.admin.v2.BigtableInstanceAdmin/ListClusters", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BigtableInstanceAdminServer).ListClusters(ctx, req.(*ListClustersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BigtableInstanceAdmin_UpdateCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Cluster) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BigtableInstanceAdminServer).UpdateCluster(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.bigtable.admin.v2.BigtableInstanceAdmin/UpdateCluster", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BigtableInstanceAdminServer).UpdateCluster(ctx, req.(*Cluster)) + } + return interceptor(ctx, in, info, handler) +} + +func _BigtableInstanceAdmin_DeleteCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteClusterRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BigtableInstanceAdminServer).DeleteCluster(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.bigtable.admin.v2.BigtableInstanceAdmin/DeleteCluster", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BigtableInstanceAdminServer).DeleteCluster(ctx, req.(*DeleteClusterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _BigtableInstanceAdmin_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.bigtable.admin.v2.BigtableInstanceAdmin", + HandlerType: (*BigtableInstanceAdminServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateInstance", + Handler: _BigtableInstanceAdmin_CreateInstance_Handler, + }, + { + MethodName: "GetInstance", + Handler: _BigtableInstanceAdmin_GetInstance_Handler, + }, + { + MethodName: "ListInstances", + Handler: _BigtableInstanceAdmin_ListInstances_Handler, + }, + { + MethodName: "UpdateInstance", + Handler: _BigtableInstanceAdmin_UpdateInstance_Handler, + }, + { + MethodName: "DeleteInstance", + Handler: _BigtableInstanceAdmin_DeleteInstance_Handler, + }, + { + MethodName: "CreateCluster", + Handler: _BigtableInstanceAdmin_CreateCluster_Handler, + }, + { + MethodName: "GetCluster", + Handler: _BigtableInstanceAdmin_GetCluster_Handler, + }, + { + MethodName: "ListClusters", + Handler: _BigtableInstanceAdmin_ListClusters_Handler, + }, + { + MethodName: "UpdateCluster", + Handler: _BigtableInstanceAdmin_UpdateCluster_Handler, + }, + { + MethodName: "DeleteCluster", + Handler: _BigtableInstanceAdmin_DeleteCluster_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/bigtable/admin/v2/bigtable_instance_admin.proto", +} + +func init() { + proto.RegisterFile("google/bigtable/admin/v2/bigtable_instance_admin.proto", fileDescriptor0) +} + +var fileDescriptor0 = []byte{ + // 1026 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0xc1, 0x6f, 0x1b, 0xc5, + 0x17, 0xd6, 0xd8, 0xfd, 0xf5, 0x57, 0xbf, 0xad, 0x93, 0x30, 0xc4, 0x91, 0xb5, 0xb4, 0x34, 0xdd, + 0x4a, 0xad, 0xeb, 0x86, 0x5d, 0x61, 0x10, 0x41, 0x89, 0x8c, 0x20, 0xa1, 0x8a, 0x22, 0xa5, 0x22, + 0xb2, 0x0a, 0x52, 0x7b, 0xc0, 0x9a, 0xd8, 0x93, 0x65, 0xe9, 0x7a, 0x76, 0xd9, 0x1d, 0x47, 0x44, + 0xa8, 0x17, 0x84, 0x38, 0x54, 0x82, 0x03, 0x1c, 0x81, 0x13, 0x17, 0x84, 0xf8, 0x4f, 0x38, 0x72, + 0xe4, 0x84, 0xc4, 0x19, 0xf1, 0x27, 0xa0, 0xd9, 0x99, 0x59, 0x7b, 0x9d, 0xb5, 0x77, 0x2d, 0x84, + 0xd4, 0x9b, 0x77, 0xe6, 0xbd, 0x37, 0xdf, 0xfb, 0xde, 0x37, 0xef, 0x8d, 0xe1, 0x0d, 0x37, 0x08, + 0x5c, 0x9f, 0x3a, 0x27, 0x9e, 0xcb, 0xc9, 0x89, 0x4f, 0x1d, 0x32, 0x1c, 0x79, 0xcc, 0x39, 0xeb, + 0xa4, 0x2b, 0x7d, 0x8f, 0xc5, 0x9c, 0xb0, 0x01, 0xed, 0x27, 0x5b, 0x76, 0x18, 0x05, 0x3c, 0xc0, + 0x4d, 0xe9, 0x67, 0x6b, 0x2b, 0x5b, 0x6e, 0x9e, 0x75, 0xcc, 0x6b, 0x2a, 0x22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0x72, 0xe3, 0x57, 0x16, 0x2b, 0x76, 0xe6, 0xc1, 0x60, 0xda, 0x65, + 0xcd, 0x95, 0xbe, 0xb3, 0x28, 0x4b, 0x72, 0x28, 0xba, 0x42, 0x3d, 0xd3, 0xa4, 0x71, 0x31, 0x21, + 0x45, 0xd5, 0xdc, 0x4e, 0x90, 0xbc, 0x6a, 0x2e, 0xc5, 0x97, 0x90, 0xfb, 0x57, 0x08, 0xea, 0x99, + 0x27, 0xc4, 0x22, 0x9d, 0xe5, 0xbd, 0x35, 0xe6, 0x8a, 0x5d, 0x91, 0xd3, 0x5e, 0x0a, 0xd2, 0xde, + 0xf7, 0x08, 0xae, 0x0d, 0x82, 0xd1, 0x5c, 0x0c, 0x7b, 0x66, 0x6e, 0xef, 0x3f, 0x16, 0x67, 0x1f, + 0xa3, 0xc7, 0x5d, 0xe5, 0xe7, 0x06, 0x3e, 0x61, 0xae, 0x1d, 0x44, 0xae, 0xe3, 0x52, 0x96, 0x20, + 0x73, 0xe4, 0x16, 0x09, 0xbd, 0xf8, 0xe2, 0xbf, 0xc1, 0xdd, 0xe4, 0xc7, 0xcf, 0x95, 0x97, 0x0f, + 0xa4, 0xff, 0xbe, 0x1f, 0x8c, 0x87, 0xb6, 0x3e, 0xca, 0x4e, 0xce, 0xb0, 0x3f, 0xe8, 0x9c, 0x5c, + 0x4e, 0x42, 0xbd, 0xf6, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x55, 0x18, 0xc5, 0x74, 0xc7, 0x0e, + 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/bigtable/admin/v2/bigtable_table_admin.pb.go b/vendor/google.golang.org/genproto/googleapis/bigtable/admin/v2/bigtable_table_admin.pb.go new file mode 100644 index 0000000000..981dd5986a --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/bigtable/admin/v2/bigtable_table_admin.pb.go @@ -0,0 +1,900 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/bigtable/admin/v2/bigtable_table_admin.proto + +package admin + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import _ "google.golang.org/genproto/googleapis/longrunning" +import _ "github.com/golang/protobuf/ptypes/duration" +import google_protobuf3 "github.com/golang/protobuf/ptypes/empty" +import _ "github.com/golang/protobuf/ptypes/timestamp" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Request message for +// [google.bigtable.admin.v2.BigtableTableAdmin.CreateTable][google.bigtable.admin.v2.BigtableTableAdmin.CreateTable] +type CreateTableRequest struct { + // The unique name of the instance in which to create the table. + // Values are of the form `projects//instances/`. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // The name by which the new table should be referred to within the parent + // instance, e.g., `foobar` rather than `/tables/foobar`. + TableId string `protobuf:"bytes,2,opt,name=table_id,json=tableId" json:"table_id,omitempty"` + // The Table to create. + Table *Table `protobuf:"bytes,3,opt,name=table" json:"table,omitempty"` + // The optional list of row keys that will be used to initially split the + // table into several tablets (tablets are similar to HBase regions). + // Given two split keys, `s1` and `s2`, three tablets will be created, + // spanning the key ranges: `[, s1), [s1, s2), [s2, )`. + // + // Example: + // + // * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",` + // `"other", "zz"]` + // * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` + // * Key assignment: + // - Tablet 1 `[, apple) => {"a"}.` + // - Tablet 2 `[apple, customer_1) => {"apple", "custom"}.` + // - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.` + // - Tablet 4 `[customer_2, other) => {"customer_2"}.` + // - Tablet 5 `[other, ) => {"other", "zz"}.` + InitialSplits []*CreateTableRequest_Split `protobuf:"bytes,4,rep,name=initial_splits,json=initialSplits" json:"initial_splits,omitempty"` +} + +func (m *CreateTableRequest) Reset() { *m = CreateTableRequest{} } +func (m *CreateTableRequest) String() string { return proto.CompactTextString(m) } +func (*CreateTableRequest) ProtoMessage() {} +func (*CreateTableRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +func (m *CreateTableRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *CreateTableRequest) GetTableId() string { + if m != nil { + return m.TableId + } + return "" +} + +func (m *CreateTableRequest) GetTable() *Table { + if m != nil { + return m.Table + } + return nil +} + +func (m *CreateTableRequest) GetInitialSplits() []*CreateTableRequest_Split { + if m != nil { + return m.InitialSplits + } + return nil +} + +// An initial split point for a newly created table. +type CreateTableRequest_Split struct { + // Row key to use as an initial tablet boundary. + Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` +} + +func (m *CreateTableRequest_Split) Reset() { *m = CreateTableRequest_Split{} } +func (m *CreateTableRequest_Split) String() string { return proto.CompactTextString(m) } +func (*CreateTableRequest_Split) ProtoMessage() {} +func (*CreateTableRequest_Split) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0, 0} } + +func (m *CreateTableRequest_Split) GetKey() []byte { + if m != nil { + return m.Key + } + return nil +} + +// Request message for +// [google.bigtable.admin.v2.BigtableTableAdmin.DropRowRange][google.bigtable.admin.v2.BigtableTableAdmin.DropRowRange] +type DropRowRangeRequest struct { + // The unique name of the table on which to drop a range of rows. + // Values are of the form + // `projects//instances//tables/`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Delete all rows or by prefix. + // + // Types that are valid to be assigned to Target: + // *DropRowRangeRequest_RowKeyPrefix + // *DropRowRangeRequest_DeleteAllDataFromTable + Target isDropRowRangeRequest_Target `protobuf_oneof:"target"` +} + +func (m *DropRowRangeRequest) Reset() { *m = DropRowRangeRequest{} } +func (m *DropRowRangeRequest) String() string { return proto.CompactTextString(m) } +func (*DropRowRangeRequest) ProtoMessage() {} +func (*DropRowRangeRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} } + +type isDropRowRangeRequest_Target interface { + isDropRowRangeRequest_Target() +} + +type DropRowRangeRequest_RowKeyPrefix struct { + RowKeyPrefix []byte `protobuf:"bytes,2,opt,name=row_key_prefix,json=rowKeyPrefix,proto3,oneof"` +} +type DropRowRangeRequest_DeleteAllDataFromTable struct { + DeleteAllDataFromTable bool `protobuf:"varint,3,opt,name=delete_all_data_from_table,json=deleteAllDataFromTable,oneof"` +} + +func (*DropRowRangeRequest_RowKeyPrefix) isDropRowRangeRequest_Target() {} +func (*DropRowRangeRequest_DeleteAllDataFromTable) isDropRowRangeRequest_Target() {} + +func (m *DropRowRangeRequest) GetTarget() isDropRowRangeRequest_Target { + if m != nil { + return m.Target + } + return nil +} + +func (m *DropRowRangeRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *DropRowRangeRequest) GetRowKeyPrefix() []byte { + if x, ok := m.GetTarget().(*DropRowRangeRequest_RowKeyPrefix); ok { + return x.RowKeyPrefix + } + return nil +} + +func (m *DropRowRangeRequest) GetDeleteAllDataFromTable() bool { + if x, ok := m.GetTarget().(*DropRowRangeRequest_DeleteAllDataFromTable); ok { + return x.DeleteAllDataFromTable + } + return false +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*DropRowRangeRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _DropRowRangeRequest_OneofMarshaler, _DropRowRangeRequest_OneofUnmarshaler, _DropRowRangeRequest_OneofSizer, []interface{}{ + (*DropRowRangeRequest_RowKeyPrefix)(nil), + (*DropRowRangeRequest_DeleteAllDataFromTable)(nil), + } +} + +func _DropRowRangeRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*DropRowRangeRequest) + // target + switch x := m.Target.(type) { + case *DropRowRangeRequest_RowKeyPrefix: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeRawBytes(x.RowKeyPrefix) + case *DropRowRangeRequest_DeleteAllDataFromTable: + t := uint64(0) + if x.DeleteAllDataFromTable { + t = 1 + } + b.EncodeVarint(3<<3 | proto.WireVarint) + b.EncodeVarint(t) + case nil: + default: + return fmt.Errorf("DropRowRangeRequest.Target has unexpected type %T", x) + } + return nil +} + +func _DropRowRangeRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*DropRowRangeRequest) + switch tag { + case 2: // target.row_key_prefix + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.Target = &DropRowRangeRequest_RowKeyPrefix{x} + return true, err + case 3: // target.delete_all_data_from_table + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Target = &DropRowRangeRequest_DeleteAllDataFromTable{x != 0} + return true, err + default: + return false, nil + } +} + +func _DropRowRangeRequest_OneofSizer(msg proto.Message) (n int) { + m := msg.(*DropRowRangeRequest) + // target + switch x := m.Target.(type) { + case *DropRowRangeRequest_RowKeyPrefix: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.RowKeyPrefix))) + n += len(x.RowKeyPrefix) + case *DropRowRangeRequest_DeleteAllDataFromTable: + n += proto.SizeVarint(3<<3 | proto.WireVarint) + n += 1 + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Request message for +// [google.bigtable.admin.v2.BigtableTableAdmin.ListTables][google.bigtable.admin.v2.BigtableTableAdmin.ListTables] +type ListTablesRequest struct { + // The unique name of the instance for which tables should be listed. + // Values are of the form `projects//instances/`. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // The view to be applied to the returned tables' fields. + // Defaults to `NAME_ONLY` if unspecified; no others are currently supported. + View Table_View `protobuf:"varint,2,opt,name=view,enum=google.bigtable.admin.v2.Table_View" json:"view,omitempty"` + // The value of `next_page_token` returned by a previous call. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListTablesRequest) Reset() { *m = ListTablesRequest{} } +func (m *ListTablesRequest) String() string { return proto.CompactTextString(m) } +func (*ListTablesRequest) ProtoMessage() {} +func (*ListTablesRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} } + +func (m *ListTablesRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *ListTablesRequest) GetView() Table_View { + if m != nil { + return m.View + } + return Table_VIEW_UNSPECIFIED +} + +func (m *ListTablesRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// Response message for +// [google.bigtable.admin.v2.BigtableTableAdmin.ListTables][google.bigtable.admin.v2.BigtableTableAdmin.ListTables] +type ListTablesResponse struct { + // The tables present in the requested instance. + Tables []*Table `protobuf:"bytes,1,rep,name=tables" json:"tables,omitempty"` + // Set if not all tables could be returned in a single response. + // Pass this value to `page_token` in another request to get the next + // page of results. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListTablesResponse) Reset() { *m = ListTablesResponse{} } +func (m *ListTablesResponse) String() string { return proto.CompactTextString(m) } +func (*ListTablesResponse) ProtoMessage() {} +func (*ListTablesResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{3} } + +func (m *ListTablesResponse) GetTables() []*Table { + if m != nil { + return m.Tables + } + return nil +} + +func (m *ListTablesResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// Request message for +// [google.bigtable.admin.v2.BigtableTableAdmin.GetTable][google.bigtable.admin.v2.BigtableTableAdmin.GetTable] +type GetTableRequest struct { + // The unique name of the requested table. + // Values are of the form + // `projects//instances//tables/
`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The view to be applied to the returned table's fields. + // Defaults to `SCHEMA_VIEW` if unspecified. + View Table_View `protobuf:"varint,2,opt,name=view,enum=google.bigtable.admin.v2.Table_View" json:"view,omitempty"` +} + +func (m *GetTableRequest) Reset() { *m = GetTableRequest{} } +func (m *GetTableRequest) String() string { return proto.CompactTextString(m) } +func (*GetTableRequest) ProtoMessage() {} +func (*GetTableRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{4} } + +func (m *GetTableRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *GetTableRequest) GetView() Table_View { + if m != nil { + return m.View + } + return Table_VIEW_UNSPECIFIED +} + +// Request message for +// [google.bigtable.admin.v2.BigtableTableAdmin.DeleteTable][google.bigtable.admin.v2.BigtableTableAdmin.DeleteTable] +type DeleteTableRequest struct { + // The unique name of the table to be deleted. + // Values are of the form + // `projects//instances//tables/
`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *DeleteTableRequest) Reset() { *m = DeleteTableRequest{} } +func (m *DeleteTableRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteTableRequest) ProtoMessage() {} +func (*DeleteTableRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{5} } + +func (m *DeleteTableRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Request message for +// [google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamilies][google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamilies] +type ModifyColumnFamiliesRequest struct { + // The unique name of the table whose families should be modified. + // Values are of the form + // `projects//instances//tables/
`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Modifications to be atomically applied to the specified table's families. + // Entries are applied in order, meaning that earlier modifications can be + // masked by later ones (in the case of repeated updates to the same family, + // for example). + Modifications []*ModifyColumnFamiliesRequest_Modification `protobuf:"bytes,2,rep,name=modifications" json:"modifications,omitempty"` +} + +func (m *ModifyColumnFamiliesRequest) Reset() { *m = ModifyColumnFamiliesRequest{} } +func (m *ModifyColumnFamiliesRequest) String() string { return proto.CompactTextString(m) } +func (*ModifyColumnFamiliesRequest) ProtoMessage() {} +func (*ModifyColumnFamiliesRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{6} } + +func (m *ModifyColumnFamiliesRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ModifyColumnFamiliesRequest) GetModifications() []*ModifyColumnFamiliesRequest_Modification { + if m != nil { + return m.Modifications + } + return nil +} + +// A create, update, or delete of a particular column family. +type ModifyColumnFamiliesRequest_Modification struct { + // The ID of the column family to be modified. + Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + // Column familiy modifications. + // + // Types that are valid to be assigned to Mod: + // *ModifyColumnFamiliesRequest_Modification_Create + // *ModifyColumnFamiliesRequest_Modification_Update + // *ModifyColumnFamiliesRequest_Modification_Drop + Mod isModifyColumnFamiliesRequest_Modification_Mod `protobuf_oneof:"mod"` +} + +func (m *ModifyColumnFamiliesRequest_Modification) Reset() { + *m = ModifyColumnFamiliesRequest_Modification{} +} +func (m *ModifyColumnFamiliesRequest_Modification) String() string { return proto.CompactTextString(m) } +func (*ModifyColumnFamiliesRequest_Modification) ProtoMessage() {} +func (*ModifyColumnFamiliesRequest_Modification) Descriptor() ([]byte, []int) { + return fileDescriptor1, []int{6, 0} +} + +type isModifyColumnFamiliesRequest_Modification_Mod interface { + isModifyColumnFamiliesRequest_Modification_Mod() +} + +type ModifyColumnFamiliesRequest_Modification_Create struct { + Create *ColumnFamily `protobuf:"bytes,2,opt,name=create,oneof"` +} +type ModifyColumnFamiliesRequest_Modification_Update struct { + Update *ColumnFamily `protobuf:"bytes,3,opt,name=update,oneof"` +} +type ModifyColumnFamiliesRequest_Modification_Drop struct { + Drop bool `protobuf:"varint,4,opt,name=drop,oneof"` +} + +func (*ModifyColumnFamiliesRequest_Modification_Create) isModifyColumnFamiliesRequest_Modification_Mod() { +} +func (*ModifyColumnFamiliesRequest_Modification_Update) isModifyColumnFamiliesRequest_Modification_Mod() { +} +func (*ModifyColumnFamiliesRequest_Modification_Drop) isModifyColumnFamiliesRequest_Modification_Mod() { +} + +func (m *ModifyColumnFamiliesRequest_Modification) GetMod() isModifyColumnFamiliesRequest_Modification_Mod { + if m != nil { + return m.Mod + } + return nil +} + +func (m *ModifyColumnFamiliesRequest_Modification) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *ModifyColumnFamiliesRequest_Modification) GetCreate() *ColumnFamily { + if x, ok := m.GetMod().(*ModifyColumnFamiliesRequest_Modification_Create); ok { + return x.Create + } + return nil +} + +func (m *ModifyColumnFamiliesRequest_Modification) GetUpdate() *ColumnFamily { + if x, ok := m.GetMod().(*ModifyColumnFamiliesRequest_Modification_Update); ok { + return x.Update + } + return nil +} + +func (m *ModifyColumnFamiliesRequest_Modification) GetDrop() bool { + if x, ok := m.GetMod().(*ModifyColumnFamiliesRequest_Modification_Drop); ok { + return x.Drop + } + return false +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*ModifyColumnFamiliesRequest_Modification) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _ModifyColumnFamiliesRequest_Modification_OneofMarshaler, _ModifyColumnFamiliesRequest_Modification_OneofUnmarshaler, _ModifyColumnFamiliesRequest_Modification_OneofSizer, []interface{}{ + (*ModifyColumnFamiliesRequest_Modification_Create)(nil), + (*ModifyColumnFamiliesRequest_Modification_Update)(nil), + (*ModifyColumnFamiliesRequest_Modification_Drop)(nil), + } +} + +func _ModifyColumnFamiliesRequest_Modification_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*ModifyColumnFamiliesRequest_Modification) + // mod + switch x := m.Mod.(type) { + case *ModifyColumnFamiliesRequest_Modification_Create: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Create); err != nil { + return err + } + case *ModifyColumnFamiliesRequest_Modification_Update: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Update); err != nil { + return err + } + case *ModifyColumnFamiliesRequest_Modification_Drop: + t := uint64(0) + if x.Drop { + t = 1 + } + b.EncodeVarint(4<<3 | proto.WireVarint) + b.EncodeVarint(t) + case nil: + default: + return fmt.Errorf("ModifyColumnFamiliesRequest_Modification.Mod has unexpected type %T", x) + } + return nil +} + +func _ModifyColumnFamiliesRequest_Modification_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*ModifyColumnFamiliesRequest_Modification) + switch tag { + case 2: // mod.create + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ColumnFamily) + err := b.DecodeMessage(msg) + m.Mod = &ModifyColumnFamiliesRequest_Modification_Create{msg} + return true, err + case 3: // mod.update + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ColumnFamily) + err := b.DecodeMessage(msg) + m.Mod = &ModifyColumnFamiliesRequest_Modification_Update{msg} + return true, err + case 4: // mod.drop + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Mod = &ModifyColumnFamiliesRequest_Modification_Drop{x != 0} + return true, err + default: + return false, nil + } +} + +func _ModifyColumnFamiliesRequest_Modification_OneofSizer(msg proto.Message) (n int) { + m := msg.(*ModifyColumnFamiliesRequest_Modification) + // mod + switch x := m.Mod.(type) { + case *ModifyColumnFamiliesRequest_Modification_Create: + s := proto.Size(x.Create) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *ModifyColumnFamiliesRequest_Modification_Update: + s := proto.Size(x.Update) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *ModifyColumnFamiliesRequest_Modification_Drop: + n += proto.SizeVarint(4<<3 | proto.WireVarint) + n += 1 + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +func init() { + proto.RegisterType((*CreateTableRequest)(nil), "google.bigtable.admin.v2.CreateTableRequest") + proto.RegisterType((*CreateTableRequest_Split)(nil), "google.bigtable.admin.v2.CreateTableRequest.Split") + proto.RegisterType((*DropRowRangeRequest)(nil), "google.bigtable.admin.v2.DropRowRangeRequest") + proto.RegisterType((*ListTablesRequest)(nil), "google.bigtable.admin.v2.ListTablesRequest") + proto.RegisterType((*ListTablesResponse)(nil), "google.bigtable.admin.v2.ListTablesResponse") + proto.RegisterType((*GetTableRequest)(nil), "google.bigtable.admin.v2.GetTableRequest") + proto.RegisterType((*DeleteTableRequest)(nil), "google.bigtable.admin.v2.DeleteTableRequest") + proto.RegisterType((*ModifyColumnFamiliesRequest)(nil), "google.bigtable.admin.v2.ModifyColumnFamiliesRequest") + proto.RegisterType((*ModifyColumnFamiliesRequest_Modification)(nil), "google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification") +} + +// 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 + +// Client API for BigtableTableAdmin service + +type BigtableTableAdminClient interface { + // Creates a new table in the specified instance. + // The table can be created with a full set of initial column families, + // specified in the request. + CreateTable(ctx context.Context, in *CreateTableRequest, opts ...grpc.CallOption) (*Table, error) + // Lists all tables served from a specified instance. + ListTables(ctx context.Context, in *ListTablesRequest, opts ...grpc.CallOption) (*ListTablesResponse, error) + // Gets metadata information about the specified table. + GetTable(ctx context.Context, in *GetTableRequest, opts ...grpc.CallOption) (*Table, error) + // Permanently deletes a specified table and all of its data. + DeleteTable(ctx context.Context, in *DeleteTableRequest, opts ...grpc.CallOption) (*google_protobuf3.Empty, error) + // Performs a series of column family modifications on the specified table. + // Either all or none of the modifications will occur before this method + // returns, but data requests received prior to that point may see a table + // where only some modifications have taken effect. + ModifyColumnFamilies(ctx context.Context, in *ModifyColumnFamiliesRequest, opts ...grpc.CallOption) (*Table, error) + // Permanently drop/delete a row range from a specified table. The request can + // specify whether to delete all rows in a table, or only those that match a + // particular prefix. + DropRowRange(ctx context.Context, in *DropRowRangeRequest, opts ...grpc.CallOption) (*google_protobuf3.Empty, error) +} + +type bigtableTableAdminClient struct { + cc *grpc.ClientConn +} + +func NewBigtableTableAdminClient(cc *grpc.ClientConn) BigtableTableAdminClient { + return &bigtableTableAdminClient{cc} +} + +func (c *bigtableTableAdminClient) CreateTable(ctx context.Context, in *CreateTableRequest, opts ...grpc.CallOption) (*Table, error) { + out := new(Table) + err := grpc.Invoke(ctx, "/google.bigtable.admin.v2.BigtableTableAdmin/CreateTable", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bigtableTableAdminClient) ListTables(ctx context.Context, in *ListTablesRequest, opts ...grpc.CallOption) (*ListTablesResponse, error) { + out := new(ListTablesResponse) + err := grpc.Invoke(ctx, "/google.bigtable.admin.v2.BigtableTableAdmin/ListTables", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bigtableTableAdminClient) GetTable(ctx context.Context, in *GetTableRequest, opts ...grpc.CallOption) (*Table, error) { + out := new(Table) + err := grpc.Invoke(ctx, "/google.bigtable.admin.v2.BigtableTableAdmin/GetTable", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bigtableTableAdminClient) DeleteTable(ctx context.Context, in *DeleteTableRequest, opts ...grpc.CallOption) (*google_protobuf3.Empty, error) { + out := new(google_protobuf3.Empty) + err := grpc.Invoke(ctx, "/google.bigtable.admin.v2.BigtableTableAdmin/DeleteTable", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bigtableTableAdminClient) ModifyColumnFamilies(ctx context.Context, in *ModifyColumnFamiliesRequest, opts ...grpc.CallOption) (*Table, error) { + out := new(Table) + err := grpc.Invoke(ctx, "/google.bigtable.admin.v2.BigtableTableAdmin/ModifyColumnFamilies", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bigtableTableAdminClient) DropRowRange(ctx context.Context, in *DropRowRangeRequest, opts ...grpc.CallOption) (*google_protobuf3.Empty, error) { + out := new(google_protobuf3.Empty) + err := grpc.Invoke(ctx, "/google.bigtable.admin.v2.BigtableTableAdmin/DropRowRange", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for BigtableTableAdmin service + +type BigtableTableAdminServer interface { + // Creates a new table in the specified instance. + // The table can be created with a full set of initial column families, + // specified in the request. + CreateTable(context.Context, *CreateTableRequest) (*Table, error) + // Lists all tables served from a specified instance. + ListTables(context.Context, *ListTablesRequest) (*ListTablesResponse, error) + // Gets metadata information about the specified table. + GetTable(context.Context, *GetTableRequest) (*Table, error) + // Permanently deletes a specified table and all of its data. + DeleteTable(context.Context, *DeleteTableRequest) (*google_protobuf3.Empty, error) + // Performs a series of column family modifications on the specified table. + // Either all or none of the modifications will occur before this method + // returns, but data requests received prior to that point may see a table + // where only some modifications have taken effect. + ModifyColumnFamilies(context.Context, *ModifyColumnFamiliesRequest) (*Table, error) + // Permanently drop/delete a row range from a specified table. The request can + // specify whether to delete all rows in a table, or only those that match a + // particular prefix. + DropRowRange(context.Context, *DropRowRangeRequest) (*google_protobuf3.Empty, error) +} + +func RegisterBigtableTableAdminServer(s *grpc.Server, srv BigtableTableAdminServer) { + s.RegisterService(&_BigtableTableAdmin_serviceDesc, srv) +} + +func _BigtableTableAdmin_CreateTable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateTableRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BigtableTableAdminServer).CreateTable(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.bigtable.admin.v2.BigtableTableAdmin/CreateTable", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BigtableTableAdminServer).CreateTable(ctx, req.(*CreateTableRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BigtableTableAdmin_ListTables_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListTablesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BigtableTableAdminServer).ListTables(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.bigtable.admin.v2.BigtableTableAdmin/ListTables", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BigtableTableAdminServer).ListTables(ctx, req.(*ListTablesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BigtableTableAdmin_GetTable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetTableRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BigtableTableAdminServer).GetTable(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.bigtable.admin.v2.BigtableTableAdmin/GetTable", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BigtableTableAdminServer).GetTable(ctx, req.(*GetTableRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BigtableTableAdmin_DeleteTable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteTableRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BigtableTableAdminServer).DeleteTable(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.bigtable.admin.v2.BigtableTableAdmin/DeleteTable", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BigtableTableAdminServer).DeleteTable(ctx, req.(*DeleteTableRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BigtableTableAdmin_ModifyColumnFamilies_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ModifyColumnFamiliesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BigtableTableAdminServer).ModifyColumnFamilies(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.bigtable.admin.v2.BigtableTableAdmin/ModifyColumnFamilies", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BigtableTableAdminServer).ModifyColumnFamilies(ctx, req.(*ModifyColumnFamiliesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BigtableTableAdmin_DropRowRange_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DropRowRangeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BigtableTableAdminServer).DropRowRange(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.bigtable.admin.v2.BigtableTableAdmin/DropRowRange", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BigtableTableAdminServer).DropRowRange(ctx, req.(*DropRowRangeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _BigtableTableAdmin_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.bigtable.admin.v2.BigtableTableAdmin", + HandlerType: (*BigtableTableAdminServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateTable", + Handler: _BigtableTableAdmin_CreateTable_Handler, + }, + { + MethodName: "ListTables", + Handler: _BigtableTableAdmin_ListTables_Handler, + }, + { + MethodName: "GetTable", + Handler: _BigtableTableAdmin_GetTable_Handler, + }, + { + MethodName: "DeleteTable", + Handler: _BigtableTableAdmin_DeleteTable_Handler, + }, + { + MethodName: "ModifyColumnFamilies", + Handler: _BigtableTableAdmin_ModifyColumnFamilies_Handler, + }, + { + MethodName: "DropRowRange", + Handler: _BigtableTableAdmin_DropRowRange_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/bigtable/admin/v2/bigtable_table_admin.proto", +} + +func init() { + proto.RegisterFile("google/bigtable/admin/v2/bigtable_table_admin.proto", fileDescriptor1) +} + +var fileDescriptor1 = []byte{ + // 922 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xdd, 0x6e, 0x1b, 0x45, + 0x14, 0xce, 0xd8, 0x4e, 0x9a, 0x1c, 0x3b, 0x29, 0x0c, 0x55, 0x70, 0xdd, 0xd2, 0x46, 0x4b, 0x15, + 0x05, 0x13, 0x76, 0xa5, 0xad, 0xa2, 0xa2, 0xd0, 0x0a, 0xea, 0x84, 0x36, 0xfc, 0x49, 0xd1, 0x52, + 0x55, 0x82, 0x9b, 0xd5, 0xc4, 0x3b, 0x59, 0x86, 0xec, 0xce, 0x2c, 0xbb, 0xe3, 0xb8, 0x16, 0xea, + 0x0d, 0x42, 0x42, 0xe2, 0xb6, 0x57, 0x11, 0x6f, 0xc0, 0x13, 0x20, 0x6e, 0x78, 0x08, 0xae, 0xb9, + 0xe3, 0x11, 0x78, 0x00, 0x34, 0x3f, 0x4e, 0x9c, 0x38, 0x6b, 0xd7, 0xb9, 0xb1, 0x66, 0xce, 0xcf, + 0x77, 0xbe, 0x39, 0x67, 0xbe, 0x1d, 0xc3, 0xfd, 0x58, 0x88, 0x38, 0xa1, 0xde, 0x01, 0x8b, 0x25, + 0x39, 0x48, 0xa8, 0x47, 0xa2, 0x94, 0x71, 0xef, 0xd8, 0x3f, 0xb5, 0x84, 0xe6, 0x57, 0xdb, 0xdd, + 0x2c, 0x17, 0x52, 0xe0, 0xa6, 0x49, 0x72, 0x87, 0x21, 0xae, 0x71, 0x1e, 0xfb, 0xad, 0xdb, 0x16, + 0x8e, 0x64, 0xcc, 0x23, 0x9c, 0x0b, 0x49, 0x24, 0x13, 0xbc, 0x30, 0x79, 0xad, 0x7b, 0xa5, 0xc5, + 0x0c, 0x8c, 0x89, 0x7a, 0xd7, 0x46, 0x25,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0x61, 0x25, 0x17, + 0xfd, 0xf0, 0x88, 0x0e, 0xc2, 0x2c, 0xa7, 0x87, 0xec, 0x85, 0x3e, 0x79, 0x63, 0x6f, 0x2e, 0x68, + 0xe4, 0xa2, 0xff, 0x05, 0x1d, 0xec, 0x6b, 0x2b, 0x7e, 0x08, 0xad, 0x88, 0x26, 0x54, 0xd2, 0x90, + 0x24, 0x49, 0x18, 0x11, 0x49, 0xc2, 0xc3, 0x5c, 0xa4, 0xe1, 0x59, 0x57, 0x16, 0xf7, 0xe6, 0x82, + 0x55, 0x13, 0xf3, 0x38, 0x49, 0x76, 0x89, 0x24, 0x4f, 0x72, 0x91, 0xea, 0x83, 0x74, 0x16, 0x61, + 0x41, 0x92, 0x3c, 0xa6, 0xd2, 0xf9, 0x19, 0xc1, 0x9b, 0x5f, 0xb2, 0x42, 0x6a, 0x7b, 0x31, 0x6d, + 0x22, 0x1f, 0x42, 0xed, 0x98, 0xd1, 0xbe, 0xe6, 0xb4, 0xe2, 0xdf, 0x9b, 0xd2, 0x75, 0xf7, 0x39, + 0xa3, 0xfd, 0x40, 0x67, 0xe0, 0x77, 0x00, 0x32, 0x12, 0xd3, 0x50, 0x8a, 0x23, 0xca, 0x35, 0xbf, + 0xa5, 0x60, 0x49, 0x59, 0x9e, 0x29, 0x83, 0xd3, 0x03, 0x3c, 0xca, 0xa2, 0xc8, 0x04, 0x2f, 0x28, + 0x7e, 0xa0, 0x68, 0x2a, 0x4b, 0x13, 0xe9, 0x31, 0x4d, 0x1d, 0xb3, 0x0d, 0xc7, 0xeb, 0x70, 0x9d, + 0xd3, 0x17, 0x32, 0x1c, 0x29, 0x69, 0x2e, 0xd0, 0xb2, 0x32, 0xef, 0x9f, 0x96, 0x0d, 0xe1, 0xfa, + 0x53, 0x2a, 0xcf, 0x5d, 0xc6, 0xcb, 0x86, 0x72, 0xe5, 0x63, 0x3b, 0x1b, 0x80, 0x77, 0xf5, 0x08, + 0xa6, 0xd5, 0x70, 0xfe, 0xa9,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xeb, 0xb8, 0xba, 0x86, 0xfb, 0xdc, 0x3f, 0x58, 0xd0, 0x50, 0xf7, 0xff, 0x0f, 0x00, 0x00, + 0xff, 0xff, 0x47, 0xff, 0x6e, 0x8f, 0xf1, 0x09, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/bigtable/admin/v2/common.pb.go b/vendor/google.golang.org/genproto/googleapis/bigtable/admin/v2/common.pb.go new file mode 100644 index 0000000000..5519217ec0 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/bigtable/admin/v2/common.pb.go @@ -0,0 +1,69 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/bigtable/admin/v2/common.proto + +package admin + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import _ "github.com/golang/protobuf/ptypes/timestamp" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Storage media types for persisting Bigtable data. +type StorageType int32 + +const ( + // The user did not specify a storage type. + StorageType_STORAGE_TYPE_UNSPECIFIED StorageType = 0 + // Flash (SSD) storage should be used. + StorageType_SSD StorageType = 1 + // Magnetic drive (HDD) storage should be used. + StorageType_HDD StorageType = 2 +) + +var StorageType_name = map[int32]string{ + 0: "STORAGE_TYPE_UNSPECIFIED", + 1: "SSD", + 2: "HDD", +} +var StorageType_value = map[string]int32{ + "STORAGE_TYPE_UNSPECIFIED": 0, + "SSD": 1, + "HDD": 2, +} + +func (x StorageType) String() string { + return proto.EnumName(StorageType_name, int32(x)) +} +func (StorageType) EnumDescriptor() ([]byte, []int) { return fileDescriptor2, []int{0} } + +func init() { + proto.RegisterEnum("google.bigtable.admin.v2.StorageType", StorageType_name, StorageType_value) +} + +func init() { proto.RegisterFile("google/bigtable/admin/v2/common.proto", fileDescriptor2) } + +var fileDescriptor2 = []byte{ + // 256 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08,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6, 0xff, 0xd5, 0xcb, 0xa7, 0x85, + 0xff, 0x46, 0x7d, 0x0c, 0xab, 0xa3, 0x8f, 0xc5, 0x08, 0x4a, 0xec, 0xc0, 0x48, 0x8a, 0xbd, 0x64, + 0x52, 0x18, 0x5f, 0x85, 0x85, 0x15, 0x58, 0x35, 0xfc, 0xbd, 0xc6, 0xbd, 0x1f, 0x7e, 0x26, 0x57, + 0xab, 0xa0, 0x2f, 0x3a, 0xdc, 0xef, 0x68, 0x7e, 0x8a, 0x5b, 0xfa, 0xb8, 0xb7, 0xac, 0xbd, 0xf0, + 0x56, 0x77, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xcd, 0xe8, 0x84, 0xa9, 0x57, 0x01, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/bigtable/admin/v2/instance.pb.go b/vendor/google.golang.org/genproto/googleapis/bigtable/admin/v2/instance.pb.go new file mode 100644 index 0000000000..a57ede0863 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/bigtable/admin/v2/instance.pb.go @@ -0,0 +1,289 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/bigtable/admin/v2/instance.proto + +package admin + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Possible states of an instance. +type Instance_State int32 + +const ( + // The state of the instance could not be determined. + Instance_STATE_NOT_KNOWN Instance_State = 0 + // The instance has been successfully created and can serve requests + // to its tables. + Instance_READY Instance_State = 1 + // The instance is currently being created, and may be destroyed + // if the creation process encounters an error. + Instance_CREATING Instance_State = 2 +) + +var Instance_State_name = map[int32]string{ + 0: "STATE_NOT_KNOWN", + 1: "READY", + 2: "CREATING", +} +var Instance_State_value = map[string]int32{ + "STATE_NOT_KNOWN": 0, + "READY": 1, + "CREATING": 2, +} + +func (x Instance_State) String() string { + return proto.EnumName(Instance_State_name, int32(x)) +} +func (Instance_State) EnumDescriptor() ([]byte, []int) { return fileDescriptor3, []int{0, 0} } + +// The type of the instance. +type Instance_Type int32 + +const ( + // The type of the instance is unspecified. If set when creating an + // instance, a `PRODUCTION` instance will be created. If set when updating + // an instance, the type will be left unchanged. + Instance_TYPE_UNSPECIFIED Instance_Type = 0 + // An instance meant for production use. `serve_nodes` must be set + // on the cluster. + Instance_PRODUCTION Instance_Type = 1 + // The instance is meant for development and testing purposes only; it has + // no performance or uptime guarantees and is not covered by SLA. + // After a development instance is created, it can be upgraded by + // updating the instance to type `PRODUCTION`. An instance created + // as a production instance cannot be changed to a development instance. + // When creating a development instance, `serve_nodes` on the cluster must + // not be set. + Instance_DEVELOPMENT Instance_Type = 2 +) + +var Instance_Type_name = map[int32]string{ + 0: "TYPE_UNSPECIFIED", + 1: "PRODUCTION", + 2: "DEVELOPMENT", +} +var Instance_Type_value = map[string]int32{ + "TYPE_UNSPECIFIED": 0, + "PRODUCTION": 1, + "DEVELOPMENT": 2, +} + +func (x Instance_Type) String() string { + return proto.EnumName(Instance_Type_name, int32(x)) +} +func (Instance_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptor3, []int{0, 1} } + +// Possible states of a cluster. +type Cluster_State int32 + +const ( + // The state of the cluster could not be determined. + Cluster_STATE_NOT_KNOWN Cluster_State = 0 + // The cluster has been successfully created and is ready to serve requests. + Cluster_READY Cluster_State = 1 + // The cluster is currently being created, and may be destroyed + // if the creation process encounters an error. + // A cluster may not be able to serve requests while being created. + Cluster_CREATING Cluster_State = 2 + // The cluster is currently being resized, and may revert to its previous + // node count if the process encounters an error. + // A cluster is still capable of serving requests while being resized, + // but may exhibit performance as if its number of allocated nodes is + // between the starting and requested states. + Cluster_RESIZING Cluster_State = 3 + // The cluster has no backing nodes. The data (tables) still + // exist, but no operations can be performed on the cluster. + Cluster_DISABLED Cluster_State = 4 +) + +var Cluster_State_name = map[int32]string{ + 0: "STATE_NOT_KNOWN", + 1: "READY", + 2: "CREATING", + 3: "RESIZING", + 4: "DISABLED", +} +var Cluster_State_value = map[string]int32{ + "STATE_NOT_KNOWN": 0, + "READY": 1, + "CREATING": 2, + "RESIZING": 3, + "DISABLED": 4, +} + +func (x Cluster_State) String() string { + return proto.EnumName(Cluster_State_name, int32(x)) +} +func (Cluster_State) EnumDescriptor() ([]byte, []int) { return fileDescriptor3, []int{1, 0} } + +// A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and +// the resources that serve them. +// All tables in an instance are served from a single +// [Cluster][google.bigtable.admin.v2.Cluster]. +type Instance struct { + // (`OutputOnly`) + // The unique name of the instance. Values are of the form + // `projects//instances/[a-z][a-z0-9\\-]+[a-z0-9]`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The descriptive name for this instance as it appears in UIs. + // Can be changed at any time, but should be kept globally unique + // to avoid confusion. + DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName" json:"display_name,omitempty"` + // (`OutputOnly`) + // The current state of the instance. + State Instance_State `protobuf:"varint,3,opt,name=state,enum=google.bigtable.admin.v2.Instance_State" json:"state,omitempty"` + // The type of the instance. Defaults to `PRODUCTION`. + Type Instance_Type `protobuf:"varint,4,opt,name=type,enum=google.bigtable.admin.v2.Instance_Type" json:"type,omitempty"` +} + +func (m *Instance) Reset() { *m = Instance{} } +func (m *Instance) String() string { return proto.CompactTextString(m) } +func (*Instance) ProtoMessage() {} +func (*Instance) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} } + +func (m *Instance) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Instance) GetDisplayName() string { + if m != nil { + return m.DisplayName + } + return "" +} + +func (m *Instance) GetState() Instance_State { + if m != nil { + return m.State + } + return Instance_STATE_NOT_KNOWN +} + +func (m *Instance) GetType() Instance_Type { + if m != nil { + return m.Type + } + return Instance_TYPE_UNSPECIFIED +} + +// A resizable group of nodes in a particular cloud location, capable +// of serving all [Tables][google.bigtable.admin.v2.Table] in the parent +// [Instance][google.bigtable.admin.v2.Instance]. +type Cluster struct { + // (`OutputOnly`) + // The unique name of the cluster. Values are of the form + // `projects//instances//clusters/[a-z][-a-z0-9]*`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // (`CreationOnly`) + // The location where this cluster's nodes and storage reside. For best + // performance, clients should be located as close as possible to this cluster. + // Currently only zones are supported, so values should be of the form + // `projects//locations/`. + Location string `protobuf:"bytes,2,opt,name=location" json:"location,omitempty"` + // (`OutputOnly`) + // The current state of the cluster. + State Cluster_State `protobuf:"varint,3,opt,name=state,enum=google.bigtable.admin.v2.Cluster_State" json:"state,omitempty"` + // The number of nodes allocated to this cluster. More nodes enable higher + // throughput and more consistent performance. + ServeNodes int32 `protobuf:"varint,4,opt,name=serve_nodes,json=serveNodes" json:"serve_nodes,omitempty"` + // (`CreationOnly`) + // The type of storage used by this cluster to serve its + // parent instance's tables, unless explicitly overridden. + DefaultStorageType StorageType `protobuf:"varint,5,opt,name=default_storage_type,json=defaultStorageType,enum=google.bigtable.admin.v2.StorageType" json:"default_storage_type,omitempty"` +} + +func (m *Cluster) Reset() { *m = Cluster{} } +func (m *Cluster) String() string { return proto.CompactTextString(m) } +func (*Cluster) ProtoMessage() {} +func (*Cluster) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{1} } + +func (m *Cluster) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Cluster) GetLocation() string { + if m != nil { + return m.Location + } + return "" +} + +func (m *Cluster) GetState() Cluster_State { + if m != nil { + return m.State + } + return Cluster_STATE_NOT_KNOWN +} + +func (m *Cluster) GetServeNodes() int32 { + if m != nil { + return m.ServeNodes + } + return 0 +} + +func (m *Cluster) GetDefaultStorageType() StorageType { + if m != nil { + return m.DefaultStorageType + } + return StorageType_STORAGE_TYPE_UNSPECIFIED +} + +func init() { + proto.RegisterType((*Instance)(nil), "google.bigtable.admin.v2.Instance") + proto.RegisterType((*Cluster)(nil), "google.bigtable.admin.v2.Cluster") + proto.RegisterEnum("google.bigtable.admin.v2.Instance_State", Instance_State_name, Instance_State_value) + proto.RegisterEnum("google.bigtable.admin.v2.Instance_Type", Instance_Type_name, Instance_Type_value) + proto.RegisterEnum("google.bigtable.admin.v2.Cluster_State", Cluster_State_name, Cluster_State_value) +} + +func init() { proto.RegisterFile("google/bigtable/admin/v2/instance.proto", fileDescriptor3) } + +var fileDescriptor3 = []byte{ + // 498 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x52, 0xdd, 0x6a, 0xdb, 0x30, + 0x14, 0xae, 0xdd, 0x64, 0x4b, 0x4f, 0xba, 0xd6, 0x68, 0xbd, 0x08, 0xa1, 0x6c, 0x5d, 0xa0, 0x34, + 0x57, 0x36, 0x64, 0xec, 0xaa, 0x64, 0x90, 0xd8, 0x5a, 0x31, 0xeb, 0x6c, 0xcf, 0x76, 0x5b, 0xda, + 0x1b, 0xa3, 0xc4, 0x9a, 0x31, 0xd8, 0x92, 0xb1, 0x95, 0x40, 0x9e, 0x62, 0xef, 0xb1, 0xeb, 0xbd, + 0xc2, 0xde, 0x6b, 0x58, 0x76, 0xc6, 0xca, 0x96, 0x31, 0x7a, 0xa7, 0x73, 0xce, 0xf7, 0x23, 0x7d, + 0x3a, 0x70, 0x91, 0x70, 0x9e, 0x64, 0xd4, 0x58, 0xa4, 0x89, 0x20, 0x8b, 0x8c, 0x1a, 0x24, 0xce, + 0x53, 0x66, 0xac, 0x27, 0x46, 0xca, 0x2a, 0x41, 0xd8, 0x92, 0xea, 0x45, 0xc9, 0x05, 0x47, 0x83, + 0x06, 0xa8, 0x6f, 0x81, 0xba, 0x04, 0xea, 0xeb, 0xc9, 0xf0, 0xb4, 0x95, 0x20, 0x45, 0x6a, 0x10, + 0xc6, 0xb8, 0x20, 0x22, 0xe5, 0xac, 0x6a, 0x78, 0xc3, 0xf3, 0x9d, 0x06, 0x4b, 0x9e, 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 0x4d, 0x6d, 0x08, 0xbd, 0x8c, 0x2f, 0xe5, 0x87, 0xb4, 0x89, 0xfd, 0xaa, + 0xd1, 0xf4, 0x71, 0x5c, 0xff, 0x78, 0x6f, 0xeb, 0xf0, 0x38, 0xad, 0xd7, 0xd0, 0xaf, 0x68, 0xb9, + 0xa6, 0x11, 0xe3, 0x31, 0xad, 0x64, 0x68, 0x5d, 0x1f, 0x64, 0xcb, 0xa9, 0x3b, 0xe8, 0x0e, 0x4e, + 0x62, 0xfa, 0x85, 0xac, 0x32, 0x11, 0x55, 0x82, 0x97, 0x24, 0xa1, 0x91, 0x8c, 0xb7, 0x2b, 0xed, + 0xce, 0x77, 0xdb, 0x05, 0x0d, 0x5a, 0x86, 0x8b, 0x5a, 0x89, 0xdf, 0x7a, 0xa3, 0xcf, 0x4f, 0x8a, + 0xba, 0xae, 0x7c, 0x1c, 0xd8, 0x0f, 0x75, 0xb5, 0x5f, 0x57, 0x96, 0x1d, 0xcc, 0xe6, 0xd7, 0xd8, + 0xd2, 0x3a, 0xf3, 0xaf, 0x0a, 0x9c, 0x2e, 0x79, 0xbe, 0xf3, 0x4e, 0xf3, 0x17, 0xdb, 0x3f, 0xf7, + 0xea, 0x75, 0xf5, 0x94, 0x87, 0x69, 0x0b, 0x4d, 0x78, 0x46, 0x58, 0xa2, 0xf3, 0x32, 0x31, 0x12, + 0xca, 0xe4, 0x32, 0x1b, 0xcd, 0x88, 0x14, 0x69, 0xf5, 0xe7, 0xda, 0x5f, 0xca, 0xc3, 0x37, 0xf5, + 0xd5, 0x55, 0xc3, 0x37, 0x33, 0xbe, 0x8a, 0xf5, 0xf9, 0xd6, 0x70, 0x26, 0x0d, 0x6f, 0x27, 0x8b, + 0x67, 0x52, 0xea, 0xed, 0xcf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x8d, 0xab, 0xe0, 0x6d, 0xa1, 0x03, + 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/bigtable/admin/v2/table.pb.go b/vendor/google.golang.org/genproto/googleapis/bigtable/admin/v2/table.pb.go new file mode 100644 index 0000000000..223c5af019 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/bigtable/admin/v2/table.pb.go @@ -0,0 +1,417 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/bigtable/admin/v2/table.proto + +package admin + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf4 "github.com/golang/protobuf/ptypes/duration" +import _ "github.com/golang/protobuf/ptypes/timestamp" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Possible timestamp granularities to use when keeping multiple versions +// of data in a table. +type Table_TimestampGranularity int32 + +const ( + // The user did not specify a granularity. Should not be returned. + // When specified during table creation, MILLIS will be used. + Table_TIMESTAMP_GRANULARITY_UNSPECIFIED Table_TimestampGranularity = 0 + // The table keeps data versioned at a granularity of 1ms. + Table_MILLIS Table_TimestampGranularity = 1 +) + +var Table_TimestampGranularity_name = map[int32]string{ + 0: "TIMESTAMP_GRANULARITY_UNSPECIFIED", + 1: "MILLIS", +} +var Table_TimestampGranularity_value = map[string]int32{ + "TIMESTAMP_GRANULARITY_UNSPECIFIED": 0, + "MILLIS": 1, +} + +func (x Table_TimestampGranularity) String() string { + return proto.EnumName(Table_TimestampGranularity_name, int32(x)) +} +func (Table_TimestampGranularity) EnumDescriptor() ([]byte, []int) { + return fileDescriptor4, []int{0, 0} +} + +// Defines a view over a table's fields. +type Table_View int32 + +const ( + // Uses the default view for each method as documented in its request. + Table_VIEW_UNSPECIFIED Table_View = 0 + // Only populates `name`. + Table_NAME_ONLY Table_View = 1 + // Only populates `name` and fields related to the table's schema. + Table_SCHEMA_VIEW Table_View = 2 + // Populates all fields. + Table_FULL Table_View = 4 +) + +var Table_View_name = map[int32]string{ + 0: "VIEW_UNSPECIFIED", + 1: "NAME_ONLY", + 2: "SCHEMA_VIEW", + 4: "FULL", +} +var Table_View_value = map[string]int32{ + "VIEW_UNSPECIFIED": 0, + "NAME_ONLY": 1, + "SCHEMA_VIEW": 2, + "FULL": 4, +} + +func (x Table_View) String() string { + return proto.EnumName(Table_View_name, int32(x)) +} +func (Table_View) EnumDescriptor() ([]byte, []int) { return fileDescriptor4, []int{0, 1} } + +// A collection of user data indexed by row, column, and timestamp. +// Each table is served using the resources of its parent cluster. +type Table struct { + // (`OutputOnly`) + // The unique name of the table. Values are of the form + // `projects//instances//tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`. + // Views: `NAME_ONLY`, `SCHEMA_VIEW`, `FULL` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // (`CreationOnly`) + // The column families configured for this table, mapped by column family ID. + // Views: `SCHEMA_VIEW`, `FULL` + ColumnFamilies map[string]*ColumnFamily `protobuf:"bytes,3,rep,name=column_families,json=columnFamilies" json:"column_families,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // (`CreationOnly`) + // The granularity (e.g. `MILLIS`, `MICROS`) at which timestamps are stored in + // this table. Timestamps not matching the granularity will be rejected. + // If unspecified at creation time, the value will be set to `MILLIS`. + // Views: `SCHEMA_VIEW`, `FULL` + Granularity Table_TimestampGranularity `protobuf:"varint,4,opt,name=granularity,enum=google.bigtable.admin.v2.Table_TimestampGranularity" json:"granularity,omitempty"` +} + +func (m *Table) Reset() { *m = Table{} } +func (m *Table) String() string { return proto.CompactTextString(m) } +func (*Table) ProtoMessage() {} +func (*Table) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{0} } + +func (m *Table) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Table) GetColumnFamilies() map[string]*ColumnFamily { + if m != nil { + return m.ColumnFamilies + } + return nil +} + +func (m *Table) GetGranularity() Table_TimestampGranularity { + if m != nil { + return m.Granularity + } + return Table_TIMESTAMP_GRANULARITY_UNSPECIFIED +} + +// A set of columns within a table which share a common configuration. +type ColumnFamily struct { + // Garbage collection rule specified as a protobuf. + // Must serialize to at most 500 bytes. + // + // NOTE: Garbage collection executes opportunistically in the background, and + // so it's possible for reads to return a cell even if it matches the active + // GC expression for its family. + GcRule *GcRule `protobuf:"bytes,1,opt,name=gc_rule,json=gcRule" json:"gc_rule,omitempty"` +} + +func (m *ColumnFamily) Reset() { *m = ColumnFamily{} } +func (m *ColumnFamily) String() string { return proto.CompactTextString(m) } +func (*ColumnFamily) ProtoMessage() {} +func (*ColumnFamily) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{1} } + +func (m *ColumnFamily) GetGcRule() *GcRule { + if m != nil { + return m.GcRule + } + return nil +} + +// Rule for determining which cells to delete during garbage collection. +type GcRule struct { + // Garbage collection rules. + // + // Types that are valid to be assigned to Rule: + // *GcRule_MaxNumVersions + // *GcRule_MaxAge + // *GcRule_Intersection_ + // *GcRule_Union_ + Rule isGcRule_Rule `protobuf_oneof:"rule"` +} + +func (m *GcRule) Reset() { *m = GcRule{} } +func (m *GcRule) String() string { return proto.CompactTextString(m) } +func (*GcRule) ProtoMessage() {} +func (*GcRule) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{2} } + +type isGcRule_Rule interface { + isGcRule_Rule() +} + +type GcRule_MaxNumVersions struct { + MaxNumVersions int32 `protobuf:"varint,1,opt,name=max_num_versions,json=maxNumVersions,oneof"` +} +type GcRule_MaxAge struct { + MaxAge *google_protobuf4.Duration `protobuf:"bytes,2,opt,name=max_age,json=maxAge,oneof"` +} +type GcRule_Intersection_ struct { + Intersection *GcRule_Intersection `protobuf:"bytes,3,opt,name=intersection,oneof"` +} +type GcRule_Union_ struct { + Union *GcRule_Union `protobuf:"bytes,4,opt,name=union,oneof"` +} + +func (*GcRule_MaxNumVersions) isGcRule_Rule() {} +func (*GcRule_MaxAge) isGcRule_Rule() {} +func (*GcRule_Intersection_) isGcRule_Rule() {} +func (*GcRule_Union_) isGcRule_Rule() {} + +func (m *GcRule) GetRule() isGcRule_Rule { + if m != nil { + return m.Rule + } + return nil +} + +func (m *GcRule) GetMaxNumVersions() int32 { + if x, ok := m.GetRule().(*GcRule_MaxNumVersions); ok { + return x.MaxNumVersions + } + return 0 +} + +func (m *GcRule) GetMaxAge() *google_protobuf4.Duration { + if x, ok := m.GetRule().(*GcRule_MaxAge); ok { + return x.MaxAge + } + return nil +} + +func (m *GcRule) GetIntersection() *GcRule_Intersection { + if x, ok := m.GetRule().(*GcRule_Intersection_); ok { + return x.Intersection + } + return nil +} + +func (m *GcRule) GetUnion() *GcRule_Union { + if x, ok := m.GetRule().(*GcRule_Union_); ok { + return x.Union + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*GcRule) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _GcRule_OneofMarshaler, _GcRule_OneofUnmarshaler, _GcRule_OneofSizer, []interface{}{ + (*GcRule_MaxNumVersions)(nil), + (*GcRule_MaxAge)(nil), + (*GcRule_Intersection_)(nil), + (*GcRule_Union_)(nil), + } +} + +func _GcRule_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*GcRule) + // rule + switch x := m.Rule.(type) { + case *GcRule_MaxNumVersions: + b.EncodeVarint(1<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.MaxNumVersions)) + case *GcRule_MaxAge: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.MaxAge); err != nil { + return err + } + case *GcRule_Intersection_: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Intersection); err != nil { + return err + } + case *GcRule_Union_: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Union); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("GcRule.Rule has unexpected type %T", x) + } + return nil +} + +func _GcRule_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*GcRule) + switch tag { + case 1: // rule.max_num_versions + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Rule = &GcRule_MaxNumVersions{int32(x)} + return true, err + case 2: // rule.max_age + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(google_protobuf4.Duration) + err := b.DecodeMessage(msg) + m.Rule = &GcRule_MaxAge{msg} + return true, err + case 3: // rule.intersection + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(GcRule_Intersection) + err := b.DecodeMessage(msg) + m.Rule = &GcRule_Intersection_{msg} + return true, err + case 4: // rule.union + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(GcRule_Union) + err := b.DecodeMessage(msg) + m.Rule = &GcRule_Union_{msg} + return true, err + default: + return false, nil + } +} + +func _GcRule_OneofSizer(msg proto.Message) (n int) { + m := msg.(*GcRule) + // rule + switch x := m.Rule.(type) { + case *GcRule_MaxNumVersions: + n += proto.SizeVarint(1<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.MaxNumVersions)) + case *GcRule_MaxAge: + s := proto.Size(x.MaxAge) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *GcRule_Intersection_: + s := proto.Size(x.Intersection) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *GcRule_Union_: + s := proto.Size(x.Union) + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// A GcRule which deletes cells matching all of the given rules. +type GcRule_Intersection struct { + // Only delete cells which would be deleted by every element of `rules`. + Rules []*GcRule `protobuf:"bytes,1,rep,name=rules" json:"rules,omitempty"` +} + +func (m *GcRule_Intersection) Reset() { *m = GcRule_Intersection{} } +func (m *GcRule_Intersection) String() string { return proto.CompactTextString(m) } +func (*GcRule_Intersection) ProtoMessage() {} +func (*GcRule_Intersection) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{2, 0} } + +func (m *GcRule_Intersection) GetRules() []*GcRule { + if m != nil { + return m.Rules + } + return nil +} + +// A GcRule which deletes cells matching any of the given rules. +type GcRule_Union struct { + // Delete cells which would be deleted by any element of `rules`. + Rules []*GcRule `protobuf:"bytes,1,rep,name=rules" json:"rules,omitempty"` +} + +func (m *GcRule_Union) Reset() { *m = GcRule_Union{} } +func (m *GcRule_Union) String() string { return proto.CompactTextString(m) } +func (*GcRule_Union) ProtoMessage() {} +func (*GcRule_Union) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{2, 1} } + +func (m *GcRule_Union) GetRules() []*GcRule { + if m != nil { + return m.Rules + } + return nil +} + +func init() { + proto.RegisterType((*Table)(nil), "google.bigtable.admin.v2.Table") + proto.RegisterType((*ColumnFamily)(nil), "google.bigtable.admin.v2.ColumnFamily") + proto.RegisterType((*GcRule)(nil), "google.bigtable.admin.v2.GcRule") + proto.RegisterType((*GcRule_Intersection)(nil), "google.bigtable.admin.v2.GcRule.Intersection") + proto.RegisterType((*GcRule_Union)(nil), "google.bigtable.admin.v2.GcRule.Union") + proto.RegisterEnum("google.bigtable.admin.v2.Table_TimestampGranularity", Table_TimestampGranularity_name, Table_TimestampGranularity_value) + proto.RegisterEnum("google.bigtable.admin.v2.Table_View", Table_View_name, Table_View_value) +} + +func init() { proto.RegisterFile("google/bigtable/admin/v2/table.proto", fileDescriptor4) } + +var fileDescriptor4 = []byte{ + // 621 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0xdd, 0x6e, 0xda, 0x3c, + 0x18, 0xc7, 0x09, 0x09, 0xf4, 0xed, 0x43, 0xdf, 0x36, 0xf2, 0x7a, 0xc0, 0x50, 0xd5, 0x31, 0xb4, + 0x4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0x3f, 0x3f, 0x4e, 0xaf, 0xc5, 0xe2, 0x47, 0xfe, 0xb8, 0x9d, 0xfa, 0x9b, + 0x7e, 0x10, 0x5f, 0x68, 0x8d, 0x75, 0x36, 0x53, 0x64, 0x9b, 0x18, 0xd3, 0xa2, 0x40, 0x9d, 0xfc, + 0x0a, 0x00, 0x00, 0xff, 0xff, 0xe0, 0xf3, 0x89, 0x9d, 0xe6, 0x04, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/bigtable/v1/bigtable_data.pb.go b/vendor/google.golang.org/genproto/googleapis/bigtable/v1/bigtable_data.pb.go new file mode 100644 index 0000000000..51ece9f932 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/bigtable/v1/bigtable_data.pb.go @@ -0,0 +1,1980 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/bigtable/v1/bigtable_data.proto + +/* +Package bigtable is a generated protocol buffer package. + +It is generated from these files: + google/bigtable/v1/bigtable_data.proto + google/bigtable/v1/bigtable_service.proto + google/bigtable/v1/bigtable_service_messages.proto + +It has these top-level messages: + Row + Family + Column + Cell + RowRange + RowSet + ColumnRange + TimestampRange + ValueRange + RowFilter + Mutation + ReadModifyWriteRule + ReadRowsRequest + ReadRowsResponse + SampleRowKeysRequest + SampleRowKeysResponse + MutateRowRequest + MutateRowsRequest + MutateRowsResponse + CheckAndMutateRowRequest + CheckAndMutateRowResponse + ReadModifyWriteRowRequest +*/ +package bigtable + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Specifies the complete (requested) contents of a single row of a table. +// Rows which exceed 256MiB in size cannot be read in full. +type Row struct { + // The unique key which identifies this row within its table. This is the same + // key that's used to identify the row in, for example, a MutateRowRequest. + // May contain any non-empty byte string up to 4KiB in length. + Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + // May be empty, but only if the entire row is empty. + // The mutual ordering of column families is not specified. + Families []*Family `protobuf:"bytes,2,rep,name=families" json:"families,omitempty"` +} + +func (m *Row) Reset() { *m = Row{} } +func (m *Row) String() string { return proto.CompactTextString(m) } +func (*Row) ProtoMessage() {} +func (*Row) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *Row) GetKey() []byte { + if m != nil { + return m.Key + } + return nil +} + +func (m *Row) GetFamilies() []*Family { + if m != nil { + return m.Families + } + return nil +} + +// Specifies (some of) the contents of a single row/column family of a table. +type Family struct { + // The unique key which identifies this family within its row. This is the + // same key that's used to identify the family in, for example, a RowFilter + // which sets its "family_name_regex_filter" field. + // Must match [-_.a-zA-Z0-9]+, except that AggregatingRowProcessors may + // produce cells in a sentinel family with an empty name. + // Must be no greater than 64 characters in length. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Must not be empty. Sorted in order of increasing "qualifier". + Columns []*Column `protobuf:"bytes,2,rep,name=columns" json:"columns,omitempty"` +} + +func (m *Family) Reset() { *m = Family{} } +func (m *Family) String() string { return proto.CompactTextString(m) } +func (*Family) ProtoMessage() {} +func (*Family) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *Family) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Family) GetColumns() []*Column { + if m != nil { + return m.Columns + } + return nil +} + +// Specifies (some of) the contents of a single row/column of a table. +type Column struct { + // The unique key which identifies this column within its family. This is the + // same key that's used to identify the column in, for example, a RowFilter + // which sets its "column_qualifier_regex_filter" field. + // May contain any byte string, including the empty string, up to 16kiB in + // length. + Qualifier []byte `protobuf:"bytes,1,opt,name=qualifier,proto3" json:"qualifier,omitempty"` + // Must not be empty. Sorted in order of decreasing "timestamp_micros". + Cells []*Cell `protobuf:"bytes,2,rep,name=cells" json:"cells,omitempty"` +} + +func (m *Column) Reset() { *m = Column{} } +func (m *Column) String() string { return proto.CompactTextString(m) } +func (*Column) ProtoMessage() {} +func (*Column) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *Column) GetQualifier() []byte { + if m != nil { + return m.Qualifier + } + return nil +} + +func (m *Column) GetCells() []*Cell { + if m != nil { + return m.Cells + } + return nil +} + +// Specifies (some of) the contents of a single row/column/timestamp of a table. +type Cell struct { + // The cell's stored timestamp, which also uniquely identifies it within + // its column. + // Values are always expressed in microseconds, but individual tables may set + // a coarser "granularity" to further restrict the allowed values. For + // example, a table which specifies millisecond granularity will only allow + // values of "timestamp_micros" which are multiples of 1000. + TimestampMicros int64 `protobuf:"varint,1,opt,name=timestamp_micros,json=timestampMicros" json:"timestamp_micros,omitempty"` + // The value stored in the cell. + // May contain any byte string, including the empty string, up to 100MiB in + // length. + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + // Labels applied to the cell by a [RowFilter][google.bigtable.v1.RowFilter]. + Labels []string `protobuf:"bytes,3,rep,name=labels" json:"labels,omitempty"` +} + +func (m *Cell) Reset() { *m = Cell{} } +func (m *Cell) String() string { return proto.CompactTextString(m) } +func (*Cell) ProtoMessage() {} +func (*Cell) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *Cell) GetTimestampMicros() int64 { + if m != nil { + return m.TimestampMicros + } + return 0 +} + +func (m *Cell) GetValue() []byte { + if m != nil { + return m.Value + } + return nil +} + +func (m *Cell) GetLabels() []string { + if m != nil { + return m.Labels + } + return nil +} + +// Specifies a contiguous range of rows. +type RowRange struct { + // Inclusive lower bound. If left empty, interpreted as the empty string. + StartKey []byte `protobuf:"bytes,2,opt,name=start_key,json=startKey,proto3" json:"start_key,omitempty"` + // Exclusive upper bound. If left empty, interpreted as infinity. + EndKey []byte `protobuf:"bytes,3,opt,name=end_key,json=endKey,proto3" json:"end_key,omitempty"` +} + +func (m *RowRange) Reset() { *m = RowRange{} } +func (m *RowRange) String() string { return proto.CompactTextString(m) } +func (*RowRange) ProtoMessage() {} +func (*RowRange) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *RowRange) GetStartKey() []byte { + if m != nil { + return m.StartKey + } + return nil +} + +func (m *RowRange) GetEndKey() []byte { + if m != nil { + return m.EndKey + } + return nil +} + +// Specifies a non-contiguous set of rows. +type RowSet struct { + // Single rows included in the set. + RowKeys [][]byte `protobuf:"bytes,1,rep,name=row_keys,json=rowKeys,proto3" json:"row_keys,omitempty"` + // Contiguous row ranges included in the set. + RowRanges []*RowRange `protobuf:"bytes,2,rep,name=row_ranges,json=rowRanges" json:"row_ranges,omitempty"` +} + +func (m *RowSet) Reset() { *m = RowSet{} } +func (m *RowSet) String() string { return proto.CompactTextString(m) } +func (*RowSet) ProtoMessage() {} +func (*RowSet) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *RowSet) GetRowKeys() [][]byte { + if m != nil { + return m.RowKeys + } + return nil +} + +func (m *RowSet) GetRowRanges() []*RowRange { + if m != nil { + return m.RowRanges + } + return nil +} + +// Specifies a contiguous range of columns within a single column family. +// The range spans from : to +// :, where both bounds can be either inclusive or +// exclusive. +type ColumnRange struct { + // The name of the column family within which this range falls. + FamilyName string `protobuf:"bytes,1,opt,name=family_name,json=familyName" json:"family_name,omitempty"` + // The column qualifier at which to start the range (within 'column_family'). + // If neither field is set, interpreted as the empty string, inclusive. + // + // Types that are valid to be assigned to StartQualifier: + // *ColumnRange_StartQualifierInclusive + // *ColumnRange_StartQualifierExclusive + StartQualifier isColumnRange_StartQualifier `protobuf_oneof:"start_qualifier"` + // The column qualifier at which to end the range (within 'column_family'). + // If neither field is set, interpreted as the infinite string, exclusive. + // + // Types that are valid to be assigned to EndQualifier: + // *ColumnRange_EndQualifierInclusive + // *ColumnRange_EndQualifierExclusive + EndQualifier isColumnRange_EndQualifier `protobuf_oneof:"end_qualifier"` +} + +func (m *ColumnRange) Reset() { *m = ColumnRange{} } +func (m *ColumnRange) String() string { return proto.CompactTextString(m) } +func (*ColumnRange) ProtoMessage() {} +func (*ColumnRange) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +type isColumnRange_StartQualifier interface { + isColumnRange_StartQualifier() +} +type isColumnRange_EndQualifier interface { + isColumnRange_EndQualifier() +} + +type ColumnRange_StartQualifierInclusive struct { + StartQualifierInclusive []byte `protobuf:"bytes,2,opt,name=start_qualifier_inclusive,json=startQualifierInclusive,proto3,oneof"` +} +type ColumnRange_StartQualifierExclusive struct { + StartQualifierExclusive []byte `protobuf:"bytes,3,opt,name=start_qualifier_exclusive,json=startQualifierExclusive,proto3,oneof"` +} +type ColumnRange_EndQualifierInclusive struct { + EndQualifierInclusive []byte `protobuf:"bytes,4,opt,name=end_qualifier_inclusive,json=endQualifierInclusive,proto3,oneof"` +} +type ColumnRange_EndQualifierExclusive struct { + EndQualifierExclusive []byte `protobuf:"bytes,5,opt,name=end_qualifier_exclusive,json=endQualifierExclusive,proto3,oneof"` +} + +func (*ColumnRange_StartQualifierInclusive) isColumnRange_StartQualifier() {} +func (*ColumnRange_StartQualifierExclusive) isColumnRange_StartQualifier() {} +func (*ColumnRange_EndQualifierInclusive) isColumnRange_EndQualifier() {} +func (*ColumnRange_EndQualifierExclusive) isColumnRange_EndQualifier() {} + +func (m *ColumnRange) GetStartQualifier() isColumnRange_StartQualifier { + if m != nil { + return m.StartQualifier + } + return nil +} +func (m *ColumnRange) GetEndQualifier() isColumnRange_EndQualifier { + if m != nil { + return m.EndQualifier + } + return nil +} + +func (m *ColumnRange) GetFamilyName() string { + if m != nil { + return m.FamilyName + } + return "" +} + +func (m *ColumnRange) GetStartQualifierInclusive() []byte { + if x, ok := m.GetStartQualifier().(*ColumnRange_StartQualifierInclusive); ok { + return x.StartQualifierInclusive + } + return nil +} + +func (m *ColumnRange) GetStartQualifierExclusive() []byte { + if x, ok := m.GetStartQualifier().(*ColumnRange_StartQualifierExclusive); ok { + return x.StartQualifierExclusive + } + return nil +} + +func (m *ColumnRange) GetEndQualifierInclusive() []byte { + if x, ok := m.GetEndQualifier().(*ColumnRange_EndQualifierInclusive); ok { + return x.EndQualifierInclusive + } + return nil +} + +func (m *ColumnRange) GetEndQualifierExclusive() []byte { + if x, ok := m.GetEndQualifier().(*ColumnRange_EndQualifierExclusive); ok { + return x.EndQualifierExclusive + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*ColumnRange) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _ColumnRange_OneofMarshaler, _ColumnRange_OneofUnmarshaler, _ColumnRange_OneofSizer, []interface{}{ + (*ColumnRange_StartQualifierInclusive)(nil), + (*ColumnRange_StartQualifierExclusive)(nil), + (*ColumnRange_EndQualifierInclusive)(nil), + (*ColumnRange_EndQualifierExclusive)(nil), + } +} + +func _ColumnRange_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*ColumnRange) + // start_qualifier + switch x := m.StartQualifier.(type) { + case *ColumnRange_StartQualifierInclusive: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeRawBytes(x.StartQualifierInclusive) + case *ColumnRange_StartQualifierExclusive: + b.EncodeVarint(3<<3 | proto.WireBytes) + b.EncodeRawBytes(x.StartQualifierExclusive) + case nil: + default: + return fmt.Errorf("ColumnRange.StartQualifier has unexpected type %T", x) + } + // end_qualifier + switch x := m.EndQualifier.(type) { + case *ColumnRange_EndQualifierInclusive: + b.EncodeVarint(4<<3 | proto.WireBytes) + b.EncodeRawBytes(x.EndQualifierInclusive) + case *ColumnRange_EndQualifierExclusive: + b.EncodeVarint(5<<3 | proto.WireBytes) + b.EncodeRawBytes(x.EndQualifierExclusive) + case nil: + default: + return fmt.Errorf("ColumnRange.EndQualifier has unexpected type %T", x) + } + return nil +} + +func _ColumnRange_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*ColumnRange) + switch tag { + case 2: // start_qualifier.start_qualifier_inclusive + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.StartQualifier = &ColumnRange_StartQualifierInclusive{x} + return true, err + case 3: // start_qualifier.start_qualifier_exclusive + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.StartQualifier = &ColumnRange_StartQualifierExclusive{x} + return true, err + case 4: // end_qualifier.end_qualifier_inclusive + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.EndQualifier = &ColumnRange_EndQualifierInclusive{x} + return true, err + case 5: // end_qualifier.end_qualifier_exclusive + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.EndQualifier = &ColumnRange_EndQualifierExclusive{x} + return true, err + default: + return false, nil + } +} + +func _ColumnRange_OneofSizer(msg proto.Message) (n int) { + m := msg.(*ColumnRange) + // start_qualifier + switch x := m.StartQualifier.(type) { + case *ColumnRange_StartQualifierInclusive: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.StartQualifierInclusive))) + n += len(x.StartQualifierInclusive) + case *ColumnRange_StartQualifierExclusive: + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.StartQualifierExclusive))) + n += len(x.StartQualifierExclusive) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + // end_qualifier + switch x := m.EndQualifier.(type) { + case *ColumnRange_EndQualifierInclusive: + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.EndQualifierInclusive))) + n += len(x.EndQualifierInclusive) + case *ColumnRange_EndQualifierExclusive: + n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.EndQualifierExclusive))) + n += len(x.EndQualifierExclusive) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Specified a contiguous range of microsecond timestamps. +type TimestampRange struct { + // Inclusive lower bound. If left empty, interpreted as 0. + StartTimestampMicros int64 `protobuf:"varint,1,opt,name=start_timestamp_micros,json=startTimestampMicros" json:"start_timestamp_micros,omitempty"` + // Exclusive upper bound. If left empty, interpreted as infinity. + EndTimestampMicros int64 `protobuf:"varint,2,opt,name=end_timestamp_micros,json=endTimestampMicros" json:"end_timestamp_micros,omitempty"` +} + +func (m *TimestampRange) Reset() { *m = TimestampRange{} } +func (m *TimestampRange) String() string { return proto.CompactTextString(m) } +func (*TimestampRange) ProtoMessage() {} +func (*TimestampRange) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *TimestampRange) GetStartTimestampMicros() int64 { + if m != nil { + return m.StartTimestampMicros + } + return 0 +} + +func (m *TimestampRange) GetEndTimestampMicros() int64 { + if m != nil { + return m.EndTimestampMicros + } + return 0 +} + +// Specifies a contiguous range of raw byte values. +type ValueRange struct { + // The value at which to start the range. + // If neither field is set, interpreted as the empty string, inclusive. + // + // Types that are valid to be assigned to StartValue: + // *ValueRange_StartValueInclusive + // *ValueRange_StartValueExclusive + StartValue isValueRange_StartValue `protobuf_oneof:"start_value"` + // The value at which to end the range. + // If neither field is set, interpreted as the infinite string, exclusive. + // + // Types that are valid to be assigned to EndValue: + // *ValueRange_EndValueInclusive + // *ValueRange_EndValueExclusive + EndValue isValueRange_EndValue `protobuf_oneof:"end_value"` +} + +func (m *ValueRange) Reset() { *m = ValueRange{} } +func (m *ValueRange) String() string { return proto.CompactTextString(m) } +func (*ValueRange) ProtoMessage() {} +func (*ValueRange) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +type isValueRange_StartValue interface { + isValueRange_StartValue() +} +type isValueRange_EndValue interface { + isValueRange_EndValue() +} + +type ValueRange_StartValueInclusive struct { + StartValueInclusive []byte `protobuf:"bytes,1,opt,name=start_value_inclusive,json=startValueInclusive,proto3,oneof"` +} +type ValueRange_StartValueExclusive struct { + StartValueExclusive []byte `protobuf:"bytes,2,opt,name=start_value_exclusive,json=startValueExclusive,proto3,oneof"` +} +type ValueRange_EndValueInclusive struct { + EndValueInclusive []byte `protobuf:"bytes,3,opt,name=end_value_inclusive,json=endValueInclusive,proto3,oneof"` +} +type ValueRange_EndValueExclusive struct { + EndValueExclusive []byte `protobuf:"bytes,4,opt,name=end_value_exclusive,json=endValueExclusive,proto3,oneof"` +} + +func (*ValueRange_StartValueInclusive) isValueRange_StartValue() {} +func (*ValueRange_StartValueExclusive) isValueRange_StartValue() {} +func (*ValueRange_EndValueInclusive) isValueRange_EndValue() {} +func (*ValueRange_EndValueExclusive) isValueRange_EndValue() {} + +func (m *ValueRange) GetStartValue() isValueRange_StartValue { + if m != nil { + return m.StartValue + } + return nil +} +func (m *ValueRange) GetEndValue() isValueRange_EndValue { + if m != nil { + return m.EndValue + } + return nil +} + +func (m *ValueRange) GetStartValueInclusive() []byte { + if x, ok := m.GetStartValue().(*ValueRange_StartValueInclusive); ok { + return x.StartValueInclusive + } + return nil +} + +func (m *ValueRange) GetStartValueExclusive() []byte { + if x, ok := m.GetStartValue().(*ValueRange_StartValueExclusive); ok { + return x.StartValueExclusive + } + return nil +} + +func (m *ValueRange) GetEndValueInclusive() []byte { + if x, ok := m.GetEndValue().(*ValueRange_EndValueInclusive); ok { + return x.EndValueInclusive + } + return nil +} + +func (m *ValueRange) GetEndValueExclusive() []byte { + if x, ok := m.GetEndValue().(*ValueRange_EndValueExclusive); ok { + return x.EndValueExclusive + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*ValueRange) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _ValueRange_OneofMarshaler, _ValueRange_OneofUnmarshaler, _ValueRange_OneofSizer, []interface{}{ + (*ValueRange_StartValueInclusive)(nil), + (*ValueRange_StartValueExclusive)(nil), + (*ValueRange_EndValueInclusive)(nil), + (*ValueRange_EndValueExclusive)(nil), + } +} + +func _ValueRange_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*ValueRange) + // start_value + switch x := m.StartValue.(type) { + case *ValueRange_StartValueInclusive: + b.EncodeVarint(1<<3 | proto.WireBytes) + b.EncodeRawBytes(x.StartValueInclusive) + case *ValueRange_StartValueExclusive: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeRawBytes(x.StartValueExclusive) + case nil: + default: + return fmt.Errorf("ValueRange.StartValue has unexpected type %T", x) + } + // end_value + switch x := m.EndValue.(type) { + case *ValueRange_EndValueInclusive: + b.EncodeVarint(3<<3 | proto.WireBytes) + b.EncodeRawBytes(x.EndValueInclusive) + case *ValueRange_EndValueExclusive: + b.EncodeVarint(4<<3 | proto.WireBytes) + b.EncodeRawBytes(x.EndValueExclusive) + case nil: + default: + return fmt.Errorf("ValueRange.EndValue has unexpected type %T", x) + } + return nil +} + +func _ValueRange_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*ValueRange) + switch tag { + case 1: // start_value.start_value_inclusive + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.StartValue = &ValueRange_StartValueInclusive{x} + return true, err + case 2: // start_value.start_value_exclusive + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.StartValue = &ValueRange_StartValueExclusive{x} + return true, err + case 3: // end_value.end_value_inclusive + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.EndValue = &ValueRange_EndValueInclusive{x} + return true, err + case 4: // end_value.end_value_exclusive + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.EndValue = &ValueRange_EndValueExclusive{x} + return true, err + default: + return false, nil + } +} + +func _ValueRange_OneofSizer(msg proto.Message) (n int) { + m := msg.(*ValueRange) + // start_value + switch x := m.StartValue.(type) { + case *ValueRange_StartValueInclusive: + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.StartValueInclusive))) + n += len(x.StartValueInclusive) + case *ValueRange_StartValueExclusive: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.StartValueExclusive))) + n += len(x.StartValueExclusive) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + // end_value + switch x := m.EndValue.(type) { + case *ValueRange_EndValueInclusive: + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.EndValueInclusive))) + n += len(x.EndValueInclusive) + case *ValueRange_EndValueExclusive: + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.EndValueExclusive))) + n += len(x.EndValueExclusive) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Takes a row as input and produces an alternate view of the row based on +// specified rules. For example, a RowFilter might trim down a row to include +// just the cells from columns matching a given regular expression, or might +// return all the cells of a row but not their values. More complicated filters +// can be composed out of these components to express requests such as, "within +// every column of a particular family, give just the two most recent cells +// which are older than timestamp X." +// +// There are two broad categories of RowFilters (true filters and transformers), +// as well as two ways to compose simple filters into more complex ones +// (chains and interleaves). They work as follows: +// +// * True filters alter the input row by excluding some of its cells wholesale +// from the output row. An example of a true filter is the "value_regex_filter", +// which excludes cells whose values don't match the specified pattern. All +// regex true filters use RE2 syntax (https://github.com/google/re2/wiki/Syntax) +// in raw byte mode (RE2::Latin1), and are evaluated as full matches. An +// important point to keep in mind is that RE2(.) is equivalent by default to +// RE2([^\n]), meaning that it does not match newlines. When attempting to match +// an arbitrary byte, you should therefore use the escape sequence '\C', which +// may need to be further escaped as '\\C' in your client language. +// +// * Transformers alter the input row by changing the values of some of its +// cells in the output, without excluding them completely. Currently, the only +// supported transformer is the "strip_value_transformer", which replaces every +// cell's value with the empty string. +// +// * Chains and interleaves are described in more detail in the +// RowFilter.Chain and RowFilter.Interleave documentation. +// +// The total serialized size of a RowFilter message must not +// exceed 4096 bytes, and RowFilters may not be nested within each other +// (in Chains or Interleaves) to a depth of more than 20. +type RowFilter struct { + // Which of the possible RowFilter types to apply. If none are set, this + // RowFilter returns all cells in the input row. + // + // Types that are valid to be assigned to Filter: + // *RowFilter_Chain_ + // *RowFilter_Interleave_ + // *RowFilter_Condition_ + // *RowFilter_Sink + // *RowFilter_PassAllFilter + // *RowFilter_BlockAllFilter + // *RowFilter_RowKeyRegexFilter + // *RowFilter_RowSampleFilter + // *RowFilter_FamilyNameRegexFilter + // *RowFilter_ColumnQualifierRegexFilter + // *RowFilter_ColumnRangeFilter + // *RowFilter_TimestampRangeFilter + // *RowFilter_ValueRegexFilter + // *RowFilter_ValueRangeFilter + // *RowFilter_CellsPerRowOffsetFilter + // *RowFilter_CellsPerRowLimitFilter + // *RowFilter_CellsPerColumnLimitFilter + // *RowFilter_StripValueTransformer + // *RowFilter_ApplyLabelTransformer + Filter isRowFilter_Filter `protobuf_oneof:"filter"` +} + +func (m *RowFilter) Reset() { *m = RowFilter{} } +func (m *RowFilter) String() string { return proto.CompactTextString(m) } +func (*RowFilter) ProtoMessage() {} +func (*RowFilter) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +type isRowFilter_Filter interface { + isRowFilter_Filter() +} + +type RowFilter_Chain_ struct { + Chain *RowFilter_Chain `protobuf:"bytes,1,opt,name=chain,oneof"` +} +type RowFilter_Interleave_ struct { + Interleave *RowFilter_Interleave `protobuf:"bytes,2,opt,name=interleave,oneof"` +} +type RowFilter_Condition_ struct { + Condition *RowFilter_Condition `protobuf:"bytes,3,opt,name=condition,oneof"` +} +type RowFilter_Sink struct { + Sink bool `protobuf:"varint,16,opt,name=sink,oneof"` +} +type RowFilter_PassAllFilter struct { + PassAllFilter bool `protobuf:"varint,17,opt,name=pass_all_filter,json=passAllFilter,oneof"` +} +type RowFilter_BlockAllFilter struct { + BlockAllFilter bool `protobuf:"varint,18,opt,name=block_all_filter,json=blockAllFilter,oneof"` +} +type RowFilter_RowKeyRegexFilter struct { + RowKeyRegexFilter []byte `protobuf:"bytes,4,opt,name=row_key_regex_filter,json=rowKeyRegexFilter,proto3,oneof"` +} +type RowFilter_RowSampleFilter struct { + RowSampleFilter float64 `protobuf:"fixed64,14,opt,name=row_sample_filter,json=rowSampleFilter,oneof"` +} +type RowFilter_FamilyNameRegexFilter struct { + FamilyNameRegexFilter string `protobuf:"bytes,5,opt,name=family_name_regex_filter,json=familyNameRegexFilter,oneof"` +} +type RowFilter_ColumnQualifierRegexFilter struct { + ColumnQualifierRegexFilter []byte `protobuf:"bytes,6,opt,name=column_qualifier_regex_filter,json=columnQualifierRegexFilter,proto3,oneof"` +} +type RowFilter_ColumnRangeFilter struct { + ColumnRangeFilter *ColumnRange `protobuf:"bytes,7,opt,name=column_range_filter,json=columnRangeFilter,oneof"` +} +type RowFilter_TimestampRangeFilter struct { + TimestampRangeFilter *TimestampRange `protobuf:"bytes,8,opt,name=timestamp_range_filter,json=timestampRangeFilter,oneof"` +} +type RowFilter_ValueRegexFilter struct { + ValueRegexFilter []byte `protobuf:"bytes,9,opt,name=value_regex_filter,json=valueRegexFilter,proto3,oneof"` +} +type RowFilter_ValueRangeFilter struct { + ValueRangeFilter *ValueRange `protobuf:"bytes,15,opt,name=value_range_filter,json=valueRangeFilter,oneof"` +} +type RowFilter_CellsPerRowOffsetFilter struct { + CellsPerRowOffsetFilter int32 `protobuf:"varint,10,opt,name=cells_per_row_offset_filter,json=cellsPerRowOffsetFilter,oneof"` +} +type RowFilter_CellsPerRowLimitFilter struct { + CellsPerRowLimitFilter int32 `protobuf:"varint,11,opt,name=cells_per_row_limit_filter,json=cellsPerRowLimitFilter,oneof"` +} +type RowFilter_CellsPerColumnLimitFilter struct { + CellsPerColumnLimitFilter int32 `protobuf:"varint,12,opt,name=cells_per_column_limit_filter,json=cellsPerColumnLimitFilter,oneof"` +} +type RowFilter_StripValueTransformer struct { + StripValueTransformer bool `protobuf:"varint,13,opt,name=strip_value_transformer,json=stripValueTransformer,oneof"` +} +type RowFilter_ApplyLabelTransformer struct { + ApplyLabelTransformer string `protobuf:"bytes,19,opt,name=apply_label_transformer,json=applyLabelTransformer,oneof"` +} + +func (*RowFilter_Chain_) isRowFilter_Filter() {} +func (*RowFilter_Interleave_) isRowFilter_Filter() {} +func (*RowFilter_Condition_) isRowFilter_Filter() {} +func (*RowFilter_Sink) isRowFilter_Filter() {} +func (*RowFilter_PassAllFilter) isRowFilter_Filter() {} +func (*RowFilter_BlockAllFilter) isRowFilter_Filter() {} +func (*RowFilter_RowKeyRegexFilter) isRowFilter_Filter() {} +func (*RowFilter_RowSampleFilter) isRowFilter_Filter() {} +func (*RowFilter_FamilyNameRegexFilter) isRowFilter_Filter() {} +func (*RowFilter_ColumnQualifierRegexFilter) isRowFilter_Filter() {} +func (*RowFilter_ColumnRangeFilter) isRowFilter_Filter() {} +func (*RowFilter_TimestampRangeFilter) isRowFilter_Filter() {} +func (*RowFilter_ValueRegexFilter) isRowFilter_Filter() {} +func (*RowFilter_ValueRangeFilter) isRowFilter_Filter() {} +func (*RowFilter_CellsPerRowOffsetFilter) isRowFilter_Filter() {} +func (*RowFilter_CellsPerRowLimitFilter) isRowFilter_Filter() {} +func (*RowFilter_CellsPerColumnLimitFilter) isRowFilter_Filter() {} +func (*RowFilter_StripValueTransformer) isRowFilter_Filter() {} +func (*RowFilter_ApplyLabelTransformer) isRowFilter_Filter() {} + +func (m *RowFilter) GetFilter() isRowFilter_Filter { + if m != nil { + return m.Filter + } + return nil +} + +func (m *RowFilter) GetChain() *RowFilter_Chain { + if x, ok := m.GetFilter().(*RowFilter_Chain_); ok { + return x.Chain + } + return nil +} + +func (m *RowFilter) GetInterleave() *RowFilter_Interleave { + if x, ok := m.GetFilter().(*RowFilter_Interleave_); ok { + return x.Interleave + } + return nil +} + +func (m *RowFilter) GetCondition() *RowFilter_Condition { + if x, ok := m.GetFilter().(*RowFilter_Condition_); ok { + return x.Condition + } + return nil +} + +func (m *RowFilter) GetSink() bool { + if x, ok := m.GetFilter().(*RowFilter_Sink); ok { + return x.Sink + } + return false +} + +func (m *RowFilter) GetPassAllFilter() bool { + if x, ok := m.GetFilter().(*RowFilter_PassAllFilter); ok { + return x.PassAllFilter + } + return false +} + +func (m *RowFilter) GetBlockAllFilter() bool { + if x, ok := m.GetFilter().(*RowFilter_BlockAllFilter); ok { + return x.BlockAllFilter + } + return false +} + +func (m *RowFilter) GetRowKeyRegexFilter() []byte { + if x, ok := m.GetFilter().(*RowFilter_RowKeyRegexFilter); ok { + return x.RowKeyRegexFilter + } + return nil +} + +func (m *RowFilter) GetRowSampleFilter() float64 { + if x, ok := m.GetFilter().(*RowFilter_RowSampleFilter); ok { + return x.RowSampleFilter + } + return 0 +} + +func (m *RowFilter) GetFamilyNameRegexFilter() string { + if x, ok := m.GetFilter().(*RowFilter_FamilyNameRegexFilter); ok { + return x.FamilyNameRegexFilter + } + return "" +} + +func (m *RowFilter) GetColumnQualifierRegexFilter() []byte { + if x, ok := m.GetFilter().(*RowFilter_ColumnQualifierRegexFilter); ok { + return x.ColumnQualifierRegexFilter + } + return nil +} + +func (m *RowFilter) GetColumnRangeFilter() *ColumnRange { + if x, ok := m.GetFilter().(*RowFilter_ColumnRangeFilter); ok { + return x.ColumnRangeFilter + } + return nil +} + +func (m *RowFilter) GetTimestampRangeFilter() *TimestampRange { + if x, ok := m.GetFilter().(*RowFilter_TimestampRangeFilter); ok { + return x.TimestampRangeFilter + } + return nil +} + +func (m *RowFilter) GetValueRegexFilter() []byte { + if x, ok := m.GetFilter().(*RowFilter_ValueRegexFilter); ok { + return x.ValueRegexFilter + } + return nil +} + +func (m *RowFilter) GetValueRangeFilter() *ValueRange { + if x, ok := m.GetFilter().(*RowFilter_ValueRangeFilter); ok { + return x.ValueRangeFilter + } + return nil +} + +func (m *RowFilter) GetCellsPerRowOffsetFilter() int32 { + if x, ok := m.GetFilter().(*RowFilter_CellsPerRowOffsetFilter); ok { + return x.CellsPerRowOffsetFilter + } + return 0 +} + +func (m *RowFilter) GetCellsPerRowLimitFilter() int32 { + if x, ok := m.GetFilter().(*RowFilter_CellsPerRowLimitFilter); ok { + return x.CellsPerRowLimitFilter + } + return 0 +} + +func (m *RowFilter) GetCellsPerColumnLimitFilter() int32 { + if x, ok := m.GetFilter().(*RowFilter_CellsPerColumnLimitFilter); ok { + return x.CellsPerColumnLimitFilter + } + return 0 +} + +func (m *RowFilter) GetStripValueTransformer() bool { + if x, ok := m.GetFilter().(*RowFilter_StripValueTransformer); ok { + return x.StripValueTransformer + } + return false +} + +func (m *RowFilter) GetApplyLabelTransformer() string { + if x, ok := m.GetFilter().(*RowFilter_ApplyLabelTransformer); ok { + return x.ApplyLabelTransformer + } + return "" +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*RowFilter) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _RowFilter_OneofMarshaler, _RowFilter_OneofUnmarshaler, _RowFilter_OneofSizer, []interface{}{ + (*RowFilter_Chain_)(nil), + (*RowFilter_Interleave_)(nil), + (*RowFilter_Condition_)(nil), + (*RowFilter_Sink)(nil), + (*RowFilter_PassAllFilter)(nil), + (*RowFilter_BlockAllFilter)(nil), + (*RowFilter_RowKeyRegexFilter)(nil), + (*RowFilter_RowSampleFilter)(nil), + (*RowFilter_FamilyNameRegexFilter)(nil), + (*RowFilter_ColumnQualifierRegexFilter)(nil), + (*RowFilter_ColumnRangeFilter)(nil), + (*RowFilter_TimestampRangeFilter)(nil), + (*RowFilter_ValueRegexFilter)(nil), + (*RowFilter_ValueRangeFilter)(nil), + (*RowFilter_CellsPerRowOffsetFilter)(nil), + (*RowFilter_CellsPerRowLimitFilter)(nil), + (*RowFilter_CellsPerColumnLimitFilter)(nil), + (*RowFilter_StripValueTransformer)(nil), + (*RowFilter_ApplyLabelTransformer)(nil), + } +} + +func _RowFilter_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*RowFilter) + // filter + switch x := m.Filter.(type) { + case *RowFilter_Chain_: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Chain); err != nil { + return err + } + case *RowFilter_Interleave_: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Interleave); err != nil { + return err + } + case *RowFilter_Condition_: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Condition); err != nil { + return err + } + case *RowFilter_Sink: + t := uint64(0) + if x.Sink { + t = 1 + } + b.EncodeVarint(16<<3 | proto.WireVarint) + b.EncodeVarint(t) + case *RowFilter_PassAllFilter: + t := uint64(0) + if x.PassAllFilter { + t = 1 + } + b.EncodeVarint(17<<3 | proto.WireVarint) + b.EncodeVarint(t) + case *RowFilter_BlockAllFilter: + t := uint64(0) + if x.BlockAllFilter { + t = 1 + } + b.EncodeVarint(18<<3 | proto.WireVarint) + b.EncodeVarint(t) + case *RowFilter_RowKeyRegexFilter: + b.EncodeVarint(4<<3 | proto.WireBytes) + b.EncodeRawBytes(x.RowKeyRegexFilter) + case *RowFilter_RowSampleFilter: + b.EncodeVarint(14<<3 | proto.WireFixed64) + b.EncodeFixed64(math.Float64bits(x.RowSampleFilter)) + case *RowFilter_FamilyNameRegexFilter: + b.EncodeVarint(5<<3 | proto.WireBytes) + b.EncodeStringBytes(x.FamilyNameRegexFilter) + case *RowFilter_ColumnQualifierRegexFilter: + b.EncodeVarint(6<<3 | proto.WireBytes) + b.EncodeRawBytes(x.ColumnQualifierRegexFilter) + case *RowFilter_ColumnRangeFilter: + b.EncodeVarint(7<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ColumnRangeFilter); err != nil { + return err + } + case *RowFilter_TimestampRangeFilter: + b.EncodeVarint(8<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.TimestampRangeFilter); err != nil { + return err + } + case *RowFilter_ValueRegexFilter: + b.EncodeVarint(9<<3 | proto.WireBytes) + b.EncodeRawBytes(x.ValueRegexFilter) + case *RowFilter_ValueRangeFilter: + b.EncodeVarint(15<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ValueRangeFilter); err != nil { + return err + } + case *RowFilter_CellsPerRowOffsetFilter: + b.EncodeVarint(10<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.CellsPerRowOffsetFilter)) + case *RowFilter_CellsPerRowLimitFilter: + b.EncodeVarint(11<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.CellsPerRowLimitFilter)) + case *RowFilter_CellsPerColumnLimitFilter: + b.EncodeVarint(12<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.CellsPerColumnLimitFilter)) + case *RowFilter_StripValueTransformer: + t := uint64(0) + if x.StripValueTransformer { + t = 1 + } + b.EncodeVarint(13<<3 | proto.WireVarint) + b.EncodeVarint(t) + case *RowFilter_ApplyLabelTransformer: + b.EncodeVarint(19<<3 | proto.WireBytes) + b.EncodeStringBytes(x.ApplyLabelTransformer) + case nil: + default: + return fmt.Errorf("RowFilter.Filter has unexpected type %T", x) + } + return nil +} + +func _RowFilter_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*RowFilter) + switch tag { + case 1: // filter.chain + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(RowFilter_Chain) + err := b.DecodeMessage(msg) + m.Filter = &RowFilter_Chain_{msg} + return true, err + case 2: // filter.interleave + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(RowFilter_Interleave) + err := b.DecodeMessage(msg) + m.Filter = &RowFilter_Interleave_{msg} + return true, err + case 3: // filter.condition + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(RowFilter_Condition) + err := b.DecodeMessage(msg) + m.Filter = &RowFilter_Condition_{msg} + return true, err + case 16: // filter.sink + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Filter = &RowFilter_Sink{x != 0} + return true, err + case 17: // filter.pass_all_filter + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Filter = &RowFilter_PassAllFilter{x != 0} + return true, err + case 18: // filter.block_all_filter + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Filter = &RowFilter_BlockAllFilter{x != 0} + return true, err + case 4: // filter.row_key_regex_filter + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.Filter = &RowFilter_RowKeyRegexFilter{x} + return true, err + case 14: // filter.row_sample_filter + if wire != proto.WireFixed64 { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeFixed64() + m.Filter = &RowFilter_RowSampleFilter{math.Float64frombits(x)} + return true, err + case 5: // filter.family_name_regex_filter + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Filter = &RowFilter_FamilyNameRegexFilter{x} + return true, err + case 6: // filter.column_qualifier_regex_filter + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.Filter = &RowFilter_ColumnQualifierRegexFilter{x} + return true, err + case 7: // filter.column_range_filter + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ColumnRange) + err := b.DecodeMessage(msg) + m.Filter = &RowFilter_ColumnRangeFilter{msg} + return true, err + case 8: // filter.timestamp_range_filter + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(TimestampRange) + err := b.DecodeMessage(msg) + m.Filter = &RowFilter_TimestampRangeFilter{msg} + return true, err + case 9: // filter.value_regex_filter + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.Filter = &RowFilter_ValueRegexFilter{x} + return true, err + case 15: // filter.value_range_filter + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ValueRange) + err := b.DecodeMessage(msg) + m.Filter = &RowFilter_ValueRangeFilter{msg} + return true, err + case 10: // filter.cells_per_row_offset_filter + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Filter = &RowFilter_CellsPerRowOffsetFilter{int32(x)} + return true, err + case 11: // filter.cells_per_row_limit_filter + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Filter = &RowFilter_CellsPerRowLimitFilter{int32(x)} + return true, err + case 12: // filter.cells_per_column_limit_filter + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Filter = &RowFilter_CellsPerColumnLimitFilter{int32(x)} + return true, err + case 13: // filter.strip_value_transformer + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Filter = &RowFilter_StripValueTransformer{x != 0} + return true, err + case 19: // filter.apply_label_transformer + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Filter = &RowFilter_ApplyLabelTransformer{x} + return true, err + default: + return false, nil + } +} + +func _RowFilter_OneofSizer(msg proto.Message) (n int) { + m := msg.(*RowFilter) + // filter + switch x := m.Filter.(type) { + case *RowFilter_Chain_: + s := proto.Size(x.Chain) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *RowFilter_Interleave_: + s := proto.Size(x.Interleave) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *RowFilter_Condition_: + s := proto.Size(x.Condition) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *RowFilter_Sink: + n += proto.SizeVarint(16<<3 | proto.WireVarint) + n += 1 + case *RowFilter_PassAllFilter: + n += proto.SizeVarint(17<<3 | proto.WireVarint) + n += 1 + case *RowFilter_BlockAllFilter: + n += proto.SizeVarint(18<<3 | proto.WireVarint) + n += 1 + case *RowFilter_RowKeyRegexFilter: + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.RowKeyRegexFilter))) + n += len(x.RowKeyRegexFilter) + case *RowFilter_RowSampleFilter: + n += proto.SizeVarint(14<<3 | proto.WireFixed64) + n += 8 + case *RowFilter_FamilyNameRegexFilter: + n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.FamilyNameRegexFilter))) + n += len(x.FamilyNameRegexFilter) + case *RowFilter_ColumnQualifierRegexFilter: + n += proto.SizeVarint(6<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.ColumnQualifierRegexFilter))) + n += len(x.ColumnQualifierRegexFilter) + case *RowFilter_ColumnRangeFilter: + s := proto.Size(x.ColumnRangeFilter) + n += proto.SizeVarint(7<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *RowFilter_TimestampRangeFilter: + s := proto.Size(x.TimestampRangeFilter) + n += proto.SizeVarint(8<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *RowFilter_ValueRegexFilter: + n += proto.SizeVarint(9<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.ValueRegexFilter))) + n += len(x.ValueRegexFilter) + case *RowFilter_ValueRangeFilter: + s := proto.Size(x.ValueRangeFilter) + n += proto.SizeVarint(15<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *RowFilter_CellsPerRowOffsetFilter: + n += proto.SizeVarint(10<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.CellsPerRowOffsetFilter)) + case *RowFilter_CellsPerRowLimitFilter: + n += proto.SizeVarint(11<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.CellsPerRowLimitFilter)) + case *RowFilter_CellsPerColumnLimitFilter: + n += proto.SizeVarint(12<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.CellsPerColumnLimitFilter)) + case *RowFilter_StripValueTransformer: + n += proto.SizeVarint(13<<3 | proto.WireVarint) + n += 1 + case *RowFilter_ApplyLabelTransformer: + n += proto.SizeVarint(19<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.ApplyLabelTransformer))) + n += len(x.ApplyLabelTransformer) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// A RowFilter which sends rows through several RowFilters in sequence. +type RowFilter_Chain struct { + // The elements of "filters" are chained together to process the input row: + // in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row + // The full chain is executed atomically. + Filters []*RowFilter `protobuf:"bytes,1,rep,name=filters" json:"filters,omitempty"` +} + +func (m *RowFilter_Chain) Reset() { *m = RowFilter_Chain{} } +func (m *RowFilter_Chain) String() string { return proto.CompactTextString(m) } +func (*RowFilter_Chain) ProtoMessage() {} +func (*RowFilter_Chain) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9, 0} } + +func (m *RowFilter_Chain) GetFilters() []*RowFilter { + if m != nil { + return m.Filters + } + return nil +} + +// A RowFilter which sends each row to each of several component +// RowFilters and interleaves the results. +type RowFilter_Interleave struct { + // The elements of "filters" all process a copy of the input row, and the + // results are pooled, sorted, and combined into a single output row. + // If multiple cells are produced with the same column and timestamp, + // they will all appear in the output row in an unspecified mutual order. + // Consider the following example, with three filters: + // + // input row + // | + // ----------------------------------------------------- + // | | | + // f(0) f(1) f(2) + // | | | + // 1: foo,bar,10,x foo,bar,10,z far,bar,7,a + // 2: foo,blah,11,z far,blah,5,x far,blah,5,x + // | | | + // ----------------------------------------------------- + // | + // 1: foo,bar,10,z // could have switched with #2 + // 2: foo,bar,10,x // could have switched with #1 + // 3: foo,blah,11,z + // 4: far,bar,7,a + // 5: far,blah,5,x // identical to #6 + // 6: far,blah,5,x // identical to #5 + // All interleaved filters are executed atomically. + Filters []*RowFilter `protobuf:"bytes,1,rep,name=filters" json:"filters,omitempty"` +} + +func (m *RowFilter_Interleave) Reset() { *m = RowFilter_Interleave{} } +func (m *RowFilter_Interleave) String() string { return proto.CompactTextString(m) } +func (*RowFilter_Interleave) ProtoMessage() {} +func (*RowFilter_Interleave) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9, 1} } + +func (m *RowFilter_Interleave) GetFilters() []*RowFilter { + if m != nil { + return m.Filters + } + return nil +} + +// A RowFilter which evaluates one of two possible RowFilters, depending on +// whether or not a predicate RowFilter outputs any cells from the input row. +// +// IMPORTANT NOTE: The predicate filter does not execute atomically with the +// true and false filters, which may lead to inconsistent or unexpected +// results. Additionally, Condition filters have poor performance, especially +// when filters are set for the false condition. +type RowFilter_Condition struct { + // If "predicate_filter" outputs any cells, then "true_filter" will be + // evaluated on the input row. Otherwise, "false_filter" will be evaluated. + PredicateFilter *RowFilter `protobuf:"bytes,1,opt,name=predicate_filter,json=predicateFilter" json:"predicate_filter,omitempty"` + // The filter to apply to the input row if "predicate_filter" returns any + // results. If not provided, no results will be returned in the true case. + TrueFilter *RowFilter `protobuf:"bytes,2,opt,name=true_filter,json=trueFilter" json:"true_filter,omitempty"` + // The filter to apply to the input row if "predicate_filter" does not + // return any results. If not provided, no results will be returned in the + // false case. + FalseFilter *RowFilter `protobuf:"bytes,3,opt,name=false_filter,json=falseFilter" json:"false_filter,omitempty"` +} + +func (m *RowFilter_Condition) Reset() { *m = RowFilter_Condition{} } +func (m *RowFilter_Condition) String() string { return proto.CompactTextString(m) } +func (*RowFilter_Condition) ProtoMessage() {} +func (*RowFilter_Condition) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9, 2} } + +func (m *RowFilter_Condition) GetPredicateFilter() *RowFilter { + if m != nil { + return m.PredicateFilter + } + return nil +} + +func (m *RowFilter_Condition) GetTrueFilter() *RowFilter { + if m != nil { + return m.TrueFilter + } + return nil +} + +func (m *RowFilter_Condition) GetFalseFilter() *RowFilter { + if m != nil { + return m.FalseFilter + } + return nil +} + +// Specifies a particular change to be made to the contents of a row. +type Mutation struct { + // Which of the possible Mutation types to apply. + // + // Types that are valid to be assigned to Mutation: + // *Mutation_SetCell_ + // *Mutation_DeleteFromColumn_ + // *Mutation_DeleteFromFamily_ + // *Mutation_DeleteFromRow_ + Mutation isMutation_Mutation `protobuf_oneof:"mutation"` +} + +func (m *Mutation) Reset() { *m = Mutation{} } +func (m *Mutation) String() string { return proto.CompactTextString(m) } +func (*Mutation) ProtoMessage() {} +func (*Mutation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +type isMutation_Mutation interface { + isMutation_Mutation() +} + +type Mutation_SetCell_ struct { + SetCell *Mutation_SetCell `protobuf:"bytes,1,opt,name=set_cell,json=setCell,oneof"` +} +type Mutation_DeleteFromColumn_ struct { + DeleteFromColumn *Mutation_DeleteFromColumn `protobuf:"bytes,2,opt,name=delete_from_column,json=deleteFromColumn,oneof"` +} +type Mutation_DeleteFromFamily_ struct { + DeleteFromFamily *Mutation_DeleteFromFamily `protobuf:"bytes,3,opt,name=delete_from_family,json=deleteFromFamily,oneof"` +} +type Mutation_DeleteFromRow_ struct { + DeleteFromRow *Mutation_DeleteFromRow `protobuf:"bytes,4,opt,name=delete_from_row,json=deleteFromRow,oneof"` +} + +func (*Mutation_SetCell_) isMutation_Mutation() {} +func (*Mutation_DeleteFromColumn_) isMutation_Mutation() {} +func (*Mutation_DeleteFromFamily_) isMutation_Mutation() {} +func (*Mutation_DeleteFromRow_) isMutation_Mutation() {} + +func (m *Mutation) GetMutation() isMutation_Mutation { + if m != nil { + return m.Mutation + } + return nil +} + +func (m *Mutation) GetSetCell() *Mutation_SetCell { + if x, ok := m.GetMutation().(*Mutation_SetCell_); ok { + return x.SetCell + } + return nil +} + +func (m *Mutation) GetDeleteFromColumn() *Mutation_DeleteFromColumn { + if x, ok := m.GetMutation().(*Mutation_DeleteFromColumn_); ok { + return x.DeleteFromColumn + } + return nil +} + +func (m *Mutation) GetDeleteFromFamily() *Mutation_DeleteFromFamily { + if x, ok := m.GetMutation().(*Mutation_DeleteFromFamily_); ok { + return x.DeleteFromFamily + } + return nil +} + +func (m *Mutation) GetDeleteFromRow() *Mutation_DeleteFromRow { + if x, ok := m.GetMutation().(*Mutation_DeleteFromRow_); ok { + return x.DeleteFromRow + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Mutation) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _Mutation_OneofMarshaler, _Mutation_OneofUnmarshaler, _Mutation_OneofSizer, []interface{}{ + (*Mutation_SetCell_)(nil), + (*Mutation_DeleteFromColumn_)(nil), + (*Mutation_DeleteFromFamily_)(nil), + (*Mutation_DeleteFromRow_)(nil), + } +} + +func _Mutation_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Mutation) + // mutation + switch x := m.Mutation.(type) { + case *Mutation_SetCell_: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.SetCell); err != nil { + return err + } + case *Mutation_DeleteFromColumn_: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.DeleteFromColumn); err != nil { + return err + } + case *Mutation_DeleteFromFamily_: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.DeleteFromFamily); err != nil { + return err + } + case *Mutation_DeleteFromRow_: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.DeleteFromRow); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("Mutation.Mutation has unexpected type %T", x) + } + return nil +} + +func _Mutation_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Mutation) + switch tag { + case 1: // mutation.set_cell + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Mutation_SetCell) + err := b.DecodeMessage(msg) + m.Mutation = &Mutation_SetCell_{msg} + return true, err + case 2: // mutation.delete_from_column + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Mutation_DeleteFromColumn) + err := b.DecodeMessage(msg) + m.Mutation = &Mutation_DeleteFromColumn_{msg} + return true, err + case 3: // mutation.delete_from_family + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Mutation_DeleteFromFamily) + err := b.DecodeMessage(msg) + m.Mutation = &Mutation_DeleteFromFamily_{msg} + return true, err + case 4: // mutation.delete_from_row + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Mutation_DeleteFromRow) + err := b.DecodeMessage(msg) + m.Mutation = &Mutation_DeleteFromRow_{msg} + return true, err + default: + return false, nil + } +} + +func _Mutation_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Mutation) + // mutation + switch x := m.Mutation.(type) { + case *Mutation_SetCell_: + s := proto.Size(x.SetCell) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Mutation_DeleteFromColumn_: + s := proto.Size(x.DeleteFromColumn) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Mutation_DeleteFromFamily_: + s := proto.Size(x.DeleteFromFamily) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Mutation_DeleteFromRow_: + s := proto.Size(x.DeleteFromRow) + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// A Mutation which sets the value of the specified cell. +type Mutation_SetCell struct { + // The name of the family into which new data should be written. + // Must match [-_.a-zA-Z0-9]+ + FamilyName string `protobuf:"bytes,1,opt,name=family_name,json=familyName" json:"family_name,omitempty"` + // The qualifier of the column into which new data should be written. + // Can be any byte string, including the empty string. + ColumnQualifier []byte `protobuf:"bytes,2,opt,name=column_qualifier,json=columnQualifier,proto3" json:"column_qualifier,omitempty"` + // The timestamp of the cell into which new data should be written. + // Use -1 for current Bigtable server time. + // Otherwise, the client should set this value itself, noting that the + // default value is a timestamp of zero if the field is left unspecified. + // Values must match the "granularity" of the table (e.g. micros, millis). + TimestampMicros int64 `protobuf:"varint,3,opt,name=timestamp_micros,json=timestampMicros" json:"timestamp_micros,omitempty"` + // The value to be written into the specified cell. + Value []byte `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` +} + +func (m *Mutation_SetCell) Reset() { *m = Mutation_SetCell{} } +func (m *Mutation_SetCell) String() string { return proto.CompactTextString(m) } +func (*Mutation_SetCell) ProtoMessage() {} +func (*Mutation_SetCell) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10, 0} } + +func (m *Mutation_SetCell) GetFamilyName() string { + if m != nil { + return m.FamilyName + } + return "" +} + +func (m *Mutation_SetCell) GetColumnQualifier() []byte { + if m != nil { + return m.ColumnQualifier + } + return nil +} + +func (m *Mutation_SetCell) GetTimestampMicros() int64 { + if m != nil { + return m.TimestampMicros + } + return 0 +} + +func (m *Mutation_SetCell) GetValue() []byte { + if m != nil { + return m.Value + } + return nil +} + +// A Mutation which deletes cells from the specified column, optionally +// restricting the deletions to a given timestamp range. +type Mutation_DeleteFromColumn struct { + // The name of the family from which cells should be deleted. + // Must match [-_.a-zA-Z0-9]+ + FamilyName string `protobuf:"bytes,1,opt,name=family_name,json=familyName" json:"family_name,omitempty"` + // The qualifier of the column from which cells should be deleted. + // Can be any byte string, including the empty string. + ColumnQualifier []byte `protobuf:"bytes,2,opt,name=column_qualifier,json=columnQualifier,proto3" json:"column_qualifier,omitempty"` + // The range of timestamps within which cells should be deleted. + TimeRange *TimestampRange `protobuf:"bytes,3,opt,name=time_range,json=timeRange" json:"time_range,omitempty"` +} + +func (m *Mutation_DeleteFromColumn) Reset() { *m = Mutation_DeleteFromColumn{} } +func (m *Mutation_DeleteFromColumn) String() string { return proto.CompactTextString(m) } +func (*Mutation_DeleteFromColumn) ProtoMessage() {} +func (*Mutation_DeleteFromColumn) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10, 1} } + +func (m *Mutation_DeleteFromColumn) GetFamilyName() string { + if m != nil { + return m.FamilyName + } + return "" +} + +func (m *Mutation_DeleteFromColumn) GetColumnQualifier() []byte { + if m != nil { + return m.ColumnQualifier + } + return nil +} + +func (m *Mutation_DeleteFromColumn) GetTimeRange() *TimestampRange { + if m != nil { + return m.TimeRange + } + return nil +} + +// A Mutation which deletes all cells from the specified column family. +type Mutation_DeleteFromFamily struct { + // The name of the family from which cells should be deleted. + // Must match [-_.a-zA-Z0-9]+ + FamilyName string `protobuf:"bytes,1,opt,name=family_name,json=familyName" json:"family_name,omitempty"` +} + +func (m *Mutation_DeleteFromFamily) Reset() { *m = Mutation_DeleteFromFamily{} } +func (m *Mutation_DeleteFromFamily) String() string { return proto.CompactTextString(m) } +func (*Mutation_DeleteFromFamily) ProtoMessage() {} +func (*Mutation_DeleteFromFamily) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10, 2} } + +func (m *Mutation_DeleteFromFamily) GetFamilyName() string { + if m != nil { + return m.FamilyName + } + return "" +} + +// A Mutation which deletes all cells from the containing row. +type Mutation_DeleteFromRow struct { +} + +func (m *Mutation_DeleteFromRow) Reset() { *m = Mutation_DeleteFromRow{} } +func (m *Mutation_DeleteFromRow) String() string { return proto.CompactTextString(m) } +func (*Mutation_DeleteFromRow) ProtoMessage() {} +func (*Mutation_DeleteFromRow) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10, 3} } + +// Specifies an atomic read/modify/write operation on the latest value of the +// specified column. +type ReadModifyWriteRule struct { + // The name of the family to which the read/modify/write should be applied. + // Must match [-_.a-zA-Z0-9]+ + FamilyName string `protobuf:"bytes,1,opt,name=family_name,json=familyName" json:"family_name,omitempty"` + // The qualifier of the column to which the read/modify/write should be + // applied. + // Can be any byte string, including the empty string. + ColumnQualifier []byte `protobuf:"bytes,2,opt,name=column_qualifier,json=columnQualifier,proto3" json:"column_qualifier,omitempty"` + // The rule used to determine the column's new latest value from its current + // latest value. + // + // Types that are valid to be assigned to Rule: + // *ReadModifyWriteRule_AppendValue + // *ReadModifyWriteRule_IncrementAmount + Rule isReadModifyWriteRule_Rule `protobuf_oneof:"rule"` +} + +func (m *ReadModifyWriteRule) Reset() { *m = ReadModifyWriteRule{} } +func (m *ReadModifyWriteRule) String() string { return proto.CompactTextString(m) } +func (*ReadModifyWriteRule) ProtoMessage() {} +func (*ReadModifyWriteRule) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } + +type isReadModifyWriteRule_Rule interface { + isReadModifyWriteRule_Rule() +} + +type ReadModifyWriteRule_AppendValue struct { + AppendValue []byte `protobuf:"bytes,3,opt,name=append_value,json=appendValue,proto3,oneof"` +} +type ReadModifyWriteRule_IncrementAmount struct { + IncrementAmount int64 `protobuf:"varint,4,opt,name=increment_amount,json=incrementAmount,oneof"` +} + +func (*ReadModifyWriteRule_AppendValue) isReadModifyWriteRule_Rule() {} +func (*ReadModifyWriteRule_IncrementAmount) isReadModifyWriteRule_Rule() {} + +func (m *ReadModifyWriteRule) GetRule() isReadModifyWriteRule_Rule { + if m != nil { + return m.Rule + } + return nil +} + +func (m *ReadModifyWriteRule) GetFamilyName() string { + if m != nil { + return m.FamilyName + } + return "" +} + +func (m *ReadModifyWriteRule) GetColumnQualifier() []byte { + if m != nil { + return m.ColumnQualifier + } + return nil +} + +func (m *ReadModifyWriteRule) GetAppendValue() []byte { + if x, ok := m.GetRule().(*ReadModifyWriteRule_AppendValue); ok { + return x.AppendValue + } + return nil +} + +func (m *ReadModifyWriteRule) GetIncrementAmount() int64 { + if x, ok := m.GetRule().(*ReadModifyWriteRule_IncrementAmount); ok { + return x.IncrementAmount + } + return 0 +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*ReadModifyWriteRule) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _ReadModifyWriteRule_OneofMarshaler, _ReadModifyWriteRule_OneofUnmarshaler, _ReadModifyWriteRule_OneofSizer, []interface{}{ + (*ReadModifyWriteRule_AppendValue)(nil), + (*ReadModifyWriteRule_IncrementAmount)(nil), + } +} + +func _ReadModifyWriteRule_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*ReadModifyWriteRule) + // rule + switch x := m.Rule.(type) { + case *ReadModifyWriteRule_AppendValue: + b.EncodeVarint(3<<3 | proto.WireBytes) + b.EncodeRawBytes(x.AppendValue) + case *ReadModifyWriteRule_IncrementAmount: + b.EncodeVarint(4<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.IncrementAmount)) + case nil: + default: + return fmt.Errorf("ReadModifyWriteRule.Rule has unexpected type %T", x) + } + return nil +} + +func _ReadModifyWriteRule_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*ReadModifyWriteRule) + switch tag { + case 3: // rule.append_value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.Rule = &ReadModifyWriteRule_AppendValue{x} + return true, err + case 4: // rule.increment_amount + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Rule = &ReadModifyWriteRule_IncrementAmount{int64(x)} + return true, err + default: + return false, nil + } +} + +func _ReadModifyWriteRule_OneofSizer(msg proto.Message) (n int) { + m := msg.(*ReadModifyWriteRule) + // rule + switch x := m.Rule.(type) { + case *ReadModifyWriteRule_AppendValue: + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.AppendValue))) + n += len(x.AppendValue) + case *ReadModifyWriteRule_IncrementAmount: + n += proto.SizeVarint(4<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.IncrementAmount)) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +func init() { + proto.RegisterType((*Row)(nil), "google.bigtable.v1.Row") + proto.RegisterType((*Family)(nil), "google.bigtable.v1.Family") + proto.RegisterType((*Column)(nil), "google.bigtable.v1.Column") + proto.RegisterType((*Cell)(nil), "google.bigtable.v1.Cell") + proto.RegisterType((*RowRange)(nil), "google.bigtable.v1.RowRange") + proto.RegisterType((*RowSet)(nil), "google.bigtable.v1.RowSet") + proto.RegisterType((*ColumnRange)(nil), "google.bigtable.v1.ColumnRange") + proto.RegisterType((*TimestampRange)(nil), "google.bigtable.v1.TimestampRange") + proto.RegisterType((*ValueRange)(nil), "google.bigtable.v1.ValueRange") + proto.RegisterType((*RowFilter)(nil), "google.bigtable.v1.RowFilter") + proto.RegisterType((*RowFilter_Chain)(nil), "google.bigtable.v1.RowFilter.Chain") + proto.RegisterType((*RowFilter_Interleave)(nil), "google.bigtable.v1.RowFilter.Interleave") + proto.RegisterType((*RowFilter_Condition)(nil), "google.bigtable.v1.RowFilter.Condition") + proto.RegisterType((*Mutation)(nil), "google.bigtable.v1.Mutation") + proto.RegisterType((*Mutation_SetCell)(nil), "google.bigtable.v1.Mutation.SetCell") + proto.RegisterType((*Mutation_DeleteFromColumn)(nil), "google.bigtable.v1.Mutation.DeleteFromColumn") + proto.RegisterType((*Mutation_DeleteFromFamily)(nil), "google.bigtable.v1.Mutation.DeleteFromFamily") + proto.RegisterType((*Mutation_DeleteFromRow)(nil), "google.bigtable.v1.Mutation.DeleteFromRow") + proto.RegisterType((*ReadModifyWriteRule)(nil), "google.bigtable.v1.ReadModifyWriteRule") +} + +func init() { proto.RegisterFile("google/bigtable/v1/bigtable_data.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 1378 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xdb, 0x6e, 0x1b, 0x37, + 0x13, 0xd6, 0x5a, 0xb2, 0x0e, 0xb3, 0x76, 0x24, 0xd3, 0x27, 0x45, 0x49, 0xfe, 0x18, 0xca, 0x8f, + 0x56, 0x49, 0x5b, 0x39, 0x71, 0x82, 0x36, 0x6d, 0x82, 0x22, 0x56, 0x0e, 0x55, 0x9a, 0x33, 0x63, + 0xa4, 0x40, 0x80, 0x62, 0x4b, 0x6b, 0x29, 0x75, 0x11, 0xee, 0x52, 0xe5, 0xae, 0xac, 0xe8, 0x45, + 0x7a, 0xdf, 0xe7, 0xe8, 0x5d, 0x5f, 0xa2, 0xaf, 0xd1, 0xcb, 0x5e, 0xf4, 0xa2, 0xe0, 0x61, 0x4f, + 0xb2, 0x62, 0x1b, 0x45, 0xee, 0x96, 0x9c, 0xef, 0xfb, 0x66, 0x38, 0x1c, 0x0e, 0xb9, 0xf0, 0xc9, + 0x88, 0xf3, 0x11, 0xa3, 0xbb, 0x87, 0xde, 0x28, 0x22, 0x87, 0x8c, 0xee, 0x1e, 0xdd, 0x48, 0xbe, + 0x1d, 0x97, 0x44, 0xa4, 0x3b, 0x16, 0x3c, 0xe2, 0x08, 0x69, 0x5c, 0x37, 0xb6, 0x75, 0x8f, 0x6e, + 0xb4, 0x5f, 0x40, 0x11, 0xf3, 0x29, 0x6a, 0x40, 0xf1, 0x1d, 0x9d, 0x35, 0xad, 0x1d, 0xab, 0xb3, + 0x82, 0xe5, 0x27, 0xfa, 0x12, 0xaa, 0x43, 0xe2, 0x7b, 0xcc, 0xa3, 0x61, 0x73, 0x69, 0xa7, 0xd8, + 0xb1, 0xf7, 0x5a, 0xdd, 0xe3, 0xfc, 0xee, 0x23, 0x89, 0x99, 0xe1, 0x04, 0xdb, 0xc6, 0x50, 0xd6, + 0x73, 0x08, 0x41, 0x29, 0x20, 0x3e, 0x55, 0xa2, 0x35, 0xac, 0xbe, 0xd1,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97, 0x52, 0xb6, 0xd9, 0xb6, 0x9c, 0xc0, 0x8a, 0x11, 0x38, 0x1f, 0x0b, + 0xe8, 0xcd, 0xca, 0x6a, 0xdc, 0x86, 0xed, 0x30, 0x12, 0xde, 0xd8, 0x74, 0x9b, 0x48, 0x90, 0x20, + 0x1c, 0x72, 0xe1, 0x53, 0xd1, 0x5c, 0x35, 0x87, 0x60, 0x53, 0x01, 0x54, 0x26, 0x0e, 0x52, 0xb3, + 0x64, 0x92, 0xf1, 0x98, 0xcd, 0x1c, 0x75, 0x8b, 0xe7, 0x98, 0xeb, 0x71, 0xa5, 0x2a, 0xc0, 0x53, + 0x69, 0xcf, 0x30, 0x5b, 0xf7, 0x60, 0x59, 0x35, 0x16, 0xf4, 0x15, 0x54, 0x74, 0xa4, 0xfa, 0xae, + 0xb6, 0xf7, 0x2e, 0x9d, 0xd8, 0x01, 0x70, 0x8c, 0x6e, 0x3d, 0x04, 0x48, 0x1b, 0xcb, 0x7f, 0x97, + 0xf9, 0xd3, 0x82, 0x5a, 0xd2, 0x55, 0x50, 0x1f, 0x1a, 0x63, 0x41, 0x5d, 0x6f, 0x40, 0xa2, 0xa4, + 0x34, 0x74, 0x97, 0x3c, 0x45, 0xaf, 0x9e, 0xd0, 0x92, 0xb2, 0xb0, 0x23, 0x31, 0x49, 0x44, 0x96, + 0xce, 0x22, 0x02, 0x92, 0x61, 0xf8, 0xf7, 0x60, 0x65, 0x48, 0x58, 0x98, 0x08, 0x14, 0xcf, 0x22, + 0x60, 0x2b, 0x8a, 0x1e, 0xf4, 0xaa, 0x50, 0xd6, 0xdc, 0xf6, 0x5f, 0xcb, 0x50, 0x7d, 0x36, 0x89, + 0x88, 0x5a, 0xe2, 0x3e, 0x54, 0x65, 0x79, 0xca, 0x72, 0x30, 0x4b, 0xfb, 0xff, 0x22, 0xd1, 0x18, + 0xdf, 0x7d, 0x4d, 0x23, 0xf9, 0xf4, 0xeb, 0x17, 0x70, 0x25, 0xd4, 0x9f, 0xe8,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 0x5e, 0x30, 0x10, 0xd4, 0xa7, 0x41, 0xe4, 0x10, 0x9f, 0x4f, 0x82, 0x48, 0xed, + 0x4f, 0x51, 0x5e, 0xfd, 0x89, 0x65, 0x5f, 0x19, 0x7a, 0x65, 0x28, 0x89, 0x09, 0xa3, 0x3d, 0x0f, + 0xb6, 0x06, 0xdc, 0x5f, 0x90, 0xc3, 0xde, 0x5a, 0xcf, 0x0c, 0x1e, 0x90, 0x88, 0xbc, 0x94, 0x3f, + 0xab, 0x2f, 0xad, 0xb7, 0xdf, 0x18, 0xe0, 0x88, 0x33, 0x12, 0x8c, 0xba, 0x5c, 0x8c, 0x76, 0x47, + 0x34, 0x50, 0xbf, 0xb2, 0xbb, 0xda, 0x44, 0xc6, 0x5e, 0x98, 0xfd, 0xeb, 0xbd, 0x13, 0x7f, 0x1f, + 0x96, 0x15, 0xec, 0xe6, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x3e, 0x54, 0x66, 0x7c, 0x1b, 0x0f, + 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/bigtable/v1/bigtable_service.pb.go b/vendor/google.golang.org/genproto/googleapis/bigtable/v1/bigtable_service.pb.go new file mode 100644 index 0000000000..bf22713ccf --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/bigtable/v1/bigtable_service.pb.go @@ -0,0 +1,387 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/bigtable/v1/bigtable_service.proto + +package bigtable + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf2 "github.com/golang/protobuf/ptypes/empty" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// 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 + +// Client API for BigtableService service + +type BigtableServiceClient interface { + // Streams back the contents of all requested rows, optionally applying + // the same Reader filter to each. Depending on their size, rows may be + // broken up across multiple responses, but atomicity of each row will still + // be preserved. + ReadRows(ctx context.Context, in *ReadRowsRequest, opts ...grpc.CallOption) (BigtableService_ReadRowsClient, error) + // Returns a sample of row keys in the table. The returned row keys will + // delimit contiguous sections of the table of approximately equal size, + // which can be used to break up the data for distributed tasks like + // mapreduces. + SampleRowKeys(ctx context.Context, in *SampleRowKeysRequest, opts ...grpc.CallOption) (BigtableService_SampleRowKeysClient, error) + // Mutates a row atomically. Cells already present in the row are left + // unchanged unless explicitly changed by 'mutation'. + MutateRow(ctx context.Context, in *MutateRowRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) + // Mutates multiple rows in a batch. Each individual row is mutated + // atomically as in MutateRow, but the entire batch is not executed + // atomically. + MutateRows(ctx context.Context, in *MutateRowsRequest, opts ...grpc.CallOption) (*MutateRowsResponse, error) + // Mutates a row atomically based on the output of a predicate Reader filter. + CheckAndMutateRow(ctx context.Context, in *CheckAndMutateRowRequest, opts ...grpc.CallOption) (*CheckAndMutateRowResponse, error) + // Modifies a row atomically, reading the latest existing timestamp/value from + // the specified columns and writing a new value at + // max(existing timestamp, current server time) based on pre-defined + // read/modify/write rules. Returns the new contents of all modified cells. + ReadModifyWriteRow(ctx context.Context, in *ReadModifyWriteRowRequest, opts ...grpc.CallOption) (*Row, error) +} + +type bigtableServiceClient struct { + cc *grpc.ClientConn +} + +func NewBigtableServiceClient(cc *grpc.ClientConn) BigtableServiceClient { + return &bigtableServiceClient{cc} +} + +func (c *bigtableServiceClient) ReadRows(ctx context.Context, in *ReadRowsRequest, opts ...grpc.CallOption) (BigtableService_ReadRowsClient, error) { + stream, err := grpc.NewClientStream(ctx, &_BigtableService_serviceDesc.Streams[0], c.cc, "/google.bigtable.v1.BigtableService/ReadRows", opts...) + if err != nil { + return nil, err + } + x := &bigtableServiceReadRowsClient{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 BigtableService_ReadRowsClient interface { + Recv() (*ReadRowsResponse, error) + grpc.ClientStream +} + +type bigtableServiceReadRowsClient struct { + grpc.ClientStream +} + +func (x *bigtableServiceReadRowsClient) Recv() (*ReadRowsResponse, error) { + m := new(ReadRowsResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *bigtableServiceClient) SampleRowKeys(ctx context.Context, in *SampleRowKeysRequest, opts ...grpc.CallOption) (BigtableService_SampleRowKeysClient, error) { + stream, err := grpc.NewClientStream(ctx, &_BigtableService_serviceDesc.Streams[1], c.cc, "/google.bigtable.v1.BigtableService/SampleRowKeys", opts...) + if err != nil { + return nil, err + } + x := &bigtableServiceSampleRowKeysClient{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 BigtableService_SampleRowKeysClient interface { + Recv() (*SampleRowKeysResponse, error) + grpc.ClientStream +} + +type bigtableServiceSampleRowKeysClient struct { + grpc.ClientStream +} + +func (x *bigtableServiceSampleRowKeysClient) Recv() (*SampleRowKeysResponse, error) { + m := new(SampleRowKeysResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *bigtableServiceClient) MutateRow(ctx context.Context, in *MutateRowRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) { + out := new(google_protobuf2.Empty) + err := grpc.Invoke(ctx, "/google.bigtable.v1.BigtableService/MutateRow", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bigtableServiceClient) MutateRows(ctx context.Context, in *MutateRowsRequest, opts ...grpc.CallOption) (*MutateRowsResponse, error) { + out := new(MutateRowsResponse) + err := grpc.Invoke(ctx, "/google.bigtable.v1.BigtableService/MutateRows", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bigtableServiceClient) CheckAndMutateRow(ctx context.Context, in *CheckAndMutateRowRequest, opts ...grpc.CallOption) (*CheckAndMutateRowResponse, error) { + out := new(CheckAndMutateRowResponse) + err := grpc.Invoke(ctx, "/google.bigtable.v1.BigtableService/CheckAndMutateRow", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bigtableServiceClient) ReadModifyWriteRow(ctx context.Context, in *ReadModifyWriteRowRequest, opts ...grpc.CallOption) (*Row, error) { + out := new(Row) + err := grpc.Invoke(ctx, "/google.bigtable.v1.BigtableService/ReadModifyWriteRow", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for BigtableService service + +type BigtableServiceServer interface { + // Streams back the contents of all requested rows, optionally applying + // the same Reader filter to each. Depending on their size, rows may be + // broken up across multiple responses, but atomicity of each row will still + // be preserved. + ReadRows(*ReadRowsRequest, BigtableService_ReadRowsServer) error + // Returns a sample of row keys in the table. The returned row keys will + // delimit contiguous sections of the table of approximately equal size, + // which can be used to break up the data for distributed tasks like + // mapreduces. + SampleRowKeys(*SampleRowKeysRequest, BigtableService_SampleRowKeysServer) error + // Mutates a row atomically. Cells already present in the row are left + // unchanged unless explicitly changed by 'mutation'. + MutateRow(context.Context, *MutateRowRequest) (*google_protobuf2.Empty, error) + // Mutates multiple rows in a batch. Each individual row is mutated + // atomically as in MutateRow, but the entire batch is not executed + // atomically. + MutateRows(context.Context, *MutateRowsRequest) (*MutateRowsResponse, error) + // Mutates a row atomically based on the output of a predicate Reader filter. + CheckAndMutateRow(context.Context, *CheckAndMutateRowRequest) (*CheckAndMutateRowResponse, error) + // Modifies a row atomically, reading the latest existing timestamp/value from + // the specified columns and writing a new value at + // max(existing timestamp, current server time) based on pre-defined + // read/modify/write rules. Returns the new contents of all modified cells. + ReadModifyWriteRow(context.Context, *ReadModifyWriteRowRequest) (*Row, error) +} + +func RegisterBigtableServiceServer(s *grpc.Server, srv BigtableServiceServer) { + s.RegisterService(&_BigtableService_serviceDesc, srv) +} + +func _BigtableService_ReadRows_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(ReadRowsRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(BigtableServiceServer).ReadRows(m, &bigtableServiceReadRowsServer{stream}) +} + +type BigtableService_ReadRowsServer interface { + Send(*ReadRowsResponse) error + grpc.ServerStream +} + +type bigtableServiceReadRowsServer struct { + grpc.ServerStream +} + +func (x *bigtableServiceReadRowsServer) Send(m *ReadRowsResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _BigtableService_SampleRowKeys_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(SampleRowKeysRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(BigtableServiceServer).SampleRowKeys(m, &bigtableServiceSampleRowKeysServer{stream}) +} + +type BigtableService_SampleRowKeysServer interface { + Send(*SampleRowKeysResponse) error + grpc.ServerStream +} + +type bigtableServiceSampleRowKeysServer struct { + grpc.ServerStream +} + +func (x *bigtableServiceSampleRowKeysServer) Send(m *SampleRowKeysResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _BigtableService_MutateRow_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MutateRowRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BigtableServiceServer).MutateRow(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.bigtable.v1.BigtableService/MutateRow", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BigtableServiceServer).MutateRow(ctx, req.(*MutateRowRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BigtableService_MutateRows_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MutateRowsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BigtableServiceServer).MutateRows(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.bigtable.v1.BigtableService/MutateRows", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BigtableServiceServer).MutateRows(ctx, req.(*MutateRowsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BigtableService_CheckAndMutateRow_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CheckAndMutateRowRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BigtableServiceServer).CheckAndMutateRow(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.bigtable.v1.BigtableService/CheckAndMutateRow", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BigtableServiceServer).CheckAndMutateRow(ctx, req.(*CheckAndMutateRowRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BigtableService_ReadModifyWriteRow_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ReadModifyWriteRowRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BigtableServiceServer).ReadModifyWriteRow(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.bigtable.v1.BigtableService/ReadModifyWriteRow", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BigtableServiceServer).ReadModifyWriteRow(ctx, req.(*ReadModifyWriteRowRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _BigtableService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.bigtable.v1.BigtableService", + HandlerType: (*BigtableServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "MutateRow", + Handler: _BigtableService_MutateRow_Handler, + }, + { + MethodName: "MutateRows", + Handler: _BigtableService_MutateRows_Handler, + }, + { + MethodName: "CheckAndMutateRow", + Handler: _BigtableService_CheckAndMutateRow_Handler, + }, + { + MethodName: "ReadModifyWriteRow", + Handler: _BigtableService_ReadModifyWriteRow_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "ReadRows", + Handler: _BigtableService_ReadRows_Handler, + ServerStreams: true, + }, + { + StreamName: "SampleRowKeys", + Handler: _BigtableService_SampleRowKeys_Handler, + ServerStreams: true, + }, + }, + Metadata: "google/bigtable/v1/bigtable_service.proto", +} + +func init() { proto.RegisterFile("google/bigtable/v1/bigtable_service.proto", fileDescriptor1) } + +var fileDescriptor1 = []byte{ + // 521 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0xcd, 0x6e, 0xd4, 0x30, + 0x10, 0xc7, 0x65, 0x0e, 0xa8, 0x58, 0x42, 0x08, 0x4b, 0x14, 0x69, 0xe1, 0x14, 0xa0, 0xa2, 0x11, + 0x8d, 0xdb, 0x72, 0x0b, 0xe2, 0xd0, 0x45, 0x50, 0x21, 0x58, 0x51, 0xa5, 0xe2, 0x43, 0xe5, 0xb0, + 0x78, 0x93, 0x69, 0x08, 0x4d, 0xe2, 0x60, 0x7b, 0x37, 0x5a, 0xaa, 0x5e, 0x38, 0x71, 0xe7, 0x11, + 0x10, 0x17, 0x5e, 0x80, 0x23, 0xef, 0x00, 0x67, 0x6e, 0x3c, 0x08, 0xb2, 0x63, 0x2f, 0x2c, 0x0d, + 0xcb, 0x8a, 0xee, 0x29, 0x8e, 0xe6, 0x3f, 0x33, 0xbf, 0xff, 0xf8, 0x03, 0xaf, 0xa6, 0x9c, 0xa7, + 0x39, 0xd0, 0x41, 0x96, 0x2a, 0x36, 0xc8, 0x81, 0x8e, 0x36, 0x26, 0xeb, 0xbe, 0x04, 0x31, 0xca, + 0x62, 0x08, 0x2a, 0xc1, 0x15, 0x27, 0xa4, 0x91, 0x06, 0x2e, 0x1c, 0x8c, 0x36, 0x3a, 0x97, 0x6d, + 0x3a, 0xab, 0x32, 0xca, 0xca, 0x92, 0x2b, 0xa6, 0x32, 0x5e, 0xca, 0x26, 0xa3, 0xb3, 0x32, 0xab, + 0x78, 0xc2, 0x14, 0xb3, 0xba, 0xcd, 0x39, 0x20, 0xfa, 0x05, 0x48, 0xc9, 0x52, 0x70, 0xb5, 0x2f, + 0xd9, 0x1c, 0xf3, 0x37, 0x18, 0xee, 0x53, 0x28, 0x2a, 0x35, 0x6e, 0x82, 0x9b, 0xdf, 0x97, 0xf0, + 0xb9, 0xae, 0x2d, 0xb0, 0xdb, 0xe4, 0x93, 0x8f, 0x08, 0x2f, 0x45, 0xc0, 0x92, 0x88, 0xd7, 0x92, + 0x5c, 0x09, 0x8e, 0x9b, 0x09, 0x5c, 0x34, 0x82, 0xd7, 0x43, 0x90, 0xaa, 0x73, 0x75, 0xb6, 0x48, + 0x56, 0xbc, 0x94, 0xe0, 0x3d, 0x7c, 0xfb, 0xed, 0xc7, 0xfb, 0x53, 0xf7, 0xbc, 0x2d, 0x4d, 0x7d, + 0xd8, 0x30, 0x97, 0xac, 0x80, 0xdb, 0x95, 0xe0, 0xaf, 0x20, 0x56, 0x92, 0xfa, 0xf4, 0x0d, 0x2f, + 0x41, 0x7f, 0xe3, 0x7c, 0x28, 0x15, 0x08, 0xbd, 0x34, 0x42, 0x49, 0xfd, 0x23, 0x2a, 0x78, 0x2d, + 0x43, 0x01, 0x2c, 0x09, 0x91, 0xbf, 0x8e, 0xc8, 0x67, 0x84, 0xcf, 0xee, 0xb2, 0xa2, 0xca, 0x21, + 0xe2, 0xf5, 0x03, 0x18, 0x4b, 0x72, 0xbd, 0x8d, 0x63, 0x4a, 0xe2, 0x88, 0x57, 0xe7, 0x50, 0x5a, + 0xec, 0x47, 0x06, 0xfb, 0x3e, 0xd9, 0x3e, 0x11, 0xb6, 0x34, 0xb5, 0x75, 0xe1, 0x75, 0x44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xa5, 0x29, 0x94, 0xe6, 0xd4, 0xd3, 0x26, 0xc4, 0xaa, 0x4c, 0xfe, 0xfe, + 0x04, 0xde, 0x72, 0xeb, 0x77, 0x08, 0x0d, 0x4e, 0x1b, 0xe5, 0xcd, 0x9f, 0x01, 0x00, 0x00, 0xff, + 0xff, 0x4c, 0x27, 0x6e, 0x9a, 0xb0, 0x05, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/bigtable/v1/bigtable_service_messages.pb.go b/vendor/google.golang.org/genproto/googleapis/bigtable/v1/bigtable_service_messages.pb.go new file mode 100644 index 0000000000..763b83c272 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/bigtable/v1/bigtable_service_messages.pb.go @@ -0,0 +1,759 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/bigtable/v1/bigtable_service_messages.proto + +package bigtable + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import google_rpc "google.golang.org/genproto/googleapis/rpc/status" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Request message for BigtableServer.ReadRows. +type ReadRowsRequest struct { + // The unique name of the table from which to read. + TableName string `protobuf:"bytes,1,opt,name=table_name,json=tableName" json:"table_name,omitempty"` + // If neither row_key nor row_range is set, reads from all rows. + // + // Types that are valid to be assigned to Target: + // *ReadRowsRequest_RowKey + // *ReadRowsRequest_RowRange + // *ReadRowsRequest_RowSet + Target isReadRowsRequest_Target `protobuf_oneof:"target"` + // The filter to apply to the contents of the specified row(s). If unset, + // reads the entire table. + Filter *RowFilter `protobuf:"bytes,5,opt,name=filter" json:"filter,omitempty"` + // By default, rows are read sequentially, producing results which are + // guaranteed to arrive in increasing row order. Setting + // "allow_row_interleaving" to true allows multiple rows to be interleaved in + // the response stream, which increases throughput but breaks this guarantee, + // and may force the client to use more memory to buffer partially-received + // rows. Cannot be set to true when specifying "num_rows_limit". + AllowRowInterleaving bool `protobuf:"varint,6,opt,name=allow_row_interleaving,json=allowRowInterleaving" json:"allow_row_interleaving,omitempty"` + // The read will terminate after committing to N rows' worth of results. The + // default (zero) is to return all results. + // Note that "allow_row_interleaving" cannot be set to true when this is set. + NumRowsLimit int64 `protobuf:"varint,7,opt,name=num_rows_limit,json=numRowsLimit" json:"num_rows_limit,omitempty"` +} + +func (m *ReadRowsRequest) Reset() { *m = ReadRowsRequest{} } +func (m *ReadRowsRequest) String() string { return proto.CompactTextString(m) } +func (*ReadRowsRequest) ProtoMessage() {} +func (*ReadRowsRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} } + +type isReadRowsRequest_Target interface { + isReadRowsRequest_Target() +} + +type ReadRowsRequest_RowKey struct { + RowKey []byte `protobuf:"bytes,2,opt,name=row_key,json=rowKey,proto3,oneof"` +} +type ReadRowsRequest_RowRange struct { + RowRange *RowRange `protobuf:"bytes,3,opt,name=row_range,json=rowRange,oneof"` +} +type ReadRowsRequest_RowSet struct { + RowSet *RowSet `protobuf:"bytes,8,opt,name=row_set,json=rowSet,oneof"` +} + +func (*ReadRowsRequest_RowKey) isReadRowsRequest_Target() {} +func (*ReadRowsRequest_RowRange) isReadRowsRequest_Target() {} +func (*ReadRowsRequest_RowSet) isReadRowsRequest_Target() {} + +func (m *ReadRowsRequest) GetTarget() isReadRowsRequest_Target { + if m != nil { + return m.Target + } + return nil +} + +func (m *ReadRowsRequest) GetTableName() string { + if m != nil { + return m.TableName + } + return "" +} + +func (m *ReadRowsRequest) GetRowKey() []byte { + if x, ok := m.GetTarget().(*ReadRowsRequest_RowKey); ok { + return x.RowKey + } + return nil +} + +func (m *ReadRowsRequest) GetRowRange() *RowRange { + if x, ok := m.GetTarget().(*ReadRowsRequest_RowRange); ok { + return x.RowRange + } + return nil +} + +func (m *ReadRowsRequest) GetRowSet() *RowSet { + if x, ok := m.GetTarget().(*ReadRowsRequest_RowSet); ok { + return x.RowSet + } + return nil +} + +func (m *ReadRowsRequest) GetFilter() *RowFilter { + if m != nil { + return m.Filter + } + return nil +} + +func (m *ReadRowsRequest) GetAllowRowInterleaving() bool { + if m != nil { + return m.AllowRowInterleaving + } + return false +} + +func (m *ReadRowsRequest) GetNumRowsLimit() int64 { + if m != nil { + return m.NumRowsLimit + } + return 0 +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*ReadRowsRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _ReadRowsRequest_OneofMarshaler, _ReadRowsRequest_OneofUnmarshaler, _ReadRowsRequest_OneofSizer, []interface{}{ + (*ReadRowsRequest_RowKey)(nil), + (*ReadRowsRequest_RowRange)(nil), + (*ReadRowsRequest_RowSet)(nil), + } +} + +func _ReadRowsRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*ReadRowsRequest) + // target + switch x := m.Target.(type) { + case *ReadRowsRequest_RowKey: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeRawBytes(x.RowKey) + case *ReadRowsRequest_RowRange: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.RowRange); err != nil { + return err + } + case *ReadRowsRequest_RowSet: + b.EncodeVarint(8<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.RowSet); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("ReadRowsRequest.Target has unexpected type %T", x) + } + return nil +} + +func _ReadRowsRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*ReadRowsRequest) + switch tag { + case 2: // target.row_key + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.Target = &ReadRowsRequest_RowKey{x} + return true, err + case 3: // target.row_range + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(RowRange) + err := b.DecodeMessage(msg) + m.Target = &ReadRowsRequest_RowRange{msg} + return true, err + case 8: // target.row_set + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(RowSet) + err := b.DecodeMessage(msg) + m.Target = &ReadRowsRequest_RowSet{msg} + return true, err + default: + return false, nil + } +} + +func _ReadRowsRequest_OneofSizer(msg proto.Message) (n int) { + m := msg.(*ReadRowsRequest) + // target + switch x := m.Target.(type) { + case *ReadRowsRequest_RowKey: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.RowKey))) + n += len(x.RowKey) + case *ReadRowsRequest_RowRange: + s := proto.Size(x.RowRange) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *ReadRowsRequest_RowSet: + s := proto.Size(x.RowSet) + n += proto.SizeVarint(8<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Response message for BigtableService.ReadRows. +type ReadRowsResponse struct { + // The key of the row for which we're receiving data. + // Results will be received in increasing row key order, unless + // "allow_row_interleaving" was specified in the request. + RowKey []byte `protobuf:"bytes,1,opt,name=row_key,json=rowKey,proto3" json:"row_key,omitempty"` + // One or more chunks of the row specified by "row_key". + Chunks []*ReadRowsResponse_Chunk `protobuf:"bytes,2,rep,name=chunks" json:"chunks,omitempty"` +} + +func (m *ReadRowsResponse) Reset() { *m = ReadRowsResponse{} } +func (m *ReadRowsResponse) String() string { return proto.CompactTextString(m) } +func (*ReadRowsResponse) ProtoMessage() {} +func (*ReadRowsResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{1} } + +func (m *ReadRowsResponse) GetRowKey() []byte { + if m != nil { + return m.RowKey + } + return nil +} + +func (m *ReadRowsResponse) GetChunks() []*ReadRowsResponse_Chunk { + if m != nil { + return m.Chunks + } + return nil +} + +// Specifies a piece of a row's contents returned as part of the read +// response stream. +type ReadRowsResponse_Chunk struct { + // Types that are valid to be assigned to Chunk: + // *ReadRowsResponse_Chunk_RowContents + // *ReadRowsResponse_Chunk_ResetRow + // *ReadRowsResponse_Chunk_CommitRow + Chunk isReadRowsResponse_Chunk_Chunk `protobuf_oneof:"chunk"` +} + +func (m *ReadRowsResponse_Chunk) Reset() { *m = ReadRowsResponse_Chunk{} } +func (m *ReadRowsResponse_Chunk) String() string { return proto.CompactTextString(m) } +func (*ReadRowsResponse_Chunk) ProtoMessage() {} +func (*ReadRowsResponse_Chunk) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{1, 0} } + +type isReadRowsResponse_Chunk_Chunk interface { + isReadRowsResponse_Chunk_Chunk() +} + +type ReadRowsResponse_Chunk_RowContents struct { + RowContents *Family `protobuf:"bytes,1,opt,name=row_contents,json=rowContents,oneof"` +} +type ReadRowsResponse_Chunk_ResetRow struct { + ResetRow bool `protobuf:"varint,2,opt,name=reset_row,json=resetRow,oneof"` +} +type ReadRowsResponse_Chunk_CommitRow struct { + CommitRow bool `protobuf:"varint,3,opt,name=commit_row,json=commitRow,oneof"` +} + +func (*ReadRowsResponse_Chunk_RowContents) isReadRowsResponse_Chunk_Chunk() {} +func (*ReadRowsResponse_Chunk_ResetRow) isReadRowsResponse_Chunk_Chunk() {} +func (*ReadRowsResponse_Chunk_CommitRow) isReadRowsResponse_Chunk_Chunk() {} + +func (m *ReadRowsResponse_Chunk) GetChunk() isReadRowsResponse_Chunk_Chunk { + if m != nil { + return m.Chunk + } + return nil +} + +func (m *ReadRowsResponse_Chunk) GetRowContents() *Family { + if x, ok := m.GetChunk().(*ReadRowsResponse_Chunk_RowContents); ok { + return x.RowContents + } + return nil +} + +func (m *ReadRowsResponse_Chunk) GetResetRow() bool { + if x, ok := m.GetChunk().(*ReadRowsResponse_Chunk_ResetRow); ok { + return x.ResetRow + } + return false +} + +func (m *ReadRowsResponse_Chunk) GetCommitRow() bool { + if x, ok := m.GetChunk().(*ReadRowsResponse_Chunk_CommitRow); ok { + return x.CommitRow + } + return false +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*ReadRowsResponse_Chunk) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _ReadRowsResponse_Chunk_OneofMarshaler, _ReadRowsResponse_Chunk_OneofUnmarshaler, _ReadRowsResponse_Chunk_OneofSizer, []interface{}{ + (*ReadRowsResponse_Chunk_RowContents)(nil), + (*ReadRowsResponse_Chunk_ResetRow)(nil), + (*ReadRowsResponse_Chunk_CommitRow)(nil), + } +} + +func _ReadRowsResponse_Chunk_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*ReadRowsResponse_Chunk) + // chunk + switch x := m.Chunk.(type) { + case *ReadRowsResponse_Chunk_RowContents: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.RowContents); err != nil { + return err + } + case *ReadRowsResponse_Chunk_ResetRow: + t := uint64(0) + if x.ResetRow { + t = 1 + } + b.EncodeVarint(2<<3 | proto.WireVarint) + b.EncodeVarint(t) + case *ReadRowsResponse_Chunk_CommitRow: + t := uint64(0) + if x.CommitRow { + t = 1 + } + b.EncodeVarint(3<<3 | proto.WireVarint) + b.EncodeVarint(t) + case nil: + default: + return fmt.Errorf("ReadRowsResponse_Chunk.Chunk has unexpected type %T", x) + } + return nil +} + +func _ReadRowsResponse_Chunk_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*ReadRowsResponse_Chunk) + switch tag { + case 1: // chunk.row_contents + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Family) + err := b.DecodeMessage(msg) + m.Chunk = &ReadRowsResponse_Chunk_RowContents{msg} + return true, err + case 2: // chunk.reset_row + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Chunk = &ReadRowsResponse_Chunk_ResetRow{x != 0} + return true, err + case 3: // chunk.commit_row + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Chunk = &ReadRowsResponse_Chunk_CommitRow{x != 0} + return true, err + default: + return false, nil + } +} + +func _ReadRowsResponse_Chunk_OneofSizer(msg proto.Message) (n int) { + m := msg.(*ReadRowsResponse_Chunk) + // chunk + switch x := m.Chunk.(type) { + case *ReadRowsResponse_Chunk_RowContents: + s := proto.Size(x.RowContents) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *ReadRowsResponse_Chunk_ResetRow: + n += proto.SizeVarint(2<<3 | proto.WireVarint) + n += 1 + case *ReadRowsResponse_Chunk_CommitRow: + n += proto.SizeVarint(3<<3 | proto.WireVarint) + n += 1 + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Request message for BigtableService.SampleRowKeys. +type SampleRowKeysRequest struct { + // The unique name of the table from which to sample row keys. + TableName string `protobuf:"bytes,1,opt,name=table_name,json=tableName" json:"table_name,omitempty"` +} + +func (m *SampleRowKeysRequest) Reset() { *m = SampleRowKeysRequest{} } +func (m *SampleRowKeysRequest) String() string { return proto.CompactTextString(m) } +func (*SampleRowKeysRequest) ProtoMessage() {} +func (*SampleRowKeysRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{2} } + +func (m *SampleRowKeysRequest) GetTableName() string { + if m != nil { + return m.TableName + } + return "" +} + +// Response message for BigtableService.SampleRowKeys. +type SampleRowKeysResponse struct { + // Sorted streamed sequence of sample row keys in the table. The table might + // have contents before the first row key in the list and after the last one, + // but a key containing the empty string indicates "end of table" and will be + // the last response given, if present. + // Note that row keys in this list may not have ever been written to or read + // from, and users should therefore not make any assumptions about the row key + // structure that are specific to their use case. + RowKey []byte `protobuf:"bytes,1,opt,name=row_key,json=rowKey,proto3" json:"row_key,omitempty"` + // Approximate total storage space used by all rows in the table which precede + // "row_key". Buffering the contents of all rows between two subsequent + // samples would require space roughly equal to the difference in their + // "offset_bytes" fields. + OffsetBytes int64 `protobuf:"varint,2,opt,name=offset_bytes,json=offsetBytes" json:"offset_bytes,omitempty"` +} + +func (m *SampleRowKeysResponse) Reset() { *m = SampleRowKeysResponse{} } +func (m *SampleRowKeysResponse) String() string { return proto.CompactTextString(m) } +func (*SampleRowKeysResponse) ProtoMessage() {} +func (*SampleRowKeysResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{3} } + +func (m *SampleRowKeysResponse) GetRowKey() []byte { + if m != nil { + return m.RowKey + } + return nil +} + +func (m *SampleRowKeysResponse) GetOffsetBytes() int64 { + if m != nil { + return m.OffsetBytes + } + return 0 +} + +// Request message for BigtableService.MutateRow. +type MutateRowRequest struct { + // The unique name of the table to which the mutation should be applied. + TableName string `protobuf:"bytes,1,opt,name=table_name,json=tableName" json:"table_name,omitempty"` + // The key of the row to which the mutation should be applied. + RowKey []byte `protobuf:"bytes,2,opt,name=row_key,json=rowKey,proto3" json:"row_key,omitempty"` + // Changes to be atomically applied to the specified row. Entries are applied + // in order, meaning that earlier mutations can be masked by later ones. + // Must contain at least one entry and at most 100000. + Mutations []*Mutation `protobuf:"bytes,3,rep,name=mutations" json:"mutations,omitempty"` +} + +func (m *MutateRowRequest) Reset() { *m = MutateRowRequest{} } +func (m *MutateRowRequest) String() string { return proto.CompactTextString(m) } +func (*MutateRowRequest) ProtoMessage() {} +func (*MutateRowRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{4} } + +func (m *MutateRowRequest) GetTableName() string { + if m != nil { + return m.TableName + } + return "" +} + +func (m *MutateRowRequest) GetRowKey() []byte { + if m != nil { + return m.RowKey + } + return nil +} + +func (m *MutateRowRequest) GetMutations() []*Mutation { + if m != nil { + return m.Mutations + } + return nil +} + +// Request message for BigtableService.MutateRows. +type MutateRowsRequest struct { + // The unique name of the table to which the mutations should be applied. + TableName string `protobuf:"bytes,1,opt,name=table_name,json=tableName" json:"table_name,omitempty"` + // The row keys/mutations to be applied in bulk. + // Each entry is applied as an atomic mutation, but the entries may be + // applied in arbitrary order (even between entries for the same row). + // At least one entry must be specified, and in total the entries may + // contain at most 100000 mutations. + Entries []*MutateRowsRequest_Entry `protobuf:"bytes,2,rep,name=entries" json:"entries,omitempty"` +} + +func (m *MutateRowsRequest) Reset() { *m = MutateRowsRequest{} } +func (m *MutateRowsRequest) String() string { return proto.CompactTextString(m) } +func (*MutateRowsRequest) ProtoMessage() {} +func (*MutateRowsRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{5} } + +func (m *MutateRowsRequest) GetTableName() string { + if m != nil { + return m.TableName + } + return "" +} + +func (m *MutateRowsRequest) GetEntries() []*MutateRowsRequest_Entry { + if m != nil { + return m.Entries + } + return nil +} + +type MutateRowsRequest_Entry struct { + // The key of the row to which the `mutations` should be applied. + RowKey []byte `protobuf:"bytes,1,opt,name=row_key,json=rowKey,proto3" json:"row_key,omitempty"` + // Changes to be atomically applied to the specified row. Mutations are + // applied in order, meaning that earlier mutations can be masked by + // later ones. + // At least one mutation must be specified. + Mutations []*Mutation `protobuf:"bytes,2,rep,name=mutations" json:"mutations,omitempty"` +} + +func (m *MutateRowsRequest_Entry) Reset() { *m = MutateRowsRequest_Entry{} } +func (m *MutateRowsRequest_Entry) String() string { return proto.CompactTextString(m) } +func (*MutateRowsRequest_Entry) ProtoMessage() {} +func (*MutateRowsRequest_Entry) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{5, 0} } + +func (m *MutateRowsRequest_Entry) GetRowKey() []byte { + if m != nil { + return m.RowKey + } + return nil +} + +func (m *MutateRowsRequest_Entry) GetMutations() []*Mutation { + if m != nil { + return m.Mutations + } + return nil +} + +// Response message for BigtableService.MutateRows. +type MutateRowsResponse struct { + // The results for each Entry from the request, presented in the order + // in which the entries were originally given. + // Depending on how requests are batched during execution, it is possible + // for one Entry to fail due to an error with another Entry. In the event + // that this occurs, the same error will be reported for both entries. + Statuses []*google_rpc.Status `protobuf:"bytes,1,rep,name=statuses" json:"statuses,omitempty"` +} + +func (m *MutateRowsResponse) Reset() { *m = MutateRowsResponse{} } +func (m *MutateRowsResponse) String() string { return proto.CompactTextString(m) } +func (*MutateRowsResponse) ProtoMessage() {} +func (*MutateRowsResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{6} } + +func (m *MutateRowsResponse) GetStatuses() []*google_rpc.Status { + if m != nil { + return m.Statuses + } + return nil +} + +// Request message for BigtableService.CheckAndMutateRowRequest +type CheckAndMutateRowRequest struct { + // The unique name of the table to which the conditional mutation should be + // applied. + TableName string `protobuf:"bytes,1,opt,name=table_name,json=tableName" json:"table_name,omitempty"` + // The key of the row to which the conditional mutation should be applied. + RowKey []byte `protobuf:"bytes,2,opt,name=row_key,json=rowKey,proto3" json:"row_key,omitempty"` + // The filter to be applied to the contents of the specified row. Depending + // on whether or not any results are yielded, either "true_mutations" or + // "false_mutations" will be executed. If unset, checks that the row contains + // any values at all. + PredicateFilter *RowFilter `protobuf:"bytes,6,opt,name=predicate_filter,json=predicateFilter" json:"predicate_filter,omitempty"` + // Changes to be atomically applied to the specified row if "predicate_filter" + // yields at least one cell when applied to "row_key". Entries are applied in + // order, meaning that earlier mutations can be masked by later ones. + // Must contain at least one entry if "false_mutations" is empty, and at most + // 100000. + TrueMutations []*Mutation `protobuf:"bytes,4,rep,name=true_mutations,json=trueMutations" json:"true_mutations,omitempty"` + // Changes to be atomically applied to the specified row if "predicate_filter" + // does not yield any cells when applied to "row_key". Entries are applied in + // order, meaning that earlier mutations can be masked by later ones. + // Must contain at least one entry if "true_mutations" is empty, and at most + // 100000. + FalseMutations []*Mutation `protobuf:"bytes,5,rep,name=false_mutations,json=falseMutations" json:"false_mutations,omitempty"` +} + +func (m *CheckAndMutateRowRequest) Reset() { *m = CheckAndMutateRowRequest{} } +func (m *CheckAndMutateRowRequest) String() string { return proto.CompactTextString(m) } +func (*CheckAndMutateRowRequest) ProtoMessage() {} +func (*CheckAndMutateRowRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{7} } + +func (m *CheckAndMutateRowRequest) GetTableName() string { + if m != nil { + return m.TableName + } + return "" +} + +func (m *CheckAndMutateRowRequest) GetRowKey() []byte { + if m != nil { + return m.RowKey + } + return nil +} + +func (m *CheckAndMutateRowRequest) GetPredicateFilter() *RowFilter { + if m != nil { + return m.PredicateFilter + } + return nil +} + +func (m *CheckAndMutateRowRequest) GetTrueMutations() []*Mutation { + if m != nil { + return m.TrueMutations + } + return nil +} + +func (m *CheckAndMutateRowRequest) GetFalseMutations() []*Mutation { + if m != nil { + return m.FalseMutations + } + return nil +} + +// Response message for BigtableService.CheckAndMutateRowRequest. +type CheckAndMutateRowResponse struct { + // Whether or not the request's "predicate_filter" yielded any results for + // the specified row. + PredicateMatched bool `protobuf:"varint,1,opt,name=predicate_matched,json=predicateMatched" json:"predicate_matched,omitempty"` +} + +func (m *CheckAndMutateRowResponse) Reset() { *m = CheckAndMutateRowResponse{} } +func (m *CheckAndMutateRowResponse) String() string { return proto.CompactTextString(m) } +func (*CheckAndMutateRowResponse) ProtoMessage() {} +func (*CheckAndMutateRowResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{8} } + +func (m *CheckAndMutateRowResponse) GetPredicateMatched() bool { + if m != nil { + return m.PredicateMatched + } + return false +} + +// Request message for BigtableService.ReadModifyWriteRowRequest. +type ReadModifyWriteRowRequest struct { + // The unique name of the table to which the read/modify/write rules should be + // applied. + TableName string `protobuf:"bytes,1,opt,name=table_name,json=tableName" json:"table_name,omitempty"` + // The key of the row to which the read/modify/write rules should be applied. + RowKey []byte `protobuf:"bytes,2,opt,name=row_key,json=rowKey,proto3" json:"row_key,omitempty"` + // Rules specifying how the specified row's contents are to be transformed + // into writes. Entries are applied in order, meaning that earlier rules will + // affect the results of later ones. + Rules []*ReadModifyWriteRule `protobuf:"bytes,3,rep,name=rules" json:"rules,omitempty"` +} + +func (m *ReadModifyWriteRowRequest) Reset() { *m = ReadModifyWriteRowRequest{} } +func (m *ReadModifyWriteRowRequest) String() string { return proto.CompactTextString(m) } +func (*ReadModifyWriteRowRequest) ProtoMessage() {} +func (*ReadModifyWriteRowRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{9} } + +func (m *ReadModifyWriteRowRequest) GetTableName() string { + if m != nil { + return m.TableName + } + return "" +} + +func (m *ReadModifyWriteRowRequest) GetRowKey() []byte { + if m != nil { + return m.RowKey + } + return nil +} + +func (m *ReadModifyWriteRowRequest) GetRules() []*ReadModifyWriteRule { + if m != nil { + return m.Rules + } + return nil +} + +func init() { + proto.RegisterType((*ReadRowsRequest)(nil), "google.bigtable.v1.ReadRowsRequest") + proto.RegisterType((*ReadRowsResponse)(nil), "google.bigtable.v1.ReadRowsResponse") + proto.RegisterType((*ReadRowsResponse_Chunk)(nil), "google.bigtable.v1.ReadRowsResponse.Chunk") + proto.RegisterType((*SampleRowKeysRequest)(nil), "google.bigtable.v1.SampleRowKeysRequest") + proto.RegisterType((*SampleRowKeysResponse)(nil), "google.bigtable.v1.SampleRowKeysResponse") + proto.RegisterType((*MutateRowRequest)(nil), "google.bigtable.v1.MutateRowRequest") + proto.RegisterType((*MutateRowsRequest)(nil), "google.bigtable.v1.MutateRowsRequest") + proto.RegisterType((*MutateRowsRequest_Entry)(nil), "google.bigtable.v1.MutateRowsRequest.Entry") + proto.RegisterType((*MutateRowsResponse)(nil), "google.bigtable.v1.MutateRowsResponse") + proto.RegisterType((*CheckAndMutateRowRequest)(nil), "google.bigtable.v1.CheckAndMutateRowRequest") + proto.RegisterType((*CheckAndMutateRowResponse)(nil), "google.bigtable.v1.CheckAndMutateRowResponse") + proto.RegisterType((*ReadModifyWriteRowRequest)(nil), "google.bigtable.v1.ReadModifyWriteRowRequest") +} + +func init() { proto.RegisterFile("google/bigtable/v1/bigtable_service_messages.proto", fileDescriptor2) } + +var fileDescriptor2 = []byte{ + // 788 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x5f, 0x8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, 0x7c, 0x6b, 0x76, 0xdb, 0x5b, 0xe7, 0x87, 0x57, 0x05, 0x26, 0x14, 0x31, 0xe3, 0xa1, 0x2f, + 0x64, 0xd8, 0x0b, 0x91, 0xdb, 0xcd, 0xd7, 0xcb, 0x5d, 0x6c, 0x11, 0xa9, 0xdd, 0xed, 0xf9, 0x7a, + 0x7d, 0x9e, 0x56, 0x6d, 0xd8, 0xa7, 0x7f, 0x05, 0x00, 0x00, 0xff, 0xff, 0x16, 0x55, 0x90, 0x95, + 0xab, 0x07, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/bigtable/v2/bigtable.pb.go b/vendor/google.golang.org/genproto/googleapis/bigtable/v2/bigtable.pb.go new file mode 100644 index 0000000000..5f1a572577 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/bigtable/v2/bigtable.pb.go @@ -0,0 +1,1168 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/bigtable/v2/bigtable.proto + +/* +Package bigtable is a generated protocol buffer package. + +It is generated from these files: + google/bigtable/v2/bigtable.proto + google/bigtable/v2/data.proto + +It has these top-level messages: + ReadRowsRequest + ReadRowsResponse + SampleRowKeysRequest + SampleRowKeysResponse + MutateRowRequest + MutateRowResponse + MutateRowsRequest + MutateRowsResponse + CheckAndMutateRowRequest + CheckAndMutateRowResponse + ReadModifyWriteRowRequest + ReadModifyWriteRowResponse + Row + Family + Column + Cell + RowRange + RowSet + ColumnRange + TimestampRange + ValueRange + RowFilter + Mutation + ReadModifyWriteRule +*/ +package bigtable + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf1 "github.com/golang/protobuf/ptypes/wrappers" +import google_rpc "google.golang.org/genproto/googleapis/rpc/status" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Request message for Bigtable.ReadRows. +type ReadRowsRequest struct { + // The unique name of the table from which to read. + // Values are of the form + // `projects//instances//tables/
`. + TableName string `protobuf:"bytes,1,opt,name=table_name,json=tableName" json:"table_name,omitempty"` + // The row keys and/or ranges to read. If not specified, reads from all rows. + Rows *RowSet `protobuf:"bytes,2,opt,name=rows" json:"rows,omitempty"` + // The filter to apply to the contents of the specified row(s). If unset, + // reads the entirety of each row. + Filter *RowFilter `protobuf:"bytes,3,opt,name=filter" json:"filter,omitempty"` + // The read will terminate after committing to N rows' worth of results. The + // default (zero) is to return all results. + RowsLimit int64 `protobuf:"varint,4,opt,name=rows_limit,json=rowsLimit" json:"rows_limit,omitempty"` +} + +func (m *ReadRowsRequest) Reset() { *m = ReadRowsRequest{} } +func (m *ReadRowsRequest) String() string { return proto.CompactTextString(m) } +func (*ReadRowsRequest) ProtoMessage() {} +func (*ReadRowsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *ReadRowsRequest) GetTableName() string { + if m != nil { + return m.TableName + } + return "" +} + +func (m *ReadRowsRequest) GetRows() *RowSet { + if m != nil { + return m.Rows + } + return nil +} + +func (m *ReadRowsRequest) GetFilter() *RowFilter { + if m != nil { + return m.Filter + } + return nil +} + +func (m *ReadRowsRequest) GetRowsLimit() int64 { + if m != nil { + return m.RowsLimit + } + return 0 +} + +// Response message for Bigtable.ReadRows. +type ReadRowsResponse struct { + Chunks []*ReadRowsResponse_CellChunk `protobuf:"bytes,1,rep,name=chunks" json:"chunks,omitempty"` + // Optionally the server might return the row key of the last row it + // has scanned. The client can use this to construct a more + // efficient retry request if needed: any row keys or portions of + // ranges less than this row key can be dropped from the request. + // This is primarily useful for cases where the server has read a + // lot of data that was filtered out since the last committed row + // key, allowing the client to skip that work on a retry. + LastScannedRowKey []byte `protobuf:"bytes,2,opt,name=last_scanned_row_key,json=lastScannedRowKey,proto3" json:"last_scanned_row_key,omitempty"` +} + +func (m *ReadRowsResponse) Reset() { *m = ReadRowsResponse{} } +func (m *ReadRowsResponse) String() string { return proto.CompactTextString(m) } +func (*ReadRowsResponse) ProtoMessage() {} +func (*ReadRowsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *ReadRowsResponse) GetChunks() []*ReadRowsResponse_CellChunk { + if m != nil { + return m.Chunks + } + return nil +} + +func (m *ReadRowsResponse) GetLastScannedRowKey() []byte { + if m != nil { + return m.LastScannedRowKey + } + return nil +} + +// Specifies a piece of a row's contents returned as part of the read +// response stream. +type ReadRowsResponse_CellChunk struct { + // The row key for this chunk of data. If the row key is empty, + // this CellChunk is a continuation of the same row as the previous + // CellChunk in the response stream, even if that CellChunk was in a + // previous ReadRowsResponse message. + RowKey []byte `protobuf:"bytes,1,opt,name=row_key,json=rowKey,proto3" json:"row_key,omitempty"` + // The column family name for this chunk of data. If this message + // is not present this CellChunk is a continuation of the same column + // family as the previous CellChunk. The empty string can occur as a + // column family name in a response so clients must check + // explicitly for the presence of this message, not just for + // `family_name.value` being non-empty. + FamilyName *google_protobuf1.StringValue `protobuf:"bytes,2,opt,name=family_name,json=familyName" json:"family_name,omitempty"` + // The column qualifier for this chunk of data. If this message + // is not present, this CellChunk is a continuation of the same column + // as the previous CellChunk. Column qualifiers may be empty so + // clients must check for the presence of this message, not just + // for `qualifier.value` being non-empty. + Qualifier *google_protobuf1.BytesValue `protobuf:"bytes,3,opt,name=qualifier" json:"qualifier,omitempty"` + // The cell's stored timestamp, which also uniquely identifies it + // within its column. Values are always expressed in + // microseconds, but individual tables may set a coarser + // granularity to further restrict the allowed values. For + // example, a table which specifies millisecond granularity will + // only allow values of `timestamp_micros` which are multiples of + // 1000. Timestamps are only set in the first CellChunk per cell + // (for cells split into multiple chunks). + TimestampMicros int64 `protobuf:"varint,4,opt,name=timestamp_micros,json=timestampMicros" json:"timestamp_micros,omitempty"` + // Labels applied to the cell by a + // [RowFilter][google.bigtable.v2.RowFilter]. Labels are only set + // on the first CellChunk per cell. + Labels []string `protobuf:"bytes,5,rep,name=labels" json:"labels,omitempty"` + // The value stored in the cell. Cell values can be split across + // multiple CellChunks. In that case only the value field will be + // set in CellChunks after the first: the timestamp and labels + // will only be present in the first CellChunk, even if the first + // CellChunk came in a previous ReadRowsResponse. + Value []byte `protobuf:"bytes,6,opt,name=value,proto3" json:"value,omitempty"` + // If this CellChunk is part of a chunked cell value and this is + // not the final chunk of that cell, value_size will be set to the + // total length of the cell value. The client can use this size + // to pre-allocate memory to hold the full cell value. + ValueSize int32 `protobuf:"varint,7,opt,name=value_size,json=valueSize" json:"value_size,omitempty"` + // Types that are valid to be assigned to RowStatus: + // *ReadRowsResponse_CellChunk_ResetRow + // *ReadRowsResponse_CellChunk_CommitRow + RowStatus isReadRowsResponse_CellChunk_RowStatus `protobuf_oneof:"row_status"` +} + +func (m *ReadRowsResponse_CellChunk) Reset() { *m = ReadRowsResponse_CellChunk{} } +func (m *ReadRowsResponse_CellChunk) String() string { return proto.CompactTextString(m) } +func (*ReadRowsResponse_CellChunk) ProtoMessage() {} +func (*ReadRowsResponse_CellChunk) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1, 0} } + +type isReadRowsResponse_CellChunk_RowStatus interface { + isReadRowsResponse_CellChunk_RowStatus() +} + +type ReadRowsResponse_CellChunk_ResetRow struct { + ResetRow bool `protobuf:"varint,8,opt,name=reset_row,json=resetRow,oneof"` +} +type ReadRowsResponse_CellChunk_CommitRow struct { + CommitRow bool `protobuf:"varint,9,opt,name=commit_row,json=commitRow,oneof"` +} + +func (*ReadRowsResponse_CellChunk_ResetRow) isReadRowsResponse_CellChunk_RowStatus() {} +func (*ReadRowsResponse_CellChunk_CommitRow) isReadRowsResponse_CellChunk_RowStatus() {} + +func (m *ReadRowsResponse_CellChunk) GetRowStatus() isReadRowsResponse_CellChunk_RowStatus { + if m != nil { + return m.RowStatus + } + return nil +} + +func (m *ReadRowsResponse_CellChunk) GetRowKey() []byte { + if m != nil { + return m.RowKey + } + return nil +} + +func (m *ReadRowsResponse_CellChunk) GetFamilyName() *google_protobuf1.StringValue { + if m != nil { + return m.FamilyName + } + return nil +} + +func (m *ReadRowsResponse_CellChunk) GetQualifier() *google_protobuf1.BytesValue { + if m != nil { + return m.Qualifier + } + return nil +} + +func (m *ReadRowsResponse_CellChunk) GetTimestampMicros() int64 { + if m != nil { + return m.TimestampMicros + } + return 0 +} + +func (m *ReadRowsResponse_CellChunk) GetLabels() []string { + if m != nil { + return m.Labels + } + return nil +} + +func (m *ReadRowsResponse_CellChunk) GetValue() []byte { + if m != nil { + return m.Value + } + return nil +} + +func (m *ReadRowsResponse_CellChunk) GetValueSize() int32 { + if m != nil { + return m.ValueSize + } + return 0 +} + +func (m *ReadRowsResponse_CellChunk) GetResetRow() bool { + if x, ok := m.GetRowStatus().(*ReadRowsResponse_CellChunk_ResetRow); ok { + return x.ResetRow + } + return false +} + +func (m *ReadRowsResponse_CellChunk) GetCommitRow() bool { + if x, ok := m.GetRowStatus().(*ReadRowsResponse_CellChunk_CommitRow); ok { + return x.CommitRow + } + return false +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*ReadRowsResponse_CellChunk) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _ReadRowsResponse_CellChunk_OneofMarshaler, _ReadRowsResponse_CellChunk_OneofUnmarshaler, _ReadRowsResponse_CellChunk_OneofSizer, []interface{}{ + (*ReadRowsResponse_CellChunk_ResetRow)(nil), + (*ReadRowsResponse_CellChunk_CommitRow)(nil), + } +} + +func _ReadRowsResponse_CellChunk_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*ReadRowsResponse_CellChunk) + // row_status + switch x := m.RowStatus.(type) { + case *ReadRowsResponse_CellChunk_ResetRow: + t := uint64(0) + if x.ResetRow { + t = 1 + } + b.EncodeVarint(8<<3 | proto.WireVarint) + b.EncodeVarint(t) + case *ReadRowsResponse_CellChunk_CommitRow: + t := uint64(0) + if x.CommitRow { + t = 1 + } + b.EncodeVarint(9<<3 | proto.WireVarint) + b.EncodeVarint(t) + case nil: + default: + return fmt.Errorf("ReadRowsResponse_CellChunk.RowStatus has unexpected type %T", x) + } + return nil +} + +func _ReadRowsResponse_CellChunk_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*ReadRowsResponse_CellChunk) + switch tag { + case 8: // row_status.reset_row + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.RowStatus = &ReadRowsResponse_CellChunk_ResetRow{x != 0} + return true, err + case 9: // row_status.commit_row + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.RowStatus = &ReadRowsResponse_CellChunk_CommitRow{x != 0} + return true, err + default: + return false, nil + } +} + +func _ReadRowsResponse_CellChunk_OneofSizer(msg proto.Message) (n int) { + m := msg.(*ReadRowsResponse_CellChunk) + // row_status + switch x := m.RowStatus.(type) { + case *ReadRowsResponse_CellChunk_ResetRow: + n += proto.SizeVarint(8<<3 | proto.WireVarint) + n += 1 + case *ReadRowsResponse_CellChunk_CommitRow: + n += proto.SizeVarint(9<<3 | proto.WireVarint) + n += 1 + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Request message for Bigtable.SampleRowKeys. +type SampleRowKeysRequest struct { + // The unique name of the table from which to sample row keys. + // Values are of the form + // `projects//instances//tables/
`. + TableName string `protobuf:"bytes,1,opt,name=table_name,json=tableName" json:"table_name,omitempty"` +} + +func (m *SampleRowKeysRequest) Reset() { *m = SampleRowKeysRequest{} } +func (m *SampleRowKeysRequest) String() string { return proto.CompactTextString(m) } +func (*SampleRowKeysRequest) ProtoMessage() {} +func (*SampleRowKeysRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *SampleRowKeysRequest) GetTableName() string { + if m != nil { + return m.TableName + } + return "" +} + +// Response message for Bigtable.SampleRowKeys. +type SampleRowKeysResponse struct { + // Sorted streamed sequence of sample row keys in the table. The table might + // have contents before the first row key in the list and after the last one, + // but a key containing the empty string indicates "end of table" and will be + // the last response given, if present. + // Note that row keys in this list may not have ever been written to or read + // from, and users should therefore not make any assumptions about the row key + // structure that are specific to their use case. + RowKey []byte `protobuf:"bytes,1,opt,name=row_key,json=rowKey,proto3" json:"row_key,omitempty"` + // Approximate total storage space used by all rows in the table which precede + // `row_key`. Buffering the contents of all rows between two subsequent + // samples would require space roughly equal to the difference in their + // `offset_bytes` fields. + OffsetBytes int64 `protobuf:"varint,2,opt,name=offset_bytes,json=offsetBytes" json:"offset_bytes,omitempty"` +} + +func (m *SampleRowKeysResponse) Reset() { *m = SampleRowKeysResponse{} } +func (m *SampleRowKeysResponse) String() string { return proto.CompactTextString(m) } +func (*SampleRowKeysResponse) ProtoMessage() {} +func (*SampleRowKeysResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *SampleRowKeysResponse) GetRowKey() []byte { + if m != nil { + return m.RowKey + } + return nil +} + +func (m *SampleRowKeysResponse) GetOffsetBytes() int64 { + if m != nil { + return m.OffsetBytes + } + return 0 +} + +// Request message for Bigtable.MutateRow. +type MutateRowRequest struct { + // The unique name of the table to which the mutation should be applied. + // Values are of the form + // `projects//instances//tables/
`. + TableName string `protobuf:"bytes,1,opt,name=table_name,json=tableName" json:"table_name,omitempty"` + // The key of the row to which the mutation should be applied. + RowKey []byte `protobuf:"bytes,2,opt,name=row_key,json=rowKey,proto3" json:"row_key,omitempty"` + // Changes to be atomically applied to the specified row. Entries are applied + // in order, meaning that earlier mutations can be masked by later ones. + // Must contain at least one entry and at most 100000. + Mutations []*Mutation `protobuf:"bytes,3,rep,name=mutations" json:"mutations,omitempty"` +} + +func (m *MutateRowRequest) Reset() { *m = MutateRowRequest{} } +func (m *MutateRowRequest) String() string { return proto.CompactTextString(m) } +func (*MutateRowRequest) ProtoMessage() {} +func (*MutateRowRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *MutateRowRequest) GetTableName() string { + if m != nil { + return m.TableName + } + return "" +} + +func (m *MutateRowRequest) GetRowKey() []byte { + if m != nil { + return m.RowKey + } + return nil +} + +func (m *MutateRowRequest) GetMutations() []*Mutation { + if m != nil { + return m.Mutations + } + return nil +} + +// Response message for Bigtable.MutateRow. +type MutateRowResponse struct { +} + +func (m *MutateRowResponse) Reset() { *m = MutateRowResponse{} } +func (m *MutateRowResponse) String() string { return proto.CompactTextString(m) } +func (*MutateRowResponse) ProtoMessage() {} +func (*MutateRowResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +// Request message for BigtableService.MutateRows. +type MutateRowsRequest struct { + // The unique name of the table to which the mutations should be applied. + TableName string `protobuf:"bytes,1,opt,name=table_name,json=tableName" json:"table_name,omitempty"` + // The row keys and corresponding mutations to be applied in bulk. + // Each entry is applied as an atomic mutation, but the entries may be + // applied in arbitrary order (even between entries for the same row). + // At least one entry must be specified, and in total the entries can + // contain at most 100000 mutations. + Entries []*MutateRowsRequest_Entry `protobuf:"bytes,2,rep,name=entries" json:"entries,omitempty"` +} + +func (m *MutateRowsRequest) Reset() { *m = MutateRowsRequest{} } +func (m *MutateRowsRequest) String() string { return proto.CompactTextString(m) } +func (*MutateRowsRequest) ProtoMessage() {} +func (*MutateRowsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *MutateRowsRequest) GetTableName() string { + if m != nil { + return m.TableName + } + return "" +} + +func (m *MutateRowsRequest) GetEntries() []*MutateRowsRequest_Entry { + if m != nil { + return m.Entries + } + return nil +} + +type MutateRowsRequest_Entry struct { + // The key of the row to which the `mutations` should be applied. + RowKey []byte `protobuf:"bytes,1,opt,name=row_key,json=rowKey,proto3" json:"row_key,omitempty"` + // Changes to be atomically applied to the specified row. Mutations are + // applied in order, meaning that earlier mutations can be masked by + // later ones. + // You must specify at least one mutation. + Mutations []*Mutation `protobuf:"bytes,2,rep,name=mutations" json:"mutations,omitempty"` +} + +func (m *MutateRowsRequest_Entry) Reset() { *m = MutateRowsRequest_Entry{} } +func (m *MutateRowsRequest_Entry) String() string { return proto.CompactTextString(m) } +func (*MutateRowsRequest_Entry) ProtoMessage() {} +func (*MutateRowsRequest_Entry) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6, 0} } + +func (m *MutateRowsRequest_Entry) GetRowKey() []byte { + if m != nil { + return m.RowKey + } + return nil +} + +func (m *MutateRowsRequest_Entry) GetMutations() []*Mutation { + if m != nil { + return m.Mutations + } + return nil +} + +// Response message for BigtableService.MutateRows. +type MutateRowsResponse struct { + // One or more results for Entries from the batch request. + Entries []*MutateRowsResponse_Entry `protobuf:"bytes,1,rep,name=entries" json:"entries,omitempty"` +} + +func (m *MutateRowsResponse) Reset() { *m = MutateRowsResponse{} } +func (m *MutateRowsResponse) String() string { return proto.CompactTextString(m) } +func (*MutateRowsResponse) ProtoMessage() {} +func (*MutateRowsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *MutateRowsResponse) GetEntries() []*MutateRowsResponse_Entry { + if m != nil { + return m.Entries + } + return nil +} + +type MutateRowsResponse_Entry struct { + // The index into the original request's `entries` list of the Entry + // for which a result is being reported. + Index int64 `protobuf:"varint,1,opt,name=index" json:"index,omitempty"` + // The result of the request Entry identified by `index`. + // Depending on how requests are batched during execution, it is possible + // for one Entry to fail due to an error with another Entry. In the event + // that this occurs, the same error will be reported for both entries. + Status *google_rpc.Status `protobuf:"bytes,2,opt,name=status" json:"status,omitempty"` +} + +func (m *MutateRowsResponse_Entry) Reset() { *m = MutateRowsResponse_Entry{} } +func (m *MutateRowsResponse_Entry) String() string { return proto.CompactTextString(m) } +func (*MutateRowsResponse_Entry) ProtoMessage() {} +func (*MutateRowsResponse_Entry) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7, 0} } + +func (m *MutateRowsResponse_Entry) GetIndex() int64 { + if m != nil { + return m.Index + } + return 0 +} + +func (m *MutateRowsResponse_Entry) GetStatus() *google_rpc.Status { + if m != nil { + return m.Status + } + return nil +} + +// Request message for Bigtable.CheckAndMutateRow. +type CheckAndMutateRowRequest struct { + // The unique name of the table to which the conditional mutation should be + // applied. + // Values are of the form + // `projects//instances//tables/
`. + TableName string `protobuf:"bytes,1,opt,name=table_name,json=tableName" json:"table_name,omitempty"` + // The key of the row to which the conditional mutation should be applied. + RowKey []byte `protobuf:"bytes,2,opt,name=row_key,json=rowKey,proto3" json:"row_key,omitempty"` + // The filter to be applied to the contents of the specified row. Depending + // on whether or not any results are yielded, either `true_mutations` or + // `false_mutations` will be executed. If unset, checks that the row contains + // any values at all. + PredicateFilter *RowFilter `protobuf:"bytes,6,opt,name=predicate_filter,json=predicateFilter" json:"predicate_filter,omitempty"` + // Changes to be atomically applied to the specified row if `predicate_filter` + // yields at least one cell when applied to `row_key`. Entries are applied in + // order, meaning that earlier mutations can be masked by later ones. + // Must contain at least one entry if `false_mutations` is empty, and at most + // 100000. + TrueMutations []*Mutation `protobuf:"bytes,4,rep,name=true_mutations,json=trueMutations" json:"true_mutations,omitempty"` + // Changes to be atomically applied to the specified row if `predicate_filter` + // does not yield any cells when applied to `row_key`. Entries are applied in + // order, meaning that earlier mutations can be masked by later ones. + // Must contain at least one entry if `true_mutations` is empty, and at most + // 100000. + FalseMutations []*Mutation `protobuf:"bytes,5,rep,name=false_mutations,json=falseMutations" json:"false_mutations,omitempty"` +} + +func (m *CheckAndMutateRowRequest) Reset() { *m = CheckAndMutateRowRequest{} } +func (m *CheckAndMutateRowRequest) String() string { return proto.CompactTextString(m) } +func (*CheckAndMutateRowRequest) ProtoMessage() {} +func (*CheckAndMutateRowRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *CheckAndMutateRowRequest) GetTableName() string { + if m != nil { + return m.TableName + } + return "" +} + +func (m *CheckAndMutateRowRequest) GetRowKey() []byte { + if m != nil { + return m.RowKey + } + return nil +} + +func (m *CheckAndMutateRowRequest) GetPredicateFilter() *RowFilter { + if m != nil { + return m.PredicateFilter + } + return nil +} + +func (m *CheckAndMutateRowRequest) GetTrueMutations() []*Mutation { + if m != nil { + return m.TrueMutations + } + return nil +} + +func (m *CheckAndMutateRowRequest) GetFalseMutations() []*Mutation { + if m != nil { + return m.FalseMutations + } + return nil +} + +// Response message for Bigtable.CheckAndMutateRow. +type CheckAndMutateRowResponse struct { + // Whether or not the request's `predicate_filter` yielded any results for + // the specified row. + PredicateMatched bool `protobuf:"varint,1,opt,name=predicate_matched,json=predicateMatched" json:"predicate_matched,omitempty"` +} + +func (m *CheckAndMutateRowResponse) Reset() { *m = CheckAndMutateRowResponse{} } +func (m *CheckAndMutateRowResponse) String() string { return proto.CompactTextString(m) } +func (*CheckAndMutateRowResponse) ProtoMessage() {} +func (*CheckAndMutateRowResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *CheckAndMutateRowResponse) GetPredicateMatched() bool { + if m != nil { + return m.PredicateMatched + } + return false +} + +// Request message for Bigtable.ReadModifyWriteRow. +type ReadModifyWriteRowRequest struct { + // The unique name of the table to which the read/modify/write rules should be + // applied. + // Values are of the form + // `projects//instances//tables/
`. + TableName string `protobuf:"bytes,1,opt,name=table_name,json=tableName" json:"table_name,omitempty"` + // The key of the row to which the read/modify/write rules should be applied. + RowKey []byte `protobuf:"bytes,2,opt,name=row_key,json=rowKey,proto3" json:"row_key,omitempty"` + // Rules specifying how the specified row's contents are to be transformed + // into writes. Entries are applied in order, meaning that earlier rules will + // affect the results of later ones. + Rules []*ReadModifyWriteRule `protobuf:"bytes,3,rep,name=rules" json:"rules,omitempty"` +} + +func (m *ReadModifyWriteRowRequest) Reset() { *m = ReadModifyWriteRowRequest{} } +func (m *ReadModifyWriteRowRequest) String() string { return proto.CompactTextString(m) } +func (*ReadModifyWriteRowRequest) ProtoMessage() {} +func (*ReadModifyWriteRowRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *ReadModifyWriteRowRequest) GetTableName() string { + if m != nil { + return m.TableName + } + return "" +} + +func (m *ReadModifyWriteRowRequest) GetRowKey() []byte { + if m != nil { + return m.RowKey + } + return nil +} + +func (m *ReadModifyWriteRowRequest) GetRules() []*ReadModifyWriteRule { + if m != nil { + return m.Rules + } + return nil +} + +// Response message for Bigtable.ReadModifyWriteRow. +type ReadModifyWriteRowResponse struct { + // A Row containing the new contents of all cells modified by the request. + Row *Row `protobuf:"bytes,1,opt,name=row" json:"row,omitempty"` +} + +func (m *ReadModifyWriteRowResponse) Reset() { *m = ReadModifyWriteRowResponse{} } +func (m *ReadModifyWriteRowResponse) String() string { return proto.CompactTextString(m) } +func (*ReadModifyWriteRowResponse) ProtoMessage() {} +func (*ReadModifyWriteRowResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } + +func (m *ReadModifyWriteRowResponse) GetRow() *Row { + if m != nil { + return m.Row + } + return nil +} + +func init() { + proto.RegisterType((*ReadRowsRequest)(nil), "google.bigtable.v2.ReadRowsRequest") + proto.RegisterType((*ReadRowsResponse)(nil), "google.bigtable.v2.ReadRowsResponse") + proto.RegisterType((*ReadRowsResponse_CellChunk)(nil), "google.bigtable.v2.ReadRowsResponse.CellChunk") + proto.RegisterType((*SampleRowKeysRequest)(nil), "google.bigtable.v2.SampleRowKeysRequest") + proto.RegisterType((*SampleRowKeysResponse)(nil), "google.bigtable.v2.SampleRowKeysResponse") + proto.RegisterType((*MutateRowRequest)(nil), "google.bigtable.v2.MutateRowRequest") + proto.RegisterType((*MutateRowResponse)(nil), "google.bigtable.v2.MutateRowResponse") + proto.RegisterType((*MutateRowsRequest)(nil), "google.bigtable.v2.MutateRowsRequest") + proto.RegisterType((*MutateRowsRequest_Entry)(nil), "google.bigtable.v2.MutateRowsRequest.Entry") + proto.RegisterType((*MutateRowsResponse)(nil), "google.bigtable.v2.MutateRowsResponse") + proto.RegisterType((*MutateRowsResponse_Entry)(nil), "google.bigtable.v2.MutateRowsResponse.Entry") + proto.RegisterType((*CheckAndMutateRowRequest)(nil), "google.bigtable.v2.CheckAndMutateRowRequest") + proto.RegisterType((*CheckAndMutateRowResponse)(nil), "google.bigtable.v2.CheckAndMutateRowResponse") + proto.RegisterType((*ReadModifyWriteRowRequest)(nil), "google.bigtable.v2.ReadModifyWriteRowRequest") + proto.RegisterType((*ReadModifyWriteRowResponse)(nil), "google.bigtable.v2.ReadModifyWriteRowResponse") +} + +// 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 + +// Client API for Bigtable service + +type BigtableClient interface { + // Streams back the contents of all requested rows in key order, optionally + // applying the same Reader filter to each. Depending on their size, + // rows and cells may be broken up across multiple responses, but + // atomicity of each row will still be preserved. See the + // ReadRowsResponse documentation for details. + ReadRows(ctx context.Context, in *ReadRowsRequest, opts ...grpc.CallOption) (Bigtable_ReadRowsClient, error) + // Returns a sample of row keys in the table. The returned row keys will + // delimit contiguous sections of the table of approximately equal size, + // which can be used to break up the data for distributed tasks like + // mapreduces. + SampleRowKeys(ctx context.Context, in *SampleRowKeysRequest, opts ...grpc.CallOption) (Bigtable_SampleRowKeysClient, error) + // Mutates a row atomically. Cells already present in the row are left + // unchanged unless explicitly changed by `mutation`. + MutateRow(ctx context.Context, in *MutateRowRequest, opts ...grpc.CallOption) (*MutateRowResponse, error) + // Mutates multiple rows in a batch. Each individual row is mutated + // atomically as in MutateRow, but the entire batch is not executed + // atomically. + MutateRows(ctx context.Context, in *MutateRowsRequest, opts ...grpc.CallOption) (Bigtable_MutateRowsClient, error) + // Mutates a row atomically based on the output of a predicate Reader filter. + CheckAndMutateRow(ctx context.Context, in *CheckAndMutateRowRequest, opts ...grpc.CallOption) (*CheckAndMutateRowResponse, error) + // Modifies a row atomically. The method reads the latest existing timestamp + // and value from the specified columns and writes a new entry based on + // pre-defined read/modify/write rules. The new value for the timestamp is the + // greater of the existing timestamp or the current server time. The method + // returns the new contents of all modified cells. + ReadModifyWriteRow(ctx context.Context, in *ReadModifyWriteRowRequest, opts ...grpc.CallOption) (*ReadModifyWriteRowResponse, error) +} + +type bigtableClient struct { + cc *grpc.ClientConn +} + +func NewBigtableClient(cc *grpc.ClientConn) BigtableClient { + return &bigtableClient{cc} +} + +func (c *bigtableClient) ReadRows(ctx context.Context, in *ReadRowsRequest, opts ...grpc.CallOption) (Bigtable_ReadRowsClient, error) { + stream, err := grpc.NewClientStream(ctx, &_Bigtable_serviceDesc.Streams[0], c.cc, "/google.bigtable.v2.Bigtable/ReadRows", opts...) + if err != nil { + return nil, err + } + x := &bigtableReadRowsClient{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 Bigtable_ReadRowsClient interface { + Recv() (*ReadRowsResponse, error) + grpc.ClientStream +} + +type bigtableReadRowsClient struct { + grpc.ClientStream +} + +func (x *bigtableReadRowsClient) Recv() (*ReadRowsResponse, error) { + m := new(ReadRowsResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *bigtableClient) SampleRowKeys(ctx context.Context, in *SampleRowKeysRequest, opts ...grpc.CallOption) (Bigtable_SampleRowKeysClient, error) { + stream, err := grpc.NewClientStream(ctx, &_Bigtable_serviceDesc.Streams[1], c.cc, "/google.bigtable.v2.Bigtable/SampleRowKeys", opts...) + if err != nil { + return nil, err + } + x := &bigtableSampleRowKeysClient{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 Bigtable_SampleRowKeysClient interface { + Recv() (*SampleRowKeysResponse, error) + grpc.ClientStream +} + +type bigtableSampleRowKeysClient struct { + grpc.ClientStream +} + +func (x *bigtableSampleRowKeysClient) Recv() (*SampleRowKeysResponse, error) { + m := new(SampleRowKeysResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *bigtableClient) MutateRow(ctx context.Context, in *MutateRowRequest, opts ...grpc.CallOption) (*MutateRowResponse, error) { + out := new(MutateRowResponse) + err := grpc.Invoke(ctx, "/google.bigtable.v2.Bigtable/MutateRow", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bigtableClient) MutateRows(ctx context.Context, in *MutateRowsRequest, opts ...grpc.CallOption) (Bigtable_MutateRowsClient, error) { + stream, err := grpc.NewClientStream(ctx, &_Bigtable_serviceDesc.Streams[2], c.cc, "/google.bigtable.v2.Bigtable/MutateRows", opts...) + if err != nil { + return nil, err + } + x := &bigtableMutateRowsClient{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 Bigtable_MutateRowsClient interface { + Recv() (*MutateRowsResponse, error) + grpc.ClientStream +} + +type bigtableMutateRowsClient struct { + grpc.ClientStream +} + +func (x *bigtableMutateRowsClient) Recv() (*MutateRowsResponse, error) { + m := new(MutateRowsResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *bigtableClient) CheckAndMutateRow(ctx context.Context, in *CheckAndMutateRowRequest, opts ...grpc.CallOption) (*CheckAndMutateRowResponse, error) { + out := new(CheckAndMutateRowResponse) + err := grpc.Invoke(ctx, "/google.bigtable.v2.Bigtable/CheckAndMutateRow", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bigtableClient) ReadModifyWriteRow(ctx context.Context, in *ReadModifyWriteRowRequest, opts ...grpc.CallOption) (*ReadModifyWriteRowResponse, error) { + out := new(ReadModifyWriteRowResponse) + err := grpc.Invoke(ctx, "/google.bigtable.v2.Bigtable/ReadModifyWriteRow", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for Bigtable service + +type BigtableServer interface { + // Streams back the contents of all requested rows in key order, optionally + // applying the same Reader filter to each. Depending on their size, + // rows and cells may be broken up across multiple responses, but + // atomicity of each row will still be preserved. See the + // ReadRowsResponse documentation for details. + ReadRows(*ReadRowsRequest, Bigtable_ReadRowsServer) error + // Returns a sample of row keys in the table. The returned row keys will + // delimit contiguous sections of the table of approximately equal size, + // which can be used to break up the data for distributed tasks like + // mapreduces. + SampleRowKeys(*SampleRowKeysRequest, Bigtable_SampleRowKeysServer) error + // Mutates a row atomically. Cells already present in the row are left + // unchanged unless explicitly changed by `mutation`. + MutateRow(context.Context, *MutateRowRequest) (*MutateRowResponse, error) + // Mutates multiple rows in a batch. Each individual row is mutated + // atomically as in MutateRow, but the entire batch is not executed + // atomically. + MutateRows(*MutateRowsRequest, Bigtable_MutateRowsServer) error + // Mutates a row atomically based on the output of a predicate Reader filter. + CheckAndMutateRow(context.Context, *CheckAndMutateRowRequest) (*CheckAndMutateRowResponse, error) + // Modifies a row atomically. The method reads the latest existing timestamp + // and value from the specified columns and writes a new entry based on + // pre-defined read/modify/write rules. The new value for the timestamp is the + // greater of the existing timestamp or the current server time. The method + // returns the new contents of all modified cells. + ReadModifyWriteRow(context.Context, *ReadModifyWriteRowRequest) (*ReadModifyWriteRowResponse, error) +} + +func RegisterBigtableServer(s *grpc.Server, srv BigtableServer) { + s.RegisterService(&_Bigtable_serviceDesc, srv) +} + +func _Bigtable_ReadRows_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(ReadRowsRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(BigtableServer).ReadRows(m, &bigtableReadRowsServer{stream}) +} + +type Bigtable_ReadRowsServer interface { + Send(*ReadRowsResponse) error + grpc.ServerStream +} + +type bigtableReadRowsServer struct { + grpc.ServerStream +} + +func (x *bigtableReadRowsServer) Send(m *ReadRowsResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _Bigtable_SampleRowKeys_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(SampleRowKeysRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(BigtableServer).SampleRowKeys(m, &bigtableSampleRowKeysServer{stream}) +} + +type Bigtable_SampleRowKeysServer interface { + Send(*SampleRowKeysResponse) error + grpc.ServerStream +} + +type bigtableSampleRowKeysServer struct { + grpc.ServerStream +} + +func (x *bigtableSampleRowKeysServer) Send(m *SampleRowKeysResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _Bigtable_MutateRow_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MutateRowRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BigtableServer).MutateRow(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.bigtable.v2.Bigtable/MutateRow", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BigtableServer).MutateRow(ctx, req.(*MutateRowRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Bigtable_MutateRows_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(MutateRowsRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(BigtableServer).MutateRows(m, &bigtableMutateRowsServer{stream}) +} + +type Bigtable_MutateRowsServer interface { + Send(*MutateRowsResponse) error + grpc.ServerStream +} + +type bigtableMutateRowsServer struct { + grpc.ServerStream +} + +func (x *bigtableMutateRowsServer) Send(m *MutateRowsResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _Bigtable_CheckAndMutateRow_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CheckAndMutateRowRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BigtableServer).CheckAndMutateRow(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.bigtable.v2.Bigtable/CheckAndMutateRow", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BigtableServer).CheckAndMutateRow(ctx, req.(*CheckAndMutateRowRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Bigtable_ReadModifyWriteRow_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ReadModifyWriteRowRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BigtableServer).ReadModifyWriteRow(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.bigtable.v2.Bigtable/ReadModifyWriteRow", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BigtableServer).ReadModifyWriteRow(ctx, req.(*ReadModifyWriteRowRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Bigtable_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.bigtable.v2.Bigtable", + HandlerType: (*BigtableServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "MutateRow", + Handler: _Bigtable_MutateRow_Handler, + }, + { + MethodName: "CheckAndMutateRow", + Handler: _Bigtable_CheckAndMutateRow_Handler, + }, + { + MethodName: "ReadModifyWriteRow", + Handler: _Bigtable_ReadModifyWriteRow_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "ReadRows", + Handler: _Bigtable_ReadRows_Handler, + ServerStreams: true, + }, + { + StreamName: "SampleRowKeys", + Handler: _Bigtable_SampleRowKeys_Handler, + ServerStreams: true, + }, + { + StreamName: "MutateRows", + Handler: _Bigtable_MutateRows_Handler, + ServerStreams: true, + }, + }, + Metadata: "google/bigtable/v2/bigtable.proto", +} + +func init() { proto.RegisterFile("google/bigtable/v2/bigtable.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 1167 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x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, 0x3b, 0x82, 0x65, 0xc2, 0x68, 0x8f, + 0xb8, 0xc3, 0x80, 0xb0, 0xc7, 0x21, 0x0b, 0x38, 0xde, 0x04, 0x10, 0x77, 0x74, 0x1c, 0x6a, 0x33, + 0x15, 0x95, 0x50, 0x59, 0x21, 0x8a, 0x90, 0x3c, 0xa4, 0x36, 0xc3, 0x3a, 0x5c, 0xf2, 0xdd, 0x61, + 0xa0, 0x66, 0x4a, 0xa8, 0xbc, 0x50, 0x2b, 0xea, 0xe7, 0x63, 0xd1, 0x89, 0x3b, 0x6c, 0x33, 0x4e, + 0x84, 0x1d, 0xbe, 0x0b, 0xf9, 0xbe, 0x69, 0x71, 0xe6, 0xab, 0x59, 0x81, 0xd8, 0x9c, 0x83, 0xd8, + 0x15, 0x46, 0x44, 0x1a, 0x47, 0x2c, 0x22, 0x78, 0xc7, 0x32, 0x6d, 0x93, 0xab, 0x97, 0x4a, 0xa8, + 0x9c, 0x25, 0x4a, 0x24, 0xf9, 0x38, 0x12, 0x68, 0xff, 0x66, 0x61, 0x65, 0x42, 0x3c, 0xf0, 0x5c, + 0x27, 0x60, 0x78, 0x17, 0xf2, 0xc6, 0x51, 0xe8, 0x1c, 0x07, 0x2a, 0x2a, 0x65, 0xcb, 0x0b, 0x35, + 0x7d, 0xe6, 0x55, 0x67, 0x50, 0x7a, 0x93, 0x59, 0x56, 0x33, 0x82, 0x11, 0x89, 0xc6, 0x55, 0x58, + 0xb3, 0x68, 0xc0, 0x3b, 0x81, 0x41, 0x1d, 0x87, 0xf5, 0x3a, 0xbe, 0x3b, 0xec, 0x1c, 0xb3, 0x91, + 0x08, 0x79, 0x91, 0xac, 0x46, 0xba, 0x76, 0xac, 0x22, 0xee, 0xf0, 0x23, 0x36, 0x2a, 0x3e, 0xcd, + 0x80, 0x32, 0x76, 0x83, 0xd7, 0xe1, 0x72, 0x82, 0x40, 0x02, 0x91, 0xf7, 0x85, 0x19, 0xde, 0x86, + 0x85, 0x3e, 0xb5, 0x4d,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 0xa2, 0xce, 0x40, 0x77, + 0xfd, 0x41, 0x75, 0xc0, 0x1c, 0xf1, 0xbb, 0xb2, 0x1a, 0xab, 0xa8, 0x67, 0x06, 0xd3, 0xff, 0x40, + 0xee, 0x27, 0xdf, 0xbf, 0x64, 0xd4, 0xbd, 0x18, 0xdc, 0xb4, 0xdc, 0xb0, 0xa7, 0x27, 0xae, 0xf5, + 0x83, 0xda, 0x5f, 0x89, 0xea, 0x50, 0xa8, 0x0e, 0x13, 0xd5, 0xe1, 0x41, 0xad, 0x9b, 0x17, 0xce, + 0xdf, 0xf9, 0x2f, 0x00, 0x00, 0xff, 0xff, 0xd0, 0x19, 0x78, 0x8d, 0x32, 0x0d, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/bigtable/v2/data.pb.go b/vendor/google.golang.org/genproto/googleapis/bigtable/v2/data.pb.go new file mode 100644 index 0000000000..a24ba5af16 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/bigtable/v2/data.pb.go @@ -0,0 +1,2119 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/bigtable/v2/data.proto + +package bigtable + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Specifies the complete (requested) contents of a single row of a table. +// Rows which exceed 256MiB in size cannot be read in full. +type Row struct { + // The unique key which identifies this row within its table. This is the same + // key that's used to identify the row in, for example, a MutateRowRequest. + // May contain any non-empty byte string up to 4KiB in length. + Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + // May be empty, but only if the entire row is empty. + // The mutual ordering of column families is not specified. + Families []*Family `protobuf:"bytes,2,rep,name=families" json:"families,omitempty"` +} + +func (m *Row) Reset() { *m = Row{} } +func (m *Row) String() string { return proto.CompactTextString(m) } +func (*Row) ProtoMessage() {} +func (*Row) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +func (m *Row) GetKey() []byte { + if m != nil { + return m.Key + } + return nil +} + +func (m *Row) GetFamilies() []*Family { + if m != nil { + return m.Families + } + return nil +} + +// Specifies (some of) the contents of a single row/column family intersection +// of a table. +type Family struct { + // The unique key which identifies this family within its row. This is the + // same key that's used to identify the family in, for example, a RowFilter + // which sets its "family_name_regex_filter" field. + // Must match `[-_.a-zA-Z0-9]+`, except that AggregatingRowProcessors may + // produce cells in a sentinel family with an empty name. + // Must be no greater than 64 characters in length. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Must not be empty. Sorted in order of increasing "qualifier". + Columns []*Column `protobuf:"bytes,2,rep,name=columns" json:"columns,omitempty"` +} + +func (m *Family) Reset() { *m = Family{} } +func (m *Family) String() string { return proto.CompactTextString(m) } +func (*Family) ProtoMessage() {} +func (*Family) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} } + +func (m *Family) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Family) GetColumns() []*Column { + if m != nil { + return m.Columns + } + return nil +} + +// Specifies (some of) the contents of a single row/column intersection of a +// table. +type Column struct { + // The unique key which identifies this column within its family. This is the + // same key that's used to identify the column in, for example, a RowFilter + // which sets its `column_qualifier_regex_filter` field. + // May contain any byte string, including the empty string, up to 16kiB in + // length. + Qualifier []byte `protobuf:"bytes,1,opt,name=qualifier,proto3" json:"qualifier,omitempty"` + // Must not be empty. Sorted in order of decreasing "timestamp_micros". + Cells []*Cell `protobuf:"bytes,2,rep,name=cells" json:"cells,omitempty"` +} + +func (m *Column) Reset() { *m = Column{} } +func (m *Column) String() string { return proto.CompactTextString(m) } +func (*Column) ProtoMessage() {} +func (*Column) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} } + +func (m *Column) GetQualifier() []byte { + if m != nil { + return m.Qualifier + } + return nil +} + +func (m *Column) GetCells() []*Cell { + if m != nil { + return m.Cells + } + return nil +} + +// Specifies (some of) the contents of a single row/column/timestamp of a table. +type Cell struct { + // The cell's stored timestamp, which also uniquely identifies it within + // its column. + // Values are always expressed in microseconds, but individual tables may set + // a coarser granularity to further restrict the allowed values. For + // example, a table which specifies millisecond granularity will only allow + // values of `timestamp_micros` which are multiples of 1000. + TimestampMicros int64 `protobuf:"varint,1,opt,name=timestamp_micros,json=timestampMicros" json:"timestamp_micros,omitempty"` + // The value stored in the cell. + // May contain any byte string, including the empty string, up to 100MiB in + // length. + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + // Labels applied to the cell by a [RowFilter][google.bigtable.v2.RowFilter]. + Labels []string `protobuf:"bytes,3,rep,name=labels" json:"labels,omitempty"` +} + +func (m *Cell) Reset() { *m = Cell{} } +func (m *Cell) String() string { return proto.CompactTextString(m) } +func (*Cell) ProtoMessage() {} +func (*Cell) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{3} } + +func (m *Cell) GetTimestampMicros() int64 { + if m != nil { + return m.TimestampMicros + } + return 0 +} + +func (m *Cell) GetValue() []byte { + if m != nil { + return m.Value + } + return nil +} + +func (m *Cell) GetLabels() []string { + if m != nil { + return m.Labels + } + return nil +} + +// Specifies a contiguous range of rows. +type RowRange struct { + // The row key at which to start the range. + // If neither field is set, interpreted as the empty string, inclusive. + // + // Types that are valid to be assigned to StartKey: + // *RowRange_StartKeyClosed + // *RowRange_StartKeyOpen + StartKey isRowRange_StartKey `protobuf_oneof:"start_key"` + // The row key at which to end the range. + // If neither field is set, interpreted as the infinite row key, exclusive. + // + // Types that are valid to be assigned to EndKey: + // *RowRange_EndKeyOpen + // *RowRange_EndKeyClosed + EndKey isRowRange_EndKey `protobuf_oneof:"end_key"` +} + +func (m *RowRange) Reset() { *m = RowRange{} } +func (m *RowRange) String() string { return proto.CompactTextString(m) } +func (*RowRange) ProtoMessage() {} +func (*RowRange) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{4} } + +type isRowRange_StartKey interface { + isRowRange_StartKey() +} +type isRowRange_EndKey interface { + isRowRange_EndKey() +} + +type RowRange_StartKeyClosed struct { + StartKeyClosed []byte `protobuf:"bytes,1,opt,name=start_key_closed,json=startKeyClosed,proto3,oneof"` +} +type RowRange_StartKeyOpen struct { + StartKeyOpen []byte `protobuf:"bytes,2,opt,name=start_key_open,json=startKeyOpen,proto3,oneof"` +} +type RowRange_EndKeyOpen struct { + EndKeyOpen []byte `protobuf:"bytes,3,opt,name=end_key_open,json=endKeyOpen,proto3,oneof"` +} +type RowRange_EndKeyClosed struct { + EndKeyClosed []byte `protobuf:"bytes,4,opt,name=end_key_closed,json=endKeyClosed,proto3,oneof"` +} + +func (*RowRange_StartKeyClosed) isRowRange_StartKey() {} +func (*RowRange_StartKeyOpen) isRowRange_StartKey() {} +func (*RowRange_EndKeyOpen) isRowRange_EndKey() {} +func (*RowRange_EndKeyClosed) isRowRange_EndKey() {} + +func (m *RowRange) GetStartKey() isRowRange_StartKey { + if m != nil { + return m.StartKey + } + return nil +} +func (m *RowRange) GetEndKey() isRowRange_EndKey { + if m != nil { + return m.EndKey + } + return nil +} + +func (m *RowRange) GetStartKeyClosed() []byte { + if x, ok := m.GetStartKey().(*RowRange_StartKeyClosed); ok { + return x.StartKeyClosed + } + return nil +} + +func (m *RowRange) GetStartKeyOpen() []byte { + if x, ok := m.GetStartKey().(*RowRange_StartKeyOpen); ok { + return x.StartKeyOpen + } + return nil +} + +func (m *RowRange) GetEndKeyOpen() []byte { + if x, ok := m.GetEndKey().(*RowRange_EndKeyOpen); ok { + return x.EndKeyOpen + } + return nil +} + +func (m *RowRange) GetEndKeyClosed() []byte { + if x, ok := m.GetEndKey().(*RowRange_EndKeyClosed); ok { + return x.EndKeyClosed + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*RowRange) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _RowRange_OneofMarshaler, _RowRange_OneofUnmarshaler, _RowRange_OneofSizer, []interface{}{ + (*RowRange_StartKeyClosed)(nil), + (*RowRange_StartKeyOpen)(nil), + (*RowRange_EndKeyOpen)(nil), + (*RowRange_EndKeyClosed)(nil), + } +} + +func _RowRange_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*RowRange) + // start_key + switch x := m.StartKey.(type) { + case *RowRange_StartKeyClosed: + b.EncodeVarint(1<<3 | proto.WireBytes) + b.EncodeRawBytes(x.StartKeyClosed) + case *RowRange_StartKeyOpen: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeRawBytes(x.StartKeyOpen) + case nil: + default: + return fmt.Errorf("RowRange.StartKey has unexpected type %T", x) + } + // end_key + switch x := m.EndKey.(type) { + case *RowRange_EndKeyOpen: + b.EncodeVarint(3<<3 | proto.WireBytes) + b.EncodeRawBytes(x.EndKeyOpen) + case *RowRange_EndKeyClosed: + b.EncodeVarint(4<<3 | proto.WireBytes) + b.EncodeRawBytes(x.EndKeyClosed) + case nil: + default: + return fmt.Errorf("RowRange.EndKey has unexpected type %T", x) + } + return nil +} + +func _RowRange_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*RowRange) + switch tag { + case 1: // start_key.start_key_closed + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.StartKey = &RowRange_StartKeyClosed{x} + return true, err + case 2: // start_key.start_key_open + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.StartKey = &RowRange_StartKeyOpen{x} + return true, err + case 3: // end_key.end_key_open + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.EndKey = &RowRange_EndKeyOpen{x} + return true, err + case 4: // end_key.end_key_closed + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.EndKey = &RowRange_EndKeyClosed{x} + return true, err + default: + return false, nil + } +} + +func _RowRange_OneofSizer(msg proto.Message) (n int) { + m := msg.(*RowRange) + // start_key + switch x := m.StartKey.(type) { + case *RowRange_StartKeyClosed: + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.StartKeyClosed))) + n += len(x.StartKeyClosed) + case *RowRange_StartKeyOpen: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.StartKeyOpen))) + n += len(x.StartKeyOpen) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + // end_key + switch x := m.EndKey.(type) { + case *RowRange_EndKeyOpen: + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.EndKeyOpen))) + n += len(x.EndKeyOpen) + case *RowRange_EndKeyClosed: + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.EndKeyClosed))) + n += len(x.EndKeyClosed) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Specifies a non-contiguous set of rows. +type RowSet struct { + // Single rows included in the set. + RowKeys [][]byte `protobuf:"bytes,1,rep,name=row_keys,json=rowKeys,proto3" json:"row_keys,omitempty"` + // Contiguous row ranges included in the set. + RowRanges []*RowRange `protobuf:"bytes,2,rep,name=row_ranges,json=rowRanges" json:"row_ranges,omitempty"` +} + +func (m *RowSet) Reset() { *m = RowSet{} } +func (m *RowSet) String() string { return proto.CompactTextString(m) } +func (*RowSet) ProtoMessage() {} +func (*RowSet) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{5} } + +func (m *RowSet) GetRowKeys() [][]byte { + if m != nil { + return m.RowKeys + } + return nil +} + +func (m *RowSet) GetRowRanges() []*RowRange { + if m != nil { + return m.RowRanges + } + return nil +} + +// Specifies a contiguous range of columns within a single column family. +// The range spans from <column_family>:<start_qualifier> to +// <column_family>:<end_qualifier>, where both bounds can be either +// inclusive or exclusive. +type ColumnRange struct { + // The name of the column family within which this range falls. + FamilyName string `protobuf:"bytes,1,opt,name=family_name,json=familyName" json:"family_name,omitempty"` + // The column qualifier at which to start the range (within `column_family`). + // If neither field is set, interpreted as the empty string, inclusive. + // + // Types that are valid to be assigned to StartQualifier: + // *ColumnRange_StartQualifierClosed + // *ColumnRange_StartQualifierOpen + StartQualifier isColumnRange_StartQualifier `protobuf_oneof:"start_qualifier"` + // The column qualifier at which to end the range (within `column_family`). + // If neither field is set, interpreted as the infinite string, exclusive. + // + // Types that are valid to be assigned to EndQualifier: + // *ColumnRange_EndQualifierClosed + // *ColumnRange_EndQualifierOpen + EndQualifier isColumnRange_EndQualifier `protobuf_oneof:"end_qualifier"` +} + +func (m *ColumnRange) Reset() { *m = ColumnRange{} } +func (m *ColumnRange) String() string { return proto.CompactTextString(m) } +func (*ColumnRange) ProtoMessage() {} +func (*ColumnRange) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{6} } + +type isColumnRange_StartQualifier interface { + isColumnRange_StartQualifier() +} +type isColumnRange_EndQualifier interface { + isColumnRange_EndQualifier() +} + +type ColumnRange_StartQualifierClosed struct { + StartQualifierClosed []byte `protobuf:"bytes,2,opt,name=start_qualifier_closed,json=startQualifierClosed,proto3,oneof"` +} +type ColumnRange_StartQualifierOpen struct { + StartQualifierOpen []byte `protobuf:"bytes,3,opt,name=start_qualifier_open,json=startQualifierOpen,proto3,oneof"` +} +type ColumnRange_EndQualifierClosed struct { + EndQualifierClosed []byte `protobuf:"bytes,4,opt,name=end_qualifier_closed,json=endQualifierClosed,proto3,oneof"` +} +type ColumnRange_EndQualifierOpen struct { + EndQualifierOpen []byte `protobuf:"bytes,5,opt,name=end_qualifier_open,json=endQualifierOpen,proto3,oneof"` +} + +func (*ColumnRange_StartQualifierClosed) isColumnRange_StartQualifier() {} +func (*ColumnRange_StartQualifierOpen) isColumnRange_StartQualifier() {} +func (*ColumnRange_EndQualifierClosed) isColumnRange_EndQualifier() {} +func (*ColumnRange_EndQualifierOpen) isColumnRange_EndQualifier() {} + +func (m *ColumnRange) GetStartQualifier() isColumnRange_StartQualifier { + if m != nil { + return m.StartQualifier + } + return nil +} +func (m *ColumnRange) GetEndQualifier() isColumnRange_EndQualifier { + if m != nil { + return m.EndQualifier + } + return nil +} + +func (m *ColumnRange) GetFamilyName() string { + if m != nil { + return m.FamilyName + } + return "" +} + +func (m *ColumnRange) GetStartQualifierClosed() []byte { + if x, ok := m.GetStartQualifier().(*ColumnRange_StartQualifierClosed); ok { + return x.StartQualifierClosed + } + return nil +} + +func (m *ColumnRange) GetStartQualifierOpen() []byte { + if x, ok := m.GetStartQualifier().(*ColumnRange_StartQualifierOpen); ok { + return x.StartQualifierOpen + } + return nil +} + +func (m *ColumnRange) GetEndQualifierClosed() []byte { + if x, ok := m.GetEndQualifier().(*ColumnRange_EndQualifierClosed); ok { + return x.EndQualifierClosed + } + return nil +} + +func (m *ColumnRange) GetEndQualifierOpen() []byte { + if x, ok := m.GetEndQualifier().(*ColumnRange_EndQualifierOpen); ok { + return x.EndQualifierOpen + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*ColumnRange) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _ColumnRange_OneofMarshaler, _ColumnRange_OneofUnmarshaler, _ColumnRange_OneofSizer, []interface{}{ + (*ColumnRange_StartQualifierClosed)(nil), + (*ColumnRange_StartQualifierOpen)(nil), + (*ColumnRange_EndQualifierClosed)(nil), + (*ColumnRange_EndQualifierOpen)(nil), + } +} + +func _ColumnRange_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*ColumnRange) + // start_qualifier + switch x := m.StartQualifier.(type) { + case *ColumnRange_StartQualifierClosed: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeRawBytes(x.StartQualifierClosed) + case *ColumnRange_StartQualifierOpen: + b.EncodeVarint(3<<3 | proto.WireBytes) + b.EncodeRawBytes(x.StartQualifierOpen) + case nil: + default: + return fmt.Errorf("ColumnRange.StartQualifier has unexpected type %T", x) + } + // end_qualifier + switch x := m.EndQualifier.(type) { + case *ColumnRange_EndQualifierClosed: + b.EncodeVarint(4<<3 | proto.WireBytes) + b.EncodeRawBytes(x.EndQualifierClosed) + case *ColumnRange_EndQualifierOpen: + b.EncodeVarint(5<<3 | proto.WireBytes) + b.EncodeRawBytes(x.EndQualifierOpen) + case nil: + default: + return fmt.Errorf("ColumnRange.EndQualifier has unexpected type %T", x) + } + return nil +} + +func _ColumnRange_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*ColumnRange) + switch tag { + case 2: // start_qualifier.start_qualifier_closed + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.StartQualifier = &ColumnRange_StartQualifierClosed{x} + return true, err + case 3: // start_qualifier.start_qualifier_open + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.StartQualifier = &ColumnRange_StartQualifierOpen{x} + return true, err + case 4: // end_qualifier.end_qualifier_closed + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.EndQualifier = &ColumnRange_EndQualifierClosed{x} + return true, err + case 5: // end_qualifier.end_qualifier_open + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.EndQualifier = &ColumnRange_EndQualifierOpen{x} + return true, err + default: + return false, nil + } +} + +func _ColumnRange_OneofSizer(msg proto.Message) (n int) { + m := msg.(*ColumnRange) + // start_qualifier + switch x := m.StartQualifier.(type) { + case *ColumnRange_StartQualifierClosed: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.StartQualifierClosed))) + n += len(x.StartQualifierClosed) + case *ColumnRange_StartQualifierOpen: + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.StartQualifierOpen))) + n += len(x.StartQualifierOpen) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + // end_qualifier + switch x := m.EndQualifier.(type) { + case *ColumnRange_EndQualifierClosed: + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.EndQualifierClosed))) + n += len(x.EndQualifierClosed) + case *ColumnRange_EndQualifierOpen: + n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.EndQualifierOpen))) + n += len(x.EndQualifierOpen) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Specified a contiguous range of microsecond timestamps. +type TimestampRange struct { + // Inclusive lower bound. If left empty, interpreted as 0. + StartTimestampMicros int64 `protobuf:"varint,1,opt,name=start_timestamp_micros,json=startTimestampMicros" json:"start_timestamp_micros,omitempty"` + // Exclusive upper bound. If left empty, interpreted as infinity. + EndTimestampMicros int64 `protobuf:"varint,2,opt,name=end_timestamp_micros,json=endTimestampMicros" json:"end_timestamp_micros,omitempty"` +} + +func (m *TimestampRange) Reset() { *m = TimestampRange{} } +func (m *TimestampRange) String() string { return proto.CompactTextString(m) } +func (*TimestampRange) ProtoMessage() {} +func (*TimestampRange) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{7} } + +func (m *TimestampRange) GetStartTimestampMicros() int64 { + if m != nil { + return m.StartTimestampMicros + } + return 0 +} + +func (m *TimestampRange) GetEndTimestampMicros() int64 { + if m != nil { + return m.EndTimestampMicros + } + return 0 +} + +// Specifies a contiguous range of raw byte values. +type ValueRange struct { + // The value at which to start the range. + // If neither field is set, interpreted as the empty string, inclusive. + // + // Types that are valid to be assigned to StartValue: + // *ValueRange_StartValueClosed + // *ValueRange_StartValueOpen + StartValue isValueRange_StartValue `protobuf_oneof:"start_value"` + // The value at which to end the range. + // If neither field is set, interpreted as the infinite string, exclusive. + // + // Types that are valid to be assigned to EndValue: + // *ValueRange_EndValueClosed + // *ValueRange_EndValueOpen + EndValue isValueRange_EndValue `protobuf_oneof:"end_value"` +} + +func (m *ValueRange) Reset() { *m = ValueRange{} } +func (m *ValueRange) String() string { return proto.CompactTextString(m) } +func (*ValueRange) ProtoMessage() {} +func (*ValueRange) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{8} } + +type isValueRange_StartValue interface { + isValueRange_StartValue() +} +type isValueRange_EndValue interface { + isValueRange_EndValue() +} + +type ValueRange_StartValueClosed struct { + StartValueClosed []byte `protobuf:"bytes,1,opt,name=start_value_closed,json=startValueClosed,proto3,oneof"` +} +type ValueRange_StartValueOpen struct { + StartValueOpen []byte `protobuf:"bytes,2,opt,name=start_value_open,json=startValueOpen,proto3,oneof"` +} +type ValueRange_EndValueClosed struct { + EndValueClosed []byte `protobuf:"bytes,3,opt,name=end_value_closed,json=endValueClosed,proto3,oneof"` +} +type ValueRange_EndValueOpen struct { + EndValueOpen []byte `protobuf:"bytes,4,opt,name=end_value_open,json=endValueOpen,proto3,oneof"` +} + +func (*ValueRange_StartValueClosed) isValueRange_StartValue() {} +func (*ValueRange_StartValueOpen) isValueRange_StartValue() {} +func (*ValueRange_EndValueClosed) isValueRange_EndValue() {} +func (*ValueRange_EndValueOpen) isValueRange_EndValue() {} + +func (m *ValueRange) GetStartValue() isValueRange_StartValue { + if m != nil { + return m.StartValue + } + return nil +} +func (m *ValueRange) GetEndValue() isValueRange_EndValue { + if m != nil { + return m.EndValue + } + return nil +} + +func (m *ValueRange) GetStartValueClosed() []byte { + if x, ok := m.GetStartValue().(*ValueRange_StartValueClosed); ok { + return x.StartValueClosed + } + return nil +} + +func (m *ValueRange) GetStartValueOpen() []byte { + if x, ok := m.GetStartValue().(*ValueRange_StartValueOpen); ok { + return x.StartValueOpen + } + return nil +} + +func (m *ValueRange) GetEndValueClosed() []byte { + if x, ok := m.GetEndValue().(*ValueRange_EndValueClosed); ok { + return x.EndValueClosed + } + return nil +} + +func (m *ValueRange) GetEndValueOpen() []byte { + if x, ok := m.GetEndValue().(*ValueRange_EndValueOpen); ok { + return x.EndValueOpen + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*ValueRange) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _ValueRange_OneofMarshaler, _ValueRange_OneofUnmarshaler, _ValueRange_OneofSizer, []interface{}{ + (*ValueRange_StartValueClosed)(nil), + (*ValueRange_StartValueOpen)(nil), + (*ValueRange_EndValueClosed)(nil), + (*ValueRange_EndValueOpen)(nil), + } +} + +func _ValueRange_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*ValueRange) + // start_value + switch x := m.StartValue.(type) { + case *ValueRange_StartValueClosed: + b.EncodeVarint(1<<3 | proto.WireBytes) + b.EncodeRawBytes(x.StartValueClosed) + case *ValueRange_StartValueOpen: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeRawBytes(x.StartValueOpen) + case nil: + default: + return fmt.Errorf("ValueRange.StartValue has unexpected type %T", x) + } + // end_value + switch x := m.EndValue.(type) { + case *ValueRange_EndValueClosed: + b.EncodeVarint(3<<3 | proto.WireBytes) + b.EncodeRawBytes(x.EndValueClosed) + case *ValueRange_EndValueOpen: + b.EncodeVarint(4<<3 | proto.WireBytes) + b.EncodeRawBytes(x.EndValueOpen) + case nil: + default: + return fmt.Errorf("ValueRange.EndValue has unexpected type %T", x) + } + return nil +} + +func _ValueRange_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*ValueRange) + switch tag { + case 1: // start_value.start_value_closed + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.StartValue = &ValueRange_StartValueClosed{x} + return true, err + case 2: // start_value.start_value_open + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.StartValue = &ValueRange_StartValueOpen{x} + return true, err + case 3: // end_value.end_value_closed + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.EndValue = &ValueRange_EndValueClosed{x} + return true, err + case 4: // end_value.end_value_open + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.EndValue = &ValueRange_EndValueOpen{x} + return true, err + default: + return false, nil + } +} + +func _ValueRange_OneofSizer(msg proto.Message) (n int) { + m := msg.(*ValueRange) + // start_value + switch x := m.StartValue.(type) { + case *ValueRange_StartValueClosed: + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.StartValueClosed))) + n += len(x.StartValueClosed) + case *ValueRange_StartValueOpen: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.StartValueOpen))) + n += len(x.StartValueOpen) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + // end_value + switch x := m.EndValue.(type) { + case *ValueRange_EndValueClosed: + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.EndValueClosed))) + n += len(x.EndValueClosed) + case *ValueRange_EndValueOpen: + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.EndValueOpen))) + n += len(x.EndValueOpen) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Takes a row as input and produces an alternate view of the row based on +// specified rules. For example, a RowFilter might trim down a row to include +// just the cells from columns matching a given regular expression, or might +// return all the cells of a row but not their values. More complicated filters +// can be composed out of these components to express requests such as, "within +// every column of a particular family, give just the two most recent cells +// which are older than timestamp X." +// +// There are two broad categories of RowFilters (true filters and transformers), +// as well as two ways to compose simple filters into more complex ones +// (chains and interleaves). They work as follows: +// +// * True filters alter the input row by excluding some of its cells wholesale +// from the output row. An example of a true filter is the `value_regex_filter`, +// which excludes cells whose values don't match the specified pattern. All +// regex true filters use RE2 syntax (https://github.com/google/re2/wiki/Syntax) +// in raw byte mode (RE2::Latin1), and are evaluated as full matches. An +// important point to keep in mind is that `RE2(.)` is equivalent by default to +// `RE2([^\n])`, meaning that it does not match newlines. When attempting to +// match an arbitrary byte, you should therefore use the escape sequence `\C`, +// which may need to be further escaped as `\\C` in your client language. +// +// * Transformers alter the input row by changing the values of some of its +// cells in the output, without excluding them completely. Currently, the only +// supported transformer is the `strip_value_transformer`, which replaces every +// cell's value with the empty string. +// +// * Chains and interleaves are described in more detail in the +// RowFilter.Chain and RowFilter.Interleave documentation. +// +// The total serialized size of a RowFilter message must not +// exceed 4096 bytes, and RowFilters may not be nested within each other +// (in Chains or Interleaves) to a depth of more than 20. +type RowFilter struct { + // Which of the possible RowFilter types to apply. If none are set, this + // RowFilter returns all cells in the input row. + // + // Types that are valid to be assigned to Filter: + // *RowFilter_Chain_ + // *RowFilter_Interleave_ + // *RowFilter_Condition_ + // *RowFilter_Sink + // *RowFilter_PassAllFilter + // *RowFilter_BlockAllFilter + // *RowFilter_RowKeyRegexFilter + // *RowFilter_RowSampleFilter + // *RowFilter_FamilyNameRegexFilter + // *RowFilter_ColumnQualifierRegexFilter + // *RowFilter_ColumnRangeFilter + // *RowFilter_TimestampRangeFilter + // *RowFilter_ValueRegexFilter + // *RowFilter_ValueRangeFilter + // *RowFilter_CellsPerRowOffsetFilter + // *RowFilter_CellsPerRowLimitFilter + // *RowFilter_CellsPerColumnLimitFilter + // *RowFilter_StripValueTransformer + // *RowFilter_ApplyLabelTransformer + Filter isRowFilter_Filter `protobuf_oneof:"filter"` +} + +func (m *RowFilter) Reset() { *m = RowFilter{} } +func (m *RowFilter) String() string { return proto.CompactTextString(m) } +func (*RowFilter) ProtoMessage() {} +func (*RowFilter) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{9} } + +type isRowFilter_Filter interface { + isRowFilter_Filter() +} + +type RowFilter_Chain_ struct { + Chain *RowFilter_Chain `protobuf:"bytes,1,opt,name=chain,oneof"` +} +type RowFilter_Interleave_ struct { + Interleave *RowFilter_Interleave `protobuf:"bytes,2,opt,name=interleave,oneof"` +} +type RowFilter_Condition_ struct { + Condition *RowFilter_Condition `protobuf:"bytes,3,opt,name=condition,oneof"` +} +type RowFilter_Sink struct { + Sink bool `protobuf:"varint,16,opt,name=sink,oneof"` +} +type RowFilter_PassAllFilter struct { + PassAllFilter bool `protobuf:"varint,17,opt,name=pass_all_filter,json=passAllFilter,oneof"` +} +type RowFilter_BlockAllFilter struct { + BlockAllFilter bool `protobuf:"varint,18,opt,name=block_all_filter,json=blockAllFilter,oneof"` +} +type RowFilter_RowKeyRegexFilter struct { + RowKeyRegexFilter []byte `protobuf:"bytes,4,opt,name=row_key_regex_filter,json=rowKeyRegexFilter,proto3,oneof"` +} +type RowFilter_RowSampleFilter struct { + RowSampleFilter float64 `protobuf:"fixed64,14,opt,name=row_sample_filter,json=rowSampleFilter,oneof"` +} +type RowFilter_FamilyNameRegexFilter struct { + FamilyNameRegexFilter string `protobuf:"bytes,5,opt,name=family_name_regex_filter,json=familyNameRegexFilter,oneof"` +} +type RowFilter_ColumnQualifierRegexFilter struct { + ColumnQualifierRegexFilter []byte `protobuf:"bytes,6,opt,name=column_qualifier_regex_filter,json=columnQualifierRegexFilter,proto3,oneof"` +} +type RowFilter_ColumnRangeFilter struct { + ColumnRangeFilter *ColumnRange `protobuf:"bytes,7,opt,name=column_range_filter,json=columnRangeFilter,oneof"` +} +type RowFilter_TimestampRangeFilter struct { + TimestampRangeFilter *TimestampRange `protobuf:"bytes,8,opt,name=timestamp_range_filter,json=timestampRangeFilter,oneof"` +} +type RowFilter_ValueRegexFilter struct { + ValueRegexFilter []byte `protobuf:"bytes,9,opt,name=value_regex_filter,json=valueRegexFilter,proto3,oneof"` +} +type RowFilter_ValueRangeFilter struct { + ValueRangeFilter *ValueRange `protobuf:"bytes,15,opt,name=value_range_filter,json=valueRangeFilter,oneof"` +} +type RowFilter_CellsPerRowOffsetFilter struct { + CellsPerRowOffsetFilter int32 `protobuf:"varint,10,opt,name=cells_per_row_offset_filter,json=cellsPerRowOffsetFilter,oneof"` +} +type RowFilter_CellsPerRowLimitFilter struct { + CellsPerRowLimitFilter int32 `protobuf:"varint,11,opt,name=cells_per_row_limit_filter,json=cellsPerRowLimitFilter,oneof"` +} +type RowFilter_CellsPerColumnLimitFilter struct { + CellsPerColumnLimitFilter int32 `protobuf:"varint,12,opt,name=cells_per_column_limit_filter,json=cellsPerColumnLimitFilter,oneof"` +} +type RowFilter_StripValueTransformer struct { + StripValueTransformer bool `protobuf:"varint,13,opt,name=strip_value_transformer,json=stripValueTransformer,oneof"` +} +type RowFilter_ApplyLabelTransformer struct { + ApplyLabelTransformer string `protobuf:"bytes,19,opt,name=apply_label_transformer,json=applyLabelTransformer,oneof"` +} + +func (*RowFilter_Chain_) isRowFilter_Filter() {} +func (*RowFilter_Interleave_) isRowFilter_Filter() {} +func (*RowFilter_Condition_) isRowFilter_Filter() {} +func (*RowFilter_Sink) isRowFilter_Filter() {} +func (*RowFilter_PassAllFilter) isRowFilter_Filter() {} +func (*RowFilter_BlockAllFilter) isRowFilter_Filter() {} +func (*RowFilter_RowKeyRegexFilter) isRowFilter_Filter() {} +func (*RowFilter_RowSampleFilter) isRowFilter_Filter() {} +func (*RowFilter_FamilyNameRegexFilter) isRowFilter_Filter() {} +func (*RowFilter_ColumnQualifierRegexFilter) isRowFilter_Filter() {} +func (*RowFilter_ColumnRangeFilter) isRowFilter_Filter() {} +func (*RowFilter_TimestampRangeFilter) isRowFilter_Filter() {} +func (*RowFilter_ValueRegexFilter) isRowFilter_Filter() {} +func (*RowFilter_ValueRangeFilter) isRowFilter_Filter() {} +func (*RowFilter_CellsPerRowOffsetFilter) isRowFilter_Filter() {} +func (*RowFilter_CellsPerRowLimitFilter) isRowFilter_Filter() {} +func (*RowFilter_CellsPerColumnLimitFilter) isRowFilter_Filter() {} +func (*RowFilter_StripValueTransformer) isRowFilter_Filter() {} +func (*RowFilter_ApplyLabelTransformer) isRowFilter_Filter() {} + +func (m *RowFilter) GetFilter() isRowFilter_Filter { + if m != nil { + return m.Filter + } + return nil +} + +func (m *RowFilter) GetChain() *RowFilter_Chain { + if x, ok := m.GetFilter().(*RowFilter_Chain_); ok { + return x.Chain + } + return nil +} + +func (m *RowFilter) GetInterleave() *RowFilter_Interleave { + if x, ok := m.GetFilter().(*RowFilter_Interleave_); ok { + return x.Interleave + } + return nil +} + +func (m *RowFilter) GetCondition() *RowFilter_Condition { + if x, ok := m.GetFilter().(*RowFilter_Condition_); ok { + return x.Condition + } + return nil +} + +func (m *RowFilter) GetSink() bool { + if x, ok := m.GetFilter().(*RowFilter_Sink); ok { + return x.Sink + } + return false +} + +func (m *RowFilter) GetPassAllFilter() bool { + if x, ok := m.GetFilter().(*RowFilter_PassAllFilter); ok { + return x.PassAllFilter + } + return false +} + +func (m *RowFilter) GetBlockAllFilter() bool { + if x, ok := m.GetFilter().(*RowFilter_BlockAllFilter); ok { + return x.BlockAllFilter + } + return false +} + +func (m *RowFilter) GetRowKeyRegexFilter() []byte { + if x, ok := m.GetFilter().(*RowFilter_RowKeyRegexFilter); ok { + return x.RowKeyRegexFilter + } + return nil +} + +func (m *RowFilter) GetRowSampleFilter() float64 { + if x, ok := m.GetFilter().(*RowFilter_RowSampleFilter); ok { + return x.RowSampleFilter + } + return 0 +} + +func (m *RowFilter) GetFamilyNameRegexFilter() string { + if x, ok := m.GetFilter().(*RowFilter_FamilyNameRegexFilter); ok { + return x.FamilyNameRegexFilter + } + return "" +} + +func (m *RowFilter) GetColumnQualifierRegexFilter() []byte { + if x, ok := m.GetFilter().(*RowFilter_ColumnQualifierRegexFilter); ok { + return x.ColumnQualifierRegexFilter + } + return nil +} + +func (m *RowFilter) GetColumnRangeFilter() *ColumnRange { + if x, ok := m.GetFilter().(*RowFilter_ColumnRangeFilter); ok { + return x.ColumnRangeFilter + } + return nil +} + +func (m *RowFilter) GetTimestampRangeFilter() *TimestampRange { + if x, ok := m.GetFilter().(*RowFilter_TimestampRangeFilter); ok { + return x.TimestampRangeFilter + } + return nil +} + +func (m *RowFilter) GetValueRegexFilter() []byte { + if x, ok := m.GetFilter().(*RowFilter_ValueRegexFilter); ok { + return x.ValueRegexFilter + } + return nil +} + +func (m *RowFilter) GetValueRangeFilter() *ValueRange { + if x, ok := m.GetFilter().(*RowFilter_ValueRangeFilter); ok { + return x.ValueRangeFilter + } + return nil +} + +func (m *RowFilter) GetCellsPerRowOffsetFilter() int32 { + if x, ok := m.GetFilter().(*RowFilter_CellsPerRowOffsetFilter); ok { + return x.CellsPerRowOffsetFilter + } + return 0 +} + +func (m *RowFilter) GetCellsPerRowLimitFilter() int32 { + if x, ok := m.GetFilter().(*RowFilter_CellsPerRowLimitFilter); ok { + return x.CellsPerRowLimitFilter + } + return 0 +} + +func (m *RowFilter) GetCellsPerColumnLimitFilter() int32 { + if x, ok := m.GetFilter().(*RowFilter_CellsPerColumnLimitFilter); ok { + return x.CellsPerColumnLimitFilter + } + return 0 +} + +func (m *RowFilter) GetStripValueTransformer() bool { + if x, ok := m.GetFilter().(*RowFilter_StripValueTransformer); ok { + return x.StripValueTransformer + } + return false +} + +func (m *RowFilter) GetApplyLabelTransformer() string { + if x, ok := m.GetFilter().(*RowFilter_ApplyLabelTransformer); ok { + return x.ApplyLabelTransformer + } + return "" +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*RowFilter) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _RowFilter_OneofMarshaler, _RowFilter_OneofUnmarshaler, _RowFilter_OneofSizer, []interface{}{ + (*RowFilter_Chain_)(nil), + (*RowFilter_Interleave_)(nil), + (*RowFilter_Condition_)(nil), + (*RowFilter_Sink)(nil), + (*RowFilter_PassAllFilter)(nil), + (*RowFilter_BlockAllFilter)(nil), + (*RowFilter_RowKeyRegexFilter)(nil), + (*RowFilter_RowSampleFilter)(nil), + (*RowFilter_FamilyNameRegexFilter)(nil), + (*RowFilter_ColumnQualifierRegexFilter)(nil), + (*RowFilter_ColumnRangeFilter)(nil), + (*RowFilter_TimestampRangeFilter)(nil), + (*RowFilter_ValueRegexFilter)(nil), + (*RowFilter_ValueRangeFilter)(nil), + (*RowFilter_CellsPerRowOffsetFilter)(nil), + (*RowFilter_CellsPerRowLimitFilter)(nil), + (*RowFilter_CellsPerColumnLimitFilter)(nil), + (*RowFilter_StripValueTransformer)(nil), + (*RowFilter_ApplyLabelTransformer)(nil), + } +} + +func _RowFilter_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*RowFilter) + // filter + switch x := m.Filter.(type) { + case *RowFilter_Chain_: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Chain); err != nil { + return err + } + case *RowFilter_Interleave_: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Interleave); err != nil { + return err + } + case *RowFilter_Condition_: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Condition); err != nil { + return err + } + case *RowFilter_Sink: + t := uint64(0) + if x.Sink { + t = 1 + } + b.EncodeVarint(16<<3 | proto.WireVarint) + b.EncodeVarint(t) + case *RowFilter_PassAllFilter: + t := uint64(0) + if x.PassAllFilter { + t = 1 + } + b.EncodeVarint(17<<3 | proto.WireVarint) + b.EncodeVarint(t) + case *RowFilter_BlockAllFilter: + t := uint64(0) + if x.BlockAllFilter { + t = 1 + } + b.EncodeVarint(18<<3 | proto.WireVarint) + b.EncodeVarint(t) + case *RowFilter_RowKeyRegexFilter: + b.EncodeVarint(4<<3 | proto.WireBytes) + b.EncodeRawBytes(x.RowKeyRegexFilter) + case *RowFilter_RowSampleFilter: + b.EncodeVarint(14<<3 | proto.WireFixed64) + b.EncodeFixed64(math.Float64bits(x.RowSampleFilter)) + case *RowFilter_FamilyNameRegexFilter: + b.EncodeVarint(5<<3 | proto.WireBytes) + b.EncodeStringBytes(x.FamilyNameRegexFilter) + case *RowFilter_ColumnQualifierRegexFilter: + b.EncodeVarint(6<<3 | proto.WireBytes) + b.EncodeRawBytes(x.ColumnQualifierRegexFilter) + case *RowFilter_ColumnRangeFilter: + b.EncodeVarint(7<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ColumnRangeFilter); err != nil { + return err + } + case *RowFilter_TimestampRangeFilter: + b.EncodeVarint(8<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.TimestampRangeFilter); err != nil { + return err + } + case *RowFilter_ValueRegexFilter: + b.EncodeVarint(9<<3 | proto.WireBytes) + b.EncodeRawBytes(x.ValueRegexFilter) + case *RowFilter_ValueRangeFilter: + b.EncodeVarint(15<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ValueRangeFilter); err != nil { + return err + } + case *RowFilter_CellsPerRowOffsetFilter: + b.EncodeVarint(10<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.CellsPerRowOffsetFilter)) + case *RowFilter_CellsPerRowLimitFilter: + b.EncodeVarint(11<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.CellsPerRowLimitFilter)) + case *RowFilter_CellsPerColumnLimitFilter: + b.EncodeVarint(12<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.CellsPerColumnLimitFilter)) + case *RowFilter_StripValueTransformer: + t := uint64(0) + if x.StripValueTransformer { + t = 1 + } + b.EncodeVarint(13<<3 | proto.WireVarint) + b.EncodeVarint(t) + case *RowFilter_ApplyLabelTransformer: + b.EncodeVarint(19<<3 | proto.WireBytes) + b.EncodeStringBytes(x.ApplyLabelTransformer) + case nil: + default: + return fmt.Errorf("RowFilter.Filter has unexpected type %T", x) + } + return nil +} + +func _RowFilter_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*RowFilter) + switch tag { + case 1: // filter.chain + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(RowFilter_Chain) + err := b.DecodeMessage(msg) + m.Filter = &RowFilter_Chain_{msg} + return true, err + case 2: // filter.interleave + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(RowFilter_Interleave) + err := b.DecodeMessage(msg) + m.Filter = &RowFilter_Interleave_{msg} + return true, err + case 3: // filter.condition + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(RowFilter_Condition) + err := b.DecodeMessage(msg) + m.Filter = &RowFilter_Condition_{msg} + return true, err + case 16: // filter.sink + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Filter = &RowFilter_Sink{x != 0} + return true, err + case 17: // filter.pass_all_filter + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Filter = &RowFilter_PassAllFilter{x != 0} + return true, err + case 18: // filter.block_all_filter + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Filter = &RowFilter_BlockAllFilter{x != 0} + return true, err + case 4: // filter.row_key_regex_filter + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.Filter = &RowFilter_RowKeyRegexFilter{x} + return true, err + case 14: // filter.row_sample_filter + if wire != proto.WireFixed64 { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeFixed64() + m.Filter = &RowFilter_RowSampleFilter{math.Float64frombits(x)} + return true, err + case 5: // filter.family_name_regex_filter + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Filter = &RowFilter_FamilyNameRegexFilter{x} + return true, err + case 6: // filter.column_qualifier_regex_filter + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.Filter = &RowFilter_ColumnQualifierRegexFilter{x} + return true, err + case 7: // filter.column_range_filter + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ColumnRange) + err := b.DecodeMessage(msg) + m.Filter = &RowFilter_ColumnRangeFilter{msg} + return true, err + case 8: // filter.timestamp_range_filter + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(TimestampRange) + err := b.DecodeMessage(msg) + m.Filter = &RowFilter_TimestampRangeFilter{msg} + return true, err + case 9: // filter.value_regex_filter + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.Filter = &RowFilter_ValueRegexFilter{x} + return true, err + case 15: // filter.value_range_filter + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ValueRange) + err := b.DecodeMessage(msg) + m.Filter = &RowFilter_ValueRangeFilter{msg} + return true, err + case 10: // filter.cells_per_row_offset_filter + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Filter = &RowFilter_CellsPerRowOffsetFilter{int32(x)} + return true, err + case 11: // filter.cells_per_row_limit_filter + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Filter = &RowFilter_CellsPerRowLimitFilter{int32(x)} + return true, err + case 12: // filter.cells_per_column_limit_filter + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Filter = &RowFilter_CellsPerColumnLimitFilter{int32(x)} + return true, err + case 13: // filter.strip_value_transformer + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Filter = &RowFilter_StripValueTransformer{x != 0} + return true, err + case 19: // filter.apply_label_transformer + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Filter = &RowFilter_ApplyLabelTransformer{x} + return true, err + default: + return false, nil + } +} + +func _RowFilter_OneofSizer(msg proto.Message) (n int) { + m := msg.(*RowFilter) + // filter + switch x := m.Filter.(type) { + case *RowFilter_Chain_: + s := proto.Size(x.Chain) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *RowFilter_Interleave_: + s := proto.Size(x.Interleave) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *RowFilter_Condition_: + s := proto.Size(x.Condition) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *RowFilter_Sink: + n += proto.SizeVarint(16<<3 | proto.WireVarint) + n += 1 + case *RowFilter_PassAllFilter: + n += proto.SizeVarint(17<<3 | proto.WireVarint) + n += 1 + case *RowFilter_BlockAllFilter: + n += proto.SizeVarint(18<<3 | proto.WireVarint) + n += 1 + case *RowFilter_RowKeyRegexFilter: + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.RowKeyRegexFilter))) + n += len(x.RowKeyRegexFilter) + case *RowFilter_RowSampleFilter: + n += proto.SizeVarint(14<<3 | proto.WireFixed64) + n += 8 + case *RowFilter_FamilyNameRegexFilter: + n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.FamilyNameRegexFilter))) + n += len(x.FamilyNameRegexFilter) + case *RowFilter_ColumnQualifierRegexFilter: + n += proto.SizeVarint(6<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.ColumnQualifierRegexFilter))) + n += len(x.ColumnQualifierRegexFilter) + case *RowFilter_ColumnRangeFilter: + s := proto.Size(x.ColumnRangeFilter) + n += proto.SizeVarint(7<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *RowFilter_TimestampRangeFilter: + s := proto.Size(x.TimestampRangeFilter) + n += proto.SizeVarint(8<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *RowFilter_ValueRegexFilter: + n += proto.SizeVarint(9<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.ValueRegexFilter))) + n += len(x.ValueRegexFilter) + case *RowFilter_ValueRangeFilter: + s := proto.Size(x.ValueRangeFilter) + n += proto.SizeVarint(15<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *RowFilter_CellsPerRowOffsetFilter: + n += proto.SizeVarint(10<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.CellsPerRowOffsetFilter)) + case *RowFilter_CellsPerRowLimitFilter: + n += proto.SizeVarint(11<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.CellsPerRowLimitFilter)) + case *RowFilter_CellsPerColumnLimitFilter: + n += proto.SizeVarint(12<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.CellsPerColumnLimitFilter)) + case *RowFilter_StripValueTransformer: + n += proto.SizeVarint(13<<3 | proto.WireVarint) + n += 1 + case *RowFilter_ApplyLabelTransformer: + n += proto.SizeVarint(19<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.ApplyLabelTransformer))) + n += len(x.ApplyLabelTransformer) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// A RowFilter which sends rows through several RowFilters in sequence. +type RowFilter_Chain struct { + // The elements of "filters" are chained together to process the input row: + // in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row + // The full chain is executed atomically. + Filters []*RowFilter `protobuf:"bytes,1,rep,name=filters" json:"filters,omitempty"` +} + +func (m *RowFilter_Chain) Reset() { *m = RowFilter_Chain{} } +func (m *RowFilter_Chain) String() string { return proto.CompactTextString(m) } +func (*RowFilter_Chain) ProtoMessage() {} +func (*RowFilter_Chain) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{9, 0} } + +func (m *RowFilter_Chain) GetFilters() []*RowFilter { + if m != nil { + return m.Filters + } + return nil +} + +// A RowFilter which sends each row to each of several component +// RowFilters and interleaves the results. +type RowFilter_Interleave struct { + // The elements of "filters" all process a copy of the input row, and the + // results are pooled, sorted, and combined into a single output row. + // If multiple cells are produced with the same column and timestamp, + // they will all appear in the output row in an unspecified mutual order. + // Consider the following example, with three filters: + // + // input row + // | + // ----------------------------------------------------- + // | | | + // f(0) f(1) f(2) + // | | | + // 1: foo,bar,10,x foo,bar,10,z far,bar,7,a + // 2: foo,blah,11,z far,blah,5,x far,blah,5,x + // | | | + // ----------------------------------------------------- + // | + // 1: foo,bar,10,z // could have switched with #2 + // 2: foo,bar,10,x // could have switched with #1 + // 3: foo,blah,11,z + // 4: far,bar,7,a + // 5: far,blah,5,x // identical to #6 + // 6: far,blah,5,x // identical to #5 + // + // All interleaved filters are executed atomically. + Filters []*RowFilter `protobuf:"bytes,1,rep,name=filters" json:"filters,omitempty"` +} + +func (m *RowFilter_Interleave) Reset() { *m = RowFilter_Interleave{} } +func (m *RowFilter_Interleave) String() string { return proto.CompactTextString(m) } +func (*RowFilter_Interleave) ProtoMessage() {} +func (*RowFilter_Interleave) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{9, 1} } + +func (m *RowFilter_Interleave) GetFilters() []*RowFilter { + if m != nil { + return m.Filters + } + return nil +} + +// A RowFilter which evaluates one of two possible RowFilters, depending on +// whether or not a predicate RowFilter outputs any cells from the input row. +// +// IMPORTANT NOTE: The predicate filter does not execute atomically with the +// true and false filters, which may lead to inconsistent or unexpected +// results. Additionally, Condition filters have poor performance, especially +// when filters are set for the false condition. +type RowFilter_Condition struct { + // If `predicate_filter` outputs any cells, then `true_filter` will be + // evaluated on the input row. Otherwise, `false_filter` will be evaluated. + PredicateFilter *RowFilter `protobuf:"bytes,1,opt,name=predicate_filter,json=predicateFilter" json:"predicate_filter,omitempty"` + // The filter to apply to the input row if `predicate_filter` returns any + // results. If not provided, no results will be returned in the true case. + TrueFilter *RowFilter `protobuf:"bytes,2,opt,name=true_filter,json=trueFilter" json:"true_filter,omitempty"` + // The filter to apply to the input row if `predicate_filter` does not + // return any results. If not provided, no results will be returned in the + // false case. + FalseFilter *RowFilter `protobuf:"bytes,3,opt,name=false_filter,json=falseFilter" json:"false_filter,omitempty"` +} + +func (m *RowFilter_Condition) Reset() { *m = RowFilter_Condition{} } +func (m *RowFilter_Condition) String() string { return proto.CompactTextString(m) } +func (*RowFilter_Condition) ProtoMessage() {} +func (*RowFilter_Condition) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{9, 2} } + +func (m *RowFilter_Condition) GetPredicateFilter() *RowFilter { + if m != nil { + return m.PredicateFilter + } + return nil +} + +func (m *RowFilter_Condition) GetTrueFilter() *RowFilter { + if m != nil { + return m.TrueFilter + } + return nil +} + +func (m *RowFilter_Condition) GetFalseFilter() *RowFilter { + if m != nil { + return m.FalseFilter + } + return nil +} + +// Specifies a particular change to be made to the contents of a row. +type Mutation struct { + // Which of the possible Mutation types to apply. + // + // Types that are valid to be assigned to Mutation: + // *Mutation_SetCell_ + // *Mutation_DeleteFromColumn_ + // *Mutation_DeleteFromFamily_ + // *Mutation_DeleteFromRow_ + Mutation isMutation_Mutation `protobuf_oneof:"mutation"` +} + +func (m *Mutation) Reset() { *m = Mutation{} } +func (m *Mutation) String() string { return proto.CompactTextString(m) } +func (*Mutation) ProtoMessage() {} +func (*Mutation) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{10} } + +type isMutation_Mutation interface { + isMutation_Mutation() +} + +type Mutation_SetCell_ struct { + SetCell *Mutation_SetCell `protobuf:"bytes,1,opt,name=set_cell,json=setCell,oneof"` +} +type Mutation_DeleteFromColumn_ struct { + DeleteFromColumn *Mutation_DeleteFromColumn `protobuf:"bytes,2,opt,name=delete_from_column,json=deleteFromColumn,oneof"` +} +type Mutation_DeleteFromFamily_ struct { + DeleteFromFamily *Mutation_DeleteFromFamily `protobuf:"bytes,3,opt,name=delete_from_family,json=deleteFromFamily,oneof"` +} +type Mutation_DeleteFromRow_ struct { + DeleteFromRow *Mutation_DeleteFromRow `protobuf:"bytes,4,opt,name=delete_from_row,json=deleteFromRow,oneof"` +} + +func (*Mutation_SetCell_) isMutation_Mutation() {} +func (*Mutation_DeleteFromColumn_) isMutation_Mutation() {} +func (*Mutation_DeleteFromFamily_) isMutation_Mutation() {} +func (*Mutation_DeleteFromRow_) isMutation_Mutation() {} + +func (m *Mutation) GetMutation() isMutation_Mutation { + if m != nil { + return m.Mutation + } + return nil +} + +func (m *Mutation) GetSetCell() *Mutation_SetCell { + if x, ok := m.GetMutation().(*Mutation_SetCell_); ok { + return x.SetCell + } + return nil +} + +func (m *Mutation) GetDeleteFromColumn() *Mutation_DeleteFromColumn { + if x, ok := m.GetMutation().(*Mutation_DeleteFromColumn_); ok { + return x.DeleteFromColumn + } + return nil +} + +func (m *Mutation) GetDeleteFromFamily() *Mutation_DeleteFromFamily { + if x, ok := m.GetMutation().(*Mutation_DeleteFromFamily_); ok { + return x.DeleteFromFamily + } + return nil +} + +func (m *Mutation) GetDeleteFromRow() *Mutation_DeleteFromRow { + if x, ok := m.GetMutation().(*Mutation_DeleteFromRow_); ok { + return x.DeleteFromRow + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Mutation) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _Mutation_OneofMarshaler, _Mutation_OneofUnmarshaler, _Mutation_OneofSizer, []interface{}{ + (*Mutation_SetCell_)(nil), + (*Mutation_DeleteFromColumn_)(nil), + (*Mutation_DeleteFromFamily_)(nil), + (*Mutation_DeleteFromRow_)(nil), + } +} + +func _Mutation_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Mutation) + // mutation + switch x := m.Mutation.(type) { + case *Mutation_SetCell_: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.SetCell); err != nil { + return err + } + case *Mutation_DeleteFromColumn_: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.DeleteFromColumn); err != nil { + return err + } + case *Mutation_DeleteFromFamily_: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.DeleteFromFamily); err != nil { + return err + } + case *Mutation_DeleteFromRow_: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.DeleteFromRow); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("Mutation.Mutation has unexpected type %T", x) + } + return nil +} + +func _Mutation_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Mutation) + switch tag { + case 1: // mutation.set_cell + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Mutation_SetCell) + err := b.DecodeMessage(msg) + m.Mutation = &Mutation_SetCell_{msg} + return true, err + case 2: // mutation.delete_from_column + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Mutation_DeleteFromColumn) + err := b.DecodeMessage(msg) + m.Mutation = &Mutation_DeleteFromColumn_{msg} + return true, err + case 3: // mutation.delete_from_family + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Mutation_DeleteFromFamily) + err := b.DecodeMessage(msg) + m.Mutation = &Mutation_DeleteFromFamily_{msg} + return true, err + case 4: // mutation.delete_from_row + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Mutation_DeleteFromRow) + err := b.DecodeMessage(msg) + m.Mutation = &Mutation_DeleteFromRow_{msg} + return true, err + default: + return false, nil + } +} + +func _Mutation_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Mutation) + // mutation + switch x := m.Mutation.(type) { + case *Mutation_SetCell_: + s := proto.Size(x.SetCell) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Mutation_DeleteFromColumn_: + s := proto.Size(x.DeleteFromColumn) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Mutation_DeleteFromFamily_: + s := proto.Size(x.DeleteFromFamily) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Mutation_DeleteFromRow_: + s := proto.Size(x.DeleteFromRow) + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// A Mutation which sets the value of the specified cell. +type Mutation_SetCell struct { + // The name of the family into which new data should be written. + // Must match `[-_.a-zA-Z0-9]+` + FamilyName string `protobuf:"bytes,1,opt,name=family_name,json=familyName" json:"family_name,omitempty"` + // The qualifier of the column into which new data should be written. + // Can be any byte string, including the empty string. + ColumnQualifier []byte `protobuf:"bytes,2,opt,name=column_qualifier,json=columnQualifier,proto3" json:"column_qualifier,omitempty"` + // The timestamp of the cell into which new data should be written. + // Use -1 for current Bigtable server time. + // Otherwise, the client should set this value itself, noting that the + // default value is a timestamp of zero if the field is left unspecified. + // Values must match the granularity of the table (e.g. micros, millis). + TimestampMicros int64 `protobuf:"varint,3,opt,name=timestamp_micros,json=timestampMicros" json:"timestamp_micros,omitempty"` + // The value to be written into the specified cell. + Value []byte `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` +} + +func (m *Mutation_SetCell) Reset() { *m = Mutation_SetCell{} } +func (m *Mutation_SetCell) String() string { return proto.CompactTextString(m) } +func (*Mutation_SetCell) ProtoMessage() {} +func (*Mutation_SetCell) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{10, 0} } + +func (m *Mutation_SetCell) GetFamilyName() string { + if m != nil { + return m.FamilyName + } + return "" +} + +func (m *Mutation_SetCell) GetColumnQualifier() []byte { + if m != nil { + return m.ColumnQualifier + } + return nil +} + +func (m *Mutation_SetCell) GetTimestampMicros() int64 { + if m != nil { + return m.TimestampMicros + } + return 0 +} + +func (m *Mutation_SetCell) GetValue() []byte { + if m != nil { + return m.Value + } + return nil +} + +// A Mutation which deletes cells from the specified column, optionally +// restricting the deletions to a given timestamp range. +type Mutation_DeleteFromColumn struct { + // The name of the family from which cells should be deleted. + // Must match `[-_.a-zA-Z0-9]+` + FamilyName string `protobuf:"bytes,1,opt,name=family_name,json=familyName" json:"family_name,omitempty"` + // The qualifier of the column from which cells should be deleted. + // Can be any byte string, including the empty string. + ColumnQualifier []byte `protobuf:"bytes,2,opt,name=column_qualifier,json=columnQualifier,proto3" json:"column_qualifier,omitempty"` + // The range of timestamps within which cells should be deleted. + TimeRange *TimestampRange `protobuf:"bytes,3,opt,name=time_range,json=timeRange" json:"time_range,omitempty"` +} + +func (m *Mutation_DeleteFromColumn) Reset() { *m = Mutation_DeleteFromColumn{} } +func (m *Mutation_DeleteFromColumn) String() string { return proto.CompactTextString(m) } +func (*Mutation_DeleteFromColumn) ProtoMessage() {} +func (*Mutation_DeleteFromColumn) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{10, 1} } + +func (m *Mutation_DeleteFromColumn) GetFamilyName() string { + if m != nil { + return m.FamilyName + } + return "" +} + +func (m *Mutation_DeleteFromColumn) GetColumnQualifier() []byte { + if m != nil { + return m.ColumnQualifier + } + return nil +} + +func (m *Mutation_DeleteFromColumn) GetTimeRange() *TimestampRange { + if m != nil { + return m.TimeRange + } + return nil +} + +// A Mutation which deletes all cells from the specified column family. +type Mutation_DeleteFromFamily struct { + // The name of the family from which cells should be deleted. + // Must match `[-_.a-zA-Z0-9]+` + FamilyName string `protobuf:"bytes,1,opt,name=family_name,json=familyName" json:"family_name,omitempty"` +} + +func (m *Mutation_DeleteFromFamily) Reset() { *m = Mutation_DeleteFromFamily{} } +func (m *Mutation_DeleteFromFamily) String() string { return proto.CompactTextString(m) } +func (*Mutation_DeleteFromFamily) ProtoMessage() {} +func (*Mutation_DeleteFromFamily) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{10, 2} } + +func (m *Mutation_DeleteFromFamily) GetFamilyName() string { + if m != nil { + return m.FamilyName + } + return "" +} + +// A Mutation which deletes all cells from the containing row. +type Mutation_DeleteFromRow struct { +} + +func (m *Mutation_DeleteFromRow) Reset() { *m = Mutation_DeleteFromRow{} } +func (m *Mutation_DeleteFromRow) String() string { return proto.CompactTextString(m) } +func (*Mutation_DeleteFromRow) ProtoMessage() {} +func (*Mutation_DeleteFromRow) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{10, 3} } + +// Specifies an atomic read/modify/write operation on the latest value of the +// specified column. +type ReadModifyWriteRule struct { + // The name of the family to which the read/modify/write should be applied. + // Must match `[-_.a-zA-Z0-9]+` + FamilyName string `protobuf:"bytes,1,opt,name=family_name,json=familyName" json:"family_name,omitempty"` + // The qualifier of the column to which the read/modify/write should be + // applied. + // Can be any byte string, including the empty string. + ColumnQualifier []byte `protobuf:"bytes,2,opt,name=column_qualifier,json=columnQualifier,proto3" json:"column_qualifier,omitempty"` + // The rule used to determine the column's new latest value from its current + // latest value. + // + // Types that are valid to be assigned to Rule: + // *ReadModifyWriteRule_AppendValue + // *ReadModifyWriteRule_IncrementAmount + Rule isReadModifyWriteRule_Rule `protobuf_oneof:"rule"` +} + +func (m *ReadModifyWriteRule) Reset() { *m = ReadModifyWriteRule{} } +func (m *ReadModifyWriteRule) String() string { return proto.CompactTextString(m) } +func (*ReadModifyWriteRule) ProtoMessage() {} +func (*ReadModifyWriteRule) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{11} } + +type isReadModifyWriteRule_Rule interface { + isReadModifyWriteRule_Rule() +} + +type ReadModifyWriteRule_AppendValue struct { + AppendValue []byte `protobuf:"bytes,3,opt,name=append_value,json=appendValue,proto3,oneof"` +} +type ReadModifyWriteRule_IncrementAmount struct { + IncrementAmount int64 `protobuf:"varint,4,opt,name=increment_amount,json=incrementAmount,oneof"` +} + +func (*ReadModifyWriteRule_AppendValue) isReadModifyWriteRule_Rule() {} +func (*ReadModifyWriteRule_IncrementAmount) isReadModifyWriteRule_Rule() {} + +func (m *ReadModifyWriteRule) GetRule() isReadModifyWriteRule_Rule { + if m != nil { + return m.Rule + } + return nil +} + +func (m *ReadModifyWriteRule) GetFamilyName() string { + if m != nil { + return m.FamilyName + } + return "" +} + +func (m *ReadModifyWriteRule) GetColumnQualifier() []byte { + if m != nil { + return m.ColumnQualifier + } + return nil +} + +func (m *ReadModifyWriteRule) GetAppendValue() []byte { + if x, ok := m.GetRule().(*ReadModifyWriteRule_AppendValue); ok { + return x.AppendValue + } + return nil +} + +func (m *ReadModifyWriteRule) GetIncrementAmount() int64 { + if x, ok := m.GetRule().(*ReadModifyWriteRule_IncrementAmount); ok { + return x.IncrementAmount + } + return 0 +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*ReadModifyWriteRule) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _ReadModifyWriteRule_OneofMarshaler, _ReadModifyWriteRule_OneofUnmarshaler, _ReadModifyWriteRule_OneofSizer, []interface{}{ + (*ReadModifyWriteRule_AppendValue)(nil), + (*ReadModifyWriteRule_IncrementAmount)(nil), + } +} + +func _ReadModifyWriteRule_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*ReadModifyWriteRule) + // rule + switch x := m.Rule.(type) { + case *ReadModifyWriteRule_AppendValue: + b.EncodeVarint(3<<3 | proto.WireBytes) + b.EncodeRawBytes(x.AppendValue) + case *ReadModifyWriteRule_IncrementAmount: + b.EncodeVarint(4<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.IncrementAmount)) + case nil: + default: + return fmt.Errorf("ReadModifyWriteRule.Rule has unexpected type %T", x) + } + return nil +} + +func _ReadModifyWriteRule_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*ReadModifyWriteRule) + switch tag { + case 3: // rule.append_value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.Rule = &ReadModifyWriteRule_AppendValue{x} + return true, err + case 4: // rule.increment_amount + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Rule = &ReadModifyWriteRule_IncrementAmount{int64(x)} + return true, err + default: + return false, nil + } +} + +func _ReadModifyWriteRule_OneofSizer(msg proto.Message) (n int) { + m := msg.(*ReadModifyWriteRule) + // rule + switch x := m.Rule.(type) { + case *ReadModifyWriteRule_AppendValue: + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.AppendValue))) + n += len(x.AppendValue) + case *ReadModifyWriteRule_IncrementAmount: + n += proto.SizeVarint(4<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.IncrementAmount)) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +func init() { + proto.RegisterType((*Row)(nil), "google.bigtable.v2.Row") + proto.RegisterType((*Family)(nil), "google.bigtable.v2.Family") + proto.RegisterType((*Column)(nil), "google.bigtable.v2.Column") + proto.RegisterType((*Cell)(nil), "google.bigtable.v2.Cell") + proto.RegisterType((*RowRange)(nil), "google.bigtable.v2.RowRange") + proto.RegisterType((*RowSet)(nil), "google.bigtable.v2.RowSet") + proto.RegisterType((*ColumnRange)(nil), "google.bigtable.v2.ColumnRange") + proto.RegisterType((*TimestampRange)(nil), "google.bigtable.v2.TimestampRange") + proto.RegisterType((*ValueRange)(nil), "google.bigtable.v2.ValueRange") + proto.RegisterType((*RowFilter)(nil), "google.bigtable.v2.RowFilter") + proto.RegisterType((*RowFilter_Chain)(nil), "google.bigtable.v2.RowFilter.Chain") + proto.RegisterType((*RowFilter_Interleave)(nil), "google.bigtable.v2.RowFilter.Interleave") + proto.RegisterType((*RowFilter_Condition)(nil), "google.bigtable.v2.RowFilter.Condition") + proto.RegisterType((*Mutation)(nil), "google.bigtable.v2.Mutation") + proto.RegisterType((*Mutation_SetCell)(nil), "google.bigtable.v2.Mutation.SetCell") + proto.RegisterType((*Mutation_DeleteFromColumn)(nil), "google.bigtable.v2.Mutation.DeleteFromColumn") + proto.RegisterType((*Mutation_DeleteFromFamily)(nil), "google.bigtable.v2.Mutation.DeleteFromFamily") + proto.RegisterType((*Mutation_DeleteFromRow)(nil), "google.bigtable.v2.Mutation.DeleteFromRow") + proto.RegisterType((*ReadModifyWriteRule)(nil), "google.bigtable.v2.ReadModifyWriteRule") +} + +func init() { proto.RegisterFile("google/bigtable/v2/data.proto", fileDescriptor1) } + +var fileDescriptor1 = []byte{ + // 1444 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xdb, 0x72, 0x1b, 0x45, + 0x13, 0xd6, 0x5a, 0xb6, 0x2c, 0xf5, 0xca, 0x96, 0x32, 0x71, 0x1c, 0x45, 0x7f, 0xfc, 0xc7, 0xa5, + 0x50, 0x41, 0x31, 0x20, 0x83, 0x92, 0x0a, 0x87, 0x50, 0x54, 0x2c, 0x87, 0x44, 0x90, 0xf3, 0xc4, + 0x65, 0xaa, 0x52, 0xa1, 0x96, 0xb1, 0x34, 0x12, 0x5b, 0x9e, 0xdd, 0x59, 0x76, 0x57, 0x56, 0xf4, + 0x22, 0x70, 0x0d, 0x97, 0xbc, 0x02, 0x77, 0x5c, 0xf2, 0x02, 0xf0, 0x18, 0x3c, 0x00, 0x17, 0xd4, + 0x9c, 0xf6, 0xa0, 0x38, 0xb6, 0x8b, 0xca, 0xdd, 0x6e, 0xf7, 0xf7, 0x7d, 0xdd, 0xd3, 0xd3, 0xd3, + 0x3b, 0x0b, 0x1b, 0x63, 0xce, 0xc7, 0x8c, 0x6e, 0x1f, 0xb8, 0xe3, 0x98, 0x1c, 0x30, 0xba, 0x7d, + 0xd4, 0xdd, 0x1e, 0x92, 0x98, 0x74, 0x82, 0x90, 0xc7, 0x1c, 0x21, 0xe5, 0xee, 0x18, 0x77, 0xe7, + 0xa8, 0xdb, 0x7a, 0x02, 0x45, 0xcc, 0xa7, 0xa8, 0x0e, 0xc5, 0x43, 0x3a, 0x6b, 0x58, 0x9b, 0x56, + 0xbb, 0x8a, 0xc5, 0x23, 0xba, 0x05, 0xe5, 0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e, 0xf7, 0xa0, 0x24, 0xc5, 0x6f, 0xfc, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x05, 0xf7, 0x92, 0x43, + 0x84, 0x0f, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/bytestream/bytestream.pb.go b/vendor/google.golang.org/genproto/googleapis/bytestream/bytestream.pb.go new file mode 100644 index 0000000000..8014948035 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/bytestream/bytestream.pb.go @@ -0,0 +1,555 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/bytestream/bytestream.proto + +/* +Package bytestream is a generated protocol buffer package. + +It is generated from these files: + google/bytestream/bytestream.proto + +It has these top-level messages: + ReadRequest + ReadResponse + WriteRequest + WriteResponse + QueryWriteStatusRequest + QueryWriteStatusResponse +*/ +package bytestream + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import _ "github.com/golang/protobuf/ptypes/wrappers" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Request object for ByteStream.Read. +type ReadRequest struct { + // The name of the resource to read. + ResourceName string `protobuf:"bytes,1,opt,name=resource_name,json=resourceName" json:"resource_name,omitempty"` + // The offset for the first byte to return in the read, relative to the start + // of the resource. + // + // A `read_offset` that is negative or greater than the size of the resource + // will cause an `OUT_OF_RANGE` error. + ReadOffset int64 `protobuf:"varint,2,opt,name=read_offset,json=readOffset" json:"read_offset,omitempty"` + // The maximum number of `data` bytes the server is allowed to return in the + // sum of all `ReadResponse` messages. A `read_limit` of zero indicates that + // there is no limit, and a negative `read_limit` will cause an error. + // + // If the stream returns fewer bytes than allowed by the `read_limit` and no + // error occurred, the stream includes all data from the `read_offset` to the + // end of the resource. + ReadLimit int64 `protobuf:"varint,3,opt,name=read_limit,json=readLimit" json:"read_limit,omitempty"` +} + +func (m *ReadRequest) Reset() { *m = ReadRequest{} } +func (m *ReadRequest) String() string { return proto.CompactTextString(m) } +func (*ReadRequest) ProtoMessage() {} +func (*ReadRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *ReadRequest) GetResourceName() string { + if m != nil { + return m.ResourceName + } + return "" +} + +func (m *ReadRequest) GetReadOffset() int64 { + if m != nil { + return m.ReadOffset + } + return 0 +} + +func (m *ReadRequest) GetReadLimit() int64 { + if m != nil { + return m.ReadLimit + } + return 0 +} + +// Response object for ByteStream.Read. +type ReadResponse struct { + // A portion of the data for the resource. The service **may** leave `data` + // empty for any given `ReadResponse`. This enables the service to inform the + // client that the request is still live while it is running an operation to + // generate more data. + Data []byte `protobuf:"bytes,10,opt,name=data,proto3" json:"data,omitempty"` +} + +func (m *ReadResponse) Reset() { *m = ReadResponse{} } +func (m *ReadResponse) String() string { return proto.CompactTextString(m) } +func (*ReadResponse) ProtoMessage() {} +func (*ReadResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *ReadResponse) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +// Request object for ByteStream.Write. +type WriteRequest struct { + // The name of the resource to write. This **must** be set on the first + // `WriteRequest` of each `Write()` action. If it is set on subsequent calls, + // it **must** match the value of the first request. + ResourceName string `protobuf:"bytes,1,opt,name=resource_name,json=resourceName" json:"resource_name,omitempty"` + // The offset from the beginning of the resource at which the data should be + // written. It is required on all `WriteRequest`s. + // + // In the first `WriteRequest` of a `Write()` action, it indicates + // the initial offset for the `Write()` call. The value **must** be equal to + // the `committed_size` that a call to `QueryWriteStatus()` would return. + // + // On subsequent calls, this value **must** be set and **must** be equal to + // the sum of the first `write_offset` and the sizes of all `data` bundles + // sent previously on this stream. + // + // An incorrect value will cause an error. + WriteOffset int64 `protobuf:"varint,2,opt,name=write_offset,json=writeOffset" json:"write_offset,omitempty"` + // If `true`, this indicates that the write is complete. Sending any + // `WriteRequest`s subsequent to one in which `finish_write` is `true` will + // cause an error. + FinishWrite bool `protobuf:"varint,3,opt,name=finish_write,json=finishWrite" json:"finish_write,omitempty"` + // A portion of the data for the resource. The client **may** leave `data` + // empty for any given `WriteRequest`. This enables the client to inform the + // service that the request is still live while it is running an operation to + // generate more data. + Data []byte `protobuf:"bytes,10,opt,name=data,proto3" json:"data,omitempty"` +} + +func (m *WriteRequest) Reset() { *m = WriteRequest{} } +func (m *WriteRequest) String() string { return proto.CompactTextString(m) } +func (*WriteRequest) ProtoMessage() {} +func (*WriteRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *WriteRequest) GetResourceName() string { + if m != nil { + return m.ResourceName + } + return "" +} + +func (m *WriteRequest) GetWriteOffset() int64 { + if m != nil { + return m.WriteOffset + } + return 0 +} + +func (m *WriteRequest) GetFinishWrite() bool { + if m != nil { + return m.FinishWrite + } + return false +} + +func (m *WriteRequest) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +// Response object for ByteStream.Write. +type WriteResponse struct { + // The number of bytes that have been processed for the given resource. + CommittedSize int64 `protobuf:"varint,1,opt,name=committed_size,json=committedSize" json:"committed_size,omitempty"` +} + +func (m *WriteResponse) Reset() { *m = WriteResponse{} } +func (m *WriteResponse) String() string { return proto.CompactTextString(m) } +func (*WriteResponse) ProtoMessage() {} +func (*WriteResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *WriteResponse) GetCommittedSize() int64 { + if m != nil { + return m.CommittedSize + } + return 0 +} + +// Request object for ByteStream.QueryWriteStatus. +type QueryWriteStatusRequest struct { + // The name of the resource whose write status is being requested. + ResourceName string `protobuf:"bytes,1,opt,name=resource_name,json=resourceName" json:"resource_name,omitempty"` +} + +func (m *QueryWriteStatusRequest) Reset() { *m = QueryWriteStatusRequest{} } +func (m *QueryWriteStatusRequest) String() string { return proto.CompactTextString(m) } +func (*QueryWriteStatusRequest) ProtoMessage() {} +func (*QueryWriteStatusRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *QueryWriteStatusRequest) GetResourceName() string { + if m != nil { + return m.ResourceName + } + return "" +} + +// Response object for ByteStream.QueryWriteStatus. +type QueryWriteStatusResponse struct { + // The number of bytes that have been processed for the given resource. + CommittedSize int64 `protobuf:"varint,1,opt,name=committed_size,json=committedSize" json:"committed_size,omitempty"` + // `complete` is `true` only if the client has sent a `WriteRequest` with + // `finish_write` set to true, and the server has processed that request. + Complete bool `protobuf:"varint,2,opt,name=complete" json:"complete,omitempty"` +} + +func (m *QueryWriteStatusResponse) Reset() { *m = QueryWriteStatusResponse{} } +func (m *QueryWriteStatusResponse) String() string { return proto.CompactTextString(m) } +func (*QueryWriteStatusResponse) ProtoMessage() {} +func (*QueryWriteStatusResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *QueryWriteStatusResponse) GetCommittedSize() int64 { + if m != nil { + return m.CommittedSize + } + return 0 +} + +func (m *QueryWriteStatusResponse) GetComplete() bool { + if m != nil { + return m.Complete + } + return false +} + +func init() { + proto.RegisterType((*ReadRequest)(nil), "google.bytestream.ReadRequest") + proto.RegisterType((*ReadResponse)(nil), "google.bytestream.ReadResponse") + proto.RegisterType((*WriteRequest)(nil), "google.bytestream.WriteRequest") + proto.RegisterType((*WriteResponse)(nil), "google.bytestream.WriteResponse") + proto.RegisterType((*QueryWriteStatusRequest)(nil), "google.bytestream.QueryWriteStatusRequest") + proto.RegisterType((*QueryWriteStatusResponse)(nil), "google.bytestream.QueryWriteStatusResponse") +} + +// 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 + +// Client API for ByteStream service + +type ByteStreamClient interface { + // `Read()` is used to retrieve the contents of a resource as a sequence + // of bytes. The bytes are returned in a sequence of responses, and the + // responses are delivered as the results of a server-side streaming RPC. + Read(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (ByteStream_ReadClient, error) + // `Write()` is used to send the contents of a resource as a sequence of + // bytes. The bytes are sent in a sequence of request protos of a client-side + // streaming RPC. + // + // A `Write()` action is resumable. If there is an error or the connection is + // broken during the `Write()`, the client should check the status of the + // `Write()` by calling `QueryWriteStatus()` and continue writing from the + // returned `committed_size`. This may be less than the amount of data the + // client previously sent. + // + // Calling `Write()` on a resource name that was previously written and + // finalized could cause an error, depending on whether the underlying service + // allows over-writing of previously written resources. + // + // When the client closes the request channel, the service will respond with + // a `WriteResponse`. The service will not view the resource as `complete` + // until the client has sent a `WriteRequest` with `finish_write` set to + // `true`. Sending any requests on a stream after sending a request with + // `finish_write` set to `true` will cause an error. The client **should** + // check the `WriteResponse` it receives to determine how much data the + // service was able to commit and whether the service views the resource as + // `complete` or not. + Write(ctx context.Context, opts ...grpc.CallOption) (ByteStream_WriteClient, error) + // `QueryWriteStatus()` is used to find the `committed_size` for a resource + // that is being written, which can then be used as the `write_offset` for + // the next `Write()` call. + // + // If the resource does not exist (i.e., the resource has been deleted, or the + // first `Write()` has not yet reached the service), this method returns the + // error `NOT_FOUND`. + // + // The client **may** call `QueryWriteStatus()` at any time to determine how + // much data has been processed for this resource. This is useful if the + // client is buffering data and needs to know which data can be safely + // evicted. For any sequence of `QueryWriteStatus()` calls for a given + // resource name, the sequence of returned `committed_size` values will be + // non-decreasing. + QueryWriteStatus(ctx context.Context, in *QueryWriteStatusRequest, opts ...grpc.CallOption) (*QueryWriteStatusResponse, error) +} + +type byteStreamClient struct { + cc *grpc.ClientConn +} + +func NewByteStreamClient(cc *grpc.ClientConn) ByteStreamClient { + return &byteStreamClient{cc} +} + +func (c *byteStreamClient) Read(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (ByteStream_ReadClient, error) { + stream, err := grpc.NewClientStream(ctx, &_ByteStream_serviceDesc.Streams[0], c.cc, "/google.bytestream.ByteStream/Read", opts...) + if err != nil { + return nil, err + } + x := &byteStreamReadClient{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 ByteStream_ReadClient interface { + Recv() (*ReadResponse, error) + grpc.ClientStream +} + +type byteStreamReadClient struct { + grpc.ClientStream +} + +func (x *byteStreamReadClient) Recv() (*ReadResponse, error) { + m := new(ReadResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *byteStreamClient) Write(ctx context.Context, opts ...grpc.CallOption) (ByteStream_WriteClient, error) { + stream, err := grpc.NewClientStream(ctx, &_ByteStream_serviceDesc.Streams[1], c.cc, "/google.bytestream.ByteStream/Write", opts...) + if err != nil { + return nil, err + } + x := &byteStreamWriteClient{stream} + return x, nil +} + +type ByteStream_WriteClient interface { + Send(*WriteRequest) error + CloseAndRecv() (*WriteResponse, error) + grpc.ClientStream +} + +type byteStreamWriteClient struct { + grpc.ClientStream +} + +func (x *byteStreamWriteClient) Send(m *WriteRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *byteStreamWriteClient) CloseAndRecv() (*WriteResponse, error) { + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + m := new(WriteResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *byteStreamClient) QueryWriteStatus(ctx context.Context, in *QueryWriteStatusRequest, opts ...grpc.CallOption) (*QueryWriteStatusResponse, error) { + out := new(QueryWriteStatusResponse) + err := grpc.Invoke(ctx, "/google.bytestream.ByteStream/QueryWriteStatus", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for ByteStream service + +type ByteStreamServer interface { + // `Read()` is used to retrieve the contents of a resource as a sequence + // of bytes. The bytes are returned in a sequence of responses, and the + // responses are delivered as the results of a server-side streaming RPC. + Read(*ReadRequest, ByteStream_ReadServer) error + // `Write()` is used to send the contents of a resource as a sequence of + // bytes. The bytes are sent in a sequence of request protos of a client-side + // streaming RPC. + // + // A `Write()` action is resumable. If there is an error or the connection is + // broken during the `Write()`, the client should check the status of the + // `Write()` by calling `QueryWriteStatus()` and continue writing from the + // returned `committed_size`. This may be less than the amount of data the + // client previously sent. + // + // Calling `Write()` on a resource name that was previously written and + // finalized could cause an error, depending on whether the underlying service + // allows over-writing of previously written resources. + // + // When the client closes the request channel, the service will respond with + // a `WriteResponse`. The service will not view the resource as `complete` + // until the client has sent a `WriteRequest` with `finish_write` set to + // `true`. Sending any requests on a stream after sending a request with + // `finish_write` set to `true` will cause an error. The client **should** + // check the `WriteResponse` it receives to determine how much data the + // service was able to commit and whether the service views the resource as + // `complete` or not. + Write(ByteStream_WriteServer) error + // `QueryWriteStatus()` is used to find the `committed_size` for a resource + // that is being written, which can then be used as the `write_offset` for + // the next `Write()` call. + // + // If the resource does not exist (i.e., the resource has been deleted, or the + // first `Write()` has not yet reached the service), this method returns the + // error `NOT_FOUND`. + // + // The client **may** call `QueryWriteStatus()` at any time to determine how + // much data has been processed for this resource. This is useful if the + // client is buffering data and needs to know which data can be safely + // evicted. For any sequence of `QueryWriteStatus()` calls for a given + // resource name, the sequence of returned `committed_size` values will be + // non-decreasing. + QueryWriteStatus(context.Context, *QueryWriteStatusRequest) (*QueryWriteStatusResponse, error) +} + +func RegisterByteStreamServer(s *grpc.Server, srv ByteStreamServer) { + s.RegisterService(&_ByteStream_serviceDesc, srv) +} + +func _ByteStream_Read_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(ReadRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(ByteStreamServer).Read(m, &byteStreamReadServer{stream}) +} + +type ByteStream_ReadServer interface { + Send(*ReadResponse) error + grpc.ServerStream +} + +type byteStreamReadServer struct { + grpc.ServerStream +} + +func (x *byteStreamReadServer) Send(m *ReadResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _ByteStream_Write_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(ByteStreamServer).Write(&byteStreamWriteServer{stream}) +} + +type ByteStream_WriteServer interface { + SendAndClose(*WriteResponse) error + Recv() (*WriteRequest, error) + grpc.ServerStream +} + +type byteStreamWriteServer struct { + grpc.ServerStream +} + +func (x *byteStreamWriteServer) SendAndClose(m *WriteResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *byteStreamWriteServer) Recv() (*WriteRequest, error) { + m := new(WriteRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _ByteStream_QueryWriteStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryWriteStatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ByteStreamServer).QueryWriteStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.bytestream.ByteStream/QueryWriteStatus", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ByteStreamServer).QueryWriteStatus(ctx, req.(*QueryWriteStatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _ByteStream_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.bytestream.ByteStream", + HandlerType: (*ByteStreamServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "QueryWriteStatus", + Handler: _ByteStream_QueryWriteStatus_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "Read", + Handler: _ByteStream_Read_Handler, + ServerStreams: true, + }, + { + StreamName: "Write", + Handler: _ByteStream_Write_Handler, + ClientStreams: true, + }, + }, + Metadata: "google/bytestream/bytestream.proto", +} + +func init() { proto.RegisterFile("google/bytestream/bytestream.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 446 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00,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0xfc, 0x80, 0x07, 0xff, 0xb7, 0x81, 0xbc, 0xd8, 0xe1, 0xdb, 0xd3, 0xeb, 0xf4, 0xe5, + 0xad, 0xb4, 0xa1, 0xdc, 0x04, 0xe1, 0xd1, 0x4c, 0x89, 0x6d, 0xc7, 0xe4, 0xfe, 0xa6, 0x55, 0x9f, + 0xdc, 0xf6, 0x7c, 0xbd, 0x68, 0x35, 0x95, 0x5a, 0x32, 0x59, 0xe5, 0x4a, 0x57, 0x45, 0x85, 0xd2, + 0x6f, 0x56, 0x11, 0x28, 0x56, 0x73, 0xd3, 0x59, 0xe3, 0x8b, 0xcd, 0x71, 0x7a, 0xd7, 0xeb, 0xde, + 0xfc, 0x09, 0x00, 0x00, 0xff, 0xff, 0x8f, 0x91, 0x09, 0xd4, 0xf8, 0x03, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/audit/audit_log.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/audit/audit_log.pb.go new file mode 100644 index 0000000000..33c48ea63b --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/audit/audit_log.pb.go @@ -0,0 +1,310 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/audit/audit_log.proto + +/* +Package audit is a generated protocol buffer package. + +It is generated from these files: + google/cloud/audit/audit_log.proto + +It has these top-level messages: + AuditLog + AuthenticationInfo + AuthorizationInfo + RequestMetadata +*/ +package audit + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf1 "github.com/golang/protobuf/ptypes/any" +import google_protobuf2 "github.com/golang/protobuf/ptypes/struct" +import google_rpc "google.golang.org/genproto/googleapis/rpc/status" + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Common audit log format for Google Cloud Platform API operations. +type AuditLog struct { + // The name of the API service performing the operation. For example, + // `"datastore.googleapis.com"`. + ServiceName string `protobuf:"bytes,7,opt,name=service_name,json=serviceName" json:"service_name,omitempty"` + // The name of the service method or operation. + // For API calls, this should be the name of the API method. + // For example, + // + // "google.datastore.v1.Datastore.RunQuery" + // "google.logging.v1.LoggingService.DeleteLog" + MethodName string `protobuf:"bytes,8,opt,name=method_name,json=methodName" json:"method_name,omitempty"` + // The resource or collection that is the target of the operation. + // The name is a scheme-less URI, not including the API service name. + // For example: + // + // "shelves/SHELF_ID/books" + // "shelves/SHELF_ID/books/BOOK_ID" + ResourceName string `protobuf:"bytes,11,opt,name=resource_name,json=resourceName" json:"resource_name,omitempty"` + // The number of items returned from a List or Query API method, + // if applicable. + NumResponseItems int64 `protobuf:"varint,12,opt,name=num_response_items,json=numResponseItems" json:"num_response_items,omitempty"` + // The status of the overall operation. + Status *google_rpc.Status `protobuf:"bytes,2,opt,name=status" json:"status,omitempty"` + // Authentication information. + AuthenticationInfo *AuthenticationInfo `protobuf:"bytes,3,opt,name=authentication_info,json=authenticationInfo" json:"authentication_info,omitempty"` + // Authorization information. If there are multiple + // resources or permissions involved, then there is + // one AuthorizationInfo element for each {resource, permission} tuple. + AuthorizationInfo []*AuthorizationInfo `protobuf:"bytes,9,rep,name=authorization_info,json=authorizationInfo" json:"authorization_info,omitempty"` + // Metadata about the operation. + RequestMetadata *RequestMetadata `protobuf:"bytes,4,opt,name=request_metadata,json=requestMetadata" json:"request_metadata,omitempty"` + // The operation request. This may not include all request parameters, + // such as those that are too large, privacy-sensitive, or duplicated + // elsewhere in the log record. + // It should never include user-generated data, such as file contents. + // When the JSON object represented here has a proto equivalent, the proto + // name will be indicated in the `@type` property. + Request *google_protobuf2.Struct `protobuf:"bytes,16,opt,name=request" json:"request,omitempty"` + // The operation response. This may not include all response elements, + // such as those that are too large, privacy-sensitive, or duplicated + // elsewhere in the log record. + // It should never include user-generated data, such as file contents. + // When the JSON object represented here has a proto equivalent, the proto + // name will be indicated in the `@type` property. + Response *google_protobuf2.Struct `protobuf:"bytes,17,opt,name=response" json:"response,omitempty"` + // Other service-specific data about the request, response, and other + // activities. + ServiceData *google_protobuf1.Any `protobuf:"bytes,15,opt,name=service_data,json=serviceData" json:"service_data,omitempty"` +} + +func (m *AuditLog) Reset() { *m = AuditLog{} } +func (m *AuditLog) String() string { return proto.CompactTextString(m) } +func (*AuditLog) ProtoMessage() {} +func (*AuditLog) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *AuditLog) GetServiceName() string { + if m != nil { + return m.ServiceName + } + return "" +} + +func (m *AuditLog) GetMethodName() string { + if m != nil { + return m.MethodName + } + return "" +} + +func (m *AuditLog) GetResourceName() string { + if m != nil { + return m.ResourceName + } + return "" +} + +func (m *AuditLog) GetNumResponseItems() int64 { + if m != nil { + return m.NumResponseItems + } + return 0 +} + +func (m *AuditLog) GetStatus() *google_rpc.Status { + if m != nil { + return m.Status + } + return nil +} + +func (m *AuditLog) GetAuthenticationInfo() *AuthenticationInfo { + if m != nil { + return m.AuthenticationInfo + } + return nil +} + +func (m *AuditLog) GetAuthorizationInfo() []*AuthorizationInfo { + if m != nil { + return m.AuthorizationInfo + } + return nil +} + +func (m *AuditLog) GetRequestMetadata() *RequestMetadata { + if m != nil { + return m.RequestMetadata + } + return nil +} + +func (m *AuditLog) GetRequest() *google_protobuf2.Struct { + if m != nil { + return m.Request + } + return nil +} + +func (m *AuditLog) GetResponse() *google_protobuf2.Struct { + if m != nil { + return m.Response + } + return nil +} + +func (m *AuditLog) GetServiceData() *google_protobuf1.Any { + if m != nil { + return m.ServiceData + } + return nil +} + +// Authentication information for the operation. +type AuthenticationInfo struct { + // The email address of the authenticated user making the request. + PrincipalEmail string `protobuf:"bytes,1,opt,name=principal_email,json=principalEmail" json:"principal_email,omitempty"` +} + +func (m *AuthenticationInfo) Reset() { *m = AuthenticationInfo{} } +func (m *AuthenticationInfo) String() string { return proto.CompactTextString(m) } +func (*AuthenticationInfo) ProtoMessage() {} +func (*AuthenticationInfo) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *AuthenticationInfo) GetPrincipalEmail() string { + if m != nil { + return m.PrincipalEmail + } + return "" +} + +// Authorization information for the operation. +type AuthorizationInfo struct { + // The resource being accessed, as a REST-style string. For example: + // + // bigquery.googlapis.com/projects/PROJECTID/datasets/DATASETID + Resource string `protobuf:"bytes,1,opt,name=resource" json:"resource,omitempty"` + // The required IAM permission. + Permission string `protobuf:"bytes,2,opt,name=permission" json:"permission,omitempty"` + // Whether or not authorization for `resource` and `permission` + // was granted. + Granted bool `protobuf:"varint,3,opt,name=granted" json:"granted,omitempty"` +} + +func (m *AuthorizationInfo) Reset() { *m = AuthorizationInfo{} } +func (m *AuthorizationInfo) String() string { return proto.CompactTextString(m) } +func (*AuthorizationInfo) ProtoMessage() {} +func (*AuthorizationInfo) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *AuthorizationInfo) GetResource() string { + if m != nil { + return m.Resource + } + return "" +} + +func (m *AuthorizationInfo) GetPermission() string { + if m != nil { + return m.Permission + } + return "" +} + +func (m *AuthorizationInfo) GetGranted() bool { + if m != nil { + return m.Granted + } + return false +} + +// Metadata about the request. +type RequestMetadata struct { + // The IP address of the caller. + CallerIp string `protobuf:"bytes,1,opt,name=caller_ip,json=callerIp" json:"caller_ip,omitempty"` + // The user agent of the caller. + // This information is not authenticated and should be treated accordingly. + // For example: + // + // + `google-api-python-client/1.4.0`: + // The request was made by the Google API client for Python. + // + `Cloud SDK Command Line Tool apitools-client/1.0 gcloud/0.9.62`: + // The request was made by the Google Cloud SDK CLI (gcloud). + // + `AppEngine-Google; (+http://code.google.com/appengine; appid: s~my-project`: + // The request was made from the `my-project` App Engine app. + CallerSuppliedUserAgent string `protobuf:"bytes,2,opt,name=caller_supplied_user_agent,json=callerSuppliedUserAgent" json:"caller_supplied_user_agent,omitempty"` +} + +func (m *RequestMetadata) Reset() { *m = RequestMetadata{} } +func (m *RequestMetadata) String() string { return proto.CompactTextString(m) } +func (*RequestMetadata) ProtoMessage() {} +func (*RequestMetadata) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *RequestMetadata) GetCallerIp() string { + if m != nil { + return m.CallerIp + } + return "" +} + +func (m *RequestMetadata) GetCallerSuppliedUserAgent() string { + if m != nil { + return m.CallerSuppliedUserAgent + } + return "" +} + +func init() { + proto.RegisterType((*AuditLog)(nil), "google.cloud.audit.AuditLog") + proto.RegisterType((*AuthenticationInfo)(nil), "google.cloud.audit.AuthenticationInfo") + proto.RegisterType((*AuthorizationInfo)(nil), "google.cloud.audit.AuthorizationInfo") + proto.RegisterType((*RequestMetadata)(nil), "google.cloud.audit.RequestMetadata") +} + +func init() { proto.RegisterFile("google/cloud/audit/audit_log.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 576 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x94, 0x5f, 0x6f, 0xd3, 0x30, + 0x14, 0xc5, 0x55, 0x36, 0x6d, 0xad, 0xbb, 0xd1, 0xd6, 0x20, 0x1a, 0xca, 0x04, 0xa5, 0x13, 0x50, + 0x21, 0x94, 0x88, 0xed, 0x61, 0x0f, 0x13, 0x0f, 0x9d, 0xe0, 0xa1, 0x12, 0x4c, 0x53, 0x0a, 0x42, + 0xe2, 0x25, 0x72, 0x93, 0xdb, 0xcc, 0x22, 0xb1, 0x8d, 0xff, 0x20, 0x8d, 0xef, 0xcc, 0x77, 0x40, + 0xbd, 0x71, 0x4a, 0xd7, 0x0e, 0x5e, 0x2c, 0xf9, 0x9c, 0xdf, 0xbd, 0x76, 0xaf, 0x4f, 0x43, 0x46, + 0xb9, 0x94, 0x79, 0x01, 0x51, 0x5a, 0x48, 0x97, 0x45, 0xcc, 0x65,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14, 0x1a, 0x90, 0xfd, 0x5c, 0x33, 0x61, 0x21, 0xc3, 0x8c, 0x34, + 0xe3, 0x7a, 0x3b, 0xfa, 0x4e, 0x3a, 0x1b, 0xe3, 0xa6, 0x4f, 0x48, 0x2b, 0x65, 0x45, 0x01, 0x3a, + 0xe1, 0xaa, 0x3e, 0xa9, 0x12, 0xa6, 0x8a, 0x9e, 0x93, 0x81, 0x37, 0x8d, 0x53, 0xaa, 0xe0, 0x90, + 0x25, 0xce, 0x80, 0x4e, 0x58, 0x0e, 0xc2, 0xfa, 0x93, 0xfb, 0x15, 0x31, 0xf3, 0xc0, 0x17, 0x03, + 0x7a, 0xb2, 0xb4, 0x2f, 0xe6, 0xe4, 0x51, 0x2a, 0xcb, 0x3b, 0x9e, 0xfc, 0xe2, 0xb0, 0xfe, 0x77, + 0x5e, 0x2d, 0x67, 0x7a, 0xd5, 0xf8, 0x76, 0xe6, 0xa1, 0x5c, 0x16, 0x4c, 0xe4, 0xa1, 0xd4, 0x79, + 0x94, 0x83, 0xc0, 0x89, 0x47, 0x95, 0xc5, 0x14, 0x37, 0xeb, 0x1f, 0x9e, 0x73, 0x5c, 0xe7, 0x7b, + 0xc8, 0x9c, 0xfe, 0x09, 0x00, 0x00, 0xff, 0xff, 0x90, 0xe4, 0x37, 0xbf, 0x9b, 0x04, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/bigquery/datatransfer/v1/datatransfer.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/bigquery/datatransfer/v1/datatransfer.pb.go new file mode 100644 index 0000000000..00d87d84d6 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/bigquery/datatransfer/v1/datatransfer.pb.go @@ -0,0 +1,1868 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/bigquery/datatransfer/v1/datatransfer.proto + +/* +Package datatransfer is a generated protocol buffer package. + +It is generated from these files: + google/cloud/bigquery/datatransfer/v1/datatransfer.proto + google/cloud/bigquery/datatransfer/v1/transfer.proto + +It has these top-level messages: + DataSourceParameter + DataSource + GetDataSourceRequest + ListDataSourcesRequest + ListDataSourcesResponse + CreateTransferConfigRequest + UpdateTransferConfigRequest + GetTransferConfigRequest + DeleteTransferConfigRequest + GetTransferRunRequest + DeleteTransferRunRequest + ListTransferConfigsRequest + ListTransferConfigsResponse + ListTransferRunsRequest + ListTransferRunsResponse + ListTransferLogsRequest + ListTransferLogsResponse + CheckValidCredsRequest + CheckValidCredsResponse + ScheduleTransferRunsRequest + ScheduleTransferRunsResponse + TransferConfig + TransferRun + TransferMessage +*/ +package datatransfer + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf4 "github.com/golang/protobuf/ptypes/duration" +import google_protobuf5 "github.com/golang/protobuf/ptypes/empty" +import google_protobuf6 "google.golang.org/genproto/protobuf/field_mask" +import google_protobuf2 "github.com/golang/protobuf/ptypes/timestamp" +import google_protobuf7 "github.com/golang/protobuf/ptypes/wrappers" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Parameter type. +type DataSourceParameter_Type int32 + +const ( + // Type unspecified. + DataSourceParameter_TYPE_UNSPECIFIED DataSourceParameter_Type = 0 + // String parameter. + DataSourceParameter_STRING DataSourceParameter_Type = 1 + // Integer parameter (64-bits). + // Will be serialized to json as string. + DataSourceParameter_INTEGER DataSourceParameter_Type = 2 + // Double precision floating point parameter. + DataSourceParameter_DOUBLE DataSourceParameter_Type = 3 + // Boolean parameter. + DataSourceParameter_BOOLEAN DataSourceParameter_Type = 4 + // Record parameter. + DataSourceParameter_RECORD DataSourceParameter_Type = 5 + // Page ID for a Google+ Page. + DataSourceParameter_PLUS_PAGE DataSourceParameter_Type = 6 +) + +var DataSourceParameter_Type_name = map[int32]string{ + 0: "TYPE_UNSPECIFIED", + 1: "STRING", + 2: "INTEGER", + 3: "DOUBLE", + 4: "BOOLEAN", + 5: "RECORD", + 6: "PLUS_PAGE", +} +var DataSourceParameter_Type_value = map[string]int32{ + "TYPE_UNSPECIFIED": 0, + "STRING": 1, + "INTEGER": 2, + "DOUBLE": 3, + "BOOLEAN": 4, + "RECORD": 5, + "PLUS_PAGE": 6, +} + +func (x DataSourceParameter_Type) String() string { + return proto.EnumName(DataSourceParameter_Type_name, int32(x)) +} +func (DataSourceParameter_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 0} } + +// The type of authorization needed for this data source. +type DataSource_AuthorizationType int32 + +const ( + // Type unspecified. + DataSource_AUTHORIZATION_TYPE_UNSPECIFIED DataSource_AuthorizationType = 0 + // Use OAuth 2 authorization codes that can be exchanged + // for a refresh token on the backend. + DataSource_AUTHORIZATION_CODE DataSource_AuthorizationType = 1 + // Return an authorization code for a given Google+ page that can then be + // exchanged for a refresh token on the backend. + DataSource_GOOGLE_PLUS_AUTHORIZATION_CODE DataSource_AuthorizationType = 2 +) + +var DataSource_AuthorizationType_name = map[int32]string{ + 0: "AUTHORIZATION_TYPE_UNSPECIFIED", + 1: "AUTHORIZATION_CODE", + 2: "GOOGLE_PLUS_AUTHORIZATION_CODE", +} +var DataSource_AuthorizationType_value = map[string]int32{ + "AUTHORIZATION_TYPE_UNSPECIFIED": 0, + "AUTHORIZATION_CODE": 1, + "GOOGLE_PLUS_AUTHORIZATION_CODE": 2, +} + +func (x DataSource_AuthorizationType) String() string { + return proto.EnumName(DataSource_AuthorizationType_name, int32(x)) +} +func (DataSource_AuthorizationType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{1, 0} +} + +// Represents how the data source supports data auto refresh. +type DataSource_DataRefreshType int32 + +const ( + // The data source won't support data auto refresh, which is default value. + DataSource_DATA_REFRESH_TYPE_UNSPECIFIED DataSource_DataRefreshType = 0 + // The data source supports data auto refresh, and runs will be scheduled + // for the past few days. Does not allow custom values to be set for each + // transfer config. + DataSource_SLIDING_WINDOW DataSource_DataRefreshType = 1 + // The data source supports data auto refresh, and runs will be scheduled + // for the past few days. Allows custom values to be set for each transfer + // config. + DataSource_CUSTOM_SLIDING_WINDOW DataSource_DataRefreshType = 2 +) + +var DataSource_DataRefreshType_name = map[int32]string{ + 0: "DATA_REFRESH_TYPE_UNSPECIFIED", + 1: "SLIDING_WINDOW", + 2: "CUSTOM_SLIDING_WINDOW", +} +var DataSource_DataRefreshType_value = map[string]int32{ + "DATA_REFRESH_TYPE_UNSPECIFIED": 0, + "SLIDING_WINDOW": 1, + "CUSTOM_SLIDING_WINDOW": 2, +} + +func (x DataSource_DataRefreshType) String() string { + return proto.EnumName(DataSource_DataRefreshType_name, int32(x)) +} +func (DataSource_DataRefreshType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{1, 1} +} + +// Represents which runs should be pulled. +type ListTransferRunsRequest_RunAttempt int32 + +const ( + // All runs should be returned. + ListTransferRunsRequest_RUN_ATTEMPT_UNSPECIFIED ListTransferRunsRequest_RunAttempt = 0 + // Only latest run per day should be returned. + ListTransferRunsRequest_LATEST ListTransferRunsRequest_RunAttempt = 1 +) + +var ListTransferRunsRequest_RunAttempt_name = map[int32]string{ + 0: "RUN_ATTEMPT_UNSPECIFIED", + 1: "LATEST", +} +var ListTransferRunsRequest_RunAttempt_value = map[string]int32{ + "RUN_ATTEMPT_UNSPECIFIED": 0, + "LATEST": 1, +} + +func (x ListTransferRunsRequest_RunAttempt) String() string { + return proto.EnumName(ListTransferRunsRequest_RunAttempt_name, int32(x)) +} +func (ListTransferRunsRequest_RunAttempt) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{13, 0} +} + +// Represents a data source parameter with validation rules, so that +// parameters can be rendered in the UI. These parameters are given to us by +// supported data sources, and include all needed information for rendering +// and validation. +// Thus, whoever uses this api can decide to generate either generic ui, +// or custom data source specific forms. +type DataSourceParameter struct { + // Parameter identifier. + ParamId string `protobuf:"bytes,1,opt,name=param_id,json=paramId" json:"param_id,omitempty"` + // Parameter display name in the user interface. + DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName" json:"display_name,omitempty"` + // Parameter description. + Description string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` + // Parameter type. + Type DataSourceParameter_Type `protobuf:"varint,4,opt,name=type,enum=google.cloud.bigquery.datatransfer.v1.DataSourceParameter_Type" json:"type,omitempty"` + // Is parameter required. + Required bool `protobuf:"varint,5,opt,name=required" json:"required,omitempty"` + // Can parameter have multiple values. + Repeated bool `protobuf:"varint,6,opt,name=repeated" json:"repeated,omitempty"` + // Regular expression which can be used for parameter validation. + ValidationRegex string `protobuf:"bytes,7,opt,name=validation_regex,json=validationRegex" json:"validation_regex,omitempty"` + // All possible values for the parameter. + AllowedValues []string `protobuf:"bytes,8,rep,name=allowed_values,json=allowedValues" json:"allowed_values,omitempty"` + // For integer and double values specifies minimum allowed value. + MinValue *google_protobuf7.DoubleValue `protobuf:"bytes,9,opt,name=min_value,json=minValue" json:"min_value,omitempty"` + // For integer and double values specifies maxminum allowed value. + MaxValue *google_protobuf7.DoubleValue `protobuf:"bytes,10,opt,name=max_value,json=maxValue" json:"max_value,omitempty"` + // When parameter is a record, describes child fields. + Fields []*DataSourceParameter `protobuf:"bytes,11,rep,name=fields" json:"fields,omitempty"` + // Description of the requirements for this field, in case the user input does + // not fulfill the regex pattern or min/max values. + ValidationDescription string `protobuf:"bytes,12,opt,name=validation_description,json=validationDescription" json:"validation_description,omitempty"` + // URL to a help document to further explain the naming requirements. + ValidationHelpUrl string `protobuf:"bytes,13,opt,name=validation_help_url,json=validationHelpUrl" json:"validation_help_url,omitempty"` + // Cannot be changed after initial creation. + Immutable bool `protobuf:"varint,14,opt,name=immutable" json:"immutable,omitempty"` + // If set to true, schema should be taken from the parent with the same + // parameter_id. Only applicable when parameter type is RECORD. + Recurse bool `protobuf:"varint,15,opt,name=recurse" json:"recurse,omitempty"` +} + +func (m *DataSourceParameter) Reset() { *m = DataSourceParameter{} } +func (m *DataSourceParameter) String() string { return proto.CompactTextString(m) } +func (*DataSourceParameter) ProtoMessage() {} +func (*DataSourceParameter) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *DataSourceParameter) GetParamId() string { + if m != nil { + return m.ParamId + } + return "" +} + +func (m *DataSourceParameter) GetDisplayName() string { + if m != nil { + return m.DisplayName + } + return "" +} + +func (m *DataSourceParameter) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *DataSourceParameter) GetType() DataSourceParameter_Type { + if m != nil { + return m.Type + } + return DataSourceParameter_TYPE_UNSPECIFIED +} + +func (m *DataSourceParameter) GetRequired() bool { + if m != nil { + return m.Required + } + return false +} + +func (m *DataSourceParameter) GetRepeated() bool { + if m != nil { + return m.Repeated + } + return false +} + +func (m *DataSourceParameter) GetValidationRegex() string { + if m != nil { + return m.ValidationRegex + } + return "" +} + +func (m *DataSourceParameter) GetAllowedValues() []string { + if m != nil { + return m.AllowedValues + } + return nil +} + +func (m *DataSourceParameter) GetMinValue() *google_protobuf7.DoubleValue { + if m != nil { + return m.MinValue + } + return nil +} + +func (m *DataSourceParameter) GetMaxValue() *google_protobuf7.DoubleValue { + if m != nil { + return m.MaxValue + } + return nil +} + +func (m *DataSourceParameter) GetFields() []*DataSourceParameter { + if m != nil { + return m.Fields + } + return nil +} + +func (m *DataSourceParameter) GetValidationDescription() string { + if m != nil { + return m.ValidationDescription + } + return "" +} + +func (m *DataSourceParameter) GetValidationHelpUrl() string { + if m != nil { + return m.ValidationHelpUrl + } + return "" +} + +func (m *DataSourceParameter) GetImmutable() bool { + if m != nil { + return m.Immutable + } + return false +} + +func (m *DataSourceParameter) GetRecurse() bool { + if m != nil { + return m.Recurse + } + return false +} + +// Represents data source metadata. Metadata is sufficient to +// render UI and request proper OAuth tokens. +type DataSource struct { + // Data source resource name. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Data source id. + DataSourceId string `protobuf:"bytes,2,opt,name=data_source_id,json=dataSourceId" json:"data_source_id,omitempty"` + // User friendly data source name. + DisplayName string `protobuf:"bytes,3,opt,name=display_name,json=displayName" json:"display_name,omitempty"` + // User friendly data source description string. + Description string `protobuf:"bytes,4,opt,name=description" json:"description,omitempty"` + // Data source client id which should be used to receive refresh token. + // When not supplied, no offline credentials are populated for data transfer. + ClientId string `protobuf:"bytes,5,opt,name=client_id,json=clientId" json:"client_id,omitempty"` + // Api auth scopes for which refresh token needs to be obtained. Only valid + // when `client_id` is specified. Ignored otherwise. These are scopes needed + // by a data source to prepare data and ingest them into BigQuery, + // e.g., https://www.googleapis.com/auth/bigquery + Scopes []string `protobuf:"bytes,6,rep,name=scopes" json:"scopes,omitempty"` + // Transfer type. Currently supports only batch transfers, + // which are transfers that use the BigQuery batch APIs (load or + // query) to ingest the data. + TransferType TransferType `protobuf:"varint,7,opt,name=transfer_type,json=transferType,enum=google.cloud.bigquery.datatransfer.v1.TransferType" json:"transfer_type,omitempty"` + // Indicates whether the data source supports multiple transfers + // to different BigQuery targets. + SupportsMultipleTransfers bool `protobuf:"varint,8,opt,name=supports_multiple_transfers,json=supportsMultipleTransfers" json:"supports_multiple_transfers,omitempty"` + // The number of seconds to wait for an update from the data source + // before BigQuery marks the transfer as failed. + UpdateDeadlineSeconds int32 `protobuf:"varint,9,opt,name=update_deadline_seconds,json=updateDeadlineSeconds" json:"update_deadline_seconds,omitempty"` + // Default data transfer schedule. + // Examples of valid schedules include: + // `1st,3rd monday of month 15:30`, + // `every wed,fri of jan,jun 13:15`, and + // `first sunday of quarter 00:00`. + DefaultSchedule string `protobuf:"bytes,10,opt,name=default_schedule,json=defaultSchedule" json:"default_schedule,omitempty"` + // Specifies whether the data source supports a user defined schedule, or + // operates on the default schedule. + // When set to `true`, user can override default schedule. + SupportsCustomSchedule bool `protobuf:"varint,11,opt,name=supports_custom_schedule,json=supportsCustomSchedule" json:"supports_custom_schedule,omitempty"` + // Data source parameters. + Parameters []*DataSourceParameter `protobuf:"bytes,12,rep,name=parameters" json:"parameters,omitempty"` + // Url for the help document for this data source. + HelpUrl string `protobuf:"bytes,13,opt,name=help_url,json=helpUrl" json:"help_url,omitempty"` + // Indicates the type of authorization. + AuthorizationType DataSource_AuthorizationType `protobuf:"varint,14,opt,name=authorization_type,json=authorizationType,enum=google.cloud.bigquery.datatransfer.v1.DataSource_AuthorizationType" json:"authorization_type,omitempty"` + // Specifies whether the data source supports automatic data refresh for the + // past few days, and how it's supported. + // For some data sources, data might not be complete until a few days later, + // so it's useful to refresh data automatically. + DataRefreshType DataSource_DataRefreshType `protobuf:"varint,15,opt,name=data_refresh_type,json=dataRefreshType,enum=google.cloud.bigquery.datatransfer.v1.DataSource_DataRefreshType" json:"data_refresh_type,omitempty"` + // Default data refresh window on days. + // Only meaningful when `data_refresh_type` = `SLIDING_WINDOW`. + DefaultDataRefreshWindowDays int32 `protobuf:"varint,16,opt,name=default_data_refresh_window_days,json=defaultDataRefreshWindowDays" json:"default_data_refresh_window_days,omitempty"` + // Disables backfilling and manual run scheduling + // for the data source. + ManualRunsDisabled bool `protobuf:"varint,17,opt,name=manual_runs_disabled,json=manualRunsDisabled" json:"manual_runs_disabled,omitempty"` + // The minimum interval between two consecutive scheduled runs. + MinimumScheduleInterval *google_protobuf4.Duration `protobuf:"bytes,18,opt,name=minimum_schedule_interval,json=minimumScheduleInterval" json:"minimum_schedule_interval,omitempty"` +} + +func (m *DataSource) Reset() { *m = DataSource{} } +func (m *DataSource) String() string { return proto.CompactTextString(m) } +func (*DataSource) ProtoMessage() {} +func (*DataSource) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *DataSource) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *DataSource) GetDataSourceId() string { + if m != nil { + return m.DataSourceId + } + return "" +} + +func (m *DataSource) GetDisplayName() string { + if m != nil { + return m.DisplayName + } + return "" +} + +func (m *DataSource) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *DataSource) GetClientId() string { + if m != nil { + return m.ClientId + } + return "" +} + +func (m *DataSource) GetScopes() []string { + if m != nil { + return m.Scopes + } + return nil +} + +func (m *DataSource) GetTransferType() TransferType { + if m != nil { + return m.TransferType + } + return TransferType_TRANSFER_TYPE_UNSPECIFIED +} + +func (m *DataSource) GetSupportsMultipleTransfers() bool { + if m != nil { + return m.SupportsMultipleTransfers + } + return false +} + +func (m *DataSource) GetUpdateDeadlineSeconds() int32 { + if m != nil { + return m.UpdateDeadlineSeconds + } + return 0 +} + +func (m *DataSource) GetDefaultSchedule() string { + if m != nil { + return m.DefaultSchedule + } + return "" +} + +func (m *DataSource) GetSupportsCustomSchedule() bool { + if m != nil { + return m.SupportsCustomSchedule + } + return false +} + +func (m *DataSource) GetParameters() []*DataSourceParameter { + if m != nil { + return m.Parameters + } + return nil +} + +func (m *DataSource) GetHelpUrl() string { + if m != nil { + return m.HelpUrl + } + return "" +} + +func (m *DataSource) GetAuthorizationType() DataSource_AuthorizationType { + if m != nil { + return m.AuthorizationType + } + return DataSource_AUTHORIZATION_TYPE_UNSPECIFIED +} + +func (m *DataSource) GetDataRefreshType() DataSource_DataRefreshType { + if m != nil { + return m.DataRefreshType + } + return DataSource_DATA_REFRESH_TYPE_UNSPECIFIED +} + +func (m *DataSource) GetDefaultDataRefreshWindowDays() int32 { + if m != nil { + return m.DefaultDataRefreshWindowDays + } + return 0 +} + +func (m *DataSource) GetManualRunsDisabled() bool { + if m != nil { + return m.ManualRunsDisabled + } + return false +} + +func (m *DataSource) GetMinimumScheduleInterval() *google_protobuf4.Duration { + if m != nil { + return m.MinimumScheduleInterval + } + return nil +} + +// A request to get data source info. +type GetDataSourceRequest struct { + // The field will contain name of the resource requested, for example: + // `projects/{project_id}/dataSources/{data_source_id}` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetDataSourceRequest) Reset() { *m = GetDataSourceRequest{} } +func (m *GetDataSourceRequest) String() string { return proto.CompactTextString(m) } +func (*GetDataSourceRequest) ProtoMessage() {} +func (*GetDataSourceRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *GetDataSourceRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Request to list supported data sources and their data transfer settings. +type ListDataSourcesRequest struct { + // The BigQuery project id for which data sources should be returned. + // Must be in the form: `projects/{project_id}` + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // Pagination token, which can be used to request a specific page + // of `ListDataSourcesRequest` list results. For multiple-page + // results, `ListDataSourcesResponse` outputs + // a `next_page` token, which can be used as the + // `page_token` value to request the next page of list results. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` + // Page size. The default page size is the maximum value of 1000 results. + PageSize int32 `protobuf:"varint,4,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` +} + +func (m *ListDataSourcesRequest) Reset() { *m = ListDataSourcesRequest{} } +func (m *ListDataSourcesRequest) String() string { return proto.CompactTextString(m) } +func (*ListDataSourcesRequest) ProtoMessage() {} +func (*ListDataSourcesRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *ListDataSourcesRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *ListDataSourcesRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +func (m *ListDataSourcesRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +// Returns list of supported data sources and their metadata. +type ListDataSourcesResponse struct { + // List of supported data sources and their transfer settings. + DataSources []*DataSource `protobuf:"bytes,1,rep,name=data_sources,json=dataSources" json:"data_sources,omitempty"` + // Output only. The next-pagination token. For multiple-page list results, + // this token can be used as the + // `ListDataSourcesRequest.page_token` + // to request the next page of list results. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListDataSourcesResponse) Reset() { *m = ListDataSourcesResponse{} } +func (m *ListDataSourcesResponse) String() string { return proto.CompactTextString(m) } +func (*ListDataSourcesResponse) ProtoMessage() {} +func (*ListDataSourcesResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *ListDataSourcesResponse) GetDataSources() []*DataSource { + if m != nil { + return m.DataSources + } + return nil +} + +func (m *ListDataSourcesResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// A request to create a data transfer configuration. If new credentials are +// needed for this transfer configuration, an authorization code must be +// provided. If an authorization code is provided, the transfer configuration +// will be associated with the user id corresponding to the +// authorization code. Otherwise, the transfer configuration will be associated +// with the calling user. +type CreateTransferConfigRequest struct { + // The BigQuery project id where the transfer configuration should be created. + // Must be in the format /projects/{project_id}/locations/{location_id} + // or + // /projects/{project_id}/locations/- + // In case when '-' is specified as location_id, location is infered from + // the destination dataset region. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // Data transfer configuration to create. + TransferConfig *TransferConfig `protobuf:"bytes,2,opt,name=transfer_config,json=transferConfig" json:"transfer_config,omitempty"` + // Optional OAuth2 authorization code to use with this transfer configuration. + // This is required if new credentials are needed, as indicated by + // `CheckValidCreds`. + // In order to obtain authorization_code, please make a + // request to + // https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= + // + // * client_id should be OAuth client_id of BigQuery DTS API for the given + // data source returned by ListDataSources method. + // * data_source_scopes are the scopes returned by ListDataSources method. + // * redirect_uri is an optional parameter. If not specified, then + // authorization code is posted to the opener of authorization flow window. + // Otherwise it will be sent to the redirect uri. A special value of + // urn:ietf:wg:oauth:2.0:oob means that authorization code should be + // returned in the title bar of the browser, with the page text prompting + // the user to copy the code and paste it in the application. + AuthorizationCode string `protobuf:"bytes,3,opt,name=authorization_code,json=authorizationCode" json:"authorization_code,omitempty"` +} + +func (m *CreateTransferConfigRequest) Reset() { *m = CreateTransferConfigRequest{} } +func (m *CreateTransferConfigRequest) String() string { return proto.CompactTextString(m) } +func (*CreateTransferConfigRequest) ProtoMessage() {} +func (*CreateTransferConfigRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *CreateTransferConfigRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *CreateTransferConfigRequest) GetTransferConfig() *TransferConfig { + if m != nil { + return m.TransferConfig + } + return nil +} + +func (m *CreateTransferConfigRequest) GetAuthorizationCode() string { + if m != nil { + return m.AuthorizationCode + } + return "" +} + +// A request to update a transfer configuration. To update the user id of the +// transfer configuration, an authorization code needs to be provided. +type UpdateTransferConfigRequest struct { + // Data transfer configuration to create. + TransferConfig *TransferConfig `protobuf:"bytes,1,opt,name=transfer_config,json=transferConfig" json:"transfer_config,omitempty"` + // Optional OAuth2 authorization code to use with this transfer configuration. + // If it is provided, the transfer configuration will be associated with the + // authorizing user. + // In order to obtain authorization_code, please make a + // request to + // https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= + // + // * client_id should be OAuth client_id of BigQuery DTS API for the given + // data source returned by ListDataSources method. + // * data_source_scopes are the scopes returned by ListDataSources method. + // * redirect_uri is an optional parameter. If not specified, then + // authorization code is posted to the opener of authorization flow window. + // Otherwise it will be sent to the redirect uri. A special value of + // urn:ietf:wg:oauth:2.0:oob means that authorization code should be + // returned in the title bar of the browser, with the page text prompting + // the user to copy the code and paste it in the application. + AuthorizationCode string `protobuf:"bytes,3,opt,name=authorization_code,json=authorizationCode" json:"authorization_code,omitempty"` + // Required list of fields to be updated in this request. + UpdateMask *google_protobuf6.FieldMask `protobuf:"bytes,4,opt,name=update_mask,json=updateMask" json:"update_mask,omitempty"` +} + +func (m *UpdateTransferConfigRequest) Reset() { *m = UpdateTransferConfigRequest{} } +func (m *UpdateTransferConfigRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateTransferConfigRequest) ProtoMessage() {} +func (*UpdateTransferConfigRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *UpdateTransferConfigRequest) GetTransferConfig() *TransferConfig { + if m != nil { + return m.TransferConfig + } + return nil +} + +func (m *UpdateTransferConfigRequest) GetAuthorizationCode() string { + if m != nil { + return m.AuthorizationCode + } + return "" +} + +func (m *UpdateTransferConfigRequest) GetUpdateMask() *google_protobuf6.FieldMask { + if m != nil { + return m.UpdateMask + } + return nil +} + +// A request to get data transfer information. +type GetTransferConfigRequest struct { + // The field will contain name of the resource requested, for example: + // `projects/{project_id}/transferConfigs/{config_id}` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetTransferConfigRequest) Reset() { *m = GetTransferConfigRequest{} } +func (m *GetTransferConfigRequest) String() string { return proto.CompactTextString(m) } +func (*GetTransferConfigRequest) ProtoMessage() {} +func (*GetTransferConfigRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *GetTransferConfigRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// A request to delete data transfer information. All associated transfer runs +// and log messages will be deleted as well. +type DeleteTransferConfigRequest struct { + // The field will contain name of the resource requested, for example: + // `projects/{project_id}/transferConfigs/{config_id}` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *DeleteTransferConfigRequest) Reset() { *m = DeleteTransferConfigRequest{} } +func (m *DeleteTransferConfigRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteTransferConfigRequest) ProtoMessage() {} +func (*DeleteTransferConfigRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *DeleteTransferConfigRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// A request to get data transfer run information. +type GetTransferRunRequest struct { + // The field will contain name of the resource requested, for example: + // `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetTransferRunRequest) Reset() { *m = GetTransferRunRequest{} } +func (m *GetTransferRunRequest) String() string { return proto.CompactTextString(m) } +func (*GetTransferRunRequest) ProtoMessage() {} +func (*GetTransferRunRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *GetTransferRunRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// A request to delete data transfer run information. +type DeleteTransferRunRequest struct { + // The field will contain name of the resource requested, for example: + // `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *DeleteTransferRunRequest) Reset() { *m = DeleteTransferRunRequest{} } +func (m *DeleteTransferRunRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteTransferRunRequest) ProtoMessage() {} +func (*DeleteTransferRunRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *DeleteTransferRunRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// A request to list data transfers configured for a BigQuery project. +type ListTransferConfigsRequest struct { + // The BigQuery project id for which data sources + // should be returned: `projects/{project_id}`. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // When specified, only configurations of requested data sources are returned. + DataSourceIds []string `protobuf:"bytes,2,rep,name=data_source_ids,json=dataSourceIds" json:"data_source_ids,omitempty"` + // Pagination token, which can be used to request a specific page + // of `ListTransfersRequest` list results. For multiple-page + // results, `ListTransfersResponse` outputs + // a `next_page` token, which can be used as the + // `page_token` value to request the next page of list results. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` + // Page size. The default page size is the maximum value of 1000 results. + PageSize int32 `protobuf:"varint,4,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` +} + +func (m *ListTransferConfigsRequest) Reset() { *m = ListTransferConfigsRequest{} } +func (m *ListTransferConfigsRequest) String() string { return proto.CompactTextString(m) } +func (*ListTransferConfigsRequest) ProtoMessage() {} +func (*ListTransferConfigsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } + +func (m *ListTransferConfigsRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *ListTransferConfigsRequest) GetDataSourceIds() []string { + if m != nil { + return m.DataSourceIds + } + return nil +} + +func (m *ListTransferConfigsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +func (m *ListTransferConfigsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +// The returned list of pipelines in the project. +type ListTransferConfigsResponse struct { + // Output only. The stored pipeline transfer configurations. + TransferConfigs []*TransferConfig `protobuf:"bytes,1,rep,name=transfer_configs,json=transferConfigs" json:"transfer_configs,omitempty"` + // Output only. The next-pagination token. For multiple-page list results, + // this token can be used as the + // `ListTransferConfigsRequest.page_token` + // to request the next page of list results. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListTransferConfigsResponse) Reset() { *m = ListTransferConfigsResponse{} } +func (m *ListTransferConfigsResponse) String() string { return proto.CompactTextString(m) } +func (*ListTransferConfigsResponse) ProtoMessage() {} +func (*ListTransferConfigsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } + +func (m *ListTransferConfigsResponse) GetTransferConfigs() []*TransferConfig { + if m != nil { + return m.TransferConfigs + } + return nil +} + +func (m *ListTransferConfigsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// A request to list data transfer runs. UI can use this method to show/filter +// specific data transfer runs. The data source can use this method to request +// all scheduled transfer runs. +type ListTransferRunsRequest struct { + // Name of transfer configuration for which transfer runs should be retrieved. + // Format of transfer configuration resource name is: + // `projects/{project_id}/transferConfigs/{config_id}`. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // When specified, only transfer runs with requested states are returned. + States []TransferState `protobuf:"varint,2,rep,packed,name=states,enum=google.cloud.bigquery.datatransfer.v1.TransferState" json:"states,omitempty"` + // Pagination token, which can be used to request a specific page + // of `ListTransferRunsRequest` list results. For multiple-page + // results, `ListTransferRunsResponse` outputs + // a `next_page` token, which can be used as the + // `page_token` value to request the next page of list results. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` + // Page size. The default page size is the maximum value of 1000 results. + PageSize int32 `protobuf:"varint,4,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // Indicates how run attempts are to be pulled. + RunAttempt ListTransferRunsRequest_RunAttempt `protobuf:"varint,5,opt,name=run_attempt,json=runAttempt,enum=google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest_RunAttempt" json:"run_attempt,omitempty"` +} + +func (m *ListTransferRunsRequest) Reset() { *m = ListTransferRunsRequest{} } +func (m *ListTransferRunsRequest) String() string { return proto.CompactTextString(m) } +func (*ListTransferRunsRequest) ProtoMessage() {} +func (*ListTransferRunsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } + +func (m *ListTransferRunsRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *ListTransferRunsRequest) GetStates() []TransferState { + if m != nil { + return m.States + } + return nil +} + +func (m *ListTransferRunsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +func (m *ListTransferRunsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListTransferRunsRequest) GetRunAttempt() ListTransferRunsRequest_RunAttempt { + if m != nil { + return m.RunAttempt + } + return ListTransferRunsRequest_RUN_ATTEMPT_UNSPECIFIED +} + +// The returned list of pipelines in the project. +type ListTransferRunsResponse struct { + // Output only. The stored pipeline transfer runs. + TransferRuns []*TransferRun `protobuf:"bytes,1,rep,name=transfer_runs,json=transferRuns" json:"transfer_runs,omitempty"` + // Output only. The next-pagination token. For multiple-page list results, + // this token can be used as the + // `ListTransferRunsRequest.page_token` + // to request the next page of list results. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListTransferRunsResponse) Reset() { *m = ListTransferRunsResponse{} } +func (m *ListTransferRunsResponse) String() string { return proto.CompactTextString(m) } +func (*ListTransferRunsResponse) ProtoMessage() {} +func (*ListTransferRunsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } + +func (m *ListTransferRunsResponse) GetTransferRuns() []*TransferRun { + if m != nil { + return m.TransferRuns + } + return nil +} + +func (m *ListTransferRunsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// A request to get user facing log messages associated with data transfer run. +type ListTransferLogsRequest struct { + // Transfer run name in the form: + // `projects/{project_id}/transferConfigs/{config_Id}/runs/{run_id}`. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // Pagination token, which can be used to request a specific page + // of `ListTransferLogsRequest` list results. For multiple-page + // results, `ListTransferLogsResponse` outputs + // a `next_page` token, which can be used as the + // `page_token` value to request the next page of list results. + PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` + // Page size. The default page size is the maximum value of 1000 results. + PageSize int32 `protobuf:"varint,5,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // Message types to return. If not populated - INFO, WARNING and ERROR + // messages are returned. + MessageTypes []TransferMessage_MessageSeverity `protobuf:"varint,6,rep,packed,name=message_types,json=messageTypes,enum=google.cloud.bigquery.datatransfer.v1.TransferMessage_MessageSeverity" json:"message_types,omitempty"` +} + +func (m *ListTransferLogsRequest) Reset() { *m = ListTransferLogsRequest{} } +func (m *ListTransferLogsRequest) String() string { return proto.CompactTextString(m) } +func (*ListTransferLogsRequest) ProtoMessage() {} +func (*ListTransferLogsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } + +func (m *ListTransferLogsRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *ListTransferLogsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +func (m *ListTransferLogsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListTransferLogsRequest) GetMessageTypes() []TransferMessage_MessageSeverity { + if m != nil { + return m.MessageTypes + } + return nil +} + +// The returned list transfer run messages. +type ListTransferLogsResponse struct { + // Output only. The stored pipeline transfer messages. + TransferMessages []*TransferMessage `protobuf:"bytes,1,rep,name=transfer_messages,json=transferMessages" json:"transfer_messages,omitempty"` + // Output only. The next-pagination token. For multiple-page list results, + // this token can be used as the + // `GetTransferRunLogRequest.page_token` + // to request the next page of list results. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListTransferLogsResponse) Reset() { *m = ListTransferLogsResponse{} } +func (m *ListTransferLogsResponse) String() string { return proto.CompactTextString(m) } +func (*ListTransferLogsResponse) ProtoMessage() {} +func (*ListTransferLogsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} } + +func (m *ListTransferLogsResponse) GetTransferMessages() []*TransferMessage { + if m != nil { + return m.TransferMessages + } + return nil +} + +func (m *ListTransferLogsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// A request to determine whether the user has valid credentials. This method +// is used to limit the number of OAuth popups in the user interface. The +// user id is inferred from the API call context. +// If the data source has the Google+ authorization type, this method +// returns false, as it cannot be determined whether the credentials are +// already valid merely based on the user id. +type CheckValidCredsRequest struct { + // The data source in the form: + // `projects/{project_id}/dataSources/{data_source_id}` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *CheckValidCredsRequest) Reset() { *m = CheckValidCredsRequest{} } +func (m *CheckValidCredsRequest) String() string { return proto.CompactTextString(m) } +func (*CheckValidCredsRequest) ProtoMessage() {} +func (*CheckValidCredsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17} } + +func (m *CheckValidCredsRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// A response indicating whether the credentials exist and are valid. +type CheckValidCredsResponse struct { + // If set to `true`, the credentials exist and are valid. + HasValidCreds bool `protobuf:"varint,1,opt,name=has_valid_creds,json=hasValidCreds" json:"has_valid_creds,omitempty"` +} + +func (m *CheckValidCredsResponse) Reset() { *m = CheckValidCredsResponse{} } +func (m *CheckValidCredsResponse) String() string { return proto.CompactTextString(m) } +func (*CheckValidCredsResponse) ProtoMessage() {} +func (*CheckValidCredsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{18} } + +func (m *CheckValidCredsResponse) GetHasValidCreds() bool { + if m != nil { + return m.HasValidCreds + } + return false +} + +// A request to schedule transfer runs for a time range. +type ScheduleTransferRunsRequest struct { + // Transfer configuration name in the form: + // `projects/{project_id}/transferConfigs/{config_id}`. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // Start time of the range of transfer runs. For example, + // `"2017-05-25T00:00:00+00:00"`. + StartTime *google_protobuf2.Timestamp `protobuf:"bytes,2,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + // End time of the range of transfer runs. For example, + // `"2017-05-30T00:00:00+00:00"`. + EndTime *google_protobuf2.Timestamp `protobuf:"bytes,3,opt,name=end_time,json=endTime" json:"end_time,omitempty"` +} + +func (m *ScheduleTransferRunsRequest) Reset() { *m = ScheduleTransferRunsRequest{} } +func (m *ScheduleTransferRunsRequest) String() string { return proto.CompactTextString(m) } +func (*ScheduleTransferRunsRequest) ProtoMessage() {} +func (*ScheduleTransferRunsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{19} } + +func (m *ScheduleTransferRunsRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *ScheduleTransferRunsRequest) GetStartTime() *google_protobuf2.Timestamp { + if m != nil { + return m.StartTime + } + return nil +} + +func (m *ScheduleTransferRunsRequest) GetEndTime() *google_protobuf2.Timestamp { + if m != nil { + return m.EndTime + } + return nil +} + +// A response to schedule transfer runs for a time range. +type ScheduleTransferRunsResponse struct { + // The transfer runs that were scheduled. + Runs []*TransferRun `protobuf:"bytes,1,rep,name=runs" json:"runs,omitempty"` +} + +func (m *ScheduleTransferRunsResponse) Reset() { *m = ScheduleTransferRunsResponse{} } +func (m *ScheduleTransferRunsResponse) String() string { return proto.CompactTextString(m) } +func (*ScheduleTransferRunsResponse) ProtoMessage() {} +func (*ScheduleTransferRunsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20} } + +func (m *ScheduleTransferRunsResponse) GetRuns() []*TransferRun { + if m != nil { + return m.Runs + } + return nil +} + +func init() { + proto.RegisterType((*DataSourceParameter)(nil), "google.cloud.bigquery.datatransfer.v1.DataSourceParameter") + proto.RegisterType((*DataSource)(nil), "google.cloud.bigquery.datatransfer.v1.DataSource") + proto.RegisterType((*GetDataSourceRequest)(nil), "google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest") + proto.RegisterType((*ListDataSourcesRequest)(nil), "google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest") + proto.RegisterType((*ListDataSourcesResponse)(nil), "google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse") + proto.RegisterType((*CreateTransferConfigRequest)(nil), "google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest") + proto.RegisterType((*UpdateTransferConfigRequest)(nil), "google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest") + proto.RegisterType((*GetTransferConfigRequest)(nil), "google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest") + proto.RegisterType((*DeleteTransferConfigRequest)(nil), "google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest") + proto.RegisterType((*GetTransferRunRequest)(nil), "google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest") + proto.RegisterType((*DeleteTransferRunRequest)(nil), "google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest") + proto.RegisterType((*ListTransferConfigsRequest)(nil), "google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest") + proto.RegisterType((*ListTransferConfigsResponse)(nil), "google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse") + proto.RegisterType((*ListTransferRunsRequest)(nil), "google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest") + proto.RegisterType((*ListTransferRunsResponse)(nil), "google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse") + proto.RegisterType((*ListTransferLogsRequest)(nil), "google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest") + proto.RegisterType((*ListTransferLogsResponse)(nil), "google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse") + proto.RegisterType((*CheckValidCredsRequest)(nil), "google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest") + proto.RegisterType((*CheckValidCredsResponse)(nil), "google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse") + proto.RegisterType((*ScheduleTransferRunsRequest)(nil), "google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest") + proto.RegisterType((*ScheduleTransferRunsResponse)(nil), "google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse") + proto.RegisterEnum("google.cloud.bigquery.datatransfer.v1.DataSourceParameter_Type", DataSourceParameter_Type_name, DataSourceParameter_Type_value) + proto.RegisterEnum("google.cloud.bigquery.datatransfer.v1.DataSource_AuthorizationType", DataSource_AuthorizationType_name, DataSource_AuthorizationType_value) + proto.RegisterEnum("google.cloud.bigquery.datatransfer.v1.DataSource_DataRefreshType", DataSource_DataRefreshType_name, DataSource_DataRefreshType_value) + proto.RegisterEnum("google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest_RunAttempt", ListTransferRunsRequest_RunAttempt_name, ListTransferRunsRequest_RunAttempt_value) +} + +// 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 + +// Client API for DataTransferService service + +type DataTransferServiceClient interface { + // Retrieves a supported data source and returns its settings, + // which can be used for UI rendering. + GetDataSource(ctx context.Context, in *GetDataSourceRequest, opts ...grpc.CallOption) (*DataSource, error) + // Lists supported data sources and returns their settings, + // which can be used for UI rendering. + ListDataSources(ctx context.Context, in *ListDataSourcesRequest, opts ...grpc.CallOption) (*ListDataSourcesResponse, error) + // Creates a new data transfer configuration. + CreateTransferConfig(ctx context.Context, in *CreateTransferConfigRequest, opts ...grpc.CallOption) (*TransferConfig, error) + // Updates a data transfer configuration. + // All fields must be set, even if they are not updated. + UpdateTransferConfig(ctx context.Context, in *UpdateTransferConfigRequest, opts ...grpc.CallOption) (*TransferConfig, error) + // Deletes a data transfer configuration, + // including any associated transfer runs and logs. + DeleteTransferConfig(ctx context.Context, in *DeleteTransferConfigRequest, opts ...grpc.CallOption) (*google_protobuf5.Empty, error) + // Returns information about a data transfer config. + GetTransferConfig(ctx context.Context, in *GetTransferConfigRequest, opts ...grpc.CallOption) (*TransferConfig, error) + // Returns information about all data transfers in the project. + ListTransferConfigs(ctx context.Context, in *ListTransferConfigsRequest, opts ...grpc.CallOption) (*ListTransferConfigsResponse, error) + // Creates transfer runs for a time range [range_start_time, range_end_time]. + // For each date - or whatever granularity the data source supports - in the + // range, one transfer run is created. + // Note that runs are created per UTC time in the time range. + ScheduleTransferRuns(ctx context.Context, in *ScheduleTransferRunsRequest, opts ...grpc.CallOption) (*ScheduleTransferRunsResponse, error) + // Returns information about the particular transfer run. + GetTransferRun(ctx context.Context, in *GetTransferRunRequest, opts ...grpc.CallOption) (*TransferRun, error) + // Deletes the specified transfer run. + DeleteTransferRun(ctx context.Context, in *DeleteTransferRunRequest, opts ...grpc.CallOption) (*google_protobuf5.Empty, error) + // Returns information about running and completed jobs. + ListTransferRuns(ctx context.Context, in *ListTransferRunsRequest, opts ...grpc.CallOption) (*ListTransferRunsResponse, error) + // Returns user facing log messages for the data transfer run. + ListTransferLogs(ctx context.Context, in *ListTransferLogsRequest, opts ...grpc.CallOption) (*ListTransferLogsResponse, error) + // Returns true if valid credentials exist for the given data source and + // requesting user. + // Some data sources doesn't support service account, so we need to talk to + // them on behalf of the end user. This API just checks whether we have OAuth + // token for the particular user, which is a pre-requisite before user can + // create a transfer config. + CheckValidCreds(ctx context.Context, in *CheckValidCredsRequest, opts ...grpc.CallOption) (*CheckValidCredsResponse, error) +} + +type dataTransferServiceClient struct { + cc *grpc.ClientConn +} + +func NewDataTransferServiceClient(cc *grpc.ClientConn) DataTransferServiceClient { + return &dataTransferServiceClient{cc} +} + +func (c *dataTransferServiceClient) GetDataSource(ctx context.Context, in *GetDataSourceRequest, opts ...grpc.CallOption) (*DataSource, error) { + out := new(DataSource) + err := grpc.Invoke(ctx, "/google.cloud.bigquery.datatransfer.v1.DataTransferService/GetDataSource", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dataTransferServiceClient) ListDataSources(ctx context.Context, in *ListDataSourcesRequest, opts ...grpc.CallOption) (*ListDataSourcesResponse, error) { + out := new(ListDataSourcesResponse) + err := grpc.Invoke(ctx, "/google.cloud.bigquery.datatransfer.v1.DataTransferService/ListDataSources", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dataTransferServiceClient) CreateTransferConfig(ctx context.Context, in *CreateTransferConfigRequest, opts ...grpc.CallOption) (*TransferConfig, error) { + out := new(TransferConfig) + err := grpc.Invoke(ctx, "/google.cloud.bigquery.datatransfer.v1.DataTransferService/CreateTransferConfig", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dataTransferServiceClient) UpdateTransferConfig(ctx context.Context, in *UpdateTransferConfigRequest, opts ...grpc.CallOption) (*TransferConfig, error) { + out := new(TransferConfig) + err := grpc.Invoke(ctx, "/google.cloud.bigquery.datatransfer.v1.DataTransferService/UpdateTransferConfig", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dataTransferServiceClient) DeleteTransferConfig(ctx context.Context, in *DeleteTransferConfigRequest, opts ...grpc.CallOption) (*google_protobuf5.Empty, error) { + out := new(google_protobuf5.Empty) + err := grpc.Invoke(ctx, "/google.cloud.bigquery.datatransfer.v1.DataTransferService/DeleteTransferConfig", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dataTransferServiceClient) GetTransferConfig(ctx context.Context, in *GetTransferConfigRequest, opts ...grpc.CallOption) (*TransferConfig, error) { + out := new(TransferConfig) + err := grpc.Invoke(ctx, "/google.cloud.bigquery.datatransfer.v1.DataTransferService/GetTransferConfig", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dataTransferServiceClient) ListTransferConfigs(ctx context.Context, in *ListTransferConfigsRequest, opts ...grpc.CallOption) (*ListTransferConfigsResponse, error) { + out := new(ListTransferConfigsResponse) + err := grpc.Invoke(ctx, "/google.cloud.bigquery.datatransfer.v1.DataTransferService/ListTransferConfigs", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dataTransferServiceClient) ScheduleTransferRuns(ctx context.Context, in *ScheduleTransferRunsRequest, opts ...grpc.CallOption) (*ScheduleTransferRunsResponse, error) { + out := new(ScheduleTransferRunsResponse) + err := grpc.Invoke(ctx, "/google.cloud.bigquery.datatransfer.v1.DataTransferService/ScheduleTransferRuns", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dataTransferServiceClient) GetTransferRun(ctx context.Context, in *GetTransferRunRequest, opts ...grpc.CallOption) (*TransferRun, error) { + out := new(TransferRun) + err := grpc.Invoke(ctx, "/google.cloud.bigquery.datatransfer.v1.DataTransferService/GetTransferRun", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dataTransferServiceClient) DeleteTransferRun(ctx context.Context, in *DeleteTransferRunRequest, opts ...grpc.CallOption) (*google_protobuf5.Empty, error) { + out := new(google_protobuf5.Empty) + err := grpc.Invoke(ctx, "/google.cloud.bigquery.datatransfer.v1.DataTransferService/DeleteTransferRun", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dataTransferServiceClient) ListTransferRuns(ctx context.Context, in *ListTransferRunsRequest, opts ...grpc.CallOption) (*ListTransferRunsResponse, error) { + out := new(ListTransferRunsResponse) + err := grpc.Invoke(ctx, "/google.cloud.bigquery.datatransfer.v1.DataTransferService/ListTransferRuns", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dataTransferServiceClient) ListTransferLogs(ctx context.Context, in *ListTransferLogsRequest, opts ...grpc.CallOption) (*ListTransferLogsResponse, error) { + out := new(ListTransferLogsResponse) + err := grpc.Invoke(ctx, "/google.cloud.bigquery.datatransfer.v1.DataTransferService/ListTransferLogs", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dataTransferServiceClient) CheckValidCreds(ctx context.Context, in *CheckValidCredsRequest, opts ...grpc.CallOption) (*CheckValidCredsResponse, error) { + out := new(CheckValidCredsResponse) + err := grpc.Invoke(ctx, "/google.cloud.bigquery.datatransfer.v1.DataTransferService/CheckValidCreds", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for DataTransferService service + +type DataTransferServiceServer interface { + // Retrieves a supported data source and returns its settings, + // which can be used for UI rendering. + GetDataSource(context.Context, *GetDataSourceRequest) (*DataSource, error) + // Lists supported data sources and returns their settings, + // which can be used for UI rendering. + ListDataSources(context.Context, *ListDataSourcesRequest) (*ListDataSourcesResponse, error) + // Creates a new data transfer configuration. + CreateTransferConfig(context.Context, *CreateTransferConfigRequest) (*TransferConfig, error) + // Updates a data transfer configuration. + // All fields must be set, even if they are not updated. + UpdateTransferConfig(context.Context, *UpdateTransferConfigRequest) (*TransferConfig, error) + // Deletes a data transfer configuration, + // including any associated transfer runs and logs. + DeleteTransferConfig(context.Context, *DeleteTransferConfigRequest) (*google_protobuf5.Empty, error) + // Returns information about a data transfer config. + GetTransferConfig(context.Context, *GetTransferConfigRequest) (*TransferConfig, error) + // Returns information about all data transfers in the project. + ListTransferConfigs(context.Context, *ListTransferConfigsRequest) (*ListTransferConfigsResponse, error) + // Creates transfer runs for a time range [range_start_time, range_end_time]. + // For each date - or whatever granularity the data source supports - in the + // range, one transfer run is created. + // Note that runs are created per UTC time in the time range. + ScheduleTransferRuns(context.Context, *ScheduleTransferRunsRequest) (*ScheduleTransferRunsResponse, error) + // Returns information about the particular transfer run. + GetTransferRun(context.Context, *GetTransferRunRequest) (*TransferRun, error) + // Deletes the specified transfer run. + DeleteTransferRun(context.Context, *DeleteTransferRunRequest) (*google_protobuf5.Empty, error) + // Returns information about running and completed jobs. + ListTransferRuns(context.Context, *ListTransferRunsRequest) (*ListTransferRunsResponse, error) + // Returns user facing log messages for the data transfer run. + ListTransferLogs(context.Context, *ListTransferLogsRequest) (*ListTransferLogsResponse, error) + // Returns true if valid credentials exist for the given data source and + // requesting user. + // Some data sources doesn't support service account, so we need to talk to + // them on behalf of the end user. This API just checks whether we have OAuth + // token for the particular user, which is a pre-requisite before user can + // create a transfer config. + CheckValidCreds(context.Context, *CheckValidCredsRequest) (*CheckValidCredsResponse, error) +} + +func RegisterDataTransferServiceServer(s *grpc.Server, srv DataTransferServiceServer) { + s.RegisterService(&_DataTransferService_serviceDesc, srv) +} + +func _DataTransferService_GetDataSource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetDataSourceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DataTransferServiceServer).GetDataSource(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.bigquery.datatransfer.v1.DataTransferService/GetDataSource", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DataTransferServiceServer).GetDataSource(ctx, req.(*GetDataSourceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DataTransferService_ListDataSources_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListDataSourcesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DataTransferServiceServer).ListDataSources(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.bigquery.datatransfer.v1.DataTransferService/ListDataSources", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DataTransferServiceServer).ListDataSources(ctx, req.(*ListDataSourcesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DataTransferService_CreateTransferConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateTransferConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DataTransferServiceServer).CreateTransferConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.bigquery.datatransfer.v1.DataTransferService/CreateTransferConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DataTransferServiceServer).CreateTransferConfig(ctx, req.(*CreateTransferConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DataTransferService_UpdateTransferConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateTransferConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DataTransferServiceServer).UpdateTransferConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.bigquery.datatransfer.v1.DataTransferService/UpdateTransferConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DataTransferServiceServer).UpdateTransferConfig(ctx, req.(*UpdateTransferConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DataTransferService_DeleteTransferConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteTransferConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DataTransferServiceServer).DeleteTransferConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.bigquery.datatransfer.v1.DataTransferService/DeleteTransferConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DataTransferServiceServer).DeleteTransferConfig(ctx, req.(*DeleteTransferConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DataTransferService_GetTransferConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetTransferConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DataTransferServiceServer).GetTransferConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.bigquery.datatransfer.v1.DataTransferService/GetTransferConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DataTransferServiceServer).GetTransferConfig(ctx, req.(*GetTransferConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DataTransferService_ListTransferConfigs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListTransferConfigsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DataTransferServiceServer).ListTransferConfigs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.bigquery.datatransfer.v1.DataTransferService/ListTransferConfigs", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DataTransferServiceServer).ListTransferConfigs(ctx, req.(*ListTransferConfigsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DataTransferService_ScheduleTransferRuns_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ScheduleTransferRunsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DataTransferServiceServer).ScheduleTransferRuns(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.bigquery.datatransfer.v1.DataTransferService/ScheduleTransferRuns", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DataTransferServiceServer).ScheduleTransferRuns(ctx, req.(*ScheduleTransferRunsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DataTransferService_GetTransferRun_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetTransferRunRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DataTransferServiceServer).GetTransferRun(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.bigquery.datatransfer.v1.DataTransferService/GetTransferRun", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DataTransferServiceServer).GetTransferRun(ctx, req.(*GetTransferRunRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DataTransferService_DeleteTransferRun_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteTransferRunRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DataTransferServiceServer).DeleteTransferRun(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.bigquery.datatransfer.v1.DataTransferService/DeleteTransferRun", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DataTransferServiceServer).DeleteTransferRun(ctx, req.(*DeleteTransferRunRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DataTransferService_ListTransferRuns_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListTransferRunsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DataTransferServiceServer).ListTransferRuns(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.bigquery.datatransfer.v1.DataTransferService/ListTransferRuns", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DataTransferServiceServer).ListTransferRuns(ctx, req.(*ListTransferRunsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DataTransferService_ListTransferLogs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListTransferLogsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DataTransferServiceServer).ListTransferLogs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.bigquery.datatransfer.v1.DataTransferService/ListTransferLogs", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DataTransferServiceServer).ListTransferLogs(ctx, req.(*ListTransferLogsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DataTransferService_CheckValidCreds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CheckValidCredsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DataTransferServiceServer).CheckValidCreds(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.bigquery.datatransfer.v1.DataTransferService/CheckValidCreds", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DataTransferServiceServer).CheckValidCreds(ctx, req.(*CheckValidCredsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _DataTransferService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.cloud.bigquery.datatransfer.v1.DataTransferService", + HandlerType: (*DataTransferServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetDataSource", + Handler: _DataTransferService_GetDataSource_Handler, + }, + { + MethodName: "ListDataSources", + Handler: _DataTransferService_ListDataSources_Handler, + }, + { + MethodName: "CreateTransferConfig", + Handler: _DataTransferService_CreateTransferConfig_Handler, + }, + { + MethodName: "UpdateTransferConfig", + Handler: _DataTransferService_UpdateTransferConfig_Handler, + }, + { + MethodName: "DeleteTransferConfig", + Handler: _DataTransferService_DeleteTransferConfig_Handler, + }, + { + MethodName: "GetTransferConfig", + Handler: _DataTransferService_GetTransferConfig_Handler, + }, + { + MethodName: "ListTransferConfigs", + Handler: _DataTransferService_ListTransferConfigs_Handler, + }, + { + MethodName: "ScheduleTransferRuns", + Handler: _DataTransferService_ScheduleTransferRuns_Handler, + }, + { + MethodName: "GetTransferRun", + Handler: _DataTransferService_GetTransferRun_Handler, + }, + { + MethodName: "DeleteTransferRun", + Handler: _DataTransferService_DeleteTransferRun_Handler, + }, + { + MethodName: "ListTransferRuns", + Handler: _DataTransferService_ListTransferRuns_Handler, + }, + { + MethodName: "ListTransferLogs", + Handler: _DataTransferService_ListTransferLogs_Handler, + }, + { + MethodName: "CheckValidCreds", + Handler: _DataTransferService_CheckValidCreds_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/cloud/bigquery/datatransfer/v1/datatransfer.proto", +} + +func init() { + proto.RegisterFile("google/cloud/bigquery/datatransfer/v1/datatransfer.proto", fileDescriptor0) +} + +var fileDescriptor0 = []byte{ + // 2233 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x59, 0x4f, 0x73, 0x1b, 0x49, + 0x15, 0x67, 0xfc, 0x5f, 0x4f, 0xb6, 0x24, 0x77, 0x1c, 0x67, 0x22, 0x67, 0x17, 0xef, 0x14, 0x49, + 0x79, 0x0d, 0x48, 0x58, 0xd9, 0x2c, 0xbb, 0xce, 0x6e, 0x52, 0xb2, 0x24, 0x3b, 0x02, 0xdb, 0x72, + 0x46, 0x72, 0x02, 0xa9, 0x14, 0x43, 0x47, 0xd3, 0x96, 0x67, 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79, 0x5c, 0x51, 0x20, 0x53, 0x7d, 0x8b, 0x96, 0x85, 0x04, 0x1d, 0xc2, + 0xcd, 0xb6, 0x61, 0x19, 0x6d, 0xbf, 0x9b, 0x05, 0x9a, 0x61, 0x79, 0xc4, 0x3d, 0xc5, 0xa6, 0x8c, + 0x78, 0xdb, 0xbd, 0x39, 0xd8, 0x76, 0xc5, 0xe5, 0xad, 0xde, 0x10, 0xb6, 0x61, 0x8a, 0x54, 0x85, + 0xa5, 0x42, 0x61, 0x71, 0xe0, 0x9c, 0x91, 0x02, 0xef, 0x16, 0x0f, 0x1b, 0x8f, 0x6a, 0x6a, 0xf5, + 0x59, 0xb1, 0x51, 0xad, 0xed, 0x6b, 0x31, 0xad, 0x6a, 0x19, 0x50, 0xaf, 0x4e, 0xa9, 0x56, 0xae, + 0x64, 0x24, 0x66, 0xbb, 0x53, 0xab, 0xed, 0xec, 0x56, 0x34, 0xde, 0x8b, 0x62, 0x74, 0x26, 0x94, + 0x26, 0xa4, 0xfb, 0x4e, 0x1a, 0xbd, 0x07, 0xef, 0x94, 0x8b, 0x8d, 0xa2, 0xa6, 0x56, 0xb6, 0xd5, + 0x4a, 0xfd, 0x51, 0xdc, 0x8e, 0x08, 0x52, 0xf5, 0xdd, 0x6a, 0xb9, 0xba, 0xbf, 0xa3, 0x3d, 0xad, + 0xee, 0x97, 0x6b, 0x4f, 0x33, 0x12, 0xba, 0x09, 0xd7, 0x4b, 0x87, 0xf5, 0x46, 0x6d, 0x4f, 0xeb, + 0x13, 0x4d, 0x28, 0xeb, 0xb0, 0xb4, 0x43, 0xbc, 0x6e, 0x70, 0x55, 0xf2, 0xd2, 0x27, 0xd4, 0x8b, + 0xeb, 0x83, 0x8a, 0x09, 0xcb, 0xbb, 0x06, 0x8d, 0x28, 0xd3, 0x50, 0x7b, 0x19, 0x66, 0x1c, 0xec, + 0x12, 0xcb, 0x13, 0xfa, 0x62, 0x84, 0xde, 0x61, 0x25, 0xd6, 0x22, 0x9a, 0x67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xed, 0x45, 0x82, 0xf5, 0x06, 0x63, 0xd4, 0x04, + 0xe3, 0xe0, 0xd0, 0x3f, 0xfb, 0x90, 0x31, 0xfe, 0x3c, 0x16, 0xb2, 0xc8, 0xab, 0x62, 0x2c, 0x64, + 0x51, 0xe2, 0xae, 0x3c, 0xe6, 0xc8, 0xbe, 0x89, 0xaa, 0xe3, 0x20, 0x0b, 0xa3, 0xd6, 0x91, 0x70, + 0x4c, 0x7f, 0x91, 0x20, 0xdd, 0xc7, 0xa8, 0x87, 0x26, 0x4a, 0xf1, 0xbc, 0x7d, 0x68, 0xa2, 0x74, + 0x0e, 0x91, 0x57, 0xbe, 0xc1, 0x51, 0x96, 0x95, 0x87, 0x23, 0x92, 0xbe, 0xcd, 0x66, 0xef, 0x82, + 0x9b, 0xd2, 0xfa, 0xd6, 0xdf, 0x25, 0x78, 0xbf, 0x69, 0xb7, 0x87, 0xf3, 0x68, 0x6b, 0x31, 0xca, + 0x82, 0x0f, 0x58, 0xbd, 0x1c, 0x48, 0xcf, 0x1e, 0x0b, 0xdb, 0x96, 0x6d, 0x62, 0xab, 0x95, 0xb3, + 0xdd, 0x56, 0xbe, 0x45, 0x2c, 0x5e, 0x4d, 0xf9, 0x40, 0x84, 0x1d, 0x83, 0x5e, 0xf2, 0x1f, 0xe3, + 0xfb, 0xd1, 0xf1, 0xcf, 0x26, 0x6e, 0xef, 0x04, 0x6b, 0x96, 0xb8, 0x3f, 0x5b, 0x46, 0xeb, 0x31, + 0xf7, 0x27, 0xba, 0x7d, 0xee, 0xc9, 0xc6, 0xef, 0x42, 0xbd, 0xe7, 0x5c, 0xef, 0x79, 0xa8, 0xf7, + 0x3c, 0xaa, 0xf7, 0xfc, 0xc9, 0xc6, 0x8b, 0x19, 0xee, 0xcd, 0xdd, 0xff, 0x05, 0x00, 0x00, 0xff, + 0xff, 0xa8, 0x04, 0x35, 0x66, 0x3d, 0x1f, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/bigquery/datatransfer/v1/transfer.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/bigquery/datatransfer/v1/transfer.pb.go new file mode 100644 index 0000000000..dabe0fe9ad --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/bigquery/datatransfer/v1/transfer.pb.go @@ -0,0 +1,521 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/bigquery/datatransfer/v1/transfer.proto + +package datatransfer + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf1 "github.com/golang/protobuf/ptypes/struct" +import google_protobuf2 "github.com/golang/protobuf/ptypes/timestamp" +import _ "google.golang.org/genproto/googleapis/rpc/status" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Represents data transfer type. +type TransferType int32 + +const ( + // Invalid or Unknown transfer type placeholder. + TransferType_TRANSFER_TYPE_UNSPECIFIED TransferType = 0 + // Batch data transfer. + TransferType_BATCH TransferType = 1 + // Streaming data transfer. Streaming data source currently doesn't + // support multiple transfer configs per project. + TransferType_STREAMING TransferType = 2 +) + +var TransferType_name = map[int32]string{ + 0: "TRANSFER_TYPE_UNSPECIFIED", + 1: "BATCH", + 2: "STREAMING", +} +var TransferType_value = map[string]int32{ + "TRANSFER_TYPE_UNSPECIFIED": 0, + "BATCH": 1, + "STREAMING": 2, +} + +func (x TransferType) String() string { + return proto.EnumName(TransferType_name, int32(x)) +} +func (TransferType) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +// Represents data transfer run state. +type TransferState int32 + +const ( + // State placeholder. + TransferState_TRANSFER_STATE_UNSPECIFIED TransferState = 0 + // Data transfer is inactive. + TransferState_INACTIVE TransferState = 1 + // Data transfer is scheduled and is waiting to be picked up by + // data transfer backend. + TransferState_PENDING TransferState = 2 + // Data transfer is in progress. + TransferState_RUNNING TransferState = 3 + // Data transfer completed successsfully. + TransferState_SUCCEEDED TransferState = 4 + // Data transfer failed. + TransferState_FAILED TransferState = 5 + // Data transfer is cancelled. + TransferState_CANCELLED TransferState = 6 +) + +var TransferState_name = map[int32]string{ + 0: "TRANSFER_STATE_UNSPECIFIED", + 1: "INACTIVE", + 2: "PENDING", + 3: "RUNNING", + 4: "SUCCEEDED", + 5: "FAILED", + 6: "CANCELLED", +} +var TransferState_value = map[string]int32{ + "TRANSFER_STATE_UNSPECIFIED": 0, + "INACTIVE": 1, + "PENDING": 2, + "RUNNING": 3, + "SUCCEEDED": 4, + "FAILED": 5, + "CANCELLED": 6, +} + +func (x TransferState) String() string { + return proto.EnumName(TransferState_name, int32(x)) +} +func (TransferState) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{1} } + +// Represents data transfer user facing message severity. +type TransferMessage_MessageSeverity int32 + +const ( + // No severity specified. + TransferMessage_MESSAGE_SEVERITY_UNSPECIFIED TransferMessage_MessageSeverity = 0 + // Informational message. + TransferMessage_INFO TransferMessage_MessageSeverity = 1 + // Warning message. + TransferMessage_WARNING TransferMessage_MessageSeverity = 2 + // Error message. + TransferMessage_ERROR TransferMessage_MessageSeverity = 3 +) + +var TransferMessage_MessageSeverity_name = map[int32]string{ + 0: "MESSAGE_SEVERITY_UNSPECIFIED", + 1: "INFO", + 2: "WARNING", + 3: "ERROR", +} +var TransferMessage_MessageSeverity_value = map[string]int32{ + "MESSAGE_SEVERITY_UNSPECIFIED": 0, + "INFO": 1, + "WARNING": 2, + "ERROR": 3, +} + +func (x TransferMessage_MessageSeverity) String() string { + return proto.EnumName(TransferMessage_MessageSeverity_name, int32(x)) +} +func (TransferMessage_MessageSeverity) EnumDescriptor() ([]byte, []int) { + return fileDescriptor1, []int{2, 0} +} + +// Represents a data transfer configuration. A transfer configuration +// contains all metadata needed to perform a data transfer. For example, +// `destination_dataset_id` specifies where data should be stored. +// When a new transfer configuration is created, the specified +// `destination_dataset_id` is created when needed and shared with the +// appropriate data source service account. +type TransferConfig struct { + // The resource name of the transfer config. + // Transfer config names have the form + // `projects/{project_id}/transferConfigs/{config_id}`. + // Where `config_id` is usually a uuid, even though it is not + // guaranteed or required. The name is ignored when creating a transfer + // config. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The BigQuery target dataset id. + DestinationDatasetId string `protobuf:"bytes,2,opt,name=destination_dataset_id,json=destinationDatasetId" json:"destination_dataset_id,omitempty"` + // User specified display name for the data transfer. + DisplayName string `protobuf:"bytes,3,opt,name=display_name,json=displayName" json:"display_name,omitempty"` + // Data source id. Cannot be changed once data transfer is created. + DataSourceId string `protobuf:"bytes,5,opt,name=data_source_id,json=dataSourceId" json:"data_source_id,omitempty"` + // Data transfer specific parameters. + Params *google_protobuf1.Struct `protobuf:"bytes,9,opt,name=params" json:"params,omitempty"` + // Data transfer schedule. + // If the data source does not support a custom schedule, this should be + // empty. If it is empty, the default value for the data source will be + // used. + // The specified times are in UTC. + // Examples of valid format: + // `1st,3rd monday of month 15:30`, + // `every wed,fri of jan,jun 13:15`, and + // `first sunday of quarter 00:00`. + // See more explanation about the format here: + // https://cloud.google.com/appengine/docs/flexible/python/scheduling-jobs-with-cron-yaml#the_schedule_format + // NOTE: the granularity should be at least 8 hours, or less frequent. + Schedule string `protobuf:"bytes,7,opt,name=schedule" json:"schedule,omitempty"` + // The number of days to look back to automatically refresh the data. + // For example, if `data_refresh_window_days = 10`, then every day + // BigQuery reingests data for [today-10, today-1], rather than ingesting data + // for just [today-1]. + // Only valid if the data source supports the feature. Set the value to 0 + // to use the default value. + DataRefreshWindowDays int32 `protobuf:"varint,12,opt,name=data_refresh_window_days,json=dataRefreshWindowDays" json:"data_refresh_window_days,omitempty"` + // Is this config disabled. When set to true, no runs are scheduled + // for a given transfer. + Disabled bool `protobuf:"varint,13,opt,name=disabled" json:"disabled,omitempty"` + // Output only. Data transfer modification time. Ignored by server on input. + UpdateTime *google_protobuf2.Timestamp `protobuf:"bytes,4,opt,name=update_time,json=updateTime" json:"update_time,omitempty"` + // Output only. Next time when data transfer will run. + NextRunTime *google_protobuf2.Timestamp `protobuf:"bytes,8,opt,name=next_run_time,json=nextRunTime" json:"next_run_time,omitempty"` + // Output only. State of the most recently updated transfer run. + State TransferState `protobuf:"varint,10,opt,name=state,enum=google.cloud.bigquery.datatransfer.v1.TransferState" json:"state,omitempty"` + // Output only. Unique ID of the user on whose behalf transfer is done. + // Applicable only to data sources that do not support service accounts. + // When set to 0, the data source service account credentials are used. + UserId int64 `protobuf:"varint,11,opt,name=user_id,json=userId" json:"user_id,omitempty"` + // Output only. Region in which BigQuery dataset is located. + DatasetRegion string `protobuf:"bytes,14,opt,name=dataset_region,json=datasetRegion" json:"dataset_region,omitempty"` +} + +func (m *TransferConfig) Reset() { *m = TransferConfig{} } +func (m *TransferConfig) String() string { return proto.CompactTextString(m) } +func (*TransferConfig) ProtoMessage() {} +func (*TransferConfig) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +func (m *TransferConfig) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *TransferConfig) GetDestinationDatasetId() string { + if m != nil { + return m.DestinationDatasetId + } + return "" +} + +func (m *TransferConfig) GetDisplayName() string { + if m != nil { + return m.DisplayName + } + return "" +} + +func (m *TransferConfig) GetDataSourceId() string { + if m != nil { + return m.DataSourceId + } + return "" +} + +func (m *TransferConfig) GetParams() *google_protobuf1.Struct { + if m != nil { + return m.Params + } + return nil +} + +func (m *TransferConfig) GetSchedule() string { + if m != nil { + return m.Schedule + } + return "" +} + +func (m *TransferConfig) GetDataRefreshWindowDays() int32 { + if m != nil { + return m.DataRefreshWindowDays + } + return 0 +} + +func (m *TransferConfig) GetDisabled() bool { + if m != nil { + return m.Disabled + } + return false +} + +func (m *TransferConfig) GetUpdateTime() *google_protobuf2.Timestamp { + if m != nil { + return m.UpdateTime + } + return nil +} + +func (m *TransferConfig) GetNextRunTime() *google_protobuf2.Timestamp { + if m != nil { + return m.NextRunTime + } + return nil +} + +func (m *TransferConfig) GetState() TransferState { + if m != nil { + return m.State + } + return TransferState_TRANSFER_STATE_UNSPECIFIED +} + +func (m *TransferConfig) GetUserId() int64 { + if m != nil { + return m.UserId + } + return 0 +} + +func (m *TransferConfig) GetDatasetRegion() string { + if m != nil { + return m.DatasetRegion + } + return "" +} + +// Represents a data transfer run. +// Next id: 23 +type TransferRun struct { + // The resource name of the transfer run. + // Transfer run names have the form + // `projects/{project_id}/locations/{location}/transferConfigs/{config_id}/runs/{run_id}`. + // The name is ignored when creating a transfer run. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The BigQuery target dataset id. + DestinationDatasetId string `protobuf:"bytes,2,opt,name=destination_dataset_id,json=destinationDatasetId" json:"destination_dataset_id,omitempty"` + // Minimum time after which a transfer run can be started. + ScheduleTime *google_protobuf2.Timestamp `protobuf:"bytes,3,opt,name=schedule_time,json=scheduleTime" json:"schedule_time,omitempty"` + // Data transfer specific parameters. + Params *google_protobuf1.Struct `protobuf:"bytes,9,opt,name=params" json:"params,omitempty"` + // For batch transfer runs, specifies the date and time that + // data should be ingested. + RunTime *google_protobuf2.Timestamp `protobuf:"bytes,10,opt,name=run_time,json=runTime" json:"run_time,omitempty"` + // Output only. Time when transfer run was started. + // Parameter ignored by server for input requests. + StartTime *google_protobuf2.Timestamp `protobuf:"bytes,4,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + // Output only. Time when transfer run ended. + // Parameter ignored by server for input requests. + EndTime *google_protobuf2.Timestamp `protobuf:"bytes,5,opt,name=end_time,json=endTime" json:"end_time,omitempty"` + // Output only. Last time the data transfer run state was updated. + UpdateTime *google_protobuf2.Timestamp `protobuf:"bytes,6,opt,name=update_time,json=updateTime" json:"update_time,omitempty"` + // Output only. Data source id. + DataSourceId string `protobuf:"bytes,7,opt,name=data_source_id,json=dataSourceId" json:"data_source_id,omitempty"` + // Data transfer run state. Ignored for input requests. + State TransferState `protobuf:"varint,8,opt,name=state,enum=google.cloud.bigquery.datatransfer.v1.TransferState" json:"state,omitempty"` + // Output only. Unique ID of the user on whose behalf transfer is done. + // Applicable only to data sources that do not support service accounts. + // When set to 0, the data source service account credentials are used. + // May be negative. + UserId int64 `protobuf:"varint,11,opt,name=user_id,json=userId" json:"user_id,omitempty"` + // Output only. Describes the schedule of this transfer run if it was + // created as part of a regular schedule. For batch transfer runs that are + // scheduled manually, this is empty. + // NOTE: the system might choose to delay the schedule depending on the + // current load, so `schedule_time` doesn't always matches this. + Schedule string `protobuf:"bytes,12,opt,name=schedule" json:"schedule,omitempty"` +} + +func (m *TransferRun) Reset() { *m = TransferRun{} } +func (m *TransferRun) String() string { return proto.CompactTextString(m) } +func (*TransferRun) ProtoMessage() {} +func (*TransferRun) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} } + +func (m *TransferRun) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *TransferRun) GetDestinationDatasetId() string { + if m != nil { + return m.DestinationDatasetId + } + return "" +} + +func (m *TransferRun) GetScheduleTime() *google_protobuf2.Timestamp { + if m != nil { + return m.ScheduleTime + } + return nil +} + +func (m *TransferRun) GetParams() *google_protobuf1.Struct { + if m != nil { + return m.Params + } + return nil +} + +func (m *TransferRun) GetRunTime() *google_protobuf2.Timestamp { + if m != nil { + return m.RunTime + } + return nil +} + +func (m *TransferRun) GetStartTime() *google_protobuf2.Timestamp { + if m != nil { + return m.StartTime + } + return nil +} + +func (m *TransferRun) GetEndTime() *google_protobuf2.Timestamp { + if m != nil { + return m.EndTime + } + return nil +} + +func (m *TransferRun) GetUpdateTime() *google_protobuf2.Timestamp { + if m != nil { + return m.UpdateTime + } + return nil +} + +func (m *TransferRun) GetDataSourceId() string { + if m != nil { + return m.DataSourceId + } + return "" +} + +func (m *TransferRun) GetState() TransferState { + if m != nil { + return m.State + } + return TransferState_TRANSFER_STATE_UNSPECIFIED +} + +func (m *TransferRun) GetUserId() int64 { + if m != nil { + return m.UserId + } + return 0 +} + +func (m *TransferRun) GetSchedule() string { + if m != nil { + return m.Schedule + } + return "" +} + +// Represents a user facing message for a particular data transfer run. +type TransferMessage struct { + // Time when message was logged. + MessageTime *google_protobuf2.Timestamp `protobuf:"bytes,1,opt,name=message_time,json=messageTime" json:"message_time,omitempty"` + // Message severity. + Severity TransferMessage_MessageSeverity `protobuf:"varint,2,opt,name=severity,enum=google.cloud.bigquery.datatransfer.v1.TransferMessage_MessageSeverity" json:"severity,omitempty"` + // Message text. + MessageText string `protobuf:"bytes,3,opt,name=message_text,json=messageText" json:"message_text,omitempty"` +} + +func (m *TransferMessage) Reset() { *m = TransferMessage{} } +func (m *TransferMessage) String() string { return proto.CompactTextString(m) } +func (*TransferMessage) ProtoMessage() {} +func (*TransferMessage) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} } + +func (m *TransferMessage) GetMessageTime() *google_protobuf2.Timestamp { + if m != nil { + return m.MessageTime + } + return nil +} + +func (m *TransferMessage) GetSeverity() TransferMessage_MessageSeverity { + if m != nil { + return m.Severity + } + return TransferMessage_MESSAGE_SEVERITY_UNSPECIFIED +} + +func (m *TransferMessage) GetMessageText() string { + if m != nil { + return m.MessageText + } + return "" +} + +func init() { + proto.RegisterType((*TransferConfig)(nil), "google.cloud.bigquery.datatransfer.v1.TransferConfig") + proto.RegisterType((*TransferRun)(nil), "google.cloud.bigquery.datatransfer.v1.TransferRun") + proto.RegisterType((*TransferMessage)(nil), "google.cloud.bigquery.datatransfer.v1.TransferMessage") + proto.RegisterEnum("google.cloud.bigquery.datatransfer.v1.TransferType", TransferType_name, TransferType_value) + proto.RegisterEnum("google.cloud.bigquery.datatransfer.v1.TransferState", TransferState_name, TransferState_value) + proto.RegisterEnum("google.cloud.bigquery.datatransfer.v1.TransferMessage_MessageSeverity", TransferMessage_MessageSeverity_name, TransferMessage_MessageSeverity_value) +} + +func init() { + proto.RegisterFile("google/cloud/bigquery/datatransfer/v1/transfer.proto", fileDescriptor1) +} + +var fileDescriptor1 = []byte{ + // 910 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xdf, 0x6e, 0xe3, 0xc4, + 0x17, 0xfe, 0xb9, 0xf9, 0x7f, 0xf2, 0x67, 0xa3, 0xd1, 0x0f, 0x6a, 0xaa, 0x05, 0x42, 0x45, 0xa5, + 0xb0, 0x17, 0xb6, 0x5a, 0xba, 0x42, 0x68, 0x05, 0x28, 0x71, 0x9c, 0x60, 0xb4, 0xf5, 0x66, 0xc7, + 0x6e, 0x57, 0x8b, 0x2a, 0x59, 0x93, 0x78, 0xea, 0xb5, 0x94, 0xd8, 0xc1, 0x33, 0xee, 0x36, 0x97, + 0xbc, 0x0a, 0x97, 0x5c, 0xf0, 0x20, 0x5c, 0x70, 0xc9, 0x2b, 0xf0, 0x1a, 0x68, 0xc6, 0x76, 0x94, + 0xcd, 0x22, 0xa5, 0x95, 0xe0, 0x2a, 0x9e, 0x73, 0xbe, 0xef, 0x9b, 0x6f, 0xce, 0x39, 0x33, 0x81, + 0xf3, 0x20, 0x8e, 0x83, 0x05, 0xd5, 0xe7, 0x8b, 0x38, 0xf5, 0xf5, 0x59, 0x18, 0xfc, 0x94, 0xd2, + 0x64, 0xad, 0xfb, 0x84, 0x13, 0x9e, 0x90, 0x88, 0xdd, 0xd0, 0x44, 0xbf, 0x3d, 0xd5, 0x8b, 0x6f, + 0x6d, 0x95, 0xc4, 0x3c, 0x46, 0x27, 0x19, 0x4b, 0x93, 0x2c, 0xad, 0x60, 0x69, 0xdb, 0x2c, 0xed, + 0xf6, 0xf4, 0xe8, 0x71, 0x2e, 0x4e, 0x56, 0xa1, 0x4e, 0xa2, 0x28, 0xe6, 0x84, 0x87, 0x71, 0xc4, + 0x32, 0x91, 0x4d, 0x56, 0xae, 0x66, 0xe9, 0x8d, 0xce, 0x78, 0x92, 0xce, 0x79, 0x9e, 0xfd, 0x74, + 0x37, 0xcb, 0xc3, 0x25, 0x65, 0x9c, 0x2c, 0x57, 0x39, 0xe0, 0x30, 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 0x6c, 0x0e, 0x2e, 0xa4, 0xe6, + 0x93, 0x9f, 0x15, 0x68, 0xbf, 0xd3, 0x47, 0xf4, 0x09, 0x1c, 0x6d, 0xa4, 0x1c, 0x77, 0xe0, 0xee, + 0x6a, 0xb5, 0xa0, 0x6e, 0xd9, 0x03, 0xc3, 0xb5, 0xae, 0xcc, 0xcc, 0xe0, 0xd4, 0xb4, 0x47, 0x99, + 0xc1, 0x26, 0xd4, 0xf0, 0xa5, 0x2d, 0xdd, 0x96, 0xe4, 0x46, 0x97, 0x86, 0x61, 0x9a, 0x23, 0x73, + 0xd4, 0x2d, 0x23, 0x80, 0xea, 0x78, 0x60, 0x3d, 0x37, 0x47, 0xdd, 0x8a, 0x48, 0x19, 0x03, 0xdb, + 0x30, 0x9f, 0x8b, 0x65, 0x75, 0xf8, 0x97, 0x02, 0x5f, 0xcc, 0xe3, 0xe5, 0xfd, 0xda, 0x33, 0xdc, + 0xd8, 0x9d, 0x8a, 0x09, 0x98, 0x2a, 0x3f, 0xbe, 0xcc, 0x79, 0x41, 0xbc, 0x20, 0x51, 0xa0, 0xc5, + 0x49, 0xa0, 0x07, 0x34, 0x92, 0xf3, 0xa1, 0x67, 0x29, 0xb2, 0x0a, 0xd9, 0x9e, 0x3f, 0xf6, 0x67, + 0xdb, 0xeb, 0x5f, 0x0e, 0x2a, 0x13, 0x63, 0x38, 0x72, 0x7f, 0x3d, 0x38, 0x99, 0x64, 0xda, 0x86, + 0xf4, 0x34, 0x0c, 0x83, 0x97, 0xd2, 0x93, 0x78, 0xb8, 0x0a, 0x1b, 0xda, 0xd5, 0xe9, 0xef, 0x05, + 0xee, 0x5a, 0xe2, 0xae, 0x0b, 0xdc, 0xf5, 0x36, 0xee, 0xfa, 0xea, 0x74, 0x56, 0x95, 0xae, 0xbe, + 0xfc, 0x3b, 0x00, 0x00, 0xff, 0xff, 0xf0, 0xc4, 0x0e, 0x43, 0x6d, 0x08, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/bigquery/logging/v1/audit_data.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/bigquery/logging/v1/audit_data.pb.go new file mode 100644 index 0000000000..84044ac8eb --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/bigquery/logging/v1/audit_data.pb.go @@ -0,0 +1,2225 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/bigquery/logging/v1/audit_data.proto + +/* +Package logging is a generated protocol buffer package. + +It is generated from these files: + google/cloud/bigquery/logging/v1/audit_data.proto + +It has these top-level messages: + AuditData + TableInsertRequest + TableUpdateRequest + TableInsertResponse + TableUpdateResponse + DatasetListRequest + DatasetInsertRequest + DatasetInsertResponse + DatasetUpdateRequest + DatasetUpdateResponse + JobInsertRequest + JobInsertResponse + JobQueryRequest + JobQueryResponse + JobGetQueryResultsRequest + JobGetQueryResultsResponse + JobQueryDoneResponse + JobCompletedEvent + TableDataListRequest + Table + TableInfo + TableViewDefinition + Dataset + DatasetInfo + BigQueryAcl + Job + JobConfiguration + TableDefinition + JobStatus + JobStatistics + DatasetName + TableName + JobName +*/ +package logging + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf1 "github.com/golang/protobuf/ptypes/duration" +import google_protobuf2 "github.com/golang/protobuf/ptypes/timestamp" +import google_rpc "google.golang.org/genproto/googleapis/rpc/status" + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// BigQuery request and response messages for audit log. +// Note: `Table.schema` has been deprecated in favor of `Table.schemaJson`. +// `Table.schema` may continue to be present in your logs during this +// transition. +type AuditData struct { + // Request data for each BigQuery method. + // + // Types that are valid to be assigned to Request: + // *AuditData_TableInsertRequest + // *AuditData_TableUpdateRequest + // *AuditData_DatasetListRequest + // *AuditData_DatasetInsertRequest + // *AuditData_DatasetUpdateRequest + // *AuditData_JobInsertRequest + // *AuditData_JobQueryRequest + // *AuditData_JobGetQueryResultsRequest + // *AuditData_TableDataListRequest + Request isAuditData_Request `protobuf_oneof:"request"` + // Response data for each BigQuery method. + // + // Types that are valid to be assigned to Response: + // *AuditData_TableInsertResponse + // *AuditData_TableUpdateResponse + // *AuditData_DatasetInsertResponse + // *AuditData_DatasetUpdateResponse + // *AuditData_JobInsertResponse + // *AuditData_JobQueryResponse + // *AuditData_JobGetQueryResultsResponse + // *AuditData_JobQueryDoneResponse + Response isAuditData_Response `protobuf_oneof:"response"` + // A job completion event. + JobCompletedEvent *JobCompletedEvent `protobuf:"bytes,17,opt,name=job_completed_event,json=jobCompletedEvent" json:"job_completed_event,omitempty"` +} + +func (m *AuditData) Reset() { *m = AuditData{} } +func (m *AuditData) String() string { return proto.CompactTextString(m) } +func (*AuditData) ProtoMessage() {} +func (*AuditData) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +type isAuditData_Request interface { + isAuditData_Request() +} +type isAuditData_Response interface { + isAuditData_Response() +} + +type AuditData_TableInsertRequest struct { + TableInsertRequest *TableInsertRequest `protobuf:"bytes,1,opt,name=table_insert_request,json=tableInsertRequest,oneof"` +} +type AuditData_TableUpdateRequest struct { + TableUpdateRequest *TableUpdateRequest `protobuf:"bytes,16,opt,name=table_update_request,json=tableUpdateRequest,oneof"` +} +type AuditData_DatasetListRequest struct { + DatasetListRequest *DatasetListRequest `protobuf:"bytes,2,opt,name=dataset_list_request,json=datasetListRequest,oneof"` +} +type AuditData_DatasetInsertRequest struct { + DatasetInsertRequest *DatasetInsertRequest `protobuf:"bytes,3,opt,name=dataset_insert_request,json=datasetInsertRequest,oneof"` +} +type AuditData_DatasetUpdateRequest struct { + DatasetUpdateRequest *DatasetUpdateRequest `protobuf:"bytes,4,opt,name=dataset_update_request,json=datasetUpdateRequest,oneof"` +} +type AuditData_JobInsertRequest struct { + JobInsertRequest *JobInsertRequest `protobuf:"bytes,5,opt,name=job_insert_request,json=jobInsertRequest,oneof"` +} +type AuditData_JobQueryRequest struct { + JobQueryRequest *JobQueryRequest `protobuf:"bytes,6,opt,name=job_query_request,json=jobQueryRequest,oneof"` +} +type AuditData_JobGetQueryResultsRequest struct { + JobGetQueryResultsRequest *JobGetQueryResultsRequest `protobuf:"bytes,7,opt,name=job_get_query_results_request,json=jobGetQueryResultsRequest,oneof"` +} +type AuditData_TableDataListRequest struct { + TableDataListRequest *TableDataListRequest `protobuf:"bytes,8,opt,name=table_data_list_request,json=tableDataListRequest,oneof"` +} +type AuditData_TableInsertResponse struct { + TableInsertResponse *TableInsertResponse `protobuf:"bytes,9,opt,name=table_insert_response,json=tableInsertResponse,oneof"` +} +type AuditData_TableUpdateResponse struct { + TableUpdateResponse *TableUpdateResponse `protobuf:"bytes,10,opt,name=table_update_response,json=tableUpdateResponse,oneof"` +} +type AuditData_DatasetInsertResponse struct { + DatasetInsertResponse *DatasetInsertResponse `protobuf:"bytes,11,opt,name=dataset_insert_response,json=datasetInsertResponse,oneof"` +} +type AuditData_DatasetUpdateResponse struct { + DatasetUpdateResponse *DatasetUpdateResponse `protobuf:"bytes,12,opt,name=dataset_update_response,json=datasetUpdateResponse,oneof"` +} +type AuditData_JobInsertResponse struct { + JobInsertResponse *JobInsertResponse `protobuf:"bytes,18,opt,name=job_insert_response,json=jobInsertResponse,oneof"` +} +type AuditData_JobQueryResponse struct { + JobQueryResponse *JobQueryResponse `protobuf:"bytes,13,opt,name=job_query_response,json=jobQueryResponse,oneof"` +} +type AuditData_JobGetQueryResultsResponse struct { + JobGetQueryResultsResponse *JobGetQueryResultsResponse `protobuf:"bytes,14,opt,name=job_get_query_results_response,json=jobGetQueryResultsResponse,oneof"` +} +type AuditData_JobQueryDoneResponse struct { + JobQueryDoneResponse *JobQueryDoneResponse `protobuf:"bytes,15,opt,name=job_query_done_response,json=jobQueryDoneResponse,oneof"` +} + +func (*AuditData_TableInsertRequest) isAuditData_Request() {} +func (*AuditData_TableUpdateRequest) isAuditData_Request() {} +func (*AuditData_DatasetListRequest) isAuditData_Request() {} +func (*AuditData_DatasetInsertRequest) isAuditData_Request() {} +func (*AuditData_DatasetUpdateRequest) isAuditData_Request() {} +func (*AuditData_JobInsertRequest) isAuditData_Request() {} +func (*AuditData_JobQueryRequest) isAuditData_Request() {} +func (*AuditData_JobGetQueryResultsRequest) isAuditData_Request() {} +func (*AuditData_TableDataListRequest) isAuditData_Request() {} +func (*AuditData_TableInsertResponse) isAuditData_Response() {} +func (*AuditData_TableUpdateResponse) isAuditData_Response() {} +func (*AuditData_DatasetInsertResponse) isAuditData_Response() {} +func (*AuditData_DatasetUpdateResponse) isAuditData_Response() {} +func (*AuditData_JobInsertResponse) isAuditData_Response() {} +func (*AuditData_JobQueryResponse) isAuditData_Response() {} +func (*AuditData_JobGetQueryResultsResponse) isAuditData_Response() {} +func (*AuditData_JobQueryDoneResponse) isAuditData_Response() {} + +func (m *AuditData) GetRequest() isAuditData_Request { + if m != nil { + return m.Request + } + return nil +} +func (m *AuditData) GetResponse() isAuditData_Response { + if m != nil { + return m.Response + } + return nil +} + +func (m *AuditData) GetTableInsertRequest() *TableInsertRequest { + if x, ok := m.GetRequest().(*AuditData_TableInsertRequest); ok { + return x.TableInsertRequest + } + return nil +} + +func (m *AuditData) GetTableUpdateRequest() *TableUpdateRequest { + if x, ok := m.GetRequest().(*AuditData_TableUpdateRequest); ok { + return x.TableUpdateRequest + } + return nil +} + +func (m *AuditData) GetDatasetListRequest() *DatasetListRequest { + if x, ok := m.GetRequest().(*AuditData_DatasetListRequest); ok { + return x.DatasetListRequest + } + return nil +} + +func (m *AuditData) GetDatasetInsertRequest() *DatasetInsertRequest { + if x, ok := m.GetRequest().(*AuditData_DatasetInsertRequest); ok { + return x.DatasetInsertRequest + } + return nil +} + +func (m *AuditData) GetDatasetUpdateRequest() *DatasetUpdateRequest { + if x, ok := m.GetRequest().(*AuditData_DatasetUpdateRequest); ok { + return x.DatasetUpdateRequest + } + return nil +} + +func (m *AuditData) GetJobInsertRequest() *JobInsertRequest { + if x, ok := m.GetRequest().(*AuditData_JobInsertRequest); ok { + return x.JobInsertRequest + } + return nil +} + +func (m *AuditData) GetJobQueryRequest() *JobQueryRequest { + if x, ok := m.GetRequest().(*AuditData_JobQueryRequest); ok { + return x.JobQueryRequest + } + return nil +} + +func (m *AuditData) GetJobGetQueryResultsRequest() *JobGetQueryResultsRequest { + if x, ok := m.GetRequest().(*AuditData_JobGetQueryResultsRequest); ok { + return x.JobGetQueryResultsRequest + } + return nil +} + +func (m *AuditData) GetTableDataListRequest() *TableDataListRequest { + if x, ok := m.GetRequest().(*AuditData_TableDataListRequest); ok { + return x.TableDataListRequest + } + return nil +} + +func (m *AuditData) GetTableInsertResponse() *TableInsertResponse { + if x, ok := m.GetResponse().(*AuditData_TableInsertResponse); ok { + return x.TableInsertResponse + } + return nil +} + +func (m *AuditData) GetTableUpdateResponse() *TableUpdateResponse { + if x, ok := m.GetResponse().(*AuditData_TableUpdateResponse); ok { + return x.TableUpdateResponse + } + return nil +} + +func (m *AuditData) GetDatasetInsertResponse() *DatasetInsertResponse { + if x, ok := m.GetResponse().(*AuditData_DatasetInsertResponse); ok { + return x.DatasetInsertResponse + } + return nil +} + +func (m *AuditData) GetDatasetUpdateResponse() *DatasetUpdateResponse { + if x, ok := m.GetResponse().(*AuditData_DatasetUpdateResponse); ok { + return x.DatasetUpdateResponse + } + return nil +} + +func (m *AuditData) GetJobInsertResponse() *JobInsertResponse { + if x, ok := m.GetResponse().(*AuditData_JobInsertResponse); ok { + return x.JobInsertResponse + } + return nil +} + +func (m *AuditData) GetJobQueryResponse() *JobQueryResponse { + if x, ok := m.GetResponse().(*AuditData_JobQueryResponse); ok { + return x.JobQueryResponse + } + return nil +} + +func (m *AuditData) GetJobGetQueryResultsResponse() *JobGetQueryResultsResponse { + if x, ok := m.GetResponse().(*AuditData_JobGetQueryResultsResponse); ok { + return x.JobGetQueryResultsResponse + } + return nil +} + +func (m *AuditData) GetJobQueryDoneResponse() *JobQueryDoneResponse { + if x, ok := m.GetResponse().(*AuditData_JobQueryDoneResponse); ok { + return x.JobQueryDoneResponse + } + return nil +} + +func (m *AuditData) GetJobCompletedEvent() *JobCompletedEvent { + if m != nil { + return m.JobCompletedEvent + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*AuditData) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _AuditData_OneofMarshaler, _AuditData_OneofUnmarshaler, _AuditData_OneofSizer, []interface{}{ + (*AuditData_TableInsertRequest)(nil), + (*AuditData_TableUpdateRequest)(nil), + (*AuditData_DatasetListRequest)(nil), + (*AuditData_DatasetInsertRequest)(nil), + (*AuditData_DatasetUpdateRequest)(nil), + (*AuditData_JobInsertRequest)(nil), + (*AuditData_JobQueryRequest)(nil), + (*AuditData_JobGetQueryResultsRequest)(nil), + (*AuditData_TableDataListRequest)(nil), + (*AuditData_TableInsertResponse)(nil), + (*AuditData_TableUpdateResponse)(nil), + (*AuditData_DatasetInsertResponse)(nil), + (*AuditData_DatasetUpdateResponse)(nil), + (*AuditData_JobInsertResponse)(nil), + (*AuditData_JobQueryResponse)(nil), + (*AuditData_JobGetQueryResultsResponse)(nil), + (*AuditData_JobQueryDoneResponse)(nil), + } +} + +func _AuditData_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*AuditData) + // request + switch x := m.Request.(type) { + case *AuditData_TableInsertRequest: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.TableInsertRequest); err != nil { + return err + } + case *AuditData_TableUpdateRequest: + b.EncodeVarint(16<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.TableUpdateRequest); err != nil { + return err + } + case *AuditData_DatasetListRequest: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.DatasetListRequest); err != nil { + return err + } + case *AuditData_DatasetInsertRequest: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.DatasetInsertRequest); err != nil { + return err + } + case *AuditData_DatasetUpdateRequest: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.DatasetUpdateRequest); err != nil { + return err + } + case *AuditData_JobInsertRequest: + b.EncodeVarint(5<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.JobInsertRequest); err != nil { + return err + } + case *AuditData_JobQueryRequest: + b.EncodeVarint(6<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.JobQueryRequest); err != nil { + return err + } + case *AuditData_JobGetQueryResultsRequest: + b.EncodeVarint(7<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.JobGetQueryResultsRequest); err != nil { + return err + } + case *AuditData_TableDataListRequest: + b.EncodeVarint(8<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.TableDataListRequest); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("AuditData.Request has unexpected type %T", x) + } + // response + switch x := m.Response.(type) { + case *AuditData_TableInsertResponse: + b.EncodeVarint(9<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.TableInsertResponse); err != nil { + return err + } + case *AuditData_TableUpdateResponse: + b.EncodeVarint(10<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.TableUpdateResponse); err != nil { + return err + } + case *AuditData_DatasetInsertResponse: + b.EncodeVarint(11<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.DatasetInsertResponse); err != nil { + return err + } + case *AuditData_DatasetUpdateResponse: + b.EncodeVarint(12<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.DatasetUpdateResponse); err != nil { + return err + } + case *AuditData_JobInsertResponse: + b.EncodeVarint(18<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.JobInsertResponse); err != nil { + return err + } + case *AuditData_JobQueryResponse: + b.EncodeVarint(13<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.JobQueryResponse); err != nil { + return err + } + case *AuditData_JobGetQueryResultsResponse: + b.EncodeVarint(14<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.JobGetQueryResultsResponse); err != nil { + return err + } + case *AuditData_JobQueryDoneResponse: + b.EncodeVarint(15<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.JobQueryDoneResponse); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("AuditData.Response has unexpected type %T", x) + } + return nil +} + +func _AuditData_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*AuditData) + switch tag { + case 1: // request.table_insert_request + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(TableInsertRequest) + err := b.DecodeMessage(msg) + m.Request = &AuditData_TableInsertRequest{msg} + return true, err + case 16: // request.table_update_request + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(TableUpdateRequest) + err := b.DecodeMessage(msg) + m.Request = &AuditData_TableUpdateRequest{msg} + return true, err + case 2: // request.dataset_list_request + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(DatasetListRequest) + err := b.DecodeMessage(msg) + m.Request = &AuditData_DatasetListRequest{msg} + return true, err + case 3: // request.dataset_insert_request + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(DatasetInsertRequest) + err := b.DecodeMessage(msg) + m.Request = &AuditData_DatasetInsertRequest{msg} + return true, err + case 4: // request.dataset_update_request + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(DatasetUpdateRequest) + err := b.DecodeMessage(msg) + m.Request = &AuditData_DatasetUpdateRequest{msg} + return true, err + case 5: // request.job_insert_request + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(JobInsertRequest) + err := b.DecodeMessage(msg) + m.Request = &AuditData_JobInsertRequest{msg} + return true, err + case 6: // request.job_query_request + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(JobQueryRequest) + err := b.DecodeMessage(msg) + m.Request = &AuditData_JobQueryRequest{msg} + return true, err + case 7: // request.job_get_query_results_request + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(JobGetQueryResultsRequest) + err := b.DecodeMessage(msg) + m.Request = &AuditData_JobGetQueryResultsRequest{msg} + return true, err + case 8: // request.table_data_list_request + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(TableDataListRequest) + err := b.DecodeMessage(msg) + m.Request = &AuditData_TableDataListRequest{msg} + return true, err + case 9: // response.table_insert_response + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(TableInsertResponse) + err := b.DecodeMessage(msg) + m.Response = &AuditData_TableInsertResponse{msg} + return true, err + case 10: // response.table_update_response + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(TableUpdateResponse) + err := b.DecodeMessage(msg) + m.Response = &AuditData_TableUpdateResponse{msg} + return true, err + case 11: // response.dataset_insert_response + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(DatasetInsertResponse) + err := b.DecodeMessage(msg) + m.Response = &AuditData_DatasetInsertResponse{msg} + return true, err + case 12: // response.dataset_update_response + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(DatasetUpdateResponse) + err := b.DecodeMessage(msg) + m.Response = &AuditData_DatasetUpdateResponse{msg} + return true, err + case 18: // response.job_insert_response + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(JobInsertResponse) + err := b.DecodeMessage(msg) + m.Response = &AuditData_JobInsertResponse{msg} + return true, err + case 13: // response.job_query_response + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(JobQueryResponse) + err := b.DecodeMessage(msg) + m.Response = &AuditData_JobQueryResponse{msg} + return true, err + case 14: // response.job_get_query_results_response + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(JobGetQueryResultsResponse) + err := b.DecodeMessage(msg) + m.Response = &AuditData_JobGetQueryResultsResponse{msg} + return true, err + case 15: // response.job_query_done_response + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(JobQueryDoneResponse) + err := b.DecodeMessage(msg) + m.Response = &AuditData_JobQueryDoneResponse{msg} + return true, err + default: + return false, nil + } +} + +func _AuditData_OneofSizer(msg proto.Message) (n int) { + m := msg.(*AuditData) + // request + switch x := m.Request.(type) { + case *AuditData_TableInsertRequest: + s := proto.Size(x.TableInsertRequest) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *AuditData_TableUpdateRequest: + s := proto.Size(x.TableUpdateRequest) + n += proto.SizeVarint(16<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *AuditData_DatasetListRequest: + s := proto.Size(x.DatasetListRequest) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *AuditData_DatasetInsertRequest: + s := proto.Size(x.DatasetInsertRequest) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *AuditData_DatasetUpdateRequest: + s := proto.Size(x.DatasetUpdateRequest) + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *AuditData_JobInsertRequest: + s := proto.Size(x.JobInsertRequest) + n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *AuditData_JobQueryRequest: + s := proto.Size(x.JobQueryRequest) + n += proto.SizeVarint(6<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *AuditData_JobGetQueryResultsRequest: + s := proto.Size(x.JobGetQueryResultsRequest) + n += proto.SizeVarint(7<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *AuditData_TableDataListRequest: + s := proto.Size(x.TableDataListRequest) + n += proto.SizeVarint(8<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + // response + switch x := m.Response.(type) { + case *AuditData_TableInsertResponse: + s := proto.Size(x.TableInsertResponse) + n += proto.SizeVarint(9<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *AuditData_TableUpdateResponse: + s := proto.Size(x.TableUpdateResponse) + n += proto.SizeVarint(10<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *AuditData_DatasetInsertResponse: + s := proto.Size(x.DatasetInsertResponse) + n += proto.SizeVarint(11<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *AuditData_DatasetUpdateResponse: + s := proto.Size(x.DatasetUpdateResponse) + n += proto.SizeVarint(12<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *AuditData_JobInsertResponse: + s := proto.Size(x.JobInsertResponse) + n += proto.SizeVarint(18<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *AuditData_JobQueryResponse: + s := proto.Size(x.JobQueryResponse) + n += proto.SizeVarint(13<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *AuditData_JobGetQueryResultsResponse: + s := proto.Size(x.JobGetQueryResultsResponse) + n += proto.SizeVarint(14<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *AuditData_JobQueryDoneResponse: + s := proto.Size(x.JobQueryDoneResponse) + n += proto.SizeVarint(15<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Table insert request. +type TableInsertRequest struct { + // The new table. + Resource *Table `protobuf:"bytes,1,opt,name=resource" json:"resource,omitempty"` +} + +func (m *TableInsertRequest) Reset() { *m = TableInsertRequest{} } +func (m *TableInsertRequest) String() string { return proto.CompactTextString(m) } +func (*TableInsertRequest) ProtoMessage() {} +func (*TableInsertRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *TableInsertRequest) GetResource() *Table { + if m != nil { + return m.Resource + } + return nil +} + +// Table update request. +type TableUpdateRequest struct { + // The table to be updated. + Resource *Table `protobuf:"bytes,1,opt,name=resource" json:"resource,omitempty"` +} + +func (m *TableUpdateRequest) Reset() { *m = TableUpdateRequest{} } +func (m *TableUpdateRequest) String() string { return proto.CompactTextString(m) } +func (*TableUpdateRequest) ProtoMessage() {} +func (*TableUpdateRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *TableUpdateRequest) GetResource() *Table { + if m != nil { + return m.Resource + } + return nil +} + +// Table insert response. +type TableInsertResponse struct { + // Final state of the inserted table. + Resource *Table `protobuf:"bytes,1,opt,name=resource" json:"resource,omitempty"` +} + +func (m *TableInsertResponse) Reset() { *m = TableInsertResponse{} } +func (m *TableInsertResponse) String() string { return proto.CompactTextString(m) } +func (*TableInsertResponse) ProtoMessage() {} +func (*TableInsertResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *TableInsertResponse) GetResource() *Table { + if m != nil { + return m.Resource + } + return nil +} + +// Table update response. +type TableUpdateResponse struct { + // Final state of the updated table. + Resource *Table `protobuf:"bytes,1,opt,name=resource" json:"resource,omitempty"` +} + +func (m *TableUpdateResponse) Reset() { *m = TableUpdateResponse{} } +func (m *TableUpdateResponse) String() string { return proto.CompactTextString(m) } +func (*TableUpdateResponse) ProtoMessage() {} +func (*TableUpdateResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *TableUpdateResponse) GetResource() *Table { + if m != nil { + return m.Resource + } + return nil +} + +// Dataset list request. +type DatasetListRequest struct { + // Whether to list all datasets, including hidden ones. + ListAll bool `protobuf:"varint,1,opt,name=list_all,json=listAll" json:"list_all,omitempty"` +} + +func (m *DatasetListRequest) Reset() { *m = DatasetListRequest{} } +func (m *DatasetListRequest) String() string { return proto.CompactTextString(m) } +func (*DatasetListRequest) ProtoMessage() {} +func (*DatasetListRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *DatasetListRequest) GetListAll() bool { + if m != nil { + return m.ListAll + } + return false +} + +// Dataset insert request. +type DatasetInsertRequest struct { + // The dataset to be inserted. + Resource *Dataset `protobuf:"bytes,1,opt,name=resource" json:"resource,omitempty"` +} + +func (m *DatasetInsertRequest) Reset() { *m = DatasetInsertRequest{} } +func (m *DatasetInsertRequest) String() string { return proto.CompactTextString(m) } +func (*DatasetInsertRequest) ProtoMessage() {} +func (*DatasetInsertRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *DatasetInsertRequest) GetResource() *Dataset { + if m != nil { + return m.Resource + } + return nil +} + +// Dataset insert response. +type DatasetInsertResponse struct { + // Final state of the inserted dataset. + Resource *Dataset `protobuf:"bytes,1,opt,name=resource" json:"resource,omitempty"` +} + +func (m *DatasetInsertResponse) Reset() { *m = DatasetInsertResponse{} } +func (m *DatasetInsertResponse) String() string { return proto.CompactTextString(m) } +func (*DatasetInsertResponse) ProtoMessage() {} +func (*DatasetInsertResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *DatasetInsertResponse) GetResource() *Dataset { + if m != nil { + return m.Resource + } + return nil +} + +// Dataset update request. +type DatasetUpdateRequest struct { + // The dataset to be updated. + Resource *Dataset `protobuf:"bytes,1,opt,name=resource" json:"resource,omitempty"` +} + +func (m *DatasetUpdateRequest) Reset() { *m = DatasetUpdateRequest{} } +func (m *DatasetUpdateRequest) String() string { return proto.CompactTextString(m) } +func (*DatasetUpdateRequest) ProtoMessage() {} +func (*DatasetUpdateRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *DatasetUpdateRequest) GetResource() *Dataset { + if m != nil { + return m.Resource + } + return nil +} + +// Dataset update response. +type DatasetUpdateResponse struct { + // Final state of the updated dataset. + Resource *Dataset `protobuf:"bytes,1,opt,name=resource" json:"resource,omitempty"` +} + +func (m *DatasetUpdateResponse) Reset() { *m = DatasetUpdateResponse{} } +func (m *DatasetUpdateResponse) String() string { return proto.CompactTextString(m) } +func (*DatasetUpdateResponse) ProtoMessage() {} +func (*DatasetUpdateResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *DatasetUpdateResponse) GetResource() *Dataset { + if m != nil { + return m.Resource + } + return nil +} + +// Job insert request. +type JobInsertRequest struct { + // Job insert request. + Resource *Job `protobuf:"bytes,1,opt,name=resource" json:"resource,omitempty"` +} + +func (m *JobInsertRequest) Reset() { *m = JobInsertRequest{} } +func (m *JobInsertRequest) String() string { return proto.CompactTextString(m) } +func (*JobInsertRequest) ProtoMessage() {} +func (*JobInsertRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *JobInsertRequest) GetResource() *Job { + if m != nil { + return m.Resource + } + return nil +} + +// Job insert response. +type JobInsertResponse struct { + // Job insert response. + Resource *Job `protobuf:"bytes,1,opt,name=resource" json:"resource,omitempty"` +} + +func (m *JobInsertResponse) Reset() { *m = JobInsertResponse{} } +func (m *JobInsertResponse) String() string { return proto.CompactTextString(m) } +func (*JobInsertResponse) ProtoMessage() {} +func (*JobInsertResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } + +func (m *JobInsertResponse) GetResource() *Job { + if m != nil { + return m.Resource + } + return nil +} + +// Job query request. +type JobQueryRequest struct { + // The query. + Query string `protobuf:"bytes,1,opt,name=query" json:"query,omitempty"` + // The maximum number of results. + MaxResults uint32 `protobuf:"varint,2,opt,name=max_results,json=maxResults" json:"max_results,omitempty"` + // The default dataset for tables that do not have a dataset specified. + DefaultDataset *DatasetName `protobuf:"bytes,3,opt,name=default_dataset,json=defaultDataset" json:"default_dataset,omitempty"` + // Project that the query should be charged to. + ProjectId string `protobuf:"bytes,4,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // If true, don't actually run the job. Just check that it would run. + DryRun bool `protobuf:"varint,5,opt,name=dry_run,json=dryRun" json:"dry_run,omitempty"` +} + +func (m *JobQueryRequest) Reset() { *m = JobQueryRequest{} } +func (m *JobQueryRequest) String() string { return proto.CompactTextString(m) } +func (*JobQueryRequest) ProtoMessage() {} +func (*JobQueryRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } + +func (m *JobQueryRequest) GetQuery() string { + if m != nil { + return m.Query + } + return "" +} + +func (m *JobQueryRequest) GetMaxResults() uint32 { + if m != nil { + return m.MaxResults + } + return 0 +} + +func (m *JobQueryRequest) GetDefaultDataset() *DatasetName { + if m != nil { + return m.DefaultDataset + } + return nil +} + +func (m *JobQueryRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *JobQueryRequest) GetDryRun() bool { + if m != nil { + return m.DryRun + } + return false +} + +// Job query response. +type JobQueryResponse struct { + // The total number of rows in the full query result set. + TotalResults uint64 `protobuf:"varint,1,opt,name=total_results,json=totalResults" json:"total_results,omitempty"` + // Information about the queried job. + Job *Job `protobuf:"bytes,2,opt,name=job" json:"job,omitempty"` +} + +func (m *JobQueryResponse) Reset() { *m = JobQueryResponse{} } +func (m *JobQueryResponse) String() string { return proto.CompactTextString(m) } +func (*JobQueryResponse) ProtoMessage() {} +func (*JobQueryResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } + +func (m *JobQueryResponse) GetTotalResults() uint64 { + if m != nil { + return m.TotalResults + } + return 0 +} + +func (m *JobQueryResponse) GetJob() *Job { + if m != nil { + return m.Job + } + return nil +} + +// Job getQueryResults request. +type JobGetQueryResultsRequest struct { + // Maximum number of results to return. + MaxResults uint32 `protobuf:"varint,1,opt,name=max_results,json=maxResults" json:"max_results,omitempty"` + // Zero-based row number at which to start. + StartRow uint64 `protobuf:"varint,2,opt,name=start_row,json=startRow" json:"start_row,omitempty"` +} + +func (m *JobGetQueryResultsRequest) Reset() { *m = JobGetQueryResultsRequest{} } +func (m *JobGetQueryResultsRequest) String() string { return proto.CompactTextString(m) } +func (*JobGetQueryResultsRequest) ProtoMessage() {} +func (*JobGetQueryResultsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } + +func (m *JobGetQueryResultsRequest) GetMaxResults() uint32 { + if m != nil { + return m.MaxResults + } + return 0 +} + +func (m *JobGetQueryResultsRequest) GetStartRow() uint64 { + if m != nil { + return m.StartRow + } + return 0 +} + +// Job getQueryResults response. +type JobGetQueryResultsResponse struct { + // Total number of results in query results. + TotalResults uint64 `protobuf:"varint,1,opt,name=total_results,json=totalResults" json:"total_results,omitempty"` + // The job that was created to run the query. + // It completed if `job.status.state` is `DONE`. + // It failed if `job.status.errorResult` is also present. + Job *Job `protobuf:"bytes,2,opt,name=job" json:"job,omitempty"` +} + +func (m *JobGetQueryResultsResponse) Reset() { *m = JobGetQueryResultsResponse{} } +func (m *JobGetQueryResultsResponse) String() string { return proto.CompactTextString(m) } +func (*JobGetQueryResultsResponse) ProtoMessage() {} +func (*JobGetQueryResultsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } + +func (m *JobGetQueryResultsResponse) GetTotalResults() uint64 { + if m != nil { + return m.TotalResults + } + return 0 +} + +func (m *JobGetQueryResultsResponse) GetJob() *Job { + if m != nil { + return m.Job + } + return nil +} + +// Job getQueryDone response. +type JobQueryDoneResponse struct { + // The job and status information. + // The job completed if `job.status.state` is `DONE`. + Job *Job `protobuf:"bytes,1,opt,name=job" json:"job,omitempty"` +} + +func (m *JobQueryDoneResponse) Reset() { *m = JobQueryDoneResponse{} } +func (m *JobQueryDoneResponse) String() string { return proto.CompactTextString(m) } +func (*JobQueryDoneResponse) ProtoMessage() {} +func (*JobQueryDoneResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} } + +func (m *JobQueryDoneResponse) GetJob() *Job { + if m != nil { + return m.Job + } + return nil +} + +// Query job completed event. +type JobCompletedEvent struct { + // Name of the event. + EventName string `protobuf:"bytes,1,opt,name=event_name,json=eventName" json:"event_name,omitempty"` + // Job information. + Job *Job `protobuf:"bytes,2,opt,name=job" json:"job,omitempty"` +} + +func (m *JobCompletedEvent) Reset() { *m = JobCompletedEvent{} } +func (m *JobCompletedEvent) String() string { return proto.CompactTextString(m) } +func (*JobCompletedEvent) ProtoMessage() {} +func (*JobCompletedEvent) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17} } + +func (m *JobCompletedEvent) GetEventName() string { + if m != nil { + return m.EventName + } + return "" +} + +func (m *JobCompletedEvent) GetJob() *Job { + if m != nil { + return m.Job + } + return nil +} + +// Table data-list request. +type TableDataListRequest struct { + // Starting row offset. + StartRow uint64 `protobuf:"varint,1,opt,name=start_row,json=startRow" json:"start_row,omitempty"` + // Maximum number of results to return. + MaxResults uint32 `protobuf:"varint,2,opt,name=max_results,json=maxResults" json:"max_results,omitempty"` +} + +func (m *TableDataListRequest) Reset() { *m = TableDataListRequest{} } +func (m *TableDataListRequest) String() string { return proto.CompactTextString(m) } +func (*TableDataListRequest) ProtoMessage() {} +func (*TableDataListRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{18} } + +func (m *TableDataListRequest) GetStartRow() uint64 { + if m != nil { + return m.StartRow + } + return 0 +} + +func (m *TableDataListRequest) GetMaxResults() uint32 { + if m != nil { + return m.MaxResults + } + return 0 +} + +// Describes a BigQuery table. +// See the [Table](/bigquery/docs/reference/v2/tables) API resource +// for more details on individual fields. +// Note: `Table.schema` has been deprecated in favor of `Table.schemaJson`. +// `Table.schema` may continue to be present in your logs during this +// transition. +type Table struct { + // The name of the table. + TableName *TableName `protobuf:"bytes,1,opt,name=table_name,json=tableName" json:"table_name,omitempty"` + // User-provided metadata for the table. + Info *TableInfo `protobuf:"bytes,2,opt,name=info" json:"info,omitempty"` + // A JSON representation of the table's schema. + SchemaJson string `protobuf:"bytes,8,opt,name=schema_json,json=schemaJson" json:"schema_json,omitempty"` + // If present, this is a virtual table defined by a SQL query. + View *TableViewDefinition `protobuf:"bytes,4,opt,name=view" json:"view,omitempty"` + // The expiration date for the table, after which the table + // is deleted and the storage reclaimed. + // If not present, the table persists indefinitely. + ExpireTime *google_protobuf2.Timestamp `protobuf:"bytes,5,opt,name=expire_time,json=expireTime" json:"expire_time,omitempty"` + // The time the table was created. + CreateTime *google_protobuf2.Timestamp `protobuf:"bytes,6,opt,name=create_time,json=createTime" json:"create_time,omitempty"` + // The time the table was last truncated + // by an operation with a `writeDisposition` of `WRITE_TRUNCATE`. + TruncateTime *google_protobuf2.Timestamp `protobuf:"bytes,7,opt,name=truncate_time,json=truncateTime" json:"truncate_time,omitempty"` +} + +func (m *Table) Reset() { *m = Table{} } +func (m *Table) String() string { return proto.CompactTextString(m) } +func (*Table) ProtoMessage() {} +func (*Table) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{19} } + +func (m *Table) GetTableName() *TableName { + if m != nil { + return m.TableName + } + return nil +} + +func (m *Table) GetInfo() *TableInfo { + if m != nil { + return m.Info + } + return nil +} + +func (m *Table) GetSchemaJson() string { + if m != nil { + return m.SchemaJson + } + return "" +} + +func (m *Table) GetView() *TableViewDefinition { + if m != nil { + return m.View + } + return nil +} + +func (m *Table) GetExpireTime() *google_protobuf2.Timestamp { + if m != nil { + return m.ExpireTime + } + return nil +} + +func (m *Table) GetCreateTime() *google_protobuf2.Timestamp { + if m != nil { + return m.CreateTime + } + return nil +} + +func (m *Table) GetTruncateTime() *google_protobuf2.Timestamp { + if m != nil { + return m.TruncateTime + } + return nil +} + +// User-provided metadata for a table. +type TableInfo struct { + // A short name for the table, such as`"Analytics Data - Jan 2011"`. + FriendlyName string `protobuf:"bytes,1,opt,name=friendly_name,json=friendlyName" json:"friendly_name,omitempty"` + // A long description, perhaps several paragraphs, + // describing the table contents in detail. + Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` +} + +func (m *TableInfo) Reset() { *m = TableInfo{} } +func (m *TableInfo) String() string { return proto.CompactTextString(m) } +func (*TableInfo) ProtoMessage() {} +func (*TableInfo) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20} } + +func (m *TableInfo) GetFriendlyName() string { + if m != nil { + return m.FriendlyName + } + return "" +} + +func (m *TableInfo) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +// Describes a virtual table defined by a SQL query. +type TableViewDefinition struct { + // SQL query defining the view. + Query string `protobuf:"bytes,1,opt,name=query" json:"query,omitempty"` +} + +func (m *TableViewDefinition) Reset() { *m = TableViewDefinition{} } +func (m *TableViewDefinition) String() string { return proto.CompactTextString(m) } +func (*TableViewDefinition) ProtoMessage() {} +func (*TableViewDefinition) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{21} } + +func (m *TableViewDefinition) GetQuery() string { + if m != nil { + return m.Query + } + return "" +} + +// BigQuery dataset information. +// See the [Dataset](/bigquery/docs/reference/v2/datasets) API resource +// for more details on individual fields. +type Dataset struct { + // The name of the dataset. + DatasetName *DatasetName `protobuf:"bytes,1,opt,name=dataset_name,json=datasetName" json:"dataset_name,omitempty"` + // User-provided metadata for the dataset. + Info *DatasetInfo `protobuf:"bytes,2,opt,name=info" json:"info,omitempty"` + // The time the dataset was created. + CreateTime *google_protobuf2.Timestamp `protobuf:"bytes,4,opt,name=create_time,json=createTime" json:"create_time,omitempty"` + // The time the dataset was last modified. + UpdateTime *google_protobuf2.Timestamp `protobuf:"bytes,5,opt,name=update_time,json=updateTime" json:"update_time,omitempty"` + // The access control list for the dataset. + Acl *BigQueryAcl `protobuf:"bytes,6,opt,name=acl" json:"acl,omitempty"` + // If this field is present, each table that does not specify an + // expiration time is assigned an expiration time by adding this + // duration to the table's `createTime`. If this field is empty, + // there is no default table expiration time. + DefaultTableExpireDuration *google_protobuf1.Duration `protobuf:"bytes,8,opt,name=default_table_expire_duration,json=defaultTableExpireDuration" json:"default_table_expire_duration,omitempty"` +} + +func (m *Dataset) Reset() { *m = Dataset{} } +func (m *Dataset) String() string { return proto.CompactTextString(m) } +func (*Dataset) ProtoMessage() {} +func (*Dataset) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{22} } + +func (m *Dataset) GetDatasetName() *DatasetName { + if m != nil { + return m.DatasetName + } + return nil +} + +func (m *Dataset) GetInfo() *DatasetInfo { + if m != nil { + return m.Info + } + return nil +} + +func (m *Dataset) GetCreateTime() *google_protobuf2.Timestamp { + if m != nil { + return m.CreateTime + } + return nil +} + +func (m *Dataset) GetUpdateTime() *google_protobuf2.Timestamp { + if m != nil { + return m.UpdateTime + } + return nil +} + +func (m *Dataset) GetAcl() *BigQueryAcl { + if m != nil { + return m.Acl + } + return nil +} + +func (m *Dataset) GetDefaultTableExpireDuration() *google_protobuf1.Duration { + if m != nil { + return m.DefaultTableExpireDuration + } + return nil +} + +// User-provided metadata for a dataset. +type DatasetInfo struct { + // A short name for the dataset, such as`"Analytics Data 2011"`. + FriendlyName string `protobuf:"bytes,1,opt,name=friendly_name,json=friendlyName" json:"friendly_name,omitempty"` + // A long description, perhaps several paragraphs, + // describing the dataset contents in detail. + Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` +} + +func (m *DatasetInfo) Reset() { *m = DatasetInfo{} } +func (m *DatasetInfo) String() string { return proto.CompactTextString(m) } +func (*DatasetInfo) ProtoMessage() {} +func (*DatasetInfo) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{23} } + +func (m *DatasetInfo) GetFriendlyName() string { + if m != nil { + return m.FriendlyName + } + return "" +} + +func (m *DatasetInfo) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +// An access control list. +type BigQueryAcl struct { + // Access control entry list. + Entries []*BigQueryAcl_Entry `protobuf:"bytes,1,rep,name=entries" json:"entries,omitempty"` +} + +func (m *BigQueryAcl) Reset() { *m = BigQueryAcl{} } +func (m *BigQueryAcl) String() string { return proto.CompactTextString(m) } +func (*BigQueryAcl) ProtoMessage() {} +func (*BigQueryAcl) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{24} } + +func (m *BigQueryAcl) GetEntries() []*BigQueryAcl_Entry { + if m != nil { + return m.Entries + } + return nil +} + +// Access control entry. +type BigQueryAcl_Entry struct { + // The granted role, which can be `READER`, `WRITER`, or `OWNER`. + Role string `protobuf:"bytes,1,opt,name=role" json:"role,omitempty"` + // Grants access to a group identified by an email address. + GroupEmail string `protobuf:"bytes,2,opt,name=group_email,json=groupEmail" json:"group_email,omitempty"` + // Grants access to a user identified by an email address. + UserEmail string `protobuf:"bytes,3,opt,name=user_email,json=userEmail" json:"user_email,omitempty"` + // Grants access to all members of a domain. + Domain string `protobuf:"bytes,4,opt,name=domain" json:"domain,omitempty"` + // Grants access to special groups. Valid groups are `PROJECT_OWNERS`, + // `PROJECT_READERS`, `PROJECT_WRITERS` and `ALL_AUTHENTICATED_USERS`. + SpecialGroup string `protobuf:"bytes,5,opt,name=special_group,json=specialGroup" json:"special_group,omitempty"` + // Grants access to a BigQuery View. + ViewName *TableName `protobuf:"bytes,6,opt,name=view_name,json=viewName" json:"view_name,omitempty"` +} + +func (m *BigQueryAcl_Entry) Reset() { *m = BigQueryAcl_Entry{} } +func (m *BigQueryAcl_Entry) String() string { return proto.CompactTextString(m) } +func (*BigQueryAcl_Entry) ProtoMessage() {} +func (*BigQueryAcl_Entry) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{24, 0} } + +func (m *BigQueryAcl_Entry) GetRole() string { + if m != nil { + return m.Role + } + return "" +} + +func (m *BigQueryAcl_Entry) GetGroupEmail() string { + if m != nil { + return m.GroupEmail + } + return "" +} + +func (m *BigQueryAcl_Entry) GetUserEmail() string { + if m != nil { + return m.UserEmail + } + return "" +} + +func (m *BigQueryAcl_Entry) GetDomain() string { + if m != nil { + return m.Domain + } + return "" +} + +func (m *BigQueryAcl_Entry) GetSpecialGroup() string { + if m != nil { + return m.SpecialGroup + } + return "" +} + +func (m *BigQueryAcl_Entry) GetViewName() *TableName { + if m != nil { + return m.ViewName + } + return nil +} + +// Describes a job. +type Job struct { + // Job name. + JobName *JobName `protobuf:"bytes,1,opt,name=job_name,json=jobName" json:"job_name,omitempty"` + // Job configuration. + JobConfiguration *JobConfiguration `protobuf:"bytes,2,opt,name=job_configuration,json=jobConfiguration" json:"job_configuration,omitempty"` + // Job status. + JobStatus *JobStatus `protobuf:"bytes,3,opt,name=job_status,json=jobStatus" json:"job_status,omitempty"` + // Job statistics. + JobStatistics *JobStatistics `protobuf:"bytes,4,opt,name=job_statistics,json=jobStatistics" json:"job_statistics,omitempty"` +} + +func (m *Job) Reset() { *m = Job{} } +func (m *Job) String() string { return proto.CompactTextString(m) } +func (*Job) ProtoMessage() {} +func (*Job) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{25} } + +func (m *Job) GetJobName() *JobName { + if m != nil { + return m.JobName + } + return nil +} + +func (m *Job) GetJobConfiguration() *JobConfiguration { + if m != nil { + return m.JobConfiguration + } + return nil +} + +func (m *Job) GetJobStatus() *JobStatus { + if m != nil { + return m.JobStatus + } + return nil +} + +func (m *Job) GetJobStatistics() *JobStatistics { + if m != nil { + return m.JobStatistics + } + return nil +} + +// Job configuration information. +// See the [Jobs](/bigquery/docs/reference/v2/jobs) API resource +// for more details on individual fields. +type JobConfiguration struct { + // Job configuration information. + // + // Types that are valid to be assigned to Configuration: + // *JobConfiguration_Query_ + // *JobConfiguration_Load_ + // *JobConfiguration_Extract_ + // *JobConfiguration_TableCopy_ + Configuration isJobConfiguration_Configuration `protobuf_oneof:"configuration"` + // If true, don't actually run the job. Just check that it would run. + DryRun bool `protobuf:"varint,9,opt,name=dry_run,json=dryRun" json:"dry_run,omitempty"` +} + +func (m *JobConfiguration) Reset() { *m = JobConfiguration{} } +func (m *JobConfiguration) String() string { return proto.CompactTextString(m) } +func (*JobConfiguration) ProtoMessage() {} +func (*JobConfiguration) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{26} } + +type isJobConfiguration_Configuration interface { + isJobConfiguration_Configuration() +} + +type JobConfiguration_Query_ struct { + Query *JobConfiguration_Query `protobuf:"bytes,5,opt,name=query,oneof"` +} +type JobConfiguration_Load_ struct { + Load *JobConfiguration_Load `protobuf:"bytes,6,opt,name=load,oneof"` +} +type JobConfiguration_Extract_ struct { + Extract *JobConfiguration_Extract `protobuf:"bytes,7,opt,name=extract,oneof"` +} +type JobConfiguration_TableCopy_ struct { + TableCopy *JobConfiguration_TableCopy `protobuf:"bytes,8,opt,name=table_copy,json=tableCopy,oneof"` +} + +func (*JobConfiguration_Query_) isJobConfiguration_Configuration() {} +func (*JobConfiguration_Load_) isJobConfiguration_Configuration() {} +func (*JobConfiguration_Extract_) isJobConfiguration_Configuration() {} +func (*JobConfiguration_TableCopy_) isJobConfiguration_Configuration() {} + +func (m *JobConfiguration) GetConfiguration() isJobConfiguration_Configuration { + if m != nil { + return m.Configuration + } + return nil +} + +func (m *JobConfiguration) GetQuery() *JobConfiguration_Query { + if x, ok := m.GetConfiguration().(*JobConfiguration_Query_); ok { + return x.Query + } + return nil +} + +func (m *JobConfiguration) GetLoad() *JobConfiguration_Load { + if x, ok := m.GetConfiguration().(*JobConfiguration_Load_); ok { + return x.Load + } + return nil +} + +func (m *JobConfiguration) GetExtract() *JobConfiguration_Extract { + if x, ok := m.GetConfiguration().(*JobConfiguration_Extract_); ok { + return x.Extract + } + return nil +} + +func (m *JobConfiguration) GetTableCopy() *JobConfiguration_TableCopy { + if x, ok := m.GetConfiguration().(*JobConfiguration_TableCopy_); ok { + return x.TableCopy + } + return nil +} + +func (m *JobConfiguration) GetDryRun() bool { + if m != nil { + return m.DryRun + } + return false +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*JobConfiguration) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _JobConfiguration_OneofMarshaler, _JobConfiguration_OneofUnmarshaler, _JobConfiguration_OneofSizer, []interface{}{ + (*JobConfiguration_Query_)(nil), + (*JobConfiguration_Load_)(nil), + (*JobConfiguration_Extract_)(nil), + (*JobConfiguration_TableCopy_)(nil), + } +} + +func _JobConfiguration_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*JobConfiguration) + // configuration + switch x := m.Configuration.(type) { + case *JobConfiguration_Query_: + b.EncodeVarint(5<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Query); err != nil { + return err + } + case *JobConfiguration_Load_: + b.EncodeVarint(6<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Load); err != nil { + return err + } + case *JobConfiguration_Extract_: + b.EncodeVarint(7<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Extract); err != nil { + return err + } + case *JobConfiguration_TableCopy_: + b.EncodeVarint(8<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.TableCopy); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("JobConfiguration.Configuration has unexpected type %T", x) + } + return nil +} + +func _JobConfiguration_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*JobConfiguration) + switch tag { + case 5: // configuration.query + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(JobConfiguration_Query) + err := b.DecodeMessage(msg) + m.Configuration = &JobConfiguration_Query_{msg} + return true, err + case 6: // configuration.load + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(JobConfiguration_Load) + err := b.DecodeMessage(msg) + m.Configuration = &JobConfiguration_Load_{msg} + return true, err + case 7: // configuration.extract + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(JobConfiguration_Extract) + err := b.DecodeMessage(msg) + m.Configuration = &JobConfiguration_Extract_{msg} + return true, err + case 8: // configuration.table_copy + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(JobConfiguration_TableCopy) + err := b.DecodeMessage(msg) + m.Configuration = &JobConfiguration_TableCopy_{msg} + return true, err + default: + return false, nil + } +} + +func _JobConfiguration_OneofSizer(msg proto.Message) (n int) { + m := msg.(*JobConfiguration) + // configuration + switch x := m.Configuration.(type) { + case *JobConfiguration_Query_: + s := proto.Size(x.Query) + n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *JobConfiguration_Load_: + s := proto.Size(x.Load) + n += proto.SizeVarint(6<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *JobConfiguration_Extract_: + s := proto.Size(x.Extract) + n += proto.SizeVarint(7<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *JobConfiguration_TableCopy_: + s := proto.Size(x.TableCopy) + n += proto.SizeVarint(8<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Describes a query job, which executes a SQL-like query. +type JobConfiguration_Query struct { + // The SQL query to run. + Query string `protobuf:"bytes,1,opt,name=query" json:"query,omitempty"` + // The table where results are written. + DestinationTable *TableName `protobuf:"bytes,2,opt,name=destination_table,json=destinationTable" json:"destination_table,omitempty"` + // Describes when a job is allowed to create a table: + // `CREATE_IF_NEEDED`, `CREATE_NEVER`. + CreateDisposition string `protobuf:"bytes,3,opt,name=create_disposition,json=createDisposition" json:"create_disposition,omitempty"` + // Describes how writes affect existing tables: + // `WRITE_TRUNCATE`, `WRITE_APPEND`, `WRITE_EMPTY`. + WriteDisposition string `protobuf:"bytes,4,opt,name=write_disposition,json=writeDisposition" json:"write_disposition,omitempty"` + // If a table name is specified without a dataset in a query, + // this dataset will be added to table name. + DefaultDataset *DatasetName `protobuf:"bytes,5,opt,name=default_dataset,json=defaultDataset" json:"default_dataset,omitempty"` + // Describes data sources outside BigQuery, if needed. + TableDefinitions []*TableDefinition `protobuf:"bytes,6,rep,name=table_definitions,json=tableDefinitions" json:"table_definitions,omitempty"` +} + +func (m *JobConfiguration_Query) Reset() { *m = JobConfiguration_Query{} } +func (m *JobConfiguration_Query) String() string { return proto.CompactTextString(m) } +func (*JobConfiguration_Query) ProtoMessage() {} +func (*JobConfiguration_Query) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{26, 0} } + +func (m *JobConfiguration_Query) GetQuery() string { + if m != nil { + return m.Query + } + return "" +} + +func (m *JobConfiguration_Query) GetDestinationTable() *TableName { + if m != nil { + return m.DestinationTable + } + return nil +} + +func (m *JobConfiguration_Query) GetCreateDisposition() string { + if m != nil { + return m.CreateDisposition + } + return "" +} + +func (m *JobConfiguration_Query) GetWriteDisposition() string { + if m != nil { + return m.WriteDisposition + } + return "" +} + +func (m *JobConfiguration_Query) GetDefaultDataset() *DatasetName { + if m != nil { + return m.DefaultDataset + } + return nil +} + +func (m *JobConfiguration_Query) GetTableDefinitions() []*TableDefinition { + if m != nil { + return m.TableDefinitions + } + return nil +} + +// Describes a load job, which loads data from an external source via +// the import pipeline. +type JobConfiguration_Load struct { + // URIs for the data to be imported. Only Google Cloud Storage URIs are + // supported. + SourceUris []string `protobuf:"bytes,1,rep,name=source_uris,json=sourceUris" json:"source_uris,omitempty"` + // The table schema in JSON format representation of a TableSchema. + SchemaJson string `protobuf:"bytes,6,opt,name=schema_json,json=schemaJson" json:"schema_json,omitempty"` + // The table where the imported data is written. + DestinationTable *TableName `protobuf:"bytes,3,opt,name=destination_table,json=destinationTable" json:"destination_table,omitempty"` + // Describes when a job is allowed to create a table: + // `CREATE_IF_NEEDED`, `CREATE_NEVER`. + CreateDisposition string `protobuf:"bytes,4,opt,name=create_disposition,json=createDisposition" json:"create_disposition,omitempty"` + // Describes how writes affect existing tables: + // `WRITE_TRUNCATE`, `WRITE_APPEND`, `WRITE_EMPTY`. + WriteDisposition string `protobuf:"bytes,5,opt,name=write_disposition,json=writeDisposition" json:"write_disposition,omitempty"` +} + +func (m *JobConfiguration_Load) Reset() { *m = JobConfiguration_Load{} } +func (m *JobConfiguration_Load) String() string { return proto.CompactTextString(m) } +func (*JobConfiguration_Load) ProtoMessage() {} +func (*JobConfiguration_Load) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{26, 1} } + +func (m *JobConfiguration_Load) GetSourceUris() []string { + if m != nil { + return m.SourceUris + } + return nil +} + +func (m *JobConfiguration_Load) GetSchemaJson() string { + if m != nil { + return m.SchemaJson + } + return "" +} + +func (m *JobConfiguration_Load) GetDestinationTable() *TableName { + if m != nil { + return m.DestinationTable + } + return nil +} + +func (m *JobConfiguration_Load) GetCreateDisposition() string { + if m != nil { + return m.CreateDisposition + } + return "" +} + +func (m *JobConfiguration_Load) GetWriteDisposition() string { + if m != nil { + return m.WriteDisposition + } + return "" +} + +// Describes an extract job, which exports data to an external source +// via the export pipeline. +type JobConfiguration_Extract struct { + // Google Cloud Storage URIs where extracted data should be written. + DestinationUris []string `protobuf:"bytes,1,rep,name=destination_uris,json=destinationUris" json:"destination_uris,omitempty"` + // The source table. + SourceTable *TableName `protobuf:"bytes,2,opt,name=source_table,json=sourceTable" json:"source_table,omitempty"` +} + +func (m *JobConfiguration_Extract) Reset() { *m = JobConfiguration_Extract{} } +func (m *JobConfiguration_Extract) String() string { return proto.CompactTextString(m) } +func (*JobConfiguration_Extract) ProtoMessage() {} +func (*JobConfiguration_Extract) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{26, 2} } + +func (m *JobConfiguration_Extract) GetDestinationUris() []string { + if m != nil { + return m.DestinationUris + } + return nil +} + +func (m *JobConfiguration_Extract) GetSourceTable() *TableName { + if m != nil { + return m.SourceTable + } + return nil +} + +// Describes a copy job, which copies an existing table to another table. +type JobConfiguration_TableCopy struct { + // Source tables. + SourceTables []*TableName `protobuf:"bytes,1,rep,name=source_tables,json=sourceTables" json:"source_tables,omitempty"` + // Destination table. + DestinationTable *TableName `protobuf:"bytes,2,opt,name=destination_table,json=destinationTable" json:"destination_table,omitempty"` + // Describes when a job is allowed to create a table: + // `CREATE_IF_NEEDED`, `CREATE_NEVER`. + CreateDisposition string `protobuf:"bytes,3,opt,name=create_disposition,json=createDisposition" json:"create_disposition,omitempty"` + // Describes how writes affect existing tables: + // `WRITE_TRUNCATE`, `WRITE_APPEND`, `WRITE_EMPTY`. + WriteDisposition string `protobuf:"bytes,4,opt,name=write_disposition,json=writeDisposition" json:"write_disposition,omitempty"` +} + +func (m *JobConfiguration_TableCopy) Reset() { *m = JobConfiguration_TableCopy{} } +func (m *JobConfiguration_TableCopy) String() string { return proto.CompactTextString(m) } +func (*JobConfiguration_TableCopy) ProtoMessage() {} +func (*JobConfiguration_TableCopy) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{26, 3} } + +func (m *JobConfiguration_TableCopy) GetSourceTables() []*TableName { + if m != nil { + return m.SourceTables + } + return nil +} + +func (m *JobConfiguration_TableCopy) GetDestinationTable() *TableName { + if m != nil { + return m.DestinationTable + } + return nil +} + +func (m *JobConfiguration_TableCopy) GetCreateDisposition() string { + if m != nil { + return m.CreateDisposition + } + return "" +} + +func (m *JobConfiguration_TableCopy) GetWriteDisposition() string { + if m != nil { + return m.WriteDisposition + } + return "" +} + +// Describes an external data source used in a query. +type TableDefinition struct { + // Name of the table, used in queries. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Google Cloud Storage URIs for the data to be imported. + SourceUris []string `protobuf:"bytes,2,rep,name=source_uris,json=sourceUris" json:"source_uris,omitempty"` +} + +func (m *TableDefinition) Reset() { *m = TableDefinition{} } +func (m *TableDefinition) String() string { return proto.CompactTextString(m) } +func (*TableDefinition) ProtoMessage() {} +func (*TableDefinition) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{27} } + +func (m *TableDefinition) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *TableDefinition) GetSourceUris() []string { + if m != nil { + return m.SourceUris + } + return nil +} + +// Running state of a job. +type JobStatus struct { + // State of a job: `PENDING`, `RUNNING`, or `DONE`. + State string `protobuf:"bytes,1,opt,name=state" json:"state,omitempty"` + // If the job did not complete successfully, this field describes why. + Error *google_rpc.Status `protobuf:"bytes,2,opt,name=error" json:"error,omitempty"` +} + +func (m *JobStatus) Reset() { *m = JobStatus{} } +func (m *JobStatus) String() string { return proto.CompactTextString(m) } +func (*JobStatus) ProtoMessage() {} +func (*JobStatus) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{28} } + +func (m *JobStatus) GetState() string { + if m != nil { + return m.State + } + return "" +} + +func (m *JobStatus) GetError() *google_rpc.Status { + if m != nil { + return m.Error + } + return nil +} + +// Job statistics that may change after a job starts. +type JobStatistics struct { + // Time when the job was created. + CreateTime *google_protobuf2.Timestamp `protobuf:"bytes,1,opt,name=create_time,json=createTime" json:"create_time,omitempty"` + // Time when the job started. + StartTime *google_protobuf2.Timestamp `protobuf:"bytes,2,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + // Time when the job ended. + EndTime *google_protobuf2.Timestamp `protobuf:"bytes,3,opt,name=end_time,json=endTime" json:"end_time,omitempty"` + // Total bytes processed for a job. + TotalProcessedBytes int64 `protobuf:"varint,4,opt,name=total_processed_bytes,json=totalProcessedBytes" json:"total_processed_bytes,omitempty"` + // Processed bytes, adjusted by the job's CPU usage. + TotalBilledBytes int64 `protobuf:"varint,5,opt,name=total_billed_bytes,json=totalBilledBytes" json:"total_billed_bytes,omitempty"` + // The tier assigned by CPU-based billing. + BillingTier int32 `protobuf:"varint,7,opt,name=billing_tier,json=billingTier" json:"billing_tier,omitempty"` +} + +func (m *JobStatistics) Reset() { *m = JobStatistics{} } +func (m *JobStatistics) String() string { return proto.CompactTextString(m) } +func (*JobStatistics) ProtoMessage() {} +func (*JobStatistics) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{29} } + +func (m *JobStatistics) GetCreateTime() *google_protobuf2.Timestamp { + if m != nil { + return m.CreateTime + } + return nil +} + +func (m *JobStatistics) GetStartTime() *google_protobuf2.Timestamp { + if m != nil { + return m.StartTime + } + return nil +} + +func (m *JobStatistics) GetEndTime() *google_protobuf2.Timestamp { + if m != nil { + return m.EndTime + } + return nil +} + +func (m *JobStatistics) GetTotalProcessedBytes() int64 { + if m != nil { + return m.TotalProcessedBytes + } + return 0 +} + +func (m *JobStatistics) GetTotalBilledBytes() int64 { + if m != nil { + return m.TotalBilledBytes + } + return 0 +} + +func (m *JobStatistics) GetBillingTier() int32 { + if m != nil { + return m.BillingTier + } + return 0 +} + +// The fully-qualified name for a dataset. +type DatasetName struct { + // The project ID. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The dataset ID within the project. + DatasetId string `protobuf:"bytes,2,opt,name=dataset_id,json=datasetId" json:"dataset_id,omitempty"` +} + +func (m *DatasetName) Reset() { *m = DatasetName{} } +func (m *DatasetName) String() string { return proto.CompactTextString(m) } +func (*DatasetName) ProtoMessage() {} +func (*DatasetName) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{30} } + +func (m *DatasetName) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *DatasetName) GetDatasetId() string { + if m != nil { + return m.DatasetId + } + return "" +} + +// The fully-qualified name for a table. +type TableName struct { + // The project ID. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The dataset ID within the project. + DatasetId string `protobuf:"bytes,2,opt,name=dataset_id,json=datasetId" json:"dataset_id,omitempty"` + // The table ID of the table within the dataset. + TableId string `protobuf:"bytes,3,opt,name=table_id,json=tableId" json:"table_id,omitempty"` +} + +func (m *TableName) Reset() { *m = TableName{} } +func (m *TableName) String() string { return proto.CompactTextString(m) } +func (*TableName) ProtoMessage() {} +func (*TableName) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{31} } + +func (m *TableName) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *TableName) GetDatasetId() string { + if m != nil { + return m.DatasetId + } + return "" +} + +func (m *TableName) GetTableId() string { + if m != nil { + return m.TableId + } + return "" +} + +// The fully-qualified name for a job. +type JobName struct { + // The project ID. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The job ID within the project. + JobId string `protobuf:"bytes,2,opt,name=job_id,json=jobId" json:"job_id,omitempty"` +} + +func (m *JobName) Reset() { *m = JobName{} } +func (m *JobName) String() string { return proto.CompactTextString(m) } +func (*JobName) ProtoMessage() {} +func (*JobName) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{32} } + +func (m *JobName) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *JobName) GetJobId() string { + if m != nil { + return m.JobId + } + return "" +} + +func init() { + proto.RegisterType((*AuditData)(nil), "google.cloud.bigquery.logging.v1.AuditData") + proto.RegisterType((*TableInsertRequest)(nil), "google.cloud.bigquery.logging.v1.TableInsertRequest") + proto.RegisterType((*TableUpdateRequest)(nil), "google.cloud.bigquery.logging.v1.TableUpdateRequest") + proto.RegisterType((*TableInsertResponse)(nil), "google.cloud.bigquery.logging.v1.TableInsertResponse") + proto.RegisterType((*TableUpdateResponse)(nil), "google.cloud.bigquery.logging.v1.TableUpdateResponse") + proto.RegisterType((*DatasetListRequest)(nil), "google.cloud.bigquery.logging.v1.DatasetListRequest") + proto.RegisterType((*DatasetInsertRequest)(nil), "google.cloud.bigquery.logging.v1.DatasetInsertRequest") + proto.RegisterType((*DatasetInsertResponse)(nil), "google.cloud.bigquery.logging.v1.DatasetInsertResponse") + proto.RegisterType((*DatasetUpdateRequest)(nil), "google.cloud.bigquery.logging.v1.DatasetUpdateRequest") + proto.RegisterType((*DatasetUpdateResponse)(nil), "google.cloud.bigquery.logging.v1.DatasetUpdateResponse") + proto.RegisterType((*JobInsertRequest)(nil), "google.cloud.bigquery.logging.v1.JobInsertRequest") + proto.RegisterType((*JobInsertResponse)(nil), "google.cloud.bigquery.logging.v1.JobInsertResponse") + proto.RegisterType((*JobQueryRequest)(nil), "google.cloud.bigquery.logging.v1.JobQueryRequest") + proto.RegisterType((*JobQueryResponse)(nil), "google.cloud.bigquery.logging.v1.JobQueryResponse") + proto.RegisterType((*JobGetQueryResultsRequest)(nil), "google.cloud.bigquery.logging.v1.JobGetQueryResultsRequest") + proto.RegisterType((*JobGetQueryResultsResponse)(nil), "google.cloud.bigquery.logging.v1.JobGetQueryResultsResponse") + proto.RegisterType((*JobQueryDoneResponse)(nil), "google.cloud.bigquery.logging.v1.JobQueryDoneResponse") + proto.RegisterType((*JobCompletedEvent)(nil), "google.cloud.bigquery.logging.v1.JobCompletedEvent") + proto.RegisterType((*TableDataListRequest)(nil), "google.cloud.bigquery.logging.v1.TableDataListRequest") + proto.RegisterType((*Table)(nil), "google.cloud.bigquery.logging.v1.Table") + proto.RegisterType((*TableInfo)(nil), "google.cloud.bigquery.logging.v1.TableInfo") + proto.RegisterType((*TableViewDefinition)(nil), "google.cloud.bigquery.logging.v1.TableViewDefinition") + proto.RegisterType((*Dataset)(nil), "google.cloud.bigquery.logging.v1.Dataset") + proto.RegisterType((*DatasetInfo)(nil), "google.cloud.bigquery.logging.v1.DatasetInfo") + proto.RegisterType((*BigQueryAcl)(nil), "google.cloud.bigquery.logging.v1.BigQueryAcl") + proto.RegisterType((*BigQueryAcl_Entry)(nil), "google.cloud.bigquery.logging.v1.BigQueryAcl.Entry") + proto.RegisterType((*Job)(nil), "google.cloud.bigquery.logging.v1.Job") + proto.RegisterType((*JobConfiguration)(nil), "google.cloud.bigquery.logging.v1.JobConfiguration") + proto.RegisterType((*JobConfiguration_Query)(nil), "google.cloud.bigquery.logging.v1.JobConfiguration.Query") + proto.RegisterType((*JobConfiguration_Load)(nil), "google.cloud.bigquery.logging.v1.JobConfiguration.Load") + proto.RegisterType((*JobConfiguration_Extract)(nil), "google.cloud.bigquery.logging.v1.JobConfiguration.Extract") + proto.RegisterType((*JobConfiguration_TableCopy)(nil), "google.cloud.bigquery.logging.v1.JobConfiguration.TableCopy") + proto.RegisterType((*TableDefinition)(nil), "google.cloud.bigquery.logging.v1.TableDefinition") + proto.RegisterType((*JobStatus)(nil), "google.cloud.bigquery.logging.v1.JobStatus") + proto.RegisterType((*JobStatistics)(nil), "google.cloud.bigquery.logging.v1.JobStatistics") + proto.RegisterType((*DatasetName)(nil), "google.cloud.bigquery.logging.v1.DatasetName") + proto.RegisterType((*TableName)(nil), "google.cloud.bigquery.logging.v1.TableName") + proto.RegisterType((*JobName)(nil), "google.cloud.bigquery.logging.v1.JobName") +} + +func init() { proto.RegisterFile("google/cloud/bigquery/logging/v1/audit_data.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 2036 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x59, 0x4f, 0x73, 0x1b, 0x49, + 0x15, 0x8f, 0x2c, 0xc9, 0x92, 0x9e, 0xec, 0xd8, 0xee, 0xd8, 0x9b, 0x58, 0x90, 0xdd, 0x30, 0x40, + 0xb1, 0x29, 0x13, 0xa9, 0x9c, 0x65, 0x09, 0x90, 0xad, 0x4a, 0xd9, 0xb1, 0x89, 0x93, 0xfd, 0x83, + 0x19, 0x1c, 0x17, 0xbb, 0xc5, 0xae, 0x6a, 0x34, 0xd3, 0xd6, 0xb6, 0x76, 0x34, 0x3d, 0x99, 0x69, + 0xc5, 0x31, 0x17, 0x0a, 0x8a, 0x1b, 0x47, 0x3e, 0x0c, 0x07, 0x2e, 0x50, 0x7c, 0x01, 0x8e, 0x5c, + 0xb8, 0xf0, 0x41, 0x28, 0xaa, 0x5f, 0x77, 0x8f, 0x66, 0x46, 0x72, 0x79, 0xc6, 0x68, 0x0f, 0x7b, + 0x9b, 0x79, 0xdd, 0xbf, 0xf7, 0xeb, 0x7e, 0xfd, 0xfe, 0xf5, 0x0c, 0xec, 0x0e, 0x39, 0x1f, 0xfa, + 0xb4, 0xe7, 0xfa, 0x7c, 0xe2, 0xf5, 0x06, 0x6c, 0xf8, 0x6a, 0x42, 0xa3, 0x8b, 0x9e, 0xcf, 0x87, + 0x43, 0x16, 0x0c, 0x7b, 0xaf, 0x77, 0x7b, 0xce, 0xc4, 0x63, 0xa2, 0xef, 0x39, 0xc2, 0xe9, 0x86, + 0x11, 0x17, 0x9c, 0xdc, 0x53, 0x90, 0x2e, 0x42, 0xba, 0x06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0xe5, 0xed, 0x68, 0xf8, 0xb2, 0x96, 0x1c, 0x00, 0x19, 0xf1, 0x41, 0x7e, 0x6f, 0x75, 0xe4, 0x7a, + 0x78, 0x35, 0xd7, 0x0b, 0x3e, 0xc8, 0xef, 0x6b, 0x7d, 0x94, 0x93, 0x91, 0x3e, 0x6c, 0x48, 0x0e, + 0x04, 0x27, 0x14, 0xcb, 0x48, 0xb1, 0x5b, 0x88, 0xe2, 0x97, 0x52, 0x36, 0x65, 0x58, 0x1b, 0x65, + 0x45, 0xe4, 0x77, 0x70, 0x57, 0x12, 0x0c, 0xa9, 0x48, 0x48, 0xe2, 0x89, 0x2f, 0xe2, 0x84, 0xac, + 0x81, 0x64, 0x8f, 0x0b, 0x91, 0x3d, 0xa3, 0x42, 0x2b, 0x47, 0x1d, 0x53, 0xda, 0xed, 0xd1, 0x65, + 0x83, 0x84, 0xc3, 0x6d, 0xe5, 0xf9, 0xd2, 0xc6, 0x59, 0x97, 0x6c, 0x16, 0x3d, 0x36, 0x74, 0x7e, + 0x79, 0x76, 0x59, 0xa7, 0x54, 0x21, 0x95, 0x93, 0x93, 0xaf, 0x60, 0x2b, 0x17, 0xd4, 0x71, 0xc8, + 0x83, 0x98, 0xde, 0x69, 0x21, 0xdd, 0xfb, 0x25, 0xa3, 0x5a, 0x81, 0x8f, 0x2a, 0xf6, 0x2d, 0x31, + 0x2b, 0x9e, 0x92, 0x25, 0x1e, 0xa9, 0xc9, 0xa0, 0x14, 0x99, 0x71, 0xbc, 0x1c, 0x59, 0x56, 0x4c, + 0x5e, 0xc1, 0xed, 0x99, 0x80, 0xd3, 0x74, 0x6d, 0xa4, 0x7b, 0x54, 0x3a, 0xe2, 0x12, 0xc2, 0x2d, + 0x6f, 0xde, 0x40, 0x9a, 0x32, 0xbf, 0xc3, 0x95, 0x92, 0x94, 0x33, 0x7b, 0xdc, 0xf2, 0xe6, 0x0d, + 0x10, 0x0a, 0xb7, 0x32, 0x61, 0xa7, 0xe9, 0x08, 0xd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, + 0xb7, 0xff, 0xfb, 0x0a, 0x7c, 0xcf, 0xe5, 0xe3, 0x2b, 0x03, 0x70, 0xff, 0x66, 0xf2, 0x07, 0xfa, + 0x58, 0x9e, 0xe3, 0x71, 0xe5, 0xb3, 0x67, 0x1a, 0x33, 0xe4, 0xbe, 0x13, 0x0c, 0xbb, 0x3c, 0x1a, + 0xf6, 0x86, 0x34, 0xc0, 0x53, 0xee, 0xa9, 0x21, 0x27, 0x64, 0xf1, 0xe5, 0xbf, 0xe0, 0x1f, 0xeb, + 0xc7, 0xc1, 0x32, 0x62, 0xde, 0xfb, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x76, 0x60, 0x19, 0x87, + 0xb5, 0x1f, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/billing/v1/cloud_billing.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/billing/v1/cloud_billing.pb.go new file mode 100644 index 0000000000..238193b8c2 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/billing/v1/cloud_billing.pb.go @@ -0,0 +1,688 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/billing/v1/cloud_billing.proto + +/* +Package billing is a generated protocol buffer package. + +It is generated from these files: + google/cloud/billing/v1/cloud_billing.proto + +It has these top-level messages: + BillingAccount + ProjectBillingInfo + GetBillingAccountRequest + ListBillingAccountsRequest + ListBillingAccountsResponse + ListProjectBillingInfoRequest + ListProjectBillingInfoResponse + GetProjectBillingInfoRequest + UpdateProjectBillingInfoRequest +*/ +package billing + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// A billing account in [Google Cloud +// Console](https://console.cloud.google.com/). You can assign a billing account +// to one or more projects. +type BillingAccount struct { + // The resource name of the billing account. The resource name has the form + // `billingAccounts/{billing_account_id}`. For example, + // `billingAccounts/012345-567890-ABCDEF` would be the resource name for + // billing account `012345-567890-ABCDEF`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // True if the billing account is open, and will therefore be charged for any + // usage on associated projects. False if the billing account is closed, and + // therefore projects associated with it will be unable to use paid services. + Open bool `protobuf:"varint,2,opt,name=open" json:"open,omitempty"` + // The display name given to the billing account, such as `My Billing + // Account`. This name is displayed in the Google Cloud Console. + DisplayName string `protobuf:"bytes,3,opt,name=display_name,json=displayName" json:"display_name,omitempty"` +} + +func (m *BillingAccount) Reset() { *m = BillingAccount{} } +func (m *BillingAccount) String() string { return proto.CompactTextString(m) } +func (*BillingAccount) ProtoMessage() {} +func (*BillingAccount) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *BillingAccount) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *BillingAccount) GetOpen() bool { + if m != nil { + return m.Open + } + return false +} + +func (m *BillingAccount) GetDisplayName() string { + if m != nil { + return m.DisplayName + } + return "" +} + +// Encapsulation of billing information for a Cloud Console project. A project +// has at most one associated billing account at a time (but a billing account +// can be assigned to multiple projects). +type ProjectBillingInfo struct { + // The resource name for the `ProjectBillingInfo`; has the form + // `projects/{project_id}/billingInfo`. For example, the resource name for the + // billing information for project `tokyo-rain-123` would be + // `projects/tokyo-rain-123/billingInfo`. This field is read-only. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The ID of the project that this `ProjectBillingInfo` represents, such as + // `tokyo-rain-123`. This is a convenience field so that you don't need to + // parse the `name` field to obtain a project ID. This field is read-only. + ProjectId string `protobuf:"bytes,2,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The resource name of the billing account associated with the project, if + // any. For example, `billingAccounts/012345-567890-ABCDEF`. + BillingAccountName string `protobuf:"bytes,3,opt,name=billing_account_name,json=billingAccountName" json:"billing_account_name,omitempty"` + // True if the project is associated with an open billing account, to which + // usage on the project is charged. False if the project is associated with a + // closed billing account, or no billing account at all, and therefore cannot + // use paid services. This field is read-only. + BillingEnabled bool `protobuf:"varint,4,opt,name=billing_enabled,json=billingEnabled" json:"billing_enabled,omitempty"` +} + +func (m *ProjectBillingInfo) Reset() { *m = ProjectBillingInfo{} } +func (m *ProjectBillingInfo) String() string { return proto.CompactTextString(m) } +func (*ProjectBillingInfo) ProtoMessage() {} +func (*ProjectBillingInfo) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *ProjectBillingInfo) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ProjectBillingInfo) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *ProjectBillingInfo) GetBillingAccountName() string { + if m != nil { + return m.BillingAccountName + } + return "" +} + +func (m *ProjectBillingInfo) GetBillingEnabled() bool { + if m != nil { + return m.BillingEnabled + } + return false +} + +// Request message for `GetBillingAccount`. +type GetBillingAccountRequest struct { + // The resource name of the billing account to retrieve. For example, + // `billingAccounts/012345-567890-ABCDEF`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetBillingAccountRequest) Reset() { *m = GetBillingAccountRequest{} } +func (m *GetBillingAccountRequest) String() string { return proto.CompactTextString(m) } +func (*GetBillingAccountRequest) ProtoMessage() {} +func (*GetBillingAccountRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *GetBillingAccountRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Request message for `ListBillingAccounts`. +type ListBillingAccountsRequest struct { + // Requested page size. The maximum page size is 100; this is also the + // default. + PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // A token identifying a page of results to return. This should be a + // `next_page_token` value returned from a previous `ListBillingAccounts` + // call. If unspecified, the first page of results is returned. + PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListBillingAccountsRequest) Reset() { *m = ListBillingAccountsRequest{} } +func (m *ListBillingAccountsRequest) String() string { return proto.CompactTextString(m) } +func (*ListBillingAccountsRequest) ProtoMessage() {} +func (*ListBillingAccountsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *ListBillingAccountsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListBillingAccountsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// Response message for `ListBillingAccounts`. +type ListBillingAccountsResponse struct { + // A list of billing accounts. + BillingAccounts []*BillingAccount `protobuf:"bytes,1,rep,name=billing_accounts,json=billingAccounts" json:"billing_accounts,omitempty"` + // A token to retrieve the next page of results. To retrieve the next page, + // call `ListBillingAccounts` again with the `page_token` field set to this + // value. This field is empty if there are no more results to retrieve. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListBillingAccountsResponse) Reset() { *m = ListBillingAccountsResponse{} } +func (m *ListBillingAccountsResponse) String() string { return proto.CompactTextString(m) } +func (*ListBillingAccountsResponse) ProtoMessage() {} +func (*ListBillingAccountsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *ListBillingAccountsResponse) GetBillingAccounts() []*BillingAccount { + if m != nil { + return m.BillingAccounts + } + return nil +} + +func (m *ListBillingAccountsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// Request message for `ListProjectBillingInfo`. +type ListProjectBillingInfoRequest struct { + // The resource name of the billing account associated with the projects that + // you want to list. For example, `billingAccounts/012345-567890-ABCDEF`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Requested page size. The maximum page size is 100; this is also the + // default. + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // A token identifying a page of results to be returned. This should be a + // `next_page_token` value returned from a previous `ListProjectBillingInfo` + // call. If unspecified, the first page of results is returned. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListProjectBillingInfoRequest) Reset() { *m = ListProjectBillingInfoRequest{} } +func (m *ListProjectBillingInfoRequest) String() string { return proto.CompactTextString(m) } +func (*ListProjectBillingInfoRequest) ProtoMessage() {} +func (*ListProjectBillingInfoRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *ListProjectBillingInfoRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ListProjectBillingInfoRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListProjectBillingInfoRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// Request message for `ListProjectBillingInfoResponse`. +type ListProjectBillingInfoResponse struct { + // A list of `ProjectBillingInfo` resources representing the projects + // associated with the billing account. + ProjectBillingInfo []*ProjectBillingInfo `protobuf:"bytes,1,rep,name=project_billing_info,json=projectBillingInfo" json:"project_billing_info,omitempty"` + // A token to retrieve the next page of results. To retrieve the next page, + // call `ListProjectBillingInfo` again with the `page_token` field set to this + // value. This field is empty if there are no more results to retrieve. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListProjectBillingInfoResponse) Reset() { *m = ListProjectBillingInfoResponse{} } +func (m *ListProjectBillingInfoResponse) String() string { return proto.CompactTextString(m) } +func (*ListProjectBillingInfoResponse) ProtoMessage() {} +func (*ListProjectBillingInfoResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *ListProjectBillingInfoResponse) GetProjectBillingInfo() []*ProjectBillingInfo { + if m != nil { + return m.ProjectBillingInfo + } + return nil +} + +func (m *ListProjectBillingInfoResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// Request message for `GetProjectBillingInfo`. +type GetProjectBillingInfoRequest struct { + // The resource name of the project for which billing information is + // retrieved. For example, `projects/tokyo-rain-123`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetProjectBillingInfoRequest) Reset() { *m = GetProjectBillingInfoRequest{} } +func (m *GetProjectBillingInfoRequest) String() string { return proto.CompactTextString(m) } +func (*GetProjectBillingInfoRequest) ProtoMessage() {} +func (*GetProjectBillingInfoRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *GetProjectBillingInfoRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Request message for `UpdateProjectBillingInfo`. +type UpdateProjectBillingInfoRequest struct { + // The resource name of the project associated with the billing information + // that you want to update. For example, `projects/tokyo-rain-123`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The new billing information for the project. Read-only fields are ignored; + // thus, you may leave empty all fields except `billing_account_name`. + ProjectBillingInfo *ProjectBillingInfo `protobuf:"bytes,2,opt,name=project_billing_info,json=projectBillingInfo" json:"project_billing_info,omitempty"` +} + +func (m *UpdateProjectBillingInfoRequest) Reset() { *m = UpdateProjectBillingInfoRequest{} } +func (m *UpdateProjectBillingInfoRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateProjectBillingInfoRequest) ProtoMessage() {} +func (*UpdateProjectBillingInfoRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *UpdateProjectBillingInfoRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *UpdateProjectBillingInfoRequest) GetProjectBillingInfo() *ProjectBillingInfo { + if m != nil { + return m.ProjectBillingInfo + } + return nil +} + +func init() { + proto.RegisterType((*BillingAccount)(nil), "google.cloud.billing.v1.BillingAccount") + proto.RegisterType((*ProjectBillingInfo)(nil), "google.cloud.billing.v1.ProjectBillingInfo") + proto.RegisterType((*GetBillingAccountRequest)(nil), "google.cloud.billing.v1.GetBillingAccountRequest") + proto.RegisterType((*ListBillingAccountsRequest)(nil), "google.cloud.billing.v1.ListBillingAccountsRequest") + proto.RegisterType((*ListBillingAccountsResponse)(nil), "google.cloud.billing.v1.ListBillingAccountsResponse") + proto.RegisterType((*ListProjectBillingInfoRequest)(nil), "google.cloud.billing.v1.ListProjectBillingInfoRequest") + proto.RegisterType((*ListProjectBillingInfoResponse)(nil), "google.cloud.billing.v1.ListProjectBillingInfoResponse") + proto.RegisterType((*GetProjectBillingInfoRequest)(nil), "google.cloud.billing.v1.GetProjectBillingInfoRequest") + proto.RegisterType((*UpdateProjectBillingInfoRequest)(nil), "google.cloud.billing.v1.UpdateProjectBillingInfoRequest") +} + +// 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 + +// Client API for CloudBilling service + +type CloudBillingClient interface { + // Gets information about a billing account. The current authenticated user + // must be an [owner of the billing + // account](https://support.google.com/cloud/answer/4430947). + GetBillingAccount(ctx context.Context, in *GetBillingAccountRequest, opts ...grpc.CallOption) (*BillingAccount, error) + // Lists the billing accounts that the current authenticated user + // [owns](https://support.google.com/cloud/answer/4430947). + ListBillingAccounts(ctx context.Context, in *ListBillingAccountsRequest, opts ...grpc.CallOption) (*ListBillingAccountsResponse, error) + // Lists the projects associated with a billing account. The current + // authenticated user must be an [owner of the billing + // account](https://support.google.com/cloud/answer/4430947). + ListProjectBillingInfo(ctx context.Context, in *ListProjectBillingInfoRequest, opts ...grpc.CallOption) (*ListProjectBillingInfoResponse, error) + // Gets the billing information for a project. The current authenticated user + // must have [permission to view the + // project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo + // ). + GetProjectBillingInfo(ctx context.Context, in *GetProjectBillingInfoRequest, opts ...grpc.CallOption) (*ProjectBillingInfo, error) + // Sets or updates the billing account associated with a project. You specify + // the new billing account by setting the `billing_account_name` in the + // `ProjectBillingInfo` resource to the resource name of a billing account. + // Associating a project with an open billing account enables billing on the + // project and allows charges for resource usage. If the project already had a + // billing account, this method changes the billing account used for resource + // usage charges. + // + // *Note:* Incurred charges that have not yet been reported in the transaction + // history of the Google Cloud Console may be billed to the new billing + // account, even if the charge occurred before the new billing account was + // assigned to the project. + // + // The current authenticated user must have ownership privileges for both the + // [project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo + // ) and the [billing + // account](https://support.google.com/cloud/answer/4430947). + // + // You can disable billing on the project by setting the + // `billing_account_name` field to empty. This action disassociates the + // current billing account from the project. Any billable activity of your + // in-use services will stop, and your application could stop functioning as + // expected. Any unbilled charges to date will be billed to the previously + // associated account. The current authenticated user must be either an owner + // of the project or an owner of the billing account for the project. + // + // Note that associating a project with a *closed* billing account will have + // much the same effect as disabling billing on the project: any paid + // resources used by the project will be shut down. Thus, unless you wish to + // disable billing, you should always call this method with the name of an + // *open* billing account. + UpdateProjectBillingInfo(ctx context.Context, in *UpdateProjectBillingInfoRequest, opts ...grpc.CallOption) (*ProjectBillingInfo, error) +} + +type cloudBillingClient struct { + cc *grpc.ClientConn +} + +func NewCloudBillingClient(cc *grpc.ClientConn) CloudBillingClient { + return &cloudBillingClient{cc} +} + +func (c *cloudBillingClient) GetBillingAccount(ctx context.Context, in *GetBillingAccountRequest, opts ...grpc.CallOption) (*BillingAccount, error) { + out := new(BillingAccount) + err := grpc.Invoke(ctx, "/google.cloud.billing.v1.CloudBilling/GetBillingAccount", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *cloudBillingClient) ListBillingAccounts(ctx context.Context, in *ListBillingAccountsRequest, opts ...grpc.CallOption) (*ListBillingAccountsResponse, error) { + out := new(ListBillingAccountsResponse) + err := grpc.Invoke(ctx, "/google.cloud.billing.v1.CloudBilling/ListBillingAccounts", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *cloudBillingClient) ListProjectBillingInfo(ctx context.Context, in *ListProjectBillingInfoRequest, opts ...grpc.CallOption) (*ListProjectBillingInfoResponse, error) { + out := new(ListProjectBillingInfoResponse) + err := grpc.Invoke(ctx, "/google.cloud.billing.v1.CloudBilling/ListProjectBillingInfo", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *cloudBillingClient) GetProjectBillingInfo(ctx context.Context, in *GetProjectBillingInfoRequest, opts ...grpc.CallOption) (*ProjectBillingInfo, error) { + out := new(ProjectBillingInfo) + err := grpc.Invoke(ctx, "/google.cloud.billing.v1.CloudBilling/GetProjectBillingInfo", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *cloudBillingClient) UpdateProjectBillingInfo(ctx context.Context, in *UpdateProjectBillingInfoRequest, opts ...grpc.CallOption) (*ProjectBillingInfo, error) { + out := new(ProjectBillingInfo) + err := grpc.Invoke(ctx, "/google.cloud.billing.v1.CloudBilling/UpdateProjectBillingInfo", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for CloudBilling service + +type CloudBillingServer interface { + // Gets information about a billing account. The current authenticated user + // must be an [owner of the billing + // account](https://support.google.com/cloud/answer/4430947). + GetBillingAccount(context.Context, *GetBillingAccountRequest) (*BillingAccount, error) + // Lists the billing accounts that the current authenticated user + // [owns](https://support.google.com/cloud/answer/4430947). + ListBillingAccounts(context.Context, *ListBillingAccountsRequest) (*ListBillingAccountsResponse, error) + // Lists the projects associated with a billing account. The current + // authenticated user must be an [owner of the billing + // account](https://support.google.com/cloud/answer/4430947). + ListProjectBillingInfo(context.Context, *ListProjectBillingInfoRequest) (*ListProjectBillingInfoResponse, error) + // Gets the billing information for a project. The current authenticated user + // must have [permission to view the + // project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo + // ). + GetProjectBillingInfo(context.Context, *GetProjectBillingInfoRequest) (*ProjectBillingInfo, error) + // Sets or updates the billing account associated with a project. You specify + // the new billing account by setting the `billing_account_name` in the + // `ProjectBillingInfo` resource to the resource name of a billing account. + // Associating a project with an open billing account enables billing on the + // project and allows charges for resource usage. If the project already had a + // billing account, this method changes the billing account used for resource + // usage charges. + // + // *Note:* Incurred charges that have not yet been reported in the transaction + // history of the Google Cloud Console may be billed to the new billing + // account, even if the charge occurred before the new billing account was + // assigned to the project. + // + // The current authenticated user must have ownership privileges for both the + // [project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo + // ) and the [billing + // account](https://support.google.com/cloud/answer/4430947). + // + // You can disable billing on the project by setting the + // `billing_account_name` field to empty. This action disassociates the + // current billing account from the project. Any billable activity of your + // in-use services will stop, and your application could stop functioning as + // expected. Any unbilled charges to date will be billed to the previously + // associated account. The current authenticated user must be either an owner + // of the project or an owner of the billing account for the project. + // + // Note that associating a project with a *closed* billing account will have + // much the same effect as disabling billing on the project: any paid + // resources used by the project will be shut down. Thus, unless you wish to + // disable billing, you should always call this method with the name of an + // *open* billing account. + UpdateProjectBillingInfo(context.Context, *UpdateProjectBillingInfoRequest) (*ProjectBillingInfo, error) +} + +func RegisterCloudBillingServer(s *grpc.Server, srv CloudBillingServer) { + s.RegisterService(&_CloudBilling_serviceDesc, srv) +} + +func _CloudBilling_GetBillingAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetBillingAccountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CloudBillingServer).GetBillingAccount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.billing.v1.CloudBilling/GetBillingAccount", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CloudBillingServer).GetBillingAccount(ctx, req.(*GetBillingAccountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CloudBilling_ListBillingAccounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListBillingAccountsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CloudBillingServer).ListBillingAccounts(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.billing.v1.CloudBilling/ListBillingAccounts", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CloudBillingServer).ListBillingAccounts(ctx, req.(*ListBillingAccountsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CloudBilling_ListProjectBillingInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListProjectBillingInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CloudBillingServer).ListProjectBillingInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.billing.v1.CloudBilling/ListProjectBillingInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CloudBillingServer).ListProjectBillingInfo(ctx, req.(*ListProjectBillingInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CloudBilling_GetProjectBillingInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetProjectBillingInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CloudBillingServer).GetProjectBillingInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.billing.v1.CloudBilling/GetProjectBillingInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CloudBillingServer).GetProjectBillingInfo(ctx, req.(*GetProjectBillingInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CloudBilling_UpdateProjectBillingInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateProjectBillingInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CloudBillingServer).UpdateProjectBillingInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.billing.v1.CloudBilling/UpdateProjectBillingInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CloudBillingServer).UpdateProjectBillingInfo(ctx, req.(*UpdateProjectBillingInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _CloudBilling_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.cloud.billing.v1.CloudBilling", + HandlerType: (*CloudBillingServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetBillingAccount", + Handler: _CloudBilling_GetBillingAccount_Handler, + }, + { + MethodName: "ListBillingAccounts", + Handler: _CloudBilling_ListBillingAccounts_Handler, + }, + { + MethodName: "ListProjectBillingInfo", + Handler: _CloudBilling_ListProjectBillingInfo_Handler, + }, + { + MethodName: "GetProjectBillingInfo", + Handler: _CloudBilling_GetProjectBillingInfo_Handler, + }, + { + MethodName: "UpdateProjectBillingInfo", + Handler: _CloudBilling_UpdateProjectBillingInfo_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/cloud/billing/v1/cloud_billing.proto", +} + +func init() { proto.RegisterFile("google/cloud/billing/v1/cloud_billing.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 667 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xdd, 0x4e, 0xd4, 0x40, + 0x14, 0xce, 0x00, 0x12, 0xf6, 0x80, 0x20, 0x03, 0xe8, 0x66, 0x17, 0x10, 0xea, 0x0f, 0x28, 0xb1, + 0x15, 0xf0, 0xdf, 0xa8, 0x11, 0x63, 0x08, 0x89, 0x31, 0x9b, 0xaa, 0x89, 0xd1, 0x98, 0x66, 0x76, + 0x3b, 0x34, 0xd5, 0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7f, 0xb9, 0xd7, 0x0a, 0x17, 0x77, 0xad, 0x0d, 0xf5, 0x16, + 0xdf, 0x32, 0x51, 0xae, 0x8d, 0xef, 0xdd, 0xc6, 0x86, 0xfc, 0x62, 0x37, 0xd0, 0x93, 0x9b, 0xba, + 0x3a, 0xe0, 0x11, 0x61, 0x81, 0xcd, 0xdb, 0x81, 0x13, 0x50, 0xa6, 0xbe, 0xe7, 0x4e, 0x7a, 0x44, + 0xe2, 0x50, 0x74, 0xfd, 0x6d, 0xb8, 0xae, 0x1f, 0x9b, 0x83, 0xaa, 0x74, 0xf5, 0x4f, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xc0, 0x01, 0x24, 0x32, 0x60, 0x08, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/dataproc/v1/clusters.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/dataproc/v1/clusters.pb.go new file mode 100644 index 0000000000..a8f3d58998 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/dataproc/v1/clusters.pb.go @@ -0,0 +1,1332 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/dataproc/v1/clusters.proto + +/* +Package dataproc is a generated protocol buffer package. + +It is generated from these files: + google/cloud/dataproc/v1/clusters.proto + google/cloud/dataproc/v1/jobs.proto + google/cloud/dataproc/v1/operations.proto + +It has these top-level messages: + Cluster + ClusterConfig + GceClusterConfig + InstanceGroupConfig + ManagedGroupConfig + DiskConfig + NodeInitializationAction + ClusterStatus + SoftwareConfig + CreateClusterRequest + UpdateClusterRequest + DeleteClusterRequest + GetClusterRequest + ListClustersRequest + ListClustersResponse + DiagnoseClusterRequest + DiagnoseClusterResults + LoggingConfig + HadoopJob + SparkJob + PySparkJob + QueryList + HiveJob + SparkSqlJob + PigJob + JobPlacement + JobStatus + JobReference + Job + SubmitJobRequest + GetJobRequest + ListJobsRequest + ListJobsResponse + CancelJobRequest + DeleteJobRequest + ClusterOperationStatus + ClusterOperationMetadata +*/ +package dataproc + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_longrunning "google.golang.org/genproto/googleapis/longrunning" +import google_protobuf4 "github.com/golang/protobuf/ptypes/duration" +import google_protobuf5 "google.golang.org/genproto/protobuf/field_mask" +import google_protobuf3 "github.com/golang/protobuf/ptypes/timestamp" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// The cluster state. +type ClusterStatus_State int32 + +const ( + // The cluster state is unknown. + ClusterStatus_UNKNOWN ClusterStatus_State = 0 + // The cluster is being created and set up. It is not ready for use. + ClusterStatus_CREATING ClusterStatus_State = 1 + // The cluster is currently running and healthy. It is ready for use. + ClusterStatus_RUNNING ClusterStatus_State = 2 + // The cluster encountered an error. It is not ready for use. + ClusterStatus_ERROR ClusterStatus_State = 3 + // The cluster is being deleted. It cannot be used. + ClusterStatus_DELETING ClusterStatus_State = 4 + // The cluster is being updated. It continues to accept and process jobs. + ClusterStatus_UPDATING ClusterStatus_State = 5 +) + +var ClusterStatus_State_name = map[int32]string{ + 0: "UNKNOWN", + 1: "CREATING", + 2: "RUNNING", + 3: "ERROR", + 4: "DELETING", + 5: "UPDATING", +} +var ClusterStatus_State_value = map[string]int32{ + "UNKNOWN": 0, + "CREATING": 1, + "RUNNING": 2, + "ERROR": 3, + "DELETING": 4, + "UPDATING": 5, +} + +func (x ClusterStatus_State) String() string { + return proto.EnumName(ClusterStatus_State_name, int32(x)) +} +func (ClusterStatus_State) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{7, 0} } + +// Describes the identifying information, config, and status of +// a cluster of Google Compute Engine instances. +type Cluster struct { + // [Required] The Google Cloud Platform project ID that the cluster belongs to. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // [Required] The cluster name. Cluster names within a project must be + // unique. Names of deleted clusters can be reused. + ClusterName string `protobuf:"bytes,2,opt,name=cluster_name,json=clusterName" json:"cluster_name,omitempty"` + // [Required] The cluster config. Note that Cloud Dataproc may set + // default values, and values may change when clusters are updated. + Config *ClusterConfig `protobuf:"bytes,3,opt,name=config" json:"config,omitempty"` + // [Output-only] Cluster status. + Status *ClusterStatus `protobuf:"bytes,4,opt,name=status" json:"status,omitempty"` + // [Output-only] The previous cluster status. + StatusHistory []*ClusterStatus `protobuf:"bytes,7,rep,name=status_history,json=statusHistory" json:"status_history,omitempty"` + // [Output-only] A cluster UUID (Unique Universal Identifier). Cloud Dataproc + // generates this value when it creates the cluster. + ClusterUuid string `protobuf:"bytes,6,opt,name=cluster_uuid,json=clusterUuid" json:"cluster_uuid,omitempty"` +} + +func (m *Cluster) Reset() { *m = Cluster{} } +func (m *Cluster) String() string { return proto.CompactTextString(m) } +func (*Cluster) ProtoMessage() {} +func (*Cluster) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *Cluster) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *Cluster) GetClusterName() string { + if m != nil { + return m.ClusterName + } + return "" +} + +func (m *Cluster) GetConfig() *ClusterConfig { + if m != nil { + return m.Config + } + return nil +} + +func (m *Cluster) GetStatus() *ClusterStatus { + if m != nil { + return m.Status + } + return nil +} + +func (m *Cluster) GetStatusHistory() []*ClusterStatus { + if m != nil { + return m.StatusHistory + } + return nil +} + +func (m *Cluster) GetClusterUuid() string { + if m != nil { + return m.ClusterUuid + } + return "" +} + +// The cluster config. +type ClusterConfig struct { + // [Optional] A Google Cloud Storage staging bucket used for sharing generated + // SSH keys and config. If you do not specify a staging bucket, Cloud + // Dataproc will determine an appropriate Cloud Storage location (US, + // ASIA, or EU) for your cluster's staging bucket according to the Google + // Compute Engine zone where your cluster is deployed, and then it will create + // and manage this project-level, per-location bucket for you. + ConfigBucket string `protobuf:"bytes,1,opt,name=config_bucket,json=configBucket" json:"config_bucket,omitempty"` + // [Required] The shared Google Compute Engine config settings for + // all instances in a cluster. + GceClusterConfig *GceClusterConfig `protobuf:"bytes,8,opt,name=gce_cluster_config,json=gceClusterConfig" json:"gce_cluster_config,omitempty"` + // [Optional] The Google Compute Engine config settings for + // the master instance in a cluster. + MasterConfig *InstanceGroupConfig `protobuf:"bytes,9,opt,name=master_config,json=masterConfig" json:"master_config,omitempty"` + // [Optional] The Google Compute Engine config settings for + // worker instances in a cluster. + WorkerConfig *InstanceGroupConfig `protobuf:"bytes,10,opt,name=worker_config,json=workerConfig" json:"worker_config,omitempty"` + // [Optional] The Google Compute Engine config settings for + // additional worker instances in a cluster. + SecondaryWorkerConfig *InstanceGroupConfig `protobuf:"bytes,12,opt,name=secondary_worker_config,json=secondaryWorkerConfig" json:"secondary_worker_config,omitempty"` + // [Optional] The config settings for software inside the cluster. + SoftwareConfig *SoftwareConfig `protobuf:"bytes,13,opt,name=software_config,json=softwareConfig" json:"software_config,omitempty"` + // [Optional] Commands to execute on each node after config is + // completed. By default, executables are run on master and all worker nodes. + // You can test a node's role metadata to run an executable on + // a master or worker node, as shown below using `curl` (you can also use `wget`): + // + // ROLE=$(curl -H Metadata-Flavor:Google http://metadata/computeMetadata/v1/instance/attributes/dataproc-role) + // if [[ "${ROLE}" == 'Master' ]]; then + // ... master specific actions ... + // else + // ... worker specific actions ... + // fi + InitializationActions []*NodeInitializationAction `protobuf:"bytes,11,rep,name=initialization_actions,json=initializationActions" json:"initialization_actions,omitempty"` +} + +func (m *ClusterConfig) Reset() { *m = ClusterConfig{} } +func (m *ClusterConfig) String() string { return proto.CompactTextString(m) } +func (*ClusterConfig) ProtoMessage() {} +func (*ClusterConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *ClusterConfig) GetConfigBucket() string { + if m != nil { + return m.ConfigBucket + } + return "" +} + +func (m *ClusterConfig) GetGceClusterConfig() *GceClusterConfig { + if m != nil { + return m.GceClusterConfig + } + return nil +} + +func (m *ClusterConfig) GetMasterConfig() *InstanceGroupConfig { + if m != nil { + return m.MasterConfig + } + return nil +} + +func (m *ClusterConfig) GetWorkerConfig() *InstanceGroupConfig { + if m != nil { + return m.WorkerConfig + } + return nil +} + +func (m *ClusterConfig) GetSecondaryWorkerConfig() *InstanceGroupConfig { + if m != nil { + return m.SecondaryWorkerConfig + } + return nil +} + +func (m *ClusterConfig) GetSoftwareConfig() *SoftwareConfig { + if m != nil { + return m.SoftwareConfig + } + return nil +} + +func (m *ClusterConfig) GetInitializationActions() []*NodeInitializationAction { + if m != nil { + return m.InitializationActions + } + return nil +} + +// Common config settings for resources of Google Compute Engine cluster +// instances, applicable to all instances in the cluster. +type GceClusterConfig struct { + // [Required] The zone where the Google Compute Engine cluster will be located. + // Example: `https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone]`. + ZoneUri string `protobuf:"bytes,1,opt,name=zone_uri,json=zoneUri" json:"zone_uri,omitempty"` + // [Optional] The Google Compute Engine network to be used for machine + // communications. Cannot be specified with subnetwork_uri. If neither + // `network_uri` nor `subnetwork_uri` is specified, the "default" network of + // the project is used, if it exists. Cannot be a "Custom Subnet Network" (see + // [Using Subnetworks](/compute/docs/subnetworks) for more information). + // Example: `https://www.googleapis.com/compute/v1/projects/[project_id]/regions/global/default`. + NetworkUri string `protobuf:"bytes,2,opt,name=network_uri,json=networkUri" json:"network_uri,omitempty"` + // [Optional] The Google Compute Engine subnetwork to be used for machine + // communications. Cannot be specified with network_uri. + // Example: `https://www.googleapis.com/compute/v1/projects/[project_id]/regions/us-east1/sub0`. + SubnetworkUri string `protobuf:"bytes,6,opt,name=subnetwork_uri,json=subnetworkUri" json:"subnetwork_uri,omitempty"` + // [Optional] If true, all instances in the cluster will only have internal IP + // addresses. By default, clusters are not restricted to internal IP addresses, + // and will have ephemeral external IP addresses assigned to each instance. + // This `internal_ip_only` restriction can only be enabled for subnetwork + // enabled networks, and all off-cluster dependencies must be configured to be + // accessible without external IP addresses. + InternalIpOnly bool `protobuf:"varint,7,opt,name=internal_ip_only,json=internalIpOnly" json:"internal_ip_only,omitempty"` + // [Optional] The URIs of service account scopes to be included in Google + // Compute Engine instances. The following base set of scopes is always + // included: + // + // * https://www.googleapis.com/auth/cloud.useraccounts.readonly + // * https://www.googleapis.com/auth/devstorage.read_write + // * https://www.googleapis.com/auth/logging.write + // + // If no scopes are specified, the following defaults are also provided: + // + // * https://www.googleapis.com/auth/bigquery + // * https://www.googleapis.com/auth/bigtable.admin.table + // * https://www.googleapis.com/auth/bigtable.data + // * https://www.googleapis.com/auth/devstorage.full_control + ServiceAccountScopes []string `protobuf:"bytes,3,rep,name=service_account_scopes,json=serviceAccountScopes" json:"service_account_scopes,omitempty"` + // The Google Compute Engine tags to add to all instances (see + // [Labeling instances](/compute/docs/label-or-tag-resources#labeling_instances)). + Tags []string `protobuf:"bytes,4,rep,name=tags" json:"tags,omitempty"` + // The Google Compute Engine metadata entries to add to all instances (see + // [Project and instance metadata](https://cloud.google.com/compute/docs/storing-retrieving-metadata#project_and_instance_metadata)). + Metadata map[string]string `protobuf:"bytes,5,rep,name=metadata" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *GceClusterConfig) Reset() { *m = GceClusterConfig{} } +func (m *GceClusterConfig) String() string { return proto.CompactTextString(m) } +func (*GceClusterConfig) ProtoMessage() {} +func (*GceClusterConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *GceClusterConfig) GetZoneUri() string { + if m != nil { + return m.ZoneUri + } + return "" +} + +func (m *GceClusterConfig) GetNetworkUri() string { + if m != nil { + return m.NetworkUri + } + return "" +} + +func (m *GceClusterConfig) GetSubnetworkUri() string { + if m != nil { + return m.SubnetworkUri + } + return "" +} + +func (m *GceClusterConfig) GetInternalIpOnly() bool { + if m != nil { + return m.InternalIpOnly + } + return false +} + +func (m *GceClusterConfig) GetServiceAccountScopes() []string { + if m != nil { + return m.ServiceAccountScopes + } + return nil +} + +func (m *GceClusterConfig) GetTags() []string { + if m != nil { + return m.Tags + } + return nil +} + +func (m *GceClusterConfig) GetMetadata() map[string]string { + if m != nil { + return m.Metadata + } + return nil +} + +// [Optional] The config settings for Google Compute Engine resources in +// an instance group, such as a master or worker group. +type InstanceGroupConfig struct { + // [Required] The number of VM instances in the instance group. + // For master instance groups, must be set to 1. + NumInstances int32 `protobuf:"varint,1,opt,name=num_instances,json=numInstances" json:"num_instances,omitempty"` + // [Optional] The list of instance names. Cloud Dataproc derives the names from + // `cluster_name`, `num_instances`, and the instance group if not set by user + // (recommended practice is to let Cloud Dataproc derive the name). + InstanceNames []string `protobuf:"bytes,2,rep,name=instance_names,json=instanceNames" json:"instance_names,omitempty"` + // [Output-only] The Google Compute Engine image resource used for cluster + // instances. Inferred from `SoftwareConfig.image_version`. + ImageUri string `protobuf:"bytes,3,opt,name=image_uri,json=imageUri" json:"image_uri,omitempty"` + // [Required] The Google Compute Engine machine type used for cluster instances. + // Example: `https://www.googleapis.com/compute/v1/projects/[project_id]/zones/us-east1-a/machineTypes/n1-standard-2`. + MachineTypeUri string `protobuf:"bytes,4,opt,name=machine_type_uri,json=machineTypeUri" json:"machine_type_uri,omitempty"` + // [Optional] Disk option config settings. + DiskConfig *DiskConfig `protobuf:"bytes,5,opt,name=disk_config,json=diskConfig" json:"disk_config,omitempty"` + // [Optional] Specifies that this instance group contains preemptible instances. + IsPreemptible bool `protobuf:"varint,6,opt,name=is_preemptible,json=isPreemptible" json:"is_preemptible,omitempty"` + // [Output-only] The config for Google Compute Engine Instance Group + // Manager that manages this group. + // This is only used for preemptible instance groups. + ManagedGroupConfig *ManagedGroupConfig `protobuf:"bytes,7,opt,name=managed_group_config,json=managedGroupConfig" json:"managed_group_config,omitempty"` +} + +func (m *InstanceGroupConfig) Reset() { *m = InstanceGroupConfig{} } +func (m *InstanceGroupConfig) String() string { return proto.CompactTextString(m) } +func (*InstanceGroupConfig) ProtoMessage() {} +func (*InstanceGroupConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *InstanceGroupConfig) GetNumInstances() int32 { + if m != nil { + return m.NumInstances + } + return 0 +} + +func (m *InstanceGroupConfig) GetInstanceNames() []string { + if m != nil { + return m.InstanceNames + } + return nil +} + +func (m *InstanceGroupConfig) GetImageUri() string { + if m != nil { + return m.ImageUri + } + return "" +} + +func (m *InstanceGroupConfig) GetMachineTypeUri() string { + if m != nil { + return m.MachineTypeUri + } + return "" +} + +func (m *InstanceGroupConfig) GetDiskConfig() *DiskConfig { + if m != nil { + return m.DiskConfig + } + return nil +} + +func (m *InstanceGroupConfig) GetIsPreemptible() bool { + if m != nil { + return m.IsPreemptible + } + return false +} + +func (m *InstanceGroupConfig) GetManagedGroupConfig() *ManagedGroupConfig { + if m != nil { + return m.ManagedGroupConfig + } + return nil +} + +// Specifies the resources used to actively manage an instance group. +type ManagedGroupConfig struct { + // [Output-only] The name of the Instance Template used for the Managed + // Instance Group. + InstanceTemplateName string `protobuf:"bytes,1,opt,name=instance_template_name,json=instanceTemplateName" json:"instance_template_name,omitempty"` + // [Output-only] The name of the Instance Group Manager for this group. + InstanceGroupManagerName string `protobuf:"bytes,2,opt,name=instance_group_manager_name,json=instanceGroupManagerName" json:"instance_group_manager_name,omitempty"` +} + +func (m *ManagedGroupConfig) Reset() { *m = ManagedGroupConfig{} } +func (m *ManagedGroupConfig) String() string { return proto.CompactTextString(m) } +func (*ManagedGroupConfig) ProtoMessage() {} +func (*ManagedGroupConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *ManagedGroupConfig) GetInstanceTemplateName() string { + if m != nil { + return m.InstanceTemplateName + } + return "" +} + +func (m *ManagedGroupConfig) GetInstanceGroupManagerName() string { + if m != nil { + return m.InstanceGroupManagerName + } + return "" +} + +// Specifies the config of disk options for a group of VM instances. +type DiskConfig struct { + // [Optional] Size in GB of the boot disk (default is 500GB). + BootDiskSizeGb int32 `protobuf:"varint,1,opt,name=boot_disk_size_gb,json=bootDiskSizeGb" json:"boot_disk_size_gb,omitempty"` + // [Optional] Number of attached SSDs, from 0 to 4 (default is 0). + // If SSDs are not attached, the boot disk is used to store runtime logs and + // [HDFS](https://hadoop.apache.org/docs/r1.2.1/hdfs_user_guide.html) data. + // If one or more SSDs are attached, this runtime bulk + // data is spread across them, and the boot disk contains only basic + // config and installed binaries. + NumLocalSsds int32 `protobuf:"varint,2,opt,name=num_local_ssds,json=numLocalSsds" json:"num_local_ssds,omitempty"` +} + +func (m *DiskConfig) Reset() { *m = DiskConfig{} } +func (m *DiskConfig) String() string { return proto.CompactTextString(m) } +func (*DiskConfig) ProtoMessage() {} +func (*DiskConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *DiskConfig) GetBootDiskSizeGb() int32 { + if m != nil { + return m.BootDiskSizeGb + } + return 0 +} + +func (m *DiskConfig) GetNumLocalSsds() int32 { + if m != nil { + return m.NumLocalSsds + } + return 0 +} + +// Specifies an executable to run on a fully configured node and a +// timeout period for executable completion. +type NodeInitializationAction struct { + // [Required] Google Cloud Storage URI of executable file. + ExecutableFile string `protobuf:"bytes,1,opt,name=executable_file,json=executableFile" json:"executable_file,omitempty"` + // [Optional] Amount of time executable has to complete. Default is + // 10 minutes. Cluster creation fails with an explanatory error message (the + // name of the executable that caused the error and the exceeded timeout + // period) if the executable is not completed at end of the timeout period. + ExecutionTimeout *google_protobuf4.Duration `protobuf:"bytes,2,opt,name=execution_timeout,json=executionTimeout" json:"execution_timeout,omitempty"` +} + +func (m *NodeInitializationAction) Reset() { *m = NodeInitializationAction{} } +func (m *NodeInitializationAction) String() string { return proto.CompactTextString(m) } +func (*NodeInitializationAction) ProtoMessage() {} +func (*NodeInitializationAction) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *NodeInitializationAction) GetExecutableFile() string { + if m != nil { + return m.ExecutableFile + } + return "" +} + +func (m *NodeInitializationAction) GetExecutionTimeout() *google_protobuf4.Duration { + if m != nil { + return m.ExecutionTimeout + } + return nil +} + +// The status of a cluster and its instances. +type ClusterStatus struct { + // [Output-only] The cluster's state. + State ClusterStatus_State `protobuf:"varint,1,opt,name=state,enum=google.cloud.dataproc.v1.ClusterStatus_State" json:"state,omitempty"` + // [Output-only] Optional details of cluster's state. + Detail string `protobuf:"bytes,2,opt,name=detail" json:"detail,omitempty"` + // [Output-only] Time when this state was entered. + StateStartTime *google_protobuf3.Timestamp `protobuf:"bytes,3,opt,name=state_start_time,json=stateStartTime" json:"state_start_time,omitempty"` +} + +func (m *ClusterStatus) Reset() { *m = ClusterStatus{} } +func (m *ClusterStatus) String() string { return proto.CompactTextString(m) } +func (*ClusterStatus) ProtoMessage() {} +func (*ClusterStatus) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *ClusterStatus) GetState() ClusterStatus_State { + if m != nil { + return m.State + } + return ClusterStatus_UNKNOWN +} + +func (m *ClusterStatus) GetDetail() string { + if m != nil { + return m.Detail + } + return "" +} + +func (m *ClusterStatus) GetStateStartTime() *google_protobuf3.Timestamp { + if m != nil { + return m.StateStartTime + } + return nil +} + +// Specifies the selection and config of software inside the cluster. +type SoftwareConfig struct { + // [Optional] The version of software inside the cluster. It must match the + // regular expression `[0-9]+\.[0-9]+`. If unspecified, it defaults to the + // latest version (see [Cloud Dataproc Versioning](/dataproc/versioning)). + ImageVersion string `protobuf:"bytes,1,opt,name=image_version,json=imageVersion" json:"image_version,omitempty"` + // [Optional] The properties to set on daemon config files. + // + // Property keys are specified in `prefix:property` format, such as + // `core:fs.defaultFS`. The following are supported prefixes + // and their mappings: + // + // * core: `core-site.xml` + // * hdfs: `hdfs-site.xml` + // * mapred: `mapred-site.xml` + // * yarn: `yarn-site.xml` + // * hive: `hive-site.xml` + // * pig: `pig.properties` + // * spark: `spark-defaults.conf` + Properties map[string]string `protobuf:"bytes,2,rep,name=properties" json:"properties,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *SoftwareConfig) Reset() { *m = SoftwareConfig{} } +func (m *SoftwareConfig) String() string { return proto.CompactTextString(m) } +func (*SoftwareConfig) ProtoMessage() {} +func (*SoftwareConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *SoftwareConfig) GetImageVersion() string { + if m != nil { + return m.ImageVersion + } + return "" +} + +func (m *SoftwareConfig) GetProperties() map[string]string { + if m != nil { + return m.Properties + } + return nil +} + +// A request to create a cluster. +type CreateClusterRequest struct { + // [Required] The ID of the Google Cloud Platform project that the cluster + // belongs to. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // [Required] The Cloud Dataproc region in which to handle the request. + Region string `protobuf:"bytes,3,opt,name=region" json:"region,omitempty"` + // [Required] The cluster to create. + Cluster *Cluster `protobuf:"bytes,2,opt,name=cluster" json:"cluster,omitempty"` +} + +func (m *CreateClusterRequest) Reset() { *m = CreateClusterRequest{} } +func (m *CreateClusterRequest) String() string { return proto.CompactTextString(m) } +func (*CreateClusterRequest) ProtoMessage() {} +func (*CreateClusterRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *CreateClusterRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *CreateClusterRequest) GetRegion() string { + if m != nil { + return m.Region + } + return "" +} + +func (m *CreateClusterRequest) GetCluster() *Cluster { + if m != nil { + return m.Cluster + } + return nil +} + +// A request to update a cluster. +type UpdateClusterRequest struct { + // [Required] The ID of the Google Cloud Platform project the + // cluster belongs to. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // [Required] The Cloud Dataproc region in which to handle the request. + Region string `protobuf:"bytes,5,opt,name=region" json:"region,omitempty"` + // [Required] The cluster name. + ClusterName string `protobuf:"bytes,2,opt,name=cluster_name,json=clusterName" json:"cluster_name,omitempty"` + // [Required] The changes to the cluster. + Cluster *Cluster `protobuf:"bytes,3,opt,name=cluster" json:"cluster,omitempty"` + // [Required] Specifies the path, relative to Cluster, of + // the field to update. For example, to change the number of workers + // in a cluster to 5, the update_mask parameter would be + // specified as config.worker_config.num_instances, + // and the `PATCH` request body would specify the new value, as follows: + // + // { + // "config":{ + // "workerConfig":{ + // "numInstances":"5" + // } + // } + // } + // Similarly, to change the number of preemptible workers in a cluster to 5, the + // update_mask parameter would be config.secondary_worker_config.num_instances, + // and the `PATCH` request body would be set as follows: + // + // { + // "config":{ + // "secondaryWorkerConfig":{ + // "numInstances":"5" + // } + // } + // } + // Note: Currently, config.worker_config.num_instances + // and config.secondary_worker_config.num_instances are the only + // fields that can be updated. + UpdateMask *google_protobuf5.FieldMask `protobuf:"bytes,4,opt,name=update_mask,json=updateMask" json:"update_mask,omitempty"` +} + +func (m *UpdateClusterRequest) Reset() { *m = UpdateClusterRequest{} } +func (m *UpdateClusterRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateClusterRequest) ProtoMessage() {} +func (*UpdateClusterRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *UpdateClusterRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *UpdateClusterRequest) GetRegion() string { + if m != nil { + return m.Region + } + return "" +} + +func (m *UpdateClusterRequest) GetClusterName() string { + if m != nil { + return m.ClusterName + } + return "" +} + +func (m *UpdateClusterRequest) GetCluster() *Cluster { + if m != nil { + return m.Cluster + } + return nil +} + +func (m *UpdateClusterRequest) GetUpdateMask() *google_protobuf5.FieldMask { + if m != nil { + return m.UpdateMask + } + return nil +} + +// A request to delete a cluster. +type DeleteClusterRequest struct { + // [Required] The ID of the Google Cloud Platform project that the cluster + // belongs to. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // [Required] The Cloud Dataproc region in which to handle the request. + Region string `protobuf:"bytes,3,opt,name=region" json:"region,omitempty"` + // [Required] The cluster name. + ClusterName string `protobuf:"bytes,2,opt,name=cluster_name,json=clusterName" json:"cluster_name,omitempty"` +} + +func (m *DeleteClusterRequest) Reset() { *m = DeleteClusterRequest{} } +func (m *DeleteClusterRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteClusterRequest) ProtoMessage() {} +func (*DeleteClusterRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } + +func (m *DeleteClusterRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *DeleteClusterRequest) GetRegion() string { + if m != nil { + return m.Region + } + return "" +} + +func (m *DeleteClusterRequest) GetClusterName() string { + if m != nil { + return m.ClusterName + } + return "" +} + +// Request to get the resource representation for a cluster in a project. +type GetClusterRequest struct { + // [Required] The ID of the Google Cloud Platform project that the cluster + // belongs to. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // [Required] The Cloud Dataproc region in which to handle the request. + Region string `protobuf:"bytes,3,opt,name=region" json:"region,omitempty"` + // [Required] The cluster name. + ClusterName string `protobuf:"bytes,2,opt,name=cluster_name,json=clusterName" json:"cluster_name,omitempty"` +} + +func (m *GetClusterRequest) Reset() { *m = GetClusterRequest{} } +func (m *GetClusterRequest) String() string { return proto.CompactTextString(m) } +func (*GetClusterRequest) ProtoMessage() {} +func (*GetClusterRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } + +func (m *GetClusterRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *GetClusterRequest) GetRegion() string { + if m != nil { + return m.Region + } + return "" +} + +func (m *GetClusterRequest) GetClusterName() string { + if m != nil { + return m.ClusterName + } + return "" +} + +// A request to list the clusters in a project. +type ListClustersRequest struct { + // [Required] The ID of the Google Cloud Platform project that the cluster + // belongs to. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // [Required] The Cloud Dataproc region in which to handle the request. + Region string `protobuf:"bytes,4,opt,name=region" json:"region,omitempty"` + // [Optional] The standard List page size. + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // [Optional] The standard List page token. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListClustersRequest) Reset() { *m = ListClustersRequest{} } +func (m *ListClustersRequest) String() string { return proto.CompactTextString(m) } +func (*ListClustersRequest) ProtoMessage() {} +func (*ListClustersRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } + +func (m *ListClustersRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *ListClustersRequest) GetRegion() string { + if m != nil { + return m.Region + } + return "" +} + +func (m *ListClustersRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListClustersRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// The list of all clusters in a project. +type ListClustersResponse struct { + // [Output-only] The clusters in the project. + Clusters []*Cluster `protobuf:"bytes,1,rep,name=clusters" json:"clusters,omitempty"` + // [Output-only] This token is included in the response if there are more + // results to fetch. To fetch additional results, provide this value as the + // `page_token` in a subsequent ListClustersRequest. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListClustersResponse) Reset() { *m = ListClustersResponse{} } +func (m *ListClustersResponse) String() string { return proto.CompactTextString(m) } +func (*ListClustersResponse) ProtoMessage() {} +func (*ListClustersResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } + +func (m *ListClustersResponse) GetClusters() []*Cluster { + if m != nil { + return m.Clusters + } + return nil +} + +func (m *ListClustersResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// A request to collect cluster diagnostic information. +type DiagnoseClusterRequest struct { + // [Required] The ID of the Google Cloud Platform project that the cluster + // belongs to. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // [Required] The Cloud Dataproc region in which to handle the request. + Region string `protobuf:"bytes,3,opt,name=region" json:"region,omitempty"` + // [Required] The cluster name. + ClusterName string `protobuf:"bytes,2,opt,name=cluster_name,json=clusterName" json:"cluster_name,omitempty"` +} + +func (m *DiagnoseClusterRequest) Reset() { *m = DiagnoseClusterRequest{} } +func (m *DiagnoseClusterRequest) String() string { return proto.CompactTextString(m) } +func (*DiagnoseClusterRequest) ProtoMessage() {} +func (*DiagnoseClusterRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } + +func (m *DiagnoseClusterRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *DiagnoseClusterRequest) GetRegion() string { + if m != nil { + return m.Region + } + return "" +} + +func (m *DiagnoseClusterRequest) GetClusterName() string { + if m != nil { + return m.ClusterName + } + return "" +} + +// The location of diagnostic output. +type DiagnoseClusterResults struct { + // [Output-only] The Google Cloud Storage URI of the diagnostic output. + // The output report is a plain text file with a summary of collected + // diagnostics. + OutputUri string `protobuf:"bytes,1,opt,name=output_uri,json=outputUri" json:"output_uri,omitempty"` +} + +func (m *DiagnoseClusterResults) Reset() { *m = DiagnoseClusterResults{} } +func (m *DiagnoseClusterResults) String() string { return proto.CompactTextString(m) } +func (*DiagnoseClusterResults) ProtoMessage() {} +func (*DiagnoseClusterResults) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} } + +func (m *DiagnoseClusterResults) GetOutputUri() string { + if m != nil { + return m.OutputUri + } + return "" +} + +func init() { + proto.RegisterType((*Cluster)(nil), "google.cloud.dataproc.v1.Cluster") + proto.RegisterType((*ClusterConfig)(nil), "google.cloud.dataproc.v1.ClusterConfig") + proto.RegisterType((*GceClusterConfig)(nil), "google.cloud.dataproc.v1.GceClusterConfig") + proto.RegisterType((*InstanceGroupConfig)(nil), "google.cloud.dataproc.v1.InstanceGroupConfig") + proto.RegisterType((*ManagedGroupConfig)(nil), "google.cloud.dataproc.v1.ManagedGroupConfig") + proto.RegisterType((*DiskConfig)(nil), "google.cloud.dataproc.v1.DiskConfig") + proto.RegisterType((*NodeInitializationAction)(nil), "google.cloud.dataproc.v1.NodeInitializationAction") + proto.RegisterType((*ClusterStatus)(nil), "google.cloud.dataproc.v1.ClusterStatus") + proto.RegisterType((*SoftwareConfig)(nil), "google.cloud.dataproc.v1.SoftwareConfig") + proto.RegisterType((*CreateClusterRequest)(nil), "google.cloud.dataproc.v1.CreateClusterRequest") + proto.RegisterType((*UpdateClusterRequest)(nil), "google.cloud.dataproc.v1.UpdateClusterRequest") + proto.RegisterType((*DeleteClusterRequest)(nil), "google.cloud.dataproc.v1.DeleteClusterRequest") + proto.RegisterType((*GetClusterRequest)(nil), "google.cloud.dataproc.v1.GetClusterRequest") + proto.RegisterType((*ListClustersRequest)(nil), "google.cloud.dataproc.v1.ListClustersRequest") + proto.RegisterType((*ListClustersResponse)(nil), "google.cloud.dataproc.v1.ListClustersResponse") + proto.RegisterType((*DiagnoseClusterRequest)(nil), "google.cloud.dataproc.v1.DiagnoseClusterRequest") + proto.RegisterType((*DiagnoseClusterResults)(nil), "google.cloud.dataproc.v1.DiagnoseClusterResults") + proto.RegisterEnum("google.cloud.dataproc.v1.ClusterStatus_State", ClusterStatus_State_name, ClusterStatus_State_value) +} + +// 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 + +// Client API for ClusterController service + +type ClusterControllerClient interface { + // Creates a cluster in a project. + CreateCluster(ctx context.Context, in *CreateClusterRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Updates a cluster in a project. + UpdateCluster(ctx context.Context, in *UpdateClusterRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Deletes a cluster in a project. + DeleteCluster(ctx context.Context, in *DeleteClusterRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Gets the resource representation for a cluster in a project. + GetCluster(ctx context.Context, in *GetClusterRequest, opts ...grpc.CallOption) (*Cluster, error) + // Lists all regions/{region}/clusters in a project. + ListClusters(ctx context.Context, in *ListClustersRequest, opts ...grpc.CallOption) (*ListClustersResponse, error) + // Gets cluster diagnostic information. + // After the operation completes, the Operation.response field + // contains `DiagnoseClusterOutputLocation`. + DiagnoseCluster(ctx context.Context, in *DiagnoseClusterRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) +} + +type clusterControllerClient struct { + cc *grpc.ClientConn +} + +func NewClusterControllerClient(cc *grpc.ClientConn) ClusterControllerClient { + return &clusterControllerClient{cc} +} + +func (c *clusterControllerClient) CreateCluster(ctx context.Context, in *CreateClusterRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.cloud.dataproc.v1.ClusterController/CreateCluster", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterControllerClient) UpdateCluster(ctx context.Context, in *UpdateClusterRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.cloud.dataproc.v1.ClusterController/UpdateCluster", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterControllerClient) DeleteCluster(ctx context.Context, in *DeleteClusterRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.cloud.dataproc.v1.ClusterController/DeleteCluster", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterControllerClient) GetCluster(ctx context.Context, in *GetClusterRequest, opts ...grpc.CallOption) (*Cluster, error) { + out := new(Cluster) + err := grpc.Invoke(ctx, "/google.cloud.dataproc.v1.ClusterController/GetCluster", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterControllerClient) ListClusters(ctx context.Context, in *ListClustersRequest, opts ...grpc.CallOption) (*ListClustersResponse, error) { + out := new(ListClustersResponse) + err := grpc.Invoke(ctx, "/google.cloud.dataproc.v1.ClusterController/ListClusters", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterControllerClient) DiagnoseCluster(ctx context.Context, in *DiagnoseClusterRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.cloud.dataproc.v1.ClusterController/DiagnoseCluster", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for ClusterController service + +type ClusterControllerServer interface { + // Creates a cluster in a project. + CreateCluster(context.Context, *CreateClusterRequest) (*google_longrunning.Operation, error) + // Updates a cluster in a project. + UpdateCluster(context.Context, *UpdateClusterRequest) (*google_longrunning.Operation, error) + // Deletes a cluster in a project. + DeleteCluster(context.Context, *DeleteClusterRequest) (*google_longrunning.Operation, error) + // Gets the resource representation for a cluster in a project. + GetCluster(context.Context, *GetClusterRequest) (*Cluster, error) + // Lists all regions/{region}/clusters in a project. + ListClusters(context.Context, *ListClustersRequest) (*ListClustersResponse, error) + // Gets cluster diagnostic information. + // After the operation completes, the Operation.response field + // contains `DiagnoseClusterOutputLocation`. + DiagnoseCluster(context.Context, *DiagnoseClusterRequest) (*google_longrunning.Operation, error) +} + +func RegisterClusterControllerServer(s *grpc.Server, srv ClusterControllerServer) { + s.RegisterService(&_ClusterController_serviceDesc, srv) +} + +func _ClusterController_CreateCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateClusterRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterControllerServer).CreateCluster(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.dataproc.v1.ClusterController/CreateCluster", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterControllerServer).CreateCluster(ctx, req.(*CreateClusterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterController_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.(ClusterControllerServer).UpdateCluster(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.dataproc.v1.ClusterController/UpdateCluster", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterControllerServer).UpdateCluster(ctx, req.(*UpdateClusterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterController_DeleteCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteClusterRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterControllerServer).DeleteCluster(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.dataproc.v1.ClusterController/DeleteCluster", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterControllerServer).DeleteCluster(ctx, req.(*DeleteClusterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterController_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.(ClusterControllerServer).GetCluster(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.dataproc.v1.ClusterController/GetCluster", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterControllerServer).GetCluster(ctx, req.(*GetClusterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterController_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.(ClusterControllerServer).ListClusters(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.dataproc.v1.ClusterController/ListClusters", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterControllerServer).ListClusters(ctx, req.(*ListClustersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterController_DiagnoseCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DiagnoseClusterRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterControllerServer).DiagnoseCluster(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.dataproc.v1.ClusterController/DiagnoseCluster", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterControllerServer).DiagnoseCluster(ctx, req.(*DiagnoseClusterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _ClusterController_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.cloud.dataproc.v1.ClusterController", + HandlerType: (*ClusterControllerServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateCluster", + Handler: _ClusterController_CreateCluster_Handler, + }, + { + MethodName: "UpdateCluster", + Handler: _ClusterController_UpdateCluster_Handler, + }, + { + MethodName: "DeleteCluster", + Handler: _ClusterController_DeleteCluster_Handler, + }, + { + MethodName: "GetCluster", + Handler: _ClusterController_GetCluster_Handler, + }, + { + MethodName: "ListClusters", + Handler: _ClusterController_ListClusters_Handler, + }, + { + MethodName: "DiagnoseCluster", + Handler: _ClusterController_DiagnoseCluster_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/cloud/dataproc/v1/clusters.proto", +} + +func init() { proto.RegisterFile("google/cloud/dataproc/v1/clusters.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 1667 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0x4f, 0x73, 0x23, 0x47, + 0x15, 0x67, 0x64, 0xcb, 0x96, 0x9f, 0x2c, 0x59, 0xdb, 0x51, 0x8c, 0xa2, 0x4d, 0x88, 0x33, 0x09, + 0xac, 0xb3, 0x80, 0x44, 0x1c, 0x28, 0x52, 0xeb, 0x0a, 0xb0, 0x6b, 0x79, 0x8d, 0xc9, 0xae, 0xd6, + 0x8c, 0xed, 0x4d, 0x8a, 0x2a, 0x98, 0x6a, 0xcd, 0xb4, 0x27, 0x8d, 0x66, 0xa6, 0x27, 0xd3, 0x3d, + 0x4e, 0xbc, 0x5b, 0x7b, 0xe1, 0x04, 0xe1, 0xc8, 0x57, 0xe0, 0x40, 0xe5, 0x08, 0x37, 0x4e, 0x7c, + 0x02, 0x2e, 0x1c, 0xb9, 0x72, 0xe2, 0x03, 0x70, 0xe2, 0x40, 0xf5, 0x9f, 0x91, 0x34, 0xb6, 0x24, + 0x7b, 0x17, 0xd7, 0x9e, 0xd4, 0xfd, 0xde, 0xef, 0xfd, 0xe9, 0xd7, 0xef, 0xbd, 0x7e, 0x23, 0xb8, + 0x15, 0x30, 0x16, 0x84, 0xa4, 0xeb, 0x85, 0x2c, 0xf3, 0xbb, 0x3e, 0x16, 0x38, 0x49, 0x99, 0xd7, + 0x3d, 0x7d, 0xaf, 0xeb, 0x85, 0x19, 0x17, 0x24, 0xe5, 0x9d, 0x24, 0x65, 0x82, 0xa1, 0x96, 0x06, + 0x76, 0x14, 0xb0, 0x93, 0x03, 0x3b, 0xa7, 0xef, 0xb5, 0x5f, 0x37, 0x2a, 0x70, 0x42, 0xbb, 0x38, + 0x8e, 0x99, 0xc0, 0x82,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0xbf, 0xf8, 0x89, 0x81, 0x06, 0x2c, 0xc4, 0x71, 0xd0, 0x61, 0x69, 0xd0, + 0x0d, 0x48, 0xac, 0x9e, 0xcc, 0xae, 0x66, 0xe1, 0x84, 0xf2, 0x8b, 0xff, 0x9c, 0x6d, 0xe7, 0xeb, + 0xc1, 0x92, 0x02, 0xbf, 0xff, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x58, 0xab, 0x60, 0x26, 0xc6, + 0x13, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/dataproc/v1/jobs.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/dataproc/v1/jobs.pb.go new file mode 100644 index 0000000000..e84b749f14 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/dataproc/v1/jobs.pb.go @@ -0,0 +1,2196 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/dataproc/v1/jobs.proto + +package dataproc + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf2 "github.com/golang/protobuf/ptypes/empty" +import google_protobuf3 "github.com/golang/protobuf/ptypes/timestamp" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// The Log4j level for job execution. When running an +// [Apache Hive](http://hive.apache.org/) job, Cloud +// Dataproc configures the Hive client to an equivalent verbosity level. +type LoggingConfig_Level int32 + +const ( + // Level is unspecified. Use default level for log4j. + LoggingConfig_LEVEL_UNSPECIFIED LoggingConfig_Level = 0 + // Use ALL level for log4j. + LoggingConfig_ALL LoggingConfig_Level = 1 + // Use TRACE level for log4j. + LoggingConfig_TRACE LoggingConfig_Level = 2 + // Use DEBUG level for log4j. + LoggingConfig_DEBUG LoggingConfig_Level = 3 + // Use INFO level for log4j. + LoggingConfig_INFO LoggingConfig_Level = 4 + // Use WARN level for log4j. + LoggingConfig_WARN LoggingConfig_Level = 5 + // Use ERROR level for log4j. + LoggingConfig_ERROR LoggingConfig_Level = 6 + // Use FATAL level for log4j. + LoggingConfig_FATAL LoggingConfig_Level = 7 + // Turn off log4j. + LoggingConfig_OFF LoggingConfig_Level = 8 +) + +var LoggingConfig_Level_name = map[int32]string{ + 0: "LEVEL_UNSPECIFIED", + 1: "ALL", + 2: "TRACE", + 3: "DEBUG", + 4: "INFO", + 5: "WARN", + 6: "ERROR", + 7: "FATAL", + 8: "OFF", +} +var LoggingConfig_Level_value = map[string]int32{ + "LEVEL_UNSPECIFIED": 0, + "ALL": 1, + "TRACE": 2, + "DEBUG": 3, + "INFO": 4, + "WARN": 5, + "ERROR": 6, + "FATAL": 7, + "OFF": 8, +} + +func (x LoggingConfig_Level) String() string { + return proto.EnumName(LoggingConfig_Level_name, int32(x)) +} +func (LoggingConfig_Level) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{0, 0} } + +// The job state. +type JobStatus_State int32 + +const ( + // The job state is unknown. + JobStatus_STATE_UNSPECIFIED JobStatus_State = 0 + // The job is pending; it has been submitted, but is not yet running. + JobStatus_PENDING JobStatus_State = 1 + // Job has been received by the service and completed initial setup; + // it will soon be submitted to the cluster. + JobStatus_SETUP_DONE JobStatus_State = 8 + // The job is running on the cluster. + JobStatus_RUNNING JobStatus_State = 2 + // A CancelJob request has been received, but is pending. + JobStatus_CANCEL_PENDING JobStatus_State = 3 + // Transient in-flight resources have been canceled, and the request to + // cancel the running job has been issued to the cluster. + JobStatus_CANCEL_STARTED JobStatus_State = 7 + // The job cancellation was successful. + JobStatus_CANCELLED JobStatus_State = 4 + // The job has completed successfully. + JobStatus_DONE JobStatus_State = 5 + // The job has completed, but encountered an error. + JobStatus_ERROR JobStatus_State = 6 +) + +var JobStatus_State_name = map[int32]string{ + 0: "STATE_UNSPECIFIED", + 1: "PENDING", + 8: "SETUP_DONE", + 2: "RUNNING", + 3: "CANCEL_PENDING", + 7: "CANCEL_STARTED", + 4: "CANCELLED", + 5: "DONE", + 6: "ERROR", +} +var JobStatus_State_value = map[string]int32{ + "STATE_UNSPECIFIED": 0, + "PENDING": 1, + "SETUP_DONE": 8, + "RUNNING": 2, + "CANCEL_PENDING": 3, + "CANCEL_STARTED": 7, + "CANCELLED": 4, + "DONE": 5, + "ERROR": 6, +} + +func (x JobStatus_State) String() string { + return proto.EnumName(JobStatus_State_name, int32(x)) +} +func (JobStatus_State) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{9, 0} } + +// A matcher that specifies categories of job states. +type ListJobsRequest_JobStateMatcher int32 + +const ( + // Match all jobs, regardless of state. + ListJobsRequest_ALL ListJobsRequest_JobStateMatcher = 0 + // Only match jobs in non-terminal states: PENDING, RUNNING, or + // CANCEL_PENDING. + ListJobsRequest_ACTIVE ListJobsRequest_JobStateMatcher = 1 + // Only match jobs in terminal states: CANCELLED, DONE, or ERROR. + ListJobsRequest_NON_ACTIVE ListJobsRequest_JobStateMatcher = 2 +) + +var ListJobsRequest_JobStateMatcher_name = map[int32]string{ + 0: "ALL", + 1: "ACTIVE", + 2: "NON_ACTIVE", +} +var ListJobsRequest_JobStateMatcher_value = map[string]int32{ + "ALL": 0, + "ACTIVE": 1, + "NON_ACTIVE": 2, +} + +func (x ListJobsRequest_JobStateMatcher) String() string { + return proto.EnumName(ListJobsRequest_JobStateMatcher_name, int32(x)) +} +func (ListJobsRequest_JobStateMatcher) EnumDescriptor() ([]byte, []int) { + return fileDescriptor1, []int{14, 0} +} + +// The runtime logging config of the job. +type LoggingConfig struct { + // The per-package log levels for the driver. This may include + // "root" package name to configure rootLogger. + // Examples: + // 'com.google = FATAL', 'root = INFO', 'org.apache = DEBUG' + DriverLogLevels map[string]LoggingConfig_Level `protobuf:"bytes,2,rep,name=driver_log_levels,json=driverLogLevels" json:"driver_log_levels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value,enum=google.cloud.dataproc.v1.LoggingConfig_Level"` +} + +func (m *LoggingConfig) Reset() { *m = LoggingConfig{} } +func (m *LoggingConfig) String() string { return proto.CompactTextString(m) } +func (*LoggingConfig) ProtoMessage() {} +func (*LoggingConfig) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +func (m *LoggingConfig) GetDriverLogLevels() map[string]LoggingConfig_Level { + if m != nil { + return m.DriverLogLevels + } + return nil +} + +// A Cloud Dataproc job for running +// [Apache Hadoop MapReduce](https://hadoop.apache.org/docs/current/hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html) +// jobs on [Apache Hadoop YARN](https://hadoop.apache.org/docs/r2.7.1/hadoop-yarn/hadoop-yarn-site/YARN.html). +type HadoopJob struct { + // [Required] Indicates the location of the driver's main class. Specify + // either the jar file that contains the main class or the main class name. + // To specify both, add the jar file to `jar_file_uris`, and then specify + // the main class name in this property. + // + // Types that are valid to be assigned to Driver: + // *HadoopJob_MainJarFileUri + // *HadoopJob_MainClass + Driver isHadoopJob_Driver `protobuf_oneof:"driver"` + // [Optional] The arguments to pass to the driver. Do not + // include arguments, such as `-libjars` or `-Dfoo=bar`, that can be set as job + // properties, since a collision may occur that causes an incorrect job + // submission. + Args []string `protobuf:"bytes,3,rep,name=args" json:"args,omitempty"` + // [Optional] Jar file URIs to add to the CLASSPATHs of the + // Hadoop driver and tasks. + JarFileUris []string `protobuf:"bytes,4,rep,name=jar_file_uris,json=jarFileUris" json:"jar_file_uris,omitempty"` + // [Optional] HCFS (Hadoop Compatible Filesystem) URIs of files to be copied + // to the working directory of Hadoop drivers and distributed tasks. Useful + // for naively parallel tasks. + FileUris []string `protobuf:"bytes,5,rep,name=file_uris,json=fileUris" json:"file_uris,omitempty"` + // [Optional] HCFS URIs of archives to be extracted in the working directory of + // Hadoop drivers and tasks. Supported file types: + // .jar, .tar, .tar.gz, .tgz, or .zip. + ArchiveUris []string `protobuf:"bytes,6,rep,name=archive_uris,json=archiveUris" json:"archive_uris,omitempty"` + // [Optional] A mapping of property names to values, used to configure Hadoop. + // Properties that conflict with values set by the Cloud Dataproc API may be + // overwritten. Can include properties set in /etc/hadoop/conf/*-site and + // classes in user code. + Properties map[string]string `protobuf:"bytes,7,rep,name=properties" json:"properties,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // [Optional] The runtime log config for job execution. + LoggingConfig *LoggingConfig `protobuf:"bytes,8,opt,name=logging_config,json=loggingConfig" json:"logging_config,omitempty"` +} + +func (m *HadoopJob) Reset() { *m = HadoopJob{} } +func (m *HadoopJob) String() string { return proto.CompactTextString(m) } +func (*HadoopJob) ProtoMessage() {} +func (*HadoopJob) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} } + +type isHadoopJob_Driver interface { + isHadoopJob_Driver() +} + +type HadoopJob_MainJarFileUri struct { + MainJarFileUri string `protobuf:"bytes,1,opt,name=main_jar_file_uri,json=mainJarFileUri,oneof"` +} +type HadoopJob_MainClass struct { + MainClass string `protobuf:"bytes,2,opt,name=main_class,json=mainClass,oneof"` +} + +func (*HadoopJob_MainJarFileUri) isHadoopJob_Driver() {} +func (*HadoopJob_MainClass) isHadoopJob_Driver() {} + +func (m *HadoopJob) GetDriver() isHadoopJob_Driver { + if m != nil { + return m.Driver + } + return nil +} + +func (m *HadoopJob) GetMainJarFileUri() string { + if x, ok := m.GetDriver().(*HadoopJob_MainJarFileUri); ok { + return x.MainJarFileUri + } + return "" +} + +func (m *HadoopJob) GetMainClass() string { + if x, ok := m.GetDriver().(*HadoopJob_MainClass); ok { + return x.MainClass + } + return "" +} + +func (m *HadoopJob) GetArgs() []string { + if m != nil { + return m.Args + } + return nil +} + +func (m *HadoopJob) GetJarFileUris() []string { + if m != nil { + return m.JarFileUris + } + return nil +} + +func (m *HadoopJob) GetFileUris() []string { + if m != nil { + return m.FileUris + } + return nil +} + +func (m *HadoopJob) GetArchiveUris() []string { + if m != nil { + return m.ArchiveUris + } + return nil +} + +func (m *HadoopJob) GetProperties() map[string]string { + if m != nil { + return m.Properties + } + return nil +} + +func (m *HadoopJob) GetLoggingConfig() *LoggingConfig { + if m != nil { + return m.LoggingConfig + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*HadoopJob) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _HadoopJob_OneofMarshaler, _HadoopJob_OneofUnmarshaler, _HadoopJob_OneofSizer, []interface{}{ + (*HadoopJob_MainJarFileUri)(nil), + (*HadoopJob_MainClass)(nil), + } +} + +func _HadoopJob_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*HadoopJob) + // driver + switch x := m.Driver.(type) { + case *HadoopJob_MainJarFileUri: + b.EncodeVarint(1<<3 | proto.WireBytes) + b.EncodeStringBytes(x.MainJarFileUri) + case *HadoopJob_MainClass: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeStringBytes(x.MainClass) + case nil: + default: + return fmt.Errorf("HadoopJob.Driver has unexpected type %T", x) + } + return nil +} + +func _HadoopJob_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*HadoopJob) + switch tag { + case 1: // driver.main_jar_file_uri + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Driver = &HadoopJob_MainJarFileUri{x} + return true, err + case 2: // driver.main_class + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Driver = &HadoopJob_MainClass{x} + return true, err + default: + return false, nil + } +} + +func _HadoopJob_OneofSizer(msg proto.Message) (n int) { + m := msg.(*HadoopJob) + // driver + switch x := m.Driver.(type) { + case *HadoopJob_MainJarFileUri: + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.MainJarFileUri))) + n += len(x.MainJarFileUri) + case *HadoopJob_MainClass: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.MainClass))) + n += len(x.MainClass) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// A Cloud Dataproc job for running [Apache Spark](http://spark.apache.org/) +// applications on YARN. +type SparkJob struct { + // [Required] The specification of the main method to call to drive the job. + // Specify either the jar file that contains the main class or the main class + // name. To pass both a main jar and a main class in that jar, add the jar to + // `CommonJob.jar_file_uris`, and then specify the main class name in `main_class`. + // + // Types that are valid to be assigned to Driver: + // *SparkJob_MainJarFileUri + // *SparkJob_MainClass + Driver isSparkJob_Driver `protobuf_oneof:"driver"` + // [Optional] The arguments to pass to the driver. Do not include arguments, + // such as `--conf`, that can be set as job properties, since a collision may + // occur that causes an incorrect job submission. + Args []string `protobuf:"bytes,3,rep,name=args" json:"args,omitempty"` + // [Optional] HCFS URIs of jar files to add to the CLASSPATHs of the + // Spark driver and tasks. + JarFileUris []string `protobuf:"bytes,4,rep,name=jar_file_uris,json=jarFileUris" json:"jar_file_uris,omitempty"` + // [Optional] HCFS URIs of files to be copied to the working directory of + // Spark drivers and distributed tasks. Useful for naively parallel tasks. + FileUris []string `protobuf:"bytes,5,rep,name=file_uris,json=fileUris" json:"file_uris,omitempty"` + // [Optional] HCFS URIs of archives to be extracted in the working directory + // of Spark drivers and tasks. Supported file types: + // .jar, .tar, .tar.gz, .tgz, and .zip. + ArchiveUris []string `protobuf:"bytes,6,rep,name=archive_uris,json=archiveUris" json:"archive_uris,omitempty"` + // [Optional] A mapping of property names to values, used to configure Spark. + // Properties that conflict with values set by the Cloud Dataproc API may be + // overwritten. Can include properties set in + // /etc/spark/conf/spark-defaults.conf and classes in user code. + Properties map[string]string `protobuf:"bytes,7,rep,name=properties" json:"properties,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // [Optional] The runtime log config for job execution. + LoggingConfig *LoggingConfig `protobuf:"bytes,8,opt,name=logging_config,json=loggingConfig" json:"logging_config,omitempty"` +} + +func (m *SparkJob) Reset() { *m = SparkJob{} } +func (m *SparkJob) String() string { return proto.CompactTextString(m) } +func (*SparkJob) ProtoMessage() {} +func (*SparkJob) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} } + +type isSparkJob_Driver interface { + isSparkJob_Driver() +} + +type SparkJob_MainJarFileUri struct { + MainJarFileUri string `protobuf:"bytes,1,opt,name=main_jar_file_uri,json=mainJarFileUri,oneof"` +} +type SparkJob_MainClass struct { + MainClass string `protobuf:"bytes,2,opt,name=main_class,json=mainClass,oneof"` +} + +func (*SparkJob_MainJarFileUri) isSparkJob_Driver() {} +func (*SparkJob_MainClass) isSparkJob_Driver() {} + +func (m *SparkJob) GetDriver() isSparkJob_Driver { + if m != nil { + return m.Driver + } + return nil +} + +func (m *SparkJob) GetMainJarFileUri() string { + if x, ok := m.GetDriver().(*SparkJob_MainJarFileUri); ok { + return x.MainJarFileUri + } + return "" +} + +func (m *SparkJob) GetMainClass() string { + if x, ok := m.GetDriver().(*SparkJob_MainClass); ok { + return x.MainClass + } + return "" +} + +func (m *SparkJob) GetArgs() []string { + if m != nil { + return m.Args + } + return nil +} + +func (m *SparkJob) GetJarFileUris() []string { + if m != nil { + return m.JarFileUris + } + return nil +} + +func (m *SparkJob) GetFileUris() []string { + if m != nil { + return m.FileUris + } + return nil +} + +func (m *SparkJob) GetArchiveUris() []string { + if m != nil { + return m.ArchiveUris + } + return nil +} + +func (m *SparkJob) GetProperties() map[string]string { + if m != nil { + return m.Properties + } + return nil +} + +func (m *SparkJob) GetLoggingConfig() *LoggingConfig { + if m != nil { + return m.LoggingConfig + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*SparkJob) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _SparkJob_OneofMarshaler, _SparkJob_OneofUnmarshaler, _SparkJob_OneofSizer, []interface{}{ + (*SparkJob_MainJarFileUri)(nil), + (*SparkJob_MainClass)(nil), + } +} + +func _SparkJob_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*SparkJob) + // driver + switch x := m.Driver.(type) { + case *SparkJob_MainJarFileUri: + b.EncodeVarint(1<<3 | proto.WireBytes) + b.EncodeStringBytes(x.MainJarFileUri) + case *SparkJob_MainClass: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeStringBytes(x.MainClass) + case nil: + default: + return fmt.Errorf("SparkJob.Driver has unexpected type %T", x) + } + return nil +} + +func _SparkJob_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*SparkJob) + switch tag { + case 1: // driver.main_jar_file_uri + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Driver = &SparkJob_MainJarFileUri{x} + return true, err + case 2: // driver.main_class + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Driver = &SparkJob_MainClass{x} + return true, err + default: + return false, nil + } +} + +func _SparkJob_OneofSizer(msg proto.Message) (n int) { + m := msg.(*SparkJob) + // driver + switch x := m.Driver.(type) { + case *SparkJob_MainJarFileUri: + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.MainJarFileUri))) + n += len(x.MainJarFileUri) + case *SparkJob_MainClass: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.MainClass))) + n += len(x.MainClass) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// A Cloud Dataproc job for running +// [Apache PySpark](https://spark.apache.org/docs/0.9.0/python-programming-guide.html) +// applications on YARN. +type PySparkJob struct { + // [Required] The HCFS URI of the main Python file to use as the driver. Must + // be a .py file. + MainPythonFileUri string `protobuf:"bytes,1,opt,name=main_python_file_uri,json=mainPythonFileUri" json:"main_python_file_uri,omitempty"` + // [Optional] The arguments to pass to the driver. Do not include arguments, + // such as `--conf`, that can be set as job properties, since a collision may + // occur that causes an incorrect job submission. + Args []string `protobuf:"bytes,2,rep,name=args" json:"args,omitempty"` + // [Optional] HCFS file URIs of Python files to pass to the PySpark + // framework. Supported file types: .py, .egg, and .zip. + PythonFileUris []string `protobuf:"bytes,3,rep,name=python_file_uris,json=pythonFileUris" json:"python_file_uris,omitempty"` + // [Optional] HCFS URIs of jar files to add to the CLASSPATHs of the + // Python driver and tasks. + JarFileUris []string `protobuf:"bytes,4,rep,name=jar_file_uris,json=jarFileUris" json:"jar_file_uris,omitempty"` + // [Optional] HCFS URIs of files to be copied to the working directory of + // Python drivers and distributed tasks. Useful for naively parallel tasks. + FileUris []string `protobuf:"bytes,5,rep,name=file_uris,json=fileUris" json:"file_uris,omitempty"` + // [Optional] HCFS URIs of archives to be extracted in the working directory of + // .jar, .tar, .tar.gz, .tgz, and .zip. + ArchiveUris []string `protobuf:"bytes,6,rep,name=archive_uris,json=archiveUris" json:"archive_uris,omitempty"` + // [Optional] A mapping of property names to values, used to configure PySpark. + // Properties that conflict with values set by the Cloud Dataproc API may be + // overwritten. Can include properties set in + // /etc/spark/conf/spark-defaults.conf and classes in user code. + Properties map[string]string `protobuf:"bytes,7,rep,name=properties" json:"properties,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // [Optional] The runtime log config for job execution. + LoggingConfig *LoggingConfig `protobuf:"bytes,8,opt,name=logging_config,json=loggingConfig" json:"logging_config,omitempty"` +} + +func (m *PySparkJob) Reset() { *m = PySparkJob{} } +func (m *PySparkJob) String() string { return proto.CompactTextString(m) } +func (*PySparkJob) ProtoMessage() {} +func (*PySparkJob) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{3} } + +func (m *PySparkJob) GetMainPythonFileUri() string { + if m != nil { + return m.MainPythonFileUri + } + return "" +} + +func (m *PySparkJob) GetArgs() []string { + if m != nil { + return m.Args + } + return nil +} + +func (m *PySparkJob) GetPythonFileUris() []string { + if m != nil { + return m.PythonFileUris + } + return nil +} + +func (m *PySparkJob) GetJarFileUris() []string { + if m != nil { + return m.JarFileUris + } + return nil +} + +func (m *PySparkJob) GetFileUris() []string { + if m != nil { + return m.FileUris + } + return nil +} + +func (m *PySparkJob) GetArchiveUris() []string { + if m != nil { + return m.ArchiveUris + } + return nil +} + +func (m *PySparkJob) GetProperties() map[string]string { + if m != nil { + return m.Properties + } + return nil +} + +func (m *PySparkJob) GetLoggingConfig() *LoggingConfig { + if m != nil { + return m.LoggingConfig + } + return nil +} + +// A list of queries to run on a cluster. +type QueryList struct { + // [Required] The queries to execute. You do not need to terminate a query + // with a semicolon. Multiple queries can be specified in one string + // by separating each with a semicolon. Here is an example of an Cloud + // Dataproc API snippet that uses a QueryList to specify a HiveJob: + // + // "hiveJob": { + // "queryList": { + // "queries": [ + // "query1", + // "query2", + // "query3;query4", + // ] + // } + // } + Queries []string `protobuf:"bytes,1,rep,name=queries" json:"queries,omitempty"` +} + +func (m *QueryList) Reset() { *m = QueryList{} } +func (m *QueryList) String() string { return proto.CompactTextString(m) } +func (*QueryList) ProtoMessage() {} +func (*QueryList) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{4} } + +func (m *QueryList) GetQueries() []string { + if m != nil { + return m.Queries + } + return nil +} + +// A Cloud Dataproc job for running [Apache Hive](https://hive.apache.org/) +// queries on YARN. +type HiveJob struct { + // [Required] The sequence of Hive queries to execute, specified as either + // an HCFS file URI or a list of queries. + // + // Types that are valid to be assigned to Queries: + // *HiveJob_QueryFileUri + // *HiveJob_QueryList + Queries isHiveJob_Queries `protobuf_oneof:"queries"` + // [Optional] Whether to continue executing queries if a query fails. + // The default value is `false`. Setting to `true` can be useful when executing + // independent parallel queries. + ContinueOnFailure bool `protobuf:"varint,3,opt,name=continue_on_failure,json=continueOnFailure" json:"continue_on_failure,omitempty"` + // [Optional] Mapping of query variable names to values (equivalent to the + // Hive command: `SET name="value";`). + ScriptVariables map[string]string `protobuf:"bytes,4,rep,name=script_variables,json=scriptVariables" json:"script_variables,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // [Optional] A mapping of property names and values, used to configure Hive. + // Properties that conflict with values set by the Cloud Dataproc API may be + // overwritten. Can include properties set in /etc/hadoop/conf/*-site.xml, + // /etc/hive/conf/hive-site.xml, and classes in user code. + Properties map[string]string `protobuf:"bytes,5,rep,name=properties" json:"properties,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // [Optional] HCFS URIs of jar files to add to the CLASSPATH of the + // Hive server and Hadoop MapReduce (MR) tasks. Can contain Hive SerDes + // and UDFs. + JarFileUris []string `protobuf:"bytes,6,rep,name=jar_file_uris,json=jarFileUris" json:"jar_file_uris,omitempty"` +} + +func (m *HiveJob) Reset() { *m = HiveJob{} } +func (m *HiveJob) String() string { return proto.CompactTextString(m) } +func (*HiveJob) ProtoMessage() {} +func (*HiveJob) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{5} } + +type isHiveJob_Queries interface { + isHiveJob_Queries() +} + +type HiveJob_QueryFileUri struct { + QueryFileUri string `protobuf:"bytes,1,opt,name=query_file_uri,json=queryFileUri,oneof"` +} +type HiveJob_QueryList struct { + QueryList *QueryList `protobuf:"bytes,2,opt,name=query_list,json=queryList,oneof"` +} + +func (*HiveJob_QueryFileUri) isHiveJob_Queries() {} +func (*HiveJob_QueryList) isHiveJob_Queries() {} + +func (m *HiveJob) GetQueries() isHiveJob_Queries { + if m != nil { + return m.Queries + } + return nil +} + +func (m *HiveJob) GetQueryFileUri() string { + if x, ok := m.GetQueries().(*HiveJob_QueryFileUri); ok { + return x.QueryFileUri + } + return "" +} + +func (m *HiveJob) GetQueryList() *QueryList { + if x, ok := m.GetQueries().(*HiveJob_QueryList); ok { + return x.QueryList + } + return nil +} + +func (m *HiveJob) GetContinueOnFailure() bool { + if m != nil { + return m.ContinueOnFailure + } + return false +} + +func (m *HiveJob) GetScriptVariables() map[string]string { + if m != nil { + return m.ScriptVariables + } + return nil +} + +func (m *HiveJob) GetProperties() map[string]string { + if m != nil { + return m.Properties + } + return nil +} + +func (m *HiveJob) GetJarFileUris() []string { + if m != nil { + return m.JarFileUris + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*HiveJob) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _HiveJob_OneofMarshaler, _HiveJob_OneofUnmarshaler, _HiveJob_OneofSizer, []interface{}{ + (*HiveJob_QueryFileUri)(nil), + (*HiveJob_QueryList)(nil), + } +} + +func _HiveJob_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*HiveJob) + // queries + switch x := m.Queries.(type) { + case *HiveJob_QueryFileUri: + b.EncodeVarint(1<<3 | proto.WireBytes) + b.EncodeStringBytes(x.QueryFileUri) + case *HiveJob_QueryList: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.QueryList); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("HiveJob.Queries has unexpected type %T", x) + } + return nil +} + +func _HiveJob_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*HiveJob) + switch tag { + case 1: // queries.query_file_uri + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Queries = &HiveJob_QueryFileUri{x} + return true, err + case 2: // queries.query_list + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(QueryList) + err := b.DecodeMessage(msg) + m.Queries = &HiveJob_QueryList{msg} + return true, err + default: + return false, nil + } +} + +func _HiveJob_OneofSizer(msg proto.Message) (n int) { + m := msg.(*HiveJob) + // queries + switch x := m.Queries.(type) { + case *HiveJob_QueryFileUri: + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.QueryFileUri))) + n += len(x.QueryFileUri) + case *HiveJob_QueryList: + s := proto.Size(x.QueryList) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// A Cloud Dataproc job for running [Apache Spark SQL](http://spark.apache.org/sql/) +// queries. +type SparkSqlJob struct { + // [Required] The sequence of Spark SQL queries to execute, specified as + // either an HCFS file URI or as a list of queries. + // + // Types that are valid to be assigned to Queries: + // *SparkSqlJob_QueryFileUri + // *SparkSqlJob_QueryList + Queries isSparkSqlJob_Queries `protobuf_oneof:"queries"` + // [Optional] Mapping of query variable names to values (equivalent to the + // Spark SQL command: SET `name="value";`). + ScriptVariables map[string]string `protobuf:"bytes,3,rep,name=script_variables,json=scriptVariables" json:"script_variables,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // [Optional] A mapping of property names to values, used to configure + // Spark SQL's SparkConf. Properties that conflict with values set by the + // Cloud Dataproc API may be overwritten. + Properties map[string]string `protobuf:"bytes,4,rep,name=properties" json:"properties,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // [Optional] HCFS URIs of jar files to be added to the Spark CLASSPATH. + JarFileUris []string `protobuf:"bytes,56,rep,name=jar_file_uris,json=jarFileUris" json:"jar_file_uris,omitempty"` + // [Optional] The runtime log config for job execution. + LoggingConfig *LoggingConfig `protobuf:"bytes,6,opt,name=logging_config,json=loggingConfig" json:"logging_config,omitempty"` +} + +func (m *SparkSqlJob) Reset() { *m = SparkSqlJob{} } +func (m *SparkSqlJob) String() string { return proto.CompactTextString(m) } +func (*SparkSqlJob) ProtoMessage() {} +func (*SparkSqlJob) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{6} } + +type isSparkSqlJob_Queries interface { + isSparkSqlJob_Queries() +} + +type SparkSqlJob_QueryFileUri struct { + QueryFileUri string `protobuf:"bytes,1,opt,name=query_file_uri,json=queryFileUri,oneof"` +} +type SparkSqlJob_QueryList struct { + QueryList *QueryList `protobuf:"bytes,2,opt,name=query_list,json=queryList,oneof"` +} + +func (*SparkSqlJob_QueryFileUri) isSparkSqlJob_Queries() {} +func (*SparkSqlJob_QueryList) isSparkSqlJob_Queries() {} + +func (m *SparkSqlJob) GetQueries() isSparkSqlJob_Queries { + if m != nil { + return m.Queries + } + return nil +} + +func (m *SparkSqlJob) GetQueryFileUri() string { + if x, ok := m.GetQueries().(*SparkSqlJob_QueryFileUri); ok { + return x.QueryFileUri + } + return "" +} + +func (m *SparkSqlJob) GetQueryList() *QueryList { + if x, ok := m.GetQueries().(*SparkSqlJob_QueryList); ok { + return x.QueryList + } + return nil +} + +func (m *SparkSqlJob) GetScriptVariables() map[string]string { + if m != nil { + return m.ScriptVariables + } + return nil +} + +func (m *SparkSqlJob) GetProperties() map[string]string { + if m != nil { + return m.Properties + } + return nil +} + +func (m *SparkSqlJob) GetJarFileUris() []string { + if m != nil { + return m.JarFileUris + } + return nil +} + +func (m *SparkSqlJob) GetLoggingConfig() *LoggingConfig { + if m != nil { + return m.LoggingConfig + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*SparkSqlJob) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _SparkSqlJob_OneofMarshaler, _SparkSqlJob_OneofUnmarshaler, _SparkSqlJob_OneofSizer, []interface{}{ + (*SparkSqlJob_QueryFileUri)(nil), + (*SparkSqlJob_QueryList)(nil), + } +} + +func _SparkSqlJob_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*SparkSqlJob) + // queries + switch x := m.Queries.(type) { + case *SparkSqlJob_QueryFileUri: + b.EncodeVarint(1<<3 | proto.WireBytes) + b.EncodeStringBytes(x.QueryFileUri) + case *SparkSqlJob_QueryList: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.QueryList); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("SparkSqlJob.Queries has unexpected type %T", x) + } + return nil +} + +func _SparkSqlJob_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*SparkSqlJob) + switch tag { + case 1: // queries.query_file_uri + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Queries = &SparkSqlJob_QueryFileUri{x} + return true, err + case 2: // queries.query_list + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(QueryList) + err := b.DecodeMessage(msg) + m.Queries = &SparkSqlJob_QueryList{msg} + return true, err + default: + return false, nil + } +} + +func _SparkSqlJob_OneofSizer(msg proto.Message) (n int) { + m := msg.(*SparkSqlJob) + // queries + switch x := m.Queries.(type) { + case *SparkSqlJob_QueryFileUri: + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.QueryFileUri))) + n += len(x.QueryFileUri) + case *SparkSqlJob_QueryList: + s := proto.Size(x.QueryList) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// A Cloud Dataproc job for running [Apache Pig](https://pig.apache.org/) +// queries on YARN. +type PigJob struct { + // [Required] The sequence of Pig queries to execute, specified as an HCFS + // file URI or a list of queries. + // + // Types that are valid to be assigned to Queries: + // *PigJob_QueryFileUri + // *PigJob_QueryList + Queries isPigJob_Queries `protobuf_oneof:"queries"` + // [Optional] Whether to continue executing queries if a query fails. + // The default value is `false`. Setting to `true` can be useful when executing + // independent parallel queries. + ContinueOnFailure bool `protobuf:"varint,3,opt,name=continue_on_failure,json=continueOnFailure" json:"continue_on_failure,omitempty"` + // [Optional] Mapping of query variable names to values (equivalent to the Pig + // command: `name=[value]`). + ScriptVariables map[string]string `protobuf:"bytes,4,rep,name=script_variables,json=scriptVariables" json:"script_variables,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // [Optional] A mapping of property names to values, used to configure Pig. + // Properties that conflict with values set by the Cloud Dataproc API may be + // overwritten. Can include properties set in /etc/hadoop/conf/*-site.xml, + // /etc/pig/conf/pig.properties, and classes in user code. + Properties map[string]string `protobuf:"bytes,5,rep,name=properties" json:"properties,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // [Optional] HCFS URIs of jar files to add to the CLASSPATH of + // the Pig Client and Hadoop MapReduce (MR) tasks. Can contain Pig UDFs. + JarFileUris []string `protobuf:"bytes,6,rep,name=jar_file_uris,json=jarFileUris" json:"jar_file_uris,omitempty"` + // [Optional] The runtime log config for job execution. + LoggingConfig *LoggingConfig `protobuf:"bytes,7,opt,name=logging_config,json=loggingConfig" json:"logging_config,omitempty"` +} + +func (m *PigJob) Reset() { *m = PigJob{} } +func (m *PigJob) String() string { return proto.CompactTextString(m) } +func (*PigJob) ProtoMessage() {} +func (*PigJob) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{7} } + +type isPigJob_Queries interface { + isPigJob_Queries() +} + +type PigJob_QueryFileUri struct { + QueryFileUri string `protobuf:"bytes,1,opt,name=query_file_uri,json=queryFileUri,oneof"` +} +type PigJob_QueryList struct { + QueryList *QueryList `protobuf:"bytes,2,opt,name=query_list,json=queryList,oneof"` +} + +func (*PigJob_QueryFileUri) isPigJob_Queries() {} +func (*PigJob_QueryList) isPigJob_Queries() {} + +func (m *PigJob) GetQueries() isPigJob_Queries { + if m != nil { + return m.Queries + } + return nil +} + +func (m *PigJob) GetQueryFileUri() string { + if x, ok := m.GetQueries().(*PigJob_QueryFileUri); ok { + return x.QueryFileUri + } + return "" +} + +func (m *PigJob) GetQueryList() *QueryList { + if x, ok := m.GetQueries().(*PigJob_QueryList); ok { + return x.QueryList + } + return nil +} + +func (m *PigJob) GetContinueOnFailure() bool { + if m != nil { + return m.ContinueOnFailure + } + return false +} + +func (m *PigJob) GetScriptVariables() map[string]string { + if m != nil { + return m.ScriptVariables + } + return nil +} + +func (m *PigJob) GetProperties() map[string]string { + if m != nil { + return m.Properties + } + return nil +} + +func (m *PigJob) GetJarFileUris() []string { + if m != nil { + return m.JarFileUris + } + return nil +} + +func (m *PigJob) GetLoggingConfig() *LoggingConfig { + if m != nil { + return m.LoggingConfig + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*PigJob) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _PigJob_OneofMarshaler, _PigJob_OneofUnmarshaler, _PigJob_OneofSizer, []interface{}{ + (*PigJob_QueryFileUri)(nil), + (*PigJob_QueryList)(nil), + } +} + +func _PigJob_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*PigJob) + // queries + switch x := m.Queries.(type) { + case *PigJob_QueryFileUri: + b.EncodeVarint(1<<3 | proto.WireBytes) + b.EncodeStringBytes(x.QueryFileUri) + case *PigJob_QueryList: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.QueryList); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("PigJob.Queries has unexpected type %T", x) + } + return nil +} + +func _PigJob_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*PigJob) + switch tag { + case 1: // queries.query_file_uri + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Queries = &PigJob_QueryFileUri{x} + return true, err + case 2: // queries.query_list + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(QueryList) + err := b.DecodeMessage(msg) + m.Queries = &PigJob_QueryList{msg} + return true, err + default: + return false, nil + } +} + +func _PigJob_OneofSizer(msg proto.Message) (n int) { + m := msg.(*PigJob) + // queries + switch x := m.Queries.(type) { + case *PigJob_QueryFileUri: + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.QueryFileUri))) + n += len(x.QueryFileUri) + case *PigJob_QueryList: + s := proto.Size(x.QueryList) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Cloud Dataproc job config. +type JobPlacement struct { + // [Required] The name of the cluster where the job will be submitted. + ClusterName string `protobuf:"bytes,1,opt,name=cluster_name,json=clusterName" json:"cluster_name,omitempty"` + // [Output-only] A cluster UUID generated by the Cloud Dataproc service when + // the job is submitted. + ClusterUuid string `protobuf:"bytes,2,opt,name=cluster_uuid,json=clusterUuid" json:"cluster_uuid,omitempty"` +} + +func (m *JobPlacement) Reset() { *m = JobPlacement{} } +func (m *JobPlacement) String() string { return proto.CompactTextString(m) } +func (*JobPlacement) ProtoMessage() {} +func (*JobPlacement) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{8} } + +func (m *JobPlacement) GetClusterName() string { + if m != nil { + return m.ClusterName + } + return "" +} + +func (m *JobPlacement) GetClusterUuid() string { + if m != nil { + return m.ClusterUuid + } + return "" +} + +// Cloud Dataproc job status. +type JobStatus struct { + // [Output-only] A state message specifying the overall job state. + State JobStatus_State `protobuf:"varint,1,opt,name=state,enum=google.cloud.dataproc.v1.JobStatus_State" json:"state,omitempty"` + // [Output-only] Optional job state details, such as an error + // description if the state is ERROR. + Details string `protobuf:"bytes,2,opt,name=details" json:"details,omitempty"` + // [Output-only] The time when this state was entered. + StateStartTime *google_protobuf3.Timestamp `protobuf:"bytes,6,opt,name=state_start_time,json=stateStartTime" json:"state_start_time,omitempty"` +} + +func (m *JobStatus) Reset() { *m = JobStatus{} } +func (m *JobStatus) String() string { return proto.CompactTextString(m) } +func (*JobStatus) ProtoMessage() {} +func (*JobStatus) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{9} } + +func (m *JobStatus) GetState() JobStatus_State { + if m != nil { + return m.State + } + return JobStatus_STATE_UNSPECIFIED +} + +func (m *JobStatus) GetDetails() string { + if m != nil { + return m.Details + } + return "" +} + +func (m *JobStatus) GetStateStartTime() *google_protobuf3.Timestamp { + if m != nil { + return m.StateStartTime + } + return nil +} + +// Encapsulates the full scoping used to reference a job. +type JobReference struct { + // [Required] The ID of the Google Cloud Platform project that the job + // belongs to. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // [Optional] The job ID, which must be unique within the project. The job ID + // is generated by the server upon job submission or provided by the user as a + // means to perform retries without creating duplicate jobs. The ID must + // contain only letters (a-z, A-Z), numbers (0-9), underscores (_), or + // hyphens (-). The maximum length is 512 characters. + JobId string `protobuf:"bytes,2,opt,name=job_id,json=jobId" json:"job_id,omitempty"` +} + +func (m *JobReference) Reset() { *m = JobReference{} } +func (m *JobReference) String() string { return proto.CompactTextString(m) } +func (*JobReference) ProtoMessage() {} +func (*JobReference) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{10} } + +func (m *JobReference) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *JobReference) GetJobId() string { + if m != nil { + return m.JobId + } + return "" +} + +// A Cloud Dataproc job resource. +type Job struct { + // [Optional] The fully qualified reference to the job, which can be used to + // obtain the equivalent REST path of the job resource. If this property + // is not specified when a job is created, the server generates a + // job_id. + Reference *JobReference `protobuf:"bytes,1,opt,name=reference" json:"reference,omitempty"` + // [Required] Job information, including how, when, and where to + // run the job. + Placement *JobPlacement `protobuf:"bytes,2,opt,name=placement" json:"placement,omitempty"` + // [Required] The application/framework-specific portion of the job. + // + // Types that are valid to be assigned to TypeJob: + // *Job_HadoopJob + // *Job_SparkJob + // *Job_PysparkJob + // *Job_HiveJob + // *Job_PigJob + // *Job_SparkSqlJob + TypeJob isJob_TypeJob `protobuf_oneof:"type_job"` + // [Output-only] The job status. Additional application-specific + // status information may be contained in the type_job + // and yarn_applications fields. + Status *JobStatus `protobuf:"bytes,8,opt,name=status" json:"status,omitempty"` + // [Output-only] The previous job status. + StatusHistory []*JobStatus `protobuf:"bytes,13,rep,name=status_history,json=statusHistory" json:"status_history,omitempty"` + // [Output-only] A URI pointing to the location of the stdout of the job's + // driver program. + DriverOutputResourceUri string `protobuf:"bytes,17,opt,name=driver_output_resource_uri,json=driverOutputResourceUri" json:"driver_output_resource_uri,omitempty"` + // [Output-only] If present, the location of miscellaneous control files + // which may be used as part of job setup and handling. If not present, + // control files may be placed in the same location as `driver_output_uri`. + DriverControlFilesUri string `protobuf:"bytes,15,opt,name=driver_control_files_uri,json=driverControlFilesUri" json:"driver_control_files_uri,omitempty"` +} + +func (m *Job) Reset() { *m = Job{} } +func (m *Job) String() string { return proto.CompactTextString(m) } +func (*Job) ProtoMessage() {} +func (*Job) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{11} } + +type isJob_TypeJob interface { + isJob_TypeJob() +} + +type Job_HadoopJob struct { + HadoopJob *HadoopJob `protobuf:"bytes,3,opt,name=hadoop_job,json=hadoopJob,oneof"` +} +type Job_SparkJob struct { + SparkJob *SparkJob `protobuf:"bytes,4,opt,name=spark_job,json=sparkJob,oneof"` +} +type Job_PysparkJob struct { + PysparkJob *PySparkJob `protobuf:"bytes,5,opt,name=pyspark_job,json=pysparkJob,oneof"` +} +type Job_HiveJob struct { + HiveJob *HiveJob `protobuf:"bytes,6,opt,name=hive_job,json=hiveJob,oneof"` +} +type Job_PigJob struct { + PigJob *PigJob `protobuf:"bytes,7,opt,name=pig_job,json=pigJob,oneof"` +} +type Job_SparkSqlJob struct { + SparkSqlJob *SparkSqlJob `protobuf:"bytes,12,opt,name=spark_sql_job,json=sparkSqlJob,oneof"` +} + +func (*Job_HadoopJob) isJob_TypeJob() {} +func (*Job_SparkJob) isJob_TypeJob() {} +func (*Job_PysparkJob) isJob_TypeJob() {} +func (*Job_HiveJob) isJob_TypeJob() {} +func (*Job_PigJob) isJob_TypeJob() {} +func (*Job_SparkSqlJob) isJob_TypeJob() {} + +func (m *Job) GetTypeJob() isJob_TypeJob { + if m != nil { + return m.TypeJob + } + return nil +} + +func (m *Job) GetReference() *JobReference { + if m != nil { + return m.Reference + } + return nil +} + +func (m *Job) GetPlacement() *JobPlacement { + if m != nil { + return m.Placement + } + return nil +} + +func (m *Job) GetHadoopJob() *HadoopJob { + if x, ok := m.GetTypeJob().(*Job_HadoopJob); ok { + return x.HadoopJob + } + return nil +} + +func (m *Job) GetSparkJob() *SparkJob { + if x, ok := m.GetTypeJob().(*Job_SparkJob); ok { + return x.SparkJob + } + return nil +} + +func (m *Job) GetPysparkJob() *PySparkJob { + if x, ok := m.GetTypeJob().(*Job_PysparkJob); ok { + return x.PysparkJob + } + return nil +} + +func (m *Job) GetHiveJob() *HiveJob { + if x, ok := m.GetTypeJob().(*Job_HiveJob); ok { + return x.HiveJob + } + return nil +} + +func (m *Job) GetPigJob() *PigJob { + if x, ok := m.GetTypeJob().(*Job_PigJob); ok { + return x.PigJob + } + return nil +} + +func (m *Job) GetSparkSqlJob() *SparkSqlJob { + if x, ok := m.GetTypeJob().(*Job_SparkSqlJob); ok { + return x.SparkSqlJob + } + return nil +} + +func (m *Job) GetStatus() *JobStatus { + if m != nil { + return m.Status + } + return nil +} + +func (m *Job) GetStatusHistory() []*JobStatus { + if m != nil { + return m.StatusHistory + } + return nil +} + +func (m *Job) GetDriverOutputResourceUri() string { + if m != nil { + return m.DriverOutputResourceUri + } + return "" +} + +func (m *Job) GetDriverControlFilesUri() string { + if m != nil { + return m.DriverControlFilesUri + } + return "" +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Job) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _Job_OneofMarshaler, _Job_OneofUnmarshaler, _Job_OneofSizer, []interface{}{ + (*Job_HadoopJob)(nil), + (*Job_SparkJob)(nil), + (*Job_PysparkJob)(nil), + (*Job_HiveJob)(nil), + (*Job_PigJob)(nil), + (*Job_SparkSqlJob)(nil), + } +} + +func _Job_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Job) + // type_job + switch x := m.TypeJob.(type) { + case *Job_HadoopJob: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.HadoopJob); err != nil { + return err + } + case *Job_SparkJob: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.SparkJob); err != nil { + return err + } + case *Job_PysparkJob: + b.EncodeVarint(5<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.PysparkJob); err != nil { + return err + } + case *Job_HiveJob: + b.EncodeVarint(6<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.HiveJob); err != nil { + return err + } + case *Job_PigJob: + b.EncodeVarint(7<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.PigJob); err != nil { + return err + } + case *Job_SparkSqlJob: + b.EncodeVarint(12<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.SparkSqlJob); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("Job.TypeJob has unexpected type %T", x) + } + return nil +} + +func _Job_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Job) + switch tag { + case 3: // type_job.hadoop_job + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(HadoopJob) + err := b.DecodeMessage(msg) + m.TypeJob = &Job_HadoopJob{msg} + return true, err + case 4: // type_job.spark_job + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SparkJob) + err := b.DecodeMessage(msg) + m.TypeJob = &Job_SparkJob{msg} + return true, err + case 5: // type_job.pyspark_job + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(PySparkJob) + err := b.DecodeMessage(msg) + m.TypeJob = &Job_PysparkJob{msg} + return true, err + case 6: // type_job.hive_job + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(HiveJob) + err := b.DecodeMessage(msg) + m.TypeJob = &Job_HiveJob{msg} + return true, err + case 7: // type_job.pig_job + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(PigJob) + err := b.DecodeMessage(msg) + m.TypeJob = &Job_PigJob{msg} + return true, err + case 12: // type_job.spark_sql_job + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SparkSqlJob) + err := b.DecodeMessage(msg) + m.TypeJob = &Job_SparkSqlJob{msg} + return true, err + default: + return false, nil + } +} + +func _Job_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Job) + // type_job + switch x := m.TypeJob.(type) { + case *Job_HadoopJob: + s := proto.Size(x.HadoopJob) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Job_SparkJob: + s := proto.Size(x.SparkJob) + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Job_PysparkJob: + s := proto.Size(x.PysparkJob) + n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Job_HiveJob: + s := proto.Size(x.HiveJob) + n += proto.SizeVarint(6<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Job_PigJob: + s := proto.Size(x.PigJob) + n += proto.SizeVarint(7<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Job_SparkSqlJob: + s := proto.Size(x.SparkSqlJob) + n += proto.SizeVarint(12<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// A request to submit a job. +type SubmitJobRequest struct { + // [Required] The ID of the Google Cloud Platform project that the job + // belongs to. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // [Required] The Cloud Dataproc region in which to handle the request. + Region string `protobuf:"bytes,3,opt,name=region" json:"region,omitempty"` + // [Required] The job resource. + Job *Job `protobuf:"bytes,2,opt,name=job" json:"job,omitempty"` +} + +func (m *SubmitJobRequest) Reset() { *m = SubmitJobRequest{} } +func (m *SubmitJobRequest) String() string { return proto.CompactTextString(m) } +func (*SubmitJobRequest) ProtoMessage() {} +func (*SubmitJobRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{12} } + +func (m *SubmitJobRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *SubmitJobRequest) GetRegion() string { + if m != nil { + return m.Region + } + return "" +} + +func (m *SubmitJobRequest) GetJob() *Job { + if m != nil { + return m.Job + } + return nil +} + +// A request to get the resource representation for a job in a project. +type GetJobRequest struct { + // [Required] The ID of the Google Cloud Platform project that the job + // belongs to. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // [Required] The Cloud Dataproc region in which to handle the request. + Region string `protobuf:"bytes,3,opt,name=region" json:"region,omitempty"` + // [Required] The job ID. + JobId string `protobuf:"bytes,2,opt,name=job_id,json=jobId" json:"job_id,omitempty"` +} + +func (m *GetJobRequest) Reset() { *m = GetJobRequest{} } +func (m *GetJobRequest) String() string { return proto.CompactTextString(m) } +func (*GetJobRequest) ProtoMessage() {} +func (*GetJobRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{13} } + +func (m *GetJobRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *GetJobRequest) GetRegion() string { + if m != nil { + return m.Region + } + return "" +} + +func (m *GetJobRequest) GetJobId() string { + if m != nil { + return m.JobId + } + return "" +} + +// A request to list jobs in a project. +type ListJobsRequest struct { + // [Required] The ID of the Google Cloud Platform project that the job + // belongs to. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // [Required] The Cloud Dataproc region in which to handle the request. + Region string `protobuf:"bytes,6,opt,name=region" json:"region,omitempty"` + // [Optional] The number of results to return in each response. + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // [Optional] The page token, returned by a previous call, to request the + // next page of results. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` + // [Optional] If set, the returned jobs list includes only jobs that were + // submitted to the named cluster. + ClusterName string `protobuf:"bytes,4,opt,name=cluster_name,json=clusterName" json:"cluster_name,omitempty"` + // [Optional] Specifies enumerated categories of jobs to list + // (default = match ALL jobs). + JobStateMatcher ListJobsRequest_JobStateMatcher `protobuf:"varint,5,opt,name=job_state_matcher,json=jobStateMatcher,enum=google.cloud.dataproc.v1.ListJobsRequest_JobStateMatcher" json:"job_state_matcher,omitempty"` +} + +func (m *ListJobsRequest) Reset() { *m = ListJobsRequest{} } +func (m *ListJobsRequest) String() string { return proto.CompactTextString(m) } +func (*ListJobsRequest) ProtoMessage() {} +func (*ListJobsRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{14} } + +func (m *ListJobsRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *ListJobsRequest) GetRegion() string { + if m != nil { + return m.Region + } + return "" +} + +func (m *ListJobsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListJobsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +func (m *ListJobsRequest) GetClusterName() string { + if m != nil { + return m.ClusterName + } + return "" +} + +func (m *ListJobsRequest) GetJobStateMatcher() ListJobsRequest_JobStateMatcher { + if m != nil { + return m.JobStateMatcher + } + return ListJobsRequest_ALL +} + +// A list of jobs in a project. +type ListJobsResponse struct { + // [Output-only] Jobs list. + Jobs []*Job `protobuf:"bytes,1,rep,name=jobs" json:"jobs,omitempty"` + // [Optional] This token is included in the response if there are more results + // to fetch. To fetch additional results, provide this value as the + // `page_token` in a subsequent ListJobsRequest. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListJobsResponse) Reset() { *m = ListJobsResponse{} } +func (m *ListJobsResponse) String() string { return proto.CompactTextString(m) } +func (*ListJobsResponse) ProtoMessage() {} +func (*ListJobsResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{15} } + +func (m *ListJobsResponse) GetJobs() []*Job { + if m != nil { + return m.Jobs + } + return nil +} + +func (m *ListJobsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// A request to cancel a job. +type CancelJobRequest struct { + // [Required] The ID of the Google Cloud Platform project that the job + // belongs to. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // [Required] The Cloud Dataproc region in which to handle the request. + Region string `protobuf:"bytes,3,opt,name=region" json:"region,omitempty"` + // [Required] The job ID. + JobId string `protobuf:"bytes,2,opt,name=job_id,json=jobId" json:"job_id,omitempty"` +} + +func (m *CancelJobRequest) Reset() { *m = CancelJobRequest{} } +func (m *CancelJobRequest) String() string { return proto.CompactTextString(m) } +func (*CancelJobRequest) ProtoMessage() {} +func (*CancelJobRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{16} } + +func (m *CancelJobRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *CancelJobRequest) GetRegion() string { + if m != nil { + return m.Region + } + return "" +} + +func (m *CancelJobRequest) GetJobId() string { + if m != nil { + return m.JobId + } + return "" +} + +// A request to delete a job. +type DeleteJobRequest struct { + // [Required] The ID of the Google Cloud Platform project that the job + // belongs to. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // [Required] The Cloud Dataproc region in which to handle the request. + Region string `protobuf:"bytes,3,opt,name=region" json:"region,omitempty"` + // [Required] The job ID. + JobId string `protobuf:"bytes,2,opt,name=job_id,json=jobId" json:"job_id,omitempty"` +} + +func (m *DeleteJobRequest) Reset() { *m = DeleteJobRequest{} } +func (m *DeleteJobRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteJobRequest) ProtoMessage() {} +func (*DeleteJobRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{17} } + +func (m *DeleteJobRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *DeleteJobRequest) GetRegion() string { + if m != nil { + return m.Region + } + return "" +} + +func (m *DeleteJobRequest) GetJobId() string { + if m != nil { + return m.JobId + } + return "" +} + +func init() { + proto.RegisterType((*LoggingConfig)(nil), "google.cloud.dataproc.v1.LoggingConfig") + proto.RegisterType((*HadoopJob)(nil), "google.cloud.dataproc.v1.HadoopJob") + proto.RegisterType((*SparkJob)(nil), "google.cloud.dataproc.v1.SparkJob") + proto.RegisterType((*PySparkJob)(nil), "google.cloud.dataproc.v1.PySparkJob") + proto.RegisterType((*QueryList)(nil), "google.cloud.dataproc.v1.QueryList") + proto.RegisterType((*HiveJob)(nil), "google.cloud.dataproc.v1.HiveJob") + proto.RegisterType((*SparkSqlJob)(nil), "google.cloud.dataproc.v1.SparkSqlJob") + proto.RegisterType((*PigJob)(nil), "google.cloud.dataproc.v1.PigJob") + proto.RegisterType((*JobPlacement)(nil), "google.cloud.dataproc.v1.JobPlacement") + proto.RegisterType((*JobStatus)(nil), "google.cloud.dataproc.v1.JobStatus") + proto.RegisterType((*JobReference)(nil), "google.cloud.dataproc.v1.JobReference") + proto.RegisterType((*Job)(nil), "google.cloud.dataproc.v1.Job") + proto.RegisterType((*SubmitJobRequest)(nil), "google.cloud.dataproc.v1.SubmitJobRequest") + proto.RegisterType((*GetJobRequest)(nil), "google.cloud.dataproc.v1.GetJobRequest") + proto.RegisterType((*ListJobsRequest)(nil), "google.cloud.dataproc.v1.ListJobsRequest") + proto.RegisterType((*ListJobsResponse)(nil), "google.cloud.dataproc.v1.ListJobsResponse") + proto.RegisterType((*CancelJobRequest)(nil), "google.cloud.dataproc.v1.CancelJobRequest") + proto.RegisterType((*DeleteJobRequest)(nil), "google.cloud.dataproc.v1.DeleteJobRequest") + proto.RegisterEnum("google.cloud.dataproc.v1.LoggingConfig_Level", LoggingConfig_Level_name, LoggingConfig_Level_value) + proto.RegisterEnum("google.cloud.dataproc.v1.JobStatus_State", JobStatus_State_name, JobStatus_State_value) + proto.RegisterEnum("google.cloud.dataproc.v1.ListJobsRequest_JobStateMatcher", ListJobsRequest_JobStateMatcher_name, ListJobsRequest_JobStateMatcher_value) +} + +// 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 + +// Client API for JobController service + +type JobControllerClient interface { + // Submits a job to a cluster. + SubmitJob(ctx context.Context, in *SubmitJobRequest, opts ...grpc.CallOption) (*Job, error) + // Gets the resource representation for a job in a project. + GetJob(ctx context.Context, in *GetJobRequest, opts ...grpc.CallOption) (*Job, error) + // Lists regions/{region}/jobs in a project. + ListJobs(ctx context.Context, in *ListJobsRequest, opts ...grpc.CallOption) (*ListJobsResponse, error) + // Starts a job cancellation request. To access the job resource + // after cancellation, call + // [regions/{region}/jobs.list](/dataproc/reference/rest/v1/projects.regions.jobs/list) or + // [regions/{region}/jobs.get](/dataproc/reference/rest/v1/projects.regions.jobs/get). + CancelJob(ctx context.Context, in *CancelJobRequest, opts ...grpc.CallOption) (*Job, error) + // Deletes the job from the project. If the job is active, the delete fails, + // and the response returns `FAILED_PRECONDITION`. + DeleteJob(ctx context.Context, in *DeleteJobRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) +} + +type jobControllerClient struct { + cc *grpc.ClientConn +} + +func NewJobControllerClient(cc *grpc.ClientConn) JobControllerClient { + return &jobControllerClient{cc} +} + +func (c *jobControllerClient) SubmitJob(ctx context.Context, in *SubmitJobRequest, opts ...grpc.CallOption) (*Job, error) { + out := new(Job) + err := grpc.Invoke(ctx, "/google.cloud.dataproc.v1.JobController/SubmitJob", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *jobControllerClient) GetJob(ctx context.Context, in *GetJobRequest, opts ...grpc.CallOption) (*Job, error) { + out := new(Job) + err := grpc.Invoke(ctx, "/google.cloud.dataproc.v1.JobController/GetJob", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *jobControllerClient) ListJobs(ctx context.Context, in *ListJobsRequest, opts ...grpc.CallOption) (*ListJobsResponse, error) { + out := new(ListJobsResponse) + err := grpc.Invoke(ctx, "/google.cloud.dataproc.v1.JobController/ListJobs", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *jobControllerClient) CancelJob(ctx context.Context, in *CancelJobRequest, opts ...grpc.CallOption) (*Job, error) { + out := new(Job) + err := grpc.Invoke(ctx, "/google.cloud.dataproc.v1.JobController/CancelJob", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *jobControllerClient) DeleteJob(ctx context.Context, in *DeleteJobRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) { + out := new(google_protobuf2.Empty) + err := grpc.Invoke(ctx, "/google.cloud.dataproc.v1.JobController/DeleteJob", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for JobController service + +type JobControllerServer interface { + // Submits a job to a cluster. + SubmitJob(context.Context, *SubmitJobRequest) (*Job, error) + // Gets the resource representation for a job in a project. + GetJob(context.Context, *GetJobRequest) (*Job, error) + // Lists regions/{region}/jobs in a project. + ListJobs(context.Context, *ListJobsRequest) (*ListJobsResponse, error) + // Starts a job cancellation request. To access the job resource + // after cancellation, call + // [regions/{region}/jobs.list](/dataproc/reference/rest/v1/projects.regions.jobs/list) or + // [regions/{region}/jobs.get](/dataproc/reference/rest/v1/projects.regions.jobs/get). + CancelJob(context.Context, *CancelJobRequest) (*Job, error) + // Deletes the job from the project. If the job is active, the delete fails, + // and the response returns `FAILED_PRECONDITION`. + DeleteJob(context.Context, *DeleteJobRequest) (*google_protobuf2.Empty, error) +} + +func RegisterJobControllerServer(s *grpc.Server, srv JobControllerServer) { + s.RegisterService(&_JobController_serviceDesc, srv) +} + +func _JobController_SubmitJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SubmitJobRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(JobControllerServer).SubmitJob(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.dataproc.v1.JobController/SubmitJob", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(JobControllerServer).SubmitJob(ctx, req.(*SubmitJobRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _JobController_GetJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetJobRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(JobControllerServer).GetJob(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.dataproc.v1.JobController/GetJob", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(JobControllerServer).GetJob(ctx, req.(*GetJobRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _JobController_ListJobs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListJobsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(JobControllerServer).ListJobs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.dataproc.v1.JobController/ListJobs", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(JobControllerServer).ListJobs(ctx, req.(*ListJobsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _JobController_CancelJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CancelJobRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(JobControllerServer).CancelJob(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.dataproc.v1.JobController/CancelJob", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(JobControllerServer).CancelJob(ctx, req.(*CancelJobRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _JobController_DeleteJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteJobRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(JobControllerServer).DeleteJob(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.dataproc.v1.JobController/DeleteJob", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(JobControllerServer).DeleteJob(ctx, req.(*DeleteJobRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _JobController_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.cloud.dataproc.v1.JobController", + HandlerType: (*JobControllerServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SubmitJob", + Handler: _JobController_SubmitJob_Handler, + }, + { + MethodName: "GetJob", + Handler: _JobController_GetJob_Handler, + }, + { + MethodName: "ListJobs", + Handler: _JobController_ListJobs_Handler, + }, + { + MethodName: "CancelJob", + Handler: _JobController_CancelJob_Handler, + }, + { + MethodName: "DeleteJob", + Handler: _JobController_DeleteJob_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/cloud/dataproc/v1/jobs.proto", +} + +func init() { proto.RegisterFile("google/cloud/dataproc/v1/jobs.proto", fileDescriptor1) } + +var fileDescriptor1 = []byte{ + // 1862 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00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0b, 0x7d, 0x6c, 0xf1, 0x9c, 0x0a, 0x42, 0xa5, 0xdb, 0x06, 0x5d, 0xfc, 0x9f, + 0xcf, 0x61, 0x30, 0xee, 0xc4, 0xb9, 0xf1, 0x07, 0xff, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xaf, 0x59, + 0x9b, 0xa1, 0x1f, 0x1a, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/dataproc/v1/operations.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/dataproc/v1/operations.pb.go new file mode 100644 index 0000000000..a66e72ad33 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/dataproc/v1/operations.pb.go @@ -0,0 +1,201 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/dataproc/v1/operations.proto + +package dataproc + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import _ "google.golang.org/genproto/googleapis/longrunning" +import _ "github.com/golang/protobuf/ptypes/empty" +import google_protobuf3 "github.com/golang/protobuf/ptypes/timestamp" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// The operation state. +type ClusterOperationStatus_State int32 + +const ( + // Unused. + ClusterOperationStatus_UNKNOWN ClusterOperationStatus_State = 0 + // The operation has been created. + ClusterOperationStatus_PENDING ClusterOperationStatus_State = 1 + // The operation is running. + ClusterOperationStatus_RUNNING ClusterOperationStatus_State = 2 + // The operation is done; either cancelled or completed. + ClusterOperationStatus_DONE ClusterOperationStatus_State = 3 +) + +var ClusterOperationStatus_State_name = map[int32]string{ + 0: "UNKNOWN", + 1: "PENDING", + 2: "RUNNING", + 3: "DONE", +} +var ClusterOperationStatus_State_value = map[string]int32{ + "UNKNOWN": 0, + "PENDING": 1, + "RUNNING": 2, + "DONE": 3, +} + +func (x ClusterOperationStatus_State) String() string { + return proto.EnumName(ClusterOperationStatus_State_name, int32(x)) +} +func (ClusterOperationStatus_State) EnumDescriptor() ([]byte, []int) { + return fileDescriptor2, []int{0, 0} +} + +// The status of the operation. +type ClusterOperationStatus struct { + // [Output-only] A message containing the operation state. + State ClusterOperationStatus_State `protobuf:"varint,1,opt,name=state,enum=google.cloud.dataproc.v1.ClusterOperationStatus_State" json:"state,omitempty"` + // [Output-only] A message containing the detailed operation state. + InnerState string `protobuf:"bytes,2,opt,name=inner_state,json=innerState" json:"inner_state,omitempty"` + // [Output-only]A message containing any operation metadata details. + Details string `protobuf:"bytes,3,opt,name=details" json:"details,omitempty"` + // [Output-only] The time this state was entered. + StateStartTime *google_protobuf3.Timestamp `protobuf:"bytes,4,opt,name=state_start_time,json=stateStartTime" json:"state_start_time,omitempty"` +} + +func (m *ClusterOperationStatus) Reset() { *m = ClusterOperationStatus{} } +func (m *ClusterOperationStatus) String() string { return proto.CompactTextString(m) } +func (*ClusterOperationStatus) ProtoMessage() {} +func (*ClusterOperationStatus) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} } + +func (m *ClusterOperationStatus) GetState() ClusterOperationStatus_State { + if m != nil { + return m.State + } + return ClusterOperationStatus_UNKNOWN +} + +func (m *ClusterOperationStatus) GetInnerState() string { + if m != nil { + return m.InnerState + } + return "" +} + +func (m *ClusterOperationStatus) GetDetails() string { + if m != nil { + return m.Details + } + return "" +} + +func (m *ClusterOperationStatus) GetStateStartTime() *google_protobuf3.Timestamp { + if m != nil { + return m.StateStartTime + } + return nil +} + +// Metadata describing the operation. +type ClusterOperationMetadata struct { + // [Output-only] Name of the cluster for the operation. + ClusterName string `protobuf:"bytes,7,opt,name=cluster_name,json=clusterName" json:"cluster_name,omitempty"` + // [Output-only] Cluster UUID for the operation. + ClusterUuid string `protobuf:"bytes,8,opt,name=cluster_uuid,json=clusterUuid" json:"cluster_uuid,omitempty"` + // [Output-only] Current operation status. + Status *ClusterOperationStatus `protobuf:"bytes,9,opt,name=status" json:"status,omitempty"` + // [Output-only] The previous operation status. + StatusHistory []*ClusterOperationStatus `protobuf:"bytes,10,rep,name=status_history,json=statusHistory" json:"status_history,omitempty"` + // [Output-only] The operation type. + OperationType string `protobuf:"bytes,11,opt,name=operation_type,json=operationType" json:"operation_type,omitempty"` + // [Output-only] Short description of operation. + Description string `protobuf:"bytes,12,opt,name=description" json:"description,omitempty"` +} + +func (m *ClusterOperationMetadata) Reset() { *m = ClusterOperationMetadata{} } +func (m *ClusterOperationMetadata) String() string { return proto.CompactTextString(m) } +func (*ClusterOperationMetadata) ProtoMessage() {} +func (*ClusterOperationMetadata) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{1} } + +func (m *ClusterOperationMetadata) GetClusterName() string { + if m != nil { + return m.ClusterName + } + return "" +} + +func (m *ClusterOperationMetadata) GetClusterUuid() string { + if m != nil { + return m.ClusterUuid + } + return "" +} + +func (m *ClusterOperationMetadata) GetStatus() *ClusterOperationStatus { + if m != nil { + return m.Status + } + return nil +} + +func (m *ClusterOperationMetadata) GetStatusHistory() []*ClusterOperationStatus { + if m != nil { + return m.StatusHistory + } + return nil +} + +func (m *ClusterOperationMetadata) GetOperationType() string { + if m != nil { + return m.OperationType + } + return "" +} + +func (m *ClusterOperationMetadata) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func init() { + proto.RegisterType((*ClusterOperationStatus)(nil), "google.cloud.dataproc.v1.ClusterOperationStatus") + proto.RegisterType((*ClusterOperationMetadata)(nil), "google.cloud.dataproc.v1.ClusterOperationMetadata") + proto.RegisterEnum("google.cloud.dataproc.v1.ClusterOperationStatus_State", ClusterOperationStatus_State_name, ClusterOperationStatus_State_value) +} + +func init() { proto.RegisterFile("google/cloud/dataproc/v1/operations.proto", fileDescriptor2) } + +var fileDescriptor2 = []byte{ + // 479 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x53, 0x4f, 0x6f, 0xd3, 0x30, + 0x14, 0x27, 0xed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 0x03, 0x5f, 0x80, 0xe1, 0xfa, 0xdb, 0xcb, 0xcc, 0x4a, 0x52, 0x14, 0xba, 0x1c, 0x47, 0xeb, 0xee, + 0xf5, 0x4a, 0x52, 0x18, 0x81, 0xb0, 0xa0, 0x3a, 0x57, 0x4c, 0xda, 0x16, 0x3a, 0xf4, 0x59, 0x37, + 0x5a, 0xe7, 0x1a, 0x1c, 0xe7, 0xa2, 0xde, 0x3a, 0xce, 0xf9, 0xe3, 0xf5, 0x20, 0x7a, 0x61, 0xaf, + 0x75, 0x11, 0x7c, 0x7b, 0xdf, 0x92, 0x4b, 0x51, 0x11, 0x5e, 0xc6, 0x42, 0x95, 0x49, 0x49, 0xb9, + 0xbb, 0xf4, 0xc4, 0x43, 0x44, 0x32, 0xfd, 0xf0, 0x57, 0x7c, 0xd7, 0x9d, 0x6f, 0xf7, 0x1c, 0xf9, + 0xf5, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2c, 0x8c, 0x74, 0x3e, 0xb6, 0x03, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/functions/v1beta2/functions.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/functions/v1beta2/functions.pb.go new file mode 100644 index 0000000000..53a9f562fc --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/functions/v1beta2/functions.pb.go @@ -0,0 +1,1203 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/functions/v1beta2/functions.proto + +/* +Package functions is a generated protocol buffer package. + +It is generated from these files: + google/cloud/functions/v1beta2/functions.proto + google/cloud/functions/v1beta2/operations.proto + +It has these top-level messages: + CloudFunction + HTTPSTrigger + EventTrigger + SourceRepository + CreateFunctionRequest + UpdateFunctionRequest + GetFunctionRequest + ListFunctionsRequest + ListFunctionsResponse + DeleteFunctionRequest + CallFunctionRequest + CallFunctionResponse + OperationMetadataV1Beta2 +*/ +package functions + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import _ "google.golang.org/genproto/googleapis/api/serviceconfig" +import google_longrunning "google.golang.org/genproto/googleapis/longrunning" +import google_protobuf3 "github.com/golang/protobuf/ptypes/duration" +import google_protobuf4 "github.com/golang/protobuf/ptypes/timestamp" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Describes the current stage of a deployment. +type CloudFunctionStatus int32 + +const ( + // Status not specified. + CloudFunctionStatus_STATUS_UNSPECIFIED CloudFunctionStatus = 0 + // Successfully deployed. + CloudFunctionStatus_READY CloudFunctionStatus = 1 + // Not deployed correctly - behavior is undefined. The item should be updated + // or deleted to move it out of this state. + CloudFunctionStatus_FAILED CloudFunctionStatus = 2 + // Creation or update in progress. + CloudFunctionStatus_DEPLOYING CloudFunctionStatus = 3 + // Deletion in progress. + CloudFunctionStatus_DELETING CloudFunctionStatus = 4 +) + +var CloudFunctionStatus_name = map[int32]string{ + 0: "STATUS_UNSPECIFIED", + 1: "READY", + 2: "FAILED", + 3: "DEPLOYING", + 4: "DELETING", +} +var CloudFunctionStatus_value = map[string]int32{ + "STATUS_UNSPECIFIED": 0, + "READY": 1, + "FAILED": 2, + "DEPLOYING": 3, + "DELETING": 4, +} + +func (x CloudFunctionStatus) String() string { + return proto.EnumName(CloudFunctionStatus_name, int32(x)) +} +func (CloudFunctionStatus) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +// Describes a Cloud Function that contains user computation executed in +// response to an event. It encapsulate function and triggers configurations. +type CloudFunction struct { + // A user-defined name of the function. Function names must be unique + // globally and match pattern `projects/*/locations/*/functions/*` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The location of the function source code. + // + // Types that are valid to be assigned to SourceCode: + // *CloudFunction_SourceArchiveUrl + // *CloudFunction_SourceRepository + SourceCode isCloudFunction_SourceCode `protobuf_oneof:"source_code"` + // An event that triggers the function. + // + // Types that are valid to be assigned to Trigger: + // *CloudFunction_HttpsTrigger + // *CloudFunction_EventTrigger + Trigger isCloudFunction_Trigger `protobuf_oneof:"trigger"` + // Output only. Status of the function deployment. + Status CloudFunctionStatus `protobuf:"varint,7,opt,name=status,enum=google.cloud.functions.v1beta2.CloudFunctionStatus" json:"status,omitempty"` + // Output only. Name of the most recent operation modifying the function. If + // the function status is `DEPLOYING` or `DELETING`, then it points to the + // active operation. + LatestOperation string `protobuf:"bytes,8,opt,name=latest_operation,json=latestOperation" json:"latest_operation,omitempty"` + // The name of the function (as defined in source code) that will be + // executed. Defaults to the resource name suffix, if not specified. For + // backward compatibility, if function with given name is not found, then the + // system will try to use function named "function". + // For Node.js this is name of a function exported by the module specified + // in `source_location`. + EntryPoint string `protobuf:"bytes,9,opt,name=entry_point,json=entryPoint" json:"entry_point,omitempty"` + // The function execution timeout. Execution is considered failed and + // can be terminated if the function is not completed at the end of the + // timeout period. Defaults to 60 seconds. + Timeout *google_protobuf3.Duration `protobuf:"bytes,10,opt,name=timeout" json:"timeout,omitempty"` + // The amount of memory in MB available for a function. + // Defaults to 256MB. + AvailableMemoryMb int32 `protobuf:"varint,11,opt,name=available_memory_mb,json=availableMemoryMb" json:"available_memory_mb,omitempty"` + // Output only. The service account of the function. + ServiceAccount string `protobuf:"bytes,13,opt,name=service_account,json=serviceAccount" json:"service_account,omitempty"` + // Output only. The last update timestamp of a Cloud Function. + UpdateTime *google_protobuf4.Timestamp `protobuf:"bytes,15,opt,name=update_time,json=updateTime" json:"update_time,omitempty"` +} + +func (m *CloudFunction) Reset() { *m = CloudFunction{} } +func (m *CloudFunction) String() string { return proto.CompactTextString(m) } +func (*CloudFunction) ProtoMessage() {} +func (*CloudFunction) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +type isCloudFunction_SourceCode interface { + isCloudFunction_SourceCode() +} +type isCloudFunction_Trigger interface { + isCloudFunction_Trigger() +} + +type CloudFunction_SourceArchiveUrl struct { + SourceArchiveUrl string `protobuf:"bytes,14,opt,name=source_archive_url,json=sourceArchiveUrl,oneof"` +} +type CloudFunction_SourceRepository struct { + SourceRepository *SourceRepository `protobuf:"bytes,3,opt,name=source_repository,json=sourceRepository,oneof"` +} +type CloudFunction_HttpsTrigger struct { + HttpsTrigger *HTTPSTrigger `protobuf:"bytes,6,opt,name=https_trigger,json=httpsTrigger,oneof"` +} +type CloudFunction_EventTrigger struct { + EventTrigger *EventTrigger `protobuf:"bytes,12,opt,name=event_trigger,json=eventTrigger,oneof"` +} + +func (*CloudFunction_SourceArchiveUrl) isCloudFunction_SourceCode() {} +func (*CloudFunction_SourceRepository) isCloudFunction_SourceCode() {} +func (*CloudFunction_HttpsTrigger) isCloudFunction_Trigger() {} +func (*CloudFunction_EventTrigger) isCloudFunction_Trigger() {} + +func (m *CloudFunction) GetSourceCode() isCloudFunction_SourceCode { + if m != nil { + return m.SourceCode + } + return nil +} +func (m *CloudFunction) GetTrigger() isCloudFunction_Trigger { + if m != nil { + return m.Trigger + } + return nil +} + +func (m *CloudFunction) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *CloudFunction) GetSourceArchiveUrl() string { + if x, ok := m.GetSourceCode().(*CloudFunction_SourceArchiveUrl); ok { + return x.SourceArchiveUrl + } + return "" +} + +func (m *CloudFunction) GetSourceRepository() *SourceRepository { + if x, ok := m.GetSourceCode().(*CloudFunction_SourceRepository); ok { + return x.SourceRepository + } + return nil +} + +func (m *CloudFunction) GetHttpsTrigger() *HTTPSTrigger { + if x, ok := m.GetTrigger().(*CloudFunction_HttpsTrigger); ok { + return x.HttpsTrigger + } + return nil +} + +func (m *CloudFunction) GetEventTrigger() *EventTrigger { + if x, ok := m.GetTrigger().(*CloudFunction_EventTrigger); ok { + return x.EventTrigger + } + return nil +} + +func (m *CloudFunction) GetStatus() CloudFunctionStatus { + if m != nil { + return m.Status + } + return CloudFunctionStatus_STATUS_UNSPECIFIED +} + +func (m *CloudFunction) GetLatestOperation() string { + if m != nil { + return m.LatestOperation + } + return "" +} + +func (m *CloudFunction) GetEntryPoint() string { + if m != nil { + return m.EntryPoint + } + return "" +} + +func (m *CloudFunction) GetTimeout() *google_protobuf3.Duration { + if m != nil { + return m.Timeout + } + return nil +} + +func (m *CloudFunction) GetAvailableMemoryMb() int32 { + if m != nil { + return m.AvailableMemoryMb + } + return 0 +} + +func (m *CloudFunction) GetServiceAccount() string { + if m != nil { + return m.ServiceAccount + } + return "" +} + +func (m *CloudFunction) GetUpdateTime() *google_protobuf4.Timestamp { + if m != nil { + return m.UpdateTime + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*CloudFunction) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _CloudFunction_OneofMarshaler, _CloudFunction_OneofUnmarshaler, _CloudFunction_OneofSizer, []interface{}{ + (*CloudFunction_SourceArchiveUrl)(nil), + (*CloudFunction_SourceRepository)(nil), + (*CloudFunction_HttpsTrigger)(nil), + (*CloudFunction_EventTrigger)(nil), + } +} + +func _CloudFunction_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*CloudFunction) + // source_code + switch x := m.SourceCode.(type) { + case *CloudFunction_SourceArchiveUrl: + b.EncodeVarint(14<<3 | proto.WireBytes) + b.EncodeStringBytes(x.SourceArchiveUrl) + case *CloudFunction_SourceRepository: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.SourceRepository); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("CloudFunction.SourceCode has unexpected type %T", x) + } + // trigger + switch x := m.Trigger.(type) { + case *CloudFunction_HttpsTrigger: + b.EncodeVarint(6<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.HttpsTrigger); err != nil { + return err + } + case *CloudFunction_EventTrigger: + b.EncodeVarint(12<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.EventTrigger); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("CloudFunction.Trigger has unexpected type %T", x) + } + return nil +} + +func _CloudFunction_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*CloudFunction) + switch tag { + case 14: // source_code.source_archive_url + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.SourceCode = &CloudFunction_SourceArchiveUrl{x} + return true, err + case 3: // source_code.source_repository + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SourceRepository) + err := b.DecodeMessage(msg) + m.SourceCode = &CloudFunction_SourceRepository{msg} + return true, err + case 6: // trigger.https_trigger + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(HTTPSTrigger) + err := b.DecodeMessage(msg) + m.Trigger = &CloudFunction_HttpsTrigger{msg} + return true, err + case 12: // trigger.event_trigger + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(EventTrigger) + err := b.DecodeMessage(msg) + m.Trigger = &CloudFunction_EventTrigger{msg} + return true, err + default: + return false, nil + } +} + +func _CloudFunction_OneofSizer(msg proto.Message) (n int) { + m := msg.(*CloudFunction) + // source_code + switch x := m.SourceCode.(type) { + case *CloudFunction_SourceArchiveUrl: + n += proto.SizeVarint(14<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.SourceArchiveUrl))) + n += len(x.SourceArchiveUrl) + case *CloudFunction_SourceRepository: + s := proto.Size(x.SourceRepository) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + // trigger + switch x := m.Trigger.(type) { + case *CloudFunction_HttpsTrigger: + s := proto.Size(x.HttpsTrigger) + n += proto.SizeVarint(6<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *CloudFunction_EventTrigger: + s := proto.Size(x.EventTrigger) + n += proto.SizeVarint(12<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Describes HTTPSTrigger, could be used to connect web hooks to function. +type HTTPSTrigger struct { + // Output only. The deployed url for the function. + Url string `protobuf:"bytes,1,opt,name=url" json:"url,omitempty"` +} + +func (m *HTTPSTrigger) Reset() { *m = HTTPSTrigger{} } +func (m *HTTPSTrigger) String() string { return proto.CompactTextString(m) } +func (*HTTPSTrigger) ProtoMessage() {} +func (*HTTPSTrigger) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *HTTPSTrigger) GetUrl() string { + if m != nil { + return m.Url + } + return "" +} + +// Describes EventTrigger, used to request events be sent from another +// service. +type EventTrigger struct { + // `event_type` names contain the service that is sending an event and the + // kind of event that was fired. Must be of the form + // `providers/*/eventTypes/*` e.g. Directly handle a Message published to + // Google Cloud Pub/Sub `providers/cloud.pubsub/eventTypes/topic.publish` + // + // Handle an object changing in Google Cloud Storage + // `providers/cloud.storage/eventTypes/object.change` + // + // Handle a write to the Firebase Realtime Database + // `providers/firebase.database/eventTypes/data.write` + EventType string `protobuf:"bytes,1,opt,name=event_type,json=eventType" json:"event_type,omitempty"` + // Which instance of the source's service should send events. E.g. for Pub/Sub + // this would be a Pub/Sub topic at `projects/*/topics/*`. For Google Cloud + // Storage this would be a bucket at `projects/*/buckets/*`. For any source + // that only supports one instance per-project, this should be the name of the + // project (`projects/*`) + Resource string `protobuf:"bytes,2,opt,name=resource" json:"resource,omitempty"` +} + +func (m *EventTrigger) Reset() { *m = EventTrigger{} } +func (m *EventTrigger) String() string { return proto.CompactTextString(m) } +func (*EventTrigger) ProtoMessage() {} +func (*EventTrigger) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *EventTrigger) GetEventType() string { + if m != nil { + return m.EventType + } + return "" +} + +func (m *EventTrigger) GetResource() string { + if m != nil { + return m.Resource + } + return "" +} + +// Describes the location of the function source in a remote repository. +type SourceRepository struct { + // URL to the hosted repository where the function is defined. Only paths in + // https://source.developers.google.com domain are supported. The path should + // contain the name of the repository. + RepositoryUrl string `protobuf:"bytes,1,opt,name=repository_url,json=repositoryUrl" json:"repository_url,omitempty"` + // The path within the repository where the function is defined. The path + // should point to the directory where Cloud Functions files are located. Use + // "/" if the function is defined directly in the root directory of a + // repository. + SourcePath string `protobuf:"bytes,2,opt,name=source_path,json=sourcePath" json:"source_path,omitempty"` + // The version of a function. Defaults to the latest version of the master + // branch. + // + // Types that are valid to be assigned to Version: + // *SourceRepository_Branch + // *SourceRepository_Tag + // *SourceRepository_Revision + Version isSourceRepository_Version `protobuf_oneof:"version"` + // Output only. The id of the revision that was resolved at the moment of + // function creation or update. For example when a user deployed from a + // branch, it will be the revision id of the latest change on this branch at + // that time. If user deployed from revision then this value will be always + // equal to the revision specified by the user. + DeployedRevision string `protobuf:"bytes,6,opt,name=deployed_revision,json=deployedRevision" json:"deployed_revision,omitempty"` +} + +func (m *SourceRepository) Reset() { *m = SourceRepository{} } +func (m *SourceRepository) String() string { return proto.CompactTextString(m) } +func (*SourceRepository) ProtoMessage() {} +func (*SourceRepository) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +type isSourceRepository_Version interface { + isSourceRepository_Version() +} + +type SourceRepository_Branch struct { + Branch string `protobuf:"bytes,3,opt,name=branch,oneof"` +} +type SourceRepository_Tag struct { + Tag string `protobuf:"bytes,4,opt,name=tag,oneof"` +} +type SourceRepository_Revision struct { + Revision string `protobuf:"bytes,5,opt,name=revision,oneof"` +} + +func (*SourceRepository_Branch) isSourceRepository_Version() {} +func (*SourceRepository_Tag) isSourceRepository_Version() {} +func (*SourceRepository_Revision) isSourceRepository_Version() {} + +func (m *SourceRepository) GetVersion() isSourceRepository_Version { + if m != nil { + return m.Version + } + return nil +} + +func (m *SourceRepository) GetRepositoryUrl() string { + if m != nil { + return m.RepositoryUrl + } + return "" +} + +func (m *SourceRepository) GetSourcePath() string { + if m != nil { + return m.SourcePath + } + return "" +} + +func (m *SourceRepository) GetBranch() string { + if x, ok := m.GetVersion().(*SourceRepository_Branch); ok { + return x.Branch + } + return "" +} + +func (m *SourceRepository) GetTag() string { + if x, ok := m.GetVersion().(*SourceRepository_Tag); ok { + return x.Tag + } + return "" +} + +func (m *SourceRepository) GetRevision() string { + if x, ok := m.GetVersion().(*SourceRepository_Revision); ok { + return x.Revision + } + return "" +} + +func (m *SourceRepository) GetDeployedRevision() string { + if m != nil { + return m.DeployedRevision + } + return "" +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*SourceRepository) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _SourceRepository_OneofMarshaler, _SourceRepository_OneofUnmarshaler, _SourceRepository_OneofSizer, []interface{}{ + (*SourceRepository_Branch)(nil), + (*SourceRepository_Tag)(nil), + (*SourceRepository_Revision)(nil), + } +} + +func _SourceRepository_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*SourceRepository) + // version + switch x := m.Version.(type) { + case *SourceRepository_Branch: + b.EncodeVarint(3<<3 | proto.WireBytes) + b.EncodeStringBytes(x.Branch) + case *SourceRepository_Tag: + b.EncodeVarint(4<<3 | proto.WireBytes) + b.EncodeStringBytes(x.Tag) + case *SourceRepository_Revision: + b.EncodeVarint(5<<3 | proto.WireBytes) + b.EncodeStringBytes(x.Revision) + case nil: + default: + return fmt.Errorf("SourceRepository.Version has unexpected type %T", x) + } + return nil +} + +func _SourceRepository_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*SourceRepository) + switch tag { + case 3: // version.branch + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Version = &SourceRepository_Branch{x} + return true, err + case 4: // version.tag + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Version = &SourceRepository_Tag{x} + return true, err + case 5: // version.revision + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Version = &SourceRepository_Revision{x} + return true, err + default: + return false, nil + } +} + +func _SourceRepository_OneofSizer(msg proto.Message) (n int) { + m := msg.(*SourceRepository) + // version + switch x := m.Version.(type) { + case *SourceRepository_Branch: + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Branch))) + n += len(x.Branch) + case *SourceRepository_Tag: + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Tag))) + n += len(x.Tag) + case *SourceRepository_Revision: + n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Revision))) + n += len(x.Revision) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Request for the `CreateFunction` method. +type CreateFunctionRequest struct { + // The project and location in which the function should be created, specified + // in the format `projects/*/locations/*` + Location string `protobuf:"bytes,1,opt,name=location" json:"location,omitempty"` + // Function to be created. + Function *CloudFunction `protobuf:"bytes,2,opt,name=function" json:"function,omitempty"` +} + +func (m *CreateFunctionRequest) Reset() { *m = CreateFunctionRequest{} } +func (m *CreateFunctionRequest) String() string { return proto.CompactTextString(m) } +func (*CreateFunctionRequest) ProtoMessage() {} +func (*CreateFunctionRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *CreateFunctionRequest) GetLocation() string { + if m != nil { + return m.Location + } + return "" +} + +func (m *CreateFunctionRequest) GetFunction() *CloudFunction { + if m != nil { + return m.Function + } + return nil +} + +// Request for the `UpdateFunction` method. +type UpdateFunctionRequest struct { + // The name of the function to be updated. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // New version of the function. + Function *CloudFunction `protobuf:"bytes,2,opt,name=function" json:"function,omitempty"` +} + +func (m *UpdateFunctionRequest) Reset() { *m = UpdateFunctionRequest{} } +func (m *UpdateFunctionRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateFunctionRequest) ProtoMessage() {} +func (*UpdateFunctionRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *UpdateFunctionRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *UpdateFunctionRequest) GetFunction() *CloudFunction { + if m != nil { + return m.Function + } + return nil +} + +// Request for the `GetFunction` method. +type GetFunctionRequest struct { + // The name of the function which details should be obtained. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetFunctionRequest) Reset() { *m = GetFunctionRequest{} } +func (m *GetFunctionRequest) String() string { return proto.CompactTextString(m) } +func (*GetFunctionRequest) ProtoMessage() {} +func (*GetFunctionRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *GetFunctionRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Request for the `ListFunctions` method. +type ListFunctionsRequest struct { + // The project and location from which the function should be listed, + // specified in the format `projects/*/locations/*` + // If you want to list functions in all locations, use "-" in place of a + // location. + Location string `protobuf:"bytes,1,opt,name=location" json:"location,omitempty"` + // Maximum number of functions to return per call. + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // The value returned by the last + // `ListFunctionsResponse`; indicates that + // this is a continuation of a prior `ListFunctions` call, and that the + // system should return the next page of data. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListFunctionsRequest) Reset() { *m = ListFunctionsRequest{} } +func (m *ListFunctionsRequest) String() string { return proto.CompactTextString(m) } +func (*ListFunctionsRequest) ProtoMessage() {} +func (*ListFunctionsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *ListFunctionsRequest) GetLocation() string { + if m != nil { + return m.Location + } + return "" +} + +func (m *ListFunctionsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListFunctionsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// Response for the `ListFunctions` method. +type ListFunctionsResponse struct { + // The functions that match the request. + Functions []*CloudFunction `protobuf:"bytes,1,rep,name=functions" json:"functions,omitempty"` + // If not empty, indicates that there may be more functions that match + // the request; this value should be passed in a new + // [google.cloud.functions.v1beta2.ListFunctionsRequest][] + // to get more functions. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListFunctionsResponse) Reset() { *m = ListFunctionsResponse{} } +func (m *ListFunctionsResponse) String() string { return proto.CompactTextString(m) } +func (*ListFunctionsResponse) ProtoMessage() {} +func (*ListFunctionsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *ListFunctionsResponse) GetFunctions() []*CloudFunction { + if m != nil { + return m.Functions + } + return nil +} + +func (m *ListFunctionsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// Request for the `DeleteFunction` method. +type DeleteFunctionRequest struct { + // The name of the function which should be deleted. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *DeleteFunctionRequest) Reset() { *m = DeleteFunctionRequest{} } +func (m *DeleteFunctionRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteFunctionRequest) ProtoMessage() {} +func (*DeleteFunctionRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *DeleteFunctionRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Request for the `CallFunction` method. +type CallFunctionRequest struct { + // The name of the function to be called. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Input to be passed to the function. + Data string `protobuf:"bytes,2,opt,name=data" json:"data,omitempty"` +} + +func (m *CallFunctionRequest) Reset() { *m = CallFunctionRequest{} } +func (m *CallFunctionRequest) String() string { return proto.CompactTextString(m) } +func (*CallFunctionRequest) ProtoMessage() {} +func (*CallFunctionRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *CallFunctionRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *CallFunctionRequest) GetData() string { + if m != nil { + return m.Data + } + return "" +} + +// Response of `CallFunction` method. +type CallFunctionResponse struct { + // Execution id of function invocation. + ExecutionId string `protobuf:"bytes,1,opt,name=execution_id,json=executionId" json:"execution_id,omitempty"` + // Result populated for successful execution of synchronous function. Will + // not be populated if function does not return a result through context. + Result string `protobuf:"bytes,2,opt,name=result" json:"result,omitempty"` + // Either system or user-function generated error. Set if execution + // was not successful. + Error string `protobuf:"bytes,3,opt,name=error" json:"error,omitempty"` +} + +func (m *CallFunctionResponse) Reset() { *m = CallFunctionResponse{} } +func (m *CallFunctionResponse) String() string { return proto.CompactTextString(m) } +func (*CallFunctionResponse) ProtoMessage() {} +func (*CallFunctionResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } + +func (m *CallFunctionResponse) GetExecutionId() string { + if m != nil { + return m.ExecutionId + } + return "" +} + +func (m *CallFunctionResponse) GetResult() string { + if m != nil { + return m.Result + } + return "" +} + +func (m *CallFunctionResponse) GetError() string { + if m != nil { + return m.Error + } + return "" +} + +func init() { + proto.RegisterType((*CloudFunction)(nil), "google.cloud.functions.v1beta2.CloudFunction") + proto.RegisterType((*HTTPSTrigger)(nil), "google.cloud.functions.v1beta2.HTTPSTrigger") + proto.RegisterType((*EventTrigger)(nil), "google.cloud.functions.v1beta2.EventTrigger") + proto.RegisterType((*SourceRepository)(nil), "google.cloud.functions.v1beta2.SourceRepository") + proto.RegisterType((*CreateFunctionRequest)(nil), "google.cloud.functions.v1beta2.CreateFunctionRequest") + proto.RegisterType((*UpdateFunctionRequest)(nil), "google.cloud.functions.v1beta2.UpdateFunctionRequest") + proto.RegisterType((*GetFunctionRequest)(nil), "google.cloud.functions.v1beta2.GetFunctionRequest") + proto.RegisterType((*ListFunctionsRequest)(nil), "google.cloud.functions.v1beta2.ListFunctionsRequest") + proto.RegisterType((*ListFunctionsResponse)(nil), "google.cloud.functions.v1beta2.ListFunctionsResponse") + proto.RegisterType((*DeleteFunctionRequest)(nil), "google.cloud.functions.v1beta2.DeleteFunctionRequest") + proto.RegisterType((*CallFunctionRequest)(nil), "google.cloud.functions.v1beta2.CallFunctionRequest") + proto.RegisterType((*CallFunctionResponse)(nil), "google.cloud.functions.v1beta2.CallFunctionResponse") + proto.RegisterEnum("google.cloud.functions.v1beta2.CloudFunctionStatus", CloudFunctionStatus_name, CloudFunctionStatus_value) +} + +// 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 + +// Client API for CloudFunctionsService service + +type CloudFunctionsServiceClient interface { + // Returns a list of functions that belong to the requested project. + ListFunctions(ctx context.Context, in *ListFunctionsRequest, opts ...grpc.CallOption) (*ListFunctionsResponse, error) + // Returns a function with the given name from the requested project. + GetFunction(ctx context.Context, in *GetFunctionRequest, opts ...grpc.CallOption) (*CloudFunction, error) + // Creates a new function. If a function with the given name already exists in + // the specified project, the long running operation will return + // `ALREADY_EXISTS` error. + CreateFunction(ctx context.Context, in *CreateFunctionRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Updates existing function. + UpdateFunction(ctx context.Context, in *UpdateFunctionRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Deletes a function with the given name from the specified project. If the + // given function is used by some trigger, the trigger will be updated to + // remove this function. + DeleteFunction(ctx context.Context, in *DeleteFunctionRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Invokes synchronously deployed function. To be used for testing, very + // limited traffic allowed. + CallFunction(ctx context.Context, in *CallFunctionRequest, opts ...grpc.CallOption) (*CallFunctionResponse, error) +} + +type cloudFunctionsServiceClient struct { + cc *grpc.ClientConn +} + +func NewCloudFunctionsServiceClient(cc *grpc.ClientConn) CloudFunctionsServiceClient { + return &cloudFunctionsServiceClient{cc} +} + +func (c *cloudFunctionsServiceClient) ListFunctions(ctx context.Context, in *ListFunctionsRequest, opts ...grpc.CallOption) (*ListFunctionsResponse, error) { + out := new(ListFunctionsResponse) + err := grpc.Invoke(ctx, "/google.cloud.functions.v1beta2.CloudFunctionsService/ListFunctions", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *cloudFunctionsServiceClient) GetFunction(ctx context.Context, in *GetFunctionRequest, opts ...grpc.CallOption) (*CloudFunction, error) { + out := new(CloudFunction) + err := grpc.Invoke(ctx, "/google.cloud.functions.v1beta2.CloudFunctionsService/GetFunction", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *cloudFunctionsServiceClient) CreateFunction(ctx context.Context, in *CreateFunctionRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.cloud.functions.v1beta2.CloudFunctionsService/CreateFunction", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *cloudFunctionsServiceClient) UpdateFunction(ctx context.Context, in *UpdateFunctionRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.cloud.functions.v1beta2.CloudFunctionsService/UpdateFunction", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *cloudFunctionsServiceClient) DeleteFunction(ctx context.Context, in *DeleteFunctionRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.cloud.functions.v1beta2.CloudFunctionsService/DeleteFunction", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *cloudFunctionsServiceClient) CallFunction(ctx context.Context, in *CallFunctionRequest, opts ...grpc.CallOption) (*CallFunctionResponse, error) { + out := new(CallFunctionResponse) + err := grpc.Invoke(ctx, "/google.cloud.functions.v1beta2.CloudFunctionsService/CallFunction", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for CloudFunctionsService service + +type CloudFunctionsServiceServer interface { + // Returns a list of functions that belong to the requested project. + ListFunctions(context.Context, *ListFunctionsRequest) (*ListFunctionsResponse, error) + // Returns a function with the given name from the requested project. + GetFunction(context.Context, *GetFunctionRequest) (*CloudFunction, error) + // Creates a new function. If a function with the given name already exists in + // the specified project, the long running operation will return + // `ALREADY_EXISTS` error. + CreateFunction(context.Context, *CreateFunctionRequest) (*google_longrunning.Operation, error) + // Updates existing function. + UpdateFunction(context.Context, *UpdateFunctionRequest) (*google_longrunning.Operation, error) + // Deletes a function with the given name from the specified project. If the + // given function is used by some trigger, the trigger will be updated to + // remove this function. + DeleteFunction(context.Context, *DeleteFunctionRequest) (*google_longrunning.Operation, error) + // Invokes synchronously deployed function. To be used for testing, very + // limited traffic allowed. + CallFunction(context.Context, *CallFunctionRequest) (*CallFunctionResponse, error) +} + +func RegisterCloudFunctionsServiceServer(s *grpc.Server, srv CloudFunctionsServiceServer) { + s.RegisterService(&_CloudFunctionsService_serviceDesc, srv) +} + +func _CloudFunctionsService_ListFunctions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListFunctionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CloudFunctionsServiceServer).ListFunctions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.functions.v1beta2.CloudFunctionsService/ListFunctions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CloudFunctionsServiceServer).ListFunctions(ctx, req.(*ListFunctionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CloudFunctionsService_GetFunction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetFunctionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CloudFunctionsServiceServer).GetFunction(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.functions.v1beta2.CloudFunctionsService/GetFunction", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CloudFunctionsServiceServer).GetFunction(ctx, req.(*GetFunctionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CloudFunctionsService_CreateFunction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateFunctionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CloudFunctionsServiceServer).CreateFunction(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.functions.v1beta2.CloudFunctionsService/CreateFunction", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CloudFunctionsServiceServer).CreateFunction(ctx, req.(*CreateFunctionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CloudFunctionsService_UpdateFunction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateFunctionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CloudFunctionsServiceServer).UpdateFunction(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.functions.v1beta2.CloudFunctionsService/UpdateFunction", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CloudFunctionsServiceServer).UpdateFunction(ctx, req.(*UpdateFunctionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CloudFunctionsService_DeleteFunction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteFunctionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CloudFunctionsServiceServer).DeleteFunction(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.functions.v1beta2.CloudFunctionsService/DeleteFunction", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CloudFunctionsServiceServer).DeleteFunction(ctx, req.(*DeleteFunctionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CloudFunctionsService_CallFunction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CallFunctionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CloudFunctionsServiceServer).CallFunction(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.functions.v1beta2.CloudFunctionsService/CallFunction", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CloudFunctionsServiceServer).CallFunction(ctx, req.(*CallFunctionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _CloudFunctionsService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.cloud.functions.v1beta2.CloudFunctionsService", + HandlerType: (*CloudFunctionsServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListFunctions", + Handler: _CloudFunctionsService_ListFunctions_Handler, + }, + { + MethodName: "GetFunction", + Handler: _CloudFunctionsService_GetFunction_Handler, + }, + { + MethodName: "CreateFunction", + Handler: _CloudFunctionsService_CreateFunction_Handler, + }, + { + MethodName: "UpdateFunction", + Handler: _CloudFunctionsService_UpdateFunction_Handler, + }, + { + MethodName: "DeleteFunction", + Handler: _CloudFunctionsService_DeleteFunction_Handler, + }, + { + MethodName: "CallFunction", + Handler: _CloudFunctionsService_CallFunction_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/cloud/functions/v1beta2/functions.proto", +} + +func init() { proto.RegisterFile("google/cloud/functions/v1beta2/functions.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 1216 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0x4d, 0x73, 0xdb, 0x44, + 0x18, 0xae, 0xf2, 0xe1, 0xc6, 0xaf, 0x3f, 0xe2, 0x6e, 0x9b, 0x8e, 0x30, 0x2d, 0x0d, 0x62, 0x80, + 0x90, 0x82, 0x0d, 0x6e, 0x80, 0x99, 0x7e, 0x30, 0x24, 0xb1, 0x93, 0x78, 0x9a, 0xb6, 0x1e, 0xd9, + 0x39, 0x94, 0x8b, 0x66, 0x2d, 0x6f, 0x15, 0x81, 0xac, 0x15, 0xab, 0x95, 0xa7, 0x29, 0x53, 0x0e, + 0xcc, 0x70, 0xe3, 0xc6, 0x3f, 0xe8, 0x99, 0xe1, 0x07, 0x30, 0xc3, 0x9d, 0x3b, 0x57, 0x86, 0x13, + 0x3f, 0x84, 0xd9, 0xd5, 0x4a, 0x96, 0x93, 0x14, 0x25, 0x19, 0x6e, 0xda, 0xe7, 0xfd, 0x7a, 0x76, + 0xdf, 0x67, 0x5f, 0xaf, 0xa1, 0xe1, 0x50, 0xea, 0x78, 0xa4, 0x69, 0x7b, 0x34, 0x1a, 0x35, 0x9f, + 0x45, 0xbe, 0xcd, 0x5d, 0xea, 0x87, 0xcd, 0xc9, 0x27, 0x43, 0xc2, 0x71, 0x6b, 0x8a, 0x34, 0x02, + 0x46, 0x39, 0x45, 0x6f, 0xc5, 0xfe, 0x0d, 0xe9, 0xdf, 0x98, 0x5a, 0x95, 0x7f, 0xfd, 0x86, 0xca, + 0x87, 0x03, 0xb7, 0x89, 0x7d, 0x9f, 0x72, 0x9c, 0x89, 0xae, 0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x37, 0x9d, 0x4b, 0xe2, + 0x7c, 0xab, 0xb3, 0x03, 0x31, 0x9f, 0xf0, 0xa9, 0x03, 0x34, 0x8f, 0x70, 0x5b, 0x12, 0xfe, 0xa2, + 0x7e, 0x81, 0x53, 0xcd, 0xd0, 0x7d, 0xa5, 0x41, 0x75, 0x76, 0x3c, 0xe4, 0xd3, 0x3d, 0x75, 0x9c, + 0xe4, 0xd1, 0x55, 0x22, 0x58, 0xbf, 0x88, 0x08, 0x7e, 0xd7, 0xa0, 0x9c, 0x9d, 0x2b, 0x28, 0xff, + 0xc1, 0x76, 0x72, 0x88, 0xd5, 0x37, 0xce, 0x17, 0xa4, 0x6e, 0xdb, 0x96, 0xe4, 0x7d, 0xdf, 0xf8, + 0xfc, 0x02, 0xc7, 0x6c, 0x63, 0xcf, 0xbb, 0xab, 0xad, 0x6f, 0xfd, 0xa8, 0x81, 0x61, 0xd3, 0x71, + 0x4e, 0xfd, 0xad, 0x6a, 0x7a, 0xd7, 0x7b, 0xe2, 0x6d, 0xd5, 0xd3, 0xbe, 0xda, 0x55, 0x11, 0x0e, + 0xf5, 0xb0, 0xef, 0x34, 0x28, 0x73, 0x9a, 0x0e, 0xf1, 0xe5, 0xcb, 0x4b, 0xfd, 0x77, 0xc1, 0x81, + 0x1b, 0xbe, 0xee, 0xff, 0xcb, 0xbd, 0x14, 0x79, 0x35, 0x37, 0xbf, 0xbb, 0xbd, 0x33, 0x2c, 0xc8, + 0xc8, 0x3b, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x22, 0xa1, 0xda, 0x9f, 0x7d, 0x0d, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/functions/v1beta2/operations.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/functions/v1beta2/operations.pb.go new file mode 100644 index 0000000000..dee76e0c0a --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/functions/v1beta2/operations.pb.go @@ -0,0 +1,116 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/functions/v1beta2/operations.proto + +package functions + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf1 "github.com/golang/protobuf/ptypes/any" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// A type of an operation. +type OperationType int32 + +const ( + // Unknown operation type. + OperationType_OPERATION_UNSPECIFIED OperationType = 0 + // Triggered by CreateFunction call + OperationType_CREATE_FUNCTION OperationType = 1 + // Triggered by UpdateFunction call + OperationType_UPDATE_FUNCTION OperationType = 2 + // Triggered by DeleteFunction call. + OperationType_DELETE_FUNCTION OperationType = 3 +) + +var OperationType_name = map[int32]string{ + 0: "OPERATION_UNSPECIFIED", + 1: "CREATE_FUNCTION", + 2: "UPDATE_FUNCTION", + 3: "DELETE_FUNCTION", +} +var OperationType_value = map[string]int32{ + "OPERATION_UNSPECIFIED": 0, + "CREATE_FUNCTION": 1, + "UPDATE_FUNCTION": 2, + "DELETE_FUNCTION": 3, +} + +func (x OperationType) String() string { + return proto.EnumName(OperationType_name, int32(x)) +} +func (OperationType) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +// Metadata describing an [Operation][google.longrunning.Operation] +type OperationMetadataV1Beta2 struct { + // Target of the operation - for example + // projects/project-1/locations/region-1/functions/function-1 + Target string `protobuf:"bytes,1,opt,name=target" json:"target,omitempty"` + // Type of operation. + Type OperationType `protobuf:"varint,2,opt,name=type,enum=google.cloud.functions.v1beta2.OperationType" json:"type,omitempty"` + // The original request that started the operation. + Request *google_protobuf1.Any `protobuf:"bytes,3,opt,name=request" json:"request,omitempty"` +} + +func (m *OperationMetadataV1Beta2) Reset() { *m = OperationMetadataV1Beta2{} } +func (m *OperationMetadataV1Beta2) String() string { return proto.CompactTextString(m) } +func (*OperationMetadataV1Beta2) ProtoMessage() {} +func (*OperationMetadataV1Beta2) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +func (m *OperationMetadataV1Beta2) GetTarget() string { + if m != nil { + return m.Target + } + return "" +} + +func (m *OperationMetadataV1Beta2) GetType() OperationType { + if m != nil { + return m.Type + } + return OperationType_OPERATION_UNSPECIFIED +} + +func (m *OperationMetadataV1Beta2) GetRequest() *google_protobuf1.Any { + if m != nil { + return m.Request + } + return nil +} + +func init() { + proto.RegisterType((*OperationMetadataV1Beta2)(nil), "google.cloud.functions.v1beta2.OperationMetadataV1Beta2") + proto.RegisterEnum("google.cloud.functions.v1beta2.OperationType", OperationType_name, OperationType_value) +} + +func init() { proto.RegisterFile("google/cloud/functions/v1beta2/operations.proto", fileDescriptor1) } + +var fileDescriptor1 = []byte{ + // 333 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x91, 0x4f, 0x4f, 0xf2, 0x30, + 0x1c, 0xc7, 0x9f, 0xc2, 0x13, 0x8c, 0x35, 0x2a, 0x99, 0x7f, 0x32, 0x88, 0x31, 0x84, 0x13, 0x31, + 0xb1, 0x0d, 0x78, 0xf4, 0x34, 0xa0, 0x18, 0x12, 0x85, 0x65, 0x82, 0x07, 0x2f, 0xa4, 0x40, 0x69, + 0x96, 0xcc, 0xb6, 0x6e, 0x9d, 0xc9, 0x5e, 0x82, 0x2f, 0xc4, 0xf7, 0x69, 0x56, 0xba, 0x05, 0x0e, + 0xea, 0xb1, 0x9f, 0xf6, 0xf3, 0xed, 0xf7, 0x97, 0x1f, 0xc4, 0x5c, 0x4a, 0x1e, 0x31, 0xbc, 0x8a, + 0x64, 0xba, 0xc6, 0x9b, 0x54, 0xac, 0x74, 0x28, 0x45, 0x82, 0x3f, 0xba, 0x4b, 0xa6, 0x69, 0x0f, + 0x4b, 0xc5, 0x62, 0x6a, 0x10, 0x52, 0xb1, 0xd4, 0xd2, 0xb9, 0xde, 0x0a, 0xc8, 0x08, 0xa8, 0x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, 0x5d, 0x2e, 0x23, 0x2a, 0x38, 0x92, 0x31, 0xc7, 0x9c, 0x09, + 0x33, 0x99, 0x5d, 0x3d, 0x55, 0x61, 0xf2, 0xd3, 0xfa, 0xef, 0x4b, 0xb2, 0xac, 0x19, 0xe7, 0xee, + 0x3b, 0x00, 0x00, 0xff, 0xff, 0x3c, 0x8a, 0xb1, 0x83, 0x31, 0x02, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/language/v1/language_service.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/language/v1/language_service.pb.go new file mode 100644 index 0000000000..126175f032 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/language/v1/language_service.pb.go @@ -0,0 +1,2591 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/language/v1/language_service.proto + +/* +Package language is a generated protocol buffer package. + +It is generated from these files: + google/cloud/language/v1/language_service.proto + +It has these top-level messages: + Document + Sentence + Entity + Token + Sentiment + PartOfSpeech + DependencyEdge + EntityMention + TextSpan + ClassificationCategory + AnalyzeSentimentRequest + AnalyzeSentimentResponse + AnalyzeEntitySentimentRequest + AnalyzeEntitySentimentResponse + AnalyzeEntitiesRequest + AnalyzeEntitiesResponse + AnalyzeSyntaxRequest + AnalyzeSyntaxResponse + ClassifyTextRequest + ClassifyTextResponse + AnnotateTextRequest + AnnotateTextResponse +*/ +package language + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Represents the text encoding that the caller uses to process the output. +// Providing an `EncodingType` is recommended because the API provides the +// beginning offsets for various outputs, such as tokens and mentions, and +// languages that natively use different text encodings may access offsets +// differently. +type EncodingType int32 + +const ( + // If `EncodingType` is not specified, encoding-dependent information (such as + // `begin_offset`) will be set at `-1`. + EncodingType_NONE EncodingType = 0 + // Encoding-dependent information (such as `begin_offset`) is calculated based + // on the UTF-8 encoding of the input. C++ and Go are examples of languages + // that use this encoding natively. + EncodingType_UTF8 EncodingType = 1 + // Encoding-dependent information (such as `begin_offset`) is calculated based + // on the UTF-16 encoding of the input. Java and Javascript are examples of + // languages that use this encoding natively. + EncodingType_UTF16 EncodingType = 2 + // Encoding-dependent information (such as `begin_offset`) is calculated based + // on the UTF-32 encoding of the input. Python is an example of a language + // that uses this encoding natively. + EncodingType_UTF32 EncodingType = 3 +) + +var EncodingType_name = map[int32]string{ + 0: "NONE", + 1: "UTF8", + 2: "UTF16", + 3: "UTF32", +} +var EncodingType_value = map[string]int32{ + "NONE": 0, + "UTF8": 1, + "UTF16": 2, + "UTF32": 3, +} + +func (x EncodingType) String() string { + return proto.EnumName(EncodingType_name, int32(x)) +} +func (EncodingType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +// The document types enum. +type Document_Type int32 + +const ( + // The content type is not specified. + Document_TYPE_UNSPECIFIED Document_Type = 0 + // Plain text + Document_PLAIN_TEXT Document_Type = 1 + // HTML + Document_HTML Document_Type = 2 +) + +var Document_Type_name = map[int32]string{ + 0: "TYPE_UNSPECIFIED", + 1: "PLAIN_TEXT", + 2: "HTML", +} +var Document_Type_value = map[string]int32{ + "TYPE_UNSPECIFIED": 0, + "PLAIN_TEXT": 1, + "HTML": 2, +} + +func (x Document_Type) String() string { + return proto.EnumName(Document_Type_name, int32(x)) +} +func (Document_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 0} } + +// The type of the entity. +type Entity_Type int32 + +const ( + // Unknown + Entity_UNKNOWN Entity_Type = 0 + // Person + Entity_PERSON Entity_Type = 1 + // Location + Entity_LOCATION Entity_Type = 2 + // Organization + Entity_ORGANIZATION Entity_Type = 3 + // Event + Entity_EVENT Entity_Type = 4 + // Work of art + Entity_WORK_OF_ART Entity_Type = 5 + // Consumer goods + Entity_CONSUMER_GOOD Entity_Type = 6 + // Other types + Entity_OTHER Entity_Type = 7 +) + +var Entity_Type_name = map[int32]string{ + 0: "UNKNOWN", + 1: "PERSON", + 2: "LOCATION", + 3: "ORGANIZATION", + 4: "EVENT", + 5: "WORK_OF_ART", + 6: "CONSUMER_GOOD", + 7: "OTHER", +} +var Entity_Type_value = map[string]int32{ + "UNKNOWN": 0, + "PERSON": 1, + "LOCATION": 2, + "ORGANIZATION": 3, + "EVENT": 4, + "WORK_OF_ART": 5, + "CONSUMER_GOOD": 6, + "OTHER": 7, +} + +func (x Entity_Type) String() string { + return proto.EnumName(Entity_Type_name, int32(x)) +} +func (Entity_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{2, 0} } + +// The part of speech tags enum. +type PartOfSpeech_Tag int32 + +const ( + // Unknown + PartOfSpeech_UNKNOWN PartOfSpeech_Tag = 0 + // Adjective + PartOfSpeech_ADJ PartOfSpeech_Tag = 1 + // Adposition (preposition and postposition) + PartOfSpeech_ADP PartOfSpeech_Tag = 2 + // Adverb + PartOfSpeech_ADV PartOfSpeech_Tag = 3 + // Conjunction + PartOfSpeech_CONJ PartOfSpeech_Tag = 4 + // Determiner + PartOfSpeech_DET PartOfSpeech_Tag = 5 + // Noun (common and proper) + PartOfSpeech_NOUN PartOfSpeech_Tag = 6 + // Cardinal number + PartOfSpeech_NUM PartOfSpeech_Tag = 7 + // Pronoun + PartOfSpeech_PRON PartOfSpeech_Tag = 8 + // Particle or other function word + PartOfSpeech_PRT PartOfSpeech_Tag = 9 + // Punctuation + PartOfSpeech_PUNCT PartOfSpeech_Tag = 10 + // Verb (all tenses and modes) + PartOfSpeech_VERB PartOfSpeech_Tag = 11 + // Other: foreign words, typos, abbreviations + PartOfSpeech_X PartOfSpeech_Tag = 12 + // Affix + PartOfSpeech_AFFIX PartOfSpeech_Tag = 13 +) + +var PartOfSpeech_Tag_name = map[int32]string{ + 0: "UNKNOWN", + 1: "ADJ", + 2: "ADP", + 3: "ADV", + 4: "CONJ", + 5: "DET", + 6: "NOUN", + 7: "NUM", + 8: "PRON", + 9: "PRT", + 10: "PUNCT", + 11: "VERB", + 12: "X", + 13: "AFFIX", +} +var PartOfSpeech_Tag_value = map[string]int32{ + "UNKNOWN": 0, + "ADJ": 1, + "ADP": 2, + "ADV": 3, + "CONJ": 4, + "DET": 5, + "NOUN": 6, + "NUM": 7, + "PRON": 8, + "PRT": 9, + "PUNCT": 10, + "VERB": 11, + "X": 12, + "AFFIX": 13, +} + +func (x PartOfSpeech_Tag) String() string { + return proto.EnumName(PartOfSpeech_Tag_name, int32(x)) +} +func (PartOfSpeech_Tag) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 0} } + +// The characteristic of a verb that expresses time flow during an event. +type PartOfSpeech_Aspect int32 + +const ( + // Aspect is not applicable in the analyzed language or is not predicted. + PartOfSpeech_ASPECT_UNKNOWN PartOfSpeech_Aspect = 0 + // Perfective + PartOfSpeech_PERFECTIVE PartOfSpeech_Aspect = 1 + // Imperfective + PartOfSpeech_IMPERFECTIVE PartOfSpeech_Aspect = 2 + // Progressive + PartOfSpeech_PROGRESSIVE PartOfSpeech_Aspect = 3 +) + +var PartOfSpeech_Aspect_name = map[int32]string{ + 0: "ASPECT_UNKNOWN", + 1: "PERFECTIVE", + 2: "IMPERFECTIVE", + 3: "PROGRESSIVE", +} +var PartOfSpeech_Aspect_value = map[string]int32{ + "ASPECT_UNKNOWN": 0, + "PERFECTIVE": 1, + "IMPERFECTIVE": 2, + "PROGRESSIVE": 3, +} + +func (x PartOfSpeech_Aspect) String() string { + return proto.EnumName(PartOfSpeech_Aspect_name, int32(x)) +} +func (PartOfSpeech_Aspect) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 1} } + +// The grammatical function performed by a noun or pronoun in a phrase, +// clause, or sentence. In some languages, other parts of speech, such as +// adjective and determiner, take case inflection in agreement with the noun. +type PartOfSpeech_Case int32 + +const ( + // Case is not applicable in the analyzed language or is not predicted. + PartOfSpeech_CASE_UNKNOWN PartOfSpeech_Case = 0 + // Accusative + PartOfSpeech_ACCUSATIVE PartOfSpeech_Case = 1 + // Adverbial + PartOfSpeech_ADVERBIAL PartOfSpeech_Case = 2 + // Complementive + PartOfSpeech_COMPLEMENTIVE PartOfSpeech_Case = 3 + // Dative + PartOfSpeech_DATIVE PartOfSpeech_Case = 4 + // Genitive + PartOfSpeech_GENITIVE PartOfSpeech_Case = 5 + // Instrumental + PartOfSpeech_INSTRUMENTAL PartOfSpeech_Case = 6 + // Locative + PartOfSpeech_LOCATIVE PartOfSpeech_Case = 7 + // Nominative + PartOfSpeech_NOMINATIVE PartOfSpeech_Case = 8 + // Oblique + PartOfSpeech_OBLIQUE PartOfSpeech_Case = 9 + // Partitive + PartOfSpeech_PARTITIVE PartOfSpeech_Case = 10 + // Prepositional + PartOfSpeech_PREPOSITIONAL PartOfSpeech_Case = 11 + // Reflexive + PartOfSpeech_REFLEXIVE_CASE PartOfSpeech_Case = 12 + // Relative + PartOfSpeech_RELATIVE_CASE PartOfSpeech_Case = 13 + // Vocative + PartOfSpeech_VOCATIVE PartOfSpeech_Case = 14 +) + +var PartOfSpeech_Case_name = map[int32]string{ + 0: "CASE_UNKNOWN", + 1: "ACCUSATIVE", + 2: "ADVERBIAL", + 3: "COMPLEMENTIVE", + 4: "DATIVE", + 5: "GENITIVE", + 6: "INSTRUMENTAL", + 7: "LOCATIVE", + 8: "NOMINATIVE", + 9: "OBLIQUE", + 10: "PARTITIVE", + 11: "PREPOSITIONAL", + 12: "REFLEXIVE_CASE", + 13: "RELATIVE_CASE", + 14: "VOCATIVE", +} +var PartOfSpeech_Case_value = map[string]int32{ + "CASE_UNKNOWN": 0, + "ACCUSATIVE": 1, + "ADVERBIAL": 2, + "COMPLEMENTIVE": 3, + "DATIVE": 4, + "GENITIVE": 5, + "INSTRUMENTAL": 6, + "LOCATIVE": 7, + "NOMINATIVE": 8, + "OBLIQUE": 9, + "PARTITIVE": 10, + "PREPOSITIONAL": 11, + "REFLEXIVE_CASE": 12, + "RELATIVE_CASE": 13, + "VOCATIVE": 14, +} + +func (x PartOfSpeech_Case) String() string { + return proto.EnumName(PartOfSpeech_Case_name, int32(x)) +} +func (PartOfSpeech_Case) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 2} } + +// Depending on the language, Form can be categorizing different forms of +// verbs, adjectives, adverbs, etc. For example, categorizing inflected +// endings of verbs and adjectives or distinguishing between short and long +// forms of adjectives and participles +type PartOfSpeech_Form int32 + +const ( + // Form is not applicable in the analyzed language or is not predicted. + PartOfSpeech_FORM_UNKNOWN PartOfSpeech_Form = 0 + // Adnomial + PartOfSpeech_ADNOMIAL PartOfSpeech_Form = 1 + // Auxiliary + PartOfSpeech_AUXILIARY PartOfSpeech_Form = 2 + // Complementizer + PartOfSpeech_COMPLEMENTIZER PartOfSpeech_Form = 3 + // Final ending + PartOfSpeech_FINAL_ENDING PartOfSpeech_Form = 4 + // Gerund + PartOfSpeech_GERUND PartOfSpeech_Form = 5 + // Realis + PartOfSpeech_REALIS PartOfSpeech_Form = 6 + // Irrealis + PartOfSpeech_IRREALIS PartOfSpeech_Form = 7 + // Short form + PartOfSpeech_SHORT PartOfSpeech_Form = 8 + // Long form + PartOfSpeech_LONG PartOfSpeech_Form = 9 + // Order form + PartOfSpeech_ORDER PartOfSpeech_Form = 10 + // Specific form + PartOfSpeech_SPECIFIC PartOfSpeech_Form = 11 +) + +var PartOfSpeech_Form_name = map[int32]string{ + 0: "FORM_UNKNOWN", + 1: "ADNOMIAL", + 2: "AUXILIARY", + 3: "COMPLEMENTIZER", + 4: "FINAL_ENDING", + 5: "GERUND", + 6: "REALIS", + 7: "IRREALIS", + 8: "SHORT", + 9: "LONG", + 10: "ORDER", + 11: "SPECIFIC", +} +var PartOfSpeech_Form_value = map[string]int32{ + "FORM_UNKNOWN": 0, + "ADNOMIAL": 1, + "AUXILIARY": 2, + "COMPLEMENTIZER": 3, + "FINAL_ENDING": 4, + "GERUND": 5, + "REALIS": 6, + "IRREALIS": 7, + "SHORT": 8, + "LONG": 9, + "ORDER": 10, + "SPECIFIC": 11, +} + +func (x PartOfSpeech_Form) String() string { + return proto.EnumName(PartOfSpeech_Form_name, int32(x)) +} +func (PartOfSpeech_Form) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 3} } + +// Gender classes of nouns reflected in the behaviour of associated words. +type PartOfSpeech_Gender int32 + +const ( + // Gender is not applicable in the analyzed language or is not predicted. + PartOfSpeech_GENDER_UNKNOWN PartOfSpeech_Gender = 0 + // Feminine + PartOfSpeech_FEMININE PartOfSpeech_Gender = 1 + // Masculine + PartOfSpeech_MASCULINE PartOfSpeech_Gender = 2 + // Neuter + PartOfSpeech_NEUTER PartOfSpeech_Gender = 3 +) + +var PartOfSpeech_Gender_name = map[int32]string{ + 0: "GENDER_UNKNOWN", + 1: "FEMININE", + 2: "MASCULINE", + 3: "NEUTER", +} +var PartOfSpeech_Gender_value = map[string]int32{ + "GENDER_UNKNOWN": 0, + "FEMININE": 1, + "MASCULINE": 2, + "NEUTER": 3, +} + +func (x PartOfSpeech_Gender) String() string { + return proto.EnumName(PartOfSpeech_Gender_name, int32(x)) +} +func (PartOfSpeech_Gender) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 4} } + +// The grammatical feature of verbs, used for showing modality and attitude. +type PartOfSpeech_Mood int32 + +const ( + // Mood is not applicable in the analyzed language or is not predicted. + PartOfSpeech_MOOD_UNKNOWN PartOfSpeech_Mood = 0 + // Conditional + PartOfSpeech_CONDITIONAL_MOOD PartOfSpeech_Mood = 1 + // Imperative + PartOfSpeech_IMPERATIVE PartOfSpeech_Mood = 2 + // Indicative + PartOfSpeech_INDICATIVE PartOfSpeech_Mood = 3 + // Interrogative + PartOfSpeech_INTERROGATIVE PartOfSpeech_Mood = 4 + // Jussive + PartOfSpeech_JUSSIVE PartOfSpeech_Mood = 5 + // Subjunctive + PartOfSpeech_SUBJUNCTIVE PartOfSpeech_Mood = 6 +) + +var PartOfSpeech_Mood_name = map[int32]string{ + 0: "MOOD_UNKNOWN", + 1: "CONDITIONAL_MOOD", + 2: "IMPERATIVE", + 3: "INDICATIVE", + 4: "INTERROGATIVE", + 5: "JUSSIVE", + 6: "SUBJUNCTIVE", +} +var PartOfSpeech_Mood_value = map[string]int32{ + "MOOD_UNKNOWN": 0, + "CONDITIONAL_MOOD": 1, + "IMPERATIVE": 2, + "INDICATIVE": 3, + "INTERROGATIVE": 4, + "JUSSIVE": 5, + "SUBJUNCTIVE": 6, +} + +func (x PartOfSpeech_Mood) String() string { + return proto.EnumName(PartOfSpeech_Mood_name, int32(x)) +} +func (PartOfSpeech_Mood) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 5} } + +// Count distinctions. +type PartOfSpeech_Number int32 + +const ( + // Number is not applicable in the analyzed language or is not predicted. + PartOfSpeech_NUMBER_UNKNOWN PartOfSpeech_Number = 0 + // Singular + PartOfSpeech_SINGULAR PartOfSpeech_Number = 1 + // Plural + PartOfSpeech_PLURAL PartOfSpeech_Number = 2 + // Dual + PartOfSpeech_DUAL PartOfSpeech_Number = 3 +) + +var PartOfSpeech_Number_name = map[int32]string{ + 0: "NUMBER_UNKNOWN", + 1: "SINGULAR", + 2: "PLURAL", + 3: "DUAL", +} +var PartOfSpeech_Number_value = map[string]int32{ + "NUMBER_UNKNOWN": 0, + "SINGULAR": 1, + "PLURAL": 2, + "DUAL": 3, +} + +func (x PartOfSpeech_Number) String() string { + return proto.EnumName(PartOfSpeech_Number_name, int32(x)) +} +func (PartOfSpeech_Number) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 6} } + +// The distinction between the speaker, second person, third person, etc. +type PartOfSpeech_Person int32 + +const ( + // Person is not applicable in the analyzed language or is not predicted. + PartOfSpeech_PERSON_UNKNOWN PartOfSpeech_Person = 0 + // First + PartOfSpeech_FIRST PartOfSpeech_Person = 1 + // Second + PartOfSpeech_SECOND PartOfSpeech_Person = 2 + // Third + PartOfSpeech_THIRD PartOfSpeech_Person = 3 + // Reflexive + PartOfSpeech_REFLEXIVE_PERSON PartOfSpeech_Person = 4 +) + +var PartOfSpeech_Person_name = map[int32]string{ + 0: "PERSON_UNKNOWN", + 1: "FIRST", + 2: "SECOND", + 3: "THIRD", + 4: "REFLEXIVE_PERSON", +} +var PartOfSpeech_Person_value = map[string]int32{ + "PERSON_UNKNOWN": 0, + "FIRST": 1, + "SECOND": 2, + "THIRD": 3, + "REFLEXIVE_PERSON": 4, +} + +func (x PartOfSpeech_Person) String() string { + return proto.EnumName(PartOfSpeech_Person_name, int32(x)) +} +func (PartOfSpeech_Person) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 7} } + +// This category shows if the token is part of a proper name. +type PartOfSpeech_Proper int32 + +const ( + // Proper is not applicable in the analyzed language or is not predicted. + PartOfSpeech_PROPER_UNKNOWN PartOfSpeech_Proper = 0 + // Proper + PartOfSpeech_PROPER PartOfSpeech_Proper = 1 + // Not proper + PartOfSpeech_NOT_PROPER PartOfSpeech_Proper = 2 +) + +var PartOfSpeech_Proper_name = map[int32]string{ + 0: "PROPER_UNKNOWN", + 1: "PROPER", + 2: "NOT_PROPER", +} +var PartOfSpeech_Proper_value = map[string]int32{ + "PROPER_UNKNOWN": 0, + "PROPER": 1, + "NOT_PROPER": 2, +} + +func (x PartOfSpeech_Proper) String() string { + return proto.EnumName(PartOfSpeech_Proper_name, int32(x)) +} +func (PartOfSpeech_Proper) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 8} } + +// Reciprocal features of a pronoun. +type PartOfSpeech_Reciprocity int32 + +const ( + // Reciprocity is not applicable in the analyzed language or is not + // predicted. + PartOfSpeech_RECIPROCITY_UNKNOWN PartOfSpeech_Reciprocity = 0 + // Reciprocal + PartOfSpeech_RECIPROCAL PartOfSpeech_Reciprocity = 1 + // Non-reciprocal + PartOfSpeech_NON_RECIPROCAL PartOfSpeech_Reciprocity = 2 +) + +var PartOfSpeech_Reciprocity_name = map[int32]string{ + 0: "RECIPROCITY_UNKNOWN", + 1: "RECIPROCAL", + 2: "NON_RECIPROCAL", +} +var PartOfSpeech_Reciprocity_value = map[string]int32{ + "RECIPROCITY_UNKNOWN": 0, + "RECIPROCAL": 1, + "NON_RECIPROCAL": 2, +} + +func (x PartOfSpeech_Reciprocity) String() string { + return proto.EnumName(PartOfSpeech_Reciprocity_name, int32(x)) +} +func (PartOfSpeech_Reciprocity) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 9} } + +// Time reference. +type PartOfSpeech_Tense int32 + +const ( + // Tense is not applicable in the analyzed language or is not predicted. + PartOfSpeech_TENSE_UNKNOWN PartOfSpeech_Tense = 0 + // Conditional + PartOfSpeech_CONDITIONAL_TENSE PartOfSpeech_Tense = 1 + // Future + PartOfSpeech_FUTURE PartOfSpeech_Tense = 2 + // Past + PartOfSpeech_PAST PartOfSpeech_Tense = 3 + // Present + PartOfSpeech_PRESENT PartOfSpeech_Tense = 4 + // Imperfect + PartOfSpeech_IMPERFECT PartOfSpeech_Tense = 5 + // Pluperfect + PartOfSpeech_PLUPERFECT PartOfSpeech_Tense = 6 +) + +var PartOfSpeech_Tense_name = map[int32]string{ + 0: "TENSE_UNKNOWN", + 1: "CONDITIONAL_TENSE", + 2: "FUTURE", + 3: "PAST", + 4: "PRESENT", + 5: "IMPERFECT", + 6: "PLUPERFECT", +} +var PartOfSpeech_Tense_value = map[string]int32{ + "TENSE_UNKNOWN": 0, + "CONDITIONAL_TENSE": 1, + "FUTURE": 2, + "PAST": 3, + "PRESENT": 4, + "IMPERFECT": 5, + "PLUPERFECT": 6, +} + +func (x PartOfSpeech_Tense) String() string { + return proto.EnumName(PartOfSpeech_Tense_name, int32(x)) +} +func (PartOfSpeech_Tense) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 10} } + +// The relationship between the action that a verb expresses and the +// participants identified by its arguments. +type PartOfSpeech_Voice int32 + +const ( + // Voice is not applicable in the analyzed language or is not predicted. + PartOfSpeech_VOICE_UNKNOWN PartOfSpeech_Voice = 0 + // Active + PartOfSpeech_ACTIVE PartOfSpeech_Voice = 1 + // Causative + PartOfSpeech_CAUSATIVE PartOfSpeech_Voice = 2 + // Passive + PartOfSpeech_PASSIVE PartOfSpeech_Voice = 3 +) + +var PartOfSpeech_Voice_name = map[int32]string{ + 0: "VOICE_UNKNOWN", + 1: "ACTIVE", + 2: "CAUSATIVE", + 3: "PASSIVE", +} +var PartOfSpeech_Voice_value = map[string]int32{ + "VOICE_UNKNOWN": 0, + "ACTIVE": 1, + "CAUSATIVE": 2, + "PASSIVE": 3, +} + +func (x PartOfSpeech_Voice) String() string { + return proto.EnumName(PartOfSpeech_Voice_name, int32(x)) +} +func (PartOfSpeech_Voice) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 11} } + +// The parse label enum for the token. +type DependencyEdge_Label int32 + +const ( + // Unknown + DependencyEdge_UNKNOWN DependencyEdge_Label = 0 + // Abbreviation modifier + DependencyEdge_ABBREV DependencyEdge_Label = 1 + // Adjectival complement + DependencyEdge_ACOMP DependencyEdge_Label = 2 + // Adverbial clause modifier + DependencyEdge_ADVCL DependencyEdge_Label = 3 + // Adverbial modifier + DependencyEdge_ADVMOD DependencyEdge_Label = 4 + // Adjectival modifier of an NP + DependencyEdge_AMOD DependencyEdge_Label = 5 + // Appositional modifier of an NP + DependencyEdge_APPOS DependencyEdge_Label = 6 + // Attribute dependent of a copular verb + DependencyEdge_ATTR DependencyEdge_Label = 7 + // Auxiliary (non-main) verb + DependencyEdge_AUX DependencyEdge_Label = 8 + // Passive auxiliary + DependencyEdge_AUXPASS DependencyEdge_Label = 9 + // Coordinating conjunction + DependencyEdge_CC DependencyEdge_Label = 10 + // Clausal complement of a verb or adjective + DependencyEdge_CCOMP DependencyEdge_Label = 11 + // Conjunct + DependencyEdge_CONJ DependencyEdge_Label = 12 + // Clausal subject + DependencyEdge_CSUBJ DependencyEdge_Label = 13 + // Clausal passive subject + DependencyEdge_CSUBJPASS DependencyEdge_Label = 14 + // Dependency (unable to determine) + DependencyEdge_DEP DependencyEdge_Label = 15 + // Determiner + DependencyEdge_DET DependencyEdge_Label = 16 + // Discourse + DependencyEdge_DISCOURSE DependencyEdge_Label = 17 + // Direct object + DependencyEdge_DOBJ DependencyEdge_Label = 18 + // Expletive + DependencyEdge_EXPL DependencyEdge_Label = 19 + // Goes with (part of a word in a text not well edited) + DependencyEdge_GOESWITH DependencyEdge_Label = 20 + // Indirect object + DependencyEdge_IOBJ DependencyEdge_Label = 21 + // Marker (word introducing a subordinate clause) + DependencyEdge_MARK DependencyEdge_Label = 22 + // Multi-word expression + DependencyEdge_MWE DependencyEdge_Label = 23 + // Multi-word verbal expression + DependencyEdge_MWV DependencyEdge_Label = 24 + // Negation modifier + DependencyEdge_NEG DependencyEdge_Label = 25 + // Noun compound modifier + DependencyEdge_NN DependencyEdge_Label = 26 + // Noun phrase used as an adverbial modifier + DependencyEdge_NPADVMOD DependencyEdge_Label = 27 + // Nominal subject + DependencyEdge_NSUBJ DependencyEdge_Label = 28 + // Passive nominal subject + DependencyEdge_NSUBJPASS DependencyEdge_Label = 29 + // Numeric modifier of a noun + DependencyEdge_NUM DependencyEdge_Label = 30 + // Element of compound number + DependencyEdge_NUMBER DependencyEdge_Label = 31 + // Punctuation mark + DependencyEdge_P DependencyEdge_Label = 32 + // Parataxis relation + DependencyEdge_PARATAXIS DependencyEdge_Label = 33 + // Participial modifier + DependencyEdge_PARTMOD DependencyEdge_Label = 34 + // The complement of a preposition is a clause + DependencyEdge_PCOMP DependencyEdge_Label = 35 + // Object of a preposition + DependencyEdge_POBJ DependencyEdge_Label = 36 + // Possession modifier + DependencyEdge_POSS DependencyEdge_Label = 37 + // Postverbal negative particle + DependencyEdge_POSTNEG DependencyEdge_Label = 38 + // Predicate complement + DependencyEdge_PRECOMP DependencyEdge_Label = 39 + // Preconjunt + DependencyEdge_PRECONJ DependencyEdge_Label = 40 + // Predeterminer + DependencyEdge_PREDET DependencyEdge_Label = 41 + // Prefix + DependencyEdge_PREF DependencyEdge_Label = 42 + // Prepositional modifier + DependencyEdge_PREP DependencyEdge_Label = 43 + // The relationship between a verb and verbal morpheme + DependencyEdge_PRONL DependencyEdge_Label = 44 + // Particle + DependencyEdge_PRT DependencyEdge_Label = 45 + // Associative or possessive marker + DependencyEdge_PS DependencyEdge_Label = 46 + // Quantifier phrase modifier + DependencyEdge_QUANTMOD DependencyEdge_Label = 47 + // Relative clause modifier + DependencyEdge_RCMOD DependencyEdge_Label = 48 + // Complementizer in relative clause + DependencyEdge_RCMODREL DependencyEdge_Label = 49 + // Ellipsis without a preceding predicate + DependencyEdge_RDROP DependencyEdge_Label = 50 + // Referent + DependencyEdge_REF DependencyEdge_Label = 51 + // Remnant + DependencyEdge_REMNANT DependencyEdge_Label = 52 + // Reparandum + DependencyEdge_REPARANDUM DependencyEdge_Label = 53 + // Root + DependencyEdge_ROOT DependencyEdge_Label = 54 + // Suffix specifying a unit of number + DependencyEdge_SNUM DependencyEdge_Label = 55 + // Suffix + DependencyEdge_SUFF DependencyEdge_Label = 56 + // Temporal modifier + DependencyEdge_TMOD DependencyEdge_Label = 57 + // Topic marker + DependencyEdge_TOPIC DependencyEdge_Label = 58 + // Clause headed by an infinite form of the verb that modifies a noun + DependencyEdge_VMOD DependencyEdge_Label = 59 + // Vocative + DependencyEdge_VOCATIVE DependencyEdge_Label = 60 + // Open clausal complement + DependencyEdge_XCOMP DependencyEdge_Label = 61 + // Name suffix + DependencyEdge_SUFFIX DependencyEdge_Label = 62 + // Name title + DependencyEdge_TITLE DependencyEdge_Label = 63 + // Adverbial phrase modifier + DependencyEdge_ADVPHMOD DependencyEdge_Label = 64 + // Causative auxiliary + DependencyEdge_AUXCAUS DependencyEdge_Label = 65 + // Helper auxiliary + DependencyEdge_AUXVV DependencyEdge_Label = 66 + // Rentaishi (Prenominal modifier) + DependencyEdge_DTMOD DependencyEdge_Label = 67 + // Foreign words + DependencyEdge_FOREIGN DependencyEdge_Label = 68 + // Keyword + DependencyEdge_KW DependencyEdge_Label = 69 + // List for chains of comparable items + DependencyEdge_LIST DependencyEdge_Label = 70 + // Nominalized clause + DependencyEdge_NOMC DependencyEdge_Label = 71 + // Nominalized clausal subject + DependencyEdge_NOMCSUBJ DependencyEdge_Label = 72 + // Nominalized clausal passive + DependencyEdge_NOMCSUBJPASS DependencyEdge_Label = 73 + // Compound of numeric modifier + DependencyEdge_NUMC DependencyEdge_Label = 74 + // Copula + DependencyEdge_COP DependencyEdge_Label = 75 + // Dislocated relation (for fronted/topicalized elements) + DependencyEdge_DISLOCATED DependencyEdge_Label = 76 + // Aspect marker + DependencyEdge_ASP DependencyEdge_Label = 77 + // Genitive modifier + DependencyEdge_GMOD DependencyEdge_Label = 78 + // Genitive object + DependencyEdge_GOBJ DependencyEdge_Label = 79 + // Infinitival modifier + DependencyEdge_INFMOD DependencyEdge_Label = 80 + // Measure + DependencyEdge_MES DependencyEdge_Label = 81 + // Nominal complement of a noun + DependencyEdge_NCOMP DependencyEdge_Label = 82 +) + +var DependencyEdge_Label_name = map[int32]string{ + 0: "UNKNOWN", + 1: "ABBREV", + 2: "ACOMP", + 3: "ADVCL", + 4: "ADVMOD", + 5: "AMOD", + 6: "APPOS", + 7: "ATTR", + 8: "AUX", + 9: "AUXPASS", + 10: "CC", + 11: "CCOMP", + 12: "CONJ", + 13: "CSUBJ", + 14: "CSUBJPASS", + 15: "DEP", + 16: "DET", + 17: "DISCOURSE", + 18: "DOBJ", + 19: "EXPL", + 20: "GOESWITH", + 21: "IOBJ", + 22: "MARK", + 23: "MWE", + 24: "MWV", + 25: "NEG", + 26: "NN", + 27: "NPADVMOD", + 28: "NSUBJ", + 29: "NSUBJPASS", + 30: "NUM", + 31: "NUMBER", + 32: "P", + 33: "PARATAXIS", + 34: "PARTMOD", + 35: "PCOMP", + 36: "POBJ", + 37: "POSS", + 38: "POSTNEG", + 39: "PRECOMP", + 40: "PRECONJ", + 41: "PREDET", + 42: "PREF", + 43: "PREP", + 44: "PRONL", + 45: "PRT", + 46: "PS", + 47: "QUANTMOD", + 48: "RCMOD", + 49: "RCMODREL", + 50: "RDROP", + 51: "REF", + 52: "REMNANT", + 53: "REPARANDUM", + 54: "ROOT", + 55: "SNUM", + 56: "SUFF", + 57: "TMOD", + 58: "TOPIC", + 59: "VMOD", + 60: "VOCATIVE", + 61: "XCOMP", + 62: "SUFFIX", + 63: "TITLE", + 64: "ADVPHMOD", + 65: "AUXCAUS", + 66: "AUXVV", + 67: "DTMOD", + 68: "FOREIGN", + 69: "KW", + 70: "LIST", + 71: "NOMC", + 72: "NOMCSUBJ", + 73: "NOMCSUBJPASS", + 74: "NUMC", + 75: "COP", + 76: "DISLOCATED", + 77: "ASP", + 78: "GMOD", + 79: "GOBJ", + 80: "INFMOD", + 81: "MES", + 82: "NCOMP", +} +var DependencyEdge_Label_value = map[string]int32{ + "UNKNOWN": 0, + "ABBREV": 1, + "ACOMP": 2, + "ADVCL": 3, + "ADVMOD": 4, + "AMOD": 5, + "APPOS": 6, + "ATTR": 7, + "AUX": 8, + "AUXPASS": 9, + "CC": 10, + "CCOMP": 11, + "CONJ": 12, + "CSUBJ": 13, + "CSUBJPASS": 14, + "DEP": 15, + "DET": 16, + "DISCOURSE": 17, + "DOBJ": 18, + "EXPL": 19, + "GOESWITH": 20, + "IOBJ": 21, + "MARK": 22, + "MWE": 23, + "MWV": 24, + "NEG": 25, + "NN": 26, + "NPADVMOD": 27, + "NSUBJ": 28, + "NSUBJPASS": 29, + "NUM": 30, + "NUMBER": 31, + "P": 32, + "PARATAXIS": 33, + "PARTMOD": 34, + "PCOMP": 35, + "POBJ": 36, + "POSS": 37, + "POSTNEG": 38, + "PRECOMP": 39, + "PRECONJ": 40, + "PREDET": 41, + "PREF": 42, + "PREP": 43, + "PRONL": 44, + "PRT": 45, + "PS": 46, + "QUANTMOD": 47, + "RCMOD": 48, + "RCMODREL": 49, + "RDROP": 50, + "REF": 51, + "REMNANT": 52, + "REPARANDUM": 53, + "ROOT": 54, + "SNUM": 55, + "SUFF": 56, + "TMOD": 57, + "TOPIC": 58, + "VMOD": 59, + "VOCATIVE": 60, + "XCOMP": 61, + "SUFFIX": 62, + "TITLE": 63, + "ADVPHMOD": 64, + "AUXCAUS": 65, + "AUXVV": 66, + "DTMOD": 67, + "FOREIGN": 68, + "KW": 69, + "LIST": 70, + "NOMC": 71, + "NOMCSUBJ": 72, + "NOMCSUBJPASS": 73, + "NUMC": 74, + "COP": 75, + "DISLOCATED": 76, + "ASP": 77, + "GMOD": 78, + "GOBJ": 79, + "INFMOD": 80, + "MES": 81, + "NCOMP": 82, +} + +func (x DependencyEdge_Label) String() string { + return proto.EnumName(DependencyEdge_Label_name, int32(x)) +} +func (DependencyEdge_Label) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{6, 0} } + +// The supported types of mentions. +type EntityMention_Type int32 + +const ( + // Unknown + EntityMention_TYPE_UNKNOWN EntityMention_Type = 0 + // Proper name + EntityMention_PROPER EntityMention_Type = 1 + // Common noun (or noun compound) + EntityMention_COMMON EntityMention_Type = 2 +) + +var EntityMention_Type_name = map[int32]string{ + 0: "TYPE_UNKNOWN", + 1: "PROPER", + 2: "COMMON", +} +var EntityMention_Type_value = map[string]int32{ + "TYPE_UNKNOWN": 0, + "PROPER": 1, + "COMMON": 2, +} + +func (x EntityMention_Type) String() string { + return proto.EnumName(EntityMention_Type_name, int32(x)) +} +func (EntityMention_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{7, 0} } + +// ################################################################ # +// +// Represents the input to API methods. +type Document struct { + // Required. If the type is not set or is `TYPE_UNSPECIFIED`, + // returns an `INVALID_ARGUMENT` error. + Type Document_Type `protobuf:"varint,1,opt,name=type,enum=google.cloud.language.v1.Document_Type" json:"type,omitempty"` + // The source of the document: a string containing the content or a + // Google Cloud Storage URI. + // + // Types that are valid to be assigned to Source: + // *Document_Content + // *Document_GcsContentUri + Source isDocument_Source `protobuf_oneof:"source"` + // The language of the document (if not specified, the language is + // automatically detected). Both ISO and BCP-47 language codes are + // accepted.
+ // [Language Support](/natural-language/docs/languages) + // lists currently supported languages for each API method. + // If the language (either specified by the caller or automatically detected) + // is not supported by the called API method, an `INVALID_ARGUMENT` error + // is returned. + Language string `protobuf:"bytes,4,opt,name=language" json:"language,omitempty"` +} + +func (m *Document) Reset() { *m = Document{} } +func (m *Document) String() string { return proto.CompactTextString(m) } +func (*Document) ProtoMessage() {} +func (*Document) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +type isDocument_Source interface { + isDocument_Source() +} + +type Document_Content struct { + Content string `protobuf:"bytes,2,opt,name=content,oneof"` +} +type Document_GcsContentUri struct { + GcsContentUri string `protobuf:"bytes,3,opt,name=gcs_content_uri,json=gcsContentUri,oneof"` +} + +func (*Document_Content) isDocument_Source() {} +func (*Document_GcsContentUri) isDocument_Source() {} + +func (m *Document) GetSource() isDocument_Source { + if m != nil { + return m.Source + } + return nil +} + +func (m *Document) GetType() Document_Type { + if m != nil { + return m.Type + } + return Document_TYPE_UNSPECIFIED +} + +func (m *Document) GetContent() string { + if x, ok := m.GetSource().(*Document_Content); ok { + return x.Content + } + return "" +} + +func (m *Document) GetGcsContentUri() string { + if x, ok := m.GetSource().(*Document_GcsContentUri); ok { + return x.GcsContentUri + } + return "" +} + +func (m *Document) GetLanguage() string { + if m != nil { + return m.Language + } + return "" +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Document) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _Document_OneofMarshaler, _Document_OneofUnmarshaler, _Document_OneofSizer, []interface{}{ + (*Document_Content)(nil), + (*Document_GcsContentUri)(nil), + } +} + +func _Document_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Document) + // source + switch x := m.Source.(type) { + case *Document_Content: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeStringBytes(x.Content) + case *Document_GcsContentUri: + b.EncodeVarint(3<<3 | proto.WireBytes) + b.EncodeStringBytes(x.GcsContentUri) + case nil: + default: + return fmt.Errorf("Document.Source has unexpected type %T", x) + } + return nil +} + +func _Document_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Document) + switch tag { + case 2: // source.content + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Source = &Document_Content{x} + return true, err + case 3: // source.gcs_content_uri + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Source = &Document_GcsContentUri{x} + return true, err + default: + return false, nil + } +} + +func _Document_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Document) + // source + switch x := m.Source.(type) { + case *Document_Content: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Content))) + n += len(x.Content) + case *Document_GcsContentUri: + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.GcsContentUri))) + n += len(x.GcsContentUri) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Represents a sentence in the input document. +type Sentence struct { + // The sentence text. + Text *TextSpan `protobuf:"bytes,1,opt,name=text" json:"text,omitempty"` + // For calls to [AnalyzeSentiment][] or if + // [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to + // true, this field will contain the sentiment for the sentence. + Sentiment *Sentiment `protobuf:"bytes,2,opt,name=sentiment" json:"sentiment,omitempty"` +} + +func (m *Sentence) Reset() { *m = Sentence{} } +func (m *Sentence) String() string { return proto.CompactTextString(m) } +func (*Sentence) ProtoMessage() {} +func (*Sentence) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *Sentence) GetText() *TextSpan { + if m != nil { + return m.Text + } + return nil +} + +func (m *Sentence) GetSentiment() *Sentiment { + if m != nil { + return m.Sentiment + } + return nil +} + +// Represents a phrase in the text that is a known entity, such as +// a person, an organization, or location. The API associates information, such +// as salience and mentions, with entities. +type Entity struct { + // The representative name for the entity. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The entity type. + Type Entity_Type `protobuf:"varint,2,opt,name=type,enum=google.cloud.language.v1.Entity_Type" json:"type,omitempty"` + // Metadata associated with the entity. + // + // Currently, Wikipedia URLs and Knowledge Graph MIDs are provided, if + // available. The associated keys are "wikipedia_url" and "mid", respectively. + Metadata map[string]string `protobuf:"bytes,3,rep,name=metadata" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // The salience score associated with the entity in the [0, 1.0] range. + // + // The salience score for an entity provides information about the + // importance or centrality of that entity to the entire document text. + // Scores closer to 0 are less salient, while scores closer to 1.0 are highly + // salient. + Salience float32 `protobuf:"fixed32,4,opt,name=salience" json:"salience,omitempty"` + // The mentions of this entity in the input document. The API currently + // supports proper noun mentions. + Mentions []*EntityMention `protobuf:"bytes,5,rep,name=mentions" json:"mentions,omitempty"` + // For calls to [AnalyzeEntitySentiment][] or if + // [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to + // true, this field will contain the aggregate sentiment expressed for this + // entity in the provided document. + Sentiment *Sentiment `protobuf:"bytes,6,opt,name=sentiment" json:"sentiment,omitempty"` +} + +func (m *Entity) Reset() { *m = Entity{} } +func (m *Entity) String() string { return proto.CompactTextString(m) } +func (*Entity) ProtoMessage() {} +func (*Entity) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *Entity) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Entity) GetType() Entity_Type { + if m != nil { + return m.Type + } + return Entity_UNKNOWN +} + +func (m *Entity) GetMetadata() map[string]string { + if m != nil { + return m.Metadata + } + return nil +} + +func (m *Entity) GetSalience() float32 { + if m != nil { + return m.Salience + } + return 0 +} + +func (m *Entity) GetMentions() []*EntityMention { + if m != nil { + return m.Mentions + } + return nil +} + +func (m *Entity) GetSentiment() *Sentiment { + if m != nil { + return m.Sentiment + } + return nil +} + +// Represents the smallest syntactic building block of the text. +type Token struct { + // The token text. + Text *TextSpan `protobuf:"bytes,1,opt,name=text" json:"text,omitempty"` + // Parts of speech tag for this token. + PartOfSpeech *PartOfSpeech `protobuf:"bytes,2,opt,name=part_of_speech,json=partOfSpeech" json:"part_of_speech,omitempty"` + // Dependency tree parse for this token. + DependencyEdge *DependencyEdge `protobuf:"bytes,3,opt,name=dependency_edge,json=dependencyEdge" json:"dependency_edge,omitempty"` + // [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token. + Lemma string `protobuf:"bytes,4,opt,name=lemma" json:"lemma,omitempty"` +} + +func (m *Token) Reset() { *m = Token{} } +func (m *Token) String() string { return proto.CompactTextString(m) } +func (*Token) ProtoMessage() {} +func (*Token) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *Token) GetText() *TextSpan { + if m != nil { + return m.Text + } + return nil +} + +func (m *Token) GetPartOfSpeech() *PartOfSpeech { + if m != nil { + return m.PartOfSpeech + } + return nil +} + +func (m *Token) GetDependencyEdge() *DependencyEdge { + if m != nil { + return m.DependencyEdge + } + return nil +} + +func (m *Token) GetLemma() string { + if m != nil { + return m.Lemma + } + return "" +} + +// Represents the feeling associated with the entire text or entities in +// the text. +type Sentiment struct { + // A non-negative number in the [0, +inf) range, which represents + // the absolute magnitude of sentiment regardless of score (positive or + // negative). + Magnitude float32 `protobuf:"fixed32,2,opt,name=magnitude" json:"magnitude,omitempty"` + // Sentiment score between -1.0 (negative sentiment) and 1.0 + // (positive sentiment). + Score float32 `protobuf:"fixed32,3,opt,name=score" json:"score,omitempty"` +} + +func (m *Sentiment) Reset() { *m = Sentiment{} } +func (m *Sentiment) String() string { return proto.CompactTextString(m) } +func (*Sentiment) ProtoMessage() {} +func (*Sentiment) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *Sentiment) GetMagnitude() float32 { + if m != nil { + return m.Magnitude + } + return 0 +} + +func (m *Sentiment) GetScore() float32 { + if m != nil { + return m.Score + } + return 0 +} + +// Represents part of speech information for a token. Parts of speech +// are as defined in +// http://www.lrec-conf.org/proceedings/lrec2012/pdf/274_Paper.pdf +type PartOfSpeech struct { + // The part of speech tag. + Tag PartOfSpeech_Tag `protobuf:"varint,1,opt,name=tag,enum=google.cloud.language.v1.PartOfSpeech_Tag" json:"tag,omitempty"` + // The grammatical aspect. + Aspect PartOfSpeech_Aspect `protobuf:"varint,2,opt,name=aspect,enum=google.cloud.language.v1.PartOfSpeech_Aspect" json:"aspect,omitempty"` + // The grammatical case. + Case PartOfSpeech_Case `protobuf:"varint,3,opt,name=case,enum=google.cloud.language.v1.PartOfSpeech_Case" json:"case,omitempty"` + // The grammatical form. + Form PartOfSpeech_Form `protobuf:"varint,4,opt,name=form,enum=google.cloud.language.v1.PartOfSpeech_Form" json:"form,omitempty"` + // The grammatical gender. + Gender PartOfSpeech_Gender `protobuf:"varint,5,opt,name=gender,enum=google.cloud.language.v1.PartOfSpeech_Gender" json:"gender,omitempty"` + // The grammatical mood. + Mood PartOfSpeech_Mood `protobuf:"varint,6,opt,name=mood,enum=google.cloud.language.v1.PartOfSpeech_Mood" json:"mood,omitempty"` + // The grammatical number. + Number PartOfSpeech_Number `protobuf:"varint,7,opt,name=number,enum=google.cloud.language.v1.PartOfSpeech_Number" json:"number,omitempty"` + // The grammatical person. + Person PartOfSpeech_Person `protobuf:"varint,8,opt,name=person,enum=google.cloud.language.v1.PartOfSpeech_Person" json:"person,omitempty"` + // The grammatical properness. + Proper PartOfSpeech_Proper `protobuf:"varint,9,opt,name=proper,enum=google.cloud.language.v1.PartOfSpeech_Proper" json:"proper,omitempty"` + // The grammatical reciprocity. + Reciprocity PartOfSpeech_Reciprocity `protobuf:"varint,10,opt,name=reciprocity,enum=google.cloud.language.v1.PartOfSpeech_Reciprocity" json:"reciprocity,omitempty"` + // The grammatical tense. + Tense PartOfSpeech_Tense `protobuf:"varint,11,opt,name=tense,enum=google.cloud.language.v1.PartOfSpeech_Tense" json:"tense,omitempty"` + // The grammatical voice. + Voice PartOfSpeech_Voice `protobuf:"varint,12,opt,name=voice,enum=google.cloud.language.v1.PartOfSpeech_Voice" json:"voice,omitempty"` +} + +func (m *PartOfSpeech) Reset() { *m = PartOfSpeech{} } +func (m *PartOfSpeech) String() string { return proto.CompactTextString(m) } +func (*PartOfSpeech) ProtoMessage() {} +func (*PartOfSpeech) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *PartOfSpeech) GetTag() PartOfSpeech_Tag { + if m != nil { + return m.Tag + } + return PartOfSpeech_UNKNOWN +} + +func (m *PartOfSpeech) GetAspect() PartOfSpeech_Aspect { + if m != nil { + return m.Aspect + } + return PartOfSpeech_ASPECT_UNKNOWN +} + +func (m *PartOfSpeech) GetCase() PartOfSpeech_Case { + if m != nil { + return m.Case + } + return PartOfSpeech_CASE_UNKNOWN +} + +func (m *PartOfSpeech) GetForm() PartOfSpeech_Form { + if m != nil { + return m.Form + } + return PartOfSpeech_FORM_UNKNOWN +} + +func (m *PartOfSpeech) GetGender() PartOfSpeech_Gender { + if m != nil { + return m.Gender + } + return PartOfSpeech_GENDER_UNKNOWN +} + +func (m *PartOfSpeech) GetMood() PartOfSpeech_Mood { + if m != nil { + return m.Mood + } + return PartOfSpeech_MOOD_UNKNOWN +} + +func (m *PartOfSpeech) GetNumber() PartOfSpeech_Number { + if m != nil { + return m.Number + } + return PartOfSpeech_NUMBER_UNKNOWN +} + +func (m *PartOfSpeech) GetPerson() PartOfSpeech_Person { + if m != nil { + return m.Person + } + return PartOfSpeech_PERSON_UNKNOWN +} + +func (m *PartOfSpeech) GetProper() PartOfSpeech_Proper { + if m != nil { + return m.Proper + } + return PartOfSpeech_PROPER_UNKNOWN +} + +func (m *PartOfSpeech) GetReciprocity() PartOfSpeech_Reciprocity { + if m != nil { + return m.Reciprocity + } + return PartOfSpeech_RECIPROCITY_UNKNOWN +} + +func (m *PartOfSpeech) GetTense() PartOfSpeech_Tense { + if m != nil { + return m.Tense + } + return PartOfSpeech_TENSE_UNKNOWN +} + +func (m *PartOfSpeech) GetVoice() PartOfSpeech_Voice { + if m != nil { + return m.Voice + } + return PartOfSpeech_VOICE_UNKNOWN +} + +// Represents dependency parse tree information for a token. (For more +// information on dependency labels, see +// http://www.aclweb.org/anthology/P13-2017 +type DependencyEdge struct { + // Represents the head of this token in the dependency tree. + // This is the index of the token which has an arc going to this token. + // The index is the position of the token in the array of tokens returned + // by the API method. If this token is a root token, then the + // `head_token_index` is its own index. + HeadTokenIndex int32 `protobuf:"varint,1,opt,name=head_token_index,json=headTokenIndex" json:"head_token_index,omitempty"` + // The parse label for the token. + Label DependencyEdge_Label `protobuf:"varint,2,opt,name=label,enum=google.cloud.language.v1.DependencyEdge_Label" json:"label,omitempty"` +} + +func (m *DependencyEdge) Reset() { *m = DependencyEdge{} } +func (m *DependencyEdge) String() string { return proto.CompactTextString(m) } +func (*DependencyEdge) ProtoMessage() {} +func (*DependencyEdge) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *DependencyEdge) GetHeadTokenIndex() int32 { + if m != nil { + return m.HeadTokenIndex + } + return 0 +} + +func (m *DependencyEdge) GetLabel() DependencyEdge_Label { + if m != nil { + return m.Label + } + return DependencyEdge_UNKNOWN +} + +// Represents a mention for an entity in the text. Currently, proper noun +// mentions are supported. +type EntityMention struct { + // The mention text. + Text *TextSpan `protobuf:"bytes,1,opt,name=text" json:"text,omitempty"` + // The type of the entity mention. + Type EntityMention_Type `protobuf:"varint,2,opt,name=type,enum=google.cloud.language.v1.EntityMention_Type" json:"type,omitempty"` + // For calls to [AnalyzeEntitySentiment][] or if + // [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to + // true, this field will contain the sentiment expressed for this mention of + // the entity in the provided document. + Sentiment *Sentiment `protobuf:"bytes,3,opt,name=sentiment" json:"sentiment,omitempty"` +} + +func (m *EntityMention) Reset() { *m = EntityMention{} } +func (m *EntityMention) String() string { return proto.CompactTextString(m) } +func (*EntityMention) ProtoMessage() {} +func (*EntityMention) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *EntityMention) GetText() *TextSpan { + if m != nil { + return m.Text + } + return nil +} + +func (m *EntityMention) GetType() EntityMention_Type { + if m != nil { + return m.Type + } + return EntityMention_TYPE_UNKNOWN +} + +func (m *EntityMention) GetSentiment() *Sentiment { + if m != nil { + return m.Sentiment + } + return nil +} + +// Represents an output piece of text. +type TextSpan struct { + // The content of the output text. + Content string `protobuf:"bytes,1,opt,name=content" json:"content,omitempty"` + // The API calculates the beginning offset of the content in the original + // document according to the [EncodingType][google.cloud.language.v1.EncodingType] specified in the API request. + BeginOffset int32 `protobuf:"varint,2,opt,name=begin_offset,json=beginOffset" json:"begin_offset,omitempty"` +} + +func (m *TextSpan) Reset() { *m = TextSpan{} } +func (m *TextSpan) String() string { return proto.CompactTextString(m) } +func (*TextSpan) ProtoMessage() {} +func (*TextSpan) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *TextSpan) GetContent() string { + if m != nil { + return m.Content + } + return "" +} + +func (m *TextSpan) GetBeginOffset() int32 { + if m != nil { + return m.BeginOffset + } + return 0 +} + +// Represents a category returned from the text classifier. +type ClassificationCategory struct { + // The name of the category representing the document. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The classifier's confidence of the category. Number represents how certain + // the classifier is that this category represents the given text. + Confidence float32 `protobuf:"fixed32,2,opt,name=confidence" json:"confidence,omitempty"` +} + +func (m *ClassificationCategory) Reset() { *m = ClassificationCategory{} } +func (m *ClassificationCategory) String() string { return proto.CompactTextString(m) } +func (*ClassificationCategory) ProtoMessage() {} +func (*ClassificationCategory) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *ClassificationCategory) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ClassificationCategory) GetConfidence() float32 { + if m != nil { + return m.Confidence + } + return 0 +} + +// The sentiment analysis request message. +type AnalyzeSentimentRequest struct { + // Input document. + Document *Document `protobuf:"bytes,1,opt,name=document" json:"document,omitempty"` + // The encoding type used by the API to calculate sentence offsets. + EncodingType EncodingType `protobuf:"varint,2,opt,name=encoding_type,json=encodingType,enum=google.cloud.language.v1.EncodingType" json:"encoding_type,omitempty"` +} + +func (m *AnalyzeSentimentRequest) Reset() { *m = AnalyzeSentimentRequest{} } +func (m *AnalyzeSentimentRequest) String() string { return proto.CompactTextString(m) } +func (*AnalyzeSentimentRequest) ProtoMessage() {} +func (*AnalyzeSentimentRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *AnalyzeSentimentRequest) GetDocument() *Document { + if m != nil { + return m.Document + } + return nil +} + +func (m *AnalyzeSentimentRequest) GetEncodingType() EncodingType { + if m != nil { + return m.EncodingType + } + return EncodingType_NONE +} + +// The sentiment analysis response message. +type AnalyzeSentimentResponse struct { + // The overall sentiment of the input document. + DocumentSentiment *Sentiment `protobuf:"bytes,1,opt,name=document_sentiment,json=documentSentiment" json:"document_sentiment,omitempty"` + // The language of the text, which will be the same as the language specified + // in the request or, if not specified, the automatically-detected language. + // See [Document.language][google.cloud.language.v1.Document.language] field for more details. + Language string `protobuf:"bytes,2,opt,name=language" json:"language,omitempty"` + // The sentiment for all the sentences in the document. + Sentences []*Sentence `protobuf:"bytes,3,rep,name=sentences" json:"sentences,omitempty"` +} + +func (m *AnalyzeSentimentResponse) Reset() { *m = AnalyzeSentimentResponse{} } +func (m *AnalyzeSentimentResponse) String() string { return proto.CompactTextString(m) } +func (*AnalyzeSentimentResponse) ProtoMessage() {} +func (*AnalyzeSentimentResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } + +func (m *AnalyzeSentimentResponse) GetDocumentSentiment() *Sentiment { + if m != nil { + return m.DocumentSentiment + } + return nil +} + +func (m *AnalyzeSentimentResponse) GetLanguage() string { + if m != nil { + return m.Language + } + return "" +} + +func (m *AnalyzeSentimentResponse) GetSentences() []*Sentence { + if m != nil { + return m.Sentences + } + return nil +} + +// The entity-level sentiment analysis request message. +type AnalyzeEntitySentimentRequest struct { + // Input document. + Document *Document `protobuf:"bytes,1,opt,name=document" json:"document,omitempty"` + // The encoding type used by the API to calculate offsets. + EncodingType EncodingType `protobuf:"varint,2,opt,name=encoding_type,json=encodingType,enum=google.cloud.language.v1.EncodingType" json:"encoding_type,omitempty"` +} + +func (m *AnalyzeEntitySentimentRequest) Reset() { *m = AnalyzeEntitySentimentRequest{} } +func (m *AnalyzeEntitySentimentRequest) String() string { return proto.CompactTextString(m) } +func (*AnalyzeEntitySentimentRequest) ProtoMessage() {} +func (*AnalyzeEntitySentimentRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } + +func (m *AnalyzeEntitySentimentRequest) GetDocument() *Document { + if m != nil { + return m.Document + } + return nil +} + +func (m *AnalyzeEntitySentimentRequest) GetEncodingType() EncodingType { + if m != nil { + return m.EncodingType + } + return EncodingType_NONE +} + +// The entity-level sentiment analysis response message. +type AnalyzeEntitySentimentResponse struct { + // The recognized entities in the input document with associated sentiments. + Entities []*Entity `protobuf:"bytes,1,rep,name=entities" json:"entities,omitempty"` + // The language of the text, which will be the same as the language specified + // in the request or, if not specified, the automatically-detected language. + // See [Document.language][google.cloud.language.v1.Document.language] field for more details. + Language string `protobuf:"bytes,2,opt,name=language" json:"language,omitempty"` +} + +func (m *AnalyzeEntitySentimentResponse) Reset() { *m = AnalyzeEntitySentimentResponse{} } +func (m *AnalyzeEntitySentimentResponse) String() string { return proto.CompactTextString(m) } +func (*AnalyzeEntitySentimentResponse) ProtoMessage() {} +func (*AnalyzeEntitySentimentResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } + +func (m *AnalyzeEntitySentimentResponse) GetEntities() []*Entity { + if m != nil { + return m.Entities + } + return nil +} + +func (m *AnalyzeEntitySentimentResponse) GetLanguage() string { + if m != nil { + return m.Language + } + return "" +} + +// The entity analysis request message. +type AnalyzeEntitiesRequest struct { + // Input document. + Document *Document `protobuf:"bytes,1,opt,name=document" json:"document,omitempty"` + // The encoding type used by the API to calculate offsets. + EncodingType EncodingType `protobuf:"varint,2,opt,name=encoding_type,json=encodingType,enum=google.cloud.language.v1.EncodingType" json:"encoding_type,omitempty"` +} + +func (m *AnalyzeEntitiesRequest) Reset() { *m = AnalyzeEntitiesRequest{} } +func (m *AnalyzeEntitiesRequest) String() string { return proto.CompactTextString(m) } +func (*AnalyzeEntitiesRequest) ProtoMessage() {} +func (*AnalyzeEntitiesRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } + +func (m *AnalyzeEntitiesRequest) GetDocument() *Document { + if m != nil { + return m.Document + } + return nil +} + +func (m *AnalyzeEntitiesRequest) GetEncodingType() EncodingType { + if m != nil { + return m.EncodingType + } + return EncodingType_NONE +} + +// The entity analysis response message. +type AnalyzeEntitiesResponse struct { + // The recognized entities in the input document. + Entities []*Entity `protobuf:"bytes,1,rep,name=entities" json:"entities,omitempty"` + // The language of the text, which will be the same as the language specified + // in the request or, if not specified, the automatically-detected language. + // See [Document.language][google.cloud.language.v1.Document.language] field for more details. + Language string `protobuf:"bytes,2,opt,name=language" json:"language,omitempty"` +} + +func (m *AnalyzeEntitiesResponse) Reset() { *m = AnalyzeEntitiesResponse{} } +func (m *AnalyzeEntitiesResponse) String() string { return proto.CompactTextString(m) } +func (*AnalyzeEntitiesResponse) ProtoMessage() {} +func (*AnalyzeEntitiesResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } + +func (m *AnalyzeEntitiesResponse) GetEntities() []*Entity { + if m != nil { + return m.Entities + } + return nil +} + +func (m *AnalyzeEntitiesResponse) GetLanguage() string { + if m != nil { + return m.Language + } + return "" +} + +// The syntax analysis request message. +type AnalyzeSyntaxRequest struct { + // Input document. + Document *Document `protobuf:"bytes,1,opt,name=document" json:"document,omitempty"` + // The encoding type used by the API to calculate offsets. + EncodingType EncodingType `protobuf:"varint,2,opt,name=encoding_type,json=encodingType,enum=google.cloud.language.v1.EncodingType" json:"encoding_type,omitempty"` +} + +func (m *AnalyzeSyntaxRequest) Reset() { *m = AnalyzeSyntaxRequest{} } +func (m *AnalyzeSyntaxRequest) String() string { return proto.CompactTextString(m) } +func (*AnalyzeSyntaxRequest) ProtoMessage() {} +func (*AnalyzeSyntaxRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} } + +func (m *AnalyzeSyntaxRequest) GetDocument() *Document { + if m != nil { + return m.Document + } + return nil +} + +func (m *AnalyzeSyntaxRequest) GetEncodingType() EncodingType { + if m != nil { + return m.EncodingType + } + return EncodingType_NONE +} + +// The syntax analysis response message. +type AnalyzeSyntaxResponse struct { + // Sentences in the input document. + Sentences []*Sentence `protobuf:"bytes,1,rep,name=sentences" json:"sentences,omitempty"` + // Tokens, along with their syntactic information, in the input document. + Tokens []*Token `protobuf:"bytes,2,rep,name=tokens" json:"tokens,omitempty"` + // The language of the text, which will be the same as the language specified + // in the request or, if not specified, the automatically-detected language. + // See [Document.language][google.cloud.language.v1.Document.language] field for more details. + Language string `protobuf:"bytes,3,opt,name=language" json:"language,omitempty"` +} + +func (m *AnalyzeSyntaxResponse) Reset() { *m = AnalyzeSyntaxResponse{} } +func (m *AnalyzeSyntaxResponse) String() string { return proto.CompactTextString(m) } +func (*AnalyzeSyntaxResponse) ProtoMessage() {} +func (*AnalyzeSyntaxResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17} } + +func (m *AnalyzeSyntaxResponse) GetSentences() []*Sentence { + if m != nil { + return m.Sentences + } + return nil +} + +func (m *AnalyzeSyntaxResponse) GetTokens() []*Token { + if m != nil { + return m.Tokens + } + return nil +} + +func (m *AnalyzeSyntaxResponse) GetLanguage() string { + if m != nil { + return m.Language + } + return "" +} + +// The document classification request message. +type ClassifyTextRequest struct { + // Input document. + Document *Document `protobuf:"bytes,1,opt,name=document" json:"document,omitempty"` +} + +func (m *ClassifyTextRequest) Reset() { *m = ClassifyTextRequest{} } +func (m *ClassifyTextRequest) String() string { return proto.CompactTextString(m) } +func (*ClassifyTextRequest) ProtoMessage() {} +func (*ClassifyTextRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{18} } + +func (m *ClassifyTextRequest) GetDocument() *Document { + if m != nil { + return m.Document + } + return nil +} + +// The document classification response message. +type ClassifyTextResponse struct { + // Categories representing the input document. + Categories []*ClassificationCategory `protobuf:"bytes,1,rep,name=categories" json:"categories,omitempty"` +} + +func (m *ClassifyTextResponse) Reset() { *m = ClassifyTextResponse{} } +func (m *ClassifyTextResponse) String() string { return proto.CompactTextString(m) } +func (*ClassifyTextResponse) ProtoMessage() {} +func (*ClassifyTextResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{19} } + +func (m *ClassifyTextResponse) GetCategories() []*ClassificationCategory { + if m != nil { + return m.Categories + } + return nil +} + +// The request message for the text annotation API, which can perform multiple +// analysis types (sentiment, entities, and syntax) in one call. +type AnnotateTextRequest struct { + // Input document. + Document *Document `protobuf:"bytes,1,opt,name=document" json:"document,omitempty"` + // The enabled features. + Features *AnnotateTextRequest_Features `protobuf:"bytes,2,opt,name=features" json:"features,omitempty"` + // The encoding type used by the API to calculate offsets. + EncodingType EncodingType `protobuf:"varint,3,opt,name=encoding_type,json=encodingType,enum=google.cloud.language.v1.EncodingType" json:"encoding_type,omitempty"` +} + +func (m *AnnotateTextRequest) Reset() { *m = AnnotateTextRequest{} } +func (m *AnnotateTextRequest) String() string { return proto.CompactTextString(m) } +func (*AnnotateTextRequest) ProtoMessage() {} +func (*AnnotateTextRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20} } + +func (m *AnnotateTextRequest) GetDocument() *Document { + if m != nil { + return m.Document + } + return nil +} + +func (m *AnnotateTextRequest) GetFeatures() *AnnotateTextRequest_Features { + if m != nil { + return m.Features + } + return nil +} + +func (m *AnnotateTextRequest) GetEncodingType() EncodingType { + if m != nil { + return m.EncodingType + } + return EncodingType_NONE +} + +// All available features for sentiment, syntax, and semantic analysis. +// Setting each one to true will enable that specific analysis for the input. +type AnnotateTextRequest_Features struct { + // Extract syntax information. + ExtractSyntax bool `protobuf:"varint,1,opt,name=extract_syntax,json=extractSyntax" json:"extract_syntax,omitempty"` + // Extract entities. + ExtractEntities bool `protobuf:"varint,2,opt,name=extract_entities,json=extractEntities" json:"extract_entities,omitempty"` + // Extract document-level sentiment. + ExtractDocumentSentiment bool `protobuf:"varint,3,opt,name=extract_document_sentiment,json=extractDocumentSentiment" json:"extract_document_sentiment,omitempty"` + // Extract entities and their associated sentiment. + ExtractEntitySentiment bool `protobuf:"varint,4,opt,name=extract_entity_sentiment,json=extractEntitySentiment" json:"extract_entity_sentiment,omitempty"` + // Classify the full document into categories. + ClassifyText bool `protobuf:"varint,6,opt,name=classify_text,json=classifyText" json:"classify_text,omitempty"` +} + +func (m *AnnotateTextRequest_Features) Reset() { *m = AnnotateTextRequest_Features{} } +func (m *AnnotateTextRequest_Features) String() string { return proto.CompactTextString(m) } +func (*AnnotateTextRequest_Features) ProtoMessage() {} +func (*AnnotateTextRequest_Features) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{20, 0} +} + +func (m *AnnotateTextRequest_Features) GetExtractSyntax() bool { + if m != nil { + return m.ExtractSyntax + } + return false +} + +func (m *AnnotateTextRequest_Features) GetExtractEntities() bool { + if m != nil { + return m.ExtractEntities + } + return false +} + +func (m *AnnotateTextRequest_Features) GetExtractDocumentSentiment() bool { + if m != nil { + return m.ExtractDocumentSentiment + } + return false +} + +func (m *AnnotateTextRequest_Features) GetExtractEntitySentiment() bool { + if m != nil { + return m.ExtractEntitySentiment + } + return false +} + +func (m *AnnotateTextRequest_Features) GetClassifyText() bool { + if m != nil { + return m.ClassifyText + } + return false +} + +// The text annotations response message. +type AnnotateTextResponse struct { + // Sentences in the input document. Populated if the user enables + // [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax]. + Sentences []*Sentence `protobuf:"bytes,1,rep,name=sentences" json:"sentences,omitempty"` + // Tokens, along with their syntactic information, in the input document. + // Populated if the user enables + // [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax]. + Tokens []*Token `protobuf:"bytes,2,rep,name=tokens" json:"tokens,omitempty"` + // Entities, along with their semantic information, in the input document. + // Populated if the user enables + // [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entities]. + Entities []*Entity `protobuf:"bytes,3,rep,name=entities" json:"entities,omitempty"` + // The overall sentiment for the document. Populated if the user enables + // [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]. + DocumentSentiment *Sentiment `protobuf:"bytes,4,opt,name=document_sentiment,json=documentSentiment" json:"document_sentiment,omitempty"` + // The language of the text, which will be the same as the language specified + // in the request or, if not specified, the automatically-detected language. + // See [Document.language][google.cloud.language.v1.Document.language] field for more details. + Language string `protobuf:"bytes,5,opt,name=language" json:"language,omitempty"` + // Categories identified in the input document. + Categories []*ClassificationCategory `protobuf:"bytes,6,rep,name=categories" json:"categories,omitempty"` +} + +func (m *AnnotateTextResponse) Reset() { *m = AnnotateTextResponse{} } +func (m *AnnotateTextResponse) String() string { return proto.CompactTextString(m) } +func (*AnnotateTextResponse) ProtoMessage() {} +func (*AnnotateTextResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{21} } + +func (m *AnnotateTextResponse) GetSentences() []*Sentence { + if m != nil { + return m.Sentences + } + return nil +} + +func (m *AnnotateTextResponse) GetTokens() []*Token { + if m != nil { + return m.Tokens + } + return nil +} + +func (m *AnnotateTextResponse) GetEntities() []*Entity { + if m != nil { + return m.Entities + } + return nil +} + +func (m *AnnotateTextResponse) GetDocumentSentiment() *Sentiment { + if m != nil { + return m.DocumentSentiment + } + return nil +} + +func (m *AnnotateTextResponse) GetLanguage() string { + if m != nil { + return m.Language + } + return "" +} + +func (m *AnnotateTextResponse) GetCategories() []*ClassificationCategory { + if m != nil { + return m.Categories + } + return nil +} + +func init() { + proto.RegisterType((*Document)(nil), "google.cloud.language.v1.Document") + proto.RegisterType((*Sentence)(nil), "google.cloud.language.v1.Sentence") + proto.RegisterType((*Entity)(nil), "google.cloud.language.v1.Entity") + proto.RegisterType((*Token)(nil), "google.cloud.language.v1.Token") + proto.RegisterType((*Sentiment)(nil), "google.cloud.language.v1.Sentiment") + proto.RegisterType((*PartOfSpeech)(nil), "google.cloud.language.v1.PartOfSpeech") + proto.RegisterType((*DependencyEdge)(nil), "google.cloud.language.v1.DependencyEdge") + proto.RegisterType((*EntityMention)(nil), "google.cloud.language.v1.EntityMention") + proto.RegisterType((*TextSpan)(nil), "google.cloud.language.v1.TextSpan") + proto.RegisterType((*ClassificationCategory)(nil), "google.cloud.language.v1.ClassificationCategory") + proto.RegisterType((*AnalyzeSentimentRequest)(nil), "google.cloud.language.v1.AnalyzeSentimentRequest") + proto.RegisterType((*AnalyzeSentimentResponse)(nil), "google.cloud.language.v1.AnalyzeSentimentResponse") + proto.RegisterType((*AnalyzeEntitySentimentRequest)(nil), "google.cloud.language.v1.AnalyzeEntitySentimentRequest") + proto.RegisterType((*AnalyzeEntitySentimentResponse)(nil), "google.cloud.language.v1.AnalyzeEntitySentimentResponse") + proto.RegisterType((*AnalyzeEntitiesRequest)(nil), "google.cloud.language.v1.AnalyzeEntitiesRequest") + proto.RegisterType((*AnalyzeEntitiesResponse)(nil), "google.cloud.language.v1.AnalyzeEntitiesResponse") + proto.RegisterType((*AnalyzeSyntaxRequest)(nil), "google.cloud.language.v1.AnalyzeSyntaxRequest") + proto.RegisterType((*AnalyzeSyntaxResponse)(nil), "google.cloud.language.v1.AnalyzeSyntaxResponse") + proto.RegisterType((*ClassifyTextRequest)(nil), "google.cloud.language.v1.ClassifyTextRequest") + proto.RegisterType((*ClassifyTextResponse)(nil), "google.cloud.language.v1.ClassifyTextResponse") + proto.RegisterType((*AnnotateTextRequest)(nil), "google.cloud.language.v1.AnnotateTextRequest") + proto.RegisterType((*AnnotateTextRequest_Features)(nil), "google.cloud.language.v1.AnnotateTextRequest.Features") + proto.RegisterType((*AnnotateTextResponse)(nil), "google.cloud.language.v1.AnnotateTextResponse") + proto.RegisterEnum("google.cloud.language.v1.EncodingType", EncodingType_name, EncodingType_value) + proto.RegisterEnum("google.cloud.language.v1.Document_Type", Document_Type_name, Document_Type_value) + proto.RegisterEnum("google.cloud.language.v1.Entity_Type", Entity_Type_name, Entity_Type_value) + proto.RegisterEnum("google.cloud.language.v1.PartOfSpeech_Tag", PartOfSpeech_Tag_name, PartOfSpeech_Tag_value) + proto.RegisterEnum("google.cloud.language.v1.PartOfSpeech_Aspect", PartOfSpeech_Aspect_name, PartOfSpeech_Aspect_value) + proto.RegisterEnum("google.cloud.language.v1.PartOfSpeech_Case", PartOfSpeech_Case_name, PartOfSpeech_Case_value) + proto.RegisterEnum("google.cloud.language.v1.PartOfSpeech_Form", PartOfSpeech_Form_name, PartOfSpeech_Form_value) + proto.RegisterEnum("google.cloud.language.v1.PartOfSpeech_Gender", PartOfSpeech_Gender_name, PartOfSpeech_Gender_value) + proto.RegisterEnum("google.cloud.language.v1.PartOfSpeech_Mood", PartOfSpeech_Mood_name, PartOfSpeech_Mood_value) + proto.RegisterEnum("google.cloud.language.v1.PartOfSpeech_Number", PartOfSpeech_Number_name, PartOfSpeech_Number_value) + proto.RegisterEnum("google.cloud.language.v1.PartOfSpeech_Person", PartOfSpeech_Person_name, PartOfSpeech_Person_value) + proto.RegisterEnum("google.cloud.language.v1.PartOfSpeech_Proper", PartOfSpeech_Proper_name, PartOfSpeech_Proper_value) + proto.RegisterEnum("google.cloud.language.v1.PartOfSpeech_Reciprocity", PartOfSpeech_Reciprocity_name, PartOfSpeech_Reciprocity_value) + proto.RegisterEnum("google.cloud.language.v1.PartOfSpeech_Tense", PartOfSpeech_Tense_name, PartOfSpeech_Tense_value) + proto.RegisterEnum("google.cloud.language.v1.PartOfSpeech_Voice", PartOfSpeech_Voice_name, PartOfSpeech_Voice_value) + proto.RegisterEnum("google.cloud.language.v1.DependencyEdge_Label", DependencyEdge_Label_name, DependencyEdge_Label_value) + proto.RegisterEnum("google.cloud.language.v1.EntityMention_Type", EntityMention_Type_name, EntityMention_Type_value) +} + +// 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 + +// Client API for LanguageService service + +type LanguageServiceClient interface { + // Analyzes the sentiment of the provided text. + AnalyzeSentiment(ctx context.Context, in *AnalyzeSentimentRequest, opts ...grpc.CallOption) (*AnalyzeSentimentResponse, error) + // Finds named entities (currently proper names and common nouns) in the text + // along with entity types, salience, mentions for each entity, and + // other properties. + AnalyzeEntities(ctx context.Context, in *AnalyzeEntitiesRequest, opts ...grpc.CallOption) (*AnalyzeEntitiesResponse, error) + // Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities] in the text and analyzes + // sentiment associated with each entity and its mentions. + AnalyzeEntitySentiment(ctx context.Context, in *AnalyzeEntitySentimentRequest, opts ...grpc.CallOption) (*AnalyzeEntitySentimentResponse, error) + // Analyzes the syntax of the text and provides sentence boundaries and + // tokenization along with part of speech tags, dependency trees, and other + // properties. + AnalyzeSyntax(ctx context.Context, in *AnalyzeSyntaxRequest, opts ...grpc.CallOption) (*AnalyzeSyntaxResponse, error) + // Classifies a document into categories. + ClassifyText(ctx context.Context, in *ClassifyTextRequest, opts ...grpc.CallOption) (*ClassifyTextResponse, error) + // A convenience method that provides all the features that analyzeSentiment, + // analyzeEntities, and analyzeSyntax provide in one call. + AnnotateText(ctx context.Context, in *AnnotateTextRequest, opts ...grpc.CallOption) (*AnnotateTextResponse, error) +} + +type languageServiceClient struct { + cc *grpc.ClientConn +} + +func NewLanguageServiceClient(cc *grpc.ClientConn) LanguageServiceClient { + return &languageServiceClient{cc} +} + +func (c *languageServiceClient) AnalyzeSentiment(ctx context.Context, in *AnalyzeSentimentRequest, opts ...grpc.CallOption) (*AnalyzeSentimentResponse, error) { + out := new(AnalyzeSentimentResponse) + err := grpc.Invoke(ctx, "/google.cloud.language.v1.LanguageService/AnalyzeSentiment", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *languageServiceClient) AnalyzeEntities(ctx context.Context, in *AnalyzeEntitiesRequest, opts ...grpc.CallOption) (*AnalyzeEntitiesResponse, error) { + out := new(AnalyzeEntitiesResponse) + err := grpc.Invoke(ctx, "/google.cloud.language.v1.LanguageService/AnalyzeEntities", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *languageServiceClient) AnalyzeEntitySentiment(ctx context.Context, in *AnalyzeEntitySentimentRequest, opts ...grpc.CallOption) (*AnalyzeEntitySentimentResponse, error) { + out := new(AnalyzeEntitySentimentResponse) + err := grpc.Invoke(ctx, "/google.cloud.language.v1.LanguageService/AnalyzeEntitySentiment", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *languageServiceClient) AnalyzeSyntax(ctx context.Context, in *AnalyzeSyntaxRequest, opts ...grpc.CallOption) (*AnalyzeSyntaxResponse, error) { + out := new(AnalyzeSyntaxResponse) + err := grpc.Invoke(ctx, "/google.cloud.language.v1.LanguageService/AnalyzeSyntax", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *languageServiceClient) ClassifyText(ctx context.Context, in *ClassifyTextRequest, opts ...grpc.CallOption) (*ClassifyTextResponse, error) { + out := new(ClassifyTextResponse) + err := grpc.Invoke(ctx, "/google.cloud.language.v1.LanguageService/ClassifyText", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *languageServiceClient) AnnotateText(ctx context.Context, in *AnnotateTextRequest, opts ...grpc.CallOption) (*AnnotateTextResponse, error) { + out := new(AnnotateTextResponse) + err := grpc.Invoke(ctx, "/google.cloud.language.v1.LanguageService/AnnotateText", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for LanguageService service + +type LanguageServiceServer interface { + // Analyzes the sentiment of the provided text. + AnalyzeSentiment(context.Context, *AnalyzeSentimentRequest) (*AnalyzeSentimentResponse, error) + // Finds named entities (currently proper names and common nouns) in the text + // along with entity types, salience, mentions for each entity, and + // other properties. + AnalyzeEntities(context.Context, *AnalyzeEntitiesRequest) (*AnalyzeEntitiesResponse, error) + // Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities] in the text and analyzes + // sentiment associated with each entity and its mentions. + AnalyzeEntitySentiment(context.Context, *AnalyzeEntitySentimentRequest) (*AnalyzeEntitySentimentResponse, error) + // Analyzes the syntax of the text and provides sentence boundaries and + // tokenization along with part of speech tags, dependency trees, and other + // properties. + AnalyzeSyntax(context.Context, *AnalyzeSyntaxRequest) (*AnalyzeSyntaxResponse, error) + // Classifies a document into categories. + ClassifyText(context.Context, *ClassifyTextRequest) (*ClassifyTextResponse, error) + // A convenience method that provides all the features that analyzeSentiment, + // analyzeEntities, and analyzeSyntax provide in one call. + AnnotateText(context.Context, *AnnotateTextRequest) (*AnnotateTextResponse, error) +} + +func RegisterLanguageServiceServer(s *grpc.Server, srv LanguageServiceServer) { + s.RegisterService(&_LanguageService_serviceDesc, srv) +} + +func _LanguageService_AnalyzeSentiment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AnalyzeSentimentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LanguageServiceServer).AnalyzeSentiment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.language.v1.LanguageService/AnalyzeSentiment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LanguageServiceServer).AnalyzeSentiment(ctx, req.(*AnalyzeSentimentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LanguageService_AnalyzeEntities_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AnalyzeEntitiesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LanguageServiceServer).AnalyzeEntities(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.language.v1.LanguageService/AnalyzeEntities", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LanguageServiceServer).AnalyzeEntities(ctx, req.(*AnalyzeEntitiesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LanguageService_AnalyzeEntitySentiment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AnalyzeEntitySentimentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LanguageServiceServer).AnalyzeEntitySentiment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.language.v1.LanguageService/AnalyzeEntitySentiment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LanguageServiceServer).AnalyzeEntitySentiment(ctx, req.(*AnalyzeEntitySentimentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LanguageService_AnalyzeSyntax_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AnalyzeSyntaxRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LanguageServiceServer).AnalyzeSyntax(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.language.v1.LanguageService/AnalyzeSyntax", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LanguageServiceServer).AnalyzeSyntax(ctx, req.(*AnalyzeSyntaxRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LanguageService_ClassifyText_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ClassifyTextRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LanguageServiceServer).ClassifyText(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.language.v1.LanguageService/ClassifyText", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LanguageServiceServer).ClassifyText(ctx, req.(*ClassifyTextRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LanguageService_AnnotateText_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AnnotateTextRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LanguageServiceServer).AnnotateText(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.language.v1.LanguageService/AnnotateText", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LanguageServiceServer).AnnotateText(ctx, req.(*AnnotateTextRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _LanguageService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.cloud.language.v1.LanguageService", + HandlerType: (*LanguageServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "AnalyzeSentiment", + Handler: _LanguageService_AnalyzeSentiment_Handler, + }, + { + MethodName: "AnalyzeEntities", + Handler: _LanguageService_AnalyzeEntities_Handler, + }, + { + MethodName: "AnalyzeEntitySentiment", + Handler: _LanguageService_AnalyzeEntitySentiment_Handler, + }, + { + MethodName: "AnalyzeSyntax", + Handler: _LanguageService_AnalyzeSyntax_Handler, + }, + { + MethodName: "ClassifyText", + Handler: _LanguageService_ClassifyText_Handler, + }, + { + MethodName: "AnnotateText", + Handler: _LanguageService_AnnotateText_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/cloud/language/v1/language_service.proto", +} + +func init() { proto.RegisterFile("google/cloud/language/v1/language_service.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 2967 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x5a, 0xcb, 0x73, 0xdb, 0xd6, + 0xd5, 0x37, 0xf8, 0x12, 0x75, 0x28, 0xc9, 0xd7, 0xb0, 0xe3, 0xf0, 0x53, 0x1c, 0xc7, 0x81, 0x63, + 0x47, 0x76, 0x12, 0xca, 0x56, 0xbe, 0xcf, 0x71, 0x6c, 0x7f, 0x89, 0x21, 0xf0, 0x92, 0x82, 0x0c, + 0x02, 0xf0, 0x05, 0x40, 0x2b, 0xd9, 0x70, 0x60, 0x12, 0x62, 0x38, 0x91, 0x08, 0x96, 0x80, 0x3c, + 0x56, 0x36, 0x9d, 0xe9, 0x4c, 0x97, 0x5d, 0x74, 0xda, 0x45, 0x97, 0x9d, 0xe9, 0x63, 0xa6, 0x33, + 0x99, 0xf6, 0x1f, 0xe8, 0x9f, 0xd0, 0x5d, 0xff, 0x84, 0x76, 0xd7, 0x5d, 0x17, 0x9d, 0x76, 0xd1, + 0xc7, 0x9c, 0x7b, 0x01, 0x12, 0x94, 0x25, 0x59, 0x72, 0xd3, 0x69, 0x76, 0xf7, 0x1e, 0x9e, 0xdf, + 0x79, 0xdd, 0xf3, 0xb8, 0xb8, 0x12, 0xac, 0xf6, 0xc3, 0xb0, 0xbf, 0x13, 0xac, 0x76, 0x77, 0xc2, + 0xbd, 0xde, 0xea, 0x8e, 0x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d, 0xf2, 0x29, 0xcc, 0x4f, 0x0e, 0x52, 0xbe, + 0x04, 0xf3, 0xbb, 0x7e, 0x7f, 0x38, 0x88, 0xf7, 0x7a, 0xe2, 0x78, 0x72, 0x6c, 0x4a, 0x40, 0x01, + 0x51, 0x37, 0x1c, 0x0b, 0x4b, 0x72, 0x4c, 0x6c, 0x94, 0xbf, 0x13, 0x58, 0xc8, 0x3a, 0x22, 0x3f, + 0x80, 0x7c, 0xec, 0xf7, 0x93, 0xa6, 0x75, 0xf3, 0x64, 0xde, 0xd7, 0x5c, 0xbf, 0xcf, 0x10, 0x26, + 0x53, 0x28, 0xf9, 0xd1, 0x28, 0xe8, 0xc6, 0x49, 0xb5, 0x7d, 0x70, 0x42, 0x01, 0x2a, 0x07, 0xb1, + 0x04, 0x2c, 0x7f, 0x0a, 0x85, 0xae, 0x1f, 0x09, 0x53, 0x97, 0xd6, 0xde, 0x3b, 0xa1, 0x10, 0xcd, + 0x8f, 0x02, 0xc6, 0x81, 0x28, 0x60, 0x3b, 0x1c, 0xef, 0xf2, 0x60, 0x9d, 0x5c, 0x40, 0x23, 0x1c, + 0xef, 0x32, 0x0e, 0x44, 0x47, 0xfa, 0x18, 0xfe, 0x71, 0xb5, 0x78, 0x2a, 0x47, 0x9a, 0x1c, 0xc4, + 0x12, 0x30, 0xda, 0xb1, 0x1b, 0x86, 0x3d, 0x5e, 0x8e, 0x27, 0xb7, 0xa3, 0x15, 0x86, 0x3d, 0xc6, + 0x81, 0x68, 0xc7, 0x70, 0x6f, 0xf7, 0x69, 0x30, 0xae, 0xce, 0x9d, 0xca, 0x0e, 0x93, 0x83, 0x58, + 0x02, 0x46, 0x31, 0xa3, 0x60, 0x1c, 0x85, 0xc3, 0x6a, 0xf9, 0x54, 0x62, 0x6c, 0x0e, 0x62, 0x09, + 0x98, 0x8b, 0x19, 0x87, 0xa3, 0x60, 0x5c, 0x9d, 0x3f, 0x9d, 0x18, 0x0e, 0x62, 0x09, 0x58, 0x76, + 0xa1, 0x32, 0x0e, 0xba, 0x83, 0xd1, 0x38, 0xec, 0x0e, 0xe2, 0xfd, 0x2a, 0x70, 0x59, 0x6b, 0x27, + 0x94, 0xc5, 0xa6, 0x48, 0x96, 0x15, 0x23, 0xaf, 0x43, 0x31, 0x0e, 0x86, 0x51, 0x50, 0xad, 0x70, + 0x79, 0xef, 0x9f, 0x34, 0x77, 0x11, 0xc3, 0x04, 0x14, 0x65, 0x3c, 0x0b, 0x07, 0xdd, 0xa0, 0xba, + 0x70, 0x2a, 0x19, 0x6d, 0xc4, 0x30, 0x01, 0x55, 0x7e, 0x20, 0x41, 0xde, 0xf5, 0xfb, 0xb3, 0x7d, + 0x70, 0x0e, 0xf2, 0x6a, 0x7d, 0x93, 0x48, 0x62, 0x61, 0x93, 0x9c, 0x58, 0xb4, 0x49, 0x1e, 0x47, + 0xab, 0x66, 0x99, 0x9b, 0xa4, 0x80, 0xa4, 0x3a, 0xc5, 0x6e, 0x57, 0x86, 0x82, 0x69, 0x79, 0x26, + 0x29, 0x21, 0xc9, 0xf4, 0x5a, 0x64, 0x0e, 0x49, 0x36, 0xb3, 0x4c, 0x52, 0x46, 0x92, 0xcd, 0x5c, + 0x32, 0x8f, 0x0d, 0xd0, 0xf6, 0x4c, 0xcd, 0x25, 0x80, 0xbf, 0xb6, 0x29, 0x5b, 0x27, 0x15, 0xb9, + 0x08, 0xd2, 0x16, 0x59, 0xc0, 0xdf, 0xd4, 0x46, 0x43, 0xdf, 0x22, 0x8b, 0x8a, 0x05, 0x25, 0x51, + 0x5e, 0xb2, 0x0c, 0x4b, 0x2a, 0x0e, 0x79, 0xb7, 0x33, 0x35, 0x0c, 0x07, 0x3d, 0x65, 0x0d, 0xaa, + 0xb9, 0x7a, 0x9b, 0x12, 0x09, 0xdb, 0xb2, 0xde, 0xca, 0x50, 0x72, 0xd8, 0x8b, 0x6d, 0x66, 0x35, + 0x19, 0x75, 0x1c, 0x24, 0xe4, 0x95, 0xbf, 0x4a, 0x50, 0xc0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x8a, 0x0d, 0x9d, 0x39, 0xae, 0x80, 0x3b, 0x14, 0x7d, + 0x22, 0x39, 0x24, 0xbb, 0x1b, 0x3a, 0xab, 0x93, 0x3c, 0x3a, 0x3a, 0x4d, 0x98, 0xe4, 0x52, 0x53, + 0x50, 0xee, 0x42, 0x49, 0x74, 0x37, 0x2e, 0x95, 0x59, 0xf6, 0x8c, 0x5d, 0x68, 0x09, 0xa7, 0x89, + 0x90, 0x98, 0x96, 0xdb, 0x49, 0xf6, 0x39, 0x65, 0x13, 0x2a, 0x99, 0x5e, 0x26, 0xbf, 0x0e, 0xe7, + 0x19, 0xd5, 0x74, 0x9b, 0x59, 0x9a, 0xee, 0x7e, 0x36, 0x5b, 0x53, 0xe9, 0x0f, 0x3c, 0xb5, 0xd0, + 0x7f, 0xcb, 0xec, 0x64, 0x68, 0x39, 0x25, 0x82, 0x22, 0xef, 0x63, 0x18, 0x57, 0x97, 0x9a, 0x33, + 0x35, 0xf9, 0x1a, 0x9c, 0xcb, 0x1e, 0x10, 0xff, 0x59, 0x78, 0xd9, 0xf0, 0x5c, 0x8f, 0x51, 0x11, + 0x24, 0x5b, 0x75, 0x5c, 0x92, 0xc7, 0x43, 0xb0, 0x19, 0x75, 0xc4, 0x2d, 0x6c, 0x11, 0xe6, 0x27, + 0xbd, 0x80, 0x14, 0xc5, 0x37, 0x81, 0x97, 0xee, 0x4b, 0xca, 0x3a, 0x14, 0x79, 0xe3, 0x43, 0xa5, + 0x6d, 0x4b, 0xd7, 0xe8, 0xac, 0xe3, 0xaa, 0x36, 0x6d, 0x02, 0x9a, 0x9a, 0xf6, 0x84, 0x1c, 0x57, + 0xa1, 0xa6, 0xbd, 0xe4, 0xeb, 0x32, 0x2c, 0xcd, 0xde, 0x7c, 0xe4, 0x15, 0x20, 0x5f, 0x04, 0x7e, + 0xaf, 0x13, 0xe3, 0x85, 0xae, 0x33, 0x18, 0xf6, 0x82, 0xe7, 0xfc, 0x3a, 0x52, 0x64, 0x4b, 0x48,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0x0f, 0x45, 0x06, 0x61, 0x04, 0xa3, 0xe4, + 0x7d, 0x49, 0x39, 0x5e, 0x0d, 0xb2, 0xb2, 0x29, 0x48, 0xf9, 0x5a, 0x82, 0x37, 0x13, 0x77, 0x44, + 0x9e, 0x7e, 0xbb, 0xa3, 0xff, 0x15, 0x5c, 0x3e, 0xca, 0xda, 0xe4, 0x08, 0x1e, 0x40, 0x19, 0x69, + 0xf1, 0x20, 0x88, 0xaa, 0x12, 0x8f, 0xc8, 0x95, 0x97, 0x95, 0x26, 0x9b, 0x20, 0x8e, 0x0b, 0xb6, + 0xf2, 0x0b, 0x09, 0x2e, 0x66, 0x95, 0x0f, 0x82, 0xe8, 0x5b, 0x19, 0xa3, 0x68, 0x52, 0x49, 0x53, + 0x33, 0xff, 0xe3, 0xc1, 0xf9, 0x99, 0x04, 0x17, 0xd2, 0xb2, 0xd8, 0x1f, 0xc6, 0xfe, 0xf3, 0x6f, + 0x65, 0x68, 0x7e, 0x2d, 0xc1, 0x6b, 0x07, 0xac, 0x4c, 0x22, 0x33, 0x53, 0x49, 0xd2, 0x2b, 0x54, + 0x92, 0xfc, 0x11, 0x94, 0xf8, 0x85, 0x33, 0xaa, 0xe6, 0x38, 0xfc, 0xad, 0x63, 0x26, 0x09, 0xf2, + 0xb1, 0x84, 0x7d, 0x26, 0xac, 0xf9, 0x03, 0x61, 0xf5, 0xe0, 0x7c, 0xd2, 0x64, 0xf7, 0xb1, 0x6b, + 0x7f, 0x43, 0x41, 0x55, 0xbe, 0x80, 0x0b, 0xb3, 0x62, 0x93, 0x28, 0xd8, 0x00, 0x5d, 0xd1, 0xc5, + 0xa7, 0x19, 0x72, 0xeb, 0x68, 0xc9, 0x87, 0xf7, 0x7f, 0x96, 0x91, 0xa1, 0xfc, 0x39, 0x0f, 0xe7, + 0x55, 0xf1, 0x67, 0x8e, 0xe0, 0x1b, 0xf4, 0x40, 0x66, 0x50, 0xde, 0x0e, 0xfc, 0x78, 0x6f, 0x1c, + 0x44,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4, 0xac, 0x6c, + 0x73, 0x3c, 0xce, 0xac, 0x43, 0x06, 0xd7, 0x72, 0xed, 0xa4, 0xec, 0xc7, 0x9b, 0xe5, 0x67, 0x78, + 0xef, 0x49, 0x37, 0xd7, 0x9f, 0xc3, 0xa5, 0x6e, 0xb8, 0x7b, 0xa4, 0xec, 0xf5, 0x0b, 0x07, 0x5a, + 0x80, 0x3d, 0x0e, 0xe3, 0xd0, 0x96, 0x3e, 0x7f, 0x98, 0x20, 0xfa, 0x21, 0x72, 0xd7, 0xc2, 0x71, + 0x7f, 0xb5, 0x1f, 0x0c, 0xf9, 0x7f, 0x33, 0x24, 0xff, 0x35, 0xe1, 0x8f, 0x06, 0xd1, 0x8b, 0xff, + 0x39, 0x71, 0x3f, 0x5d, 0x3f, 0x2d, 0x71, 0xe6, 0x0f, 0xff, 0x15, 0x00, 0x00, 0xff, 0xff, 0x5f, + 0x87, 0x12, 0xb1, 0x65, 0x21, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/language/v1beta1/language_service.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/language/v1beta1/language_service.pb.go new file mode 100644 index 0000000000..4eba895073 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/language/v1beta1/language_service.pb.go @@ -0,0 +1,2311 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/language/v1beta1/language_service.proto + +/* +Package language is a generated protocol buffer package. + +It is generated from these files: + google/cloud/language/v1beta1/language_service.proto + +It has these top-level messages: + Document + Sentence + Entity + Token + Sentiment + PartOfSpeech + DependencyEdge + EntityMention + TextSpan + AnalyzeSentimentRequest + AnalyzeSentimentResponse + AnalyzeEntitiesRequest + AnalyzeEntitiesResponse + AnalyzeSyntaxRequest + AnalyzeSyntaxResponse + AnnotateTextRequest + AnnotateTextResponse +*/ +package language + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Represents the text encoding that the caller uses to process the output. +// Providing an `EncodingType` is recommended because the API provides the +// beginning offsets for various outputs, such as tokens and mentions, and +// languages that natively use different text encodings may access offsets +// differently. +type EncodingType int32 + +const ( + // If `EncodingType` is not specified, encoding-dependent information (such as + // `begin_offset`) will be set at `-1`. + EncodingType_NONE EncodingType = 0 + // Encoding-dependent information (such as `begin_offset`) is calculated based + // on the UTF-8 encoding of the input. C++ and Go are examples of languages + // that use this encoding natively. + EncodingType_UTF8 EncodingType = 1 + // Encoding-dependent information (such as `begin_offset`) is calculated based + // on the UTF-16 encoding of the input. Java and Javascript are examples of + // languages that use this encoding natively. + EncodingType_UTF16 EncodingType = 2 + // Encoding-dependent information (such as `begin_offset`) is calculated based + // on the UTF-32 encoding of the input. Python is an example of a language + // that uses this encoding natively. + EncodingType_UTF32 EncodingType = 3 +) + +var EncodingType_name = map[int32]string{ + 0: "NONE", + 1: "UTF8", + 2: "UTF16", + 3: "UTF32", +} +var EncodingType_value = map[string]int32{ + "NONE": 0, + "UTF8": 1, + "UTF16": 2, + "UTF32": 3, +} + +func (x EncodingType) String() string { + return proto.EnumName(EncodingType_name, int32(x)) +} +func (EncodingType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +// The document types enum. +type Document_Type int32 + +const ( + // The content type is not specified. + Document_TYPE_UNSPECIFIED Document_Type = 0 + // Plain text + Document_PLAIN_TEXT Document_Type = 1 + // HTML + Document_HTML Document_Type = 2 +) + +var Document_Type_name = map[int32]string{ + 0: "TYPE_UNSPECIFIED", + 1: "PLAIN_TEXT", + 2: "HTML", +} +var Document_Type_value = map[string]int32{ + "TYPE_UNSPECIFIED": 0, + "PLAIN_TEXT": 1, + "HTML": 2, +} + +func (x Document_Type) String() string { + return proto.EnumName(Document_Type_name, int32(x)) +} +func (Document_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 0} } + +// The type of the entity. +type Entity_Type int32 + +const ( + // Unknown + Entity_UNKNOWN Entity_Type = 0 + // Person + Entity_PERSON Entity_Type = 1 + // Location + Entity_LOCATION Entity_Type = 2 + // Organization + Entity_ORGANIZATION Entity_Type = 3 + // Event + Entity_EVENT Entity_Type = 4 + // Work of art + Entity_WORK_OF_ART Entity_Type = 5 + // Consumer goods + Entity_CONSUMER_GOOD Entity_Type = 6 + // Other types + Entity_OTHER Entity_Type = 7 +) + +var Entity_Type_name = map[int32]string{ + 0: "UNKNOWN", + 1: "PERSON", + 2: "LOCATION", + 3: "ORGANIZATION", + 4: "EVENT", + 5: "WORK_OF_ART", + 6: "CONSUMER_GOOD", + 7: "OTHER", +} +var Entity_Type_value = map[string]int32{ + "UNKNOWN": 0, + "PERSON": 1, + "LOCATION": 2, + "ORGANIZATION": 3, + "EVENT": 4, + "WORK_OF_ART": 5, + "CONSUMER_GOOD": 6, + "OTHER": 7, +} + +func (x Entity_Type) String() string { + return proto.EnumName(Entity_Type_name, int32(x)) +} +func (Entity_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{2, 0} } + +// The part of speech tags enum. +type PartOfSpeech_Tag int32 + +const ( + // Unknown + PartOfSpeech_UNKNOWN PartOfSpeech_Tag = 0 + // Adjective + PartOfSpeech_ADJ PartOfSpeech_Tag = 1 + // Adposition (preposition and postposition) + PartOfSpeech_ADP PartOfSpeech_Tag = 2 + // Adverb + PartOfSpeech_ADV PartOfSpeech_Tag = 3 + // Conjunction + PartOfSpeech_CONJ PartOfSpeech_Tag = 4 + // Determiner + PartOfSpeech_DET PartOfSpeech_Tag = 5 + // Noun (common and proper) + PartOfSpeech_NOUN PartOfSpeech_Tag = 6 + // Cardinal number + PartOfSpeech_NUM PartOfSpeech_Tag = 7 + // Pronoun + PartOfSpeech_PRON PartOfSpeech_Tag = 8 + // Particle or other function word + PartOfSpeech_PRT PartOfSpeech_Tag = 9 + // Punctuation + PartOfSpeech_PUNCT PartOfSpeech_Tag = 10 + // Verb (all tenses and modes) + PartOfSpeech_VERB PartOfSpeech_Tag = 11 + // Other: foreign words, typos, abbreviations + PartOfSpeech_X PartOfSpeech_Tag = 12 + // Affix + PartOfSpeech_AFFIX PartOfSpeech_Tag = 13 +) + +var PartOfSpeech_Tag_name = map[int32]string{ + 0: "UNKNOWN", + 1: "ADJ", + 2: "ADP", + 3: "ADV", + 4: "CONJ", + 5: "DET", + 6: "NOUN", + 7: "NUM", + 8: "PRON", + 9: "PRT", + 10: "PUNCT", + 11: "VERB", + 12: "X", + 13: "AFFIX", +} +var PartOfSpeech_Tag_value = map[string]int32{ + "UNKNOWN": 0, + "ADJ": 1, + "ADP": 2, + "ADV": 3, + "CONJ": 4, + "DET": 5, + "NOUN": 6, + "NUM": 7, + "PRON": 8, + "PRT": 9, + "PUNCT": 10, + "VERB": 11, + "X": 12, + "AFFIX": 13, +} + +func (x PartOfSpeech_Tag) String() string { + return proto.EnumName(PartOfSpeech_Tag_name, int32(x)) +} +func (PartOfSpeech_Tag) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 0} } + +// The characteristic of a verb that expresses time flow during an event. +type PartOfSpeech_Aspect int32 + +const ( + // Aspect is not applicable in the analyzed language or is not predicted. + PartOfSpeech_ASPECT_UNKNOWN PartOfSpeech_Aspect = 0 + // Perfective + PartOfSpeech_PERFECTIVE PartOfSpeech_Aspect = 1 + // Imperfective + PartOfSpeech_IMPERFECTIVE PartOfSpeech_Aspect = 2 + // Progressive + PartOfSpeech_PROGRESSIVE PartOfSpeech_Aspect = 3 +) + +var PartOfSpeech_Aspect_name = map[int32]string{ + 0: "ASPECT_UNKNOWN", + 1: "PERFECTIVE", + 2: "IMPERFECTIVE", + 3: "PROGRESSIVE", +} +var PartOfSpeech_Aspect_value = map[string]int32{ + "ASPECT_UNKNOWN": 0, + "PERFECTIVE": 1, + "IMPERFECTIVE": 2, + "PROGRESSIVE": 3, +} + +func (x PartOfSpeech_Aspect) String() string { + return proto.EnumName(PartOfSpeech_Aspect_name, int32(x)) +} +func (PartOfSpeech_Aspect) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 1} } + +// The grammatical function performed by a noun or pronoun in a phrase, +// clause, or sentence. In some languages, other parts of speech, such as +// adjective and determiner, take case inflection in agreement with the noun. +type PartOfSpeech_Case int32 + +const ( + // Case is not applicable in the analyzed language or is not predicted. + PartOfSpeech_CASE_UNKNOWN PartOfSpeech_Case = 0 + // Accusative + PartOfSpeech_ACCUSATIVE PartOfSpeech_Case = 1 + // Adverbial + PartOfSpeech_ADVERBIAL PartOfSpeech_Case = 2 + // Complementive + PartOfSpeech_COMPLEMENTIVE PartOfSpeech_Case = 3 + // Dative + PartOfSpeech_DATIVE PartOfSpeech_Case = 4 + // Genitive + PartOfSpeech_GENITIVE PartOfSpeech_Case = 5 + // Instrumental + PartOfSpeech_INSTRUMENTAL PartOfSpeech_Case = 6 + // Locative + PartOfSpeech_LOCATIVE PartOfSpeech_Case = 7 + // Nominative + PartOfSpeech_NOMINATIVE PartOfSpeech_Case = 8 + // Oblique + PartOfSpeech_OBLIQUE PartOfSpeech_Case = 9 + // Partitive + PartOfSpeech_PARTITIVE PartOfSpeech_Case = 10 + // Prepositional + PartOfSpeech_PREPOSITIONAL PartOfSpeech_Case = 11 + // Reflexive + PartOfSpeech_REFLEXIVE_CASE PartOfSpeech_Case = 12 + // Relative + PartOfSpeech_RELATIVE_CASE PartOfSpeech_Case = 13 + // Vocative + PartOfSpeech_VOCATIVE PartOfSpeech_Case = 14 +) + +var PartOfSpeech_Case_name = map[int32]string{ + 0: "CASE_UNKNOWN", + 1: "ACCUSATIVE", + 2: "ADVERBIAL", + 3: "COMPLEMENTIVE", + 4: "DATIVE", + 5: "GENITIVE", + 6: "INSTRUMENTAL", + 7: "LOCATIVE", + 8: "NOMINATIVE", + 9: "OBLIQUE", + 10: "PARTITIVE", + 11: "PREPOSITIONAL", + 12: "REFLEXIVE_CASE", + 13: "RELATIVE_CASE", + 14: "VOCATIVE", +} +var PartOfSpeech_Case_value = map[string]int32{ + "CASE_UNKNOWN": 0, + "ACCUSATIVE": 1, + "ADVERBIAL": 2, + "COMPLEMENTIVE": 3, + "DATIVE": 4, + "GENITIVE": 5, + "INSTRUMENTAL": 6, + "LOCATIVE": 7, + "NOMINATIVE": 8, + "OBLIQUE": 9, + "PARTITIVE": 10, + "PREPOSITIONAL": 11, + "REFLEXIVE_CASE": 12, + "RELATIVE_CASE": 13, + "VOCATIVE": 14, +} + +func (x PartOfSpeech_Case) String() string { + return proto.EnumName(PartOfSpeech_Case_name, int32(x)) +} +func (PartOfSpeech_Case) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 2} } + +// Depending on the language, Form can be categorizing different forms of +// verbs, adjectives, adverbs, etc. For example, categorizing inflected +// endings of verbs and adjectives or distinguishing between short and long +// forms of adjectives and participles +type PartOfSpeech_Form int32 + +const ( + // Form is not applicable in the analyzed language or is not predicted. + PartOfSpeech_FORM_UNKNOWN PartOfSpeech_Form = 0 + // Adnomial + PartOfSpeech_ADNOMIAL PartOfSpeech_Form = 1 + // Auxiliary + PartOfSpeech_AUXILIARY PartOfSpeech_Form = 2 + // Complementizer + PartOfSpeech_COMPLEMENTIZER PartOfSpeech_Form = 3 + // Final ending + PartOfSpeech_FINAL_ENDING PartOfSpeech_Form = 4 + // Gerund + PartOfSpeech_GERUND PartOfSpeech_Form = 5 + // Realis + PartOfSpeech_REALIS PartOfSpeech_Form = 6 + // Irrealis + PartOfSpeech_IRREALIS PartOfSpeech_Form = 7 + // Short form + PartOfSpeech_SHORT PartOfSpeech_Form = 8 + // Long form + PartOfSpeech_LONG PartOfSpeech_Form = 9 + // Order form + PartOfSpeech_ORDER PartOfSpeech_Form = 10 + // Specific form + PartOfSpeech_SPECIFIC PartOfSpeech_Form = 11 +) + +var PartOfSpeech_Form_name = map[int32]string{ + 0: "FORM_UNKNOWN", + 1: "ADNOMIAL", + 2: "AUXILIARY", + 3: "COMPLEMENTIZER", + 4: "FINAL_ENDING", + 5: "GERUND", + 6: "REALIS", + 7: "IRREALIS", + 8: "SHORT", + 9: "LONG", + 10: "ORDER", + 11: "SPECIFIC", +} +var PartOfSpeech_Form_value = map[string]int32{ + "FORM_UNKNOWN": 0, + "ADNOMIAL": 1, + "AUXILIARY": 2, + "COMPLEMENTIZER": 3, + "FINAL_ENDING": 4, + "GERUND": 5, + "REALIS": 6, + "IRREALIS": 7, + "SHORT": 8, + "LONG": 9, + "ORDER": 10, + "SPECIFIC": 11, +} + +func (x PartOfSpeech_Form) String() string { + return proto.EnumName(PartOfSpeech_Form_name, int32(x)) +} +func (PartOfSpeech_Form) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 3} } + +// Gender classes of nouns reflected in the behaviour of associated words. +type PartOfSpeech_Gender int32 + +const ( + // Gender is not applicable in the analyzed language or is not predicted. + PartOfSpeech_GENDER_UNKNOWN PartOfSpeech_Gender = 0 + // Feminine + PartOfSpeech_FEMININE PartOfSpeech_Gender = 1 + // Masculine + PartOfSpeech_MASCULINE PartOfSpeech_Gender = 2 + // Neuter + PartOfSpeech_NEUTER PartOfSpeech_Gender = 3 +) + +var PartOfSpeech_Gender_name = map[int32]string{ + 0: "GENDER_UNKNOWN", + 1: "FEMININE", + 2: "MASCULINE", + 3: "NEUTER", +} +var PartOfSpeech_Gender_value = map[string]int32{ + "GENDER_UNKNOWN": 0, + "FEMININE": 1, + "MASCULINE": 2, + "NEUTER": 3, +} + +func (x PartOfSpeech_Gender) String() string { + return proto.EnumName(PartOfSpeech_Gender_name, int32(x)) +} +func (PartOfSpeech_Gender) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 4} } + +// The grammatical feature of verbs, used for showing modality and attitude. +type PartOfSpeech_Mood int32 + +const ( + // Mood is not applicable in the analyzed language or is not predicted. + PartOfSpeech_MOOD_UNKNOWN PartOfSpeech_Mood = 0 + // Conditional + PartOfSpeech_CONDITIONAL_MOOD PartOfSpeech_Mood = 1 + // Imperative + PartOfSpeech_IMPERATIVE PartOfSpeech_Mood = 2 + // Indicative + PartOfSpeech_INDICATIVE PartOfSpeech_Mood = 3 + // Interrogative + PartOfSpeech_INTERROGATIVE PartOfSpeech_Mood = 4 + // Jussive + PartOfSpeech_JUSSIVE PartOfSpeech_Mood = 5 + // Subjunctive + PartOfSpeech_SUBJUNCTIVE PartOfSpeech_Mood = 6 +) + +var PartOfSpeech_Mood_name = map[int32]string{ + 0: "MOOD_UNKNOWN", + 1: "CONDITIONAL_MOOD", + 2: "IMPERATIVE", + 3: "INDICATIVE", + 4: "INTERROGATIVE", + 5: "JUSSIVE", + 6: "SUBJUNCTIVE", +} +var PartOfSpeech_Mood_value = map[string]int32{ + "MOOD_UNKNOWN": 0, + "CONDITIONAL_MOOD": 1, + "IMPERATIVE": 2, + "INDICATIVE": 3, + "INTERROGATIVE": 4, + "JUSSIVE": 5, + "SUBJUNCTIVE": 6, +} + +func (x PartOfSpeech_Mood) String() string { + return proto.EnumName(PartOfSpeech_Mood_name, int32(x)) +} +func (PartOfSpeech_Mood) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 5} } + +// Count distinctions. +type PartOfSpeech_Number int32 + +const ( + // Number is not applicable in the analyzed language or is not predicted. + PartOfSpeech_NUMBER_UNKNOWN PartOfSpeech_Number = 0 + // Singular + PartOfSpeech_SINGULAR PartOfSpeech_Number = 1 + // Plural + PartOfSpeech_PLURAL PartOfSpeech_Number = 2 + // Dual + PartOfSpeech_DUAL PartOfSpeech_Number = 3 +) + +var PartOfSpeech_Number_name = map[int32]string{ + 0: "NUMBER_UNKNOWN", + 1: "SINGULAR", + 2: "PLURAL", + 3: "DUAL", +} +var PartOfSpeech_Number_value = map[string]int32{ + "NUMBER_UNKNOWN": 0, + "SINGULAR": 1, + "PLURAL": 2, + "DUAL": 3, +} + +func (x PartOfSpeech_Number) String() string { + return proto.EnumName(PartOfSpeech_Number_name, int32(x)) +} +func (PartOfSpeech_Number) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 6} } + +// The distinction between the speaker, second person, third person, etc. +type PartOfSpeech_Person int32 + +const ( + // Person is not applicable in the analyzed language or is not predicted. + PartOfSpeech_PERSON_UNKNOWN PartOfSpeech_Person = 0 + // First + PartOfSpeech_FIRST PartOfSpeech_Person = 1 + // Second + PartOfSpeech_SECOND PartOfSpeech_Person = 2 + // Third + PartOfSpeech_THIRD PartOfSpeech_Person = 3 + // Reflexive + PartOfSpeech_REFLEXIVE_PERSON PartOfSpeech_Person = 4 +) + +var PartOfSpeech_Person_name = map[int32]string{ + 0: "PERSON_UNKNOWN", + 1: "FIRST", + 2: "SECOND", + 3: "THIRD", + 4: "REFLEXIVE_PERSON", +} +var PartOfSpeech_Person_value = map[string]int32{ + "PERSON_UNKNOWN": 0, + "FIRST": 1, + "SECOND": 2, + "THIRD": 3, + "REFLEXIVE_PERSON": 4, +} + +func (x PartOfSpeech_Person) String() string { + return proto.EnumName(PartOfSpeech_Person_name, int32(x)) +} +func (PartOfSpeech_Person) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 7} } + +// This category shows if the token is part of a proper name. +type PartOfSpeech_Proper int32 + +const ( + // Proper is not applicable in the analyzed language or is not predicted. + PartOfSpeech_PROPER_UNKNOWN PartOfSpeech_Proper = 0 + // Proper + PartOfSpeech_PROPER PartOfSpeech_Proper = 1 + // Not proper + PartOfSpeech_NOT_PROPER PartOfSpeech_Proper = 2 +) + +var PartOfSpeech_Proper_name = map[int32]string{ + 0: "PROPER_UNKNOWN", + 1: "PROPER", + 2: "NOT_PROPER", +} +var PartOfSpeech_Proper_value = map[string]int32{ + "PROPER_UNKNOWN": 0, + "PROPER": 1, + "NOT_PROPER": 2, +} + +func (x PartOfSpeech_Proper) String() string { + return proto.EnumName(PartOfSpeech_Proper_name, int32(x)) +} +func (PartOfSpeech_Proper) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 8} } + +// Reciprocal features of a pronoun. +type PartOfSpeech_Reciprocity int32 + +const ( + // Reciprocity is not applicable in the analyzed language or is not + // predicted. + PartOfSpeech_RECIPROCITY_UNKNOWN PartOfSpeech_Reciprocity = 0 + // Reciprocal + PartOfSpeech_RECIPROCAL PartOfSpeech_Reciprocity = 1 + // Non-reciprocal + PartOfSpeech_NON_RECIPROCAL PartOfSpeech_Reciprocity = 2 +) + +var PartOfSpeech_Reciprocity_name = map[int32]string{ + 0: "RECIPROCITY_UNKNOWN", + 1: "RECIPROCAL", + 2: "NON_RECIPROCAL", +} +var PartOfSpeech_Reciprocity_value = map[string]int32{ + "RECIPROCITY_UNKNOWN": 0, + "RECIPROCAL": 1, + "NON_RECIPROCAL": 2, +} + +func (x PartOfSpeech_Reciprocity) String() string { + return proto.EnumName(PartOfSpeech_Reciprocity_name, int32(x)) +} +func (PartOfSpeech_Reciprocity) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 9} } + +// Time reference. +type PartOfSpeech_Tense int32 + +const ( + // Tense is not applicable in the analyzed language or is not predicted. + PartOfSpeech_TENSE_UNKNOWN PartOfSpeech_Tense = 0 + // Conditional + PartOfSpeech_CONDITIONAL_TENSE PartOfSpeech_Tense = 1 + // Future + PartOfSpeech_FUTURE PartOfSpeech_Tense = 2 + // Past + PartOfSpeech_PAST PartOfSpeech_Tense = 3 + // Present + PartOfSpeech_PRESENT PartOfSpeech_Tense = 4 + // Imperfect + PartOfSpeech_IMPERFECT PartOfSpeech_Tense = 5 + // Pluperfect + PartOfSpeech_PLUPERFECT PartOfSpeech_Tense = 6 +) + +var PartOfSpeech_Tense_name = map[int32]string{ + 0: "TENSE_UNKNOWN", + 1: "CONDITIONAL_TENSE", + 2: "FUTURE", + 3: "PAST", + 4: "PRESENT", + 5: "IMPERFECT", + 6: "PLUPERFECT", +} +var PartOfSpeech_Tense_value = map[string]int32{ + "TENSE_UNKNOWN": 0, + "CONDITIONAL_TENSE": 1, + "FUTURE": 2, + "PAST": 3, + "PRESENT": 4, + "IMPERFECT": 5, + "PLUPERFECT": 6, +} + +func (x PartOfSpeech_Tense) String() string { + return proto.EnumName(PartOfSpeech_Tense_name, int32(x)) +} +func (PartOfSpeech_Tense) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 10} } + +// The relationship between the action that a verb expresses and the +// participants identified by its arguments. +type PartOfSpeech_Voice int32 + +const ( + // Voice is not applicable in the analyzed language or is not predicted. + PartOfSpeech_VOICE_UNKNOWN PartOfSpeech_Voice = 0 + // Active + PartOfSpeech_ACTIVE PartOfSpeech_Voice = 1 + // Causative + PartOfSpeech_CAUSATIVE PartOfSpeech_Voice = 2 + // Passive + PartOfSpeech_PASSIVE PartOfSpeech_Voice = 3 +) + +var PartOfSpeech_Voice_name = map[int32]string{ + 0: "VOICE_UNKNOWN", + 1: "ACTIVE", + 2: "CAUSATIVE", + 3: "PASSIVE", +} +var PartOfSpeech_Voice_value = map[string]int32{ + "VOICE_UNKNOWN": 0, + "ACTIVE": 1, + "CAUSATIVE": 2, + "PASSIVE": 3, +} + +func (x PartOfSpeech_Voice) String() string { + return proto.EnumName(PartOfSpeech_Voice_name, int32(x)) +} +func (PartOfSpeech_Voice) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 11} } + +// The parse label enum for the token. +type DependencyEdge_Label int32 + +const ( + // Unknown + DependencyEdge_UNKNOWN DependencyEdge_Label = 0 + // Abbreviation modifier + DependencyEdge_ABBREV DependencyEdge_Label = 1 + // Adjectival complement + DependencyEdge_ACOMP DependencyEdge_Label = 2 + // Adverbial clause modifier + DependencyEdge_ADVCL DependencyEdge_Label = 3 + // Adverbial modifier + DependencyEdge_ADVMOD DependencyEdge_Label = 4 + // Adjectival modifier of an NP + DependencyEdge_AMOD DependencyEdge_Label = 5 + // Appositional modifier of an NP + DependencyEdge_APPOS DependencyEdge_Label = 6 + // Attribute dependent of a copular verb + DependencyEdge_ATTR DependencyEdge_Label = 7 + // Auxiliary (non-main) verb + DependencyEdge_AUX DependencyEdge_Label = 8 + // Passive auxiliary + DependencyEdge_AUXPASS DependencyEdge_Label = 9 + // Coordinating conjunction + DependencyEdge_CC DependencyEdge_Label = 10 + // Clausal complement of a verb or adjective + DependencyEdge_CCOMP DependencyEdge_Label = 11 + // Conjunct + DependencyEdge_CONJ DependencyEdge_Label = 12 + // Clausal subject + DependencyEdge_CSUBJ DependencyEdge_Label = 13 + // Clausal passive subject + DependencyEdge_CSUBJPASS DependencyEdge_Label = 14 + // Dependency (unable to determine) + DependencyEdge_DEP DependencyEdge_Label = 15 + // Determiner + DependencyEdge_DET DependencyEdge_Label = 16 + // Discourse + DependencyEdge_DISCOURSE DependencyEdge_Label = 17 + // Direct object + DependencyEdge_DOBJ DependencyEdge_Label = 18 + // Expletive + DependencyEdge_EXPL DependencyEdge_Label = 19 + // Goes with (part of a word in a text not well edited) + DependencyEdge_GOESWITH DependencyEdge_Label = 20 + // Indirect object + DependencyEdge_IOBJ DependencyEdge_Label = 21 + // Marker (word introducing a subordinate clause) + DependencyEdge_MARK DependencyEdge_Label = 22 + // Multi-word expression + DependencyEdge_MWE DependencyEdge_Label = 23 + // Multi-word verbal expression + DependencyEdge_MWV DependencyEdge_Label = 24 + // Negation modifier + DependencyEdge_NEG DependencyEdge_Label = 25 + // Noun compound modifier + DependencyEdge_NN DependencyEdge_Label = 26 + // Noun phrase used as an adverbial modifier + DependencyEdge_NPADVMOD DependencyEdge_Label = 27 + // Nominal subject + DependencyEdge_NSUBJ DependencyEdge_Label = 28 + // Passive nominal subject + DependencyEdge_NSUBJPASS DependencyEdge_Label = 29 + // Numeric modifier of a noun + DependencyEdge_NUM DependencyEdge_Label = 30 + // Element of compound number + DependencyEdge_NUMBER DependencyEdge_Label = 31 + // Punctuation mark + DependencyEdge_P DependencyEdge_Label = 32 + // Parataxis relation + DependencyEdge_PARATAXIS DependencyEdge_Label = 33 + // Participial modifier + DependencyEdge_PARTMOD DependencyEdge_Label = 34 + // The complement of a preposition is a clause + DependencyEdge_PCOMP DependencyEdge_Label = 35 + // Object of a preposition + DependencyEdge_POBJ DependencyEdge_Label = 36 + // Possession modifier + DependencyEdge_POSS DependencyEdge_Label = 37 + // Postverbal negative particle + DependencyEdge_POSTNEG DependencyEdge_Label = 38 + // Predicate complement + DependencyEdge_PRECOMP DependencyEdge_Label = 39 + // Preconjunt + DependencyEdge_PRECONJ DependencyEdge_Label = 40 + // Predeterminer + DependencyEdge_PREDET DependencyEdge_Label = 41 + // Prefix + DependencyEdge_PREF DependencyEdge_Label = 42 + // Prepositional modifier + DependencyEdge_PREP DependencyEdge_Label = 43 + // The relationship between a verb and verbal morpheme + DependencyEdge_PRONL DependencyEdge_Label = 44 + // Particle + DependencyEdge_PRT DependencyEdge_Label = 45 + // Associative or possessive marker + DependencyEdge_PS DependencyEdge_Label = 46 + // Quantifier phrase modifier + DependencyEdge_QUANTMOD DependencyEdge_Label = 47 + // Relative clause modifier + DependencyEdge_RCMOD DependencyEdge_Label = 48 + // Complementizer in relative clause + DependencyEdge_RCMODREL DependencyEdge_Label = 49 + // Ellipsis without a preceding predicate + DependencyEdge_RDROP DependencyEdge_Label = 50 + // Referent + DependencyEdge_REF DependencyEdge_Label = 51 + // Remnant + DependencyEdge_REMNANT DependencyEdge_Label = 52 + // Reparandum + DependencyEdge_REPARANDUM DependencyEdge_Label = 53 + // Root + DependencyEdge_ROOT DependencyEdge_Label = 54 + // Suffix specifying a unit of number + DependencyEdge_SNUM DependencyEdge_Label = 55 + // Suffix + DependencyEdge_SUFF DependencyEdge_Label = 56 + // Temporal modifier + DependencyEdge_TMOD DependencyEdge_Label = 57 + // Topic marker + DependencyEdge_TOPIC DependencyEdge_Label = 58 + // Clause headed by an infinite form of the verb that modifies a noun + DependencyEdge_VMOD DependencyEdge_Label = 59 + // Vocative + DependencyEdge_VOCATIVE DependencyEdge_Label = 60 + // Open clausal complement + DependencyEdge_XCOMP DependencyEdge_Label = 61 + // Name suffix + DependencyEdge_SUFFIX DependencyEdge_Label = 62 + // Name title + DependencyEdge_TITLE DependencyEdge_Label = 63 + // Adverbial phrase modifier + DependencyEdge_ADVPHMOD DependencyEdge_Label = 64 + // Causative auxiliary + DependencyEdge_AUXCAUS DependencyEdge_Label = 65 + // Helper auxiliary + DependencyEdge_AUXVV DependencyEdge_Label = 66 + // Rentaishi (Prenominal modifier) + DependencyEdge_DTMOD DependencyEdge_Label = 67 + // Foreign words + DependencyEdge_FOREIGN DependencyEdge_Label = 68 + // Keyword + DependencyEdge_KW DependencyEdge_Label = 69 + // List for chains of comparable items + DependencyEdge_LIST DependencyEdge_Label = 70 + // Nominalized clause + DependencyEdge_NOMC DependencyEdge_Label = 71 + // Nominalized clausal subject + DependencyEdge_NOMCSUBJ DependencyEdge_Label = 72 + // Nominalized clausal passive + DependencyEdge_NOMCSUBJPASS DependencyEdge_Label = 73 + // Compound of numeric modifier + DependencyEdge_NUMC DependencyEdge_Label = 74 + // Copula + DependencyEdge_COP DependencyEdge_Label = 75 + // Dislocated relation (for fronted/topicalized elements) + DependencyEdge_DISLOCATED DependencyEdge_Label = 76 +) + +var DependencyEdge_Label_name = map[int32]string{ + 0: "UNKNOWN", + 1: "ABBREV", + 2: "ACOMP", + 3: "ADVCL", + 4: "ADVMOD", + 5: "AMOD", + 6: "APPOS", + 7: "ATTR", + 8: "AUX", + 9: "AUXPASS", + 10: "CC", + 11: "CCOMP", + 12: "CONJ", + 13: "CSUBJ", + 14: "CSUBJPASS", + 15: "DEP", + 16: "DET", + 17: "DISCOURSE", + 18: "DOBJ", + 19: "EXPL", + 20: "GOESWITH", + 21: "IOBJ", + 22: "MARK", + 23: "MWE", + 24: "MWV", + 25: "NEG", + 26: "NN", + 27: "NPADVMOD", + 28: "NSUBJ", + 29: "NSUBJPASS", + 30: "NUM", + 31: "NUMBER", + 32: "P", + 33: "PARATAXIS", + 34: "PARTMOD", + 35: "PCOMP", + 36: "POBJ", + 37: "POSS", + 38: "POSTNEG", + 39: "PRECOMP", + 40: "PRECONJ", + 41: "PREDET", + 42: "PREF", + 43: "PREP", + 44: "PRONL", + 45: "PRT", + 46: "PS", + 47: "QUANTMOD", + 48: "RCMOD", + 49: "RCMODREL", + 50: "RDROP", + 51: "REF", + 52: "REMNANT", + 53: "REPARANDUM", + 54: "ROOT", + 55: "SNUM", + 56: "SUFF", + 57: "TMOD", + 58: "TOPIC", + 59: "VMOD", + 60: "VOCATIVE", + 61: "XCOMP", + 62: "SUFFIX", + 63: "TITLE", + 64: "ADVPHMOD", + 65: "AUXCAUS", + 66: "AUXVV", + 67: "DTMOD", + 68: "FOREIGN", + 69: "KW", + 70: "LIST", + 71: "NOMC", + 72: "NOMCSUBJ", + 73: "NOMCSUBJPASS", + 74: "NUMC", + 75: "COP", + 76: "DISLOCATED", +} +var DependencyEdge_Label_value = map[string]int32{ + "UNKNOWN": 0, + "ABBREV": 1, + "ACOMP": 2, + "ADVCL": 3, + "ADVMOD": 4, + "AMOD": 5, + "APPOS": 6, + "ATTR": 7, + "AUX": 8, + "AUXPASS": 9, + "CC": 10, + "CCOMP": 11, + "CONJ": 12, + "CSUBJ": 13, + "CSUBJPASS": 14, + "DEP": 15, + "DET": 16, + "DISCOURSE": 17, + "DOBJ": 18, + "EXPL": 19, + "GOESWITH": 20, + "IOBJ": 21, + "MARK": 22, + "MWE": 23, + "MWV": 24, + "NEG": 25, + "NN": 26, + "NPADVMOD": 27, + "NSUBJ": 28, + "NSUBJPASS": 29, + "NUM": 30, + "NUMBER": 31, + "P": 32, + "PARATAXIS": 33, + "PARTMOD": 34, + "PCOMP": 35, + "POBJ": 36, + "POSS": 37, + "POSTNEG": 38, + "PRECOMP": 39, + "PRECONJ": 40, + "PREDET": 41, + "PREF": 42, + "PREP": 43, + "PRONL": 44, + "PRT": 45, + "PS": 46, + "QUANTMOD": 47, + "RCMOD": 48, + "RCMODREL": 49, + "RDROP": 50, + "REF": 51, + "REMNANT": 52, + "REPARANDUM": 53, + "ROOT": 54, + "SNUM": 55, + "SUFF": 56, + "TMOD": 57, + "TOPIC": 58, + "VMOD": 59, + "VOCATIVE": 60, + "XCOMP": 61, + "SUFFIX": 62, + "TITLE": 63, + "ADVPHMOD": 64, + "AUXCAUS": 65, + "AUXVV": 66, + "DTMOD": 67, + "FOREIGN": 68, + "KW": 69, + "LIST": 70, + "NOMC": 71, + "NOMCSUBJ": 72, + "NOMCSUBJPASS": 73, + "NUMC": 74, + "COP": 75, + "DISLOCATED": 76, +} + +func (x DependencyEdge_Label) String() string { + return proto.EnumName(DependencyEdge_Label_name, int32(x)) +} +func (DependencyEdge_Label) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{6, 0} } + +// The supported types of mentions. +type EntityMention_Type int32 + +const ( + // Unknown + EntityMention_TYPE_UNKNOWN EntityMention_Type = 0 + // Proper name + EntityMention_PROPER EntityMention_Type = 1 + // Common noun (or noun compound) + EntityMention_COMMON EntityMention_Type = 2 +) + +var EntityMention_Type_name = map[int32]string{ + 0: "TYPE_UNKNOWN", + 1: "PROPER", + 2: "COMMON", +} +var EntityMention_Type_value = map[string]int32{ + "TYPE_UNKNOWN": 0, + "PROPER": 1, + "COMMON": 2, +} + +func (x EntityMention_Type) String() string { + return proto.EnumName(EntityMention_Type_name, int32(x)) +} +func (EntityMention_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{7, 0} } + +// ################################################################ # +// +// Represents the input to API methods. +type Document struct { + // Required. If the type is not set or is `TYPE_UNSPECIFIED`, + // returns an `INVALID_ARGUMENT` error. + Type Document_Type `protobuf:"varint,1,opt,name=type,enum=google.cloud.language.v1beta1.Document_Type" json:"type,omitempty"` + // The source of the document: a string containing the content or a + // Google Cloud Storage URI. + // + // Types that are valid to be assigned to Source: + // *Document_Content + // *Document_GcsContentUri + Source isDocument_Source `protobuf_oneof:"source"` + // The language of the document (if not specified, the language is + // automatically detected). Both ISO and BCP-47 language codes are + // accepted.
+ // [Language Support](https://cloud.google.com/natural-language/docs/languages) + // lists currently supported languages for each API method. + // If the language (either specified by the caller or automatically detected) + // is not supported by the called API method, an `INVALID_ARGUMENT` error + // is returned. + Language string `protobuf:"bytes,4,opt,name=language" json:"language,omitempty"` +} + +func (m *Document) Reset() { *m = Document{} } +func (m *Document) String() string { return proto.CompactTextString(m) } +func (*Document) ProtoMessage() {} +func (*Document) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +type isDocument_Source interface { + isDocument_Source() +} + +type Document_Content struct { + Content string `protobuf:"bytes,2,opt,name=content,oneof"` +} +type Document_GcsContentUri struct { + GcsContentUri string `protobuf:"bytes,3,opt,name=gcs_content_uri,json=gcsContentUri,oneof"` +} + +func (*Document_Content) isDocument_Source() {} +func (*Document_GcsContentUri) isDocument_Source() {} + +func (m *Document) GetSource() isDocument_Source { + if m != nil { + return m.Source + } + return nil +} + +func (m *Document) GetType() Document_Type { + if m != nil { + return m.Type + } + return Document_TYPE_UNSPECIFIED +} + +func (m *Document) GetContent() string { + if x, ok := m.GetSource().(*Document_Content); ok { + return x.Content + } + return "" +} + +func (m *Document) GetGcsContentUri() string { + if x, ok := m.GetSource().(*Document_GcsContentUri); ok { + return x.GcsContentUri + } + return "" +} + +func (m *Document) GetLanguage() string { + if m != nil { + return m.Language + } + return "" +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Document) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _Document_OneofMarshaler, _Document_OneofUnmarshaler, _Document_OneofSizer, []interface{}{ + (*Document_Content)(nil), + (*Document_GcsContentUri)(nil), + } +} + +func _Document_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Document) + // source + switch x := m.Source.(type) { + case *Document_Content: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeStringBytes(x.Content) + case *Document_GcsContentUri: + b.EncodeVarint(3<<3 | proto.WireBytes) + b.EncodeStringBytes(x.GcsContentUri) + case nil: + default: + return fmt.Errorf("Document.Source has unexpected type %T", x) + } + return nil +} + +func _Document_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Document) + switch tag { + case 2: // source.content + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Source = &Document_Content{x} + return true, err + case 3: // source.gcs_content_uri + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Source = &Document_GcsContentUri{x} + return true, err + default: + return false, nil + } +} + +func _Document_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Document) + // source + switch x := m.Source.(type) { + case *Document_Content: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Content))) + n += len(x.Content) + case *Document_GcsContentUri: + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.GcsContentUri))) + n += len(x.GcsContentUri) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Represents a sentence in the input document. +type Sentence struct { + // The sentence text. + Text *TextSpan `protobuf:"bytes,1,opt,name=text" json:"text,omitempty"` + // For calls to [AnalyzeSentiment][] or if + // [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1beta1.AnnotateTextRequest.Features.extract_document_sentiment] is set to + // true, this field will contain the sentiment for the sentence. + Sentiment *Sentiment `protobuf:"bytes,2,opt,name=sentiment" json:"sentiment,omitempty"` +} + +func (m *Sentence) Reset() { *m = Sentence{} } +func (m *Sentence) String() string { return proto.CompactTextString(m) } +func (*Sentence) ProtoMessage() {} +func (*Sentence) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *Sentence) GetText() *TextSpan { + if m != nil { + return m.Text + } + return nil +} + +func (m *Sentence) GetSentiment() *Sentiment { + if m != nil { + return m.Sentiment + } + return nil +} + +// Represents a phrase in the text that is a known entity, such as +// a person, an organization, or location. The API associates information, such +// as salience and mentions, with entities. +type Entity struct { + // The representative name for the entity. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The entity type. + Type Entity_Type `protobuf:"varint,2,opt,name=type,enum=google.cloud.language.v1beta1.Entity_Type" json:"type,omitempty"` + // Metadata associated with the entity. + // + // Currently, Wikipedia URLs and Knowledge Graph MIDs are provided, if + // available. The associated keys are "wikipedia_url" and "mid", respectively. + Metadata map[string]string `protobuf:"bytes,3,rep,name=metadata" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // The salience score associated with the entity in the [0, 1.0] range. + // + // The salience score for an entity provides information about the + // importance or centrality of that entity to the entire document text. + // Scores closer to 0 are less salient, while scores closer to 1.0 are highly + // salient. + Salience float32 `protobuf:"fixed32,4,opt,name=salience" json:"salience,omitempty"` + // The mentions of this entity in the input document. The API currently + // supports proper noun mentions. + Mentions []*EntityMention `protobuf:"bytes,5,rep,name=mentions" json:"mentions,omitempty"` +} + +func (m *Entity) Reset() { *m = Entity{} } +func (m *Entity) String() string { return proto.CompactTextString(m) } +func (*Entity) ProtoMessage() {} +func (*Entity) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *Entity) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Entity) GetType() Entity_Type { + if m != nil { + return m.Type + } + return Entity_UNKNOWN +} + +func (m *Entity) GetMetadata() map[string]string { + if m != nil { + return m.Metadata + } + return nil +} + +func (m *Entity) GetSalience() float32 { + if m != nil { + return m.Salience + } + return 0 +} + +func (m *Entity) GetMentions() []*EntityMention { + if m != nil { + return m.Mentions + } + return nil +} + +// Represents the smallest syntactic building block of the text. +type Token struct { + // The token text. + Text *TextSpan `protobuf:"bytes,1,opt,name=text" json:"text,omitempty"` + // Parts of speech tag for this token. + PartOfSpeech *PartOfSpeech `protobuf:"bytes,2,opt,name=part_of_speech,json=partOfSpeech" json:"part_of_speech,omitempty"` + // Dependency tree parse for this token. + DependencyEdge *DependencyEdge `protobuf:"bytes,3,opt,name=dependency_edge,json=dependencyEdge" json:"dependency_edge,omitempty"` + // [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token. + Lemma string `protobuf:"bytes,4,opt,name=lemma" json:"lemma,omitempty"` +} + +func (m *Token) Reset() { *m = Token{} } +func (m *Token) String() string { return proto.CompactTextString(m) } +func (*Token) ProtoMessage() {} +func (*Token) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *Token) GetText() *TextSpan { + if m != nil { + return m.Text + } + return nil +} + +func (m *Token) GetPartOfSpeech() *PartOfSpeech { + if m != nil { + return m.PartOfSpeech + } + return nil +} + +func (m *Token) GetDependencyEdge() *DependencyEdge { + if m != nil { + return m.DependencyEdge + } + return nil +} + +func (m *Token) GetLemma() string { + if m != nil { + return m.Lemma + } + return "" +} + +// Represents the feeling associated with the entire text or entities in +// the text. +type Sentiment struct { + // DEPRECATED FIELD - This field is being deprecated in + // favor of score. Please refer to our documentation at + // https://cloud.google.com/natural-language/docs for more information. + Polarity float32 `protobuf:"fixed32,1,opt,name=polarity" json:"polarity,omitempty"` + // A non-negative number in the [0, +inf) range, which represents + // the absolute magnitude of sentiment regardless of score (positive or + // negative). + Magnitude float32 `protobuf:"fixed32,2,opt,name=magnitude" json:"magnitude,omitempty"` + // Sentiment score between -1.0 (negative sentiment) and 1.0 + // (positive sentiment). + Score float32 `protobuf:"fixed32,3,opt,name=score" json:"score,omitempty"` +} + +func (m *Sentiment) Reset() { *m = Sentiment{} } +func (m *Sentiment) String() string { return proto.CompactTextString(m) } +func (*Sentiment) ProtoMessage() {} +func (*Sentiment) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *Sentiment) GetPolarity() float32 { + if m != nil { + return m.Polarity + } + return 0 +} + +func (m *Sentiment) GetMagnitude() float32 { + if m != nil { + return m.Magnitude + } + return 0 +} + +func (m *Sentiment) GetScore() float32 { + if m != nil { + return m.Score + } + return 0 +} + +// Represents part of speech information for a token. +type PartOfSpeech struct { + // The part of speech tag. + Tag PartOfSpeech_Tag `protobuf:"varint,1,opt,name=tag,enum=google.cloud.language.v1beta1.PartOfSpeech_Tag" json:"tag,omitempty"` + // The grammatical aspect. + Aspect PartOfSpeech_Aspect `protobuf:"varint,2,opt,name=aspect,enum=google.cloud.language.v1beta1.PartOfSpeech_Aspect" json:"aspect,omitempty"` + // The grammatical case. + Case PartOfSpeech_Case `protobuf:"varint,3,opt,name=case,enum=google.cloud.language.v1beta1.PartOfSpeech_Case" json:"case,omitempty"` + // The grammatical form. + Form PartOfSpeech_Form `protobuf:"varint,4,opt,name=form,enum=google.cloud.language.v1beta1.PartOfSpeech_Form" json:"form,omitempty"` + // The grammatical gender. + Gender PartOfSpeech_Gender `protobuf:"varint,5,opt,name=gender,enum=google.cloud.language.v1beta1.PartOfSpeech_Gender" json:"gender,omitempty"` + // The grammatical mood. + Mood PartOfSpeech_Mood `protobuf:"varint,6,opt,name=mood,enum=google.cloud.language.v1beta1.PartOfSpeech_Mood" json:"mood,omitempty"` + // The grammatical number. + Number PartOfSpeech_Number `protobuf:"varint,7,opt,name=number,enum=google.cloud.language.v1beta1.PartOfSpeech_Number" json:"number,omitempty"` + // The grammatical person. + Person PartOfSpeech_Person `protobuf:"varint,8,opt,name=person,enum=google.cloud.language.v1beta1.PartOfSpeech_Person" json:"person,omitempty"` + // The grammatical properness. + Proper PartOfSpeech_Proper `protobuf:"varint,9,opt,name=proper,enum=google.cloud.language.v1beta1.PartOfSpeech_Proper" json:"proper,omitempty"` + // The grammatical reciprocity. + Reciprocity PartOfSpeech_Reciprocity `protobuf:"varint,10,opt,name=reciprocity,enum=google.cloud.language.v1beta1.PartOfSpeech_Reciprocity" json:"reciprocity,omitempty"` + // The grammatical tense. + Tense PartOfSpeech_Tense `protobuf:"varint,11,opt,name=tense,enum=google.cloud.language.v1beta1.PartOfSpeech_Tense" json:"tense,omitempty"` + // The grammatical voice. + Voice PartOfSpeech_Voice `protobuf:"varint,12,opt,name=voice,enum=google.cloud.language.v1beta1.PartOfSpeech_Voice" json:"voice,omitempty"` +} + +func (m *PartOfSpeech) Reset() { *m = PartOfSpeech{} } +func (m *PartOfSpeech) String() string { return proto.CompactTextString(m) } +func (*PartOfSpeech) ProtoMessage() {} +func (*PartOfSpeech) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *PartOfSpeech) GetTag() PartOfSpeech_Tag { + if m != nil { + return m.Tag + } + return PartOfSpeech_UNKNOWN +} + +func (m *PartOfSpeech) GetAspect() PartOfSpeech_Aspect { + if m != nil { + return m.Aspect + } + return PartOfSpeech_ASPECT_UNKNOWN +} + +func (m *PartOfSpeech) GetCase() PartOfSpeech_Case { + if m != nil { + return m.Case + } + return PartOfSpeech_CASE_UNKNOWN +} + +func (m *PartOfSpeech) GetForm() PartOfSpeech_Form { + if m != nil { + return m.Form + } + return PartOfSpeech_FORM_UNKNOWN +} + +func (m *PartOfSpeech) GetGender() PartOfSpeech_Gender { + if m != nil { + return m.Gender + } + return PartOfSpeech_GENDER_UNKNOWN +} + +func (m *PartOfSpeech) GetMood() PartOfSpeech_Mood { + if m != nil { + return m.Mood + } + return PartOfSpeech_MOOD_UNKNOWN +} + +func (m *PartOfSpeech) GetNumber() PartOfSpeech_Number { + if m != nil { + return m.Number + } + return PartOfSpeech_NUMBER_UNKNOWN +} + +func (m *PartOfSpeech) GetPerson() PartOfSpeech_Person { + if m != nil { + return m.Person + } + return PartOfSpeech_PERSON_UNKNOWN +} + +func (m *PartOfSpeech) GetProper() PartOfSpeech_Proper { + if m != nil { + return m.Proper + } + return PartOfSpeech_PROPER_UNKNOWN +} + +func (m *PartOfSpeech) GetReciprocity() PartOfSpeech_Reciprocity { + if m != nil { + return m.Reciprocity + } + return PartOfSpeech_RECIPROCITY_UNKNOWN +} + +func (m *PartOfSpeech) GetTense() PartOfSpeech_Tense { + if m != nil { + return m.Tense + } + return PartOfSpeech_TENSE_UNKNOWN +} + +func (m *PartOfSpeech) GetVoice() PartOfSpeech_Voice { + if m != nil { + return m.Voice + } + return PartOfSpeech_VOICE_UNKNOWN +} + +// Represents dependency parse tree information for a token. +type DependencyEdge struct { + // Represents the head of this token in the dependency tree. + // This is the index of the token which has an arc going to this token. + // The index is the position of the token in the array of tokens returned + // by the API method. If this token is a root token, then the + // `head_token_index` is its own index. + HeadTokenIndex int32 `protobuf:"varint,1,opt,name=head_token_index,json=headTokenIndex" json:"head_token_index,omitempty"` + // The parse label for the token. + Label DependencyEdge_Label `protobuf:"varint,2,opt,name=label,enum=google.cloud.language.v1beta1.DependencyEdge_Label" json:"label,omitempty"` +} + +func (m *DependencyEdge) Reset() { *m = DependencyEdge{} } +func (m *DependencyEdge) String() string { return proto.CompactTextString(m) } +func (*DependencyEdge) ProtoMessage() {} +func (*DependencyEdge) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *DependencyEdge) GetHeadTokenIndex() int32 { + if m != nil { + return m.HeadTokenIndex + } + return 0 +} + +func (m *DependencyEdge) GetLabel() DependencyEdge_Label { + if m != nil { + return m.Label + } + return DependencyEdge_UNKNOWN +} + +// Represents a mention for an entity in the text. Currently, proper noun +// mentions are supported. +type EntityMention struct { + // The mention text. + Text *TextSpan `protobuf:"bytes,1,opt,name=text" json:"text,omitempty"` + // The type of the entity mention. + Type EntityMention_Type `protobuf:"varint,2,opt,name=type,enum=google.cloud.language.v1beta1.EntityMention_Type" json:"type,omitempty"` +} + +func (m *EntityMention) Reset() { *m = EntityMention{} } +func (m *EntityMention) String() string { return proto.CompactTextString(m) } +func (*EntityMention) ProtoMessage() {} +func (*EntityMention) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *EntityMention) GetText() *TextSpan { + if m != nil { + return m.Text + } + return nil +} + +func (m *EntityMention) GetType() EntityMention_Type { + if m != nil { + return m.Type + } + return EntityMention_TYPE_UNKNOWN +} + +// Represents an output piece of text. +type TextSpan struct { + // The content of the output text. + Content string `protobuf:"bytes,1,opt,name=content" json:"content,omitempty"` + // The API calculates the beginning offset of the content in the original + // document according to the [EncodingType][google.cloud.language.v1beta1.EncodingType] specified in the API request. + BeginOffset int32 `protobuf:"varint,2,opt,name=begin_offset,json=beginOffset" json:"begin_offset,omitempty"` +} + +func (m *TextSpan) Reset() { *m = TextSpan{} } +func (m *TextSpan) String() string { return proto.CompactTextString(m) } +func (*TextSpan) ProtoMessage() {} +func (*TextSpan) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *TextSpan) GetContent() string { + if m != nil { + return m.Content + } + return "" +} + +func (m *TextSpan) GetBeginOffset() int32 { + if m != nil { + return m.BeginOffset + } + return 0 +} + +// The sentiment analysis request message. +type AnalyzeSentimentRequest struct { + // Input document. + Document *Document `protobuf:"bytes,1,opt,name=document" json:"document,omitempty"` + // The encoding type used by the API to calculate sentence offsets for the + // sentence sentiment. + EncodingType EncodingType `protobuf:"varint,2,opt,name=encoding_type,json=encodingType,enum=google.cloud.language.v1beta1.EncodingType" json:"encoding_type,omitempty"` +} + +func (m *AnalyzeSentimentRequest) Reset() { *m = AnalyzeSentimentRequest{} } +func (m *AnalyzeSentimentRequest) String() string { return proto.CompactTextString(m) } +func (*AnalyzeSentimentRequest) ProtoMessage() {} +func (*AnalyzeSentimentRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *AnalyzeSentimentRequest) GetDocument() *Document { + if m != nil { + return m.Document + } + return nil +} + +func (m *AnalyzeSentimentRequest) GetEncodingType() EncodingType { + if m != nil { + return m.EncodingType + } + return EncodingType_NONE +} + +// The sentiment analysis response message. +type AnalyzeSentimentResponse struct { + // The overall sentiment of the input document. + DocumentSentiment *Sentiment `protobuf:"bytes,1,opt,name=document_sentiment,json=documentSentiment" json:"document_sentiment,omitempty"` + // The language of the text, which will be the same as the language specified + // in the request or, if not specified, the automatically-detected language. + // See [Document.language][google.cloud.language.v1beta1.Document.language] field for more details. + Language string `protobuf:"bytes,2,opt,name=language" json:"language,omitempty"` + // The sentiment for all the sentences in the document. + Sentences []*Sentence `protobuf:"bytes,3,rep,name=sentences" json:"sentences,omitempty"` +} + +func (m *AnalyzeSentimentResponse) Reset() { *m = AnalyzeSentimentResponse{} } +func (m *AnalyzeSentimentResponse) String() string { return proto.CompactTextString(m) } +func (*AnalyzeSentimentResponse) ProtoMessage() {} +func (*AnalyzeSentimentResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *AnalyzeSentimentResponse) GetDocumentSentiment() *Sentiment { + if m != nil { + return m.DocumentSentiment + } + return nil +} + +func (m *AnalyzeSentimentResponse) GetLanguage() string { + if m != nil { + return m.Language + } + return "" +} + +func (m *AnalyzeSentimentResponse) GetSentences() []*Sentence { + if m != nil { + return m.Sentences + } + return nil +} + +// The entity analysis request message. +type AnalyzeEntitiesRequest struct { + // Input document. + Document *Document `protobuf:"bytes,1,opt,name=document" json:"document,omitempty"` + // The encoding type used by the API to calculate offsets. + EncodingType EncodingType `protobuf:"varint,2,opt,name=encoding_type,json=encodingType,enum=google.cloud.language.v1beta1.EncodingType" json:"encoding_type,omitempty"` +} + +func (m *AnalyzeEntitiesRequest) Reset() { *m = AnalyzeEntitiesRequest{} } +func (m *AnalyzeEntitiesRequest) String() string { return proto.CompactTextString(m) } +func (*AnalyzeEntitiesRequest) ProtoMessage() {} +func (*AnalyzeEntitiesRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } + +func (m *AnalyzeEntitiesRequest) GetDocument() *Document { + if m != nil { + return m.Document + } + return nil +} + +func (m *AnalyzeEntitiesRequest) GetEncodingType() EncodingType { + if m != nil { + return m.EncodingType + } + return EncodingType_NONE +} + +// The entity analysis response message. +type AnalyzeEntitiesResponse struct { + // The recognized entities in the input document. + Entities []*Entity `protobuf:"bytes,1,rep,name=entities" json:"entities,omitempty"` + // The language of the text, which will be the same as the language specified + // in the request or, if not specified, the automatically-detected language. + // See [Document.language][google.cloud.language.v1beta1.Document.language] field for more details. + Language string `protobuf:"bytes,2,opt,name=language" json:"language,omitempty"` +} + +func (m *AnalyzeEntitiesResponse) Reset() { *m = AnalyzeEntitiesResponse{} } +func (m *AnalyzeEntitiesResponse) String() string { return proto.CompactTextString(m) } +func (*AnalyzeEntitiesResponse) ProtoMessage() {} +func (*AnalyzeEntitiesResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } + +func (m *AnalyzeEntitiesResponse) GetEntities() []*Entity { + if m != nil { + return m.Entities + } + return nil +} + +func (m *AnalyzeEntitiesResponse) GetLanguage() string { + if m != nil { + return m.Language + } + return "" +} + +// The syntax analysis request message. +type AnalyzeSyntaxRequest struct { + // Input document. + Document *Document `protobuf:"bytes,1,opt,name=document" json:"document,omitempty"` + // The encoding type used by the API to calculate offsets. + EncodingType EncodingType `protobuf:"varint,2,opt,name=encoding_type,json=encodingType,enum=google.cloud.language.v1beta1.EncodingType" json:"encoding_type,omitempty"` +} + +func (m *AnalyzeSyntaxRequest) Reset() { *m = AnalyzeSyntaxRequest{} } +func (m *AnalyzeSyntaxRequest) String() string { return proto.CompactTextString(m) } +func (*AnalyzeSyntaxRequest) ProtoMessage() {} +func (*AnalyzeSyntaxRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } + +func (m *AnalyzeSyntaxRequest) GetDocument() *Document { + if m != nil { + return m.Document + } + return nil +} + +func (m *AnalyzeSyntaxRequest) GetEncodingType() EncodingType { + if m != nil { + return m.EncodingType + } + return EncodingType_NONE +} + +// The syntax analysis response message. +type AnalyzeSyntaxResponse struct { + // Sentences in the input document. + Sentences []*Sentence `protobuf:"bytes,1,rep,name=sentences" json:"sentences,omitempty"` + // Tokens, along with their syntactic information, in the input document. + Tokens []*Token `protobuf:"bytes,2,rep,name=tokens" json:"tokens,omitempty"` + // The language of the text, which will be the same as the language specified + // in the request or, if not specified, the automatically-detected language. + // See [Document.language][google.cloud.language.v1beta1.Document.language] field for more details. + Language string `protobuf:"bytes,3,opt,name=language" json:"language,omitempty"` +} + +func (m *AnalyzeSyntaxResponse) Reset() { *m = AnalyzeSyntaxResponse{} } +func (m *AnalyzeSyntaxResponse) String() string { return proto.CompactTextString(m) } +func (*AnalyzeSyntaxResponse) ProtoMessage() {} +func (*AnalyzeSyntaxResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } + +func (m *AnalyzeSyntaxResponse) GetSentences() []*Sentence { + if m != nil { + return m.Sentences + } + return nil +} + +func (m *AnalyzeSyntaxResponse) GetTokens() []*Token { + if m != nil { + return m.Tokens + } + return nil +} + +func (m *AnalyzeSyntaxResponse) GetLanguage() string { + if m != nil { + return m.Language + } + return "" +} + +// The request message for the text annotation API, which can perform multiple +// analysis types (sentiment, entities, and syntax) in one call. +type AnnotateTextRequest struct { + // Input document. + Document *Document `protobuf:"bytes,1,opt,name=document" json:"document,omitempty"` + // The enabled features. + Features *AnnotateTextRequest_Features `protobuf:"bytes,2,opt,name=features" json:"features,omitempty"` + // The encoding type used by the API to calculate offsets. + EncodingType EncodingType `protobuf:"varint,3,opt,name=encoding_type,json=encodingType,enum=google.cloud.language.v1beta1.EncodingType" json:"encoding_type,omitempty"` +} + +func (m *AnnotateTextRequest) Reset() { *m = AnnotateTextRequest{} } +func (m *AnnotateTextRequest) String() string { return proto.CompactTextString(m) } +func (*AnnotateTextRequest) ProtoMessage() {} +func (*AnnotateTextRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } + +func (m *AnnotateTextRequest) GetDocument() *Document { + if m != nil { + return m.Document + } + return nil +} + +func (m *AnnotateTextRequest) GetFeatures() *AnnotateTextRequest_Features { + if m != nil { + return m.Features + } + return nil +} + +func (m *AnnotateTextRequest) GetEncodingType() EncodingType { + if m != nil { + return m.EncodingType + } + return EncodingType_NONE +} + +// All available features for sentiment, syntax, and semantic analysis. +// Setting each one to true will enable that specific analysis for the input. +type AnnotateTextRequest_Features struct { + // Extract syntax information. + ExtractSyntax bool `protobuf:"varint,1,opt,name=extract_syntax,json=extractSyntax" json:"extract_syntax,omitempty"` + // Extract entities. + ExtractEntities bool `protobuf:"varint,2,opt,name=extract_entities,json=extractEntities" json:"extract_entities,omitempty"` + // Extract document-level sentiment. + ExtractDocumentSentiment bool `protobuf:"varint,3,opt,name=extract_document_sentiment,json=extractDocumentSentiment" json:"extract_document_sentiment,omitempty"` +} + +func (m *AnnotateTextRequest_Features) Reset() { *m = AnnotateTextRequest_Features{} } +func (m *AnnotateTextRequest_Features) String() string { return proto.CompactTextString(m) } +func (*AnnotateTextRequest_Features) ProtoMessage() {} +func (*AnnotateTextRequest_Features) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{15, 0} +} + +func (m *AnnotateTextRequest_Features) GetExtractSyntax() bool { + if m != nil { + return m.ExtractSyntax + } + return false +} + +func (m *AnnotateTextRequest_Features) GetExtractEntities() bool { + if m != nil { + return m.ExtractEntities + } + return false +} + +func (m *AnnotateTextRequest_Features) GetExtractDocumentSentiment() bool { + if m != nil { + return m.ExtractDocumentSentiment + } + return false +} + +// The text annotations response message. +type AnnotateTextResponse struct { + // Sentences in the input document. Populated if the user enables + // [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1beta1.AnnotateTextRequest.Features.extract_syntax]. + Sentences []*Sentence `protobuf:"bytes,1,rep,name=sentences" json:"sentences,omitempty"` + // Tokens, along with their syntactic information, in the input document. + // Populated if the user enables + // [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1beta1.AnnotateTextRequest.Features.extract_syntax]. + Tokens []*Token `protobuf:"bytes,2,rep,name=tokens" json:"tokens,omitempty"` + // Entities, along with their semantic information, in the input document. + // Populated if the user enables + // [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v1beta1.AnnotateTextRequest.Features.extract_entities]. + Entities []*Entity `protobuf:"bytes,3,rep,name=entities" json:"entities,omitempty"` + // The overall sentiment for the document. Populated if the user enables + // [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1beta1.AnnotateTextRequest.Features.extract_document_sentiment]. + DocumentSentiment *Sentiment `protobuf:"bytes,4,opt,name=document_sentiment,json=documentSentiment" json:"document_sentiment,omitempty"` + // The language of the text, which will be the same as the language specified + // in the request or, if not specified, the automatically-detected language. + // See [Document.language][google.cloud.language.v1beta1.Document.language] field for more details. + Language string `protobuf:"bytes,5,opt,name=language" json:"language,omitempty"` +} + +func (m *AnnotateTextResponse) Reset() { *m = AnnotateTextResponse{} } +func (m *AnnotateTextResponse) String() string { return proto.CompactTextString(m) } +func (*AnnotateTextResponse) ProtoMessage() {} +func (*AnnotateTextResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} } + +func (m *AnnotateTextResponse) GetSentences() []*Sentence { + if m != nil { + return m.Sentences + } + return nil +} + +func (m *AnnotateTextResponse) GetTokens() []*Token { + if m != nil { + return m.Tokens + } + return nil +} + +func (m *AnnotateTextResponse) GetEntities() []*Entity { + if m != nil { + return m.Entities + } + return nil +} + +func (m *AnnotateTextResponse) GetDocumentSentiment() *Sentiment { + if m != nil { + return m.DocumentSentiment + } + return nil +} + +func (m *AnnotateTextResponse) GetLanguage() string { + if m != nil { + return m.Language + } + return "" +} + +func init() { + proto.RegisterType((*Document)(nil), "google.cloud.language.v1beta1.Document") + proto.RegisterType((*Sentence)(nil), "google.cloud.language.v1beta1.Sentence") + proto.RegisterType((*Entity)(nil), "google.cloud.language.v1beta1.Entity") + proto.RegisterType((*Token)(nil), "google.cloud.language.v1beta1.Token") + proto.RegisterType((*Sentiment)(nil), "google.cloud.language.v1beta1.Sentiment") + proto.RegisterType((*PartOfSpeech)(nil), "google.cloud.language.v1beta1.PartOfSpeech") + proto.RegisterType((*DependencyEdge)(nil), "google.cloud.language.v1beta1.DependencyEdge") + proto.RegisterType((*EntityMention)(nil), "google.cloud.language.v1beta1.EntityMention") + proto.RegisterType((*TextSpan)(nil), "google.cloud.language.v1beta1.TextSpan") + proto.RegisterType((*AnalyzeSentimentRequest)(nil), "google.cloud.language.v1beta1.AnalyzeSentimentRequest") + proto.RegisterType((*AnalyzeSentimentResponse)(nil), "google.cloud.language.v1beta1.AnalyzeSentimentResponse") + proto.RegisterType((*AnalyzeEntitiesRequest)(nil), "google.cloud.language.v1beta1.AnalyzeEntitiesRequest") + proto.RegisterType((*AnalyzeEntitiesResponse)(nil), "google.cloud.language.v1beta1.AnalyzeEntitiesResponse") + proto.RegisterType((*AnalyzeSyntaxRequest)(nil), "google.cloud.language.v1beta1.AnalyzeSyntaxRequest") + proto.RegisterType((*AnalyzeSyntaxResponse)(nil), "google.cloud.language.v1beta1.AnalyzeSyntaxResponse") + proto.RegisterType((*AnnotateTextRequest)(nil), "google.cloud.language.v1beta1.AnnotateTextRequest") + proto.RegisterType((*AnnotateTextRequest_Features)(nil), "google.cloud.language.v1beta1.AnnotateTextRequest.Features") + proto.RegisterType((*AnnotateTextResponse)(nil), "google.cloud.language.v1beta1.AnnotateTextResponse") + proto.RegisterEnum("google.cloud.language.v1beta1.EncodingType", EncodingType_name, EncodingType_value) + proto.RegisterEnum("google.cloud.language.v1beta1.Document_Type", Document_Type_name, Document_Type_value) + proto.RegisterEnum("google.cloud.language.v1beta1.Entity_Type", Entity_Type_name, Entity_Type_value) + proto.RegisterEnum("google.cloud.language.v1beta1.PartOfSpeech_Tag", PartOfSpeech_Tag_name, PartOfSpeech_Tag_value) + proto.RegisterEnum("google.cloud.language.v1beta1.PartOfSpeech_Aspect", PartOfSpeech_Aspect_name, PartOfSpeech_Aspect_value) + proto.RegisterEnum("google.cloud.language.v1beta1.PartOfSpeech_Case", PartOfSpeech_Case_name, PartOfSpeech_Case_value) + proto.RegisterEnum("google.cloud.language.v1beta1.PartOfSpeech_Form", PartOfSpeech_Form_name, PartOfSpeech_Form_value) + proto.RegisterEnum("google.cloud.language.v1beta1.PartOfSpeech_Gender", PartOfSpeech_Gender_name, PartOfSpeech_Gender_value) + proto.RegisterEnum("google.cloud.language.v1beta1.PartOfSpeech_Mood", PartOfSpeech_Mood_name, PartOfSpeech_Mood_value) + proto.RegisterEnum("google.cloud.language.v1beta1.PartOfSpeech_Number", PartOfSpeech_Number_name, PartOfSpeech_Number_value) + proto.RegisterEnum("google.cloud.language.v1beta1.PartOfSpeech_Person", PartOfSpeech_Person_name, PartOfSpeech_Person_value) + proto.RegisterEnum("google.cloud.language.v1beta1.PartOfSpeech_Proper", PartOfSpeech_Proper_name, PartOfSpeech_Proper_value) + proto.RegisterEnum("google.cloud.language.v1beta1.PartOfSpeech_Reciprocity", PartOfSpeech_Reciprocity_name, PartOfSpeech_Reciprocity_value) + proto.RegisterEnum("google.cloud.language.v1beta1.PartOfSpeech_Tense", PartOfSpeech_Tense_name, PartOfSpeech_Tense_value) + proto.RegisterEnum("google.cloud.language.v1beta1.PartOfSpeech_Voice", PartOfSpeech_Voice_name, PartOfSpeech_Voice_value) + proto.RegisterEnum("google.cloud.language.v1beta1.DependencyEdge_Label", DependencyEdge_Label_name, DependencyEdge_Label_value) + proto.RegisterEnum("google.cloud.language.v1beta1.EntityMention_Type", EntityMention_Type_name, EntityMention_Type_value) +} + +// 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 + +// Client API for LanguageService service + +type LanguageServiceClient interface { + // Analyzes the sentiment of the provided text. + AnalyzeSentiment(ctx context.Context, in *AnalyzeSentimentRequest, opts ...grpc.CallOption) (*AnalyzeSentimentResponse, error) + // Finds named entities (currently proper names and common nouns) in the text + // along with entity types, salience, mentions for each entity, and + // other properties. + AnalyzeEntities(ctx context.Context, in *AnalyzeEntitiesRequest, opts ...grpc.CallOption) (*AnalyzeEntitiesResponse, error) + // Analyzes the syntax of the text and provides sentence boundaries and + // tokenization along with part of speech tags, dependency trees, and other + // properties. + AnalyzeSyntax(ctx context.Context, in *AnalyzeSyntaxRequest, opts ...grpc.CallOption) (*AnalyzeSyntaxResponse, error) + // A convenience method that provides all the features that analyzeSentiment, + // analyzeEntities, and analyzeSyntax provide in one call. + AnnotateText(ctx context.Context, in *AnnotateTextRequest, opts ...grpc.CallOption) (*AnnotateTextResponse, error) +} + +type languageServiceClient struct { + cc *grpc.ClientConn +} + +func NewLanguageServiceClient(cc *grpc.ClientConn) LanguageServiceClient { + return &languageServiceClient{cc} +} + +func (c *languageServiceClient) AnalyzeSentiment(ctx context.Context, in *AnalyzeSentimentRequest, opts ...grpc.CallOption) (*AnalyzeSentimentResponse, error) { + out := new(AnalyzeSentimentResponse) + err := grpc.Invoke(ctx, "/google.cloud.language.v1beta1.LanguageService/AnalyzeSentiment", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *languageServiceClient) AnalyzeEntities(ctx context.Context, in *AnalyzeEntitiesRequest, opts ...grpc.CallOption) (*AnalyzeEntitiesResponse, error) { + out := new(AnalyzeEntitiesResponse) + err := grpc.Invoke(ctx, "/google.cloud.language.v1beta1.LanguageService/AnalyzeEntities", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *languageServiceClient) AnalyzeSyntax(ctx context.Context, in *AnalyzeSyntaxRequest, opts ...grpc.CallOption) (*AnalyzeSyntaxResponse, error) { + out := new(AnalyzeSyntaxResponse) + err := grpc.Invoke(ctx, "/google.cloud.language.v1beta1.LanguageService/AnalyzeSyntax", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *languageServiceClient) AnnotateText(ctx context.Context, in *AnnotateTextRequest, opts ...grpc.CallOption) (*AnnotateTextResponse, error) { + out := new(AnnotateTextResponse) + err := grpc.Invoke(ctx, "/google.cloud.language.v1beta1.LanguageService/AnnotateText", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for LanguageService service + +type LanguageServiceServer interface { + // Analyzes the sentiment of the provided text. + AnalyzeSentiment(context.Context, *AnalyzeSentimentRequest) (*AnalyzeSentimentResponse, error) + // Finds named entities (currently proper names and common nouns) in the text + // along with entity types, salience, mentions for each entity, and + // other properties. + AnalyzeEntities(context.Context, *AnalyzeEntitiesRequest) (*AnalyzeEntitiesResponse, error) + // Analyzes the syntax of the text and provides sentence boundaries and + // tokenization along with part of speech tags, dependency trees, and other + // properties. + AnalyzeSyntax(context.Context, *AnalyzeSyntaxRequest) (*AnalyzeSyntaxResponse, error) + // A convenience method that provides all the features that analyzeSentiment, + // analyzeEntities, and analyzeSyntax provide in one call. + AnnotateText(context.Context, *AnnotateTextRequest) (*AnnotateTextResponse, error) +} + +func RegisterLanguageServiceServer(s *grpc.Server, srv LanguageServiceServer) { + s.RegisterService(&_LanguageService_serviceDesc, srv) +} + +func _LanguageService_AnalyzeSentiment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AnalyzeSentimentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LanguageServiceServer).AnalyzeSentiment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.language.v1beta1.LanguageService/AnalyzeSentiment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LanguageServiceServer).AnalyzeSentiment(ctx, req.(*AnalyzeSentimentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LanguageService_AnalyzeEntities_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AnalyzeEntitiesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LanguageServiceServer).AnalyzeEntities(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.language.v1beta1.LanguageService/AnalyzeEntities", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LanguageServiceServer).AnalyzeEntities(ctx, req.(*AnalyzeEntitiesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LanguageService_AnalyzeSyntax_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AnalyzeSyntaxRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LanguageServiceServer).AnalyzeSyntax(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.language.v1beta1.LanguageService/AnalyzeSyntax", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LanguageServiceServer).AnalyzeSyntax(ctx, req.(*AnalyzeSyntaxRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LanguageService_AnnotateText_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AnnotateTextRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LanguageServiceServer).AnnotateText(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.language.v1beta1.LanguageService/AnnotateText", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LanguageServiceServer).AnnotateText(ctx, req.(*AnnotateTextRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _LanguageService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.cloud.language.v1beta1.LanguageService", + HandlerType: (*LanguageServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "AnalyzeSentiment", + Handler: _LanguageService_AnalyzeSentiment_Handler, + }, + { + MethodName: "AnalyzeEntities", + Handler: _LanguageService_AnalyzeEntities_Handler, + }, + { + MethodName: "AnalyzeSyntax", + Handler: _LanguageService_AnalyzeSyntax_Handler, + }, + { + MethodName: "AnnotateText", + Handler: _LanguageService_AnnotateText_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/cloud/language/v1beta1/language_service.proto", +} + +func init() { + proto.RegisterFile("google/cloud/language/v1beta1/language_service.proto", fileDescriptor0) +} + +var fileDescriptor0 = []byte{ + // 2755 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x59, 0x4f, 0x73, 0xdb, 0xc6, + 0x15, 0x37, 0xf8, 0x4f, 0xe4, 0x92, 0x92, 0xd6, 0x88, 0x93, 0xb0, 0x6a, 0xd2, 0x38, 0x48, 0x5c, + 0x2b, 0x76, 0x42, 0xc5, 0x52, 0xe2, 0xb8, 0x76, 0x9a, 0x06, 0x02, 0x96, 0x14, 0x64, 0x10, 0x40, + 0x16, 0x00, 0x25, 0xa7, 0x07, 0x0e, 0x4c, 0xae, 0x19, 0x4e, 0x24, 0x80, 0x25, 0x21, 0x8f, 0xd5, + 0x4b, 0x67, 0x32, 0xd3, 0x63, 0xa7, 0x87, 0xde, 0x7a, 0x6c, 0x0f, 0x3d, 0x75, 0xd2, 0x99, 0x5e, + 0xda, 0x0f, 0xd0, 0x43, 0xa7, 0xc7, 0xcc, 0xf4, 0x13, 0xf4, 0xd8, 0x43, 0x0f, 0x3d, 0xf4, 0xd8, + 0x79, 0xbb, 0x0b, 0xfe, 0x51, 0x1c, 0x4b, 0x4c, 0x72, 0xc8, 0x6d, 0xf7, 0xf1, 0xfd, 0x7e, 0xef, + 0xed, 0xdb, 0xb7, 0xef, 0x2d, 0x96, 0xe8, 0x9d, 0x41, 0x92, 0x0c, 0x8e, 0xd8, 0x56, 0xef, 0x28, + 0x39, 0xe9, 0x6f, 0x1d, 0x45, 0xf1, 0xe0, 0x24, 0x1a, 0xb0, 0xad, 0xc7, 0xb7, 0x1e, 0xb2, 0x34, + 0xba, 0x35, 0x15, 0x74, 0x27, 0x6c, 0xfc, 0x78, 0xd8, 0x63, 0x8d, 0xd1, 0x38, 0x49, 0x13, 0xf5, + 0x65, 0x81, 0x6a, 0x70, 0x54, 0x23, 0x53, 0x6a, 0x48, 0xd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 0x61, 0xf5, 0x2a, 0x27, 0xbd, 0xb5, 0x54, 0xb6, 0x03, 0x90, 0x0a, 0x3c, + 0x10, 0x3d, 0x4e, 0x86, 0x3d, 0x56, 0xaf, 0x2d, 0x4f, 0xd4, 0x01, 0x20, 0x15, 0x78, 0xed, 0x57, + 0x0a, 0xca, 0x07, 0xd1, 0x60, 0xb1, 0xdc, 0xae, 0xa0, 0xbc, 0x6e, 0xee, 0x63, 0x45, 0x0c, 0x3c, + 0x9c, 0x13, 0x83, 0x0e, 0xce, 0x43, 0x5f, 0x36, 0x5c, 0x67, 0x1f, 0x17, 0x40, 0x64, 0x12, 0x28, + 0xaa, 0x65, 0x54, 0x70, 0xdc, 0xd0, 0xc1, 0x25, 0x10, 0x39, 0x61, 0x1b, 0xaf, 0x80, 0xc8, 0xa3, + 0xae, 0x83, 0xcb, 0x20, 0xf2, 0x68, 0x80, 0x2b, 0x50, 0x67, 0xbd, 0xd0, 0x31, 0x02, 0x8c, 0xe0, + 0xd7, 0x0e, 0xa1, 0xbb, 0xb8, 0xaa, 0x16, 0x91, 0x72, 0x88, 0x6b, 0xf0, 0x9b, 0xde, 0x6c, 0x5a, + 0x87, 0x78, 0x55, 0x73, 0x51, 0x49, 0x1c, 0x48, 0x55, 0x45, 0x6b, 0x3a, 0xdc, 0x10, 0x82, 0xee, + 0xcc, 0x31, 0xb8, 0x25, 0x10, 0xda, 0x24, 0x46, 0x60, 0x75, 0x08, 0x56, 0xa0, 0xfa, 0x5b, 0xed, + 0x39, 0x49, 0x0e, 0x4a, 0xbe, 0x47, 0xdd, 0x16, 0x25, 0xbe, 0x0f, 0x82, 0xbc, 0xf6, 0x3f, 0x05, + 0x15, 0xe0, 0x60, 0x82, 0xae, 0xa1, 0xfb, 0x64, 0x91, 0x4d, 0x37, 0x8c, 0xd0, 0xd7, 0x25, 0xdb, + 0x2a, 0xaa, 0xe8, 0x26, 0x78, 0x66, 0xe9, 0x36, 0xce, 0x89, 0x66, 0xd1, 0xf6, 0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0x49, 0x28, 0x46, 0xa0, 0x2d, 0xaf, 0x81, 0x06, 0xae, 0x6a, 0x04, 0x95, 0x44, + 0xd9, 0x02, 0x1f, 0x5a, 0xc4, 0x31, 0x09, 0x5d, 0x74, 0xba, 0x49, 0xda, 0x96, 0x63, 0x39, 0x72, + 0xb7, 0xda, 0xba, 0x6f, 0x84, 0x36, 0x4c, 0x73, 0xe0, 0x82, 0x43, 0xc2, 0x00, 0x9c, 0xd5, 0x7e, + 0x81, 0x0a, 0x50, 0xb3, 0xc0, 0xe9, 0xb6, 0xeb, 0x9a, 0x73, 0x14, 0x57, 0x10, 0x36, 0x5c, 0xc7, + 0x94, 0x81, 0xed, 0xc2, 0xaf, 0x58, 0x81, 0xcd, 0xe1, 0x69, 0xa4, 0xcb, 0x24, 0x82, 0xb9, 0x63, + 0x5a, 0x32, 0x90, 0x79, 0x88, 0xb4, 0xe5, 0x04, 0x84, 0x52, 0xb7, 0x95, 0xed, 0x7e, 0x15, 0xad, + 0xec, 0x87, 0x22, 0xc7, 0x8a, 0x90, 0x74, 0x7e, 0xb8, 0xbb, 0x0f, 0xe9, 0x0d, 0x82, 0x92, 0xf6, + 0x21, 0x2a, 0x89, 0x62, 0x07, 0xeb, 0x70, 0xc2, 0xf6, 0xee, 0xd9, 0x75, 0xf8, 0x96, 0xd3, 0x0a, + 0x6d, 0x9d, 0x62, 0x85, 0xdf, 0x6d, 0xec, 0x90, 0xf2, 0x94, 0x2b, 0xa3, 0x82, 0x19, 0xea, 0x36, + 0xce, 0x6b, 0x01, 0x2a, 0x89, 0x12, 0x07, 0x0c, 0xe2, 0xee, 0x33, 0xc7, 0x50, 0x41, 0xc5, 0xa6, + 0x45, 0xfd, 0x40, 0xc0, 0x7d, 0x02, 0x6b, 0xc2, 0x39, 0x10, 0x07, 0x7b, 0x16, 0x35, 0x71, 0x1e, + 0x16, 0x3a, 0x4b, 0x18, 0x79, 0x77, 0x2a, 0x68, 0x77, 0x50, 0x49, 0x14, 0x3b, 0xce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0xc4, 0x4f, 0xd1, 0x68, 0x38, 0xf9, 0x8a, 0xff, 0x5b, 0xef, 0x65, 0x82, + 0x87, 0x25, 0x8e, 0xd8, 0xf9, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe6, 0xf6, 0xe5, 0xb1, 0xa0, + 0x1d, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/language/v1beta2/language_service.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/language/v1beta2/language_service.pb.go new file mode 100644 index 0000000000..a1fea0695f --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/language/v1beta2/language_service.pb.go @@ -0,0 +1,2596 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/language/v1beta2/language_service.proto + +/* +Package language is a generated protocol buffer package. + +It is generated from these files: + google/cloud/language/v1beta2/language_service.proto + +It has these top-level messages: + Document + Sentence + Entity + Token + Sentiment + PartOfSpeech + DependencyEdge + EntityMention + TextSpan + ClassificationCategory + AnalyzeSentimentRequest + AnalyzeSentimentResponse + AnalyzeEntitySentimentRequest + AnalyzeEntitySentimentResponse + AnalyzeEntitiesRequest + AnalyzeEntitiesResponse + AnalyzeSyntaxRequest + AnalyzeSyntaxResponse + ClassifyTextRequest + ClassifyTextResponse + AnnotateTextRequest + AnnotateTextResponse +*/ +package language + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import _ "google.golang.org/genproto/googleapis/longrunning" +import _ "github.com/golang/protobuf/ptypes/timestamp" +import _ "google.golang.org/genproto/googleapis/rpc/status" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Represents the text encoding that the caller uses to process the output. +// Providing an `EncodingType` is recommended because the API provides the +// beginning offsets for various outputs, such as tokens and mentions, and +// languages that natively use different text encodings may access offsets +// differently. +type EncodingType int32 + +const ( + // If `EncodingType` is not specified, encoding-dependent information (such as + // `begin_offset`) will be set at `-1`. + EncodingType_NONE EncodingType = 0 + // Encoding-dependent information (such as `begin_offset`) is calculated based + // on the UTF-8 encoding of the input. C++ and Go are examples of languages + // that use this encoding natively. + EncodingType_UTF8 EncodingType = 1 + // Encoding-dependent information (such as `begin_offset`) is calculated based + // on the UTF-16 encoding of the input. Java and Javascript are examples of + // languages that use this encoding natively. + EncodingType_UTF16 EncodingType = 2 + // Encoding-dependent information (such as `begin_offset`) is calculated based + // on the UTF-32 encoding of the input. Python is an example of a language + // that uses this encoding natively. + EncodingType_UTF32 EncodingType = 3 +) + +var EncodingType_name = map[int32]string{ + 0: "NONE", + 1: "UTF8", + 2: "UTF16", + 3: "UTF32", +} +var EncodingType_value = map[string]int32{ + "NONE": 0, + "UTF8": 1, + "UTF16": 2, + "UTF32": 3, +} + +func (x EncodingType) String() string { + return proto.EnumName(EncodingType_name, int32(x)) +} +func (EncodingType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +// The document types enum. +type Document_Type int32 + +const ( + // The content type is not specified. + Document_TYPE_UNSPECIFIED Document_Type = 0 + // Plain text + Document_PLAIN_TEXT Document_Type = 1 + // HTML + Document_HTML Document_Type = 2 +) + +var Document_Type_name = map[int32]string{ + 0: "TYPE_UNSPECIFIED", + 1: "PLAIN_TEXT", + 2: "HTML", +} +var Document_Type_value = map[string]int32{ + "TYPE_UNSPECIFIED": 0, + "PLAIN_TEXT": 1, + "HTML": 2, +} + +func (x Document_Type) String() string { + return proto.EnumName(Document_Type_name, int32(x)) +} +func (Document_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 0} } + +// The type of the entity. +type Entity_Type int32 + +const ( + // Unknown + Entity_UNKNOWN Entity_Type = 0 + // Person + Entity_PERSON Entity_Type = 1 + // Location + Entity_LOCATION Entity_Type = 2 + // Organization + Entity_ORGANIZATION Entity_Type = 3 + // Event + Entity_EVENT Entity_Type = 4 + // Work of art + Entity_WORK_OF_ART Entity_Type = 5 + // Consumer goods + Entity_CONSUMER_GOOD Entity_Type = 6 + // Other types + Entity_OTHER Entity_Type = 7 +) + +var Entity_Type_name = map[int32]string{ + 0: "UNKNOWN", + 1: "PERSON", + 2: "LOCATION", + 3: "ORGANIZATION", + 4: "EVENT", + 5: "WORK_OF_ART", + 6: "CONSUMER_GOOD", + 7: "OTHER", +} +var Entity_Type_value = map[string]int32{ + "UNKNOWN": 0, + "PERSON": 1, + "LOCATION": 2, + "ORGANIZATION": 3, + "EVENT": 4, + "WORK_OF_ART": 5, + "CONSUMER_GOOD": 6, + "OTHER": 7, +} + +func (x Entity_Type) String() string { + return proto.EnumName(Entity_Type_name, int32(x)) +} +func (Entity_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{2, 0} } + +// The part of speech tags enum. +type PartOfSpeech_Tag int32 + +const ( + // Unknown + PartOfSpeech_UNKNOWN PartOfSpeech_Tag = 0 + // Adjective + PartOfSpeech_ADJ PartOfSpeech_Tag = 1 + // Adposition (preposition and postposition) + PartOfSpeech_ADP PartOfSpeech_Tag = 2 + // Adverb + PartOfSpeech_ADV PartOfSpeech_Tag = 3 + // Conjunction + PartOfSpeech_CONJ PartOfSpeech_Tag = 4 + // Determiner + PartOfSpeech_DET PartOfSpeech_Tag = 5 + // Noun (common and proper) + PartOfSpeech_NOUN PartOfSpeech_Tag = 6 + // Cardinal number + PartOfSpeech_NUM PartOfSpeech_Tag = 7 + // Pronoun + PartOfSpeech_PRON PartOfSpeech_Tag = 8 + // Particle or other function word + PartOfSpeech_PRT PartOfSpeech_Tag = 9 + // Punctuation + PartOfSpeech_PUNCT PartOfSpeech_Tag = 10 + // Verb (all tenses and modes) + PartOfSpeech_VERB PartOfSpeech_Tag = 11 + // Other: foreign words, typos, abbreviations + PartOfSpeech_X PartOfSpeech_Tag = 12 + // Affix + PartOfSpeech_AFFIX PartOfSpeech_Tag = 13 +) + +var PartOfSpeech_Tag_name = map[int32]string{ + 0: "UNKNOWN", + 1: "ADJ", + 2: "ADP", + 3: "ADV", + 4: "CONJ", + 5: "DET", + 6: "NOUN", + 7: "NUM", + 8: "PRON", + 9: "PRT", + 10: "PUNCT", + 11: "VERB", + 12: "X", + 13: "AFFIX", +} +var PartOfSpeech_Tag_value = map[string]int32{ + "UNKNOWN": 0, + "ADJ": 1, + "ADP": 2, + "ADV": 3, + "CONJ": 4, + "DET": 5, + "NOUN": 6, + "NUM": 7, + "PRON": 8, + "PRT": 9, + "PUNCT": 10, + "VERB": 11, + "X": 12, + "AFFIX": 13, +} + +func (x PartOfSpeech_Tag) String() string { + return proto.EnumName(PartOfSpeech_Tag_name, int32(x)) +} +func (PartOfSpeech_Tag) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 0} } + +// The characteristic of a verb that expresses time flow during an event. +type PartOfSpeech_Aspect int32 + +const ( + // Aspect is not applicable in the analyzed language or is not predicted. + PartOfSpeech_ASPECT_UNKNOWN PartOfSpeech_Aspect = 0 + // Perfective + PartOfSpeech_PERFECTIVE PartOfSpeech_Aspect = 1 + // Imperfective + PartOfSpeech_IMPERFECTIVE PartOfSpeech_Aspect = 2 + // Progressive + PartOfSpeech_PROGRESSIVE PartOfSpeech_Aspect = 3 +) + +var PartOfSpeech_Aspect_name = map[int32]string{ + 0: "ASPECT_UNKNOWN", + 1: "PERFECTIVE", + 2: "IMPERFECTIVE", + 3: "PROGRESSIVE", +} +var PartOfSpeech_Aspect_value = map[string]int32{ + "ASPECT_UNKNOWN": 0, + "PERFECTIVE": 1, + "IMPERFECTIVE": 2, + "PROGRESSIVE": 3, +} + +func (x PartOfSpeech_Aspect) String() string { + return proto.EnumName(PartOfSpeech_Aspect_name, int32(x)) +} +func (PartOfSpeech_Aspect) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 1} } + +// The grammatical function performed by a noun or pronoun in a phrase, +// clause, or sentence. In some languages, other parts of speech, such as +// adjective and determiner, take case inflection in agreement with the noun. +type PartOfSpeech_Case int32 + +const ( + // Case is not applicable in the analyzed language or is not predicted. + PartOfSpeech_CASE_UNKNOWN PartOfSpeech_Case = 0 + // Accusative + PartOfSpeech_ACCUSATIVE PartOfSpeech_Case = 1 + // Adverbial + PartOfSpeech_ADVERBIAL PartOfSpeech_Case = 2 + // Complementive + PartOfSpeech_COMPLEMENTIVE PartOfSpeech_Case = 3 + // Dative + PartOfSpeech_DATIVE PartOfSpeech_Case = 4 + // Genitive + PartOfSpeech_GENITIVE PartOfSpeech_Case = 5 + // Instrumental + PartOfSpeech_INSTRUMENTAL PartOfSpeech_Case = 6 + // Locative + PartOfSpeech_LOCATIVE PartOfSpeech_Case = 7 + // Nominative + PartOfSpeech_NOMINATIVE PartOfSpeech_Case = 8 + // Oblique + PartOfSpeech_OBLIQUE PartOfSpeech_Case = 9 + // Partitive + PartOfSpeech_PARTITIVE PartOfSpeech_Case = 10 + // Prepositional + PartOfSpeech_PREPOSITIONAL PartOfSpeech_Case = 11 + // Reflexive + PartOfSpeech_REFLEXIVE_CASE PartOfSpeech_Case = 12 + // Relative + PartOfSpeech_RELATIVE_CASE PartOfSpeech_Case = 13 + // Vocative + PartOfSpeech_VOCATIVE PartOfSpeech_Case = 14 +) + +var PartOfSpeech_Case_name = map[int32]string{ + 0: "CASE_UNKNOWN", + 1: "ACCUSATIVE", + 2: "ADVERBIAL", + 3: "COMPLEMENTIVE", + 4: "DATIVE", + 5: "GENITIVE", + 6: "INSTRUMENTAL", + 7: "LOCATIVE", + 8: "NOMINATIVE", + 9: "OBLIQUE", + 10: "PARTITIVE", + 11: "PREPOSITIONAL", + 12: "REFLEXIVE_CASE", + 13: "RELATIVE_CASE", + 14: "VOCATIVE", +} +var PartOfSpeech_Case_value = map[string]int32{ + "CASE_UNKNOWN": 0, + "ACCUSATIVE": 1, + "ADVERBIAL": 2, + "COMPLEMENTIVE": 3, + "DATIVE": 4, + "GENITIVE": 5, + "INSTRUMENTAL": 6, + "LOCATIVE": 7, + "NOMINATIVE": 8, + "OBLIQUE": 9, + "PARTITIVE": 10, + "PREPOSITIONAL": 11, + "REFLEXIVE_CASE": 12, + "RELATIVE_CASE": 13, + "VOCATIVE": 14, +} + +func (x PartOfSpeech_Case) String() string { + return proto.EnumName(PartOfSpeech_Case_name, int32(x)) +} +func (PartOfSpeech_Case) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 2} } + +// Depending on the language, Form can be categorizing different forms of +// verbs, adjectives, adverbs, etc. For example, categorizing inflected +// endings of verbs and adjectives or distinguishing between short and long +// forms of adjectives and participles +type PartOfSpeech_Form int32 + +const ( + // Form is not applicable in the analyzed language or is not predicted. + PartOfSpeech_FORM_UNKNOWN PartOfSpeech_Form = 0 + // Adnomial + PartOfSpeech_ADNOMIAL PartOfSpeech_Form = 1 + // Auxiliary + PartOfSpeech_AUXILIARY PartOfSpeech_Form = 2 + // Complementizer + PartOfSpeech_COMPLEMENTIZER PartOfSpeech_Form = 3 + // Final ending + PartOfSpeech_FINAL_ENDING PartOfSpeech_Form = 4 + // Gerund + PartOfSpeech_GERUND PartOfSpeech_Form = 5 + // Realis + PartOfSpeech_REALIS PartOfSpeech_Form = 6 + // Irrealis + PartOfSpeech_IRREALIS PartOfSpeech_Form = 7 + // Short form + PartOfSpeech_SHORT PartOfSpeech_Form = 8 + // Long form + PartOfSpeech_LONG PartOfSpeech_Form = 9 + // Order form + PartOfSpeech_ORDER PartOfSpeech_Form = 10 + // Specific form + PartOfSpeech_SPECIFIC PartOfSpeech_Form = 11 +) + +var PartOfSpeech_Form_name = map[int32]string{ + 0: "FORM_UNKNOWN", + 1: "ADNOMIAL", + 2: "AUXILIARY", + 3: "COMPLEMENTIZER", + 4: "FINAL_ENDING", + 5: "GERUND", + 6: "REALIS", + 7: "IRREALIS", + 8: "SHORT", + 9: "LONG", + 10: "ORDER", + 11: "SPECIFIC", +} +var PartOfSpeech_Form_value = map[string]int32{ + "FORM_UNKNOWN": 0, + "ADNOMIAL": 1, + "AUXILIARY": 2, + "COMPLEMENTIZER": 3, + "FINAL_ENDING": 4, + "GERUND": 5, + "REALIS": 6, + "IRREALIS": 7, + "SHORT": 8, + "LONG": 9, + "ORDER": 10, + "SPECIFIC": 11, +} + +func (x PartOfSpeech_Form) String() string { + return proto.EnumName(PartOfSpeech_Form_name, int32(x)) +} +func (PartOfSpeech_Form) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 3} } + +// Gender classes of nouns reflected in the behaviour of associated words. +type PartOfSpeech_Gender int32 + +const ( + // Gender is not applicable in the analyzed language or is not predicted. + PartOfSpeech_GENDER_UNKNOWN PartOfSpeech_Gender = 0 + // Feminine + PartOfSpeech_FEMININE PartOfSpeech_Gender = 1 + // Masculine + PartOfSpeech_MASCULINE PartOfSpeech_Gender = 2 + // Neuter + PartOfSpeech_NEUTER PartOfSpeech_Gender = 3 +) + +var PartOfSpeech_Gender_name = map[int32]string{ + 0: "GENDER_UNKNOWN", + 1: "FEMININE", + 2: "MASCULINE", + 3: "NEUTER", +} +var PartOfSpeech_Gender_value = map[string]int32{ + "GENDER_UNKNOWN": 0, + "FEMININE": 1, + "MASCULINE": 2, + "NEUTER": 3, +} + +func (x PartOfSpeech_Gender) String() string { + return proto.EnumName(PartOfSpeech_Gender_name, int32(x)) +} +func (PartOfSpeech_Gender) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 4} } + +// The grammatical feature of verbs, used for showing modality and attitude. +type PartOfSpeech_Mood int32 + +const ( + // Mood is not applicable in the analyzed language or is not predicted. + PartOfSpeech_MOOD_UNKNOWN PartOfSpeech_Mood = 0 + // Conditional + PartOfSpeech_CONDITIONAL_MOOD PartOfSpeech_Mood = 1 + // Imperative + PartOfSpeech_IMPERATIVE PartOfSpeech_Mood = 2 + // Indicative + PartOfSpeech_INDICATIVE PartOfSpeech_Mood = 3 + // Interrogative + PartOfSpeech_INTERROGATIVE PartOfSpeech_Mood = 4 + // Jussive + PartOfSpeech_JUSSIVE PartOfSpeech_Mood = 5 + // Subjunctive + PartOfSpeech_SUBJUNCTIVE PartOfSpeech_Mood = 6 +) + +var PartOfSpeech_Mood_name = map[int32]string{ + 0: "MOOD_UNKNOWN", + 1: "CONDITIONAL_MOOD", + 2: "IMPERATIVE", + 3: "INDICATIVE", + 4: "INTERROGATIVE", + 5: "JUSSIVE", + 6: "SUBJUNCTIVE", +} +var PartOfSpeech_Mood_value = map[string]int32{ + "MOOD_UNKNOWN": 0, + "CONDITIONAL_MOOD": 1, + "IMPERATIVE": 2, + "INDICATIVE": 3, + "INTERROGATIVE": 4, + "JUSSIVE": 5, + "SUBJUNCTIVE": 6, +} + +func (x PartOfSpeech_Mood) String() string { + return proto.EnumName(PartOfSpeech_Mood_name, int32(x)) +} +func (PartOfSpeech_Mood) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 5} } + +// Count distinctions. +type PartOfSpeech_Number int32 + +const ( + // Number is not applicable in the analyzed language or is not predicted. + PartOfSpeech_NUMBER_UNKNOWN PartOfSpeech_Number = 0 + // Singular + PartOfSpeech_SINGULAR PartOfSpeech_Number = 1 + // Plural + PartOfSpeech_PLURAL PartOfSpeech_Number = 2 + // Dual + PartOfSpeech_DUAL PartOfSpeech_Number = 3 +) + +var PartOfSpeech_Number_name = map[int32]string{ + 0: "NUMBER_UNKNOWN", + 1: "SINGULAR", + 2: "PLURAL", + 3: "DUAL", +} +var PartOfSpeech_Number_value = map[string]int32{ + "NUMBER_UNKNOWN": 0, + "SINGULAR": 1, + "PLURAL": 2, + "DUAL": 3, +} + +func (x PartOfSpeech_Number) String() string { + return proto.EnumName(PartOfSpeech_Number_name, int32(x)) +} +func (PartOfSpeech_Number) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 6} } + +// The distinction between the speaker, second person, third person, etc. +type PartOfSpeech_Person int32 + +const ( + // Person is not applicable in the analyzed language or is not predicted. + PartOfSpeech_PERSON_UNKNOWN PartOfSpeech_Person = 0 + // First + PartOfSpeech_FIRST PartOfSpeech_Person = 1 + // Second + PartOfSpeech_SECOND PartOfSpeech_Person = 2 + // Third + PartOfSpeech_THIRD PartOfSpeech_Person = 3 + // Reflexive + PartOfSpeech_REFLEXIVE_PERSON PartOfSpeech_Person = 4 +) + +var PartOfSpeech_Person_name = map[int32]string{ + 0: "PERSON_UNKNOWN", + 1: "FIRST", + 2: "SECOND", + 3: "THIRD", + 4: "REFLEXIVE_PERSON", +} +var PartOfSpeech_Person_value = map[string]int32{ + "PERSON_UNKNOWN": 0, + "FIRST": 1, + "SECOND": 2, + "THIRD": 3, + "REFLEXIVE_PERSON": 4, +} + +func (x PartOfSpeech_Person) String() string { + return proto.EnumName(PartOfSpeech_Person_name, int32(x)) +} +func (PartOfSpeech_Person) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 7} } + +// This category shows if the token is part of a proper name. +type PartOfSpeech_Proper int32 + +const ( + // Proper is not applicable in the analyzed language or is not predicted. + PartOfSpeech_PROPER_UNKNOWN PartOfSpeech_Proper = 0 + // Proper + PartOfSpeech_PROPER PartOfSpeech_Proper = 1 + // Not proper + PartOfSpeech_NOT_PROPER PartOfSpeech_Proper = 2 +) + +var PartOfSpeech_Proper_name = map[int32]string{ + 0: "PROPER_UNKNOWN", + 1: "PROPER", + 2: "NOT_PROPER", +} +var PartOfSpeech_Proper_value = map[string]int32{ + "PROPER_UNKNOWN": 0, + "PROPER": 1, + "NOT_PROPER": 2, +} + +func (x PartOfSpeech_Proper) String() string { + return proto.EnumName(PartOfSpeech_Proper_name, int32(x)) +} +func (PartOfSpeech_Proper) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 8} } + +// Reciprocal features of a pronoun. +type PartOfSpeech_Reciprocity int32 + +const ( + // Reciprocity is not applicable in the analyzed language or is not + // predicted. + PartOfSpeech_RECIPROCITY_UNKNOWN PartOfSpeech_Reciprocity = 0 + // Reciprocal + PartOfSpeech_RECIPROCAL PartOfSpeech_Reciprocity = 1 + // Non-reciprocal + PartOfSpeech_NON_RECIPROCAL PartOfSpeech_Reciprocity = 2 +) + +var PartOfSpeech_Reciprocity_name = map[int32]string{ + 0: "RECIPROCITY_UNKNOWN", + 1: "RECIPROCAL", + 2: "NON_RECIPROCAL", +} +var PartOfSpeech_Reciprocity_value = map[string]int32{ + "RECIPROCITY_UNKNOWN": 0, + "RECIPROCAL": 1, + "NON_RECIPROCAL": 2, +} + +func (x PartOfSpeech_Reciprocity) String() string { + return proto.EnumName(PartOfSpeech_Reciprocity_name, int32(x)) +} +func (PartOfSpeech_Reciprocity) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 9} } + +// Time reference. +type PartOfSpeech_Tense int32 + +const ( + // Tense is not applicable in the analyzed language or is not predicted. + PartOfSpeech_TENSE_UNKNOWN PartOfSpeech_Tense = 0 + // Conditional + PartOfSpeech_CONDITIONAL_TENSE PartOfSpeech_Tense = 1 + // Future + PartOfSpeech_FUTURE PartOfSpeech_Tense = 2 + // Past + PartOfSpeech_PAST PartOfSpeech_Tense = 3 + // Present + PartOfSpeech_PRESENT PartOfSpeech_Tense = 4 + // Imperfect + PartOfSpeech_IMPERFECT PartOfSpeech_Tense = 5 + // Pluperfect + PartOfSpeech_PLUPERFECT PartOfSpeech_Tense = 6 +) + +var PartOfSpeech_Tense_name = map[int32]string{ + 0: "TENSE_UNKNOWN", + 1: "CONDITIONAL_TENSE", + 2: "FUTURE", + 3: "PAST", + 4: "PRESENT", + 5: "IMPERFECT", + 6: "PLUPERFECT", +} +var PartOfSpeech_Tense_value = map[string]int32{ + "TENSE_UNKNOWN": 0, + "CONDITIONAL_TENSE": 1, + "FUTURE": 2, + "PAST": 3, + "PRESENT": 4, + "IMPERFECT": 5, + "PLUPERFECT": 6, +} + +func (x PartOfSpeech_Tense) String() string { + return proto.EnumName(PartOfSpeech_Tense_name, int32(x)) +} +func (PartOfSpeech_Tense) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 10} } + +// The relationship between the action that a verb expresses and the +// participants identified by its arguments. +type PartOfSpeech_Voice int32 + +const ( + // Voice is not applicable in the analyzed language or is not predicted. + PartOfSpeech_VOICE_UNKNOWN PartOfSpeech_Voice = 0 + // Active + PartOfSpeech_ACTIVE PartOfSpeech_Voice = 1 + // Causative + PartOfSpeech_CAUSATIVE PartOfSpeech_Voice = 2 + // Passive + PartOfSpeech_PASSIVE PartOfSpeech_Voice = 3 +) + +var PartOfSpeech_Voice_name = map[int32]string{ + 0: "VOICE_UNKNOWN", + 1: "ACTIVE", + 2: "CAUSATIVE", + 3: "PASSIVE", +} +var PartOfSpeech_Voice_value = map[string]int32{ + "VOICE_UNKNOWN": 0, + "ACTIVE": 1, + "CAUSATIVE": 2, + "PASSIVE": 3, +} + +func (x PartOfSpeech_Voice) String() string { + return proto.EnumName(PartOfSpeech_Voice_name, int32(x)) +} +func (PartOfSpeech_Voice) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 11} } + +// The parse label enum for the token. +type DependencyEdge_Label int32 + +const ( + // Unknown + DependencyEdge_UNKNOWN DependencyEdge_Label = 0 + // Abbreviation modifier + DependencyEdge_ABBREV DependencyEdge_Label = 1 + // Adjectival complement + DependencyEdge_ACOMP DependencyEdge_Label = 2 + // Adverbial clause modifier + DependencyEdge_ADVCL DependencyEdge_Label = 3 + // Adverbial modifier + DependencyEdge_ADVMOD DependencyEdge_Label = 4 + // Adjectival modifier of an NP + DependencyEdge_AMOD DependencyEdge_Label = 5 + // Appositional modifier of an NP + DependencyEdge_APPOS DependencyEdge_Label = 6 + // Attribute dependent of a copular verb + DependencyEdge_ATTR DependencyEdge_Label = 7 + // Auxiliary (non-main) verb + DependencyEdge_AUX DependencyEdge_Label = 8 + // Passive auxiliary + DependencyEdge_AUXPASS DependencyEdge_Label = 9 + // Coordinating conjunction + DependencyEdge_CC DependencyEdge_Label = 10 + // Clausal complement of a verb or adjective + DependencyEdge_CCOMP DependencyEdge_Label = 11 + // Conjunct + DependencyEdge_CONJ DependencyEdge_Label = 12 + // Clausal subject + DependencyEdge_CSUBJ DependencyEdge_Label = 13 + // Clausal passive subject + DependencyEdge_CSUBJPASS DependencyEdge_Label = 14 + // Dependency (unable to determine) + DependencyEdge_DEP DependencyEdge_Label = 15 + // Determiner + DependencyEdge_DET DependencyEdge_Label = 16 + // Discourse + DependencyEdge_DISCOURSE DependencyEdge_Label = 17 + // Direct object + DependencyEdge_DOBJ DependencyEdge_Label = 18 + // Expletive + DependencyEdge_EXPL DependencyEdge_Label = 19 + // Goes with (part of a word in a text not well edited) + DependencyEdge_GOESWITH DependencyEdge_Label = 20 + // Indirect object + DependencyEdge_IOBJ DependencyEdge_Label = 21 + // Marker (word introducing a subordinate clause) + DependencyEdge_MARK DependencyEdge_Label = 22 + // Multi-word expression + DependencyEdge_MWE DependencyEdge_Label = 23 + // Multi-word verbal expression + DependencyEdge_MWV DependencyEdge_Label = 24 + // Negation modifier + DependencyEdge_NEG DependencyEdge_Label = 25 + // Noun compound modifier + DependencyEdge_NN DependencyEdge_Label = 26 + // Noun phrase used as an adverbial modifier + DependencyEdge_NPADVMOD DependencyEdge_Label = 27 + // Nominal subject + DependencyEdge_NSUBJ DependencyEdge_Label = 28 + // Passive nominal subject + DependencyEdge_NSUBJPASS DependencyEdge_Label = 29 + // Numeric modifier of a noun + DependencyEdge_NUM DependencyEdge_Label = 30 + // Element of compound number + DependencyEdge_NUMBER DependencyEdge_Label = 31 + // Punctuation mark + DependencyEdge_P DependencyEdge_Label = 32 + // Parataxis relation + DependencyEdge_PARATAXIS DependencyEdge_Label = 33 + // Participial modifier + DependencyEdge_PARTMOD DependencyEdge_Label = 34 + // The complement of a preposition is a clause + DependencyEdge_PCOMP DependencyEdge_Label = 35 + // Object of a preposition + DependencyEdge_POBJ DependencyEdge_Label = 36 + // Possession modifier + DependencyEdge_POSS DependencyEdge_Label = 37 + // Postverbal negative particle + DependencyEdge_POSTNEG DependencyEdge_Label = 38 + // Predicate complement + DependencyEdge_PRECOMP DependencyEdge_Label = 39 + // Preconjunt + DependencyEdge_PRECONJ DependencyEdge_Label = 40 + // Predeterminer + DependencyEdge_PREDET DependencyEdge_Label = 41 + // Prefix + DependencyEdge_PREF DependencyEdge_Label = 42 + // Prepositional modifier + DependencyEdge_PREP DependencyEdge_Label = 43 + // The relationship between a verb and verbal morpheme + DependencyEdge_PRONL DependencyEdge_Label = 44 + // Particle + DependencyEdge_PRT DependencyEdge_Label = 45 + // Associative or possessive marker + DependencyEdge_PS DependencyEdge_Label = 46 + // Quantifier phrase modifier + DependencyEdge_QUANTMOD DependencyEdge_Label = 47 + // Relative clause modifier + DependencyEdge_RCMOD DependencyEdge_Label = 48 + // Complementizer in relative clause + DependencyEdge_RCMODREL DependencyEdge_Label = 49 + // Ellipsis without a preceding predicate + DependencyEdge_RDROP DependencyEdge_Label = 50 + // Referent + DependencyEdge_REF DependencyEdge_Label = 51 + // Remnant + DependencyEdge_REMNANT DependencyEdge_Label = 52 + // Reparandum + DependencyEdge_REPARANDUM DependencyEdge_Label = 53 + // Root + DependencyEdge_ROOT DependencyEdge_Label = 54 + // Suffix specifying a unit of number + DependencyEdge_SNUM DependencyEdge_Label = 55 + // Suffix + DependencyEdge_SUFF DependencyEdge_Label = 56 + // Temporal modifier + DependencyEdge_TMOD DependencyEdge_Label = 57 + // Topic marker + DependencyEdge_TOPIC DependencyEdge_Label = 58 + // Clause headed by an infinite form of the verb that modifies a noun + DependencyEdge_VMOD DependencyEdge_Label = 59 + // Vocative + DependencyEdge_VOCATIVE DependencyEdge_Label = 60 + // Open clausal complement + DependencyEdge_XCOMP DependencyEdge_Label = 61 + // Name suffix + DependencyEdge_SUFFIX DependencyEdge_Label = 62 + // Name title + DependencyEdge_TITLE DependencyEdge_Label = 63 + // Adverbial phrase modifier + DependencyEdge_ADVPHMOD DependencyEdge_Label = 64 + // Causative auxiliary + DependencyEdge_AUXCAUS DependencyEdge_Label = 65 + // Helper auxiliary + DependencyEdge_AUXVV DependencyEdge_Label = 66 + // Rentaishi (Prenominal modifier) + DependencyEdge_DTMOD DependencyEdge_Label = 67 + // Foreign words + DependencyEdge_FOREIGN DependencyEdge_Label = 68 + // Keyword + DependencyEdge_KW DependencyEdge_Label = 69 + // List for chains of comparable items + DependencyEdge_LIST DependencyEdge_Label = 70 + // Nominalized clause + DependencyEdge_NOMC DependencyEdge_Label = 71 + // Nominalized clausal subject + DependencyEdge_NOMCSUBJ DependencyEdge_Label = 72 + // Nominalized clausal passive + DependencyEdge_NOMCSUBJPASS DependencyEdge_Label = 73 + // Compound of numeric modifier + DependencyEdge_NUMC DependencyEdge_Label = 74 + // Copula + DependencyEdge_COP DependencyEdge_Label = 75 + // Dislocated relation (for fronted/topicalized elements) + DependencyEdge_DISLOCATED DependencyEdge_Label = 76 + // Aspect marker + DependencyEdge_ASP DependencyEdge_Label = 77 + // Genitive modifier + DependencyEdge_GMOD DependencyEdge_Label = 78 + // Genitive object + DependencyEdge_GOBJ DependencyEdge_Label = 79 + // Infinitival modifier + DependencyEdge_INFMOD DependencyEdge_Label = 80 + // Measure + DependencyEdge_MES DependencyEdge_Label = 81 + // Nominal complement of a noun + DependencyEdge_NCOMP DependencyEdge_Label = 82 +) + +var DependencyEdge_Label_name = map[int32]string{ + 0: "UNKNOWN", + 1: "ABBREV", + 2: "ACOMP", + 3: "ADVCL", + 4: "ADVMOD", + 5: "AMOD", + 6: "APPOS", + 7: "ATTR", + 8: "AUX", + 9: "AUXPASS", + 10: "CC", + 11: "CCOMP", + 12: "CONJ", + 13: "CSUBJ", + 14: "CSUBJPASS", + 15: "DEP", + 16: "DET", + 17: "DISCOURSE", + 18: "DOBJ", + 19: "EXPL", + 20: "GOESWITH", + 21: "IOBJ", + 22: "MARK", + 23: "MWE", + 24: "MWV", + 25: "NEG", + 26: "NN", + 27: "NPADVMOD", + 28: "NSUBJ", + 29: "NSUBJPASS", + 30: "NUM", + 31: "NUMBER", + 32: "P", + 33: "PARATAXIS", + 34: "PARTMOD", + 35: "PCOMP", + 36: "POBJ", + 37: "POSS", + 38: "POSTNEG", + 39: "PRECOMP", + 40: "PRECONJ", + 41: "PREDET", + 42: "PREF", + 43: "PREP", + 44: "PRONL", + 45: "PRT", + 46: "PS", + 47: "QUANTMOD", + 48: "RCMOD", + 49: "RCMODREL", + 50: "RDROP", + 51: "REF", + 52: "REMNANT", + 53: "REPARANDUM", + 54: "ROOT", + 55: "SNUM", + 56: "SUFF", + 57: "TMOD", + 58: "TOPIC", + 59: "VMOD", + 60: "VOCATIVE", + 61: "XCOMP", + 62: "SUFFIX", + 63: "TITLE", + 64: "ADVPHMOD", + 65: "AUXCAUS", + 66: "AUXVV", + 67: "DTMOD", + 68: "FOREIGN", + 69: "KW", + 70: "LIST", + 71: "NOMC", + 72: "NOMCSUBJ", + 73: "NOMCSUBJPASS", + 74: "NUMC", + 75: "COP", + 76: "DISLOCATED", + 77: "ASP", + 78: "GMOD", + 79: "GOBJ", + 80: "INFMOD", + 81: "MES", + 82: "NCOMP", +} +var DependencyEdge_Label_value = map[string]int32{ + "UNKNOWN": 0, + "ABBREV": 1, + "ACOMP": 2, + "ADVCL": 3, + "ADVMOD": 4, + "AMOD": 5, + "APPOS": 6, + "ATTR": 7, + "AUX": 8, + "AUXPASS": 9, + "CC": 10, + "CCOMP": 11, + "CONJ": 12, + "CSUBJ": 13, + "CSUBJPASS": 14, + "DEP": 15, + "DET": 16, + "DISCOURSE": 17, + "DOBJ": 18, + "EXPL": 19, + "GOESWITH": 20, + "IOBJ": 21, + "MARK": 22, + "MWE": 23, + "MWV": 24, + "NEG": 25, + "NN": 26, + "NPADVMOD": 27, + "NSUBJ": 28, + "NSUBJPASS": 29, + "NUM": 30, + "NUMBER": 31, + "P": 32, + "PARATAXIS": 33, + "PARTMOD": 34, + "PCOMP": 35, + "POBJ": 36, + "POSS": 37, + "POSTNEG": 38, + "PRECOMP": 39, + "PRECONJ": 40, + "PREDET": 41, + "PREF": 42, + "PREP": 43, + "PRONL": 44, + "PRT": 45, + "PS": 46, + "QUANTMOD": 47, + "RCMOD": 48, + "RCMODREL": 49, + "RDROP": 50, + "REF": 51, + "REMNANT": 52, + "REPARANDUM": 53, + "ROOT": 54, + "SNUM": 55, + "SUFF": 56, + "TMOD": 57, + "TOPIC": 58, + "VMOD": 59, + "VOCATIVE": 60, + "XCOMP": 61, + "SUFFIX": 62, + "TITLE": 63, + "ADVPHMOD": 64, + "AUXCAUS": 65, + "AUXVV": 66, + "DTMOD": 67, + "FOREIGN": 68, + "KW": 69, + "LIST": 70, + "NOMC": 71, + "NOMCSUBJ": 72, + "NOMCSUBJPASS": 73, + "NUMC": 74, + "COP": 75, + "DISLOCATED": 76, + "ASP": 77, + "GMOD": 78, + "GOBJ": 79, + "INFMOD": 80, + "MES": 81, + "NCOMP": 82, +} + +func (x DependencyEdge_Label) String() string { + return proto.EnumName(DependencyEdge_Label_name, int32(x)) +} +func (DependencyEdge_Label) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{6, 0} } + +// The supported types of mentions. +type EntityMention_Type int32 + +const ( + // Unknown + EntityMention_TYPE_UNKNOWN EntityMention_Type = 0 + // Proper name + EntityMention_PROPER EntityMention_Type = 1 + // Common noun (or noun compound) + EntityMention_COMMON EntityMention_Type = 2 +) + +var EntityMention_Type_name = map[int32]string{ + 0: "TYPE_UNKNOWN", + 1: "PROPER", + 2: "COMMON", +} +var EntityMention_Type_value = map[string]int32{ + "TYPE_UNKNOWN": 0, + "PROPER": 1, + "COMMON": 2, +} + +func (x EntityMention_Type) String() string { + return proto.EnumName(EntityMention_Type_name, int32(x)) +} +func (EntityMention_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{7, 0} } + +// ################################################################ # +// +// Represents the input to API methods. +type Document struct { + // Required. If the type is not set or is `TYPE_UNSPECIFIED`, + // returns an `INVALID_ARGUMENT` error. + Type Document_Type `protobuf:"varint,1,opt,name=type,enum=google.cloud.language.v1beta2.Document_Type" json:"type,omitempty"` + // The source of the document: a string containing the content or a + // Google Cloud Storage URI. + // + // Types that are valid to be assigned to Source: + // *Document_Content + // *Document_GcsContentUri + Source isDocument_Source `protobuf_oneof:"source"` + // The language of the document (if not specified, the language is + // automatically detected). Both ISO and BCP-47 language codes are + // accepted.
+ // [Language Support](/natural-language/docs/languages) + // lists currently supported languages for each API method. + // If the language (either specified by the caller or automatically detected) + // is not supported by the called API method, an `INVALID_ARGUMENT` error + // is returned. + Language string `protobuf:"bytes,4,opt,name=language" json:"language,omitempty"` +} + +func (m *Document) Reset() { *m = Document{} } +func (m *Document) String() string { return proto.CompactTextString(m) } +func (*Document) ProtoMessage() {} +func (*Document) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +type isDocument_Source interface { + isDocument_Source() +} + +type Document_Content struct { + Content string `protobuf:"bytes,2,opt,name=content,oneof"` +} +type Document_GcsContentUri struct { + GcsContentUri string `protobuf:"bytes,3,opt,name=gcs_content_uri,json=gcsContentUri,oneof"` +} + +func (*Document_Content) isDocument_Source() {} +func (*Document_GcsContentUri) isDocument_Source() {} + +func (m *Document) GetSource() isDocument_Source { + if m != nil { + return m.Source + } + return nil +} + +func (m *Document) GetType() Document_Type { + if m != nil { + return m.Type + } + return Document_TYPE_UNSPECIFIED +} + +func (m *Document) GetContent() string { + if x, ok := m.GetSource().(*Document_Content); ok { + return x.Content + } + return "" +} + +func (m *Document) GetGcsContentUri() string { + if x, ok := m.GetSource().(*Document_GcsContentUri); ok { + return x.GcsContentUri + } + return "" +} + +func (m *Document) GetLanguage() string { + if m != nil { + return m.Language + } + return "" +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Document) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _Document_OneofMarshaler, _Document_OneofUnmarshaler, _Document_OneofSizer, []interface{}{ + (*Document_Content)(nil), + (*Document_GcsContentUri)(nil), + } +} + +func _Document_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Document) + // source + switch x := m.Source.(type) { + case *Document_Content: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeStringBytes(x.Content) + case *Document_GcsContentUri: + b.EncodeVarint(3<<3 | proto.WireBytes) + b.EncodeStringBytes(x.GcsContentUri) + case nil: + default: + return fmt.Errorf("Document.Source has unexpected type %T", x) + } + return nil +} + +func _Document_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Document) + switch tag { + case 2: // source.content + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Source = &Document_Content{x} + return true, err + case 3: // source.gcs_content_uri + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Source = &Document_GcsContentUri{x} + return true, err + default: + return false, nil + } +} + +func _Document_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Document) + // source + switch x := m.Source.(type) { + case *Document_Content: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Content))) + n += len(x.Content) + case *Document_GcsContentUri: + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.GcsContentUri))) + n += len(x.GcsContentUri) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Represents a sentence in the input document. +type Sentence struct { + // The sentence text. + Text *TextSpan `protobuf:"bytes,1,opt,name=text" json:"text,omitempty"` + // For calls to [AnalyzeSentiment][] or if + // [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_document_sentiment] is set to + // true, this field will contain the sentiment for the sentence. + Sentiment *Sentiment `protobuf:"bytes,2,opt,name=sentiment" json:"sentiment,omitempty"` +} + +func (m *Sentence) Reset() { *m = Sentence{} } +func (m *Sentence) String() string { return proto.CompactTextString(m) } +func (*Sentence) ProtoMessage() {} +func (*Sentence) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *Sentence) GetText() *TextSpan { + if m != nil { + return m.Text + } + return nil +} + +func (m *Sentence) GetSentiment() *Sentiment { + if m != nil { + return m.Sentiment + } + return nil +} + +// Represents a phrase in the text that is a known entity, such as +// a person, an organization, or location. The API associates information, such +// as salience and mentions, with entities. +type Entity struct { + // The representative name for the entity. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The entity type. + Type Entity_Type `protobuf:"varint,2,opt,name=type,enum=google.cloud.language.v1beta2.Entity_Type" json:"type,omitempty"` + // Metadata associated with the entity. + // + // Currently, Wikipedia URLs and Knowledge Graph MIDs are provided, if + // available. The associated keys are "wikipedia_url" and "mid", respectively. + Metadata map[string]string `protobuf:"bytes,3,rep,name=metadata" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // The salience score associated with the entity in the [0, 1.0] range. + // + // The salience score for an entity provides information about the + // importance or centrality of that entity to the entire document text. + // Scores closer to 0 are less salient, while scores closer to 1.0 are highly + // salient. + Salience float32 `protobuf:"fixed32,4,opt,name=salience" json:"salience,omitempty"` + // The mentions of this entity in the input document. The API currently + // supports proper noun mentions. + Mentions []*EntityMention `protobuf:"bytes,5,rep,name=mentions" json:"mentions,omitempty"` + // For calls to [AnalyzeEntitySentiment][] or if + // [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_entity_sentiment] is set to + // true, this field will contain the aggregate sentiment expressed for this + // entity in the provided document. + Sentiment *Sentiment `protobuf:"bytes,6,opt,name=sentiment" json:"sentiment,omitempty"` +} + +func (m *Entity) Reset() { *m = Entity{} } +func (m *Entity) String() string { return proto.CompactTextString(m) } +func (*Entity) ProtoMessage() {} +func (*Entity) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *Entity) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Entity) GetType() Entity_Type { + if m != nil { + return m.Type + } + return Entity_UNKNOWN +} + +func (m *Entity) GetMetadata() map[string]string { + if m != nil { + return m.Metadata + } + return nil +} + +func (m *Entity) GetSalience() float32 { + if m != nil { + return m.Salience + } + return 0 +} + +func (m *Entity) GetMentions() []*EntityMention { + if m != nil { + return m.Mentions + } + return nil +} + +func (m *Entity) GetSentiment() *Sentiment { + if m != nil { + return m.Sentiment + } + return nil +} + +// Represents the smallest syntactic building block of the text. +type Token struct { + // The token text. + Text *TextSpan `protobuf:"bytes,1,opt,name=text" json:"text,omitempty"` + // Parts of speech tag for this token. + PartOfSpeech *PartOfSpeech `protobuf:"bytes,2,opt,name=part_of_speech,json=partOfSpeech" json:"part_of_speech,omitempty"` + // Dependency tree parse for this token. + DependencyEdge *DependencyEdge `protobuf:"bytes,3,opt,name=dependency_edge,json=dependencyEdge" json:"dependency_edge,omitempty"` + // [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token. + Lemma string `protobuf:"bytes,4,opt,name=lemma" json:"lemma,omitempty"` +} + +func (m *Token) Reset() { *m = Token{} } +func (m *Token) String() string { return proto.CompactTextString(m) } +func (*Token) ProtoMessage() {} +func (*Token) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *Token) GetText() *TextSpan { + if m != nil { + return m.Text + } + return nil +} + +func (m *Token) GetPartOfSpeech() *PartOfSpeech { + if m != nil { + return m.PartOfSpeech + } + return nil +} + +func (m *Token) GetDependencyEdge() *DependencyEdge { + if m != nil { + return m.DependencyEdge + } + return nil +} + +func (m *Token) GetLemma() string { + if m != nil { + return m.Lemma + } + return "" +} + +// Represents the feeling associated with the entire text or entities in +// the text. +type Sentiment struct { + // A non-negative number in the [0, +inf) range, which represents + // the absolute magnitude of sentiment regardless of score (positive or + // negative). + Magnitude float32 `protobuf:"fixed32,2,opt,name=magnitude" json:"magnitude,omitempty"` + // Sentiment score between -1.0 (negative sentiment) and 1.0 + // (positive sentiment). + Score float32 `protobuf:"fixed32,3,opt,name=score" json:"score,omitempty"` +} + +func (m *Sentiment) Reset() { *m = Sentiment{} } +func (m *Sentiment) String() string { return proto.CompactTextString(m) } +func (*Sentiment) ProtoMessage() {} +func (*Sentiment) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *Sentiment) GetMagnitude() float32 { + if m != nil { + return m.Magnitude + } + return 0 +} + +func (m *Sentiment) GetScore() float32 { + if m != nil { + return m.Score + } + return 0 +} + +// Represents part of speech information for a token. +type PartOfSpeech struct { + // The part of speech tag. + Tag PartOfSpeech_Tag `protobuf:"varint,1,opt,name=tag,enum=google.cloud.language.v1beta2.PartOfSpeech_Tag" json:"tag,omitempty"` + // The grammatical aspect. + Aspect PartOfSpeech_Aspect `protobuf:"varint,2,opt,name=aspect,enum=google.cloud.language.v1beta2.PartOfSpeech_Aspect" json:"aspect,omitempty"` + // The grammatical case. + Case PartOfSpeech_Case `protobuf:"varint,3,opt,name=case,enum=google.cloud.language.v1beta2.PartOfSpeech_Case" json:"case,omitempty"` + // The grammatical form. + Form PartOfSpeech_Form `protobuf:"varint,4,opt,name=form,enum=google.cloud.language.v1beta2.PartOfSpeech_Form" json:"form,omitempty"` + // The grammatical gender. + Gender PartOfSpeech_Gender `protobuf:"varint,5,opt,name=gender,enum=google.cloud.language.v1beta2.PartOfSpeech_Gender" json:"gender,omitempty"` + // The grammatical mood. + Mood PartOfSpeech_Mood `protobuf:"varint,6,opt,name=mood,enum=google.cloud.language.v1beta2.PartOfSpeech_Mood" json:"mood,omitempty"` + // The grammatical number. + Number PartOfSpeech_Number `protobuf:"varint,7,opt,name=number,enum=google.cloud.language.v1beta2.PartOfSpeech_Number" json:"number,omitempty"` + // The grammatical person. + Person PartOfSpeech_Person `protobuf:"varint,8,opt,name=person,enum=google.cloud.language.v1beta2.PartOfSpeech_Person" json:"person,omitempty"` + // The grammatical properness. + Proper PartOfSpeech_Proper `protobuf:"varint,9,opt,name=proper,enum=google.cloud.language.v1beta2.PartOfSpeech_Proper" json:"proper,omitempty"` + // The grammatical reciprocity. + Reciprocity PartOfSpeech_Reciprocity `protobuf:"varint,10,opt,name=reciprocity,enum=google.cloud.language.v1beta2.PartOfSpeech_Reciprocity" json:"reciprocity,omitempty"` + // The grammatical tense. + Tense PartOfSpeech_Tense `protobuf:"varint,11,opt,name=tense,enum=google.cloud.language.v1beta2.PartOfSpeech_Tense" json:"tense,omitempty"` + // The grammatical voice. + Voice PartOfSpeech_Voice `protobuf:"varint,12,opt,name=voice,enum=google.cloud.language.v1beta2.PartOfSpeech_Voice" json:"voice,omitempty"` +} + +func (m *PartOfSpeech) Reset() { *m = PartOfSpeech{} } +func (m *PartOfSpeech) String() string { return proto.CompactTextString(m) } +func (*PartOfSpeech) ProtoMessage() {} +func (*PartOfSpeech) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *PartOfSpeech) GetTag() PartOfSpeech_Tag { + if m != nil { + return m.Tag + } + return PartOfSpeech_UNKNOWN +} + +func (m *PartOfSpeech) GetAspect() PartOfSpeech_Aspect { + if m != nil { + return m.Aspect + } + return PartOfSpeech_ASPECT_UNKNOWN +} + +func (m *PartOfSpeech) GetCase() PartOfSpeech_Case { + if m != nil { + return m.Case + } + return PartOfSpeech_CASE_UNKNOWN +} + +func (m *PartOfSpeech) GetForm() PartOfSpeech_Form { + if m != nil { + return m.Form + } + return PartOfSpeech_FORM_UNKNOWN +} + +func (m *PartOfSpeech) GetGender() PartOfSpeech_Gender { + if m != nil { + return m.Gender + } + return PartOfSpeech_GENDER_UNKNOWN +} + +func (m *PartOfSpeech) GetMood() PartOfSpeech_Mood { + if m != nil { + return m.Mood + } + return PartOfSpeech_MOOD_UNKNOWN +} + +func (m *PartOfSpeech) GetNumber() PartOfSpeech_Number { + if m != nil { + return m.Number + } + return PartOfSpeech_NUMBER_UNKNOWN +} + +func (m *PartOfSpeech) GetPerson() PartOfSpeech_Person { + if m != nil { + return m.Person + } + return PartOfSpeech_PERSON_UNKNOWN +} + +func (m *PartOfSpeech) GetProper() PartOfSpeech_Proper { + if m != nil { + return m.Proper + } + return PartOfSpeech_PROPER_UNKNOWN +} + +func (m *PartOfSpeech) GetReciprocity() PartOfSpeech_Reciprocity { + if m != nil { + return m.Reciprocity + } + return PartOfSpeech_RECIPROCITY_UNKNOWN +} + +func (m *PartOfSpeech) GetTense() PartOfSpeech_Tense { + if m != nil { + return m.Tense + } + return PartOfSpeech_TENSE_UNKNOWN +} + +func (m *PartOfSpeech) GetVoice() PartOfSpeech_Voice { + if m != nil { + return m.Voice + } + return PartOfSpeech_VOICE_UNKNOWN +} + +// Represents dependency parse tree information for a token. +type DependencyEdge struct { + // Represents the head of this token in the dependency tree. + // This is the index of the token which has an arc going to this token. + // The index is the position of the token in the array of tokens returned + // by the API method. If this token is a root token, then the + // `head_token_index` is its own index. + HeadTokenIndex int32 `protobuf:"varint,1,opt,name=head_token_index,json=headTokenIndex" json:"head_token_index,omitempty"` + // The parse label for the token. + Label DependencyEdge_Label `protobuf:"varint,2,opt,name=label,enum=google.cloud.language.v1beta2.DependencyEdge_Label" json:"label,omitempty"` +} + +func (m *DependencyEdge) Reset() { *m = DependencyEdge{} } +func (m *DependencyEdge) String() string { return proto.CompactTextString(m) } +func (*DependencyEdge) ProtoMessage() {} +func (*DependencyEdge) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *DependencyEdge) GetHeadTokenIndex() int32 { + if m != nil { + return m.HeadTokenIndex + } + return 0 +} + +func (m *DependencyEdge) GetLabel() DependencyEdge_Label { + if m != nil { + return m.Label + } + return DependencyEdge_UNKNOWN +} + +// Represents a mention for an entity in the text. Currently, proper noun +// mentions are supported. +type EntityMention struct { + // The mention text. + Text *TextSpan `protobuf:"bytes,1,opt,name=text" json:"text,omitempty"` + // The type of the entity mention. + Type EntityMention_Type `protobuf:"varint,2,opt,name=type,enum=google.cloud.language.v1beta2.EntityMention_Type" json:"type,omitempty"` + // For calls to [AnalyzeEntitySentiment][] or if + // [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_entity_sentiment] is set to + // true, this field will contain the sentiment expressed for this mention of + // the entity in the provided document. + Sentiment *Sentiment `protobuf:"bytes,3,opt,name=sentiment" json:"sentiment,omitempty"` +} + +func (m *EntityMention) Reset() { *m = EntityMention{} } +func (m *EntityMention) String() string { return proto.CompactTextString(m) } +func (*EntityMention) ProtoMessage() {} +func (*EntityMention) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *EntityMention) GetText() *TextSpan { + if m != nil { + return m.Text + } + return nil +} + +func (m *EntityMention) GetType() EntityMention_Type { + if m != nil { + return m.Type + } + return EntityMention_TYPE_UNKNOWN +} + +func (m *EntityMention) GetSentiment() *Sentiment { + if m != nil { + return m.Sentiment + } + return nil +} + +// Represents an output piece of text. +type TextSpan struct { + // The content of the output text. + Content string `protobuf:"bytes,1,opt,name=content" json:"content,omitempty"` + // The API calculates the beginning offset of the content in the original + // document according to the [EncodingType][google.cloud.language.v1beta2.EncodingType] specified in the API request. + BeginOffset int32 `protobuf:"varint,2,opt,name=begin_offset,json=beginOffset" json:"begin_offset,omitempty"` +} + +func (m *TextSpan) Reset() { *m = TextSpan{} } +func (m *TextSpan) String() string { return proto.CompactTextString(m) } +func (*TextSpan) ProtoMessage() {} +func (*TextSpan) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *TextSpan) GetContent() string { + if m != nil { + return m.Content + } + return "" +} + +func (m *TextSpan) GetBeginOffset() int32 { + if m != nil { + return m.BeginOffset + } + return 0 +} + +// Represents a category returned from the text classifier. +type ClassificationCategory struct { + // The name of the category representing the document. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The classifier's confidence of the category. Number represents how certain + // the classifier is that this category represents the given text. + Confidence float32 `protobuf:"fixed32,2,opt,name=confidence" json:"confidence,omitempty"` +} + +func (m *ClassificationCategory) Reset() { *m = ClassificationCategory{} } +func (m *ClassificationCategory) String() string { return proto.CompactTextString(m) } +func (*ClassificationCategory) ProtoMessage() {} +func (*ClassificationCategory) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *ClassificationCategory) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ClassificationCategory) GetConfidence() float32 { + if m != nil { + return m.Confidence + } + return 0 +} + +// The sentiment analysis request message. +type AnalyzeSentimentRequest struct { + // Input document. + Document *Document `protobuf:"bytes,1,opt,name=document" json:"document,omitempty"` + // The encoding type used by the API to calculate sentence offsets for the + // sentence sentiment. + EncodingType EncodingType `protobuf:"varint,2,opt,name=encoding_type,json=encodingType,enum=google.cloud.language.v1beta2.EncodingType" json:"encoding_type,omitempty"` +} + +func (m *AnalyzeSentimentRequest) Reset() { *m = AnalyzeSentimentRequest{} } +func (m *AnalyzeSentimentRequest) String() string { return proto.CompactTextString(m) } +func (*AnalyzeSentimentRequest) ProtoMessage() {} +func (*AnalyzeSentimentRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *AnalyzeSentimentRequest) GetDocument() *Document { + if m != nil { + return m.Document + } + return nil +} + +func (m *AnalyzeSentimentRequest) GetEncodingType() EncodingType { + if m != nil { + return m.EncodingType + } + return EncodingType_NONE +} + +// The sentiment analysis response message. +type AnalyzeSentimentResponse struct { + // The overall sentiment of the input document. + DocumentSentiment *Sentiment `protobuf:"bytes,1,opt,name=document_sentiment,json=documentSentiment" json:"document_sentiment,omitempty"` + // The language of the text, which will be the same as the language specified + // in the request or, if not specified, the automatically-detected language. + // See [Document.language][google.cloud.language.v1beta2.Document.language] field for more details. + Language string `protobuf:"bytes,2,opt,name=language" json:"language,omitempty"` + // The sentiment for all the sentences in the document. + Sentences []*Sentence `protobuf:"bytes,3,rep,name=sentences" json:"sentences,omitempty"` +} + +func (m *AnalyzeSentimentResponse) Reset() { *m = AnalyzeSentimentResponse{} } +func (m *AnalyzeSentimentResponse) String() string { return proto.CompactTextString(m) } +func (*AnalyzeSentimentResponse) ProtoMessage() {} +func (*AnalyzeSentimentResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } + +func (m *AnalyzeSentimentResponse) GetDocumentSentiment() *Sentiment { + if m != nil { + return m.DocumentSentiment + } + return nil +} + +func (m *AnalyzeSentimentResponse) GetLanguage() string { + if m != nil { + return m.Language + } + return "" +} + +func (m *AnalyzeSentimentResponse) GetSentences() []*Sentence { + if m != nil { + return m.Sentences + } + return nil +} + +// The entity-level sentiment analysis request message. +type AnalyzeEntitySentimentRequest struct { + // Input document. + Document *Document `protobuf:"bytes,1,opt,name=document" json:"document,omitempty"` + // The encoding type used by the API to calculate offsets. + EncodingType EncodingType `protobuf:"varint,2,opt,name=encoding_type,json=encodingType,enum=google.cloud.language.v1beta2.EncodingType" json:"encoding_type,omitempty"` +} + +func (m *AnalyzeEntitySentimentRequest) Reset() { *m = AnalyzeEntitySentimentRequest{} } +func (m *AnalyzeEntitySentimentRequest) String() string { return proto.CompactTextString(m) } +func (*AnalyzeEntitySentimentRequest) ProtoMessage() {} +func (*AnalyzeEntitySentimentRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } + +func (m *AnalyzeEntitySentimentRequest) GetDocument() *Document { + if m != nil { + return m.Document + } + return nil +} + +func (m *AnalyzeEntitySentimentRequest) GetEncodingType() EncodingType { + if m != nil { + return m.EncodingType + } + return EncodingType_NONE +} + +// The entity-level sentiment analysis response message. +type AnalyzeEntitySentimentResponse struct { + // The recognized entities in the input document with associated sentiments. + Entities []*Entity `protobuf:"bytes,1,rep,name=entities" json:"entities,omitempty"` + // The language of the text, which will be the same as the language specified + // in the request or, if not specified, the automatically-detected language. + // See [Document.language][google.cloud.language.v1beta2.Document.language] field for more details. + Language string `protobuf:"bytes,2,opt,name=language" json:"language,omitempty"` +} + +func (m *AnalyzeEntitySentimentResponse) Reset() { *m = AnalyzeEntitySentimentResponse{} } +func (m *AnalyzeEntitySentimentResponse) String() string { return proto.CompactTextString(m) } +func (*AnalyzeEntitySentimentResponse) ProtoMessage() {} +func (*AnalyzeEntitySentimentResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } + +func (m *AnalyzeEntitySentimentResponse) GetEntities() []*Entity { + if m != nil { + return m.Entities + } + return nil +} + +func (m *AnalyzeEntitySentimentResponse) GetLanguage() string { + if m != nil { + return m.Language + } + return "" +} + +// The entity analysis request message. +type AnalyzeEntitiesRequest struct { + // Input document. + Document *Document `protobuf:"bytes,1,opt,name=document" json:"document,omitempty"` + // The encoding type used by the API to calculate offsets. + EncodingType EncodingType `protobuf:"varint,2,opt,name=encoding_type,json=encodingType,enum=google.cloud.language.v1beta2.EncodingType" json:"encoding_type,omitempty"` +} + +func (m *AnalyzeEntitiesRequest) Reset() { *m = AnalyzeEntitiesRequest{} } +func (m *AnalyzeEntitiesRequest) String() string { return proto.CompactTextString(m) } +func (*AnalyzeEntitiesRequest) ProtoMessage() {} +func (*AnalyzeEntitiesRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } + +func (m *AnalyzeEntitiesRequest) GetDocument() *Document { + if m != nil { + return m.Document + } + return nil +} + +func (m *AnalyzeEntitiesRequest) GetEncodingType() EncodingType { + if m != nil { + return m.EncodingType + } + return EncodingType_NONE +} + +// The entity analysis response message. +type AnalyzeEntitiesResponse struct { + // The recognized entities in the input document. + Entities []*Entity `protobuf:"bytes,1,rep,name=entities" json:"entities,omitempty"` + // The language of the text, which will be the same as the language specified + // in the request or, if not specified, the automatically-detected language. + // See [Document.language][google.cloud.language.v1beta2.Document.language] field for more details. + Language string `protobuf:"bytes,2,opt,name=language" json:"language,omitempty"` +} + +func (m *AnalyzeEntitiesResponse) Reset() { *m = AnalyzeEntitiesResponse{} } +func (m *AnalyzeEntitiesResponse) String() string { return proto.CompactTextString(m) } +func (*AnalyzeEntitiesResponse) ProtoMessage() {} +func (*AnalyzeEntitiesResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } + +func (m *AnalyzeEntitiesResponse) GetEntities() []*Entity { + if m != nil { + return m.Entities + } + return nil +} + +func (m *AnalyzeEntitiesResponse) GetLanguage() string { + if m != nil { + return m.Language + } + return "" +} + +// The syntax analysis request message. +type AnalyzeSyntaxRequest struct { + // Input document. + Document *Document `protobuf:"bytes,1,opt,name=document" json:"document,omitempty"` + // The encoding type used by the API to calculate offsets. + EncodingType EncodingType `protobuf:"varint,2,opt,name=encoding_type,json=encodingType,enum=google.cloud.language.v1beta2.EncodingType" json:"encoding_type,omitempty"` +} + +func (m *AnalyzeSyntaxRequest) Reset() { *m = AnalyzeSyntaxRequest{} } +func (m *AnalyzeSyntaxRequest) String() string { return proto.CompactTextString(m) } +func (*AnalyzeSyntaxRequest) ProtoMessage() {} +func (*AnalyzeSyntaxRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} } + +func (m *AnalyzeSyntaxRequest) GetDocument() *Document { + if m != nil { + return m.Document + } + return nil +} + +func (m *AnalyzeSyntaxRequest) GetEncodingType() EncodingType { + if m != nil { + return m.EncodingType + } + return EncodingType_NONE +} + +// The syntax analysis response message. +type AnalyzeSyntaxResponse struct { + // Sentences in the input document. + Sentences []*Sentence `protobuf:"bytes,1,rep,name=sentences" json:"sentences,omitempty"` + // Tokens, along with their syntactic information, in the input document. + Tokens []*Token `protobuf:"bytes,2,rep,name=tokens" json:"tokens,omitempty"` + // The language of the text, which will be the same as the language specified + // in the request or, if not specified, the automatically-detected language. + // See [Document.language][google.cloud.language.v1beta2.Document.language] field for more details. + Language string `protobuf:"bytes,3,opt,name=language" json:"language,omitempty"` +} + +func (m *AnalyzeSyntaxResponse) Reset() { *m = AnalyzeSyntaxResponse{} } +func (m *AnalyzeSyntaxResponse) String() string { return proto.CompactTextString(m) } +func (*AnalyzeSyntaxResponse) ProtoMessage() {} +func (*AnalyzeSyntaxResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17} } + +func (m *AnalyzeSyntaxResponse) GetSentences() []*Sentence { + if m != nil { + return m.Sentences + } + return nil +} + +func (m *AnalyzeSyntaxResponse) GetTokens() []*Token { + if m != nil { + return m.Tokens + } + return nil +} + +func (m *AnalyzeSyntaxResponse) GetLanguage() string { + if m != nil { + return m.Language + } + return "" +} + +// The document classification request message. +type ClassifyTextRequest struct { + // Input document. + Document *Document `protobuf:"bytes,1,opt,name=document" json:"document,omitempty"` +} + +func (m *ClassifyTextRequest) Reset() { *m = ClassifyTextRequest{} } +func (m *ClassifyTextRequest) String() string { return proto.CompactTextString(m) } +func (*ClassifyTextRequest) ProtoMessage() {} +func (*ClassifyTextRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{18} } + +func (m *ClassifyTextRequest) GetDocument() *Document { + if m != nil { + return m.Document + } + return nil +} + +// The document classification response message. +type ClassifyTextResponse struct { + // Categories representing the input document. + Categories []*ClassificationCategory `protobuf:"bytes,1,rep,name=categories" json:"categories,omitempty"` +} + +func (m *ClassifyTextResponse) Reset() { *m = ClassifyTextResponse{} } +func (m *ClassifyTextResponse) String() string { return proto.CompactTextString(m) } +func (*ClassifyTextResponse) ProtoMessage() {} +func (*ClassifyTextResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{19} } + +func (m *ClassifyTextResponse) GetCategories() []*ClassificationCategory { + if m != nil { + return m.Categories + } + return nil +} + +// The request message for the text annotation API, which can perform multiple +// analysis types (sentiment, entities, and syntax) in one call. +type AnnotateTextRequest struct { + // Input document. + Document *Document `protobuf:"bytes,1,opt,name=document" json:"document,omitempty"` + // The enabled features. + Features *AnnotateTextRequest_Features `protobuf:"bytes,2,opt,name=features" json:"features,omitempty"` + // The encoding type used by the API to calculate offsets. + EncodingType EncodingType `protobuf:"varint,3,opt,name=encoding_type,json=encodingType,enum=google.cloud.language.v1beta2.EncodingType" json:"encoding_type,omitempty"` +} + +func (m *AnnotateTextRequest) Reset() { *m = AnnotateTextRequest{} } +func (m *AnnotateTextRequest) String() string { return proto.CompactTextString(m) } +func (*AnnotateTextRequest) ProtoMessage() {} +func (*AnnotateTextRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20} } + +func (m *AnnotateTextRequest) GetDocument() *Document { + if m != nil { + return m.Document + } + return nil +} + +func (m *AnnotateTextRequest) GetFeatures() *AnnotateTextRequest_Features { + if m != nil { + return m.Features + } + return nil +} + +func (m *AnnotateTextRequest) GetEncodingType() EncodingType { + if m != nil { + return m.EncodingType + } + return EncodingType_NONE +} + +// All available features for sentiment, syntax, and semantic analysis. +// Setting each one to true will enable that specific analysis for the input. +type AnnotateTextRequest_Features struct { + // Extract syntax information. + ExtractSyntax bool `protobuf:"varint,1,opt,name=extract_syntax,json=extractSyntax" json:"extract_syntax,omitempty"` + // Extract entities. + ExtractEntities bool `protobuf:"varint,2,opt,name=extract_entities,json=extractEntities" json:"extract_entities,omitempty"` + // Extract document-level sentiment. + ExtractDocumentSentiment bool `protobuf:"varint,3,opt,name=extract_document_sentiment,json=extractDocumentSentiment" json:"extract_document_sentiment,omitempty"` + // Extract entities and their associated sentiment. + ExtractEntitySentiment bool `protobuf:"varint,4,opt,name=extract_entity_sentiment,json=extractEntitySentiment" json:"extract_entity_sentiment,omitempty"` + // Classify the full document into categories. + ClassifyText bool `protobuf:"varint,6,opt,name=classify_text,json=classifyText" json:"classify_text,omitempty"` +} + +func (m *AnnotateTextRequest_Features) Reset() { *m = AnnotateTextRequest_Features{} } +func (m *AnnotateTextRequest_Features) String() string { return proto.CompactTextString(m) } +func (*AnnotateTextRequest_Features) ProtoMessage() {} +func (*AnnotateTextRequest_Features) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{20, 0} +} + +func (m *AnnotateTextRequest_Features) GetExtractSyntax() bool { + if m != nil { + return m.ExtractSyntax + } + return false +} + +func (m *AnnotateTextRequest_Features) GetExtractEntities() bool { + if m != nil { + return m.ExtractEntities + } + return false +} + +func (m *AnnotateTextRequest_Features) GetExtractDocumentSentiment() bool { + if m != nil { + return m.ExtractDocumentSentiment + } + return false +} + +func (m *AnnotateTextRequest_Features) GetExtractEntitySentiment() bool { + if m != nil { + return m.ExtractEntitySentiment + } + return false +} + +func (m *AnnotateTextRequest_Features) GetClassifyText() bool { + if m != nil { + return m.ClassifyText + } + return false +} + +// The text annotations response message. +type AnnotateTextResponse struct { + // Sentences in the input document. Populated if the user enables + // [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_syntax]. + Sentences []*Sentence `protobuf:"bytes,1,rep,name=sentences" json:"sentences,omitempty"` + // Tokens, along with their syntactic information, in the input document. + // Populated if the user enables + // [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_syntax]. + Tokens []*Token `protobuf:"bytes,2,rep,name=tokens" json:"tokens,omitempty"` + // Entities, along with their semantic information, in the input document. + // Populated if the user enables + // [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_entities]. + Entities []*Entity `protobuf:"bytes,3,rep,name=entities" json:"entities,omitempty"` + // The overall sentiment for the document. Populated if the user enables + // [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_document_sentiment]. + DocumentSentiment *Sentiment `protobuf:"bytes,4,opt,name=document_sentiment,json=documentSentiment" json:"document_sentiment,omitempty"` + // The language of the text, which will be the same as the language specified + // in the request or, if not specified, the automatically-detected language. + // See [Document.language][google.cloud.language.v1beta2.Document.language] field for more details. + Language string `protobuf:"bytes,5,opt,name=language" json:"language,omitempty"` + // Categories identified in the input document. + Categories []*ClassificationCategory `protobuf:"bytes,6,rep,name=categories" json:"categories,omitempty"` +} + +func (m *AnnotateTextResponse) Reset() { *m = AnnotateTextResponse{} } +func (m *AnnotateTextResponse) String() string { return proto.CompactTextString(m) } +func (*AnnotateTextResponse) ProtoMessage() {} +func (*AnnotateTextResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{21} } + +func (m *AnnotateTextResponse) GetSentences() []*Sentence { + if m != nil { + return m.Sentences + } + return nil +} + +func (m *AnnotateTextResponse) GetTokens() []*Token { + if m != nil { + return m.Tokens + } + return nil +} + +func (m *AnnotateTextResponse) GetEntities() []*Entity { + if m != nil { + return m.Entities + } + return nil +} + +func (m *AnnotateTextResponse) GetDocumentSentiment() *Sentiment { + if m != nil { + return m.DocumentSentiment + } + return nil +} + +func (m *AnnotateTextResponse) GetLanguage() string { + if m != nil { + return m.Language + } + return "" +} + +func (m *AnnotateTextResponse) GetCategories() []*ClassificationCategory { + if m != nil { + return m.Categories + } + return nil +} + +func init() { + proto.RegisterType((*Document)(nil), "google.cloud.language.v1beta2.Document") + proto.RegisterType((*Sentence)(nil), "google.cloud.language.v1beta2.Sentence") + proto.RegisterType((*Entity)(nil), "google.cloud.language.v1beta2.Entity") + proto.RegisterType((*Token)(nil), "google.cloud.language.v1beta2.Token") + proto.RegisterType((*Sentiment)(nil), "google.cloud.language.v1beta2.Sentiment") + proto.RegisterType((*PartOfSpeech)(nil), "google.cloud.language.v1beta2.PartOfSpeech") + proto.RegisterType((*DependencyEdge)(nil), "google.cloud.language.v1beta2.DependencyEdge") + proto.RegisterType((*EntityMention)(nil), "google.cloud.language.v1beta2.EntityMention") + proto.RegisterType((*TextSpan)(nil), "google.cloud.language.v1beta2.TextSpan") + proto.RegisterType((*ClassificationCategory)(nil), "google.cloud.language.v1beta2.ClassificationCategory") + proto.RegisterType((*AnalyzeSentimentRequest)(nil), "google.cloud.language.v1beta2.AnalyzeSentimentRequest") + proto.RegisterType((*AnalyzeSentimentResponse)(nil), "google.cloud.language.v1beta2.AnalyzeSentimentResponse") + proto.RegisterType((*AnalyzeEntitySentimentRequest)(nil), "google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest") + proto.RegisterType((*AnalyzeEntitySentimentResponse)(nil), "google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse") + proto.RegisterType((*AnalyzeEntitiesRequest)(nil), "google.cloud.language.v1beta2.AnalyzeEntitiesRequest") + proto.RegisterType((*AnalyzeEntitiesResponse)(nil), "google.cloud.language.v1beta2.AnalyzeEntitiesResponse") + proto.RegisterType((*AnalyzeSyntaxRequest)(nil), "google.cloud.language.v1beta2.AnalyzeSyntaxRequest") + proto.RegisterType((*AnalyzeSyntaxResponse)(nil), "google.cloud.language.v1beta2.AnalyzeSyntaxResponse") + proto.RegisterType((*ClassifyTextRequest)(nil), "google.cloud.language.v1beta2.ClassifyTextRequest") + proto.RegisterType((*ClassifyTextResponse)(nil), "google.cloud.language.v1beta2.ClassifyTextResponse") + proto.RegisterType((*AnnotateTextRequest)(nil), "google.cloud.language.v1beta2.AnnotateTextRequest") + proto.RegisterType((*AnnotateTextRequest_Features)(nil), "google.cloud.language.v1beta2.AnnotateTextRequest.Features") + proto.RegisterType((*AnnotateTextResponse)(nil), "google.cloud.language.v1beta2.AnnotateTextResponse") + proto.RegisterEnum("google.cloud.language.v1beta2.EncodingType", EncodingType_name, EncodingType_value) + proto.RegisterEnum("google.cloud.language.v1beta2.Document_Type", Document_Type_name, Document_Type_value) + proto.RegisterEnum("google.cloud.language.v1beta2.Entity_Type", Entity_Type_name, Entity_Type_value) + proto.RegisterEnum("google.cloud.language.v1beta2.PartOfSpeech_Tag", PartOfSpeech_Tag_name, PartOfSpeech_Tag_value) + proto.RegisterEnum("google.cloud.language.v1beta2.PartOfSpeech_Aspect", PartOfSpeech_Aspect_name, PartOfSpeech_Aspect_value) + proto.RegisterEnum("google.cloud.language.v1beta2.PartOfSpeech_Case", PartOfSpeech_Case_name, PartOfSpeech_Case_value) + proto.RegisterEnum("google.cloud.language.v1beta2.PartOfSpeech_Form", PartOfSpeech_Form_name, PartOfSpeech_Form_value) + proto.RegisterEnum("google.cloud.language.v1beta2.PartOfSpeech_Gender", PartOfSpeech_Gender_name, PartOfSpeech_Gender_value) + proto.RegisterEnum("google.cloud.language.v1beta2.PartOfSpeech_Mood", PartOfSpeech_Mood_name, PartOfSpeech_Mood_value) + proto.RegisterEnum("google.cloud.language.v1beta2.PartOfSpeech_Number", PartOfSpeech_Number_name, PartOfSpeech_Number_value) + proto.RegisterEnum("google.cloud.language.v1beta2.PartOfSpeech_Person", PartOfSpeech_Person_name, PartOfSpeech_Person_value) + proto.RegisterEnum("google.cloud.language.v1beta2.PartOfSpeech_Proper", PartOfSpeech_Proper_name, PartOfSpeech_Proper_value) + proto.RegisterEnum("google.cloud.language.v1beta2.PartOfSpeech_Reciprocity", PartOfSpeech_Reciprocity_name, PartOfSpeech_Reciprocity_value) + proto.RegisterEnum("google.cloud.language.v1beta2.PartOfSpeech_Tense", PartOfSpeech_Tense_name, PartOfSpeech_Tense_value) + proto.RegisterEnum("google.cloud.language.v1beta2.PartOfSpeech_Voice", PartOfSpeech_Voice_name, PartOfSpeech_Voice_value) + proto.RegisterEnum("google.cloud.language.v1beta2.DependencyEdge_Label", DependencyEdge_Label_name, DependencyEdge_Label_value) + proto.RegisterEnum("google.cloud.language.v1beta2.EntityMention_Type", EntityMention_Type_name, EntityMention_Type_value) +} + +// 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 + +// Client API for LanguageService service + +type LanguageServiceClient interface { + // Analyzes the sentiment of the provided text. + AnalyzeSentiment(ctx context.Context, in *AnalyzeSentimentRequest, opts ...grpc.CallOption) (*AnalyzeSentimentResponse, error) + // Finds named entities (currently proper names and common nouns) in the text + // along with entity types, salience, mentions for each entity, and + // other properties. + AnalyzeEntities(ctx context.Context, in *AnalyzeEntitiesRequest, opts ...grpc.CallOption) (*AnalyzeEntitiesResponse, error) + // Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1beta2.LanguageService.AnalyzeEntities] in the text and analyzes + // sentiment associated with each entity and its mentions. + AnalyzeEntitySentiment(ctx context.Context, in *AnalyzeEntitySentimentRequest, opts ...grpc.CallOption) (*AnalyzeEntitySentimentResponse, error) + // Analyzes the syntax of the text and provides sentence boundaries and + // tokenization along with part of speech tags, dependency trees, and other + // properties. + AnalyzeSyntax(ctx context.Context, in *AnalyzeSyntaxRequest, opts ...grpc.CallOption) (*AnalyzeSyntaxResponse, error) + // Classifies a document into categories. + ClassifyText(ctx context.Context, in *ClassifyTextRequest, opts ...grpc.CallOption) (*ClassifyTextResponse, error) + // A convenience method that provides all syntax, sentiment, entity, and + // classification features in one call. + AnnotateText(ctx context.Context, in *AnnotateTextRequest, opts ...grpc.CallOption) (*AnnotateTextResponse, error) +} + +type languageServiceClient struct { + cc *grpc.ClientConn +} + +func NewLanguageServiceClient(cc *grpc.ClientConn) LanguageServiceClient { + return &languageServiceClient{cc} +} + +func (c *languageServiceClient) AnalyzeSentiment(ctx context.Context, in *AnalyzeSentimentRequest, opts ...grpc.CallOption) (*AnalyzeSentimentResponse, error) { + out := new(AnalyzeSentimentResponse) + err := grpc.Invoke(ctx, "/google.cloud.language.v1beta2.LanguageService/AnalyzeSentiment", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *languageServiceClient) AnalyzeEntities(ctx context.Context, in *AnalyzeEntitiesRequest, opts ...grpc.CallOption) (*AnalyzeEntitiesResponse, error) { + out := new(AnalyzeEntitiesResponse) + err := grpc.Invoke(ctx, "/google.cloud.language.v1beta2.LanguageService/AnalyzeEntities", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *languageServiceClient) AnalyzeEntitySentiment(ctx context.Context, in *AnalyzeEntitySentimentRequest, opts ...grpc.CallOption) (*AnalyzeEntitySentimentResponse, error) { + out := new(AnalyzeEntitySentimentResponse) + err := grpc.Invoke(ctx, "/google.cloud.language.v1beta2.LanguageService/AnalyzeEntitySentiment", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *languageServiceClient) AnalyzeSyntax(ctx context.Context, in *AnalyzeSyntaxRequest, opts ...grpc.CallOption) (*AnalyzeSyntaxResponse, error) { + out := new(AnalyzeSyntaxResponse) + err := grpc.Invoke(ctx, "/google.cloud.language.v1beta2.LanguageService/AnalyzeSyntax", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *languageServiceClient) ClassifyText(ctx context.Context, in *ClassifyTextRequest, opts ...grpc.CallOption) (*ClassifyTextResponse, error) { + out := new(ClassifyTextResponse) + err := grpc.Invoke(ctx, "/google.cloud.language.v1beta2.LanguageService/ClassifyText", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *languageServiceClient) AnnotateText(ctx context.Context, in *AnnotateTextRequest, opts ...grpc.CallOption) (*AnnotateTextResponse, error) { + out := new(AnnotateTextResponse) + err := grpc.Invoke(ctx, "/google.cloud.language.v1beta2.LanguageService/AnnotateText", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for LanguageService service + +type LanguageServiceServer interface { + // Analyzes the sentiment of the provided text. + AnalyzeSentiment(context.Context, *AnalyzeSentimentRequest) (*AnalyzeSentimentResponse, error) + // Finds named entities (currently proper names and common nouns) in the text + // along with entity types, salience, mentions for each entity, and + // other properties. + AnalyzeEntities(context.Context, *AnalyzeEntitiesRequest) (*AnalyzeEntitiesResponse, error) + // Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1beta2.LanguageService.AnalyzeEntities] in the text and analyzes + // sentiment associated with each entity and its mentions. + AnalyzeEntitySentiment(context.Context, *AnalyzeEntitySentimentRequest) (*AnalyzeEntitySentimentResponse, error) + // Analyzes the syntax of the text and provides sentence boundaries and + // tokenization along with part of speech tags, dependency trees, and other + // properties. + AnalyzeSyntax(context.Context, *AnalyzeSyntaxRequest) (*AnalyzeSyntaxResponse, error) + // Classifies a document into categories. + ClassifyText(context.Context, *ClassifyTextRequest) (*ClassifyTextResponse, error) + // A convenience method that provides all syntax, sentiment, entity, and + // classification features in one call. + AnnotateText(context.Context, *AnnotateTextRequest) (*AnnotateTextResponse, error) +} + +func RegisterLanguageServiceServer(s *grpc.Server, srv LanguageServiceServer) { + s.RegisterService(&_LanguageService_serviceDesc, srv) +} + +func _LanguageService_AnalyzeSentiment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AnalyzeSentimentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LanguageServiceServer).AnalyzeSentiment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.language.v1beta2.LanguageService/AnalyzeSentiment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LanguageServiceServer).AnalyzeSentiment(ctx, req.(*AnalyzeSentimentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LanguageService_AnalyzeEntities_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AnalyzeEntitiesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LanguageServiceServer).AnalyzeEntities(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.language.v1beta2.LanguageService/AnalyzeEntities", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LanguageServiceServer).AnalyzeEntities(ctx, req.(*AnalyzeEntitiesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LanguageService_AnalyzeEntitySentiment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AnalyzeEntitySentimentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LanguageServiceServer).AnalyzeEntitySentiment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.language.v1beta2.LanguageService/AnalyzeEntitySentiment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LanguageServiceServer).AnalyzeEntitySentiment(ctx, req.(*AnalyzeEntitySentimentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LanguageService_AnalyzeSyntax_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AnalyzeSyntaxRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LanguageServiceServer).AnalyzeSyntax(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.language.v1beta2.LanguageService/AnalyzeSyntax", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LanguageServiceServer).AnalyzeSyntax(ctx, req.(*AnalyzeSyntaxRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LanguageService_ClassifyText_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ClassifyTextRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LanguageServiceServer).ClassifyText(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.language.v1beta2.LanguageService/ClassifyText", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LanguageServiceServer).ClassifyText(ctx, req.(*ClassifyTextRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LanguageService_AnnotateText_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AnnotateTextRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LanguageServiceServer).AnnotateText(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.language.v1beta2.LanguageService/AnnotateText", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LanguageServiceServer).AnnotateText(ctx, req.(*AnnotateTextRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _LanguageService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.cloud.language.v1beta2.LanguageService", + HandlerType: (*LanguageServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "AnalyzeSentiment", + Handler: _LanguageService_AnalyzeSentiment_Handler, + }, + { + MethodName: "AnalyzeEntities", + Handler: _LanguageService_AnalyzeEntities_Handler, + }, + { + MethodName: "AnalyzeEntitySentiment", + Handler: _LanguageService_AnalyzeEntitySentiment_Handler, + }, + { + MethodName: "AnalyzeSyntax", + Handler: _LanguageService_AnalyzeSyntax_Handler, + }, + { + MethodName: "ClassifyText", + Handler: _LanguageService_ClassifyText_Handler, + }, + { + MethodName: "AnnotateText", + Handler: _LanguageService_AnnotateText_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/cloud/language/v1beta2/language_service.proto", +} + +func init() { + proto.RegisterFile("google/cloud/language/v1beta2/language_service.proto", fileDescriptor0) +} + +var fileDescriptor0 = []byte{ + // 3019 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x3a, 0x4b, 0x73, 0xdb, 0xc6, + 0xfd, 0x06, 0x5f, 0xa2, 0x96, 0x92, 0xbc, 0x86, 0x1d, 0x9b, 0x7f, 0xfd, 0xf3, 0x70, 0xe0, 0xb8, + 0x56, 0xec, 0x44, 0x8a, 0x25, 0xc7, 0x71, 0x6d, 0xe7, 0x01, 0x01, 0x4b, 0x0a, 0x32, 0x09, 0xc0, + 0x0b, 0x80, 0x92, 0x7d, 0xe1, 0xc0, 0x24, 0xc4, 0x70, 0x22, 0x02, 0x2c, 0x01, 0x79, 0xac, 0x5e, + 0x32, 0xcd, 0x4c, 0x8f, 0x99, 0x1e, 0xf2, 0x11, 0x7a, 0xe8, 0xb4, 0x33, 0x9d, 0xb4, 0xd3, 0x99, + 0x4e, 0x7b, 0xe8, 0x27, 0xe8, 0xb1, 0x33, 0xfd, 0x04, 0xfd, 0x00, 0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0xcd, 0x75, 0xa2, 0x30, 0x09, 0xc2, 0xa4, 0x9a, 0xbb, 0x2c, 0xad, 0xcc, 0x6f, 0x9d, 0xa1, + 0x29, 0x40, 0x5e, 0x41, 0x67, 0x7b, 0x9d, 0xb8, 0x2d, 0xb6, 0xed, 0x83, 0x51, 0xbf, 0x9a, 0x17, + 0x38, 0x8b, 0xbd, 0x4e, 0xac, 0x71, 0xb8, 0x37, 0xea, 0xcb, 0xcb, 0xa8, 0x9c, 0x4a, 0xab, 0x16, + 0x00, 0x85, 0x8e, 0xf7, 0xca, 0x6d, 0x54, 0x00, 0x79, 0xf2, 0x05, 0x84, 0xdd, 0x47, 0x36, 0x69, + 0x7b, 0xa6, 0x63, 0x13, 0xcd, 0xa8, 0x19, 0x44, 0xc7, 0x67, 0xe4, 0x25, 0x84, 0xec, 0x86, 0x6a, + 0x98, 0x6d, 0x97, 0xec, 0xba, 0x58, 0x92, 0xcb, 0xa8, 0xb0, 0xe5, 0x36, 0x1b, 0x38, 0xb7, 0x59, + 0x46, 0xa5, 0x38, 0x3a, 0x18, 0x75, 0x02, 0xe5, 0x17, 0x12, 0x2a, 0x3b, 0x01, 0x08, 0xeb, 0x04, + 0xf2, 0x3d, 0x54, 0x48, 0x82, 0x67, 0x09, 0x33, 0xb9, 0xb2, 0x7e, 0xed, 0x04, 0x93, 0xdd, 0xe0, + 0x59, 0xe2, 0x0c, 0xfd, 0x90, 0x32, 0x22, 0xb9, 0x86, 0xe6, 0xe3, 0x20, 0x04, 0x5f, 0x0b, 0x7b, + 0x2b, 0xeb, 0x2b, 0x27, 0x70, 0x70, 0x52, 0x7c, 0x3a, 0x21, 0x55, 0xbe, 0x29, 0xa0, 0x12, 0x09, + 0x93, 0x7e, 0x72, 0x28, 0xcb, 0xa8, 0x10, 0xfa, 0x03, 0x1e, 0x82, 0x79, 0xca, 0xd6, 0xf2, 0x27, + 0x22, 0x2c, 0x39, 0x16, 0x96, 0xeb, 0x27, 0x48, 0xe0, 0x8c, 0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0, 0x71, 0x96, 0x51, 0xc1, + 0xb4, 0x3c, 0x13, 0x97, 0x00, 0x64, 0x7a, 0x4d, 0x3c, 0x07, 0x20, 0x9b, 0x5a, 0x26, 0x2e, 0x03, + 0xc8, 0xa6, 0x2e, 0x9e, 0x87, 0x5e, 0x6a, 0x7b, 0xa6, 0xe6, 0x62, 0x04, 0x5f, 0x5b, 0x84, 0x6e, + 0xe2, 0x8a, 0x5c, 0x44, 0xd2, 0x2e, 0x5e, 0x80, 0x6f, 0x6a, 0xad, 0x66, 0xec, 0xe2, 0x45, 0xc5, + 0x42, 0x25, 0x5e, 0x90, 0xb2, 0x8c, 0x96, 0x54, 0x38, 0x4d, 0xb8, 0xed, 0x89, 0x62, 0x70, 0xa2, + 0x20, 0xb4, 0x46, 0x34, 0xd7, 0x68, 0x11, 0x2c, 0x41, 0x87, 0x37, 0x9a, 0x19, 0x48, 0x0e, 0xda, + 0xba, 0x4d, 0xad, 0x3a, 0x25, 0x8e, 0x03, 0x80, 0xbc, 0xf2, 0x2f, 0x09, 0x15, 0xa0, 0x30, 0x01, + 0x57, 0x53, 0x1d, 0x32, 0xcd, 0x4d, 0xd5, 0x34, 0xcf, 0x51, 0x05, 0xb7, 0x45, 0x34, 0xaf, 0xea, + 0xa0, 0x99, 0xa1, 0x36, 0x70, 0x8e, 0x0f, 0x84, 0xa6, 0xdd, 0x20, 0x4d, 0x62, 0x32, 0x8c, 0x3c, + 0xcc, 0x1a, 0x9d, 0x63, 0x17, 0x60, 0xd6, 0xd4, 0x89, 0x69, 0xb0, 0x5d, 0x91, 0x69, 0x62, 0x3a, + 0x2e, 0xf5, 0x00, 0x59, 0x6d, 0xe0, 0xd2, 0x64, 0x16, 0xb5, 0x08, 0x9e, 0x03, 0x59, 0xa6, 0xd5, + 0x34, 0x4c, 0xbe, 0x2f, 0x83, 0xbf, 0xad, 0xcd, 0x86, 0xf1, 0xd0, 0x23, 0x78, 0x1e, 0x04, 0xdb, + 0x2a, 0x75, 0x39, 0x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xb1, 0xf1, 0x9f, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xcc, 0x93, 0x36, 0x44, 0x2d, 0x23, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/location/locations.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/location/locations.pb.go new file mode 100644 index 0000000000..2b9f9f526a --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/location/locations.pb.go @@ -0,0 +1,331 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/location/locations.proto + +/* +Package location is a generated protocol buffer package. + +It is generated from these files: + google/cloud/location/locations.proto + +It has these top-level messages: + ListLocationsRequest + ListLocationsResponse + GetLocationRequest + Location +*/ +package location + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf1 "github.com/golang/protobuf/ptypes/any" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// The request message for [Locations.ListLocations][google.cloud.location.Locations.ListLocations]. +type ListLocationsRequest struct { + // The resource that owns the locations collection, if applicable. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The standard list filter. + Filter string `protobuf:"bytes,2,opt,name=filter" json:"filter,omitempty"` + // The standard list page size. + PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // The standard list page token. + PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListLocationsRequest) Reset() { *m = ListLocationsRequest{} } +func (m *ListLocationsRequest) String() string { return proto.CompactTextString(m) } +func (*ListLocationsRequest) ProtoMessage() {} +func (*ListLocationsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *ListLocationsRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ListLocationsRequest) GetFilter() string { + if m != nil { + return m.Filter + } + return "" +} + +func (m *ListLocationsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListLocationsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// The response message for [Locations.ListLocations][google.cloud.location.Locations.ListLocations]. +type ListLocationsResponse struct { + // A list of locations that matches the specified filter in the request. + Locations []*Location `protobuf:"bytes,1,rep,name=locations" json:"locations,omitempty"` + // The standard List next-page token. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListLocationsResponse) Reset() { *m = ListLocationsResponse{} } +func (m *ListLocationsResponse) String() string { return proto.CompactTextString(m) } +func (*ListLocationsResponse) ProtoMessage() {} +func (*ListLocationsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *ListLocationsResponse) GetLocations() []*Location { + if m != nil { + return m.Locations + } + return nil +} + +func (m *ListLocationsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// The request message for [Locations.GetLocation][google.cloud.location.Locations.GetLocation]. +type GetLocationRequest struct { + // Resource name for the location. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetLocationRequest) Reset() { *m = GetLocationRequest{} } +func (m *GetLocationRequest) String() string { return proto.CompactTextString(m) } +func (*GetLocationRequest) ProtoMessage() {} +func (*GetLocationRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *GetLocationRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// A resource that represents Google Cloud Platform location. +type Location struct { + // Resource name for the location, which may vary between implementations. + // For example: `"projects/example-project/locations/us-east1"` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The canonical id for this location. For example: `"us-east1"`. + LocationId string `protobuf:"bytes,4,opt,name=location_id,json=locationId" json:"location_id,omitempty"` + // Cross-service attributes for the location. For example + // + // {"cloud.googleapis.com/region": "us-east1"} + Labels map[string]string `protobuf:"bytes,2,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // Service-specific metadata. For example the available capacity at the given + // location. + Metadata *google_protobuf1.Any `protobuf:"bytes,3,opt,name=metadata" json:"metadata,omitempty"` +} + +func (m *Location) Reset() { *m = Location{} } +func (m *Location) String() string { return proto.CompactTextString(m) } +func (*Location) ProtoMessage() {} +func (*Location) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *Location) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Location) GetLocationId() string { + if m != nil { + return m.LocationId + } + return "" +} + +func (m *Location) GetLabels() map[string]string { + if m != nil { + return m.Labels + } + return nil +} + +func (m *Location) GetMetadata() *google_protobuf1.Any { + if m != nil { + return m.Metadata + } + return nil +} + +func init() { + proto.RegisterType((*ListLocationsRequest)(nil), "google.cloud.location.ListLocationsRequest") + proto.RegisterType((*ListLocationsResponse)(nil), "google.cloud.location.ListLocationsResponse") + proto.RegisterType((*GetLocationRequest)(nil), "google.cloud.location.GetLocationRequest") + proto.RegisterType((*Location)(nil), "google.cloud.location.Location") +} + +// 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 + +// Client API for Locations service + +type LocationsClient interface { + // Lists information about the supported locations for this service. + ListLocations(ctx context.Context, in *ListLocationsRequest, opts ...grpc.CallOption) (*ListLocationsResponse, error) + // Get information about a location. + GetLocation(ctx context.Context, in *GetLocationRequest, opts ...grpc.CallOption) (*Location, error) +} + +type locationsClient struct { + cc *grpc.ClientConn +} + +func NewLocationsClient(cc *grpc.ClientConn) LocationsClient { + return &locationsClient{cc} +} + +func (c *locationsClient) ListLocations(ctx context.Context, in *ListLocationsRequest, opts ...grpc.CallOption) (*ListLocationsResponse, error) { + out := new(ListLocationsResponse) + err := grpc.Invoke(ctx, "/google.cloud.location.Locations/ListLocations", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *locationsClient) GetLocation(ctx context.Context, in *GetLocationRequest, opts ...grpc.CallOption) (*Location, error) { + out := new(Location) + err := grpc.Invoke(ctx, "/google.cloud.location.Locations/GetLocation", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for Locations service + +type LocationsServer interface { + // Lists information about the supported locations for this service. + ListLocations(context.Context, *ListLocationsRequest) (*ListLocationsResponse, error) + // Get information about a location. + GetLocation(context.Context, *GetLocationRequest) (*Location, error) +} + +func RegisterLocationsServer(s *grpc.Server, srv LocationsServer) { + s.RegisterService(&_Locations_serviceDesc, srv) +} + +func _Locations_ListLocations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListLocationsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LocationsServer).ListLocations(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.location.Locations/ListLocations", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LocationsServer).ListLocations(ctx, req.(*ListLocationsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Locations_GetLocation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetLocationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LocationsServer).GetLocation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.location.Locations/GetLocation", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LocationsServer).GetLocation(ctx, req.(*GetLocationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Locations_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.cloud.location.Locations", + HandlerType: (*LocationsServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListLocations", + Handler: _Locations_ListLocations_Handler, + }, + { + MethodName: "GetLocation", + Handler: _Locations_GetLocation_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/cloud/location/locations.proto", +} + +func init() { proto.RegisterFile("google/cloud/location/locations.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 508 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xcd, 0x6e, 0xd3, 0x40, + 0x10, 0xd6, 0x3a, 0x6d, 0x94, 0x8c, 0x55, 0x40, 0xa3, 0x14, 0xb9, 0x06, 0x94, 0xd4, 0x08, 0x48, + 0x0b, 0xf2, 0x42, 0xb8, 0xf0, 0xa3, 0x1c, 0x28, 0x42, 0x08, 0x29, 0x87, 0xc8, 0x70, 0xe2, 0x12, + 0x6d, 0x92, 0xad, 0x65, 0xea, 0xec, 0x1a, 0x7b, 0x53, 0x91, 0xa2, 0xf6, 0x80, 0x78, 0x83, 0xbe, + 0x04, 0xef, 0xc3, 0x2b, 0xf0, 0x02, 0xdc, 0x38, 0x22, 0xaf, 0x7f, 0x12, 0x8a, 0x4b, 0xb8, 0xcd, + 0xce, 0x7c, 0xb3, 0xdf, 0x7c, 0xf3, 0xad, 0x0d, 0x77, 0x7c, 0x29, 0xfd, 0x90, 0xd3, 0x49, 0x28, + 0xe7, 0x53, 0x1a, 0xca, 0x09, 0x53, 0x81, 0x14, 0x65, 0x90, 0xb8, 0x51, 0x2c, 0x95, 0xc4, 0xed, + 0x0c, 0xe6, 0x6a, 0x98, 0x5b, 0x54, 0xed, 0x9b, 0x79, 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xfe, 0x06, 0xcf, 0x8b, 0xe0, 0x17, 0x21, 0xe3, 0xba, 0x06, 0x3f, 0xfe, 0x1d, + 0x00, 0x00, 0xff, 0xff, 0x0d, 0x57, 0x9e, 0xa7, 0x39, 0x04, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/ml/v1/job_service.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/ml/v1/job_service.pb.go new file mode 100644 index 0000000000..b99add0ecd --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/ml/v1/job_service.pb.go @@ -0,0 +1,1822 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/ml/v1/job_service.proto + +/* +Package ml is a generated protocol buffer package. + +It is generated from these files: + google/cloud/ml/v1/job_service.proto + google/cloud/ml/v1/model_service.proto + google/cloud/ml/v1/operation_metadata.proto + google/cloud/ml/v1/prediction_service.proto + google/cloud/ml/v1/project_service.proto + +It has these top-level messages: + TrainingInput + HyperparameterSpec + ParameterSpec + HyperparameterOutput + TrainingOutput + PredictionInput + PredictionOutput + Job + CreateJobRequest + ListJobsRequest + ListJobsResponse + GetJobRequest + CancelJobRequest + Model + Version + ManualScaling + CreateModelRequest + ListModelsRequest + ListModelsResponse + GetModelRequest + DeleteModelRequest + CreateVersionRequest + ListVersionsRequest + ListVersionsResponse + GetVersionRequest + DeleteVersionRequest + SetDefaultVersionRequest + OperationMetadata + PredictRequest + GetConfigRequest + GetConfigResponse +*/ +package ml + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import _ "google.golang.org/genproto/googleapis/api/serviceconfig" +import google_protobuf1 "github.com/golang/protobuf/ptypes/empty" +import google_protobuf2 "github.com/golang/protobuf/ptypes/timestamp" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// A scale tier is an abstract representation of the resources Cloud ML +// will allocate to a training job. When selecting a scale tier for your +// training job, you should consider the size of your training dataset and +// the complexity of your model. As the tiers increase, virtual machines are +// added to handle your job, and the individual machines in the cluster +// generally have more memory and greater processing power than they do at +// lower tiers. The number of training units charged per hour of processing +// increases as tiers get more advanced. Refer to the +// [pricing guide](/ml/pricing) for more details. Note that in addition to +// incurring costs, your use of training resources is constrained by the +// [quota policy](/ml/quota). +type TrainingInput_ScaleTier int32 + +const ( + // A single worker instance. This tier is suitable for learning how to use + // Cloud ML, and for experimenting with new models using small datasets. + TrainingInput_BASIC TrainingInput_ScaleTier = 0 + // Many workers and a few parameter servers. + TrainingInput_STANDARD_1 TrainingInput_ScaleTier = 1 + // A large number of workers with many parameter servers. + TrainingInput_PREMIUM_1 TrainingInput_ScaleTier = 3 + // A single worker instance [with a GPU](ml/docs/how-tos/using-gpus). + TrainingInput_BASIC_GPU TrainingInput_ScaleTier = 6 + // The CUSTOM tier is not a set tier, but rather enables you to use your + // own cluster specification. When you use this tier, set values to + // configure your processing cluster according to these guidelines: + // + // * You _must_ set `TrainingInput.masterType` to specify the type + // of machine to use for your master node. This is the only required + // setting. + // + // * You _may_ set `TrainingInput.workerCount` to specify the number of + // workers to use. If you specify one or more workers, you _must_ also + // set `TrainingInput.workerType` to specify the type of machine to use + // for your worker nodes. + // + // * You _may_ set `TrainingInput.parameterServerCount` to specify the + // number of parameter servers to use. If you specify one or more + // parameter servers, you _must_ also set + // `TrainingInput.parameterServerType` to specify the type of machine to + // use for your parameter servers. + // + // Note that all of your workers must use the same machine type, which can + // be different from your parameter server type and master type. Your + // parameter servers must likewise use the same machine type, which can be + // different from your worker type and master type. + TrainingInput_CUSTOM TrainingInput_ScaleTier = 5 +) + +var TrainingInput_ScaleTier_name = map[int32]string{ + 0: "BASIC", + 1: "STANDARD_1", + 3: "PREMIUM_1", + 6: "BASIC_GPU", + 5: "CUSTOM", +} +var TrainingInput_ScaleTier_value = map[string]int32{ + "BASIC": 0, + "STANDARD_1": 1, + "PREMIUM_1": 3, + "BASIC_GPU": 6, + "CUSTOM": 5, +} + +func (x TrainingInput_ScaleTier) String() string { + return proto.EnumName(TrainingInput_ScaleTier_name, int32(x)) +} +func (TrainingInput_ScaleTier) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 0} } + +// The available types of optimization goals. +type HyperparameterSpec_GoalType int32 + +const ( + // Goal Type will default to maximize. + HyperparameterSpec_GOAL_TYPE_UNSPECIFIED HyperparameterSpec_GoalType = 0 + // Maximize the goal metric. + HyperparameterSpec_MAXIMIZE HyperparameterSpec_GoalType = 1 + // Minimize the goal metric. + HyperparameterSpec_MINIMIZE HyperparameterSpec_GoalType = 2 +) + +var HyperparameterSpec_GoalType_name = map[int32]string{ + 0: "GOAL_TYPE_UNSPECIFIED", + 1: "MAXIMIZE", + 2: "MINIMIZE", +} +var HyperparameterSpec_GoalType_value = map[string]int32{ + "GOAL_TYPE_UNSPECIFIED": 0, + "MAXIMIZE": 1, + "MINIMIZE": 2, +} + +func (x HyperparameterSpec_GoalType) String() string { + return proto.EnumName(HyperparameterSpec_GoalType_name, int32(x)) +} +func (HyperparameterSpec_GoalType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{1, 0} +} + +// The type of the parameter. +type ParameterSpec_ParameterType int32 + +const ( + // You must specify a valid type. Using this unspecified type will result in + // an error. + ParameterSpec_PARAMETER_TYPE_UNSPECIFIED ParameterSpec_ParameterType = 0 + // Type for real-valued parameters. + ParameterSpec_DOUBLE ParameterSpec_ParameterType = 1 + // Type for integral parameters. + ParameterSpec_INTEGER ParameterSpec_ParameterType = 2 + // The parameter is categorical, with a value chosen from the categories + // field. + ParameterSpec_CATEGORICAL ParameterSpec_ParameterType = 3 + // The parameter is real valued, with a fixed set of feasible points. If + // `type==DISCRETE`, feasible_points must be provided, and + // {`min_value`, `max_value`} will be ignored. + ParameterSpec_DISCRETE ParameterSpec_ParameterType = 4 +) + +var ParameterSpec_ParameterType_name = map[int32]string{ + 0: "PARAMETER_TYPE_UNSPECIFIED", + 1: "DOUBLE", + 2: "INTEGER", + 3: "CATEGORICAL", + 4: "DISCRETE", +} +var ParameterSpec_ParameterType_value = map[string]int32{ + "PARAMETER_TYPE_UNSPECIFIED": 0, + "DOUBLE": 1, + "INTEGER": 2, + "CATEGORICAL": 3, + "DISCRETE": 4, +} + +func (x ParameterSpec_ParameterType) String() string { + return proto.EnumName(ParameterSpec_ParameterType_name, int32(x)) +} +func (ParameterSpec_ParameterType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{2, 0} +} + +// The type of scaling that should be applied to this parameter. +type ParameterSpec_ScaleType int32 + +const ( + // By default, no scaling is applied. + ParameterSpec_NONE ParameterSpec_ScaleType = 0 + // Scales the feasible space to (0, 1) linearly. + ParameterSpec_UNIT_LINEAR_SCALE ParameterSpec_ScaleType = 1 + // Scales the feasible space logarithmically to (0, 1). The entire feasible + // space must be strictly positive. + ParameterSpec_UNIT_LOG_SCALE ParameterSpec_ScaleType = 2 + // Scales the feasible space "reverse" logarithmically to (0, 1). The result + // is that values close to the top of the feasible space are spread out more + // than points near the bottom. The entire feasible space must be strictly + // positive. + ParameterSpec_UNIT_REVERSE_LOG_SCALE ParameterSpec_ScaleType = 3 +) + +var ParameterSpec_ScaleType_name = map[int32]string{ + 0: "NONE", + 1: "UNIT_LINEAR_SCALE", + 2: "UNIT_LOG_SCALE", + 3: "UNIT_REVERSE_LOG_SCALE", +} +var ParameterSpec_ScaleType_value = map[string]int32{ + "NONE": 0, + "UNIT_LINEAR_SCALE": 1, + "UNIT_LOG_SCALE": 2, + "UNIT_REVERSE_LOG_SCALE": 3, +} + +func (x ParameterSpec_ScaleType) String() string { + return proto.EnumName(ParameterSpec_ScaleType_name, int32(x)) +} +func (ParameterSpec_ScaleType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{2, 1} } + +// The format used to separate data instances in the source files. +type PredictionInput_DataFormat int32 + +const ( + // Unspecified format. + PredictionInput_DATA_FORMAT_UNSPECIFIED PredictionInput_DataFormat = 0 + // The source file is a text file with instances separated by the + // new-line character. + PredictionInput_TEXT PredictionInput_DataFormat = 1 + // The source file is a TFRecord file. + PredictionInput_TF_RECORD PredictionInput_DataFormat = 2 + // The source file is a GZIP-compressed TFRecord file. + PredictionInput_TF_RECORD_GZIP PredictionInput_DataFormat = 3 +) + +var PredictionInput_DataFormat_name = map[int32]string{ + 0: "DATA_FORMAT_UNSPECIFIED", + 1: "TEXT", + 2: "TF_RECORD", + 3: "TF_RECORD_GZIP", +} +var PredictionInput_DataFormat_value = map[string]int32{ + "DATA_FORMAT_UNSPECIFIED": 0, + "TEXT": 1, + "TF_RECORD": 2, + "TF_RECORD_GZIP": 3, +} + +func (x PredictionInput_DataFormat) String() string { + return proto.EnumName(PredictionInput_DataFormat_name, int32(x)) +} +func (PredictionInput_DataFormat) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{5, 0} +} + +// Describes the job state. +type Job_State int32 + +const ( + // The job state is unspecified. + Job_STATE_UNSPECIFIED Job_State = 0 + // The job has been just created and processing has not yet begun. + Job_QUEUED Job_State = 1 + // The service is preparing to run the job. + Job_PREPARING Job_State = 2 + // The job is in progress. + Job_RUNNING Job_State = 3 + // The job completed successfully. + Job_SUCCEEDED Job_State = 4 + // The job failed. + // `error_message` should contain the details of the failure. + Job_FAILED Job_State = 5 + // The job is being cancelled. + // `error_message` should describe the reason for the cancellation. + Job_CANCELLING Job_State = 6 + // The job has been cancelled. + // `error_message` should describe the reason for the cancellation. + Job_CANCELLED Job_State = 7 +) + +var Job_State_name = map[int32]string{ + 0: "STATE_UNSPECIFIED", + 1: "QUEUED", + 2: "PREPARING", + 3: "RUNNING", + 4: "SUCCEEDED", + 5: "FAILED", + 6: "CANCELLING", + 7: "CANCELLED", +} +var Job_State_value = map[string]int32{ + "STATE_UNSPECIFIED": 0, + "QUEUED": 1, + "PREPARING": 2, + "RUNNING": 3, + "SUCCEEDED": 4, + "FAILED": 5, + "CANCELLING": 6, + "CANCELLED": 7, +} + +func (x Job_State) String() string { + return proto.EnumName(Job_State_name, int32(x)) +} +func (Job_State) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{7, 0} } + +// Represents input parameters for a training job. +type TrainingInput struct { + // Required. Specifies the machine types, the number of replicas for workers + // and parameter servers. + ScaleTier TrainingInput_ScaleTier `protobuf:"varint,1,opt,name=scale_tier,json=scaleTier,enum=google.cloud.ml.v1.TrainingInput_ScaleTier" json:"scale_tier,omitempty"` + // Optional. Specifies the type of virtual machine to use for your training + // job's master worker. + // + // The following types are supported: + // + //
+ //
standard
+ //
+ // A basic machine configuration suitable for training simple models with + // small to moderate datasets. + //
+ //
large_model
+ //
+ // A machine with a lot of memory, specially suited for parameter servers + // when your model is large (having many hidden layers or layers with very + // large numbers of nodes). + //
+ //
complex_model_s
+ //
+ // A machine suitable for the master and workers of the cluster when your + // model requires more computation than the standard machine can handle + // satisfactorily. + //
+ //
complex_model_m
+ //
+ // A machine with roughly twice the number of cores and roughly double the + // memory of complex_model_s. + //
+ //
complex_model_l
+ //
+ // A machine with roughly twice the number of cores and roughly double the + // memory of complex_model_m. + //
+ //
standard_gpu
+ //
+ // A machine equivalent to standard that + // also includes a + // + // GPU that you can use in your trainer. + //
+ //
complex_model_m_gpu
+ //
+ // A machine equivalent to + // coplex_model_m that also includes + // four GPUs. + //
+ //
+ // + // You must set this value when `scaleTier` is set to `CUSTOM`. + MasterType string `protobuf:"bytes,2,opt,name=master_type,json=masterType" json:"master_type,omitempty"` + // Optional. Specifies the type of virtual machine to use for your training + // job's worker nodes. + // + // The supported values are the same as those described in the entry for + // `masterType`. + // + // This value must be present when `scaleTier` is set to `CUSTOM` and + // `workerCount` is greater than zero. + WorkerType string `protobuf:"bytes,3,opt,name=worker_type,json=workerType" json:"worker_type,omitempty"` + // Optional. Specifies the type of virtual machine to use for your training + // job's parameter server. + // + // The supported values are the same as those described in the entry for + // `master_type`. + // + // This value must be present when `scaleTier` is set to `CUSTOM` and + // `parameter_server_count` is greater than zero. + ParameterServerType string `protobuf:"bytes,4,opt,name=parameter_server_type,json=parameterServerType" json:"parameter_server_type,omitempty"` + // Optional. The number of worker replicas to use for the training job. Each + // replica in the cluster will be of the type specified in `worker_type`. + // + // This value can only be used when `scale_tier` is set to `CUSTOM`. If you + // set this value, you must also set `worker_type`. + WorkerCount int64 `protobuf:"varint,5,opt,name=worker_count,json=workerCount" json:"worker_count,omitempty"` + // Optional. The number of parameter server replicas to use for the training + // job. Each replica in the cluster will be of the type specified in + // `parameter_server_type`. + // + // This value can only be used when `scale_tier` is set to `CUSTOM`.If you + // set this value, you must also set `parameter_server_type`. + ParameterServerCount int64 `protobuf:"varint,6,opt,name=parameter_server_count,json=parameterServerCount" json:"parameter_server_count,omitempty"` + // Required. The Google Cloud Storage location of the packages with + // the training program and any additional dependencies. + PackageUris []string `protobuf:"bytes,7,rep,name=package_uris,json=packageUris" json:"package_uris,omitempty"` + // Required. The Python module name to run after installing the packages. + PythonModule string `protobuf:"bytes,8,opt,name=python_module,json=pythonModule" json:"python_module,omitempty"` + // Optional. Command line arguments to pass to the program. + Args []string `protobuf:"bytes,10,rep,name=args" json:"args,omitempty"` + // Optional. The set of Hyperparameters to tune. + Hyperparameters *HyperparameterSpec `protobuf:"bytes,12,opt,name=hyperparameters" json:"hyperparameters,omitempty"` + // Required. The Google Compute Engine region to run the training job in. + Region string `protobuf:"bytes,14,opt,name=region" json:"region,omitempty"` + // Optional. A Google Cloud Storage path in which to store training outputs + // and other data needed for training. This path is passed to your TensorFlow + // program as the 'job_dir' command-line argument. The benefit of specifying + // this field is that Cloud ML validates the path for use in training. + JobDir string `protobuf:"bytes,16,opt,name=job_dir,json=jobDir" json:"job_dir,omitempty"` + // Optional. The Google Cloud ML runtime version to use for training. If not + // set, Google Cloud ML will choose the latest stable version. + RuntimeVersion string `protobuf:"bytes,15,opt,name=runtime_version,json=runtimeVersion" json:"runtime_version,omitempty"` +} + +func (m *TrainingInput) Reset() { *m = TrainingInput{} } +func (m *TrainingInput) String() string { return proto.CompactTextString(m) } +func (*TrainingInput) ProtoMessage() {} +func (*TrainingInput) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *TrainingInput) GetScaleTier() TrainingInput_ScaleTier { + if m != nil { + return m.ScaleTier + } + return TrainingInput_BASIC +} + +func (m *TrainingInput) GetMasterType() string { + if m != nil { + return m.MasterType + } + return "" +} + +func (m *TrainingInput) GetWorkerType() string { + if m != nil { + return m.WorkerType + } + return "" +} + +func (m *TrainingInput) GetParameterServerType() string { + if m != nil { + return m.ParameterServerType + } + return "" +} + +func (m *TrainingInput) GetWorkerCount() int64 { + if m != nil { + return m.WorkerCount + } + return 0 +} + +func (m *TrainingInput) GetParameterServerCount() int64 { + if m != nil { + return m.ParameterServerCount + } + return 0 +} + +func (m *TrainingInput) GetPackageUris() []string { + if m != nil { + return m.PackageUris + } + return nil +} + +func (m *TrainingInput) GetPythonModule() string { + if m != nil { + return m.PythonModule + } + return "" +} + +func (m *TrainingInput) GetArgs() []string { + if m != nil { + return m.Args + } + return nil +} + +func (m *TrainingInput) GetHyperparameters() *HyperparameterSpec { + if m != nil { + return m.Hyperparameters + } + return nil +} + +func (m *TrainingInput) GetRegion() string { + if m != nil { + return m.Region + } + return "" +} + +func (m *TrainingInput) GetJobDir() string { + if m != nil { + return m.JobDir + } + return "" +} + +func (m *TrainingInput) GetRuntimeVersion() string { + if m != nil { + return m.RuntimeVersion + } + return "" +} + +// Represents a set of hyperparameters to optimize. +type HyperparameterSpec struct { + // Required. The type of goal to use for tuning. Available types are + // `MAXIMIZE` and `MINIMIZE`. + // + // Defaults to `MAXIMIZE`. + Goal HyperparameterSpec_GoalType `protobuf:"varint,1,opt,name=goal,enum=google.cloud.ml.v1.HyperparameterSpec_GoalType" json:"goal,omitempty"` + // Required. The set of parameters to tune. + Params []*ParameterSpec `protobuf:"bytes,2,rep,name=params" json:"params,omitempty"` + // Optional. How many training trials should be attempted to optimize + // the specified hyperparameters. + // + // Defaults to one. + MaxTrials int32 `protobuf:"varint,3,opt,name=max_trials,json=maxTrials" json:"max_trials,omitempty"` + // Optional. The number of training trials to run concurrently. + // You can reduce the time it takes to perform hyperparameter tuning by adding + // trials in parallel. However, each trail only benefits from the information + // gained in completed trials. That means that a trial does not get access to + // the results of trials running at the same time, which could reduce the + // quality of the overall optimization. + // + // Each trial will use the same scale tier and machine types. + // + // Defaults to one. + MaxParallelTrials int32 `protobuf:"varint,4,opt,name=max_parallel_trials,json=maxParallelTrials" json:"max_parallel_trials,omitempty"` + // Optional. The Tensorflow summary tag name to use for optimizing trials. For + // current versions of Tensorflow, this tag name should exactly match what is + // shown in Tensorboard, including all scopes. For versions of Tensorflow + // prior to 0.12, this should be only the tag passed to tf.Summary. + // By default, "training/hptuning/metric" will be used. + HyperparameterMetricTag string `protobuf:"bytes,5,opt,name=hyperparameter_metric_tag,json=hyperparameterMetricTag" json:"hyperparameter_metric_tag,omitempty"` +} + +func (m *HyperparameterSpec) Reset() { *m = HyperparameterSpec{} } +func (m *HyperparameterSpec) String() string { return proto.CompactTextString(m) } +func (*HyperparameterSpec) ProtoMessage() {} +func (*HyperparameterSpec) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *HyperparameterSpec) GetGoal() HyperparameterSpec_GoalType { + if m != nil { + return m.Goal + } + return HyperparameterSpec_GOAL_TYPE_UNSPECIFIED +} + +func (m *HyperparameterSpec) GetParams() []*ParameterSpec { + if m != nil { + return m.Params + } + return nil +} + +func (m *HyperparameterSpec) GetMaxTrials() int32 { + if m != nil { + return m.MaxTrials + } + return 0 +} + +func (m *HyperparameterSpec) GetMaxParallelTrials() int32 { + if m != nil { + return m.MaxParallelTrials + } + return 0 +} + +func (m *HyperparameterSpec) GetHyperparameterMetricTag() string { + if m != nil { + return m.HyperparameterMetricTag + } + return "" +} + +// Represents a single hyperparameter to optimize. +type ParameterSpec struct { + // Required. The parameter name must be unique amongst all ParameterConfigs in + // a HyperparameterSpec message. E.g., "learning_rate". + ParameterName string `protobuf:"bytes,1,opt,name=parameter_name,json=parameterName" json:"parameter_name,omitempty"` + // Required. The type of the parameter. + Type ParameterSpec_ParameterType `protobuf:"varint,4,opt,name=type,enum=google.cloud.ml.v1.ParameterSpec_ParameterType" json:"type,omitempty"` + // Required if type is `DOUBLE` or `INTEGER`. This field + // should be unset if type is `CATEGORICAL`. This value should be integers if + // type is INTEGER. + MinValue float64 `protobuf:"fixed64,2,opt,name=min_value,json=minValue" json:"min_value,omitempty"` + // Required if typeis `DOUBLE` or `INTEGER`. This field + // should be unset if type is `CATEGORICAL`. This value should be integers if + // type is `INTEGER`. + MaxValue float64 `protobuf:"fixed64,3,opt,name=max_value,json=maxValue" json:"max_value,omitempty"` + // Required if type is `CATEGORICAL`. The list of possible categories. + CategoricalValues []string `protobuf:"bytes,5,rep,name=categorical_values,json=categoricalValues" json:"categorical_values,omitempty"` + // Required if type is `DISCRETE`. + // A list of feasible points. + // The list should be in strictly increasing order. For instance, this + // parameter might have possible settings of 1.5, 2.5, and 4.0. This list + // should not contain more than 1,000 values. + DiscreteValues []float64 `protobuf:"fixed64,6,rep,packed,name=discrete_values,json=discreteValues" json:"discrete_values,omitempty"` + // Optional. How the parameter should be scaled to the hypercube. + // Leave unset for categorical parameters. + // Some kind of scaling is strongly recommended for real or integral + // parameters (e.g., `UNIT_LINEAR_SCALE`). + ScaleType ParameterSpec_ScaleType `protobuf:"varint,7,opt,name=scale_type,json=scaleType,enum=google.cloud.ml.v1.ParameterSpec_ScaleType" json:"scale_type,omitempty"` +} + +func (m *ParameterSpec) Reset() { *m = ParameterSpec{} } +func (m *ParameterSpec) String() string { return proto.CompactTextString(m) } +func (*ParameterSpec) ProtoMessage() {} +func (*ParameterSpec) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *ParameterSpec) GetParameterName() string { + if m != nil { + return m.ParameterName + } + return "" +} + +func (m *ParameterSpec) GetType() ParameterSpec_ParameterType { + if m != nil { + return m.Type + } + return ParameterSpec_PARAMETER_TYPE_UNSPECIFIED +} + +func (m *ParameterSpec) GetMinValue() float64 { + if m != nil { + return m.MinValue + } + return 0 +} + +func (m *ParameterSpec) GetMaxValue() float64 { + if m != nil { + return m.MaxValue + } + return 0 +} + +func (m *ParameterSpec) GetCategoricalValues() []string { + if m != nil { + return m.CategoricalValues + } + return nil +} + +func (m *ParameterSpec) GetDiscreteValues() []float64 { + if m != nil { + return m.DiscreteValues + } + return nil +} + +func (m *ParameterSpec) GetScaleType() ParameterSpec_ScaleType { + if m != nil { + return m.ScaleType + } + return ParameterSpec_NONE +} + +// Represents the result of a single hyperparameter tuning trial from a +// training job. The TrainingOutput object that is returned on successful +// completion of a training job with hyperparameter tuning includes a list +// of HyperparameterOutput objects, one for each successful trial. +type HyperparameterOutput struct { + // The trial id for these results. + TrialId string `protobuf:"bytes,1,opt,name=trial_id,json=trialId" json:"trial_id,omitempty"` + // The hyperparameters given to this trial. + Hyperparameters map[string]string `protobuf:"bytes,2,rep,name=hyperparameters" json:"hyperparameters,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // The final objective metric seen for this trial. + FinalMetric *HyperparameterOutput_HyperparameterMetric `protobuf:"bytes,3,opt,name=final_metric,json=finalMetric" json:"final_metric,omitempty"` + // All recorded object metrics for this trial. + AllMetrics []*HyperparameterOutput_HyperparameterMetric `protobuf:"bytes,4,rep,name=all_metrics,json=allMetrics" json:"all_metrics,omitempty"` +} + +func (m *HyperparameterOutput) Reset() { *m = HyperparameterOutput{} } +func (m *HyperparameterOutput) String() string { return proto.CompactTextString(m) } +func (*HyperparameterOutput) ProtoMessage() {} +func (*HyperparameterOutput) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *HyperparameterOutput) GetTrialId() string { + if m != nil { + return m.TrialId + } + return "" +} + +func (m *HyperparameterOutput) GetHyperparameters() map[string]string { + if m != nil { + return m.Hyperparameters + } + return nil +} + +func (m *HyperparameterOutput) GetFinalMetric() *HyperparameterOutput_HyperparameterMetric { + if m != nil { + return m.FinalMetric + } + return nil +} + +func (m *HyperparameterOutput) GetAllMetrics() []*HyperparameterOutput_HyperparameterMetric { + if m != nil { + return m.AllMetrics + } + return nil +} + +// An observed value of a metric. +type HyperparameterOutput_HyperparameterMetric struct { + // The global training step for this metric. + TrainingStep int64 `protobuf:"varint,1,opt,name=training_step,json=trainingStep" json:"training_step,omitempty"` + // The objective value at this training step. + ObjectiveValue float64 `protobuf:"fixed64,2,opt,name=objective_value,json=objectiveValue" json:"objective_value,omitempty"` +} + +func (m *HyperparameterOutput_HyperparameterMetric) Reset() { + *m = HyperparameterOutput_HyperparameterMetric{} +} +func (m *HyperparameterOutput_HyperparameterMetric) String() string { return proto.CompactTextString(m) } +func (*HyperparameterOutput_HyperparameterMetric) ProtoMessage() {} +func (*HyperparameterOutput_HyperparameterMetric) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{3, 0} +} + +func (m *HyperparameterOutput_HyperparameterMetric) GetTrainingStep() int64 { + if m != nil { + return m.TrainingStep + } + return 0 +} + +func (m *HyperparameterOutput_HyperparameterMetric) GetObjectiveValue() float64 { + if m != nil { + return m.ObjectiveValue + } + return 0 +} + +// Represents results of a training job. Output only. +type TrainingOutput struct { + // The number of hyperparameter tuning trials that completed successfully. + // Only set for hyperparameter tuning jobs. + CompletedTrialCount int64 `protobuf:"varint,1,opt,name=completed_trial_count,json=completedTrialCount" json:"completed_trial_count,omitempty"` + // Results for individual Hyperparameter trials. + // Only set for hyperparameter tuning jobs. + Trials []*HyperparameterOutput `protobuf:"bytes,2,rep,name=trials" json:"trials,omitempty"` + // The amount of ML units consumed by the job. + ConsumedMlUnits float64 `protobuf:"fixed64,3,opt,name=consumed_ml_units,json=consumedMlUnits" json:"consumed_ml_units,omitempty"` + // Whether this job is a hyperparameter tuning job. + IsHyperparameterTuningJob bool `protobuf:"varint,4,opt,name=is_hyperparameter_tuning_job,json=isHyperparameterTuningJob" json:"is_hyperparameter_tuning_job,omitempty"` +} + +func (m *TrainingOutput) Reset() { *m = TrainingOutput{} } +func (m *TrainingOutput) String() string { return proto.CompactTextString(m) } +func (*TrainingOutput) ProtoMessage() {} +func (*TrainingOutput) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *TrainingOutput) GetCompletedTrialCount() int64 { + if m != nil { + return m.CompletedTrialCount + } + return 0 +} + +func (m *TrainingOutput) GetTrials() []*HyperparameterOutput { + if m != nil { + return m.Trials + } + return nil +} + +func (m *TrainingOutput) GetConsumedMlUnits() float64 { + if m != nil { + return m.ConsumedMlUnits + } + return 0 +} + +func (m *TrainingOutput) GetIsHyperparameterTuningJob() bool { + if m != nil { + return m.IsHyperparameterTuningJob + } + return false +} + +// Represents input parameters for a prediction job. +type PredictionInput struct { + // Required. The model or the version to use for prediction. + // + // Types that are valid to be assigned to ModelVersion: + // *PredictionInput_ModelName + // *PredictionInput_VersionName + // *PredictionInput_Uri + ModelVersion isPredictionInput_ModelVersion `protobuf_oneof:"model_version"` + // Required. The format of the input data files. + DataFormat PredictionInput_DataFormat `protobuf:"varint,3,opt,name=data_format,json=dataFormat,enum=google.cloud.ml.v1.PredictionInput_DataFormat" json:"data_format,omitempty"` + // Required. The Google Cloud Storage location of the input data files. + // May contain wildcards. + InputPaths []string `protobuf:"bytes,4,rep,name=input_paths,json=inputPaths" json:"input_paths,omitempty"` + // Required. The output Google Cloud Storage location. + OutputPath string `protobuf:"bytes,5,opt,name=output_path,json=outputPath" json:"output_path,omitempty"` + // Optional. The maximum number of workers to be used for parallel processing. + // Defaults to 10 if not specified. + MaxWorkerCount int64 `protobuf:"varint,6,opt,name=max_worker_count,json=maxWorkerCount" json:"max_worker_count,omitempty"` + // Required. The Google Compute Engine region to run the prediction job in. + Region string `protobuf:"bytes,7,opt,name=region" json:"region,omitempty"` + // Optional. The Google Cloud ML runtime version to use for this batch + // prediction. If not set, Google Cloud ML will pick the runtime version used + // during the CreateVersion request for this model version, or choose the + // latest stable version when model version information is not available + // such as when the model is specified by uri. + RuntimeVersion string `protobuf:"bytes,8,opt,name=runtime_version,json=runtimeVersion" json:"runtime_version,omitempty"` +} + +func (m *PredictionInput) Reset() { *m = PredictionInput{} } +func (m *PredictionInput) String() string { return proto.CompactTextString(m) } +func (*PredictionInput) ProtoMessage() {} +func (*PredictionInput) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +type isPredictionInput_ModelVersion interface { + isPredictionInput_ModelVersion() +} + +type PredictionInput_ModelName struct { + ModelName string `protobuf:"bytes,1,opt,name=model_name,json=modelName,oneof"` +} +type PredictionInput_VersionName struct { + VersionName string `protobuf:"bytes,2,opt,name=version_name,json=versionName,oneof"` +} +type PredictionInput_Uri struct { + Uri string `protobuf:"bytes,9,opt,name=uri,oneof"` +} + +func (*PredictionInput_ModelName) isPredictionInput_ModelVersion() {} +func (*PredictionInput_VersionName) isPredictionInput_ModelVersion() {} +func (*PredictionInput_Uri) isPredictionInput_ModelVersion() {} + +func (m *PredictionInput) GetModelVersion() isPredictionInput_ModelVersion { + if m != nil { + return m.ModelVersion + } + return nil +} + +func (m *PredictionInput) GetModelName() string { + if x, ok := m.GetModelVersion().(*PredictionInput_ModelName); ok { + return x.ModelName + } + return "" +} + +func (m *PredictionInput) GetVersionName() string { + if x, ok := m.GetModelVersion().(*PredictionInput_VersionName); ok { + return x.VersionName + } + return "" +} + +func (m *PredictionInput) GetUri() string { + if x, ok := m.GetModelVersion().(*PredictionInput_Uri); ok { + return x.Uri + } + return "" +} + +func (m *PredictionInput) GetDataFormat() PredictionInput_DataFormat { + if m != nil { + return m.DataFormat + } + return PredictionInput_DATA_FORMAT_UNSPECIFIED +} + +func (m *PredictionInput) GetInputPaths() []string { + if m != nil { + return m.InputPaths + } + return nil +} + +func (m *PredictionInput) GetOutputPath() string { + if m != nil { + return m.OutputPath + } + return "" +} + +func (m *PredictionInput) GetMaxWorkerCount() int64 { + if m != nil { + return m.MaxWorkerCount + } + return 0 +} + +func (m *PredictionInput) GetRegion() string { + if m != nil { + return m.Region + } + return "" +} + +func (m *PredictionInput) GetRuntimeVersion() string { + if m != nil { + return m.RuntimeVersion + } + return "" +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*PredictionInput) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _PredictionInput_OneofMarshaler, _PredictionInput_OneofUnmarshaler, _PredictionInput_OneofSizer, []interface{}{ + (*PredictionInput_ModelName)(nil), + (*PredictionInput_VersionName)(nil), + (*PredictionInput_Uri)(nil), + } +} + +func _PredictionInput_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*PredictionInput) + // model_version + switch x := m.ModelVersion.(type) { + case *PredictionInput_ModelName: + b.EncodeVarint(1<<3 | proto.WireBytes) + b.EncodeStringBytes(x.ModelName) + case *PredictionInput_VersionName: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeStringBytes(x.VersionName) + case *PredictionInput_Uri: + b.EncodeVarint(9<<3 | proto.WireBytes) + b.EncodeStringBytes(x.Uri) + case nil: + default: + return fmt.Errorf("PredictionInput.ModelVersion has unexpected type %T", x) + } + return nil +} + +func _PredictionInput_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*PredictionInput) + switch tag { + case 1: // model_version.model_name + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.ModelVersion = &PredictionInput_ModelName{x} + return true, err + case 2: // model_version.version_name + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.ModelVersion = &PredictionInput_VersionName{x} + return true, err + case 9: // model_version.uri + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.ModelVersion = &PredictionInput_Uri{x} + return true, err + default: + return false, nil + } +} + +func _PredictionInput_OneofSizer(msg proto.Message) (n int) { + m := msg.(*PredictionInput) + // model_version + switch x := m.ModelVersion.(type) { + case *PredictionInput_ModelName: + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.ModelName))) + n += len(x.ModelName) + case *PredictionInput_VersionName: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.VersionName))) + n += len(x.VersionName) + case *PredictionInput_Uri: + n += proto.SizeVarint(9<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Uri))) + n += len(x.Uri) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Represents results of a prediction job. +type PredictionOutput struct { + // The output Google Cloud Storage location provided at the job creation time. + OutputPath string `protobuf:"bytes,1,opt,name=output_path,json=outputPath" json:"output_path,omitempty"` + // The number of generated predictions. + PredictionCount int64 `protobuf:"varint,2,opt,name=prediction_count,json=predictionCount" json:"prediction_count,omitempty"` + // The number of data instances which resulted in errors. + ErrorCount int64 `protobuf:"varint,3,opt,name=error_count,json=errorCount" json:"error_count,omitempty"` + // Node hours used by the batch prediction job. + NodeHours float64 `protobuf:"fixed64,4,opt,name=node_hours,json=nodeHours" json:"node_hours,omitempty"` +} + +func (m *PredictionOutput) Reset() { *m = PredictionOutput{} } +func (m *PredictionOutput) String() string { return proto.CompactTextString(m) } +func (*PredictionOutput) ProtoMessage() {} +func (*PredictionOutput) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *PredictionOutput) GetOutputPath() string { + if m != nil { + return m.OutputPath + } + return "" +} + +func (m *PredictionOutput) GetPredictionCount() int64 { + if m != nil { + return m.PredictionCount + } + return 0 +} + +func (m *PredictionOutput) GetErrorCount() int64 { + if m != nil { + return m.ErrorCount + } + return 0 +} + +func (m *PredictionOutput) GetNodeHours() float64 { + if m != nil { + return m.NodeHours + } + return 0 +} + +// Represents a training or prediction job. +type Job struct { + // Required. The user-specified id of the job. + JobId string `protobuf:"bytes,1,opt,name=job_id,json=jobId" json:"job_id,omitempty"` + // Required. Parameters to create a job. + // + // Types that are valid to be assigned to Input: + // *Job_TrainingInput + // *Job_PredictionInput + Input isJob_Input `protobuf_oneof:"input"` + // Output only. When the job was created. + CreateTime *google_protobuf2.Timestamp `protobuf:"bytes,4,opt,name=create_time,json=createTime" json:"create_time,omitempty"` + // Output only. When the job processing was started. + StartTime *google_protobuf2.Timestamp `protobuf:"bytes,5,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + // Output only. When the job processing was completed. + EndTime *google_protobuf2.Timestamp `protobuf:"bytes,6,opt,name=end_time,json=endTime" json:"end_time,omitempty"` + // Output only. The detailed state of a job. + State Job_State `protobuf:"varint,7,opt,name=state,enum=google.cloud.ml.v1.Job_State" json:"state,omitempty"` + // Output only. The details of a failure or a cancellation. + ErrorMessage string `protobuf:"bytes,8,opt,name=error_message,json=errorMessage" json:"error_message,omitempty"` + // Output only. The current result of the job. + // + // Types that are valid to be assigned to Output: + // *Job_TrainingOutput + // *Job_PredictionOutput + Output isJob_Output `protobuf_oneof:"output"` +} + +func (m *Job) Reset() { *m = Job{} } +func (m *Job) String() string { return proto.CompactTextString(m) } +func (*Job) ProtoMessage() {} +func (*Job) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +type isJob_Input interface { + isJob_Input() +} +type isJob_Output interface { + isJob_Output() +} + +type Job_TrainingInput struct { + TrainingInput *TrainingInput `protobuf:"bytes,2,opt,name=training_input,json=trainingInput,oneof"` +} +type Job_PredictionInput struct { + PredictionInput *PredictionInput `protobuf:"bytes,3,opt,name=prediction_input,json=predictionInput,oneof"` +} +type Job_TrainingOutput struct { + TrainingOutput *TrainingOutput `protobuf:"bytes,9,opt,name=training_output,json=trainingOutput,oneof"` +} +type Job_PredictionOutput struct { + PredictionOutput *PredictionOutput `protobuf:"bytes,10,opt,name=prediction_output,json=predictionOutput,oneof"` +} + +func (*Job_TrainingInput) isJob_Input() {} +func (*Job_PredictionInput) isJob_Input() {} +func (*Job_TrainingOutput) isJob_Output() {} +func (*Job_PredictionOutput) isJob_Output() {} + +func (m *Job) GetInput() isJob_Input { + if m != nil { + return m.Input + } + return nil +} +func (m *Job) GetOutput() isJob_Output { + if m != nil { + return m.Output + } + return nil +} + +func (m *Job) GetJobId() string { + if m != nil { + return m.JobId + } + return "" +} + +func (m *Job) GetTrainingInput() *TrainingInput { + if x, ok := m.GetInput().(*Job_TrainingInput); ok { + return x.TrainingInput + } + return nil +} + +func (m *Job) GetPredictionInput() *PredictionInput { + if x, ok := m.GetInput().(*Job_PredictionInput); ok { + return x.PredictionInput + } + return nil +} + +func (m *Job) GetCreateTime() *google_protobuf2.Timestamp { + if m != nil { + return m.CreateTime + } + return nil +} + +func (m *Job) GetStartTime() *google_protobuf2.Timestamp { + if m != nil { + return m.StartTime + } + return nil +} + +func (m *Job) GetEndTime() *google_protobuf2.Timestamp { + if m != nil { + return m.EndTime + } + return nil +} + +func (m *Job) GetState() Job_State { + if m != nil { + return m.State + } + return Job_STATE_UNSPECIFIED +} + +func (m *Job) GetErrorMessage() string { + if m != nil { + return m.ErrorMessage + } + return "" +} + +func (m *Job) GetTrainingOutput() *TrainingOutput { + if x, ok := m.GetOutput().(*Job_TrainingOutput); ok { + return x.TrainingOutput + } + return nil +} + +func (m *Job) GetPredictionOutput() *PredictionOutput { + if x, ok := m.GetOutput().(*Job_PredictionOutput); ok { + return x.PredictionOutput + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Job) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _Job_OneofMarshaler, _Job_OneofUnmarshaler, _Job_OneofSizer, []interface{}{ + (*Job_TrainingInput)(nil), + (*Job_PredictionInput)(nil), + (*Job_TrainingOutput)(nil), + (*Job_PredictionOutput)(nil), + } +} + +func _Job_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Job) + // input + switch x := m.Input.(type) { + case *Job_TrainingInput: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.TrainingInput); err != nil { + return err + } + case *Job_PredictionInput: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.PredictionInput); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("Job.Input has unexpected type %T", x) + } + // output + switch x := m.Output.(type) { + case *Job_TrainingOutput: + b.EncodeVarint(9<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.TrainingOutput); err != nil { + return err + } + case *Job_PredictionOutput: + b.EncodeVarint(10<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.PredictionOutput); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("Job.Output has unexpected type %T", x) + } + return nil +} + +func _Job_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Job) + switch tag { + case 2: // input.training_input + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(TrainingInput) + err := b.DecodeMessage(msg) + m.Input = &Job_TrainingInput{msg} + return true, err + case 3: // input.prediction_input + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(PredictionInput) + err := b.DecodeMessage(msg) + m.Input = &Job_PredictionInput{msg} + return true, err + case 9: // output.training_output + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(TrainingOutput) + err := b.DecodeMessage(msg) + m.Output = &Job_TrainingOutput{msg} + return true, err + case 10: // output.prediction_output + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(PredictionOutput) + err := b.DecodeMessage(msg) + m.Output = &Job_PredictionOutput{msg} + return true, err + default: + return false, nil + } +} + +func _Job_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Job) + // input + switch x := m.Input.(type) { + case *Job_TrainingInput: + s := proto.Size(x.TrainingInput) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Job_PredictionInput: + s := proto.Size(x.PredictionInput) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + // output + switch x := m.Output.(type) { + case *Job_TrainingOutput: + s := proto.Size(x.TrainingOutput) + n += proto.SizeVarint(9<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Job_PredictionOutput: + s := proto.Size(x.PredictionOutput) + n += proto.SizeVarint(10<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Request message for the CreateJob method. +type CreateJobRequest struct { + // Required. The project name. + // + // Authorization: requires `Editor` role on the specified project. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // Required. The job to create. + Job *Job `protobuf:"bytes,2,opt,name=job" json:"job,omitempty"` +} + +func (m *CreateJobRequest) Reset() { *m = CreateJobRequest{} } +func (m *CreateJobRequest) String() string { return proto.CompactTextString(m) } +func (*CreateJobRequest) ProtoMessage() {} +func (*CreateJobRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *CreateJobRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *CreateJobRequest) GetJob() *Job { + if m != nil { + return m.Job + } + return nil +} + +// Request message for the ListJobs method. +type ListJobsRequest struct { + // Required. The name of the project for which to list jobs. + // + // Authorization: requires `Viewer` role on the specified project. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // Optional. Specifies the subset of jobs to retrieve. + Filter string `protobuf:"bytes,2,opt,name=filter" json:"filter,omitempty"` + // Optional. A page token to request the next page of results. + // + // You get the token from the `next_page_token` field of the response from + // the previous call. + PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` + // Optional. The number of jobs to retrieve per "page" of results. If there + // are more remaining results than this number, the response message will + // contain a valid value in the `next_page_token` field. + // + // The default value is 20, and the maximum page size is 100. + PageSize int32 `protobuf:"varint,5,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` +} + +func (m *ListJobsRequest) Reset() { *m = ListJobsRequest{} } +func (m *ListJobsRequest) String() string { return proto.CompactTextString(m) } +func (*ListJobsRequest) ProtoMessage() {} +func (*ListJobsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *ListJobsRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *ListJobsRequest) GetFilter() string { + if m != nil { + return m.Filter + } + return "" +} + +func (m *ListJobsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +func (m *ListJobsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +// Response message for the ListJobs method. +type ListJobsResponse struct { + // The list of jobs. + Jobs []*Job `protobuf:"bytes,1,rep,name=jobs" json:"jobs,omitempty"` + // Optional. Pass this token as the `page_token` field of the request for a + // subsequent call. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListJobsResponse) Reset() { *m = ListJobsResponse{} } +func (m *ListJobsResponse) String() string { return proto.CompactTextString(m) } +func (*ListJobsResponse) ProtoMessage() {} +func (*ListJobsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *ListJobsResponse) GetJobs() []*Job { + if m != nil { + return m.Jobs + } + return nil +} + +func (m *ListJobsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// Request message for the GetJob method. +type GetJobRequest struct { + // Required. The name of the job to get the description of. + // + // Authorization: requires `Viewer` role on the parent project. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetJobRequest) Reset() { *m = GetJobRequest{} } +func (m *GetJobRequest) String() string { return proto.CompactTextString(m) } +func (*GetJobRequest) ProtoMessage() {} +func (*GetJobRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } + +func (m *GetJobRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Request message for the CancelJob method. +type CancelJobRequest struct { + // Required. The name of the job to cancel. + // + // Authorization: requires `Editor` role on the parent project. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *CancelJobRequest) Reset() { *m = CancelJobRequest{} } +func (m *CancelJobRequest) String() string { return proto.CompactTextString(m) } +func (*CancelJobRequest) ProtoMessage() {} +func (*CancelJobRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } + +func (m *CancelJobRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func init() { + proto.RegisterType((*TrainingInput)(nil), "google.cloud.ml.v1.TrainingInput") + proto.RegisterType((*HyperparameterSpec)(nil), "google.cloud.ml.v1.HyperparameterSpec") + proto.RegisterType((*ParameterSpec)(nil), "google.cloud.ml.v1.ParameterSpec") + proto.RegisterType((*HyperparameterOutput)(nil), "google.cloud.ml.v1.HyperparameterOutput") + proto.RegisterType((*HyperparameterOutput_HyperparameterMetric)(nil), "google.cloud.ml.v1.HyperparameterOutput.HyperparameterMetric") + proto.RegisterType((*TrainingOutput)(nil), "google.cloud.ml.v1.TrainingOutput") + proto.RegisterType((*PredictionInput)(nil), "google.cloud.ml.v1.PredictionInput") + proto.RegisterType((*PredictionOutput)(nil), "google.cloud.ml.v1.PredictionOutput") + proto.RegisterType((*Job)(nil), "google.cloud.ml.v1.Job") + proto.RegisterType((*CreateJobRequest)(nil), "google.cloud.ml.v1.CreateJobRequest") + proto.RegisterType((*ListJobsRequest)(nil), "google.cloud.ml.v1.ListJobsRequest") + proto.RegisterType((*ListJobsResponse)(nil), "google.cloud.ml.v1.ListJobsResponse") + proto.RegisterType((*GetJobRequest)(nil), "google.cloud.ml.v1.GetJobRequest") + proto.RegisterType((*CancelJobRequest)(nil), "google.cloud.ml.v1.CancelJobRequest") + proto.RegisterEnum("google.cloud.ml.v1.TrainingInput_ScaleTier", TrainingInput_ScaleTier_name, TrainingInput_ScaleTier_value) + proto.RegisterEnum("google.cloud.ml.v1.HyperparameterSpec_GoalType", HyperparameterSpec_GoalType_name, HyperparameterSpec_GoalType_value) + proto.RegisterEnum("google.cloud.ml.v1.ParameterSpec_ParameterType", ParameterSpec_ParameterType_name, ParameterSpec_ParameterType_value) + proto.RegisterEnum("google.cloud.ml.v1.ParameterSpec_ScaleType", ParameterSpec_ScaleType_name, ParameterSpec_ScaleType_value) + proto.RegisterEnum("google.cloud.ml.v1.PredictionInput_DataFormat", PredictionInput_DataFormat_name, PredictionInput_DataFormat_value) + proto.RegisterEnum("google.cloud.ml.v1.Job_State", Job_State_name, Job_State_value) +} + +// 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 + +// Client API for JobService service + +type JobServiceClient interface { + // Creates a training or a batch prediction job. + CreateJob(ctx context.Context, in *CreateJobRequest, opts ...grpc.CallOption) (*Job, error) + // Lists the jobs in the project. + ListJobs(ctx context.Context, in *ListJobsRequest, opts ...grpc.CallOption) (*ListJobsResponse, error) + // Describes a job. + GetJob(ctx context.Context, in *GetJobRequest, opts ...grpc.CallOption) (*Job, error) + // Cancels a running job. + CancelJob(ctx context.Context, in *CancelJobRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) +} + +type jobServiceClient struct { + cc *grpc.ClientConn +} + +func NewJobServiceClient(cc *grpc.ClientConn) JobServiceClient { + return &jobServiceClient{cc} +} + +func (c *jobServiceClient) CreateJob(ctx context.Context, in *CreateJobRequest, opts ...grpc.CallOption) (*Job, error) { + out := new(Job) + err := grpc.Invoke(ctx, "/google.cloud.ml.v1.JobService/CreateJob", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *jobServiceClient) ListJobs(ctx context.Context, in *ListJobsRequest, opts ...grpc.CallOption) (*ListJobsResponse, error) { + out := new(ListJobsResponse) + err := grpc.Invoke(ctx, "/google.cloud.ml.v1.JobService/ListJobs", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *jobServiceClient) GetJob(ctx context.Context, in *GetJobRequest, opts ...grpc.CallOption) (*Job, error) { + out := new(Job) + err := grpc.Invoke(ctx, "/google.cloud.ml.v1.JobService/GetJob", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *jobServiceClient) CancelJob(ctx context.Context, in *CancelJobRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { + out := new(google_protobuf1.Empty) + err := grpc.Invoke(ctx, "/google.cloud.ml.v1.JobService/CancelJob", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for JobService service + +type JobServiceServer interface { + // Creates a training or a batch prediction job. + CreateJob(context.Context, *CreateJobRequest) (*Job, error) + // Lists the jobs in the project. + ListJobs(context.Context, *ListJobsRequest) (*ListJobsResponse, error) + // Describes a job. + GetJob(context.Context, *GetJobRequest) (*Job, error) + // Cancels a running job. + CancelJob(context.Context, *CancelJobRequest) (*google_protobuf1.Empty, error) +} + +func RegisterJobServiceServer(s *grpc.Server, srv JobServiceServer) { + s.RegisterService(&_JobService_serviceDesc, srv) +} + +func _JobService_CreateJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateJobRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(JobServiceServer).CreateJob(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.ml.v1.JobService/CreateJob", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(JobServiceServer).CreateJob(ctx, req.(*CreateJobRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _JobService_ListJobs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListJobsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(JobServiceServer).ListJobs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.ml.v1.JobService/ListJobs", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(JobServiceServer).ListJobs(ctx, req.(*ListJobsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _JobService_GetJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetJobRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(JobServiceServer).GetJob(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.ml.v1.JobService/GetJob", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(JobServiceServer).GetJob(ctx, req.(*GetJobRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _JobService_CancelJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CancelJobRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(JobServiceServer).CancelJob(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.ml.v1.JobService/CancelJob", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(JobServiceServer).CancelJob(ctx, req.(*CancelJobRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _JobService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.cloud.ml.v1.JobService", + HandlerType: (*JobServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateJob", + Handler: _JobService_CreateJob_Handler, + }, + { + MethodName: "ListJobs", + Handler: _JobService_ListJobs_Handler, + }, + { + MethodName: "GetJob", + Handler: _JobService_GetJob_Handler, + }, + { + MethodName: "CancelJob", + Handler: _JobService_CancelJob_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/cloud/ml/v1/job_service.proto", +} + +func init() { proto.RegisterFile("google/cloud/ml/v1/job_service.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 2070 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x58, 0xdb, 0x6e, 0x1b, 0xc9, + 0x11, 0x15, 0xaf, 0x22, 0x8b, 0x12, 0x39, 0x6e, 0x5b, 0x36, 0x4d, 0xdb, 0x6b, 0x79, 0xe4, 0x38, + 0xb2, 0x17, 0x21, 0x21, 0xed, 0x06, 0xc8, 0x7a, 0xb1, 0x48, 0x28, 0x72, 0x2c, 0x51, 0x10, 0x29, + 0xa6, 0x39, 0x74, 0x36, 0x46, 0x90, 0x49, 0x93, 0x6c, 0xd3, 0x23, 0xcf, 0x2d, 0x33, 0x4d, 0x45, + 0xda, 0x85, 0x81, 0x20, 0x08, 0xf2, 0x03, 0x79, 0x0f, 0xf2, 0x4d, 0xc9, 0x1f, 0x04, 0x01, 0xf2, + 0x01, 0x79, 0x0e, 0x10, 0xf4, 0x85, 0xc3, 0x8b, 0x28, 0xd9, 0x48, 0xde, 0xd8, 0xa7, 0x4e, 0x55, + 0x75, 0x57, 0x55, 0x57, 0xd7, 0x10, 0x9e, 0x8e, 0x7d, 0x7f, 0xec, 0xd0, 0xda, 0xd0, 0xf1, 0x27, + 0xa3, 0x9a, 0xeb, 0xd4, 0xce, 0xf7, 0x6a, 0x67, 0xfe, 0xc0, 0x8a, 0x68, 0x78, 0x6e, 0x0f, 0x69, + 0x35, 0x08, 0x7d, 0xe6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 0x86, 0xcd, 0x85, 0x73, 0xa2, 0x1f, 0x40, 0x71, 0xb6, 0x17, + 0x8f, 0xb8, 0x54, 0x44, 0x3a, 0x8f, 0x37, 0x63, 0xb4, 0x43, 0x5c, 0xca, 0xd3, 0x10, 0xdf, 0xb9, + 0x6b, 0xd2, 0xb0, 0x60, 0x77, 0xb6, 0x92, 0x69, 0xe0, 0xca, 0xe8, 0x01, 0xe4, 0x5d, 0xdb, 0xb3, + 0xce, 0x89, 0x33, 0x91, 0x9d, 0x20, 0x81, 0x73, 0xae, 0xed, 0xbd, 0xe6, 0x6b, 0x21, 0x24, 0x17, + 0x4a, 0x98, 0x52, 0x42, 0x72, 0x21, 0x85, 0x3f, 0x02, 0x34, 0x24, 0x8c, 0x8e, 0xfd, 0xd0, 0x1e, + 0x12, 0x47, 0x92, 0xa2, 0x72, 0x46, 0x5c, 0x9e, 0x5b, 0x73, 0x12, 0xc1, 0x8e, 0x78, 0x19, 0x8f, + 0xec, 0x68, 0x18, 0x52, 0x46, 0xa7, 0xdc, 0xec, 0x76, 0x6a, 0x37, 0x81, 0x8b, 0x53, 0x58, 0x11, + 0x67, 0x9d, 0x8e, 0x1f, 0x6e, 0xfd, 0xfa, 0x4e, 0xb7, 0x78, 0x38, 0x59, 0xfa, 0xfc, 0x60, 0xaa, + 0xd3, 0x5d, 0x06, 0x54, 0x1f, 0xcf, 0x85, 0x56, 0xe4, 0xe8, 0x33, 0xa8, 0x74, 0xeb, 0xb8, 0xde, + 0x36, 0x4c, 0x03, 0xaf, 0x4a, 0x14, 0x40, 0xb6, 0x79, 0xda, 0x3f, 0x38, 0xe1, 0x69, 0x2a, 0xc0, + 0x7a, 0xab, 0x63, 0x1a, 0x87, 0x06, 0xd6, 0x92, 0xa8, 0x04, 0x85, 0x46, 0xdd, 0x34, 0x0e, 0x4f, + 0x71, 0xab, 0x51, 0x3f, 0xd1, 0x52, 0x3c, 0x89, 0xcd, 0x56, 0xaf, 0x81, 0x0d, 0xd3, 0xd0,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xf5, 0x43, 0x97, 0x30, 0x71, 0xa8, + 0xe2, 0x7e, 0x75, 0x65, 0x03, 0x5a, 0xdc, 0x53, 0xb5, 0x49, 0x18, 0x79, 0x25, 0xb4, 0x30, 0x8c, + 0xe2, 0xdf, 0x7c, 0x9a, 0xb2, 0xb9, 0xdc, 0x0a, 0x08, 0x7b, 0x27, 0xcb, 0x37, 0x8f, 0x41, 0x40, + 0x5d, 0x8e, 0x70, 0x82, 0x2f, 0xc2, 0x2b, 0x18, 0xea, 0xc9, 0x01, 0x09, 0x71, 0x06, 0xda, 0x05, + 0x8d, 0xf7, 0xe1, 0x85, 0xf1, 0x49, 0x4e, 0x44, 0x45, 0x97, 0x5c, 0xfc, 0x62, 0x6e, 0x82, 0x9a, + 0x4d, 0x17, 0xeb, 0x0b, 0xd3, 0xc5, 0x8a, 0x21, 0x22, 0xb7, 0x72, 0x88, 0x78, 0x0d, 0x30, 0x3b, + 0x06, 0x7a, 0x00, 0xf7, 0x9a, 0x75, 0xb3, 0x6e, 0xbd, 0x3a, 0xc5, 0xed, 0xba, 0xb9, 0xd4, 0x2b, + 0x73, 0x90, 0x36, 0x8d, 0x6f, 0x4d, 0x39, 0x51, 0x98, 0xaf, 0x2c, 0x6c, 0x34, 0x4e, 0x71, 0x53, + 0x4b, 0xf2, 0xf6, 0x16, 0x2f, 0xad, 0xc3, 0x37, 0xad, 0xae, 0x96, 0x3a, 0x28, 0xc1, 0xa6, 0xcc, + 0x97, 0x72, 0xaf, 0xff, 0x25, 0x01, 0xda, 0x2c, 0x80, 0xaa, 0x98, 0x97, 0x22, 0x91, 0xb8, 0x12, + 0x89, 0xe7, 0xa0, 0x05, 0xb1, 0x92, 0x8a, 0x44, 0x52, 0x44, 0xa2, 0x34, 0xc3, 0x65, 0x28, 0x1e, + 0x43, 0x81, 0x86, 0xa1, 0x3f, 0x8d, 0x57, 0x4a, 0xb0, 0x40, 0x40, 0x92, 0xf0, 0x08, 0xc0, 0xf3, + 0x47, 0xd4, 0x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4f, 0xbb, 0xe8, 0x8b, 0xc7, 0x76, 0xce, 0x93, 0x70, 0x54, 0x7b, 0xf1, 0x01, + 0x5d, 0x42, 0x3e, 0x4e, 0xcb, 0x35, 0xf1, 0x5d, 0xca, 0x5a, 0xe5, 0xee, 0x95, 0x36, 0x67, 0xb8, + 0x01, 0xbb, 0xd4, 0xab, 0xc2, 0xe1, 0xae, 0xbe, 0x73, 0x93, 0xc3, 0x97, 0x43, 0x61, 0xee, 0x65, + 0xe2, 0xc5, 0x01, 0x85, 0xca, 0xd0, 0x77, 0xaf, 0xb8, 0x24, 0x81, 0x5d, 0x3d, 0xdf, 0x3b, 0x28, + 0xcd, 0x8a, 0xa0, 0xcb, 0xfd, 0x74, 0x13, 0x6f, 0xbe, 0x54, 0xd4, 0xb1, 0xef, 0x10, 0x6f, 0x5c, + 0xf5, 0xc3, 0x71, 0x6d, 0x4c, 0x3d, 0xb1, 0x8b, 0x9a, 0x14, 0x91, 0xc0, 0x8e, 0xe6, 0xff, 0xf6, + 0xfa, 0xda, 0x75, 0x06, 0x59, 0x41, 0xf8, 0xe2, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x4c, 0x7b, + 0x72, 0xd5, 0x16, 0x13, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/ml/v1/model_service.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/ml/v1/model_service.pb.go new file mode 100644 index 0000000000..c05f8adf5b --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/ml/v1/model_service.pb.go @@ -0,0 +1,1049 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/ml/v1/model_service.proto + +package ml + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import _ "google.golang.org/genproto/googleapis/api/serviceconfig" +import google_longrunning "google.golang.org/genproto/googleapis/longrunning" +import google_protobuf2 "github.com/golang/protobuf/ptypes/timestamp" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Represents a machine learning solution. +// +// A model can have multiple versions, each of which is a deployed, trained +// model ready to receive prediction requests. The model itself is just a +// container. +type Model struct { + // Required. The name specified for the model when it was created. + // + // The model name must be unique within the project it is created in. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Optional. The description specified for the model when it was created. + Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` + // Output only. The default version of the model. This version will be used to + // handle prediction requests that do not specify a version. + // + // You can change the default version by calling + // [projects.methods.versions.setDefault](/ml/reference/rest/v1/projects.models.versions/setDefault). + DefaultVersion *Version `protobuf:"bytes,3,opt,name=default_version,json=defaultVersion" json:"default_version,omitempty"` + // Optional. The list of regions where the model is going to be deployed. + // Currently only one region per model is supported. + // Defaults to 'us-central1' if nothing is set. + Regions []string `protobuf:"bytes,4,rep,name=regions" json:"regions,omitempty"` + // Optional. If true, enables StackDriver Logging for online prediction. + // Default is false. + OnlinePredictionLogging bool `protobuf:"varint,5,opt,name=online_prediction_logging,json=onlinePredictionLogging" json:"online_prediction_logging,omitempty"` +} + +func (m *Model) Reset() { *m = Model{} } +func (m *Model) String() string { return proto.CompactTextString(m) } +func (*Model) ProtoMessage() {} +func (*Model) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +func (m *Model) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Model) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *Model) GetDefaultVersion() *Version { + if m != nil { + return m.DefaultVersion + } + return nil +} + +func (m *Model) GetRegions() []string { + if m != nil { + return m.Regions + } + return nil +} + +func (m *Model) GetOnlinePredictionLogging() bool { + if m != nil { + return m.OnlinePredictionLogging + } + return false +} + +// Represents a version of the model. +// +// Each version is a trained model deployed in the cloud, ready to handle +// prediction requests. A model can have multiple versions. You can get +// information about all of the versions of a given model by calling +// [projects.models.versions.list](/ml/reference/rest/v1/projects.models.versions/list). +type Version struct { + // Required.The name specified for the version when it was created. + // + // The version name must be unique within the model it is created in. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Optional. The description specified for the version when it was created. + Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` + // Output only. If true, this version will be used to handle prediction + // requests that do not specify a version. + // + // You can change the default version by calling + // [projects.methods.versions.setDefault](/ml/reference/rest/v1/projects.models.versions/setDefault). + IsDefault bool `protobuf:"varint,3,opt,name=is_default,json=isDefault" json:"is_default,omitempty"` + // Required. The Google Cloud Storage location of the trained model used to + // create the version. See the + // [overview of model deployment](/ml/docs/concepts/deployment-overview) for + // more informaiton. + // + // When passing Version to + // [projects.models.versions.create](/ml/reference/rest/v1/projects.models.versions/create) + // the model service uses the specified location as the source of the model. + // Once deployed, the model version is hosted by the prediction service, so + // this location is useful only as a historical record. + DeploymentUri string `protobuf:"bytes,4,opt,name=deployment_uri,json=deploymentUri" json:"deployment_uri,omitempty"` + // Output only. The time the version was created. + CreateTime *google_protobuf2.Timestamp `protobuf:"bytes,5,opt,name=create_time,json=createTime" json:"create_time,omitempty"` + // Output only. The time the version was last used for prediction. + LastUseTime *google_protobuf2.Timestamp `protobuf:"bytes,6,opt,name=last_use_time,json=lastUseTime" json:"last_use_time,omitempty"` + // Optional. The Google Cloud ML runtime version to use for this deployment. + // If not set, Google Cloud ML will choose a version. + RuntimeVersion string `protobuf:"bytes,8,opt,name=runtime_version,json=runtimeVersion" json:"runtime_version,omitempty"` + // Optional. Manually select the number of nodes to use for serving the + // model. If unset (i.e., by default), the number of nodes used to serve + // the model automatically scales with traffic. However, care should be + // taken to ramp up traffic according to the model's ability to scale. If + // your model needs to handle bursts of traffic beyond it's ability to + // scale, it is recommended you set this field appropriately. + ManualScaling *ManualScaling `protobuf:"bytes,9,opt,name=manual_scaling,json=manualScaling" json:"manual_scaling,omitempty"` +} + +func (m *Version) Reset() { *m = Version{} } +func (m *Version) String() string { return proto.CompactTextString(m) } +func (*Version) ProtoMessage() {} +func (*Version) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} } + +func (m *Version) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Version) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *Version) GetIsDefault() bool { + if m != nil { + return m.IsDefault + } + return false +} + +func (m *Version) GetDeploymentUri() string { + if m != nil { + return m.DeploymentUri + } + return "" +} + +func (m *Version) GetCreateTime() *google_protobuf2.Timestamp { + if m != nil { + return m.CreateTime + } + return nil +} + +func (m *Version) GetLastUseTime() *google_protobuf2.Timestamp { + if m != nil { + return m.LastUseTime + } + return nil +} + +func (m *Version) GetRuntimeVersion() string { + if m != nil { + return m.RuntimeVersion + } + return "" +} + +func (m *Version) GetManualScaling() *ManualScaling { + if m != nil { + return m.ManualScaling + } + return nil +} + +// Options for manually scaling a model. +type ManualScaling struct { + // The number of nodes to allocate for this model. These nodes are always up, + // starting from the time the model is deployed, so the cost of operating + // this model will be proportional to nodes * number of hours since + // deployment. + Nodes int32 `protobuf:"varint,1,opt,name=nodes" json:"nodes,omitempty"` +} + +func (m *ManualScaling) Reset() { *m = ManualScaling{} } +func (m *ManualScaling) String() string { return proto.CompactTextString(m) } +func (*ManualScaling) ProtoMessage() {} +func (*ManualScaling) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} } + +func (m *ManualScaling) GetNodes() int32 { + if m != nil { + return m.Nodes + } + return 0 +} + +// Request message for the CreateModel method. +type CreateModelRequest struct { + // Required. The project name. + // + // Authorization: requires `Editor` role on the specified project. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // Required. The model to create. + Model *Model `protobuf:"bytes,2,opt,name=model" json:"model,omitempty"` +} + +func (m *CreateModelRequest) Reset() { *m = CreateModelRequest{} } +func (m *CreateModelRequest) String() string { return proto.CompactTextString(m) } +func (*CreateModelRequest) ProtoMessage() {} +func (*CreateModelRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{3} } + +func (m *CreateModelRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *CreateModelRequest) GetModel() *Model { + if m != nil { + return m.Model + } + return nil +} + +// Request message for the ListModels method. +type ListModelsRequest struct { + // Required. The name of the project whose models are to be listed. + // + // Authorization: requires `Viewer` role on the specified project. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // Optional. A page token to request the next page of results. + // + // You get the token from the `next_page_token` field of the response from + // the previous call. + PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` + // Optional. The number of models to retrieve per "page" of results. If there + // are more remaining results than this number, the response message will + // contain a valid value in the `next_page_token` field. + // + // The default value is 20, and the maximum page size is 100. + PageSize int32 `protobuf:"varint,5,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` +} + +func (m *ListModelsRequest) Reset() { *m = ListModelsRequest{} } +func (m *ListModelsRequest) String() string { return proto.CompactTextString(m) } +func (*ListModelsRequest) ProtoMessage() {} +func (*ListModelsRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{4} } + +func (m *ListModelsRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *ListModelsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +func (m *ListModelsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +// Response message for the ListModels method. +type ListModelsResponse struct { + // The list of models. + Models []*Model `protobuf:"bytes,1,rep,name=models" json:"models,omitempty"` + // Optional. Pass this token as the `page_token` field of the request for a + // subsequent call. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListModelsResponse) Reset() { *m = ListModelsResponse{} } +func (m *ListModelsResponse) String() string { return proto.CompactTextString(m) } +func (*ListModelsResponse) ProtoMessage() {} +func (*ListModelsResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{5} } + +func (m *ListModelsResponse) GetModels() []*Model { + if m != nil { + return m.Models + } + return nil +} + +func (m *ListModelsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// Request message for the GetModel method. +type GetModelRequest struct { + // Required. The name of the model. + // + // Authorization: requires `Viewer` role on the parent project. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetModelRequest) Reset() { *m = GetModelRequest{} } +func (m *GetModelRequest) String() string { return proto.CompactTextString(m) } +func (*GetModelRequest) ProtoMessage() {} +func (*GetModelRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{6} } + +func (m *GetModelRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Request message for the DeleteModel method. +type DeleteModelRequest struct { + // Required. The name of the model. + // + // Authorization: requires `Editor` role on the parent project. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *DeleteModelRequest) Reset() { *m = DeleteModelRequest{} } +func (m *DeleteModelRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteModelRequest) ProtoMessage() {} +func (*DeleteModelRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{7} } + +func (m *DeleteModelRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Uploads the provided trained model version to Cloud Machine Learning. +type CreateVersionRequest struct { + // Required. The name of the model. + // + // Authorization: requires `Editor` role on the parent project. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // Required. The version details. + Version *Version `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"` +} + +func (m *CreateVersionRequest) Reset() { *m = CreateVersionRequest{} } +func (m *CreateVersionRequest) String() string { return proto.CompactTextString(m) } +func (*CreateVersionRequest) ProtoMessage() {} +func (*CreateVersionRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{8} } + +func (m *CreateVersionRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *CreateVersionRequest) GetVersion() *Version { + if m != nil { + return m.Version + } + return nil +} + +// Request message for the ListVersions method. +type ListVersionsRequest struct { + // Required. The name of the model for which to list the version. + // + // Authorization: requires `Viewer` role on the parent project. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // Optional. A page token to request the next page of results. + // + // You get the token from the `next_page_token` field of the response from + // the previous call. + PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` + // Optional. The number of versions to retrieve per "page" of results. If + // there are more remaining results than this number, the response message + // will contain a valid value in the `next_page_token` field. + // + // The default value is 20, and the maximum page size is 100. + PageSize int32 `protobuf:"varint,5,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` +} + +func (m *ListVersionsRequest) Reset() { *m = ListVersionsRequest{} } +func (m *ListVersionsRequest) String() string { return proto.CompactTextString(m) } +func (*ListVersionsRequest) ProtoMessage() {} +func (*ListVersionsRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{9} } + +func (m *ListVersionsRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *ListVersionsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +func (m *ListVersionsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +// Response message for the ListVersions method. +type ListVersionsResponse struct { + // The list of versions. + Versions []*Version `protobuf:"bytes,1,rep,name=versions" json:"versions,omitempty"` + // Optional. Pass this token as the `page_token` field of the request for a + // subsequent call. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListVersionsResponse) Reset() { *m = ListVersionsResponse{} } +func (m *ListVersionsResponse) String() string { return proto.CompactTextString(m) } +func (*ListVersionsResponse) ProtoMessage() {} +func (*ListVersionsResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{10} } + +func (m *ListVersionsResponse) GetVersions() []*Version { + if m != nil { + return m.Versions + } + return nil +} + +func (m *ListVersionsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// Request message for the GetVersion method. +type GetVersionRequest struct { + // Required. The name of the version. + // + // Authorization: requires `Viewer` role on the parent project. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetVersionRequest) Reset() { *m = GetVersionRequest{} } +func (m *GetVersionRequest) String() string { return proto.CompactTextString(m) } +func (*GetVersionRequest) ProtoMessage() {} +func (*GetVersionRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{11} } + +func (m *GetVersionRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Request message for the DeleteVerionRequest method. +type DeleteVersionRequest struct { + // Required. The name of the version. You can get the names of all the + // versions of a model by calling + // [projects.models.versions.list](/ml/reference/rest/v1/projects.models.versions/list). + // + // Authorization: requires `Editor` role on the parent project. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *DeleteVersionRequest) Reset() { *m = DeleteVersionRequest{} } +func (m *DeleteVersionRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteVersionRequest) ProtoMessage() {} +func (*DeleteVersionRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{12} } + +func (m *DeleteVersionRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Request message for the SetDefaultVersion request. +type SetDefaultVersionRequest struct { + // Required. The name of the version to make the default for the model. You + // can get the names of all the versions of a model by calling + // [projects.models.versions.list](/ml/reference/rest/v1/projects.models.versions/list). + // + // Authorization: requires `Editor` role on the parent project. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *SetDefaultVersionRequest) Reset() { *m = SetDefaultVersionRequest{} } +func (m *SetDefaultVersionRequest) String() string { return proto.CompactTextString(m) } +func (*SetDefaultVersionRequest) ProtoMessage() {} +func (*SetDefaultVersionRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{13} } + +func (m *SetDefaultVersionRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func init() { + proto.RegisterType((*Model)(nil), "google.cloud.ml.v1.Model") + proto.RegisterType((*Version)(nil), "google.cloud.ml.v1.Version") + proto.RegisterType((*ManualScaling)(nil), "google.cloud.ml.v1.ManualScaling") + proto.RegisterType((*CreateModelRequest)(nil), "google.cloud.ml.v1.CreateModelRequest") + proto.RegisterType((*ListModelsRequest)(nil), "google.cloud.ml.v1.ListModelsRequest") + proto.RegisterType((*ListModelsResponse)(nil), "google.cloud.ml.v1.ListModelsResponse") + proto.RegisterType((*GetModelRequest)(nil), "google.cloud.ml.v1.GetModelRequest") + proto.RegisterType((*DeleteModelRequest)(nil), "google.cloud.ml.v1.DeleteModelRequest") + proto.RegisterType((*CreateVersionRequest)(nil), "google.cloud.ml.v1.CreateVersionRequest") + proto.RegisterType((*ListVersionsRequest)(nil), "google.cloud.ml.v1.ListVersionsRequest") + proto.RegisterType((*ListVersionsResponse)(nil), "google.cloud.ml.v1.ListVersionsResponse") + proto.RegisterType((*GetVersionRequest)(nil), "google.cloud.ml.v1.GetVersionRequest") + proto.RegisterType((*DeleteVersionRequest)(nil), "google.cloud.ml.v1.DeleteVersionRequest") + proto.RegisterType((*SetDefaultVersionRequest)(nil), "google.cloud.ml.v1.SetDefaultVersionRequest") +} + +// 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 + +// Client API for ModelService service + +type ModelServiceClient interface { + // Creates a model which will later contain one or more versions. + // + // You must add at least one version before you can request predictions from + // the model. Add versions by calling + // [projects.models.versions.create](/ml/reference/rest/v1/projects.models.versions/create). + CreateModel(ctx context.Context, in *CreateModelRequest, opts ...grpc.CallOption) (*Model, error) + // Lists the models in a project. + // + // Each project can contain multiple models, and each model can have multiple + // versions. + ListModels(ctx context.Context, in *ListModelsRequest, opts ...grpc.CallOption) (*ListModelsResponse, error) + // Gets information about a model, including its name, the description (if + // set), and the default version (if at least one version of the model has + // been deployed). + GetModel(ctx context.Context, in *GetModelRequest, opts ...grpc.CallOption) (*Model, error) + // Deletes a model. + // + // You can only delete a model if there are no versions in it. You can delete + // versions by calling + // [projects.models.versions.delete](/ml/reference/rest/v1/projects.models.versions/delete). + DeleteModel(ctx context.Context, in *DeleteModelRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Creates a new version of a model from a trained TensorFlow model. + // + // If the version created in the cloud by this call is the first deployed + // version of the specified model, it will be made the default version of the + // model. When you add a version to a model that already has one or more + // versions, the default version does not automatically change. If you want a + // new version to be the default, you must call + // [projects.models.versions.setDefault](/ml/reference/rest/v1/projects.models.versions/setDefault). + CreateVersion(ctx context.Context, in *CreateVersionRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Gets basic information about all the versions of a model. + // + // If you expect that a model has a lot of versions, or if you need to handle + // only a limited number of results at a time, you can request that the list + // be retrieved in batches (called pages): + ListVersions(ctx context.Context, in *ListVersionsRequest, opts ...grpc.CallOption) (*ListVersionsResponse, error) + // Gets information about a model version. + // + // Models can have multiple versions. You can call + // [projects.models.versions.list](/ml/reference/rest/v1/projects.models.versions/list) + // to get the same information that this method returns for all of the + // versions of a model. + GetVersion(ctx context.Context, in *GetVersionRequest, opts ...grpc.CallOption) (*Version, error) + // Deletes a model version. + // + // Each model can have multiple versions deployed and in use at any given + // time. Use this method to remove a single version. + // + // Note: You cannot delete the version that is set as the default version + // of the model unless it is the only remaining version. + DeleteVersion(ctx context.Context, in *DeleteVersionRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Designates a version to be the default for the model. + // + // The default version is used for prediction requests made against the model + // that don't specify a version. + // + // The first version to be created for a model is automatically set as the + // default. You must make any subsequent changes to the default version + // setting manually using this method. + SetDefaultVersion(ctx context.Context, in *SetDefaultVersionRequest, opts ...grpc.CallOption) (*Version, error) +} + +type modelServiceClient struct { + cc *grpc.ClientConn +} + +func NewModelServiceClient(cc *grpc.ClientConn) ModelServiceClient { + return &modelServiceClient{cc} +} + +func (c *modelServiceClient) CreateModel(ctx context.Context, in *CreateModelRequest, opts ...grpc.CallOption) (*Model, error) { + out := new(Model) + err := grpc.Invoke(ctx, "/google.cloud.ml.v1.ModelService/CreateModel", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *modelServiceClient) ListModels(ctx context.Context, in *ListModelsRequest, opts ...grpc.CallOption) (*ListModelsResponse, error) { + out := new(ListModelsResponse) + err := grpc.Invoke(ctx, "/google.cloud.ml.v1.ModelService/ListModels", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *modelServiceClient) GetModel(ctx context.Context, in *GetModelRequest, opts ...grpc.CallOption) (*Model, error) { + out := new(Model) + err := grpc.Invoke(ctx, "/google.cloud.ml.v1.ModelService/GetModel", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *modelServiceClient) DeleteModel(ctx context.Context, in *DeleteModelRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.cloud.ml.v1.ModelService/DeleteModel", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *modelServiceClient) CreateVersion(ctx context.Context, in *CreateVersionRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.cloud.ml.v1.ModelService/CreateVersion", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *modelServiceClient) ListVersions(ctx context.Context, in *ListVersionsRequest, opts ...grpc.CallOption) (*ListVersionsResponse, error) { + out := new(ListVersionsResponse) + err := grpc.Invoke(ctx, "/google.cloud.ml.v1.ModelService/ListVersions", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *modelServiceClient) GetVersion(ctx context.Context, in *GetVersionRequest, opts ...grpc.CallOption) (*Version, error) { + out := new(Version) + err := grpc.Invoke(ctx, "/google.cloud.ml.v1.ModelService/GetVersion", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *modelServiceClient) DeleteVersion(ctx context.Context, in *DeleteVersionRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.cloud.ml.v1.ModelService/DeleteVersion", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *modelServiceClient) SetDefaultVersion(ctx context.Context, in *SetDefaultVersionRequest, opts ...grpc.CallOption) (*Version, error) { + out := new(Version) + err := grpc.Invoke(ctx, "/google.cloud.ml.v1.ModelService/SetDefaultVersion", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for ModelService service + +type ModelServiceServer interface { + // Creates a model which will later contain one or more versions. + // + // You must add at least one version before you can request predictions from + // the model. Add versions by calling + // [projects.models.versions.create](/ml/reference/rest/v1/projects.models.versions/create). + CreateModel(context.Context, *CreateModelRequest) (*Model, error) + // Lists the models in a project. + // + // Each project can contain multiple models, and each model can have multiple + // versions. + ListModels(context.Context, *ListModelsRequest) (*ListModelsResponse, error) + // Gets information about a model, including its name, the description (if + // set), and the default version (if at least one version of the model has + // been deployed). + GetModel(context.Context, *GetModelRequest) (*Model, error) + // Deletes a model. + // + // You can only delete a model if there are no versions in it. You can delete + // versions by calling + // [projects.models.versions.delete](/ml/reference/rest/v1/projects.models.versions/delete). + DeleteModel(context.Context, *DeleteModelRequest) (*google_longrunning.Operation, error) + // Creates a new version of a model from a trained TensorFlow model. + // + // If the version created in the cloud by this call is the first deployed + // version of the specified model, it will be made the default version of the + // model. When you add a version to a model that already has one or more + // versions, the default version does not automatically change. If you want a + // new version to be the default, you must call + // [projects.models.versions.setDefault](/ml/reference/rest/v1/projects.models.versions/setDefault). + CreateVersion(context.Context, *CreateVersionRequest) (*google_longrunning.Operation, error) + // Gets basic information about all the versions of a model. + // + // If you expect that a model has a lot of versions, or if you need to handle + // only a limited number of results at a time, you can request that the list + // be retrieved in batches (called pages): + ListVersions(context.Context, *ListVersionsRequest) (*ListVersionsResponse, error) + // Gets information about a model version. + // + // Models can have multiple versions. You can call + // [projects.models.versions.list](/ml/reference/rest/v1/projects.models.versions/list) + // to get the same information that this method returns for all of the + // versions of a model. + GetVersion(context.Context, *GetVersionRequest) (*Version, error) + // Deletes a model version. + // + // Each model can have multiple versions deployed and in use at any given + // time. Use this method to remove a single version. + // + // Note: You cannot delete the version that is set as the default version + // of the model unless it is the only remaining version. + DeleteVersion(context.Context, *DeleteVersionRequest) (*google_longrunning.Operation, error) + // Designates a version to be the default for the model. + // + // The default version is used for prediction requests made against the model + // that don't specify a version. + // + // The first version to be created for a model is automatically set as the + // default. You must make any subsequent changes to the default version + // setting manually using this method. + SetDefaultVersion(context.Context, *SetDefaultVersionRequest) (*Version, error) +} + +func RegisterModelServiceServer(s *grpc.Server, srv ModelServiceServer) { + s.RegisterService(&_ModelService_serviceDesc, srv) +} + +func _ModelService_CreateModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateModelRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ModelServiceServer).CreateModel(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.ml.v1.ModelService/CreateModel", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ModelServiceServer).CreateModel(ctx, req.(*CreateModelRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ModelService_ListModels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListModelsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ModelServiceServer).ListModels(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.ml.v1.ModelService/ListModels", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ModelServiceServer).ListModels(ctx, req.(*ListModelsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ModelService_GetModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetModelRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ModelServiceServer).GetModel(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.ml.v1.ModelService/GetModel", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ModelServiceServer).GetModel(ctx, req.(*GetModelRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ModelService_DeleteModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteModelRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ModelServiceServer).DeleteModel(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.ml.v1.ModelService/DeleteModel", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ModelServiceServer).DeleteModel(ctx, req.(*DeleteModelRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ModelService_CreateVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateVersionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ModelServiceServer).CreateVersion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.ml.v1.ModelService/CreateVersion", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ModelServiceServer).CreateVersion(ctx, req.(*CreateVersionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ModelService_ListVersions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListVersionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ModelServiceServer).ListVersions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.ml.v1.ModelService/ListVersions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ModelServiceServer).ListVersions(ctx, req.(*ListVersionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ModelService_GetVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetVersionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ModelServiceServer).GetVersion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.ml.v1.ModelService/GetVersion", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ModelServiceServer).GetVersion(ctx, req.(*GetVersionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ModelService_DeleteVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteVersionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ModelServiceServer).DeleteVersion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.ml.v1.ModelService/DeleteVersion", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ModelServiceServer).DeleteVersion(ctx, req.(*DeleteVersionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ModelService_SetDefaultVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetDefaultVersionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ModelServiceServer).SetDefaultVersion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.ml.v1.ModelService/SetDefaultVersion", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ModelServiceServer).SetDefaultVersion(ctx, req.(*SetDefaultVersionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _ModelService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.cloud.ml.v1.ModelService", + HandlerType: (*ModelServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateModel", + Handler: _ModelService_CreateModel_Handler, + }, + { + MethodName: "ListModels", + Handler: _ModelService_ListModels_Handler, + }, + { + MethodName: "GetModel", + Handler: _ModelService_GetModel_Handler, + }, + { + MethodName: "DeleteModel", + Handler: _ModelService_DeleteModel_Handler, + }, + { + MethodName: "CreateVersion", + Handler: _ModelService_CreateVersion_Handler, + }, + { + MethodName: "ListVersions", + Handler: _ModelService_ListVersions_Handler, + }, + { + MethodName: "GetVersion", + Handler: _ModelService_GetVersion_Handler, + }, + { + MethodName: "DeleteVersion", + Handler: _ModelService_DeleteVersion_Handler, + }, + { + MethodName: "SetDefaultVersion", + Handler: _ModelService_SetDefaultVersion_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/cloud/ml/v1/model_service.proto", +} + +func init() { proto.RegisterFile("google/cloud/ml/v1/model_service.proto", fileDescriptor1) } + +var fileDescriptor1 = []byte{ + // 996 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcf, 0x6f, 0xe3, 0x44, + 0x14, 0x96, 0xdb, 0xa6, 0x4d, 0x5e, 0x36, 0xad, 0x3a, 0x14, 0xc8, 0x66, 0x29, 0x04, 0xaf, 0xda, + 0x86, 0x00, 0xb6, 0x52, 0x8a, 0x10, 0x59, 0x01, 0xd2, 0x52, 0x69, 0x39, 0xec, 0x8a, 0xca, 0xdd, + 0xe5, 0x80, 0x84, 0x2c, 0x6f, 0x32, 0x6b, 0x06, 0xec, 0x19, 0xe3, 0x19, 0x07, 0x58, 0x58, 0x21, + 0xc1, 0x91, 0x23, 0xdc, 0xf9, 0xa3, 0x38, 0x71, 0xe7, 0xc6, 0x99, 0x3b, 0x9a, 0x1f, 0x4e, 0xed, + 0xc4, 0x89, 0x0b, 0x12, 0x37, 0xcf, 0x9b, 0xef, 0xcd, 0xfb, 0xe6, 0x7d, 0xef, 0xbd, 0x31, 0x1c, + 0x87, 0x8c, 0x85, 0x11, 0x76, 0x27, 0x11, 0xcb, 0xa6, 0x6e, 0x1c, 0xb9, 0xb3, 0x91, 0x1b, 0xb3, + 0x29, 0x8e, 0x7c, 0x8e, 0xd3, 0x19, 0x99, 0x60, 0x27, 0x49, 0x99, 0x60, 0x08, 0x69, 0x9c, 0xa3, + 0x70, 0x4e, 0x1c, 0x39, 0xb3, 0x51, 0xef, 0x25, 0xe3, 0x1b, 0x24, 0xc4, 0x0d, 0x28, 0x65, 0x22, + 0x10, 0x84, 0x51, 0xae, 0x3d, 0x7a, 0xcf, 0x17, 0x77, 0x33, 0xf1, 0xb9, 0x31, 0xdf, 0x36, 0xe6, + 0x88, 0xd1, 0x30, 0xcd, 0x28, 0x25, 0x34, 0x74, 0x59, 0x82, 0xd3, 0x92, 0xef, 0x2b, 0x06, 0xa4, + 0x56, 0x8f, 0xb3, 0x27, 0xae, 0x20, 0x31, 0xe6, 0x22, 0x88, 0x13, 0x0d, 0xb0, 0xff, 0xb0, 0xa0, + 0xf1, 0x40, 0xd2, 0x44, 0x08, 0xb6, 0x68, 0x10, 0xe3, 0xae, 0xd5, 0xb7, 0x06, 0x2d, 0x4f, 0x7d, + 0xa3, 0x3e, 0xb4, 0xa7, 0x98, 0x4f, 0x52, 0x92, 0xc8, 0x43, 0xbb, 0x1b, 0x6a, 0xab, 0x68, 0x42, + 0xe7, 0xb0, 0x37, 0xc5, 0x4f, 0x82, 0x2c, 0x12, 0xfe, 0x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, 0x37, 0xc4, 0x54, 0xfd, 0x4a, 0xb9, 0x7a, 0x2b, 0x48, 0x08, 0x2f, 0xfe, 0xcb, 0xdf, 0x89, + 0xa3, 0xc7, 0xdb, 0x0a, 0xf0, 0xd6, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xcc, 0x07, 0x42, 0xf7, + 0xeb, 0x0b, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/ml/v1/operation_metadata.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/ml/v1/operation_metadata.pb.go new file mode 100644 index 0000000000..a41117d50e --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/ml/v1/operation_metadata.pb.go @@ -0,0 +1,161 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/ml/v1/operation_metadata.proto + +package ml + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf2 "github.com/golang/protobuf/ptypes/timestamp" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// The operation type. +type OperationMetadata_OperationType int32 + +const ( + // Unspecified operation type. + OperationMetadata_OPERATION_TYPE_UNSPECIFIED OperationMetadata_OperationType = 0 + // An operation to create a new version. + OperationMetadata_CREATE_VERSION OperationMetadata_OperationType = 1 + // An operation to delete an existing version. + OperationMetadata_DELETE_VERSION OperationMetadata_OperationType = 2 + // An operation to delete an existing model. + OperationMetadata_DELETE_MODEL OperationMetadata_OperationType = 3 +) + +var OperationMetadata_OperationType_name = map[int32]string{ + 0: "OPERATION_TYPE_UNSPECIFIED", + 1: "CREATE_VERSION", + 2: "DELETE_VERSION", + 3: "DELETE_MODEL", +} +var OperationMetadata_OperationType_value = map[string]int32{ + "OPERATION_TYPE_UNSPECIFIED": 0, + "CREATE_VERSION": 1, + "DELETE_VERSION": 2, + "DELETE_MODEL": 3, +} + +func (x OperationMetadata_OperationType) String() string { + return proto.EnumName(OperationMetadata_OperationType_name, int32(x)) +} +func (OperationMetadata_OperationType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor2, []int{0, 0} +} + +// Represents the metadata of the long-running operation. +type OperationMetadata struct { + // The time the operation was submitted. + CreateTime *google_protobuf2.Timestamp `protobuf:"bytes,1,opt,name=create_time,json=createTime" json:"create_time,omitempty"` + // The time operation processing started. + StartTime *google_protobuf2.Timestamp `protobuf:"bytes,2,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + // The time operation processing completed. + EndTime *google_protobuf2.Timestamp `protobuf:"bytes,3,opt,name=end_time,json=endTime" json:"end_time,omitempty"` + // Indicates whether a request to cancel this operation has been made. + IsCancellationRequested bool `protobuf:"varint,4,opt,name=is_cancellation_requested,json=isCancellationRequested" json:"is_cancellation_requested,omitempty"` + // The operation type. + OperationType OperationMetadata_OperationType `protobuf:"varint,5,opt,name=operation_type,json=operationType,enum=google.cloud.ml.v1.OperationMetadata_OperationType" json:"operation_type,omitempty"` + // Contains the name of the model associated with the operation. + ModelName string `protobuf:"bytes,6,opt,name=model_name,json=modelName" json:"model_name,omitempty"` + // Contains the version associated with the operation. + Version *Version `protobuf:"bytes,7,opt,name=version" json:"version,omitempty"` +} + +func (m *OperationMetadata) Reset() { *m = OperationMetadata{} } +func (m *OperationMetadata) String() string { return proto.CompactTextString(m) } +func (*OperationMetadata) ProtoMessage() {} +func (*OperationMetadata) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} } + +func (m *OperationMetadata) GetCreateTime() *google_protobuf2.Timestamp { + if m != nil { + return m.CreateTime + } + return nil +} + +func (m *OperationMetadata) GetStartTime() *google_protobuf2.Timestamp { + if m != nil { + return m.StartTime + } + return nil +} + +func (m *OperationMetadata) GetEndTime() *google_protobuf2.Timestamp { + if m != nil { + return m.EndTime + } + return nil +} + +func (m *OperationMetadata) GetIsCancellationRequested() bool { + if m != nil { + return m.IsCancellationRequested + } + return false +} + +func (m *OperationMetadata) GetOperationType() OperationMetadata_OperationType { + if m != nil { + return m.OperationType + } + return OperationMetadata_OPERATION_TYPE_UNSPECIFIED +} + +func (m *OperationMetadata) GetModelName() string { + if m != nil { + return m.ModelName + } + return "" +} + +func (m *OperationMetadata) GetVersion() *Version { + if m != nil { + return m.Version + } + return nil +} + +func init() { + proto.RegisterType((*OperationMetadata)(nil), "google.cloud.ml.v1.OperationMetadata") + proto.RegisterEnum("google.cloud.ml.v1.OperationMetadata_OperationType", OperationMetadata_OperationType_name, OperationMetadata_OperationType_value) +} + +func init() { proto.RegisterFile("google/cloud/ml/v1/operation_metadata.proto", fileDescriptor2) } + +var fileDescriptor2 = []byte{ + // 454 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0x5f, 0x6b, 0xdb, 0x30, + 0x14, 0xc5, 0xe7, 0xb6, 0x6b, 0x1a, 0x75, 0x0d, 0x99, 0x1e, 0xb6, 0xcc, 0xfb, 0x17, 0xfa, 0x30, + 0x02, 0x03, 0x99, 0xb4, 0xdb, 0xc3, 0xd6, 0xa7, 0x36, 0xd1, 0x20, 0xd0, 0xc6, 0xc6, 0xf5, 0x0a, + 0xeb, 0x8b, 0x51, 0xed, 0x3b, 0x23, 0x90, 0x25, 0xcf, 0x52, 0x0c, 0xfd, 0x2c, 0xfb, 0xb2, 0x23, + 0x92, 0x4d, 0x33, 0x52, 0xe8, 0xa3, 0xce, 0xfd, 0x9d, 0xab, 0xab, 0x7b, 0x84, 0x3e, 0x17, 0x4a, + 0x15, 0x02, 0x82, 0x4c, 0xa8, 0x55, 0x1e, 0x94, 0x22, 0x68, 0xa6, 0x81, 0xaa, 0xa0, 0x66, 0x86, + 0x2b, 0x99, 0x96, 0x60, 0x58, 0xce, 0x0c, 0x23, 0x55, 0xad, 0x8c, 0xc2, 0xd8, 0xc1, 0xc4, 0xc2, + 0xa4, 0x14, 0xa4, 0x99, 0xfa,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0xd2, 0x8f, 0xfb, 0x56, 0x59, + 0x32, 0xfb, 0xda, 0x5e, 0x03, 0xb5, 0xe6, 0x4a, 0x8e, 0x7a, 0xf6, 0xb1, 0x6f, 0x1f, 0xbb, 0xf3, + 0xc6, 0x21, 0x71, 0xc7, 0x1e, 0x73, 0x74, 0xf4, 0xdf, 0xad, 0xf8, 0x03, 0xf2, 0xc3, 0x88, 0xc6, + 0xe7, 0xc9, 0x22, 0x5c, 0xa6, 0xc9, 0xaf, 0x88, 0xa6, 0x3f, 0x97, 0xd7, 0x11, 0x9d, 0x2d, 0x7e, + 0x2c, 0xe8, 0x7c, 0xf8, 0x0c, 0x63, 0x34, 0x98, 0xc5, 0xf4, 0x3c, 0xa1, 0xe9, 0x0d, 0x8d, 0xaf, + 0x17, 0xe1, 0x72, 0xe8, 0xad, 0xb5, 0x39, 0xbd, 0xa4, 0x1b, 0xda, 0x0e, 0x1e, 0xa2, 0x17, 0xad, + 0x76, 0x15, 0xce, 0xe9, 0xe5, 0x70, 0xf7, 0x42, 0x20, 0x3f, 0x53, 0xe5, 0xd6, 0x54, 0xac, 0xe2, + 0xa4, 0x99, 0x5e, 0xbc, 0xda, 0x5a, 0x47, 0xb4, 0x0e, 0x29, 0xf2, 0x6e, 0xbf, 0xb4, 0x8e, 0x42, + 0x09, 0x26, 0x0b, 0xa2, 0xea, 0x22, 0x28, 0x40, 0xda, 0x08, 0x03, 0x57, 0x62, 0x15, 0xd7, 0x9b, + 0xbf, 0xf7, 0xac, 0x14, 0x77, 0xfb, 0x16, 0x38, 0xfd, 0x17, 0x00, 0x00, 0xff, 0xff, 0x03, 0xf9, + 0xcc, 0xf1, 0x3c, 0x03, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/ml/v1/prediction_service.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/ml/v1/prediction_service.pb.go new file mode 100644 index 0000000000..9d27c9c400 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/ml/v1/prediction_service.pb.go @@ -0,0 +1,343 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/ml/v1/prediction_service.proto + +package ml + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_api3 "google.golang.org/genproto/googleapis/api/httpbody" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Request for predictions to be issued against a trained model. +// +// The body of the request is a single JSON object with a single top-level +// field: +// +//
+//
instances
+//
A JSON array containing values representing the instances to use for +// prediction.
+//
+// +// The structure of each element of the instances list is determined by your +// model's input definition. Instances can include named inputs or can contain +// only unlabeled values. +// +// Not all data includes named inputs. Some instances will be simple +// JSON values (boolean, number, or string). However, instances are often lists +// of simple values, or complex nested lists. Here are some examples of request +// bodies: +// +// CSV data with each row encoded as a string value: +//
+// {"instances": ["1.0,true,\\"x\\"", "-2.0,false,\\"y\\""]}
+// 
+// Plain text: +//
+// {"instances": ["the quick brown fox", "la bruja le dio"]}
+// 
+// Sentences encoded as lists of words (vectors of strings): +//
+// {
+//   "instances": [
+//     ["the","quick","brown"],
+//     ["la","bruja","le"],
+//     ...
+//   ]
+// }
+// 
+// Floating point scalar values: +//
+// {"instances": [0.0, 1.1, 2.2]}
+// 
+// Vectors of integers: +//
+// {
+//   "instances": [
+//     [0, 1, 2],
+//     [3, 4, 5],
+//     ...
+//   ]
+// }
+// 
+// Tensors (in this case, two-dimensional tensors): +//
+// {
+//   "instances": [
+//     [
+//       [0, 1, 2],
+//       [3, 4, 5]
+//     ],
+//     ...
+//   ]
+// }
+// 
+// Images can be represented different ways. In this encoding scheme the first +// two dimensions represent the rows and columns of the image, and the third +// contains lists (vectors) of the R, G, and B values for each pixel. +//
+// {
+//   "instances": [
+//     [
+//       [
+//         [138, 30, 66],
+//         [130, 20, 56],
+//         ...
+//       ],
+//       [
+//         [126, 38, 61],
+//         [122, 24, 57],
+//         ...
+//       ],
+//       ...
+//     ],
+//     ...
+//   ]
+// }
+// 
+// JSON strings must be encoded as UTF-8. To send binary data, you must +// base64-encode the data and mark it as binary. To mark a JSON string +// as binary, replace it with a JSON object with a single attribute named `b64`: +//
{"b64": "..."} 
+// For example: +// +// Two Serialized tf.Examples (fake data, for illustrative purposes only): +//
+// {"instances": [{"b64": "X5ad6u"}, {"b64": "IA9j4nx"}]}
+// 
+// Two JPEG image byte strings (fake data, for illustrative purposes only): +//
+// {"instances": [{"b64": "ASa8asdf"}, {"b64": "JLK7ljk3"}]}
+// 
+// If your data includes named references, format each instance as a JSON object +// with the named references as the keys: +// +// JSON input data to be preprocessed: +//
+// {
+//   "instances": [
+//     {
+//       "a": 1.0,
+//       "b": true,
+//       "c": "x"
+//     },
+//     {
+//       "a": -2.0,
+//       "b": false,
+//       "c": "y"
+//     }
+//   ]
+// }
+// 
+// Some models have an underlying TensorFlow graph that accepts multiple input +// tensors. In this case, you should use the names of JSON name/value pairs to +// identify the input tensors, as shown in the following exmaples: +// +// For a graph with input tensor aliases "tag" (string) and "image" +// (base64-encoded string): +//
+// {
+//   "instances": [
+//     {
+//       "tag": "beach",
+//       "image": {"b64": "ASa8asdf"}
+//     },
+//     {
+//       "tag": "car",
+//       "image": {"b64": "JLK7ljk3"}
+//     }
+//   ]
+// }
+// 
+// For a graph with input tensor aliases "tag" (string) and "image" +// (3-dimensional array of 8-bit ints): +//
+// {
+//   "instances": [
+//     {
+//       "tag": "beach",
+//       "image": [
+//         [
+//           [138, 30, 66],
+//           [130, 20, 56],
+//           ...
+//         ],
+//         [
+//           [126, 38, 61],
+//           [122, 24, 57],
+//           ...
+//         ],
+//         ...
+//       ]
+//     },
+//     {
+//       "tag": "car",
+//       "image": [
+//         [
+//           [255, 0, 102],
+//           [255, 0, 97],
+//           ...
+//         ],
+//         [
+//           [254, 1, 101],
+//           [254, 2, 93],
+//           ...
+//         ],
+//         ...
+//       ]
+//     },
+//     ...
+//   ]
+// }
+// 
+// If the call is successful, the response body will contain one prediction +// entry per instance in the request body. If prediction fails for any +// instance, the response body will contain no predictions and will contian +// a single error entry instead. +type PredictRequest struct { + // Required. The resource name of a model or a version. + // + // Authorization: requires `Viewer` role on the parent project. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // + // Required. The prediction request body. + HttpBody *google_api3.HttpBody `protobuf:"bytes,2,opt,name=http_body,json=httpBody" json:"http_body,omitempty"` +} + +func (m *PredictRequest) Reset() { *m = PredictRequest{} } +func (m *PredictRequest) String() string { return proto.CompactTextString(m) } +func (*PredictRequest) ProtoMessage() {} +func (*PredictRequest) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} } + +func (m *PredictRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *PredictRequest) GetHttpBody() *google_api3.HttpBody { + if m != nil { + return m.HttpBody + } + return nil +} + +func init() { + proto.RegisterType((*PredictRequest)(nil), "google.cloud.ml.v1.PredictRequest") +} + +// 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 + +// Client API for OnlinePredictionService service + +type OnlinePredictionServiceClient interface { + // Performs prediction on the data in the request. + // + // **** REMOVE FROM GENERATED DOCUMENTATION + Predict(ctx context.Context, in *PredictRequest, opts ...grpc.CallOption) (*google_api3.HttpBody, error) +} + +type onlinePredictionServiceClient struct { + cc *grpc.ClientConn +} + +func NewOnlinePredictionServiceClient(cc *grpc.ClientConn) OnlinePredictionServiceClient { + return &onlinePredictionServiceClient{cc} +} + +func (c *onlinePredictionServiceClient) Predict(ctx context.Context, in *PredictRequest, opts ...grpc.CallOption) (*google_api3.HttpBody, error) { + out := new(google_api3.HttpBody) + err := grpc.Invoke(ctx, "/google.cloud.ml.v1.OnlinePredictionService/Predict", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for OnlinePredictionService service + +type OnlinePredictionServiceServer interface { + // Performs prediction on the data in the request. + // + // **** REMOVE FROM GENERATED DOCUMENTATION + Predict(context.Context, *PredictRequest) (*google_api3.HttpBody, error) +} + +func RegisterOnlinePredictionServiceServer(s *grpc.Server, srv OnlinePredictionServiceServer) { + s.RegisterService(&_OnlinePredictionService_serviceDesc, srv) +} + +func _OnlinePredictionService_Predict_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PredictRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OnlinePredictionServiceServer).Predict(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.ml.v1.OnlinePredictionService/Predict", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OnlinePredictionServiceServer).Predict(ctx, req.(*PredictRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _OnlinePredictionService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.cloud.ml.v1.OnlinePredictionService", + HandlerType: (*OnlinePredictionServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Predict", + Handler: _OnlinePredictionService_Predict_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/cloud/ml/v1/prediction_service.proto", +} + +func init() { proto.RegisterFile("google/cloud/ml/v1/prediction_service.proto", fileDescriptor3) } + +var fileDescriptor3 = []byte{ + // 308 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x51, 0x4f, 0x4b, 0xfb, 0x30, + 0x18, 0xa6, 0xe3, 0xc7, 0x4f, 0x17, 0xc1, 0x43, 0x10, 0x9d, 0x45, 0x64, 0xd4, 0xcb, 0x9c, 0x90, + 0xd0, 0xe9, 0x69, 0xe2, 0x65, 0x27, 0x6f, 0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xeb, + 0xa3, 0x77, 0x96, 0x9c, 0xba, 0xb2, 0x5e, 0x9c, 0xcd, 0x1b, 0x53, 0xc1, 0x13, 0xcf, 0x6d, 0x4d, + 0xc7, 0xe3, 0xd7, 0x69, 0xe8, 0x6f, 0x1a, 0x8d, 0x67, 0x0a, 0xc5, 0x39, 0x94, 0x1d, 0x25, 0x77, + 0xae, 0x49, 0x67, 0x87, 0x1d, 0x83, 0x99, 0xab, 0x26, 0x8b, 0x1e, 0xaf, 0x02, 0x43, 0x80, 0x62, + 0x5a, 0x10, 0xa8, 0x04, 0x15, 0x5c, 0xb7, 0xc5, 0x51, 0xbf, 0x62, 0x46, 0xd6, 0xdb, 0xbf, 0x76, + 0x5d, 0xaa, 0xe5, 0xff, 0x16, 0x70, 0xf9, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x81, 0x8e, 0x25, 0xca, + 0xd5, 0x01, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/ml/v1/project_service.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/ml/v1/project_service.pb.go new file mode 100644 index 0000000000..751bce74e8 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/ml/v1/project_service.pb.go @@ -0,0 +1,177 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/ml/v1/project_service.proto + +package ml + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Requests service account information associated with a project. +type GetConfigRequest struct { + // Required. The project name. + // + // Authorization: requires `Viewer` role on the specified project. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetConfigRequest) Reset() { *m = GetConfigRequest{} } +func (m *GetConfigRequest) String() string { return proto.CompactTextString(m) } +func (*GetConfigRequest) ProtoMessage() {} +func (*GetConfigRequest) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{0} } + +func (m *GetConfigRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Returns service account information associated with a project. +type GetConfigResponse struct { + // The service account Cloud ML uses to access resources in the project. + ServiceAccount string `protobuf:"bytes,1,opt,name=service_account,json=serviceAccount" json:"service_account,omitempty"` + // The project number for `service_account`. + ServiceAccountProject int64 `protobuf:"varint,2,opt,name=service_account_project,json=serviceAccountProject" json:"service_account_project,omitempty"` +} + +func (m *GetConfigResponse) Reset() { *m = GetConfigResponse{} } +func (m *GetConfigResponse) String() string { return proto.CompactTextString(m) } +func (*GetConfigResponse) ProtoMessage() {} +func (*GetConfigResponse) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{1} } + +func (m *GetConfigResponse) GetServiceAccount() string { + if m != nil { + return m.ServiceAccount + } + return "" +} + +func (m *GetConfigResponse) GetServiceAccountProject() int64 { + if m != nil { + return m.ServiceAccountProject + } + return 0 +} + +func init() { + proto.RegisterType((*GetConfigRequest)(nil), "google.cloud.ml.v1.GetConfigRequest") + proto.RegisterType((*GetConfigResponse)(nil), "google.cloud.ml.v1.GetConfigResponse") +} + +// 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 + +// Client API for ProjectManagementService service + +type ProjectManagementServiceClient interface { + // Get the service account information associated with your project. You need + // this information in order to grant the service account persmissions for + // the Google Cloud Storage location where you put your model training code + // for training the model with Google Cloud Machine Learning. + GetConfig(ctx context.Context, in *GetConfigRequest, opts ...grpc.CallOption) (*GetConfigResponse, error) +} + +type projectManagementServiceClient struct { + cc *grpc.ClientConn +} + +func NewProjectManagementServiceClient(cc *grpc.ClientConn) ProjectManagementServiceClient { + return &projectManagementServiceClient{cc} +} + +func (c *projectManagementServiceClient) GetConfig(ctx context.Context, in *GetConfigRequest, opts ...grpc.CallOption) (*GetConfigResponse, error) { + out := new(GetConfigResponse) + err := grpc.Invoke(ctx, "/google.cloud.ml.v1.ProjectManagementService/GetConfig", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for ProjectManagementService service + +type ProjectManagementServiceServer interface { + // Get the service account information associated with your project. You need + // this information in order to grant the service account persmissions for + // the Google Cloud Storage location where you put your model training code + // for training the model with Google Cloud Machine Learning. + GetConfig(context.Context, *GetConfigRequest) (*GetConfigResponse, error) +} + +func RegisterProjectManagementServiceServer(s *grpc.Server, srv ProjectManagementServiceServer) { + s.RegisterService(&_ProjectManagementService_serviceDesc, srv) +} + +func _ProjectManagementService_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.(ProjectManagementServiceServer).GetConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.ml.v1.ProjectManagementService/GetConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProjectManagementServiceServer).GetConfig(ctx, req.(*GetConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _ProjectManagementService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.cloud.ml.v1.ProjectManagementService", + HandlerType: (*ProjectManagementServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetConfig", + Handler: _ProjectManagementService_GetConfig_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/cloud/ml/v1/project_service.proto", +} + +func init() { proto.RegisterFile("google/cloud/ml/v1/project_service.proto", fileDescriptor4) } + +var fileDescriptor4 = []byte{ + // 319 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x91, 0xbf, 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 0xc1, 0x20, 0x0e, 0x0f, 0x3f, 0x32, 0xd2, 0x48, 0xf5, 0xb5, 0xb0, 0x42, + 0x82, 0x01, 0x1b, 0x6e, 0x22, 0x4a, 0x5f, 0x33, 0x52, 0xff, 0xf5, 0x44, 0x77, 0xd9, 0x7c, 0x76, + 0x36, 0x1b, 0xad, 0xb9, 0xf7, 0x0f, 0x15, 0x83, 0xb5, 0x3b, 0x6f, 0x9f, 0x5f, 0xef, 0xb5, 0x1d, + 0xba, 0x3d, 0x59, 0xf5, 0xf3, 0x64, 0x01, 0xe7, 0xc9, 0xaf, 0xe7, 0x07, 0x2f, 0xa7, 0xf2, 0x47, + 0xd0, 0x57, 0xa4, 0x99, 0xa3, 0x99, 0x7b, 0x54, 0x38, 0xc5, 0xca, 0x5e, 0x7f, 0x3d, 0x79, 0x4f, + 0x8e, 0x07, 0x93, 0x8d, 0x0f, 0xb2, 0xdb, 0xe3, 0x84, 0x4b, 0xd4, 0xc2, 0x4a, 0x86, 0x85, 0xe4, + 0x12, 0x6c, 0x75, 0x0f, 0x1e, 0x47, 0xc2, 0x29, 0x3f, 0x7d, 0xee, 0x33, 0xa3, 0xef, 0x96, 0x2a, + 0xe0, 0xe8, 0x3b, 0x00, 0x00, 0xff, 0xff, 0xd0, 0xa5, 0x43, 0x33, 0x0e, 0x02, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/ml/v1beta1/job_service.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/ml/v1beta1/job_service.pb.go new file mode 100644 index 0000000000..df13ca5e7b --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/ml/v1beta1/job_service.pb.go @@ -0,0 +1,1823 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/ml/v1beta1/job_service.proto + +/* +Package ml is a generated protocol buffer package. + +It is generated from these files: + google/cloud/ml/v1beta1/job_service.proto + google/cloud/ml/v1beta1/model_service.proto + google/cloud/ml/v1beta1/operation_metadata.proto + google/cloud/ml/v1beta1/prediction_service.proto + google/cloud/ml/v1beta1/project_service.proto + +It has these top-level messages: + TrainingInput + HyperparameterSpec + ParameterSpec + HyperparameterOutput + TrainingOutput + PredictionInput + PredictionOutput + Job + CreateJobRequest + ListJobsRequest + ListJobsResponse + GetJobRequest + CancelJobRequest + Model + Version + ManualScaling + CreateModelRequest + ListModelsRequest + ListModelsResponse + GetModelRequest + DeleteModelRequest + CreateVersionRequest + ListVersionsRequest + ListVersionsResponse + GetVersionRequest + DeleteVersionRequest + SetDefaultVersionRequest + OperationMetadata + PredictRequest + GetConfigRequest + GetConfigResponse +*/ +package ml + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import _ "google.golang.org/genproto/googleapis/api/serviceconfig" +import google_protobuf1 "github.com/golang/protobuf/ptypes/empty" +import google_protobuf2 "github.com/golang/protobuf/ptypes/timestamp" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// A scale tier is an abstract representation of the resources Cloud ML +// will allocate to a training job. When selecting a scale tier for your +// training job, you should consider the size of your training dataset and +// the complexity of your model. As the tiers increase, virtual machines are +// added to handle your job, and the individual machines in the cluster +// generally have more memory and greater processing power than they do at +// lower tiers. The number of training units charged per hour of processing +// increases as tiers get more advanced. Refer to the +// [pricing guide](/ml/pricing) for more details. Note that in addition to +// incurring costs, your use of training resources is constrained by the +// [quota policy](/ml/quota). +type TrainingInput_ScaleTier int32 + +const ( + // A single worker instance. This tier is suitable for learning how to use + // Cloud ML, and for experimenting with new models using small datasets. + TrainingInput_BASIC TrainingInput_ScaleTier = 0 + // Many workers and a few parameter servers. + TrainingInput_STANDARD_1 TrainingInput_ScaleTier = 1 + // A large number of workers with many parameter servers. + TrainingInput_PREMIUM_1 TrainingInput_ScaleTier = 3 + // A single worker instance [with a GPU](ml/docs/how-tos/using-gpus). + TrainingInput_BASIC_GPU TrainingInput_ScaleTier = 6 + // The CUSTOM tier is not a set tier, but rather enables you to use your + // own cluster specification. When you use this tier, set values to + // configure your processing cluster according to these guidelines: + // + // * You _must_ set `TrainingInput.masterType` to specify the type + // of machine to use for your master node. This is the only required + // setting. + // + // * You _may_ set `TrainingInput.workerCount` to specify the number of + // workers to use. If you specify one or more workers, you _must_ also + // set `TrainingInput.workerType` to specify the type of machine to use + // for your worker nodes. + // + // * You _may_ set `TrainingInput.parameterServerCount` to specify the + // number of parameter servers to use. If you specify one or more + // parameter servers, you _must_ also set + // `TrainingInput.parameterServerType` to specify the type of machine to + // use for your parameter servers. + // + // Note that all of your workers must use the same machine type, which can + // be different from your parameter server type and master type. Your + // parameter servers must likewise use the same machine type, which can be + // different from your worker type and master type. + TrainingInput_CUSTOM TrainingInput_ScaleTier = 5 +) + +var TrainingInput_ScaleTier_name = map[int32]string{ + 0: "BASIC", + 1: "STANDARD_1", + 3: "PREMIUM_1", + 6: "BASIC_GPU", + 5: "CUSTOM", +} +var TrainingInput_ScaleTier_value = map[string]int32{ + "BASIC": 0, + "STANDARD_1": 1, + "PREMIUM_1": 3, + "BASIC_GPU": 6, + "CUSTOM": 5, +} + +func (x TrainingInput_ScaleTier) String() string { + return proto.EnumName(TrainingInput_ScaleTier_name, int32(x)) +} +func (TrainingInput_ScaleTier) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 0} } + +// The available types of optimization goals. +type HyperparameterSpec_GoalType int32 + +const ( + // Goal Type will default to maximize. + HyperparameterSpec_GOAL_TYPE_UNSPECIFIED HyperparameterSpec_GoalType = 0 + // Maximize the goal metric. + HyperparameterSpec_MAXIMIZE HyperparameterSpec_GoalType = 1 + // Minimize the goal metric. + HyperparameterSpec_MINIMIZE HyperparameterSpec_GoalType = 2 +) + +var HyperparameterSpec_GoalType_name = map[int32]string{ + 0: "GOAL_TYPE_UNSPECIFIED", + 1: "MAXIMIZE", + 2: "MINIMIZE", +} +var HyperparameterSpec_GoalType_value = map[string]int32{ + "GOAL_TYPE_UNSPECIFIED": 0, + "MAXIMIZE": 1, + "MINIMIZE": 2, +} + +func (x HyperparameterSpec_GoalType) String() string { + return proto.EnumName(HyperparameterSpec_GoalType_name, int32(x)) +} +func (HyperparameterSpec_GoalType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{1, 0} +} + +// The type of the parameter. +type ParameterSpec_ParameterType int32 + +const ( + // You must specify a valid type. Using this unspecified type will result in + // an error. + ParameterSpec_PARAMETER_TYPE_UNSPECIFIED ParameterSpec_ParameterType = 0 + // Type for real-valued parameters. + ParameterSpec_DOUBLE ParameterSpec_ParameterType = 1 + // Type for integral parameters. + ParameterSpec_INTEGER ParameterSpec_ParameterType = 2 + // The parameter is categorical, with a value chosen from the categories + // field. + ParameterSpec_CATEGORICAL ParameterSpec_ParameterType = 3 + // The parameter is real valued, with a fixed set of feasible points. If + // `type==DISCRETE`, feasible_points must be provided, and + // {`min_value`, `max_value`} will be ignored. + ParameterSpec_DISCRETE ParameterSpec_ParameterType = 4 +) + +var ParameterSpec_ParameterType_name = map[int32]string{ + 0: "PARAMETER_TYPE_UNSPECIFIED", + 1: "DOUBLE", + 2: "INTEGER", + 3: "CATEGORICAL", + 4: "DISCRETE", +} +var ParameterSpec_ParameterType_value = map[string]int32{ + "PARAMETER_TYPE_UNSPECIFIED": 0, + "DOUBLE": 1, + "INTEGER": 2, + "CATEGORICAL": 3, + "DISCRETE": 4, +} + +func (x ParameterSpec_ParameterType) String() string { + return proto.EnumName(ParameterSpec_ParameterType_name, int32(x)) +} +func (ParameterSpec_ParameterType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{2, 0} +} + +// The type of scaling that should be applied to this parameter. +type ParameterSpec_ScaleType int32 + +const ( + // By default, no scaling is applied. + ParameterSpec_NONE ParameterSpec_ScaleType = 0 + // Scales the feasible space to (0, 1) linearly. + ParameterSpec_UNIT_LINEAR_SCALE ParameterSpec_ScaleType = 1 + // Scales the feasible space logarithmically to (0, 1). The entire feasible + // space must be strictly positive. + ParameterSpec_UNIT_LOG_SCALE ParameterSpec_ScaleType = 2 + // Scales the feasible space "reverse" logarithmically to (0, 1). The result + // is that values close to the top of the feasible space are spread out more + // than points near the bottom. The entire feasible space must be strictly + // positive. + ParameterSpec_UNIT_REVERSE_LOG_SCALE ParameterSpec_ScaleType = 3 +) + +var ParameterSpec_ScaleType_name = map[int32]string{ + 0: "NONE", + 1: "UNIT_LINEAR_SCALE", + 2: "UNIT_LOG_SCALE", + 3: "UNIT_REVERSE_LOG_SCALE", +} +var ParameterSpec_ScaleType_value = map[string]int32{ + "NONE": 0, + "UNIT_LINEAR_SCALE": 1, + "UNIT_LOG_SCALE": 2, + "UNIT_REVERSE_LOG_SCALE": 3, +} + +func (x ParameterSpec_ScaleType) String() string { + return proto.EnumName(ParameterSpec_ScaleType_name, int32(x)) +} +func (ParameterSpec_ScaleType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{2, 1} } + +// The format used to separate data instances in the source files. +type PredictionInput_DataFormat int32 + +const ( + // Unspecified format. + PredictionInput_DATA_FORMAT_UNSPECIFIED PredictionInput_DataFormat = 0 + // The source file is a text file with instances separated by the + // new-line character. + PredictionInput_TEXT PredictionInput_DataFormat = 1 + // The source file is a TFRecord file. + PredictionInput_TF_RECORD PredictionInput_DataFormat = 2 + // The source file is a GZIP-compressed TFRecord file. + PredictionInput_TF_RECORD_GZIP PredictionInput_DataFormat = 3 +) + +var PredictionInput_DataFormat_name = map[int32]string{ + 0: "DATA_FORMAT_UNSPECIFIED", + 1: "TEXT", + 2: "TF_RECORD", + 3: "TF_RECORD_GZIP", +} +var PredictionInput_DataFormat_value = map[string]int32{ + "DATA_FORMAT_UNSPECIFIED": 0, + "TEXT": 1, + "TF_RECORD": 2, + "TF_RECORD_GZIP": 3, +} + +func (x PredictionInput_DataFormat) String() string { + return proto.EnumName(PredictionInput_DataFormat_name, int32(x)) +} +func (PredictionInput_DataFormat) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{5, 0} +} + +// Describes the job state. +type Job_State int32 + +const ( + // The job state is unspecified. + Job_STATE_UNSPECIFIED Job_State = 0 + // The job has been just created and processing has not yet begun. + Job_QUEUED Job_State = 1 + // The service is preparing to run the job. + Job_PREPARING Job_State = 2 + // The job is in progress. + Job_RUNNING Job_State = 3 + // The job completed successfully. + Job_SUCCEEDED Job_State = 4 + // The job failed. + // `error_message` should contain the details of the failure. + Job_FAILED Job_State = 5 + // The job is being cancelled. + // `error_message` should describe the reason for the cancellation. + Job_CANCELLING Job_State = 6 + // The job has been cancelled. + // `error_message` should describe the reason for the cancellation. + Job_CANCELLED Job_State = 7 +) + +var Job_State_name = map[int32]string{ + 0: "STATE_UNSPECIFIED", + 1: "QUEUED", + 2: "PREPARING", + 3: "RUNNING", + 4: "SUCCEEDED", + 5: "FAILED", + 6: "CANCELLING", + 7: "CANCELLED", +} +var Job_State_value = map[string]int32{ + "STATE_UNSPECIFIED": 0, + "QUEUED": 1, + "PREPARING": 2, + "RUNNING": 3, + "SUCCEEDED": 4, + "FAILED": 5, + "CANCELLING": 6, + "CANCELLED": 7, +} + +func (x Job_State) String() string { + return proto.EnumName(Job_State_name, int32(x)) +} +func (Job_State) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{7, 0} } + +// Represents input parameters for a training job. +type TrainingInput struct { + // Required. Specifies the machine types, the number of replicas for workers + // and parameter servers. + ScaleTier TrainingInput_ScaleTier `protobuf:"varint,1,opt,name=scale_tier,json=scaleTier,enum=google.cloud.ml.v1beta1.TrainingInput_ScaleTier" json:"scale_tier,omitempty"` + // Optional. Specifies the type of virtual machine to use for your training + // job's master worker. + // + // The following types are supported: + // + //
+ //
standard
+ //
+ // A basic machine configuration suitable for training simple models with + // small to moderate datasets. + //
+ //
large_model
+ //
+ // A machine with a lot of memory, specially suited for parameter servers + // when your model is large (having many hidden layers or layers with very + // large numbers of nodes). + //
+ //
complex_model_s
+ //
+ // A machine suitable for the master and workers of the cluster when your + // model requires more computation than the standard machine can handle + // satisfactorily. + //
+ //
complex_model_m
+ //
+ // A machine with roughly twice the number of cores and roughly double the + // memory of complex_model_s. + //
+ //
complex_model_l
+ //
+ // A machine with roughly twice the number of cores and roughly double the + // memory of complex_model_m. + //
+ //
standard_gpu
+ //
+ // A machine equivalent to standard that + // also includes a + // + // GPU that you can use in your trainer. + //
+ //
complex_model_m_gpu
+ //
+ // A machine equivalent to + // coplex_model_m that also includes + // four GPUs. + //
+ //
+ // + // You must set this value when `scaleTier` is set to `CUSTOM`. + MasterType string `protobuf:"bytes,2,opt,name=master_type,json=masterType" json:"master_type,omitempty"` + // Optional. Specifies the type of virtual machine to use for your training + // job's worker nodes. + // + // The supported values are the same as those described in the entry for + // `masterType`. + // + // This value must be present when `scaleTier` is set to `CUSTOM` and + // `workerCount` is greater than zero. + WorkerType string `protobuf:"bytes,3,opt,name=worker_type,json=workerType" json:"worker_type,omitempty"` + // Optional. Specifies the type of virtual machine to use for your training + // job's parameter server. + // + // The supported values are the same as those described in the entry for + // `master_type`. + // + // This value must be present when `scaleTier` is set to `CUSTOM` and + // `parameter_server_count` is greater than zero. + ParameterServerType string `protobuf:"bytes,4,opt,name=parameter_server_type,json=parameterServerType" json:"parameter_server_type,omitempty"` + // Optional. The number of worker replicas to use for the training job. Each + // replica in the cluster will be of the type specified in `worker_type`. + // + // This value can only be used when `scale_tier` is set to `CUSTOM`. If you + // set this value, you must also set `worker_type`. + WorkerCount int64 `protobuf:"varint,5,opt,name=worker_count,json=workerCount" json:"worker_count,omitempty"` + // Optional. The number of parameter server replicas to use for the training + // job. Each replica in the cluster will be of the type specified in + // `parameter_server_type`. + // + // This value can only be used when `scale_tier` is set to `CUSTOM`.If you + // set this value, you must also set `parameter_server_type`. + ParameterServerCount int64 `protobuf:"varint,6,opt,name=parameter_server_count,json=parameterServerCount" json:"parameter_server_count,omitempty"` + // Required. The Google Cloud Storage location of the packages with + // the training program and any additional dependencies. + PackageUris []string `protobuf:"bytes,7,rep,name=package_uris,json=packageUris" json:"package_uris,omitempty"` + // Required. The Python module name to run after installing the packages. + PythonModule string `protobuf:"bytes,8,opt,name=python_module,json=pythonModule" json:"python_module,omitempty"` + // Optional. Command line arguments to pass to the program. + Args []string `protobuf:"bytes,10,rep,name=args" json:"args,omitempty"` + // Optional. The set of Hyperparameters to tune. + Hyperparameters *HyperparameterSpec `protobuf:"bytes,12,opt,name=hyperparameters" json:"hyperparameters,omitempty"` + // Required. The Google Compute Engine region to run the training job in. + Region string `protobuf:"bytes,14,opt,name=region" json:"region,omitempty"` + // Optional. A Google Cloud Storage path in which to store training outputs + // and other data needed for training. This path is passed to your TensorFlow + // program as the 'job_dir' command-line argument. The benefit of specifying + // this field is that Cloud ML validates the path for use in training. + JobDir string `protobuf:"bytes,16,opt,name=job_dir,json=jobDir" json:"job_dir,omitempty"` + // Optional. The Google Cloud ML runtime version to use for training. If not + // set, Google Cloud ML will choose the latest stable version. + RuntimeVersion string `protobuf:"bytes,15,opt,name=runtime_version,json=runtimeVersion" json:"runtime_version,omitempty"` +} + +func (m *TrainingInput) Reset() { *m = TrainingInput{} } +func (m *TrainingInput) String() string { return proto.CompactTextString(m) } +func (*TrainingInput) ProtoMessage() {} +func (*TrainingInput) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *TrainingInput) GetScaleTier() TrainingInput_ScaleTier { + if m != nil { + return m.ScaleTier + } + return TrainingInput_BASIC +} + +func (m *TrainingInput) GetMasterType() string { + if m != nil { + return m.MasterType + } + return "" +} + +func (m *TrainingInput) GetWorkerType() string { + if m != nil { + return m.WorkerType + } + return "" +} + +func (m *TrainingInput) GetParameterServerType() string { + if m != nil { + return m.ParameterServerType + } + return "" +} + +func (m *TrainingInput) GetWorkerCount() int64 { + if m != nil { + return m.WorkerCount + } + return 0 +} + +func (m *TrainingInput) GetParameterServerCount() int64 { + if m != nil { + return m.ParameterServerCount + } + return 0 +} + +func (m *TrainingInput) GetPackageUris() []string { + if m != nil { + return m.PackageUris + } + return nil +} + +func (m *TrainingInput) GetPythonModule() string { + if m != nil { + return m.PythonModule + } + return "" +} + +func (m *TrainingInput) GetArgs() []string { + if m != nil { + return m.Args + } + return nil +} + +func (m *TrainingInput) GetHyperparameters() *HyperparameterSpec { + if m != nil { + return m.Hyperparameters + } + return nil +} + +func (m *TrainingInput) GetRegion() string { + if m != nil { + return m.Region + } + return "" +} + +func (m *TrainingInput) GetJobDir() string { + if m != nil { + return m.JobDir + } + return "" +} + +func (m *TrainingInput) GetRuntimeVersion() string { + if m != nil { + return m.RuntimeVersion + } + return "" +} + +// Represents a set of hyperparameters to optimize. +type HyperparameterSpec struct { + // Required. The type of goal to use for tuning. Available types are + // `MAXIMIZE` and `MINIMIZE`. + // + // Defaults to `MAXIMIZE`. + Goal HyperparameterSpec_GoalType `protobuf:"varint,1,opt,name=goal,enum=google.cloud.ml.v1beta1.HyperparameterSpec_GoalType" json:"goal,omitempty"` + // Required. The set of parameters to tune. + Params []*ParameterSpec `protobuf:"bytes,2,rep,name=params" json:"params,omitempty"` + // Optional. How many training trials should be attempted to optimize + // the specified hyperparameters. + // + // Defaults to one. + MaxTrials int32 `protobuf:"varint,3,opt,name=max_trials,json=maxTrials" json:"max_trials,omitempty"` + // Optional. The number of training trials to run concurrently. + // You can reduce the time it takes to perform hyperparameter tuning by adding + // trials in parallel. However, each trail only benefits from the information + // gained in completed trials. That means that a trial does not get access to + // the results of trials running at the same time, which could reduce the + // quality of the overall optimization. + // + // Each trial will use the same scale tier and machine types. + // + // Defaults to one. + MaxParallelTrials int32 `protobuf:"varint,4,opt,name=max_parallel_trials,json=maxParallelTrials" json:"max_parallel_trials,omitempty"` + // Optional. The Tensorflow summary tag name to use for optimizing trials. For + // current versions of Tensorflow, this tag name should exactly match what is + // shown in Tensorboard, including all scopes. For versions of Tensorflow + // prior to 0.12, this should be only the tag passed to tf.Summary. + // By default, "training/hptuning/metric" will be used. + HyperparameterMetricTag string `protobuf:"bytes,5,opt,name=hyperparameter_metric_tag,json=hyperparameterMetricTag" json:"hyperparameter_metric_tag,omitempty"` +} + +func (m *HyperparameterSpec) Reset() { *m = HyperparameterSpec{} } +func (m *HyperparameterSpec) String() string { return proto.CompactTextString(m) } +func (*HyperparameterSpec) ProtoMessage() {} +func (*HyperparameterSpec) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *HyperparameterSpec) GetGoal() HyperparameterSpec_GoalType { + if m != nil { + return m.Goal + } + return HyperparameterSpec_GOAL_TYPE_UNSPECIFIED +} + +func (m *HyperparameterSpec) GetParams() []*ParameterSpec { + if m != nil { + return m.Params + } + return nil +} + +func (m *HyperparameterSpec) GetMaxTrials() int32 { + if m != nil { + return m.MaxTrials + } + return 0 +} + +func (m *HyperparameterSpec) GetMaxParallelTrials() int32 { + if m != nil { + return m.MaxParallelTrials + } + return 0 +} + +func (m *HyperparameterSpec) GetHyperparameterMetricTag() string { + if m != nil { + return m.HyperparameterMetricTag + } + return "" +} + +// Represents a single hyperparameter to optimize. +type ParameterSpec struct { + // Required. The parameter name must be unique amongst all ParameterConfigs in + // a HyperparameterSpec message. E.g., "learning_rate". + ParameterName string `protobuf:"bytes,1,opt,name=parameter_name,json=parameterName" json:"parameter_name,omitempty"` + // Required. The type of the parameter. + Type ParameterSpec_ParameterType `protobuf:"varint,4,opt,name=type,enum=google.cloud.ml.v1beta1.ParameterSpec_ParameterType" json:"type,omitempty"` + // Required if type is `DOUBLE` or `INTEGER`. This field + // should be unset if type is `CATEGORICAL`. This value should be integers if + // type is INTEGER. + MinValue float64 `protobuf:"fixed64,2,opt,name=min_value,json=minValue" json:"min_value,omitempty"` + // Required if typeis `DOUBLE` or `INTEGER`. This field + // should be unset if type is `CATEGORICAL`. This value should be integers if + // type is `INTEGER`. + MaxValue float64 `protobuf:"fixed64,3,opt,name=max_value,json=maxValue" json:"max_value,omitempty"` + // Required if type is `CATEGORICAL`. The list of possible categories. + CategoricalValues []string `protobuf:"bytes,5,rep,name=categorical_values,json=categoricalValues" json:"categorical_values,omitempty"` + // Required if type is `DISCRETE`. + // A list of feasible points. + // The list should be in strictly increasing order. For instance, this + // parameter might have possible settings of 1.5, 2.5, and 4.0. This list + // should not contain more than 1,000 values. + DiscreteValues []float64 `protobuf:"fixed64,6,rep,packed,name=discrete_values,json=discreteValues" json:"discrete_values,omitempty"` + // Optional. How the parameter should be scaled to the hypercube. + // Leave unset for categorical parameters. + // Some kind of scaling is strongly recommended for real or integral + // parameters (e.g., `UNIT_LINEAR_SCALE`). + ScaleType ParameterSpec_ScaleType `protobuf:"varint,7,opt,name=scale_type,json=scaleType,enum=google.cloud.ml.v1beta1.ParameterSpec_ScaleType" json:"scale_type,omitempty"` +} + +func (m *ParameterSpec) Reset() { *m = ParameterSpec{} } +func (m *ParameterSpec) String() string { return proto.CompactTextString(m) } +func (*ParameterSpec) ProtoMessage() {} +func (*ParameterSpec) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *ParameterSpec) GetParameterName() string { + if m != nil { + return m.ParameterName + } + return "" +} + +func (m *ParameterSpec) GetType() ParameterSpec_ParameterType { + if m != nil { + return m.Type + } + return ParameterSpec_PARAMETER_TYPE_UNSPECIFIED +} + +func (m *ParameterSpec) GetMinValue() float64 { + if m != nil { + return m.MinValue + } + return 0 +} + +func (m *ParameterSpec) GetMaxValue() float64 { + if m != nil { + return m.MaxValue + } + return 0 +} + +func (m *ParameterSpec) GetCategoricalValues() []string { + if m != nil { + return m.CategoricalValues + } + return nil +} + +func (m *ParameterSpec) GetDiscreteValues() []float64 { + if m != nil { + return m.DiscreteValues + } + return nil +} + +func (m *ParameterSpec) GetScaleType() ParameterSpec_ScaleType { + if m != nil { + return m.ScaleType + } + return ParameterSpec_NONE +} + +// Represents the result of a single hyperparameter tuning trial from a +// training job. The TrainingOutput object that is returned on successful +// completion of a training job with hyperparameter tuning includes a list +// of HyperparameterOutput objects, one for each successful trial. +type HyperparameterOutput struct { + // The trial id for these results. + TrialId string `protobuf:"bytes,1,opt,name=trial_id,json=trialId" json:"trial_id,omitempty"` + // The hyperparameters given to this trial. + Hyperparameters map[string]string `protobuf:"bytes,2,rep,name=hyperparameters" json:"hyperparameters,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // The final objective metric seen for this trial. + FinalMetric *HyperparameterOutput_HyperparameterMetric `protobuf:"bytes,3,opt,name=final_metric,json=finalMetric" json:"final_metric,omitempty"` + // All recorded object metrics for this trial. + AllMetrics []*HyperparameterOutput_HyperparameterMetric `protobuf:"bytes,4,rep,name=all_metrics,json=allMetrics" json:"all_metrics,omitempty"` +} + +func (m *HyperparameterOutput) Reset() { *m = HyperparameterOutput{} } +func (m *HyperparameterOutput) String() string { return proto.CompactTextString(m) } +func (*HyperparameterOutput) ProtoMessage() {} +func (*HyperparameterOutput) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *HyperparameterOutput) GetTrialId() string { + if m != nil { + return m.TrialId + } + return "" +} + +func (m *HyperparameterOutput) GetHyperparameters() map[string]string { + if m != nil { + return m.Hyperparameters + } + return nil +} + +func (m *HyperparameterOutput) GetFinalMetric() *HyperparameterOutput_HyperparameterMetric { + if m != nil { + return m.FinalMetric + } + return nil +} + +func (m *HyperparameterOutput) GetAllMetrics() []*HyperparameterOutput_HyperparameterMetric { + if m != nil { + return m.AllMetrics + } + return nil +} + +// An observed value of a metric. +type HyperparameterOutput_HyperparameterMetric struct { + // The global training step for this metric. + TrainingStep int64 `protobuf:"varint,1,opt,name=training_step,json=trainingStep" json:"training_step,omitempty"` + // The objective value at this training step. + ObjectiveValue float64 `protobuf:"fixed64,2,opt,name=objective_value,json=objectiveValue" json:"objective_value,omitempty"` +} + +func (m *HyperparameterOutput_HyperparameterMetric) Reset() { + *m = HyperparameterOutput_HyperparameterMetric{} +} +func (m *HyperparameterOutput_HyperparameterMetric) String() string { return proto.CompactTextString(m) } +func (*HyperparameterOutput_HyperparameterMetric) ProtoMessage() {} +func (*HyperparameterOutput_HyperparameterMetric) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{3, 0} +} + +func (m *HyperparameterOutput_HyperparameterMetric) GetTrainingStep() int64 { + if m != nil { + return m.TrainingStep + } + return 0 +} + +func (m *HyperparameterOutput_HyperparameterMetric) GetObjectiveValue() float64 { + if m != nil { + return m.ObjectiveValue + } + return 0 +} + +// Represents results of a training job. Output only. +type TrainingOutput struct { + // The number of hyperparameter tuning trials that completed successfully. + // Only set for hyperparameter tuning jobs. + CompletedTrialCount int64 `protobuf:"varint,1,opt,name=completed_trial_count,json=completedTrialCount" json:"completed_trial_count,omitempty"` + // Results for individual Hyperparameter trials. + // Only set for hyperparameter tuning jobs. + Trials []*HyperparameterOutput `protobuf:"bytes,2,rep,name=trials" json:"trials,omitempty"` + // The amount of ML units consumed by the job. + ConsumedMlUnits float64 `protobuf:"fixed64,3,opt,name=consumed_ml_units,json=consumedMlUnits" json:"consumed_ml_units,omitempty"` + // Whether this job is a hyperparameter tuning job. + IsHyperparameterTuningJob bool `protobuf:"varint,4,opt,name=is_hyperparameter_tuning_job,json=isHyperparameterTuningJob" json:"is_hyperparameter_tuning_job,omitempty"` +} + +func (m *TrainingOutput) Reset() { *m = TrainingOutput{} } +func (m *TrainingOutput) String() string { return proto.CompactTextString(m) } +func (*TrainingOutput) ProtoMessage() {} +func (*TrainingOutput) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *TrainingOutput) GetCompletedTrialCount() int64 { + if m != nil { + return m.CompletedTrialCount + } + return 0 +} + +func (m *TrainingOutput) GetTrials() []*HyperparameterOutput { + if m != nil { + return m.Trials + } + return nil +} + +func (m *TrainingOutput) GetConsumedMlUnits() float64 { + if m != nil { + return m.ConsumedMlUnits + } + return 0 +} + +func (m *TrainingOutput) GetIsHyperparameterTuningJob() bool { + if m != nil { + return m.IsHyperparameterTuningJob + } + return false +} + +// Represents input parameters for a prediction job. +type PredictionInput struct { + // Required. The model or the version to use for prediction. + // + // Types that are valid to be assigned to ModelVersion: + // *PredictionInput_ModelName + // *PredictionInput_VersionName + // *PredictionInput_Uri + ModelVersion isPredictionInput_ModelVersion `protobuf_oneof:"model_version"` + // Required. The format of the input data files. + DataFormat PredictionInput_DataFormat `protobuf:"varint,3,opt,name=data_format,json=dataFormat,enum=google.cloud.ml.v1beta1.PredictionInput_DataFormat" json:"data_format,omitempty"` + // Required. The Google Cloud Storage location of the input data files. + // May contain wildcards. + InputPaths []string `protobuf:"bytes,4,rep,name=input_paths,json=inputPaths" json:"input_paths,omitempty"` + // Required. The output Google Cloud Storage location. + OutputPath string `protobuf:"bytes,5,opt,name=output_path,json=outputPath" json:"output_path,omitempty"` + // Optional. The maximum number of workers to be used for parallel processing. + // Defaults to 10 if not specified. + MaxWorkerCount int64 `protobuf:"varint,6,opt,name=max_worker_count,json=maxWorkerCount" json:"max_worker_count,omitempty"` + // Required. The Google Compute Engine region to run the prediction job in. + Region string `protobuf:"bytes,7,opt,name=region" json:"region,omitempty"` + // Optional. The Google Cloud ML runtime version to use for this batch + // prediction. If not set, Google Cloud ML will pick the runtime version used + // during the CreateVersion request for this model version, or choose the + // latest stable version when model version information is not available + // such as when the model is specified by uri. + RuntimeVersion string `protobuf:"bytes,8,opt,name=runtime_version,json=runtimeVersion" json:"runtime_version,omitempty"` +} + +func (m *PredictionInput) Reset() { *m = PredictionInput{} } +func (m *PredictionInput) String() string { return proto.CompactTextString(m) } +func (*PredictionInput) ProtoMessage() {} +func (*PredictionInput) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +type isPredictionInput_ModelVersion interface { + isPredictionInput_ModelVersion() +} + +type PredictionInput_ModelName struct { + ModelName string `protobuf:"bytes,1,opt,name=model_name,json=modelName,oneof"` +} +type PredictionInput_VersionName struct { + VersionName string `protobuf:"bytes,2,opt,name=version_name,json=versionName,oneof"` +} +type PredictionInput_Uri struct { + Uri string `protobuf:"bytes,9,opt,name=uri,oneof"` +} + +func (*PredictionInput_ModelName) isPredictionInput_ModelVersion() {} +func (*PredictionInput_VersionName) isPredictionInput_ModelVersion() {} +func (*PredictionInput_Uri) isPredictionInput_ModelVersion() {} + +func (m *PredictionInput) GetModelVersion() isPredictionInput_ModelVersion { + if m != nil { + return m.ModelVersion + } + return nil +} + +func (m *PredictionInput) GetModelName() string { + if x, ok := m.GetModelVersion().(*PredictionInput_ModelName); ok { + return x.ModelName + } + return "" +} + +func (m *PredictionInput) GetVersionName() string { + if x, ok := m.GetModelVersion().(*PredictionInput_VersionName); ok { + return x.VersionName + } + return "" +} + +func (m *PredictionInput) GetUri() string { + if x, ok := m.GetModelVersion().(*PredictionInput_Uri); ok { + return x.Uri + } + return "" +} + +func (m *PredictionInput) GetDataFormat() PredictionInput_DataFormat { + if m != nil { + return m.DataFormat + } + return PredictionInput_DATA_FORMAT_UNSPECIFIED +} + +func (m *PredictionInput) GetInputPaths() []string { + if m != nil { + return m.InputPaths + } + return nil +} + +func (m *PredictionInput) GetOutputPath() string { + if m != nil { + return m.OutputPath + } + return "" +} + +func (m *PredictionInput) GetMaxWorkerCount() int64 { + if m != nil { + return m.MaxWorkerCount + } + return 0 +} + +func (m *PredictionInput) GetRegion() string { + if m != nil { + return m.Region + } + return "" +} + +func (m *PredictionInput) GetRuntimeVersion() string { + if m != nil { + return m.RuntimeVersion + } + return "" +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*PredictionInput) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _PredictionInput_OneofMarshaler, _PredictionInput_OneofUnmarshaler, _PredictionInput_OneofSizer, []interface{}{ + (*PredictionInput_ModelName)(nil), + (*PredictionInput_VersionName)(nil), + (*PredictionInput_Uri)(nil), + } +} + +func _PredictionInput_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*PredictionInput) + // model_version + switch x := m.ModelVersion.(type) { + case *PredictionInput_ModelName: + b.EncodeVarint(1<<3 | proto.WireBytes) + b.EncodeStringBytes(x.ModelName) + case *PredictionInput_VersionName: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeStringBytes(x.VersionName) + case *PredictionInput_Uri: + b.EncodeVarint(9<<3 | proto.WireBytes) + b.EncodeStringBytes(x.Uri) + case nil: + default: + return fmt.Errorf("PredictionInput.ModelVersion has unexpected type %T", x) + } + return nil +} + +func _PredictionInput_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*PredictionInput) + switch tag { + case 1: // model_version.model_name + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.ModelVersion = &PredictionInput_ModelName{x} + return true, err + case 2: // model_version.version_name + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.ModelVersion = &PredictionInput_VersionName{x} + return true, err + case 9: // model_version.uri + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.ModelVersion = &PredictionInput_Uri{x} + return true, err + default: + return false, nil + } +} + +func _PredictionInput_OneofSizer(msg proto.Message) (n int) { + m := msg.(*PredictionInput) + // model_version + switch x := m.ModelVersion.(type) { + case *PredictionInput_ModelName: + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.ModelName))) + n += len(x.ModelName) + case *PredictionInput_VersionName: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.VersionName))) + n += len(x.VersionName) + case *PredictionInput_Uri: + n += proto.SizeVarint(9<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Uri))) + n += len(x.Uri) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Represents results of a prediction job. +type PredictionOutput struct { + // The output Google Cloud Storage location provided at the job creation time. + OutputPath string `protobuf:"bytes,1,opt,name=output_path,json=outputPath" json:"output_path,omitempty"` + // The number of generated predictions. + PredictionCount int64 `protobuf:"varint,2,opt,name=prediction_count,json=predictionCount" json:"prediction_count,omitempty"` + // The number of data instances which resulted in errors. + ErrorCount int64 `protobuf:"varint,3,opt,name=error_count,json=errorCount" json:"error_count,omitempty"` + // Node hours used by the batch prediction job. + NodeHours float64 `protobuf:"fixed64,4,opt,name=node_hours,json=nodeHours" json:"node_hours,omitempty"` +} + +func (m *PredictionOutput) Reset() { *m = PredictionOutput{} } +func (m *PredictionOutput) String() string { return proto.CompactTextString(m) } +func (*PredictionOutput) ProtoMessage() {} +func (*PredictionOutput) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *PredictionOutput) GetOutputPath() string { + if m != nil { + return m.OutputPath + } + return "" +} + +func (m *PredictionOutput) GetPredictionCount() int64 { + if m != nil { + return m.PredictionCount + } + return 0 +} + +func (m *PredictionOutput) GetErrorCount() int64 { + if m != nil { + return m.ErrorCount + } + return 0 +} + +func (m *PredictionOutput) GetNodeHours() float64 { + if m != nil { + return m.NodeHours + } + return 0 +} + +// Represents a training or prediction job. +type Job struct { + // Required. The user-specified id of the job. + JobId string `protobuf:"bytes,1,opt,name=job_id,json=jobId" json:"job_id,omitempty"` + // Required. Parameters to create a job. + // + // Types that are valid to be assigned to Input: + // *Job_TrainingInput + // *Job_PredictionInput + Input isJob_Input `protobuf_oneof:"input"` + // Output only. When the job was created. + CreateTime *google_protobuf2.Timestamp `protobuf:"bytes,4,opt,name=create_time,json=createTime" json:"create_time,omitempty"` + // Output only. When the job processing was started. + StartTime *google_protobuf2.Timestamp `protobuf:"bytes,5,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + // Output only. When the job processing was completed. + EndTime *google_protobuf2.Timestamp `protobuf:"bytes,6,opt,name=end_time,json=endTime" json:"end_time,omitempty"` + // Output only. The detailed state of a job. + State Job_State `protobuf:"varint,7,opt,name=state,enum=google.cloud.ml.v1beta1.Job_State" json:"state,omitempty"` + // Output only. The details of a failure or a cancellation. + ErrorMessage string `protobuf:"bytes,8,opt,name=error_message,json=errorMessage" json:"error_message,omitempty"` + // Output only. The current result of the job. + // + // Types that are valid to be assigned to Output: + // *Job_TrainingOutput + // *Job_PredictionOutput + Output isJob_Output `protobuf_oneof:"output"` +} + +func (m *Job) Reset() { *m = Job{} } +func (m *Job) String() string { return proto.CompactTextString(m) } +func (*Job) ProtoMessage() {} +func (*Job) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +type isJob_Input interface { + isJob_Input() +} +type isJob_Output interface { + isJob_Output() +} + +type Job_TrainingInput struct { + TrainingInput *TrainingInput `protobuf:"bytes,2,opt,name=training_input,json=trainingInput,oneof"` +} +type Job_PredictionInput struct { + PredictionInput *PredictionInput `protobuf:"bytes,3,opt,name=prediction_input,json=predictionInput,oneof"` +} +type Job_TrainingOutput struct { + TrainingOutput *TrainingOutput `protobuf:"bytes,9,opt,name=training_output,json=trainingOutput,oneof"` +} +type Job_PredictionOutput struct { + PredictionOutput *PredictionOutput `protobuf:"bytes,10,opt,name=prediction_output,json=predictionOutput,oneof"` +} + +func (*Job_TrainingInput) isJob_Input() {} +func (*Job_PredictionInput) isJob_Input() {} +func (*Job_TrainingOutput) isJob_Output() {} +func (*Job_PredictionOutput) isJob_Output() {} + +func (m *Job) GetInput() isJob_Input { + if m != nil { + return m.Input + } + return nil +} +func (m *Job) GetOutput() isJob_Output { + if m != nil { + return m.Output + } + return nil +} + +func (m *Job) GetJobId() string { + if m != nil { + return m.JobId + } + return "" +} + +func (m *Job) GetTrainingInput() *TrainingInput { + if x, ok := m.GetInput().(*Job_TrainingInput); ok { + return x.TrainingInput + } + return nil +} + +func (m *Job) GetPredictionInput() *PredictionInput { + if x, ok := m.GetInput().(*Job_PredictionInput); ok { + return x.PredictionInput + } + return nil +} + +func (m *Job) GetCreateTime() *google_protobuf2.Timestamp { + if m != nil { + return m.CreateTime + } + return nil +} + +func (m *Job) GetStartTime() *google_protobuf2.Timestamp { + if m != nil { + return m.StartTime + } + return nil +} + +func (m *Job) GetEndTime() *google_protobuf2.Timestamp { + if m != nil { + return m.EndTime + } + return nil +} + +func (m *Job) GetState() Job_State { + if m != nil { + return m.State + } + return Job_STATE_UNSPECIFIED +} + +func (m *Job) GetErrorMessage() string { + if m != nil { + return m.ErrorMessage + } + return "" +} + +func (m *Job) GetTrainingOutput() *TrainingOutput { + if x, ok := m.GetOutput().(*Job_TrainingOutput); ok { + return x.TrainingOutput + } + return nil +} + +func (m *Job) GetPredictionOutput() *PredictionOutput { + if x, ok := m.GetOutput().(*Job_PredictionOutput); ok { + return x.PredictionOutput + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Job) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _Job_OneofMarshaler, _Job_OneofUnmarshaler, _Job_OneofSizer, []interface{}{ + (*Job_TrainingInput)(nil), + (*Job_PredictionInput)(nil), + (*Job_TrainingOutput)(nil), + (*Job_PredictionOutput)(nil), + } +} + +func _Job_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Job) + // input + switch x := m.Input.(type) { + case *Job_TrainingInput: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.TrainingInput); err != nil { + return err + } + case *Job_PredictionInput: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.PredictionInput); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("Job.Input has unexpected type %T", x) + } + // output + switch x := m.Output.(type) { + case *Job_TrainingOutput: + b.EncodeVarint(9<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.TrainingOutput); err != nil { + return err + } + case *Job_PredictionOutput: + b.EncodeVarint(10<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.PredictionOutput); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("Job.Output has unexpected type %T", x) + } + return nil +} + +func _Job_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Job) + switch tag { + case 2: // input.training_input + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(TrainingInput) + err := b.DecodeMessage(msg) + m.Input = &Job_TrainingInput{msg} + return true, err + case 3: // input.prediction_input + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(PredictionInput) + err := b.DecodeMessage(msg) + m.Input = &Job_PredictionInput{msg} + return true, err + case 9: // output.training_output + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(TrainingOutput) + err := b.DecodeMessage(msg) + m.Output = &Job_TrainingOutput{msg} + return true, err + case 10: // output.prediction_output + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(PredictionOutput) + err := b.DecodeMessage(msg) + m.Output = &Job_PredictionOutput{msg} + return true, err + default: + return false, nil + } +} + +func _Job_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Job) + // input + switch x := m.Input.(type) { + case *Job_TrainingInput: + s := proto.Size(x.TrainingInput) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Job_PredictionInput: + s := proto.Size(x.PredictionInput) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + // output + switch x := m.Output.(type) { + case *Job_TrainingOutput: + s := proto.Size(x.TrainingOutput) + n += proto.SizeVarint(9<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Job_PredictionOutput: + s := proto.Size(x.PredictionOutput) + n += proto.SizeVarint(10<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Request message for the CreateJob method. +type CreateJobRequest struct { + // Required. The project name. + // + // Authorization: requires `Editor` role on the specified project. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // Required. The job to create. + Job *Job `protobuf:"bytes,2,opt,name=job" json:"job,omitempty"` +} + +func (m *CreateJobRequest) Reset() { *m = CreateJobRequest{} } +func (m *CreateJobRequest) String() string { return proto.CompactTextString(m) } +func (*CreateJobRequest) ProtoMessage() {} +func (*CreateJobRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *CreateJobRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *CreateJobRequest) GetJob() *Job { + if m != nil { + return m.Job + } + return nil +} + +// Request message for the ListJobs method. +type ListJobsRequest struct { + // Required. The name of the project for which to list jobs. + // + // Authorization: requires `Viewer` role on the specified project. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // Optional. Specifies the subset of jobs to retrieve. + Filter string `protobuf:"bytes,2,opt,name=filter" json:"filter,omitempty"` + // Optional. A page token to request the next page of results. + // + // You get the token from the `next_page_token` field of the response from + // the previous call. + PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` + // Optional. The number of jobs to retrieve per "page" of results. If there + // are more remaining results than this number, the response message will + // contain a valid value in the `next_page_token` field. + // + // The default value is 20, and the maximum page size is 100. + PageSize int32 `protobuf:"varint,5,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` +} + +func (m *ListJobsRequest) Reset() { *m = ListJobsRequest{} } +func (m *ListJobsRequest) String() string { return proto.CompactTextString(m) } +func (*ListJobsRequest) ProtoMessage() {} +func (*ListJobsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *ListJobsRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *ListJobsRequest) GetFilter() string { + if m != nil { + return m.Filter + } + return "" +} + +func (m *ListJobsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +func (m *ListJobsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +// Response message for the ListJobs method. +type ListJobsResponse struct { + // The list of jobs. + Jobs []*Job `protobuf:"bytes,1,rep,name=jobs" json:"jobs,omitempty"` + // Optional. Pass this token as the `page_token` field of the request for a + // subsequent call. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListJobsResponse) Reset() { *m = ListJobsResponse{} } +func (m *ListJobsResponse) String() string { return proto.CompactTextString(m) } +func (*ListJobsResponse) ProtoMessage() {} +func (*ListJobsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *ListJobsResponse) GetJobs() []*Job { + if m != nil { + return m.Jobs + } + return nil +} + +func (m *ListJobsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// Request message for the GetJob method. +type GetJobRequest struct { + // Required. The name of the job to get the description of. + // + // Authorization: requires `Viewer` role on the parent project. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetJobRequest) Reset() { *m = GetJobRequest{} } +func (m *GetJobRequest) String() string { return proto.CompactTextString(m) } +func (*GetJobRequest) ProtoMessage() {} +func (*GetJobRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } + +func (m *GetJobRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Request message for the CancelJob method. +type CancelJobRequest struct { + // Required. The name of the job to cancel. + // + // Authorization: requires `Editor` role on the parent project. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *CancelJobRequest) Reset() { *m = CancelJobRequest{} } +func (m *CancelJobRequest) String() string { return proto.CompactTextString(m) } +func (*CancelJobRequest) ProtoMessage() {} +func (*CancelJobRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } + +func (m *CancelJobRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func init() { + proto.RegisterType((*TrainingInput)(nil), "google.cloud.ml.v1beta1.TrainingInput") + proto.RegisterType((*HyperparameterSpec)(nil), "google.cloud.ml.v1beta1.HyperparameterSpec") + proto.RegisterType((*ParameterSpec)(nil), "google.cloud.ml.v1beta1.ParameterSpec") + proto.RegisterType((*HyperparameterOutput)(nil), "google.cloud.ml.v1beta1.HyperparameterOutput") + proto.RegisterType((*HyperparameterOutput_HyperparameterMetric)(nil), "google.cloud.ml.v1beta1.HyperparameterOutput.HyperparameterMetric") + proto.RegisterType((*TrainingOutput)(nil), "google.cloud.ml.v1beta1.TrainingOutput") + proto.RegisterType((*PredictionInput)(nil), "google.cloud.ml.v1beta1.PredictionInput") + proto.RegisterType((*PredictionOutput)(nil), "google.cloud.ml.v1beta1.PredictionOutput") + proto.RegisterType((*Job)(nil), "google.cloud.ml.v1beta1.Job") + proto.RegisterType((*CreateJobRequest)(nil), "google.cloud.ml.v1beta1.CreateJobRequest") + proto.RegisterType((*ListJobsRequest)(nil), "google.cloud.ml.v1beta1.ListJobsRequest") + proto.RegisterType((*ListJobsResponse)(nil), "google.cloud.ml.v1beta1.ListJobsResponse") + proto.RegisterType((*GetJobRequest)(nil), "google.cloud.ml.v1beta1.GetJobRequest") + proto.RegisterType((*CancelJobRequest)(nil), "google.cloud.ml.v1beta1.CancelJobRequest") + proto.RegisterEnum("google.cloud.ml.v1beta1.TrainingInput_ScaleTier", TrainingInput_ScaleTier_name, TrainingInput_ScaleTier_value) + proto.RegisterEnum("google.cloud.ml.v1beta1.HyperparameterSpec_GoalType", HyperparameterSpec_GoalType_name, HyperparameterSpec_GoalType_value) + proto.RegisterEnum("google.cloud.ml.v1beta1.ParameterSpec_ParameterType", ParameterSpec_ParameterType_name, ParameterSpec_ParameterType_value) + proto.RegisterEnum("google.cloud.ml.v1beta1.ParameterSpec_ScaleType", ParameterSpec_ScaleType_name, ParameterSpec_ScaleType_value) + proto.RegisterEnum("google.cloud.ml.v1beta1.PredictionInput_DataFormat", PredictionInput_DataFormat_name, PredictionInput_DataFormat_value) + proto.RegisterEnum("google.cloud.ml.v1beta1.Job_State", Job_State_name, Job_State_value) +} + +// 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 + +// Client API for JobService service + +type JobServiceClient interface { + // Creates a training or a batch prediction job. + CreateJob(ctx context.Context, in *CreateJobRequest, opts ...grpc.CallOption) (*Job, error) + // Lists the jobs in the project. + ListJobs(ctx context.Context, in *ListJobsRequest, opts ...grpc.CallOption) (*ListJobsResponse, error) + // Describes a job. + GetJob(ctx context.Context, in *GetJobRequest, opts ...grpc.CallOption) (*Job, error) + // Cancels a running job. + CancelJob(ctx context.Context, in *CancelJobRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) +} + +type jobServiceClient struct { + cc *grpc.ClientConn +} + +func NewJobServiceClient(cc *grpc.ClientConn) JobServiceClient { + return &jobServiceClient{cc} +} + +func (c *jobServiceClient) CreateJob(ctx context.Context, in *CreateJobRequest, opts ...grpc.CallOption) (*Job, error) { + out := new(Job) + err := grpc.Invoke(ctx, "/google.cloud.ml.v1beta1.JobService/CreateJob", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *jobServiceClient) ListJobs(ctx context.Context, in *ListJobsRequest, opts ...grpc.CallOption) (*ListJobsResponse, error) { + out := new(ListJobsResponse) + err := grpc.Invoke(ctx, "/google.cloud.ml.v1beta1.JobService/ListJobs", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *jobServiceClient) GetJob(ctx context.Context, in *GetJobRequest, opts ...grpc.CallOption) (*Job, error) { + out := new(Job) + err := grpc.Invoke(ctx, "/google.cloud.ml.v1beta1.JobService/GetJob", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *jobServiceClient) CancelJob(ctx context.Context, in *CancelJobRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { + out := new(google_protobuf1.Empty) + err := grpc.Invoke(ctx, "/google.cloud.ml.v1beta1.JobService/CancelJob", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for JobService service + +type JobServiceServer interface { + // Creates a training or a batch prediction job. + CreateJob(context.Context, *CreateJobRequest) (*Job, error) + // Lists the jobs in the project. + ListJobs(context.Context, *ListJobsRequest) (*ListJobsResponse, error) + // Describes a job. + GetJob(context.Context, *GetJobRequest) (*Job, error) + // Cancels a running job. + CancelJob(context.Context, *CancelJobRequest) (*google_protobuf1.Empty, error) +} + +func RegisterJobServiceServer(s *grpc.Server, srv JobServiceServer) { + s.RegisterService(&_JobService_serviceDesc, srv) +} + +func _JobService_CreateJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateJobRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(JobServiceServer).CreateJob(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.ml.v1beta1.JobService/CreateJob", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(JobServiceServer).CreateJob(ctx, req.(*CreateJobRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _JobService_ListJobs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListJobsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(JobServiceServer).ListJobs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.ml.v1beta1.JobService/ListJobs", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(JobServiceServer).ListJobs(ctx, req.(*ListJobsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _JobService_GetJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetJobRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(JobServiceServer).GetJob(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.ml.v1beta1.JobService/GetJob", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(JobServiceServer).GetJob(ctx, req.(*GetJobRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _JobService_CancelJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CancelJobRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(JobServiceServer).CancelJob(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.ml.v1beta1.JobService/CancelJob", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(JobServiceServer).CancelJob(ctx, req.(*CancelJobRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _JobService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.cloud.ml.v1beta1.JobService", + HandlerType: (*JobServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateJob", + Handler: _JobService_CreateJob_Handler, + }, + { + MethodName: "ListJobs", + Handler: _JobService_ListJobs_Handler, + }, + { + MethodName: "GetJob", + Handler: _JobService_GetJob_Handler, + }, + { + MethodName: "CancelJob", + Handler: _JobService_CancelJob_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/cloud/ml/v1beta1/job_service.proto", +} + +func init() { proto.RegisterFile("google/cloud/ml/v1beta1/job_service.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 2082 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0x4b, 0x6f, 0x1b, 0xc9, + 0x11, 0x16, 0x9f, 0x22, 0x8b, 0x12, 0x39, 0x6e, 0x5b, 0x36, 0x2d, 0x7b, 0x63, 0x79, 0x8c, 0x78, + 0x65, 0x07, 0x26, 0xd7, 0xf2, 0x06, 0xd8, 0xf5, 0x22, 0x09, 0x28, 0x72, 0x2c, 0x51, 0x10, 0x1f, + 0x69, 0x0e, 0x1d, 0xc7, 0x08, 0x30, 0x68, 0x92, 0x6d, 0x7a, 0xe4, 0x99, 0xe9, 0xc9, 0x4c, 0xd3, + 0x91, 0x36, 0x30, 0x10, 0x24, 0x39, 0xe5, 0x90, 0x4b, 0x90, 0x1c, 0x03, 0xe4, 0x9a, 0xbf, 0x93, + 0x43, 0xfe, 0x40, 0x8e, 0xf9, 0x01, 0x39, 0x06, 0xfd, 0xe0, 0x53, 0x96, 0xe4, 0x45, 0x72, 0x63, + 0x7f, 0xf5, 0x55, 0x55, 0x77, 0x55, 0x75, 0x4d, 0x35, 0xe1, 0xd1, 0x98, 0xb1, 0xb1, 0x47, 0xab, + 0x43, 0x8f, 0x4d, 0x46, 0x55, 0xdf, 0xab, 0xbe, 0x7f, 0x3a, 0xa0, 0x9c, 0x3c, 0xad, 0x9e, 0xb0, + 0x81, 0x13, 0xd3, 0xe8, 0xbd, 0x3b, 0xa4, 0x95, 0x30, 0x62, 0x9c, 0xa1, 0x5b, 0x8a, 0x5a, 0x91, + 0xd4, 0x8a, 0xef, 0x55, 0x34, 0x75, 0xfb, 0xae, 0xb6, 0x41, 0x42, 0xb7, 0x4a, 0x82, 0x80, 0x71, + 0xc2, 0x5d, 0x16, 0xc4, 0x4a, 0x6d, 0x7b, 0x6b, 0x51, 0x3a, 0xe1, 0x6f, 0x35, 0x7c, 0x47, 0xc3, + 0x72, 0x35, 0x98, 0xbc, 0xa9, 0x52, 0x3f, 0xe4, 0x67, 0x5a, 0x78, 0x6f, 0x55, 0xc8, 0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 0xf3, 0xa1, 0xb4, 0xf9, 0x3c, 0xf1, 0x78, 0x9f, + 0xc1, 0xbd, 0x21, 0xf3, 0xcf, 0x39, 0x27, 0xa1, 0x3b, 0xdd, 0xc0, 0x7e, 0x69, 0x5e, 0x43, 0x5d, + 0xe1, 0xb1, 0x9b, 0x78, 0xfd, 0xb5, 0xe6, 0x8f, 0x99, 0x47, 0x82, 0x71, 0x85, 0x45, 0xe3, 0xea, + 0x98, 0x06, 0x72, 0x3f, 0x55, 0x25, 0x22, 0xa1, 0x1b, 0x9f, 0xfb, 0x67, 0xee, 0x1b, 0xdf, 0x1b, + 0x64, 0x25, 0xeb, 0xd9, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xaf, 0x10, 0x62, 0xa8, 0xbe, 0x13, + 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/ml/v1beta1/model_service.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/ml/v1beta1/model_service.pb.go new file mode 100644 index 0000000000..486865db64 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/ml/v1beta1/model_service.pb.go @@ -0,0 +1,1050 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/ml/v1beta1/model_service.proto + +package ml + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import _ "google.golang.org/genproto/googleapis/api/serviceconfig" +import google_longrunning "google.golang.org/genproto/googleapis/longrunning" +import google_protobuf2 "github.com/golang/protobuf/ptypes/timestamp" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Represents a machine learning solution. +// +// A model can have multiple versions, each of which is a deployed, trained +// model ready to receive prediction requests. The model itself is just a +// container. +type Model struct { + // Required. The name specified for the model when it was created. + // + // The model name must be unique within the project it is created in. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Optional. The description specified for the model when it was created. + Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` + // Output only. The default version of the model. This version will be used to + // handle prediction requests that do not specify a version. + // + // You can change the default version by calling + // [projects.methods.versions.setDefault](/ml/reference/rest/v1beta1/projects.models.versions/setDefault). + DefaultVersion *Version `protobuf:"bytes,3,opt,name=default_version,json=defaultVersion" json:"default_version,omitempty"` + // Optional. The list of regions where the model is going to be deployed. + // Currently only one region per model is supported. + // Defaults to 'us-central1' if nothing is set. + Regions []string `protobuf:"bytes,4,rep,name=regions" json:"regions,omitempty"` + // Optional. If true, enables StackDriver Logging for online prediction. + // Default is false. + OnlinePredictionLogging bool `protobuf:"varint,5,opt,name=online_prediction_logging,json=onlinePredictionLogging" json:"online_prediction_logging,omitempty"` +} + +func (m *Model) Reset() { *m = Model{} } +func (m *Model) String() string { return proto.CompactTextString(m) } +func (*Model) ProtoMessage() {} +func (*Model) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +func (m *Model) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Model) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *Model) GetDefaultVersion() *Version { + if m != nil { + return m.DefaultVersion + } + return nil +} + +func (m *Model) GetRegions() []string { + if m != nil { + return m.Regions + } + return nil +} + +func (m *Model) GetOnlinePredictionLogging() bool { + if m != nil { + return m.OnlinePredictionLogging + } + return false +} + +// Represents a version of the model. +// +// Each version is a trained model deployed in the cloud, ready to handle +// prediction requests. A model can have multiple versions. You can get +// information about all of the versions of a given model by calling +// [projects.models.versions.list](/ml/reference/rest/v1beta1/projects.models.versions/list). +type Version struct { + // Required.The name specified for the version when it was created. + // + // The version name must be unique within the model it is created in. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Optional. The description specified for the version when it was created. + Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` + // Output only. If true, this version will be used to handle prediction + // requests that do not specify a version. + // + // You can change the default version by calling + // [projects.methods.versions.setDefault](/ml/reference/rest/v1beta1/projects.models.versions/setDefault). + IsDefault bool `protobuf:"varint,3,opt,name=is_default,json=isDefault" json:"is_default,omitempty"` + // Required. The Google Cloud Storage location of the trained model used to + // create the version. See the + // [overview of model deployment](/ml/docs/concepts/deployment-overview) for + // more informaiton. + // + // When passing Version to + // [projects.models.versions.create](/ml/reference/rest/v1beta1/projects.models.versions/create) + // the model service uses the specified location as the source of the model. + // Once deployed, the model version is hosted by the prediction service, so + // this location is useful only as a historical record. + DeploymentUri string `protobuf:"bytes,4,opt,name=deployment_uri,json=deploymentUri" json:"deployment_uri,omitempty"` + // Output only. The time the version was created. + CreateTime *google_protobuf2.Timestamp `protobuf:"bytes,5,opt,name=create_time,json=createTime" json:"create_time,omitempty"` + // Output only. The time the version was last used for prediction. + LastUseTime *google_protobuf2.Timestamp `protobuf:"bytes,6,opt,name=last_use_time,json=lastUseTime" json:"last_use_time,omitempty"` + // Optional. The Google Cloud ML runtime version to use for this deployment. + // If not set, Google Cloud ML will choose a version. + RuntimeVersion string `protobuf:"bytes,8,opt,name=runtime_version,json=runtimeVersion" json:"runtime_version,omitempty"` + // Optional. Manually select the number of nodes to use for serving the + // model. If unset (i.e., by default), the number of nodes used to serve + // the model automatically scales with traffic. However, care should be + // taken to ramp up traffic according to the model's ability to scale. If + // your model needs to handle bursts of traffic beyond it's ability to + // scale, it is recommended you set this field appropriately. + ManualScaling *ManualScaling `protobuf:"bytes,9,opt,name=manual_scaling,json=manualScaling" json:"manual_scaling,omitempty"` +} + +func (m *Version) Reset() { *m = Version{} } +func (m *Version) String() string { return proto.CompactTextString(m) } +func (*Version) ProtoMessage() {} +func (*Version) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} } + +func (m *Version) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Version) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *Version) GetIsDefault() bool { + if m != nil { + return m.IsDefault + } + return false +} + +func (m *Version) GetDeploymentUri() string { + if m != nil { + return m.DeploymentUri + } + return "" +} + +func (m *Version) GetCreateTime() *google_protobuf2.Timestamp { + if m != nil { + return m.CreateTime + } + return nil +} + +func (m *Version) GetLastUseTime() *google_protobuf2.Timestamp { + if m != nil { + return m.LastUseTime + } + return nil +} + +func (m *Version) GetRuntimeVersion() string { + if m != nil { + return m.RuntimeVersion + } + return "" +} + +func (m *Version) GetManualScaling() *ManualScaling { + if m != nil { + return m.ManualScaling + } + return nil +} + +// Options for manually scaling a model. +type ManualScaling struct { + // The number of nodes to allocate for this model. These nodes are always up, + // starting from the time the model is deployed, so the cost of operating + // this model will be proportional to nodes * number of hours since + // deployment. + Nodes int32 `protobuf:"varint,1,opt,name=nodes" json:"nodes,omitempty"` +} + +func (m *ManualScaling) Reset() { *m = ManualScaling{} } +func (m *ManualScaling) String() string { return proto.CompactTextString(m) } +func (*ManualScaling) ProtoMessage() {} +func (*ManualScaling) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} } + +func (m *ManualScaling) GetNodes() int32 { + if m != nil { + return m.Nodes + } + return 0 +} + +// Request message for the CreateModel method. +type CreateModelRequest struct { + // Required. The project name. + // + // Authorization: requires `Editor` role on the specified project. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // Required. The model to create. + Model *Model `protobuf:"bytes,2,opt,name=model" json:"model,omitempty"` +} + +func (m *CreateModelRequest) Reset() { *m = CreateModelRequest{} } +func (m *CreateModelRequest) String() string { return proto.CompactTextString(m) } +func (*CreateModelRequest) ProtoMessage() {} +func (*CreateModelRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{3} } + +func (m *CreateModelRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *CreateModelRequest) GetModel() *Model { + if m != nil { + return m.Model + } + return nil +} + +// Request message for the ListModels method. +type ListModelsRequest struct { + // Required. The name of the project whose models are to be listed. + // + // Authorization: requires `Viewer` role on the specified project. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // Optional. A page token to request the next page of results. + // + // You get the token from the `next_page_token` field of the response from + // the previous call. + PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` + // Optional. The number of models to retrieve per "page" of results. If there + // are more remaining results than this number, the response message will + // contain a valid value in the `next_page_token` field. + // + // The default value is 20, and the maximum page size is 100. + PageSize int32 `protobuf:"varint,5,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` +} + +func (m *ListModelsRequest) Reset() { *m = ListModelsRequest{} } +func (m *ListModelsRequest) String() string { return proto.CompactTextString(m) } +func (*ListModelsRequest) ProtoMessage() {} +func (*ListModelsRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{4} } + +func (m *ListModelsRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *ListModelsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +func (m *ListModelsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +// Response message for the ListModels method. +type ListModelsResponse struct { + // The list of models. + Models []*Model `protobuf:"bytes,1,rep,name=models" json:"models,omitempty"` + // Optional. Pass this token as the `page_token` field of the request for a + // subsequent call. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListModelsResponse) Reset() { *m = ListModelsResponse{} } +func (m *ListModelsResponse) String() string { return proto.CompactTextString(m) } +func (*ListModelsResponse) ProtoMessage() {} +func (*ListModelsResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{5} } + +func (m *ListModelsResponse) GetModels() []*Model { + if m != nil { + return m.Models + } + return nil +} + +func (m *ListModelsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// Request message for the GetModel method. +type GetModelRequest struct { + // Required. The name of the model. + // + // Authorization: requires `Viewer` role on the parent project. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetModelRequest) Reset() { *m = GetModelRequest{} } +func (m *GetModelRequest) String() string { return proto.CompactTextString(m) } +func (*GetModelRequest) ProtoMessage() {} +func (*GetModelRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{6} } + +func (m *GetModelRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Request message for the DeleteModel method. +type DeleteModelRequest struct { + // Required. The name of the model. + // + // Authorization: requires `Editor` role on the parent project. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *DeleteModelRequest) Reset() { *m = DeleteModelRequest{} } +func (m *DeleteModelRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteModelRequest) ProtoMessage() {} +func (*DeleteModelRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{7} } + +func (m *DeleteModelRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Uploads the provided trained model version to Cloud Machine Learning. +type CreateVersionRequest struct { + // Required. The name of the model. + // + // Authorization: requires `Editor` role on the parent project. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // Required. The version details. + Version *Version `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"` +} + +func (m *CreateVersionRequest) Reset() { *m = CreateVersionRequest{} } +func (m *CreateVersionRequest) String() string { return proto.CompactTextString(m) } +func (*CreateVersionRequest) ProtoMessage() {} +func (*CreateVersionRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{8} } + +func (m *CreateVersionRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *CreateVersionRequest) GetVersion() *Version { + if m != nil { + return m.Version + } + return nil +} + +// Request message for the ListVersions method. +type ListVersionsRequest struct { + // Required. The name of the model for which to list the version. + // + // Authorization: requires `Viewer` role on the parent project. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // Optional. A page token to request the next page of results. + // + // You get the token from the `next_page_token` field of the response from + // the previous call. + PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` + // Optional. The number of versions to retrieve per "page" of results. If + // there are more remaining results than this number, the response message + // will contain a valid value in the `next_page_token` field. + // + // The default value is 20, and the maximum page size is 100. + PageSize int32 `protobuf:"varint,5,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` +} + +func (m *ListVersionsRequest) Reset() { *m = ListVersionsRequest{} } +func (m *ListVersionsRequest) String() string { return proto.CompactTextString(m) } +func (*ListVersionsRequest) ProtoMessage() {} +func (*ListVersionsRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{9} } + +func (m *ListVersionsRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *ListVersionsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +func (m *ListVersionsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +// Response message for the ListVersions method. +type ListVersionsResponse struct { + // The list of versions. + Versions []*Version `protobuf:"bytes,1,rep,name=versions" json:"versions,omitempty"` + // Optional. Pass this token as the `page_token` field of the request for a + // subsequent call. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListVersionsResponse) Reset() { *m = ListVersionsResponse{} } +func (m *ListVersionsResponse) String() string { return proto.CompactTextString(m) } +func (*ListVersionsResponse) ProtoMessage() {} +func (*ListVersionsResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{10} } + +func (m *ListVersionsResponse) GetVersions() []*Version { + if m != nil { + return m.Versions + } + return nil +} + +func (m *ListVersionsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// Request message for the GetVersion method. +type GetVersionRequest struct { + // Required. The name of the version. + // + // Authorization: requires `Viewer` role on the parent project. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetVersionRequest) Reset() { *m = GetVersionRequest{} } +func (m *GetVersionRequest) String() string { return proto.CompactTextString(m) } +func (*GetVersionRequest) ProtoMessage() {} +func (*GetVersionRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{11} } + +func (m *GetVersionRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Request message for the DeleteVerionRequest method. +type DeleteVersionRequest struct { + // Required. The name of the version. You can get the names of all the + // versions of a model by calling + // [projects.models.versions.list](/ml/reference/rest/v1beta1/projects.models.versions/list). + // + // Authorization: requires `Editor` role on the parent project. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *DeleteVersionRequest) Reset() { *m = DeleteVersionRequest{} } +func (m *DeleteVersionRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteVersionRequest) ProtoMessage() {} +func (*DeleteVersionRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{12} } + +func (m *DeleteVersionRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Request message for the SetDefaultVersion request. +type SetDefaultVersionRequest struct { + // Required. The name of the version to make the default for the model. You + // can get the names of all the versions of a model by calling + // [projects.models.versions.list](/ml/reference/rest/v1beta1/projects.models.versions/list). + // + // Authorization: requires `Editor` role on the parent project. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *SetDefaultVersionRequest) Reset() { *m = SetDefaultVersionRequest{} } +func (m *SetDefaultVersionRequest) String() string { return proto.CompactTextString(m) } +func (*SetDefaultVersionRequest) ProtoMessage() {} +func (*SetDefaultVersionRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{13} } + +func (m *SetDefaultVersionRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func init() { + proto.RegisterType((*Model)(nil), "google.cloud.ml.v1beta1.Model") + proto.RegisterType((*Version)(nil), "google.cloud.ml.v1beta1.Version") + proto.RegisterType((*ManualScaling)(nil), "google.cloud.ml.v1beta1.ManualScaling") + proto.RegisterType((*CreateModelRequest)(nil), "google.cloud.ml.v1beta1.CreateModelRequest") + proto.RegisterType((*ListModelsRequest)(nil), "google.cloud.ml.v1beta1.ListModelsRequest") + proto.RegisterType((*ListModelsResponse)(nil), "google.cloud.ml.v1beta1.ListModelsResponse") + proto.RegisterType((*GetModelRequest)(nil), "google.cloud.ml.v1beta1.GetModelRequest") + proto.RegisterType((*DeleteModelRequest)(nil), "google.cloud.ml.v1beta1.DeleteModelRequest") + proto.RegisterType((*CreateVersionRequest)(nil), "google.cloud.ml.v1beta1.CreateVersionRequest") + proto.RegisterType((*ListVersionsRequest)(nil), "google.cloud.ml.v1beta1.ListVersionsRequest") + proto.RegisterType((*ListVersionsResponse)(nil), "google.cloud.ml.v1beta1.ListVersionsResponse") + proto.RegisterType((*GetVersionRequest)(nil), "google.cloud.ml.v1beta1.GetVersionRequest") + proto.RegisterType((*DeleteVersionRequest)(nil), "google.cloud.ml.v1beta1.DeleteVersionRequest") + proto.RegisterType((*SetDefaultVersionRequest)(nil), "google.cloud.ml.v1beta1.SetDefaultVersionRequest") +} + +// 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 + +// Client API for ModelService service + +type ModelServiceClient interface { + // Creates a model which will later contain one or more versions. + // + // You must add at least one version before you can request predictions from + // the model. Add versions by calling + // [projects.models.versions.create](/ml/reference/rest/v1beta1/projects.models.versions/create). + CreateModel(ctx context.Context, in *CreateModelRequest, opts ...grpc.CallOption) (*Model, error) + // Lists the models in a project. + // + // Each project can contain multiple models, and each model can have multiple + // versions. + ListModels(ctx context.Context, in *ListModelsRequest, opts ...grpc.CallOption) (*ListModelsResponse, error) + // Gets information about a model, including its name, the description (if + // set), and the default version (if at least one version of the model has + // been deployed). + GetModel(ctx context.Context, in *GetModelRequest, opts ...grpc.CallOption) (*Model, error) + // Deletes a model. + // + // You can only delete a model if there are no versions in it. You can delete + // versions by calling + // [projects.models.versions.delete](/ml/reference/rest/v1beta1/projects.models.versions/delete). + DeleteModel(ctx context.Context, in *DeleteModelRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Creates a new version of a model from a trained TensorFlow model. + // + // If the version created in the cloud by this call is the first deployed + // version of the specified model, it will be made the default version of the + // model. When you add a version to a model that already has one or more + // versions, the default version does not automatically change. If you want a + // new version to be the default, you must call + // [projects.models.versions.setDefault](/ml/reference/rest/v1beta1/projects.models.versions/setDefault). + CreateVersion(ctx context.Context, in *CreateVersionRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Gets basic information about all the versions of a model. + // + // If you expect that a model has a lot of versions, or if you need to handle + // only a limited number of results at a time, you can request that the list + // be retrieved in batches (called pages): + ListVersions(ctx context.Context, in *ListVersionsRequest, opts ...grpc.CallOption) (*ListVersionsResponse, error) + // Gets information about a model version. + // + // Models can have multiple versions. You can call + // [projects.models.versions.list](/ml/reference/rest/v1beta1/projects.models.versions/list) + // to get the same information that this method returns for all of the + // versions of a model. + GetVersion(ctx context.Context, in *GetVersionRequest, opts ...grpc.CallOption) (*Version, error) + // Deletes a model version. + // + // Each model can have multiple versions deployed and in use at any given + // time. Use this method to remove a single version. + // + // Note: You cannot delete the version that is set as the default version + // of the model unless it is the only remaining version. + DeleteVersion(ctx context.Context, in *DeleteVersionRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Designates a version to be the default for the model. + // + // The default version is used for prediction requests made against the model + // that don't specify a version. + // + // The first version to be created for a model is automatically set as the + // default. You must make any subsequent changes to the default version + // setting manually using this method. + SetDefaultVersion(ctx context.Context, in *SetDefaultVersionRequest, opts ...grpc.CallOption) (*Version, error) +} + +type modelServiceClient struct { + cc *grpc.ClientConn +} + +func NewModelServiceClient(cc *grpc.ClientConn) ModelServiceClient { + return &modelServiceClient{cc} +} + +func (c *modelServiceClient) CreateModel(ctx context.Context, in *CreateModelRequest, opts ...grpc.CallOption) (*Model, error) { + out := new(Model) + err := grpc.Invoke(ctx, "/google.cloud.ml.v1beta1.ModelService/CreateModel", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *modelServiceClient) ListModels(ctx context.Context, in *ListModelsRequest, opts ...grpc.CallOption) (*ListModelsResponse, error) { + out := new(ListModelsResponse) + err := grpc.Invoke(ctx, "/google.cloud.ml.v1beta1.ModelService/ListModels", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *modelServiceClient) GetModel(ctx context.Context, in *GetModelRequest, opts ...grpc.CallOption) (*Model, error) { + out := new(Model) + err := grpc.Invoke(ctx, "/google.cloud.ml.v1beta1.ModelService/GetModel", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *modelServiceClient) DeleteModel(ctx context.Context, in *DeleteModelRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.cloud.ml.v1beta1.ModelService/DeleteModel", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *modelServiceClient) CreateVersion(ctx context.Context, in *CreateVersionRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.cloud.ml.v1beta1.ModelService/CreateVersion", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *modelServiceClient) ListVersions(ctx context.Context, in *ListVersionsRequest, opts ...grpc.CallOption) (*ListVersionsResponse, error) { + out := new(ListVersionsResponse) + err := grpc.Invoke(ctx, "/google.cloud.ml.v1beta1.ModelService/ListVersions", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *modelServiceClient) GetVersion(ctx context.Context, in *GetVersionRequest, opts ...grpc.CallOption) (*Version, error) { + out := new(Version) + err := grpc.Invoke(ctx, "/google.cloud.ml.v1beta1.ModelService/GetVersion", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *modelServiceClient) DeleteVersion(ctx context.Context, in *DeleteVersionRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.cloud.ml.v1beta1.ModelService/DeleteVersion", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *modelServiceClient) SetDefaultVersion(ctx context.Context, in *SetDefaultVersionRequest, opts ...grpc.CallOption) (*Version, error) { + out := new(Version) + err := grpc.Invoke(ctx, "/google.cloud.ml.v1beta1.ModelService/SetDefaultVersion", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for ModelService service + +type ModelServiceServer interface { + // Creates a model which will later contain one or more versions. + // + // You must add at least one version before you can request predictions from + // the model. Add versions by calling + // [projects.models.versions.create](/ml/reference/rest/v1beta1/projects.models.versions/create). + CreateModel(context.Context, *CreateModelRequest) (*Model, error) + // Lists the models in a project. + // + // Each project can contain multiple models, and each model can have multiple + // versions. + ListModels(context.Context, *ListModelsRequest) (*ListModelsResponse, error) + // Gets information about a model, including its name, the description (if + // set), and the default version (if at least one version of the model has + // been deployed). + GetModel(context.Context, *GetModelRequest) (*Model, error) + // Deletes a model. + // + // You can only delete a model if there are no versions in it. You can delete + // versions by calling + // [projects.models.versions.delete](/ml/reference/rest/v1beta1/projects.models.versions/delete). + DeleteModel(context.Context, *DeleteModelRequest) (*google_longrunning.Operation, error) + // Creates a new version of a model from a trained TensorFlow model. + // + // If the version created in the cloud by this call is the first deployed + // version of the specified model, it will be made the default version of the + // model. When you add a version to a model that already has one or more + // versions, the default version does not automatically change. If you want a + // new version to be the default, you must call + // [projects.models.versions.setDefault](/ml/reference/rest/v1beta1/projects.models.versions/setDefault). + CreateVersion(context.Context, *CreateVersionRequest) (*google_longrunning.Operation, error) + // Gets basic information about all the versions of a model. + // + // If you expect that a model has a lot of versions, or if you need to handle + // only a limited number of results at a time, you can request that the list + // be retrieved in batches (called pages): + ListVersions(context.Context, *ListVersionsRequest) (*ListVersionsResponse, error) + // Gets information about a model version. + // + // Models can have multiple versions. You can call + // [projects.models.versions.list](/ml/reference/rest/v1beta1/projects.models.versions/list) + // to get the same information that this method returns for all of the + // versions of a model. + GetVersion(context.Context, *GetVersionRequest) (*Version, error) + // Deletes a model version. + // + // Each model can have multiple versions deployed and in use at any given + // time. Use this method to remove a single version. + // + // Note: You cannot delete the version that is set as the default version + // of the model unless it is the only remaining version. + DeleteVersion(context.Context, *DeleteVersionRequest) (*google_longrunning.Operation, error) + // Designates a version to be the default for the model. + // + // The default version is used for prediction requests made against the model + // that don't specify a version. + // + // The first version to be created for a model is automatically set as the + // default. You must make any subsequent changes to the default version + // setting manually using this method. + SetDefaultVersion(context.Context, *SetDefaultVersionRequest) (*Version, error) +} + +func RegisterModelServiceServer(s *grpc.Server, srv ModelServiceServer) { + s.RegisterService(&_ModelService_serviceDesc, srv) +} + +func _ModelService_CreateModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateModelRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ModelServiceServer).CreateModel(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.ml.v1beta1.ModelService/CreateModel", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ModelServiceServer).CreateModel(ctx, req.(*CreateModelRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ModelService_ListModels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListModelsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ModelServiceServer).ListModels(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.ml.v1beta1.ModelService/ListModels", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ModelServiceServer).ListModels(ctx, req.(*ListModelsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ModelService_GetModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetModelRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ModelServiceServer).GetModel(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.ml.v1beta1.ModelService/GetModel", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ModelServiceServer).GetModel(ctx, req.(*GetModelRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ModelService_DeleteModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteModelRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ModelServiceServer).DeleteModel(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.ml.v1beta1.ModelService/DeleteModel", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ModelServiceServer).DeleteModel(ctx, req.(*DeleteModelRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ModelService_CreateVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateVersionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ModelServiceServer).CreateVersion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.ml.v1beta1.ModelService/CreateVersion", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ModelServiceServer).CreateVersion(ctx, req.(*CreateVersionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ModelService_ListVersions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListVersionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ModelServiceServer).ListVersions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.ml.v1beta1.ModelService/ListVersions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ModelServiceServer).ListVersions(ctx, req.(*ListVersionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ModelService_GetVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetVersionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ModelServiceServer).GetVersion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.ml.v1beta1.ModelService/GetVersion", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ModelServiceServer).GetVersion(ctx, req.(*GetVersionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ModelService_DeleteVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteVersionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ModelServiceServer).DeleteVersion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.ml.v1beta1.ModelService/DeleteVersion", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ModelServiceServer).DeleteVersion(ctx, req.(*DeleteVersionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ModelService_SetDefaultVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetDefaultVersionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ModelServiceServer).SetDefaultVersion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.ml.v1beta1.ModelService/SetDefaultVersion", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ModelServiceServer).SetDefaultVersion(ctx, req.(*SetDefaultVersionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _ModelService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.cloud.ml.v1beta1.ModelService", + HandlerType: (*ModelServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateModel", + Handler: _ModelService_CreateModel_Handler, + }, + { + MethodName: "ListModels", + Handler: _ModelService_ListModels_Handler, + }, + { + MethodName: "GetModel", + Handler: _ModelService_GetModel_Handler, + }, + { + MethodName: "DeleteModel", + Handler: _ModelService_DeleteModel_Handler, + }, + { + MethodName: "CreateVersion", + Handler: _ModelService_CreateVersion_Handler, + }, + { + MethodName: "ListVersions", + Handler: _ModelService_ListVersions_Handler, + }, + { + MethodName: "GetVersion", + Handler: _ModelService_GetVersion_Handler, + }, + { + MethodName: "DeleteVersion", + Handler: _ModelService_DeleteVersion_Handler, + }, + { + MethodName: "SetDefaultVersion", + Handler: _ModelService_SetDefaultVersion_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/cloud/ml/v1beta1/model_service.proto", +} + +func init() { proto.RegisterFile("google/cloud/ml/v1beta1/model_service.proto", fileDescriptor1) } + +var fileDescriptor1 = []byte{ + // 1013 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0xcf, 0x6f, 0x1b, 0x45, + 0x14, 0xd6, 0x26, 0x71, 0x62, 0x3f, 0xd7, 0x89, 0x32, 0x04, 0x6a, 0x0c, 0xa1, 0xd6, 0x56, 0x69, + 0x2d, 0xa7, 0xdd, 0x25, 0x06, 0x55, 0x8a, 0x0b, 0x45, 0x2a, 0x91, 0x2a, 0xa4, 0x46, 0x44, 0x9b, + 0x96, 0x03, 0x97, 0xd5, 0xc6, 0x9e, 0x2e, 0x53, 0x76, 0x67, 0xb6, 0x3b, 0xb3, 0x11, 0x14, 0x7a, + 0x80, 0x03, 0x47, 0x0e, 0x20, 0xae, 0x5c, 0xb8, 0xf3, 0xcf, 0x70, 0xe7, 0x84, 0xf8, 0x23, 0x38, + 0xa1, 0xf9, 0xb1, 0xce, 0x3a, 0xfe, 0xb1, 0x1b, 0x24, 0x6e, 0x9e, 0x37, 0xdf, 0x9b, 0xf7, 0xcd, + 0xfb, 0xde, 0x7b, 0x3b, 0x86, 0xfd, 0x90, 0xb1, 0x30, 0xc2, 0xee, 0x28, 0x62, 0xd9, 0xd8, 0x8d, + 0x23, 0xf7, 0xfc, 0xe0, 0x0c, 0x8b, 0xe0, 0xc0, 0x8d, 0xd9, 0x18, 0x47, 0x3e, 0xc7, 0xe9, 0x39, + 0x19, 0x61, 0x27, 0x49, 0x99, 0x60, 0xe8, 0xba, 0x06, 0x3b, 0x0a, 0xec, 0xc4, 0x91, 0x63, 0xc0, + 0x9d, 0xb7, 0xcd, 0x29, 0x41, 0x42, 0xdc, 0x80, 0x52, 0x26, 0x02, 0x41, 0x18, 0xe5, 0xda, 0xad, + 0xf3, 0x7a, 0x71, 0x37, 0x13, 0x5f, 0x18, 0xf3, 0x4d, 0x63, 0x8e, 0x18, 0x0d, 0xd3, 0x8c, 0x52, + 0x42, 0x43, 0x97, 0x25, 0x38, 0x9d, 0xf2, 0xbd, 0x61, 0x40, 0x6a, 0x75, 0x96, 0x3d, 0x73, 0x05, + 0x89, 0x31, 0x17, 0x41, 0x9c, 0x68, 0x80, 0xfd, 0xa7, 0x05, 0xb5, 0x63, 0xc9, 0x15, 0x21, 0x58, + 0xa3, 0x41, 0x8c, 0xdb, 0x56, 0xd7, 0xea, 0x35, 0x3c, 0xf5, 0x1b, 0x75, 0xa1, 0x39, 0xc6, 0x7c, + 0x94, 0x92, 0x44, 0x1e, 0xda, 0x5e, 0x51, 0x5b, 0x45, 0x13, 0xfa, 0x04, 0xb6, 0xc6, 0xf8, 0x59, + 0x90, 0x45, 0xc2, 0x3f, 0xc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 0xf1, 0x08, 0x59, 0x14, 0xd0, 0xd0, + 0x61, 0x69, 0xe8, 0x86, 0x98, 0xaa, 0x37, 0x9e, 0xab, 0xb7, 0x82, 0x84, 0xf0, 0x99, 0xff, 0x1c, + 0xf7, 0xe3, 0xe8, 0x6c, 0x5d, 0xa1, 0xde, 0xfb, 0x37, 0x00, 0x00, 0xff, 0xff, 0x04, 0x39, 0xff, + 0x08, 0x98, 0x0c, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/ml/v1beta1/operation_metadata.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/ml/v1beta1/operation_metadata.pb.go new file mode 100644 index 0000000000..293077731d --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/ml/v1beta1/operation_metadata.pb.go @@ -0,0 +1,161 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/ml/v1beta1/operation_metadata.proto + +package ml + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf2 "github.com/golang/protobuf/ptypes/timestamp" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// The operation type. +type OperationMetadata_OperationType int32 + +const ( + // Unspecified operation type. + OperationMetadata_OPERATION_TYPE_UNSPECIFIED OperationMetadata_OperationType = 0 + // An operation to create a new version. + OperationMetadata_CREATE_VERSION OperationMetadata_OperationType = 1 + // An operation to delete an existing version. + OperationMetadata_DELETE_VERSION OperationMetadata_OperationType = 2 + // An operation to delete an existing model. + OperationMetadata_DELETE_MODEL OperationMetadata_OperationType = 3 +) + +var OperationMetadata_OperationType_name = map[int32]string{ + 0: "OPERATION_TYPE_UNSPECIFIED", + 1: "CREATE_VERSION", + 2: "DELETE_VERSION", + 3: "DELETE_MODEL", +} +var OperationMetadata_OperationType_value = map[string]int32{ + "OPERATION_TYPE_UNSPECIFIED": 0, + "CREATE_VERSION": 1, + "DELETE_VERSION": 2, + "DELETE_MODEL": 3, +} + +func (x OperationMetadata_OperationType) String() string { + return proto.EnumName(OperationMetadata_OperationType_name, int32(x)) +} +func (OperationMetadata_OperationType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor2, []int{0, 0} +} + +// Represents the metadata of the long-running operation. +type OperationMetadata struct { + // The time the operation was submitted. + CreateTime *google_protobuf2.Timestamp `protobuf:"bytes,1,opt,name=create_time,json=createTime" json:"create_time,omitempty"` + // The time operation processing started. + StartTime *google_protobuf2.Timestamp `protobuf:"bytes,2,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + // The time operation processing completed. + EndTime *google_protobuf2.Timestamp `protobuf:"bytes,3,opt,name=end_time,json=endTime" json:"end_time,omitempty"` + // Indicates whether a request to cancel this operation has been made. + IsCancellationRequested bool `protobuf:"varint,4,opt,name=is_cancellation_requested,json=isCancellationRequested" json:"is_cancellation_requested,omitempty"` + // The operation type. + OperationType OperationMetadata_OperationType `protobuf:"varint,5,opt,name=operation_type,json=operationType,enum=google.cloud.ml.v1beta1.OperationMetadata_OperationType" json:"operation_type,omitempty"` + // Contains the name of the model associated with the operation. + ModelName string `protobuf:"bytes,6,opt,name=model_name,json=modelName" json:"model_name,omitempty"` + // Contains the version associated with the operation. + Version *Version `protobuf:"bytes,7,opt,name=version" json:"version,omitempty"` +} + +func (m *OperationMetadata) Reset() { *m = OperationMetadata{} } +func (m *OperationMetadata) String() string { return proto.CompactTextString(m) } +func (*OperationMetadata) ProtoMessage() {} +func (*OperationMetadata) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} } + +func (m *OperationMetadata) GetCreateTime() *google_protobuf2.Timestamp { + if m != nil { + return m.CreateTime + } + return nil +} + +func (m *OperationMetadata) GetStartTime() *google_protobuf2.Timestamp { + if m != nil { + return m.StartTime + } + return nil +} + +func (m *OperationMetadata) GetEndTime() *google_protobuf2.Timestamp { + if m != nil { + return m.EndTime + } + return nil +} + +func (m *OperationMetadata) GetIsCancellationRequested() bool { + if m != nil { + return m.IsCancellationRequested + } + return false +} + +func (m *OperationMetadata) GetOperationType() OperationMetadata_OperationType { + if m != nil { + return m.OperationType + } + return OperationMetadata_OPERATION_TYPE_UNSPECIFIED +} + +func (m *OperationMetadata) GetModelName() string { + if m != nil { + return m.ModelName + } + return "" +} + +func (m *OperationMetadata) GetVersion() *Version { + if m != nil { + return m.Version + } + return nil +} + +func init() { + proto.RegisterType((*OperationMetadata)(nil), "google.cloud.ml.v1beta1.OperationMetadata") + proto.RegisterEnum("google.cloud.ml.v1beta1.OperationMetadata_OperationType", OperationMetadata_OperationType_name, OperationMetadata_OperationType_value) +} + +func init() { proto.RegisterFile("google/cloud/ml/v1beta1/operation_metadata.proto", fileDescriptor2) } + +var fileDescriptor2 = []byte{ + // 457 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0x5f, 0x6b, 0xdb, 0x30, + 0x14, 0xc5, 0xe7, 0xb6, 0x6b, 0x1b, 0x75, 0x0d, 0x99, 0x1f, 0x56, 0x2f, 0x6c, 0xab, 0xe9, 0x53, + 0x60, 0x60, 0xaf, 0x1d, 0x83, 0x75, 0x7d, 0x6a, 0x13, 0x0d, 0x02, 0x6d, 0x6c, 0x54, 0xaf, 0xb0, + 0xbd, 0x18, 0xc5, 0xbe, 0x33, 0x02, 0xfd, 0xf1, 0x2c, 0x25, 0xd0, 0x0f, 0xb4, 0xef, 0x39, 0x22, + 0xd9, 0x34, 0x23, 0x84, 0x3e, 0xea, 0xdc, 0xf3, 0xbb, 0xf7, 0xf8, 0x5e, 0xa3, 0x4f, 0x95, 0x52, + 0x15, 0x87, 0xb8, 0xe0, 0x6a, 0x51, 0xc6, 0x82, 0xc7, 0xcb, 0xf3, 0x39, 0x18, 0x7a, 0x1e, 0xab, + 0x1a, 0x1a, 0x6a, 0x98, 0x92, 0xb9, 0x00, 0x43, 0x4b, 0x6a, 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xf5, 0xa7, 0xff, 0x1e, 0x21, 0x77, 0x19, 0x49, 0x05, 0x04, 0xfb, 0xa1, 0x37, 0xea, 0x91, + 0x9e, 0x55, 0x66, 0xd4, 0x66, 0x3f, 0x58, 0x42, 0xa3, 0x99, 0x92, 0xc1, 0x81, 0xfd, 0xe2, 0x70, + 0xeb, 0xe0, 0x07, 0xe7, 0x23, 0x1d, 0x70, 0xc6, 0xd0, 0xf1, 0x7f, 0xa3, 0xfd, 0x0f, 0x68, 0x98, + 0xa4, 0x98, 0x5c, 0x67, 0xd3, 0x64, 0x96, 0x67, 0x3f, 0x53, 0x9c, 0xff, 0x98, 0xdd, 0xa7, 0x78, + 0x3c, 0xfd, 0x3e, 0xc5, 0x93, 0xc1, 0x0b, 0xdf, 0x47, 0xfd, 0x31, 0xc1, 0xd7, 0x19, 0xce, 0x1f, + 0x30, 0xb9, 0x9f, 0x26, 0xb3, 0x81, 0xb7, 0xd2, 0x26, 0xf8, 0x16, 0xaf, 0x69, 0x3b, 0xfe, 0x00, + 0xbd, 0x6a, 0xb5, 0xbb, 0x64, 0x82, 0x6f, 0x07, 0xbb, 0x37, 0x4b, 0x74, 0x5a, 0x28, 0xb1, 0x11, + 0x8d, 0xd6, 0xac, 0x8b, 0x77, 0xf3, 0x66, 0x63, 0x31, 0xe9, 0xea, 0x66, 0xa9, 0xf7, 0xeb, 0xb2, + 0xc5, 0x2a, 0xc5, 0xa9, 0xac, 0x22, 0xd5, 0x54, 0x71, 0x05, 0xd2, 0x5e, 0x34, 0x76, 0x25, 0x5a, + 0x33, 0xbd, 0xf1, 0x47, 0x5f, 0x09, 0x3e, 0xdf, 0xb7, 0xae, 0xcf, 0xff, 0x02, 0x00, 0x00, 0xff, + 0xff, 0x89, 0xf8, 0x21, 0xa7, 0x5f, 0x03, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/ml/v1beta1/prediction_service.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/ml/v1beta1/prediction_service.pb.go new file mode 100644 index 0000000000..7d6a8ada99 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/ml/v1beta1/prediction_service.pb.go @@ -0,0 +1,343 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/ml/v1beta1/prediction_service.proto + +package ml + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_api3 "google.golang.org/genproto/googleapis/api/httpbody" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Request for predictions to be issued against a trained model. +// +// The body of the request is a single JSON object with a single top-level +// field: +// +//
+//
instances
+//
A JSON array containing values representing the instances to use for +// prediction.
+//
+// +// The structure of each element of the instances list is determined by your +// model's input definition. Instances can include named inputs or can contain +// only unlabeled values. +// +// Not all data includes named inputs. Some instances will be simple +// JSON values (boolean, number, or string). However, instances are often lists +// of simple values, or complex nested lists. Here are some examples of request +// bodies: +// +// CSV data with each row encoded as a string value: +//
+// {"instances": ["1.0,true,\\"x\\"", "-2.0,false,\\"y\\""]}
+// 
+// Plain text: +//
+// {"instances": ["the quick brown fox", "la bruja le dio"]}
+// 
+// Sentences encoded as lists of words (vectors of strings): +//
+// {
+//   "instances": [
+//     ["the","quick","brown"],
+//     ["la","bruja","le"],
+//     ...
+//   ]
+// }
+// 
+// Floating point scalar values: +//
+// {"instances": [0.0, 1.1, 2.2]}
+// 
+// Vectors of integers: +//
+// {
+//   "instances": [
+//     [0, 1, 2],
+//     [3, 4, 5],
+//     ...
+//   ]
+// }
+// 
+// Tensors (in this case, two-dimensional tensors): +//
+// {
+//   "instances": [
+//     [
+//       [0, 1, 2],
+//       [3, 4, 5]
+//     ],
+//     ...
+//   ]
+// }
+// 
+// Images can be represented different ways. In this encoding scheme the first +// two dimensions represent the rows and columns of the image, and the third +// contains lists (vectors) of the R, G, and B values for each pixel. +//
+// {
+//   "instances": [
+//     [
+//       [
+//         [138, 30, 66],
+//         [130, 20, 56],
+//         ...
+//       ],
+//       [
+//         [126, 38, 61],
+//         [122, 24, 57],
+//         ...
+//       ],
+//       ...
+//     ],
+//     ...
+//   ]
+// }
+// 
+// JSON strings must be encoded as UTF-8. To send binary data, you must +// base64-encode the data and mark it as binary. To mark a JSON string +// as binary, replace it with a JSON object with a single attribute named `b64`: +//
{"b64": "..."} 
+// For example: +// +// Two Serialized tf.Examples (fake data, for illustrative purposes only): +//
+// {"instances": [{"b64": "X5ad6u"}, {"b64": "IA9j4nx"}]}
+// 
+// Two JPEG image byte strings (fake data, for illustrative purposes only): +//
+// {"instances": [{"b64": "ASa8asdf"}, {"b64": "JLK7ljk3"}]}
+// 
+// If your data includes named references, format each instance as a JSON object +// with the named references as the keys: +// +// JSON input data to be preprocessed: +//
+// {
+//   "instances": [
+//     {
+//       "a": 1.0,
+//       "b": true,
+//       "c": "x"
+//     },
+//     {
+//       "a": -2.0,
+//       "b": false,
+//       "c": "y"
+//     }
+//   ]
+// }
+// 
+// Some models have an underlying TensorFlow graph that accepts multiple input +// tensors. In this case, you should use the names of JSON name/value pairs to +// identify the input tensors, as shown in the following exmaples: +// +// For a graph with input tensor aliases "tag" (string) and "image" +// (base64-encoded string): +//
+// {
+//   "instances": [
+//     {
+//       "tag": "beach",
+//       "image": {"b64": "ASa8asdf"}
+//     },
+//     {
+//       "tag": "car",
+//       "image": {"b64": "JLK7ljk3"}
+//     }
+//   ]
+// }
+// 
+// For a graph with input tensor aliases "tag" (string) and "image" +// (3-dimensional array of 8-bit ints): +//
+// {
+//   "instances": [
+//     {
+//       "tag": "beach",
+//       "image": [
+//         [
+//           [138, 30, 66],
+//           [130, 20, 56],
+//           ...
+//         ],
+//         [
+//           [126, 38, 61],
+//           [122, 24, 57],
+//           ...
+//         ],
+//         ...
+//       ]
+//     },
+//     {
+//       "tag": "car",
+//       "image": [
+//         [
+//           [255, 0, 102],
+//           [255, 0, 97],
+//           ...
+//         ],
+//         [
+//           [254, 1, 101],
+//           [254, 2, 93],
+//           ...
+//         ],
+//         ...
+//       ]
+//     },
+//     ...
+//   ]
+// }
+// 
+// If the call is successful, the response body will contain one prediction +// entry per instance in the request body. If prediction fails for any +// instance, the response body will contain no predictions and will contian +// a single error entry instead. +type PredictRequest struct { + // Required. The resource name of a model or a version. + // + // Authorization: requires `Viewer` role on the parent project. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // + // Required. The prediction request body. + HttpBody *google_api3.HttpBody `protobuf:"bytes,2,opt,name=http_body,json=httpBody" json:"http_body,omitempty"` +} + +func (m *PredictRequest) Reset() { *m = PredictRequest{} } +func (m *PredictRequest) String() string { return proto.CompactTextString(m) } +func (*PredictRequest) ProtoMessage() {} +func (*PredictRequest) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} } + +func (m *PredictRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *PredictRequest) GetHttpBody() *google_api3.HttpBody { + if m != nil { + return m.HttpBody + } + return nil +} + +func init() { + proto.RegisterType((*PredictRequest)(nil), "google.cloud.ml.v1beta1.PredictRequest") +} + +// 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 + +// Client API for OnlinePredictionService service + +type OnlinePredictionServiceClient interface { + // Performs prediction on the data in the request. + // + // **** REMOVE FROM GENERATED DOCUMENTATION + Predict(ctx context.Context, in *PredictRequest, opts ...grpc.CallOption) (*google_api3.HttpBody, error) +} + +type onlinePredictionServiceClient struct { + cc *grpc.ClientConn +} + +func NewOnlinePredictionServiceClient(cc *grpc.ClientConn) OnlinePredictionServiceClient { + return &onlinePredictionServiceClient{cc} +} + +func (c *onlinePredictionServiceClient) Predict(ctx context.Context, in *PredictRequest, opts ...grpc.CallOption) (*google_api3.HttpBody, error) { + out := new(google_api3.HttpBody) + err := grpc.Invoke(ctx, "/google.cloud.ml.v1beta1.OnlinePredictionService/Predict", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for OnlinePredictionService service + +type OnlinePredictionServiceServer interface { + // Performs prediction on the data in the request. + // + // **** REMOVE FROM GENERATED DOCUMENTATION + Predict(context.Context, *PredictRequest) (*google_api3.HttpBody, error) +} + +func RegisterOnlinePredictionServiceServer(s *grpc.Server, srv OnlinePredictionServiceServer) { + s.RegisterService(&_OnlinePredictionService_serviceDesc, srv) +} + +func _OnlinePredictionService_Predict_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PredictRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OnlinePredictionServiceServer).Predict(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.ml.v1beta1.OnlinePredictionService/Predict", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OnlinePredictionServiceServer).Predict(ctx, req.(*PredictRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _OnlinePredictionService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.cloud.ml.v1beta1.OnlinePredictionService", + HandlerType: (*OnlinePredictionServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Predict", + Handler: _OnlinePredictionService_Predict_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/cloud/ml/v1beta1/prediction_service.proto", +} + +func init() { proto.RegisterFile("google/cloud/ml/v1beta1/prediction_service.proto", fileDescriptor3) } + +var fileDescriptor3 = []byte{ + // 312 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0x4d, 0x4a, 0x03, 0x31, + 0x14, 0xc7, 0x49, 0x11, 0xb5, 0x11, 0x5c, 0x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 0xe4, + 0x15, 0xef, 0xc5, 0x8f, 0xe4, 0x82, 0xfe, 0x13, 0x89, 0xfe, 0xb6, 0xd5, 0xf9, 0x53, 0xaf, 0x47, + 0x3f, 0x3e, 0xbf, 0x36, 0x8d, 0x7e, 0xef, 0x7c, 0xdb, 0xdd, 0x9b, 0x37, 0x7c, 0x6b, 0x0b, 0x78, + 0x16, 0xa9, 0x2b, 0xd9, 0x60, 0xf0, 0x3e, 0x8e, 0x75, 0x8e, 0xd1, 0x60, 0xb2, 0xc2, 0x67, 0x29, + 0xe4, 0x35, 0x4d, 0x7f, 0x33, 0x1e, 0x98, 0x1c, 0xd7, 0xfc, 0x26, 0xbe, 0xa9, 0x04, 0x3d, 0x5d, + 0x47, 0x4c, 0x82, 0xe6, 0x46, 0x52, 0x28, 0x24, 0x93, 0xc2, 0x54, 0x3d, 0xb2, 0xb0, 0xe2, 0x56, + 0x95, 0xb5, 0xe7, 0xbc, 0xc9, 0xf5, 0x7c, 0xb7, 0xfa, 0xeb, 0xea, 0x3b, 0x00, 0x00, 0xff, 0xff, + 0x00, 0x26, 0x25, 0x67, 0xf3, 0x01, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/ml/v1beta1/project_service.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/ml/v1beta1/project_service.pb.go new file mode 100644 index 0000000000..cdf5bbc57d --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/ml/v1beta1/project_service.pb.go @@ -0,0 +1,178 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/ml/v1beta1/project_service.proto + +package ml + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Requests service account information associated with a project. +type GetConfigRequest struct { + // Required. The project name. + // + // Authorization: requires `Viewer` role on the specified project. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetConfigRequest) Reset() { *m = GetConfigRequest{} } +func (m *GetConfigRequest) String() string { return proto.CompactTextString(m) } +func (*GetConfigRequest) ProtoMessage() {} +func (*GetConfigRequest) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{0} } + +func (m *GetConfigRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Returns service account information associated with a project. +type GetConfigResponse struct { + // The service account Cloud ML uses to access resources in the project. + ServiceAccount string `protobuf:"bytes,1,opt,name=service_account,json=serviceAccount" json:"service_account,omitempty"` + // The project number for `service_account`. + ServiceAccountProject int64 `protobuf:"varint,2,opt,name=service_account_project,json=serviceAccountProject" json:"service_account_project,omitempty"` +} + +func (m *GetConfigResponse) Reset() { *m = GetConfigResponse{} } +func (m *GetConfigResponse) String() string { return proto.CompactTextString(m) } +func (*GetConfigResponse) ProtoMessage() {} +func (*GetConfigResponse) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{1} } + +func (m *GetConfigResponse) GetServiceAccount() string { + if m != nil { + return m.ServiceAccount + } + return "" +} + +func (m *GetConfigResponse) GetServiceAccountProject() int64 { + if m != nil { + return m.ServiceAccountProject + } + return 0 +} + +func init() { + proto.RegisterType((*GetConfigRequest)(nil), "google.cloud.ml.v1beta1.GetConfigRequest") + proto.RegisterType((*GetConfigResponse)(nil), "google.cloud.ml.v1beta1.GetConfigResponse") +} + +// 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 + +// Client API for ProjectManagementService service + +type ProjectManagementServiceClient interface { + // Get the service account information associated with your project. You need + // this information in order to grant the service account persmissions for + // the Google Cloud Storage location where you put your model training code + // for training the model with Google Cloud Machine Learning. + GetConfig(ctx context.Context, in *GetConfigRequest, opts ...grpc.CallOption) (*GetConfigResponse, error) +} + +type projectManagementServiceClient struct { + cc *grpc.ClientConn +} + +func NewProjectManagementServiceClient(cc *grpc.ClientConn) ProjectManagementServiceClient { + return &projectManagementServiceClient{cc} +} + +func (c *projectManagementServiceClient) GetConfig(ctx context.Context, in *GetConfigRequest, opts ...grpc.CallOption) (*GetConfigResponse, error) { + out := new(GetConfigResponse) + err := grpc.Invoke(ctx, "/google.cloud.ml.v1beta1.ProjectManagementService/GetConfig", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for ProjectManagementService service + +type ProjectManagementServiceServer interface { + // Get the service account information associated with your project. You need + // this information in order to grant the service account persmissions for + // the Google Cloud Storage location where you put your model training code + // for training the model with Google Cloud Machine Learning. + GetConfig(context.Context, *GetConfigRequest) (*GetConfigResponse, error) +} + +func RegisterProjectManagementServiceServer(s *grpc.Server, srv ProjectManagementServiceServer) { + s.RegisterService(&_ProjectManagementService_serviceDesc, srv) +} + +func _ProjectManagementService_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.(ProjectManagementServiceServer).GetConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.ml.v1beta1.ProjectManagementService/GetConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProjectManagementServiceServer).GetConfig(ctx, req.(*GetConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _ProjectManagementService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.cloud.ml.v1beta1.ProjectManagementService", + HandlerType: (*ProjectManagementServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetConfig", + Handler: _ProjectManagementService_GetConfig_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/cloud/ml/v1beta1/project_service.proto", +} + +func init() { proto.RegisterFile("google/cloud/ml/v1beta1/project_service.proto", fileDescriptor4) } + +var fileDescriptor4 = []byte{ + // 327 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x4f, 0x4a, 0x43, 0x31, + 0x10, 0xc6, 0x79, 0x55, 0x84, 0x66, 0xe1, 0x9f, 0x88, 0xb4, 0x14, 0xc1, 0x52, 0xa4, 0xd6, 0xa2, + 0x09, 0x55, 0x10, 0x54, 0x5c, 0x58, 0x17, 0xae, 0x84, 0x52, 0x77, 0x6e, 0x4a, 0xfa, 0x1c, 0xc3, + 0x93, 0x24, 0x13, 0x5f, 0xd2, 0x6e, 0xc4, 0x8d, 0x27, 0x10, 0x3c, 0x87, 0xa7, 0xf1, 0x0a, 0x1e, + 0x44, 0xfa, 0x92, 0x16, 0x6d, 0x11, 0xdc, 0x0d, 0x33, 0xbf, 0x6f, 0x32, 0xdf, 0x4c, 0xc8, 0xa1, + 0x44, 0x94, 0x0a, 0x78, 0xaa, 0x70, 0x74, 0xcf, 0xb5, 0xe2, 0xe3, 0xce, 0x10, 0xbc, 0xe8, 0x70, + 0x9b, 0xe3, 0x23, 0xa4, 0x7e, 0xe0, 0x20, 0x1f, 0x67, 0x29, 0x30, 0x9b, 0xa3, 0x47, 0x5a, 0x09, + 0x38, 0x2b, 0x70, 0xa6, 0x15, 0x8b, 0x78, 0x6d, 0x3b, 0xf6, 0x11, 0x36, 0xe3, 0xc2, 0x18, 0xf4, + 0xc2, 0x67, 0x68, 0x5c, 0x90, 0x35, 0x9a, 0x64, 0xfd, 0x1a, 0xfc, 0x15, 0x9a, 0x87, 0x4c, 0xf6, + 0xe1, 0x69, 0x04, 0xce, 0x53, 0x4a, 0x96, 0x8d, 0xd0, 0x50, 0x4d, 0xea, 0x49, 0xab, 0xdc, 0x2f, + 0xe2, 0x86, 0x27, 0x1b, 0x3f, 0x38, 0x67, 0xd1, 0x38, 0xa0, 0x7b, 0x64, 0x2d, 0x0e, 0x31, 0x10, + 0x69, 0x8a, 0x23, 0xe3, 0xa3, 0x66, 0x35, 0xa6, 0x2f, 0x43, 0x96, 0x9e, 0x90, 0xca, 0x1c, 0x38, + 0x88, 0x2e, 0xaa, 0xa5, 0x7a, 0xd2, 0x5a, 0xea, 0x6f, 0xfd, 0x16, 0xf4, 0x42, 0xf1, 0xe8, 0x23, + 0x21, 0xd5, 0x18, 0xdf, 0x08, 0x23, 0x24, 0x68, 0x30, 0xfe, 0x36, 0xa0, 0xf4, 0x2d, 0x21, 0xe5, + 0xd9, 0x4c, 0x74, 0x9f, 0xfd, 0xb1, 0x00, 0x36, 0xef, 0xaf, 0xd6, 0xfe, 0x0f, 0x1a, 0x2c, 0x36, + 0x0e, 0x5e, 0x3f, 0xbf, 0xde, 0x4b, 0x4d, 0xba, 0x3b, 0x5b, 0xff, 0xf3, 0x64, 0x1f, 0x17, 0x71, + 0x7c, 0xc7, 0xdb, 0x2f, 0x67, 0x72, 0xaa, 0xea, 0x3a, 0xb2, 0x93, 0xa2, 0x5e, 0x68, 0x2f, 0x6c, + 0x36, 0x7d, 0xa2, 0xbb, 0x19, 0xfd, 0x44, 0x17, 0xbd, 0xc9, 0x15, 0x7a, 0xc9, 0xdd, 0x69, 0xd4, + 0x48, 0x54, 0xc2, 0x48, 0x86, 0xb9, 0xe4, 0x12, 0x4c, 0x71, 0x23, 0x1e, 0x4a, 0xc2, 0x66, 0x6e, + 0xe1, 0x33, 0x9c, 0x6b, 0x35, 0x5c, 0x29, 0xa8, 0xe3, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x76, + 0x59, 0xc4, 0x91, 0x31, 0x02, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/oslogin/common/common.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/oslogin/common/common.pb.go new file mode 100644 index 0000000000..6d8c6380c6 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/oslogin/common/common.pb.go @@ -0,0 +1,194 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/oslogin/common.proto + +/* +Package common is a generated protocol buffer package. + +It is generated from these files: + google/cloud/oslogin/common.proto + +It has these top-level messages: + PosixAccount + SshPublicKey +*/ +package common + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// The POSIX account information associated with a Google account. +type PosixAccount struct { + // Only one POSIX account can be marked as primary. + Primary bool `protobuf:"varint,1,opt,name=primary" json:"primary,omitempty"` + // The username of the POSIX account. + Username string `protobuf:"bytes,2,opt,name=username" json:"username,omitempty"` + // The user ID. + Uid int64 `protobuf:"varint,3,opt,name=uid" json:"uid,omitempty"` + // The default group ID. + Gid int64 `protobuf:"varint,4,opt,name=gid" json:"gid,omitempty"` + // The path to the home directory for this account. + HomeDirectory string `protobuf:"bytes,5,opt,name=home_directory,json=homeDirectory" json:"home_directory,omitempty"` + // The path to the logic shell for this account. + Shell string `protobuf:"bytes,6,opt,name=shell" json:"shell,omitempty"` + // The GECOS (user information) entry for this account. + Gecos string `protobuf:"bytes,7,opt,name=gecos" json:"gecos,omitempty"` + // System identifier for which account the username or uid applies to. + // By default, the empty value is used. + SystemId string `protobuf:"bytes,8,opt,name=system_id,json=systemId" json:"system_id,omitempty"` + // Output only. A POSIX account identifier. + AccountId string `protobuf:"bytes,9,opt,name=account_id,json=accountId" json:"account_id,omitempty"` +} + +func (m *PosixAccount) Reset() { *m = PosixAccount{} } +func (m *PosixAccount) String() string { return proto.CompactTextString(m) } +func (*PosixAccount) ProtoMessage() {} +func (*PosixAccount) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *PosixAccount) GetPrimary() bool { + if m != nil { + return m.Primary + } + return false +} + +func (m *PosixAccount) GetUsername() string { + if m != nil { + return m.Username + } + return "" +} + +func (m *PosixAccount) GetUid() int64 { + if m != nil { + return m.Uid + } + return 0 +} + +func (m *PosixAccount) GetGid() int64 { + if m != nil { + return m.Gid + } + return 0 +} + +func (m *PosixAccount) GetHomeDirectory() string { + if m != nil { + return m.HomeDirectory + } + return "" +} + +func (m *PosixAccount) GetShell() string { + if m != nil { + return m.Shell + } + return "" +} + +func (m *PosixAccount) GetGecos() string { + if m != nil { + return m.Gecos + } + return "" +} + +func (m *PosixAccount) GetSystemId() string { + if m != nil { + return m.SystemId + } + return "" +} + +func (m *PosixAccount) GetAccountId() string { + if m != nil { + return m.AccountId + } + return "" +} + +// The SSH public key information associated with a Google account. +type SshPublicKey struct { + // Public key text in SSH format, defined by + // RFC4253 + // section 6.6. + Key string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` + // An expiration time in microseconds since epoch. + ExpirationTimeUsec int64 `protobuf:"varint,2,opt,name=expiration_time_usec,json=expirationTimeUsec" json:"expiration_time_usec,omitempty"` + // Output only. The SHA-256 fingerprint of the SSH public key. + Fingerprint string `protobuf:"bytes,3,opt,name=fingerprint" json:"fingerprint,omitempty"` +} + +func (m *SshPublicKey) Reset() { *m = SshPublicKey{} } +func (m *SshPublicKey) String() string { return proto.CompactTextString(m) } +func (*SshPublicKey) ProtoMessage() {} +func (*SshPublicKey) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *SshPublicKey) GetKey() string { + if m != nil { + return m.Key + } + return "" +} + +func (m *SshPublicKey) GetExpirationTimeUsec() int64 { + if m != nil { + return m.ExpirationTimeUsec + } + return 0 +} + +func (m *SshPublicKey) GetFingerprint() string { + if m != nil { + return m.Fingerprint + } + return "" +} + +func init() { + proto.RegisterType((*PosixAccount)(nil), "google.cloud.oslogin.common.PosixAccount") + proto.RegisterType((*SshPublicKey)(nil), "google.cloud.oslogin.common.SshPublicKey") +} + +func init() { proto.RegisterFile("google/cloud/oslogin/common.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 373 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0xcf, 0x6b, 0x14, 0x31, + 0x14, 0xc7, 0x19, 0xd7, 0xb6, 0x3b, 0x71, 0x15, 0x09, 0x3d, 0x84, 0x56, 0x71, 0x2d, 0x08, 0x7b, + 0x9a, 0x11, 0x3c, 0x7a, 0x6a, 0xf1, 0x52, 0x14, 0x5c, 0x46, 0xbd, 0x78, 0x19, 0xd2, 0xe4, 0x99, + 0x7d, 0x38, 0xc9, 0x1b, 0x92, 0x0c, 0x74, 0xfe, 0x72, 0xaf, 0x92, 0x64, 0x56, 0x3d, 0x48, 0x4f, + 0x93, 0xef, 0xe7, 0xfb, 0xcd, 0xf0, 0x7e, 0x84, 0xbd, 0x36, 0x44, 0x66, 0x80, 0x56, 0x0d, 0x34, + 0xe9, 0x96, 0xc2, 0x40, 0x06, 0x5d, 0xab, 0xc8, 0x5a, 0x72, 0xcd, 0xe8, 0x29, 0x12, 0xbf, 0x2c, + 0x91, 0x26, 0x47, 0x9a, 0x25, 0xd2, 0x94, 0xc8, 0xc5, 0x8b, 0xe5, 0xbe, 0x1c, 0xb1, 0x95, 0xce, + 0x51, 0x94, 0x11, 0xc9, 0x85, 0x72, 0xf5, 0xea, 0x57, 0xc5, 0x36, 0x7b, 0x0a, 0x78, 0x7f, 0xad, + 0x14, 0x4d, 0x2e, 0x72, 0xc1, 0xce, 0x46, 0x8f, 0x56, 0xfa, 0x59, 0x54, 0xdb, 0x6a, 0xb7, 0xee, + 0x8e, 0x92, 0x5f, 0xb0, 0xf5, 0x14, 0xc0, 0x3b, 0x69, 0x41, 0x3c, 0xda, 0x56, 0xbb, 0xba, 0xfb, + 0x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, 0x70, 0x79, 0x79, 0x6d, 0xb1, 0xe4, 0x88, 0xe1, 0xbf, 0xaf, 0xe3, + 0x7d, 0xf9, 0xdc, 0x9d, 0xe6, 0xf4, 0xbb, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x0a, 0xe8, 0xeb, + 0xaa, 0x4a, 0x02, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/oslogin/v1alpha/oslogin.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/oslogin/v1alpha/oslogin.pb.go new file mode 100644 index 0000000000..62b1ba721b --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/oslogin/v1alpha/oslogin.pb.go @@ -0,0 +1,581 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/oslogin/v1alpha/oslogin.proto + +/* +Package oslogin is a generated protocol buffer package. + +It is generated from these files: + google/cloud/oslogin/v1alpha/oslogin.proto + +It has these top-level messages: + LoginProfile + DeletePosixAccountRequest + DeleteSshPublicKeyRequest + GetLoginProfileRequest + GetSshPublicKeyRequest + ImportSshPublicKeyRequest + ImportSshPublicKeyResponse + UpdateSshPublicKeyRequest +*/ +package oslogin + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_cloud_oslogin_common "google.golang.org/genproto/googleapis/cloud/oslogin/common" +import google_protobuf1 "github.com/golang/protobuf/ptypes/empty" +import google_protobuf2 "google.golang.org/genproto/protobuf/field_mask" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// The user profile information used for logging in to a virtual machine on +// Google Compute Engine. +type LoginProfile struct { + // A unique user ID for identifying the user. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The list of POSIX accounts associated with the Directory API user. + PosixAccounts []*google_cloud_oslogin_common.PosixAccount `protobuf:"bytes,2,rep,name=posix_accounts,json=posixAccounts" json:"posix_accounts,omitempty"` + // A map from SSH public key fingerprint to the associated key object. + SshPublicKeys map[string]*google_cloud_oslogin_common.SshPublicKey `protobuf:"bytes,3,rep,name=ssh_public_keys,json=sshPublicKeys" json:"ssh_public_keys,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // Indicates if the user is suspended. + Suspended bool `protobuf:"varint,4,opt,name=suspended" json:"suspended,omitempty"` +} + +func (m *LoginProfile) Reset() { *m = LoginProfile{} } +func (m *LoginProfile) String() string { return proto.CompactTextString(m) } +func (*LoginProfile) ProtoMessage() {} +func (*LoginProfile) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *LoginProfile) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *LoginProfile) GetPosixAccounts() []*google_cloud_oslogin_common.PosixAccount { + if m != nil { + return m.PosixAccounts + } + return nil +} + +func (m *LoginProfile) GetSshPublicKeys() map[string]*google_cloud_oslogin_common.SshPublicKey { + if m != nil { + return m.SshPublicKeys + } + return nil +} + +func (m *LoginProfile) GetSuspended() bool { + if m != nil { + return m.Suspended + } + return false +} + +// A request message for deleting a POSIX account entry. +type DeletePosixAccountRequest struct { + // A reference to the POSIX account to update. POSIX accounts are identified + // by the project ID they are associated with. A reference to the POSIX + // account is in format `users/{user}/projects/{project}`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *DeletePosixAccountRequest) Reset() { *m = DeletePosixAccountRequest{} } +func (m *DeletePosixAccountRequest) String() string { return proto.CompactTextString(m) } +func (*DeletePosixAccountRequest) ProtoMessage() {} +func (*DeletePosixAccountRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *DeletePosixAccountRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// A request message for deleting an SSH public key. +type DeleteSshPublicKeyRequest struct { + // The fingerprint of the public key to update. Public keys are identified by + // their SHA-256 fingerprint. The fingerprint of the public key is in format + // `users/{user}/sshPublicKeys/{fingerprint}`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *DeleteSshPublicKeyRequest) Reset() { *m = DeleteSshPublicKeyRequest{} } +func (m *DeleteSshPublicKeyRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteSshPublicKeyRequest) ProtoMessage() {} +func (*DeleteSshPublicKeyRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *DeleteSshPublicKeyRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// A request message for retrieving the login profile information for a user. +type GetLoginProfileRequest struct { + // The unique ID for the user in format `users/{user}`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetLoginProfileRequest) Reset() { *m = GetLoginProfileRequest{} } +func (m *GetLoginProfileRequest) String() string { return proto.CompactTextString(m) } +func (*GetLoginProfileRequest) ProtoMessage() {} +func (*GetLoginProfileRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *GetLoginProfileRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// A request message for retrieving an SSH public key. +type GetSshPublicKeyRequest struct { + // The fingerprint of the public key to retrieve. Public keys are identified + // by their SHA-256 fingerprint. The fingerprint of the public key is in + // format `users/{user}/sshPublicKeys/{fingerprint}`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetSshPublicKeyRequest) Reset() { *m = GetSshPublicKeyRequest{} } +func (m *GetSshPublicKeyRequest) String() string { return proto.CompactTextString(m) } +func (*GetSshPublicKeyRequest) ProtoMessage() {} +func (*GetSshPublicKeyRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *GetSshPublicKeyRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// A request message for importing an SSH public key. +type ImportSshPublicKeyRequest struct { + // The unique ID for the user in format `users/{user}`. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // The SSH public key and expiration time. + SshPublicKey *google_cloud_oslogin_common.SshPublicKey `protobuf:"bytes,2,opt,name=ssh_public_key,json=sshPublicKey" json:"ssh_public_key,omitempty"` + // The project ID of the Google Cloud Platform project. + ProjectId string `protobuf:"bytes,3,opt,name=project_id,json=projectId" json:"project_id,omitempty"` +} + +func (m *ImportSshPublicKeyRequest) Reset() { *m = ImportSshPublicKeyRequest{} } +func (m *ImportSshPublicKeyRequest) String() string { return proto.CompactTextString(m) } +func (*ImportSshPublicKeyRequest) ProtoMessage() {} +func (*ImportSshPublicKeyRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *ImportSshPublicKeyRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *ImportSshPublicKeyRequest) GetSshPublicKey() *google_cloud_oslogin_common.SshPublicKey { + if m != nil { + return m.SshPublicKey + } + return nil +} + +func (m *ImportSshPublicKeyRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +// A response message for importing an SSH public key. +type ImportSshPublicKeyResponse struct { + // The login profile information for the user. + LoginProfile *LoginProfile `protobuf:"bytes,1,opt,name=login_profile,json=loginProfile" json:"login_profile,omitempty"` +} + +func (m *ImportSshPublicKeyResponse) Reset() { *m = ImportSshPublicKeyResponse{} } +func (m *ImportSshPublicKeyResponse) String() string { return proto.CompactTextString(m) } +func (*ImportSshPublicKeyResponse) ProtoMessage() {} +func (*ImportSshPublicKeyResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *ImportSshPublicKeyResponse) GetLoginProfile() *LoginProfile { + if m != nil { + return m.LoginProfile + } + return nil +} + +// A request message for updating an SSH public key. +type UpdateSshPublicKeyRequest struct { + // The fingerprint of the public key to update. Public keys are identified by + // their SHA-256 fingerprint. The fingerprint of the public key is in format + // `users/{user}/sshPublicKeys/{fingerprint}`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The SSH public key and expiration time. + SshPublicKey *google_cloud_oslogin_common.SshPublicKey `protobuf:"bytes,2,opt,name=ssh_public_key,json=sshPublicKey" json:"ssh_public_key,omitempty"` + // Mask to control which fields get updated. Updates all if not present. + UpdateMask *google_protobuf2.FieldMask `protobuf:"bytes,3,opt,name=update_mask,json=updateMask" json:"update_mask,omitempty"` +} + +func (m *UpdateSshPublicKeyRequest) Reset() { *m = UpdateSshPublicKeyRequest{} } +func (m *UpdateSshPublicKeyRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateSshPublicKeyRequest) ProtoMessage() {} +func (*UpdateSshPublicKeyRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *UpdateSshPublicKeyRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *UpdateSshPublicKeyRequest) GetSshPublicKey() *google_cloud_oslogin_common.SshPublicKey { + if m != nil { + return m.SshPublicKey + } + return nil +} + +func (m *UpdateSshPublicKeyRequest) GetUpdateMask() *google_protobuf2.FieldMask { + if m != nil { + return m.UpdateMask + } + return nil +} + +func init() { + proto.RegisterType((*LoginProfile)(nil), "google.cloud.oslogin.v1alpha.LoginProfile") + proto.RegisterType((*DeletePosixAccountRequest)(nil), "google.cloud.oslogin.v1alpha.DeletePosixAccountRequest") + proto.RegisterType((*DeleteSshPublicKeyRequest)(nil), "google.cloud.oslogin.v1alpha.DeleteSshPublicKeyRequest") + proto.RegisterType((*GetLoginProfileRequest)(nil), "google.cloud.oslogin.v1alpha.GetLoginProfileRequest") + proto.RegisterType((*GetSshPublicKeyRequest)(nil), "google.cloud.oslogin.v1alpha.GetSshPublicKeyRequest") + proto.RegisterType((*ImportSshPublicKeyRequest)(nil), "google.cloud.oslogin.v1alpha.ImportSshPublicKeyRequest") + proto.RegisterType((*ImportSshPublicKeyResponse)(nil), "google.cloud.oslogin.v1alpha.ImportSshPublicKeyResponse") + proto.RegisterType((*UpdateSshPublicKeyRequest)(nil), "google.cloud.oslogin.v1alpha.UpdateSshPublicKeyRequest") +} + +// 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 + +// Client API for OsLoginService service + +type OsLoginServiceClient interface { + // Deletes a POSIX account. + DeletePosixAccount(ctx context.Context, in *DeletePosixAccountRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) + // Deletes an SSH public key. + DeleteSshPublicKey(ctx context.Context, in *DeleteSshPublicKeyRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) + // Retrieves the profile information used for logging in to a virtual machine + // on Google Compute Engine. + GetLoginProfile(ctx context.Context, in *GetLoginProfileRequest, opts ...grpc.CallOption) (*LoginProfile, error) + // Retrieves an SSH public key. + GetSshPublicKey(ctx context.Context, in *GetSshPublicKeyRequest, opts ...grpc.CallOption) (*google_cloud_oslogin_common.SshPublicKey, error) + // Adds an SSH public key and returns the profile information. Default POSIX + // account information is set when no username and UID exist as part of the + // login profile. + ImportSshPublicKey(ctx context.Context, in *ImportSshPublicKeyRequest, opts ...grpc.CallOption) (*ImportSshPublicKeyResponse, error) + // Updates an SSH public key and returns the profile information. This method + // supports patch semantics. + UpdateSshPublicKey(ctx context.Context, in *UpdateSshPublicKeyRequest, opts ...grpc.CallOption) (*google_cloud_oslogin_common.SshPublicKey, error) +} + +type osLoginServiceClient struct { + cc *grpc.ClientConn +} + +func NewOsLoginServiceClient(cc *grpc.ClientConn) OsLoginServiceClient { + return &osLoginServiceClient{cc} +} + +func (c *osLoginServiceClient) DeletePosixAccount(ctx context.Context, in *DeletePosixAccountRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { + out := new(google_protobuf1.Empty) + err := grpc.Invoke(ctx, "/google.cloud.oslogin.v1alpha.OsLoginService/DeletePosixAccount", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *osLoginServiceClient) DeleteSshPublicKey(ctx context.Context, in *DeleteSshPublicKeyRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { + out := new(google_protobuf1.Empty) + err := grpc.Invoke(ctx, "/google.cloud.oslogin.v1alpha.OsLoginService/DeleteSshPublicKey", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *osLoginServiceClient) GetLoginProfile(ctx context.Context, in *GetLoginProfileRequest, opts ...grpc.CallOption) (*LoginProfile, error) { + out := new(LoginProfile) + err := grpc.Invoke(ctx, "/google.cloud.oslogin.v1alpha.OsLoginService/GetLoginProfile", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *osLoginServiceClient) GetSshPublicKey(ctx context.Context, in *GetSshPublicKeyRequest, opts ...grpc.CallOption) (*google_cloud_oslogin_common.SshPublicKey, error) { + out := new(google_cloud_oslogin_common.SshPublicKey) + err := grpc.Invoke(ctx, "/google.cloud.oslogin.v1alpha.OsLoginService/GetSshPublicKey", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *osLoginServiceClient) ImportSshPublicKey(ctx context.Context, in *ImportSshPublicKeyRequest, opts ...grpc.CallOption) (*ImportSshPublicKeyResponse, error) { + out := new(ImportSshPublicKeyResponse) + err := grpc.Invoke(ctx, "/google.cloud.oslogin.v1alpha.OsLoginService/ImportSshPublicKey", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *osLoginServiceClient) UpdateSshPublicKey(ctx context.Context, in *UpdateSshPublicKeyRequest, opts ...grpc.CallOption) (*google_cloud_oslogin_common.SshPublicKey, error) { + out := new(google_cloud_oslogin_common.SshPublicKey) + err := grpc.Invoke(ctx, "/google.cloud.oslogin.v1alpha.OsLoginService/UpdateSshPublicKey", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for OsLoginService service + +type OsLoginServiceServer interface { + // Deletes a POSIX account. + DeletePosixAccount(context.Context, *DeletePosixAccountRequest) (*google_protobuf1.Empty, error) + // Deletes an SSH public key. + DeleteSshPublicKey(context.Context, *DeleteSshPublicKeyRequest) (*google_protobuf1.Empty, error) + // Retrieves the profile information used for logging in to a virtual machine + // on Google Compute Engine. + GetLoginProfile(context.Context, *GetLoginProfileRequest) (*LoginProfile, error) + // Retrieves an SSH public key. + GetSshPublicKey(context.Context, *GetSshPublicKeyRequest) (*google_cloud_oslogin_common.SshPublicKey, error) + // Adds an SSH public key and returns the profile information. Default POSIX + // account information is set when no username and UID exist as part of the + // login profile. + ImportSshPublicKey(context.Context, *ImportSshPublicKeyRequest) (*ImportSshPublicKeyResponse, error) + // Updates an SSH public key and returns the profile information. This method + // supports patch semantics. + UpdateSshPublicKey(context.Context, *UpdateSshPublicKeyRequest) (*google_cloud_oslogin_common.SshPublicKey, error) +} + +func RegisterOsLoginServiceServer(s *grpc.Server, srv OsLoginServiceServer) { + s.RegisterService(&_OsLoginService_serviceDesc, srv) +} + +func _OsLoginService_DeletePosixAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeletePosixAccountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OsLoginServiceServer).DeletePosixAccount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.oslogin.v1alpha.OsLoginService/DeletePosixAccount", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OsLoginServiceServer).DeletePosixAccount(ctx, req.(*DeletePosixAccountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _OsLoginService_DeleteSshPublicKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteSshPublicKeyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OsLoginServiceServer).DeleteSshPublicKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.oslogin.v1alpha.OsLoginService/DeleteSshPublicKey", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OsLoginServiceServer).DeleteSshPublicKey(ctx, req.(*DeleteSshPublicKeyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _OsLoginService_GetLoginProfile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetLoginProfileRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OsLoginServiceServer).GetLoginProfile(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.oslogin.v1alpha.OsLoginService/GetLoginProfile", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OsLoginServiceServer).GetLoginProfile(ctx, req.(*GetLoginProfileRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _OsLoginService_GetSshPublicKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetSshPublicKeyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OsLoginServiceServer).GetSshPublicKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.oslogin.v1alpha.OsLoginService/GetSshPublicKey", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OsLoginServiceServer).GetSshPublicKey(ctx, req.(*GetSshPublicKeyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _OsLoginService_ImportSshPublicKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ImportSshPublicKeyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OsLoginServiceServer).ImportSshPublicKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.oslogin.v1alpha.OsLoginService/ImportSshPublicKey", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OsLoginServiceServer).ImportSshPublicKey(ctx, req.(*ImportSshPublicKeyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _OsLoginService_UpdateSshPublicKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateSshPublicKeyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OsLoginServiceServer).UpdateSshPublicKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.oslogin.v1alpha.OsLoginService/UpdateSshPublicKey", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OsLoginServiceServer).UpdateSshPublicKey(ctx, req.(*UpdateSshPublicKeyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _OsLoginService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.cloud.oslogin.v1alpha.OsLoginService", + HandlerType: (*OsLoginServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "DeletePosixAccount", + Handler: _OsLoginService_DeletePosixAccount_Handler, + }, + { + MethodName: "DeleteSshPublicKey", + Handler: _OsLoginService_DeleteSshPublicKey_Handler, + }, + { + MethodName: "GetLoginProfile", + Handler: _OsLoginService_GetLoginProfile_Handler, + }, + { + MethodName: "GetSshPublicKey", + Handler: _OsLoginService_GetSshPublicKey_Handler, + }, + { + MethodName: "ImportSshPublicKey", + Handler: _OsLoginService_ImportSshPublicKey_Handler, + }, + { + MethodName: "UpdateSshPublicKey", + Handler: _OsLoginService_UpdateSshPublicKey_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/cloud/oslogin/v1alpha/oslogin.proto", +} + +func init() { proto.RegisterFile("google/cloud/oslogin/v1alpha/oslogin.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 745 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xcd, 0x6e, 0xd3, 0x4c, + 0x14, 0x95, 0x93, 0x7e, 0x55, 0x3b, 0x49, 0xdb, 0x4f, 0xb3, 0xa8, 0x52, 0x53, 0xa4, 0x60, 0x55, + 0xd0, 0x5a, 0x95, 0x47, 0x04, 0x24, 0x4a, 0xab, 0x52, 0x51, 0x5a, 0x50, 0x05, 0xa8, 0x91, 0x2b, + 0x36, 0x6c, 0xa2, 0xa9, 0x3d, 0x75, 0x4d, 0x6c, 0xcf, 0xe0, 0xb1, 0x0b, 0x11, 0xea, 0x86, 0x37, + 0x40, 0x95, 0xd8, 0xa3, 0x3e, 0x05, 0x0b, 0x1e, 0x81, 0x15, 0xaf, 0x80, 0x78, 0x0e, 0xe4, 0xf1, + 0xa4, 0x71, 0x12, 0x27, 0x71, 0x24, 0x76, 0xbe, 0x33, 0xf7, 0xdc, 0x39, 0xf7, 0xdc, 0x1f, 0x19, + 0xe8, 0x0e, 0xa5, 0x8e, 0x47, 0x90, 0xe5, 0xd1, 0xd8, 0x46, 0x94, 0x7b, 0xd4, 0x71, 0x03, 0x74, + 0x71, 0x1f, 0x7b, 0xec, 0x1c, 0x77, 0x6d, 0x83, 0x85, 0x34, 0xa2, 0x70, 0x35, 0xf5, 0x35, 0x84, + 0xaf, 0xd1, 0xbd, 0x93, 0xbe, 0xaa, 0xbc, 0x45, 0x98, 0xb9, 0x08, 0x07, 0x01, 0x8d, 0x70, 0xe4, + 0xd2, 0x80, 0xa7, 0x58, 0xf5, 0x4e, 0xee, 0x3b, 0x16, 0xf5, 0x7d, 0x2a, 0xc3, 0xab, 0xb7, 0xa4, + 0x8b, 0xb0, 0x4e, 0xe3, 0x33, 0x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0x81, 0x98, 0x2f, 0x94, 0x5e, 0x61, 0xe6, + 0xf2, 0xfc, 0xdf, 0xa5, 0x1d, 0x69, 0x9f, 0xce, 0x0a, 0xff, 0x07, 0x7f, 0x03, 0x00, 0x00, 0xff, + 0xff, 0xa6, 0x7e, 0xc7, 0x43, 0x5d, 0x09, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/oslogin/v1beta/oslogin.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/oslogin/v1beta/oslogin.pb.go new file mode 100644 index 0000000000..681ab2d98a --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/oslogin/v1beta/oslogin.pb.go @@ -0,0 +1,584 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/oslogin/v1beta/oslogin.proto + +/* +Package oslogin is a generated protocol buffer package. + +It is generated from these files: + google/cloud/oslogin/v1beta/oslogin.proto + +It has these top-level messages: + LoginProfile + DeletePosixAccountRequest + DeleteSshPublicKeyRequest + GetLoginProfileRequest + GetSshPublicKeyRequest + ImportSshPublicKeyRequest + ImportSshPublicKeyResponse + UpdateSshPublicKeyRequest +*/ +package oslogin + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_cloud_oslogin_common "google.golang.org/genproto/googleapis/cloud/oslogin/common" +import google_protobuf1 "github.com/golang/protobuf/ptypes/empty" +import google_protobuf2 "google.golang.org/genproto/protobuf/field_mask" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// The user profile information used for logging in to a virtual machine on +// Google Compute Engine. +type LoginProfile struct { + // The primary email address that uniquely identifies the user. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The list of POSIX accounts associated with the user. + PosixAccounts []*google_cloud_oslogin_common.PosixAccount `protobuf:"bytes,2,rep,name=posix_accounts,json=posixAccounts" json:"posix_accounts,omitempty"` + // A map from SSH public key fingerprint to the associated key object. + SshPublicKeys map[string]*google_cloud_oslogin_common.SshPublicKey `protobuf:"bytes,3,rep,name=ssh_public_keys,json=sshPublicKeys" json:"ssh_public_keys,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // Indicates if the user is suspended. A suspended user cannot log in but + // their profile information is retained. + Suspended bool `protobuf:"varint,4,opt,name=suspended" json:"suspended,omitempty"` +} + +func (m *LoginProfile) Reset() { *m = LoginProfile{} } +func (m *LoginProfile) String() string { return proto.CompactTextString(m) } +func (*LoginProfile) ProtoMessage() {} +func (*LoginProfile) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *LoginProfile) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *LoginProfile) GetPosixAccounts() []*google_cloud_oslogin_common.PosixAccount { + if m != nil { + return m.PosixAccounts + } + return nil +} + +func (m *LoginProfile) GetSshPublicKeys() map[string]*google_cloud_oslogin_common.SshPublicKey { + if m != nil { + return m.SshPublicKeys + } + return nil +} + +func (m *LoginProfile) GetSuspended() bool { + if m != nil { + return m.Suspended + } + return false +} + +// A request message for deleting a POSIX account entry. +type DeletePosixAccountRequest struct { + // A reference to the POSIX account to update. POSIX accounts are identified + // by the project ID they are associated with. A reference to the POSIX + // account is in format `users/{user}/projects/{project}`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *DeletePosixAccountRequest) Reset() { *m = DeletePosixAccountRequest{} } +func (m *DeletePosixAccountRequest) String() string { return proto.CompactTextString(m) } +func (*DeletePosixAccountRequest) ProtoMessage() {} +func (*DeletePosixAccountRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *DeletePosixAccountRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// A request message for deleting an SSH public key. +type DeleteSshPublicKeyRequest struct { + // The fingerprint of the public key to update. Public keys are identified by + // their SHA-256 fingerprint. The fingerprint of the public key is in format + // `users/{user}/sshPublicKeys/{fingerprint}`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *DeleteSshPublicKeyRequest) Reset() { *m = DeleteSshPublicKeyRequest{} } +func (m *DeleteSshPublicKeyRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteSshPublicKeyRequest) ProtoMessage() {} +func (*DeleteSshPublicKeyRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *DeleteSshPublicKeyRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// A request message for retrieving the login profile information for a user. +type GetLoginProfileRequest struct { + // The unique ID for the user in format `users/{user}`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetLoginProfileRequest) Reset() { *m = GetLoginProfileRequest{} } +func (m *GetLoginProfileRequest) String() string { return proto.CompactTextString(m) } +func (*GetLoginProfileRequest) ProtoMessage() {} +func (*GetLoginProfileRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *GetLoginProfileRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// A request message for retrieving an SSH public key. +type GetSshPublicKeyRequest struct { + // The fingerprint of the public key to retrieve. Public keys are identified + // by their SHA-256 fingerprint. The fingerprint of the public key is in + // format `users/{user}/sshPublicKeys/{fingerprint}`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetSshPublicKeyRequest) Reset() { *m = GetSshPublicKeyRequest{} } +func (m *GetSshPublicKeyRequest) String() string { return proto.CompactTextString(m) } +func (*GetSshPublicKeyRequest) ProtoMessage() {} +func (*GetSshPublicKeyRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *GetSshPublicKeyRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// A request message for importing an SSH public key. +type ImportSshPublicKeyRequest struct { + // The unique ID for the user in format `users/{user}`. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // The SSH public key and expiration time. + SshPublicKey *google_cloud_oslogin_common.SshPublicKey `protobuf:"bytes,2,opt,name=ssh_public_key,json=sshPublicKey" json:"ssh_public_key,omitempty"` + // The project ID of the Google Cloud Platform project. + ProjectId string `protobuf:"bytes,3,opt,name=project_id,json=projectId" json:"project_id,omitempty"` +} + +func (m *ImportSshPublicKeyRequest) Reset() { *m = ImportSshPublicKeyRequest{} } +func (m *ImportSshPublicKeyRequest) String() string { return proto.CompactTextString(m) } +func (*ImportSshPublicKeyRequest) ProtoMessage() {} +func (*ImportSshPublicKeyRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *ImportSshPublicKeyRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *ImportSshPublicKeyRequest) GetSshPublicKey() *google_cloud_oslogin_common.SshPublicKey { + if m != nil { + return m.SshPublicKey + } + return nil +} + +func (m *ImportSshPublicKeyRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +// A response message for importing an SSH public key. +type ImportSshPublicKeyResponse struct { + // The login profile information for the user. + LoginProfile *LoginProfile `protobuf:"bytes,1,opt,name=login_profile,json=loginProfile" json:"login_profile,omitempty"` +} + +func (m *ImportSshPublicKeyResponse) Reset() { *m = ImportSshPublicKeyResponse{} } +func (m *ImportSshPublicKeyResponse) String() string { return proto.CompactTextString(m) } +func (*ImportSshPublicKeyResponse) ProtoMessage() {} +func (*ImportSshPublicKeyResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *ImportSshPublicKeyResponse) GetLoginProfile() *LoginProfile { + if m != nil { + return m.LoginProfile + } + return nil +} + +// A request message for updating an SSH public key. +type UpdateSshPublicKeyRequest struct { + // The fingerprint of the public key to update. Public keys are identified by + // their SHA-256 fingerprint. The fingerprint of the public key is in format + // `users/{user}/sshPublicKeys/{fingerprint}`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The SSH public key and expiration time. + SshPublicKey *google_cloud_oslogin_common.SshPublicKey `protobuf:"bytes,2,opt,name=ssh_public_key,json=sshPublicKey" json:"ssh_public_key,omitempty"` + // Mask to control which fields get updated. Updates all if not present. + UpdateMask *google_protobuf2.FieldMask `protobuf:"bytes,3,opt,name=update_mask,json=updateMask" json:"update_mask,omitempty"` +} + +func (m *UpdateSshPublicKeyRequest) Reset() { *m = UpdateSshPublicKeyRequest{} } +func (m *UpdateSshPublicKeyRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateSshPublicKeyRequest) ProtoMessage() {} +func (*UpdateSshPublicKeyRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *UpdateSshPublicKeyRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *UpdateSshPublicKeyRequest) GetSshPublicKey() *google_cloud_oslogin_common.SshPublicKey { + if m != nil { + return m.SshPublicKey + } + return nil +} + +func (m *UpdateSshPublicKeyRequest) GetUpdateMask() *google_protobuf2.FieldMask { + if m != nil { + return m.UpdateMask + } + return nil +} + +func init() { + proto.RegisterType((*LoginProfile)(nil), "google.cloud.oslogin.v1beta.LoginProfile") + proto.RegisterType((*DeletePosixAccountRequest)(nil), "google.cloud.oslogin.v1beta.DeletePosixAccountRequest") + proto.RegisterType((*DeleteSshPublicKeyRequest)(nil), "google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest") + proto.RegisterType((*GetLoginProfileRequest)(nil), "google.cloud.oslogin.v1beta.GetLoginProfileRequest") + proto.RegisterType((*GetSshPublicKeyRequest)(nil), "google.cloud.oslogin.v1beta.GetSshPublicKeyRequest") + proto.RegisterType((*ImportSshPublicKeyRequest)(nil), "google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest") + proto.RegisterType((*ImportSshPublicKeyResponse)(nil), "google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse") + proto.RegisterType((*UpdateSshPublicKeyRequest)(nil), "google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest") +} + +// 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 + +// Client API for OsLoginService service + +type OsLoginServiceClient interface { + // Deletes a POSIX account. + DeletePosixAccount(ctx context.Context, in *DeletePosixAccountRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) + // Deletes an SSH public key. + DeleteSshPublicKey(ctx context.Context, in *DeleteSshPublicKeyRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) + // Retrieves the profile information used for logging in to a virtual machine + // on Google Compute Engine. + GetLoginProfile(ctx context.Context, in *GetLoginProfileRequest, opts ...grpc.CallOption) (*LoginProfile, error) + // Retrieves an SSH public key. + GetSshPublicKey(ctx context.Context, in *GetSshPublicKeyRequest, opts ...grpc.CallOption) (*google_cloud_oslogin_common.SshPublicKey, error) + // Adds an SSH public key and returns the profile information. Default POSIX + // account information is set when no username and UID exist as part of the + // login profile. + ImportSshPublicKey(ctx context.Context, in *ImportSshPublicKeyRequest, opts ...grpc.CallOption) (*ImportSshPublicKeyResponse, error) + // Updates an SSH public key and returns the profile information. This method + // supports patch semantics. + UpdateSshPublicKey(ctx context.Context, in *UpdateSshPublicKeyRequest, opts ...grpc.CallOption) (*google_cloud_oslogin_common.SshPublicKey, error) +} + +type osLoginServiceClient struct { + cc *grpc.ClientConn +} + +func NewOsLoginServiceClient(cc *grpc.ClientConn) OsLoginServiceClient { + return &osLoginServiceClient{cc} +} + +func (c *osLoginServiceClient) DeletePosixAccount(ctx context.Context, in *DeletePosixAccountRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { + out := new(google_protobuf1.Empty) + err := grpc.Invoke(ctx, "/google.cloud.oslogin.v1beta.OsLoginService/DeletePosixAccount", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *osLoginServiceClient) DeleteSshPublicKey(ctx context.Context, in *DeleteSshPublicKeyRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { + out := new(google_protobuf1.Empty) + err := grpc.Invoke(ctx, "/google.cloud.oslogin.v1beta.OsLoginService/DeleteSshPublicKey", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *osLoginServiceClient) GetLoginProfile(ctx context.Context, in *GetLoginProfileRequest, opts ...grpc.CallOption) (*LoginProfile, error) { + out := new(LoginProfile) + err := grpc.Invoke(ctx, "/google.cloud.oslogin.v1beta.OsLoginService/GetLoginProfile", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *osLoginServiceClient) GetSshPublicKey(ctx context.Context, in *GetSshPublicKeyRequest, opts ...grpc.CallOption) (*google_cloud_oslogin_common.SshPublicKey, error) { + out := new(google_cloud_oslogin_common.SshPublicKey) + err := grpc.Invoke(ctx, "/google.cloud.oslogin.v1beta.OsLoginService/GetSshPublicKey", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *osLoginServiceClient) ImportSshPublicKey(ctx context.Context, in *ImportSshPublicKeyRequest, opts ...grpc.CallOption) (*ImportSshPublicKeyResponse, error) { + out := new(ImportSshPublicKeyResponse) + err := grpc.Invoke(ctx, "/google.cloud.oslogin.v1beta.OsLoginService/ImportSshPublicKey", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *osLoginServiceClient) UpdateSshPublicKey(ctx context.Context, in *UpdateSshPublicKeyRequest, opts ...grpc.CallOption) (*google_cloud_oslogin_common.SshPublicKey, error) { + out := new(google_cloud_oslogin_common.SshPublicKey) + err := grpc.Invoke(ctx, "/google.cloud.oslogin.v1beta.OsLoginService/UpdateSshPublicKey", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for OsLoginService service + +type OsLoginServiceServer interface { + // Deletes a POSIX account. + DeletePosixAccount(context.Context, *DeletePosixAccountRequest) (*google_protobuf1.Empty, error) + // Deletes an SSH public key. + DeleteSshPublicKey(context.Context, *DeleteSshPublicKeyRequest) (*google_protobuf1.Empty, error) + // Retrieves the profile information used for logging in to a virtual machine + // on Google Compute Engine. + GetLoginProfile(context.Context, *GetLoginProfileRequest) (*LoginProfile, error) + // Retrieves an SSH public key. + GetSshPublicKey(context.Context, *GetSshPublicKeyRequest) (*google_cloud_oslogin_common.SshPublicKey, error) + // Adds an SSH public key and returns the profile information. Default POSIX + // account information is set when no username and UID exist as part of the + // login profile. + ImportSshPublicKey(context.Context, *ImportSshPublicKeyRequest) (*ImportSshPublicKeyResponse, error) + // Updates an SSH public key and returns the profile information. This method + // supports patch semantics. + UpdateSshPublicKey(context.Context, *UpdateSshPublicKeyRequest) (*google_cloud_oslogin_common.SshPublicKey, error) +} + +func RegisterOsLoginServiceServer(s *grpc.Server, srv OsLoginServiceServer) { + s.RegisterService(&_OsLoginService_serviceDesc, srv) +} + +func _OsLoginService_DeletePosixAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeletePosixAccountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OsLoginServiceServer).DeletePosixAccount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.oslogin.v1beta.OsLoginService/DeletePosixAccount", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OsLoginServiceServer).DeletePosixAccount(ctx, req.(*DeletePosixAccountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _OsLoginService_DeleteSshPublicKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteSshPublicKeyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OsLoginServiceServer).DeleteSshPublicKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.oslogin.v1beta.OsLoginService/DeleteSshPublicKey", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OsLoginServiceServer).DeleteSshPublicKey(ctx, req.(*DeleteSshPublicKeyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _OsLoginService_GetLoginProfile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetLoginProfileRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OsLoginServiceServer).GetLoginProfile(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.oslogin.v1beta.OsLoginService/GetLoginProfile", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OsLoginServiceServer).GetLoginProfile(ctx, req.(*GetLoginProfileRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _OsLoginService_GetSshPublicKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetSshPublicKeyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OsLoginServiceServer).GetSshPublicKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.oslogin.v1beta.OsLoginService/GetSshPublicKey", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OsLoginServiceServer).GetSshPublicKey(ctx, req.(*GetSshPublicKeyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _OsLoginService_ImportSshPublicKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ImportSshPublicKeyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OsLoginServiceServer).ImportSshPublicKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.oslogin.v1beta.OsLoginService/ImportSshPublicKey", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OsLoginServiceServer).ImportSshPublicKey(ctx, req.(*ImportSshPublicKeyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _OsLoginService_UpdateSshPublicKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateSshPublicKeyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OsLoginServiceServer).UpdateSshPublicKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.oslogin.v1beta.OsLoginService/UpdateSshPublicKey", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OsLoginServiceServer).UpdateSshPublicKey(ctx, req.(*UpdateSshPublicKeyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _OsLoginService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.cloud.oslogin.v1beta.OsLoginService", + HandlerType: (*OsLoginServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "DeletePosixAccount", + Handler: _OsLoginService_DeletePosixAccount_Handler, + }, + { + MethodName: "DeleteSshPublicKey", + Handler: _OsLoginService_DeleteSshPublicKey_Handler, + }, + { + MethodName: "GetLoginProfile", + Handler: _OsLoginService_GetLoginProfile_Handler, + }, + { + MethodName: "GetSshPublicKey", + Handler: _OsLoginService_GetSshPublicKey_Handler, + }, + { + MethodName: "ImportSshPublicKey", + Handler: _OsLoginService_ImportSshPublicKey_Handler, + }, + { + MethodName: "UpdateSshPublicKey", + Handler: _OsLoginService_UpdateSshPublicKey_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/cloud/oslogin/v1beta/oslogin.proto", +} + +func init() { proto.RegisterFile("google/cloud/oslogin/v1beta/oslogin.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 780 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xcd, 0x4e, 0xdb, 0x4a, + 0x14, 0x96, 0x13, 0x2e, 0x82, 0x21, 0xc0, 0xd5, 0x2c, 0x50, 0x30, 0x5c, 0xdd, 0x60, 0xd4, 0x2a, + 0x84, 0xca, 0x16, 0x41, 0x6a, 0x11, 0x94, 0x56, 0x0d, 0xa5, 0x08, 0xf5, 0x87, 0x28, 0xa8, 0x2c, + 0x2a, 0xa4, 0x68, 0x62, 0x0f, 0xc6, 0x8d, 0xed, 0x99, 0x7a, 0x6c, 0xd4, 0xa8, 0x62, 0x53, 0xa9, + 0xeb, 0x2e, 0xda, 0x75, 0xa5, 0xaa, 0xbb, 0xee, 0xba, 0xea, 0xaa, 0x2f, 0xc0, 0xb6, 0xaf, 0xd0, + 0xbe, 0x47, 0xe5, 0xf1, 0x18, 0x9c, 0xc4, 0x49, 0x8c, 0xd4, 0x9d, 0x67, 0xce, 0x39, 0xdf, 0xf9, + 0xe6, 0x3b, 0x3f, 0x32, 0x58, 0x31, 0x09, 0x31, 0x6d, 0xac, 0xe9, 0x36, 0x09, 0x0c, 0x8d, 0x30, + 0x9b, 0x98, 0x96, 0xab, 0x9d, 0xad, 0xb5, 0xb0, 0x8f, 0xe2, 0xa3, 0x4a, 0x3d, 0xe2, 0x13, 0xb8, + 0x10, 0xb9, 0xaa, 0xdc, 0x55, 0x8d, 0x6d, 0x91, 0xab, 0xbc, 0x28, 0x70, 0x10, 0xb5, 0x34, 0xe4, + 0xba, 0xc4, 0x47, 0xbe, 0x45, 0x5c, 0x16, 0x85, 0xca, 0x4b, 0xa9, 0x59, 0x74, 0xe2, 0x38, 0x44, + 0xa0, 0xcb, 0x02, 0x5d, 0xe3, 0xa7, 0x56, 0x70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 0x72, 0x4d, 0x95, 0x78, 0xa6, 0x66, + 0x62, 0x97, 0x0f, 0x95, 0x16, 0x99, 0x10, 0xb5, 0x58, 0xea, 0xcf, 0xd1, 0x96, 0x38, 0x7e, 0xcd, + 0x2d, 0xec, 0x45, 0x20, 0x3b, 0x3c, 0xa3, 0xc8, 0xa0, 0x1e, 0xad, 0xd5, 0xb0, 0x8f, 0x2e, 0x62, + 0xeb, 0x31, 0xb7, 0x1e, 0x0b, 0xeb, 0xf1, 0x11, 0xc7, 0x68, 0x8d, 0xf3, 0x54, 0xeb, 0x7f, 0x02, + 0x00, 0x00, 0xff, 0xff, 0x63, 0x03, 0xf6, 0x66, 0x86, 0x09, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/resourcemanager/v2/folders.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/resourcemanager/v2/folders.pb.go new file mode 100644 index 0000000000..6f360bba40 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/resourcemanager/v2/folders.pb.go @@ -0,0 +1,1263 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/resourcemanager/v2/folders.proto + +/* +Package resourcemanager is a generated protocol buffer package. + +It is generated from these files: + google/cloud/resourcemanager/v2/folders.proto + +It has these top-level messages: + Folder + ListFoldersRequest + ListFoldersResponse + SearchFoldersRequest + SearchFoldersResponse + GetFolderRequest + CreateFolderRequest + MoveFolderRequest + UpdateFolderRequest + DeleteFolderRequest + UndeleteFolderRequest + FolderOperation +*/ +package resourcemanager + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_iam_v11 "google.golang.org/genproto/googleapis/iam/v1" +import google_iam_v1 "google.golang.org/genproto/googleapis/iam/v1" +import google_longrunning "google.golang.org/genproto/googleapis/longrunning" +import google_protobuf3 "google.golang.org/genproto/protobuf/field_mask" +import google_protobuf4 "github.com/golang/protobuf/ptypes/timestamp" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Folder lifecycle states. +type Folder_LifecycleState int32 + +const ( + // Unspecified state. + Folder_LIFECYCLE_STATE_UNSPECIFIED Folder_LifecycleState = 0 + // The normal and active state. + Folder_ACTIVE Folder_LifecycleState = 1 + // The folder has been marked for deletion by the user. + Folder_DELETE_REQUESTED Folder_LifecycleState = 2 +) + +var Folder_LifecycleState_name = map[int32]string{ + 0: "LIFECYCLE_STATE_UNSPECIFIED", + 1: "ACTIVE", + 2: "DELETE_REQUESTED", +} +var Folder_LifecycleState_value = map[string]int32{ + "LIFECYCLE_STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "DELETE_REQUESTED": 2, +} + +func (x Folder_LifecycleState) String() string { + return proto.EnumName(Folder_LifecycleState_name, int32(x)) +} +func (Folder_LifecycleState) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 0} } + +// The type of operation that failed. +type FolderOperation_OperationType int32 + +const ( + // Operation type not specified. + FolderOperation_OPERATION_TYPE_UNSPECIFIED FolderOperation_OperationType = 0 + // A create folder operation. + FolderOperation_CREATE FolderOperation_OperationType = 1 + // A move folder operation. + FolderOperation_MOVE FolderOperation_OperationType = 2 +) + +var FolderOperation_OperationType_name = map[int32]string{ + 0: "OPERATION_TYPE_UNSPECIFIED", + 1: "CREATE", + 2: "MOVE", +} +var FolderOperation_OperationType_value = map[string]int32{ + "OPERATION_TYPE_UNSPECIFIED": 0, + "CREATE": 1, + "MOVE": 2, +} + +func (x FolderOperation_OperationType) String() string { + return proto.EnumName(FolderOperation_OperationType_name, int32(x)) +} +func (FolderOperation_OperationType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{11, 0} +} + +// A Folder in an Organization's resource hierarchy, used to +// organize that Organization's resources. +type Folder struct { + // Output only. The resource name of the Folder. + // Its format is `folders/{folder_id}`, for example: "folders/1234". + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The Folder’s parent's resource name. + // Updates to the folder's parent must be performed via [MoveFolders]. + Parent string `protobuf:"bytes,2,opt,name=parent" json:"parent,omitempty"` + // The folder’s display name. + // A folder’s display name must be unique amongst its siblings, e.g. + // no two folders with the same parent can share the same display name. + // The display name must start and end with a letter or digit, may contain + // letters, digits, spaces, hyphens and underscores and can be no longer + // than 30 characters. This is captured by the regular expression: + // [\p{L}\p{N}]({\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?. + DisplayName string `protobuf:"bytes,3,opt,name=display_name,json=displayName" json:"display_name,omitempty"` + // Output only. The lifecycle state of the folder. + // Updates to the lifecycle_state must be performed via + // [DeleteFolder] and [UndeleteFolder]. + LifecycleState Folder_LifecycleState `protobuf:"varint,4,opt,name=lifecycle_state,json=lifecycleState,enum=google.cloud.resourcemanager.v2.Folder_LifecycleState" json:"lifecycle_state,omitempty"` + // Output only. Timestamp when the Folder was created. Assigned by the server. + CreateTime *google_protobuf4.Timestamp `protobuf:"bytes,5,opt,name=create_time,json=createTime" json:"create_time,omitempty"` + // Output only. Timestamp when the Folder was last modified. + UpdateTime *google_protobuf4.Timestamp `protobuf:"bytes,6,opt,name=update_time,json=updateTime" json:"update_time,omitempty"` +} + +func (m *Folder) Reset() { *m = Folder{} } +func (m *Folder) String() string { return proto.CompactTextString(m) } +func (*Folder) ProtoMessage() {} +func (*Folder) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *Folder) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Folder) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *Folder) GetDisplayName() string { + if m != nil { + return m.DisplayName + } + return "" +} + +func (m *Folder) GetLifecycleState() Folder_LifecycleState { + if m != nil { + return m.LifecycleState + } + return Folder_LIFECYCLE_STATE_UNSPECIFIED +} + +func (m *Folder) GetCreateTime() *google_protobuf4.Timestamp { + if m != nil { + return m.CreateTime + } + return nil +} + +func (m *Folder) GetUpdateTime() *google_protobuf4.Timestamp { + if m != nil { + return m.UpdateTime + } + return nil +} + +// The ListFolders request message. +type ListFoldersRequest struct { + // The resource name of the Organization or Folder whose Folders are + // being listed. + // Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. + // Access to this method is controlled by checking the + // `resourcemanager.folders.list` permission on the `parent`. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // The maximum number of Folders to return in the response. + // This field is optional. + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // A pagination token returned from a previous call to `ListFolders` + // that indicates where this listing should continue from. + // This field is optional. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` + // Controls whether Folders in the [DELETE_REQUESTED} state should + // be returned. + ShowDeleted bool `protobuf:"varint,4,opt,name=show_deleted,json=showDeleted" json:"show_deleted,omitempty"` +} + +func (m *ListFoldersRequest) Reset() { *m = ListFoldersRequest{} } +func (m *ListFoldersRequest) String() string { return proto.CompactTextString(m) } +func (*ListFoldersRequest) ProtoMessage() {} +func (*ListFoldersRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *ListFoldersRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *ListFoldersRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListFoldersRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +func (m *ListFoldersRequest) GetShowDeleted() bool { + if m != nil { + return m.ShowDeleted + } + return false +} + +// The ListFolders response message. +type ListFoldersResponse struct { + // A possibly paginated list of Folders that are direct descendants of + // the specified parent resource. + Folders []*Folder `protobuf:"bytes,1,rep,name=folders" json:"folders,omitempty"` + // A pagination token returned from a previous call to `ListFolders` + // that indicates from where listing should continue. + // This field is optional. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListFoldersResponse) Reset() { *m = ListFoldersResponse{} } +func (m *ListFoldersResponse) String() string { return proto.CompactTextString(m) } +func (*ListFoldersResponse) ProtoMessage() {} +func (*ListFoldersResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *ListFoldersResponse) GetFolders() []*Folder { + if m != nil { + return m.Folders + } + return nil +} + +func (m *ListFoldersResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// The request message for searching folders. +type SearchFoldersRequest struct { + // The maximum number of folders to return in the response. + // This field is optional. + PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // A pagination token returned from a previous call to `SearchFolders` + // that indicates from where search should continue. + // This field is optional. + PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` + // Search criteria used to select the Folders to return. + // If no search criteria is specified then all accessible folders will be + // returned. + // + // Query expressions can be used to restrict results based upon displayName, + // lifecycleState and parent, where the operators `=`, `NOT`, `AND` and `OR` + // can be used along with the suffix wildcard symbol `*`. + // + // Some example queries are: + // |Query|Description| + // |------|-----------| + // |displayName=Test*|Folders whose display name starts with "Test".| + // |lifecycleState=ACTIVE|Folders whose lifecycleState is ACTIVE.| + // |parent=folders/123|Folders whose parent is "folders/123".| + // |parent=folders/123 AND lifecycleState=ACTIVE|Active folders whose + // parent is "folders/123".| + Query string `protobuf:"bytes,3,opt,name=query" json:"query,omitempty"` +} + +func (m *SearchFoldersRequest) Reset() { *m = SearchFoldersRequest{} } +func (m *SearchFoldersRequest) String() string { return proto.CompactTextString(m) } +func (*SearchFoldersRequest) ProtoMessage() {} +func (*SearchFoldersRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *SearchFoldersRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *SearchFoldersRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +func (m *SearchFoldersRequest) GetQuery() string { + if m != nil { + return m.Query + } + return "" +} + +// The response message for searching folders. +type SearchFoldersResponse struct { + // A possibly paginated folder search results. + // the specified parent resource. + Folders []*Folder `protobuf:"bytes,1,rep,name=folders" json:"folders,omitempty"` + // A pagination token returned from a previous call to `SearchFolders` + // that indicates from where searching should continue. + // This field is optional. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *SearchFoldersResponse) Reset() { *m = SearchFoldersResponse{} } +func (m *SearchFoldersResponse) String() string { return proto.CompactTextString(m) } +func (*SearchFoldersResponse) ProtoMessage() {} +func (*SearchFoldersResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *SearchFoldersResponse) GetFolders() []*Folder { + if m != nil { + return m.Folders + } + return nil +} + +func (m *SearchFoldersResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// The GetFolder request message. +type GetFolderRequest struct { + // The resource name of the Folder to retrieve. + // Must be of the form `folders/{folder_id}`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetFolderRequest) Reset() { *m = GetFolderRequest{} } +func (m *GetFolderRequest) String() string { return proto.CompactTextString(m) } +func (*GetFolderRequest) ProtoMessage() {} +func (*GetFolderRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *GetFolderRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// The CreateFolder request message. +type CreateFolderRequest struct { + // The resource name of the new Folder's parent. + // Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // The Folder being created, only the display name will be consulted. + // All other fields will be ignored. + Folder *Folder `protobuf:"bytes,2,opt,name=folder" json:"folder,omitempty"` +} + +func (m *CreateFolderRequest) Reset() { *m = CreateFolderRequest{} } +func (m *CreateFolderRequest) String() string { return proto.CompactTextString(m) } +func (*CreateFolderRequest) ProtoMessage() {} +func (*CreateFolderRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *CreateFolderRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *CreateFolderRequest) GetFolder() *Folder { + if m != nil { + return m.Folder + } + return nil +} + +// The MoveFolder request message. +type MoveFolderRequest struct { + // The resource name of the Folder to move. + // Must be of the form folders/{folder_id} + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The resource name of the Folder or Organization to reparent + // the folder under. + // Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. + DestinationParent string `protobuf:"bytes,2,opt,name=destination_parent,json=destinationParent" json:"destination_parent,omitempty"` +} + +func (m *MoveFolderRequest) Reset() { *m = MoveFolderRequest{} } +func (m *MoveFolderRequest) String() string { return proto.CompactTextString(m) } +func (*MoveFolderRequest) ProtoMessage() {} +func (*MoveFolderRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *MoveFolderRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *MoveFolderRequest) GetDestinationParent() string { + if m != nil { + return m.DestinationParent + } + return "" +} + +// The request message for updating a folder's display name. +type UpdateFolderRequest struct { + // The new definition of the Folder. It must include a + // a `name` and `display_name` field. The other fields + // will be ignored. + Folder *Folder `protobuf:"bytes,1,opt,name=folder" json:"folder,omitempty"` + // Fields to be updated. + // Only the `display_name` can be updated. + UpdateMask *google_protobuf3.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask" json:"update_mask,omitempty"` +} + +func (m *UpdateFolderRequest) Reset() { *m = UpdateFolderRequest{} } +func (m *UpdateFolderRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateFolderRequest) ProtoMessage() {} +func (*UpdateFolderRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *UpdateFolderRequest) GetFolder() *Folder { + if m != nil { + return m.Folder + } + return nil +} + +func (m *UpdateFolderRequest) GetUpdateMask() *google_protobuf3.FieldMask { + if m != nil { + return m.UpdateMask + } + return nil +} + +// The DeleteFolder request message. +type DeleteFolderRequest struct { + // the resource name of the Folder to be deleted. + // Must be of the form `folders/{folder_id}`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Instructs DeleteFolderAction to delete a folder even when the folder is not + // empty. + RecursiveDelete bool `protobuf:"varint,2,opt,name=recursive_delete,json=recursiveDelete" json:"recursive_delete,omitempty"` +} + +func (m *DeleteFolderRequest) Reset() { *m = DeleteFolderRequest{} } +func (m *DeleteFolderRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteFolderRequest) ProtoMessage() {} +func (*DeleteFolderRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *DeleteFolderRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *DeleteFolderRequest) GetRecursiveDelete() bool { + if m != nil { + return m.RecursiveDelete + } + return false +} + +// The UndeleteFolder request message. +type UndeleteFolderRequest struct { + // The resource name of the Folder to undelete. + // Must be of the form `folders/{folder_id}`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *UndeleteFolderRequest) Reset() { *m = UndeleteFolderRequest{} } +func (m *UndeleteFolderRequest) String() string { return proto.CompactTextString(m) } +func (*UndeleteFolderRequest) ProtoMessage() {} +func (*UndeleteFolderRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *UndeleteFolderRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Metadata describing a long running folder operation +type FolderOperation struct { + // The display name of the folder. + DisplayName string `protobuf:"bytes,1,opt,name=display_name,json=displayName" json:"display_name,omitempty"` + // The type of this operation. + OperationType FolderOperation_OperationType `protobuf:"varint,2,opt,name=operation_type,json=operationType,enum=google.cloud.resourcemanager.v2.FolderOperation_OperationType" json:"operation_type,omitempty"` + // The resource name of the folder's parent. + // Only applicable when the operation_type is MOVE. + SourceParent string `protobuf:"bytes,3,opt,name=source_parent,json=sourceParent" json:"source_parent,omitempty"` + // The resource name of the folder or organization we are either creating + // the folder under or moving the folder to. + DestinationParent string `protobuf:"bytes,4,opt,name=destination_parent,json=destinationParent" json:"destination_parent,omitempty"` +} + +func (m *FolderOperation) Reset() { *m = FolderOperation{} } +func (m *FolderOperation) String() string { return proto.CompactTextString(m) } +func (*FolderOperation) ProtoMessage() {} +func (*FolderOperation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } + +func (m *FolderOperation) GetDisplayName() string { + if m != nil { + return m.DisplayName + } + return "" +} + +func (m *FolderOperation) GetOperationType() FolderOperation_OperationType { + if m != nil { + return m.OperationType + } + return FolderOperation_OPERATION_TYPE_UNSPECIFIED +} + +func (m *FolderOperation) GetSourceParent() string { + if m != nil { + return m.SourceParent + } + return "" +} + +func (m *FolderOperation) GetDestinationParent() string { + if m != nil { + return m.DestinationParent + } + return "" +} + +func init() { + proto.RegisterType((*Folder)(nil), "google.cloud.resourcemanager.v2.Folder") + proto.RegisterType((*ListFoldersRequest)(nil), "google.cloud.resourcemanager.v2.ListFoldersRequest") + proto.RegisterType((*ListFoldersResponse)(nil), "google.cloud.resourcemanager.v2.ListFoldersResponse") + proto.RegisterType((*SearchFoldersRequest)(nil), "google.cloud.resourcemanager.v2.SearchFoldersRequest") + proto.RegisterType((*SearchFoldersResponse)(nil), "google.cloud.resourcemanager.v2.SearchFoldersResponse") + proto.RegisterType((*GetFolderRequest)(nil), "google.cloud.resourcemanager.v2.GetFolderRequest") + proto.RegisterType((*CreateFolderRequest)(nil), "google.cloud.resourcemanager.v2.CreateFolderRequest") + proto.RegisterType((*MoveFolderRequest)(nil), "google.cloud.resourcemanager.v2.MoveFolderRequest") + proto.RegisterType((*UpdateFolderRequest)(nil), "google.cloud.resourcemanager.v2.UpdateFolderRequest") + proto.RegisterType((*DeleteFolderRequest)(nil), "google.cloud.resourcemanager.v2.DeleteFolderRequest") + proto.RegisterType((*UndeleteFolderRequest)(nil), "google.cloud.resourcemanager.v2.UndeleteFolderRequest") + proto.RegisterType((*FolderOperation)(nil), "google.cloud.resourcemanager.v2.FolderOperation") + proto.RegisterEnum("google.cloud.resourcemanager.v2.Folder_LifecycleState", Folder_LifecycleState_name, Folder_LifecycleState_value) + proto.RegisterEnum("google.cloud.resourcemanager.v2.FolderOperation_OperationType", FolderOperation_OperationType_name, FolderOperation_OperationType_value) +} + +// 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 + +// Client API for Folders service + +type FoldersClient interface { + // Lists the Folders that are direct descendants of supplied parent resource. + // List provides a strongly consistent view of the Folders underneath + // the specified parent resource. + // List returns Folders sorted based upon the (ascending) lexical ordering + // of their display_name. + // The caller must have `resourcemanager.folders.list` permission on the + // identified parent. + ListFolders(ctx context.Context, in *ListFoldersRequest, opts ...grpc.CallOption) (*ListFoldersResponse, error) + // Search for folders that match specific filter criteria. + // Search provides an eventually consistent view of the folders a user has + // access to which meet the specified filter criteria. + // + // This will only return folders on which the caller has the + // permission `resourcemanager.folders.get`. + SearchFolders(ctx context.Context, in *SearchFoldersRequest, opts ...grpc.CallOption) (*SearchFoldersResponse, error) + // Retrieves a Folder identified by the supplied resource name. + // Valid Folder resource names have the format `folders/{folder_id}` + // (for example, `folders/1234`). + // The caller must have `resourcemanager.folders.get` permission on the + // identified folder. + GetFolder(ctx context.Context, in *GetFolderRequest, opts ...grpc.CallOption) (*Folder, error) + // Creates a Folder in the resource hierarchy. + // Returns an Operation which can be used to track the progress of the + // folder creation workflow. + // Upon success the Operation.response field will be populated with the + // created Folder. + // + // In order to succeed, the addition of this new Folder must not violate + // the Folder naming, height or fanout constraints. + // + The Folder's display_name must be distinct from all other Folder's that + // share its parent. + // + The addition of the Folder must not cause the active Folder hierarchy + // to exceed a height of 4. Note, the full active + deleted Folder hierarchy + // is allowed to reach a height of 8; this provides additional headroom when + // moving folders that contain deleted folders. + // + The addition of the Folder must not cause the total number of Folders + // under its parent to exceed 100. + // + // If the operation fails due to a folder constraint violation, + // a PreconditionFailure explaining the violation will be returned. + // If the failure occurs synchronously then the PreconditionFailure + // will be returned via the Status.details field and if it occurs + // asynchronously then the PreconditionFailure will be returned + // via the the Operation.error field. + // + // The caller must have `resourcemanager.folders.create` permission on the + // identified parent. + CreateFolder(ctx context.Context, in *CreateFolderRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Updates a Folder, changing its display_name. + // Changes to the folder display_name will be rejected if they violate either + // the display_name formatting rules or naming constraints described in + // the [CreateFolder] documentation. + // + The Folder's display name must start and end with a letter or digit, + // may contain letters, digits, spaces, hyphens and underscores and can be + // no longer than 30 characters. This is captured by the regular expression: + // [\p{L}\p{N}]({\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?. + // The caller must have `resourcemanager.folders.update` permission on the + // identified folder. + // + // If the update fails due to the unique name constraint then a + // PreconditionFailure explaining this violation will be returned + // in the Status.details field. + UpdateFolder(ctx context.Context, in *UpdateFolderRequest, opts ...grpc.CallOption) (*Folder, error) + // Moves a Folder under a new resource parent. + // Returns an Operation which can be used to track the progress of the + // folder move workflow. + // Upon success the Operation.response field will be populated with the + // moved Folder. + // Upon failure, a FolderOperationError categorizing the failure cause will + // be returned - if the failure occurs synchronously then the + // FolderOperationError will be returned via the Status.details field + // and if it occurs asynchronously then the FolderOperation will be returned + // via the the Operation.error field. + // In addition, the Operation.metadata field will be populated with a + // FolderOperation message as an aid to stateless clients. + // Folder moves will be rejected if they violate either the naming, height + // or fanout constraints described in the [CreateFolder] documentation. + // The caller must have `resourcemanager.folders.move` permission on the + // folder's current and proposed new parent. + MoveFolder(ctx context.Context, in *MoveFolderRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Requests deletion of a Folder. The Folder is moved into the + // [DELETE_REQUESTED] state immediately, and is deleted approximately 30 days + // later. This method may only be called on an empty Folder in the [ACTIVE] + // state, where a Folder is empty if it doesn't contain any Folders or + // Projects in the [ACTIVE] state. + // The caller must have `resourcemanager.folders.delete` permission on the + // identified folder. + DeleteFolder(ctx context.Context, in *DeleteFolderRequest, opts ...grpc.CallOption) (*Folder, error) + // Cancels the deletion request for a Folder. This method may only be + // called on a Folder in the [DELETE_REQUESTED] state. + // In order to succeed, the Folder's parent must be in the [ACTIVE] state. + // In addition, reintroducing the folder into the tree must not violate + // folder naming, height and fanout constraints described in the + // [CreateFolder] documentation. + // The caller must have `resourcemanager.folders.undelete` permission on the + // identified folder. + UndeleteFolder(ctx context.Context, in *UndeleteFolderRequest, opts ...grpc.CallOption) (*Folder, error) + // Gets the access control policy for a Folder. The returned policy may be + // empty if no such policy or resource exists. The `resource` field should + // be the Folder's resource name, e.g. "folders/1234". + // The caller must have `resourcemanager.folders.getIamPolicy` permission + // on the identified folder. + GetIamPolicy(ctx context.Context, in *google_iam_v11.GetIamPolicyRequest, opts ...grpc.CallOption) (*google_iam_v1.Policy, error) + // Sets the access control policy on a Folder, replacing any existing policy. + // The `resource` field should be the Folder's resource name, e.g. + // "folders/1234". + // The caller must have `resourcemanager.folders.setIamPolicy` permission + // on the identified folder. + SetIamPolicy(ctx context.Context, in *google_iam_v11.SetIamPolicyRequest, opts ...grpc.CallOption) (*google_iam_v1.Policy, error) + // Returns permissions that a caller has on the specified Folder. + // The `resource` field should be the Folder's resource name, + // e.g. "folders/1234". + // + // There are no permissions required for making this API call. + TestIamPermissions(ctx context.Context, in *google_iam_v11.TestIamPermissionsRequest, opts ...grpc.CallOption) (*google_iam_v11.TestIamPermissionsResponse, error) +} + +type foldersClient struct { + cc *grpc.ClientConn +} + +func NewFoldersClient(cc *grpc.ClientConn) FoldersClient { + return &foldersClient{cc} +} + +func (c *foldersClient) ListFolders(ctx context.Context, in *ListFoldersRequest, opts ...grpc.CallOption) (*ListFoldersResponse, error) { + out := new(ListFoldersResponse) + err := grpc.Invoke(ctx, "/google.cloud.resourcemanager.v2.Folders/ListFolders", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *foldersClient) SearchFolders(ctx context.Context, in *SearchFoldersRequest, opts ...grpc.CallOption) (*SearchFoldersResponse, error) { + out := new(SearchFoldersResponse) + err := grpc.Invoke(ctx, "/google.cloud.resourcemanager.v2.Folders/SearchFolders", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *foldersClient) GetFolder(ctx context.Context, in *GetFolderRequest, opts ...grpc.CallOption) (*Folder, error) { + out := new(Folder) + err := grpc.Invoke(ctx, "/google.cloud.resourcemanager.v2.Folders/GetFolder", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *foldersClient) CreateFolder(ctx context.Context, in *CreateFolderRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.cloud.resourcemanager.v2.Folders/CreateFolder", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *foldersClient) UpdateFolder(ctx context.Context, in *UpdateFolderRequest, opts ...grpc.CallOption) (*Folder, error) { + out := new(Folder) + err := grpc.Invoke(ctx, "/google.cloud.resourcemanager.v2.Folders/UpdateFolder", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *foldersClient) MoveFolder(ctx context.Context, in *MoveFolderRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.cloud.resourcemanager.v2.Folders/MoveFolder", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *foldersClient) DeleteFolder(ctx context.Context, in *DeleteFolderRequest, opts ...grpc.CallOption) (*Folder, error) { + out := new(Folder) + err := grpc.Invoke(ctx, "/google.cloud.resourcemanager.v2.Folders/DeleteFolder", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *foldersClient) UndeleteFolder(ctx context.Context, in *UndeleteFolderRequest, opts ...grpc.CallOption) (*Folder, error) { + out := new(Folder) + err := grpc.Invoke(ctx, "/google.cloud.resourcemanager.v2.Folders/UndeleteFolder", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *foldersClient) GetIamPolicy(ctx context.Context, in *google_iam_v11.GetIamPolicyRequest, opts ...grpc.CallOption) (*google_iam_v1.Policy, error) { + out := new(google_iam_v1.Policy) + err := grpc.Invoke(ctx, "/google.cloud.resourcemanager.v2.Folders/GetIamPolicy", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *foldersClient) SetIamPolicy(ctx context.Context, in *google_iam_v11.SetIamPolicyRequest, opts ...grpc.CallOption) (*google_iam_v1.Policy, error) { + out := new(google_iam_v1.Policy) + err := grpc.Invoke(ctx, "/google.cloud.resourcemanager.v2.Folders/SetIamPolicy", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *foldersClient) TestIamPermissions(ctx context.Context, in *google_iam_v11.TestIamPermissionsRequest, opts ...grpc.CallOption) (*google_iam_v11.TestIamPermissionsResponse, error) { + out := new(google_iam_v11.TestIamPermissionsResponse) + err := grpc.Invoke(ctx, "/google.cloud.resourcemanager.v2.Folders/TestIamPermissions", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for Folders service + +type FoldersServer interface { + // Lists the Folders that are direct descendants of supplied parent resource. + // List provides a strongly consistent view of the Folders underneath + // the specified parent resource. + // List returns Folders sorted based upon the (ascending) lexical ordering + // of their display_name. + // The caller must have `resourcemanager.folders.list` permission on the + // identified parent. + ListFolders(context.Context, *ListFoldersRequest) (*ListFoldersResponse, error) + // Search for folders that match specific filter criteria. + // Search provides an eventually consistent view of the folders a user has + // access to which meet the specified filter criteria. + // + // This will only return folders on which the caller has the + // permission `resourcemanager.folders.get`. + SearchFolders(context.Context, *SearchFoldersRequest) (*SearchFoldersResponse, error) + // Retrieves a Folder identified by the supplied resource name. + // Valid Folder resource names have the format `folders/{folder_id}` + // (for example, `folders/1234`). + // The caller must have `resourcemanager.folders.get` permission on the + // identified folder. + GetFolder(context.Context, *GetFolderRequest) (*Folder, error) + // Creates a Folder in the resource hierarchy. + // Returns an Operation which can be used to track the progress of the + // folder creation workflow. + // Upon success the Operation.response field will be populated with the + // created Folder. + // + // In order to succeed, the addition of this new Folder must not violate + // the Folder naming, height or fanout constraints. + // + The Folder's display_name must be distinct from all other Folder's that + // share its parent. + // + The addition of the Folder must not cause the active Folder hierarchy + // to exceed a height of 4. Note, the full active + deleted Folder hierarchy + // is allowed to reach a height of 8; this provides additional headroom when + // moving folders that contain deleted folders. + // + The addition of the Folder must not cause the total number of Folders + // under its parent to exceed 100. + // + // If the operation fails due to a folder constraint violation, + // a PreconditionFailure explaining the violation will be returned. + // If the failure occurs synchronously then the PreconditionFailure + // will be returned via the Status.details field and if it occurs + // asynchronously then the PreconditionFailure will be returned + // via the the Operation.error field. + // + // The caller must have `resourcemanager.folders.create` permission on the + // identified parent. + CreateFolder(context.Context, *CreateFolderRequest) (*google_longrunning.Operation, error) + // Updates a Folder, changing its display_name. + // Changes to the folder display_name will be rejected if they violate either + // the display_name formatting rules or naming constraints described in + // the [CreateFolder] documentation. + // + The Folder's display name must start and end with a letter or digit, + // may contain letters, digits, spaces, hyphens and underscores and can be + // no longer than 30 characters. This is captured by the regular expression: + // [\p{L}\p{N}]({\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?. + // The caller must have `resourcemanager.folders.update` permission on the + // identified folder. + // + // If the update fails due to the unique name constraint then a + // PreconditionFailure explaining this violation will be returned + // in the Status.details field. + UpdateFolder(context.Context, *UpdateFolderRequest) (*Folder, error) + // Moves a Folder under a new resource parent. + // Returns an Operation which can be used to track the progress of the + // folder move workflow. + // Upon success the Operation.response field will be populated with the + // moved Folder. + // Upon failure, a FolderOperationError categorizing the failure cause will + // be returned - if the failure occurs synchronously then the + // FolderOperationError will be returned via the Status.details field + // and if it occurs asynchronously then the FolderOperation will be returned + // via the the Operation.error field. + // In addition, the Operation.metadata field will be populated with a + // FolderOperation message as an aid to stateless clients. + // Folder moves will be rejected if they violate either the naming, height + // or fanout constraints described in the [CreateFolder] documentation. + // The caller must have `resourcemanager.folders.move` permission on the + // folder's current and proposed new parent. + MoveFolder(context.Context, *MoveFolderRequest) (*google_longrunning.Operation, error) + // Requests deletion of a Folder. The Folder is moved into the + // [DELETE_REQUESTED] state immediately, and is deleted approximately 30 days + // later. This method may only be called on an empty Folder in the [ACTIVE] + // state, where a Folder is empty if it doesn't contain any Folders or + // Projects in the [ACTIVE] state. + // The caller must have `resourcemanager.folders.delete` permission on the + // identified folder. + DeleteFolder(context.Context, *DeleteFolderRequest) (*Folder, error) + // Cancels the deletion request for a Folder. This method may only be + // called on a Folder in the [DELETE_REQUESTED] state. + // In order to succeed, the Folder's parent must be in the [ACTIVE] state. + // In addition, reintroducing the folder into the tree must not violate + // folder naming, height and fanout constraints described in the + // [CreateFolder] documentation. + // The caller must have `resourcemanager.folders.undelete` permission on the + // identified folder. + UndeleteFolder(context.Context, *UndeleteFolderRequest) (*Folder, error) + // Gets the access control policy for a Folder. The returned policy may be + // empty if no such policy or resource exists. The `resource` field should + // be the Folder's resource name, e.g. "folders/1234". + // The caller must have `resourcemanager.folders.getIamPolicy` permission + // on the identified folder. + GetIamPolicy(context.Context, *google_iam_v11.GetIamPolicyRequest) (*google_iam_v1.Policy, error) + // Sets the access control policy on a Folder, replacing any existing policy. + // The `resource` field should be the Folder's resource name, e.g. + // "folders/1234". + // The caller must have `resourcemanager.folders.setIamPolicy` permission + // on the identified folder. + SetIamPolicy(context.Context, *google_iam_v11.SetIamPolicyRequest) (*google_iam_v1.Policy, error) + // Returns permissions that a caller has on the specified Folder. + // The `resource` field should be the Folder's resource name, + // e.g. "folders/1234". + // + // There are no permissions required for making this API call. + TestIamPermissions(context.Context, *google_iam_v11.TestIamPermissionsRequest) (*google_iam_v11.TestIamPermissionsResponse, error) +} + +func RegisterFoldersServer(s *grpc.Server, srv FoldersServer) { + s.RegisterService(&_Folders_serviceDesc, srv) +} + +func _Folders_ListFolders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListFoldersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FoldersServer).ListFolders(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.resourcemanager.v2.Folders/ListFolders", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FoldersServer).ListFolders(ctx, req.(*ListFoldersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Folders_SearchFolders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SearchFoldersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FoldersServer).SearchFolders(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.resourcemanager.v2.Folders/SearchFolders", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FoldersServer).SearchFolders(ctx, req.(*SearchFoldersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Folders_GetFolder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetFolderRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FoldersServer).GetFolder(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.resourcemanager.v2.Folders/GetFolder", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FoldersServer).GetFolder(ctx, req.(*GetFolderRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Folders_CreateFolder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateFolderRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FoldersServer).CreateFolder(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.resourcemanager.v2.Folders/CreateFolder", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FoldersServer).CreateFolder(ctx, req.(*CreateFolderRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Folders_UpdateFolder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateFolderRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FoldersServer).UpdateFolder(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.resourcemanager.v2.Folders/UpdateFolder", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FoldersServer).UpdateFolder(ctx, req.(*UpdateFolderRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Folders_MoveFolder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MoveFolderRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FoldersServer).MoveFolder(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.resourcemanager.v2.Folders/MoveFolder", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FoldersServer).MoveFolder(ctx, req.(*MoveFolderRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Folders_DeleteFolder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteFolderRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FoldersServer).DeleteFolder(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.resourcemanager.v2.Folders/DeleteFolder", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FoldersServer).DeleteFolder(ctx, req.(*DeleteFolderRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Folders_UndeleteFolder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UndeleteFolderRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FoldersServer).UndeleteFolder(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.resourcemanager.v2.Folders/UndeleteFolder", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FoldersServer).UndeleteFolder(ctx, req.(*UndeleteFolderRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Folders_GetIamPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(google_iam_v11.GetIamPolicyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FoldersServer).GetIamPolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.resourcemanager.v2.Folders/GetIamPolicy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FoldersServer).GetIamPolicy(ctx, req.(*google_iam_v11.GetIamPolicyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Folders_SetIamPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(google_iam_v11.SetIamPolicyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FoldersServer).SetIamPolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.resourcemanager.v2.Folders/SetIamPolicy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FoldersServer).SetIamPolicy(ctx, req.(*google_iam_v11.SetIamPolicyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Folders_TestIamPermissions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(google_iam_v11.TestIamPermissionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FoldersServer).TestIamPermissions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.resourcemanager.v2.Folders/TestIamPermissions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FoldersServer).TestIamPermissions(ctx, req.(*google_iam_v11.TestIamPermissionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Folders_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.cloud.resourcemanager.v2.Folders", + HandlerType: (*FoldersServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListFolders", + Handler: _Folders_ListFolders_Handler, + }, + { + MethodName: "SearchFolders", + Handler: _Folders_SearchFolders_Handler, + }, + { + MethodName: "GetFolder", + Handler: _Folders_GetFolder_Handler, + }, + { + MethodName: "CreateFolder", + Handler: _Folders_CreateFolder_Handler, + }, + { + MethodName: "UpdateFolder", + Handler: _Folders_UpdateFolder_Handler, + }, + { + MethodName: "MoveFolder", + Handler: _Folders_MoveFolder_Handler, + }, + { + MethodName: "DeleteFolder", + Handler: _Folders_DeleteFolder_Handler, + }, + { + MethodName: "UndeleteFolder", + Handler: _Folders_UndeleteFolder_Handler, + }, + { + MethodName: "GetIamPolicy", + Handler: _Folders_GetIamPolicy_Handler, + }, + { + MethodName: "SetIamPolicy", + Handler: _Folders_SetIamPolicy_Handler, + }, + { + MethodName: "TestIamPermissions", + Handler: _Folders_TestIamPermissions_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/cloud/resourcemanager/v2/folders.proto", +} + +func init() { proto.RegisterFile("google/cloud/resourcemanager/v2/folders.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 1235 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0x5d, 0x6f, 0xdb, 0xd4, + 0x1b, 0xff, 0x9f, 0xac, 0xcb, 0xba, 0x27, 0x2f, 0xcd, 0x4e, 0xdb, 0xfd, 0x4b, 0xba, 0xbe, 0x70, + 0xca, 0x46, 0xd6, 0x6a, 0xce, 0x9a, 0x41, 0x2f, 0x3a, 0x01, 0xea, 0x52, 0xb7, 0x8a, 0xd4, 0x97, + 0xe0, 0xb8, 0x95, 0x86, 0x2a, 0x59, 0x5e, 0x72, 0x9a, 0x5a, 0x75, 0x6c, 0xcf, 0x76, 0x02, 0xd9, + 0x84, 0x34, 0x4d, 0x9a, 0xb8, 0x98, 0xb8, 0xda, 0x1d, 0x88, 0x0b, 0x6e, 0xb9, 0x45, 0xe2, 0x3b, + 0xc0, 0x2d, 0x5f, 0x81, 0x0f, 0x82, 0x7c, 0x7c, 0x9c, 0xda, 0x4e, 0x3a, 0xa7, 0x08, 0x71, 0x55, + 0xfb, 0x79, 0xfd, 0x3d, 0x6f, 0xbf, 0x3a, 0xf0, 0xa0, 0x6d, 0x9a, 0x6d, 0x9d, 0x96, 0x9b, 0xba, + 0xd9, 0x6d, 0x95, 0x6d, 0xea, 0x98, 0x5d, 0xbb, 0x49, 0x3b, 0xaa, 0xa1, 0xb6, 0xa9, 0x5d, 0xee, + 0x55, 0xca, 0xa7, 0xa6, 0xde, 0xa2, 0xb6, 0x23, 0x58, 0xb6, 0xe9, 0x9a, 0x78, 0xc9, 0x37, 0x17, + 0x98, 0xb9, 0x10, 0x33, 0x17, 0x7a, 0x95, 0xe2, 0x1d, 0x1e, 0x4f, 0x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 0x56, 0x06, 0x30, 0x66, 0x63, + 0x36, 0xbe, 0x96, 0x3c, 0x64, 0x49, 0x57, 0xc9, 0x5d, 0x96, 0x34, 0x00, 0x17, 0x4e, 0xdc, 0x0e, + 0x05, 0xe3, 0xc9, 0x1b, 0xef, 0x4b, 0xde, 0xf8, 0x37, 0x93, 0x3b, 0xb1, 0xe4, 0x3f, 0x23, 0xc0, + 0x32, 0x75, 0x98, 0x90, 0xda, 0x1d, 0xcd, 0x71, 0xbc, 0x5f, 0x2f, 0xb8, 0x14, 0x8b, 0x3f, 0x6c, + 0x12, 0x20, 0xb9, 0x3f, 0x86, 0x25, 0x27, 0xb8, 0x0d, 0x86, 0xee, 0x21, 0x59, 0xbb, 0x14, 0x9d, + 0x3b, 0xe4, 0xbc, 0x89, 0x56, 0x9f, 0xfc, 0x8e, 0x60, 0xa5, 0x69, 0x76, 0x92, 0xc6, 0xfe, 0x24, + 0xcb, 0x19, 0xb5, 0xee, 0x7d, 0x40, 0xd4, 0xd1, 0x57, 0x07, 0xdc, 0xa1, 0x6d, 0xea, 0xaa, 0xd1, + 0x16, 0x4c, 0xbb, 0x5d, 0x6e, 0x53, 0x83, 0x7d, 0x5e, 0x94, 0x7d, 0x95, 0x6a, 0x69, 0xce, 0xa5, + 0x3f, 0x35, 0x1f, 0xc7, 0x44, 0xbf, 0xa4, 0x96, 0x76, 0xfd, 0x80, 0x55, 0x86, 0x40, 0xe2, 0xea, + 0x7d, 0x8e, 0xe0, 0xb8, 0xf2, 0x47, 0x60, 0x71, 0xc2, 0x2c, 0x4e, 0x62, 0x16, 0x27, 0xc7, 0x95, + 0x67, 0x69, 0x96, 0xfe, 0xd1, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xda, 0x9b, 0x45, 0x8f, 0xe8, + 0x0e, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/runtimeconfig/v1beta1/resources.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/runtimeconfig/v1beta1/resources.pb.go new file mode 100644 index 0000000000..157bd2c4c0 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/runtimeconfig/v1beta1/resources.pb.go @@ -0,0 +1,591 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/runtimeconfig/v1beta1/resources.proto + +/* +Package runtimeconfig is a generated protocol buffer package. + +It is generated from these files: + google/cloud/runtimeconfig/v1beta1/resources.proto + google/cloud/runtimeconfig/v1beta1/runtimeconfig.proto + +It has these top-level messages: + RuntimeConfig + Variable + EndCondition + Waiter + ListConfigsRequest + ListConfigsResponse + GetConfigRequest + CreateConfigRequest + UpdateConfigRequest + DeleteConfigRequest + ListVariablesRequest + ListVariablesResponse + WatchVariableRequest + GetVariableRequest + CreateVariableRequest + UpdateVariableRequest + DeleteVariableRequest + ListWaitersRequest + ListWaitersResponse + GetWaiterRequest + CreateWaiterRequest + DeleteWaiterRequest +*/ +package runtimeconfig + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf1 "github.com/golang/protobuf/ptypes/duration" +import google_protobuf2 "github.com/golang/protobuf/ptypes/timestamp" +import google_rpc "google.golang.org/genproto/googleapis/rpc/status" + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// The `VariableState` describes the last known state of the variable and is +// used during a `variables().watch` call to distinguish the state of the +// variable. +type VariableState int32 + +const ( + // Default variable state. + VariableState_VARIABLE_STATE_UNSPECIFIED VariableState = 0 + // The variable was updated, while `variables().watch` was executing. + VariableState_UPDATED VariableState = 1 + // The variable was deleted, while `variables().watch` was executing. + VariableState_DELETED VariableState = 2 +) + +var VariableState_name = map[int32]string{ + 0: "VARIABLE_STATE_UNSPECIFIED", + 1: "UPDATED", + 2: "DELETED", +} +var VariableState_value = map[string]int32{ + "VARIABLE_STATE_UNSPECIFIED": 0, + "UPDATED": 1, + "DELETED": 2, +} + +func (x VariableState) String() string { + return proto.EnumName(VariableState_name, int32(x)) +} +func (VariableState) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +// A RuntimeConfig resource is the primary resource in the Cloud RuntimeConfig +// service. A RuntimeConfig resource consists of metadata and a hierarchy of +// variables. +type RuntimeConfig struct { + // The resource name of a runtime config. The name must have the format: + // + // projects/[PROJECT_ID]/configs/[CONFIG_NAME] + // + // The `[PROJECT_ID]` must be a valid project ID, and `[CONFIG_NAME]` is an + // arbitrary name that matches RFC 1035 segment specification. The length of + // `[CONFIG_NAME]` must be less than 64 bytes. + // + // You pick the RuntimeConfig resource name, but the server will validate that + // the name adheres to this format. After you create the resource, you cannot + // change the resource's name. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // An optional description of the RuntimeConfig object. + Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` +} + +func (m *RuntimeConfig) Reset() { *m = RuntimeConfig{} } +func (m *RuntimeConfig) String() string { return proto.CompactTextString(m) } +func (*RuntimeConfig) ProtoMessage() {} +func (*RuntimeConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *RuntimeConfig) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *RuntimeConfig) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +// Describes a single variable within a RuntimeConfig resource. +// The name denotes the hierarchical variable name. For example, +// `ports/serving_port` is a valid variable name. The variable value is an +// opaque string and only leaf variables can have values (that is, variables +// that do not have any child variables). +type Variable struct { + // The name of the variable resource, in the format: + // + // projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIABLE_NAME] + // + // The `[PROJECT_ID]` must be a valid project ID, `[CONFIG_NAME]` must be a + // valid RuntimeConfig reource and `[VARIABLE_NAME]` follows Unix file system + // file path naming. + // + // The `[VARIABLE_NAME]` can contain ASCII letters, numbers, slashes and + // dashes. Slashes are used as path element separators and are not part of the + // `[VARIABLE_NAME]` itself, so `[VARIABLE_NAME]` must contain at least one + // non-slash character. Multiple slashes are coalesced into single slash + // character. Each path segment should follow RFC 1035 segment specification. + // The length of a `[VARIABLE_NAME]` must be less than 256 bytes. + // + // Once you create a variable, you cannot change the variable name. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The the value of the variable. It can be either a binary or a string + // value. You must specify one of either `value` or `text`. Specifying both + // will cause the server to return an error. + // + // Types that are valid to be assigned to Contents: + // *Variable_Value + // *Variable_Text + Contents isVariable_Contents `protobuf_oneof:"contents"` + // [Output Only] The time of the last variable update. + UpdateTime *google_protobuf2.Timestamp `protobuf:"bytes,3,opt,name=update_time,json=updateTime" json:"update_time,omitempty"` + // [Ouput only] The current state of the variable. The variable state indicates + // the outcome of the `variables().watch` call and is visible through the + // `get` and `list` calls. + State VariableState `protobuf:"varint,4,opt,name=state,enum=google.cloud.runtimeconfig.v1beta1.VariableState" json:"state,omitempty"` +} + +func (m *Variable) Reset() { *m = Variable{} } +func (m *Variable) String() string { return proto.CompactTextString(m) } +func (*Variable) ProtoMessage() {} +func (*Variable) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +type isVariable_Contents interface { + isVariable_Contents() +} + +type Variable_Value struct { + Value []byte `protobuf:"bytes,2,opt,name=value,proto3,oneof"` +} +type Variable_Text struct { + Text string `protobuf:"bytes,5,opt,name=text,oneof"` +} + +func (*Variable_Value) isVariable_Contents() {} +func (*Variable_Text) isVariable_Contents() {} + +func (m *Variable) GetContents() isVariable_Contents { + if m != nil { + return m.Contents + } + return nil +} + +func (m *Variable) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Variable) GetValue() []byte { + if x, ok := m.GetContents().(*Variable_Value); ok { + return x.Value + } + return nil +} + +func (m *Variable) GetText() string { + if x, ok := m.GetContents().(*Variable_Text); ok { + return x.Text + } + return "" +} + +func (m *Variable) GetUpdateTime() *google_protobuf2.Timestamp { + if m != nil { + return m.UpdateTime + } + return nil +} + +func (m *Variable) GetState() VariableState { + if m != nil { + return m.State + } + return VariableState_VARIABLE_STATE_UNSPECIFIED +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Variable) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _Variable_OneofMarshaler, _Variable_OneofUnmarshaler, _Variable_OneofSizer, []interface{}{ + (*Variable_Value)(nil), + (*Variable_Text)(nil), + } +} + +func _Variable_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Variable) + // contents + switch x := m.Contents.(type) { + case *Variable_Value: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeRawBytes(x.Value) + case *Variable_Text: + b.EncodeVarint(5<<3 | proto.WireBytes) + b.EncodeStringBytes(x.Text) + case nil: + default: + return fmt.Errorf("Variable.Contents has unexpected type %T", x) + } + return nil +} + +func _Variable_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Variable) + switch tag { + case 2: // contents.value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.Contents = &Variable_Value{x} + return true, err + case 5: // contents.text + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Contents = &Variable_Text{x} + return true, err + default: + return false, nil + } +} + +func _Variable_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Variable) + // contents + switch x := m.Contents.(type) { + case *Variable_Value: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Value))) + n += len(x.Value) + case *Variable_Text: + n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Text))) + n += len(x.Text) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// The condition that a Waiter resource is waiting for. +type EndCondition struct { + // The condition oneof holds the available condition types for this + // EndCondition. Currently, the only available type is Cardinality. + // + // Types that are valid to be assigned to Condition: + // *EndCondition_Cardinality_ + Condition isEndCondition_Condition `protobuf_oneof:"condition"` +} + +func (m *EndCondition) Reset() { *m = EndCondition{} } +func (m *EndCondition) String() string { return proto.CompactTextString(m) } +func (*EndCondition) ProtoMessage() {} +func (*EndCondition) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +type isEndCondition_Condition interface { + isEndCondition_Condition() +} + +type EndCondition_Cardinality_ struct { + Cardinality *EndCondition_Cardinality `protobuf:"bytes,1,opt,name=cardinality,oneof"` +} + +func (*EndCondition_Cardinality_) isEndCondition_Condition() {} + +func (m *EndCondition) GetCondition() isEndCondition_Condition { + if m != nil { + return m.Condition + } + return nil +} + +func (m *EndCondition) GetCardinality() *EndCondition_Cardinality { + if x, ok := m.GetCondition().(*EndCondition_Cardinality_); ok { + return x.Cardinality + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*EndCondition) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _EndCondition_OneofMarshaler, _EndCondition_OneofUnmarshaler, _EndCondition_OneofSizer, []interface{}{ + (*EndCondition_Cardinality_)(nil), + } +} + +func _EndCondition_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*EndCondition) + // condition + switch x := m.Condition.(type) { + case *EndCondition_Cardinality_: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Cardinality); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("EndCondition.Condition has unexpected type %T", x) + } + return nil +} + +func _EndCondition_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*EndCondition) + switch tag { + case 1: // condition.cardinality + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(EndCondition_Cardinality) + err := b.DecodeMessage(msg) + m.Condition = &EndCondition_Cardinality_{msg} + return true, err + default: + return false, nil + } +} + +func _EndCondition_OneofSizer(msg proto.Message) (n int) { + m := msg.(*EndCondition) + // condition + switch x := m.Condition.(type) { + case *EndCondition_Cardinality_: + s := proto.Size(x.Cardinality) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// A Cardinality condition for the Waiter resource. A cardinality condition is +// met when the number of variables under a specified path prefix reaches a +// predefined number. For example, if you set a Cardinality condition where +// the `path` is set to `/foo` and the number of paths is set to 2, the +// following variables would meet the condition in a RuntimeConfig resource: +// +// + `/foo/variable1 = "value1"` +// + `/foo/variable2 = "value2"` +// + `/bar/variable3 = "value3"` +// +// It would not would not satisify the same condition with the `number` set to +// 3, however, because there is only 2 paths that start with `/foo`. +// Cardinality conditions are recursive; all subtrees under the specific +// path prefix are counted. +type EndCondition_Cardinality struct { + // The root of the variable subtree to monitor. For example, `/foo`. + Path string `protobuf:"bytes,1,opt,name=path" json:"path,omitempty"` + // The number variables under the `path` that must exist to meet this + // condition. Defaults to 1 if not specified. + Number int32 `protobuf:"varint,2,opt,name=number" json:"number,omitempty"` +} + +func (m *EndCondition_Cardinality) Reset() { *m = EndCondition_Cardinality{} } +func (m *EndCondition_Cardinality) String() string { return proto.CompactTextString(m) } +func (*EndCondition_Cardinality) ProtoMessage() {} +func (*EndCondition_Cardinality) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2, 0} } + +func (m *EndCondition_Cardinality) GetPath() string { + if m != nil { + return m.Path + } + return "" +} + +func (m *EndCondition_Cardinality) GetNumber() int32 { + if m != nil { + return m.Number + } + return 0 +} + +// A Waiter resource waits for some end condition within a RuntimeConfig resource +// to be met before it returns. For example, assume you have a distributed +// system where each node writes to a Variable resource indidicating the node's +// readiness as part of the startup process. +// +// You then configure a Waiter resource with the success condition set to wait +// until some number of nodes have checked in. Afterwards, your application +// runs some arbitrary code after the condition has been met and the waiter +// returns successfully. +// +// Once created, a Waiter resource is immutable. +// +// To learn more about using waiters, read the +// [Creating a Waiter](/deployment-manager/runtime-configurator/creating-a-waiter) +// documentation. +type Waiter struct { + // The name of the Waiter resource, in the format: + // + // projects/[PROJECT_ID]/configs/[CONFIG_NAME]/waiters/[WAITER_NAME] + // + // The `[PROJECT_ID]` must be a valid Google Cloud project ID, + // the `[CONFIG_NAME]` must be a valid RuntimeConfig resource, the + // `[WAITER_NAME]` must match RFC 1035 segment specification, and the length + // of `[WAITER_NAME]` must be less than 64 bytes. + // + // After you create a Waiter resource, you cannot change the resource name. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // [Required] Specifies the timeout of the waiter in seconds, beginning from + // the instant that `waiters().create` method is called. If this time elapses + // before the success or failure conditions are met, the waiter fails and sets + // the `error` code to `DEADLINE_EXCEEDED`. + Timeout *google_protobuf1.Duration `protobuf:"bytes,2,opt,name=timeout" json:"timeout,omitempty"` + // [Optional] The failure condition of this waiter. If this condition is met, + // `done` will be set to `true` and the `error` code will be set to `ABORTED`. + // The failure condition takes precedence over the success condition. If both + // conditions are met, a failure will be indicated. This value is optional; if + // no failure condition is set, the only failure scenario will be a timeout. + Failure *EndCondition `protobuf:"bytes,3,opt,name=failure" json:"failure,omitempty"` + // [Required] The success condition. If this condition is met, `done` will be + // set to `true` and the `error` value will remain unset. The failure condition + // takes precedence over the success condition. If both conditions are met, a + // failure will be indicated. + Success *EndCondition `protobuf:"bytes,4,opt,name=success" json:"success,omitempty"` + // [Output Only] The instant at which this Waiter resource was created. Adding + // the value of `timeout` to this instant yields the timeout deadline for the + // waiter. + CreateTime *google_protobuf2.Timestamp `protobuf:"bytes,5,opt,name=create_time,json=createTime" json:"create_time,omitempty"` + // [Output Only] If the value is `false`, it means the waiter is still waiting + // for one of its conditions to be met. + // + // If true, the waiter has finished. If the waiter finished due to a timeout + // or failure, `error` will be set. + Done bool `protobuf:"varint,6,opt,name=done" json:"done,omitempty"` + // [Output Only] If the waiter ended due to a failure or timeout, this value + // will be set. + Error *google_rpc.Status `protobuf:"bytes,7,opt,name=error" json:"error,omitempty"` +} + +func (m *Waiter) Reset() { *m = Waiter{} } +func (m *Waiter) String() string { return proto.CompactTextString(m) } +func (*Waiter) ProtoMessage() {} +func (*Waiter) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *Waiter) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Waiter) GetTimeout() *google_protobuf1.Duration { + if m != nil { + return m.Timeout + } + return nil +} + +func (m *Waiter) GetFailure() *EndCondition { + if m != nil { + return m.Failure + } + return nil +} + +func (m *Waiter) GetSuccess() *EndCondition { + if m != nil { + return m.Success + } + return nil +} + +func (m *Waiter) GetCreateTime() *google_protobuf2.Timestamp { + if m != nil { + return m.CreateTime + } + return nil +} + +func (m *Waiter) GetDone() bool { + if m != nil { + return m.Done + } + return false +} + +func (m *Waiter) GetError() *google_rpc.Status { + if m != nil { + return m.Error + } + return nil +} + +func init() { + proto.RegisterType((*RuntimeConfig)(nil), "google.cloud.runtimeconfig.v1beta1.RuntimeConfig") + proto.RegisterType((*Variable)(nil), "google.cloud.runtimeconfig.v1beta1.Variable") + proto.RegisterType((*EndCondition)(nil), "google.cloud.runtimeconfig.v1beta1.EndCondition") + proto.RegisterType((*EndCondition_Cardinality)(nil), "google.cloud.runtimeconfig.v1beta1.EndCondition.Cardinality") + proto.RegisterType((*Waiter)(nil), "google.cloud.runtimeconfig.v1beta1.Waiter") + proto.RegisterEnum("google.cloud.runtimeconfig.v1beta1.VariableState", VariableState_name, VariableState_value) +} + +func init() { proto.RegisterFile("google/cloud/runtimeconfig/v1beta1/resources.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 628 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0xdd, 0x6e, 0xd3, 0x30, + 0x14, 0xc7, 0x9b, 0xd2, 0x8f, 0xed, 0x64, 0x43, 0x93, 0x85, 0x46, 0xa8, 0xd0, 0xa8, 0x7a, 0x81, + 0x2a, 0x2e, 0x12, 0xda, 0x5d, 0xa1, 0x71, 0xd3, 0x8f, 0xb0, 0x15, 0x4d, 0x30, 0xa5, 0x5d, 0x91, + 0xd0, 0xa4, 0xe1, 0x3a, 0x6e, 0x88, 0x94, 0xda, 0x91, 0xe3, 0x4c, 0xf0, 0x4a, 0x3c, 0x01, 0x2f, + 0xc0, 0x0d, 0x0f, 0xc1, 0x15, 0x0f, 0x82, 0xec, 0x38, 0xd0, 0xc2, 0xc4, 0x06, 0x77, 0x3e, 0x3e, + 0xff, 0xf3, 0x3b, 0x1f, 0x3e, 0x09, 0xf4, 0x23, 0xce, 0xa3, 0x84, 0x7a, 0x24, 0xe1, 0x79, 0xe8, + 0x89, 0x9c, 0xc9, 0x78, 0x45, 0x09, 0x67, 0xcb, 0x38, 0xf2, 0xae, 0x7a, 0x0b, 0x2a, 0x71, 0xcf, + 0x13, 0x34, 0xe3, 0xb9, 0x20, 0x34, 0x73, 0x53, 0xc1, 0x25, 0x47, 0x9d, 0x22, 0xc6, 0xd5, 0x31, + 0xee, 0x46, 0x8c, 0x6b, 0x62, 0x5a, 0x0f, 0x0d, 0x17, 0xa7, 0xb1, 0x87, 0x19, 0xe3, 0x12, 0xcb, + 0x98, 0x33, 0x43, 0x68, 0x1d, 0x18, 0xaf, 0xb6, 0x16, 0xf9, 0xd2, 0x0b, 0x73, 0xa1, 0x05, 0xc6, + 0xff, 0xe8, 0x77, 0xbf, 0xca, 0x90, 0x49, 0xbc, 0x4a, 0x8d, 0xe0, 0xbe, 0x11, 0x88, 0x94, 0x78, + 0x99, 0xc4, 0x32, 0x37, 0xe4, 0x8e, 0x0f, 0xbb, 0x41, 0x51, 0xd0, 0x48, 0x17, 0x84, 0x10, 0xd4, + 0x18, 0x5e, 0x51, 0xc7, 0x6a, 0x5b, 0xdd, 0xed, 0x40, 0x9f, 0x51, 0x1b, 0xec, 0x90, 0x66, 0x44, + 0xc4, 0xa9, 0xca, 0xe9, 0x54, 0xb5, 0x6b, 0xfd, 0xaa, 0xf3, 0xcd, 0x82, 0xad, 0x39, 0x16, 0x31, + 0x5e, 0x24, 0xf4, 0x5a, 0xc4, 0x3e, 0xd4, 0xaf, 0x70, 0x92, 0x53, 0x1d, 0xbc, 0x73, 0x52, 0x09, + 0x0a, 0x13, 0xdd, 0x83, 0x9a, 0xa4, 0x1f, 0xa4, 0x53, 0x57, 0xda, 0x93, 0x4a, 0xa0, 0x2d, 0x74, + 0x04, 0x76, 0x9e, 0x86, 0x58, 0xd2, 0x4b, 0x55, 0x99, 0x73, 0xa7, 0x6d, 0x75, 0xed, 0x7e, 0xcb, + 0x35, 0x73, 0x2c, 0xbb, 0x74, 0x67, 0x65, 0x97, 0x01, 0x14, 0x72, 0x75, 0x81, 0x8e, 0xa1, 0xae, + 0x5a, 0xa4, 0x4e, 0xad, 0x6d, 0x75, 0xef, 0xf6, 0x7b, 0xee, 0xcd, 0xe3, 0x77, 0xcb, 0xda, 0xa7, + 0x2a, 0x30, 0x28, 0xe2, 0x87, 0x00, 0x5b, 0x84, 0x33, 0x49, 0x99, 0xcc, 0x3a, 0x9f, 0x2d, 0xd8, + 0xf1, 0x59, 0x38, 0xe2, 0x2c, 0x8c, 0x55, 0xc7, 0xe8, 0x1d, 0xd8, 0x04, 0x8b, 0x30, 0x66, 0x38, + 0x89, 0xe5, 0x47, 0xdd, 0xab, 0xdd, 0x7f, 0x7e, 0x9b, 0x5c, 0xeb, 0x18, 0x77, 0xf4, 0x8b, 0x71, + 0x52, 0x09, 0xd6, 0x91, 0xad, 0x67, 0x60, 0xaf, 0x79, 0xd5, 0x54, 0x53, 0x2c, 0xdf, 0x97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f, 0xdd, 0x62, 0x0c, 0x67, 0xd6, 0xdb, 0xd7, 0x46, 0x15, 0xf1, + 0x04, 0xb3, 0xc8, 0xe5, 0x22, 0xf2, 0x22, 0xca, 0x74, 0xab, 0x5e, 0xe1, 0xc2, 0x69, 0x9c, 0xfd, + 0xed, 0x87, 0x75, 0xb4, 0x71, 0xfb, 0xa9, 0xda, 0x39, 0x2e, 0x88, 0x23, 0x9d, 0x77, 0xe3, 0xf7, + 0xe0, 0xce, 0x7b, 0x43, 0x15, 0xf2, 0xb5, 0x14, 0x5d, 0x68, 0xd1, 0xc5, 0x86, 0xe8, 0x62, 0x5e, + 0x70, 0x17, 0x0d, 0x5d, 0xc5, 0xe1, 0x8f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x1a, 0xc9, 0x60, 0x90, + 0x35, 0x05, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/runtimeconfig/v1beta1/runtimeconfig.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/runtimeconfig/v1beta1/runtimeconfig.pb.go new file mode 100644 index 0000000000..2fb9f13791 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/runtimeconfig/v1beta1/runtimeconfig.pb.go @@ -0,0 +1,1355 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/runtimeconfig/v1beta1/runtimeconfig.proto + +package runtimeconfig + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_longrunning "google.golang.org/genproto/googleapis/longrunning" +import google_protobuf4 "github.com/golang/protobuf/ptypes/empty" +import google_protobuf2 "github.com/golang/protobuf/ptypes/timestamp" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Request for the `ListConfigs()` method. +type ListConfigsRequest struct { + // The [project ID](https://support.google.com/cloud/answer/6158840?hl=en&ref_topic=6158848) + // for this request, in the format `projects/[PROJECT_ID]`. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // Specifies the number of results to return per page. If there are fewer + // elements than the specified number, returns all elements. + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // Specifies a page token to use. Set `pageToken` to a `nextPageToken` + // returned by a previous list request to get the next page of results. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListConfigsRequest) Reset() { *m = ListConfigsRequest{} } +func (m *ListConfigsRequest) String() string { return proto.CompactTextString(m) } +func (*ListConfigsRequest) ProtoMessage() {} +func (*ListConfigsRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +func (m *ListConfigsRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *ListConfigsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListConfigsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// `ListConfigs()` returns the following response. The order of returned +// objects is arbitrary; that is, it is not ordered in any particular way. +type ListConfigsResponse struct { + // A list of the configurations in the project. The order of returned + // objects is arbitrary; that is, it is not ordered in any particular way. + Configs []*RuntimeConfig `protobuf:"bytes,1,rep,name=configs" json:"configs,omitempty"` + // This token allows you to get the next page of results for list requests. + // If the number of results is larger than `pageSize`, use the `nextPageToken` + // as a value for the query parameter `pageToken` in the next list request. + // Subsequent list requests will have their own `nextPageToken` to continue + // paging through the results + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListConfigsResponse) Reset() { *m = ListConfigsResponse{} } +func (m *ListConfigsResponse) String() string { return proto.CompactTextString(m) } +func (*ListConfigsResponse) ProtoMessage() {} +func (*ListConfigsResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} } + +func (m *ListConfigsResponse) GetConfigs() []*RuntimeConfig { + if m != nil { + return m.Configs + } + return nil +} + +func (m *ListConfigsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// Gets a RuntimeConfig resource. +type GetConfigRequest struct { + // The name of the RuntimeConfig resource to retrieve, in the format: + // + // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` + Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` +} + +func (m *GetConfigRequest) Reset() { *m = GetConfigRequest{} } +func (m *GetConfigRequest) String() string { return proto.CompactTextString(m) } +func (*GetConfigRequest) ProtoMessage() {} +func (*GetConfigRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} } + +func (m *GetConfigRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Creates a RuntimeConfig resource. +type CreateConfigRequest struct { + // The [project ID](https://support.google.com/cloud/answer/6158840?hl=en&ref_topic=6158848) + // for this request, in the format `projects/[PROJECT_ID]`. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // The RuntimeConfig to create. + Config *RuntimeConfig `protobuf:"bytes,2,opt,name=config" json:"config,omitempty"` + // An optional but recommended unique `request_id`. If the server + // receives two `create()` requests with the same + // `request_id`, then the second request will be ignored and the + // first resource created and stored in the backend is returned. + // Empty `request_id` fields are ignored. + // + // It is responsibility of the client to ensure uniqueness of the + // `request_id` strings. + // + // `request_id` strings are limited to 64 characters. + RequestId string `protobuf:"bytes,3,opt,name=request_id,json=requestId" json:"request_id,omitempty"` +} + +func (m *CreateConfigRequest) Reset() { *m = CreateConfigRequest{} } +func (m *CreateConfigRequest) String() string { return proto.CompactTextString(m) } +func (*CreateConfigRequest) ProtoMessage() {} +func (*CreateConfigRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{3} } + +func (m *CreateConfigRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *CreateConfigRequest) GetConfig() *RuntimeConfig { + if m != nil { + return m.Config + } + return nil +} + +func (m *CreateConfigRequest) GetRequestId() string { + if m != nil { + return m.RequestId + } + return "" +} + +// Request message for `UpdateConfig()` method. +type UpdateConfigRequest struct { + // The name of the RuntimeConfig resource to update, in the format: + // + // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The config resource to update. + Config *RuntimeConfig `protobuf:"bytes,2,opt,name=config" json:"config,omitempty"` +} + +func (m *UpdateConfigRequest) Reset() { *m = UpdateConfigRequest{} } +func (m *UpdateConfigRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateConfigRequest) ProtoMessage() {} +func (*UpdateConfigRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{4} } + +func (m *UpdateConfigRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *UpdateConfigRequest) GetConfig() *RuntimeConfig { + if m != nil { + return m.Config + } + return nil +} + +// Request for the `DeleteConfig()` method. +type DeleteConfigRequest struct { + // The RuntimeConfig resource to delete, in the format: + // + // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *DeleteConfigRequest) Reset() { *m = DeleteConfigRequest{} } +func (m *DeleteConfigRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteConfigRequest) ProtoMessage() {} +func (*DeleteConfigRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{5} } + +func (m *DeleteConfigRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Request for the `ListVariables()` method. +type ListVariablesRequest struct { + // The path to the RuntimeConfig resource for which you want to list variables. + // The configuration must exist beforehand; the path must by in the format: + // + // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // Filters variables by matching the specified filter. For example: + // + // `projects/example-project/config/[CONFIG_NAME]/variables/example-variable`. + Filter string `protobuf:"bytes,2,opt,name=filter" json:"filter,omitempty"` + // Specifies the number of results to return per page. If there are fewer + // elements than the specified number, returns all elements. + PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // Specifies a page token to use. Set `pageToken` to a `nextPageToken` + // returned by a previous list request to get the next page of results. + PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` + // The flag indicates whether the user wants to return values of variables. + // If true, then only those variables that user has IAM GetVariable permission + // will be returned along with their values. + ReturnValues bool `protobuf:"varint,5,opt,name=return_values,json=returnValues" json:"return_values,omitempty"` +} + +func (m *ListVariablesRequest) Reset() { *m = ListVariablesRequest{} } +func (m *ListVariablesRequest) String() string { return proto.CompactTextString(m) } +func (*ListVariablesRequest) ProtoMessage() {} +func (*ListVariablesRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{6} } + +func (m *ListVariablesRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *ListVariablesRequest) GetFilter() string { + if m != nil { + return m.Filter + } + return "" +} + +func (m *ListVariablesRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListVariablesRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +func (m *ListVariablesRequest) GetReturnValues() bool { + if m != nil { + return m.ReturnValues + } + return false +} + +// Response for the `ListVariables()` method. +type ListVariablesResponse struct { + // A list of variables and their values. The order of returned variable + // objects is arbitrary. + Variables []*Variable `protobuf:"bytes,1,rep,name=variables" json:"variables,omitempty"` + // This token allows you to get the next page of results for list requests. + // If the number of results is larger than `pageSize`, use the `nextPageToken` + // as a value for the query parameter `pageToken` in the next list request. + // Subsequent list requests will have their own `nextPageToken` to continue + // paging through the results + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListVariablesResponse) Reset() { *m = ListVariablesResponse{} } +func (m *ListVariablesResponse) String() string { return proto.CompactTextString(m) } +func (*ListVariablesResponse) ProtoMessage() {} +func (*ListVariablesResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{7} } + +func (m *ListVariablesResponse) GetVariables() []*Variable { + if m != nil { + return m.Variables + } + return nil +} + +func (m *ListVariablesResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// Request for the `WatchVariable()` method. +type WatchVariableRequest struct { + // The name of the variable to watch, in the format: + // + // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // If specified, checks the current timestamp of the variable and if the + // current timestamp is newer than `newerThan` timestamp, the method returns + // immediately. + // + // If not specified or the variable has an older timestamp, the watcher waits + // for a the value to change before returning. + NewerThan *google_protobuf2.Timestamp `protobuf:"bytes,4,opt,name=newer_than,json=newerThan" json:"newer_than,omitempty"` +} + +func (m *WatchVariableRequest) Reset() { *m = WatchVariableRequest{} } +func (m *WatchVariableRequest) String() string { return proto.CompactTextString(m) } +func (*WatchVariableRequest) ProtoMessage() {} +func (*WatchVariableRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{8} } + +func (m *WatchVariableRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *WatchVariableRequest) GetNewerThan() *google_protobuf2.Timestamp { + if m != nil { + return m.NewerThan + } + return nil +} + +// Request for the `GetVariable()` method. +type GetVariableRequest struct { + // The name of the variable to return, in the format: + // + // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIBLE_NAME]` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetVariableRequest) Reset() { *m = GetVariableRequest{} } +func (m *GetVariableRequest) String() string { return proto.CompactTextString(m) } +func (*GetVariableRequest) ProtoMessage() {} +func (*GetVariableRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{9} } + +func (m *GetVariableRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Request for the `CreateVariable()` method. +type CreateVariableRequest struct { + // The path to the RutimeConfig resource that this variable should belong to. + // The configuration must exist beforehand; the path must by in the format: + // + // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // The variable to create. + Variable *Variable `protobuf:"bytes,2,opt,name=variable" json:"variable,omitempty"` + // An optional but recommended unique `request_id`. If the server + // receives two `create()` requests with the same + // `request_id`, then the second request will be ignored and the + // first resource created and stored in the backend is returned. + // Empty `request_id` fields are ignored. + // + // It is responsibility of the client to ensure uniqueness of the + // `request_id` strings. + // + // `request_id` strings are limited to 64 characters. + RequestId string `protobuf:"bytes,3,opt,name=request_id,json=requestId" json:"request_id,omitempty"` +} + +func (m *CreateVariableRequest) Reset() { *m = CreateVariableRequest{} } +func (m *CreateVariableRequest) String() string { return proto.CompactTextString(m) } +func (*CreateVariableRequest) ProtoMessage() {} +func (*CreateVariableRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{10} } + +func (m *CreateVariableRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *CreateVariableRequest) GetVariable() *Variable { + if m != nil { + return m.Variable + } + return nil +} + +func (m *CreateVariableRequest) GetRequestId() string { + if m != nil { + return m.RequestId + } + return "" +} + +// Request for the `UpdateVariable()` method. +type UpdateVariableRequest struct { + // The name of the variable to update, in the format: + // + // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIABLE_NAME]` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The variable to update. + Variable *Variable `protobuf:"bytes,2,opt,name=variable" json:"variable,omitempty"` +} + +func (m *UpdateVariableRequest) Reset() { *m = UpdateVariableRequest{} } +func (m *UpdateVariableRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateVariableRequest) ProtoMessage() {} +func (*UpdateVariableRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{11} } + +func (m *UpdateVariableRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *UpdateVariableRequest) GetVariable() *Variable { + if m != nil { + return m.Variable + } + return nil +} + +// Request for the `DeleteVariable()` method. +type DeleteVariableRequest struct { + // The name of the variable to delete, in the format: + // + // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIABLE_NAME]` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Set to `true` to recursively delete multiple variables with the same + // prefix. + Recursive bool `protobuf:"varint,2,opt,name=recursive" json:"recursive,omitempty"` +} + +func (m *DeleteVariableRequest) Reset() { *m = DeleteVariableRequest{} } +func (m *DeleteVariableRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteVariableRequest) ProtoMessage() {} +func (*DeleteVariableRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{12} } + +func (m *DeleteVariableRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *DeleteVariableRequest) GetRecursive() bool { + if m != nil { + return m.Recursive + } + return false +} + +// Request for the `ListWaiters()` method. +type ListWaitersRequest struct { + // The path to the configuration for which you want to get a list of waiters. + // The configuration must exist beforehand; the path must by in the format: + // + // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // Specifies the number of results to return per page. If there are fewer + // elements than the specified number, returns all elements. + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // Specifies a page token to use. Set `pageToken` to a `nextPageToken` + // returned by a previous list request to get the next page of results. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListWaitersRequest) Reset() { *m = ListWaitersRequest{} } +func (m *ListWaitersRequest) String() string { return proto.CompactTextString(m) } +func (*ListWaitersRequest) ProtoMessage() {} +func (*ListWaitersRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{13} } + +func (m *ListWaitersRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *ListWaitersRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListWaitersRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// Response for the `ListWaiters()` method. +// Order of returned waiter objects is arbitrary. +type ListWaitersResponse struct { + // Found waiters in the project. + Waiters []*Waiter `protobuf:"bytes,1,rep,name=waiters" json:"waiters,omitempty"` + // This token allows you to get the next page of results for list requests. + // If the number of results is larger than `pageSize`, use the `nextPageToken` + // as a value for the query parameter `pageToken` in the next list request. + // Subsequent list requests will have their own `nextPageToken` to continue + // paging through the results + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListWaitersResponse) Reset() { *m = ListWaitersResponse{} } +func (m *ListWaitersResponse) String() string { return proto.CompactTextString(m) } +func (*ListWaitersResponse) ProtoMessage() {} +func (*ListWaitersResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{14} } + +func (m *ListWaitersResponse) GetWaiters() []*Waiter { + if m != nil { + return m.Waiters + } + return nil +} + +func (m *ListWaitersResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// Request for the `GetWaiter()` method. +type GetWaiterRequest struct { + // The fully-qualified name of the Waiter resource object to retrieve, in the + // format: + // + // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]/waiters/[WAITER_NAME]` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetWaiterRequest) Reset() { *m = GetWaiterRequest{} } +func (m *GetWaiterRequest) String() string { return proto.CompactTextString(m) } +func (*GetWaiterRequest) ProtoMessage() {} +func (*GetWaiterRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{15} } + +func (m *GetWaiterRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Request message for `CreateWaiter()` method. +type CreateWaiterRequest struct { + // The path to the configuration that will own the waiter. + // The configuration must exist beforehand; the path must by in the format: + // + // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]`. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // The Waiter resource to create. + Waiter *Waiter `protobuf:"bytes,2,opt,name=waiter" json:"waiter,omitempty"` + // An optional but recommended unique `request_id`. If the server + // receives two `create()` requests with the same + // `request_id`, then the second request will be ignored and the + // first resource created and stored in the backend is returned. + // Empty `request_id` fields are ignored. + // + // It is responsibility of the client to ensure uniqueness of the + // `request_id` strings. + // + // `request_id` strings are limited to 64 characters. + RequestId string `protobuf:"bytes,3,opt,name=request_id,json=requestId" json:"request_id,omitempty"` +} + +func (m *CreateWaiterRequest) Reset() { *m = CreateWaiterRequest{} } +func (m *CreateWaiterRequest) String() string { return proto.CompactTextString(m) } +func (*CreateWaiterRequest) ProtoMessage() {} +func (*CreateWaiterRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{16} } + +func (m *CreateWaiterRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *CreateWaiterRequest) GetWaiter() *Waiter { + if m != nil { + return m.Waiter + } + return nil +} + +func (m *CreateWaiterRequest) GetRequestId() string { + if m != nil { + return m.RequestId + } + return "" +} + +// Request for the `DeleteWaiter()` method. +type DeleteWaiterRequest struct { + // The Waiter resource to delete, in the format: + // + // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]/waiters/[WAITER_NAME]` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *DeleteWaiterRequest) Reset() { *m = DeleteWaiterRequest{} } +func (m *DeleteWaiterRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteWaiterRequest) ProtoMessage() {} +func (*DeleteWaiterRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{17} } + +func (m *DeleteWaiterRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func init() { + proto.RegisterType((*ListConfigsRequest)(nil), "google.cloud.runtimeconfig.v1beta1.ListConfigsRequest") + proto.RegisterType((*ListConfigsResponse)(nil), "google.cloud.runtimeconfig.v1beta1.ListConfigsResponse") + proto.RegisterType((*GetConfigRequest)(nil), "google.cloud.runtimeconfig.v1beta1.GetConfigRequest") + proto.RegisterType((*CreateConfigRequest)(nil), "google.cloud.runtimeconfig.v1beta1.CreateConfigRequest") + proto.RegisterType((*UpdateConfigRequest)(nil), "google.cloud.runtimeconfig.v1beta1.UpdateConfigRequest") + proto.RegisterType((*DeleteConfigRequest)(nil), "google.cloud.runtimeconfig.v1beta1.DeleteConfigRequest") + proto.RegisterType((*ListVariablesRequest)(nil), "google.cloud.runtimeconfig.v1beta1.ListVariablesRequest") + proto.RegisterType((*ListVariablesResponse)(nil), "google.cloud.runtimeconfig.v1beta1.ListVariablesResponse") + proto.RegisterType((*WatchVariableRequest)(nil), "google.cloud.runtimeconfig.v1beta1.WatchVariableRequest") + proto.RegisterType((*GetVariableRequest)(nil), "google.cloud.runtimeconfig.v1beta1.GetVariableRequest") + proto.RegisterType((*CreateVariableRequest)(nil), "google.cloud.runtimeconfig.v1beta1.CreateVariableRequest") + proto.RegisterType((*UpdateVariableRequest)(nil), "google.cloud.runtimeconfig.v1beta1.UpdateVariableRequest") + proto.RegisterType((*DeleteVariableRequest)(nil), "google.cloud.runtimeconfig.v1beta1.DeleteVariableRequest") + proto.RegisterType((*ListWaitersRequest)(nil), "google.cloud.runtimeconfig.v1beta1.ListWaitersRequest") + proto.RegisterType((*ListWaitersResponse)(nil), "google.cloud.runtimeconfig.v1beta1.ListWaitersResponse") + proto.RegisterType((*GetWaiterRequest)(nil), "google.cloud.runtimeconfig.v1beta1.GetWaiterRequest") + proto.RegisterType((*CreateWaiterRequest)(nil), "google.cloud.runtimeconfig.v1beta1.CreateWaiterRequest") + proto.RegisterType((*DeleteWaiterRequest)(nil), "google.cloud.runtimeconfig.v1beta1.DeleteWaiterRequest") +} + +// 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 + +// Client API for RuntimeConfigManager service + +type RuntimeConfigManagerClient interface { + // Lists all the RuntimeConfig resources within project. + ListConfigs(ctx context.Context, in *ListConfigsRequest, opts ...grpc.CallOption) (*ListConfigsResponse, error) + // Gets information about a RuntimeConfig resource. + GetConfig(ctx context.Context, in *GetConfigRequest, opts ...grpc.CallOption) (*RuntimeConfig, error) + // Creates a new RuntimeConfig resource. The configuration name must be + // unique within project. + CreateConfig(ctx context.Context, in *CreateConfigRequest, opts ...grpc.CallOption) (*RuntimeConfig, error) + // Updates a RuntimeConfig resource. The configuration must exist beforehand. + UpdateConfig(ctx context.Context, in *UpdateConfigRequest, opts ...grpc.CallOption) (*RuntimeConfig, error) + // Deletes a RuntimeConfig resource. + DeleteConfig(ctx context.Context, in *DeleteConfigRequest, opts ...grpc.CallOption) (*google_protobuf4.Empty, error) + // Lists variables within given a configuration, matching any provided filters. + // This only lists variable names, not the values, unless `return_values` is + // true, in which case only variables that user has IAM permission to + // GetVariable will be returned. + ListVariables(ctx context.Context, in *ListVariablesRequest, opts ...grpc.CallOption) (*ListVariablesResponse, error) + // Gets information about a single variable. + GetVariable(ctx context.Context, in *GetVariableRequest, opts ...grpc.CallOption) (*Variable, error) + // Watches a specific variable and waits for a change in the variable's value. + // When there is a change, this method returns the new value or times out. + // + // If a variable is deleted while being watched, the `variableState` state is + // set to `DELETED` and the method returns the last known variable `value`. + // + // If you set the deadline for watching to a larger value than internal timeout + // (60 seconds), the current variable value is returned and the `variableState` + // will be `VARIABLE_STATE_UNSPECIFIED`. + // + // To learn more about creating a watcher, read the + // [Watching a Variable for Changes](/deployment-manager/runtime-configurator/watching-a-variable) + // documentation. + WatchVariable(ctx context.Context, in *WatchVariableRequest, opts ...grpc.CallOption) (*Variable, error) + // Creates a variable within the given configuration. You cannot create + // a variable with a name that is a prefix of an existing variable name, or a + // name that has an existing variable name as a prefix. + // + // To learn more about creating a variable, read the + // [Setting and Getting Data](/deployment-manager/runtime-configurator/set-and-get-variables) + // documentation. + CreateVariable(ctx context.Context, in *CreateVariableRequest, opts ...grpc.CallOption) (*Variable, error) + // Updates an existing variable with a new value. + UpdateVariable(ctx context.Context, in *UpdateVariableRequest, opts ...grpc.CallOption) (*Variable, error) + // Deletes a variable or multiple variables. + // + // If you specify a variable name, then that variable is deleted. If you + // specify a prefix and `recursive` is true, then all variables with that + // prefix are deleted. You must set a `recursive` to true if you delete + // variables by prefix. + DeleteVariable(ctx context.Context, in *DeleteVariableRequest, opts ...grpc.CallOption) (*google_protobuf4.Empty, error) + // List waiters within the given configuration. + ListWaiters(ctx context.Context, in *ListWaitersRequest, opts ...grpc.CallOption) (*ListWaitersResponse, error) + // Gets information about a single waiter. + GetWaiter(ctx context.Context, in *GetWaiterRequest, opts ...grpc.CallOption) (*Waiter, error) + // Creates a Waiter resource. This operation returns a long-running Operation + // resource which can be polled for completion. However, a waiter with the + // given name will exist (and can be retrieved) prior to the operation + // completing. If the operation fails, the failed Waiter resource will + // still exist and must be deleted prior to subsequent creation attempts. + CreateWaiter(ctx context.Context, in *CreateWaiterRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Deletes the waiter with the specified name. + DeleteWaiter(ctx context.Context, in *DeleteWaiterRequest, opts ...grpc.CallOption) (*google_protobuf4.Empty, error) +} + +type runtimeConfigManagerClient struct { + cc *grpc.ClientConn +} + +func NewRuntimeConfigManagerClient(cc *grpc.ClientConn) RuntimeConfigManagerClient { + return &runtimeConfigManagerClient{cc} +} + +func (c *runtimeConfigManagerClient) ListConfigs(ctx context.Context, in *ListConfigsRequest, opts ...grpc.CallOption) (*ListConfigsResponse, error) { + out := new(ListConfigsResponse) + err := grpc.Invoke(ctx, "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/ListConfigs", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *runtimeConfigManagerClient) GetConfig(ctx context.Context, in *GetConfigRequest, opts ...grpc.CallOption) (*RuntimeConfig, error) { + out := new(RuntimeConfig) + err := grpc.Invoke(ctx, "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/GetConfig", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *runtimeConfigManagerClient) CreateConfig(ctx context.Context, in *CreateConfigRequest, opts ...grpc.CallOption) (*RuntimeConfig, error) { + out := new(RuntimeConfig) + err := grpc.Invoke(ctx, "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/CreateConfig", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *runtimeConfigManagerClient) UpdateConfig(ctx context.Context, in *UpdateConfigRequest, opts ...grpc.CallOption) (*RuntimeConfig, error) { + out := new(RuntimeConfig) + err := grpc.Invoke(ctx, "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/UpdateConfig", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *runtimeConfigManagerClient) DeleteConfig(ctx context.Context, in *DeleteConfigRequest, opts ...grpc.CallOption) (*google_protobuf4.Empty, error) { + out := new(google_protobuf4.Empty) + err := grpc.Invoke(ctx, "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/DeleteConfig", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *runtimeConfigManagerClient) ListVariables(ctx context.Context, in *ListVariablesRequest, opts ...grpc.CallOption) (*ListVariablesResponse, error) { + out := new(ListVariablesResponse) + err := grpc.Invoke(ctx, "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/ListVariables", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *runtimeConfigManagerClient) GetVariable(ctx context.Context, in *GetVariableRequest, opts ...grpc.CallOption) (*Variable, error) { + out := new(Variable) + err := grpc.Invoke(ctx, "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/GetVariable", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *runtimeConfigManagerClient) WatchVariable(ctx context.Context, in *WatchVariableRequest, opts ...grpc.CallOption) (*Variable, error) { + out := new(Variable) + err := grpc.Invoke(ctx, "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/WatchVariable", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *runtimeConfigManagerClient) CreateVariable(ctx context.Context, in *CreateVariableRequest, opts ...grpc.CallOption) (*Variable, error) { + out := new(Variable) + err := grpc.Invoke(ctx, "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/CreateVariable", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *runtimeConfigManagerClient) UpdateVariable(ctx context.Context, in *UpdateVariableRequest, opts ...grpc.CallOption) (*Variable, error) { + out := new(Variable) + err := grpc.Invoke(ctx, "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/UpdateVariable", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *runtimeConfigManagerClient) DeleteVariable(ctx context.Context, in *DeleteVariableRequest, opts ...grpc.CallOption) (*google_protobuf4.Empty, error) { + out := new(google_protobuf4.Empty) + err := grpc.Invoke(ctx, "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/DeleteVariable", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *runtimeConfigManagerClient) ListWaiters(ctx context.Context, in *ListWaitersRequest, opts ...grpc.CallOption) (*ListWaitersResponse, error) { + out := new(ListWaitersResponse) + err := grpc.Invoke(ctx, "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/ListWaiters", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *runtimeConfigManagerClient) GetWaiter(ctx context.Context, in *GetWaiterRequest, opts ...grpc.CallOption) (*Waiter, error) { + out := new(Waiter) + err := grpc.Invoke(ctx, "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/GetWaiter", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *runtimeConfigManagerClient) CreateWaiter(ctx context.Context, in *CreateWaiterRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/CreateWaiter", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *runtimeConfigManagerClient) DeleteWaiter(ctx context.Context, in *DeleteWaiterRequest, opts ...grpc.CallOption) (*google_protobuf4.Empty, error) { + out := new(google_protobuf4.Empty) + err := grpc.Invoke(ctx, "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/DeleteWaiter", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for RuntimeConfigManager service + +type RuntimeConfigManagerServer interface { + // Lists all the RuntimeConfig resources within project. + ListConfigs(context.Context, *ListConfigsRequest) (*ListConfigsResponse, error) + // Gets information about a RuntimeConfig resource. + GetConfig(context.Context, *GetConfigRequest) (*RuntimeConfig, error) + // Creates a new RuntimeConfig resource. The configuration name must be + // unique within project. + CreateConfig(context.Context, *CreateConfigRequest) (*RuntimeConfig, error) + // Updates a RuntimeConfig resource. The configuration must exist beforehand. + UpdateConfig(context.Context, *UpdateConfigRequest) (*RuntimeConfig, error) + // Deletes a RuntimeConfig resource. + DeleteConfig(context.Context, *DeleteConfigRequest) (*google_protobuf4.Empty, error) + // Lists variables within given a configuration, matching any provided filters. + // This only lists variable names, not the values, unless `return_values` is + // true, in which case only variables that user has IAM permission to + // GetVariable will be returned. + ListVariables(context.Context, *ListVariablesRequest) (*ListVariablesResponse, error) + // Gets information about a single variable. + GetVariable(context.Context, *GetVariableRequest) (*Variable, error) + // Watches a specific variable and waits for a change in the variable's value. + // When there is a change, this method returns the new value or times out. + // + // If a variable is deleted while being watched, the `variableState` state is + // set to `DELETED` and the method returns the last known variable `value`. + // + // If you set the deadline for watching to a larger value than internal timeout + // (60 seconds), the current variable value is returned and the `variableState` + // will be `VARIABLE_STATE_UNSPECIFIED`. + // + // To learn more about creating a watcher, read the + // [Watching a Variable for Changes](/deployment-manager/runtime-configurator/watching-a-variable) + // documentation. + WatchVariable(context.Context, *WatchVariableRequest) (*Variable, error) + // Creates a variable within the given configuration. You cannot create + // a variable with a name that is a prefix of an existing variable name, or a + // name that has an existing variable name as a prefix. + // + // To learn more about creating a variable, read the + // [Setting and Getting Data](/deployment-manager/runtime-configurator/set-and-get-variables) + // documentation. + CreateVariable(context.Context, *CreateVariableRequest) (*Variable, error) + // Updates an existing variable with a new value. + UpdateVariable(context.Context, *UpdateVariableRequest) (*Variable, error) + // Deletes a variable or multiple variables. + // + // If you specify a variable name, then that variable is deleted. If you + // specify a prefix and `recursive` is true, then all variables with that + // prefix are deleted. You must set a `recursive` to true if you delete + // variables by prefix. + DeleteVariable(context.Context, *DeleteVariableRequest) (*google_protobuf4.Empty, error) + // List waiters within the given configuration. + ListWaiters(context.Context, *ListWaitersRequest) (*ListWaitersResponse, error) + // Gets information about a single waiter. + GetWaiter(context.Context, *GetWaiterRequest) (*Waiter, error) + // Creates a Waiter resource. This operation returns a long-running Operation + // resource which can be polled for completion. However, a waiter with the + // given name will exist (and can be retrieved) prior to the operation + // completing. If the operation fails, the failed Waiter resource will + // still exist and must be deleted prior to subsequent creation attempts. + CreateWaiter(context.Context, *CreateWaiterRequest) (*google_longrunning.Operation, error) + // Deletes the waiter with the specified name. + DeleteWaiter(context.Context, *DeleteWaiterRequest) (*google_protobuf4.Empty, error) +} + +func RegisterRuntimeConfigManagerServer(s *grpc.Server, srv RuntimeConfigManagerServer) { + s.RegisterService(&_RuntimeConfigManager_serviceDesc, srv) +} + +func _RuntimeConfigManager_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.(RuntimeConfigManagerServer).ListConfigs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/ListConfigs", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeConfigManagerServer).ListConfigs(ctx, req.(*ListConfigsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RuntimeConfigManager_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.(RuntimeConfigManagerServer).GetConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/GetConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeConfigManagerServer).GetConfig(ctx, req.(*GetConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RuntimeConfigManager_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.(RuntimeConfigManagerServer).CreateConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/CreateConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeConfigManagerServer).CreateConfig(ctx, req.(*CreateConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RuntimeConfigManager_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.(RuntimeConfigManagerServer).UpdateConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/UpdateConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeConfigManagerServer).UpdateConfig(ctx, req.(*UpdateConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RuntimeConfigManager_DeleteConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RuntimeConfigManagerServer).DeleteConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/DeleteConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeConfigManagerServer).DeleteConfig(ctx, req.(*DeleteConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RuntimeConfigManager_ListVariables_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListVariablesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RuntimeConfigManagerServer).ListVariables(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/ListVariables", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeConfigManagerServer).ListVariables(ctx, req.(*ListVariablesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RuntimeConfigManager_GetVariable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetVariableRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RuntimeConfigManagerServer).GetVariable(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/GetVariable", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeConfigManagerServer).GetVariable(ctx, req.(*GetVariableRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RuntimeConfigManager_WatchVariable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(WatchVariableRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RuntimeConfigManagerServer).WatchVariable(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/WatchVariable", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeConfigManagerServer).WatchVariable(ctx, req.(*WatchVariableRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RuntimeConfigManager_CreateVariable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateVariableRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RuntimeConfigManagerServer).CreateVariable(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/CreateVariable", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeConfigManagerServer).CreateVariable(ctx, req.(*CreateVariableRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RuntimeConfigManager_UpdateVariable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateVariableRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RuntimeConfigManagerServer).UpdateVariable(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/UpdateVariable", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeConfigManagerServer).UpdateVariable(ctx, req.(*UpdateVariableRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RuntimeConfigManager_DeleteVariable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteVariableRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RuntimeConfigManagerServer).DeleteVariable(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/DeleteVariable", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeConfigManagerServer).DeleteVariable(ctx, req.(*DeleteVariableRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RuntimeConfigManager_ListWaiters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListWaitersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RuntimeConfigManagerServer).ListWaiters(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/ListWaiters", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeConfigManagerServer).ListWaiters(ctx, req.(*ListWaitersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RuntimeConfigManager_GetWaiter_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetWaiterRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RuntimeConfigManagerServer).GetWaiter(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/GetWaiter", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeConfigManagerServer).GetWaiter(ctx, req.(*GetWaiterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RuntimeConfigManager_CreateWaiter_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateWaiterRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RuntimeConfigManagerServer).CreateWaiter(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/CreateWaiter", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeConfigManagerServer).CreateWaiter(ctx, req.(*CreateWaiterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RuntimeConfigManager_DeleteWaiter_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteWaiterRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RuntimeConfigManagerServer).DeleteWaiter(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/DeleteWaiter", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeConfigManagerServer).DeleteWaiter(ctx, req.(*DeleteWaiterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _RuntimeConfigManager_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager", + HandlerType: (*RuntimeConfigManagerServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListConfigs", + Handler: _RuntimeConfigManager_ListConfigs_Handler, + }, + { + MethodName: "GetConfig", + Handler: _RuntimeConfigManager_GetConfig_Handler, + }, + { + MethodName: "CreateConfig", + Handler: _RuntimeConfigManager_CreateConfig_Handler, + }, + { + MethodName: "UpdateConfig", + Handler: _RuntimeConfigManager_UpdateConfig_Handler, + }, + { + MethodName: "DeleteConfig", + Handler: _RuntimeConfigManager_DeleteConfig_Handler, + }, + { + MethodName: "ListVariables", + Handler: _RuntimeConfigManager_ListVariables_Handler, + }, + { + MethodName: "GetVariable", + Handler: _RuntimeConfigManager_GetVariable_Handler, + }, + { + MethodName: "WatchVariable", + Handler: _RuntimeConfigManager_WatchVariable_Handler, + }, + { + MethodName: "CreateVariable", + Handler: _RuntimeConfigManager_CreateVariable_Handler, + }, + { + MethodName: "UpdateVariable", + Handler: _RuntimeConfigManager_UpdateVariable_Handler, + }, + { + MethodName: "DeleteVariable", + Handler: _RuntimeConfigManager_DeleteVariable_Handler, + }, + { + MethodName: "ListWaiters", + Handler: _RuntimeConfigManager_ListWaiters_Handler, + }, + { + MethodName: "GetWaiter", + Handler: _RuntimeConfigManager_GetWaiter_Handler, + }, + { + MethodName: "CreateWaiter", + Handler: _RuntimeConfigManager_CreateWaiter_Handler, + }, + { + MethodName: "DeleteWaiter", + Handler: _RuntimeConfigManager_DeleteWaiter_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/cloud/runtimeconfig/v1beta1/runtimeconfig.proto", +} + +func init() { + proto.RegisterFile("google/cloud/runtimeconfig/v1beta1/runtimeconfig.proto", fileDescriptor1) +} + +var fileDescriptor1 = []byte{ + // 1158 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x98, 0x4b, 0x6f, 0xdd, 0x44, + 0x14, 0xc7, 0x35, 0x49, 0x9b, 0xe6, 0x9e, 0x3c, 0x40, 0x93, 0x87, 0x22, 0xb7, 0x15, 0x91, 0x8b, + 0xa2, 0x70, 0x55, 0xd9, 0x4d, 0x5a, 0xa5, 0x49, 0xa0, 0x2c, 0x92, 0xa2, 0x10, 0x1e, 0x6a, 0x65, + 0x42, 0x2a, 0xa1, 0x48, 0xd1, 0xe4, 0x66, 0xe2, 0x18, 0x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8f, 0x88, 0xea, 0xef, 0xfa, 0x39, 0xfa, 0xfb, 0x37, + 0xa5, 0xcd, 0x6a, 0x40, 0x32, 0xd7, 0xe6, 0xf2, 0xf0, 0x66, 0xae, 0xcd, 0x6d, 0x93, 0x98, 0xbd, + 0x24, 0xd8, 0x6f, 0x61, 0xc7, 0xb0, 0x4d, 0xf4, 0xec, 0xf5, 0xbd, 0x54, 0x69, 0x19, 0xce, 0x58, + 0xa5, 0x4b, 0x53, 0x8c, 0x55, 0x61, 0x5e, 0xea, 0xc4, 0xd9, 0xbd, 0xc6, 0x0a, 0x32, 0x7b, 0xb2, + 0x7f, 0xc8, 0x85, 0x5a, 0xa1, 0x56, 0x10, 0xea, 0x32, 0xed, 0x75, 0xed, 0x58, 0xf8, 0x65, 0xc4, + 0x79, 0xa0, 0x7f, 0x19, 0xb1, 0x5f, 0x15, 0x80, 0xcb, 0x76, 0xc5, 0x42, 0xae, 0xea, 0x41, 0xf0, + 0x49, 0xae, 0x75, 0x55, 0x40, 0x3b, 0x0c, 0x87, 0x5d, 0xdb, 0x54, 0x95, 0xb0, 0x5e, 0xb1, 0x84, + 0x6b, 0x7f, 0x22, 0x98, 0x6b, 0x84, 0x47, 0x06, 0x38, 0x0f, 0xd1, 0x7b, 0x0f, 0x94, 0x95, 0x1f, + 0x36, 0x09, 0xf3, 0x9d, 0x30, 0xf6, 0x5d, 0x9f, 0x32, 0x41, 0xe2, 0xca, 0x4f, 0x24, 0x0a, 0x92, + 0x5e, 0xbf, 0x48, 0xbd, 0x5c, 0x5a, 0xfd, 0x69, 0xc0, 0xde, 0x90, 0x11, 0xd7, 0x45, 0xde, 0xd2, + 0x58, 0xe1, 0x6c, 0x2f, 0xac, 0x65, 0x2e, 0x7f, 0x69, 0xa3, 0x1d, 0x61, 0xb4, 0x53, 0x32, 0xda, + 0xd9, 0x96, 0x71, 0xf7, 0x86, 0x04, 0xc5, 0xed, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x9f, 0x36, + 0x17, 0x5a, 0x90, 0x13, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/speech/v1/cloud_speech.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/speech/v1/cloud_speech.pb.go new file mode 100644 index 0000000000..31c6c4e56c --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/speech/v1/cloud_speech.pb.go @@ -0,0 +1,1254 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/speech/v1/cloud_speech.proto + +/* +Package speech is a generated protocol buffer package. + +It is generated from these files: + google/cloud/speech/v1/cloud_speech.proto + +It has these top-level messages: + RecognizeRequest + LongRunningRecognizeRequest + StreamingRecognizeRequest + StreamingRecognitionConfig + RecognitionConfig + SpeechContext + RecognitionAudio + RecognizeResponse + LongRunningRecognizeResponse + LongRunningRecognizeMetadata + StreamingRecognizeResponse + StreamingRecognitionResult + SpeechRecognitionResult + SpeechRecognitionAlternative + WordInfo +*/ +package speech + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_longrunning "google.golang.org/genproto/googleapis/longrunning" +import _ "github.com/golang/protobuf/ptypes/any" +import google_protobuf3 "github.com/golang/protobuf/ptypes/duration" +import google_protobuf4 "github.com/golang/protobuf/ptypes/timestamp" +import google_rpc "google.golang.org/genproto/googleapis/rpc/status" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Audio encoding of the data sent in the audio message. All encodings support +// only 1 channel (mono) audio. Only `FLAC` and `WAV` include a header that +// describes the bytes of audio that follow the header. The other encodings +// are raw audio bytes with no header. +// +// For best results, the audio source should be captured and transmitted using +// a lossless encoding (`FLAC` or `LINEAR16`). Recognition accuracy may be +// reduced if lossy codecs, which include the other codecs listed in +// this section, are used to capture or transmit the audio, particularly if +// background noise is present. +type RecognitionConfig_AudioEncoding int32 + +const ( + // Not specified. Will return result [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + RecognitionConfig_ENCODING_UNSPECIFIED RecognitionConfig_AudioEncoding = 0 + // Uncompressed 16-bit signed little-endian samples (Linear PCM). + RecognitionConfig_LINEAR16 RecognitionConfig_AudioEncoding = 1 + // [`FLAC`](https://xiph.org/flac/documentation.html) (Free Lossless Audio + // Codec) is the recommended encoding because it is + // lossless--therefore recognition is not compromised--and + // requires only about half the bandwidth of `LINEAR16`. `FLAC` stream + // encoding supports 16-bit and 24-bit samples, however, not all fields in + // `STREAMINFO` are supported. + RecognitionConfig_FLAC RecognitionConfig_AudioEncoding = 2 + // 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. + RecognitionConfig_MULAW RecognitionConfig_AudioEncoding = 3 + // Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000. + RecognitionConfig_AMR RecognitionConfig_AudioEncoding = 4 + // Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000. + RecognitionConfig_AMR_WB RecognitionConfig_AudioEncoding = 5 + // Opus encoded audio frames in Ogg container + // ([OggOpus](https://wiki.xiph.org/OggOpus)). + // `sample_rate_hertz` must be 16000. + RecognitionConfig_OGG_OPUS RecognitionConfig_AudioEncoding = 6 + // Although the use of lossy encodings is not recommended, if a very low + // bitrate encoding is required, `OGG_OPUS` is highly preferred over + // Speex encoding. The [Speex](https://speex.org/) encoding supported by + // Cloud Speech API has a header byte in each block, as in MIME type + // `audio/x-speex-with-header-byte`. + // It is a variant of the RTP Speex encoding defined in + // [RFC 5574](https://tools.ietf.org/html/rfc5574). + // The stream is a sequence of blocks, one block per RTP packet. Each block + // starts with a byte containing the length of the block, in bytes, followed + // by one or more frames of Speex data, padded to an integral number of + // bytes (octets) as specified in RFC 5574. In other words, each RTP header + // is replaced with a single byte containing the block length. Only Speex + // wideband is supported. `sample_rate_hertz` must be 16000. + RecognitionConfig_SPEEX_WITH_HEADER_BYTE RecognitionConfig_AudioEncoding = 7 +) + +var RecognitionConfig_AudioEncoding_name = map[int32]string{ + 0: "ENCODING_UNSPECIFIED", + 1: "LINEAR16", + 2: "FLAC", + 3: "MULAW", + 4: "AMR", + 5: "AMR_WB", + 6: "OGG_OPUS", + 7: "SPEEX_WITH_HEADER_BYTE", +} +var RecognitionConfig_AudioEncoding_value = map[string]int32{ + "ENCODING_UNSPECIFIED": 0, + "LINEAR16": 1, + "FLAC": 2, + "MULAW": 3, + "AMR": 4, + "AMR_WB": 5, + "OGG_OPUS": 6, + "SPEEX_WITH_HEADER_BYTE": 7, +} + +func (x RecognitionConfig_AudioEncoding) String() string { + return proto.EnumName(RecognitionConfig_AudioEncoding_name, int32(x)) +} +func (RecognitionConfig_AudioEncoding) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{4, 0} +} + +// Indicates the type of speech event. +type StreamingRecognizeResponse_SpeechEventType int32 + +const ( + // No speech event specified. + StreamingRecognizeResponse_SPEECH_EVENT_UNSPECIFIED StreamingRecognizeResponse_SpeechEventType = 0 + // This event indicates that the server has detected the end of the user's + // speech utterance and expects no additional speech. Therefore, the server + // will not process additional audio (although it may subsequently return + // additional results). The client should stop sending additional audio + // data, half-close the gRPC connection, and wait for any additional results + // until the server closes the gRPC connection. This event is only sent if + // `single_utterance` was set to `true`, and is not used otherwise. + StreamingRecognizeResponse_END_OF_SINGLE_UTTERANCE StreamingRecognizeResponse_SpeechEventType = 1 +) + +var StreamingRecognizeResponse_SpeechEventType_name = map[int32]string{ + 0: "SPEECH_EVENT_UNSPECIFIED", + 1: "END_OF_SINGLE_UTTERANCE", +} +var StreamingRecognizeResponse_SpeechEventType_value = map[string]int32{ + "SPEECH_EVENT_UNSPECIFIED": 0, + "END_OF_SINGLE_UTTERANCE": 1, +} + +func (x StreamingRecognizeResponse_SpeechEventType) String() string { + return proto.EnumName(StreamingRecognizeResponse_SpeechEventType_name, int32(x)) +} +func (StreamingRecognizeResponse_SpeechEventType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{10, 0} +} + +// The top-level message sent by the client for the `Recognize` method. +type RecognizeRequest struct { + // *Required* Provides information to the recognizer that specifies how to + // process the request. + Config *RecognitionConfig `protobuf:"bytes,1,opt,name=config" json:"config,omitempty"` + // *Required* The audio data to be recognized. + Audio *RecognitionAudio `protobuf:"bytes,2,opt,name=audio" json:"audio,omitempty"` +} + +func (m *RecognizeRequest) Reset() { *m = RecognizeRequest{} } +func (m *RecognizeRequest) String() string { return proto.CompactTextString(m) } +func (*RecognizeRequest) ProtoMessage() {} +func (*RecognizeRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *RecognizeRequest) GetConfig() *RecognitionConfig { + if m != nil { + return m.Config + } + return nil +} + +func (m *RecognizeRequest) GetAudio() *RecognitionAudio { + if m != nil { + return m.Audio + } + return nil +} + +// The top-level message sent by the client for the `LongRunningRecognize` +// method. +type LongRunningRecognizeRequest struct { + // *Required* Provides information to the recognizer that specifies how to + // process the request. + Config *RecognitionConfig `protobuf:"bytes,1,opt,name=config" json:"config,omitempty"` + // *Required* The audio data to be recognized. + Audio *RecognitionAudio `protobuf:"bytes,2,opt,name=audio" json:"audio,omitempty"` +} + +func (m *LongRunningRecognizeRequest) Reset() { *m = LongRunningRecognizeRequest{} } +func (m *LongRunningRecognizeRequest) String() string { return proto.CompactTextString(m) } +func (*LongRunningRecognizeRequest) ProtoMessage() {} +func (*LongRunningRecognizeRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *LongRunningRecognizeRequest) GetConfig() *RecognitionConfig { + if m != nil { + return m.Config + } + return nil +} + +func (m *LongRunningRecognizeRequest) GetAudio() *RecognitionAudio { + if m != nil { + return m.Audio + } + return nil +} + +// The top-level message sent by the client for the `StreamingRecognize` method. +// Multiple `StreamingRecognizeRequest` messages are sent. The first message +// must contain a `streaming_config` message and must not contain `audio` data. +// All subsequent messages must contain `audio` data and must not contain a +// `streaming_config` message. +type StreamingRecognizeRequest struct { + // The streaming request, which is either a streaming config or audio content. + // + // Types that are valid to be assigned to StreamingRequest: + // *StreamingRecognizeRequest_StreamingConfig + // *StreamingRecognizeRequest_AudioContent + StreamingRequest isStreamingRecognizeRequest_StreamingRequest `protobuf_oneof:"streaming_request"` +} + +func (m *StreamingRecognizeRequest) Reset() { *m = StreamingRecognizeRequest{} } +func (m *StreamingRecognizeRequest) String() string { return proto.CompactTextString(m) } +func (*StreamingRecognizeRequest) ProtoMessage() {} +func (*StreamingRecognizeRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +type isStreamingRecognizeRequest_StreamingRequest interface { + isStreamingRecognizeRequest_StreamingRequest() +} + +type StreamingRecognizeRequest_StreamingConfig struct { + StreamingConfig *StreamingRecognitionConfig `protobuf:"bytes,1,opt,name=streaming_config,json=streamingConfig,oneof"` +} +type StreamingRecognizeRequest_AudioContent struct { + AudioContent []byte `protobuf:"bytes,2,opt,name=audio_content,json=audioContent,proto3,oneof"` +} + +func (*StreamingRecognizeRequest_StreamingConfig) isStreamingRecognizeRequest_StreamingRequest() {} +func (*StreamingRecognizeRequest_AudioContent) isStreamingRecognizeRequest_StreamingRequest() {} + +func (m *StreamingRecognizeRequest) GetStreamingRequest() isStreamingRecognizeRequest_StreamingRequest { + if m != nil { + return m.StreamingRequest + } + return nil +} + +func (m *StreamingRecognizeRequest) GetStreamingConfig() *StreamingRecognitionConfig { + if x, ok := m.GetStreamingRequest().(*StreamingRecognizeRequest_StreamingConfig); ok { + return x.StreamingConfig + } + return nil +} + +func (m *StreamingRecognizeRequest) GetAudioContent() []byte { + if x, ok := m.GetStreamingRequest().(*StreamingRecognizeRequest_AudioContent); ok { + return x.AudioContent + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*StreamingRecognizeRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _StreamingRecognizeRequest_OneofMarshaler, _StreamingRecognizeRequest_OneofUnmarshaler, _StreamingRecognizeRequest_OneofSizer, []interface{}{ + (*StreamingRecognizeRequest_StreamingConfig)(nil), + (*StreamingRecognizeRequest_AudioContent)(nil), + } +} + +func _StreamingRecognizeRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*StreamingRecognizeRequest) + // streaming_request + switch x := m.StreamingRequest.(type) { + case *StreamingRecognizeRequest_StreamingConfig: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.StreamingConfig); err != nil { + return err + } + case *StreamingRecognizeRequest_AudioContent: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeRawBytes(x.AudioContent) + case nil: + default: + return fmt.Errorf("StreamingRecognizeRequest.StreamingRequest has unexpected type %T", x) + } + return nil +} + +func _StreamingRecognizeRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*StreamingRecognizeRequest) + switch tag { + case 1: // streaming_request.streaming_config + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(StreamingRecognitionConfig) + err := b.DecodeMessage(msg) + m.StreamingRequest = &StreamingRecognizeRequest_StreamingConfig{msg} + return true, err + case 2: // streaming_request.audio_content + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.StreamingRequest = &StreamingRecognizeRequest_AudioContent{x} + return true, err + default: + return false, nil + } +} + +func _StreamingRecognizeRequest_OneofSizer(msg proto.Message) (n int) { + m := msg.(*StreamingRecognizeRequest) + // streaming_request + switch x := m.StreamingRequest.(type) { + case *StreamingRecognizeRequest_StreamingConfig: + s := proto.Size(x.StreamingConfig) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *StreamingRecognizeRequest_AudioContent: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.AudioContent))) + n += len(x.AudioContent) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Provides information to the recognizer that specifies how to process the +// request. +type StreamingRecognitionConfig struct { + // *Required* Provides information to the recognizer that specifies how to + // process the request. + Config *RecognitionConfig `protobuf:"bytes,1,opt,name=config" json:"config,omitempty"` + // *Optional* If `false` or omitted, the recognizer will perform continuous + // recognition (continuing to wait for and process audio even if the user + // pauses speaking) until the client closes the input stream (gRPC API) or + // until the maximum time limit has been reached. May return multiple + // `StreamingRecognitionResult`s with the `is_final` flag set to `true`. + // + // If `true`, the recognizer will detect a single spoken utterance. When it + // detects that the user has paused or stopped speaking, it will return an + // `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no + // more than one `StreamingRecognitionResult` with the `is_final` flag set to + // `true`. + SingleUtterance bool `protobuf:"varint,2,opt,name=single_utterance,json=singleUtterance" json:"single_utterance,omitempty"` + // *Optional* If `true`, interim results (tentative hypotheses) may be + // returned as they become available (these interim results are indicated with + // the `is_final=false` flag). + // If `false` or omitted, only `is_final=true` result(s) are returned. + InterimResults bool `protobuf:"varint,3,opt,name=interim_results,json=interimResults" json:"interim_results,omitempty"` +} + +func (m *StreamingRecognitionConfig) Reset() { *m = StreamingRecognitionConfig{} } +func (m *StreamingRecognitionConfig) String() string { return proto.CompactTextString(m) } +func (*StreamingRecognitionConfig) ProtoMessage() {} +func (*StreamingRecognitionConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *StreamingRecognitionConfig) GetConfig() *RecognitionConfig { + if m != nil { + return m.Config + } + return nil +} + +func (m *StreamingRecognitionConfig) GetSingleUtterance() bool { + if m != nil { + return m.SingleUtterance + } + return false +} + +func (m *StreamingRecognitionConfig) GetInterimResults() bool { + if m != nil { + return m.InterimResults + } + return false +} + +// Provides information to the recognizer that specifies how to process the +// request. +type RecognitionConfig struct { + // *Required* Encoding of audio data sent in all `RecognitionAudio` messages. + Encoding RecognitionConfig_AudioEncoding `protobuf:"varint,1,opt,name=encoding,enum=google.cloud.speech.v1.RecognitionConfig_AudioEncoding" json:"encoding,omitempty"` + // *Required* Sample rate in Hertz of the audio data sent in all + // `RecognitionAudio` messages. Valid values are: 8000-48000. + // 16000 is optimal. For best results, set the sampling rate of the audio + // source to 16000 Hz. If that's not possible, use the native sample rate of + // the audio source (instead of re-sampling). + SampleRateHertz int32 `protobuf:"varint,2,opt,name=sample_rate_hertz,json=sampleRateHertz" json:"sample_rate_hertz,omitempty"` + // *Required* The language of the supplied audio as a + // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + // Example: "en-US". + // See [Language Support](https://cloud.google.com/speech/docs/languages) + // for a list of the currently supported language codes. + LanguageCode string `protobuf:"bytes,3,opt,name=language_code,json=languageCode" json:"language_code,omitempty"` + // *Optional* Maximum number of recognition hypotheses to be returned. + // Specifically, the maximum number of `SpeechRecognitionAlternative` messages + // within each `SpeechRecognitionResult`. + // The server may return fewer than `max_alternatives`. + // Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of + // one. If omitted, will return a maximum of one. + MaxAlternatives int32 `protobuf:"varint,4,opt,name=max_alternatives,json=maxAlternatives" json:"max_alternatives,omitempty"` + // *Optional* If set to `true`, the server will attempt to filter out + // profanities, replacing all but the initial character in each filtered word + // with asterisks, e.g. "f***". If set to `false` or omitted, profanities + // won't be filtered out. + ProfanityFilter bool `protobuf:"varint,5,opt,name=profanity_filter,json=profanityFilter" json:"profanity_filter,omitempty"` + // *Optional* A means to provide context to assist the speech recognition. + SpeechContexts []*SpeechContext `protobuf:"bytes,6,rep,name=speech_contexts,json=speechContexts" json:"speech_contexts,omitempty"` + // *Optional* If `true`, the top result includes a list of words and + // the start and end time offsets (timestamps) for those words. If + // `false`, no word-level time offset information is returned. The default is + // `false`. + EnableWordTimeOffsets bool `protobuf:"varint,8,opt,name=enable_word_time_offsets,json=enableWordTimeOffsets" json:"enable_word_time_offsets,omitempty"` +} + +func (m *RecognitionConfig) Reset() { *m = RecognitionConfig{} } +func (m *RecognitionConfig) String() string { return proto.CompactTextString(m) } +func (*RecognitionConfig) ProtoMessage() {} +func (*RecognitionConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *RecognitionConfig) GetEncoding() RecognitionConfig_AudioEncoding { + if m != nil { + return m.Encoding + } + return RecognitionConfig_ENCODING_UNSPECIFIED +} + +func (m *RecognitionConfig) GetSampleRateHertz() int32 { + if m != nil { + return m.SampleRateHertz + } + return 0 +} + +func (m *RecognitionConfig) GetLanguageCode() string { + if m != nil { + return m.LanguageCode + } + return "" +} + +func (m *RecognitionConfig) GetMaxAlternatives() int32 { + if m != nil { + return m.MaxAlternatives + } + return 0 +} + +func (m *RecognitionConfig) GetProfanityFilter() bool { + if m != nil { + return m.ProfanityFilter + } + return false +} + +func (m *RecognitionConfig) GetSpeechContexts() []*SpeechContext { + if m != nil { + return m.SpeechContexts + } + return nil +} + +func (m *RecognitionConfig) GetEnableWordTimeOffsets() bool { + if m != nil { + return m.EnableWordTimeOffsets + } + return false +} + +// Provides "hints" to the speech recognizer to favor specific words and phrases +// in the results. +type SpeechContext struct { + // *Optional* A list of strings containing words and phrases "hints" so that + // the speech recognition is more likely to recognize them. This can be used + // to improve the accuracy for specific words and phrases, for example, if + // specific commands are typically spoken by the user. This can also be used + // to add additional words to the vocabulary of the recognizer. See + // [usage limits](https://cloud.google.com/speech/limits#content). + Phrases []string `protobuf:"bytes,1,rep,name=phrases" json:"phrases,omitempty"` +} + +func (m *SpeechContext) Reset() { *m = SpeechContext{} } +func (m *SpeechContext) String() string { return proto.CompactTextString(m) } +func (*SpeechContext) ProtoMessage() {} +func (*SpeechContext) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *SpeechContext) GetPhrases() []string { + if m != nil { + return m.Phrases + } + return nil +} + +// Contains audio data in the encoding specified in the `RecognitionConfig`. +// Either `content` or `uri` must be supplied. Supplying both or neither +// returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. See +// [audio limits](https://cloud.google.com/speech/limits#content). +type RecognitionAudio struct { + // The audio source, which is either inline content or a Google Cloud + // Storage uri. + // + // Types that are valid to be assigned to AudioSource: + // *RecognitionAudio_Content + // *RecognitionAudio_Uri + AudioSource isRecognitionAudio_AudioSource `protobuf_oneof:"audio_source"` +} + +func (m *RecognitionAudio) Reset() { *m = RecognitionAudio{} } +func (m *RecognitionAudio) String() string { return proto.CompactTextString(m) } +func (*RecognitionAudio) ProtoMessage() {} +func (*RecognitionAudio) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +type isRecognitionAudio_AudioSource interface { + isRecognitionAudio_AudioSource() +} + +type RecognitionAudio_Content struct { + Content []byte `protobuf:"bytes,1,opt,name=content,proto3,oneof"` +} +type RecognitionAudio_Uri struct { + Uri string `protobuf:"bytes,2,opt,name=uri,oneof"` +} + +func (*RecognitionAudio_Content) isRecognitionAudio_AudioSource() {} +func (*RecognitionAudio_Uri) isRecognitionAudio_AudioSource() {} + +func (m *RecognitionAudio) GetAudioSource() isRecognitionAudio_AudioSource { + if m != nil { + return m.AudioSource + } + return nil +} + +func (m *RecognitionAudio) GetContent() []byte { + if x, ok := m.GetAudioSource().(*RecognitionAudio_Content); ok { + return x.Content + } + return nil +} + +func (m *RecognitionAudio) GetUri() string { + if x, ok := m.GetAudioSource().(*RecognitionAudio_Uri); ok { + return x.Uri + } + return "" +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*RecognitionAudio) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _RecognitionAudio_OneofMarshaler, _RecognitionAudio_OneofUnmarshaler, _RecognitionAudio_OneofSizer, []interface{}{ + (*RecognitionAudio_Content)(nil), + (*RecognitionAudio_Uri)(nil), + } +} + +func _RecognitionAudio_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*RecognitionAudio) + // audio_source + switch x := m.AudioSource.(type) { + case *RecognitionAudio_Content: + b.EncodeVarint(1<<3 | proto.WireBytes) + b.EncodeRawBytes(x.Content) + case *RecognitionAudio_Uri: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeStringBytes(x.Uri) + case nil: + default: + return fmt.Errorf("RecognitionAudio.AudioSource has unexpected type %T", x) + } + return nil +} + +func _RecognitionAudio_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*RecognitionAudio) + switch tag { + case 1: // audio_source.content + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.AudioSource = &RecognitionAudio_Content{x} + return true, err + case 2: // audio_source.uri + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.AudioSource = &RecognitionAudio_Uri{x} + return true, err + default: + return false, nil + } +} + +func _RecognitionAudio_OneofSizer(msg proto.Message) (n int) { + m := msg.(*RecognitionAudio) + // audio_source + switch x := m.AudioSource.(type) { + case *RecognitionAudio_Content: + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Content))) + n += len(x.Content) + case *RecognitionAudio_Uri: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Uri))) + n += len(x.Uri) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// The only message returned to the client by the `Recognize` method. It +// contains the result as zero or more sequential `SpeechRecognitionResult` +// messages. +type RecognizeResponse struct { + // *Output-only* Sequential list of transcription results corresponding to + // sequential portions of audio. + Results []*SpeechRecognitionResult `protobuf:"bytes,2,rep,name=results" json:"results,omitempty"` +} + +func (m *RecognizeResponse) Reset() { *m = RecognizeResponse{} } +func (m *RecognizeResponse) String() string { return proto.CompactTextString(m) } +func (*RecognizeResponse) ProtoMessage() {} +func (*RecognizeResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *RecognizeResponse) GetResults() []*SpeechRecognitionResult { + if m != nil { + return m.Results + } + return nil +} + +// The only message returned to the client by the `LongRunningRecognize` method. +// It contains the result as zero or more sequential `SpeechRecognitionResult` +// messages. It is included in the `result.response` field of the `Operation` +// returned by the `GetOperation` call of the `google::longrunning::Operations` +// service. +type LongRunningRecognizeResponse struct { + // *Output-only* Sequential list of transcription results corresponding to + // sequential portions of audio. + Results []*SpeechRecognitionResult `protobuf:"bytes,2,rep,name=results" json:"results,omitempty"` +} + +func (m *LongRunningRecognizeResponse) Reset() { *m = LongRunningRecognizeResponse{} } +func (m *LongRunningRecognizeResponse) String() string { return proto.CompactTextString(m) } +func (*LongRunningRecognizeResponse) ProtoMessage() {} +func (*LongRunningRecognizeResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *LongRunningRecognizeResponse) GetResults() []*SpeechRecognitionResult { + if m != nil { + return m.Results + } + return nil +} + +// Describes the progress of a long-running `LongRunningRecognize` call. It is +// included in the `metadata` field of the `Operation` returned by the +// `GetOperation` call of the `google::longrunning::Operations` service. +type LongRunningRecognizeMetadata struct { + // Approximate percentage of audio processed thus far. Guaranteed to be 100 + // when the audio is fully processed and the results are available. + ProgressPercent int32 `protobuf:"varint,1,opt,name=progress_percent,json=progressPercent" json:"progress_percent,omitempty"` + // Time when the request was received. + StartTime *google_protobuf4.Timestamp `protobuf:"bytes,2,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + // Time of the most recent processing update. + LastUpdateTime *google_protobuf4.Timestamp `protobuf:"bytes,3,opt,name=last_update_time,json=lastUpdateTime" json:"last_update_time,omitempty"` +} + +func (m *LongRunningRecognizeMetadata) Reset() { *m = LongRunningRecognizeMetadata{} } +func (m *LongRunningRecognizeMetadata) String() string { return proto.CompactTextString(m) } +func (*LongRunningRecognizeMetadata) ProtoMessage() {} +func (*LongRunningRecognizeMetadata) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *LongRunningRecognizeMetadata) GetProgressPercent() int32 { + if m != nil { + return m.ProgressPercent + } + return 0 +} + +func (m *LongRunningRecognizeMetadata) GetStartTime() *google_protobuf4.Timestamp { + if m != nil { + return m.StartTime + } + return nil +} + +func (m *LongRunningRecognizeMetadata) GetLastUpdateTime() *google_protobuf4.Timestamp { + if m != nil { + return m.LastUpdateTime + } + return nil +} + +// `StreamingRecognizeResponse` is the only message returned to the client by +// `StreamingRecognize`. A series of zero or more `StreamingRecognizeResponse` +// messages are streamed back to the client. If there is no recognizable +// audio, and `single_utterance` is set to false, then no messages are streamed +// back to the client. +// +// Here's an example of a series of ten `StreamingRecognizeResponse`s that might +// be returned while processing audio: +// +// 1. results { alternatives { transcript: "tube" } stability: 0.01 } +// +// 2. results { alternatives { transcript: "to be a" } stability: 0.01 } +// +// 3. results { alternatives { transcript: "to be" } stability: 0.9 } +// results { alternatives { transcript: " or not to be" } stability: 0.01 } +// +// 4. results { alternatives { transcript: "to be or not to be" +// confidence: 0.92 } +// alternatives { transcript: "to bee or not to bee" } +// is_final: true } +// +// 5. results { alternatives { transcript: " that's" } stability: 0.01 } +// +// 6. results { alternatives { transcript: " that is" } stability: 0.9 } +// results { alternatives { transcript: " the question" } stability: 0.01 } +// +// 7. results { alternatives { transcript: " that is the question" +// confidence: 0.98 } +// alternatives { transcript: " that was the question" } +// is_final: true } +// +// Notes: +// +// - Only two of the above responses #4 and #7 contain final results; they are +// indicated by `is_final: true`. Concatenating these together generates the +// full transcript: "to be or not to be that is the question". +// +// - The others contain interim `results`. #3 and #6 contain two interim +// `results`: the first portion has a high stability and is less likely to +// change; the second portion has a low stability and is very likely to +// change. A UI designer might choose to show only high stability `results`. +// +// - The specific `stability` and `confidence` values shown above are only for +// illustrative purposes. Actual values may vary. +// +// - In each response, only one of these fields will be set: +// `error`, +// `speech_event_type`, or +// one or more (repeated) `results`. +type StreamingRecognizeResponse struct { + // *Output-only* If set, returns a [google.rpc.Status][google.rpc.Status] message that + // specifies the error for the operation. + Error *google_rpc.Status `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"` + // *Output-only* This repeated list contains zero or more results that + // correspond to consecutive portions of the audio currently being processed. + // It contains zero or more `is_final=false` results followed by zero or one + // `is_final=true` result (the newly settled portion). + Results []*StreamingRecognitionResult `protobuf:"bytes,2,rep,name=results" json:"results,omitempty"` + // *Output-only* Indicates the type of speech event. + SpeechEventType StreamingRecognizeResponse_SpeechEventType `protobuf:"varint,4,opt,name=speech_event_type,json=speechEventType,enum=google.cloud.speech.v1.StreamingRecognizeResponse_SpeechEventType" json:"speech_event_type,omitempty"` +} + +func (m *StreamingRecognizeResponse) Reset() { *m = StreamingRecognizeResponse{} } +func (m *StreamingRecognizeResponse) String() string { return proto.CompactTextString(m) } +func (*StreamingRecognizeResponse) ProtoMessage() {} +func (*StreamingRecognizeResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *StreamingRecognizeResponse) GetError() *google_rpc.Status { + if m != nil { + return m.Error + } + return nil +} + +func (m *StreamingRecognizeResponse) GetResults() []*StreamingRecognitionResult { + if m != nil { + return m.Results + } + return nil +} + +func (m *StreamingRecognizeResponse) GetSpeechEventType() StreamingRecognizeResponse_SpeechEventType { + if m != nil { + return m.SpeechEventType + } + return StreamingRecognizeResponse_SPEECH_EVENT_UNSPECIFIED +} + +// A streaming speech recognition result corresponding to a portion of the audio +// that is currently being processed. +type StreamingRecognitionResult struct { + // *Output-only* May contain one or more recognition hypotheses (up to the + // maximum specified in `max_alternatives`). + Alternatives []*SpeechRecognitionAlternative `protobuf:"bytes,1,rep,name=alternatives" json:"alternatives,omitempty"` + // *Output-only* If `false`, this `StreamingRecognitionResult` represents an + // interim result that may change. If `true`, this is the final time the + // speech service will return this particular `StreamingRecognitionResult`, + // the recognizer will not return any further hypotheses for this portion of + // the transcript and corresponding audio. + IsFinal bool `protobuf:"varint,2,opt,name=is_final,json=isFinal" json:"is_final,omitempty"` + // *Output-only* An estimate of the likelihood that the recognizer will not + // change its guess about this interim result. Values range from 0.0 + // (completely unstable) to 1.0 (completely stable). + // This field is only provided for interim results (`is_final=false`). + // The default of 0.0 is a sentinel value indicating `stability` was not set. + Stability float32 `protobuf:"fixed32,3,opt,name=stability" json:"stability,omitempty"` +} + +func (m *StreamingRecognitionResult) Reset() { *m = StreamingRecognitionResult{} } +func (m *StreamingRecognitionResult) String() string { return proto.CompactTextString(m) } +func (*StreamingRecognitionResult) ProtoMessage() {} +func (*StreamingRecognitionResult) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } + +func (m *StreamingRecognitionResult) GetAlternatives() []*SpeechRecognitionAlternative { + if m != nil { + return m.Alternatives + } + return nil +} + +func (m *StreamingRecognitionResult) GetIsFinal() bool { + if m != nil { + return m.IsFinal + } + return false +} + +func (m *StreamingRecognitionResult) GetStability() float32 { + if m != nil { + return m.Stability + } + return 0 +} + +// A speech recognition result corresponding to a portion of the audio. +type SpeechRecognitionResult struct { + // *Output-only* May contain one or more recognition hypotheses (up to the + // maximum specified in `max_alternatives`). + // These alternatives are ordered in terms of accuracy, with the top (first) + // alternative being the most probable, as ranked by the recognizer. + Alternatives []*SpeechRecognitionAlternative `protobuf:"bytes,1,rep,name=alternatives" json:"alternatives,omitempty"` +} + +func (m *SpeechRecognitionResult) Reset() { *m = SpeechRecognitionResult{} } +func (m *SpeechRecognitionResult) String() string { return proto.CompactTextString(m) } +func (*SpeechRecognitionResult) ProtoMessage() {} +func (*SpeechRecognitionResult) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } + +func (m *SpeechRecognitionResult) GetAlternatives() []*SpeechRecognitionAlternative { + if m != nil { + return m.Alternatives + } + return nil +} + +// Alternative hypotheses (a.k.a. n-best list). +type SpeechRecognitionAlternative struct { + // *Output-only* Transcript text representing the words that the user spoke. + Transcript string `protobuf:"bytes,1,opt,name=transcript" json:"transcript,omitempty"` + // *Output-only* The confidence estimate between 0.0 and 1.0. A higher number + // indicates an estimated greater likelihood that the recognized words are + // correct. This field is typically provided only for the top hypothesis, and + // only for `is_final=true` results. Clients should not rely on the + // `confidence` field as it is not guaranteed to be accurate or consistent. + // The default of 0.0 is a sentinel value indicating `confidence` was not set. + Confidence float32 `protobuf:"fixed32,2,opt,name=confidence" json:"confidence,omitempty"` + // *Output-only* A list of word-specific information for each recognized word. + Words []*WordInfo `protobuf:"bytes,3,rep,name=words" json:"words,omitempty"` +} + +func (m *SpeechRecognitionAlternative) Reset() { *m = SpeechRecognitionAlternative{} } +func (m *SpeechRecognitionAlternative) String() string { return proto.CompactTextString(m) } +func (*SpeechRecognitionAlternative) ProtoMessage() {} +func (*SpeechRecognitionAlternative) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } + +func (m *SpeechRecognitionAlternative) GetTranscript() string { + if m != nil { + return m.Transcript + } + return "" +} + +func (m *SpeechRecognitionAlternative) GetConfidence() float32 { + if m != nil { + return m.Confidence + } + return 0 +} + +func (m *SpeechRecognitionAlternative) GetWords() []*WordInfo { + if m != nil { + return m.Words + } + return nil +} + +// Word-specific information for recognized words. Word information is only +// included in the response when certain request parameters are set, such +// as `enable_word_time_offsets`. +type WordInfo struct { + // *Output-only* Time offset relative to the beginning of the audio, + // and corresponding to the start of the spoken word. + // This field is only set if `enable_word_time_offsets=true` and only + // in the top hypothesis. + // This is an experimental feature and the accuracy of the time offset can + // vary. + StartTime *google_protobuf3.Duration `protobuf:"bytes,1,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + // *Output-only* Time offset relative to the beginning of the audio, + // and corresponding to the end of the spoken word. + // This field is only set if `enable_word_time_offsets=true` and only + // in the top hypothesis. + // This is an experimental feature and the accuracy of the time offset can + // vary. + EndTime *google_protobuf3.Duration `protobuf:"bytes,2,opt,name=end_time,json=endTime" json:"end_time,omitempty"` + // *Output-only* The word corresponding to this set of information. + Word string `protobuf:"bytes,3,opt,name=word" json:"word,omitempty"` +} + +func (m *WordInfo) Reset() { *m = WordInfo{} } +func (m *WordInfo) String() string { return proto.CompactTextString(m) } +func (*WordInfo) ProtoMessage() {} +func (*WordInfo) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } + +func (m *WordInfo) GetStartTime() *google_protobuf3.Duration { + if m != nil { + return m.StartTime + } + return nil +} + +func (m *WordInfo) GetEndTime() *google_protobuf3.Duration { + if m != nil { + return m.EndTime + } + return nil +} + +func (m *WordInfo) GetWord() string { + if m != nil { + return m.Word + } + return "" +} + +func init() { + proto.RegisterType((*RecognizeRequest)(nil), "google.cloud.speech.v1.RecognizeRequest") + proto.RegisterType((*LongRunningRecognizeRequest)(nil), "google.cloud.speech.v1.LongRunningRecognizeRequest") + proto.RegisterType((*StreamingRecognizeRequest)(nil), "google.cloud.speech.v1.StreamingRecognizeRequest") + proto.RegisterType((*StreamingRecognitionConfig)(nil), "google.cloud.speech.v1.StreamingRecognitionConfig") + proto.RegisterType((*RecognitionConfig)(nil), "google.cloud.speech.v1.RecognitionConfig") + proto.RegisterType((*SpeechContext)(nil), "google.cloud.speech.v1.SpeechContext") + proto.RegisterType((*RecognitionAudio)(nil), "google.cloud.speech.v1.RecognitionAudio") + proto.RegisterType((*RecognizeResponse)(nil), "google.cloud.speech.v1.RecognizeResponse") + proto.RegisterType((*LongRunningRecognizeResponse)(nil), "google.cloud.speech.v1.LongRunningRecognizeResponse") + proto.RegisterType((*LongRunningRecognizeMetadata)(nil), "google.cloud.speech.v1.LongRunningRecognizeMetadata") + proto.RegisterType((*StreamingRecognizeResponse)(nil), "google.cloud.speech.v1.StreamingRecognizeResponse") + proto.RegisterType((*StreamingRecognitionResult)(nil), "google.cloud.speech.v1.StreamingRecognitionResult") + proto.RegisterType((*SpeechRecognitionResult)(nil), "google.cloud.speech.v1.SpeechRecognitionResult") + proto.RegisterType((*SpeechRecognitionAlternative)(nil), "google.cloud.speech.v1.SpeechRecognitionAlternative") + proto.RegisterType((*WordInfo)(nil), "google.cloud.speech.v1.WordInfo") + proto.RegisterEnum("google.cloud.speech.v1.RecognitionConfig_AudioEncoding", RecognitionConfig_AudioEncoding_name, RecognitionConfig_AudioEncoding_value) + proto.RegisterEnum("google.cloud.speech.v1.StreamingRecognizeResponse_SpeechEventType", StreamingRecognizeResponse_SpeechEventType_name, StreamingRecognizeResponse_SpeechEventType_value) +} + +// 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 + +// Client API for Speech service + +type SpeechClient interface { + // Performs synchronous speech recognition: receive results after all audio + // has been sent and processed. + Recognize(ctx context.Context, in *RecognizeRequest, opts ...grpc.CallOption) (*RecognizeResponse, error) + // Performs asynchronous speech recognition: receive results via the + // google.longrunning.Operations interface. Returns either an + // `Operation.error` or an `Operation.response` which contains + // a `LongRunningRecognizeResponse` message. + LongRunningRecognize(ctx context.Context, in *LongRunningRecognizeRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Performs bidirectional streaming speech recognition: receive results while + // sending audio. This method is only available via the gRPC API (not REST). + StreamingRecognize(ctx context.Context, opts ...grpc.CallOption) (Speech_StreamingRecognizeClient, error) +} + +type speechClient struct { + cc *grpc.ClientConn +} + +func NewSpeechClient(cc *grpc.ClientConn) SpeechClient { + return &speechClient{cc} +} + +func (c *speechClient) Recognize(ctx context.Context, in *RecognizeRequest, opts ...grpc.CallOption) (*RecognizeResponse, error) { + out := new(RecognizeResponse) + err := grpc.Invoke(ctx, "/google.cloud.speech.v1.Speech/Recognize", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *speechClient) LongRunningRecognize(ctx context.Context, in *LongRunningRecognizeRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.cloud.speech.v1.Speech/LongRunningRecognize", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *speechClient) StreamingRecognize(ctx context.Context, opts ...grpc.CallOption) (Speech_StreamingRecognizeClient, error) { + stream, err := grpc.NewClientStream(ctx, &_Speech_serviceDesc.Streams[0], c.cc, "/google.cloud.speech.v1.Speech/StreamingRecognize", opts...) + if err != nil { + return nil, err + } + x := &speechStreamingRecognizeClient{stream} + return x, nil +} + +type Speech_StreamingRecognizeClient interface { + Send(*StreamingRecognizeRequest) error + Recv() (*StreamingRecognizeResponse, error) + grpc.ClientStream +} + +type speechStreamingRecognizeClient struct { + grpc.ClientStream +} + +func (x *speechStreamingRecognizeClient) Send(m *StreamingRecognizeRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *speechStreamingRecognizeClient) Recv() (*StreamingRecognizeResponse, error) { + m := new(StreamingRecognizeResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// Server API for Speech service + +type SpeechServer interface { + // Performs synchronous speech recognition: receive results after all audio + // has been sent and processed. + Recognize(context.Context, *RecognizeRequest) (*RecognizeResponse, error) + // Performs asynchronous speech recognition: receive results via the + // google.longrunning.Operations interface. Returns either an + // `Operation.error` or an `Operation.response` which contains + // a `LongRunningRecognizeResponse` message. + LongRunningRecognize(context.Context, *LongRunningRecognizeRequest) (*google_longrunning.Operation, error) + // Performs bidirectional streaming speech recognition: receive results while + // sending audio. This method is only available via the gRPC API (not REST). + StreamingRecognize(Speech_StreamingRecognizeServer) error +} + +func RegisterSpeechServer(s *grpc.Server, srv SpeechServer) { + s.RegisterService(&_Speech_serviceDesc, srv) +} + +func _Speech_Recognize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RecognizeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SpeechServer).Recognize(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.speech.v1.Speech/Recognize", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SpeechServer).Recognize(ctx, req.(*RecognizeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Speech_LongRunningRecognize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LongRunningRecognizeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SpeechServer).LongRunningRecognize(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.speech.v1.Speech/LongRunningRecognize", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SpeechServer).LongRunningRecognize(ctx, req.(*LongRunningRecognizeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Speech_StreamingRecognize_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(SpeechServer).StreamingRecognize(&speechStreamingRecognizeServer{stream}) +} + +type Speech_StreamingRecognizeServer interface { + Send(*StreamingRecognizeResponse) error + Recv() (*StreamingRecognizeRequest, error) + grpc.ServerStream +} + +type speechStreamingRecognizeServer struct { + grpc.ServerStream +} + +func (x *speechStreamingRecognizeServer) Send(m *StreamingRecognizeResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *speechStreamingRecognizeServer) Recv() (*StreamingRecognizeRequest, error) { + m := new(StreamingRecognizeRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +var _Speech_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.cloud.speech.v1.Speech", + HandlerType: (*SpeechServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Recognize", + Handler: _Speech_Recognize_Handler, + }, + { + MethodName: "LongRunningRecognize", + Handler: _Speech_LongRunningRecognize_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "StreamingRecognize", + Handler: _Speech_StreamingRecognize_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "google/cloud/speech/v1/cloud_speech.proto", +} + +func init() { proto.RegisterFile("google/cloud/speech/v1/cloud_speech.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 1318 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0x4d, 0x6f, 0x1b, 0x45, + 0x18, 0xce, 0xc6, 0x71, 0x3e, 0xde, 0xe6, 0xc3, 0x19, 0x4a, 0xeb, 0xb8, 0xa1, 0x8d, 0xb6, 0x54, + 0x24, 0x3d, 0xd8, 0x24, 0xad, 0x5a, 0x28, 0x08, 0xc9, 0x71, 0x36, 0x89, 0x25, 0xc7, 0x89, 0xc6, + 0x0e, 0x29, 0x1c, 0x18, 0x4d, 0xec, 0xf1, 0x76, 0x25, 0x7b, 0x76, 0x99, 0x19, 0x87, 0xa6, 0x17, + 0x04, 0x57, 0x24, 0x2e, 0x88, 0x9e, 0x39, 0xf5, 0xca, 0x81, 0x0b, 0xbf, 0x81, 0x23, 0xfc, 0x05, + 0x7e, 0x04, 0x47, 0x34, 0x33, 0xbb, 0x8e, 0xed, 0xc4, 0x69, 0x2a, 0x15, 0x89, 0xdb, 0xce, 0xf3, + 0x7e, 0xcc, 0x33, 0xef, 0xbc, 0x1f, 0xb3, 0xb0, 0xe6, 0x87, 0xa1, 0xdf, 0x66, 0x85, 0x46, 0x3b, + 0xec, 0x36, 0x0b, 0x32, 0x62, 0xac, 0xf1, 0xac, 0x70, 0xb2, 0x6e, 0xd7, 0xc4, 0xae, 0xf3, 0x91, + 0x08, 0x55, 0x88, 0x6e, 0x58, 0xd5, 0xbc, 0x11, 0xe5, 0x63, 0xd1, 0xc9, 0x7a, 0x6e, 0x39, 0x76, + 0x41, 0xa3, 0xa0, 0x40, 0x39, 0x0f, 0x15, 0x55, 0x41, 0xc8, 0xa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0x98, 0x1b, 0x38, + 0x27, 0xca, 0xc2, 0x54, 0xf4, 0x4c, 0x50, 0xc9, 0x64, 0xd6, 0x59, 0x49, 0xad, 0xce, 0xe0, 0x64, + 0xe9, 0xe2, 0x5e, 0xfb, 0xeb, 0xd5, 0x37, 0xca, 0xc1, 0x54, 0x52, 0x53, 0x4e, 0x5c, 0x53, 0x09, + 0x80, 0x10, 0xa4, 0xba, 0x22, 0x30, 0xa9, 0x30, 0xb3, 0x3b, 0x86, 0xf5, 0x62, 0x73, 0x1e, 0x6c, + 0xc9, 0x11, 0x19, 0x76, 0x45, 0x83, 0xb9, 0x5f, 0xf5, 0xd2, 0x54, 0xb7, 0x03, 0x19, 0x85, 0x5c, + 0x32, 0x54, 0x86, 0xa9, 0x24, 0xbb, 0xc7, 0xcd, 0x15, 0x15, 0x2e, 0xbf, 0xa2, 0x3e, 0x56, 0x36, + 0xff, 0x71, 0x62, 0xef, 0x06, 0xb0, 0x7c, 0x71, 0x6b, 0x7c, 0xfb, 0x5b, 0xfd, 0xe1, 0x5c, 0xbc, + 0xd7, 0x1e, 0x53, 0xb4, 0x49, 0x15, 0x8d, 0x93, 0xd5, 0x17, 0x4c, 0x4a, 0x12, 0x31, 0xd1, 0x48, + 0x82, 0x96, 0x36, 0xc9, 0x6a, 0xf0, 0x03, 0x0b, 0xa3, 0x8f, 0x01, 0xa4, 0xa2, 0x42, 0x99, 0xb4, + 0x8a, 0x9b, 0x6e, 0x2e, 0x61, 0x96, 0x4c, 0xae, 0x7c, 0x3d, 0x99, 0x5c, 0x78, 0xc6, 0x68, 0xeb, + 0x35, 0xda, 0x82, 0x4c, 0x9b, 0x4a, 0x45, 0xba, 0x51, 0x53, 0x97, 0xa3, 0x71, 0x90, 0x7a, 0xad, + 0x83, 0x79, 0x6d, 0x73, 0x68, 0x4c, 0x34, 0xe8, 0xfe, 0x39, 0x7e, 0xbe, 0xeb, 0xf5, 0x85, 0x6d, + 0x15, 0xd2, 0x4c, 0x88, 0x50, 0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0xc9, + 0xac, 0x3a, 0x1f, 0x3a, 0x9b, 0x6d, 0xc8, 0x35, 0xc2, 0xce, 0x08, 0xe3, 0xcd, 0x6b, 0xf6, 0x0e, + 0x0f, 0xf4, 0xe5, 0x1f, 0x38, 0x5f, 0x7e, 0x1a, 0xab, 0xf9, 0xa1, 0x7e, 0x16, 0xe5, 0x43, 0xe1, + 0x17, 0x7c, 0xc6, 0x4d, 0x6a, 0x14, 0xac, 0x88, 0x46, 0x81, 0x1c, 0xfe, 0x03, 0xfb, 0xc4, 0x7e, + 0xfd, 0xe3, 0x38, 0xc7, 0x93, 0x46, 0xf7, 0xc1, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x52, 0x28, + 0xae, 0xd1, 0xac, 0x0d, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/speech/v1beta1/cloud_speech.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/speech/v1beta1/cloud_speech.pb.go new file mode 100644 index 0000000000..178a930759 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/speech/v1beta1/cloud_speech.pb.go @@ -0,0 +1,1195 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/speech/v1beta1/cloud_speech.proto + +/* +Package speech is a generated protocol buffer package. + +It is generated from these files: + google/cloud/speech/v1beta1/cloud_speech.proto + +It has these top-level messages: + SyncRecognizeRequest + AsyncRecognizeRequest + StreamingRecognizeRequest + StreamingRecognitionConfig + RecognitionConfig + SpeechContext + RecognitionAudio + SyncRecognizeResponse + AsyncRecognizeResponse + AsyncRecognizeMetadata + StreamingRecognizeResponse + StreamingRecognitionResult + SpeechRecognitionResult + SpeechRecognitionAlternative +*/ +package speech + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_longrunning "google.golang.org/genproto/googleapis/longrunning" +import _ "github.com/golang/protobuf/ptypes/duration" +import google_protobuf4 "github.com/golang/protobuf/ptypes/timestamp" +import google_rpc "google.golang.org/genproto/googleapis/rpc/status" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Audio encoding of the data sent in the audio message. All encodings support +// only 1 channel (mono) audio. Only `FLAC` includes a header that describes +// the bytes of audio that follow the header. The other encodings are raw +// audio bytes with no header. +// +// For best results, the audio source should be captured and transmitted using +// a lossless encoding (`FLAC` or `LINEAR16`). Recognition accuracy may be +// reduced if lossy codecs (such as AMR, AMR_WB and MULAW) are used to capture +// or transmit the audio, particularly if background noise is present. +type RecognitionConfig_AudioEncoding int32 + +const ( + // Not specified. Will return result [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + RecognitionConfig_ENCODING_UNSPECIFIED RecognitionConfig_AudioEncoding = 0 + // Uncompressed 16-bit signed little-endian samples (Linear PCM). + // This is the only encoding that may be used by `AsyncRecognize`. + RecognitionConfig_LINEAR16 RecognitionConfig_AudioEncoding = 1 + // This is the recommended encoding for `SyncRecognize` and + // `StreamingRecognize` because it uses lossless compression; therefore + // recognition accuracy is not compromised by a lossy codec. + // + // The stream FLAC (Free Lossless Audio Codec) encoding is specified at: + // http://flac.sourceforge.net/documentation.html. + // 16-bit and 24-bit samples are supported. + // Not all fields in STREAMINFO are supported. + RecognitionConfig_FLAC RecognitionConfig_AudioEncoding = 2 + // 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. + RecognitionConfig_MULAW RecognitionConfig_AudioEncoding = 3 + // Adaptive Multi-Rate Narrowband codec. `sample_rate` must be 8000 Hz. + RecognitionConfig_AMR RecognitionConfig_AudioEncoding = 4 + // Adaptive Multi-Rate Wideband codec. `sample_rate` must be 16000 Hz. + RecognitionConfig_AMR_WB RecognitionConfig_AudioEncoding = 5 +) + +var RecognitionConfig_AudioEncoding_name = map[int32]string{ + 0: "ENCODING_UNSPECIFIED", + 1: "LINEAR16", + 2: "FLAC", + 3: "MULAW", + 4: "AMR", + 5: "AMR_WB", +} +var RecognitionConfig_AudioEncoding_value = map[string]int32{ + "ENCODING_UNSPECIFIED": 0, + "LINEAR16": 1, + "FLAC": 2, + "MULAW": 3, + "AMR": 4, + "AMR_WB": 5, +} + +func (x RecognitionConfig_AudioEncoding) String() string { + return proto.EnumName(RecognitionConfig_AudioEncoding_name, int32(x)) +} +func (RecognitionConfig_AudioEncoding) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{4, 0} +} + +// Indicates the type of endpointer event. +type StreamingRecognizeResponse_EndpointerType int32 + +const ( + // No endpointer event specified. + StreamingRecognizeResponse_ENDPOINTER_EVENT_UNSPECIFIED StreamingRecognizeResponse_EndpointerType = 0 + // Speech has been detected in the audio stream, and the service is + // beginning to process it. + StreamingRecognizeResponse_START_OF_SPEECH StreamingRecognizeResponse_EndpointerType = 1 + // Speech has ceased to be detected in the audio stream. (For example, the + // user may have paused after speaking.) If `single_utterance` is `false`, + // the service will continue to process audio, and if subsequent speech is + // detected, will send another START_OF_SPEECH event. + StreamingRecognizeResponse_END_OF_SPEECH StreamingRecognizeResponse_EndpointerType = 2 + // This event is sent after the client has half-closed the input stream gRPC + // connection and the server has received all of the audio. (The server may + // still be processing the audio and may subsequently return additional + // results.) + StreamingRecognizeResponse_END_OF_AUDIO StreamingRecognizeResponse_EndpointerType = 3 + // This event is only sent when `single_utterance` is `true`. It indicates + // that the server has detected the end of the user's speech utterance and + // expects no additional speech. Therefore, the server will not process + // additional audio (although it may subsequently return additional + // results). The client should stop sending additional audio data, + // half-close the gRPC connection, and wait for any additional results + // until the server closes the gRPC connection. + StreamingRecognizeResponse_END_OF_UTTERANCE StreamingRecognizeResponse_EndpointerType = 4 +) + +var StreamingRecognizeResponse_EndpointerType_name = map[int32]string{ + 0: "ENDPOINTER_EVENT_UNSPECIFIED", + 1: "START_OF_SPEECH", + 2: "END_OF_SPEECH", + 3: "END_OF_AUDIO", + 4: "END_OF_UTTERANCE", +} +var StreamingRecognizeResponse_EndpointerType_value = map[string]int32{ + "ENDPOINTER_EVENT_UNSPECIFIED": 0, + "START_OF_SPEECH": 1, + "END_OF_SPEECH": 2, + "END_OF_AUDIO": 3, + "END_OF_UTTERANCE": 4, +} + +func (x StreamingRecognizeResponse_EndpointerType) String() string { + return proto.EnumName(StreamingRecognizeResponse_EndpointerType_name, int32(x)) +} +func (StreamingRecognizeResponse_EndpointerType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{10, 0} +} + +// The top-level message sent by the client for the `SyncRecognize` method. +type SyncRecognizeRequest struct { + // *Required* Provides information to the recognizer that specifies how to + // process the request. + Config *RecognitionConfig `protobuf:"bytes,1,opt,name=config" json:"config,omitempty"` + // *Required* The audio data to be recognized. + Audio *RecognitionAudio `protobuf:"bytes,2,opt,name=audio" json:"audio,omitempty"` +} + +func (m *SyncRecognizeRequest) Reset() { *m = SyncRecognizeRequest{} } +func (m *SyncRecognizeRequest) String() string { return proto.CompactTextString(m) } +func (*SyncRecognizeRequest) ProtoMessage() {} +func (*SyncRecognizeRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *SyncRecognizeRequest) GetConfig() *RecognitionConfig { + if m != nil { + return m.Config + } + return nil +} + +func (m *SyncRecognizeRequest) GetAudio() *RecognitionAudio { + if m != nil { + return m.Audio + } + return nil +} + +// The top-level message sent by the client for the `AsyncRecognize` method. +type AsyncRecognizeRequest struct { + // *Required* Provides information to the recognizer that specifies how to + // process the request. + Config *RecognitionConfig `protobuf:"bytes,1,opt,name=config" json:"config,omitempty"` + // *Required* The audio data to be recognized. + Audio *RecognitionAudio `protobuf:"bytes,2,opt,name=audio" json:"audio,omitempty"` +} + +func (m *AsyncRecognizeRequest) Reset() { *m = AsyncRecognizeRequest{} } +func (m *AsyncRecognizeRequest) String() string { return proto.CompactTextString(m) } +func (*AsyncRecognizeRequest) ProtoMessage() {} +func (*AsyncRecognizeRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *AsyncRecognizeRequest) GetConfig() *RecognitionConfig { + if m != nil { + return m.Config + } + return nil +} + +func (m *AsyncRecognizeRequest) GetAudio() *RecognitionAudio { + if m != nil { + return m.Audio + } + return nil +} + +// The top-level message sent by the client for the `StreamingRecognize` method. +// Multiple `StreamingRecognizeRequest` messages are sent. The first message +// must contain a `streaming_config` message and must not contain `audio` data. +// All subsequent messages must contain `audio` data and must not contain a +// `streaming_config` message. +type StreamingRecognizeRequest struct { + // The streaming request, which is either a streaming config or audio content. + // + // Types that are valid to be assigned to StreamingRequest: + // *StreamingRecognizeRequest_StreamingConfig + // *StreamingRecognizeRequest_AudioContent + StreamingRequest isStreamingRecognizeRequest_StreamingRequest `protobuf_oneof:"streaming_request"` +} + +func (m *StreamingRecognizeRequest) Reset() { *m = StreamingRecognizeRequest{} } +func (m *StreamingRecognizeRequest) String() string { return proto.CompactTextString(m) } +func (*StreamingRecognizeRequest) ProtoMessage() {} +func (*StreamingRecognizeRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +type isStreamingRecognizeRequest_StreamingRequest interface { + isStreamingRecognizeRequest_StreamingRequest() +} + +type StreamingRecognizeRequest_StreamingConfig struct { + StreamingConfig *StreamingRecognitionConfig `protobuf:"bytes,1,opt,name=streaming_config,json=streamingConfig,oneof"` +} +type StreamingRecognizeRequest_AudioContent struct { + AudioContent []byte `protobuf:"bytes,2,opt,name=audio_content,json=audioContent,proto3,oneof"` +} + +func (*StreamingRecognizeRequest_StreamingConfig) isStreamingRecognizeRequest_StreamingRequest() {} +func (*StreamingRecognizeRequest_AudioContent) isStreamingRecognizeRequest_StreamingRequest() {} + +func (m *StreamingRecognizeRequest) GetStreamingRequest() isStreamingRecognizeRequest_StreamingRequest { + if m != nil { + return m.StreamingRequest + } + return nil +} + +func (m *StreamingRecognizeRequest) GetStreamingConfig() *StreamingRecognitionConfig { + if x, ok := m.GetStreamingRequest().(*StreamingRecognizeRequest_StreamingConfig); ok { + return x.StreamingConfig + } + return nil +} + +func (m *StreamingRecognizeRequest) GetAudioContent() []byte { + if x, ok := m.GetStreamingRequest().(*StreamingRecognizeRequest_AudioContent); ok { + return x.AudioContent + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*StreamingRecognizeRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _StreamingRecognizeRequest_OneofMarshaler, _StreamingRecognizeRequest_OneofUnmarshaler, _StreamingRecognizeRequest_OneofSizer, []interface{}{ + (*StreamingRecognizeRequest_StreamingConfig)(nil), + (*StreamingRecognizeRequest_AudioContent)(nil), + } +} + +func _StreamingRecognizeRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*StreamingRecognizeRequest) + // streaming_request + switch x := m.StreamingRequest.(type) { + case *StreamingRecognizeRequest_StreamingConfig: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.StreamingConfig); err != nil { + return err + } + case *StreamingRecognizeRequest_AudioContent: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeRawBytes(x.AudioContent) + case nil: + default: + return fmt.Errorf("StreamingRecognizeRequest.StreamingRequest has unexpected type %T", x) + } + return nil +} + +func _StreamingRecognizeRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*StreamingRecognizeRequest) + switch tag { + case 1: // streaming_request.streaming_config + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(StreamingRecognitionConfig) + err := b.DecodeMessage(msg) + m.StreamingRequest = &StreamingRecognizeRequest_StreamingConfig{msg} + return true, err + case 2: // streaming_request.audio_content + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.StreamingRequest = &StreamingRecognizeRequest_AudioContent{x} + return true, err + default: + return false, nil + } +} + +func _StreamingRecognizeRequest_OneofSizer(msg proto.Message) (n int) { + m := msg.(*StreamingRecognizeRequest) + // streaming_request + switch x := m.StreamingRequest.(type) { + case *StreamingRecognizeRequest_StreamingConfig: + s := proto.Size(x.StreamingConfig) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *StreamingRecognizeRequest_AudioContent: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.AudioContent))) + n += len(x.AudioContent) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Provides information to the recognizer that specifies how to process the +// request. +type StreamingRecognitionConfig struct { + // *Required* Provides information to the recognizer that specifies how to + // process the request. + Config *RecognitionConfig `protobuf:"bytes,1,opt,name=config" json:"config,omitempty"` + // *Optional* If `false` or omitted, the recognizer will perform continuous + // recognition (continuing to wait for and process audio even if the user + // pauses speaking) until the client closes the input stream (gRPC API) or + // until the maximum time limit has been reached. May return multiple + // `StreamingRecognitionResult`s with the `is_final` flag set to `true`. + // + // If `true`, the recognizer will detect a single spoken utterance. When it + // detects that the user has paused or stopped speaking, it will return an + // `END_OF_UTTERANCE` event and cease recognition. It will return no more than + // one `StreamingRecognitionResult` with the `is_final` flag set to `true`. + SingleUtterance bool `protobuf:"varint,2,opt,name=single_utterance,json=singleUtterance" json:"single_utterance,omitempty"` + // *Optional* If `true`, interim results (tentative hypotheses) may be + // returned as they become available (these interim results are indicated with + // the `is_final=false` flag). + // If `false` or omitted, only `is_final=true` result(s) are returned. + InterimResults bool `protobuf:"varint,3,opt,name=interim_results,json=interimResults" json:"interim_results,omitempty"` +} + +func (m *StreamingRecognitionConfig) Reset() { *m = StreamingRecognitionConfig{} } +func (m *StreamingRecognitionConfig) String() string { return proto.CompactTextString(m) } +func (*StreamingRecognitionConfig) ProtoMessage() {} +func (*StreamingRecognitionConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *StreamingRecognitionConfig) GetConfig() *RecognitionConfig { + if m != nil { + return m.Config + } + return nil +} + +func (m *StreamingRecognitionConfig) GetSingleUtterance() bool { + if m != nil { + return m.SingleUtterance + } + return false +} + +func (m *StreamingRecognitionConfig) GetInterimResults() bool { + if m != nil { + return m.InterimResults + } + return false +} + +// Provides information to the recognizer that specifies how to process the +// request. +type RecognitionConfig struct { + // *Required* Encoding of audio data sent in all `RecognitionAudio` messages. + Encoding RecognitionConfig_AudioEncoding `protobuf:"varint,1,opt,name=encoding,enum=google.cloud.speech.v1beta1.RecognitionConfig_AudioEncoding" json:"encoding,omitempty"` + // *Required* Sample rate in Hertz of the audio data sent in all + // `RecognitionAudio` messages. Valid values are: 8000-48000. + // 16000 is optimal. For best results, set the sampling rate of the audio + // source to 16000 Hz. If that's not possible, use the native sample rate of + // the audio source (instead of re-sampling). + SampleRate int32 `protobuf:"varint,2,opt,name=sample_rate,json=sampleRate" json:"sample_rate,omitempty"` + // *Optional* The language of the supplied audio as a BCP-47 language tag. + // Example: "en-GB" https://www.rfc-editor.org/rfc/bcp/bcp47.txt + // If omitted, defaults to "en-US". See + // [Language Support](https://cloud.google.com/speech/docs/languages) + // for a list of the currently supported language codes. + LanguageCode string `protobuf:"bytes,3,opt,name=language_code,json=languageCode" json:"language_code,omitempty"` + // *Optional* Maximum number of recognition hypotheses to be returned. + // Specifically, the maximum number of `SpeechRecognitionAlternative` messages + // within each `SpeechRecognitionResult`. + // The server may return fewer than `max_alternatives`. + // Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of + // one. If omitted, will return a maximum of one. + MaxAlternatives int32 `protobuf:"varint,4,opt,name=max_alternatives,json=maxAlternatives" json:"max_alternatives,omitempty"` + // *Optional* If set to `true`, the server will attempt to filter out + // profanities, replacing all but the initial character in each filtered word + // with asterisks, e.g. "f***". If set to `false` or omitted, profanities + // won't be filtered out. + ProfanityFilter bool `protobuf:"varint,5,opt,name=profanity_filter,json=profanityFilter" json:"profanity_filter,omitempty"` + // *Optional* A means to provide context to assist the speech recognition. + SpeechContext *SpeechContext `protobuf:"bytes,6,opt,name=speech_context,json=speechContext" json:"speech_context,omitempty"` +} + +func (m *RecognitionConfig) Reset() { *m = RecognitionConfig{} } +func (m *RecognitionConfig) String() string { return proto.CompactTextString(m) } +func (*RecognitionConfig) ProtoMessage() {} +func (*RecognitionConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *RecognitionConfig) GetEncoding() RecognitionConfig_AudioEncoding { + if m != nil { + return m.Encoding + } + return RecognitionConfig_ENCODING_UNSPECIFIED +} + +func (m *RecognitionConfig) GetSampleRate() int32 { + if m != nil { + return m.SampleRate + } + return 0 +} + +func (m *RecognitionConfig) GetLanguageCode() string { + if m != nil { + return m.LanguageCode + } + return "" +} + +func (m *RecognitionConfig) GetMaxAlternatives() int32 { + if m != nil { + return m.MaxAlternatives + } + return 0 +} + +func (m *RecognitionConfig) GetProfanityFilter() bool { + if m != nil { + return m.ProfanityFilter + } + return false +} + +func (m *RecognitionConfig) GetSpeechContext() *SpeechContext { + if m != nil { + return m.SpeechContext + } + return nil +} + +// Provides "hints" to the speech recognizer to favor specific words and phrases +// in the results. +type SpeechContext struct { + // *Optional* A list of strings containing words and phrases "hints" so that + // the speech recognition is more likely to recognize them. This can be used + // to improve the accuracy for specific words and phrases, for example, if + // specific commands are typically spoken by the user. This can also be used + // to add additional words to the vocabulary of the recognizer. See + // [usage limits](https://cloud.google.com/speech/limits#content). + Phrases []string `protobuf:"bytes,1,rep,name=phrases" json:"phrases,omitempty"` +} + +func (m *SpeechContext) Reset() { *m = SpeechContext{} } +func (m *SpeechContext) String() string { return proto.CompactTextString(m) } +func (*SpeechContext) ProtoMessage() {} +func (*SpeechContext) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *SpeechContext) GetPhrases() []string { + if m != nil { + return m.Phrases + } + return nil +} + +// Contains audio data in the encoding specified in the `RecognitionConfig`. +// Either `content` or `uri` must be supplied. Supplying both or neither +// returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. See +// [audio limits](https://cloud.google.com/speech/limits#content). +type RecognitionAudio struct { + // The audio source, which is either inline content or a GCS uri. + // + // Types that are valid to be assigned to AudioSource: + // *RecognitionAudio_Content + // *RecognitionAudio_Uri + AudioSource isRecognitionAudio_AudioSource `protobuf_oneof:"audio_source"` +} + +func (m *RecognitionAudio) Reset() { *m = RecognitionAudio{} } +func (m *RecognitionAudio) String() string { return proto.CompactTextString(m) } +func (*RecognitionAudio) ProtoMessage() {} +func (*RecognitionAudio) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +type isRecognitionAudio_AudioSource interface { + isRecognitionAudio_AudioSource() +} + +type RecognitionAudio_Content struct { + Content []byte `protobuf:"bytes,1,opt,name=content,proto3,oneof"` +} +type RecognitionAudio_Uri struct { + Uri string `protobuf:"bytes,2,opt,name=uri,oneof"` +} + +func (*RecognitionAudio_Content) isRecognitionAudio_AudioSource() {} +func (*RecognitionAudio_Uri) isRecognitionAudio_AudioSource() {} + +func (m *RecognitionAudio) GetAudioSource() isRecognitionAudio_AudioSource { + if m != nil { + return m.AudioSource + } + return nil +} + +func (m *RecognitionAudio) GetContent() []byte { + if x, ok := m.GetAudioSource().(*RecognitionAudio_Content); ok { + return x.Content + } + return nil +} + +func (m *RecognitionAudio) GetUri() string { + if x, ok := m.GetAudioSource().(*RecognitionAudio_Uri); ok { + return x.Uri + } + return "" +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*RecognitionAudio) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _RecognitionAudio_OneofMarshaler, _RecognitionAudio_OneofUnmarshaler, _RecognitionAudio_OneofSizer, []interface{}{ + (*RecognitionAudio_Content)(nil), + (*RecognitionAudio_Uri)(nil), + } +} + +func _RecognitionAudio_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*RecognitionAudio) + // audio_source + switch x := m.AudioSource.(type) { + case *RecognitionAudio_Content: + b.EncodeVarint(1<<3 | proto.WireBytes) + b.EncodeRawBytes(x.Content) + case *RecognitionAudio_Uri: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeStringBytes(x.Uri) + case nil: + default: + return fmt.Errorf("RecognitionAudio.AudioSource has unexpected type %T", x) + } + return nil +} + +func _RecognitionAudio_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*RecognitionAudio) + switch tag { + case 1: // audio_source.content + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.AudioSource = &RecognitionAudio_Content{x} + return true, err + case 2: // audio_source.uri + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.AudioSource = &RecognitionAudio_Uri{x} + return true, err + default: + return false, nil + } +} + +func _RecognitionAudio_OneofSizer(msg proto.Message) (n int) { + m := msg.(*RecognitionAudio) + // audio_source + switch x := m.AudioSource.(type) { + case *RecognitionAudio_Content: + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Content))) + n += len(x.Content) + case *RecognitionAudio_Uri: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Uri))) + n += len(x.Uri) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// The only message returned to the client by `SyncRecognize`. method. It +// contains the result as zero or more sequential `SpeechRecognitionResult` +// messages. +type SyncRecognizeResponse struct { + // *Output-only* Sequential list of transcription results corresponding to + // sequential portions of audio. + Results []*SpeechRecognitionResult `protobuf:"bytes,2,rep,name=results" json:"results,omitempty"` +} + +func (m *SyncRecognizeResponse) Reset() { *m = SyncRecognizeResponse{} } +func (m *SyncRecognizeResponse) String() string { return proto.CompactTextString(m) } +func (*SyncRecognizeResponse) ProtoMessage() {} +func (*SyncRecognizeResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *SyncRecognizeResponse) GetResults() []*SpeechRecognitionResult { + if m != nil { + return m.Results + } + return nil +} + +// The only message returned to the client by `AsyncRecognize`. It contains the +// result as zero or more sequential `SpeechRecognitionResult` messages. It is +// included in the `result.response` field of the `Operation` returned by the +// `GetOperation` call of the `google::longrunning::Operations` service. +type AsyncRecognizeResponse struct { + // *Output-only* Sequential list of transcription results corresponding to + // sequential portions of audio. + Results []*SpeechRecognitionResult `protobuf:"bytes,2,rep,name=results" json:"results,omitempty"` +} + +func (m *AsyncRecognizeResponse) Reset() { *m = AsyncRecognizeResponse{} } +func (m *AsyncRecognizeResponse) String() string { return proto.CompactTextString(m) } +func (*AsyncRecognizeResponse) ProtoMessage() {} +func (*AsyncRecognizeResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *AsyncRecognizeResponse) GetResults() []*SpeechRecognitionResult { + if m != nil { + return m.Results + } + return nil +} + +// Describes the progress of a long-running `AsyncRecognize` call. It is +// included in the `metadata` field of the `Operation` returned by the +// `GetOperation` call of the `google::longrunning::Operations` service. +type AsyncRecognizeMetadata struct { + // Approximate percentage of audio processed thus far. Guaranteed to be 100 + // when the audio is fully processed and the results are available. + ProgressPercent int32 `protobuf:"varint,1,opt,name=progress_percent,json=progressPercent" json:"progress_percent,omitempty"` + // Time when the request was received. + StartTime *google_protobuf4.Timestamp `protobuf:"bytes,2,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + // Time of the most recent processing update. + LastUpdateTime *google_protobuf4.Timestamp `protobuf:"bytes,3,opt,name=last_update_time,json=lastUpdateTime" json:"last_update_time,omitempty"` +} + +func (m *AsyncRecognizeMetadata) Reset() { *m = AsyncRecognizeMetadata{} } +func (m *AsyncRecognizeMetadata) String() string { return proto.CompactTextString(m) } +func (*AsyncRecognizeMetadata) ProtoMessage() {} +func (*AsyncRecognizeMetadata) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *AsyncRecognizeMetadata) GetProgressPercent() int32 { + if m != nil { + return m.ProgressPercent + } + return 0 +} + +func (m *AsyncRecognizeMetadata) GetStartTime() *google_protobuf4.Timestamp { + if m != nil { + return m.StartTime + } + return nil +} + +func (m *AsyncRecognizeMetadata) GetLastUpdateTime() *google_protobuf4.Timestamp { + if m != nil { + return m.LastUpdateTime + } + return nil +} + +// `StreamingRecognizeResponse` is the only message returned to the client by +// `StreamingRecognize`. A series of one or more `StreamingRecognizeResponse` +// messages are streamed back to the client. +// +// Here's an example of a series of ten `StreamingRecognizeResponse`s that might +// be returned while processing audio: +// +// 1. endpointer_type: START_OF_SPEECH +// +// 2. results { alternatives { transcript: "tube" } stability: 0.01 } +// result_index: 0 +// +// 3. results { alternatives { transcript: "to be a" } stability: 0.01 } +// result_index: 0 +// +// 4. results { alternatives { transcript: "to be" } stability: 0.9 } +// results { alternatives { transcript: " or not to be" } stability: 0.01 } +// result_index: 0 +// +// 5. results { alternatives { transcript: "to be or not to be" +// confidence: 0.92 } +// alternatives { transcript: "to bee or not to bee" } +// is_final: true } +// result_index: 0 +// +// 6. results { alternatives { transcript: " that's" } stability: 0.01 } +// result_index: 1 +// +// 7. results { alternatives { transcript: " that is" } stability: 0.9 } +// results { alternatives { transcript: " the question" } stability: 0.01 } +// result_index: 1 +// +// 8. endpointer_type: END_OF_SPEECH +// +// 9. results { alternatives { transcript: " that is the question" +// confidence: 0.98 } +// alternatives { transcript: " that was the question" } +// is_final: true } +// result_index: 1 +// +// 10. endpointer_type: END_OF_AUDIO +// +// Notes: +// +// - Only two of the above responses #5 and #9 contain final results, they are +// indicated by `is_final: true`. Concatenating these together generates the +// full transcript: "to be or not to be that is the question". +// +// - The others contain interim `results`. #4 and #7 contain two interim +// `results`, the first portion has a high stability and is less likely to +// change, the second portion has a low stability and is very likely to +// change. A UI designer might choose to show only high stability `results`. +// +// - The specific `stability` and `confidence` values shown above are only for +// illustrative purposes. Actual values may vary. +// +// - The `result_index` indicates the portion of audio that has had final +// results returned, and is no longer being processed. For example, the +// `results` in #6 and later correspond to the portion of audio after +// "to be or not to be". +type StreamingRecognizeResponse struct { + // *Output-only* If set, returns a [google.rpc.Status][google.rpc.Status] message that + // specifies the error for the operation. + Error *google_rpc.Status `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"` + // *Output-only* This repeated list contains zero or more results that + // correspond to consecutive portions of the audio currently being processed. + // It contains zero or one `is_final=true` result (the newly settled portion), + // followed by zero or more `is_final=false` results. + Results []*StreamingRecognitionResult `protobuf:"bytes,2,rep,name=results" json:"results,omitempty"` + // *Output-only* Indicates the lowest index in the `results` array that has + // changed. The repeated `StreamingRecognitionResult` results overwrite past + // results at this index and higher. + ResultIndex int32 `protobuf:"varint,3,opt,name=result_index,json=resultIndex" json:"result_index,omitempty"` + // *Output-only* Indicates the type of endpointer event. + EndpointerType StreamingRecognizeResponse_EndpointerType `protobuf:"varint,4,opt,name=endpointer_type,json=endpointerType,enum=google.cloud.speech.v1beta1.StreamingRecognizeResponse_EndpointerType" json:"endpointer_type,omitempty"` +} + +func (m *StreamingRecognizeResponse) Reset() { *m = StreamingRecognizeResponse{} } +func (m *StreamingRecognizeResponse) String() string { return proto.CompactTextString(m) } +func (*StreamingRecognizeResponse) ProtoMessage() {} +func (*StreamingRecognizeResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *StreamingRecognizeResponse) GetError() *google_rpc.Status { + if m != nil { + return m.Error + } + return nil +} + +func (m *StreamingRecognizeResponse) GetResults() []*StreamingRecognitionResult { + if m != nil { + return m.Results + } + return nil +} + +func (m *StreamingRecognizeResponse) GetResultIndex() int32 { + if m != nil { + return m.ResultIndex + } + return 0 +} + +func (m *StreamingRecognizeResponse) GetEndpointerType() StreamingRecognizeResponse_EndpointerType { + if m != nil { + return m.EndpointerType + } + return StreamingRecognizeResponse_ENDPOINTER_EVENT_UNSPECIFIED +} + +// A streaming speech recognition result corresponding to a portion of the audio +// that is currently being processed. +type StreamingRecognitionResult struct { + // *Output-only* May contain one or more recognition hypotheses (up to the + // maximum specified in `max_alternatives`). + Alternatives []*SpeechRecognitionAlternative `protobuf:"bytes,1,rep,name=alternatives" json:"alternatives,omitempty"` + // *Output-only* If `false`, this `StreamingRecognitionResult` represents an + // interim result that may change. If `true`, this is the final time the + // speech service will return this particular `StreamingRecognitionResult`, + // the recognizer will not return any further hypotheses for this portion of + // the transcript and corresponding audio. + IsFinal bool `protobuf:"varint,2,opt,name=is_final,json=isFinal" json:"is_final,omitempty"` + // *Output-only* An estimate of the likelihood that the recognizer will not + // change its guess about this interim result. Values range from 0.0 + // (completely unstable) to 1.0 (completely stable). + // This field is only provided for interim results (`is_final=false`). + // The default of 0.0 is a sentinel value indicating `stability` was not set. + Stability float32 `protobuf:"fixed32,3,opt,name=stability" json:"stability,omitempty"` +} + +func (m *StreamingRecognitionResult) Reset() { *m = StreamingRecognitionResult{} } +func (m *StreamingRecognitionResult) String() string { return proto.CompactTextString(m) } +func (*StreamingRecognitionResult) ProtoMessage() {} +func (*StreamingRecognitionResult) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } + +func (m *StreamingRecognitionResult) GetAlternatives() []*SpeechRecognitionAlternative { + if m != nil { + return m.Alternatives + } + return nil +} + +func (m *StreamingRecognitionResult) GetIsFinal() bool { + if m != nil { + return m.IsFinal + } + return false +} + +func (m *StreamingRecognitionResult) GetStability() float32 { + if m != nil { + return m.Stability + } + return 0 +} + +// A speech recognition result corresponding to a portion of the audio. +type SpeechRecognitionResult struct { + // *Output-only* May contain one or more recognition hypotheses (up to the + // maximum specified in `max_alternatives`). + Alternatives []*SpeechRecognitionAlternative `protobuf:"bytes,1,rep,name=alternatives" json:"alternatives,omitempty"` +} + +func (m *SpeechRecognitionResult) Reset() { *m = SpeechRecognitionResult{} } +func (m *SpeechRecognitionResult) String() string { return proto.CompactTextString(m) } +func (*SpeechRecognitionResult) ProtoMessage() {} +func (*SpeechRecognitionResult) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } + +func (m *SpeechRecognitionResult) GetAlternatives() []*SpeechRecognitionAlternative { + if m != nil { + return m.Alternatives + } + return nil +} + +// Alternative hypotheses (a.k.a. n-best list). +type SpeechRecognitionAlternative struct { + // *Output-only* Transcript text representing the words that the user spoke. + Transcript string `protobuf:"bytes,1,opt,name=transcript" json:"transcript,omitempty"` + // *Output-only* The confidence estimate between 0.0 and 1.0. A higher number + // indicates an estimated greater likelihood that the recognized words are + // correct. This field is typically provided only for the top hypothesis, and + // only for `is_final=true` results. Clients should not rely on the + // `confidence` field as it is not guaranteed to be accurate, or even set, in + // any of the results. + // The default of 0.0 is a sentinel value indicating `confidence` was not set. + Confidence float32 `protobuf:"fixed32,2,opt,name=confidence" json:"confidence,omitempty"` +} + +func (m *SpeechRecognitionAlternative) Reset() { *m = SpeechRecognitionAlternative{} } +func (m *SpeechRecognitionAlternative) String() string { return proto.CompactTextString(m) } +func (*SpeechRecognitionAlternative) ProtoMessage() {} +func (*SpeechRecognitionAlternative) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } + +func (m *SpeechRecognitionAlternative) GetTranscript() string { + if m != nil { + return m.Transcript + } + return "" +} + +func (m *SpeechRecognitionAlternative) GetConfidence() float32 { + if m != nil { + return m.Confidence + } + return 0 +} + +func init() { + proto.RegisterType((*SyncRecognizeRequest)(nil), "google.cloud.speech.v1beta1.SyncRecognizeRequest") + proto.RegisterType((*AsyncRecognizeRequest)(nil), "google.cloud.speech.v1beta1.AsyncRecognizeRequest") + proto.RegisterType((*StreamingRecognizeRequest)(nil), "google.cloud.speech.v1beta1.StreamingRecognizeRequest") + proto.RegisterType((*StreamingRecognitionConfig)(nil), "google.cloud.speech.v1beta1.StreamingRecognitionConfig") + proto.RegisterType((*RecognitionConfig)(nil), "google.cloud.speech.v1beta1.RecognitionConfig") + proto.RegisterType((*SpeechContext)(nil), "google.cloud.speech.v1beta1.SpeechContext") + proto.RegisterType((*RecognitionAudio)(nil), "google.cloud.speech.v1beta1.RecognitionAudio") + proto.RegisterType((*SyncRecognizeResponse)(nil), "google.cloud.speech.v1beta1.SyncRecognizeResponse") + proto.RegisterType((*AsyncRecognizeResponse)(nil), "google.cloud.speech.v1beta1.AsyncRecognizeResponse") + proto.RegisterType((*AsyncRecognizeMetadata)(nil), "google.cloud.speech.v1beta1.AsyncRecognizeMetadata") + proto.RegisterType((*StreamingRecognizeResponse)(nil), "google.cloud.speech.v1beta1.StreamingRecognizeResponse") + proto.RegisterType((*StreamingRecognitionResult)(nil), "google.cloud.speech.v1beta1.StreamingRecognitionResult") + proto.RegisterType((*SpeechRecognitionResult)(nil), "google.cloud.speech.v1beta1.SpeechRecognitionResult") + proto.RegisterType((*SpeechRecognitionAlternative)(nil), "google.cloud.speech.v1beta1.SpeechRecognitionAlternative") + proto.RegisterEnum("google.cloud.speech.v1beta1.RecognitionConfig_AudioEncoding", RecognitionConfig_AudioEncoding_name, RecognitionConfig_AudioEncoding_value) + proto.RegisterEnum("google.cloud.speech.v1beta1.StreamingRecognizeResponse_EndpointerType", StreamingRecognizeResponse_EndpointerType_name, StreamingRecognizeResponse_EndpointerType_value) +} + +// 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 + +// Client API for Speech service + +type SpeechClient interface { + // Performs synchronous speech recognition: receive results after all audio + // has been sent and processed. + SyncRecognize(ctx context.Context, in *SyncRecognizeRequest, opts ...grpc.CallOption) (*SyncRecognizeResponse, error) + // Performs asynchronous speech recognition: receive results via the + // [google.longrunning.Operations] + // (/speech/reference/rest/v1beta1/operations#Operation) + // interface. Returns either an + // `Operation.error` or an `Operation.response` which contains + // an `AsyncRecognizeResponse` message. + AsyncRecognize(ctx context.Context, in *AsyncRecognizeRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Performs bidirectional streaming speech recognition: receive results while + // sending audio. This method is only available via the gRPC API (not REST). + StreamingRecognize(ctx context.Context, opts ...grpc.CallOption) (Speech_StreamingRecognizeClient, error) +} + +type speechClient struct { + cc *grpc.ClientConn +} + +func NewSpeechClient(cc *grpc.ClientConn) SpeechClient { + return &speechClient{cc} +} + +func (c *speechClient) SyncRecognize(ctx context.Context, in *SyncRecognizeRequest, opts ...grpc.CallOption) (*SyncRecognizeResponse, error) { + out := new(SyncRecognizeResponse) + err := grpc.Invoke(ctx, "/google.cloud.speech.v1beta1.Speech/SyncRecognize", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *speechClient) AsyncRecognize(ctx context.Context, in *AsyncRecognizeRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.cloud.speech.v1beta1.Speech/AsyncRecognize", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *speechClient) StreamingRecognize(ctx context.Context, opts ...grpc.CallOption) (Speech_StreamingRecognizeClient, error) { + stream, err := grpc.NewClientStream(ctx, &_Speech_serviceDesc.Streams[0], c.cc, "/google.cloud.speech.v1beta1.Speech/StreamingRecognize", opts...) + if err != nil { + return nil, err + } + x := &speechStreamingRecognizeClient{stream} + return x, nil +} + +type Speech_StreamingRecognizeClient interface { + Send(*StreamingRecognizeRequest) error + Recv() (*StreamingRecognizeResponse, error) + grpc.ClientStream +} + +type speechStreamingRecognizeClient struct { + grpc.ClientStream +} + +func (x *speechStreamingRecognizeClient) Send(m *StreamingRecognizeRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *speechStreamingRecognizeClient) Recv() (*StreamingRecognizeResponse, error) { + m := new(StreamingRecognizeResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// Server API for Speech service + +type SpeechServer interface { + // Performs synchronous speech recognition: receive results after all audio + // has been sent and processed. + SyncRecognize(context.Context, *SyncRecognizeRequest) (*SyncRecognizeResponse, error) + // Performs asynchronous speech recognition: receive results via the + // [google.longrunning.Operations] + // (/speech/reference/rest/v1beta1/operations#Operation) + // interface. Returns either an + // `Operation.error` or an `Operation.response` which contains + // an `AsyncRecognizeResponse` message. + AsyncRecognize(context.Context, *AsyncRecognizeRequest) (*google_longrunning.Operation, error) + // Performs bidirectional streaming speech recognition: receive results while + // sending audio. This method is only available via the gRPC API (not REST). + StreamingRecognize(Speech_StreamingRecognizeServer) error +} + +func RegisterSpeechServer(s *grpc.Server, srv SpeechServer) { + s.RegisterService(&_Speech_serviceDesc, srv) +} + +func _Speech_SyncRecognize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SyncRecognizeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SpeechServer).SyncRecognize(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.speech.v1beta1.Speech/SyncRecognize", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SpeechServer).SyncRecognize(ctx, req.(*SyncRecognizeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Speech_AsyncRecognize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AsyncRecognizeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SpeechServer).AsyncRecognize(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.speech.v1beta1.Speech/AsyncRecognize", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SpeechServer).AsyncRecognize(ctx, req.(*AsyncRecognizeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Speech_StreamingRecognize_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(SpeechServer).StreamingRecognize(&speechStreamingRecognizeServer{stream}) +} + +type Speech_StreamingRecognizeServer interface { + Send(*StreamingRecognizeResponse) error + Recv() (*StreamingRecognizeRequest, error) + grpc.ServerStream +} + +type speechStreamingRecognizeServer struct { + grpc.ServerStream +} + +func (x *speechStreamingRecognizeServer) Send(m *StreamingRecognizeResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *speechStreamingRecognizeServer) Recv() (*StreamingRecognizeRequest, error) { + m := new(StreamingRecognizeRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +var _Speech_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.cloud.speech.v1beta1.Speech", + HandlerType: (*SpeechServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SyncRecognize", + Handler: _Speech_SyncRecognize_Handler, + }, + { + MethodName: "AsyncRecognize", + Handler: _Speech_AsyncRecognize_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "StreamingRecognize", + Handler: _Speech_StreamingRecognize_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "google/cloud/speech/v1beta1/cloud_speech.proto", +} + +func init() { proto.RegisterFile("google/cloud/speech/v1beta1/cloud_speech.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 1214 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0x4d, 0x6f, 0x1b, 0xc5, + 0x1b, 0xcf, 0xda, 0x71, 0x5e, 0x9e, 0xd8, 0xce, 0x76, 0xda, 0xfe, 0xeb, 0xfa, 0x9f, 0xb6, 0x61, + 0x2b, 0x44, 0x5a, 0x89, 0x35, 0x09, 0xa8, 0x55, 0x0b, 0x17, 0xc7, 0x59, 0x13, 0x4b, 0x8d, 0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0x88, 0xe6, 0xa1, 0xd8, 0xdc, 0xc1, 0xf6, 0x2c, 0x02, 0x98, 0x6b, 0xee, + 0x60, 0xff, 0xd9, 0xa6, 0x5d, 0x72, 0xee, 0x41, 0x65, 0x8c, 0x02, 0xaa, 0xc1, 0x7c, 0xfc, 0x5c, + 0x10, 0x49, 0x65, 0xcd, 0x5a, 0x2d, 0xae, 0x2d, 0xe2, 0x5c, 0x74, 0x30, 0xd8, 0x93, 0x2d, 0x88, + 0xea, 0x30, 0x9f, 0x57, 0xbc, 0x95, 0x55, 0x7c, 0x0e, 0x20, 0x04, 0xc5, 0x44, 0x44, 0xfa, 0x92, + 0x16, 0xb7, 0x67, 0x70, 0x2a, 0x6c, 0x56, 0xc1, 0x34, 0x84, 0x2f, 0x79, 0x22, 0x02, 0xea, 0x84, + 0x70, 0x7d, 0x62, 0x0e, 0xca, 0x98, 0x33, 0x49, 0x51, 0x17, 0xe6, 0xf3, 0xd2, 0x2b, 0xac, 0x16, + 0xd7, 0x96, 0x36, 0x3e, 0x78, 0x8d, 0x34, 0x8e, 0xd0, 0x33, 0x15, 0x8a, 0xf3, 0x20, 0xce, 0x73, + 0xf8, 0xdf, 0xe4, 0x28, 0x7b, 0x43, 0x27, 0xfd, 0x66, 0x4d, 0x1e, 0xb5, 0x43, 0x15, 0xe9, 0x13, + 0x45, 0xb2, 0x6a, 0x0a, 0x05, 0x95, 0xd2, 0x8f, 0xa9, 0x08, 0xf2, 0xb4, 0x95, 0x74, 0x35, 0x69, + 0x7c, 0xcf, 0xc0, 0xe8, 0x11, 0x80, 0x54, 0x44, 0x28, 0x3f, 0xdd, 0x29, 0xd9, 0x78, 0xac, 0xe7, + 0xc4, 0xf2, 0x85, 0xe3, 0xf6, 0xf2, 0x85, 0x83, 0x17, 0xb5, 0x75, 0x2a, 0xa3, 0x2d, 0xb0, 0x07, + 0x44, 0x2a, 0x3f, 0x89, 0xfb, 0x44, 0x51, 0x13, 0xa0, 0xf8, 0xb7, 0x01, 0xa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0xf0, 0x1f, 0xf6, 0xfe, 0x9a, 0xf5, 0x9e, 0xb5, + 0x29, 0xe1, 0x4e, 0xc0, 0x87, 0xd3, 0x22, 0x6c, 0x2e, 0x99, 0xab, 0xde, 0x4b, 0xa7, 0xeb, 0x9e, + 0xf5, 0x59, 0x33, 0xb3, 0x0d, 0x79, 0xfa, 0xfc, 0x70, 0xb9, 0x08, 0x1b, 0x21, 0x65, 0x7a, 0xf6, + 0x36, 0x8c, 0x8a, 0xc4, 0x91, 0x7c, 0xe5, 0xdf, 0x9d, 0x0f, 0x8d, 0x78, 0x38, 0xa7, 0xad, 0xdf, + 0xff, 0x2b, 0x00, 0x00, 0xff, 0xff, 0x25, 0x0d, 0x06, 0x48, 0x1b, 0x0d, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/speech/v1p1beta1/cloud_speech.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/speech/v1p1beta1/cloud_speech.pb.go new file mode 100644 index 0000000000..1a65d2eb4a --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/speech/v1p1beta1/cloud_speech.pb.go @@ -0,0 +1,1646 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/speech/v1_1beta1/cloud_speech.proto + +/* +Package speech is a generated protocol buffer package. + +It is generated from these files: + google/cloud/speech/v1_1beta1/cloud_speech.proto + +It has these top-level messages: + RecognizeRequest + LongRunningRecognizeRequest + StreamingRecognizeRequest + StreamingRecognitionConfig + RecognitionConfig + RecognitionMetadata + SpeechContext + RecognitionAudio + RecognizeResponse + LongRunningRecognizeResponse + LongRunningRecognizeMetadata + StreamingRecognizeResponse + StreamingRecognitionResult + SpeechRecognitionResult + SpeechRecognitionAlternative + WordInfo +*/ +package speech + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_longrunning "google.golang.org/genproto/googleapis/longrunning" +import google_protobuf3 "github.com/golang/protobuf/ptypes/duration" +import google_protobuf4 "github.com/golang/protobuf/ptypes/timestamp" +import google_rpc "google.golang.org/genproto/googleapis/rpc/status" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Audio encoding of the data sent in the audio message. All encodings support +// only 1 channel (mono) audio. Only `FLAC` includes a header that describes +// the bytes of audio that follow the header. The other encodings are raw +// audio bytes with no header. +// +// For best results, the audio source should be captured and transmitted using +// a lossless encoding (`FLAC` or `LINEAR16`). Recognition accuracy may be +// reduced if lossy codecs, which include the other codecs listed in +// this section, are used to capture or transmit the audio, particularly if +// background noise is present. +type RecognitionConfig_AudioEncoding int32 + +const ( + // Not specified. Will return result [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + RecognitionConfig_ENCODING_UNSPECIFIED RecognitionConfig_AudioEncoding = 0 + // Uncompressed 16-bit signed little-endian samples (Linear PCM). + RecognitionConfig_LINEAR16 RecognitionConfig_AudioEncoding = 1 + // [`FLAC`](https://xiph.org/flac/documentation.html) (Free Lossless Audio + // Codec) is the recommended encoding because it is + // lossless--therefore recognition is not compromised--and + // requires only about half the bandwidth of `LINEAR16`. `FLAC` stream + // encoding supports 16-bit and 24-bit samples, however, not all fields in + // `STREAMINFO` are supported. + RecognitionConfig_FLAC RecognitionConfig_AudioEncoding = 2 + // 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. + RecognitionConfig_MULAW RecognitionConfig_AudioEncoding = 3 + // Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000. + RecognitionConfig_AMR RecognitionConfig_AudioEncoding = 4 + // Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000. + RecognitionConfig_AMR_WB RecognitionConfig_AudioEncoding = 5 + // Opus encoded audio frames in Ogg container + // ([OggOpus](https://wiki.xiph.org/OggOpus)). + // `sample_rate_hertz` must be 16000. + RecognitionConfig_OGG_OPUS RecognitionConfig_AudioEncoding = 6 + // Although the use of lossy encodings is not recommended, if a very low + // bitrate encoding is required, `OGG_OPUS` is highly preferred over + // Speex encoding. The [Speex](https://speex.org/) encoding supported by + // Cloud Speech API has a header byte in each block, as in MIME type + // `audio/x-speex-with-header-byte`. + // It is a variant of the RTP Speex encoding defined in + // [RFC 5574](https://tools.ietf.org/html/rfc5574). + // The stream is a sequence of blocks, one block per RTP packet. Each block + // starts with a byte containing the length of the block, in bytes, followed + // by one or more frames of Speex data, padded to an integral number of + // bytes (octets) as specified in RFC 5574. In other words, each RTP header + // is replaced with a single byte containing the block length. Only Speex + // wideband is supported. `sample_rate_hertz` must be 16000. + RecognitionConfig_SPEEX_WITH_HEADER_BYTE RecognitionConfig_AudioEncoding = 7 +) + +var RecognitionConfig_AudioEncoding_name = map[int32]string{ + 0: "ENCODING_UNSPECIFIED", + 1: "LINEAR16", + 2: "FLAC", + 3: "MULAW", + 4: "AMR", + 5: "AMR_WB", + 6: "OGG_OPUS", + 7: "SPEEX_WITH_HEADER_BYTE", +} +var RecognitionConfig_AudioEncoding_value = map[string]int32{ + "ENCODING_UNSPECIFIED": 0, + "LINEAR16": 1, + "FLAC": 2, + "MULAW": 3, + "AMR": 4, + "AMR_WB": 5, + "OGG_OPUS": 6, + "SPEEX_WITH_HEADER_BYTE": 7, +} + +func (x RecognitionConfig_AudioEncoding) String() string { + return proto.EnumName(RecognitionConfig_AudioEncoding_name, int32(x)) +} +func (RecognitionConfig_AudioEncoding) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{4, 0} +} + +// Use case categories that the audio recognition request can be described +// by. +type RecognitionMetadata_InteractionType int32 + +const ( + // Use case is either unknown or is something other than one of the other + // values below. + RecognitionMetadata_INTERACTION_TYPE_UNSPECIFIED RecognitionMetadata_InteractionType = 0 + // Multiple people in a conversation or discussion. For example in a + // meeting with two or more people actively participating. Typically + // all the primary people speaking would be in the same room (if not, + // see PHONE_CALL) + RecognitionMetadata_DISCUSSION RecognitionMetadata_InteractionType = 1 + // One or more persons lecturing or presenting to others, mostly + // uninterrupted. + RecognitionMetadata_PRESENTATION RecognitionMetadata_InteractionType = 2 + // A phone-call or video-conference in which two or more people, who are + // not in the same room, are actively participating. + RecognitionMetadata_PHONE_CALL RecognitionMetadata_InteractionType = 3 + // A recorded message intended for another person to listen to. + RecognitionMetadata_VOICEMAIL RecognitionMetadata_InteractionType = 4 + // Professionally produced audio (eg. TV Show, Podcast). + RecognitionMetadata_PROFESSIONALLY_PRODUCED RecognitionMetadata_InteractionType = 5 + // Transcribe spoken questions and queries into text. + RecognitionMetadata_VOICE_SEARCH RecognitionMetadata_InteractionType = 6 + // Transcribe voice commands, such as for controlling a device. + RecognitionMetadata_VOICE_COMMAND RecognitionMetadata_InteractionType = 7 + // Transcribe speech to text to create a written document, such as a + // text-message, email or report. + RecognitionMetadata_DICTATION RecognitionMetadata_InteractionType = 8 +) + +var RecognitionMetadata_InteractionType_name = map[int32]string{ + 0: "INTERACTION_TYPE_UNSPECIFIED", + 1: "DISCUSSION", + 2: "PRESENTATION", + 3: "PHONE_CALL", + 4: "VOICEMAIL", + 5: "PROFESSIONALLY_PRODUCED", + 6: "VOICE_SEARCH", + 7: "VOICE_COMMAND", + 8: "DICTATION", +} +var RecognitionMetadata_InteractionType_value = map[string]int32{ + "INTERACTION_TYPE_UNSPECIFIED": 0, + "DISCUSSION": 1, + "PRESENTATION": 2, + "PHONE_CALL": 3, + "VOICEMAIL": 4, + "PROFESSIONALLY_PRODUCED": 5, + "VOICE_SEARCH": 6, + "VOICE_COMMAND": 7, + "DICTATION": 8, +} + +func (x RecognitionMetadata_InteractionType) String() string { + return proto.EnumName(RecognitionMetadata_InteractionType_name, int32(x)) +} +func (RecognitionMetadata_InteractionType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{5, 0} +} + +// Enumerates the types of capture settings describing an audio file. +type RecognitionMetadata_MicrophoneDistance int32 + +const ( + // Audio type is not known. + RecognitionMetadata_MICROPHONE_DISTANCE_UNSPECIFIED RecognitionMetadata_MicrophoneDistance = 0 + // The audio was captured from a closely placed microphone. Eg. phone, + // dictaphone, or handheld microphone. Generally if there speaker is within + // 1 meter of the microphone. + RecognitionMetadata_NEARFIELD RecognitionMetadata_MicrophoneDistance = 1 + // The speaker if within 3 meters of the microphone. + RecognitionMetadata_MIDFIELD RecognitionMetadata_MicrophoneDistance = 2 + // The speaker is more than 3 meters away from the microphone. + RecognitionMetadata_FARFIELD RecognitionMetadata_MicrophoneDistance = 3 +) + +var RecognitionMetadata_MicrophoneDistance_name = map[int32]string{ + 0: "MICROPHONE_DISTANCE_UNSPECIFIED", + 1: "NEARFIELD", + 2: "MIDFIELD", + 3: "FARFIELD", +} +var RecognitionMetadata_MicrophoneDistance_value = map[string]int32{ + "MICROPHONE_DISTANCE_UNSPECIFIED": 0, + "NEARFIELD": 1, + "MIDFIELD": 2, + "FARFIELD": 3, +} + +func (x RecognitionMetadata_MicrophoneDistance) String() string { + return proto.EnumName(RecognitionMetadata_MicrophoneDistance_name, int32(x)) +} +func (RecognitionMetadata_MicrophoneDistance) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{5, 1} +} + +// The original media the speech was recorded on. +type RecognitionMetadata_OriginalMediaType int32 + +const ( + // Unknown original media type. + RecognitionMetadata_ORIGINAL_MEDIA_TYPE_UNSPECIFIED RecognitionMetadata_OriginalMediaType = 0 + // The speech data is an audio recording. + RecognitionMetadata_AUDIO RecognitionMetadata_OriginalMediaType = 1 + // The speech data originally recorded on a video. + RecognitionMetadata_VIDEO RecognitionMetadata_OriginalMediaType = 2 +) + +var RecognitionMetadata_OriginalMediaType_name = map[int32]string{ + 0: "ORIGINAL_MEDIA_TYPE_UNSPECIFIED", + 1: "AUDIO", + 2: "VIDEO", +} +var RecognitionMetadata_OriginalMediaType_value = map[string]int32{ + "ORIGINAL_MEDIA_TYPE_UNSPECIFIED": 0, + "AUDIO": 1, + "VIDEO": 2, +} + +func (x RecognitionMetadata_OriginalMediaType) String() string { + return proto.EnumName(RecognitionMetadata_OriginalMediaType_name, int32(x)) +} +func (RecognitionMetadata_OriginalMediaType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{5, 2} +} + +// How many speakers expected in the speech to be recognized. +type RecognitionMetadata_NumberOfSpeakers int32 + +const ( + // Unknown number of persons speaking. + RecognitionMetadata_NUMBER_OF_SPEAKERS_UNSPECIFIED RecognitionMetadata_NumberOfSpeakers = 0 + // Only one person is the prominent speaker (ignore background voices). + RecognitionMetadata_ONE_SPEAKER RecognitionMetadata_NumberOfSpeakers = 1 + // Two people are the prominent speakers (transcript should focus + // on the two most prominent speakers). + RecognitionMetadata_TWO_SPEAKERS RecognitionMetadata_NumberOfSpeakers = 2 + // Transcribe all voices. + RecognitionMetadata_MULTIPLE_SPEAKERS RecognitionMetadata_NumberOfSpeakers = 3 +) + +var RecognitionMetadata_NumberOfSpeakers_name = map[int32]string{ + 0: "NUMBER_OF_SPEAKERS_UNSPECIFIED", + 1: "ONE_SPEAKER", + 2: "TWO_SPEAKERS", + 3: "MULTIPLE_SPEAKERS", +} +var RecognitionMetadata_NumberOfSpeakers_value = map[string]int32{ + "NUMBER_OF_SPEAKERS_UNSPECIFIED": 0, + "ONE_SPEAKER": 1, + "TWO_SPEAKERS": 2, + "MULTIPLE_SPEAKERS": 3, +} + +func (x RecognitionMetadata_NumberOfSpeakers) String() string { + return proto.EnumName(RecognitionMetadata_NumberOfSpeakers_name, int32(x)) +} +func (RecognitionMetadata_NumberOfSpeakers) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{5, 3} +} + +// The type of device the speech was recorded with. +type RecognitionMetadata_RecordingDeviceType int32 + +const ( + // The recording device is unknown. + RecognitionMetadata_RECORDING_DEVICE_TYPE_UNSPECIFIED RecognitionMetadata_RecordingDeviceType = 0 + // Speech was recorded on a smartphone. + RecognitionMetadata_SMARTPHONE RecognitionMetadata_RecordingDeviceType = 1 + // Speech was recorded using a personal computer or tablet. + RecognitionMetadata_PC RecognitionMetadata_RecordingDeviceType = 2 + // Speech was recorded over a phone line. + RecognitionMetadata_PHONE_LINE RecognitionMetadata_RecordingDeviceType = 3 + // Speech was recorded in a vehicle. + RecognitionMetadata_VEHICLE RecognitionMetadata_RecordingDeviceType = 4 + // Speech was recorded outdoors. + RecognitionMetadata_OTHER_OUTDOOR_DEVICE RecognitionMetadata_RecordingDeviceType = 5 + // Speech was recorded indoors. + RecognitionMetadata_OTHER_INDOOR_DEVICE RecognitionMetadata_RecordingDeviceType = 6 +) + +var RecognitionMetadata_RecordingDeviceType_name = map[int32]string{ + 0: "RECORDING_DEVICE_TYPE_UNSPECIFIED", + 1: "SMARTPHONE", + 2: "PC", + 3: "PHONE_LINE", + 4: "VEHICLE", + 5: "OTHER_OUTDOOR_DEVICE", + 6: "OTHER_INDOOR_DEVICE", +} +var RecognitionMetadata_RecordingDeviceType_value = map[string]int32{ + "RECORDING_DEVICE_TYPE_UNSPECIFIED": 0, + "SMARTPHONE": 1, + "PC": 2, + "PHONE_LINE": 3, + "VEHICLE": 4, + "OTHER_OUTDOOR_DEVICE": 5, + "OTHER_INDOOR_DEVICE": 6, +} + +func (x RecognitionMetadata_RecordingDeviceType) String() string { + return proto.EnumName(RecognitionMetadata_RecordingDeviceType_name, int32(x)) +} +func (RecognitionMetadata_RecordingDeviceType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{5, 4} +} + +// Indicates the type of speech event. +type StreamingRecognizeResponse_SpeechEventType int32 + +const ( + // No speech event specified. + StreamingRecognizeResponse_SPEECH_EVENT_UNSPECIFIED StreamingRecognizeResponse_SpeechEventType = 0 + // This event indicates that the server has detected the end of the user's + // speech utterance and expects no additional speech. Therefore, the server + // will not process additional audio (although it may subsequently return + // additional results). The client should stop sending additional audio + // data, half-close the gRPC connection, and wait for any additional results + // until the server closes the gRPC connection. This event is only sent if + // `single_utterance` was set to `true`, and is not used otherwise. + StreamingRecognizeResponse_END_OF_SINGLE_UTTERANCE StreamingRecognizeResponse_SpeechEventType = 1 +) + +var StreamingRecognizeResponse_SpeechEventType_name = map[int32]string{ + 0: "SPEECH_EVENT_UNSPECIFIED", + 1: "END_OF_SINGLE_UTTERANCE", +} +var StreamingRecognizeResponse_SpeechEventType_value = map[string]int32{ + "SPEECH_EVENT_UNSPECIFIED": 0, + "END_OF_SINGLE_UTTERANCE": 1, +} + +func (x StreamingRecognizeResponse_SpeechEventType) String() string { + return proto.EnumName(StreamingRecognizeResponse_SpeechEventType_name, int32(x)) +} +func (StreamingRecognizeResponse_SpeechEventType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{11, 0} +} + +// The top-level message sent by the client for the `Recognize` method. +type RecognizeRequest struct { + // *Required* Provides information to the recognizer that specifies how to + // process the request. + Config *RecognitionConfig `protobuf:"bytes,1,opt,name=config" json:"config,omitempty"` + // *Required* The audio data to be recognized. + Audio *RecognitionAudio `protobuf:"bytes,2,opt,name=audio" json:"audio,omitempty"` +} + +func (m *RecognizeRequest) Reset() { *m = RecognizeRequest{} } +func (m *RecognizeRequest) String() string { return proto.CompactTextString(m) } +func (*RecognizeRequest) ProtoMessage() {} +func (*RecognizeRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *RecognizeRequest) GetConfig() *RecognitionConfig { + if m != nil { + return m.Config + } + return nil +} + +func (m *RecognizeRequest) GetAudio() *RecognitionAudio { + if m != nil { + return m.Audio + } + return nil +} + +// The top-level message sent by the client for the `LongRunningRecognize` +// method. +type LongRunningRecognizeRequest struct { + // *Required* Provides information to the recognizer that specifies how to + // process the request. + Config *RecognitionConfig `protobuf:"bytes,1,opt,name=config" json:"config,omitempty"` + // *Required* The audio data to be recognized. + Audio *RecognitionAudio `protobuf:"bytes,2,opt,name=audio" json:"audio,omitempty"` +} + +func (m *LongRunningRecognizeRequest) Reset() { *m = LongRunningRecognizeRequest{} } +func (m *LongRunningRecognizeRequest) String() string { return proto.CompactTextString(m) } +func (*LongRunningRecognizeRequest) ProtoMessage() {} +func (*LongRunningRecognizeRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *LongRunningRecognizeRequest) GetConfig() *RecognitionConfig { + if m != nil { + return m.Config + } + return nil +} + +func (m *LongRunningRecognizeRequest) GetAudio() *RecognitionAudio { + if m != nil { + return m.Audio + } + return nil +} + +// The top-level message sent by the client for the `StreamingRecognize` method. +// Multiple `StreamingRecognizeRequest` messages are sent. The first message +// must contain a `streaming_config` message and must not contain `audio` data. +// All subsequent messages must contain `audio` data and must not contain a +// `streaming_config` message. +type StreamingRecognizeRequest struct { + // The streaming request, which is either a streaming config or audio content. + // + // Types that are valid to be assigned to StreamingRequest: + // *StreamingRecognizeRequest_StreamingConfig + // *StreamingRecognizeRequest_AudioContent + StreamingRequest isStreamingRecognizeRequest_StreamingRequest `protobuf_oneof:"streaming_request"` +} + +func (m *StreamingRecognizeRequest) Reset() { *m = StreamingRecognizeRequest{} } +func (m *StreamingRecognizeRequest) String() string { return proto.CompactTextString(m) } +func (*StreamingRecognizeRequest) ProtoMessage() {} +func (*StreamingRecognizeRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +type isStreamingRecognizeRequest_StreamingRequest interface { + isStreamingRecognizeRequest_StreamingRequest() +} + +type StreamingRecognizeRequest_StreamingConfig struct { + StreamingConfig *StreamingRecognitionConfig `protobuf:"bytes,1,opt,name=streaming_config,json=streamingConfig,oneof"` +} +type StreamingRecognizeRequest_AudioContent struct { + AudioContent []byte `protobuf:"bytes,2,opt,name=audio_content,json=audioContent,proto3,oneof"` +} + +func (*StreamingRecognizeRequest_StreamingConfig) isStreamingRecognizeRequest_StreamingRequest() {} +func (*StreamingRecognizeRequest_AudioContent) isStreamingRecognizeRequest_StreamingRequest() {} + +func (m *StreamingRecognizeRequest) GetStreamingRequest() isStreamingRecognizeRequest_StreamingRequest { + if m != nil { + return m.StreamingRequest + } + return nil +} + +func (m *StreamingRecognizeRequest) GetStreamingConfig() *StreamingRecognitionConfig { + if x, ok := m.GetStreamingRequest().(*StreamingRecognizeRequest_StreamingConfig); ok { + return x.StreamingConfig + } + return nil +} + +func (m *StreamingRecognizeRequest) GetAudioContent() []byte { + if x, ok := m.GetStreamingRequest().(*StreamingRecognizeRequest_AudioContent); ok { + return x.AudioContent + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*StreamingRecognizeRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _StreamingRecognizeRequest_OneofMarshaler, _StreamingRecognizeRequest_OneofUnmarshaler, _StreamingRecognizeRequest_OneofSizer, []interface{}{ + (*StreamingRecognizeRequest_StreamingConfig)(nil), + (*StreamingRecognizeRequest_AudioContent)(nil), + } +} + +func _StreamingRecognizeRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*StreamingRecognizeRequest) + // streaming_request + switch x := m.StreamingRequest.(type) { + case *StreamingRecognizeRequest_StreamingConfig: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.StreamingConfig); err != nil { + return err + } + case *StreamingRecognizeRequest_AudioContent: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeRawBytes(x.AudioContent) + case nil: + default: + return fmt.Errorf("StreamingRecognizeRequest.StreamingRequest has unexpected type %T", x) + } + return nil +} + +func _StreamingRecognizeRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*StreamingRecognizeRequest) + switch tag { + case 1: // streaming_request.streaming_config + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(StreamingRecognitionConfig) + err := b.DecodeMessage(msg) + m.StreamingRequest = &StreamingRecognizeRequest_StreamingConfig{msg} + return true, err + case 2: // streaming_request.audio_content + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.StreamingRequest = &StreamingRecognizeRequest_AudioContent{x} + return true, err + default: + return false, nil + } +} + +func _StreamingRecognizeRequest_OneofSizer(msg proto.Message) (n int) { + m := msg.(*StreamingRecognizeRequest) + // streaming_request + switch x := m.StreamingRequest.(type) { + case *StreamingRecognizeRequest_StreamingConfig: + s := proto.Size(x.StreamingConfig) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *StreamingRecognizeRequest_AudioContent: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.AudioContent))) + n += len(x.AudioContent) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Provides information to the recognizer that specifies how to process the +// request. +type StreamingRecognitionConfig struct { + // *Required* Provides information to the recognizer that specifies how to + // process the request. + Config *RecognitionConfig `protobuf:"bytes,1,opt,name=config" json:"config,omitempty"` + // *Optional* If `false` or omitted, the recognizer will perform continuous + // recognition (continuing to wait for and process audio even if the user + // pauses speaking) until the client closes the input stream (gRPC API) or + // until the maximum time limit has been reached. May return multiple + // `StreamingRecognitionResult`s with the `is_final` flag set to `true`. + // + // If `true`, the recognizer will detect a single spoken utterance. When it + // detects that the user has paused or stopped speaking, it will return an + // `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no + // more than one `StreamingRecognitionResult` with the `is_final` flag set to + // `true`. + SingleUtterance bool `protobuf:"varint,2,opt,name=single_utterance,json=singleUtterance" json:"single_utterance,omitempty"` + // *Optional* If `true`, interim results (tentative hypotheses) may be + // returned as they become available (these interim results are indicated with + // the `is_final=false` flag). + // If `false` or omitted, only `is_final=true` result(s) are returned. + InterimResults bool `protobuf:"varint,3,opt,name=interim_results,json=interimResults" json:"interim_results,omitempty"` +} + +func (m *StreamingRecognitionConfig) Reset() { *m = StreamingRecognitionConfig{} } +func (m *StreamingRecognitionConfig) String() string { return proto.CompactTextString(m) } +func (*StreamingRecognitionConfig) ProtoMessage() {} +func (*StreamingRecognitionConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *StreamingRecognitionConfig) GetConfig() *RecognitionConfig { + if m != nil { + return m.Config + } + return nil +} + +func (m *StreamingRecognitionConfig) GetSingleUtterance() bool { + if m != nil { + return m.SingleUtterance + } + return false +} + +func (m *StreamingRecognitionConfig) GetInterimResults() bool { + if m != nil { + return m.InterimResults + } + return false +} + +// Provides information to the recognizer that specifies how to process the +// request. +type RecognitionConfig struct { + // *Required* Encoding of audio data sent in all `RecognitionAudio` messages. + Encoding RecognitionConfig_AudioEncoding `protobuf:"varint,1,opt,name=encoding,enum=google.cloud.speech.v1p1beta1.RecognitionConfig_AudioEncoding" json:"encoding,omitempty"` + // *Required* Sample rate in Hertz of the audio data sent in all + // `RecognitionAudio` messages. Valid values are: 8000-48000. + // 16000 is optimal. For best results, set the sampling rate of the audio + // source to 16000 Hz. If that's not possible, use the native sample rate of + // the audio source (instead of re-sampling). + SampleRateHertz int32 `protobuf:"varint,2,opt,name=sample_rate_hertz,json=sampleRateHertz" json:"sample_rate_hertz,omitempty"` + // *Required* The language of the supplied audio as a + // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + // Example: "en-US". + // See [Language Support](https://cloud.google.com/speech/docs/languages) + // for a list of the currently supported language codes. + LanguageCode string `protobuf:"bytes,3,opt,name=language_code,json=languageCode" json:"language_code,omitempty"` + // *Optional* Maximum number of recognition hypotheses to be returned. + // Specifically, the maximum number of `SpeechRecognitionAlternative` messages + // within each `SpeechRecognitionResult`. + // The server may return fewer than `max_alternatives`. + // Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of + // one. If omitted, will return a maximum of one. + MaxAlternatives int32 `protobuf:"varint,4,opt,name=max_alternatives,json=maxAlternatives" json:"max_alternatives,omitempty"` + // *Optional* If set to `true`, the server will attempt to filter out + // profanities, replacing all but the initial character in each filtered word + // with asterisks, e.g. "f***". If set to `false` or omitted, profanities + // won't be filtered out. + ProfanityFilter bool `protobuf:"varint,5,opt,name=profanity_filter,json=profanityFilter" json:"profanity_filter,omitempty"` + // *Optional* A means to provide context to assist the speech recognition. + SpeechContexts []*SpeechContext `protobuf:"bytes,6,rep,name=speech_contexts,json=speechContexts" json:"speech_contexts,omitempty"` + // *Optional* If `true`, the top result includes a list of words and + // the start and end time offsets (timestamps) for those words. If + // `false`, no word-level time offset information is returned. The default is + // `false`. + EnableWordTimeOffsets bool `protobuf:"varint,8,opt,name=enable_word_time_offsets,json=enableWordTimeOffsets" json:"enable_word_time_offsets,omitempty"` + // *Optional* If 'true', adds punctuation to recognition result hypotheses. + // This feature is only available in select languages. Setting this for + // requests in other languages has no effect at all. + // The default 'false' value does not add punctuation to result hypotheses. + // NOTE: "This is currently offered as an experimental service, complimentary + // to all users. In the future this may be exclusively available as a + // premium feature." + EnableAutomaticPunctuation bool `protobuf:"varint,11,opt,name=enable_automatic_punctuation,json=enableAutomaticPunctuation" json:"enable_automatic_punctuation,omitempty"` + // *Optional* Metadata regarding this request. + Metadata *RecognitionMetadata `protobuf:"bytes,9,opt,name=metadata" json:"metadata,omitempty"` +} + +func (m *RecognitionConfig) Reset() { *m = RecognitionConfig{} } +func (m *RecognitionConfig) String() string { return proto.CompactTextString(m) } +func (*RecognitionConfig) ProtoMessage() {} +func (*RecognitionConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *RecognitionConfig) GetEncoding() RecognitionConfig_AudioEncoding { + if m != nil { + return m.Encoding + } + return RecognitionConfig_ENCODING_UNSPECIFIED +} + +func (m *RecognitionConfig) GetSampleRateHertz() int32 { + if m != nil { + return m.SampleRateHertz + } + return 0 +} + +func (m *RecognitionConfig) GetLanguageCode() string { + if m != nil { + return m.LanguageCode + } + return "" +} + +func (m *RecognitionConfig) GetMaxAlternatives() int32 { + if m != nil { + return m.MaxAlternatives + } + return 0 +} + +func (m *RecognitionConfig) GetProfanityFilter() bool { + if m != nil { + return m.ProfanityFilter + } + return false +} + +func (m *RecognitionConfig) GetSpeechContexts() []*SpeechContext { + if m != nil { + return m.SpeechContexts + } + return nil +} + +func (m *RecognitionConfig) GetEnableWordTimeOffsets() bool { + if m != nil { + return m.EnableWordTimeOffsets + } + return false +} + +func (m *RecognitionConfig) GetEnableAutomaticPunctuation() bool { + if m != nil { + return m.EnableAutomaticPunctuation + } + return false +} + +func (m *RecognitionConfig) GetMetadata() *RecognitionMetadata { + if m != nil { + return m.Metadata + } + return nil +} + +// Description of audio data to be recognized. +type RecognitionMetadata struct { + // The use case most closely describing the audio content to be recognized. + InteractionType RecognitionMetadata_InteractionType `protobuf:"varint,1,opt,name=interaction_type,json=interactionType,enum=google.cloud.speech.v1p1beta1.RecognitionMetadata_InteractionType" json:"interaction_type,omitempty"` + // The industry vertical to which this speech recognition request most + // closely applies. This is most indicative of the topics contained + // in the audio. Use the 6-digit NAICS code to identify the industry + // vertical - see https://www.naics.com/search/. + IndustryNaicsCodeOfAudio uint32 `protobuf:"varint,3,opt,name=industry_naics_code_of_audio,json=industryNaicsCodeOfAudio" json:"industry_naics_code_of_audio,omitempty"` + // The audio type that most closely describes the audio being recognized. + MicrophoneDistance RecognitionMetadata_MicrophoneDistance `protobuf:"varint,4,opt,name=microphone_distance,json=microphoneDistance,enum=google.cloud.speech.v1p1beta1.RecognitionMetadata_MicrophoneDistance" json:"microphone_distance,omitempty"` + // The original media the speech was recorded on. + OriginalMediaType RecognitionMetadata_OriginalMediaType `protobuf:"varint,5,opt,name=original_media_type,json=originalMediaType,enum=google.cloud.speech.v1p1beta1.RecognitionMetadata_OriginalMediaType" json:"original_media_type,omitempty"` + // How many people are speaking prominently in the audio and expected to be + // recognized. + NumberOfSpeakers RecognitionMetadata_NumberOfSpeakers `protobuf:"varint,6,opt,name=number_of_speakers,json=numberOfSpeakers,enum=google.cloud.speech.v1p1beta1.RecognitionMetadata_NumberOfSpeakers" json:"number_of_speakers,omitempty"` + // The type of device the speech was recorded with. + RecordingDeviceType RecognitionMetadata_RecordingDeviceType `protobuf:"varint,7,opt,name=recording_device_type,json=recordingDeviceType,enum=google.cloud.speech.v1p1beta1.RecognitionMetadata_RecordingDeviceType" json:"recording_device_type,omitempty"` + // The device used to make the recording. Examples 'Nexus 5X' or + // 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or + // 'Cardioid Microphone'. + RecordingDeviceName string `protobuf:"bytes,8,opt,name=recording_device_name,json=recordingDeviceName" json:"recording_device_name,omitempty"` + // Mime type of the original audio file. For example `audio/m4a`, + // `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`. + // A list of possible audio mime types is maintained at + // http://www.iana.org/assignments/media-types/media-types.xhtml#audio + OriginalMimeType string `protobuf:"bytes,9,opt,name=original_mime_type,json=originalMimeType" json:"original_mime_type,omitempty"` + // Obfuscated (privacy-protected) ID of the user, to identify number of + // unique users using the service. + ObfuscatedId int64 `protobuf:"varint,10,opt,name=obfuscated_id,json=obfuscatedId" json:"obfuscated_id,omitempty"` + // Description of the content. Eg. "Recordings of federal supreme court + // hearings from 2012". + AudioTopic string `protobuf:"bytes,11,opt,name=audio_topic,json=audioTopic" json:"audio_topic,omitempty"` +} + +func (m *RecognitionMetadata) Reset() { *m = RecognitionMetadata{} } +func (m *RecognitionMetadata) String() string { return proto.CompactTextString(m) } +func (*RecognitionMetadata) ProtoMessage() {} +func (*RecognitionMetadata) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *RecognitionMetadata) GetInteractionType() RecognitionMetadata_InteractionType { + if m != nil { + return m.InteractionType + } + return RecognitionMetadata_INTERACTION_TYPE_UNSPECIFIED +} + +func (m *RecognitionMetadata) GetIndustryNaicsCodeOfAudio() uint32 { + if m != nil { + return m.IndustryNaicsCodeOfAudio + } + return 0 +} + +func (m *RecognitionMetadata) GetMicrophoneDistance() RecognitionMetadata_MicrophoneDistance { + if m != nil { + return m.MicrophoneDistance + } + return RecognitionMetadata_MICROPHONE_DISTANCE_UNSPECIFIED +} + +func (m *RecognitionMetadata) GetOriginalMediaType() RecognitionMetadata_OriginalMediaType { + if m != nil { + return m.OriginalMediaType + } + return RecognitionMetadata_ORIGINAL_MEDIA_TYPE_UNSPECIFIED +} + +func (m *RecognitionMetadata) GetNumberOfSpeakers() RecognitionMetadata_NumberOfSpeakers { + if m != nil { + return m.NumberOfSpeakers + } + return RecognitionMetadata_NUMBER_OF_SPEAKERS_UNSPECIFIED +} + +func (m *RecognitionMetadata) GetRecordingDeviceType() RecognitionMetadata_RecordingDeviceType { + if m != nil { + return m.RecordingDeviceType + } + return RecognitionMetadata_RECORDING_DEVICE_TYPE_UNSPECIFIED +} + +func (m *RecognitionMetadata) GetRecordingDeviceName() string { + if m != nil { + return m.RecordingDeviceName + } + return "" +} + +func (m *RecognitionMetadata) GetOriginalMimeType() string { + if m != nil { + return m.OriginalMimeType + } + return "" +} + +func (m *RecognitionMetadata) GetObfuscatedId() int64 { + if m != nil { + return m.ObfuscatedId + } + return 0 +} + +func (m *RecognitionMetadata) GetAudioTopic() string { + if m != nil { + return m.AudioTopic + } + return "" +} + +// Provides "hints" to the speech recognizer to favor specific words and phrases +// in the results. +type SpeechContext struct { + // *Optional* A list of strings containing words and phrases "hints" so that + // the speech recognition is more likely to recognize them. This can be used + // to improve the accuracy for specific words and phrases, for example, if + // specific commands are typically spoken by the user. This can also be used + // to add additional words to the vocabulary of the recognizer. See + // [usage limits](https://cloud.google.com/speech/limits#content). + Phrases []string `protobuf:"bytes,1,rep,name=phrases" json:"phrases,omitempty"` +} + +func (m *SpeechContext) Reset() { *m = SpeechContext{} } +func (m *SpeechContext) String() string { return proto.CompactTextString(m) } +func (*SpeechContext) ProtoMessage() {} +func (*SpeechContext) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *SpeechContext) GetPhrases() []string { + if m != nil { + return m.Phrases + } + return nil +} + +// Contains audio data in the encoding specified in the `RecognitionConfig`. +// Either `content` or `uri` must be supplied. Supplying both or neither +// returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. See +// [audio limits](https://cloud.google.com/speech/limits#content). +type RecognitionAudio struct { + // The audio source, which is either inline content or a GCS uri. + // + // Types that are valid to be assigned to AudioSource: + // *RecognitionAudio_Content + // *RecognitionAudio_Uri + AudioSource isRecognitionAudio_AudioSource `protobuf_oneof:"audio_source"` +} + +func (m *RecognitionAudio) Reset() { *m = RecognitionAudio{} } +func (m *RecognitionAudio) String() string { return proto.CompactTextString(m) } +func (*RecognitionAudio) ProtoMessage() {} +func (*RecognitionAudio) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +type isRecognitionAudio_AudioSource interface { + isRecognitionAudio_AudioSource() +} + +type RecognitionAudio_Content struct { + Content []byte `protobuf:"bytes,1,opt,name=content,proto3,oneof"` +} +type RecognitionAudio_Uri struct { + Uri string `protobuf:"bytes,2,opt,name=uri,oneof"` +} + +func (*RecognitionAudio_Content) isRecognitionAudio_AudioSource() {} +func (*RecognitionAudio_Uri) isRecognitionAudio_AudioSource() {} + +func (m *RecognitionAudio) GetAudioSource() isRecognitionAudio_AudioSource { + if m != nil { + return m.AudioSource + } + return nil +} + +func (m *RecognitionAudio) GetContent() []byte { + if x, ok := m.GetAudioSource().(*RecognitionAudio_Content); ok { + return x.Content + } + return nil +} + +func (m *RecognitionAudio) GetUri() string { + if x, ok := m.GetAudioSource().(*RecognitionAudio_Uri); ok { + return x.Uri + } + return "" +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*RecognitionAudio) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _RecognitionAudio_OneofMarshaler, _RecognitionAudio_OneofUnmarshaler, _RecognitionAudio_OneofSizer, []interface{}{ + (*RecognitionAudio_Content)(nil), + (*RecognitionAudio_Uri)(nil), + } +} + +func _RecognitionAudio_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*RecognitionAudio) + // audio_source + switch x := m.AudioSource.(type) { + case *RecognitionAudio_Content: + b.EncodeVarint(1<<3 | proto.WireBytes) + b.EncodeRawBytes(x.Content) + case *RecognitionAudio_Uri: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeStringBytes(x.Uri) + case nil: + default: + return fmt.Errorf("RecognitionAudio.AudioSource has unexpected type %T", x) + } + return nil +} + +func _RecognitionAudio_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*RecognitionAudio) + switch tag { + case 1: // audio_source.content + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.AudioSource = &RecognitionAudio_Content{x} + return true, err + case 2: // audio_source.uri + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.AudioSource = &RecognitionAudio_Uri{x} + return true, err + default: + return false, nil + } +} + +func _RecognitionAudio_OneofSizer(msg proto.Message) (n int) { + m := msg.(*RecognitionAudio) + // audio_source + switch x := m.AudioSource.(type) { + case *RecognitionAudio_Content: + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Content))) + n += len(x.Content) + case *RecognitionAudio_Uri: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Uri))) + n += len(x.Uri) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// The only message returned to the client by the `Recognize` method. It +// contains the result as zero or more sequential `SpeechRecognitionResult` +// messages. +type RecognizeResponse struct { + // *Output-only* Sequential list of transcription results corresponding to + // sequential portions of audio. + Results []*SpeechRecognitionResult `protobuf:"bytes,2,rep,name=results" json:"results,omitempty"` +} + +func (m *RecognizeResponse) Reset() { *m = RecognizeResponse{} } +func (m *RecognizeResponse) String() string { return proto.CompactTextString(m) } +func (*RecognizeResponse) ProtoMessage() {} +func (*RecognizeResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *RecognizeResponse) GetResults() []*SpeechRecognitionResult { + if m != nil { + return m.Results + } + return nil +} + +// The only message returned to the client by the `LongRunningRecognize` method. +// It contains the result as zero or more sequential `SpeechRecognitionResult` +// messages. It is included in the `result.response` field of the `Operation` +// returned by the `GetOperation` call of the `google::longrunning::Operations` +// service. +type LongRunningRecognizeResponse struct { + // *Output-only* Sequential list of transcription results corresponding to + // sequential portions of audio. + Results []*SpeechRecognitionResult `protobuf:"bytes,2,rep,name=results" json:"results,omitempty"` +} + +func (m *LongRunningRecognizeResponse) Reset() { *m = LongRunningRecognizeResponse{} } +func (m *LongRunningRecognizeResponse) String() string { return proto.CompactTextString(m) } +func (*LongRunningRecognizeResponse) ProtoMessage() {} +func (*LongRunningRecognizeResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *LongRunningRecognizeResponse) GetResults() []*SpeechRecognitionResult { + if m != nil { + return m.Results + } + return nil +} + +// Describes the progress of a long-running `LongRunningRecognize` call. It is +// included in the `metadata` field of the `Operation` returned by the +// `GetOperation` call of the `google::longrunning::Operations` service. +type LongRunningRecognizeMetadata struct { + // Approximate percentage of audio processed thus far. Guaranteed to be 100 + // when the audio is fully processed and the results are available. + ProgressPercent int32 `protobuf:"varint,1,opt,name=progress_percent,json=progressPercent" json:"progress_percent,omitempty"` + // Time when the request was received. + StartTime *google_protobuf4.Timestamp `protobuf:"bytes,2,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + // Time of the most recent processing update. + LastUpdateTime *google_protobuf4.Timestamp `protobuf:"bytes,3,opt,name=last_update_time,json=lastUpdateTime" json:"last_update_time,omitempty"` +} + +func (m *LongRunningRecognizeMetadata) Reset() { *m = LongRunningRecognizeMetadata{} } +func (m *LongRunningRecognizeMetadata) String() string { return proto.CompactTextString(m) } +func (*LongRunningRecognizeMetadata) ProtoMessage() {} +func (*LongRunningRecognizeMetadata) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *LongRunningRecognizeMetadata) GetProgressPercent() int32 { + if m != nil { + return m.ProgressPercent + } + return 0 +} + +func (m *LongRunningRecognizeMetadata) GetStartTime() *google_protobuf4.Timestamp { + if m != nil { + return m.StartTime + } + return nil +} + +func (m *LongRunningRecognizeMetadata) GetLastUpdateTime() *google_protobuf4.Timestamp { + if m != nil { + return m.LastUpdateTime + } + return nil +} + +// `StreamingRecognizeResponse` is the only message returned to the client by +// `StreamingRecognize`. A series of zero or more `StreamingRecognizeResponse` +// messages are streamed back to the client. If there is no recognizable +// audio, and `single_utterance` is set to false, then no messages are streamed +// back to the client. +// +// Here's an example of a series of ten `StreamingRecognizeResponse`s that might +// be returned while processing audio: +// +// 1. results { alternatives { transcript: "tube" } stability: 0.01 } +// +// 2. results { alternatives { transcript: "to be a" } stability: 0.01 } +// +// 3. results { alternatives { transcript: "to be" } stability: 0.9 } +// results { alternatives { transcript: " or not to be" } stability: 0.01 } +// +// 4. results { alternatives { transcript: "to be or not to be" +// confidence: 0.92 } +// alternatives { transcript: "to bee or not to bee" } +// is_final: true } +// +// 5. results { alternatives { transcript: " that's" } stability: 0.01 } +// +// 6. results { alternatives { transcript: " that is" } stability: 0.9 } +// results { alternatives { transcript: " the question" } stability: 0.01 } +// +// 7. results { alternatives { transcript: " that is the question" +// confidence: 0.98 } +// alternatives { transcript: " that was the question" } +// is_final: true } +// +// Notes: +// +// - Only two of the above responses #4 and #7 contain final results; they are +// indicated by `is_final: true`. Concatenating these together generates the +// full transcript: "to be or not to be that is the question". +// +// - The others contain interim `results`. #3 and #6 contain two interim +// `results`: the first portion has a high stability and is less likely to +// change; the second portion has a low stability and is very likely to +// change. A UI designer might choose to show only high stability `results`. +// +// - The specific `stability` and `confidence` values shown above are only for +// illustrative purposes. Actual values may vary. +// +// - In each response, only one of these fields will be set: +// `error`, +// `speech_event_type`, or +// one or more (repeated) `results`. +type StreamingRecognizeResponse struct { + // *Output-only* If set, returns a [google.rpc.Status][google.rpc.Status] message that + // specifies the error for the operation. + Error *google_rpc.Status `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"` + // *Output-only* This repeated list contains zero or more results that + // correspond to consecutive portions of the audio currently being processed. + // It contains zero or more `is_final=false` results followed by zero or one + // `is_final=true` result (the newly settled portion). + Results []*StreamingRecognitionResult `protobuf:"bytes,2,rep,name=results" json:"results,omitempty"` + // *Output-only* Indicates the type of speech event. + SpeechEventType StreamingRecognizeResponse_SpeechEventType `protobuf:"varint,4,opt,name=speech_event_type,json=speechEventType,enum=google.cloud.speech.v1p1beta1.StreamingRecognizeResponse_SpeechEventType" json:"speech_event_type,omitempty"` +} + +func (m *StreamingRecognizeResponse) Reset() { *m = StreamingRecognizeResponse{} } +func (m *StreamingRecognizeResponse) String() string { return proto.CompactTextString(m) } +func (*StreamingRecognizeResponse) ProtoMessage() {} +func (*StreamingRecognizeResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } + +func (m *StreamingRecognizeResponse) GetError() *google_rpc.Status { + if m != nil { + return m.Error + } + return nil +} + +func (m *StreamingRecognizeResponse) GetResults() []*StreamingRecognitionResult { + if m != nil { + return m.Results + } + return nil +} + +func (m *StreamingRecognizeResponse) GetSpeechEventType() StreamingRecognizeResponse_SpeechEventType { + if m != nil { + return m.SpeechEventType + } + return StreamingRecognizeResponse_SPEECH_EVENT_UNSPECIFIED +} + +// A streaming speech recognition result corresponding to a portion of the audio +// that is currently being processed. +type StreamingRecognitionResult struct { + // *Output-only* May contain one or more recognition hypotheses (up to the + // maximum specified in `max_alternatives`). + Alternatives []*SpeechRecognitionAlternative `protobuf:"bytes,1,rep,name=alternatives" json:"alternatives,omitempty"` + // *Output-only* If `false`, this `StreamingRecognitionResult` represents an + // interim result that may change. If `true`, this is the final time the + // speech service will return this particular `StreamingRecognitionResult`, + // the recognizer will not return any further hypotheses for this portion of + // the transcript and corresponding audio. + IsFinal bool `protobuf:"varint,2,opt,name=is_final,json=isFinal" json:"is_final,omitempty"` + // *Output-only* An estimate of the likelihood that the recognizer will not + // change its guess about this interim result. Values range from 0.0 + // (completely unstable) to 1.0 (completely stable). + // This field is only provided for interim results (`is_final=false`). + // The default of 0.0 is a sentinel value indicating `stability` was not set. + Stability float32 `protobuf:"fixed32,3,opt,name=stability" json:"stability,omitempty"` +} + +func (m *StreamingRecognitionResult) Reset() { *m = StreamingRecognitionResult{} } +func (m *StreamingRecognitionResult) String() string { return proto.CompactTextString(m) } +func (*StreamingRecognitionResult) ProtoMessage() {} +func (*StreamingRecognitionResult) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } + +func (m *StreamingRecognitionResult) GetAlternatives() []*SpeechRecognitionAlternative { + if m != nil { + return m.Alternatives + } + return nil +} + +func (m *StreamingRecognitionResult) GetIsFinal() bool { + if m != nil { + return m.IsFinal + } + return false +} + +func (m *StreamingRecognitionResult) GetStability() float32 { + if m != nil { + return m.Stability + } + return 0 +} + +// A speech recognition result corresponding to a portion of the audio. +type SpeechRecognitionResult struct { + // *Output-only* May contain one or more recognition hypotheses (up to the + // maximum specified in `max_alternatives`). + // These alternatives are ordered in terms of accuracy, with the top (first) + // alternative being the most probable, as ranked by the recognizer. + Alternatives []*SpeechRecognitionAlternative `protobuf:"bytes,1,rep,name=alternatives" json:"alternatives,omitempty"` +} + +func (m *SpeechRecognitionResult) Reset() { *m = SpeechRecognitionResult{} } +func (m *SpeechRecognitionResult) String() string { return proto.CompactTextString(m) } +func (*SpeechRecognitionResult) ProtoMessage() {} +func (*SpeechRecognitionResult) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } + +func (m *SpeechRecognitionResult) GetAlternatives() []*SpeechRecognitionAlternative { + if m != nil { + return m.Alternatives + } + return nil +} + +// Alternative hypotheses (a.k.a. n-best list). +type SpeechRecognitionAlternative struct { + // *Output-only* Transcript text representing the words that the user spoke. + Transcript string `protobuf:"bytes,1,opt,name=transcript" json:"transcript,omitempty"` + // *Output-only* The confidence estimate between 0.0 and 1.0. A higher number + // indicates an estimated greater likelihood that the recognized words are + // correct. This field is typically provided only for the top hypothesis, and + // only for `is_final=true` results. Clients should not rely on the + // `confidence` field as it is not guaranteed to be accurate, or even set, in + // any of the results. + // The default of 0.0 is a sentinel value indicating `confidence` was not set. + Confidence float32 `protobuf:"fixed32,2,opt,name=confidence" json:"confidence,omitempty"` + // *Output-only* A list of word-specific information for each recognized word. + Words []*WordInfo `protobuf:"bytes,3,rep,name=words" json:"words,omitempty"` +} + +func (m *SpeechRecognitionAlternative) Reset() { *m = SpeechRecognitionAlternative{} } +func (m *SpeechRecognitionAlternative) String() string { return proto.CompactTextString(m) } +func (*SpeechRecognitionAlternative) ProtoMessage() {} +func (*SpeechRecognitionAlternative) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } + +func (m *SpeechRecognitionAlternative) GetTranscript() string { + if m != nil { + return m.Transcript + } + return "" +} + +func (m *SpeechRecognitionAlternative) GetConfidence() float32 { + if m != nil { + return m.Confidence + } + return 0 +} + +func (m *SpeechRecognitionAlternative) GetWords() []*WordInfo { + if m != nil { + return m.Words + } + return nil +} + +// Word-specific information for recognized words. Word information is only +// included in the response when certain request parameters are set, such +// as `enable_word_time_offsets`. +type WordInfo struct { + // *Output-only* Time offset relative to the beginning of the audio, + // and corresponding to the start of the spoken word. + // This field is only set if `enable_word_time_offsets=true` and only + // in the top hypothesis. + // This is an experimental feature and the accuracy of the time offset can + // vary. + StartTime *google_protobuf3.Duration `protobuf:"bytes,1,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + // *Output-only* Time offset relative to the beginning of the audio, + // and corresponding to the end of the spoken word. + // This field is only set if `enable_word_time_offsets=true` and only + // in the top hypothesis. + // This is an experimental feature and the accuracy of the time offset can + // vary. + EndTime *google_protobuf3.Duration `protobuf:"bytes,2,opt,name=end_time,json=endTime" json:"end_time,omitempty"` + // *Output-only* The word corresponding to this set of information. + Word string `protobuf:"bytes,3,opt,name=word" json:"word,omitempty"` +} + +func (m *WordInfo) Reset() { *m = WordInfo{} } +func (m *WordInfo) String() string { return proto.CompactTextString(m) } +func (*WordInfo) ProtoMessage() {} +func (*WordInfo) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } + +func (m *WordInfo) GetStartTime() *google_protobuf3.Duration { + if m != nil { + return m.StartTime + } + return nil +} + +func (m *WordInfo) GetEndTime() *google_protobuf3.Duration { + if m != nil { + return m.EndTime + } + return nil +} + +func (m *WordInfo) GetWord() string { + if m != nil { + return m.Word + } + return "" +} + +func init() { + proto.RegisterType((*RecognizeRequest)(nil), "google.cloud.speech.v1p1beta1.RecognizeRequest") + proto.RegisterType((*LongRunningRecognizeRequest)(nil), "google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest") + proto.RegisterType((*StreamingRecognizeRequest)(nil), "google.cloud.speech.v1p1beta1.StreamingRecognizeRequest") + proto.RegisterType((*StreamingRecognitionConfig)(nil), "google.cloud.speech.v1p1beta1.StreamingRecognitionConfig") + proto.RegisterType((*RecognitionConfig)(nil), "google.cloud.speech.v1p1beta1.RecognitionConfig") + proto.RegisterType((*RecognitionMetadata)(nil), "google.cloud.speech.v1p1beta1.RecognitionMetadata") + proto.RegisterType((*SpeechContext)(nil), "google.cloud.speech.v1p1beta1.SpeechContext") + proto.RegisterType((*RecognitionAudio)(nil), "google.cloud.speech.v1p1beta1.RecognitionAudio") + proto.RegisterType((*RecognizeResponse)(nil), "google.cloud.speech.v1p1beta1.RecognizeResponse") + proto.RegisterType((*LongRunningRecognizeResponse)(nil), "google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse") + proto.RegisterType((*LongRunningRecognizeMetadata)(nil), "google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata") + proto.RegisterType((*StreamingRecognizeResponse)(nil), "google.cloud.speech.v1p1beta1.StreamingRecognizeResponse") + proto.RegisterType((*StreamingRecognitionResult)(nil), "google.cloud.speech.v1p1beta1.StreamingRecognitionResult") + proto.RegisterType((*SpeechRecognitionResult)(nil), "google.cloud.speech.v1p1beta1.SpeechRecognitionResult") + proto.RegisterType((*SpeechRecognitionAlternative)(nil), "google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative") + proto.RegisterType((*WordInfo)(nil), "google.cloud.speech.v1p1beta1.WordInfo") + proto.RegisterEnum("google.cloud.speech.v1p1beta1.RecognitionConfig_AudioEncoding", RecognitionConfig_AudioEncoding_name, RecognitionConfig_AudioEncoding_value) + proto.RegisterEnum("google.cloud.speech.v1p1beta1.RecognitionMetadata_InteractionType", RecognitionMetadata_InteractionType_name, RecognitionMetadata_InteractionType_value) + proto.RegisterEnum("google.cloud.speech.v1p1beta1.RecognitionMetadata_MicrophoneDistance", RecognitionMetadata_MicrophoneDistance_name, RecognitionMetadata_MicrophoneDistance_value) + proto.RegisterEnum("google.cloud.speech.v1p1beta1.RecognitionMetadata_OriginalMediaType", RecognitionMetadata_OriginalMediaType_name, RecognitionMetadata_OriginalMediaType_value) + proto.RegisterEnum("google.cloud.speech.v1p1beta1.RecognitionMetadata_NumberOfSpeakers", RecognitionMetadata_NumberOfSpeakers_name, RecognitionMetadata_NumberOfSpeakers_value) + proto.RegisterEnum("google.cloud.speech.v1p1beta1.RecognitionMetadata_RecordingDeviceType", RecognitionMetadata_RecordingDeviceType_name, RecognitionMetadata_RecordingDeviceType_value) + proto.RegisterEnum("google.cloud.speech.v1p1beta1.StreamingRecognizeResponse_SpeechEventType", StreamingRecognizeResponse_SpeechEventType_name, StreamingRecognizeResponse_SpeechEventType_value) +} + +// 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 + +// Client API for Speech service + +type SpeechClient interface { + // Performs synchronous speech recognition: receive results after all audio + // has been sent and processed. + Recognize(ctx context.Context, in *RecognizeRequest, opts ...grpc.CallOption) (*RecognizeResponse, error) + // Performs asynchronous speech recognition: receive results via the + // google.longrunning.Operations interface. Returns either an + // `Operation.error` or an `Operation.response` which contains + // a `LongRunningRecognizeResponse` message. + LongRunningRecognize(ctx context.Context, in *LongRunningRecognizeRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Performs bidirectional streaming speech recognition: receive results while + // sending audio. This method is only available via the gRPC API (not REST). + StreamingRecognize(ctx context.Context, opts ...grpc.CallOption) (Speech_StreamingRecognizeClient, error) +} + +type speechClient struct { + cc *grpc.ClientConn +} + +func NewSpeechClient(cc *grpc.ClientConn) SpeechClient { + return &speechClient{cc} +} + +func (c *speechClient) Recognize(ctx context.Context, in *RecognizeRequest, opts ...grpc.CallOption) (*RecognizeResponse, error) { + out := new(RecognizeResponse) + err := grpc.Invoke(ctx, "/google.cloud.speech.v1p1beta1.Speech/Recognize", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *speechClient) LongRunningRecognize(ctx context.Context, in *LongRunningRecognizeRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.cloud.speech.v1p1beta1.Speech/LongRunningRecognize", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *speechClient) StreamingRecognize(ctx context.Context, opts ...grpc.CallOption) (Speech_StreamingRecognizeClient, error) { + stream, err := grpc.NewClientStream(ctx, &_Speech_serviceDesc.Streams[0], c.cc, "/google.cloud.speech.v1p1beta1.Speech/StreamingRecognize", opts...) + if err != nil { + return nil, err + } + x := &speechStreamingRecognizeClient{stream} + return x, nil +} + +type Speech_StreamingRecognizeClient interface { + Send(*StreamingRecognizeRequest) error + Recv() (*StreamingRecognizeResponse, error) + grpc.ClientStream +} + +type speechStreamingRecognizeClient struct { + grpc.ClientStream +} + +func (x *speechStreamingRecognizeClient) Send(m *StreamingRecognizeRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *speechStreamingRecognizeClient) Recv() (*StreamingRecognizeResponse, error) { + m := new(StreamingRecognizeResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// Server API for Speech service + +type SpeechServer interface { + // Performs synchronous speech recognition: receive results after all audio + // has been sent and processed. + Recognize(context.Context, *RecognizeRequest) (*RecognizeResponse, error) + // Performs asynchronous speech recognition: receive results via the + // google.longrunning.Operations interface. Returns either an + // `Operation.error` or an `Operation.response` which contains + // a `LongRunningRecognizeResponse` message. + LongRunningRecognize(context.Context, *LongRunningRecognizeRequest) (*google_longrunning.Operation, error) + // Performs bidirectional streaming speech recognition: receive results while + // sending audio. This method is only available via the gRPC API (not REST). + StreamingRecognize(Speech_StreamingRecognizeServer) error +} + +func RegisterSpeechServer(s *grpc.Server, srv SpeechServer) { + s.RegisterService(&_Speech_serviceDesc, srv) +} + +func _Speech_Recognize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RecognizeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SpeechServer).Recognize(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.speech.v1p1beta1.Speech/Recognize", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SpeechServer).Recognize(ctx, req.(*RecognizeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Speech_LongRunningRecognize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LongRunningRecognizeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SpeechServer).LongRunningRecognize(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.speech.v1p1beta1.Speech/LongRunningRecognize", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SpeechServer).LongRunningRecognize(ctx, req.(*LongRunningRecognizeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Speech_StreamingRecognize_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(SpeechServer).StreamingRecognize(&speechStreamingRecognizeServer{stream}) +} + +type Speech_StreamingRecognizeServer interface { + Send(*StreamingRecognizeResponse) error + Recv() (*StreamingRecognizeRequest, error) + grpc.ServerStream +} + +type speechStreamingRecognizeServer struct { + grpc.ServerStream +} + +func (x *speechStreamingRecognizeServer) Send(m *StreamingRecognizeResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *speechStreamingRecognizeServer) Recv() (*StreamingRecognizeRequest, error) { + m := new(StreamingRecognizeRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +var _Speech_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.cloud.speech.v1p1beta1.Speech", + HandlerType: (*SpeechServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Recognize", + Handler: _Speech_Recognize_Handler, + }, + { + MethodName: "LongRunningRecognize", + Handler: _Speech_LongRunningRecognize_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "StreamingRecognize", + Handler: _Speech_StreamingRecognize_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "google/cloud/speech/v1_1beta1/cloud_speech.proto", +} + +func init() { proto.RegisterFile("google/cloud/speech/v1_1beta1/cloud_speech.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 2005 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0xbf, 0x73, 0xdb, 0xc8, + 0xf5, 0x37, 0x48, 0x51, 0x12, 0x9f, 0x7e, 0x41, 0xab, 0xf3, 0xd7, 0xb4, 0xac, 0xb3, 0x75, 0xf0, + 0xdc, 0x9d, 0xee, 0xbe, 0x37, 0xa4, 0xa5, 0x64, 0x2e, 0x67, 0xdf, 0xe4, 0x26, 0x10, 0x00, 0x99, + 0x98, 0x90, 0x00, 0x67, 0x49, 0xda, 0xf1, 0x35, 0x3b, 0x10, 0xb8, 0xa4, 0x31, 0x21, 0x01, 0x1c, + 0xb0, 0x50, 0x6c, 0x97, 0x69, 0x33, 0x49, 0x93, 0x99, 0x74, 0xa9, 0x72, 0x75, 0xca, 0x14, 0x69, + 0x52, 0x25, 0x45, 0xda, 0x34, 0x29, 0xaf, 0xc8, 0x1f, 0x91, 0x32, 0xb3, 0xbb, 0x00, 0x45, 0x91, + 0xb2, 0x2d, 0x6b, 0x72, 0x33, 0xe9, 0x88, 0xcf, 0xbe, 0xf7, 0x79, 0x6f, 0xdf, 0xbe, 0x7d, 0x7c, + 0x6f, 0xe1, 0xc1, 0x28, 0x8a, 0x46, 0x63, 0xda, 0xf0, 0xc7, 0x51, 0x36, 0x68, 0xa4, 0x31, 0xa5, + 0xfe, 0xf3, 0xc6, 0xd9, 0x21, 0x39, 0x3c, 0xa5, 0xcc, 0x3b, 0x94, 0x30, 0x91, 0x70, 0x3d, 0x4e, + 0x22, 0x16, 0xa1, 0xf7, 0xa5, 0x46, 0x5d, 0x2c, 0xd5, 0xf3, 0xa5, 0xb3, 0xc3, 0x58, 0x6a, 0xec, + 0xee, 0xe5, 0x84, 0x5e, 0x1c, 0x34, 0xbc, 0x30, 0x8c, 0x98, 0xc7, 0x82, 0x28, 0x4c, 0xa5, 0xf2, + 0xee, 0xfd, 0x7c, 0x75, 0x1c, 0x85, 0xa3, 0x24, 0x0b, 0xc3, 0x20, 0x1c, 0x35, 0xa2, 0x98, 0x26, + 0x17, 0x84, 0xee, 0xe6, 0x42, 0xe2, 0xeb, 0x34, 0x1b, 0x36, 0x06, 0x99, 0x14, 0xc8, 0xd7, 0xef, + 0xcd, 0xaf, 0xb3, 0x60, 0x42, 0x53, 0xe6, 0x4d, 0xe2, 0x5c, 0xe0, 0x56, 0x2e, 0x90, 0xc4, 0x7e, + 0x23, 0x65, 0x1e, 0xcb, 0x72, 0x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bc, + 0x23, 0x61, 0xf4, 0x10, 0x20, 0x65, 0x5e, 0xc2, 0x44, 0x67, 0x93, 0x8f, 0x06, 0xbb, 0x85, 0x83, + 0xc5, 0xd0, 0x55, 0xef, 0x15, 0x43, 0x17, 0xae, 0x0a, 0x69, 0xfe, 0x8d, 0x4c, 0x50, 0xc7, 0x5e, + 0xca, 0x48, 0x16, 0x0f, 0x78, 0x63, 0x28, 0x08, 0xca, 0x6f, 0x25, 0xd8, 0xe4, 0x3a, 0x7d, 0xa1, + 0xc2, 0x41, 0xed, 0xbb, 0xd2, 0x62, 0x37, 0x3e, 0x13, 0xbd, 0x03, 0xa8, 0xd0, 0x24, 0x89, 0x92, + 0xbc, 0x19, 0x47, 0x05, 0x73, 0x12, 0xfb, 0xf5, 0xae, 0x18, 0xf7, 0xb0, 0x14, 0x40, 0xdd, 0xf9, + 0x38, 0x5f, 0x67, 0xe2, 0x98, 0x0b, 0x35, 0xca, 0x60, 0x3b, 0xef, 0x2a, 0xe9, 0x19, 0x0d, 0x99, + 0x2c, 0xe6, 0xf2, 0xcf, 0xdd, 0x7e, 0x47, 0xfa, 0xf3, 0x4d, 0xe5, 0x27, 0x6c, 0x71, 0x46, 0xd9, + 0x95, 0xa4, 0x17, 0x01, 0xad, 0x05, 0x5b, 0x73, 0x32, 0x68, 0x0f, 0x6a, 0xbc, 0x97, 0x32, 0x9a, + 0xc4, 0x7a, 0x62, 0x39, 0xbd, 0xb9, 0x2b, 0x7d, 0x07, 0x6e, 0x59, 0x8e, 0x29, 0x8a, 0x8d, 0xed, + 0x3c, 0x6e, 0x59, 0xa4, 0xdf, 0xe3, 0xb5, 0xdf, 0x31, 0x2c, 0x55, 0xd1, 0xfe, 0xf4, 0x9a, 0x81, + 0x47, 0x6e, 0x16, 0x11, 0x58, 0xbf, 0xd0, 0x8b, 0x2b, 0x22, 0x7a, 0x5f, 0xbe, 0x6b, 0x96, 0xce, + 0x34, 0xee, 0xf8, 0x02, 0x21, 0xba, 0x0d, 0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b7, 0x1e, 0x25, 0x85, + 0xf0, 0x23, 0xe5, 0x53, 0xf4, 0xad, 0x02, 0xef, 0x5d, 0x56, 0x39, 0xd1, 0xa3, 0xb7, 0x98, 0x7c, + 0xc3, 0x13, 0xcd, 0xee, 0xfb, 0x85, 0xee, 0xcc, 0x43, 0x57, 0xdd, 0x2d, 0x1e, 0xba, 0xb4, 0x43, + 0xe1, 0xdb, 0xff, 0x6b, 0x1f, 0x2d, 0xfa, 0x36, 0xa3, 0x70, 0xc1, 0xcd, 0x5f, 0x2b, 0x80, 0x16, + 0xcb, 0x07, 0xfa, 0xe2, 0x1a, 0x15, 0x47, 0xba, 0xf8, 0xf0, 0xda, 0xb5, 0xea, 0x40, 0x79, 0xa0, + 0x1c, 0xbf, 0x82, 0x0f, 0xfc, 0x68, 0xf2, 0x66, 0x8e, 0xe3, 0x35, 0x79, 0xf8, 0x1d, 0x9e, 0x35, + 0x1d, 0xe5, 0x6b, 0x23, 0x97, 0x1e, 0x45, 0x7c, 0xf8, 0xaf, 0x47, 0xc9, 0xa8, 0x31, 0xa2, 0xa1, + 0xc8, 0xa9, 0x86, 0x5c, 0xf2, 0xe2, 0x20, 0x9d, 0x7f, 0x8b, 0xcc, 0xc9, 0xbe, 0x94, 0xc0, 0xbf, + 0x15, 0xe5, 0x74, 0x59, 0xa8, 0xfc, 0xe0, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xdf, 0x32, 0x25, + 0x1e, 0xbd, 0x14, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/support/common/common.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/support/common/common.pb.go new file mode 100644 index 0000000000..b9bbfb8644 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/support/common/common.pb.go @@ -0,0 +1,864 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/support/common.proto + +/* +Package common is a generated protocol buffer package. + +It is generated from these files: + google/cloud/support/common.proto + +It has these top-level messages: + SupportAccount + Case + CustomerIssue + SupportRole + Comment + IssueTaxonomy +*/ +package common + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf1 "github.com/golang/protobuf/ptypes/timestamp" + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// The current state of this SupportAccount. +type SupportAccount_State int32 + +const ( + // Account is in an unknown state. + SupportAccount_STATE_UNSPECIFIED SupportAccount_State = 0 + // Account is in an active state. + SupportAccount_ACTIVE SupportAccount_State = 1 + // Account has been created but is being provisioned in support systems. + SupportAccount_PENDING SupportAccount_State = 2 + // Account deletion has been requested by the user. + SupportAccount_PENDING_DELETION SupportAccount_State = 3 +) + +var SupportAccount_State_name = map[int32]string{ + 0: "STATE_UNSPECIFIED", + 1: "ACTIVE", + 2: "PENDING", + 3: "PENDING_DELETION", +} +var SupportAccount_State_value = map[string]int32{ + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "PENDING": 2, + "PENDING_DELETION": 3, +} + +func (x SupportAccount_State) String() string { + return proto.EnumName(SupportAccount_State_name, int32(x)) +} +func (SupportAccount_State) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 0} } + +// Pricing model applicable to this support account. +type SupportAccount_PricingModel int32 + +const ( + // This account is subscribed to an unknown pricing model. + SupportAccount_PRICING_MODEL_UNKNOWN SupportAccount_PricingModel = 0 + // Package based pricing (Platinum, Gold, Silver, Bronze). + SupportAccount_PACKAGES SupportAccount_PricingModel = 1 + // Support charges are calculated based on user seats a.k.a, + // "Pick Your Team" model. + SupportAccount_USER_ROLES SupportAccount_PricingModel = 2 +) + +var SupportAccount_PricingModel_name = map[int32]string{ + 0: "PRICING_MODEL_UNKNOWN", + 1: "PACKAGES", + 2: "USER_ROLES", +} +var SupportAccount_PricingModel_value = map[string]int32{ + "PRICING_MODEL_UNKNOWN": 0, + "PACKAGES": 1, + "USER_ROLES": 2, +} + +func (x SupportAccount_PricingModel) String() string { + return proto.EnumName(SupportAccount_PricingModel_name, int32(x)) +} +func (SupportAccount_PricingModel) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{0, 1} +} + +// The case priority with P0 being the most urgent and P4 the least. +type Case_Priority int32 + +const ( + // Priority is undefined or has not been set yet. + Case_PRIORITY_UNSPECIFIED Case_Priority = 0 + // Extreme impact on a production service - Service is hard down. + Case_P0 Case_Priority = 1 + // Critical impact on a production service - Service is currently unusable. + Case_P1 Case_Priority = 2 + // Severe impact on a production service - Service is usable but greatly + // impaired. + Case_P2 Case_Priority = 3 + // Medium impact on a production service - Service is available, but + // moderately impaired. + Case_P3 Case_Priority = 4 + // General questions or minor issues - Production service is fully + // available. + Case_P4 Case_Priority = 5 +) + +var Case_Priority_name = map[int32]string{ + 0: "PRIORITY_UNSPECIFIED", + 1: "P0", + 2: "P1", + 3: "P2", + 4: "P3", + 5: "P4", +} +var Case_Priority_value = map[string]int32{ + "PRIORITY_UNSPECIFIED": 0, + "P0": 1, + "P1": 2, + "P2": 3, + "P3": 4, + "P4": 5, +} + +func (x Case_Priority) String() string { + return proto.EnumName(Case_Priority_name, int32(x)) +} +func (Case_Priority) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{1, 0} } + +// The state of a case. +type Case_State int32 + +const ( + // Case is in an unknown state. + Case_STATE_UNSPECIFIED Case_State = 0 + // Case has been created but no one is assigned to work on it yet. + Case_NEW Case_State = 1 + // Case has been assigned to a support agent. + Case_ASSIGNED Case_State = 2 + // A support agent is currently investigating the case. + Case_IN_PROGRESS_GOOGLE_SUPPORT Case_State = 3 + // Case has been forwarded to product team for further investigation. + Case_IN_PROGRESS_GOOGLE_ENG Case_State = 4 + // Case is under investigation and relates to a known issue. + Case_IN_PROGRESS_KNOWN_ISSUE Case_State = 5 + // Case is waiting for a response from the customer. + Case_WAITING_FOR_CUSTOMER_RESPONSE Case_State = 6 + // A solution has been offered for the case but it isn't closed yet. + Case_SOLUTION_OFFERED Case_State = 7 + // Cases has been fully resolved and is in a closed state. + Case_CLOSED Case_State = 8 +) + +var Case_State_name = map[int32]string{ + 0: "STATE_UNSPECIFIED", + 1: "NEW", + 2: "ASSIGNED", + 3: "IN_PROGRESS_GOOGLE_SUPPORT", + 4: "IN_PROGRESS_GOOGLE_ENG", + 5: "IN_PROGRESS_KNOWN_ISSUE", + 6: "WAITING_FOR_CUSTOMER_RESPONSE", + 7: "SOLUTION_OFFERED", + 8: "CLOSED", +} +var Case_State_value = map[string]int32{ + "STATE_UNSPECIFIED": 0, + "NEW": 1, + "ASSIGNED": 2, + "IN_PROGRESS_GOOGLE_SUPPORT": 3, + "IN_PROGRESS_GOOGLE_ENG": 4, + "IN_PROGRESS_KNOWN_ISSUE": 5, + "WAITING_FOR_CUSTOMER_RESPONSE": 6, + "SOLUTION_OFFERED": 7, + "CLOSED": 8, +} + +func (x Case_State) String() string { + return proto.EnumName(Case_State_name, int32(x)) +} +func (Case_State) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{1, 1} } + +// The status of a customer issue. +type CustomerIssue_IssueState int32 + +const ( + // Issue in an unknown state. + CustomerIssue_ISSUE_STATE_UNSPECIFIED CustomerIssue_IssueState = 0 + // Issue is currently open but the work on it has not been started. + CustomerIssue_OPEN CustomerIssue_IssueState = 1 + // Issue is currently being worked on. + CustomerIssue_IN_PROGRESS CustomerIssue_IssueState = 2 + // Issue is fixed. + CustomerIssue_FIXED CustomerIssue_IssueState = 3 + // Issue has been marked as invalid. + CustomerIssue_WONT_FIX CustomerIssue_IssueState = 4 + // Issue verified and in production. + CustomerIssue_VERIFIED CustomerIssue_IssueState = 5 +) + +var CustomerIssue_IssueState_name = map[int32]string{ + 0: "ISSUE_STATE_UNSPECIFIED", + 1: "OPEN", + 2: "IN_PROGRESS", + 3: "FIXED", + 4: "WONT_FIX", + 5: "VERIFIED", +} +var CustomerIssue_IssueState_value = map[string]int32{ + "ISSUE_STATE_UNSPECIFIED": 0, + "OPEN": 1, + "IN_PROGRESS": 2, + "FIXED": 3, + "WONT_FIX": 4, + "VERIFIED": 5, +} + +func (x CustomerIssue_IssueState) String() string { + return proto.EnumName(CustomerIssue_IssueState_name, int32(x)) +} +func (CustomerIssue_IssueState) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{2, 0} } + +// A role which determines the support resources and features a user might +// get access to. +type SupportRole_Role int32 + +const ( + // An unknown role. + SupportRole_ROLE_UNSPECIFIED SupportRole_Role = 0 + // The basic support role. + SupportRole_BASIC SupportRole_Role = 1 + // The developer role. + SupportRole_DEVELOPER SupportRole_Role = 2 + // The operation role. + SupportRole_OPERATION SupportRole_Role = 3 + // The site reliability role. + SupportRole_SITE_RELIABILITY SupportRole_Role = 4 +) + +var SupportRole_Role_name = map[int32]string{ + 0: "ROLE_UNSPECIFIED", + 1: "BASIC", + 2: "DEVELOPER", + 3: "OPERATION", + 4: "SITE_RELIABILITY", +} +var SupportRole_Role_value = map[string]int32{ + "ROLE_UNSPECIFIED": 0, + "BASIC": 1, + "DEVELOPER": 2, + "OPERATION": 3, + "SITE_RELIABILITY": 4, +} + +func (x SupportRole_Role) String() string { + return proto.EnumName(SupportRole_Role_name, int32(x)) +} +func (SupportRole_Role) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{3, 0} } + +// A Google Cloud Platform account that identifies support eligibility for a +// Cloud resource. Currently the Cloud resource can only be an Organization +// but this might change in future. +type SupportAccount struct { + // The resource name for a support account in format + // `supportAccounts/{account_id}`. + // Output only. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Identifier for this entity that gets persisted in storage system. The + // resource name is populated using this field in format + // `supportAccounts/{account_id}`. + AccountId string `protobuf:"bytes,2,opt,name=account_id,json=accountId" json:"account_id,omitempty"` + // The Cloud resource with which this support account is associated. + CloudResource string `protobuf:"bytes,3,opt,name=cloud_resource,json=cloudResource" json:"cloud_resource,omitempty"` + // A user friendly display name assigned to this support account. + DisplayName string `protobuf:"bytes,4,opt,name=display_name,json=displayName" json:"display_name,omitempty"` + // Indicates the current state of an account. + State SupportAccount_State `protobuf:"varint,5,opt,name=state,enum=google.cloud.support.common.SupportAccount_State" json:"state,omitempty"` + // Time when this account was created. + // Output only. + CreateTime *google_protobuf1.Timestamp `protobuf:"bytes,6,opt,name=create_time,json=createTime" json:"create_time,omitempty"` + // The resource name of a billing account associated with this support + // account. For example, `billingAccounts/ABCDEF-012345-567890`. + BillingAccountName string `protobuf:"bytes,7,opt,name=billing_account_name,json=billingAccountName" json:"billing_account_name,omitempty"` + UnifyAccountId string `protobuf:"bytes,8,opt,name=unify_account_id,json=unifyAccountId" json:"unify_account_id,omitempty"` + // The PricingModel applicable to this support account. + PricingModel SupportAccount_PricingModel `protobuf:"varint,9,opt,name=pricing_model,json=pricingModel,enum=google.cloud.support.common.SupportAccount_PricingModel" json:"pricing_model,omitempty"` +} + +func (m *SupportAccount) Reset() { *m = SupportAccount{} } +func (m *SupportAccount) String() string { return proto.CompactTextString(m) } +func (*SupportAccount) ProtoMessage() {} +func (*SupportAccount) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *SupportAccount) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *SupportAccount) GetAccountId() string { + if m != nil { + return m.AccountId + } + return "" +} + +func (m *SupportAccount) GetCloudResource() string { + if m != nil { + return m.CloudResource + } + return "" +} + +func (m *SupportAccount) GetDisplayName() string { + if m != nil { + return m.DisplayName + } + return "" +} + +func (m *SupportAccount) GetState() SupportAccount_State { + if m != nil { + return m.State + } + return SupportAccount_STATE_UNSPECIFIED +} + +func (m *SupportAccount) GetCreateTime() *google_protobuf1.Timestamp { + if m != nil { + return m.CreateTime + } + return nil +} + +func (m *SupportAccount) GetBillingAccountName() string { + if m != nil { + return m.BillingAccountName + } + return "" +} + +func (m *SupportAccount) GetUnifyAccountId() string { + if m != nil { + return m.UnifyAccountId + } + return "" +} + +func (m *SupportAccount) GetPricingModel() SupportAccount_PricingModel { + if m != nil { + return m.PricingModel + } + return SupportAccount_PRICING_MODEL_UNKNOWN +} + +// A support case created by the user. +type Case struct { + // The resource name for the Case in format + // `supportAccounts/{account_id}/cases/{case_id}` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The short summary of the issue reported in this case. + DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName" json:"display_name,omitempty"` + // The board description of issue provided with initial summary. + Description string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` + // The product component for which this Case is reported. + Component string `protobuf:"bytes,4,opt,name=component" json:"component,omitempty"` + // The product subcomponent for which this Case is reported. + Subcomponent string `protobuf:"bytes,5,opt,name=subcomponent" json:"subcomponent,omitempty"` + // Timezone the client sending this request is in. + // It should be in a format IANA recognizes: https://www.iana.org/time-zone + // There is no additional validation done by the API. + ClientTimezone string `protobuf:"bytes,6,opt,name=client_timezone,json=clientTimezone" json:"client_timezone,omitempty"` + // The email addresses that can be copied to receive updates on this case. + // Users can specify a maximum of 10 email addresses. + CcAddresses []string `protobuf:"bytes,7,rep,name=cc_addresses,json=ccAddresses" json:"cc_addresses,omitempty"` + // The Google Cloud Platform project ID for which this case is created. + ProjectId string `protobuf:"bytes,8,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // List of customer issues associated with this case. + Issues []*CustomerIssue `protobuf:"bytes,10,rep,name=issues" json:"issues,omitempty"` + // The current priority of this case. + Priority Case_Priority `protobuf:"varint,11,opt,name=priority,enum=google.cloud.support.common.Case_Priority" json:"priority,omitempty"` + // The current state of this case. + State Case_State `protobuf:"varint,12,opt,name=state,enum=google.cloud.support.common.Case_State" json:"state,omitempty"` + // Time when this case was created. + // Output only. + CreateTime *google_protobuf1.Timestamp `protobuf:"bytes,13,opt,name=create_time,json=createTime" json:"create_time,omitempty"` + // Time when this case was last updated. + // Output only. + UpdateTime *google_protobuf1.Timestamp `protobuf:"bytes,14,opt,name=update_time,json=updateTime" json:"update_time,omitempty"` + // Email address of user who created this case. + // Output only. It is inferred from credentials supplied during case creation. + CreatorEmail string `protobuf:"bytes,15,opt,name=creator_email,json=creatorEmail" json:"creator_email,omitempty"` + // The issue category applicable to this case. + Category string `protobuf:"bytes,16,opt,name=category" json:"category,omitempty"` +} + +func (m *Case) Reset() { *m = Case{} } +func (m *Case) String() string { return proto.CompactTextString(m) } +func (*Case) ProtoMessage() {} +func (*Case) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *Case) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Case) GetDisplayName() string { + if m != nil { + return m.DisplayName + } + return "" +} + +func (m *Case) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *Case) GetComponent() string { + if m != nil { + return m.Component + } + return "" +} + +func (m *Case) GetSubcomponent() string { + if m != nil { + return m.Subcomponent + } + return "" +} + +func (m *Case) GetClientTimezone() string { + if m != nil { + return m.ClientTimezone + } + return "" +} + +func (m *Case) GetCcAddresses() []string { + if m != nil { + return m.CcAddresses + } + return nil +} + +func (m *Case) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *Case) GetIssues() []*CustomerIssue { + if m != nil { + return m.Issues + } + return nil +} + +func (m *Case) GetPriority() Case_Priority { + if m != nil { + return m.Priority + } + return Case_PRIORITY_UNSPECIFIED +} + +func (m *Case) GetState() Case_State { + if m != nil { + return m.State + } + return Case_STATE_UNSPECIFIED +} + +func (m *Case) GetCreateTime() *google_protobuf1.Timestamp { + if m != nil { + return m.CreateTime + } + return nil +} + +func (m *Case) GetUpdateTime() *google_protobuf1.Timestamp { + if m != nil { + return m.UpdateTime + } + return nil +} + +func (m *Case) GetCreatorEmail() string { + if m != nil { + return m.CreatorEmail + } + return "" +} + +func (m *Case) GetCategory() string { + if m != nil { + return m.Category + } + return "" +} + +// Reference to a Google internal ticket used for investigating a support case. +// Not every support case will have an internal ticket associated with it. +// A support case can have multiple tickets linked to it. +type CustomerIssue struct { + // Unique identifier for the internal issue. + // Output only. + IssueId string `protobuf:"bytes,1,opt,name=issue_id,json=issueId" json:"issue_id,omitempty"` + // Represents current status of the internal ticket. + // Output only. + State CustomerIssue_IssueState `protobuf:"varint,2,opt,name=state,enum=google.cloud.support.common.CustomerIssue_IssueState" json:"state,omitempty"` + // Time when the internal issue was created. + // Output only. + CreateTime *google_protobuf1.Timestamp `protobuf:"bytes,3,opt,name=create_time,json=createTime" json:"create_time,omitempty"` + // Time when the internal issue was marked as resolved. + // Output only. + ResolveTime *google_protobuf1.Timestamp `protobuf:"bytes,4,opt,name=resolve_time,json=resolveTime" json:"resolve_time,omitempty"` + // Time when the internal issue was last updated. + // Output only. + UpdateTime *google_protobuf1.Timestamp `protobuf:"bytes,5,opt,name=update_time,json=updateTime" json:"update_time,omitempty"` +} + +func (m *CustomerIssue) Reset() { *m = CustomerIssue{} } +func (m *CustomerIssue) String() string { return proto.CompactTextString(m) } +func (*CustomerIssue) ProtoMessage() {} +func (*CustomerIssue) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *CustomerIssue) GetIssueId() string { + if m != nil { + return m.IssueId + } + return "" +} + +func (m *CustomerIssue) GetState() CustomerIssue_IssueState { + if m != nil { + return m.State + } + return CustomerIssue_ISSUE_STATE_UNSPECIFIED +} + +func (m *CustomerIssue) GetCreateTime() *google_protobuf1.Timestamp { + if m != nil { + return m.CreateTime + } + return nil +} + +func (m *CustomerIssue) GetResolveTime() *google_protobuf1.Timestamp { + if m != nil { + return m.ResolveTime + } + return nil +} + +func (m *CustomerIssue) GetUpdateTime() *google_protobuf1.Timestamp { + if m != nil { + return m.UpdateTime + } + return nil +} + +// A message that contains mapping of a user and their role under a support +// account. +type SupportRole struct { + // Email address of user being added through this Role. + Email string `protobuf:"bytes,1,opt,name=email" json:"email,omitempty"` + // The type of role assigned to user. + Role SupportRole_Role `protobuf:"varint,2,opt,name=role,enum=google.cloud.support.common.SupportRole_Role" json:"role,omitempty"` +} + +func (m *SupportRole) Reset() { *m = SupportRole{} } +func (m *SupportRole) String() string { return proto.CompactTextString(m) } +func (*SupportRole) ProtoMessage() {} +func (*SupportRole) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *SupportRole) GetEmail() string { + if m != nil { + return m.Email + } + return "" +} + +func (m *SupportRole) GetRole() SupportRole_Role { + if m != nil { + return m.Role + } + return SupportRole_ROLE_UNSPECIFIED +} + +// The comment text associated with a `Case`. +type Comment struct { + // Text containing a maximum of 3000 characters. + Text string `protobuf:"bytes,1,opt,name=text" json:"text,omitempty"` + // Time when this update was created. + // Output only. + CreateTime *google_protobuf1.Timestamp `protobuf:"bytes,2,opt,name=create_time,json=createTime" json:"create_time,omitempty"` + // The email address/name of user who created this comment. + // Output only. + Author string `protobuf:"bytes,3,opt,name=author" json:"author,omitempty"` + // The resource name for this comment in format + // `supportAccounts/{account_id}/cases/{case_id}/{comment_id}`. + // Output only. + Name string `protobuf:"bytes,4,opt,name=name" json:"name,omitempty"` +} + +func (m *Comment) Reset() { *m = Comment{} } +func (m *Comment) String() string { return proto.CompactTextString(m) } +func (*Comment) ProtoMessage() {} +func (*Comment) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *Comment) GetText() string { + if m != nil { + return m.Text + } + return "" +} + +func (m *Comment) GetCreateTime() *google_protobuf1.Timestamp { + if m != nil { + return m.CreateTime + } + return nil +} + +func (m *Comment) GetAuthor() string { + if m != nil { + return m.Author + } + return "" +} + +func (m *Comment) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Represents the product component taxonomy that is to be used while creating +// or updating a `Case`. A client should obtain the list of issue categories, +// component/subcomponent from this object and specify it in `Case.category`, +// `Case.component` and `Case.subcomponent` fields respectively. +type IssueTaxonomy struct { + // Map of available categories. + Categories map[string]*IssueTaxonomy_Category `protobuf:"bytes,1,rep,name=categories" json:"categories,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *IssueTaxonomy) Reset() { *m = IssueTaxonomy{} } +func (m *IssueTaxonomy) String() string { return proto.CompactTextString(m) } +func (*IssueTaxonomy) ProtoMessage() {} +func (*IssueTaxonomy) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *IssueTaxonomy) GetCategories() map[string]*IssueTaxonomy_Category { + if m != nil { + return m.Categories + } + return nil +} + +// The representation of a product component. It is composed of a canonical +// name for the product (e.g., Google App Engine), languages in which a +// support ticket can be created under this component, a template that +// provides hints on important details to be filled out before submitting a +// case. It also contains an embedded list of product subcomponents that have +// similar attributes as top-level components. +// (e.g., Google App Engine > Memcache). +type IssueTaxonomy_Component struct { + // User friendly name of this component. + DisplayName string `protobuf:"bytes,1,opt,name=display_name,json=displayName" json:"display_name,omitempty"` + // List of languages in which a support case can be created under this + // component. Represented by language codes in ISO_639-1 standard. + Languages []string `protobuf:"bytes,2,rep,name=languages" json:"languages,omitempty"` + // Template to be used while filling the description of a support case. + Template string `protobuf:"bytes,3,opt,name=template" json:"template,omitempty"` + // List of subcomponents under this component. + Subcomponents []*IssueTaxonomy_Component `protobuf:"bytes,4,rep,name=subcomponents" json:"subcomponents,omitempty"` +} + +func (m *IssueTaxonomy_Component) Reset() { *m = IssueTaxonomy_Component{} } +func (m *IssueTaxonomy_Component) String() string { return proto.CompactTextString(m) } +func (*IssueTaxonomy_Component) ProtoMessage() {} +func (*IssueTaxonomy_Component) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 0} } + +func (m *IssueTaxonomy_Component) GetDisplayName() string { + if m != nil { + return m.DisplayName + } + return "" +} + +func (m *IssueTaxonomy_Component) GetLanguages() []string { + if m != nil { + return m.Languages + } + return nil +} + +func (m *IssueTaxonomy_Component) GetTemplate() string { + if m != nil { + return m.Template + } + return "" +} + +func (m *IssueTaxonomy_Component) GetSubcomponents() []*IssueTaxonomy_Component { + if m != nil { + return m.Subcomponents + } + return nil +} + +// Represents the category of issue (Technical or Non-Technical) +// reported through a support case. +type IssueTaxonomy_Category struct { + // User friendly name of this category. + DisplayName string `protobuf:"bytes,1,opt,name=display_name,json=displayName" json:"display_name,omitempty"` + // Map of product components under this category. + Components map[string]*IssueTaxonomy_Component `protobuf:"bytes,2,rep,name=components" json:"components,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *IssueTaxonomy_Category) Reset() { *m = IssueTaxonomy_Category{} } +func (m *IssueTaxonomy_Category) String() string { return proto.CompactTextString(m) } +func (*IssueTaxonomy_Category) ProtoMessage() {} +func (*IssueTaxonomy_Category) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 1} } + +func (m *IssueTaxonomy_Category) GetDisplayName() string { + if m != nil { + return m.DisplayName + } + return "" +} + +func (m *IssueTaxonomy_Category) GetComponents() map[string]*IssueTaxonomy_Component { + if m != nil { + return m.Components + } + return nil +} + +func init() { + proto.RegisterType((*SupportAccount)(nil), "google.cloud.support.common.SupportAccount") + proto.RegisterType((*Case)(nil), "google.cloud.support.common.Case") + proto.RegisterType((*CustomerIssue)(nil), "google.cloud.support.common.CustomerIssue") + proto.RegisterType((*SupportRole)(nil), "google.cloud.support.common.SupportRole") + proto.RegisterType((*Comment)(nil), "google.cloud.support.common.Comment") + proto.RegisterType((*IssueTaxonomy)(nil), "google.cloud.support.common.IssueTaxonomy") + proto.RegisterType((*IssueTaxonomy_Component)(nil), "google.cloud.support.common.IssueTaxonomy.Component") + proto.RegisterType((*IssueTaxonomy_Category)(nil), "google.cloud.support.common.IssueTaxonomy.Category") + proto.RegisterEnum("google.cloud.support.common.SupportAccount_State", SupportAccount_State_name, SupportAccount_State_value) + proto.RegisterEnum("google.cloud.support.common.SupportAccount_PricingModel", SupportAccount_PricingModel_name, SupportAccount_PricingModel_value) + proto.RegisterEnum("google.cloud.support.common.Case_Priority", Case_Priority_name, Case_Priority_value) + proto.RegisterEnum("google.cloud.support.common.Case_State", Case_State_name, Case_State_value) + proto.RegisterEnum("google.cloud.support.common.CustomerIssue_IssueState", CustomerIssue_IssueState_name, CustomerIssue_IssueState_value) + proto.RegisterEnum("google.cloud.support.common.SupportRole_Role", SupportRole_Role_name, SupportRole_Role_value) +} + +func init() { proto.RegisterFile("google/cloud/support/common.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 1336 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0x61, 0x6e, 0xdb, 0xc6, + 0x12, 0x0e, 0x29, 0xc9, 0x92, 0x46, 0x96, 0xbd, 0x59, 0x38, 0x79, 0x8c, 0x92, 0xbc, 0x38, 0x7a, + 0x78, 0x88, 0x51, 0xa0, 0x72, 0xe2, 0xa4, 0x40, 0x90, 0x20, 0x3f, 0x64, 0x6a, 0x2d, 0xb0, 0x91, + 0x49, 0x82, 0xa4, 0xe3, 0x24, 0x45, 0x41, 0xd0, 0xd4, 0x46, 0x65, 0x43, 0x72, 0x09, 0x92, 0x4a, + 0xa3, 0x1e, 0xa0, 0x3d, 0x45, 0xef, 0xd0, 0x5f, 0xbd, 0x40, 0x7b, 0x83, 0xde, 0xa1, 0xe7, 0x28, + 0x76, 0x49, 0xc9, 0xb2, 0x63, 0xd8, 0x51, 0xfe, 0x68, 0x39, 0xb3, 0x33, 0xb3, 0x33, 0xb3, 0xdf, + 0xb7, 0x63, 0xc3, 0xfd, 0x09, 0x63, 0x93, 0x90, 0xee, 0xfa, 0x21, 0x9b, 0x8e, 0x77, 0xb3, 0x69, + 0x92, 0xb0, 0x34, 0xdf, 0xf5, 0x59, 0x14, 0xb1, 0xb8, 0x97, 0xa4, 0x2c, 0x67, 0xf8, 0x76, 0x61, + 0xd2, 0x13, 0x26, 0xbd, 0xd2, 0xa4, 0x57, 0x98, 0x74, 0xee, 0x94, 0xfe, 0x5e, 0x12, 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 0x27, 0xfe, 0x16, 0x6a, 0x1f, 0xbc, 0x70, 0x3a, 0x47, 0xd4, 0x97, 0x75, + 0xa3, 0x08, 0xf1, 0x4c, 0x7e, 0x2a, 0x75, 0x52, 0xd8, 0x3c, 0x77, 0xdf, 0x17, 0x1c, 0xaa, 0x9d, + 0x3d, 0xf4, 0xf1, 0x17, 0x54, 0xbe, 0x74, 0xe6, 0xfe, 0x4f, 0x70, 0xcf, 0x67, 0xd1, 0x65, 0x41, + 0xf6, 0xaf, 0xab, 0x5c, 0x5b, 0x12, 0xdb, 0xe4, 0x6c, 0x79, 0xdb, 0x2f, 0xed, 0x27, 0x8c, 0xe3, + 0xa7, 0xc7, 0xd2, 0xc9, 0xee, 0x84, 0xc6, 0x82, 0x49, 0xbb, 0xc5, 0x96, 0x97, 0x04, 0xd9, 0x85, + 0xff, 0x97, 0x3c, 0x2f, 0x96, 0x93, 0x35, 0x61, 0xfd, 0xf8, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x0c, 0xd0, 0x7b, 0x46, 0xc4, 0x0c, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/support/v1alpha1/cloud_support.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/support/v1alpha1/cloud_support.pb.go new file mode 100644 index 0000000000..80ae418c05 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/support/v1alpha1/cloud_support.pb.go @@ -0,0 +1,806 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/support/v1alpha1/cloud_support.proto + +/* +Package support is a generated protocol buffer package. + +It is generated from these files: + google/cloud/support/v1alpha1/cloud_support.proto + +It has these top-level messages: + GetSupportAccountRequest + ListSupportAccountsRequest + ListSupportAccountsResponse + GetCaseRequest + ListCasesRequest + ListCasesResponse + ListCommentsRequest + ListCommentsResponse + CreateCaseRequest + UpdateCaseRequest + CreateCommentRequest + GetIssueTaxonomyRequest +*/ +package support + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_cloud_support_common "google.golang.org/genproto/googleapis/cloud/support/common" +import _ "github.com/golang/protobuf/ptypes/empty" +import google_protobuf3 "google.golang.org/genproto/protobuf/field_mask" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// The request message for `GetSupportAccount`. +type GetSupportAccountRequest struct { + // The resource name of the support accounts. For example: + // `supportAccounts/accountA`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetSupportAccountRequest) Reset() { *m = GetSupportAccountRequest{} } +func (m *GetSupportAccountRequest) String() string { return proto.CompactTextString(m) } +func (*GetSupportAccountRequest) ProtoMessage() {} +func (*GetSupportAccountRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *GetSupportAccountRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// The request message for `ListSupportAccount`. +type ListSupportAccountsRequest struct { + // The filter applied to search results. It only supports filtering a support + // account list by a cloud_resource. For example, to filter results by support + // accounts associated with an Organization, its value should be: + // "cloud_resource:organizations/" + Filter string `protobuf:"bytes,1,opt,name=filter" json:"filter,omitempty"` + // Maximum number of accounts fetched with each request. + PageSize int64 `protobuf:"varint,2,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // A token identifying the page of results to return. If unspecified, the + // first page is retrieved. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListSupportAccountsRequest) Reset() { *m = ListSupportAccountsRequest{} } +func (m *ListSupportAccountsRequest) String() string { return proto.CompactTextString(m) } +func (*ListSupportAccountsRequest) ProtoMessage() {} +func (*ListSupportAccountsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *ListSupportAccountsRequest) GetFilter() string { + if m != nil { + return m.Filter + } + return "" +} + +func (m *ListSupportAccountsRequest) GetPageSize() int64 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListSupportAccountsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// The response message for `ListSupportAccount`. +type ListSupportAccountsResponse struct { + // A list of support accounts. + Accounts []*google_cloud_support_common.SupportAccount `protobuf:"bytes,1,rep,name=accounts" json:"accounts,omitempty"` + // A token to retrieve the next page of results. This should be passed on in + // `page_token` field of `ListSupportAccountRequest` for next request. If + // unspecified, there are no more results to retrieve. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListSupportAccountsResponse) Reset() { *m = ListSupportAccountsResponse{} } +func (m *ListSupportAccountsResponse) String() string { return proto.CompactTextString(m) } +func (*ListSupportAccountsResponse) ProtoMessage() {} +func (*ListSupportAccountsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *ListSupportAccountsResponse) GetAccounts() []*google_cloud_support_common.SupportAccount { + if m != nil { + return m.Accounts + } + return nil +} + +func (m *ListSupportAccountsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// The request message for `GetCase` method. +type GetCaseRequest struct { + // Name of case resource requested. + // For example: "supportAccounts/accountA/cases/123" + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetCaseRequest) Reset() { *m = GetCaseRequest{} } +func (m *GetCaseRequest) String() string { return proto.CompactTextString(m) } +func (*GetCaseRequest) ProtoMessage() {} +func (*GetCaseRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *GetCaseRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// The request message for `ListCase` method. +type ListCasesRequest struct { + // Name of the account resource for which cases are requested. For example: + // "supportAccounts/accountA" + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The filter applied to the search results. Currently it only accepts "OPEN" + // or "CLOSED" strings, filtering out cases that are open or resolved. + Filter string `protobuf:"bytes,2,opt,name=filter" json:"filter,omitempty"` + // Maximum number of cases fetched with each request. + PageSize int64 `protobuf:"varint,3,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // A token identifying the page of results to return. If unspecified, the + // first page is retrieved. + PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListCasesRequest) Reset() { *m = ListCasesRequest{} } +func (m *ListCasesRequest) String() string { return proto.CompactTextString(m) } +func (*ListCasesRequest) ProtoMessage() {} +func (*ListCasesRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *ListCasesRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ListCasesRequest) GetFilter() string { + if m != nil { + return m.Filter + } + return "" +} + +func (m *ListCasesRequest) GetPageSize() int64 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListCasesRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// The response message for `ListCase` method. +type ListCasesResponse struct { + // A list of cases. + Cases []*google_cloud_support_common.Case `protobuf:"bytes,1,rep,name=cases" json:"cases,omitempty"` + // A token to retrieve the next page of results. This should be passed on in + // `page_token` field of `ListCaseRequest` for next request. If unspecified, + // there are no more results to retrieve. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListCasesResponse) Reset() { *m = ListCasesResponse{} } +func (m *ListCasesResponse) String() string { return proto.CompactTextString(m) } +func (*ListCasesResponse) ProtoMessage() {} +func (*ListCasesResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *ListCasesResponse) GetCases() []*google_cloud_support_common.Case { + if m != nil { + return m.Cases + } + return nil +} + +func (m *ListCasesResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// The request message for `ListComments` method. +type ListCommentsRequest struct { + // The resource name of case for which comments should be listed. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *ListCommentsRequest) Reset() { *m = ListCommentsRequest{} } +func (m *ListCommentsRequest) String() string { return proto.CompactTextString(m) } +func (*ListCommentsRequest) ProtoMessage() {} +func (*ListCommentsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *ListCommentsRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// The response message for `ListComments` method. +type ListCommentsResponse struct { + // A list of comments. + Comments []*google_cloud_support_common.Comment `protobuf:"bytes,1,rep,name=comments" json:"comments,omitempty"` +} + +func (m *ListCommentsResponse) Reset() { *m = ListCommentsResponse{} } +func (m *ListCommentsResponse) String() string { return proto.CompactTextString(m) } +func (*ListCommentsResponse) ProtoMessage() {} +func (*ListCommentsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *ListCommentsResponse) GetComments() []*google_cloud_support_common.Comment { + if m != nil { + return m.Comments + } + return nil +} + +// The request message for `CreateCase` method. +type CreateCaseRequest struct { + // The resource name for `SupportAccount` under which this case is created. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // The case resource to create. + Case *google_cloud_support_common.Case `protobuf:"bytes,2,opt,name=case" json:"case,omitempty"` +} + +func (m *CreateCaseRequest) Reset() { *m = CreateCaseRequest{} } +func (m *CreateCaseRequest) String() string { return proto.CompactTextString(m) } +func (*CreateCaseRequest) ProtoMessage() {} +func (*CreateCaseRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *CreateCaseRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *CreateCaseRequest) GetCase() *google_cloud_support_common.Case { + if m != nil { + return m.Case + } + return nil +} + +// The request message for `UpdateCase` method. +type UpdateCaseRequest struct { + // The case resource to update. + Case *google_cloud_support_common.Case `protobuf:"bytes,1,opt,name=case" json:"case,omitempty"` + // A field that represents attributes of a Case object that should be updated + // as part of this request. + UpdateMask *google_protobuf3.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask" json:"update_mask,omitempty"` +} + +func (m *UpdateCaseRequest) Reset() { *m = UpdateCaseRequest{} } +func (m *UpdateCaseRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateCaseRequest) ProtoMessage() {} +func (*UpdateCaseRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *UpdateCaseRequest) GetCase() *google_cloud_support_common.Case { + if m != nil { + return m.Case + } + return nil +} + +func (m *UpdateCaseRequest) GetUpdateMask() *google_protobuf3.FieldMask { + if m != nil { + return m.UpdateMask + } + return nil +} + +// The request message for `CreateComment` method. +type CreateCommentRequest struct { + // The resource name of case to which this comment should be added. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The `Comment` to be added to this case. + Comment *google_cloud_support_common.Comment `protobuf:"bytes,2,opt,name=comment" json:"comment,omitempty"` +} + +func (m *CreateCommentRequest) Reset() { *m = CreateCommentRequest{} } +func (m *CreateCommentRequest) String() string { return proto.CompactTextString(m) } +func (*CreateCommentRequest) ProtoMessage() {} +func (*CreateCommentRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *CreateCommentRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *CreateCommentRequest) GetComment() *google_cloud_support_common.Comment { + if m != nil { + return m.Comment + } + return nil +} + +// The request message for `GetIssueTaxonomy` method. +type GetIssueTaxonomyRequest struct { +} + +func (m *GetIssueTaxonomyRequest) Reset() { *m = GetIssueTaxonomyRequest{} } +func (m *GetIssueTaxonomyRequest) String() string { return proto.CompactTextString(m) } +func (*GetIssueTaxonomyRequest) ProtoMessage() {} +func (*GetIssueTaxonomyRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } + +func init() { + proto.RegisterType((*GetSupportAccountRequest)(nil), "google.cloud.support.v1alpha1.GetSupportAccountRequest") + proto.RegisterType((*ListSupportAccountsRequest)(nil), "google.cloud.support.v1alpha1.ListSupportAccountsRequest") + proto.RegisterType((*ListSupportAccountsResponse)(nil), "google.cloud.support.v1alpha1.ListSupportAccountsResponse") + proto.RegisterType((*GetCaseRequest)(nil), "google.cloud.support.v1alpha1.GetCaseRequest") + proto.RegisterType((*ListCasesRequest)(nil), "google.cloud.support.v1alpha1.ListCasesRequest") + proto.RegisterType((*ListCasesResponse)(nil), "google.cloud.support.v1alpha1.ListCasesResponse") + proto.RegisterType((*ListCommentsRequest)(nil), "google.cloud.support.v1alpha1.ListCommentsRequest") + proto.RegisterType((*ListCommentsResponse)(nil), "google.cloud.support.v1alpha1.ListCommentsResponse") + proto.RegisterType((*CreateCaseRequest)(nil), "google.cloud.support.v1alpha1.CreateCaseRequest") + proto.RegisterType((*UpdateCaseRequest)(nil), "google.cloud.support.v1alpha1.UpdateCaseRequest") + proto.RegisterType((*CreateCommentRequest)(nil), "google.cloud.support.v1alpha1.CreateCommentRequest") + proto.RegisterType((*GetIssueTaxonomyRequest)(nil), "google.cloud.support.v1alpha1.GetIssueTaxonomyRequest") +} + +// 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 + +// Client API for CloudSupport service + +type CloudSupportClient interface { + // Retrieves the support account details given an account identifier. + // The authenticated user calling this method must be the account owner. + GetSupportAccount(ctx context.Context, in *GetSupportAccountRequest, opts ...grpc.CallOption) (*google_cloud_support_common.SupportAccount, error) + // Retrieves the list of accounts the current authenticated user has access + // to. + ListSupportAccounts(ctx context.Context, in *ListSupportAccountsRequest, opts ...grpc.CallOption) (*ListSupportAccountsResponse, error) + // Retrieves the details for a support case. The current authenticated user + // calling this method must have permissions to view this case. + GetCase(ctx context.Context, in *GetCaseRequest, opts ...grpc.CallOption) (*google_cloud_support_common.Case, error) + // Retrieves the list of support cases associated with an account. The current + // authenticated user must have the permission to list and view these cases. + ListCases(ctx context.Context, in *ListCasesRequest, opts ...grpc.CallOption) (*ListCasesResponse, error) + // Lists all comments from a case. + ListComments(ctx context.Context, in *ListCommentsRequest, opts ...grpc.CallOption) (*ListCommentsResponse, error) + // Creates a case and associates it with a + // [SupportAccount][google.cloud.support.v1alpha2.SupportAcccount]. The + // authenticated user attempting this action must have permissions to create a + // `Case` under that [SupportAccount]. + CreateCase(ctx context.Context, in *CreateCaseRequest, opts ...grpc.CallOption) (*google_cloud_support_common.Case, error) + // Updates a support case. Only a small set of details (priority, subject and + // cc_address) can be update after a case is created. + UpdateCase(ctx context.Context, in *UpdateCaseRequest, opts ...grpc.CallOption) (*google_cloud_support_common.Case, error) + // Adds a new comment to a case. + CreateComment(ctx context.Context, in *CreateCommentRequest, opts ...grpc.CallOption) (*google_cloud_support_common.Comment, error) + // Retrieves the taxonomy of product categories and components to be used + // while creating a support case. + GetIssueTaxonomy(ctx context.Context, in *GetIssueTaxonomyRequest, opts ...grpc.CallOption) (*google_cloud_support_common.IssueTaxonomy, error) +} + +type cloudSupportClient struct { + cc *grpc.ClientConn +} + +func NewCloudSupportClient(cc *grpc.ClientConn) CloudSupportClient { + return &cloudSupportClient{cc} +} + +func (c *cloudSupportClient) GetSupportAccount(ctx context.Context, in *GetSupportAccountRequest, opts ...grpc.CallOption) (*google_cloud_support_common.SupportAccount, error) { + out := new(google_cloud_support_common.SupportAccount) + err := grpc.Invoke(ctx, "/google.cloud.support.v1alpha1.CloudSupport/GetSupportAccount", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *cloudSupportClient) ListSupportAccounts(ctx context.Context, in *ListSupportAccountsRequest, opts ...grpc.CallOption) (*ListSupportAccountsResponse, error) { + out := new(ListSupportAccountsResponse) + err := grpc.Invoke(ctx, "/google.cloud.support.v1alpha1.CloudSupport/ListSupportAccounts", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *cloudSupportClient) GetCase(ctx context.Context, in *GetCaseRequest, opts ...grpc.CallOption) (*google_cloud_support_common.Case, error) { + out := new(google_cloud_support_common.Case) + err := grpc.Invoke(ctx, "/google.cloud.support.v1alpha1.CloudSupport/GetCase", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *cloudSupportClient) ListCases(ctx context.Context, in *ListCasesRequest, opts ...grpc.CallOption) (*ListCasesResponse, error) { + out := new(ListCasesResponse) + err := grpc.Invoke(ctx, "/google.cloud.support.v1alpha1.CloudSupport/ListCases", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *cloudSupportClient) ListComments(ctx context.Context, in *ListCommentsRequest, opts ...grpc.CallOption) (*ListCommentsResponse, error) { + out := new(ListCommentsResponse) + err := grpc.Invoke(ctx, "/google.cloud.support.v1alpha1.CloudSupport/ListComments", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *cloudSupportClient) CreateCase(ctx context.Context, in *CreateCaseRequest, opts ...grpc.CallOption) (*google_cloud_support_common.Case, error) { + out := new(google_cloud_support_common.Case) + err := grpc.Invoke(ctx, "/google.cloud.support.v1alpha1.CloudSupport/CreateCase", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *cloudSupportClient) UpdateCase(ctx context.Context, in *UpdateCaseRequest, opts ...grpc.CallOption) (*google_cloud_support_common.Case, error) { + out := new(google_cloud_support_common.Case) + err := grpc.Invoke(ctx, "/google.cloud.support.v1alpha1.CloudSupport/UpdateCase", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *cloudSupportClient) CreateComment(ctx context.Context, in *CreateCommentRequest, opts ...grpc.CallOption) (*google_cloud_support_common.Comment, error) { + out := new(google_cloud_support_common.Comment) + err := grpc.Invoke(ctx, "/google.cloud.support.v1alpha1.CloudSupport/CreateComment", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *cloudSupportClient) GetIssueTaxonomy(ctx context.Context, in *GetIssueTaxonomyRequest, opts ...grpc.CallOption) (*google_cloud_support_common.IssueTaxonomy, error) { + out := new(google_cloud_support_common.IssueTaxonomy) + err := grpc.Invoke(ctx, "/google.cloud.support.v1alpha1.CloudSupport/GetIssueTaxonomy", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for CloudSupport service + +type CloudSupportServer interface { + // Retrieves the support account details given an account identifier. + // The authenticated user calling this method must be the account owner. + GetSupportAccount(context.Context, *GetSupportAccountRequest) (*google_cloud_support_common.SupportAccount, error) + // Retrieves the list of accounts the current authenticated user has access + // to. + ListSupportAccounts(context.Context, *ListSupportAccountsRequest) (*ListSupportAccountsResponse, error) + // Retrieves the details for a support case. The current authenticated user + // calling this method must have permissions to view this case. + GetCase(context.Context, *GetCaseRequest) (*google_cloud_support_common.Case, error) + // Retrieves the list of support cases associated with an account. The current + // authenticated user must have the permission to list and view these cases. + ListCases(context.Context, *ListCasesRequest) (*ListCasesResponse, error) + // Lists all comments from a case. + ListComments(context.Context, *ListCommentsRequest) (*ListCommentsResponse, error) + // Creates a case and associates it with a + // [SupportAccount][google.cloud.support.v1alpha2.SupportAcccount]. The + // authenticated user attempting this action must have permissions to create a + // `Case` under that [SupportAccount]. + CreateCase(context.Context, *CreateCaseRequest) (*google_cloud_support_common.Case, error) + // Updates a support case. Only a small set of details (priority, subject and + // cc_address) can be update after a case is created. + UpdateCase(context.Context, *UpdateCaseRequest) (*google_cloud_support_common.Case, error) + // Adds a new comment to a case. + CreateComment(context.Context, *CreateCommentRequest) (*google_cloud_support_common.Comment, error) + // Retrieves the taxonomy of product categories and components to be used + // while creating a support case. + GetIssueTaxonomy(context.Context, *GetIssueTaxonomyRequest) (*google_cloud_support_common.IssueTaxonomy, error) +} + +func RegisterCloudSupportServer(s *grpc.Server, srv CloudSupportServer) { + s.RegisterService(&_CloudSupport_serviceDesc, srv) +} + +func _CloudSupport_GetSupportAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetSupportAccountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CloudSupportServer).GetSupportAccount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.support.v1alpha1.CloudSupport/GetSupportAccount", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CloudSupportServer).GetSupportAccount(ctx, req.(*GetSupportAccountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CloudSupport_ListSupportAccounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListSupportAccountsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CloudSupportServer).ListSupportAccounts(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.support.v1alpha1.CloudSupport/ListSupportAccounts", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CloudSupportServer).ListSupportAccounts(ctx, req.(*ListSupportAccountsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CloudSupport_GetCase_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetCaseRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CloudSupportServer).GetCase(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.support.v1alpha1.CloudSupport/GetCase", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CloudSupportServer).GetCase(ctx, req.(*GetCaseRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CloudSupport_ListCases_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListCasesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CloudSupportServer).ListCases(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.support.v1alpha1.CloudSupport/ListCases", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CloudSupportServer).ListCases(ctx, req.(*ListCasesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CloudSupport_ListComments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListCommentsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CloudSupportServer).ListComments(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.support.v1alpha1.CloudSupport/ListComments", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CloudSupportServer).ListComments(ctx, req.(*ListCommentsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CloudSupport_CreateCase_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateCaseRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CloudSupportServer).CreateCase(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.support.v1alpha1.CloudSupport/CreateCase", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CloudSupportServer).CreateCase(ctx, req.(*CreateCaseRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CloudSupport_UpdateCase_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateCaseRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CloudSupportServer).UpdateCase(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.support.v1alpha1.CloudSupport/UpdateCase", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CloudSupportServer).UpdateCase(ctx, req.(*UpdateCaseRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CloudSupport_CreateComment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateCommentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CloudSupportServer).CreateComment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.support.v1alpha1.CloudSupport/CreateComment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CloudSupportServer).CreateComment(ctx, req.(*CreateCommentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CloudSupport_GetIssueTaxonomy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetIssueTaxonomyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CloudSupportServer).GetIssueTaxonomy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.support.v1alpha1.CloudSupport/GetIssueTaxonomy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CloudSupportServer).GetIssueTaxonomy(ctx, req.(*GetIssueTaxonomyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _CloudSupport_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.cloud.support.v1alpha1.CloudSupport", + HandlerType: (*CloudSupportServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetSupportAccount", + Handler: _CloudSupport_GetSupportAccount_Handler, + }, + { + MethodName: "ListSupportAccounts", + Handler: _CloudSupport_ListSupportAccounts_Handler, + }, + { + MethodName: "GetCase", + Handler: _CloudSupport_GetCase_Handler, + }, + { + MethodName: "ListCases", + Handler: _CloudSupport_ListCases_Handler, + }, + { + MethodName: "ListComments", + Handler: _CloudSupport_ListComments_Handler, + }, + { + MethodName: "CreateCase", + Handler: _CloudSupport_CreateCase_Handler, + }, + { + MethodName: "UpdateCase", + Handler: _CloudSupport_UpdateCase_Handler, + }, + { + MethodName: "CreateComment", + Handler: _CloudSupport_CreateComment_Handler, + }, + { + MethodName: "GetIssueTaxonomy", + Handler: _CloudSupport_GetIssueTaxonomy_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/cloud/support/v1alpha1/cloud_support.proto", +} + +func init() { proto.RegisterFile("google/cloud/support/v1alpha1/cloud_support.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 863 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x41, 0x4f, 0x33, 0x45, + 0x18, 0xce, 0xb4, 0xc8, 0x07, 0x2f, 0xdf, 0xa7, 0x5f, 0x47, 0x82, 0x65, 0x0b, 0x49, 0x3b, 0x21, + 0xa6, 0x56, 0xdd, 0x85, 0x36, 0x88, 0x96, 0x40, 0x14, 0x88, 0x8d, 0x89, 0x26, 0xa4, 0x60, 0x62, + 0xbc, 0x34, 0x43, 0x19, 0xd6, 0x95, 0xee, 0xce, 0xda, 0x99, 0x1a, 0x40, 0xbd, 0x78, 0xf1, 0xa6, + 0x07, 0x6f, 0x7a, 0xe1, 0xe2, 0x59, 0x0f, 0xfe, 0x13, 0xff, 0x82, 0xfe, 0x0f, 0xb3, 0xb3, 0xb3, + 0xed, 0x76, 0x69, 0x77, 0x17, 0x6e, 0xdd, 0x77, 0xde, 0xe7, 0x7d, 0x9f, 0x79, 0xe6, 0x9d, 0x67, + 0x0a, 0x3b, 0x36, 0xe7, 0xf6, 0x80, 0x59, 0xfd, 0x01, 0x1f, 0x5d, 0x5a, 0x62, 0xe4, 0xfb, 0x7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0xf9, 0x57, 0xbd, 0xaf, 0x03, 0x17, 0x8b, 0x0a, + 0xd0, 0xfa, 0x3f, 0x00, 0x00, 0xff, 0xff, 0xad, 0xe1, 0xf2, 0x57, 0x85, 0x0b, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/videointelligence/v1/video_intelligence.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/videointelligence/v1/video_intelligence.pb.go new file mode 100644 index 0000000000..75b0f760ab --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/videointelligence/v1/video_intelligence.pb.go @@ -0,0 +1,1158 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/videointelligence/v1/video_intelligence.proto + +/* +Package videointelligence is a generated protocol buffer package. + +It is generated from these files: + google/cloud/videointelligence/v1/video_intelligence.proto + +It has these top-level messages: + AnnotateVideoRequest + VideoContext + LabelDetectionConfig + ShotChangeDetectionConfig + ExplicitContentDetectionConfig + FaceDetectionConfig + VideoSegment + LabelSegment + LabelFrame + Entity + LabelAnnotation + ExplicitContentFrame + ExplicitContentAnnotation + NormalizedBoundingBox + FaceSegment + FaceFrame + FaceAnnotation + VideoAnnotationResults + AnnotateVideoResponse + VideoAnnotationProgress + AnnotateVideoProgress +*/ +package videointelligence + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_longrunning "google.golang.org/genproto/googleapis/longrunning" +import google_protobuf3 "github.com/golang/protobuf/ptypes/duration" +import google_protobuf4 "github.com/golang/protobuf/ptypes/timestamp" +import google_rpc "google.golang.org/genproto/googleapis/rpc/status" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Video annotation feature. +type Feature int32 + +const ( + // Unspecified. + Feature_FEATURE_UNSPECIFIED Feature = 0 + // Label detection. Detect objects, such as dog or flower. + Feature_LABEL_DETECTION Feature = 1 + // Shot change detection. + Feature_SHOT_CHANGE_DETECTION Feature = 2 + // Explicit content detection. + Feature_EXPLICIT_CONTENT_DETECTION Feature = 3 + // Human face detection and tracking. + Feature_FACE_DETECTION Feature = 4 +) + +var Feature_name = map[int32]string{ + 0: "FEATURE_UNSPECIFIED", + 1: "LABEL_DETECTION", + 2: "SHOT_CHANGE_DETECTION", + 3: "EXPLICIT_CONTENT_DETECTION", + 4: "FACE_DETECTION", +} +var Feature_value = map[string]int32{ + "FEATURE_UNSPECIFIED": 0, + "LABEL_DETECTION": 1, + "SHOT_CHANGE_DETECTION": 2, + "EXPLICIT_CONTENT_DETECTION": 3, + "FACE_DETECTION": 4, +} + +func (x Feature) String() string { + return proto.EnumName(Feature_name, int32(x)) +} +func (Feature) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +// Label detection mode. +type LabelDetectionMode int32 + +const ( + // Unspecified. + LabelDetectionMode_LABEL_DETECTION_MODE_UNSPECIFIED LabelDetectionMode = 0 + // Detect shot-level labels. + LabelDetectionMode_SHOT_MODE LabelDetectionMode = 1 + // Detect frame-level labels. + LabelDetectionMode_FRAME_MODE LabelDetectionMode = 2 + // Detect both shot-level and frame-level labels. + LabelDetectionMode_SHOT_AND_FRAME_MODE LabelDetectionMode = 3 +) + +var LabelDetectionMode_name = map[int32]string{ + 0: "LABEL_DETECTION_MODE_UNSPECIFIED", + 1: "SHOT_MODE", + 2: "FRAME_MODE", + 3: "SHOT_AND_FRAME_MODE", +} +var LabelDetectionMode_value = map[string]int32{ + "LABEL_DETECTION_MODE_UNSPECIFIED": 0, + "SHOT_MODE": 1, + "FRAME_MODE": 2, + "SHOT_AND_FRAME_MODE": 3, +} + +func (x LabelDetectionMode) String() string { + return proto.EnumName(LabelDetectionMode_name, int32(x)) +} +func (LabelDetectionMode) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +// Bucketized representation of likelihood. +type Likelihood int32 + +const ( + // Unspecified likelihood. + Likelihood_LIKELIHOOD_UNSPECIFIED Likelihood = 0 + // Very unlikely. + Likelihood_VERY_UNLIKELY Likelihood = 1 + // Unlikely. + Likelihood_UNLIKELY Likelihood = 2 + // Possible. + Likelihood_POSSIBLE Likelihood = 3 + // Likely. + Likelihood_LIKELY Likelihood = 4 + // Very likely. + Likelihood_VERY_LIKELY Likelihood = 5 +) + +var Likelihood_name = map[int32]string{ + 0: "LIKELIHOOD_UNSPECIFIED", + 1: "VERY_UNLIKELY", + 2: "UNLIKELY", + 3: "POSSIBLE", + 4: "LIKELY", + 5: "VERY_LIKELY", +} +var Likelihood_value = map[string]int32{ + "LIKELIHOOD_UNSPECIFIED": 0, + "VERY_UNLIKELY": 1, + "UNLIKELY": 2, + "POSSIBLE": 3, + "LIKELY": 4, + "VERY_LIKELY": 5, +} + +func (x Likelihood) String() string { + return proto.EnumName(Likelihood_name, int32(x)) +} +func (Likelihood) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +// Video annotation request. +type AnnotateVideoRequest struct { + // Input video location. Currently, only + // [Google Cloud Storage](https://cloud.google.com/storage/) URIs are + // supported, which must be specified in the following format: + // `gs://bucket-id/object-id` (other URI formats return + // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see + // [Request URIs](/storage/docs/reference-uris). + // A video URI may include wildcards in `object-id`, and thus identify + // multiple videos. Supported wildcards: '*' to match 0 or more characters; + // '?' to match 1 character. If unset, the input video should be embedded + // in the request as `input_content`. If set, `input_content` should be unset. + InputUri string `protobuf:"bytes,1,opt,name=input_uri,json=inputUri" json:"input_uri,omitempty"` + // The video data bytes. + // If unset, the input video(s) should be specified via `input_uri`. + // If set, `input_uri` should be unset. + InputContent []byte `protobuf:"bytes,6,opt,name=input_content,json=inputContent,proto3" json:"input_content,omitempty"` + // Requested video annotation features. + Features []Feature `protobuf:"varint,2,rep,packed,name=features,enum=google.cloud.videointelligence.v1.Feature" json:"features,omitempty"` + // Additional video context and/or feature-specific parameters. + VideoContext *VideoContext `protobuf:"bytes,3,opt,name=video_context,json=videoContext" json:"video_context,omitempty"` + // Optional location where the output (in JSON format) should be stored. + // Currently, only [Google Cloud Storage](https://cloud.google.com/storage/) + // URIs are supported, which must be specified in the following format: + // `gs://bucket-id/object-id` (other URI formats return + // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see + // [Request URIs](/storage/docs/reference-uris). + OutputUri string `protobuf:"bytes,4,opt,name=output_uri,json=outputUri" json:"output_uri,omitempty"` + // Optional cloud region where annotation should take place. Supported cloud + // regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region + // is specified, a region will be determined based on video file location. + LocationId string `protobuf:"bytes,5,opt,name=location_id,json=locationId" json:"location_id,omitempty"` +} + +func (m *AnnotateVideoRequest) Reset() { *m = AnnotateVideoRequest{} } +func (m *AnnotateVideoRequest) String() string { return proto.CompactTextString(m) } +func (*AnnotateVideoRequest) ProtoMessage() {} +func (*AnnotateVideoRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *AnnotateVideoRequest) GetInputUri() string { + if m != nil { + return m.InputUri + } + return "" +} + +func (m *AnnotateVideoRequest) GetInputContent() []byte { + if m != nil { + return m.InputContent + } + return nil +} + +func (m *AnnotateVideoRequest) GetFeatures() []Feature { + if m != nil { + return m.Features + } + return nil +} + +func (m *AnnotateVideoRequest) GetVideoContext() *VideoContext { + if m != nil { + return m.VideoContext + } + return nil +} + +func (m *AnnotateVideoRequest) GetOutputUri() string { + if m != nil { + return m.OutputUri + } + return "" +} + +func (m *AnnotateVideoRequest) GetLocationId() string { + if m != nil { + return m.LocationId + } + return "" +} + +// Video context and/or feature-specific parameters. +type VideoContext struct { + // Video segments to annotate. The segments may overlap and are not required + // to be contiguous or span the whole video. If unspecified, each video + // is treated as a single segment. + Segments []*VideoSegment `protobuf:"bytes,1,rep,name=segments" json:"segments,omitempty"` + // Config for LABEL_DETECTION. + LabelDetectionConfig *LabelDetectionConfig `protobuf:"bytes,2,opt,name=label_detection_config,json=labelDetectionConfig" json:"label_detection_config,omitempty"` + // Config for SHOT_CHANGE_DETECTION. + ShotChangeDetectionConfig *ShotChangeDetectionConfig `protobuf:"bytes,3,opt,name=shot_change_detection_config,json=shotChangeDetectionConfig" json:"shot_change_detection_config,omitempty"` + // Config for EXPLICIT_CONTENT_DETECTION. + ExplicitContentDetectionConfig *ExplicitContentDetectionConfig `protobuf:"bytes,4,opt,name=explicit_content_detection_config,json=explicitContentDetectionConfig" json:"explicit_content_detection_config,omitempty"` + // Config for FACE_DETECTION. + FaceDetectionConfig *FaceDetectionConfig `protobuf:"bytes,5,opt,name=face_detection_config,json=faceDetectionConfig" json:"face_detection_config,omitempty"` +} + +func (m *VideoContext) Reset() { *m = VideoContext{} } +func (m *VideoContext) String() string { return proto.CompactTextString(m) } +func (*VideoContext) ProtoMessage() {} +func (*VideoContext) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *VideoContext) GetSegments() []*VideoSegment { + if m != nil { + return m.Segments + } + return nil +} + +func (m *VideoContext) GetLabelDetectionConfig() *LabelDetectionConfig { + if m != nil { + return m.LabelDetectionConfig + } + return nil +} + +func (m *VideoContext) GetShotChangeDetectionConfig() *ShotChangeDetectionConfig { + if m != nil { + return m.ShotChangeDetectionConfig + } + return nil +} + +func (m *VideoContext) GetExplicitContentDetectionConfig() *ExplicitContentDetectionConfig { + if m != nil { + return m.ExplicitContentDetectionConfig + } + return nil +} + +func (m *VideoContext) GetFaceDetectionConfig() *FaceDetectionConfig { + if m != nil { + return m.FaceDetectionConfig + } + return nil +} + +// Config for LABEL_DETECTION. +type LabelDetectionConfig struct { + // What labels should be detected with LABEL_DETECTION, in addition to + // video-level labels or segment-level labels. + // If unspecified, defaults to `SHOT_MODE`. + LabelDetectionMode LabelDetectionMode `protobuf:"varint,1,opt,name=label_detection_mode,json=labelDetectionMode,enum=google.cloud.videointelligence.v1.LabelDetectionMode" json:"label_detection_mode,omitempty"` + // Whether the video has been shot from a stationary (i.e. non-moving) camera. + // When set to true, might improve detection accuracy for moving objects. + // Should be used with `SHOT_AND_FRAME_MODE` enabled. + StationaryCamera bool `protobuf:"varint,2,opt,name=stationary_camera,json=stationaryCamera" json:"stationary_camera,omitempty"` + // Model to use for label detection. + // Supported values: "builtin/stable" (the default if unset) and + // "builtin/latest". + Model string `protobuf:"bytes,3,opt,name=model" json:"model,omitempty"` +} + +func (m *LabelDetectionConfig) Reset() { *m = LabelDetectionConfig{} } +func (m *LabelDetectionConfig) String() string { return proto.CompactTextString(m) } +func (*LabelDetectionConfig) ProtoMessage() {} +func (*LabelDetectionConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *LabelDetectionConfig) GetLabelDetectionMode() LabelDetectionMode { + if m != nil { + return m.LabelDetectionMode + } + return LabelDetectionMode_LABEL_DETECTION_MODE_UNSPECIFIED +} + +func (m *LabelDetectionConfig) GetStationaryCamera() bool { + if m != nil { + return m.StationaryCamera + } + return false +} + +func (m *LabelDetectionConfig) GetModel() string { + if m != nil { + return m.Model + } + return "" +} + +// Config for SHOT_CHANGE_DETECTION. +type ShotChangeDetectionConfig struct { + // Model to use for shot change detection. + // Supported values: "builtin/stable" (the default if unset) and + // "builtin/latest". + Model string `protobuf:"bytes,1,opt,name=model" json:"model,omitempty"` +} + +func (m *ShotChangeDetectionConfig) Reset() { *m = ShotChangeDetectionConfig{} } +func (m *ShotChangeDetectionConfig) String() string { return proto.CompactTextString(m) } +func (*ShotChangeDetectionConfig) ProtoMessage() {} +func (*ShotChangeDetectionConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *ShotChangeDetectionConfig) GetModel() string { + if m != nil { + return m.Model + } + return "" +} + +// Config for EXPLICIT_CONTENT_DETECTION. +type ExplicitContentDetectionConfig struct { + // Model to use for explicit content detection. + // Supported values: "builtin/stable" (the default if unset) and + // "builtin/latest". + Model string `protobuf:"bytes,1,opt,name=model" json:"model,omitempty"` +} + +func (m *ExplicitContentDetectionConfig) Reset() { *m = ExplicitContentDetectionConfig{} } +func (m *ExplicitContentDetectionConfig) String() string { return proto.CompactTextString(m) } +func (*ExplicitContentDetectionConfig) ProtoMessage() {} +func (*ExplicitContentDetectionConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *ExplicitContentDetectionConfig) GetModel() string { + if m != nil { + return m.Model + } + return "" +} + +// Config for FACE_DETECTION. +type FaceDetectionConfig struct { + // Model to use for face detection. + // Supported values: "builtin/stable" (the default if unset) and + // "builtin/latest". + Model string `protobuf:"bytes,1,opt,name=model" json:"model,omitempty"` + // Whether bounding boxes be included in the face annotation output. + IncludeBoundingBoxes bool `protobuf:"varint,2,opt,name=include_bounding_boxes,json=includeBoundingBoxes" json:"include_bounding_boxes,omitempty"` +} + +func (m *FaceDetectionConfig) Reset() { *m = FaceDetectionConfig{} } +func (m *FaceDetectionConfig) String() string { return proto.CompactTextString(m) } +func (*FaceDetectionConfig) ProtoMessage() {} +func (*FaceDetectionConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *FaceDetectionConfig) GetModel() string { + if m != nil { + return m.Model + } + return "" +} + +func (m *FaceDetectionConfig) GetIncludeBoundingBoxes() bool { + if m != nil { + return m.IncludeBoundingBoxes + } + return false +} + +// Video segment. +type VideoSegment struct { + // Time-offset, relative to the beginning of the video, + // corresponding to the start of the segment (inclusive). + StartTimeOffset *google_protobuf3.Duration `protobuf:"bytes,1,opt,name=start_time_offset,json=startTimeOffset" json:"start_time_offset,omitempty"` + // Time-offset, relative to the beginning of the video, + // corresponding to the end of the segment (inclusive). + EndTimeOffset *google_protobuf3.Duration `protobuf:"bytes,2,opt,name=end_time_offset,json=endTimeOffset" json:"end_time_offset,omitempty"` +} + +func (m *VideoSegment) Reset() { *m = VideoSegment{} } +func (m *VideoSegment) String() string { return proto.CompactTextString(m) } +func (*VideoSegment) ProtoMessage() {} +func (*VideoSegment) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *VideoSegment) GetStartTimeOffset() *google_protobuf3.Duration { + if m != nil { + return m.StartTimeOffset + } + return nil +} + +func (m *VideoSegment) GetEndTimeOffset() *google_protobuf3.Duration { + if m != nil { + return m.EndTimeOffset + } + return nil +} + +// Video segment level annotation results for label detection. +type LabelSegment struct { + // Video segment where a label was detected. + Segment *VideoSegment `protobuf:"bytes,1,opt,name=segment" json:"segment,omitempty"` + // Confidence that the label is accurate. Range: [0, 1]. + Confidence float32 `protobuf:"fixed32,2,opt,name=confidence" json:"confidence,omitempty"` +} + +func (m *LabelSegment) Reset() { *m = LabelSegment{} } +func (m *LabelSegment) String() string { return proto.CompactTextString(m) } +func (*LabelSegment) ProtoMessage() {} +func (*LabelSegment) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *LabelSegment) GetSegment() *VideoSegment { + if m != nil { + return m.Segment + } + return nil +} + +func (m *LabelSegment) GetConfidence() float32 { + if m != nil { + return m.Confidence + } + return 0 +} + +// Video frame level annotation results for label detection. +type LabelFrame struct { + // Time-offset, relative to the beginning of the video, corresponding to the + // video frame for this location. + TimeOffset *google_protobuf3.Duration `protobuf:"bytes,1,opt,name=time_offset,json=timeOffset" json:"time_offset,omitempty"` + // Confidence that the label is accurate. Range: [0, 1]. + Confidence float32 `protobuf:"fixed32,2,opt,name=confidence" json:"confidence,omitempty"` +} + +func (m *LabelFrame) Reset() { *m = LabelFrame{} } +func (m *LabelFrame) String() string { return proto.CompactTextString(m) } +func (*LabelFrame) ProtoMessage() {} +func (*LabelFrame) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *LabelFrame) GetTimeOffset() *google_protobuf3.Duration { + if m != nil { + return m.TimeOffset + } + return nil +} + +func (m *LabelFrame) GetConfidence() float32 { + if m != nil { + return m.Confidence + } + return 0 +} + +// Detected entity from video analysis. +type Entity struct { + // Opaque entity ID. Some IDs may be available in + // [Google Knowledge Graph Search + // API](https://developers.google.com/knowledge-graph/). + EntityId string `protobuf:"bytes,1,opt,name=entity_id,json=entityId" json:"entity_id,omitempty"` + // Textual description, e.g. `Fixed-gear bicycle`. + Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` + // Language code for `description` in BCP-47 format. + LanguageCode string `protobuf:"bytes,3,opt,name=language_code,json=languageCode" json:"language_code,omitempty"` +} + +func (m *Entity) Reset() { *m = Entity{} } +func (m *Entity) String() string { return proto.CompactTextString(m) } +func (*Entity) ProtoMessage() {} +func (*Entity) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *Entity) GetEntityId() string { + if m != nil { + return m.EntityId + } + return "" +} + +func (m *Entity) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *Entity) GetLanguageCode() string { + if m != nil { + return m.LanguageCode + } + return "" +} + +// Label annotation. +type LabelAnnotation struct { + // Detected entity. + Entity *Entity `protobuf:"bytes,1,opt,name=entity" json:"entity,omitempty"` + // Common categories for the detected entity. + // E.g. when the label is `Terrier` the category is likely `dog`. And in some + // cases there might be more than one categories e.g. `Terrier` could also be + // a `pet`. + CategoryEntities []*Entity `protobuf:"bytes,2,rep,name=category_entities,json=categoryEntities" json:"category_entities,omitempty"` + // All video segments where a label was detected. + Segments []*LabelSegment `protobuf:"bytes,3,rep,name=segments" json:"segments,omitempty"` + // All video frames where a label was detected. + Frames []*LabelFrame `protobuf:"bytes,4,rep,name=frames" json:"frames,omitempty"` +} + +func (m *LabelAnnotation) Reset() { *m = LabelAnnotation{} } +func (m *LabelAnnotation) String() string { return proto.CompactTextString(m) } +func (*LabelAnnotation) ProtoMessage() {} +func (*LabelAnnotation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *LabelAnnotation) GetEntity() *Entity { + if m != nil { + return m.Entity + } + return nil +} + +func (m *LabelAnnotation) GetCategoryEntities() []*Entity { + if m != nil { + return m.CategoryEntities + } + return nil +} + +func (m *LabelAnnotation) GetSegments() []*LabelSegment { + if m != nil { + return m.Segments + } + return nil +} + +func (m *LabelAnnotation) GetFrames() []*LabelFrame { + if m != nil { + return m.Frames + } + return nil +} + +// Video frame level annotation results for explicit content. +type ExplicitContentFrame struct { + // Time-offset, relative to the beginning of the video, corresponding to the + // video frame for this location. + TimeOffset *google_protobuf3.Duration `protobuf:"bytes,1,opt,name=time_offset,json=timeOffset" json:"time_offset,omitempty"` + // Likelihood of the pornography content.. + PornographyLikelihood Likelihood `protobuf:"varint,2,opt,name=pornography_likelihood,json=pornographyLikelihood,enum=google.cloud.videointelligence.v1.Likelihood" json:"pornography_likelihood,omitempty"` +} + +func (m *ExplicitContentFrame) Reset() { *m = ExplicitContentFrame{} } +func (m *ExplicitContentFrame) String() string { return proto.CompactTextString(m) } +func (*ExplicitContentFrame) ProtoMessage() {} +func (*ExplicitContentFrame) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } + +func (m *ExplicitContentFrame) GetTimeOffset() *google_protobuf3.Duration { + if m != nil { + return m.TimeOffset + } + return nil +} + +func (m *ExplicitContentFrame) GetPornographyLikelihood() Likelihood { + if m != nil { + return m.PornographyLikelihood + } + return Likelihood_LIKELIHOOD_UNSPECIFIED +} + +// Explicit content annotation (based on per-frame visual signals only). +// If no explicit content has been detected in a frame, no annotations are +// present for that frame. +type ExplicitContentAnnotation struct { + // All video frames where explicit content was detected. + Frames []*ExplicitContentFrame `protobuf:"bytes,1,rep,name=frames" json:"frames,omitempty"` +} + +func (m *ExplicitContentAnnotation) Reset() { *m = ExplicitContentAnnotation{} } +func (m *ExplicitContentAnnotation) String() string { return proto.CompactTextString(m) } +func (*ExplicitContentAnnotation) ProtoMessage() {} +func (*ExplicitContentAnnotation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } + +func (m *ExplicitContentAnnotation) GetFrames() []*ExplicitContentFrame { + if m != nil { + return m.Frames + } + return nil +} + +// Normalized bounding box. +// The normalized vertex coordinates are relative to the original image. +// Range: [0, 1]. +type NormalizedBoundingBox struct { + // Left X coordinate. + Left float32 `protobuf:"fixed32,1,opt,name=left" json:"left,omitempty"` + // Top Y coordinate. + Top float32 `protobuf:"fixed32,2,opt,name=top" json:"top,omitempty"` + // Right X coordinate. + Right float32 `protobuf:"fixed32,3,opt,name=right" json:"right,omitempty"` + // Bottom Y coordinate. + Bottom float32 `protobuf:"fixed32,4,opt,name=bottom" json:"bottom,omitempty"` +} + +func (m *NormalizedBoundingBox) Reset() { *m = NormalizedBoundingBox{} } +func (m *NormalizedBoundingBox) String() string { return proto.CompactTextString(m) } +func (*NormalizedBoundingBox) ProtoMessage() {} +func (*NormalizedBoundingBox) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } + +func (m *NormalizedBoundingBox) GetLeft() float32 { + if m != nil { + return m.Left + } + return 0 +} + +func (m *NormalizedBoundingBox) GetTop() float32 { + if m != nil { + return m.Top + } + return 0 +} + +func (m *NormalizedBoundingBox) GetRight() float32 { + if m != nil { + return m.Right + } + return 0 +} + +func (m *NormalizedBoundingBox) GetBottom() float32 { + if m != nil { + return m.Bottom + } + return 0 +} + +// Video segment level annotation results for face detection. +type FaceSegment struct { + // Video segment where a face was detected. + Segment *VideoSegment `protobuf:"bytes,1,opt,name=segment" json:"segment,omitempty"` +} + +func (m *FaceSegment) Reset() { *m = FaceSegment{} } +func (m *FaceSegment) String() string { return proto.CompactTextString(m) } +func (*FaceSegment) ProtoMessage() {} +func (*FaceSegment) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } + +func (m *FaceSegment) GetSegment() *VideoSegment { + if m != nil { + return m.Segment + } + return nil +} + +// Video frame level annotation results for face detection. +type FaceFrame struct { + // Normalized Bounding boxes in a frame. + // There can be more than one boxes if the same face is detected in multiple + // locations within the current frame. + NormalizedBoundingBoxes []*NormalizedBoundingBox `protobuf:"bytes,1,rep,name=normalized_bounding_boxes,json=normalizedBoundingBoxes" json:"normalized_bounding_boxes,omitempty"` + // Time-offset, relative to the beginning of the video, + // corresponding to the video frame for this location. + TimeOffset *google_protobuf3.Duration `protobuf:"bytes,2,opt,name=time_offset,json=timeOffset" json:"time_offset,omitempty"` +} + +func (m *FaceFrame) Reset() { *m = FaceFrame{} } +func (m *FaceFrame) String() string { return proto.CompactTextString(m) } +func (*FaceFrame) ProtoMessage() {} +func (*FaceFrame) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } + +func (m *FaceFrame) GetNormalizedBoundingBoxes() []*NormalizedBoundingBox { + if m != nil { + return m.NormalizedBoundingBoxes + } + return nil +} + +func (m *FaceFrame) GetTimeOffset() *google_protobuf3.Duration { + if m != nil { + return m.TimeOffset + } + return nil +} + +// Face annotation. +type FaceAnnotation struct { + // Thumbnail of a representative face view (in JPEG format). + Thumbnail []byte `protobuf:"bytes,1,opt,name=thumbnail,proto3" json:"thumbnail,omitempty"` + // All video segments where a face was detected. + Segments []*FaceSegment `protobuf:"bytes,2,rep,name=segments" json:"segments,omitempty"` + // All video frames where a face was detected. + Frames []*FaceFrame `protobuf:"bytes,3,rep,name=frames" json:"frames,omitempty"` +} + +func (m *FaceAnnotation) Reset() { *m = FaceAnnotation{} } +func (m *FaceAnnotation) String() string { return proto.CompactTextString(m) } +func (*FaceAnnotation) ProtoMessage() {} +func (*FaceAnnotation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} } + +func (m *FaceAnnotation) GetThumbnail() []byte { + if m != nil { + return m.Thumbnail + } + return nil +} + +func (m *FaceAnnotation) GetSegments() []*FaceSegment { + if m != nil { + return m.Segments + } + return nil +} + +func (m *FaceAnnotation) GetFrames() []*FaceFrame { + if m != nil { + return m.Frames + } + return nil +} + +// Annotation results for a single video. +type VideoAnnotationResults struct { + // Video file location in + // [Google Cloud Storage](https://cloud.google.com/storage/). + InputUri string `protobuf:"bytes,1,opt,name=input_uri,json=inputUri" json:"input_uri,omitempty"` + // Label annotations on video level or user specified segment level. + // There is exactly one element for each unique label. + SegmentLabelAnnotations []*LabelAnnotation `protobuf:"bytes,2,rep,name=segment_label_annotations,json=segmentLabelAnnotations" json:"segment_label_annotations,omitempty"` + // Label annotations on shot level. + // There is exactly one element for each unique label. + ShotLabelAnnotations []*LabelAnnotation `protobuf:"bytes,3,rep,name=shot_label_annotations,json=shotLabelAnnotations" json:"shot_label_annotations,omitempty"` + // Label annotations on frame level. + // There is exactly one element for each unique label. + FrameLabelAnnotations []*LabelAnnotation `protobuf:"bytes,4,rep,name=frame_label_annotations,json=frameLabelAnnotations" json:"frame_label_annotations,omitempty"` + // Face annotations. There is exactly one element for each unique face. + FaceAnnotations []*FaceAnnotation `protobuf:"bytes,5,rep,name=face_annotations,json=faceAnnotations" json:"face_annotations,omitempty"` + // Shot annotations. Each shot is represented as a video segment. + ShotAnnotations []*VideoSegment `protobuf:"bytes,6,rep,name=shot_annotations,json=shotAnnotations" json:"shot_annotations,omitempty"` + // Explicit content annotation. + ExplicitAnnotation *ExplicitContentAnnotation `protobuf:"bytes,7,opt,name=explicit_annotation,json=explicitAnnotation" json:"explicit_annotation,omitempty"` + // If set, indicates an error. Note that for a single `AnnotateVideoRequest` + // some videos may succeed and some may fail. + Error *google_rpc.Status `protobuf:"bytes,9,opt,name=error" json:"error,omitempty"` +} + +func (m *VideoAnnotationResults) Reset() { *m = VideoAnnotationResults{} } +func (m *VideoAnnotationResults) String() string { return proto.CompactTextString(m) } +func (*VideoAnnotationResults) ProtoMessage() {} +func (*VideoAnnotationResults) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17} } + +func (m *VideoAnnotationResults) GetInputUri() string { + if m != nil { + return m.InputUri + } + return "" +} + +func (m *VideoAnnotationResults) GetSegmentLabelAnnotations() []*LabelAnnotation { + if m != nil { + return m.SegmentLabelAnnotations + } + return nil +} + +func (m *VideoAnnotationResults) GetShotLabelAnnotations() []*LabelAnnotation { + if m != nil { + return m.ShotLabelAnnotations + } + return nil +} + +func (m *VideoAnnotationResults) GetFrameLabelAnnotations() []*LabelAnnotation { + if m != nil { + return m.FrameLabelAnnotations + } + return nil +} + +func (m *VideoAnnotationResults) GetFaceAnnotations() []*FaceAnnotation { + if m != nil { + return m.FaceAnnotations + } + return nil +} + +func (m *VideoAnnotationResults) GetShotAnnotations() []*VideoSegment { + if m != nil { + return m.ShotAnnotations + } + return nil +} + +func (m *VideoAnnotationResults) GetExplicitAnnotation() *ExplicitContentAnnotation { + if m != nil { + return m.ExplicitAnnotation + } + return nil +} + +func (m *VideoAnnotationResults) GetError() *google_rpc.Status { + if m != nil { + return m.Error + } + return nil +} + +// Video annotation response. Included in the `response` +// field of the `Operation` returned by the `GetOperation` +// call of the `google::longrunning::Operations` service. +type AnnotateVideoResponse struct { + // Annotation results for all videos specified in `AnnotateVideoRequest`. + AnnotationResults []*VideoAnnotationResults `protobuf:"bytes,1,rep,name=annotation_results,json=annotationResults" json:"annotation_results,omitempty"` +} + +func (m *AnnotateVideoResponse) Reset() { *m = AnnotateVideoResponse{} } +func (m *AnnotateVideoResponse) String() string { return proto.CompactTextString(m) } +func (*AnnotateVideoResponse) ProtoMessage() {} +func (*AnnotateVideoResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{18} } + +func (m *AnnotateVideoResponse) GetAnnotationResults() []*VideoAnnotationResults { + if m != nil { + return m.AnnotationResults + } + return nil +} + +// Annotation progress for a single video. +type VideoAnnotationProgress struct { + // Video file location in + // [Google Cloud Storage](https://cloud.google.com/storage/). + InputUri string `protobuf:"bytes,1,opt,name=input_uri,json=inputUri" json:"input_uri,omitempty"` + // Approximate percentage processed thus far. + // Guaranteed to be 100 when fully processed. + ProgressPercent int32 `protobuf:"varint,2,opt,name=progress_percent,json=progressPercent" json:"progress_percent,omitempty"` + // Time when the request was received. + StartTime *google_protobuf4.Timestamp `protobuf:"bytes,3,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + // Time of the most recent update. + UpdateTime *google_protobuf4.Timestamp `protobuf:"bytes,4,opt,name=update_time,json=updateTime" json:"update_time,omitempty"` +} + +func (m *VideoAnnotationProgress) Reset() { *m = VideoAnnotationProgress{} } +func (m *VideoAnnotationProgress) String() string { return proto.CompactTextString(m) } +func (*VideoAnnotationProgress) ProtoMessage() {} +func (*VideoAnnotationProgress) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{19} } + +func (m *VideoAnnotationProgress) GetInputUri() string { + if m != nil { + return m.InputUri + } + return "" +} + +func (m *VideoAnnotationProgress) GetProgressPercent() int32 { + if m != nil { + return m.ProgressPercent + } + return 0 +} + +func (m *VideoAnnotationProgress) GetStartTime() *google_protobuf4.Timestamp { + if m != nil { + return m.StartTime + } + return nil +} + +func (m *VideoAnnotationProgress) GetUpdateTime() *google_protobuf4.Timestamp { + if m != nil { + return m.UpdateTime + } + return nil +} + +// Video annotation progress. Included in the `metadata` +// field of the `Operation` returned by the `GetOperation` +// call of the `google::longrunning::Operations` service. +type AnnotateVideoProgress struct { + // Progress metadata for all videos specified in `AnnotateVideoRequest`. + AnnotationProgress []*VideoAnnotationProgress `protobuf:"bytes,1,rep,name=annotation_progress,json=annotationProgress" json:"annotation_progress,omitempty"` +} + +func (m *AnnotateVideoProgress) Reset() { *m = AnnotateVideoProgress{} } +func (m *AnnotateVideoProgress) String() string { return proto.CompactTextString(m) } +func (*AnnotateVideoProgress) ProtoMessage() {} +func (*AnnotateVideoProgress) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20} } + +func (m *AnnotateVideoProgress) GetAnnotationProgress() []*VideoAnnotationProgress { + if m != nil { + return m.AnnotationProgress + } + return nil +} + +func init() { + proto.RegisterType((*AnnotateVideoRequest)(nil), "google.cloud.videointelligence.v1.AnnotateVideoRequest") + proto.RegisterType((*VideoContext)(nil), "google.cloud.videointelligence.v1.VideoContext") + proto.RegisterType((*LabelDetectionConfig)(nil), "google.cloud.videointelligence.v1.LabelDetectionConfig") + proto.RegisterType((*ShotChangeDetectionConfig)(nil), "google.cloud.videointelligence.v1.ShotChangeDetectionConfig") + proto.RegisterType((*ExplicitContentDetectionConfig)(nil), "google.cloud.videointelligence.v1.ExplicitContentDetectionConfig") + proto.RegisterType((*FaceDetectionConfig)(nil), "google.cloud.videointelligence.v1.FaceDetectionConfig") + proto.RegisterType((*VideoSegment)(nil), "google.cloud.videointelligence.v1.VideoSegment") + proto.RegisterType((*LabelSegment)(nil), "google.cloud.videointelligence.v1.LabelSegment") + proto.RegisterType((*LabelFrame)(nil), "google.cloud.videointelligence.v1.LabelFrame") + proto.RegisterType((*Entity)(nil), "google.cloud.videointelligence.v1.Entity") + proto.RegisterType((*LabelAnnotation)(nil), "google.cloud.videointelligence.v1.LabelAnnotation") + proto.RegisterType((*ExplicitContentFrame)(nil), "google.cloud.videointelligence.v1.ExplicitContentFrame") + proto.RegisterType((*ExplicitContentAnnotation)(nil), "google.cloud.videointelligence.v1.ExplicitContentAnnotation") + proto.RegisterType((*NormalizedBoundingBox)(nil), "google.cloud.videointelligence.v1.NormalizedBoundingBox") + proto.RegisterType((*FaceSegment)(nil), "google.cloud.videointelligence.v1.FaceSegment") + proto.RegisterType((*FaceFrame)(nil), "google.cloud.videointelligence.v1.FaceFrame") + proto.RegisterType((*FaceAnnotation)(nil), "google.cloud.videointelligence.v1.FaceAnnotation") + proto.RegisterType((*VideoAnnotationResults)(nil), "google.cloud.videointelligence.v1.VideoAnnotationResults") + proto.RegisterType((*AnnotateVideoResponse)(nil), "google.cloud.videointelligence.v1.AnnotateVideoResponse") + proto.RegisterType((*VideoAnnotationProgress)(nil), "google.cloud.videointelligence.v1.VideoAnnotationProgress") + proto.RegisterType((*AnnotateVideoProgress)(nil), "google.cloud.videointelligence.v1.AnnotateVideoProgress") + proto.RegisterEnum("google.cloud.videointelligence.v1.Feature", Feature_name, Feature_value) + proto.RegisterEnum("google.cloud.videointelligence.v1.LabelDetectionMode", LabelDetectionMode_name, LabelDetectionMode_value) + proto.RegisterEnum("google.cloud.videointelligence.v1.Likelihood", Likelihood_name, Likelihood_value) +} + +// 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 + +// Client API for VideoIntelligenceService service + +type VideoIntelligenceServiceClient interface { + // Performs asynchronous video annotation. Progress and results can be + // retrieved through the `google.longrunning.Operations` interface. + // `Operation.metadata` contains `AnnotateVideoProgress` (progress). + // `Operation.response` contains `AnnotateVideoResponse` (results). + AnnotateVideo(ctx context.Context, in *AnnotateVideoRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) +} + +type videoIntelligenceServiceClient struct { + cc *grpc.ClientConn +} + +func NewVideoIntelligenceServiceClient(cc *grpc.ClientConn) VideoIntelligenceServiceClient { + return &videoIntelligenceServiceClient{cc} +} + +func (c *videoIntelligenceServiceClient) AnnotateVideo(ctx context.Context, in *AnnotateVideoRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.cloud.videointelligence.v1.VideoIntelligenceService/AnnotateVideo", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for VideoIntelligenceService service + +type VideoIntelligenceServiceServer interface { + // Performs asynchronous video annotation. Progress and results can be + // retrieved through the `google.longrunning.Operations` interface. + // `Operation.metadata` contains `AnnotateVideoProgress` (progress). + // `Operation.response` contains `AnnotateVideoResponse` (results). + AnnotateVideo(context.Context, *AnnotateVideoRequest) (*google_longrunning.Operation, error) +} + +func RegisterVideoIntelligenceServiceServer(s *grpc.Server, srv VideoIntelligenceServiceServer) { + s.RegisterService(&_VideoIntelligenceService_serviceDesc, srv) +} + +func _VideoIntelligenceService_AnnotateVideo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AnnotateVideoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VideoIntelligenceServiceServer).AnnotateVideo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.videointelligence.v1.VideoIntelligenceService/AnnotateVideo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VideoIntelligenceServiceServer).AnnotateVideo(ctx, req.(*AnnotateVideoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _VideoIntelligenceService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.cloud.videointelligence.v1.VideoIntelligenceService", + HandlerType: (*VideoIntelligenceServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "AnnotateVideo", + Handler: _VideoIntelligenceService_AnnotateVideo_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/cloud/videointelligence/v1/video_intelligence.proto", +} + +func init() { + proto.RegisterFile("google/cloud/videointelligence/v1/video_intelligence.proto", fileDescriptor0) +} + +var fileDescriptor0 = []byte{ + // 1705 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0xcd, 0x73, 0xe3, 0x48, + 0x15, 0x47, 0xb6, 0x93, 0x89, 0x5f, 0xbe, 0x3c, 0x9d, 0x2f, 0x27, 0xcc, 0x64, 0x33, 0x5a, 0xa8, + 0xca, 0x06, 0xb0, 0x2b, 0x01, 0x76, 0xd9, 0x2c, 0x17, 0xc7, 0x51, 0x76, 0xcc, 0x66, 0xe2, 0x54, + 0xdb, 0x93, 0xda, 0xdd, 0x9a, 0x2a, 0x95, 0x22, 0xb5, 0x65, 0xed, 0xc8, 0x6a, 0x21, 0xb5, 0x52, + 0x13, 0xaa, 0x38, 0x40, 0x51, 0x70, 0xe1, 0xc6, 0x85, 0x3f, 0x80, 0x13, 0x7f, 0x00, 0xc5, 0x85, + 0xaa, 0x2d, 0x8a, 0x13, 0x07, 0x2e, 0x9c, 0xb8, 0xef, 0x1f, 0x42, 0xa9, 0xbb, 0x65, 0x2b, 0x92, + 0x33, 0x91, 0x07, 0x6e, 0xea, 0xf7, 0xf1, 0x7b, 0xaf, 0xdf, 0x57, 0x77, 0x0b, 0x8e, 0x6d, 0x4a, + 0x6d, 0x97, 0x34, 0x4d, 0x97, 0x46, 0x56, 0xf3, 0xc6, 0xb1, 0x08, 0x75, 0x3c, 0x46, 0x5c, 0xd7, + 0xb1, 0x89, 0x67, 0x92, 0xe6, 0xcd, 0xa1, 0x20, 0xea, 0x69, 0x6a, 0xc3, 0x0f, 0x28, 0xa3, 0xe8, + 0x99, 0xd0, 0x6d, 0x70, 0xdd, 0x46, 0x4e, 0xb7, 0x71, 0x73, 0xb8, 0xf3, 0x44, 0xc2, 0x1b, 0xbe, + 0xd3, 0x34, 0x3c, 0x8f, 0x32, 0x83, 0x39, 0xd4, 0x0b, 0x05, 0xc0, 0xce, 0xfb, 0x92, 0xeb, 0x52, + 0xcf, 0x0e, 0x22, 0xcf, 0x73, 0x3c, 0xbb, 0x49, 0x7d, 0x12, 0xdc, 0x11, 0xda, 0x95, 0x42, 0x7c, + 0x75, 0x1d, 0x0d, 0x9a, 0x56, 0x24, 0x04, 0x24, 0xff, 0xbd, 0x2c, 0x9f, 0x39, 0x23, 0x12, 0x32, + 0x63, 0xe4, 0x4b, 0x81, 0x2d, 0x29, 0x10, 0xf8, 0x66, 0x33, 0x64, 0x06, 0x8b, 0x24, 0xb2, 0xfa, + 0x97, 0x12, 0xac, 0xb7, 0x84, 0x53, 0xe4, 0x2a, 0xf6, 0x1e, 0x93, 0x9f, 0x47, 0x24, 0x64, 0xe8, + 0xdb, 0x50, 0x75, 0x3c, 0x3f, 0x62, 0x7a, 0x14, 0x38, 0x75, 0x65, 0x4f, 0xd9, 0xaf, 0xe2, 0x05, + 0x4e, 0x78, 0x19, 0x38, 0xe8, 0x7d, 0x58, 0x16, 0x4c, 0x93, 0x7a, 0x8c, 0x78, 0xac, 0x3e, 0xbf, + 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, 0x47, 0xb0, 0x36, 0xbe, 0x68, 0x4f, 0xf0, 0xeb, 0x8f, 0x0a, 0xdf, 0xef, 0xef, 0x9d, 0x96, + 0x18, 0x25, 0xc0, 0xa9, 0xb6, 0xda, 0x87, 0x39, 0x12, 0x04, 0x34, 0xa8, 0x57, 0xb9, 0x01, 0x94, + 0x18, 0x08, 0x7c, 0xb3, 0xd1, 0xe3, 0xcf, 0x50, 0x2c, 0x04, 0xd4, 0x5f, 0x29, 0xb0, 0x91, 0x79, + 0x87, 0x86, 0x3e, 0xf5, 0x42, 0x82, 0x86, 0x80, 0x26, 0x9e, 0xea, 0x81, 0xa8, 0x72, 0x39, 0x58, + 0x3e, 0x2e, 0x1a, 0x90, 0x5c, 0x9b, 0xe0, 0xc7, 0x46, 0x96, 0xa4, 0xfe, 0x47, 0x81, 0xad, 0x8c, + 0xf4, 0x65, 0x40, 0xed, 0x80, 0x84, 0x0f, 0x74, 0xd5, 0x07, 0x50, 0xf3, 0xa5, 0xa0, 0xee, 0x93, + 0xc0, 0x8c, 0x87, 0x6c, 0x3c, 0x91, 0xe6, 0xf0, 0x6a, 0x42, 0xbf, 0x14, 0x64, 0xf4, 0x31, 0xc0, + 0xe4, 0x2e, 0x29, 0xdf, 0x55, 0x3b, 0xb9, 0xb1, 0xd5, 0x4f, 0x9e, 0xef, 0xb8, 0x3a, 0xbe, 0x45, + 0xa2, 0x4f, 0x60, 0x31, 0xf2, 0x2d, 0x83, 0x11, 0xa1, 0x5b, 0x79, 0x50, 0x17, 0x84, 0x78, 0x4c, + 0x50, 0x7f, 0x93, 0x8d, 0xef, 0x78, 0x67, 0xaf, 0x61, 0x2d, 0x15, 0xdf, 0xc4, 0x5f, 0x19, 0xe0, + 0xe3, 0xd9, 0x03, 0x9c, 0x00, 0xe3, 0x54, 0xda, 0x12, 0xda, 0xc1, 0x6f, 0x15, 0x78, 0x24, 0x5f, + 0xf8, 0x68, 0x0b, 0xd6, 0xce, 0xb4, 0x56, 0xff, 0x25, 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2a, 0x09, 0x73, + 0x47, 0x7f, 0x52, 0xa0, 0xce, 0x53, 0xd4, 0x49, 0xe5, 0xad, 0x47, 0x82, 0x1b, 0xc7, 0x24, 0xe8, + 0x77, 0x0a, 0x2c, 0xdf, 0x29, 0x0b, 0x54, 0xe4, 0x92, 0x33, 0xed, 0x87, 0xd1, 0xce, 0xd3, 0x44, + 0x31, 0xf5, 0x27, 0xab, 0xd1, 0x4d, 0xfe, 0x64, 0xa9, 0xbb, 0xbf, 0xfe, 0xf7, 0x37, 0x7f, 0x28, + 0xd5, 0xd5, 0xb5, 0xf1, 0xef, 0xb4, 0xf0, 0x58, 0x16, 0x08, 0x39, 0x56, 0x0e, 0x4e, 0xbe, 0x51, + 0xe0, 0xbb, 0x26, 0x1d, 0x3d, 0x6c, 0xfd, 0xe4, 0xe9, 0x7d, 0xbb, 0xb9, 0x8c, 0x5b, 0xe0, 0x52, + 0xf9, 0x12, 0x4b, 0x0c, 0x9b, 0xc6, 0x37, 0xfd, 0x06, 0x0d, 0xec, 0xa6, 0x4d, 0x3c, 0xde, 0x20, + 0x4d, 0xc1, 0x32, 0x7c, 0x27, 0x7c, 0xcb, 0xef, 0xbe, 0x4f, 0x72, 0xc4, 0x3f, 0x97, 0x9e, 0x7d, + 0x2a, 0x40, 0xdb, 0xdc, 0xb1, 0x9c, 0x0b, 0x8d, 0xab, 0xc3, 0x7f, 0x26, 0x32, 0xaf, 0xb8, 0xcc, + 0xab, 0x9c, 0xcc, 0xab, 0xab, 0xc3, 0xeb, 0x79, 0xee, 0xc6, 0x0f, 0xff, 0x1b, 0x00, 0x00, 0xff, + 0xff, 0xa3, 0x97, 0x20, 0x48, 0x74, 0x14, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/videointelligence/v1beta1/video_intelligence.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/videointelligence/v1beta1/video_intelligence.pb.go new file mode 100644 index 0000000000..c9f821ff35 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/videointelligence/v1beta1/video_intelligence.pb.go @@ -0,0 +1,990 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/videointelligence/v1beta1/video_intelligence.proto + +/* +Package videointelligence is a generated protocol buffer package. + +It is generated from these files: + google/cloud/videointelligence/v1beta1/video_intelligence.proto + +It has these top-level messages: + AnnotateVideoRequest + VideoContext + VideoSegment + LabelLocation + LabelAnnotation + SafeSearchAnnotation + BoundingBox + FaceLocation + FaceAnnotation + VideoAnnotationResults + AnnotateVideoResponse + VideoAnnotationProgress + AnnotateVideoProgress +*/ +package videointelligence + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_longrunning "google.golang.org/genproto/googleapis/longrunning" +import google_protobuf3 "github.com/golang/protobuf/ptypes/timestamp" +import google_rpc "google.golang.org/genproto/googleapis/rpc/status" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Video annotation feature. +type Feature int32 + +const ( + // Unspecified. + Feature_FEATURE_UNSPECIFIED Feature = 0 + // Label detection. Detect objects, such as dog or flower. + Feature_LABEL_DETECTION Feature = 1 + // Human face detection and tracking. + Feature_FACE_DETECTION Feature = 2 + // Shot change detection. + Feature_SHOT_CHANGE_DETECTION Feature = 3 + // Safe search detection. + Feature_SAFE_SEARCH_DETECTION Feature = 4 +) + +var Feature_name = map[int32]string{ + 0: "FEATURE_UNSPECIFIED", + 1: "LABEL_DETECTION", + 2: "FACE_DETECTION", + 3: "SHOT_CHANGE_DETECTION", + 4: "SAFE_SEARCH_DETECTION", +} +var Feature_value = map[string]int32{ + "FEATURE_UNSPECIFIED": 0, + "LABEL_DETECTION": 1, + "FACE_DETECTION": 2, + "SHOT_CHANGE_DETECTION": 3, + "SAFE_SEARCH_DETECTION": 4, +} + +func (x Feature) String() string { + return proto.EnumName(Feature_name, int32(x)) +} +func (Feature) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +// Label level (scope). +type LabelLevel int32 + +const ( + // Unspecified. + LabelLevel_LABEL_LEVEL_UNSPECIFIED LabelLevel = 0 + // Video-level. Corresponds to the whole video. + LabelLevel_VIDEO_LEVEL LabelLevel = 1 + // Segment-level. Corresponds to one of `AnnotateSpec.segments`. + LabelLevel_SEGMENT_LEVEL LabelLevel = 2 + // Shot-level. Corresponds to a single shot (i.e. a series of frames + // without a major camera position or background change). + LabelLevel_SHOT_LEVEL LabelLevel = 3 + // Frame-level. Corresponds to a single video frame. + LabelLevel_FRAME_LEVEL LabelLevel = 4 +) + +var LabelLevel_name = map[int32]string{ + 0: "LABEL_LEVEL_UNSPECIFIED", + 1: "VIDEO_LEVEL", + 2: "SEGMENT_LEVEL", + 3: "SHOT_LEVEL", + 4: "FRAME_LEVEL", +} +var LabelLevel_value = map[string]int32{ + "LABEL_LEVEL_UNSPECIFIED": 0, + "VIDEO_LEVEL": 1, + "SEGMENT_LEVEL": 2, + "SHOT_LEVEL": 3, + "FRAME_LEVEL": 4, +} + +func (x LabelLevel) String() string { + return proto.EnumName(LabelLevel_name, int32(x)) +} +func (LabelLevel) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +// Label detection mode. +type LabelDetectionMode int32 + +const ( + // Unspecified. + LabelDetectionMode_LABEL_DETECTION_MODE_UNSPECIFIED LabelDetectionMode = 0 + // Detect shot-level labels. + LabelDetectionMode_SHOT_MODE LabelDetectionMode = 1 + // Detect frame-level labels. + LabelDetectionMode_FRAME_MODE LabelDetectionMode = 2 + // Detect both shot-level and frame-level labels. + LabelDetectionMode_SHOT_AND_FRAME_MODE LabelDetectionMode = 3 +) + +var LabelDetectionMode_name = map[int32]string{ + 0: "LABEL_DETECTION_MODE_UNSPECIFIED", + 1: "SHOT_MODE", + 2: "FRAME_MODE", + 3: "SHOT_AND_FRAME_MODE", +} +var LabelDetectionMode_value = map[string]int32{ + "LABEL_DETECTION_MODE_UNSPECIFIED": 0, + "SHOT_MODE": 1, + "FRAME_MODE": 2, + "SHOT_AND_FRAME_MODE": 3, +} + +func (x LabelDetectionMode) String() string { + return proto.EnumName(LabelDetectionMode_name, int32(x)) +} +func (LabelDetectionMode) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +// Bucketized representation of likelihood. +type Likelihood int32 + +const ( + // Unknown likelihood. + Likelihood_UNKNOWN Likelihood = 0 + // Very unlikely. + Likelihood_VERY_UNLIKELY Likelihood = 1 + // Unlikely. + Likelihood_UNLIKELY Likelihood = 2 + // Possible. + Likelihood_POSSIBLE Likelihood = 3 + // Likely. + Likelihood_LIKELY Likelihood = 4 + // Very likely. + Likelihood_VERY_LIKELY Likelihood = 5 +) + +var Likelihood_name = map[int32]string{ + 0: "UNKNOWN", + 1: "VERY_UNLIKELY", + 2: "UNLIKELY", + 3: "POSSIBLE", + 4: "LIKELY", + 5: "VERY_LIKELY", +} +var Likelihood_value = map[string]int32{ + "UNKNOWN": 0, + "VERY_UNLIKELY": 1, + "UNLIKELY": 2, + "POSSIBLE": 3, + "LIKELY": 4, + "VERY_LIKELY": 5, +} + +func (x Likelihood) String() string { + return proto.EnumName(Likelihood_name, int32(x)) +} +func (Likelihood) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +// Video annotation request. +type AnnotateVideoRequest struct { + // Input video location. Currently, only + // [Google Cloud Storage](https://cloud.google.com/storage/) URIs are + // supported, which must be specified in the following format: + // `gs://bucket-id/object-id` (other URI formats return + // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see + // [Request URIs](/storage/docs/reference-uris). + // A video URI may include wildcards in `object-id`, and thus identify + // multiple videos. Supported wildcards: '*' to match 0 or more characters; + // '?' to match 1 character. If unset, the input video should be embedded + // in the request as `input_content`. If set, `input_content` should be unset. + InputUri string `protobuf:"bytes,1,opt,name=input_uri,json=inputUri" json:"input_uri,omitempty"` + // The video data bytes. Encoding: base64. If unset, the input video(s) + // should be specified via `input_uri`. If set, `input_uri` should be unset. + InputContent string `protobuf:"bytes,6,opt,name=input_content,json=inputContent" json:"input_content,omitempty"` + // Requested video annotation features. + Features []Feature `protobuf:"varint,2,rep,packed,name=features,enum=google.cloud.videointelligence.v1beta1.Feature" json:"features,omitempty"` + // Additional video context and/or feature-specific parameters. + VideoContext *VideoContext `protobuf:"bytes,3,opt,name=video_context,json=videoContext" json:"video_context,omitempty"` + // Optional location where the output (in JSON format) should be stored. + // Currently, only [Google Cloud Storage](https://cloud.google.com/storage/) + // URIs are supported, which must be specified in the following format: + // `gs://bucket-id/object-id` (other URI formats return + // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see + // [Request URIs](/storage/docs/reference-uris). + OutputUri string `protobuf:"bytes,4,opt,name=output_uri,json=outputUri" json:"output_uri,omitempty"` + // Optional cloud region where annotation should take place. Supported cloud + // regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region + // is specified, a region will be determined based on video file location. + LocationId string `protobuf:"bytes,5,opt,name=location_id,json=locationId" json:"location_id,omitempty"` +} + +func (m *AnnotateVideoRequest) Reset() { *m = AnnotateVideoRequest{} } +func (m *AnnotateVideoRequest) String() string { return proto.CompactTextString(m) } +func (*AnnotateVideoRequest) ProtoMessage() {} +func (*AnnotateVideoRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *AnnotateVideoRequest) GetInputUri() string { + if m != nil { + return m.InputUri + } + return "" +} + +func (m *AnnotateVideoRequest) GetInputContent() string { + if m != nil { + return m.InputContent + } + return "" +} + +func (m *AnnotateVideoRequest) GetFeatures() []Feature { + if m != nil { + return m.Features + } + return nil +} + +func (m *AnnotateVideoRequest) GetVideoContext() *VideoContext { + if m != nil { + return m.VideoContext + } + return nil +} + +func (m *AnnotateVideoRequest) GetOutputUri() string { + if m != nil { + return m.OutputUri + } + return "" +} + +func (m *AnnotateVideoRequest) GetLocationId() string { + if m != nil { + return m.LocationId + } + return "" +} + +// Video context and/or feature-specific parameters. +type VideoContext struct { + // Video segments to annotate. The segments may overlap and are not required + // to be contiguous or span the whole video. If unspecified, each video + // is treated as a single segment. + Segments []*VideoSegment `protobuf:"bytes,1,rep,name=segments" json:"segments,omitempty"` + // If label detection has been requested, what labels should be detected + // in addition to video-level labels or segment-level labels. If unspecified, + // defaults to `SHOT_MODE`. + LabelDetectionMode LabelDetectionMode `protobuf:"varint,2,opt,name=label_detection_mode,json=labelDetectionMode,enum=google.cloud.videointelligence.v1beta1.LabelDetectionMode" json:"label_detection_mode,omitempty"` + // Whether the video has been shot from a stationary (i.e. non-moving) camera. + // When set to true, might improve detection accuracy for moving objects. + StationaryCamera bool `protobuf:"varint,3,opt,name=stationary_camera,json=stationaryCamera" json:"stationary_camera,omitempty"` + // Model to use for label detection. + // Supported values: "latest" and "stable" (the default). + LabelDetectionModel string `protobuf:"bytes,4,opt,name=label_detection_model,json=labelDetectionModel" json:"label_detection_model,omitempty"` + // Model to use for face detection. + // Supported values: "latest" and "stable" (the default). + FaceDetectionModel string `protobuf:"bytes,5,opt,name=face_detection_model,json=faceDetectionModel" json:"face_detection_model,omitempty"` + // Model to use for shot change detection. + // Supported values: "latest" and "stable" (the default). + ShotChangeDetectionModel string `protobuf:"bytes,6,opt,name=shot_change_detection_model,json=shotChangeDetectionModel" json:"shot_change_detection_model,omitempty"` + // Model to use for safe search detection. + // Supported values: "latest" and "stable" (the default). + SafeSearchDetectionModel string `protobuf:"bytes,7,opt,name=safe_search_detection_model,json=safeSearchDetectionModel" json:"safe_search_detection_model,omitempty"` +} + +func (m *VideoContext) Reset() { *m = VideoContext{} } +func (m *VideoContext) String() string { return proto.CompactTextString(m) } +func (*VideoContext) ProtoMessage() {} +func (*VideoContext) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *VideoContext) GetSegments() []*VideoSegment { + if m != nil { + return m.Segments + } + return nil +} + +func (m *VideoContext) GetLabelDetectionMode() LabelDetectionMode { + if m != nil { + return m.LabelDetectionMode + } + return LabelDetectionMode_LABEL_DETECTION_MODE_UNSPECIFIED +} + +func (m *VideoContext) GetStationaryCamera() bool { + if m != nil { + return m.StationaryCamera + } + return false +} + +func (m *VideoContext) GetLabelDetectionModel() string { + if m != nil { + return m.LabelDetectionModel + } + return "" +} + +func (m *VideoContext) GetFaceDetectionModel() string { + if m != nil { + return m.FaceDetectionModel + } + return "" +} + +func (m *VideoContext) GetShotChangeDetectionModel() string { + if m != nil { + return m.ShotChangeDetectionModel + } + return "" +} + +func (m *VideoContext) GetSafeSearchDetectionModel() string { + if m != nil { + return m.SafeSearchDetectionModel + } + return "" +} + +// Video segment. +type VideoSegment struct { + // Start offset in microseconds (inclusive). Unset means 0. + StartTimeOffset int64 `protobuf:"varint,1,opt,name=start_time_offset,json=startTimeOffset" json:"start_time_offset,omitempty"` + // End offset in microseconds (inclusive). Unset means 0. + EndTimeOffset int64 `protobuf:"varint,2,opt,name=end_time_offset,json=endTimeOffset" json:"end_time_offset,omitempty"` +} + +func (m *VideoSegment) Reset() { *m = VideoSegment{} } +func (m *VideoSegment) String() string { return proto.CompactTextString(m) } +func (*VideoSegment) ProtoMessage() {} +func (*VideoSegment) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *VideoSegment) GetStartTimeOffset() int64 { + if m != nil { + return m.StartTimeOffset + } + return 0 +} + +func (m *VideoSegment) GetEndTimeOffset() int64 { + if m != nil { + return m.EndTimeOffset + } + return 0 +} + +// Label location. +type LabelLocation struct { + // Video segment. Set to [-1, -1] for video-level labels. + // Set to [timestamp, timestamp] for frame-level labels. + // Otherwise, corresponds to one of `AnnotateSpec.segments` + // (if specified) or to shot boundaries (if requested). + Segment *VideoSegment `protobuf:"bytes,1,opt,name=segment" json:"segment,omitempty"` + // Confidence that the label is accurate. Range: [0, 1]. + Confidence float32 `protobuf:"fixed32,2,opt,name=confidence" json:"confidence,omitempty"` + // Label level. + Level LabelLevel `protobuf:"varint,3,opt,name=level,enum=google.cloud.videointelligence.v1beta1.LabelLevel" json:"level,omitempty"` +} + +func (m *LabelLocation) Reset() { *m = LabelLocation{} } +func (m *LabelLocation) String() string { return proto.CompactTextString(m) } +func (*LabelLocation) ProtoMessage() {} +func (*LabelLocation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *LabelLocation) GetSegment() *VideoSegment { + if m != nil { + return m.Segment + } + return nil +} + +func (m *LabelLocation) GetConfidence() float32 { + if m != nil { + return m.Confidence + } + return 0 +} + +func (m *LabelLocation) GetLevel() LabelLevel { + if m != nil { + return m.Level + } + return LabelLevel_LABEL_LEVEL_UNSPECIFIED +} + +// Label annotation. +type LabelAnnotation struct { + // Textual description, e.g. `Fixed-gear bicycle`. + Description string `protobuf:"bytes,1,opt,name=description" json:"description,omitempty"` + // Language code for `description` in BCP-47 format. + LanguageCode string `protobuf:"bytes,2,opt,name=language_code,json=languageCode" json:"language_code,omitempty"` + // Where the label was detected and with what confidence. + Locations []*LabelLocation `protobuf:"bytes,3,rep,name=locations" json:"locations,omitempty"` +} + +func (m *LabelAnnotation) Reset() { *m = LabelAnnotation{} } +func (m *LabelAnnotation) String() string { return proto.CompactTextString(m) } +func (*LabelAnnotation) ProtoMessage() {} +func (*LabelAnnotation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *LabelAnnotation) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *LabelAnnotation) GetLanguageCode() string { + if m != nil { + return m.LanguageCode + } + return "" +} + +func (m *LabelAnnotation) GetLocations() []*LabelLocation { + if m != nil { + return m.Locations + } + return nil +} + +// Safe search annotation (based on per-frame visual signals only). +// If no unsafe content has been detected in a frame, no annotations +// are present for that frame. If only some types of unsafe content +// have been detected in a frame, the likelihood is set to `UNKNOWN` +// for all other types of unsafe content. +type SafeSearchAnnotation struct { + // Likelihood of adult content. + Adult Likelihood `protobuf:"varint,1,opt,name=adult,enum=google.cloud.videointelligence.v1beta1.Likelihood" json:"adult,omitempty"` + // Likelihood that an obvious modification was made to the original + // version to make it appear funny or offensive. + Spoof Likelihood `protobuf:"varint,2,opt,name=spoof,enum=google.cloud.videointelligence.v1beta1.Likelihood" json:"spoof,omitempty"` + // Likelihood of medical content. + Medical Likelihood `protobuf:"varint,3,opt,name=medical,enum=google.cloud.videointelligence.v1beta1.Likelihood" json:"medical,omitempty"` + // Likelihood of violent content. + Violent Likelihood `protobuf:"varint,4,opt,name=violent,enum=google.cloud.videointelligence.v1beta1.Likelihood" json:"violent,omitempty"` + // Likelihood of racy content. + Racy Likelihood `protobuf:"varint,5,opt,name=racy,enum=google.cloud.videointelligence.v1beta1.Likelihood" json:"racy,omitempty"` + // Video time offset in microseconds. + TimeOffset int64 `protobuf:"varint,6,opt,name=time_offset,json=timeOffset" json:"time_offset,omitempty"` +} + +func (m *SafeSearchAnnotation) Reset() { *m = SafeSearchAnnotation{} } +func (m *SafeSearchAnnotation) String() string { return proto.CompactTextString(m) } +func (*SafeSearchAnnotation) ProtoMessage() {} +func (*SafeSearchAnnotation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *SafeSearchAnnotation) GetAdult() Likelihood { + if m != nil { + return m.Adult + } + return Likelihood_UNKNOWN +} + +func (m *SafeSearchAnnotation) GetSpoof() Likelihood { + if m != nil { + return m.Spoof + } + return Likelihood_UNKNOWN +} + +func (m *SafeSearchAnnotation) GetMedical() Likelihood { + if m != nil { + return m.Medical + } + return Likelihood_UNKNOWN +} + +func (m *SafeSearchAnnotation) GetViolent() Likelihood { + if m != nil { + return m.Violent + } + return Likelihood_UNKNOWN +} + +func (m *SafeSearchAnnotation) GetRacy() Likelihood { + if m != nil { + return m.Racy + } + return Likelihood_UNKNOWN +} + +func (m *SafeSearchAnnotation) GetTimeOffset() int64 { + if m != nil { + return m.TimeOffset + } + return 0 +} + +// Bounding box. +type BoundingBox struct { + // Left X coordinate. + Left int32 `protobuf:"varint,1,opt,name=left" json:"left,omitempty"` + // Right X coordinate. + Right int32 `protobuf:"varint,2,opt,name=right" json:"right,omitempty"` + // Bottom Y coordinate. + Bottom int32 `protobuf:"varint,3,opt,name=bottom" json:"bottom,omitempty"` + // Top Y coordinate. + Top int32 `protobuf:"varint,4,opt,name=top" json:"top,omitempty"` +} + +func (m *BoundingBox) Reset() { *m = BoundingBox{} } +func (m *BoundingBox) String() string { return proto.CompactTextString(m) } +func (*BoundingBox) ProtoMessage() {} +func (*BoundingBox) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *BoundingBox) GetLeft() int32 { + if m != nil { + return m.Left + } + return 0 +} + +func (m *BoundingBox) GetRight() int32 { + if m != nil { + return m.Right + } + return 0 +} + +func (m *BoundingBox) GetBottom() int32 { + if m != nil { + return m.Bottom + } + return 0 +} + +func (m *BoundingBox) GetTop() int32 { + if m != nil { + return m.Top + } + return 0 +} + +// Face location. +type FaceLocation struct { + // Bounding box in a frame. + BoundingBox *BoundingBox `protobuf:"bytes,1,opt,name=bounding_box,json=boundingBox" json:"bounding_box,omitempty"` + // Video time offset in microseconds. + TimeOffset int64 `protobuf:"varint,2,opt,name=time_offset,json=timeOffset" json:"time_offset,omitempty"` +} + +func (m *FaceLocation) Reset() { *m = FaceLocation{} } +func (m *FaceLocation) String() string { return proto.CompactTextString(m) } +func (*FaceLocation) ProtoMessage() {} +func (*FaceLocation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *FaceLocation) GetBoundingBox() *BoundingBox { + if m != nil { + return m.BoundingBox + } + return nil +} + +func (m *FaceLocation) GetTimeOffset() int64 { + if m != nil { + return m.TimeOffset + } + return 0 +} + +// Face annotation. +type FaceAnnotation struct { + // Thumbnail of a representative face view (in JPEG format). Encoding: base64. + Thumbnail string `protobuf:"bytes,1,opt,name=thumbnail" json:"thumbnail,omitempty"` + // All locations where a face was detected. + // Faces are detected and tracked on a per-video basis + // (as opposed to across multiple videos). + Segments []*VideoSegment `protobuf:"bytes,2,rep,name=segments" json:"segments,omitempty"` + // Face locations at one frame per second. + Locations []*FaceLocation `protobuf:"bytes,3,rep,name=locations" json:"locations,omitempty"` +} + +func (m *FaceAnnotation) Reset() { *m = FaceAnnotation{} } +func (m *FaceAnnotation) String() string { return proto.CompactTextString(m) } +func (*FaceAnnotation) ProtoMessage() {} +func (*FaceAnnotation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *FaceAnnotation) GetThumbnail() string { + if m != nil { + return m.Thumbnail + } + return "" +} + +func (m *FaceAnnotation) GetSegments() []*VideoSegment { + if m != nil { + return m.Segments + } + return nil +} + +func (m *FaceAnnotation) GetLocations() []*FaceLocation { + if m != nil { + return m.Locations + } + return nil +} + +// Annotation results for a single video. +type VideoAnnotationResults struct { + // Video file location in + // [Google Cloud Storage](https://cloud.google.com/storage/). + InputUri string `protobuf:"bytes,1,opt,name=input_uri,json=inputUri" json:"input_uri,omitempty"` + // Label annotations. There is exactly one element for each unique label. + LabelAnnotations []*LabelAnnotation `protobuf:"bytes,2,rep,name=label_annotations,json=labelAnnotations" json:"label_annotations,omitempty"` + // Face annotations. There is exactly one element for each unique face. + FaceAnnotations []*FaceAnnotation `protobuf:"bytes,3,rep,name=face_annotations,json=faceAnnotations" json:"face_annotations,omitempty"` + // Shot annotations. Each shot is represented as a video segment. + ShotAnnotations []*VideoSegment `protobuf:"bytes,4,rep,name=shot_annotations,json=shotAnnotations" json:"shot_annotations,omitempty"` + // Safe search annotations. + SafeSearchAnnotations []*SafeSearchAnnotation `protobuf:"bytes,6,rep,name=safe_search_annotations,json=safeSearchAnnotations" json:"safe_search_annotations,omitempty"` + // If set, indicates an error. Note that for a single `AnnotateVideoRequest` + // some videos may succeed and some may fail. + Error *google_rpc.Status `protobuf:"bytes,5,opt,name=error" json:"error,omitempty"` +} + +func (m *VideoAnnotationResults) Reset() { *m = VideoAnnotationResults{} } +func (m *VideoAnnotationResults) String() string { return proto.CompactTextString(m) } +func (*VideoAnnotationResults) ProtoMessage() {} +func (*VideoAnnotationResults) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *VideoAnnotationResults) GetInputUri() string { + if m != nil { + return m.InputUri + } + return "" +} + +func (m *VideoAnnotationResults) GetLabelAnnotations() []*LabelAnnotation { + if m != nil { + return m.LabelAnnotations + } + return nil +} + +func (m *VideoAnnotationResults) GetFaceAnnotations() []*FaceAnnotation { + if m != nil { + return m.FaceAnnotations + } + return nil +} + +func (m *VideoAnnotationResults) GetShotAnnotations() []*VideoSegment { + if m != nil { + return m.ShotAnnotations + } + return nil +} + +func (m *VideoAnnotationResults) GetSafeSearchAnnotations() []*SafeSearchAnnotation { + if m != nil { + return m.SafeSearchAnnotations + } + return nil +} + +func (m *VideoAnnotationResults) GetError() *google_rpc.Status { + if m != nil { + return m.Error + } + return nil +} + +// Video annotation response. Included in the `response` +// field of the `Operation` returned by the `GetOperation` +// call of the `google::longrunning::Operations` service. +type AnnotateVideoResponse struct { + // Annotation results for all videos specified in `AnnotateVideoRequest`. + AnnotationResults []*VideoAnnotationResults `protobuf:"bytes,1,rep,name=annotation_results,json=annotationResults" json:"annotation_results,omitempty"` +} + +func (m *AnnotateVideoResponse) Reset() { *m = AnnotateVideoResponse{} } +func (m *AnnotateVideoResponse) String() string { return proto.CompactTextString(m) } +func (*AnnotateVideoResponse) ProtoMessage() {} +func (*AnnotateVideoResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *AnnotateVideoResponse) GetAnnotationResults() []*VideoAnnotationResults { + if m != nil { + return m.AnnotationResults + } + return nil +} + +// Annotation progress for a single video. +type VideoAnnotationProgress struct { + // Video file location in + // [Google Cloud Storage](https://cloud.google.com/storage/). + InputUri string `protobuf:"bytes,1,opt,name=input_uri,json=inputUri" json:"input_uri,omitempty"` + // Approximate percentage processed thus far. + // Guaranteed to be 100 when fully processed. + ProgressPercent int32 `protobuf:"varint,2,opt,name=progress_percent,json=progressPercent" json:"progress_percent,omitempty"` + // Time when the request was received. + StartTime *google_protobuf3.Timestamp `protobuf:"bytes,3,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + // Time of the most recent update. + UpdateTime *google_protobuf3.Timestamp `protobuf:"bytes,4,opt,name=update_time,json=updateTime" json:"update_time,omitempty"` +} + +func (m *VideoAnnotationProgress) Reset() { *m = VideoAnnotationProgress{} } +func (m *VideoAnnotationProgress) String() string { return proto.CompactTextString(m) } +func (*VideoAnnotationProgress) ProtoMessage() {} +func (*VideoAnnotationProgress) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } + +func (m *VideoAnnotationProgress) GetInputUri() string { + if m != nil { + return m.InputUri + } + return "" +} + +func (m *VideoAnnotationProgress) GetProgressPercent() int32 { + if m != nil { + return m.ProgressPercent + } + return 0 +} + +func (m *VideoAnnotationProgress) GetStartTime() *google_protobuf3.Timestamp { + if m != nil { + return m.StartTime + } + return nil +} + +func (m *VideoAnnotationProgress) GetUpdateTime() *google_protobuf3.Timestamp { + if m != nil { + return m.UpdateTime + } + return nil +} + +// Video annotation progress. Included in the `metadata` +// field of the `Operation` returned by the `GetOperation` +// call of the `google::longrunning::Operations` service. +type AnnotateVideoProgress struct { + // Progress metadata for all videos specified in `AnnotateVideoRequest`. + AnnotationProgress []*VideoAnnotationProgress `protobuf:"bytes,1,rep,name=annotation_progress,json=annotationProgress" json:"annotation_progress,omitempty"` +} + +func (m *AnnotateVideoProgress) Reset() { *m = AnnotateVideoProgress{} } +func (m *AnnotateVideoProgress) String() string { return proto.CompactTextString(m) } +func (*AnnotateVideoProgress) ProtoMessage() {} +func (*AnnotateVideoProgress) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } + +func (m *AnnotateVideoProgress) GetAnnotationProgress() []*VideoAnnotationProgress { + if m != nil { + return m.AnnotationProgress + } + return nil +} + +func init() { + proto.RegisterType((*AnnotateVideoRequest)(nil), "google.cloud.videointelligence.v1beta1.AnnotateVideoRequest") + proto.RegisterType((*VideoContext)(nil), "google.cloud.videointelligence.v1beta1.VideoContext") + proto.RegisterType((*VideoSegment)(nil), "google.cloud.videointelligence.v1beta1.VideoSegment") + proto.RegisterType((*LabelLocation)(nil), "google.cloud.videointelligence.v1beta1.LabelLocation") + proto.RegisterType((*LabelAnnotation)(nil), "google.cloud.videointelligence.v1beta1.LabelAnnotation") + proto.RegisterType((*SafeSearchAnnotation)(nil), "google.cloud.videointelligence.v1beta1.SafeSearchAnnotation") + proto.RegisterType((*BoundingBox)(nil), "google.cloud.videointelligence.v1beta1.BoundingBox") + proto.RegisterType((*FaceLocation)(nil), "google.cloud.videointelligence.v1beta1.FaceLocation") + proto.RegisterType((*FaceAnnotation)(nil), "google.cloud.videointelligence.v1beta1.FaceAnnotation") + proto.RegisterType((*VideoAnnotationResults)(nil), "google.cloud.videointelligence.v1beta1.VideoAnnotationResults") + proto.RegisterType((*AnnotateVideoResponse)(nil), "google.cloud.videointelligence.v1beta1.AnnotateVideoResponse") + proto.RegisterType((*VideoAnnotationProgress)(nil), "google.cloud.videointelligence.v1beta1.VideoAnnotationProgress") + proto.RegisterType((*AnnotateVideoProgress)(nil), "google.cloud.videointelligence.v1beta1.AnnotateVideoProgress") + proto.RegisterEnum("google.cloud.videointelligence.v1beta1.Feature", Feature_name, Feature_value) + proto.RegisterEnum("google.cloud.videointelligence.v1beta1.LabelLevel", LabelLevel_name, LabelLevel_value) + proto.RegisterEnum("google.cloud.videointelligence.v1beta1.LabelDetectionMode", LabelDetectionMode_name, LabelDetectionMode_value) + proto.RegisterEnum("google.cloud.videointelligence.v1beta1.Likelihood", Likelihood_name, Likelihood_value) +} + +// 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 + +// Client API for VideoIntelligenceService service + +type VideoIntelligenceServiceClient interface { + // Performs asynchronous video annotation. Progress and results can be + // retrieved through the `google.longrunning.Operations` interface. + // `Operation.metadata` contains `AnnotateVideoProgress` (progress). + // `Operation.response` contains `AnnotateVideoResponse` (results). + AnnotateVideo(ctx context.Context, in *AnnotateVideoRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) +} + +type videoIntelligenceServiceClient struct { + cc *grpc.ClientConn +} + +func NewVideoIntelligenceServiceClient(cc *grpc.ClientConn) VideoIntelligenceServiceClient { + return &videoIntelligenceServiceClient{cc} +} + +func (c *videoIntelligenceServiceClient) AnnotateVideo(ctx context.Context, in *AnnotateVideoRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.cloud.videointelligence.v1beta1.VideoIntelligenceService/AnnotateVideo", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for VideoIntelligenceService service + +type VideoIntelligenceServiceServer interface { + // Performs asynchronous video annotation. Progress and results can be + // retrieved through the `google.longrunning.Operations` interface. + // `Operation.metadata` contains `AnnotateVideoProgress` (progress). + // `Operation.response` contains `AnnotateVideoResponse` (results). + AnnotateVideo(context.Context, *AnnotateVideoRequest) (*google_longrunning.Operation, error) +} + +func RegisterVideoIntelligenceServiceServer(s *grpc.Server, srv VideoIntelligenceServiceServer) { + s.RegisterService(&_VideoIntelligenceService_serviceDesc, srv) +} + +func _VideoIntelligenceService_AnnotateVideo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AnnotateVideoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VideoIntelligenceServiceServer).AnnotateVideo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.videointelligence.v1beta1.VideoIntelligenceService/AnnotateVideo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VideoIntelligenceServiceServer).AnnotateVideo(ctx, req.(*AnnotateVideoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _VideoIntelligenceService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.cloud.videointelligence.v1beta1.VideoIntelligenceService", + HandlerType: (*VideoIntelligenceServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "AnnotateVideo", + Handler: _VideoIntelligenceService_AnnotateVideo_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/cloud/videointelligence/v1beta1/video_intelligence.proto", +} + +func init() { + proto.RegisterFile("google/cloud/videointelligence/v1beta1/video_intelligence.proto", fileDescriptor0) +} + +var fileDescriptor0 = []byte{ + // 1520 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0xcb, 0x6f, 0x1b, 0xd5, + 0x1a, 0xef, 0xf8, 0x91, 0xc4, 0x9f, 0x93, 0xd8, 0x39, 0x49, 0x1a, 0xdf, 0xb4, 0xb9, 0x8d, 0xdc, + 0xab, 0x2a, 0x37, 0x57, 0xb2, 0x6f, 0x5d, 0x1e, 0xa2, 0x05, 0x2a, 0xc7, 0x19, 0x37, 0x56, 0x1d, + 0x3b, 0x1a, 0x27, 0xa9, 0x8a, 0x2a, 0x8d, 0xc6, 0x33, 0xc7, 0xce, 0x88, 0xf1, 0x9c, 0x61, 0xe6, + 0x4c, 0xd4, 0x2e, 0x61, 0x01, 0x62, 0x89, 0xf8, 0x2f, 0x90, 0x80, 0x7f, 0x81, 0x2d, 0x6c, 0x61, + 0xc3, 0x8a, 0x0d, 0x7f, 0x04, 0x3b, 0xd0, 0x79, 0x8c, 0x3d, 0xb6, 0x03, 0xb5, 0x03, 0x3b, 0x9f, + 0xef, 0xf1, 0xfb, 0xde, 0xe7, 0x7c, 0x63, 0x78, 0xdc, 0x27, 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0x8c, 0xf5, 0x1d, 0x9a, 0xf9, 0xb6, 0xb9, 0xea, 0x83, + 0x74, 0x7b, 0x27, 0xd2, 0x8e, 0x7d, 0x09, 0x97, 0xda, 0xd1, 0x97, 0x70, 0xf1, 0xee, 0x27, 0x3f, + 0xfe, 0xfa, 0x65, 0x62, 0xa7, 0x58, 0x18, 0xff, 0x30, 0x0f, 0x1e, 0xca, 0x36, 0xc4, 0x0f, 0x95, + 0xfd, 0x83, 0xdf, 0x14, 0xd8, 0x37, 0xc9, 0x60, 0x46, 0x3f, 0x0e, 0x76, 0xfe, 0x2c, 0xb8, 0x13, + 0x36, 0x72, 0x27, 0xca, 0x07, 0xcf, 0x24, 0x50, 0x9f, 0xb0, 0x25, 0xb5, 0x44, 0xfc, 0x7e, 0xb9, + 0x8f, 0x5d, 0x3e, 0x90, 0x65, 0xc1, 0x32, 0x3c, 0x3b, 0x78, 0xdd, 0x5f, 0x08, 0x8f, 0xa6, 0x38, + 0x5f, 0x25, 0xee, 0x3d, 0x11, 0xc8, 0x35, 0xee, 0xe2, 0x94, 0x1f, 0xa5, 0xf3, 0xfb, 0x07, 0x4c, + 0xf5, 0x87, 0x48, 0xf0, 0x05, 0x17, 0x7c, 0x31, 0x25, 0xf8, 0xe2, 0x5c, 0xd8, 0xe8, 0x2e, 0x70, + 0xaf, 0x1e, 0xfc, 0x11, 0x00, 0x00, 0xff, 0xff, 0xba, 0xc2, 0xb0, 0xa0, 0xd7, 0x10, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/videointelligence/v1beta2/video_intelligence.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/videointelligence/v1beta2/video_intelligence.pb.go new file mode 100644 index 0000000000..cf6b222207 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/videointelligence/v1beta2/video_intelligence.pb.go @@ -0,0 +1,1159 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/videointelligence/v1beta2/video_intelligence.proto + +/* +Package videointelligence is a generated protocol buffer package. + +It is generated from these files: + google/cloud/videointelligence/v1beta2/video_intelligence.proto + +It has these top-level messages: + AnnotateVideoRequest + VideoContext + LabelDetectionConfig + ShotChangeDetectionConfig + ExplicitContentDetectionConfig + FaceDetectionConfig + VideoSegment + LabelSegment + LabelFrame + Entity + LabelAnnotation + ExplicitContentFrame + ExplicitContentAnnotation + NormalizedBoundingBox + FaceSegment + FaceFrame + FaceAnnotation + VideoAnnotationResults + AnnotateVideoResponse + VideoAnnotationProgress + AnnotateVideoProgress +*/ +package videointelligence + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_longrunning "google.golang.org/genproto/googleapis/longrunning" +import google_protobuf3 "github.com/golang/protobuf/ptypes/duration" +import google_protobuf4 "github.com/golang/protobuf/ptypes/timestamp" +import google_rpc "google.golang.org/genproto/googleapis/rpc/status" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Video annotation feature. +type Feature int32 + +const ( + // Unspecified. + Feature_FEATURE_UNSPECIFIED Feature = 0 + // Label detection. Detect objects, such as dog or flower. + Feature_LABEL_DETECTION Feature = 1 + // Shot change detection. + Feature_SHOT_CHANGE_DETECTION Feature = 2 + // Explicit content detection. + Feature_EXPLICIT_CONTENT_DETECTION Feature = 3 + // Human face detection and tracking. + Feature_FACE_DETECTION Feature = 4 +) + +var Feature_name = map[int32]string{ + 0: "FEATURE_UNSPECIFIED", + 1: "LABEL_DETECTION", + 2: "SHOT_CHANGE_DETECTION", + 3: "EXPLICIT_CONTENT_DETECTION", + 4: "FACE_DETECTION", +} +var Feature_value = map[string]int32{ + "FEATURE_UNSPECIFIED": 0, + "LABEL_DETECTION": 1, + "SHOT_CHANGE_DETECTION": 2, + "EXPLICIT_CONTENT_DETECTION": 3, + "FACE_DETECTION": 4, +} + +func (x Feature) String() string { + return proto.EnumName(Feature_name, int32(x)) +} +func (Feature) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +// Label detection mode. +type LabelDetectionMode int32 + +const ( + // Unspecified. + LabelDetectionMode_LABEL_DETECTION_MODE_UNSPECIFIED LabelDetectionMode = 0 + // Detect shot-level labels. + LabelDetectionMode_SHOT_MODE LabelDetectionMode = 1 + // Detect frame-level labels. + LabelDetectionMode_FRAME_MODE LabelDetectionMode = 2 + // Detect both shot-level and frame-level labels. + LabelDetectionMode_SHOT_AND_FRAME_MODE LabelDetectionMode = 3 +) + +var LabelDetectionMode_name = map[int32]string{ + 0: "LABEL_DETECTION_MODE_UNSPECIFIED", + 1: "SHOT_MODE", + 2: "FRAME_MODE", + 3: "SHOT_AND_FRAME_MODE", +} +var LabelDetectionMode_value = map[string]int32{ + "LABEL_DETECTION_MODE_UNSPECIFIED": 0, + "SHOT_MODE": 1, + "FRAME_MODE": 2, + "SHOT_AND_FRAME_MODE": 3, +} + +func (x LabelDetectionMode) String() string { + return proto.EnumName(LabelDetectionMode_name, int32(x)) +} +func (LabelDetectionMode) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +// Bucketized representation of likelihood. +type Likelihood int32 + +const ( + // Unspecified likelihood. + Likelihood_LIKELIHOOD_UNSPECIFIED Likelihood = 0 + // Very unlikely. + Likelihood_VERY_UNLIKELY Likelihood = 1 + // Unlikely. + Likelihood_UNLIKELY Likelihood = 2 + // Possible. + Likelihood_POSSIBLE Likelihood = 3 + // Likely. + Likelihood_LIKELY Likelihood = 4 + // Very likely. + Likelihood_VERY_LIKELY Likelihood = 5 +) + +var Likelihood_name = map[int32]string{ + 0: "LIKELIHOOD_UNSPECIFIED", + 1: "VERY_UNLIKELY", + 2: "UNLIKELY", + 3: "POSSIBLE", + 4: "LIKELY", + 5: "VERY_LIKELY", +} +var Likelihood_value = map[string]int32{ + "LIKELIHOOD_UNSPECIFIED": 0, + "VERY_UNLIKELY": 1, + "UNLIKELY": 2, + "POSSIBLE": 3, + "LIKELY": 4, + "VERY_LIKELY": 5, +} + +func (x Likelihood) String() string { + return proto.EnumName(Likelihood_name, int32(x)) +} +func (Likelihood) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +// Video annotation request. +type AnnotateVideoRequest struct { + // Input video location. Currently, only + // [Google Cloud Storage](https://cloud.google.com/storage/) URIs are + // supported, which must be specified in the following format: + // `gs://bucket-id/object-id` (other URI formats return + // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see + // [Request URIs](/storage/docs/reference-uris). + // A video URI may include wildcards in `object-id`, and thus identify + // multiple videos. Supported wildcards: '*' to match 0 or more characters; + // '?' to match 1 character. If unset, the input video should be embedded + // in the request as `input_content`. If set, `input_content` should be unset. + InputUri string `protobuf:"bytes,1,opt,name=input_uri,json=inputUri" json:"input_uri,omitempty"` + // The video data bytes. + // If unset, the input video(s) should be specified via `input_uri`. + // If set, `input_uri` should be unset. + InputContent []byte `protobuf:"bytes,6,opt,name=input_content,json=inputContent,proto3" json:"input_content,omitempty"` + // Requested video annotation features. + Features []Feature `protobuf:"varint,2,rep,packed,name=features,enum=google.cloud.videointelligence.v1beta2.Feature" json:"features,omitempty"` + // Additional video context and/or feature-specific parameters. + VideoContext *VideoContext `protobuf:"bytes,3,opt,name=video_context,json=videoContext" json:"video_context,omitempty"` + // Optional location where the output (in JSON format) should be stored. + // Currently, only [Google Cloud Storage](https://cloud.google.com/storage/) + // URIs are supported, which must be specified in the following format: + // `gs://bucket-id/object-id` (other URI formats return + // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see + // [Request URIs](/storage/docs/reference-uris). + OutputUri string `protobuf:"bytes,4,opt,name=output_uri,json=outputUri" json:"output_uri,omitempty"` + // Optional cloud region where annotation should take place. Supported cloud + // regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region + // is specified, a region will be determined based on video file location. + LocationId string `protobuf:"bytes,5,opt,name=location_id,json=locationId" json:"location_id,omitempty"` +} + +func (m *AnnotateVideoRequest) Reset() { *m = AnnotateVideoRequest{} } +func (m *AnnotateVideoRequest) String() string { return proto.CompactTextString(m) } +func (*AnnotateVideoRequest) ProtoMessage() {} +func (*AnnotateVideoRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *AnnotateVideoRequest) GetInputUri() string { + if m != nil { + return m.InputUri + } + return "" +} + +func (m *AnnotateVideoRequest) GetInputContent() []byte { + if m != nil { + return m.InputContent + } + return nil +} + +func (m *AnnotateVideoRequest) GetFeatures() []Feature { + if m != nil { + return m.Features + } + return nil +} + +func (m *AnnotateVideoRequest) GetVideoContext() *VideoContext { + if m != nil { + return m.VideoContext + } + return nil +} + +func (m *AnnotateVideoRequest) GetOutputUri() string { + if m != nil { + return m.OutputUri + } + return "" +} + +func (m *AnnotateVideoRequest) GetLocationId() string { + if m != nil { + return m.LocationId + } + return "" +} + +// Video context and/or feature-specific parameters. +type VideoContext struct { + // Video segments to annotate. The segments may overlap and are not required + // to be contiguous or span the whole video. If unspecified, each video + // is treated as a single segment. + Segments []*VideoSegment `protobuf:"bytes,1,rep,name=segments" json:"segments,omitempty"` + // Config for LABEL_DETECTION. + LabelDetectionConfig *LabelDetectionConfig `protobuf:"bytes,2,opt,name=label_detection_config,json=labelDetectionConfig" json:"label_detection_config,omitempty"` + // Config for SHOT_CHANGE_DETECTION. + ShotChangeDetectionConfig *ShotChangeDetectionConfig `protobuf:"bytes,3,opt,name=shot_change_detection_config,json=shotChangeDetectionConfig" json:"shot_change_detection_config,omitempty"` + // Config for EXPLICIT_CONTENT_DETECTION. + ExplicitContentDetectionConfig *ExplicitContentDetectionConfig `protobuf:"bytes,4,opt,name=explicit_content_detection_config,json=explicitContentDetectionConfig" json:"explicit_content_detection_config,omitempty"` + // Config for FACE_DETECTION. + FaceDetectionConfig *FaceDetectionConfig `protobuf:"bytes,5,opt,name=face_detection_config,json=faceDetectionConfig" json:"face_detection_config,omitempty"` +} + +func (m *VideoContext) Reset() { *m = VideoContext{} } +func (m *VideoContext) String() string { return proto.CompactTextString(m) } +func (*VideoContext) ProtoMessage() {} +func (*VideoContext) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *VideoContext) GetSegments() []*VideoSegment { + if m != nil { + return m.Segments + } + return nil +} + +func (m *VideoContext) GetLabelDetectionConfig() *LabelDetectionConfig { + if m != nil { + return m.LabelDetectionConfig + } + return nil +} + +func (m *VideoContext) GetShotChangeDetectionConfig() *ShotChangeDetectionConfig { + if m != nil { + return m.ShotChangeDetectionConfig + } + return nil +} + +func (m *VideoContext) GetExplicitContentDetectionConfig() *ExplicitContentDetectionConfig { + if m != nil { + return m.ExplicitContentDetectionConfig + } + return nil +} + +func (m *VideoContext) GetFaceDetectionConfig() *FaceDetectionConfig { + if m != nil { + return m.FaceDetectionConfig + } + return nil +} + +// Config for LABEL_DETECTION. +type LabelDetectionConfig struct { + // What labels should be detected with LABEL_DETECTION, in addition to + // video-level labels or segment-level labels. + // If unspecified, defaults to `SHOT_MODE`. + LabelDetectionMode LabelDetectionMode `protobuf:"varint,1,opt,name=label_detection_mode,json=labelDetectionMode,enum=google.cloud.videointelligence.v1beta2.LabelDetectionMode" json:"label_detection_mode,omitempty"` + // Whether the video has been shot from a stationary (i.e. non-moving) camera. + // When set to true, might improve detection accuracy for moving objects. + // Should be used with `SHOT_AND_FRAME_MODE` enabled. + StationaryCamera bool `protobuf:"varint,2,opt,name=stationary_camera,json=stationaryCamera" json:"stationary_camera,omitempty"` + // Model to use for label detection. + // Supported values: "builtin/stable" (the default if unset) and + // "builtin/latest". + Model string `protobuf:"bytes,3,opt,name=model" json:"model,omitempty"` +} + +func (m *LabelDetectionConfig) Reset() { *m = LabelDetectionConfig{} } +func (m *LabelDetectionConfig) String() string { return proto.CompactTextString(m) } +func (*LabelDetectionConfig) ProtoMessage() {} +func (*LabelDetectionConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *LabelDetectionConfig) GetLabelDetectionMode() LabelDetectionMode { + if m != nil { + return m.LabelDetectionMode + } + return LabelDetectionMode_LABEL_DETECTION_MODE_UNSPECIFIED +} + +func (m *LabelDetectionConfig) GetStationaryCamera() bool { + if m != nil { + return m.StationaryCamera + } + return false +} + +func (m *LabelDetectionConfig) GetModel() string { + if m != nil { + return m.Model + } + return "" +} + +// Config for SHOT_CHANGE_DETECTION. +type ShotChangeDetectionConfig struct { + // Model to use for shot change detection. + // Supported values: "builtin/stable" (the default if unset) and + // "builtin/latest". + Model string `protobuf:"bytes,1,opt,name=model" json:"model,omitempty"` +} + +func (m *ShotChangeDetectionConfig) Reset() { *m = ShotChangeDetectionConfig{} } +func (m *ShotChangeDetectionConfig) String() string { return proto.CompactTextString(m) } +func (*ShotChangeDetectionConfig) ProtoMessage() {} +func (*ShotChangeDetectionConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *ShotChangeDetectionConfig) GetModel() string { + if m != nil { + return m.Model + } + return "" +} + +// Config for EXPLICIT_CONTENT_DETECTION. +type ExplicitContentDetectionConfig struct { + // Model to use for explicit content detection. + // Supported values: "builtin/stable" (the default if unset) and + // "builtin/latest". + Model string `protobuf:"bytes,1,opt,name=model" json:"model,omitempty"` +} + +func (m *ExplicitContentDetectionConfig) Reset() { *m = ExplicitContentDetectionConfig{} } +func (m *ExplicitContentDetectionConfig) String() string { return proto.CompactTextString(m) } +func (*ExplicitContentDetectionConfig) ProtoMessage() {} +func (*ExplicitContentDetectionConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *ExplicitContentDetectionConfig) GetModel() string { + if m != nil { + return m.Model + } + return "" +} + +// Config for FACE_DETECTION. +type FaceDetectionConfig struct { + // Model to use for face detection. + // Supported values: "builtin/stable" (the default if unset) and + // "builtin/latest". + Model string `protobuf:"bytes,1,opt,name=model" json:"model,omitempty"` + // Whether bounding boxes be included in the face annotation output. + IncludeBoundingBoxes bool `protobuf:"varint,2,opt,name=include_bounding_boxes,json=includeBoundingBoxes" json:"include_bounding_boxes,omitempty"` +} + +func (m *FaceDetectionConfig) Reset() { *m = FaceDetectionConfig{} } +func (m *FaceDetectionConfig) String() string { return proto.CompactTextString(m) } +func (*FaceDetectionConfig) ProtoMessage() {} +func (*FaceDetectionConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *FaceDetectionConfig) GetModel() string { + if m != nil { + return m.Model + } + return "" +} + +func (m *FaceDetectionConfig) GetIncludeBoundingBoxes() bool { + if m != nil { + return m.IncludeBoundingBoxes + } + return false +} + +// Video segment. +type VideoSegment struct { + // Time-offset, relative to the beginning of the video, + // corresponding to the start of the segment (inclusive). + StartTimeOffset *google_protobuf3.Duration `protobuf:"bytes,1,opt,name=start_time_offset,json=startTimeOffset" json:"start_time_offset,omitempty"` + // Time-offset, relative to the beginning of the video, + // corresponding to the end of the segment (inclusive). + EndTimeOffset *google_protobuf3.Duration `protobuf:"bytes,2,opt,name=end_time_offset,json=endTimeOffset" json:"end_time_offset,omitempty"` +} + +func (m *VideoSegment) Reset() { *m = VideoSegment{} } +func (m *VideoSegment) String() string { return proto.CompactTextString(m) } +func (*VideoSegment) ProtoMessage() {} +func (*VideoSegment) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *VideoSegment) GetStartTimeOffset() *google_protobuf3.Duration { + if m != nil { + return m.StartTimeOffset + } + return nil +} + +func (m *VideoSegment) GetEndTimeOffset() *google_protobuf3.Duration { + if m != nil { + return m.EndTimeOffset + } + return nil +} + +// Video segment level annotation results for label detection. +type LabelSegment struct { + // Video segment where a label was detected. + Segment *VideoSegment `protobuf:"bytes,1,opt,name=segment" json:"segment,omitempty"` + // Confidence that the label is accurate. Range: [0, 1]. + Confidence float32 `protobuf:"fixed32,2,opt,name=confidence" json:"confidence,omitempty"` +} + +func (m *LabelSegment) Reset() { *m = LabelSegment{} } +func (m *LabelSegment) String() string { return proto.CompactTextString(m) } +func (*LabelSegment) ProtoMessage() {} +func (*LabelSegment) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *LabelSegment) GetSegment() *VideoSegment { + if m != nil { + return m.Segment + } + return nil +} + +func (m *LabelSegment) GetConfidence() float32 { + if m != nil { + return m.Confidence + } + return 0 +} + +// Video frame level annotation results for label detection. +type LabelFrame struct { + // Time-offset, relative to the beginning of the video, corresponding to the + // video frame for this location. + TimeOffset *google_protobuf3.Duration `protobuf:"bytes,1,opt,name=time_offset,json=timeOffset" json:"time_offset,omitempty"` + // Confidence that the label is accurate. Range: [0, 1]. + Confidence float32 `protobuf:"fixed32,2,opt,name=confidence" json:"confidence,omitempty"` +} + +func (m *LabelFrame) Reset() { *m = LabelFrame{} } +func (m *LabelFrame) String() string { return proto.CompactTextString(m) } +func (*LabelFrame) ProtoMessage() {} +func (*LabelFrame) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *LabelFrame) GetTimeOffset() *google_protobuf3.Duration { + if m != nil { + return m.TimeOffset + } + return nil +} + +func (m *LabelFrame) GetConfidence() float32 { + if m != nil { + return m.Confidence + } + return 0 +} + +// Detected entity from video analysis. +type Entity struct { + // Opaque entity ID. Some IDs may be available in + // [Google Knowledge Graph Search + // API](https://developers.google.com/knowledge-graph/). + EntityId string `protobuf:"bytes,1,opt,name=entity_id,json=entityId" json:"entity_id,omitempty"` + // Textual description, e.g. `Fixed-gear bicycle`. + Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` + // Language code for `description` in BCP-47 format. + LanguageCode string `protobuf:"bytes,3,opt,name=language_code,json=languageCode" json:"language_code,omitempty"` +} + +func (m *Entity) Reset() { *m = Entity{} } +func (m *Entity) String() string { return proto.CompactTextString(m) } +func (*Entity) ProtoMessage() {} +func (*Entity) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *Entity) GetEntityId() string { + if m != nil { + return m.EntityId + } + return "" +} + +func (m *Entity) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *Entity) GetLanguageCode() string { + if m != nil { + return m.LanguageCode + } + return "" +} + +// Label annotation. +type LabelAnnotation struct { + // Detected entity. + Entity *Entity `protobuf:"bytes,1,opt,name=entity" json:"entity,omitempty"` + // Common categories for the detected entity. + // E.g. when the label is `Terrier` the category is likely `dog`. And in some + // cases there might be more than one categories e.g. `Terrier` could also be + // a `pet`. + CategoryEntities []*Entity `protobuf:"bytes,2,rep,name=category_entities,json=categoryEntities" json:"category_entities,omitempty"` + // All video segments where a label was detected. + Segments []*LabelSegment `protobuf:"bytes,3,rep,name=segments" json:"segments,omitempty"` + // All video frames where a label was detected. + Frames []*LabelFrame `protobuf:"bytes,4,rep,name=frames" json:"frames,omitempty"` +} + +func (m *LabelAnnotation) Reset() { *m = LabelAnnotation{} } +func (m *LabelAnnotation) String() string { return proto.CompactTextString(m) } +func (*LabelAnnotation) ProtoMessage() {} +func (*LabelAnnotation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *LabelAnnotation) GetEntity() *Entity { + if m != nil { + return m.Entity + } + return nil +} + +func (m *LabelAnnotation) GetCategoryEntities() []*Entity { + if m != nil { + return m.CategoryEntities + } + return nil +} + +func (m *LabelAnnotation) GetSegments() []*LabelSegment { + if m != nil { + return m.Segments + } + return nil +} + +func (m *LabelAnnotation) GetFrames() []*LabelFrame { + if m != nil { + return m.Frames + } + return nil +} + +// Video frame level annotation results for explicit content. +type ExplicitContentFrame struct { + // Time-offset, relative to the beginning of the video, corresponding to the + // video frame for this location. + TimeOffset *google_protobuf3.Duration `protobuf:"bytes,1,opt,name=time_offset,json=timeOffset" json:"time_offset,omitempty"` + // Likelihood of the pornography content.. + PornographyLikelihood Likelihood `protobuf:"varint,2,opt,name=pornography_likelihood,json=pornographyLikelihood,enum=google.cloud.videointelligence.v1beta2.Likelihood" json:"pornography_likelihood,omitempty"` +} + +func (m *ExplicitContentFrame) Reset() { *m = ExplicitContentFrame{} } +func (m *ExplicitContentFrame) String() string { return proto.CompactTextString(m) } +func (*ExplicitContentFrame) ProtoMessage() {} +func (*ExplicitContentFrame) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } + +func (m *ExplicitContentFrame) GetTimeOffset() *google_protobuf3.Duration { + if m != nil { + return m.TimeOffset + } + return nil +} + +func (m *ExplicitContentFrame) GetPornographyLikelihood() Likelihood { + if m != nil { + return m.PornographyLikelihood + } + return Likelihood_LIKELIHOOD_UNSPECIFIED +} + +// Explicit content annotation (based on per-frame visual signals only). +// If no explicit content has been detected in a frame, no annotations are +// present for that frame. +type ExplicitContentAnnotation struct { + // All video frames where explicit content was detected. + Frames []*ExplicitContentFrame `protobuf:"bytes,1,rep,name=frames" json:"frames,omitempty"` +} + +func (m *ExplicitContentAnnotation) Reset() { *m = ExplicitContentAnnotation{} } +func (m *ExplicitContentAnnotation) String() string { return proto.CompactTextString(m) } +func (*ExplicitContentAnnotation) ProtoMessage() {} +func (*ExplicitContentAnnotation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } + +func (m *ExplicitContentAnnotation) GetFrames() []*ExplicitContentFrame { + if m != nil { + return m.Frames + } + return nil +} + +// Normalized bounding box. +// The normalized vertex coordinates are relative to the original image. +// Range: [0, 1]. +type NormalizedBoundingBox struct { + // Left X coordinate. + Left float32 `protobuf:"fixed32,1,opt,name=left" json:"left,omitempty"` + // Top Y coordinate. + Top float32 `protobuf:"fixed32,2,opt,name=top" json:"top,omitempty"` + // Right X coordinate. + Right float32 `protobuf:"fixed32,3,opt,name=right" json:"right,omitempty"` + // Bottom Y coordinate. + Bottom float32 `protobuf:"fixed32,4,opt,name=bottom" json:"bottom,omitempty"` +} + +func (m *NormalizedBoundingBox) Reset() { *m = NormalizedBoundingBox{} } +func (m *NormalizedBoundingBox) String() string { return proto.CompactTextString(m) } +func (*NormalizedBoundingBox) ProtoMessage() {} +func (*NormalizedBoundingBox) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } + +func (m *NormalizedBoundingBox) GetLeft() float32 { + if m != nil { + return m.Left + } + return 0 +} + +func (m *NormalizedBoundingBox) GetTop() float32 { + if m != nil { + return m.Top + } + return 0 +} + +func (m *NormalizedBoundingBox) GetRight() float32 { + if m != nil { + return m.Right + } + return 0 +} + +func (m *NormalizedBoundingBox) GetBottom() float32 { + if m != nil { + return m.Bottom + } + return 0 +} + +// Video segment level annotation results for face detection. +type FaceSegment struct { + // Video segment where a face was detected. + Segment *VideoSegment `protobuf:"bytes,1,opt,name=segment" json:"segment,omitempty"` +} + +func (m *FaceSegment) Reset() { *m = FaceSegment{} } +func (m *FaceSegment) String() string { return proto.CompactTextString(m) } +func (*FaceSegment) ProtoMessage() {} +func (*FaceSegment) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } + +func (m *FaceSegment) GetSegment() *VideoSegment { + if m != nil { + return m.Segment + } + return nil +} + +// Video frame level annotation results for face detection. +type FaceFrame struct { + // Normalized Bounding boxes in a frame. + // There can be more than one boxes if the same face is detected in multiple + // locations within the current frame. + NormalizedBoundingBoxes []*NormalizedBoundingBox `protobuf:"bytes,1,rep,name=normalized_bounding_boxes,json=normalizedBoundingBoxes" json:"normalized_bounding_boxes,omitempty"` + // Time-offset, relative to the beginning of the video, + // corresponding to the video frame for this location. + TimeOffset *google_protobuf3.Duration `protobuf:"bytes,2,opt,name=time_offset,json=timeOffset" json:"time_offset,omitempty"` +} + +func (m *FaceFrame) Reset() { *m = FaceFrame{} } +func (m *FaceFrame) String() string { return proto.CompactTextString(m) } +func (*FaceFrame) ProtoMessage() {} +func (*FaceFrame) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } + +func (m *FaceFrame) GetNormalizedBoundingBoxes() []*NormalizedBoundingBox { + if m != nil { + return m.NormalizedBoundingBoxes + } + return nil +} + +func (m *FaceFrame) GetTimeOffset() *google_protobuf3.Duration { + if m != nil { + return m.TimeOffset + } + return nil +} + +// Face annotation. +type FaceAnnotation struct { + // Thumbnail of a representative face view (in JPEG format). + Thumbnail []byte `protobuf:"bytes,1,opt,name=thumbnail,proto3" json:"thumbnail,omitempty"` + // All video segments where a face was detected. + Segments []*FaceSegment `protobuf:"bytes,2,rep,name=segments" json:"segments,omitempty"` + // All video frames where a face was detected. + Frames []*FaceFrame `protobuf:"bytes,3,rep,name=frames" json:"frames,omitempty"` +} + +func (m *FaceAnnotation) Reset() { *m = FaceAnnotation{} } +func (m *FaceAnnotation) String() string { return proto.CompactTextString(m) } +func (*FaceAnnotation) ProtoMessage() {} +func (*FaceAnnotation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} } + +func (m *FaceAnnotation) GetThumbnail() []byte { + if m != nil { + return m.Thumbnail + } + return nil +} + +func (m *FaceAnnotation) GetSegments() []*FaceSegment { + if m != nil { + return m.Segments + } + return nil +} + +func (m *FaceAnnotation) GetFrames() []*FaceFrame { + if m != nil { + return m.Frames + } + return nil +} + +// Annotation results for a single video. +type VideoAnnotationResults struct { + // Video file location in + // [Google Cloud Storage](https://cloud.google.com/storage/). + InputUri string `protobuf:"bytes,1,opt,name=input_uri,json=inputUri" json:"input_uri,omitempty"` + // Label annotations on video level or user specified segment level. + // There is exactly one element for each unique label. + SegmentLabelAnnotations []*LabelAnnotation `protobuf:"bytes,2,rep,name=segment_label_annotations,json=segmentLabelAnnotations" json:"segment_label_annotations,omitempty"` + // Label annotations on shot level. + // There is exactly one element for each unique label. + ShotLabelAnnotations []*LabelAnnotation `protobuf:"bytes,3,rep,name=shot_label_annotations,json=shotLabelAnnotations" json:"shot_label_annotations,omitempty"` + // Label annotations on frame level. + // There is exactly one element for each unique label. + FrameLabelAnnotations []*LabelAnnotation `protobuf:"bytes,4,rep,name=frame_label_annotations,json=frameLabelAnnotations" json:"frame_label_annotations,omitempty"` + // Face annotations. There is exactly one element for each unique face. + FaceAnnotations []*FaceAnnotation `protobuf:"bytes,5,rep,name=face_annotations,json=faceAnnotations" json:"face_annotations,omitempty"` + // Shot annotations. Each shot is represented as a video segment. + ShotAnnotations []*VideoSegment `protobuf:"bytes,6,rep,name=shot_annotations,json=shotAnnotations" json:"shot_annotations,omitempty"` + // Explicit content annotation. + ExplicitAnnotation *ExplicitContentAnnotation `protobuf:"bytes,7,opt,name=explicit_annotation,json=explicitAnnotation" json:"explicit_annotation,omitempty"` + // If set, indicates an error. Note that for a single `AnnotateVideoRequest` + // some videos may succeed and some may fail. + Error *google_rpc.Status `protobuf:"bytes,9,opt,name=error" json:"error,omitempty"` +} + +func (m *VideoAnnotationResults) Reset() { *m = VideoAnnotationResults{} } +func (m *VideoAnnotationResults) String() string { return proto.CompactTextString(m) } +func (*VideoAnnotationResults) ProtoMessage() {} +func (*VideoAnnotationResults) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17} } + +func (m *VideoAnnotationResults) GetInputUri() string { + if m != nil { + return m.InputUri + } + return "" +} + +func (m *VideoAnnotationResults) GetSegmentLabelAnnotations() []*LabelAnnotation { + if m != nil { + return m.SegmentLabelAnnotations + } + return nil +} + +func (m *VideoAnnotationResults) GetShotLabelAnnotations() []*LabelAnnotation { + if m != nil { + return m.ShotLabelAnnotations + } + return nil +} + +func (m *VideoAnnotationResults) GetFrameLabelAnnotations() []*LabelAnnotation { + if m != nil { + return m.FrameLabelAnnotations + } + return nil +} + +func (m *VideoAnnotationResults) GetFaceAnnotations() []*FaceAnnotation { + if m != nil { + return m.FaceAnnotations + } + return nil +} + +func (m *VideoAnnotationResults) GetShotAnnotations() []*VideoSegment { + if m != nil { + return m.ShotAnnotations + } + return nil +} + +func (m *VideoAnnotationResults) GetExplicitAnnotation() *ExplicitContentAnnotation { + if m != nil { + return m.ExplicitAnnotation + } + return nil +} + +func (m *VideoAnnotationResults) GetError() *google_rpc.Status { + if m != nil { + return m.Error + } + return nil +} + +// Video annotation response. Included in the `response` +// field of the `Operation` returned by the `GetOperation` +// call of the `google::longrunning::Operations` service. +type AnnotateVideoResponse struct { + // Annotation results for all videos specified in `AnnotateVideoRequest`. + AnnotationResults []*VideoAnnotationResults `protobuf:"bytes,1,rep,name=annotation_results,json=annotationResults" json:"annotation_results,omitempty"` +} + +func (m *AnnotateVideoResponse) Reset() { *m = AnnotateVideoResponse{} } +func (m *AnnotateVideoResponse) String() string { return proto.CompactTextString(m) } +func (*AnnotateVideoResponse) ProtoMessage() {} +func (*AnnotateVideoResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{18} } + +func (m *AnnotateVideoResponse) GetAnnotationResults() []*VideoAnnotationResults { + if m != nil { + return m.AnnotationResults + } + return nil +} + +// Annotation progress for a single video. +type VideoAnnotationProgress struct { + // Video file location in + // [Google Cloud Storage](https://cloud.google.com/storage/). + InputUri string `protobuf:"bytes,1,opt,name=input_uri,json=inputUri" json:"input_uri,omitempty"` + // Approximate percentage processed thus far. + // Guaranteed to be 100 when fully processed. + ProgressPercent int32 `protobuf:"varint,2,opt,name=progress_percent,json=progressPercent" json:"progress_percent,omitempty"` + // Time when the request was received. + StartTime *google_protobuf4.Timestamp `protobuf:"bytes,3,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + // Time of the most recent update. + UpdateTime *google_protobuf4.Timestamp `protobuf:"bytes,4,opt,name=update_time,json=updateTime" json:"update_time,omitempty"` +} + +func (m *VideoAnnotationProgress) Reset() { *m = VideoAnnotationProgress{} } +func (m *VideoAnnotationProgress) String() string { return proto.CompactTextString(m) } +func (*VideoAnnotationProgress) ProtoMessage() {} +func (*VideoAnnotationProgress) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{19} } + +func (m *VideoAnnotationProgress) GetInputUri() string { + if m != nil { + return m.InputUri + } + return "" +} + +func (m *VideoAnnotationProgress) GetProgressPercent() int32 { + if m != nil { + return m.ProgressPercent + } + return 0 +} + +func (m *VideoAnnotationProgress) GetStartTime() *google_protobuf4.Timestamp { + if m != nil { + return m.StartTime + } + return nil +} + +func (m *VideoAnnotationProgress) GetUpdateTime() *google_protobuf4.Timestamp { + if m != nil { + return m.UpdateTime + } + return nil +} + +// Video annotation progress. Included in the `metadata` +// field of the `Operation` returned by the `GetOperation` +// call of the `google::longrunning::Operations` service. +type AnnotateVideoProgress struct { + // Progress metadata for all videos specified in `AnnotateVideoRequest`. + AnnotationProgress []*VideoAnnotationProgress `protobuf:"bytes,1,rep,name=annotation_progress,json=annotationProgress" json:"annotation_progress,omitempty"` +} + +func (m *AnnotateVideoProgress) Reset() { *m = AnnotateVideoProgress{} } +func (m *AnnotateVideoProgress) String() string { return proto.CompactTextString(m) } +func (*AnnotateVideoProgress) ProtoMessage() {} +func (*AnnotateVideoProgress) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20} } + +func (m *AnnotateVideoProgress) GetAnnotationProgress() []*VideoAnnotationProgress { + if m != nil { + return m.AnnotationProgress + } + return nil +} + +func init() { + proto.RegisterType((*AnnotateVideoRequest)(nil), "google.cloud.videointelligence.v1beta2.AnnotateVideoRequest") + proto.RegisterType((*VideoContext)(nil), "google.cloud.videointelligence.v1beta2.VideoContext") + proto.RegisterType((*LabelDetectionConfig)(nil), "google.cloud.videointelligence.v1beta2.LabelDetectionConfig") + proto.RegisterType((*ShotChangeDetectionConfig)(nil), "google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig") + proto.RegisterType((*ExplicitContentDetectionConfig)(nil), "google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig") + proto.RegisterType((*FaceDetectionConfig)(nil), "google.cloud.videointelligence.v1beta2.FaceDetectionConfig") + proto.RegisterType((*VideoSegment)(nil), "google.cloud.videointelligence.v1beta2.VideoSegment") + proto.RegisterType((*LabelSegment)(nil), "google.cloud.videointelligence.v1beta2.LabelSegment") + proto.RegisterType((*LabelFrame)(nil), "google.cloud.videointelligence.v1beta2.LabelFrame") + proto.RegisterType((*Entity)(nil), "google.cloud.videointelligence.v1beta2.Entity") + proto.RegisterType((*LabelAnnotation)(nil), "google.cloud.videointelligence.v1beta2.LabelAnnotation") + proto.RegisterType((*ExplicitContentFrame)(nil), "google.cloud.videointelligence.v1beta2.ExplicitContentFrame") + proto.RegisterType((*ExplicitContentAnnotation)(nil), "google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation") + proto.RegisterType((*NormalizedBoundingBox)(nil), "google.cloud.videointelligence.v1beta2.NormalizedBoundingBox") + proto.RegisterType((*FaceSegment)(nil), "google.cloud.videointelligence.v1beta2.FaceSegment") + proto.RegisterType((*FaceFrame)(nil), "google.cloud.videointelligence.v1beta2.FaceFrame") + proto.RegisterType((*FaceAnnotation)(nil), "google.cloud.videointelligence.v1beta2.FaceAnnotation") + proto.RegisterType((*VideoAnnotationResults)(nil), "google.cloud.videointelligence.v1beta2.VideoAnnotationResults") + proto.RegisterType((*AnnotateVideoResponse)(nil), "google.cloud.videointelligence.v1beta2.AnnotateVideoResponse") + proto.RegisterType((*VideoAnnotationProgress)(nil), "google.cloud.videointelligence.v1beta2.VideoAnnotationProgress") + proto.RegisterType((*AnnotateVideoProgress)(nil), "google.cloud.videointelligence.v1beta2.AnnotateVideoProgress") + proto.RegisterEnum("google.cloud.videointelligence.v1beta2.Feature", Feature_name, Feature_value) + proto.RegisterEnum("google.cloud.videointelligence.v1beta2.LabelDetectionMode", LabelDetectionMode_name, LabelDetectionMode_value) + proto.RegisterEnum("google.cloud.videointelligence.v1beta2.Likelihood", Likelihood_name, Likelihood_value) +} + +// 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 + +// Client API for VideoIntelligenceService service + +type VideoIntelligenceServiceClient interface { + // Performs asynchronous video annotation. Progress and results can be + // retrieved through the `google.longrunning.Operations` interface. + // `Operation.metadata` contains `AnnotateVideoProgress` (progress). + // `Operation.response` contains `AnnotateVideoResponse` (results). + AnnotateVideo(ctx context.Context, in *AnnotateVideoRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) +} + +type videoIntelligenceServiceClient struct { + cc *grpc.ClientConn +} + +func NewVideoIntelligenceServiceClient(cc *grpc.ClientConn) VideoIntelligenceServiceClient { + return &videoIntelligenceServiceClient{cc} +} + +func (c *videoIntelligenceServiceClient) AnnotateVideo(ctx context.Context, in *AnnotateVideoRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.cloud.videointelligence.v1beta2.VideoIntelligenceService/AnnotateVideo", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for VideoIntelligenceService service + +type VideoIntelligenceServiceServer interface { + // Performs asynchronous video annotation. Progress and results can be + // retrieved through the `google.longrunning.Operations` interface. + // `Operation.metadata` contains `AnnotateVideoProgress` (progress). + // `Operation.response` contains `AnnotateVideoResponse` (results). + AnnotateVideo(context.Context, *AnnotateVideoRequest) (*google_longrunning.Operation, error) +} + +func RegisterVideoIntelligenceServiceServer(s *grpc.Server, srv VideoIntelligenceServiceServer) { + s.RegisterService(&_VideoIntelligenceService_serviceDesc, srv) +} + +func _VideoIntelligenceService_AnnotateVideo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AnnotateVideoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VideoIntelligenceServiceServer).AnnotateVideo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.videointelligence.v1beta2.VideoIntelligenceService/AnnotateVideo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VideoIntelligenceServiceServer).AnnotateVideo(ctx, req.(*AnnotateVideoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _VideoIntelligenceService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.cloud.videointelligence.v1beta2.VideoIntelligenceService", + HandlerType: (*VideoIntelligenceServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "AnnotateVideo", + Handler: _VideoIntelligenceService_AnnotateVideo_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/cloud/videointelligence/v1beta2/video_intelligence.proto", +} + +func init() { + proto.RegisterFile("google/cloud/videointelligence/v1beta2/video_intelligence.proto", fileDescriptor0) +} + +var fileDescriptor0 = []byte{ + // 1718 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0x4f, 0x6f, 0xdb, 0xc8, + 0x15, 0x2f, 0x25, 0xd9, 0xb1, 0x9e, 0xff, 0x48, 0x19, 0xcb, 0xb6, 0xec, 0x26, 0x5e, 0x97, 0x29, + 0x16, 0xae, 0x0b, 0x48, 0x88, 0x77, 0xb1, 0x45, 0x93, 0x6d, 0x17, 0xb2, 0x4c, 0x6d, 0xd4, 0x75, + 0x24, 0x81, 0x52, 0xd2, 0xa6, 0x4d, 0x41, 0x50, 0xe4, 0x88, 0x22, 0x96, 0xe2, 0x70, 0xc9, 0x61, + 0x10, 0xf7, 0xd0, 0xc3, 0x1e, 0x16, 0xe8, 0xb1, 0xe8, 0xa5, 0x9f, 0xa1, 0x87, 0x7e, 0x83, 0x02, + 0x45, 0x2f, 0x05, 0x72, 0x6d, 0x2f, 0xbd, 0xf4, 0xd4, 0x63, 0x3f, 0x40, 0x8f, 0x05, 0x67, 0x86, + 0x12, 0x45, 0xca, 0xb1, 0x94, 0x60, 0x6f, 0x9c, 0xf7, 0xe6, 0xfd, 0xde, 0xff, 0x37, 0x33, 0x84, + 0xcf, 0x2c, 0x42, 0x2c, 0x07, 0xd7, 0x0d, 0x87, 0x84, 0x66, 0xfd, 0x95, 0x6d, 0x62, 0x62, 0xbb, + 0x14, 0x3b, 0x8e, 0x6d, 0x61, 0xd7, 0xc0, 0xf5, 0x57, 0x0f, 0x87, 0x98, 0xea, 0xe7, 0x9c, 0xa3, + 0x25, 0x59, 0x35, 0xcf, 0x27, 0x94, 0xa0, 0x0f, 0x39, 0x40, 0x8d, 0x01, 0xd4, 0x32, 0x00, 0x35, + 0x01, 0x70, 0x74, 0x4f, 0x28, 0xd2, 0x3d, 0xbb, 0xae, 0xbb, 0x2e, 0xa1, 0x3a, 0xb5, 0x89, 0x1b, + 0x70, 0x94, 0xa3, 0x07, 0x82, 0xeb, 0x10, 0xd7, 0xf2, 0x43, 0xd7, 0xb5, 0x5d, 0xab, 0x4e, 0x3c, + 0xec, 0xcf, 0x6d, 0x3a, 0x16, 0x9b, 0xd8, 0x6a, 0x18, 0x8e, 0xea, 0x66, 0xc8, 0x37, 0x08, 0xfe, + 0x07, 0x69, 0x3e, 0xb5, 0x27, 0x38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 0xb0, 0x2a, 0x29, 0xaa, 0x7c, 0x21, 0x3f, 0x84, 0xc3, 0x1b, 0xcb, 0x60, 0x26, 0x22, + 0x25, 0x45, 0x3e, 0x81, 0xe3, 0xb7, 0xe7, 0xeb, 0x06, 0x39, 0x1d, 0x76, 0x17, 0x04, 0x78, 0xf1, + 0x66, 0xf4, 0x31, 0xec, 0xdb, 0xae, 0xe1, 0x84, 0x26, 0xd6, 0x86, 0x24, 0x74, 0x4d, 0xdb, 0xb5, + 0xb4, 0x21, 0x79, 0xcd, 0x06, 0x57, 0xe4, 0x5f, 0x45, 0x70, 0x2f, 0x04, 0xf3, 0x22, 0xe2, 0xc9, + 0x7f, 0x94, 0x44, 0xe3, 0x8b, 0x86, 0x45, 0x0a, 0x8b, 0x90, 0x4f, 0xb5, 0x68, 0xfc, 0x6a, 0x64, + 0x34, 0x0a, 0x30, 0x65, 0x8a, 0x36, 0xcf, 0x0f, 0xe3, 0x64, 0xc4, 0x23, 0xba, 0x76, 0x29, 0x46, + 0xb8, 0x5a, 0x62, 0x32, 0x03, 0x7b, 0x82, 0xbb, 0x4c, 0x02, 0x35, 0xa0, 0x84, 0x5d, 0x73, 0x0e, + 0x24, 0x77, 0x1b, 0xc8, 0x36, 0x76, 0xcd, 0x19, 0x84, 0xfc, 0x5b, 0xd8, 0x62, 0x59, 0x8d, 0x2d, + 0xeb, 0xc0, 0x1d, 0x31, 0x4c, 0x84, 0x3d, 0xef, 0x36, 0x91, 0x62, 0x10, 0x74, 0x0c, 0xc0, 0x8a, + 0xde, 0x8c, 0xf6, 0x32, 0xeb, 0x72, 0x6a, 0x82, 0x22, 0x8f, 0x01, 0x98, 0xfe, 0x96, 0xaf, 0x4f, + 0x30, 0x7a, 0x04, 0x9b, 0x2b, 0x45, 0x04, 0xe8, 0x2c, 0x18, 0xb7, 0x69, 0x72, 0x60, 0x5d, 0x71, + 0xa9, 0x4d, 0xaf, 0xa3, 0x13, 0x0b, 0xb3, 0xaf, 0x68, 0x4c, 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39, 0x47, 0x6e, 0x32, 0x13, 0x33, 0x76, + 0xd4, 0x9e, 0x3f, 0xbc, 0x88, 0x44, 0xdf, 0xc4, 0x1b, 0x5f, 0xb2, 0x8d, 0x2f, 0x33, 0x1b, 0x5f, + 0x3e, 0xe7, 0x3a, 0x86, 0xeb, 0xcc, 0xaa, 0x8f, 0xfe, 0x1f, 0x00, 0x00, 0xff, 0xff, 0x1e, 0x8a, + 0xa0, 0x1c, 0x24, 0x15, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/vision/v1/geometry.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/vision/v1/geometry.pb.go new file mode 100644 index 0000000000..ef01b7cbb9 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/vision/v1/geometry.pb.go @@ -0,0 +1,171 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/vision/v1/geometry.proto + +/* +Package vision is a generated protocol buffer package. + +It is generated from these files: + google/cloud/vision/v1/geometry.proto + google/cloud/vision/v1/image_annotator.proto + google/cloud/vision/v1/text_annotation.proto + google/cloud/vision/v1/web_detection.proto + +It has these top-level messages: + Vertex + BoundingPoly + Position + Feature + ImageSource + Image + FaceAnnotation + LocationInfo + Property + EntityAnnotation + SafeSearchAnnotation + LatLongRect + ColorInfo + DominantColorsAnnotation + ImageProperties + CropHint + CropHintsAnnotation + CropHintsParams + ImageContext + AnnotateImageRequest + AnnotateImageResponse + BatchAnnotateImagesRequest + BatchAnnotateImagesResponse + TextAnnotation + Page + Block + Paragraph + Word + Symbol + WebDetection +*/ +package vision + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// A vertex represents a 2D point in the image. +// NOTE: the vertex coordinates are in the same scale as the original image. +type Vertex struct { + // X coordinate. + X int32 `protobuf:"varint,1,opt,name=x" json:"x,omitempty"` + // Y coordinate. + Y int32 `protobuf:"varint,2,opt,name=y" json:"y,omitempty"` +} + +func (m *Vertex) Reset() { *m = Vertex{} } +func (m *Vertex) String() string { return proto.CompactTextString(m) } +func (*Vertex) ProtoMessage() {} +func (*Vertex) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *Vertex) GetX() int32 { + if m != nil { + return m.X + } + return 0 +} + +func (m *Vertex) GetY() int32 { + if m != nil { + return m.Y + } + return 0 +} + +// A bounding polygon for the detected image annotation. +type BoundingPoly struct { + // The bounding polygon vertices. + Vertices []*Vertex `protobuf:"bytes,1,rep,name=vertices" json:"vertices,omitempty"` +} + +func (m *BoundingPoly) Reset() { *m = BoundingPoly{} } +func (m *BoundingPoly) String() string { return proto.CompactTextString(m) } +func (*BoundingPoly) ProtoMessage() {} +func (*BoundingPoly) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *BoundingPoly) GetVertices() []*Vertex { + if m != nil { + return m.Vertices + } + return nil +} + +// A 3D position in the image, used primarily for Face detection landmarks. +// A valid Position must have both x and y coordinates. +// The position coordinates are in the same scale as the original image. +type Position struct { + // X coordinate. + X float32 `protobuf:"fixed32,1,opt,name=x" json:"x,omitempty"` + // Y coordinate. + Y float32 `protobuf:"fixed32,2,opt,name=y" json:"y,omitempty"` + // Z coordinate (or depth). + Z float32 `protobuf:"fixed32,3,opt,name=z" json:"z,omitempty"` +} + +func (m *Position) Reset() { *m = Position{} } +func (m *Position) String() string { return proto.CompactTextString(m) } +func (*Position) ProtoMessage() {} +func (*Position) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *Position) GetX() float32 { + if m != nil { + return m.X + } + return 0 +} + +func (m *Position) GetY() float32 { + if m != nil { + return m.Y + } + return 0 +} + +func (m *Position) GetZ() float32 { + if m != nil { + return m.Z + } + return 0 +} + +func init() { + proto.RegisterType((*Vertex)(nil), "google.cloud.vision.v1.Vertex") + proto.RegisterType((*BoundingPoly)(nil), "google.cloud.vision.v1.BoundingPoly") + proto.RegisterType((*Position)(nil), "google.cloud.vision.v1.Position") +} + +func init() { proto.RegisterFile("google/cloud/vision/v1/geometry.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 237 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x90, 0x31, 0x4b, 0x03, 0x31, + 0x14, 0x80, 0x79, 0x57, 0x2c, 0x25, 0xd6, 0xe5, 0x06, 0x39, 0x1c, 0xa4, 0x1c, 0x0a, 0x9d, 0x12, + 0xaa, 0x4e, 0xea, 0x74, 0x8b, 0xe0, 0x74, 0xdc, 0xe0, 0xe0, 0x56, 0xaf, 0x8f, 0x47, 0xe0, 0x9a, + 0x57, 0x92, 0x34, 0x34, 0xfd, 0xe5, 0x8e, 0xd2, 0xa4, 0x28, 0x8a, 0xdd, 0xf2, 0x91, 0x8f, 0xf7, + 0xf1, 0x9e, 0xb8, 0x25, 0x66, 0x1a, 0x50, 0xf5, 0x03, 0x6f, 0x57, 0x2a, 0x68, 0xa7, 0xd9, 0xa8, + 0xb0, 0x50, 0x84, 0xbc, 0x46, 0x6f, 0xa3, 0xdc, 0x58, 0xf6, 0x5c, 0x5e, 0x66, 0x4d, 0x26, 0x4d, + 0x66, 0x4d, 0x86, 0x45, 0x7d, 0x23, 0xc6, 0x6f, 0x68, 0x3d, 0xee, 0xca, 0xa9, 0x80, 0x5d, 0x05, + 0x33, 0x98, 0x9f, 0x75, 0x90, 0x28, 0x56, 0x45, 0xa6, 0x58, 0xbf, 0x8a, 0x69, 0xc3, 0x5b, 0xb3, + 0xd2, 0x86, 0x5a, 0x1e, 0x62, 0xf9, 0x28, 0x26, 0x01, 0xad, 0xd7, 0x3d, 0xba, 0x0a, 0x66, 0xa3, + 0xf9, 0xf9, 0xdd, 0xb5, 0xfc, 0x3f, 0x20, 0xf3, 0xf4, 0xee, 0xdb, 0xaf, 0x1f, 0xc4, 0xa4, 0x65, + 0xa7, 0xbd, 0x66, 0xf3, 0xd3, 0x2c, 0x7e, 0x35, 0x8b, 0x0e, 0xe2, 0x81, 0xf6, 0xd5, 0x28, 0xd3, + 0xbe, 0x31, 0xe2, 0xaa, 0xe7, 0xf5, 0x89, 0x48, 0x73, 0xf1, 0x72, 0xdc, 0xb6, 0x3d, 0x2c, 0xdb, + 0xc2, 0xfb, 0xf3, 0x51, 0x24, 0x1e, 0x96, 0x86, 0x24, 0x5b, 0x52, 0x84, 0x26, 0x9d, 0x42, 0xe5, + 0xaf, 0xe5, 0x46, 0xbb, 0xbf, 0x47, 0x7b, 0xca, 0xaf, 0x4f, 0x80, 0x8f, 0x71, 0x72, 0xef, 0xbf, + 0x02, 0x00, 0x00, 0xff, 0xff, 0xd0, 0x04, 0x38, 0x95, 0x5f, 0x01, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/vision/v1/image_annotator.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/vision/v1/image_annotator.pb.go new file mode 100644 index 0000000000..d5ed6d63dd --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/vision/v1/image_annotator.pb.go @@ -0,0 +1,1438 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/vision/v1/image_annotator.proto + +package vision + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_rpc "google.golang.org/genproto/googleapis/rpc/status" +import google_type "google.golang.org/genproto/googleapis/type/color" +import google_type1 "google.golang.org/genproto/googleapis/type/latlng" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// A bucketized representation of likelihood, which is intended to give clients +// highly stable results across model upgrades. +type Likelihood int32 + +const ( + // Unknown likelihood. + Likelihood_UNKNOWN Likelihood = 0 + // It is very unlikely that the image belongs to the specified vertical. + Likelihood_VERY_UNLIKELY Likelihood = 1 + // It is unlikely that the image belongs to the specified vertical. + Likelihood_UNLIKELY Likelihood = 2 + // It is possible that the image belongs to the specified vertical. + Likelihood_POSSIBLE Likelihood = 3 + // It is likely that the image belongs to the specified vertical. + Likelihood_LIKELY Likelihood = 4 + // It is very likely that the image belongs to the specified vertical. + Likelihood_VERY_LIKELY Likelihood = 5 +) + +var Likelihood_name = map[int32]string{ + 0: "UNKNOWN", + 1: "VERY_UNLIKELY", + 2: "UNLIKELY", + 3: "POSSIBLE", + 4: "LIKELY", + 5: "VERY_LIKELY", +} +var Likelihood_value = map[string]int32{ + "UNKNOWN": 0, + "VERY_UNLIKELY": 1, + "UNLIKELY": 2, + "POSSIBLE": 3, + "LIKELY": 4, + "VERY_LIKELY": 5, +} + +func (x Likelihood) String() string { + return proto.EnumName(Likelihood_name, int32(x)) +} +func (Likelihood) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +// Type of image feature. +type Feature_Type int32 + +const ( + // Unspecified feature type. + Feature_TYPE_UNSPECIFIED Feature_Type = 0 + // Run face detection. + Feature_FACE_DETECTION Feature_Type = 1 + // Run landmark detection. + Feature_LANDMARK_DETECTION Feature_Type = 2 + // Run logo detection. + Feature_LOGO_DETECTION Feature_Type = 3 + // Run label detection. + Feature_LABEL_DETECTION Feature_Type = 4 + // Run OCR. + Feature_TEXT_DETECTION Feature_Type = 5 + // Run dense text document OCR. Takes precedence when both + // DOCUMENT_TEXT_DETECTION and TEXT_DETECTION are present. + Feature_DOCUMENT_TEXT_DETECTION Feature_Type = 11 + // Run computer vision models to compute image safe-search properties. + Feature_SAFE_SEARCH_DETECTION Feature_Type = 6 + // Compute a set of image properties, such as the image's dominant colors. + Feature_IMAGE_PROPERTIES Feature_Type = 7 + // Run crop hints. + Feature_CROP_HINTS Feature_Type = 9 + // Run web detection. + Feature_WEB_DETECTION Feature_Type = 10 +) + +var Feature_Type_name = map[int32]string{ + 0: "TYPE_UNSPECIFIED", + 1: "FACE_DETECTION", + 2: "LANDMARK_DETECTION", + 3: "LOGO_DETECTION", + 4: "LABEL_DETECTION", + 5: "TEXT_DETECTION", + 11: "DOCUMENT_TEXT_DETECTION", + 6: "SAFE_SEARCH_DETECTION", + 7: "IMAGE_PROPERTIES", + 9: "CROP_HINTS", + 10: "WEB_DETECTION", +} +var Feature_Type_value = map[string]int32{ + "TYPE_UNSPECIFIED": 0, + "FACE_DETECTION": 1, + "LANDMARK_DETECTION": 2, + "LOGO_DETECTION": 3, + "LABEL_DETECTION": 4, + "TEXT_DETECTION": 5, + "DOCUMENT_TEXT_DETECTION": 11, + "SAFE_SEARCH_DETECTION": 6, + "IMAGE_PROPERTIES": 7, + "CROP_HINTS": 9, + "WEB_DETECTION": 10, +} + +func (x Feature_Type) String() string { + return proto.EnumName(Feature_Type_name, int32(x)) +} +func (Feature_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{0, 0} } + +// Face landmark (feature) type. +// Left and right are defined from the vantage of the viewer of the image +// without considering mirror projections typical of photos. So, `LEFT_EYE`, +// typically, is the person's right eye. +type FaceAnnotation_Landmark_Type int32 + +const ( + // Unknown face landmark detected. Should not be filled. + FaceAnnotation_Landmark_UNKNOWN_LANDMARK FaceAnnotation_Landmark_Type = 0 + // Left eye. + FaceAnnotation_Landmark_LEFT_EYE FaceAnnotation_Landmark_Type = 1 + // Right eye. + FaceAnnotation_Landmark_RIGHT_EYE FaceAnnotation_Landmark_Type = 2 + // Left of left eyebrow. + FaceAnnotation_Landmark_LEFT_OF_LEFT_EYEBROW FaceAnnotation_Landmark_Type = 3 + // Right of left eyebrow. + FaceAnnotation_Landmark_RIGHT_OF_LEFT_EYEBROW FaceAnnotation_Landmark_Type = 4 + // Left of right eyebrow. + FaceAnnotation_Landmark_LEFT_OF_RIGHT_EYEBROW FaceAnnotation_Landmark_Type = 5 + // Right of right eyebrow. + FaceAnnotation_Landmark_RIGHT_OF_RIGHT_EYEBROW FaceAnnotation_Landmark_Type = 6 + // Midpoint between eyes. + FaceAnnotation_Landmark_MIDPOINT_BETWEEN_EYES FaceAnnotation_Landmark_Type = 7 + // Nose tip. + FaceAnnotation_Landmark_NOSE_TIP FaceAnnotation_Landmark_Type = 8 + // Upper lip. + FaceAnnotation_Landmark_UPPER_LIP FaceAnnotation_Landmark_Type = 9 + // Lower lip. + FaceAnnotation_Landmark_LOWER_LIP FaceAnnotation_Landmark_Type = 10 + // Mouth left. + FaceAnnotation_Landmark_MOUTH_LEFT FaceAnnotation_Landmark_Type = 11 + // Mouth right. + FaceAnnotation_Landmark_MOUTH_RIGHT FaceAnnotation_Landmark_Type = 12 + // Mouth center. + FaceAnnotation_Landmark_MOUTH_CENTER FaceAnnotation_Landmark_Type = 13 + // Nose, bottom right. + FaceAnnotation_Landmark_NOSE_BOTTOM_RIGHT FaceAnnotation_Landmark_Type = 14 + // Nose, bottom left. + FaceAnnotation_Landmark_NOSE_BOTTOM_LEFT FaceAnnotation_Landmark_Type = 15 + // Nose, bottom center. + FaceAnnotation_Landmark_NOSE_BOTTOM_CENTER FaceAnnotation_Landmark_Type = 16 + // Left eye, top boundary. + FaceAnnotation_Landmark_LEFT_EYE_TOP_BOUNDARY FaceAnnotation_Landmark_Type = 17 + // Left eye, right corner. + FaceAnnotation_Landmark_LEFT_EYE_RIGHT_CORNER FaceAnnotation_Landmark_Type = 18 + // Left eye, bottom boundary. + FaceAnnotation_Landmark_LEFT_EYE_BOTTOM_BOUNDARY FaceAnnotation_Landmark_Type = 19 + // Left eye, left corner. + FaceAnnotation_Landmark_LEFT_EYE_LEFT_CORNER FaceAnnotation_Landmark_Type = 20 + // Right eye, top boundary. + FaceAnnotation_Landmark_RIGHT_EYE_TOP_BOUNDARY FaceAnnotation_Landmark_Type = 21 + // Right eye, right corner. + FaceAnnotation_Landmark_RIGHT_EYE_RIGHT_CORNER FaceAnnotation_Landmark_Type = 22 + // Right eye, bottom boundary. + FaceAnnotation_Landmark_RIGHT_EYE_BOTTOM_BOUNDARY FaceAnnotation_Landmark_Type = 23 + // Right eye, left corner. + FaceAnnotation_Landmark_RIGHT_EYE_LEFT_CORNER FaceAnnotation_Landmark_Type = 24 + // Left eyebrow, upper midpoint. + FaceAnnotation_Landmark_LEFT_EYEBROW_UPPER_MIDPOINT FaceAnnotation_Landmark_Type = 25 + // Right eyebrow, upper midpoint. + FaceAnnotation_Landmark_RIGHT_EYEBROW_UPPER_MIDPOINT FaceAnnotation_Landmark_Type = 26 + // Left ear tragion. + FaceAnnotation_Landmark_LEFT_EAR_TRAGION FaceAnnotation_Landmark_Type = 27 + // Right ear tragion. + FaceAnnotation_Landmark_RIGHT_EAR_TRAGION FaceAnnotation_Landmark_Type = 28 + // Left eye pupil. + FaceAnnotation_Landmark_LEFT_EYE_PUPIL FaceAnnotation_Landmark_Type = 29 + // Right eye pupil. + FaceAnnotation_Landmark_RIGHT_EYE_PUPIL FaceAnnotation_Landmark_Type = 30 + // Forehead glabella. + FaceAnnotation_Landmark_FOREHEAD_GLABELLA FaceAnnotation_Landmark_Type = 31 + // Chin gnathion. + FaceAnnotation_Landmark_CHIN_GNATHION FaceAnnotation_Landmark_Type = 32 + // Chin left gonion. + FaceAnnotation_Landmark_CHIN_LEFT_GONION FaceAnnotation_Landmark_Type = 33 + // Chin right gonion. + FaceAnnotation_Landmark_CHIN_RIGHT_GONION FaceAnnotation_Landmark_Type = 34 +) + +var FaceAnnotation_Landmark_Type_name = map[int32]string{ + 0: "UNKNOWN_LANDMARK", + 1: "LEFT_EYE", + 2: "RIGHT_EYE", + 3: "LEFT_OF_LEFT_EYEBROW", + 4: "RIGHT_OF_LEFT_EYEBROW", + 5: "LEFT_OF_RIGHT_EYEBROW", + 6: "RIGHT_OF_RIGHT_EYEBROW", + 7: "MIDPOINT_BETWEEN_EYES", + 8: "NOSE_TIP", + 9: "UPPER_LIP", + 10: "LOWER_LIP", + 11: "MOUTH_LEFT", + 12: "MOUTH_RIGHT", + 13: "MOUTH_CENTER", + 14: "NOSE_BOTTOM_RIGHT", + 15: "NOSE_BOTTOM_LEFT", + 16: "NOSE_BOTTOM_CENTER", + 17: "LEFT_EYE_TOP_BOUNDARY", + 18: "LEFT_EYE_RIGHT_CORNER", + 19: "LEFT_EYE_BOTTOM_BOUNDARY", + 20: "LEFT_EYE_LEFT_CORNER", + 21: "RIGHT_EYE_TOP_BOUNDARY", + 22: "RIGHT_EYE_RIGHT_CORNER", + 23: "RIGHT_EYE_BOTTOM_BOUNDARY", + 24: "RIGHT_EYE_LEFT_CORNER", + 25: "LEFT_EYEBROW_UPPER_MIDPOINT", + 26: "RIGHT_EYEBROW_UPPER_MIDPOINT", + 27: "LEFT_EAR_TRAGION", + 28: "RIGHT_EAR_TRAGION", + 29: "LEFT_EYE_PUPIL", + 30: "RIGHT_EYE_PUPIL", + 31: "FOREHEAD_GLABELLA", + 32: "CHIN_GNATHION", + 33: "CHIN_LEFT_GONION", + 34: "CHIN_RIGHT_GONION", +} +var FaceAnnotation_Landmark_Type_value = map[string]int32{ + "UNKNOWN_LANDMARK": 0, + "LEFT_EYE": 1, + "RIGHT_EYE": 2, + "LEFT_OF_LEFT_EYEBROW": 3, + "RIGHT_OF_LEFT_EYEBROW": 4, + "LEFT_OF_RIGHT_EYEBROW": 5, + "RIGHT_OF_RIGHT_EYEBROW": 6, + "MIDPOINT_BETWEEN_EYES": 7, + "NOSE_TIP": 8, + "UPPER_LIP": 9, + "LOWER_LIP": 10, + "MOUTH_LEFT": 11, + "MOUTH_RIGHT": 12, + "MOUTH_CENTER": 13, + "NOSE_BOTTOM_RIGHT": 14, + "NOSE_BOTTOM_LEFT": 15, + "NOSE_BOTTOM_CENTER": 16, + "LEFT_EYE_TOP_BOUNDARY": 17, + "LEFT_EYE_RIGHT_CORNER": 18, + "LEFT_EYE_BOTTOM_BOUNDARY": 19, + "LEFT_EYE_LEFT_CORNER": 20, + "RIGHT_EYE_TOP_BOUNDARY": 21, + "RIGHT_EYE_RIGHT_CORNER": 22, + "RIGHT_EYE_BOTTOM_BOUNDARY": 23, + "RIGHT_EYE_LEFT_CORNER": 24, + "LEFT_EYEBROW_UPPER_MIDPOINT": 25, + "RIGHT_EYEBROW_UPPER_MIDPOINT": 26, + "LEFT_EAR_TRAGION": 27, + "RIGHT_EAR_TRAGION": 28, + "LEFT_EYE_PUPIL": 29, + "RIGHT_EYE_PUPIL": 30, + "FOREHEAD_GLABELLA": 31, + "CHIN_GNATHION": 32, + "CHIN_LEFT_GONION": 33, + "CHIN_RIGHT_GONION": 34, +} + +func (x FaceAnnotation_Landmark_Type) String() string { + return proto.EnumName(FaceAnnotation_Landmark_Type_name, int32(x)) +} +func (FaceAnnotation_Landmark_Type) EnumDescriptor() ([]byte, []int) { + return fileDescriptor1, []int{3, 0, 0} +} + +// Users describe the type of Google Cloud Vision API tasks to perform over +// images by using *Feature*s. Each Feature indicates a type of image +// detection task to perform. Features encode the Cloud Vision API +// vertical to operate on and the number of top-scoring results to return. +type Feature struct { + // The feature type. + Type Feature_Type `protobuf:"varint,1,opt,name=type,enum=google.cloud.vision.v1.Feature_Type" json:"type,omitempty"` + // Maximum number of results of this type. + MaxResults int32 `protobuf:"varint,2,opt,name=max_results,json=maxResults" json:"max_results,omitempty"` +} + +func (m *Feature) Reset() { *m = Feature{} } +func (m *Feature) String() string { return proto.CompactTextString(m) } +func (*Feature) ProtoMessage() {} +func (*Feature) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +func (m *Feature) GetType() Feature_Type { + if m != nil { + return m.Type + } + return Feature_TYPE_UNSPECIFIED +} + +func (m *Feature) GetMaxResults() int32 { + if m != nil { + return m.MaxResults + } + return 0 +} + +// External image source (Google Cloud Storage image location). +type ImageSource struct { + // NOTE: For new code `image_uri` below is preferred. + // Google Cloud Storage image URI, which must be in the following form: + // `gs://bucket_name/object_name` (for details, see + // [Google Cloud Storage Request + // URIs](https://cloud.google.com/storage/docs/reference-uris)). + // NOTE: Cloud Storage object versioning is not supported. + GcsImageUri string `protobuf:"bytes,1,opt,name=gcs_image_uri,json=gcsImageUri" json:"gcs_image_uri,omitempty"` + // Image URI which supports: + // 1) Google Cloud Storage image URI, which must be in the following form: + // `gs://bucket_name/object_name` (for details, see + // [Google Cloud Storage Request + // URIs](https://cloud.google.com/storage/docs/reference-uris)). + // NOTE: Cloud Storage object versioning is not supported. + // 2) Publicly accessible image HTTP/HTTPS URL. + // This is preferred over the legacy `gcs_image_uri` above. When both + // `gcs_image_uri` and `image_uri` are specified, `image_uri` takes + // precedence. + ImageUri string `protobuf:"bytes,2,opt,name=image_uri,json=imageUri" json:"image_uri,omitempty"` +} + +func (m *ImageSource) Reset() { *m = ImageSource{} } +func (m *ImageSource) String() string { return proto.CompactTextString(m) } +func (*ImageSource) ProtoMessage() {} +func (*ImageSource) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} } + +func (m *ImageSource) GetGcsImageUri() string { + if m != nil { + return m.GcsImageUri + } + return "" +} + +func (m *ImageSource) GetImageUri() string { + if m != nil { + return m.ImageUri + } + return "" +} + +// Client image to perform Google Cloud Vision API tasks over. +type Image struct { + // Image content, represented as a stream of bytes. + // Note: as with all `bytes` fields, protobuffers use a pure binary + // representation, whereas JSON representations use base64. + Content []byte `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` + // Google Cloud Storage image location. If both `content` and `source` + // are provided for an image, `content` takes precedence and is + // used to perform the image annotation request. + Source *ImageSource `protobuf:"bytes,2,opt,name=source" json:"source,omitempty"` +} + +func (m *Image) Reset() { *m = Image{} } +func (m *Image) String() string { return proto.CompactTextString(m) } +func (*Image) ProtoMessage() {} +func (*Image) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} } + +func (m *Image) GetContent() []byte { + if m != nil { + return m.Content + } + return nil +} + +func (m *Image) GetSource() *ImageSource { + if m != nil { + return m.Source + } + return nil +} + +// A face annotation object contains the results of face detection. +type FaceAnnotation struct { + // The bounding polygon around the face. The coordinates of the bounding box + // are in the original image's scale, as returned in `ImageParams`. + // The bounding box is computed to "frame" the face in accordance with human + // expectations. It is based on the landmarker results. + // Note that one or more x and/or y coordinates may not be generated in the + // `BoundingPoly` (the polygon will be unbounded) if only a partial face + // appears in the image to be annotated. + BoundingPoly *BoundingPoly `protobuf:"bytes,1,opt,name=bounding_poly,json=boundingPoly" json:"bounding_poly,omitempty"` + // The `fd_bounding_poly` bounding polygon is tighter than the + // `boundingPoly`, and encloses only the skin part of the face. Typically, it + // is used to eliminate the face from any image analysis that detects the + // "amount of skin" visible in an image. It is not based on the + // landmarker results, only on the initial face detection, hence + // the fd (face detection) prefix. + FdBoundingPoly *BoundingPoly `protobuf:"bytes,2,opt,name=fd_bounding_poly,json=fdBoundingPoly" json:"fd_bounding_poly,omitempty"` + // Detected face landmarks. + Landmarks []*FaceAnnotation_Landmark `protobuf:"bytes,3,rep,name=landmarks" json:"landmarks,omitempty"` + // Roll angle, which indicates the amount of clockwise/anti-clockwise rotation + // of the face relative to the image vertical about the axis perpendicular to + // the face. Range [-180,180]. + RollAngle float32 `protobuf:"fixed32,4,opt,name=roll_angle,json=rollAngle" json:"roll_angle,omitempty"` + // Yaw angle, which indicates the leftward/rightward angle that the face is + // pointing relative to the vertical plane perpendicular to the image. Range + // [-180,180]. + PanAngle float32 `protobuf:"fixed32,5,opt,name=pan_angle,json=panAngle" json:"pan_angle,omitempty"` + // Pitch angle, which indicates the upwards/downwards angle that the face is + // pointing relative to the image's horizontal plane. Range [-180,180]. + TiltAngle float32 `protobuf:"fixed32,6,opt,name=tilt_angle,json=tiltAngle" json:"tilt_angle,omitempty"` + // Detection confidence. Range [0, 1]. + DetectionConfidence float32 `protobuf:"fixed32,7,opt,name=detection_confidence,json=detectionConfidence" json:"detection_confidence,omitempty"` + // Face landmarking confidence. Range [0, 1]. + LandmarkingConfidence float32 `protobuf:"fixed32,8,opt,name=landmarking_confidence,json=landmarkingConfidence" json:"landmarking_confidence,omitempty"` + // Joy likelihood. + JoyLikelihood Likelihood `protobuf:"varint,9,opt,name=joy_likelihood,json=joyLikelihood,enum=google.cloud.vision.v1.Likelihood" json:"joy_likelihood,omitempty"` + // Sorrow likelihood. + SorrowLikelihood Likelihood `protobuf:"varint,10,opt,name=sorrow_likelihood,json=sorrowLikelihood,enum=google.cloud.vision.v1.Likelihood" json:"sorrow_likelihood,omitempty"` + // Anger likelihood. + AngerLikelihood Likelihood `protobuf:"varint,11,opt,name=anger_likelihood,json=angerLikelihood,enum=google.cloud.vision.v1.Likelihood" json:"anger_likelihood,omitempty"` + // Surprise likelihood. + SurpriseLikelihood Likelihood `protobuf:"varint,12,opt,name=surprise_likelihood,json=surpriseLikelihood,enum=google.cloud.vision.v1.Likelihood" json:"surprise_likelihood,omitempty"` + // Under-exposed likelihood. + UnderExposedLikelihood Likelihood `protobuf:"varint,13,opt,name=under_exposed_likelihood,json=underExposedLikelihood,enum=google.cloud.vision.v1.Likelihood" json:"under_exposed_likelihood,omitempty"` + // Blurred likelihood. + BlurredLikelihood Likelihood `protobuf:"varint,14,opt,name=blurred_likelihood,json=blurredLikelihood,enum=google.cloud.vision.v1.Likelihood" json:"blurred_likelihood,omitempty"` + // Headwear likelihood. + HeadwearLikelihood Likelihood `protobuf:"varint,15,opt,name=headwear_likelihood,json=headwearLikelihood,enum=google.cloud.vision.v1.Likelihood" json:"headwear_likelihood,omitempty"` +} + +func (m *FaceAnnotation) Reset() { *m = FaceAnnotation{} } +func (m *FaceAnnotation) String() string { return proto.CompactTextString(m) } +func (*FaceAnnotation) ProtoMessage() {} +func (*FaceAnnotation) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{3} } + +func (m *FaceAnnotation) GetBoundingPoly() *BoundingPoly { + if m != nil { + return m.BoundingPoly + } + return nil +} + +func (m *FaceAnnotation) GetFdBoundingPoly() *BoundingPoly { + if m != nil { + return m.FdBoundingPoly + } + return nil +} + +func (m *FaceAnnotation) GetLandmarks() []*FaceAnnotation_Landmark { + if m != nil { + return m.Landmarks + } + return nil +} + +func (m *FaceAnnotation) GetRollAngle() float32 { + if m != nil { + return m.RollAngle + } + return 0 +} + +func (m *FaceAnnotation) GetPanAngle() float32 { + if m != nil { + return m.PanAngle + } + return 0 +} + +func (m *FaceAnnotation) GetTiltAngle() float32 { + if m != nil { + return m.TiltAngle + } + return 0 +} + +func (m *FaceAnnotation) GetDetectionConfidence() float32 { + if m != nil { + return m.DetectionConfidence + } + return 0 +} + +func (m *FaceAnnotation) GetLandmarkingConfidence() float32 { + if m != nil { + return m.LandmarkingConfidence + } + return 0 +} + +func (m *FaceAnnotation) GetJoyLikelihood() Likelihood { + if m != nil { + return m.JoyLikelihood + } + return Likelihood_UNKNOWN +} + +func (m *FaceAnnotation) GetSorrowLikelihood() Likelihood { + if m != nil { + return m.SorrowLikelihood + } + return Likelihood_UNKNOWN +} + +func (m *FaceAnnotation) GetAngerLikelihood() Likelihood { + if m != nil { + return m.AngerLikelihood + } + return Likelihood_UNKNOWN +} + +func (m *FaceAnnotation) GetSurpriseLikelihood() Likelihood { + if m != nil { + return m.SurpriseLikelihood + } + return Likelihood_UNKNOWN +} + +func (m *FaceAnnotation) GetUnderExposedLikelihood() Likelihood { + if m != nil { + return m.UnderExposedLikelihood + } + return Likelihood_UNKNOWN +} + +func (m *FaceAnnotation) GetBlurredLikelihood() Likelihood { + if m != nil { + return m.BlurredLikelihood + } + return Likelihood_UNKNOWN +} + +func (m *FaceAnnotation) GetHeadwearLikelihood() Likelihood { + if m != nil { + return m.HeadwearLikelihood + } + return Likelihood_UNKNOWN +} + +// A face-specific landmark (for example, a face feature). +// Landmark positions may fall outside the bounds of the image +// if the face is near one or more edges of the image. +// Therefore it is NOT guaranteed that `0 <= x < width` or +// `0 <= y < height`. +type FaceAnnotation_Landmark struct { + // Face landmark type. + Type FaceAnnotation_Landmark_Type `protobuf:"varint,3,opt,name=type,enum=google.cloud.vision.v1.FaceAnnotation_Landmark_Type" json:"type,omitempty"` + // Face landmark position. + Position *Position `protobuf:"bytes,4,opt,name=position" json:"position,omitempty"` +} + +func (m *FaceAnnotation_Landmark) Reset() { *m = FaceAnnotation_Landmark{} } +func (m *FaceAnnotation_Landmark) String() string { return proto.CompactTextString(m) } +func (*FaceAnnotation_Landmark) ProtoMessage() {} +func (*FaceAnnotation_Landmark) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{3, 0} } + +func (m *FaceAnnotation_Landmark) GetType() FaceAnnotation_Landmark_Type { + if m != nil { + return m.Type + } + return FaceAnnotation_Landmark_UNKNOWN_LANDMARK +} + +func (m *FaceAnnotation_Landmark) GetPosition() *Position { + if m != nil { + return m.Position + } + return nil +} + +// Detected entity location information. +type LocationInfo struct { + // lat/long location coordinates. + LatLng *google_type1.LatLng `protobuf:"bytes,1,opt,name=lat_lng,json=latLng" json:"lat_lng,omitempty"` +} + +func (m *LocationInfo) Reset() { *m = LocationInfo{} } +func (m *LocationInfo) String() string { return proto.CompactTextString(m) } +func (*LocationInfo) ProtoMessage() {} +func (*LocationInfo) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{4} } + +func (m *LocationInfo) GetLatLng() *google_type1.LatLng { + if m != nil { + return m.LatLng + } + return nil +} + +// A `Property` consists of a user-supplied name/value pair. +type Property struct { + // Name of the property. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Value of the property. + Value string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` +} + +func (m *Property) Reset() { *m = Property{} } +func (m *Property) String() string { return proto.CompactTextString(m) } +func (*Property) ProtoMessage() {} +func (*Property) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{5} } + +func (m *Property) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Property) GetValue() string { + if m != nil { + return m.Value + } + return "" +} + +// Set of detected entity features. +type EntityAnnotation struct { + // Opaque entity ID. Some IDs may be available in + // [Google Knowledge Graph Search API](https://developers.google.com/knowledge-graph/). + Mid string `protobuf:"bytes,1,opt,name=mid" json:"mid,omitempty"` + // The language code for the locale in which the entity textual + // `description` is expressed. + Locale string `protobuf:"bytes,2,opt,name=locale" json:"locale,omitempty"` + // Entity textual description, expressed in its `locale` language. + Description string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` + // Overall score of the result. Range [0, 1]. + Score float32 `protobuf:"fixed32,4,opt,name=score" json:"score,omitempty"` + // The accuracy of the entity detection in an image. + // For example, for an image in which the "Eiffel Tower" entity is detected, + // this field represents the confidence that there is a tower in the query + // image. Range [0, 1]. + Confidence float32 `protobuf:"fixed32,5,opt,name=confidence" json:"confidence,omitempty"` + // The relevancy of the ICA (Image Content Annotation) label to the + // image. For example, the relevancy of "tower" is likely higher to an image + // containing the detected "Eiffel Tower" than to an image containing a + // detected distant towering building, even though the confidence that + // there is a tower in each image may be the same. Range [0, 1]. + Topicality float32 `protobuf:"fixed32,6,opt,name=topicality" json:"topicality,omitempty"` + // Image region to which this entity belongs. Currently not produced + // for `LABEL_DETECTION` features. For `TEXT_DETECTION` (OCR), `boundingPoly`s + // are produced for the entire text detected in an image region, followed by + // `boundingPoly`s for each word within the detected text. + BoundingPoly *BoundingPoly `protobuf:"bytes,7,opt,name=bounding_poly,json=boundingPoly" json:"bounding_poly,omitempty"` + // The location information for the detected entity. Multiple + // `LocationInfo` elements can be present because one location may + // indicate the location of the scene in the image, and another location + // may indicate the location of the place where the image was taken. + // Location information is usually present for landmarks. + Locations []*LocationInfo `protobuf:"bytes,8,rep,name=locations" json:"locations,omitempty"` + // Some entities may have optional user-supplied `Property` (name/value) + // fields, such a score or string that qualifies the entity. + Properties []*Property `protobuf:"bytes,9,rep,name=properties" json:"properties,omitempty"` +} + +func (m *EntityAnnotation) Reset() { *m = EntityAnnotation{} } +func (m *EntityAnnotation) String() string { return proto.CompactTextString(m) } +func (*EntityAnnotation) ProtoMessage() {} +func (*EntityAnnotation) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{6} } + +func (m *EntityAnnotation) GetMid() string { + if m != nil { + return m.Mid + } + return "" +} + +func (m *EntityAnnotation) GetLocale() string { + if m != nil { + return m.Locale + } + return "" +} + +func (m *EntityAnnotation) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *EntityAnnotation) GetScore() float32 { + if m != nil { + return m.Score + } + return 0 +} + +func (m *EntityAnnotation) GetConfidence() float32 { + if m != nil { + return m.Confidence + } + return 0 +} + +func (m *EntityAnnotation) GetTopicality() float32 { + if m != nil { + return m.Topicality + } + return 0 +} + +func (m *EntityAnnotation) GetBoundingPoly() *BoundingPoly { + if m != nil { + return m.BoundingPoly + } + return nil +} + +func (m *EntityAnnotation) GetLocations() []*LocationInfo { + if m != nil { + return m.Locations + } + return nil +} + +func (m *EntityAnnotation) GetProperties() []*Property { + if m != nil { + return m.Properties + } + return nil +} + +// Set of features pertaining to the image, computed by computer vision +// methods over safe-search verticals (for example, adult, spoof, medical, +// violence). +type SafeSearchAnnotation struct { + // Represents the adult content likelihood for the image. + Adult Likelihood `protobuf:"varint,1,opt,name=adult,enum=google.cloud.vision.v1.Likelihood" json:"adult,omitempty"` + // Spoof likelihood. The likelihood that an modification + // was made to the image's canonical version to make it appear + // funny or offensive. + Spoof Likelihood `protobuf:"varint,2,opt,name=spoof,enum=google.cloud.vision.v1.Likelihood" json:"spoof,omitempty"` + // Likelihood that this is a medical image. + Medical Likelihood `protobuf:"varint,3,opt,name=medical,enum=google.cloud.vision.v1.Likelihood" json:"medical,omitempty"` + // Violence likelihood. + Violence Likelihood `protobuf:"varint,4,opt,name=violence,enum=google.cloud.vision.v1.Likelihood" json:"violence,omitempty"` +} + +func (m *SafeSearchAnnotation) Reset() { *m = SafeSearchAnnotation{} } +func (m *SafeSearchAnnotation) String() string { return proto.CompactTextString(m) } +func (*SafeSearchAnnotation) ProtoMessage() {} +func (*SafeSearchAnnotation) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{7} } + +func (m *SafeSearchAnnotation) GetAdult() Likelihood { + if m != nil { + return m.Adult + } + return Likelihood_UNKNOWN +} + +func (m *SafeSearchAnnotation) GetSpoof() Likelihood { + if m != nil { + return m.Spoof + } + return Likelihood_UNKNOWN +} + +func (m *SafeSearchAnnotation) GetMedical() Likelihood { + if m != nil { + return m.Medical + } + return Likelihood_UNKNOWN +} + +func (m *SafeSearchAnnotation) GetViolence() Likelihood { + if m != nil { + return m.Violence + } + return Likelihood_UNKNOWN +} + +// Rectangle determined by min and max `LatLng` pairs. +type LatLongRect struct { + // Min lat/long pair. + MinLatLng *google_type1.LatLng `protobuf:"bytes,1,opt,name=min_lat_lng,json=minLatLng" json:"min_lat_lng,omitempty"` + // Max lat/long pair. + MaxLatLng *google_type1.LatLng `protobuf:"bytes,2,opt,name=max_lat_lng,json=maxLatLng" json:"max_lat_lng,omitempty"` +} + +func (m *LatLongRect) Reset() { *m = LatLongRect{} } +func (m *LatLongRect) String() string { return proto.CompactTextString(m) } +func (*LatLongRect) ProtoMessage() {} +func (*LatLongRect) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{8} } + +func (m *LatLongRect) GetMinLatLng() *google_type1.LatLng { + if m != nil { + return m.MinLatLng + } + return nil +} + +func (m *LatLongRect) GetMaxLatLng() *google_type1.LatLng { + if m != nil { + return m.MaxLatLng + } + return nil +} + +// Color information consists of RGB channels, score, and the fraction of +// the image that the color occupies in the image. +type ColorInfo struct { + // RGB components of the color. + Color *google_type.Color `protobuf:"bytes,1,opt,name=color" json:"color,omitempty"` + // Image-specific score for this color. Value in range [0, 1]. + Score float32 `protobuf:"fixed32,2,opt,name=score" json:"score,omitempty"` + // The fraction of pixels the color occupies in the image. + // Value in range [0, 1]. + PixelFraction float32 `protobuf:"fixed32,3,opt,name=pixel_fraction,json=pixelFraction" json:"pixel_fraction,omitempty"` +} + +func (m *ColorInfo) Reset() { *m = ColorInfo{} } +func (m *ColorInfo) String() string { return proto.CompactTextString(m) } +func (*ColorInfo) ProtoMessage() {} +func (*ColorInfo) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{9} } + +func (m *ColorInfo) GetColor() *google_type.Color { + if m != nil { + return m.Color + } + return nil +} + +func (m *ColorInfo) GetScore() float32 { + if m != nil { + return m.Score + } + return 0 +} + +func (m *ColorInfo) GetPixelFraction() float32 { + if m != nil { + return m.PixelFraction + } + return 0 +} + +// Set of dominant colors and their corresponding scores. +type DominantColorsAnnotation struct { + // RGB color values with their score and pixel fraction. + Colors []*ColorInfo `protobuf:"bytes,1,rep,name=colors" json:"colors,omitempty"` +} + +func (m *DominantColorsAnnotation) Reset() { *m = DominantColorsAnnotation{} } +func (m *DominantColorsAnnotation) String() string { return proto.CompactTextString(m) } +func (*DominantColorsAnnotation) ProtoMessage() {} +func (*DominantColorsAnnotation) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{10} } + +func (m *DominantColorsAnnotation) GetColors() []*ColorInfo { + if m != nil { + return m.Colors + } + return nil +} + +// Stores image properties, such as dominant colors. +type ImageProperties struct { + // If present, dominant colors completed successfully. + DominantColors *DominantColorsAnnotation `protobuf:"bytes,1,opt,name=dominant_colors,json=dominantColors" json:"dominant_colors,omitempty"` +} + +func (m *ImageProperties) Reset() { *m = ImageProperties{} } +func (m *ImageProperties) String() string { return proto.CompactTextString(m) } +func (*ImageProperties) ProtoMessage() {} +func (*ImageProperties) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{11} } + +func (m *ImageProperties) GetDominantColors() *DominantColorsAnnotation { + if m != nil { + return m.DominantColors + } + return nil +} + +// Single crop hint that is used to generate a new crop when serving an image. +type CropHint struct { + // The bounding polygon for the crop region. The coordinates of the bounding + // box are in the original image's scale, as returned in `ImageParams`. + BoundingPoly *BoundingPoly `protobuf:"bytes,1,opt,name=bounding_poly,json=boundingPoly" json:"bounding_poly,omitempty"` + // Confidence of this being a salient region. Range [0, 1]. + Confidence float32 `protobuf:"fixed32,2,opt,name=confidence" json:"confidence,omitempty"` + // Fraction of importance of this salient region with respect to the original + // image. + ImportanceFraction float32 `protobuf:"fixed32,3,opt,name=importance_fraction,json=importanceFraction" json:"importance_fraction,omitempty"` +} + +func (m *CropHint) Reset() { *m = CropHint{} } +func (m *CropHint) String() string { return proto.CompactTextString(m) } +func (*CropHint) ProtoMessage() {} +func (*CropHint) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{12} } + +func (m *CropHint) GetBoundingPoly() *BoundingPoly { + if m != nil { + return m.BoundingPoly + } + return nil +} + +func (m *CropHint) GetConfidence() float32 { + if m != nil { + return m.Confidence + } + return 0 +} + +func (m *CropHint) GetImportanceFraction() float32 { + if m != nil { + return m.ImportanceFraction + } + return 0 +} + +// Set of crop hints that are used to generate new crops when serving images. +type CropHintsAnnotation struct { + CropHints []*CropHint `protobuf:"bytes,1,rep,name=crop_hints,json=cropHints" json:"crop_hints,omitempty"` +} + +func (m *CropHintsAnnotation) Reset() { *m = CropHintsAnnotation{} } +func (m *CropHintsAnnotation) String() string { return proto.CompactTextString(m) } +func (*CropHintsAnnotation) ProtoMessage() {} +func (*CropHintsAnnotation) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{13} } + +func (m *CropHintsAnnotation) GetCropHints() []*CropHint { + if m != nil { + return m.CropHints + } + return nil +} + +// Parameters for crop hints annotation request. +type CropHintsParams struct { + // Aspect ratios in floats, representing the ratio of the width to the height + // of the image. For example, if the desired aspect ratio is 4/3, the + // corresponding float value should be 1.33333. If not specified, the + // best possible crop is returned. The number of provided aspect ratios is + // limited to a maximum of 16; any aspect ratios provided after the 16th are + // ignored. + AspectRatios []float32 `protobuf:"fixed32,1,rep,packed,name=aspect_ratios,json=aspectRatios" json:"aspect_ratios,omitempty"` +} + +func (m *CropHintsParams) Reset() { *m = CropHintsParams{} } +func (m *CropHintsParams) String() string { return proto.CompactTextString(m) } +func (*CropHintsParams) ProtoMessage() {} +func (*CropHintsParams) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{14} } + +func (m *CropHintsParams) GetAspectRatios() []float32 { + if m != nil { + return m.AspectRatios + } + return nil +} + +// Image context and/or feature-specific parameters. +type ImageContext struct { + // lat/long rectangle that specifies the location of the image. + LatLongRect *LatLongRect `protobuf:"bytes,1,opt,name=lat_long_rect,json=latLongRect" json:"lat_long_rect,omitempty"` + // List of languages to use for TEXT_DETECTION. In most cases, an empty value + // yields the best results since it enables automatic language detection. For + // languages based on the Latin alphabet, setting `language_hints` is not + // needed. In rare cases, when the language of the text in the image is known, + // setting a hint will help get better results (although it will be a + // significant hindrance if the hint is wrong). Text detection returns an + // error if one or more of the specified languages is not one of the + // [supported languages](/vision/docs/languages). + LanguageHints []string `protobuf:"bytes,2,rep,name=language_hints,json=languageHints" json:"language_hints,omitempty"` + // Parameters for crop hints annotation request. + CropHintsParams *CropHintsParams `protobuf:"bytes,4,opt,name=crop_hints_params,json=cropHintsParams" json:"crop_hints_params,omitempty"` +} + +func (m *ImageContext) Reset() { *m = ImageContext{} } +func (m *ImageContext) String() string { return proto.CompactTextString(m) } +func (*ImageContext) ProtoMessage() {} +func (*ImageContext) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{15} } + +func (m *ImageContext) GetLatLongRect() *LatLongRect { + if m != nil { + return m.LatLongRect + } + return nil +} + +func (m *ImageContext) GetLanguageHints() []string { + if m != nil { + return m.LanguageHints + } + return nil +} + +func (m *ImageContext) GetCropHintsParams() *CropHintsParams { + if m != nil { + return m.CropHintsParams + } + return nil +} + +// Request for performing Google Cloud Vision API tasks over a user-provided +// image, with user-requested features. +type AnnotateImageRequest struct { + // The image to be processed. + Image *Image `protobuf:"bytes,1,opt,name=image" json:"image,omitempty"` + // Requested features. + Features []*Feature `protobuf:"bytes,2,rep,name=features" json:"features,omitempty"` + // Additional context that may accompany the image. + ImageContext *ImageContext `protobuf:"bytes,3,opt,name=image_context,json=imageContext" json:"image_context,omitempty"` +} + +func (m *AnnotateImageRequest) Reset() { *m = AnnotateImageRequest{} } +func (m *AnnotateImageRequest) String() string { return proto.CompactTextString(m) } +func (*AnnotateImageRequest) ProtoMessage() {} +func (*AnnotateImageRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{16} } + +func (m *AnnotateImageRequest) GetImage() *Image { + if m != nil { + return m.Image + } + return nil +} + +func (m *AnnotateImageRequest) GetFeatures() []*Feature { + if m != nil { + return m.Features + } + return nil +} + +func (m *AnnotateImageRequest) GetImageContext() *ImageContext { + if m != nil { + return m.ImageContext + } + return nil +} + +// Response to an image annotation request. +type AnnotateImageResponse struct { + // If present, face detection has completed successfully. + FaceAnnotations []*FaceAnnotation `protobuf:"bytes,1,rep,name=face_annotations,json=faceAnnotations" json:"face_annotations,omitempty"` + // If present, landmark detection has completed successfully. + LandmarkAnnotations []*EntityAnnotation `protobuf:"bytes,2,rep,name=landmark_annotations,json=landmarkAnnotations" json:"landmark_annotations,omitempty"` + // If present, logo detection has completed successfully. + LogoAnnotations []*EntityAnnotation `protobuf:"bytes,3,rep,name=logo_annotations,json=logoAnnotations" json:"logo_annotations,omitempty"` + // If present, label detection has completed successfully. + LabelAnnotations []*EntityAnnotation `protobuf:"bytes,4,rep,name=label_annotations,json=labelAnnotations" json:"label_annotations,omitempty"` + // If present, text (OCR) detection or document (OCR) text detection has + // completed successfully. + TextAnnotations []*EntityAnnotation `protobuf:"bytes,5,rep,name=text_annotations,json=textAnnotations" json:"text_annotations,omitempty"` + // If present, text (OCR) detection or document (OCR) text detection has + // completed successfully. + // This annotation provides the structural hierarchy for the OCR detected + // text. + FullTextAnnotation *TextAnnotation `protobuf:"bytes,12,opt,name=full_text_annotation,json=fullTextAnnotation" json:"full_text_annotation,omitempty"` + // If present, safe-search annotation has completed successfully. + SafeSearchAnnotation *SafeSearchAnnotation `protobuf:"bytes,6,opt,name=safe_search_annotation,json=safeSearchAnnotation" json:"safe_search_annotation,omitempty"` + // If present, image properties were extracted successfully. + ImagePropertiesAnnotation *ImageProperties `protobuf:"bytes,8,opt,name=image_properties_annotation,json=imagePropertiesAnnotation" json:"image_properties_annotation,omitempty"` + // If present, crop hints have completed successfully. + CropHintsAnnotation *CropHintsAnnotation `protobuf:"bytes,11,opt,name=crop_hints_annotation,json=cropHintsAnnotation" json:"crop_hints_annotation,omitempty"` + // If present, web detection has completed successfully. + WebDetection *WebDetection `protobuf:"bytes,13,opt,name=web_detection,json=webDetection" json:"web_detection,omitempty"` + // If set, represents the error message for the operation. + // Note that filled-in image annotations are guaranteed to be + // correct, even when `error` is set. + Error *google_rpc.Status `protobuf:"bytes,9,opt,name=error" json:"error,omitempty"` +} + +func (m *AnnotateImageResponse) Reset() { *m = AnnotateImageResponse{} } +func (m *AnnotateImageResponse) String() string { return proto.CompactTextString(m) } +func (*AnnotateImageResponse) ProtoMessage() {} +func (*AnnotateImageResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{17} } + +func (m *AnnotateImageResponse) GetFaceAnnotations() []*FaceAnnotation { + if m != nil { + return m.FaceAnnotations + } + return nil +} + +func (m *AnnotateImageResponse) GetLandmarkAnnotations() []*EntityAnnotation { + if m != nil { + return m.LandmarkAnnotations + } + return nil +} + +func (m *AnnotateImageResponse) GetLogoAnnotations() []*EntityAnnotation { + if m != nil { + return m.LogoAnnotations + } + return nil +} + +func (m *AnnotateImageResponse) GetLabelAnnotations() []*EntityAnnotation { + if m != nil { + return m.LabelAnnotations + } + return nil +} + +func (m *AnnotateImageResponse) GetTextAnnotations() []*EntityAnnotation { + if m != nil { + return m.TextAnnotations + } + return nil +} + +func (m *AnnotateImageResponse) GetFullTextAnnotation() *TextAnnotation { + if m != nil { + return m.FullTextAnnotation + } + return nil +} + +func (m *AnnotateImageResponse) GetSafeSearchAnnotation() *SafeSearchAnnotation { + if m != nil { + return m.SafeSearchAnnotation + } + return nil +} + +func (m *AnnotateImageResponse) GetImagePropertiesAnnotation() *ImageProperties { + if m != nil { + return m.ImagePropertiesAnnotation + } + return nil +} + +func (m *AnnotateImageResponse) GetCropHintsAnnotation() *CropHintsAnnotation { + if m != nil { + return m.CropHintsAnnotation + } + return nil +} + +func (m *AnnotateImageResponse) GetWebDetection() *WebDetection { + if m != nil { + return m.WebDetection + } + return nil +} + +func (m *AnnotateImageResponse) GetError() *google_rpc.Status { + if m != nil { + return m.Error + } + return nil +} + +// Multiple image annotation requests are batched into a single service call. +type BatchAnnotateImagesRequest struct { + // Individual image annotation requests for this batch. + Requests []*AnnotateImageRequest `protobuf:"bytes,1,rep,name=requests" json:"requests,omitempty"` +} + +func (m *BatchAnnotateImagesRequest) Reset() { *m = BatchAnnotateImagesRequest{} } +func (m *BatchAnnotateImagesRequest) String() string { return proto.CompactTextString(m) } +func (*BatchAnnotateImagesRequest) ProtoMessage() {} +func (*BatchAnnotateImagesRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{18} } + +func (m *BatchAnnotateImagesRequest) GetRequests() []*AnnotateImageRequest { + if m != nil { + return m.Requests + } + return nil +} + +// Response to a batch image annotation request. +type BatchAnnotateImagesResponse struct { + // Individual responses to image annotation requests within the batch. + Responses []*AnnotateImageResponse `protobuf:"bytes,1,rep,name=responses" json:"responses,omitempty"` +} + +func (m *BatchAnnotateImagesResponse) Reset() { *m = BatchAnnotateImagesResponse{} } +func (m *BatchAnnotateImagesResponse) String() string { return proto.CompactTextString(m) } +func (*BatchAnnotateImagesResponse) ProtoMessage() {} +func (*BatchAnnotateImagesResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{19} } + +func (m *BatchAnnotateImagesResponse) GetResponses() []*AnnotateImageResponse { + if m != nil { + return m.Responses + } + return nil +} + +func init() { + proto.RegisterType((*Feature)(nil), "google.cloud.vision.v1.Feature") + proto.RegisterType((*ImageSource)(nil), "google.cloud.vision.v1.ImageSource") + proto.RegisterType((*Image)(nil), "google.cloud.vision.v1.Image") + proto.RegisterType((*FaceAnnotation)(nil), "google.cloud.vision.v1.FaceAnnotation") + proto.RegisterType((*FaceAnnotation_Landmark)(nil), "google.cloud.vision.v1.FaceAnnotation.Landmark") + proto.RegisterType((*LocationInfo)(nil), "google.cloud.vision.v1.LocationInfo") + proto.RegisterType((*Property)(nil), "google.cloud.vision.v1.Property") + proto.RegisterType((*EntityAnnotation)(nil), "google.cloud.vision.v1.EntityAnnotation") + proto.RegisterType((*SafeSearchAnnotation)(nil), "google.cloud.vision.v1.SafeSearchAnnotation") + proto.RegisterType((*LatLongRect)(nil), "google.cloud.vision.v1.LatLongRect") + proto.RegisterType((*ColorInfo)(nil), "google.cloud.vision.v1.ColorInfo") + proto.RegisterType((*DominantColorsAnnotation)(nil), "google.cloud.vision.v1.DominantColorsAnnotation") + proto.RegisterType((*ImageProperties)(nil), "google.cloud.vision.v1.ImageProperties") + proto.RegisterType((*CropHint)(nil), "google.cloud.vision.v1.CropHint") + proto.RegisterType((*CropHintsAnnotation)(nil), "google.cloud.vision.v1.CropHintsAnnotation") + proto.RegisterType((*CropHintsParams)(nil), "google.cloud.vision.v1.CropHintsParams") + proto.RegisterType((*ImageContext)(nil), "google.cloud.vision.v1.ImageContext") + proto.RegisterType((*AnnotateImageRequest)(nil), "google.cloud.vision.v1.AnnotateImageRequest") + proto.RegisterType((*AnnotateImageResponse)(nil), "google.cloud.vision.v1.AnnotateImageResponse") + proto.RegisterType((*BatchAnnotateImagesRequest)(nil), "google.cloud.vision.v1.BatchAnnotateImagesRequest") + proto.RegisterType((*BatchAnnotateImagesResponse)(nil), "google.cloud.vision.v1.BatchAnnotateImagesResponse") + proto.RegisterEnum("google.cloud.vision.v1.Likelihood", Likelihood_name, Likelihood_value) + proto.RegisterEnum("google.cloud.vision.v1.Feature_Type", Feature_Type_name, Feature_Type_value) + proto.RegisterEnum("google.cloud.vision.v1.FaceAnnotation_Landmark_Type", FaceAnnotation_Landmark_Type_name, FaceAnnotation_Landmark_Type_value) +} + +// 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 + +// Client API for ImageAnnotator service + +type ImageAnnotatorClient interface { + // Run image detection and annotation for a batch of images. + BatchAnnotateImages(ctx context.Context, in *BatchAnnotateImagesRequest, opts ...grpc.CallOption) (*BatchAnnotateImagesResponse, error) +} + +type imageAnnotatorClient struct { + cc *grpc.ClientConn +} + +func NewImageAnnotatorClient(cc *grpc.ClientConn) ImageAnnotatorClient { + return &imageAnnotatorClient{cc} +} + +func (c *imageAnnotatorClient) BatchAnnotateImages(ctx context.Context, in *BatchAnnotateImagesRequest, opts ...grpc.CallOption) (*BatchAnnotateImagesResponse, error) { + out := new(BatchAnnotateImagesResponse) + err := grpc.Invoke(ctx, "/google.cloud.vision.v1.ImageAnnotator/BatchAnnotateImages", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for ImageAnnotator service + +type ImageAnnotatorServer interface { + // Run image detection and annotation for a batch of images. + BatchAnnotateImages(context.Context, *BatchAnnotateImagesRequest) (*BatchAnnotateImagesResponse, error) +} + +func RegisterImageAnnotatorServer(s *grpc.Server, srv ImageAnnotatorServer) { + s.RegisterService(&_ImageAnnotator_serviceDesc, srv) +} + +func _ImageAnnotator_BatchAnnotateImages_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BatchAnnotateImagesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ImageAnnotatorServer).BatchAnnotateImages(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.vision.v1.ImageAnnotator/BatchAnnotateImages", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ImageAnnotatorServer).BatchAnnotateImages(ctx, req.(*BatchAnnotateImagesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _ImageAnnotator_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.cloud.vision.v1.ImageAnnotator", + HandlerType: (*ImageAnnotatorServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "BatchAnnotateImages", + Handler: _ImageAnnotator_BatchAnnotateImages_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/cloud/vision/v1/image_annotator.proto", +} + +func init() { proto.RegisterFile("google/cloud/vision/v1/image_annotator.proto", fileDescriptor1) } + +var fileDescriptor1 = []byte{ + // 2281 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x59, 0x4b, 0x73, 0x23, 0x49, + 0xf1, 0x5f, 0xc9, 0x2f, 0x29, 0xf5, 0x6a, 0x97, 0x1f, 0xa3, 0xb1, 0xe7, 0xe1, 0xed, 0xfd, 0xcf, + 0x1f, 0xc7, 0x30, 0xd8, 0x8c, 0x67, 0x21, 0x96, 0x9d, 0x09, 0x40, 0x92, 0xdb, 0xb6, 0x62, 0x64, + 0x49, 0x5b, 0x92, 0xd7, 0x6b, 0x20, 0xe8, 0x68, 0xb7, 0x4a, 0x9a, 0x9e, 0x6d, 0x75, 0x35, 0xdd, + 0xad, 0x19, 0xfb, 0x4a, 0x04, 0x11, 0xdc, 0xb9, 0x73, 0xe4, 0x4e, 0x04, 0x5f, 0x81, 0x03, 0x47, + 0x62, 0xcf, 0xdc, 0xf8, 0x0c, 0x04, 0x47, 0xa2, 0x1e, 0xdd, 0x2a, 0x69, 0x2c, 0x8f, 0x4c, 0x70, + 0x52, 0x57, 0x66, 0xfe, 0x7e, 0x59, 0x95, 0x55, 0x59, 0x59, 0x55, 0x82, 0x67, 0x03, 0x4a, 0x07, + 0x2e, 0xd9, 0xb7, 0x5d, 0x3a, 0xea, 0xed, 0xbf, 0x73, 0x42, 0x87, 0x7a, 0xfb, 0xef, 0x9e, 0xef, + 0x3b, 0x43, 0x6b, 0x40, 0x4c, 0xcb, 0xf3, 0x68, 0x64, 0x45, 0x34, 0xd8, 0xf3, 0x03, 0x1a, 0x51, + 0xb4, 0x29, 0xac, 0xf7, 0xb8, 0xf5, 0x9e, 0xb0, 0xde, 0x7b, 0xf7, 0x7c, 0xeb, 0x81, 0x64, 0xb1, + 0x7c, 0x67, 0x5f, 0x62, 0x1c, 0xea, 0x85, 0x02, 0xb5, 0xf5, 0x64, 0x86, 0x8f, 0x01, 0xa1, 0x43, + 0x12, 0x05, 0xd7, 0xd2, 0x6c, 0x56, 0x57, 0x22, 0x72, 0x15, 0x99, 0x63, 0x56, 0x69, 0xfd, 0x74, + 0x86, 0xf5, 0x7b, 0x72, 0x69, 0xf6, 0x48, 0x44, 0x6c, 0xc5, 0xf6, 0x9e, 0xb4, 0x0d, 0x7c, 0x7b, + 0x3f, 0x8c, 0xac, 0x68, 0x14, 0x4e, 0x29, 0xa2, 0x6b, 0x9f, 0xec, 0xdb, 0xd4, 0x8d, 0x07, 0xba, + 0x55, 0x56, 0x15, 0xae, 0x15, 0xb9, 0xde, 0x40, 0x68, 0xf4, 0x7f, 0xa4, 0x61, 0xe5, 0x88, 0x58, + 0xd1, 0x28, 0x20, 0xe8, 0x0b, 0x58, 0x64, 0x06, 0xe5, 0xd4, 0x4e, 0x6a, 0xb7, 0x78, 0xf0, 0x7f, + 0x7b, 0x37, 0x47, 0x67, 0x4f, 0x9a, 0xef, 0x75, 0xaf, 0x7d, 0x82, 0x39, 0x02, 0x3d, 0x86, 0xdc, + 0xd0, 0xba, 0x32, 0x03, 0x12, 0x8e, 0xdc, 0x28, 0x2c, 0xa7, 0x77, 0x52, 0xbb, 0x4b, 0x18, 0x86, + 0xd6, 0x15, 0x16, 0x12, 0xfd, 0x5f, 0x29, 0x58, 0x64, 0xf6, 0x68, 0x1d, 0xb4, 0xee, 0x45, 0xdb, + 0x30, 0xcf, 0x9a, 0x9d, 0xb6, 0x51, 0xab, 0x1f, 0xd5, 0x8d, 0x43, 0xed, 0x13, 0x84, 0xa0, 0x78, + 0x54, 0xa9, 0x19, 0xe6, 0xa1, 0xd1, 0x35, 0x6a, 0xdd, 0x7a, 0xab, 0xa9, 0xa5, 0xd0, 0x26, 0xa0, + 0x46, 0xa5, 0x79, 0x78, 0x5a, 0xc1, 0xaf, 0x15, 0x79, 0x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 0x8f, 0x9b, 0xa8, 0x05, 0xab, 0x21, 0x0d, 0x02, 0xfa, 0x5e, + 0x65, 0x83, 0xb9, 0xd9, 0x34, 0x01, 0x56, 0x08, 0x4f, 0x41, 0xb3, 0xbc, 0x01, 0x09, 0x54, 0xbe, + 0xdc, 0xdc, 0x7c, 0x25, 0x8e, 0x55, 0xe8, 0x3a, 0xb0, 0x16, 0x8e, 0x02, 0x3f, 0x70, 0x42, 0xa2, + 0x32, 0xe6, 0xe7, 0x66, 0x44, 0x31, 0x5c, 0x21, 0xfd, 0x15, 0x94, 0x47, 0x5e, 0x8f, 0x04, 0x26, + 0xb9, 0xf2, 0x69, 0x48, 0x7a, 0x2a, 0x73, 0x61, 0x6e, 0xe6, 0x4d, 0xce, 0x61, 0x08, 0x0a, 0x85, + 0xfd, 0x2b, 0x40, 0x97, 0xee, 0x28, 0x08, 0x26, 0x79, 0x8b, 0x73, 0xf3, 0xae, 0x4a, 0xf4, 0x64, + 0x14, 0xde, 0x10, 0xab, 0xf7, 0x9e, 0x58, 0x13, 0x71, 0x2d, 0xcd, 0x1f, 0x85, 0x18, 0x3e, 0x96, + 0x6d, 0xfd, 0x6d, 0x05, 0x32, 0x71, 0x8a, 0xa0, 0x13, 0x59, 0x18, 0x16, 0x38, 0xe5, 0xe7, 0x77, + 0xcc, 0x30, 0xb5, 0x50, 0xbc, 0x82, 0x8c, 0x4f, 0x43, 0x87, 0xe9, 0x79, 0x7e, 0xe5, 0x0e, 0x76, + 0x66, 0xb1, 0xb5, 0xa5, 0x1d, 0x4e, 0x10, 0xfa, 0x5f, 0x96, 0xc7, 0x55, 0xe4, 0xac, 0xf9, 0xba, + 0xd9, 0x3a, 0x6f, 0x9a, 0x71, 0x8d, 0xd0, 0x3e, 0x41, 0x79, 0xc8, 0x34, 0x8c, 0xa3, 0xae, 0x69, + 0x5c, 0x18, 0x5a, 0x0a, 0x15, 0x20, 0x8b, 0xeb, 0xc7, 0x27, 0xa2, 0x99, 0x46, 0x65, 0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9, 0x85, 0x7f, 0xa3, 0x75, 0x58, 0x7a, + 0x67, 0xb9, 0x23, 0x22, 0x8f, 0x2a, 0xa2, 0xa1, 0xff, 0x6e, 0x01, 0x34, 0xc3, 0x8b, 0x9c, 0xe8, + 0x5a, 0x39, 0x49, 0x68, 0xb0, 0x30, 0x74, 0x7a, 0x12, 0xcd, 0x3e, 0xd1, 0x26, 0x2c, 0xbb, 0xd4, + 0xb6, 0xdc, 0x18, 0x2d, 0x5b, 0x68, 0x07, 0x72, 0x3d, 0x12, 0xda, 0x81, 0xe3, 0xf3, 0xad, 0x62, + 0x41, 0x9c, 0x92, 0x14, 0x11, 0x73, 0x1b, 0xda, 0x34, 0x88, 0xcb, 0xb4, 0x68, 0xa0, 0x47, 0x00, + 0x4a, 0x9d, 0x14, 0x35, 0x5a, 0x91, 0x30, 0x7d, 0x44, 0x7d, 0xc7, 0xb6, 0x5c, 0x27, 0xba, 0x96, + 0x55, 0x5a, 0x91, 0x7c, 0x78, 0xd6, 0x59, 0xf9, 0xaf, 0xcf, 0x3a, 0x55, 0xc8, 0xba, 0x32, 0xea, + 0x61, 0x39, 0xc3, 0xcf, 0x26, 0x33, 0x69, 0xd4, 0xe9, 0xc1, 0x63, 0x18, 0xfa, 0x39, 0x80, 0x2f, + 0x62, 0xef, 0x90, 0xb0, 0x9c, 0xe5, 0x24, 0xb3, 0x37, 0x4c, 0x39, 0x4b, 0x58, 0xc1, 0xe8, 0xbf, + 0x4f, 0xc3, 0x7a, 0xc7, 0xea, 0x93, 0x0e, 0xb1, 0x02, 0xfb, 0x8d, 0x32, 0x17, 0x5f, 0xc0, 0x92, + 0xd5, 0x1b, 0xb9, 0x91, 0x3c, 0xed, 0xcf, 0x53, 0x27, 0x04, 0x80, 0x21, 0x43, 0x9f, 0xd2, 0x3e, + 0x9f, 0xb2, 0x39, 0x91, 0x1c, 0x80, 0x5e, 0xc1, 0xca, 0x90, 0xf4, 0x58, 0xac, 0x65, 0x29, 0x99, + 0x07, 0x1b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x79, + 0xf1, 0xc0, 0x09, 0x80, 0x2d, 0x46, 0x71, 0x47, 0xb7, 0x45, 0x80, 0xf9, 0xda, 0xb8, 0x65, 0x31, + 0xaa, 0x93, 0x81, 0xf3, 0x8e, 0xd2, 0xd2, 0xff, 0xba, 0x02, 0x1b, 0x53, 0xa3, 0x0a, 0x7d, 0xea, + 0x85, 0x04, 0x7d, 0x05, 0x5a, 0xdf, 0xb2, 0x89, 0xf2, 0x58, 0x14, 0x2f, 0xa2, 0xff, 0x9f, 0xef, + 0x08, 0x8e, 0x4b, 0xfd, 0x89, 0x76, 0x88, 0x7e, 0x09, 0xeb, 0xf1, 0xad, 0x71, 0x82, 0x56, 0x04, + 0x60, 0x77, 0x16, 0xed, 0x74, 0x25, 0xc7, 0x6b, 0x31, 0x8b, 0x4a, 0xde, 0x01, 0xcd, 0xa5, 0x03, + 0x3a, 0x41, 0xbc, 0x70, 0x47, 0xe2, 0x12, 0x63, 0x50, 0x49, 0xcf, 0x60, 0xd5, 0xb5, 0x2e, 0x89, + 0x3b, 0xc1, 0xba, 0x78, 0x47, 0x56, 0x8d, 0x53, 0x4c, 0xf5, 0x75, 0xea, 0x21, 0x2e, 0x2c, 0x2f, + 0xdd, 0xb5, 0xaf, 0x8c, 0x41, 0x25, 0xfd, 0x06, 0xd6, 0xfb, 0x23, 0xd7, 0x35, 0xa7, 0x98, 0xf9, + 0x85, 0xf4, 0x96, 0x49, 0xeb, 0x4e, 0xd0, 0x60, 0xc4, 0x38, 0x26, 0x65, 0xe8, 0x12, 0x36, 0x43, + 0xab, 0x4f, 0xcc, 0x90, 0x97, 0x71, 0x95, 0x7b, 0x99, 0x73, 0x3f, 0x9b, 0xc5, 0x7d, 0x53, 0xed, + 0xc7, 0xeb, 0xe1, 0x4d, 0x27, 0x82, 0x01, 0x6c, 0x8b, 0x35, 0x3d, 0x3e, 0x3e, 0xa8, 0x8e, 0x32, + 0xb7, 0x67, 0xef, 0x54, 0x59, 0xc0, 0xf7, 0x9d, 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e8, 0x8f, 0x29, 0x58, 0xbb, + 0x61, 0x98, 0xe8, 0x60, 0x66, 0xb9, 0x9f, 0x19, 0xfb, 0xad, 0x17, 0x77, 0xc2, 0x88, 0xb1, 0xeb, + 0x8f, 0x7e, 0xfb, 0xdd, 0x3f, 0xff, 0x90, 0x2e, 0xeb, 0x6b, 0xc9, 0xdf, 0x07, 0xe1, 0x97, 0x72, + 0xa9, 0x92, 0x2f, 0x53, 0x4f, 0xab, 0x11, 0x6c, 0xd9, 0x74, 0x38, 0x83, 0xb9, 0xba, 0x36, 0x39, + 0x9c, 0x76, 0x40, 0x23, 0xda, 0x4e, 0xfd, 0xe2, 0x95, 0x34, 0x1f, 0x50, 0x56, 0x2e, 0xf7, 0x68, + 0x30, 0xd8, 0x1f, 0x10, 0x8f, 0xbf, 0xc4, 0xef, 0x0b, 0x95, 0xe5, 0x3b, 0xe1, 0xf4, 0x9f, 0x00, + 0x2f, 0xc5, 0xd7, 0xbf, 0x53, 0xa9, 0xcb, 0x65, 0x6e, 0xfb, 0xe2, 0x3f, 0x01, 0x00, 0x00, 0xff, + 0xff, 0xe5, 0x59, 0xbe, 0xb0, 0xe8, 0x18, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/vision/v1/text_annotation.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/vision/v1/text_annotation.pb.go new file mode 100644 index 0000000000..566d596703 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/vision/v1/text_annotation.pb.go @@ -0,0 +1,537 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/vision/v1/text_annotation.proto + +package vision + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Enum to denote the type of break found. New line, space etc. +type TextAnnotation_DetectedBreak_BreakType int32 + +const ( + // Unknown break label type. + TextAnnotation_DetectedBreak_UNKNOWN TextAnnotation_DetectedBreak_BreakType = 0 + // Regular space. + TextAnnotation_DetectedBreak_SPACE TextAnnotation_DetectedBreak_BreakType = 1 + // Sure space (very wide). + TextAnnotation_DetectedBreak_SURE_SPACE TextAnnotation_DetectedBreak_BreakType = 2 + // Line-wrapping break. + TextAnnotation_DetectedBreak_EOL_SURE_SPACE TextAnnotation_DetectedBreak_BreakType = 3 + // End-line hyphen that is not present in text; does + TextAnnotation_DetectedBreak_HYPHEN TextAnnotation_DetectedBreak_BreakType = 4 + // not co-occur with SPACE, LEADER_SPACE, or + // LINE_BREAK. + // Line break that ends a paragraph. + TextAnnotation_DetectedBreak_LINE_BREAK TextAnnotation_DetectedBreak_BreakType = 5 +) + +var TextAnnotation_DetectedBreak_BreakType_name = map[int32]string{ + 0: "UNKNOWN", + 1: "SPACE", + 2: "SURE_SPACE", + 3: "EOL_SURE_SPACE", + 4: "HYPHEN", + 5: "LINE_BREAK", +} +var TextAnnotation_DetectedBreak_BreakType_value = map[string]int32{ + "UNKNOWN": 0, + "SPACE": 1, + "SURE_SPACE": 2, + "EOL_SURE_SPACE": 3, + "HYPHEN": 4, + "LINE_BREAK": 5, +} + +func (x TextAnnotation_DetectedBreak_BreakType) String() string { + return proto.EnumName(TextAnnotation_DetectedBreak_BreakType_name, int32(x)) +} +func (TextAnnotation_DetectedBreak_BreakType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor2, []int{0, 1, 0} +} + +// Type of a block (text, image etc) as identified by OCR. +type Block_BlockType int32 + +const ( + // Unknown block type. + Block_UNKNOWN Block_BlockType = 0 + // Regular text block. + Block_TEXT Block_BlockType = 1 + // Table block. + Block_TABLE Block_BlockType = 2 + // Image block. + Block_PICTURE Block_BlockType = 3 + // Horizontal/vertical line box. + Block_RULER Block_BlockType = 4 + // Barcode block. + Block_BARCODE Block_BlockType = 5 +) + +var Block_BlockType_name = map[int32]string{ + 0: "UNKNOWN", + 1: "TEXT", + 2: "TABLE", + 3: "PICTURE", + 4: "RULER", + 5: "BARCODE", +} +var Block_BlockType_value = map[string]int32{ + "UNKNOWN": 0, + "TEXT": 1, + "TABLE": 2, + "PICTURE": 3, + "RULER": 4, + "BARCODE": 5, +} + +func (x Block_BlockType) String() string { + return proto.EnumName(Block_BlockType_name, int32(x)) +} +func (Block_BlockType) EnumDescriptor() ([]byte, []int) { return fileDescriptor2, []int{2, 0} } + +// TextAnnotation contains a structured representation of OCR extracted text. +// The hierarchy of an OCR extracted text structure is like this: +// TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol +// Each structural component, starting from Page, may further have their own +// properties. Properties describe detected languages, breaks etc.. Please +// refer to the [google.cloud.vision.v1.TextAnnotation.TextProperty][google.cloud.vision.v1.TextAnnotation.TextProperty] message +// definition below for more detail. +type TextAnnotation struct { + // List of pages detected by OCR. + Pages []*Page `protobuf:"bytes,1,rep,name=pages" json:"pages,omitempty"` + // UTF-8 text detected on the pages. + Text string `protobuf:"bytes,2,opt,name=text" json:"text,omitempty"` +} + +func (m *TextAnnotation) Reset() { *m = TextAnnotation{} } +func (m *TextAnnotation) String() string { return proto.CompactTextString(m) } +func (*TextAnnotation) ProtoMessage() {} +func (*TextAnnotation) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} } + +func (m *TextAnnotation) GetPages() []*Page { + if m != nil { + return m.Pages + } + return nil +} + +func (m *TextAnnotation) GetText() string { + if m != nil { + return m.Text + } + return "" +} + +// Detected language for a structural component. +type TextAnnotation_DetectedLanguage struct { + // The BCP-47 language code, such as "en-US" or "sr-Latn". For more + // information, see + // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + LanguageCode string `protobuf:"bytes,1,opt,name=language_code,json=languageCode" json:"language_code,omitempty"` + // Confidence of detected language. Range [0, 1]. + Confidence float32 `protobuf:"fixed32,2,opt,name=confidence" json:"confidence,omitempty"` +} + +func (m *TextAnnotation_DetectedLanguage) Reset() { *m = TextAnnotation_DetectedLanguage{} } +func (m *TextAnnotation_DetectedLanguage) String() string { return proto.CompactTextString(m) } +func (*TextAnnotation_DetectedLanguage) ProtoMessage() {} +func (*TextAnnotation_DetectedLanguage) Descriptor() ([]byte, []int) { + return fileDescriptor2, []int{0, 0} +} + +func (m *TextAnnotation_DetectedLanguage) GetLanguageCode() string { + if m != nil { + return m.LanguageCode + } + return "" +} + +func (m *TextAnnotation_DetectedLanguage) GetConfidence() float32 { + if m != nil { + return m.Confidence + } + return 0 +} + +// Detected start or end of a structural component. +type TextAnnotation_DetectedBreak struct { + Type TextAnnotation_DetectedBreak_BreakType `protobuf:"varint,1,opt,name=type,enum=google.cloud.vision.v1.TextAnnotation_DetectedBreak_BreakType" json:"type,omitempty"` + // True if break prepends the element. + IsPrefix bool `protobuf:"varint,2,opt,name=is_prefix,json=isPrefix" json:"is_prefix,omitempty"` +} + +func (m *TextAnnotation_DetectedBreak) Reset() { *m = TextAnnotation_DetectedBreak{} } +func (m *TextAnnotation_DetectedBreak) String() string { return proto.CompactTextString(m) } +func (*TextAnnotation_DetectedBreak) ProtoMessage() {} +func (*TextAnnotation_DetectedBreak) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0, 1} } + +func (m *TextAnnotation_DetectedBreak) GetType() TextAnnotation_DetectedBreak_BreakType { + if m != nil { + return m.Type + } + return TextAnnotation_DetectedBreak_UNKNOWN +} + +func (m *TextAnnotation_DetectedBreak) GetIsPrefix() bool { + if m != nil { + return m.IsPrefix + } + return false +} + +// Additional information detected on the structural component. +type TextAnnotation_TextProperty struct { + // A list of detected languages together with confidence. + DetectedLanguages []*TextAnnotation_DetectedLanguage `protobuf:"bytes,1,rep,name=detected_languages,json=detectedLanguages" json:"detected_languages,omitempty"` + // Detected start or end of a text segment. + DetectedBreak *TextAnnotation_DetectedBreak `protobuf:"bytes,2,opt,name=detected_break,json=detectedBreak" json:"detected_break,omitempty"` +} + +func (m *TextAnnotation_TextProperty) Reset() { *m = TextAnnotation_TextProperty{} } +func (m *TextAnnotation_TextProperty) String() string { return proto.CompactTextString(m) } +func (*TextAnnotation_TextProperty) ProtoMessage() {} +func (*TextAnnotation_TextProperty) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0, 2} } + +func (m *TextAnnotation_TextProperty) GetDetectedLanguages() []*TextAnnotation_DetectedLanguage { + if m != nil { + return m.DetectedLanguages + } + return nil +} + +func (m *TextAnnotation_TextProperty) GetDetectedBreak() *TextAnnotation_DetectedBreak { + if m != nil { + return m.DetectedBreak + } + return nil +} + +// Detected page from OCR. +type Page struct { + // Additional information detected on the page. + Property *TextAnnotation_TextProperty `protobuf:"bytes,1,opt,name=property" json:"property,omitempty"` + // Page width in pixels. + Width int32 `protobuf:"varint,2,opt,name=width" json:"width,omitempty"` + // Page height in pixels. + Height int32 `protobuf:"varint,3,opt,name=height" json:"height,omitempty"` + // List of blocks of text, images etc on this page. + Blocks []*Block `protobuf:"bytes,4,rep,name=blocks" json:"blocks,omitempty"` +} + +func (m *Page) Reset() { *m = Page{} } +func (m *Page) String() string { return proto.CompactTextString(m) } +func (*Page) ProtoMessage() {} +func (*Page) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{1} } + +func (m *Page) GetProperty() *TextAnnotation_TextProperty { + if m != nil { + return m.Property + } + return nil +} + +func (m *Page) GetWidth() int32 { + if m != nil { + return m.Width + } + return 0 +} + +func (m *Page) GetHeight() int32 { + if m != nil { + return m.Height + } + return 0 +} + +func (m *Page) GetBlocks() []*Block { + if m != nil { + return m.Blocks + } + return nil +} + +// Logical element on the page. +type Block struct { + // Additional information detected for the block. + Property *TextAnnotation_TextProperty `protobuf:"bytes,1,opt,name=property" json:"property,omitempty"` + // The bounding box for the block. + // The vertices are in the order of top-left, top-right, bottom-right, + // bottom-left. When a rotation of the bounding box is detected the rotation + // is represented as around the top-left corner as defined when the text is + // read in the 'natural' orientation. + // For example: + // * when the text is horizontal it might look like: + // 0----1 + // | | + // 3----2 + // * when it's rotated 180 degrees around the top-left corner it becomes: + // 2----3 + // | | + // 1----0 + // and the vertice order will still be (0, 1, 2, 3). + BoundingBox *BoundingPoly `protobuf:"bytes,2,opt,name=bounding_box,json=boundingBox" json:"bounding_box,omitempty"` + // List of paragraphs in this block (if this blocks is of type text). + Paragraphs []*Paragraph `protobuf:"bytes,3,rep,name=paragraphs" json:"paragraphs,omitempty"` + // Detected block type (text, image etc) for this block. + BlockType Block_BlockType `protobuf:"varint,4,opt,name=block_type,json=blockType,enum=google.cloud.vision.v1.Block_BlockType" json:"block_type,omitempty"` +} + +func (m *Block) Reset() { *m = Block{} } +func (m *Block) String() string { return proto.CompactTextString(m) } +func (*Block) ProtoMessage() {} +func (*Block) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{2} } + +func (m *Block) GetProperty() *TextAnnotation_TextProperty { + if m != nil { + return m.Property + } + return nil +} + +func (m *Block) GetBoundingBox() *BoundingPoly { + if m != nil { + return m.BoundingBox + } + return nil +} + +func (m *Block) GetParagraphs() []*Paragraph { + if m != nil { + return m.Paragraphs + } + return nil +} + +func (m *Block) GetBlockType() Block_BlockType { + if m != nil { + return m.BlockType + } + return Block_UNKNOWN +} + +// Structural unit of text representing a number of words in certain order. +type Paragraph struct { + // Additional information detected for the paragraph. + Property *TextAnnotation_TextProperty `protobuf:"bytes,1,opt,name=property" json:"property,omitempty"` + // The bounding box for the paragraph. + // The vertices are in the order of top-left, top-right, bottom-right, + // bottom-left. When a rotation of the bounding box is detected the rotation + // is represented as around the top-left corner as defined when the text is + // read in the 'natural' orientation. + // For example: + // * when the text is horizontal it might look like: + // 0----1 + // | | + // 3----2 + // * when it's rotated 180 degrees around the top-left corner it becomes: + // 2----3 + // | | + // 1----0 + // and the vertice order will still be (0, 1, 2, 3). + BoundingBox *BoundingPoly `protobuf:"bytes,2,opt,name=bounding_box,json=boundingBox" json:"bounding_box,omitempty"` + // List of words in this paragraph. + Words []*Word `protobuf:"bytes,3,rep,name=words" json:"words,omitempty"` +} + +func (m *Paragraph) Reset() { *m = Paragraph{} } +func (m *Paragraph) String() string { return proto.CompactTextString(m) } +func (*Paragraph) ProtoMessage() {} +func (*Paragraph) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{3} } + +func (m *Paragraph) GetProperty() *TextAnnotation_TextProperty { + if m != nil { + return m.Property + } + return nil +} + +func (m *Paragraph) GetBoundingBox() *BoundingPoly { + if m != nil { + return m.BoundingBox + } + return nil +} + +func (m *Paragraph) GetWords() []*Word { + if m != nil { + return m.Words + } + return nil +} + +// A word representation. +type Word struct { + // Additional information detected for the word. + Property *TextAnnotation_TextProperty `protobuf:"bytes,1,opt,name=property" json:"property,omitempty"` + // The bounding box for the word. + // The vertices are in the order of top-left, top-right, bottom-right, + // bottom-left. When a rotation of the bounding box is detected the rotation + // is represented as around the top-left corner as defined when the text is + // read in the 'natural' orientation. + // For example: + // * when the text is horizontal it might look like: + // 0----1 + // | | + // 3----2 + // * when it's rotated 180 degrees around the top-left corner it becomes: + // 2----3 + // | | + // 1----0 + // and the vertice order will still be (0, 1, 2, 3). + BoundingBox *BoundingPoly `protobuf:"bytes,2,opt,name=bounding_box,json=boundingBox" json:"bounding_box,omitempty"` + // List of symbols in the word. + // The order of the symbols follows the natural reading order. + Symbols []*Symbol `protobuf:"bytes,3,rep,name=symbols" json:"symbols,omitempty"` +} + +func (m *Word) Reset() { *m = Word{} } +func (m *Word) String() string { return proto.CompactTextString(m) } +func (*Word) ProtoMessage() {} +func (*Word) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{4} } + +func (m *Word) GetProperty() *TextAnnotation_TextProperty { + if m != nil { + return m.Property + } + return nil +} + +func (m *Word) GetBoundingBox() *BoundingPoly { + if m != nil { + return m.BoundingBox + } + return nil +} + +func (m *Word) GetSymbols() []*Symbol { + if m != nil { + return m.Symbols + } + return nil +} + +// A single symbol representation. +type Symbol struct { + // Additional information detected for the symbol. + Property *TextAnnotation_TextProperty `protobuf:"bytes,1,opt,name=property" json:"property,omitempty"` + // The bounding box for the symbol. + // The vertices are in the order of top-left, top-right, bottom-right, + // bottom-left. When a rotation of the bounding box is detected the rotation + // is represented as around the top-left corner as defined when the text is + // read in the 'natural' orientation. + // For example: + // * when the text is horizontal it might look like: + // 0----1 + // | | + // 3----2 + // * when it's rotated 180 degrees around the top-left corner it becomes: + // 2----3 + // | | + // 1----0 + // and the vertice order will still be (0, 1, 2, 3). + BoundingBox *BoundingPoly `protobuf:"bytes,2,opt,name=bounding_box,json=boundingBox" json:"bounding_box,omitempty"` + // The actual UTF-8 representation of the symbol. + Text string `protobuf:"bytes,3,opt,name=text" json:"text,omitempty"` +} + +func (m *Symbol) Reset() { *m = Symbol{} } +func (m *Symbol) String() string { return proto.CompactTextString(m) } +func (*Symbol) ProtoMessage() {} +func (*Symbol) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{5} } + +func (m *Symbol) GetProperty() *TextAnnotation_TextProperty { + if m != nil { + return m.Property + } + return nil +} + +func (m *Symbol) GetBoundingBox() *BoundingPoly { + if m != nil { + return m.BoundingBox + } + return nil +} + +func (m *Symbol) GetText() string { + if m != nil { + return m.Text + } + return "" +} + +func init() { + proto.RegisterType((*TextAnnotation)(nil), "google.cloud.vision.v1.TextAnnotation") + proto.RegisterType((*TextAnnotation_DetectedLanguage)(nil), "google.cloud.vision.v1.TextAnnotation.DetectedLanguage") + proto.RegisterType((*TextAnnotation_DetectedBreak)(nil), "google.cloud.vision.v1.TextAnnotation.DetectedBreak") + proto.RegisterType((*TextAnnotation_TextProperty)(nil), "google.cloud.vision.v1.TextAnnotation.TextProperty") + proto.RegisterType((*Page)(nil), "google.cloud.vision.v1.Page") + proto.RegisterType((*Block)(nil), "google.cloud.vision.v1.Block") + proto.RegisterType((*Paragraph)(nil), "google.cloud.vision.v1.Paragraph") + proto.RegisterType((*Word)(nil), "google.cloud.vision.v1.Word") + proto.RegisterType((*Symbol)(nil), "google.cloud.vision.v1.Symbol") + proto.RegisterEnum("google.cloud.vision.v1.TextAnnotation_DetectedBreak_BreakType", TextAnnotation_DetectedBreak_BreakType_name, TextAnnotation_DetectedBreak_BreakType_value) + proto.RegisterEnum("google.cloud.vision.v1.Block_BlockType", Block_BlockType_name, Block_BlockType_value) +} + +func init() { proto.RegisterFile("google/cloud/vision/v1/text_annotation.proto", fileDescriptor2) } + +var fileDescriptor2 = []byte{ + // 744 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x55, 0x4f, 0x6f, 0xd3, 0x4e, + 0x10, 0xfd, 0xb9, 0xb1, 0xd3, 0x78, 0xd2, 0x46, 0xfe, 0x2d, 0xa8, 0x8a, 0x42, 0xa9, 0x8a, 0x01, + 0xd1, 0x03, 0x72, 0xd4, 0x14, 0x04, 0x12, 0x08, 0x29, 0x4e, 0x0d, 0xad, 0x1a, 0x25, 0xd6, 0x36, + 0x51, 0xf9, 0x73, 0xb0, 0xfc, 0x67, 0xeb, 0x58, 0x4d, 0xbd, 0x96, 0xed, 0xb6, 0xc9, 0x8d, 0x4f, + 0xc5, 0x89, 0x6f, 0xc1, 0x09, 0xee, 0x9c, 0xb9, 0x72, 0x44, 0x5e, 0xdb, 0x69, 0x52, 0x61, 0x04, + 0x88, 0x43, 0x2f, 0xd6, 0xce, 0xe4, 0xed, 0xdb, 0xf7, 0x66, 0x33, 0x3b, 0xf0, 0xd0, 0xa5, 0xd4, + 0x1d, 0x93, 0xa6, 0x3d, 0xa6, 0x67, 0x4e, 0xf3, 0xdc, 0x8b, 0x3c, 0xea, 0x37, 0xcf, 0xb7, 0x9b, + 0x31, 0x99, 0xc4, 0x86, 0xe9, 0xfb, 0x34, 0x36, 0x63, 0x8f, 0xfa, 0x4a, 0x10, 0xd2, 0x98, 0xa2, + 0xb5, 0x14, 0xad, 0x30, 0xb4, 0x92, 0xa2, 0x95, 0xf3, 0xed, 0xc6, 0x7a, 0xc6, 0x62, 0x06, 0x5e, + 0xf3, 0x72, 0x53, 0x94, 0xee, 0x6a, 0xdc, 0x2f, 0x38, 0xc3, 0x25, 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a, 0xbc, 0xd5, + 0x0a, 0x0d, 0xdd, 0xa6, 0x4b, 0x7c, 0x36, 0x76, 0x9b, 0xe9, 0x4f, 0x66, 0xe0, 0x45, 0x57, 0x07, + 0xf4, 0xb3, 0x74, 0xf5, 0x9d, 0xe3, 0xac, 0x32, 0xc3, 0xee, 0xfc, 0x08, 0x00, 0x00, 0xff, 0xff, + 0x80, 0x29, 0x2a, 0x3b, 0x2f, 0x08, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/vision/v1/web_detection.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/vision/v1/web_detection.pb.go new file mode 100644 index 0000000000..2f4089cf4c --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/vision/v1/web_detection.pb.go @@ -0,0 +1,193 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/vision/v1/web_detection.proto + +package vision + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Relevant information for the image from the Internet. +type WebDetection struct { + // Deduced entities from similar images on the Internet. + WebEntities []*WebDetection_WebEntity `protobuf:"bytes,1,rep,name=web_entities,json=webEntities" json:"web_entities,omitempty"` + // Fully matching images from the Internet. + // They're definite neardups and most often a copy of the query image with + // merely a size change. + FullMatchingImages []*WebDetection_WebImage `protobuf:"bytes,2,rep,name=full_matching_images,json=fullMatchingImages" json:"full_matching_images,omitempty"` + // Partial matching images from the Internet. + // Those images are similar enough to share some key-point features. For + // example an original image will likely have partial matching for its crops. + PartialMatchingImages []*WebDetection_WebImage `protobuf:"bytes,3,rep,name=partial_matching_images,json=partialMatchingImages" json:"partial_matching_images,omitempty"` + // Web pages containing the matching images from the Internet. + PagesWithMatchingImages []*WebDetection_WebPage `protobuf:"bytes,4,rep,name=pages_with_matching_images,json=pagesWithMatchingImages" json:"pages_with_matching_images,omitempty"` +} + +func (m *WebDetection) Reset() { *m = WebDetection{} } +func (m *WebDetection) String() string { return proto.CompactTextString(m) } +func (*WebDetection) ProtoMessage() {} +func (*WebDetection) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} } + +func (m *WebDetection) GetWebEntities() []*WebDetection_WebEntity { + if m != nil { + return m.WebEntities + } + return nil +} + +func (m *WebDetection) GetFullMatchingImages() []*WebDetection_WebImage { + if m != nil { + return m.FullMatchingImages + } + return nil +} + +func (m *WebDetection) GetPartialMatchingImages() []*WebDetection_WebImage { + if m != nil { + return m.PartialMatchingImages + } + return nil +} + +func (m *WebDetection) GetPagesWithMatchingImages() []*WebDetection_WebPage { + if m != nil { + return m.PagesWithMatchingImages + } + return nil +} + +// Entity deduced from similar images on the Internet. +type WebDetection_WebEntity struct { + // Opaque entity ID. + EntityId string `protobuf:"bytes,1,opt,name=entity_id,json=entityId" json:"entity_id,omitempty"` + // Overall relevancy score for the entity. + // Not normalized and not comparable across different image queries. + Score float32 `protobuf:"fixed32,2,opt,name=score" json:"score,omitempty"` + // Canonical description of the entity, in English. + Description string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` +} + +func (m *WebDetection_WebEntity) Reset() { *m = WebDetection_WebEntity{} } +func (m *WebDetection_WebEntity) String() string { return proto.CompactTextString(m) } +func (*WebDetection_WebEntity) ProtoMessage() {} +func (*WebDetection_WebEntity) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0, 0} } + +func (m *WebDetection_WebEntity) GetEntityId() string { + if m != nil { + return m.EntityId + } + return "" +} + +func (m *WebDetection_WebEntity) GetScore() float32 { + if m != nil { + return m.Score + } + return 0 +} + +func (m *WebDetection_WebEntity) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +// Metadata for online images. +type WebDetection_WebImage struct { + // The result image URL. + Url string `protobuf:"bytes,1,opt,name=url" json:"url,omitempty"` + // Overall relevancy score for the image. + // Not normalized and not comparable across different image queries. + Score float32 `protobuf:"fixed32,2,opt,name=score" json:"score,omitempty"` +} + +func (m *WebDetection_WebImage) Reset() { *m = WebDetection_WebImage{} } +func (m *WebDetection_WebImage) String() string { return proto.CompactTextString(m) } +func (*WebDetection_WebImage) ProtoMessage() {} +func (*WebDetection_WebImage) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0, 1} } + +func (m *WebDetection_WebImage) GetUrl() string { + if m != nil { + return m.Url + } + return "" +} + +func (m *WebDetection_WebImage) GetScore() float32 { + if m != nil { + return m.Score + } + return 0 +} + +// Metadata for web pages. +type WebDetection_WebPage struct { + // The result web page URL. + Url string `protobuf:"bytes,1,opt,name=url" json:"url,omitempty"` + // Overall relevancy score for the web page. + // Not normalized and not comparable across different image queries. + Score float32 `protobuf:"fixed32,2,opt,name=score" json:"score,omitempty"` +} + +func (m *WebDetection_WebPage) Reset() { *m = WebDetection_WebPage{} } +func (m *WebDetection_WebPage) String() string { return proto.CompactTextString(m) } +func (*WebDetection_WebPage) ProtoMessage() {} +func (*WebDetection_WebPage) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0, 2} } + +func (m *WebDetection_WebPage) GetUrl() string { + if m != nil { + return m.Url + } + return "" +} + +func (m *WebDetection_WebPage) GetScore() float32 { + if m != nil { + return m.Score + } + return 0 +} + +func init() { + proto.RegisterType((*WebDetection)(nil), "google.cloud.vision.v1.WebDetection") + proto.RegisterType((*WebDetection_WebEntity)(nil), "google.cloud.vision.v1.WebDetection.WebEntity") + proto.RegisterType((*WebDetection_WebImage)(nil), "google.cloud.vision.v1.WebDetection.WebImage") + proto.RegisterType((*WebDetection_WebPage)(nil), "google.cloud.vision.v1.WebDetection.WebPage") +} + +func init() { proto.RegisterFile("google/cloud/vision/v1/web_detection.proto", fileDescriptor3) } + +var fileDescriptor3 = []byte{ + // 383 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x93, 0x41, 0x4f, 0xea, 0x40, + 0x14, 0x85, 0x53, 0xca, 0x7b, 0x0f, 0x06, 0x16, 0xcf, 0x09, 0x4a, 0x53, 0x5d, 0x34, 0xae, 0x88, + 0xd1, 0x69, 0xc0, 0xa5, 0xae, 0x88, 0x2e, 0x58, 0x98, 0x60, 0x37, 0x24, 0x6e, 0xea, 0xd0, 0x8e, + 0xc3, 0x4d, 0xca, 0x4c, 0xd3, 0x19, 0x20, 0xfc, 0x58, 0xff, 0x87, 0x4b, 0x33, 0xd3, 0x62, 0x10, + 0x30, 0x21, 0xee, 0xee, 0xdc, 0x9e, 0xf3, 0x9d, 0xf6, 0xf6, 0x0e, 0xba, 0xe2, 0x52, 0xf2, 0x8c, + 0x85, 0x49, 0x26, 0x17, 0x69, 0xb8, 0x04, 0x05, 0x52, 0x84, 0xcb, 0x7e, 0xb8, 0x62, 0xd3, 0x38, + 0x65, 0x9a, 0x25, 0x1a, 0xa4, 0x20, 0x79, 0x21, 0xb5, 0xc4, 0x67, 0xa5, 0x96, 0x58, 0x2d, 0x29, + 0xb5, 0x64, 0xd9, 0xf7, 0x2f, 0x2a, 0x06, 0xcd, 0x21, 0xa4, 0x42, 0x48, 0x4d, 0x8d, 0x49, 0x95, + 0xae, 0xcb, 0xf7, 0x3a, 0x6a, 0x4f, 0xd8, 0xf4, 0x61, 0x03, 0xc3, 0xcf, 0xa8, 0x6d, 0xe8, 0x4c, + 0x68, 0xd0, 0xc0, 0x94, 0xe7, 0x04, 0x6e, 0xaf, 0x35, 0x20, 0xe4, 0x30, 0x9d, 0x6c, 0x7b, 0xcd, + 0xe1, 0xd1, 0xf8, 0xd6, 0x51, 0x6b, 0x55, 0x95, 0xc0, 0x14, 0x8e, 0x51, 0xe7, 0x6d, 0x91, 0x65, + 0xf1, 0x9c, 0xea, 0x64, 0x06, 0x82, 0xc7, 0x30, 0xa7, 0x9c, 0x29, 0xaf, 0x66, 0xd1, 0x37, 0xc7, + 0xa2, 0x47, 0xc6, 0x15, 0x61, 0x83, 0x7a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0x03, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/vision/v1p1beta1/geometry.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/vision/v1p1beta1/geometry.pb.go new file mode 100644 index 0000000000..c04a32add6 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/vision/v1p1beta1/geometry.pb.go @@ -0,0 +1,173 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/vision/v1p1beta1/geometry.proto + +/* +Package vision is a generated protocol buffer package. + +It is generated from these files: + google/cloud/vision/v1p1beta1/geometry.proto + google/cloud/vision/v1p1beta1/image_annotator.proto + google/cloud/vision/v1p1beta1/text_annotation.proto + google/cloud/vision/v1p1beta1/web_detection.proto + +It has these top-level messages: + Vertex + BoundingPoly + Position + Feature + ImageSource + Image + FaceAnnotation + LocationInfo + Property + EntityAnnotation + SafeSearchAnnotation + LatLongRect + ColorInfo + DominantColorsAnnotation + ImageProperties + CropHint + CropHintsAnnotation + CropHintsParams + WebDetectionParams + ImageContext + AnnotateImageRequest + AnnotateImageResponse + BatchAnnotateImagesRequest + BatchAnnotateImagesResponse + TextAnnotation + Page + Block + Paragraph + Word + Symbol + WebDetection +*/ +package vision + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// A vertex represents a 2D point in the image. +// NOTE: the vertex coordinates are in the same scale as the original image. +type Vertex struct { + // X coordinate. + X int32 `protobuf:"varint,1,opt,name=x" json:"x,omitempty"` + // Y coordinate. + Y int32 `protobuf:"varint,2,opt,name=y" json:"y,omitempty"` +} + +func (m *Vertex) Reset() { *m = Vertex{} } +func (m *Vertex) String() string { return proto.CompactTextString(m) } +func (*Vertex) ProtoMessage() {} +func (*Vertex) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *Vertex) GetX() int32 { + if m != nil { + return m.X + } + return 0 +} + +func (m *Vertex) GetY() int32 { + if m != nil { + return m.Y + } + return 0 +} + +// A bounding polygon for the detected image annotation. +type BoundingPoly struct { + // The bounding polygon vertices. + Vertices []*Vertex `protobuf:"bytes,1,rep,name=vertices" json:"vertices,omitempty"` +} + +func (m *BoundingPoly) Reset() { *m = BoundingPoly{} } +func (m *BoundingPoly) String() string { return proto.CompactTextString(m) } +func (*BoundingPoly) ProtoMessage() {} +func (*BoundingPoly) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *BoundingPoly) GetVertices() []*Vertex { + if m != nil { + return m.Vertices + } + return nil +} + +// A 3D position in the image, used primarily for Face detection landmarks. +// A valid Position must have both x and y coordinates. +// The position coordinates are in the same scale as the original image. +type Position struct { + // X coordinate. + X float32 `protobuf:"fixed32,1,opt,name=x" json:"x,omitempty"` + // Y coordinate. + Y float32 `protobuf:"fixed32,2,opt,name=y" json:"y,omitempty"` + // Z coordinate (or depth). + Z float32 `protobuf:"fixed32,3,opt,name=z" json:"z,omitempty"` +} + +func (m *Position) Reset() { *m = Position{} } +func (m *Position) String() string { return proto.CompactTextString(m) } +func (*Position) ProtoMessage() {} +func (*Position) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *Position) GetX() float32 { + if m != nil { + return m.X + } + return 0 +} + +func (m *Position) GetY() float32 { + if m != nil { + return m.Y + } + return 0 +} + +func (m *Position) GetZ() float32 { + if m != nil { + return m.Z + } + return 0 +} + +func init() { + proto.RegisterType((*Vertex)(nil), "google.cloud.vision.v1p1beta1.Vertex") + proto.RegisterType((*BoundingPoly)(nil), "google.cloud.vision.v1p1beta1.BoundingPoly") + proto.RegisterType((*Position)(nil), "google.cloud.vision.v1p1beta1.Position") +} + +func init() { proto.RegisterFile("google/cloud/vision/v1p1beta1/geometry.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 243 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x90, 0xb1, 0x4b, 0xc3, 0x40, + 0x14, 0x87, 0x79, 0x29, 0x96, 0x72, 0xd6, 0x25, 0x53, 0x16, 0xa1, 0x06, 0x85, 0x0e, 0x72, 0x47, + 0xd4, 0xcd, 0xc9, 0x38, 0xb8, 0xc6, 0x0c, 0x0e, 0x6e, 0x69, 0xfa, 0x78, 0x1c, 0xa4, 0xf7, 0xc2, + 0xe5, 0x1a, 0x7a, 0xc5, 0x3f, 0xdc, 0x51, 0x7a, 0x57, 0x2a, 0x0e, 0x76, 0xfc, 0xdd, 0x7d, 0x8f, + 0x0f, 0x3e, 0x71, 0x4f, 0xcc, 0xd4, 0xa1, 0x6a, 0x3b, 0xde, 0xae, 0xd5, 0xa8, 0x07, 0xcd, 0x46, + 0x8d, 0x45, 0x5f, 0xac, 0xd0, 0x35, 0x85, 0x22, 0xe4, 0x0d, 0x3a, 0xeb, 0x65, 0x6f, 0xd9, 0x71, + 0x7a, 0x1d, 0x69, 0x19, 0x68, 0x19, 0x69, 0x79, 0xa2, 0xf3, 0x5b, 0x31, 0xfd, 0x40, 0xeb, 0x70, + 0x97, 0xce, 0x05, 0xec, 0x32, 0x58, 0xc0, 0xf2, 0xa2, 0x86, 0xb0, 0x7c, 0x96, 0xc4, 0xe5, 0xf3, + 0x77, 0x31, 0x2f, 0x79, 0x6b, 0xd6, 0xda, 0x50, 0xc5, 0x9d, 0x4f, 0x5f, 0xc4, 0x6c, 0x44, 0xeb, + 0x74, 0x8b, 0x43, 0x06, 0x8b, 0xc9, 0xf2, 0xf2, 0xe1, 0x4e, 0x9e, 0xf5, 0xc8, 0x28, 0xa9, 0x4f, + 0x67, 0xf9, 0x93, 0x98, 0x55, 0x3c, 0x68, 0xa7, 0xd9, 0xfc, 0xaa, 0x93, 0x3f, 0xea, 0xa4, 0x06, + 0x7f, 0x58, 0xfb, 0x6c, 0x12, 0xd7, 0xbe, 0xfc, 0x12, 0x37, 0x2d, 0x6f, 0xce, 0xbb, 0xca, 0xab, + 0xb7, 0x63, 0x82, 0xea, 0x50, 0xa0, 0x82, 0xcf, 0xd7, 0x23, 0x4f, 0xdc, 0x35, 0x86, 0x24, 0x5b, + 0x52, 0x84, 0x26, 0xf4, 0x51, 0xf1, 0xab, 0xe9, 0xf5, 0xf0, 0x4f, 0xd0, 0xe7, 0xf8, 0xf0, 0x0d, + 0xb0, 0x9a, 0x86, 0x93, 0xc7, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x91, 0xa5, 0x86, 0xce, 0x82, + 0x01, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/vision/v1p1beta1/image_annotator.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/vision/v1p1beta1/image_annotator.pb.go new file mode 100644 index 0000000000..0d2b5b6538 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/vision/v1p1beta1/image_annotator.pb.go @@ -0,0 +1,1503 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/vision/v1p1beta1/image_annotator.proto + +package vision + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_rpc "google.golang.org/genproto/googleapis/rpc/status" +import google_type "google.golang.org/genproto/googleapis/type/color" +import google_type1 "google.golang.org/genproto/googleapis/type/latlng" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// A bucketized representation of likelihood, which is intended to give clients +// highly stable results across model upgrades. +type Likelihood int32 + +const ( + // Unknown likelihood. + Likelihood_UNKNOWN Likelihood = 0 + // It is very unlikely that the image belongs to the specified vertical. + Likelihood_VERY_UNLIKELY Likelihood = 1 + // It is unlikely that the image belongs to the specified vertical. + Likelihood_UNLIKELY Likelihood = 2 + // It is possible that the image belongs to the specified vertical. + Likelihood_POSSIBLE Likelihood = 3 + // It is likely that the image belongs to the specified vertical. + Likelihood_LIKELY Likelihood = 4 + // It is very likely that the image belongs to the specified vertical. + Likelihood_VERY_LIKELY Likelihood = 5 +) + +var Likelihood_name = map[int32]string{ + 0: "UNKNOWN", + 1: "VERY_UNLIKELY", + 2: "UNLIKELY", + 3: "POSSIBLE", + 4: "LIKELY", + 5: "VERY_LIKELY", +} +var Likelihood_value = map[string]int32{ + "UNKNOWN": 0, + "VERY_UNLIKELY": 1, + "UNLIKELY": 2, + "POSSIBLE": 3, + "LIKELY": 4, + "VERY_LIKELY": 5, +} + +func (x Likelihood) String() string { + return proto.EnumName(Likelihood_name, int32(x)) +} +func (Likelihood) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +// Type of image feature. +type Feature_Type int32 + +const ( + // Unspecified feature type. + Feature_TYPE_UNSPECIFIED Feature_Type = 0 + // Run face detection. + Feature_FACE_DETECTION Feature_Type = 1 + // Run landmark detection. + Feature_LANDMARK_DETECTION Feature_Type = 2 + // Run logo detection. + Feature_LOGO_DETECTION Feature_Type = 3 + // Run label detection. + Feature_LABEL_DETECTION Feature_Type = 4 + // Run OCR. + Feature_TEXT_DETECTION Feature_Type = 5 + // Run dense text document OCR. Takes precedence when both + // DOCUMENT_TEXT_DETECTION and TEXT_DETECTION are present. + Feature_DOCUMENT_TEXT_DETECTION Feature_Type = 11 + // Run computer vision models to compute image safe-search properties. + Feature_SAFE_SEARCH_DETECTION Feature_Type = 6 + // Compute a set of image properties, such as the image's dominant colors. + Feature_IMAGE_PROPERTIES Feature_Type = 7 + // Run crop hints. + Feature_CROP_HINTS Feature_Type = 9 + // Run web detection. + Feature_WEB_DETECTION Feature_Type = 10 +) + +var Feature_Type_name = map[int32]string{ + 0: "TYPE_UNSPECIFIED", + 1: "FACE_DETECTION", + 2: "LANDMARK_DETECTION", + 3: "LOGO_DETECTION", + 4: "LABEL_DETECTION", + 5: "TEXT_DETECTION", + 11: "DOCUMENT_TEXT_DETECTION", + 6: "SAFE_SEARCH_DETECTION", + 7: "IMAGE_PROPERTIES", + 9: "CROP_HINTS", + 10: "WEB_DETECTION", +} +var Feature_Type_value = map[string]int32{ + "TYPE_UNSPECIFIED": 0, + "FACE_DETECTION": 1, + "LANDMARK_DETECTION": 2, + "LOGO_DETECTION": 3, + "LABEL_DETECTION": 4, + "TEXT_DETECTION": 5, + "DOCUMENT_TEXT_DETECTION": 11, + "SAFE_SEARCH_DETECTION": 6, + "IMAGE_PROPERTIES": 7, + "CROP_HINTS": 9, + "WEB_DETECTION": 10, +} + +func (x Feature_Type) String() string { + return proto.EnumName(Feature_Type_name, int32(x)) +} +func (Feature_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{0, 0} } + +// Face landmark (feature) type. +// Left and right are defined from the vantage of the viewer of the image +// without considering mirror projections typical of photos. So, `LEFT_EYE`, +// typically, is the person's right eye. +type FaceAnnotation_Landmark_Type int32 + +const ( + // Unknown face landmark detected. Should not be filled. + FaceAnnotation_Landmark_UNKNOWN_LANDMARK FaceAnnotation_Landmark_Type = 0 + // Left eye. + FaceAnnotation_Landmark_LEFT_EYE FaceAnnotation_Landmark_Type = 1 + // Right eye. + FaceAnnotation_Landmark_RIGHT_EYE FaceAnnotation_Landmark_Type = 2 + // Left of left eyebrow. + FaceAnnotation_Landmark_LEFT_OF_LEFT_EYEBROW FaceAnnotation_Landmark_Type = 3 + // Right of left eyebrow. + FaceAnnotation_Landmark_RIGHT_OF_LEFT_EYEBROW FaceAnnotation_Landmark_Type = 4 + // Left of right eyebrow. + FaceAnnotation_Landmark_LEFT_OF_RIGHT_EYEBROW FaceAnnotation_Landmark_Type = 5 + // Right of right eyebrow. + FaceAnnotation_Landmark_RIGHT_OF_RIGHT_EYEBROW FaceAnnotation_Landmark_Type = 6 + // Midpoint between eyes. + FaceAnnotation_Landmark_MIDPOINT_BETWEEN_EYES FaceAnnotation_Landmark_Type = 7 + // Nose tip. + FaceAnnotation_Landmark_NOSE_TIP FaceAnnotation_Landmark_Type = 8 + // Upper lip. + FaceAnnotation_Landmark_UPPER_LIP FaceAnnotation_Landmark_Type = 9 + // Lower lip. + FaceAnnotation_Landmark_LOWER_LIP FaceAnnotation_Landmark_Type = 10 + // Mouth left. + FaceAnnotation_Landmark_MOUTH_LEFT FaceAnnotation_Landmark_Type = 11 + // Mouth right. + FaceAnnotation_Landmark_MOUTH_RIGHT FaceAnnotation_Landmark_Type = 12 + // Mouth center. + FaceAnnotation_Landmark_MOUTH_CENTER FaceAnnotation_Landmark_Type = 13 + // Nose, bottom right. + FaceAnnotation_Landmark_NOSE_BOTTOM_RIGHT FaceAnnotation_Landmark_Type = 14 + // Nose, bottom left. + FaceAnnotation_Landmark_NOSE_BOTTOM_LEFT FaceAnnotation_Landmark_Type = 15 + // Nose, bottom center. + FaceAnnotation_Landmark_NOSE_BOTTOM_CENTER FaceAnnotation_Landmark_Type = 16 + // Left eye, top boundary. + FaceAnnotation_Landmark_LEFT_EYE_TOP_BOUNDARY FaceAnnotation_Landmark_Type = 17 + // Left eye, right corner. + FaceAnnotation_Landmark_LEFT_EYE_RIGHT_CORNER FaceAnnotation_Landmark_Type = 18 + // Left eye, bottom boundary. + FaceAnnotation_Landmark_LEFT_EYE_BOTTOM_BOUNDARY FaceAnnotation_Landmark_Type = 19 + // Left eye, left corner. + FaceAnnotation_Landmark_LEFT_EYE_LEFT_CORNER FaceAnnotation_Landmark_Type = 20 + // Right eye, top boundary. + FaceAnnotation_Landmark_RIGHT_EYE_TOP_BOUNDARY FaceAnnotation_Landmark_Type = 21 + // Right eye, right corner. + FaceAnnotation_Landmark_RIGHT_EYE_RIGHT_CORNER FaceAnnotation_Landmark_Type = 22 + // Right eye, bottom boundary. + FaceAnnotation_Landmark_RIGHT_EYE_BOTTOM_BOUNDARY FaceAnnotation_Landmark_Type = 23 + // Right eye, left corner. + FaceAnnotation_Landmark_RIGHT_EYE_LEFT_CORNER FaceAnnotation_Landmark_Type = 24 + // Left eyebrow, upper midpoint. + FaceAnnotation_Landmark_LEFT_EYEBROW_UPPER_MIDPOINT FaceAnnotation_Landmark_Type = 25 + // Right eyebrow, upper midpoint. + FaceAnnotation_Landmark_RIGHT_EYEBROW_UPPER_MIDPOINT FaceAnnotation_Landmark_Type = 26 + // Left ear tragion. + FaceAnnotation_Landmark_LEFT_EAR_TRAGION FaceAnnotation_Landmark_Type = 27 + // Right ear tragion. + FaceAnnotation_Landmark_RIGHT_EAR_TRAGION FaceAnnotation_Landmark_Type = 28 + // Left eye pupil. + FaceAnnotation_Landmark_LEFT_EYE_PUPIL FaceAnnotation_Landmark_Type = 29 + // Right eye pupil. + FaceAnnotation_Landmark_RIGHT_EYE_PUPIL FaceAnnotation_Landmark_Type = 30 + // Forehead glabella. + FaceAnnotation_Landmark_FOREHEAD_GLABELLA FaceAnnotation_Landmark_Type = 31 + // Chin gnathion. + FaceAnnotation_Landmark_CHIN_GNATHION FaceAnnotation_Landmark_Type = 32 + // Chin left gonion. + FaceAnnotation_Landmark_CHIN_LEFT_GONION FaceAnnotation_Landmark_Type = 33 + // Chin right gonion. + FaceAnnotation_Landmark_CHIN_RIGHT_GONION FaceAnnotation_Landmark_Type = 34 +) + +var FaceAnnotation_Landmark_Type_name = map[int32]string{ + 0: "UNKNOWN_LANDMARK", + 1: "LEFT_EYE", + 2: "RIGHT_EYE", + 3: "LEFT_OF_LEFT_EYEBROW", + 4: "RIGHT_OF_LEFT_EYEBROW", + 5: "LEFT_OF_RIGHT_EYEBROW", + 6: "RIGHT_OF_RIGHT_EYEBROW", + 7: "MIDPOINT_BETWEEN_EYES", + 8: "NOSE_TIP", + 9: "UPPER_LIP", + 10: "LOWER_LIP", + 11: "MOUTH_LEFT", + 12: "MOUTH_RIGHT", + 13: "MOUTH_CENTER", + 14: "NOSE_BOTTOM_RIGHT", + 15: "NOSE_BOTTOM_LEFT", + 16: "NOSE_BOTTOM_CENTER", + 17: "LEFT_EYE_TOP_BOUNDARY", + 18: "LEFT_EYE_RIGHT_CORNER", + 19: "LEFT_EYE_BOTTOM_BOUNDARY", + 20: "LEFT_EYE_LEFT_CORNER", + 21: "RIGHT_EYE_TOP_BOUNDARY", + 22: "RIGHT_EYE_RIGHT_CORNER", + 23: "RIGHT_EYE_BOTTOM_BOUNDARY", + 24: "RIGHT_EYE_LEFT_CORNER", + 25: "LEFT_EYEBROW_UPPER_MIDPOINT", + 26: "RIGHT_EYEBROW_UPPER_MIDPOINT", + 27: "LEFT_EAR_TRAGION", + 28: "RIGHT_EAR_TRAGION", + 29: "LEFT_EYE_PUPIL", + 30: "RIGHT_EYE_PUPIL", + 31: "FOREHEAD_GLABELLA", + 32: "CHIN_GNATHION", + 33: "CHIN_LEFT_GONION", + 34: "CHIN_RIGHT_GONION", +} +var FaceAnnotation_Landmark_Type_value = map[string]int32{ + "UNKNOWN_LANDMARK": 0, + "LEFT_EYE": 1, + "RIGHT_EYE": 2, + "LEFT_OF_LEFT_EYEBROW": 3, + "RIGHT_OF_LEFT_EYEBROW": 4, + "LEFT_OF_RIGHT_EYEBROW": 5, + "RIGHT_OF_RIGHT_EYEBROW": 6, + "MIDPOINT_BETWEEN_EYES": 7, + "NOSE_TIP": 8, + "UPPER_LIP": 9, + "LOWER_LIP": 10, + "MOUTH_LEFT": 11, + "MOUTH_RIGHT": 12, + "MOUTH_CENTER": 13, + "NOSE_BOTTOM_RIGHT": 14, + "NOSE_BOTTOM_LEFT": 15, + "NOSE_BOTTOM_CENTER": 16, + "LEFT_EYE_TOP_BOUNDARY": 17, + "LEFT_EYE_RIGHT_CORNER": 18, + "LEFT_EYE_BOTTOM_BOUNDARY": 19, + "LEFT_EYE_LEFT_CORNER": 20, + "RIGHT_EYE_TOP_BOUNDARY": 21, + "RIGHT_EYE_RIGHT_CORNER": 22, + "RIGHT_EYE_BOTTOM_BOUNDARY": 23, + "RIGHT_EYE_LEFT_CORNER": 24, + "LEFT_EYEBROW_UPPER_MIDPOINT": 25, + "RIGHT_EYEBROW_UPPER_MIDPOINT": 26, + "LEFT_EAR_TRAGION": 27, + "RIGHT_EAR_TRAGION": 28, + "LEFT_EYE_PUPIL": 29, + "RIGHT_EYE_PUPIL": 30, + "FOREHEAD_GLABELLA": 31, + "CHIN_GNATHION": 32, + "CHIN_LEFT_GONION": 33, + "CHIN_RIGHT_GONION": 34, +} + +func (x FaceAnnotation_Landmark_Type) String() string { + return proto.EnumName(FaceAnnotation_Landmark_Type_name, int32(x)) +} +func (FaceAnnotation_Landmark_Type) EnumDescriptor() ([]byte, []int) { + return fileDescriptor1, []int{3, 0, 0} +} + +// Users describe the type of Google Cloud Vision API tasks to perform over +// images by using *Feature*s. Each Feature indicates a type of image +// detection task to perform. Features encode the Cloud Vision API +// vertical to operate on and the number of top-scoring results to return. +type Feature struct { + // The feature type. + Type Feature_Type `protobuf:"varint,1,opt,name=type,enum=google.cloud.vision.v1p1beta1.Feature_Type" json:"type,omitempty"` + // Maximum number of results of this type. + MaxResults int32 `protobuf:"varint,2,opt,name=max_results,json=maxResults" json:"max_results,omitempty"` + // Model to use for the feature. + // Supported values: "builtin/stable" (the default if unset) and + // "builtin/latest". + Model string `protobuf:"bytes,3,opt,name=model" json:"model,omitempty"` +} + +func (m *Feature) Reset() { *m = Feature{} } +func (m *Feature) String() string { return proto.CompactTextString(m) } +func (*Feature) ProtoMessage() {} +func (*Feature) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +func (m *Feature) GetType() Feature_Type { + if m != nil { + return m.Type + } + return Feature_TYPE_UNSPECIFIED +} + +func (m *Feature) GetMaxResults() int32 { + if m != nil { + return m.MaxResults + } + return 0 +} + +func (m *Feature) GetModel() string { + if m != nil { + return m.Model + } + return "" +} + +// External image source (Google Cloud Storage image location). +type ImageSource struct { + // NOTE: For new code `image_uri` below is preferred. + // Google Cloud Storage image URI, which must be in the following form: + // `gs://bucket_name/object_name` (for details, see + // [Google Cloud Storage Request + // URIs](https://cloud.google.com/storage/docs/reference-uris)). + // NOTE: Cloud Storage object versioning is not supported. + GcsImageUri string `protobuf:"bytes,1,opt,name=gcs_image_uri,json=gcsImageUri" json:"gcs_image_uri,omitempty"` + // Image URI which supports: + // 1) Google Cloud Storage image URI, which must be in the following form: + // `gs://bucket_name/object_name` (for details, see + // [Google Cloud Storage Request + // URIs](https://cloud.google.com/storage/docs/reference-uris)). + // NOTE: Cloud Storage object versioning is not supported. + // 2) Publicly accessible image HTTP/HTTPS URL. + // This is preferred over the legacy `gcs_image_uri` above. When both + // `gcs_image_uri` and `image_uri` are specified, `image_uri` takes + // precedence. + ImageUri string `protobuf:"bytes,2,opt,name=image_uri,json=imageUri" json:"image_uri,omitempty"` +} + +func (m *ImageSource) Reset() { *m = ImageSource{} } +func (m *ImageSource) String() string { return proto.CompactTextString(m) } +func (*ImageSource) ProtoMessage() {} +func (*ImageSource) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} } + +func (m *ImageSource) GetGcsImageUri() string { + if m != nil { + return m.GcsImageUri + } + return "" +} + +func (m *ImageSource) GetImageUri() string { + if m != nil { + return m.ImageUri + } + return "" +} + +// Client image to perform Google Cloud Vision API tasks over. +type Image struct { + // Image content, represented as a stream of bytes. + // Note: as with all `bytes` fields, protobuffers use a pure binary + // representation, whereas JSON representations use base64. + Content []byte `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` + // Google Cloud Storage image location. If both `content` and `source` + // are provided for an image, `content` takes precedence and is + // used to perform the image annotation request. + Source *ImageSource `protobuf:"bytes,2,opt,name=source" json:"source,omitempty"` +} + +func (m *Image) Reset() { *m = Image{} } +func (m *Image) String() string { return proto.CompactTextString(m) } +func (*Image) ProtoMessage() {} +func (*Image) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} } + +func (m *Image) GetContent() []byte { + if m != nil { + return m.Content + } + return nil +} + +func (m *Image) GetSource() *ImageSource { + if m != nil { + return m.Source + } + return nil +} + +// A face annotation object contains the results of face detection. +type FaceAnnotation struct { + // The bounding polygon around the face. The coordinates of the bounding box + // are in the original image's scale, as returned in `ImageParams`. + // The bounding box is computed to "frame" the face in accordance with human + // expectations. It is based on the landmarker results. + // Note that one or more x and/or y coordinates may not be generated in the + // `BoundingPoly` (the polygon will be unbounded) if only a partial face + // appears in the image to be annotated. + BoundingPoly *BoundingPoly `protobuf:"bytes,1,opt,name=bounding_poly,json=boundingPoly" json:"bounding_poly,omitempty"` + // The `fd_bounding_poly` bounding polygon is tighter than the + // `boundingPoly`, and encloses only the skin part of the face. Typically, it + // is used to eliminate the face from any image analysis that detects the + // "amount of skin" visible in an image. It is not based on the + // landmarker results, only on the initial face detection, hence + // the fd (face detection) prefix. + FdBoundingPoly *BoundingPoly `protobuf:"bytes,2,opt,name=fd_bounding_poly,json=fdBoundingPoly" json:"fd_bounding_poly,omitempty"` + // Detected face landmarks. + Landmarks []*FaceAnnotation_Landmark `protobuf:"bytes,3,rep,name=landmarks" json:"landmarks,omitempty"` + // Roll angle, which indicates the amount of clockwise/anti-clockwise rotation + // of the face relative to the image vertical about the axis perpendicular to + // the face. Range [-180,180]. + RollAngle float32 `protobuf:"fixed32,4,opt,name=roll_angle,json=rollAngle" json:"roll_angle,omitempty"` + // Yaw angle, which indicates the leftward/rightward angle that the face is + // pointing relative to the vertical plane perpendicular to the image. Range + // [-180,180]. + PanAngle float32 `protobuf:"fixed32,5,opt,name=pan_angle,json=panAngle" json:"pan_angle,omitempty"` + // Pitch angle, which indicates the upwards/downwards angle that the face is + // pointing relative to the image's horizontal plane. Range [-180,180]. + TiltAngle float32 `protobuf:"fixed32,6,opt,name=tilt_angle,json=tiltAngle" json:"tilt_angle,omitempty"` + // Detection confidence. Range [0, 1]. + DetectionConfidence float32 `protobuf:"fixed32,7,opt,name=detection_confidence,json=detectionConfidence" json:"detection_confidence,omitempty"` + // Face landmarking confidence. Range [0, 1]. + LandmarkingConfidence float32 `protobuf:"fixed32,8,opt,name=landmarking_confidence,json=landmarkingConfidence" json:"landmarking_confidence,omitempty"` + // Joy likelihood. + JoyLikelihood Likelihood `protobuf:"varint,9,opt,name=joy_likelihood,json=joyLikelihood,enum=google.cloud.vision.v1p1beta1.Likelihood" json:"joy_likelihood,omitempty"` + // Sorrow likelihood. + SorrowLikelihood Likelihood `protobuf:"varint,10,opt,name=sorrow_likelihood,json=sorrowLikelihood,enum=google.cloud.vision.v1p1beta1.Likelihood" json:"sorrow_likelihood,omitempty"` + // Anger likelihood. + AngerLikelihood Likelihood `protobuf:"varint,11,opt,name=anger_likelihood,json=angerLikelihood,enum=google.cloud.vision.v1p1beta1.Likelihood" json:"anger_likelihood,omitempty"` + // Surprise likelihood. + SurpriseLikelihood Likelihood `protobuf:"varint,12,opt,name=surprise_likelihood,json=surpriseLikelihood,enum=google.cloud.vision.v1p1beta1.Likelihood" json:"surprise_likelihood,omitempty"` + // Under-exposed likelihood. + UnderExposedLikelihood Likelihood `protobuf:"varint,13,opt,name=under_exposed_likelihood,json=underExposedLikelihood,enum=google.cloud.vision.v1p1beta1.Likelihood" json:"under_exposed_likelihood,omitempty"` + // Blurred likelihood. + BlurredLikelihood Likelihood `protobuf:"varint,14,opt,name=blurred_likelihood,json=blurredLikelihood,enum=google.cloud.vision.v1p1beta1.Likelihood" json:"blurred_likelihood,omitempty"` + // Headwear likelihood. + HeadwearLikelihood Likelihood `protobuf:"varint,15,opt,name=headwear_likelihood,json=headwearLikelihood,enum=google.cloud.vision.v1p1beta1.Likelihood" json:"headwear_likelihood,omitempty"` +} + +func (m *FaceAnnotation) Reset() { *m = FaceAnnotation{} } +func (m *FaceAnnotation) String() string { return proto.CompactTextString(m) } +func (*FaceAnnotation) ProtoMessage() {} +func (*FaceAnnotation) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{3} } + +func (m *FaceAnnotation) GetBoundingPoly() *BoundingPoly { + if m != nil { + return m.BoundingPoly + } + return nil +} + +func (m *FaceAnnotation) GetFdBoundingPoly() *BoundingPoly { + if m != nil { + return m.FdBoundingPoly + } + return nil +} + +func (m *FaceAnnotation) GetLandmarks() []*FaceAnnotation_Landmark { + if m != nil { + return m.Landmarks + } + return nil +} + +func (m *FaceAnnotation) GetRollAngle() float32 { + if m != nil { + return m.RollAngle + } + return 0 +} + +func (m *FaceAnnotation) GetPanAngle() float32 { + if m != nil { + return m.PanAngle + } + return 0 +} + +func (m *FaceAnnotation) GetTiltAngle() float32 { + if m != nil { + return m.TiltAngle + } + return 0 +} + +func (m *FaceAnnotation) GetDetectionConfidence() float32 { + if m != nil { + return m.DetectionConfidence + } + return 0 +} + +func (m *FaceAnnotation) GetLandmarkingConfidence() float32 { + if m != nil { + return m.LandmarkingConfidence + } + return 0 +} + +func (m *FaceAnnotation) GetJoyLikelihood() Likelihood { + if m != nil { + return m.JoyLikelihood + } + return Likelihood_UNKNOWN +} + +func (m *FaceAnnotation) GetSorrowLikelihood() Likelihood { + if m != nil { + return m.SorrowLikelihood + } + return Likelihood_UNKNOWN +} + +func (m *FaceAnnotation) GetAngerLikelihood() Likelihood { + if m != nil { + return m.AngerLikelihood + } + return Likelihood_UNKNOWN +} + +func (m *FaceAnnotation) GetSurpriseLikelihood() Likelihood { + if m != nil { + return m.SurpriseLikelihood + } + return Likelihood_UNKNOWN +} + +func (m *FaceAnnotation) GetUnderExposedLikelihood() Likelihood { + if m != nil { + return m.UnderExposedLikelihood + } + return Likelihood_UNKNOWN +} + +func (m *FaceAnnotation) GetBlurredLikelihood() Likelihood { + if m != nil { + return m.BlurredLikelihood + } + return Likelihood_UNKNOWN +} + +func (m *FaceAnnotation) GetHeadwearLikelihood() Likelihood { + if m != nil { + return m.HeadwearLikelihood + } + return Likelihood_UNKNOWN +} + +// A face-specific landmark (for example, a face feature). +type FaceAnnotation_Landmark struct { + // Face landmark type. + Type FaceAnnotation_Landmark_Type `protobuf:"varint,3,opt,name=type,enum=google.cloud.vision.v1p1beta1.FaceAnnotation_Landmark_Type" json:"type,omitempty"` + // Face landmark position. + Position *Position `protobuf:"bytes,4,opt,name=position" json:"position,omitempty"` +} + +func (m *FaceAnnotation_Landmark) Reset() { *m = FaceAnnotation_Landmark{} } +func (m *FaceAnnotation_Landmark) String() string { return proto.CompactTextString(m) } +func (*FaceAnnotation_Landmark) ProtoMessage() {} +func (*FaceAnnotation_Landmark) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{3, 0} } + +func (m *FaceAnnotation_Landmark) GetType() FaceAnnotation_Landmark_Type { + if m != nil { + return m.Type + } + return FaceAnnotation_Landmark_UNKNOWN_LANDMARK +} + +func (m *FaceAnnotation_Landmark) GetPosition() *Position { + if m != nil { + return m.Position + } + return nil +} + +// Detected entity location information. +type LocationInfo struct { + // lat/long location coordinates. + LatLng *google_type1.LatLng `protobuf:"bytes,1,opt,name=lat_lng,json=latLng" json:"lat_lng,omitempty"` +} + +func (m *LocationInfo) Reset() { *m = LocationInfo{} } +func (m *LocationInfo) String() string { return proto.CompactTextString(m) } +func (*LocationInfo) ProtoMessage() {} +func (*LocationInfo) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{4} } + +func (m *LocationInfo) GetLatLng() *google_type1.LatLng { + if m != nil { + return m.LatLng + } + return nil +} + +// A `Property` consists of a user-supplied name/value pair. +type Property struct { + // Name of the property. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Value of the property. + Value string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` + // Value of numeric properties. + Uint64Value uint64 `protobuf:"varint,3,opt,name=uint64_value,json=uint64Value" json:"uint64_value,omitempty"` +} + +func (m *Property) Reset() { *m = Property{} } +func (m *Property) String() string { return proto.CompactTextString(m) } +func (*Property) ProtoMessage() {} +func (*Property) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{5} } + +func (m *Property) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Property) GetValue() string { + if m != nil { + return m.Value + } + return "" +} + +func (m *Property) GetUint64Value() uint64 { + if m != nil { + return m.Uint64Value + } + return 0 +} + +// Set of detected entity features. +type EntityAnnotation struct { + // Opaque entity ID. Some IDs may be available in + // [Google Knowledge Graph Search API](https://developers.google.com/knowledge-graph/). + Mid string `protobuf:"bytes,1,opt,name=mid" json:"mid,omitempty"` + // The language code for the locale in which the entity textual + // `description` is expressed. + Locale string `protobuf:"bytes,2,opt,name=locale" json:"locale,omitempty"` + // Entity textual description, expressed in its `locale` language. + Description string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` + // Overall score of the result. Range [0, 1]. + Score float32 `protobuf:"fixed32,4,opt,name=score" json:"score,omitempty"` + // The accuracy of the entity detection in an image. + // For example, for an image in which the "Eiffel Tower" entity is detected, + // this field represents the confidence that there is a tower in the query + // image. Range [0, 1]. + Confidence float32 `protobuf:"fixed32,5,opt,name=confidence" json:"confidence,omitempty"` + // The relevancy of the ICA (Image Content Annotation) label to the + // image. For example, the relevancy of "tower" is likely higher to an image + // containing the detected "Eiffel Tower" than to an image containing a + // detected distant towering building, even though the confidence that + // there is a tower in each image may be the same. Range [0, 1]. + Topicality float32 `protobuf:"fixed32,6,opt,name=topicality" json:"topicality,omitempty"` + // Image region to which this entity belongs. Not produced + // for `LABEL_DETECTION` features. + BoundingPoly *BoundingPoly `protobuf:"bytes,7,opt,name=bounding_poly,json=boundingPoly" json:"bounding_poly,omitempty"` + // The location information for the detected entity. Multiple + // `LocationInfo` elements can be present because one location may + // indicate the location of the scene in the image, and another location + // may indicate the location of the place where the image was taken. + // Location information is usually present for landmarks. + Locations []*LocationInfo `protobuf:"bytes,8,rep,name=locations" json:"locations,omitempty"` + // Some entities may have optional user-supplied `Property` (name/value) + // fields, such a score or string that qualifies the entity. + Properties []*Property `protobuf:"bytes,9,rep,name=properties" json:"properties,omitempty"` +} + +func (m *EntityAnnotation) Reset() { *m = EntityAnnotation{} } +func (m *EntityAnnotation) String() string { return proto.CompactTextString(m) } +func (*EntityAnnotation) ProtoMessage() {} +func (*EntityAnnotation) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{6} } + +func (m *EntityAnnotation) GetMid() string { + if m != nil { + return m.Mid + } + return "" +} + +func (m *EntityAnnotation) GetLocale() string { + if m != nil { + return m.Locale + } + return "" +} + +func (m *EntityAnnotation) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *EntityAnnotation) GetScore() float32 { + if m != nil { + return m.Score + } + return 0 +} + +func (m *EntityAnnotation) GetConfidence() float32 { + if m != nil { + return m.Confidence + } + return 0 +} + +func (m *EntityAnnotation) GetTopicality() float32 { + if m != nil { + return m.Topicality + } + return 0 +} + +func (m *EntityAnnotation) GetBoundingPoly() *BoundingPoly { + if m != nil { + return m.BoundingPoly + } + return nil +} + +func (m *EntityAnnotation) GetLocations() []*LocationInfo { + if m != nil { + return m.Locations + } + return nil +} + +func (m *EntityAnnotation) GetProperties() []*Property { + if m != nil { + return m.Properties + } + return nil +} + +// Set of features pertaining to the image, computed by computer vision +// methods over safe-search verticals (for example, adult, spoof, medical, +// violence). +type SafeSearchAnnotation struct { + // Represents the adult content likelihood for the image. Adult content may + // contain elements such as nudity, pornographic images or cartoons, or + // sexual activities. + Adult Likelihood `protobuf:"varint,1,opt,name=adult,enum=google.cloud.vision.v1p1beta1.Likelihood" json:"adult,omitempty"` + // Spoof likelihood. The likelihood that an modification + // was made to the image's canonical version to make it appear + // funny or offensive. + Spoof Likelihood `protobuf:"varint,2,opt,name=spoof,enum=google.cloud.vision.v1p1beta1.Likelihood" json:"spoof,omitempty"` + // Likelihood that this is a medical image. + Medical Likelihood `protobuf:"varint,3,opt,name=medical,enum=google.cloud.vision.v1p1beta1.Likelihood" json:"medical,omitempty"` + // Likelihood that this image contains violent content. + Violence Likelihood `protobuf:"varint,4,opt,name=violence,enum=google.cloud.vision.v1p1beta1.Likelihood" json:"violence,omitempty"` + // Likelihood that the request image contains racy content. Racy content may + // include (but is not limited to) skimpy or sheer clothing, strategically + // covered nudity, lewd or provocative poses, or close-ups of sensitive + // body areas. + Racy Likelihood `protobuf:"varint,9,opt,name=racy,enum=google.cloud.vision.v1p1beta1.Likelihood" json:"racy,omitempty"` +} + +func (m *SafeSearchAnnotation) Reset() { *m = SafeSearchAnnotation{} } +func (m *SafeSearchAnnotation) String() string { return proto.CompactTextString(m) } +func (*SafeSearchAnnotation) ProtoMessage() {} +func (*SafeSearchAnnotation) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{7} } + +func (m *SafeSearchAnnotation) GetAdult() Likelihood { + if m != nil { + return m.Adult + } + return Likelihood_UNKNOWN +} + +func (m *SafeSearchAnnotation) GetSpoof() Likelihood { + if m != nil { + return m.Spoof + } + return Likelihood_UNKNOWN +} + +func (m *SafeSearchAnnotation) GetMedical() Likelihood { + if m != nil { + return m.Medical + } + return Likelihood_UNKNOWN +} + +func (m *SafeSearchAnnotation) GetViolence() Likelihood { + if m != nil { + return m.Violence + } + return Likelihood_UNKNOWN +} + +func (m *SafeSearchAnnotation) GetRacy() Likelihood { + if m != nil { + return m.Racy + } + return Likelihood_UNKNOWN +} + +// Rectangle determined by min and max `LatLng` pairs. +type LatLongRect struct { + // Min lat/long pair. + MinLatLng *google_type1.LatLng `protobuf:"bytes,1,opt,name=min_lat_lng,json=minLatLng" json:"min_lat_lng,omitempty"` + // Max lat/long pair. + MaxLatLng *google_type1.LatLng `protobuf:"bytes,2,opt,name=max_lat_lng,json=maxLatLng" json:"max_lat_lng,omitempty"` +} + +func (m *LatLongRect) Reset() { *m = LatLongRect{} } +func (m *LatLongRect) String() string { return proto.CompactTextString(m) } +func (*LatLongRect) ProtoMessage() {} +func (*LatLongRect) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{8} } + +func (m *LatLongRect) GetMinLatLng() *google_type1.LatLng { + if m != nil { + return m.MinLatLng + } + return nil +} + +func (m *LatLongRect) GetMaxLatLng() *google_type1.LatLng { + if m != nil { + return m.MaxLatLng + } + return nil +} + +// Color information consists of RGB channels, score, and the fraction of +// the image that the color occupies in the image. +type ColorInfo struct { + // RGB components of the color. + Color *google_type.Color `protobuf:"bytes,1,opt,name=color" json:"color,omitempty"` + // Image-specific score for this color. Value in range [0, 1]. + Score float32 `protobuf:"fixed32,2,opt,name=score" json:"score,omitempty"` + // The fraction of pixels the color occupies in the image. + // Value in range [0, 1]. + PixelFraction float32 `protobuf:"fixed32,3,opt,name=pixel_fraction,json=pixelFraction" json:"pixel_fraction,omitempty"` +} + +func (m *ColorInfo) Reset() { *m = ColorInfo{} } +func (m *ColorInfo) String() string { return proto.CompactTextString(m) } +func (*ColorInfo) ProtoMessage() {} +func (*ColorInfo) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{9} } + +func (m *ColorInfo) GetColor() *google_type.Color { + if m != nil { + return m.Color + } + return nil +} + +func (m *ColorInfo) GetScore() float32 { + if m != nil { + return m.Score + } + return 0 +} + +func (m *ColorInfo) GetPixelFraction() float32 { + if m != nil { + return m.PixelFraction + } + return 0 +} + +// Set of dominant colors and their corresponding scores. +type DominantColorsAnnotation struct { + // RGB color values with their score and pixel fraction. + Colors []*ColorInfo `protobuf:"bytes,1,rep,name=colors" json:"colors,omitempty"` +} + +func (m *DominantColorsAnnotation) Reset() { *m = DominantColorsAnnotation{} } +func (m *DominantColorsAnnotation) String() string { return proto.CompactTextString(m) } +func (*DominantColorsAnnotation) ProtoMessage() {} +func (*DominantColorsAnnotation) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{10} } + +func (m *DominantColorsAnnotation) GetColors() []*ColorInfo { + if m != nil { + return m.Colors + } + return nil +} + +// Stores image properties, such as dominant colors. +type ImageProperties struct { + // If present, dominant colors completed successfully. + DominantColors *DominantColorsAnnotation `protobuf:"bytes,1,opt,name=dominant_colors,json=dominantColors" json:"dominant_colors,omitempty"` +} + +func (m *ImageProperties) Reset() { *m = ImageProperties{} } +func (m *ImageProperties) String() string { return proto.CompactTextString(m) } +func (*ImageProperties) ProtoMessage() {} +func (*ImageProperties) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{11} } + +func (m *ImageProperties) GetDominantColors() *DominantColorsAnnotation { + if m != nil { + return m.DominantColors + } + return nil +} + +// Single crop hint that is used to generate a new crop when serving an image. +type CropHint struct { + // The bounding polygon for the crop region. The coordinates of the bounding + // box are in the original image's scale, as returned in `ImageParams`. + BoundingPoly *BoundingPoly `protobuf:"bytes,1,opt,name=bounding_poly,json=boundingPoly" json:"bounding_poly,omitempty"` + // Confidence of this being a salient region. Range [0, 1]. + Confidence float32 `protobuf:"fixed32,2,opt,name=confidence" json:"confidence,omitempty"` + // Fraction of importance of this salient region with respect to the original + // image. + ImportanceFraction float32 `protobuf:"fixed32,3,opt,name=importance_fraction,json=importanceFraction" json:"importance_fraction,omitempty"` +} + +func (m *CropHint) Reset() { *m = CropHint{} } +func (m *CropHint) String() string { return proto.CompactTextString(m) } +func (*CropHint) ProtoMessage() {} +func (*CropHint) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{12} } + +func (m *CropHint) GetBoundingPoly() *BoundingPoly { + if m != nil { + return m.BoundingPoly + } + return nil +} + +func (m *CropHint) GetConfidence() float32 { + if m != nil { + return m.Confidence + } + return 0 +} + +func (m *CropHint) GetImportanceFraction() float32 { + if m != nil { + return m.ImportanceFraction + } + return 0 +} + +// Set of crop hints that are used to generate new crops when serving images. +type CropHintsAnnotation struct { + // Crop hint results. + CropHints []*CropHint `protobuf:"bytes,1,rep,name=crop_hints,json=cropHints" json:"crop_hints,omitempty"` +} + +func (m *CropHintsAnnotation) Reset() { *m = CropHintsAnnotation{} } +func (m *CropHintsAnnotation) String() string { return proto.CompactTextString(m) } +func (*CropHintsAnnotation) ProtoMessage() {} +func (*CropHintsAnnotation) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{13} } + +func (m *CropHintsAnnotation) GetCropHints() []*CropHint { + if m != nil { + return m.CropHints + } + return nil +} + +// Parameters for crop hints annotation request. +type CropHintsParams struct { + // Aspect ratios in floats, representing the ratio of the width to the height + // of the image. For example, if the desired aspect ratio is 4/3, the + // corresponding float value should be 1.33333. If not specified, the + // best possible crop is returned. The number of provided aspect ratios is + // limited to a maximum of 16; any aspect ratios provided after the 16th are + // ignored. + AspectRatios []float32 `protobuf:"fixed32,1,rep,packed,name=aspect_ratios,json=aspectRatios" json:"aspect_ratios,omitempty"` +} + +func (m *CropHintsParams) Reset() { *m = CropHintsParams{} } +func (m *CropHintsParams) String() string { return proto.CompactTextString(m) } +func (*CropHintsParams) ProtoMessage() {} +func (*CropHintsParams) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{14} } + +func (m *CropHintsParams) GetAspectRatios() []float32 { + if m != nil { + return m.AspectRatios + } + return nil +} + +// Parameters for web detection request. +type WebDetectionParams struct { + // Whether to include results derived from the geo information in the image. + IncludeGeoResults bool `protobuf:"varint,2,opt,name=include_geo_results,json=includeGeoResults" json:"include_geo_results,omitempty"` +} + +func (m *WebDetectionParams) Reset() { *m = WebDetectionParams{} } +func (m *WebDetectionParams) String() string { return proto.CompactTextString(m) } +func (*WebDetectionParams) ProtoMessage() {} +func (*WebDetectionParams) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{15} } + +func (m *WebDetectionParams) GetIncludeGeoResults() bool { + if m != nil { + return m.IncludeGeoResults + } + return false +} + +// Image context and/or feature-specific parameters. +type ImageContext struct { + // lat/long rectangle that specifies the location of the image. + LatLongRect *LatLongRect `protobuf:"bytes,1,opt,name=lat_long_rect,json=latLongRect" json:"lat_long_rect,omitempty"` + // List of languages to use for TEXT_DETECTION. In most cases, an empty value + // yields the best results since it enables automatic language detection. For + // languages based on the Latin alphabet, setting `language_hints` is not + // needed. In rare cases, when the language of the text in the image is known, + // setting a hint will help get better results (although it will be a + // significant hindrance if the hint is wrong). Text detection returns an + // error if one or more of the specified languages is not one of the + // [supported languages](/vision/docs/languages). + LanguageHints []string `protobuf:"bytes,2,rep,name=language_hints,json=languageHints" json:"language_hints,omitempty"` + // Parameters for crop hints annotation request. + CropHintsParams *CropHintsParams `protobuf:"bytes,4,opt,name=crop_hints_params,json=cropHintsParams" json:"crop_hints_params,omitempty"` + // Parameters for web detection. + WebDetectionParams *WebDetectionParams `protobuf:"bytes,6,opt,name=web_detection_params,json=webDetectionParams" json:"web_detection_params,omitempty"` +} + +func (m *ImageContext) Reset() { *m = ImageContext{} } +func (m *ImageContext) String() string { return proto.CompactTextString(m) } +func (*ImageContext) ProtoMessage() {} +func (*ImageContext) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{16} } + +func (m *ImageContext) GetLatLongRect() *LatLongRect { + if m != nil { + return m.LatLongRect + } + return nil +} + +func (m *ImageContext) GetLanguageHints() []string { + if m != nil { + return m.LanguageHints + } + return nil +} + +func (m *ImageContext) GetCropHintsParams() *CropHintsParams { + if m != nil { + return m.CropHintsParams + } + return nil +} + +func (m *ImageContext) GetWebDetectionParams() *WebDetectionParams { + if m != nil { + return m.WebDetectionParams + } + return nil +} + +// Request for performing Google Cloud Vision API tasks over a user-provided +// image, with user-requested features. +type AnnotateImageRequest struct { + // The image to be processed. + Image *Image `protobuf:"bytes,1,opt,name=image" json:"image,omitempty"` + // Requested features. + Features []*Feature `protobuf:"bytes,2,rep,name=features" json:"features,omitempty"` + // Additional context that may accompany the image. + ImageContext *ImageContext `protobuf:"bytes,3,opt,name=image_context,json=imageContext" json:"image_context,omitempty"` +} + +func (m *AnnotateImageRequest) Reset() { *m = AnnotateImageRequest{} } +func (m *AnnotateImageRequest) String() string { return proto.CompactTextString(m) } +func (*AnnotateImageRequest) ProtoMessage() {} +func (*AnnotateImageRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{17} } + +func (m *AnnotateImageRequest) GetImage() *Image { + if m != nil { + return m.Image + } + return nil +} + +func (m *AnnotateImageRequest) GetFeatures() []*Feature { + if m != nil { + return m.Features + } + return nil +} + +func (m *AnnotateImageRequest) GetImageContext() *ImageContext { + if m != nil { + return m.ImageContext + } + return nil +} + +// Response to an image annotation request. +type AnnotateImageResponse struct { + // If present, face detection has completed successfully. + FaceAnnotations []*FaceAnnotation `protobuf:"bytes,1,rep,name=face_annotations,json=faceAnnotations" json:"face_annotations,omitempty"` + // If present, landmark detection has completed successfully. + LandmarkAnnotations []*EntityAnnotation `protobuf:"bytes,2,rep,name=landmark_annotations,json=landmarkAnnotations" json:"landmark_annotations,omitempty"` + // If present, logo detection has completed successfully. + LogoAnnotations []*EntityAnnotation `protobuf:"bytes,3,rep,name=logo_annotations,json=logoAnnotations" json:"logo_annotations,omitempty"` + // If present, label detection has completed successfully. + LabelAnnotations []*EntityAnnotation `protobuf:"bytes,4,rep,name=label_annotations,json=labelAnnotations" json:"label_annotations,omitempty"` + // If present, text (OCR) detection has completed successfully. + TextAnnotations []*EntityAnnotation `protobuf:"bytes,5,rep,name=text_annotations,json=textAnnotations" json:"text_annotations,omitempty"` + // If present, text (OCR) detection or document (OCR) text detection has + // completed successfully. + // This annotation provides the structural hierarchy for the OCR detected + // text. + FullTextAnnotation *TextAnnotation `protobuf:"bytes,12,opt,name=full_text_annotation,json=fullTextAnnotation" json:"full_text_annotation,omitempty"` + // If present, safe-search annotation has completed successfully. + SafeSearchAnnotation *SafeSearchAnnotation `protobuf:"bytes,6,opt,name=safe_search_annotation,json=safeSearchAnnotation" json:"safe_search_annotation,omitempty"` + // If present, image properties were extracted successfully. + ImagePropertiesAnnotation *ImageProperties `protobuf:"bytes,8,opt,name=image_properties_annotation,json=imagePropertiesAnnotation" json:"image_properties_annotation,omitempty"` + // If present, crop hints have completed successfully. + CropHintsAnnotation *CropHintsAnnotation `protobuf:"bytes,11,opt,name=crop_hints_annotation,json=cropHintsAnnotation" json:"crop_hints_annotation,omitempty"` + // If present, web detection has completed successfully. + WebDetection *WebDetection `protobuf:"bytes,13,opt,name=web_detection,json=webDetection" json:"web_detection,omitempty"` + // If set, represents the error message for the operation. + // Note that filled-in image annotations are guaranteed to be + // correct, even when `error` is set. + Error *google_rpc.Status `protobuf:"bytes,9,opt,name=error" json:"error,omitempty"` +} + +func (m *AnnotateImageResponse) Reset() { *m = AnnotateImageResponse{} } +func (m *AnnotateImageResponse) String() string { return proto.CompactTextString(m) } +func (*AnnotateImageResponse) ProtoMessage() {} +func (*AnnotateImageResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{18} } + +func (m *AnnotateImageResponse) GetFaceAnnotations() []*FaceAnnotation { + if m != nil { + return m.FaceAnnotations + } + return nil +} + +func (m *AnnotateImageResponse) GetLandmarkAnnotations() []*EntityAnnotation { + if m != nil { + return m.LandmarkAnnotations + } + return nil +} + +func (m *AnnotateImageResponse) GetLogoAnnotations() []*EntityAnnotation { + if m != nil { + return m.LogoAnnotations + } + return nil +} + +func (m *AnnotateImageResponse) GetLabelAnnotations() []*EntityAnnotation { + if m != nil { + return m.LabelAnnotations + } + return nil +} + +func (m *AnnotateImageResponse) GetTextAnnotations() []*EntityAnnotation { + if m != nil { + return m.TextAnnotations + } + return nil +} + +func (m *AnnotateImageResponse) GetFullTextAnnotation() *TextAnnotation { + if m != nil { + return m.FullTextAnnotation + } + return nil +} + +func (m *AnnotateImageResponse) GetSafeSearchAnnotation() *SafeSearchAnnotation { + if m != nil { + return m.SafeSearchAnnotation + } + return nil +} + +func (m *AnnotateImageResponse) GetImagePropertiesAnnotation() *ImageProperties { + if m != nil { + return m.ImagePropertiesAnnotation + } + return nil +} + +func (m *AnnotateImageResponse) GetCropHintsAnnotation() *CropHintsAnnotation { + if m != nil { + return m.CropHintsAnnotation + } + return nil +} + +func (m *AnnotateImageResponse) GetWebDetection() *WebDetection { + if m != nil { + return m.WebDetection + } + return nil +} + +func (m *AnnotateImageResponse) GetError() *google_rpc.Status { + if m != nil { + return m.Error + } + return nil +} + +// Multiple image annotation requests are batched into a single service call. +type BatchAnnotateImagesRequest struct { + // Individual image annotation requests for this batch. + Requests []*AnnotateImageRequest `protobuf:"bytes,1,rep,name=requests" json:"requests,omitempty"` +} + +func (m *BatchAnnotateImagesRequest) Reset() { *m = BatchAnnotateImagesRequest{} } +func (m *BatchAnnotateImagesRequest) String() string { return proto.CompactTextString(m) } +func (*BatchAnnotateImagesRequest) ProtoMessage() {} +func (*BatchAnnotateImagesRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{19} } + +func (m *BatchAnnotateImagesRequest) GetRequests() []*AnnotateImageRequest { + if m != nil { + return m.Requests + } + return nil +} + +// Response to a batch image annotation request. +type BatchAnnotateImagesResponse struct { + // Individual responses to image annotation requests within the batch. + Responses []*AnnotateImageResponse `protobuf:"bytes,1,rep,name=responses" json:"responses,omitempty"` +} + +func (m *BatchAnnotateImagesResponse) Reset() { *m = BatchAnnotateImagesResponse{} } +func (m *BatchAnnotateImagesResponse) String() string { return proto.CompactTextString(m) } +func (*BatchAnnotateImagesResponse) ProtoMessage() {} +func (*BatchAnnotateImagesResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{20} } + +func (m *BatchAnnotateImagesResponse) GetResponses() []*AnnotateImageResponse { + if m != nil { + return m.Responses + } + return nil +} + +func init() { + proto.RegisterType((*Feature)(nil), "google.cloud.vision.v1p1beta1.Feature") + proto.RegisterType((*ImageSource)(nil), "google.cloud.vision.v1p1beta1.ImageSource") + proto.RegisterType((*Image)(nil), "google.cloud.vision.v1p1beta1.Image") + proto.RegisterType((*FaceAnnotation)(nil), "google.cloud.vision.v1p1beta1.FaceAnnotation") + proto.RegisterType((*FaceAnnotation_Landmark)(nil), "google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark") + proto.RegisterType((*LocationInfo)(nil), "google.cloud.vision.v1p1beta1.LocationInfo") + proto.RegisterType((*Property)(nil), "google.cloud.vision.v1p1beta1.Property") + proto.RegisterType((*EntityAnnotation)(nil), "google.cloud.vision.v1p1beta1.EntityAnnotation") + proto.RegisterType((*SafeSearchAnnotation)(nil), "google.cloud.vision.v1p1beta1.SafeSearchAnnotation") + proto.RegisterType((*LatLongRect)(nil), "google.cloud.vision.v1p1beta1.LatLongRect") + proto.RegisterType((*ColorInfo)(nil), "google.cloud.vision.v1p1beta1.ColorInfo") + proto.RegisterType((*DominantColorsAnnotation)(nil), "google.cloud.vision.v1p1beta1.DominantColorsAnnotation") + proto.RegisterType((*ImageProperties)(nil), "google.cloud.vision.v1p1beta1.ImageProperties") + proto.RegisterType((*CropHint)(nil), "google.cloud.vision.v1p1beta1.CropHint") + proto.RegisterType((*CropHintsAnnotation)(nil), "google.cloud.vision.v1p1beta1.CropHintsAnnotation") + proto.RegisterType((*CropHintsParams)(nil), "google.cloud.vision.v1p1beta1.CropHintsParams") + proto.RegisterType((*WebDetectionParams)(nil), "google.cloud.vision.v1p1beta1.WebDetectionParams") + proto.RegisterType((*ImageContext)(nil), "google.cloud.vision.v1p1beta1.ImageContext") + proto.RegisterType((*AnnotateImageRequest)(nil), "google.cloud.vision.v1p1beta1.AnnotateImageRequest") + proto.RegisterType((*AnnotateImageResponse)(nil), "google.cloud.vision.v1p1beta1.AnnotateImageResponse") + proto.RegisterType((*BatchAnnotateImagesRequest)(nil), "google.cloud.vision.v1p1beta1.BatchAnnotateImagesRequest") + proto.RegisterType((*BatchAnnotateImagesResponse)(nil), "google.cloud.vision.v1p1beta1.BatchAnnotateImagesResponse") + proto.RegisterEnum("google.cloud.vision.v1p1beta1.Likelihood", Likelihood_name, Likelihood_value) + proto.RegisterEnum("google.cloud.vision.v1p1beta1.Feature_Type", Feature_Type_name, Feature_Type_value) + proto.RegisterEnum("google.cloud.vision.v1p1beta1.FaceAnnotation_Landmark_Type", FaceAnnotation_Landmark_Type_name, FaceAnnotation_Landmark_Type_value) +} + +// 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 + +// Client API for ImageAnnotator service + +type ImageAnnotatorClient interface { + // Run image detection and annotation for a batch of images. + BatchAnnotateImages(ctx context.Context, in *BatchAnnotateImagesRequest, opts ...grpc.CallOption) (*BatchAnnotateImagesResponse, error) +} + +type imageAnnotatorClient struct { + cc *grpc.ClientConn +} + +func NewImageAnnotatorClient(cc *grpc.ClientConn) ImageAnnotatorClient { + return &imageAnnotatorClient{cc} +} + +func (c *imageAnnotatorClient) BatchAnnotateImages(ctx context.Context, in *BatchAnnotateImagesRequest, opts ...grpc.CallOption) (*BatchAnnotateImagesResponse, error) { + out := new(BatchAnnotateImagesResponse) + err := grpc.Invoke(ctx, "/google.cloud.vision.v1p1beta1.ImageAnnotator/BatchAnnotateImages", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for ImageAnnotator service + +type ImageAnnotatorServer interface { + // Run image detection and annotation for a batch of images. + BatchAnnotateImages(context.Context, *BatchAnnotateImagesRequest) (*BatchAnnotateImagesResponse, error) +} + +func RegisterImageAnnotatorServer(s *grpc.Server, srv ImageAnnotatorServer) { + s.RegisterService(&_ImageAnnotator_serviceDesc, srv) +} + +func _ImageAnnotator_BatchAnnotateImages_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BatchAnnotateImagesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ImageAnnotatorServer).BatchAnnotateImages(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.vision.v1p1beta1.ImageAnnotator/BatchAnnotateImages", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ImageAnnotatorServer).BatchAnnotateImages(ctx, req.(*BatchAnnotateImagesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _ImageAnnotator_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.cloud.vision.v1p1beta1.ImageAnnotator", + HandlerType: (*ImageAnnotatorServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "BatchAnnotateImages", + Handler: _ImageAnnotator_BatchAnnotateImages_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/cloud/vision/v1p1beta1/image_annotator.proto", +} + +func init() { + proto.RegisterFile("google/cloud/vision/v1p1beta1/image_annotator.proto", fileDescriptor1) +} + +var fileDescriptor1 = []byte{ + // 2392 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x59, 0xcd, 0x72, 0xe3, 0xc6, + 0xf1, 0x37, 0xa9, 0x2f, 0xb2, 0x49, 0x91, 0xd0, 0x48, 0x2b, 0x73, 0xb5, 0xbb, 0x5e, 0x19, 0xff, + 0xbf, 0x13, 0xc5, 0x71, 0xa8, 0x5a, 0xad, 0xe3, 0x54, 0xd6, 0x49, 0x39, 0x24, 0x05, 0x49, 0x2c, + 0x73, 0x49, 0xd4, 0x90, 0xb2, 0xbc, 0x5b, 0x4e, 0x21, 0x10, 0x38, 0xe4, 0xc2, 0x06, 0x31, 0x30, + 0x00, 0xee, 0x4a, 0x57, 0x5f, 0x73, 0xcc, 0x2d, 0xf7, 0x1c, 0x73, 0x4a, 0x9e, 0xc1, 0x2f, 0x90, + 0x43, 0x1e, 0x20, 0x39, 0xe4, 0x09, 0x52, 0xa9, 0x9c, 0x52, 0xf3, 0x01, 0x70, 0xc0, 0xfd, 0xa0, + 0xb8, 0xa9, 0x9c, 0x88, 0xe9, 0x9e, 0xdf, 0xaf, 0x67, 0xba, 0xa7, 0x67, 0x7a, 0x86, 0xf0, 0x70, + 0x4c, 0xe9, 0xd8, 0x23, 0x87, 0x8e, 0x47, 0xa7, 0xc3, 0xc3, 0xe7, 0x6e, 0xe4, 0x52, 0xff, 0xf0, + 0xf9, 0x83, 0xe0, 0xc1, 0x25, 0x89, 0xed, 0x07, 0x87, 0xee, 0xc4, 0x1e, 0x13, 0xcb, 0xf6, 0x7d, + 0x1a, 0xdb, 0x31, 0x0d, 0xeb, 0x41, 0x48, 0x63, 0x8a, 0xee, 0x09, 0x50, 0x9d, 0x83, 0xea, 0x02, + 0x54, 0x4f, 0x41, 0x7b, 0x77, 0x25, 0xa7, 0x1d, 0xb8, 0x87, 0x12, 0xea, 0x52, 0x3f, 0x12, 0xe0, + 0xbd, 0x8f, 0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0x6b, 0xfe, 0x71, 0xfa, + 0x54, 0x08, 0xfe, 0x95, 0xcb, 0x5d, 0xae, 0x73, 0xc8, 0xc3, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, + 0xb8, 0x10, 0xf5, 0x85, 0x78, 0x1b, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/vision/v1p1beta1/text_annotation.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/vision/v1p1beta1/text_annotation.pb.go new file mode 100644 index 0000000000..6143b45250 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/vision/v1p1beta1/text_annotation.pb.go @@ -0,0 +1,587 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/vision/v1p1beta1/text_annotation.proto + +package vision + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Enum to denote the type of break found. New line, space etc. +type TextAnnotation_DetectedBreak_BreakType int32 + +const ( + // Unknown break label type. + TextAnnotation_DetectedBreak_UNKNOWN TextAnnotation_DetectedBreak_BreakType = 0 + // Regular space. + TextAnnotation_DetectedBreak_SPACE TextAnnotation_DetectedBreak_BreakType = 1 + // Sure space (very wide). + TextAnnotation_DetectedBreak_SURE_SPACE TextAnnotation_DetectedBreak_BreakType = 2 + // Line-wrapping break. + TextAnnotation_DetectedBreak_EOL_SURE_SPACE TextAnnotation_DetectedBreak_BreakType = 3 + // End-line hyphen that is not present in text; does not co-occur with + // `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`. + TextAnnotation_DetectedBreak_HYPHEN TextAnnotation_DetectedBreak_BreakType = 4 + // Line break that ends a paragraph. + TextAnnotation_DetectedBreak_LINE_BREAK TextAnnotation_DetectedBreak_BreakType = 5 +) + +var TextAnnotation_DetectedBreak_BreakType_name = map[int32]string{ + 0: "UNKNOWN", + 1: "SPACE", + 2: "SURE_SPACE", + 3: "EOL_SURE_SPACE", + 4: "HYPHEN", + 5: "LINE_BREAK", +} +var TextAnnotation_DetectedBreak_BreakType_value = map[string]int32{ + "UNKNOWN": 0, + "SPACE": 1, + "SURE_SPACE": 2, + "EOL_SURE_SPACE": 3, + "HYPHEN": 4, + "LINE_BREAK": 5, +} + +func (x TextAnnotation_DetectedBreak_BreakType) String() string { + return proto.EnumName(TextAnnotation_DetectedBreak_BreakType_name, int32(x)) +} +func (TextAnnotation_DetectedBreak_BreakType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor2, []int{0, 1, 0} +} + +// Type of a block (text, image etc) as identified by OCR. +type Block_BlockType int32 + +const ( + // Unknown block type. + Block_UNKNOWN Block_BlockType = 0 + // Regular text block. + Block_TEXT Block_BlockType = 1 + // Table block. + Block_TABLE Block_BlockType = 2 + // Image block. + Block_PICTURE Block_BlockType = 3 + // Horizontal/vertical line box. + Block_RULER Block_BlockType = 4 + // Barcode block. + Block_BARCODE Block_BlockType = 5 +) + +var Block_BlockType_name = map[int32]string{ + 0: "UNKNOWN", + 1: "TEXT", + 2: "TABLE", + 3: "PICTURE", + 4: "RULER", + 5: "BARCODE", +} +var Block_BlockType_value = map[string]int32{ + "UNKNOWN": 0, + "TEXT": 1, + "TABLE": 2, + "PICTURE": 3, + "RULER": 4, + "BARCODE": 5, +} + +func (x Block_BlockType) String() string { + return proto.EnumName(Block_BlockType_name, int32(x)) +} +func (Block_BlockType) EnumDescriptor() ([]byte, []int) { return fileDescriptor2, []int{2, 0} } + +// TextAnnotation contains a structured representation of OCR extracted text. +// The hierarchy of an OCR extracted text structure is like this: +// TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol +// Each structural component, starting from Page, may further have their own +// properties. Properties describe detected languages, breaks etc.. Please refer +// to the +// [TextAnnotation.TextProperty][google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty] +// message definition below for more detail. +type TextAnnotation struct { + // List of pages detected by OCR. + Pages []*Page `protobuf:"bytes,1,rep,name=pages" json:"pages,omitempty"` + // UTF-8 text detected on the pages. + Text string `protobuf:"bytes,2,opt,name=text" json:"text,omitempty"` +} + +func (m *TextAnnotation) Reset() { *m = TextAnnotation{} } +func (m *TextAnnotation) String() string { return proto.CompactTextString(m) } +func (*TextAnnotation) ProtoMessage() {} +func (*TextAnnotation) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} } + +func (m *TextAnnotation) GetPages() []*Page { + if m != nil { + return m.Pages + } + return nil +} + +func (m *TextAnnotation) GetText() string { + if m != nil { + return m.Text + } + return "" +} + +// Detected language for a structural component. +type TextAnnotation_DetectedLanguage struct { + // The BCP-47 language code, such as "en-US" or "sr-Latn". For more + // information, see + // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + LanguageCode string `protobuf:"bytes,1,opt,name=language_code,json=languageCode" json:"language_code,omitempty"` + // Confidence of detected language. Range [0, 1]. + Confidence float32 `protobuf:"fixed32,2,opt,name=confidence" json:"confidence,omitempty"` +} + +func (m *TextAnnotation_DetectedLanguage) Reset() { *m = TextAnnotation_DetectedLanguage{} } +func (m *TextAnnotation_DetectedLanguage) String() string { return proto.CompactTextString(m) } +func (*TextAnnotation_DetectedLanguage) ProtoMessage() {} +func (*TextAnnotation_DetectedLanguage) Descriptor() ([]byte, []int) { + return fileDescriptor2, []int{0, 0} +} + +func (m *TextAnnotation_DetectedLanguage) GetLanguageCode() string { + if m != nil { + return m.LanguageCode + } + return "" +} + +func (m *TextAnnotation_DetectedLanguage) GetConfidence() float32 { + if m != nil { + return m.Confidence + } + return 0 +} + +// Detected start or end of a structural component. +type TextAnnotation_DetectedBreak struct { + // Detected break type. + Type TextAnnotation_DetectedBreak_BreakType `protobuf:"varint,1,opt,name=type,enum=google.cloud.vision.v1p1beta1.TextAnnotation_DetectedBreak_BreakType" json:"type,omitempty"` + // True if break prepends the element. + IsPrefix bool `protobuf:"varint,2,opt,name=is_prefix,json=isPrefix" json:"is_prefix,omitempty"` +} + +func (m *TextAnnotation_DetectedBreak) Reset() { *m = TextAnnotation_DetectedBreak{} } +func (m *TextAnnotation_DetectedBreak) String() string { return proto.CompactTextString(m) } +func (*TextAnnotation_DetectedBreak) ProtoMessage() {} +func (*TextAnnotation_DetectedBreak) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0, 1} } + +func (m *TextAnnotation_DetectedBreak) GetType() TextAnnotation_DetectedBreak_BreakType { + if m != nil { + return m.Type + } + return TextAnnotation_DetectedBreak_UNKNOWN +} + +func (m *TextAnnotation_DetectedBreak) GetIsPrefix() bool { + if m != nil { + return m.IsPrefix + } + return false +} + +// Additional information detected on the structural component. +type TextAnnotation_TextProperty struct { + // A list of detected languages together with confidence. + DetectedLanguages []*TextAnnotation_DetectedLanguage `protobuf:"bytes,1,rep,name=detected_languages,json=detectedLanguages" json:"detected_languages,omitempty"` + // Detected start or end of a text segment. + DetectedBreak *TextAnnotation_DetectedBreak `protobuf:"bytes,2,opt,name=detected_break,json=detectedBreak" json:"detected_break,omitempty"` +} + +func (m *TextAnnotation_TextProperty) Reset() { *m = TextAnnotation_TextProperty{} } +func (m *TextAnnotation_TextProperty) String() string { return proto.CompactTextString(m) } +func (*TextAnnotation_TextProperty) ProtoMessage() {} +func (*TextAnnotation_TextProperty) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0, 2} } + +func (m *TextAnnotation_TextProperty) GetDetectedLanguages() []*TextAnnotation_DetectedLanguage { + if m != nil { + return m.DetectedLanguages + } + return nil +} + +func (m *TextAnnotation_TextProperty) GetDetectedBreak() *TextAnnotation_DetectedBreak { + if m != nil { + return m.DetectedBreak + } + return nil +} + +// Detected page from OCR. +type Page struct { + // Additional information detected on the page. + Property *TextAnnotation_TextProperty `protobuf:"bytes,1,opt,name=property" json:"property,omitempty"` + // Page width in pixels. + Width int32 `protobuf:"varint,2,opt,name=width" json:"width,omitempty"` + // Page height in pixels. + Height int32 `protobuf:"varint,3,opt,name=height" json:"height,omitempty"` + // List of blocks of text, images etc on this page. + Blocks []*Block `protobuf:"bytes,4,rep,name=blocks" json:"blocks,omitempty"` + // Confidence of the OCR results on the page. Range [0, 1]. + Confidence float32 `protobuf:"fixed32,5,opt,name=confidence" json:"confidence,omitempty"` +} + +func (m *Page) Reset() { *m = Page{} } +func (m *Page) String() string { return proto.CompactTextString(m) } +func (*Page) ProtoMessage() {} +func (*Page) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{1} } + +func (m *Page) GetProperty() *TextAnnotation_TextProperty { + if m != nil { + return m.Property + } + return nil +} + +func (m *Page) GetWidth() int32 { + if m != nil { + return m.Width + } + return 0 +} + +func (m *Page) GetHeight() int32 { + if m != nil { + return m.Height + } + return 0 +} + +func (m *Page) GetBlocks() []*Block { + if m != nil { + return m.Blocks + } + return nil +} + +func (m *Page) GetConfidence() float32 { + if m != nil { + return m.Confidence + } + return 0 +} + +// Logical element on the page. +type Block struct { + // Additional information detected for the block. + Property *TextAnnotation_TextProperty `protobuf:"bytes,1,opt,name=property" json:"property,omitempty"` + // The bounding box for the block. + // The vertices are in the order of top-left, top-right, bottom-right, + // bottom-left. When a rotation of the bounding box is detected the rotation + // is represented as around the top-left corner as defined when the text is + // read in the 'natural' orientation. + // For example: + // * when the text is horizontal it might look like: + // 0----1 + // | | + // 3----2 + // * when it's rotated 180 degrees around the top-left corner it becomes: + // 2----3 + // | | + // 1----0 + // and the vertice order will still be (0, 1, 2, 3). + BoundingBox *BoundingPoly `protobuf:"bytes,2,opt,name=bounding_box,json=boundingBox" json:"bounding_box,omitempty"` + // List of paragraphs in this block (if this blocks is of type text). + Paragraphs []*Paragraph `protobuf:"bytes,3,rep,name=paragraphs" json:"paragraphs,omitempty"` + // Detected block type (text, image etc) for this block. + BlockType Block_BlockType `protobuf:"varint,4,opt,name=block_type,json=blockType,enum=google.cloud.vision.v1p1beta1.Block_BlockType" json:"block_type,omitempty"` + // Confidence of the OCR results on the block. Range [0, 1]. + Confidence float32 `protobuf:"fixed32,5,opt,name=confidence" json:"confidence,omitempty"` +} + +func (m *Block) Reset() { *m = Block{} } +func (m *Block) String() string { return proto.CompactTextString(m) } +func (*Block) ProtoMessage() {} +func (*Block) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{2} } + +func (m *Block) GetProperty() *TextAnnotation_TextProperty { + if m != nil { + return m.Property + } + return nil +} + +func (m *Block) GetBoundingBox() *BoundingPoly { + if m != nil { + return m.BoundingBox + } + return nil +} + +func (m *Block) GetParagraphs() []*Paragraph { + if m != nil { + return m.Paragraphs + } + return nil +} + +func (m *Block) GetBlockType() Block_BlockType { + if m != nil { + return m.BlockType + } + return Block_UNKNOWN +} + +func (m *Block) GetConfidence() float32 { + if m != nil { + return m.Confidence + } + return 0 +} + +// Structural unit of text representing a number of words in certain order. +type Paragraph struct { + // Additional information detected for the paragraph. + Property *TextAnnotation_TextProperty `protobuf:"bytes,1,opt,name=property" json:"property,omitempty"` + // The bounding box for the paragraph. + // The vertices are in the order of top-left, top-right, bottom-right, + // bottom-left. When a rotation of the bounding box is detected the rotation + // is represented as around the top-left corner as defined when the text is + // read in the 'natural' orientation. + // For example: + // * when the text is horizontal it might look like: + // 0----1 + // | | + // 3----2 + // * when it's rotated 180 degrees around the top-left corner it becomes: + // 2----3 + // | | + // 1----0 + // and the vertice order will still be (0, 1, 2, 3). + BoundingBox *BoundingPoly `protobuf:"bytes,2,opt,name=bounding_box,json=boundingBox" json:"bounding_box,omitempty"` + // List of words in this paragraph. + Words []*Word `protobuf:"bytes,3,rep,name=words" json:"words,omitempty"` + // Confidence of the OCR results for the paragraph. Range [0, 1]. + Confidence float32 `protobuf:"fixed32,4,opt,name=confidence" json:"confidence,omitempty"` +} + +func (m *Paragraph) Reset() { *m = Paragraph{} } +func (m *Paragraph) String() string { return proto.CompactTextString(m) } +func (*Paragraph) ProtoMessage() {} +func (*Paragraph) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{3} } + +func (m *Paragraph) GetProperty() *TextAnnotation_TextProperty { + if m != nil { + return m.Property + } + return nil +} + +func (m *Paragraph) GetBoundingBox() *BoundingPoly { + if m != nil { + return m.BoundingBox + } + return nil +} + +func (m *Paragraph) GetWords() []*Word { + if m != nil { + return m.Words + } + return nil +} + +func (m *Paragraph) GetConfidence() float32 { + if m != nil { + return m.Confidence + } + return 0 +} + +// A word representation. +type Word struct { + // Additional information detected for the word. + Property *TextAnnotation_TextProperty `protobuf:"bytes,1,opt,name=property" json:"property,omitempty"` + // The bounding box for the word. + // The vertices are in the order of top-left, top-right, bottom-right, + // bottom-left. When a rotation of the bounding box is detected the rotation + // is represented as around the top-left corner as defined when the text is + // read in the 'natural' orientation. + // For example: + // * when the text is horizontal it might look like: + // 0----1 + // | | + // 3----2 + // * when it's rotated 180 degrees around the top-left corner it becomes: + // 2----3 + // | | + // 1----0 + // and the vertice order will still be (0, 1, 2, 3). + BoundingBox *BoundingPoly `protobuf:"bytes,2,opt,name=bounding_box,json=boundingBox" json:"bounding_box,omitempty"` + // List of symbols in the word. + // The order of the symbols follows the natural reading order. + Symbols []*Symbol `protobuf:"bytes,3,rep,name=symbols" json:"symbols,omitempty"` + // Confidence of the OCR results for the word. Range [0, 1]. + Confidence float32 `protobuf:"fixed32,4,opt,name=confidence" json:"confidence,omitempty"` +} + +func (m *Word) Reset() { *m = Word{} } +func (m *Word) String() string { return proto.CompactTextString(m) } +func (*Word) ProtoMessage() {} +func (*Word) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{4} } + +func (m *Word) GetProperty() *TextAnnotation_TextProperty { + if m != nil { + return m.Property + } + return nil +} + +func (m *Word) GetBoundingBox() *BoundingPoly { + if m != nil { + return m.BoundingBox + } + return nil +} + +func (m *Word) GetSymbols() []*Symbol { + if m != nil { + return m.Symbols + } + return nil +} + +func (m *Word) GetConfidence() float32 { + if m != nil { + return m.Confidence + } + return 0 +} + +// A single symbol representation. +type Symbol struct { + // Additional information detected for the symbol. + Property *TextAnnotation_TextProperty `protobuf:"bytes,1,opt,name=property" json:"property,omitempty"` + // The bounding box for the symbol. + // The vertices are in the order of top-left, top-right, bottom-right, + // bottom-left. When a rotation of the bounding box is detected the rotation + // is represented as around the top-left corner as defined when the text is + // read in the 'natural' orientation. + // For example: + // * when the text is horizontal it might look like: + // 0----1 + // | | + // 3----2 + // * when it's rotated 180 degrees around the top-left corner it becomes: + // 2----3 + // | | + // 1----0 + // and the vertice order will still be (0, 1, 2, 3). + BoundingBox *BoundingPoly `protobuf:"bytes,2,opt,name=bounding_box,json=boundingBox" json:"bounding_box,omitempty"` + // The actual UTF-8 representation of the symbol. + Text string `protobuf:"bytes,3,opt,name=text" json:"text,omitempty"` + // Confidence of the OCR results for the symbol. Range [0, 1]. + Confidence float32 `protobuf:"fixed32,4,opt,name=confidence" json:"confidence,omitempty"` +} + +func (m *Symbol) Reset() { *m = Symbol{} } +func (m *Symbol) String() string { return proto.CompactTextString(m) } +func (*Symbol) ProtoMessage() {} +func (*Symbol) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{5} } + +func (m *Symbol) GetProperty() *TextAnnotation_TextProperty { + if m != nil { + return m.Property + } + return nil +} + +func (m *Symbol) GetBoundingBox() *BoundingPoly { + if m != nil { + return m.BoundingBox + } + return nil +} + +func (m *Symbol) GetText() string { + if m != nil { + return m.Text + } + return "" +} + +func (m *Symbol) GetConfidence() float32 { + if m != nil { + return m.Confidence + } + return 0 +} + +func init() { + proto.RegisterType((*TextAnnotation)(nil), "google.cloud.vision.v1p1beta1.TextAnnotation") + proto.RegisterType((*TextAnnotation_DetectedLanguage)(nil), "google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage") + proto.RegisterType((*TextAnnotation_DetectedBreak)(nil), "google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak") + proto.RegisterType((*TextAnnotation_TextProperty)(nil), "google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty") + proto.RegisterType((*Page)(nil), "google.cloud.vision.v1p1beta1.Page") + proto.RegisterType((*Block)(nil), "google.cloud.vision.v1p1beta1.Block") + proto.RegisterType((*Paragraph)(nil), "google.cloud.vision.v1p1beta1.Paragraph") + proto.RegisterType((*Word)(nil), "google.cloud.vision.v1p1beta1.Word") + proto.RegisterType((*Symbol)(nil), "google.cloud.vision.v1p1beta1.Symbol") + proto.RegisterEnum("google.cloud.vision.v1p1beta1.TextAnnotation_DetectedBreak_BreakType", TextAnnotation_DetectedBreak_BreakType_name, TextAnnotation_DetectedBreak_BreakType_value) + proto.RegisterEnum("google.cloud.vision.v1p1beta1.Block_BlockType", Block_BlockType_name, Block_BlockType_value) +} + +func init() { + proto.RegisterFile("google/cloud/vision/v1p1beta1/text_annotation.proto", fileDescriptor2) +} + +var fileDescriptor2 = []byte{ + // 775 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x56, 0x4f, 0x6f, 0xd3, 0x48, + 0x14, 0x5f, 0x27, 0x76, 0x1a, 0xbf, 0xb4, 0x91, 0x77, 0x76, 0xb5, 0x8a, 0xb2, 0xbb, 0xa8, 0xa4, + 0x20, 0x55, 0x02, 0x39, 0x6a, 0x7a, 0x2a, 0x45, 0xa0, 0x38, 0xb5, 0xd4, 0xaa, 0x21, 0xb5, 0xa6, + 0x09, 0xa5, 0x5c, 0x2c, 0xff, 0x99, 0x3a, 0x56, 0x13, 0x8f, 0x65, 0xbb, 0x6d, 0x72, 0xe5, 0x8a, + 0x04, 0x5f, 0x88, 0x2f, 0x83, 0xc4, 0x09, 0xf1, 0x01, 0x38, 0x22, 0x8f, 0xed, 0x34, 0x09, 0xa2, + 0xe6, 0x8f, 0x38, 0xf4, 0x12, 0xcd, 0x7b, 0x79, 0xbf, 0x37, 0xef, 0xf7, 0x7b, 0xf3, 0x3c, 0x03, + 0xdb, 0x0e, 0xa5, 0xce, 0x88, 0x34, 0xad, 0x11, 0xbd, 0xb0, 0x9b, 0x97, 0x6e, 0xe8, 0x52, 0xaf, + 0x79, 0xb9, 0xe5, 0x6f, 0x99, 0x24, 0x32, 0xb6, 0x9a, 0x11, 0x99, 0x44, 0xba, 0xe1, 0x79, 0x34, + 0x32, 0x22, 0x97, 0x7a, 0xb2, 0x1f, 0xd0, 0x88, 0xa2, 0xff, 0x13, 0x90, 0xcc, 0x40, 0x72, 0x02, + 0x92, 0x67, 0xa0, 0xfa, 0x7f, 0x69, 0x4e, 0xc3, 0x77, 0x9b, 0xd7, 0xd8, 0x30, 0x01, 0xd7, 0x1f, + 0xde, 0xbc, 0xa3, 0x43, 0xe8, 0x98, 0x44, 0xc1, 0x34, 0x89, 0x6e, 0xbc, 0x16, 0xa0, 0xda, 0x27, + 0x93, 0xa8, 0x3d, 0xcb, 0x83, 0x76, 0x40, 0xf0, 0x0d, 0x87, 0x84, 0x35, 0x6e, 0xbd, 0xb8, 0x59, + 0x69, 0x6d, 0xc8, 0x37, 0x56, 0x23, 0x6b, 0x86, 0x43, 0x70, 0x82, 0x40, 0x08, 0xf8, 0x98, 0x51, + 0xad, 0xb0, 0xce, 0x6d, 0x8a, 0x98, 0xad, 0xeb, 0x27, 0x20, 0xed, 0x91, 0x88, 0x58, 0x11, 0xb1, + 0xbb, 0x86, 0xe7, 0x5c, 0x18, 0x0e, 0x41, 0x1b, 0xb0, 0x36, 0x4a, 0xd7, 0xba, 0x45, 0x6d, 0x52, + 0xe3, 0x18, 0x60, 0x35, 0x73, 0x76, 0xa8, 0x4d, 0xd0, 0x1d, 0x00, 0x8b, 0x7a, 0x67, 0xae, 0x4d, + 0x3c, 0x8b, 0xb0, 0x94, 0x05, 0x3c, 0xe7, 0xa9, 0x7f, 0xe2, 0x60, 0x2d, 0xcb, 0xac, 0x04, 0xc4, + 0x38, 0x47, 0xa7, 0xc0, 0x47, 0x53, 0x3f, 0xc9, 0x56, 0x6d, 0xa9, 0x39, 0x85, 0x2f, 0xd2, 0x96, + 0x17, 0x52, 0xc9, 0xec, 0xb7, 0x3f, 0xf5, 0x09, 0x66, 0x29, 0xd1, 0xbf, 0x20, 0xba, 0xa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38, 0xfe, 0xd6, 0x68, + 0xf1, 0x14, 0x56, 0xc2, 0xe9, 0xd8, 0xa4, 0xa3, 0x4c, 0x8d, 0xfb, 0x39, 0xa9, 0x8e, 0x59, 0x34, + 0xce, 0x50, 0xb9, 0x8a, 0x7c, 0xe0, 0xa0, 0x94, 0x60, 0x6e, 0x8d, 0x26, 0xd9, 0x0d, 0x5e, 0xbc, + 0xbe, 0xc1, 0xf3, 0x68, 0x2a, 0xaf, 0x38, 0xb8, 0x6b, 0xd1, 0xf1, 0xcd, 0x7b, 0x2a, 0x7f, 0x2d, + 0x12, 0xd2, 0xe2, 0xe7, 0x87, 0xc6, 0xbd, 0xec, 0xa4, 0x28, 0x87, 0xc6, 0x77, 0x98, 0x4c, 0x03, + 0xa7, 0xe9, 0x10, 0x8f, 0x3d, 0x4e, 0x9a, 0xc9, 0x5f, 0x86, 0xef, 0x86, 0xdf, 0x78, 0xcd, 0xec, + 0x26, 0x8e, 0xcf, 0x1c, 0x67, 0x96, 0x18, 0x64, 0xfb, 0x4b, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb1, + 0xa1, 0x02, 0xbb, 0x71, 0x09, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/vision/v1p1beta1/web_detection.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/vision/v1p1beta1/web_detection.pb.go new file mode 100644 index 0000000000..a66a485930 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/cloud/vision/v1p1beta1/web_detection.pb.go @@ -0,0 +1,277 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/cloud/vision/v1p1beta1/web_detection.proto + +package vision + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Relevant information for the image from the Internet. +type WebDetection struct { + // Deduced entities from similar images on the Internet. + WebEntities []*WebDetection_WebEntity `protobuf:"bytes,1,rep,name=web_entities,json=webEntities" json:"web_entities,omitempty"` + // Fully matching images from the Internet. + // Can include resized copies of the query image. + FullMatchingImages []*WebDetection_WebImage `protobuf:"bytes,2,rep,name=full_matching_images,json=fullMatchingImages" json:"full_matching_images,omitempty"` + // Partial matching images from the Internet. + // Those images are similar enough to share some key-point features. For + // example an original image will likely have partial matching for its crops. + PartialMatchingImages []*WebDetection_WebImage `protobuf:"bytes,3,rep,name=partial_matching_images,json=partialMatchingImages" json:"partial_matching_images,omitempty"` + // Web pages containing the matching images from the Internet. + PagesWithMatchingImages []*WebDetection_WebPage `protobuf:"bytes,4,rep,name=pages_with_matching_images,json=pagesWithMatchingImages" json:"pages_with_matching_images,omitempty"` + // The visually similar image results. + VisuallySimilarImages []*WebDetection_WebImage `protobuf:"bytes,6,rep,name=visually_similar_images,json=visuallySimilarImages" json:"visually_similar_images,omitempty"` + // Best guess text labels for the request image. + BestGuessLabels []*WebDetection_WebLabel `protobuf:"bytes,8,rep,name=best_guess_labels,json=bestGuessLabels" json:"best_guess_labels,omitempty"` +} + +func (m *WebDetection) Reset() { *m = WebDetection{} } +func (m *WebDetection) String() string { return proto.CompactTextString(m) } +func (*WebDetection) ProtoMessage() {} +func (*WebDetection) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} } + +func (m *WebDetection) GetWebEntities() []*WebDetection_WebEntity { + if m != nil { + return m.WebEntities + } + return nil +} + +func (m *WebDetection) GetFullMatchingImages() []*WebDetection_WebImage { + if m != nil { + return m.FullMatchingImages + } + return nil +} + +func (m *WebDetection) GetPartialMatchingImages() []*WebDetection_WebImage { + if m != nil { + return m.PartialMatchingImages + } + return nil +} + +func (m *WebDetection) GetPagesWithMatchingImages() []*WebDetection_WebPage { + if m != nil { + return m.PagesWithMatchingImages + } + return nil +} + +func (m *WebDetection) GetVisuallySimilarImages() []*WebDetection_WebImage { + if m != nil { + return m.VisuallySimilarImages + } + return nil +} + +func (m *WebDetection) GetBestGuessLabels() []*WebDetection_WebLabel { + if m != nil { + return m.BestGuessLabels + } + return nil +} + +// Entity deduced from similar images on the Internet. +type WebDetection_WebEntity struct { + // Opaque entity ID. + EntityId string `protobuf:"bytes,1,opt,name=entity_id,json=entityId" json:"entity_id,omitempty"` + // Overall relevancy score for the entity. + // Not normalized and not comparable across different image queries. + Score float32 `protobuf:"fixed32,2,opt,name=score" json:"score,omitempty"` + // Canonical description of the entity, in English. + Description string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` +} + +func (m *WebDetection_WebEntity) Reset() { *m = WebDetection_WebEntity{} } +func (m *WebDetection_WebEntity) String() string { return proto.CompactTextString(m) } +func (*WebDetection_WebEntity) ProtoMessage() {} +func (*WebDetection_WebEntity) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0, 0} } + +func (m *WebDetection_WebEntity) GetEntityId() string { + if m != nil { + return m.EntityId + } + return "" +} + +func (m *WebDetection_WebEntity) GetScore() float32 { + if m != nil { + return m.Score + } + return 0 +} + +func (m *WebDetection_WebEntity) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +// Metadata for online images. +type WebDetection_WebImage struct { + // The result image URL. + Url string `protobuf:"bytes,1,opt,name=url" json:"url,omitempty"` + // (Deprecated) Overall relevancy score for the image. + Score float32 `protobuf:"fixed32,2,opt,name=score" json:"score,omitempty"` +} + +func (m *WebDetection_WebImage) Reset() { *m = WebDetection_WebImage{} } +func (m *WebDetection_WebImage) String() string { return proto.CompactTextString(m) } +func (*WebDetection_WebImage) ProtoMessage() {} +func (*WebDetection_WebImage) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0, 1} } + +func (m *WebDetection_WebImage) GetUrl() string { + if m != nil { + return m.Url + } + return "" +} + +func (m *WebDetection_WebImage) GetScore() float32 { + if m != nil { + return m.Score + } + return 0 +} + +// Metadata for web pages. +type WebDetection_WebPage struct { + // The result web page URL. + Url string `protobuf:"bytes,1,opt,name=url" json:"url,omitempty"` + // (Deprecated) Overall relevancy score for the web page. + Score float32 `protobuf:"fixed32,2,opt,name=score" json:"score,omitempty"` + // Title for the web page, may contain HTML markups. + PageTitle string `protobuf:"bytes,3,opt,name=page_title,json=pageTitle" json:"page_title,omitempty"` + // Fully matching images on the page. + // Can include resized copies of the query image. + FullMatchingImages []*WebDetection_WebImage `protobuf:"bytes,4,rep,name=full_matching_images,json=fullMatchingImages" json:"full_matching_images,omitempty"` + // Partial matching images on the page. + // Those images are similar enough to share some key-point features. For + // example an original image will likely have partial matching for its + // crops. + PartialMatchingImages []*WebDetection_WebImage `protobuf:"bytes,5,rep,name=partial_matching_images,json=partialMatchingImages" json:"partial_matching_images,omitempty"` +} + +func (m *WebDetection_WebPage) Reset() { *m = WebDetection_WebPage{} } +func (m *WebDetection_WebPage) String() string { return proto.CompactTextString(m) } +func (*WebDetection_WebPage) ProtoMessage() {} +func (*WebDetection_WebPage) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0, 2} } + +func (m *WebDetection_WebPage) GetUrl() string { + if m != nil { + return m.Url + } + return "" +} + +func (m *WebDetection_WebPage) GetScore() float32 { + if m != nil { + return m.Score + } + return 0 +} + +func (m *WebDetection_WebPage) GetPageTitle() string { + if m != nil { + return m.PageTitle + } + return "" +} + +func (m *WebDetection_WebPage) GetFullMatchingImages() []*WebDetection_WebImage { + if m != nil { + return m.FullMatchingImages + } + return nil +} + +func (m *WebDetection_WebPage) GetPartialMatchingImages() []*WebDetection_WebImage { + if m != nil { + return m.PartialMatchingImages + } + return nil +} + +// Label to provide extra metadata for the web detection. +type WebDetection_WebLabel struct { + // Label for extra metadata. + Label string `protobuf:"bytes,1,opt,name=label" json:"label,omitempty"` + // The BCP-47 language code for `label`, such as "en-US" or "sr-Latn". + // For more information, see + // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + LanguageCode string `protobuf:"bytes,2,opt,name=language_code,json=languageCode" json:"language_code,omitempty"` +} + +func (m *WebDetection_WebLabel) Reset() { *m = WebDetection_WebLabel{} } +func (m *WebDetection_WebLabel) String() string { return proto.CompactTextString(m) } +func (*WebDetection_WebLabel) ProtoMessage() {} +func (*WebDetection_WebLabel) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0, 3} } + +func (m *WebDetection_WebLabel) GetLabel() string { + if m != nil { + return m.Label + } + return "" +} + +func (m *WebDetection_WebLabel) GetLanguageCode() string { + if m != nil { + return m.LanguageCode + } + return "" +} + +func init() { + proto.RegisterType((*WebDetection)(nil), "google.cloud.vision.v1p1beta1.WebDetection") + proto.RegisterType((*WebDetection_WebEntity)(nil), "google.cloud.vision.v1p1beta1.WebDetection.WebEntity") + proto.RegisterType((*WebDetection_WebImage)(nil), "google.cloud.vision.v1p1beta1.WebDetection.WebImage") + proto.RegisterType((*WebDetection_WebPage)(nil), "google.cloud.vision.v1p1beta1.WebDetection.WebPage") + proto.RegisterType((*WebDetection_WebLabel)(nil), "google.cloud.vision.v1p1beta1.WebDetection.WebLabel") +} + +func init() { proto.RegisterFile("google/cloud/vision/v1p1beta1/web_detection.proto", fileDescriptor3) } + +var fileDescriptor3 = []byte{ + // 511 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x94, 0x4f, 0x6f, 0xd3, 0x30, + 0x18, 0xc6, 0x95, 0x76, 0x1b, 0x8b, 0x5b, 0x04, 0xb3, 0x86, 0x16, 0x05, 0x26, 0x15, 0xb8, 0xf4, + 0x94, 0xa8, 0x1b, 0x9c, 0xb8, 0x6d, 0x4c, 0x68, 0x12, 0x48, 0x55, 0x40, 0x1a, 0xe2, 0x92, 0x39, + 0x89, 0x97, 0xbe, 0x92, 0x1b, 0x47, 0xb1, 0xd3, 0xaa, 0x37, 0x4e, 0x7c, 0x14, 0x3e, 0x23, 0x47, + 0xf4, 0xda, 0xce, 0x54, 0x51, 0x36, 0x31, 0x86, 0xb8, 0xf9, 0x7d, 0xac, 0xe7, 0xf9, 0xd9, 0xaf, + 0xff,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x0b, 0x7e, 0xf2, + 0xd5, 0x23, 0xcf, 0x73, 0x39, 0xbf, 0x7d, 0x65, 0x27, 0x7b, 0xeb, 0x4b, 0x9b, 0xe2, 0x0f, 0x36, + 0xf5, 0xbe, 0x9c, 0x3a, 0x4f, 0x29, 0x31, 0x31, 0x92, 0x4d, 0x19, 0x97, 0xbc, 0x32, 0xff, 0x5b, + 0x6c, 0xa7, 0x58, 0x0d, 0xea, 0x86, 0x2f, 0xf5, 0x8d, 0x15, 0x7e, 0x78, 0x5e, 0xb6, 0x63, 0x2c, + 0xc7, 0x3f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xa2, 0x19, 0xa7, 0x1d, 0x84, 0x05, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/container/v1/cluster_service.pb.go b/vendor/google.golang.org/genproto/googleapis/container/v1/cluster_service.pb.go new file mode 100644 index 0000000000..15da6ae84b --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/container/v1/cluster_service.pb.go @@ -0,0 +1,5085 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/container/v1/cluster_service.proto + +/* +Package container is a generated protocol buffer package. + +It is generated from these files: + google/container/v1/cluster_service.proto + +It has these top-level messages: + NodeConfig + MasterAuth + ClientCertificateConfig + AddonsConfig + HttpLoadBalancing + HorizontalPodAutoscaling + KubernetesDashboard + NetworkPolicyConfig + MasterAuthorizedNetworksConfig + LegacyAbac + NetworkPolicy + IPAllocationPolicy + Cluster + ClusterUpdate + Operation + CreateClusterRequest + GetClusterRequest + UpdateClusterRequest + UpdateNodePoolRequest + SetNodePoolAutoscalingRequest + SetLoggingServiceRequest + SetMonitoringServiceRequest + SetAddonsConfigRequest + SetLocationsRequest + UpdateMasterRequest + SetMasterAuthRequest + DeleteClusterRequest + ListClustersRequest + ListClustersResponse + GetOperationRequest + ListOperationsRequest + CancelOperationRequest + ListOperationsResponse + GetServerConfigRequest + ServerConfig + CreateNodePoolRequest + DeleteNodePoolRequest + ListNodePoolsRequest + GetNodePoolRequest + NodePool + NodeManagement + AutoUpgradeOptions + MaintenancePolicy + MaintenanceWindow + DailyMaintenanceWindow + SetNodePoolManagementRequest + SetNodePoolSizeRequest + RollbackNodePoolUpgradeRequest + ListNodePoolsResponse + NodePoolAutoscaling + SetLabelsRequest + SetLegacyAbacRequest + StartIPRotationRequest + CompleteIPRotationRequest + AcceleratorConfig + SetNetworkPolicyRequest + SetMaintenancePolicyRequest +*/ +package container + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf1 "github.com/golang/protobuf/ptypes/empty" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Allowed Network Policy providers. +type NetworkPolicy_Provider int32 + +const ( + // Not set + NetworkPolicy_PROVIDER_UNSPECIFIED NetworkPolicy_Provider = 0 + // Tigera (Calico Felix). + NetworkPolicy_CALICO NetworkPolicy_Provider = 1 +) + +var NetworkPolicy_Provider_name = map[int32]string{ + 0: "PROVIDER_UNSPECIFIED", + 1: "CALICO", +} +var NetworkPolicy_Provider_value = map[string]int32{ + "PROVIDER_UNSPECIFIED": 0, + "CALICO": 1, +} + +func (x NetworkPolicy_Provider) String() string { + return proto.EnumName(NetworkPolicy_Provider_name, int32(x)) +} +func (NetworkPolicy_Provider) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{10, 0} } + +// The current status of the cluster. +type Cluster_Status int32 + +const ( + // Not set. + Cluster_STATUS_UNSPECIFIED Cluster_Status = 0 + // The PROVISIONING state indicates the cluster is being created. + Cluster_PROVISIONING Cluster_Status = 1 + // The RUNNING state indicates the cluster has been created and is fully + // usable. + Cluster_RUNNING Cluster_Status = 2 + // The RECONCILING state indicates that some work is actively being done on + // the cluster, such as upgrading the master or node software. Details can + // be found in the `statusMessage` field. + Cluster_RECONCILING Cluster_Status = 3 + // The STOPPING state indicates the cluster is being deleted. + Cluster_STOPPING Cluster_Status = 4 + // The ERROR state indicates the cluster may be unusable. Details + // can be found in the `statusMessage` field. + Cluster_ERROR Cluster_Status = 5 +) + +var Cluster_Status_name = map[int32]string{ + 0: "STATUS_UNSPECIFIED", + 1: "PROVISIONING", + 2: "RUNNING", + 3: "RECONCILING", + 4: "STOPPING", + 5: "ERROR", +} +var Cluster_Status_value = map[string]int32{ + "STATUS_UNSPECIFIED": 0, + "PROVISIONING": 1, + "RUNNING": 2, + "RECONCILING": 3, + "STOPPING": 4, + "ERROR": 5, +} + +func (x Cluster_Status) String() string { + return proto.EnumName(Cluster_Status_name, int32(x)) +} +func (Cluster_Status) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{12, 0} } + +// Current status of the operation. +type Operation_Status int32 + +const ( + // Not set. + Operation_STATUS_UNSPECIFIED Operation_Status = 0 + // The operation has been created. + Operation_PENDING Operation_Status = 1 + // The operation is currently running. + Operation_RUNNING Operation_Status = 2 + // The operation is done, either cancelled or completed. + Operation_DONE Operation_Status = 3 + // The operation is aborting. + Operation_ABORTING Operation_Status = 4 +) + +var Operation_Status_name = map[int32]string{ + 0: "STATUS_UNSPECIFIED", + 1: "PENDING", + 2: "RUNNING", + 3: "DONE", + 4: "ABORTING", +} +var Operation_Status_value = map[string]int32{ + "STATUS_UNSPECIFIED": 0, + "PENDING": 1, + "RUNNING": 2, + "DONE": 3, + "ABORTING": 4, +} + +func (x Operation_Status) String() string { + return proto.EnumName(Operation_Status_name, int32(x)) +} +func (Operation_Status) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{14, 0} } + +// Operation type. +type Operation_Type int32 + +const ( + // Not set. + Operation_TYPE_UNSPECIFIED Operation_Type = 0 + // Cluster create. + Operation_CREATE_CLUSTER Operation_Type = 1 + // Cluster delete. + Operation_DELETE_CLUSTER Operation_Type = 2 + // A master upgrade. + Operation_UPGRADE_MASTER Operation_Type = 3 + // A node upgrade. + Operation_UPGRADE_NODES Operation_Type = 4 + // Cluster repair. + Operation_REPAIR_CLUSTER Operation_Type = 5 + // Cluster update. + Operation_UPDATE_CLUSTER Operation_Type = 6 + // Node pool create. + Operation_CREATE_NODE_POOL Operation_Type = 7 + // Node pool delete. + Operation_DELETE_NODE_POOL Operation_Type = 8 + // Set node pool management. + Operation_SET_NODE_POOL_MANAGEMENT Operation_Type = 9 + // Automatic node pool repair. + Operation_AUTO_REPAIR_NODES Operation_Type = 10 + // Automatic node upgrade. + Operation_AUTO_UPGRADE_NODES Operation_Type = 11 + // Set labels. + Operation_SET_LABELS Operation_Type = 12 + // Set/generate master auth materials + Operation_SET_MASTER_AUTH Operation_Type = 13 + // Set node pool size. + Operation_SET_NODE_POOL_SIZE Operation_Type = 14 + // Updates network policy for a cluster. + Operation_SET_NETWORK_POLICY Operation_Type = 15 + // Set the maintenance policy. + Operation_SET_MAINTENANCE_POLICY Operation_Type = 16 +) + +var Operation_Type_name = map[int32]string{ + 0: "TYPE_UNSPECIFIED", + 1: "CREATE_CLUSTER", + 2: "DELETE_CLUSTER", + 3: "UPGRADE_MASTER", + 4: "UPGRADE_NODES", + 5: "REPAIR_CLUSTER", + 6: "UPDATE_CLUSTER", + 7: "CREATE_NODE_POOL", + 8: "DELETE_NODE_POOL", + 9: "SET_NODE_POOL_MANAGEMENT", + 10: "AUTO_REPAIR_NODES", + 11: "AUTO_UPGRADE_NODES", + 12: "SET_LABELS", + 13: "SET_MASTER_AUTH", + 14: "SET_NODE_POOL_SIZE", + 15: "SET_NETWORK_POLICY", + 16: "SET_MAINTENANCE_POLICY", +} +var Operation_Type_value = map[string]int32{ + "TYPE_UNSPECIFIED": 0, + "CREATE_CLUSTER": 1, + "DELETE_CLUSTER": 2, + "UPGRADE_MASTER": 3, + "UPGRADE_NODES": 4, + "REPAIR_CLUSTER": 5, + "UPDATE_CLUSTER": 6, + "CREATE_NODE_POOL": 7, + "DELETE_NODE_POOL": 8, + "SET_NODE_POOL_MANAGEMENT": 9, + "AUTO_REPAIR_NODES": 10, + "AUTO_UPGRADE_NODES": 11, + "SET_LABELS": 12, + "SET_MASTER_AUTH": 13, + "SET_NODE_POOL_SIZE": 14, + "SET_NETWORK_POLICY": 15, + "SET_MAINTENANCE_POLICY": 16, +} + +func (x Operation_Type) String() string { + return proto.EnumName(Operation_Type_name, int32(x)) +} +func (Operation_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{14, 1} } + +// Operation type: what type update to perform. +type SetMasterAuthRequest_Action int32 + +const ( + // Operation is unknown and will error out. + SetMasterAuthRequest_UNKNOWN SetMasterAuthRequest_Action = 0 + // Set the password to a user generated value. + SetMasterAuthRequest_SET_PASSWORD SetMasterAuthRequest_Action = 1 + // Generate a new password and set it to that. + SetMasterAuthRequest_GENERATE_PASSWORD SetMasterAuthRequest_Action = 2 + // Set the username. If an empty username is provided, basic authentication + // is disabled for the cluster. If a non-empty username is provided, basic + // authentication is enabled, with either a provided password or a generated + // one. + SetMasterAuthRequest_SET_USERNAME SetMasterAuthRequest_Action = 3 +) + +var SetMasterAuthRequest_Action_name = map[int32]string{ + 0: "UNKNOWN", + 1: "SET_PASSWORD", + 2: "GENERATE_PASSWORD", + 3: "SET_USERNAME", +} +var SetMasterAuthRequest_Action_value = map[string]int32{ + "UNKNOWN": 0, + "SET_PASSWORD": 1, + "GENERATE_PASSWORD": 2, + "SET_USERNAME": 3, +} + +func (x SetMasterAuthRequest_Action) String() string { + return proto.EnumName(SetMasterAuthRequest_Action_name, int32(x)) +} +func (SetMasterAuthRequest_Action) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{25, 0} +} + +// The current status of the node pool instance. +type NodePool_Status int32 + +const ( + // Not set. + NodePool_STATUS_UNSPECIFIED NodePool_Status = 0 + // The PROVISIONING state indicates the node pool is being created. + NodePool_PROVISIONING NodePool_Status = 1 + // The RUNNING state indicates the node pool has been created + // and is fully usable. + NodePool_RUNNING NodePool_Status = 2 + // The RUNNING_WITH_ERROR state indicates the node pool has been created + // and is partially usable. Some error state has occurred and some + // functionality may be impaired. Customer may need to reissue a request + // or trigger a new update. + NodePool_RUNNING_WITH_ERROR NodePool_Status = 3 + // The RECONCILING state indicates that some work is actively being done on + // the node pool, such as upgrading node software. Details can + // be found in the `statusMessage` field. + NodePool_RECONCILING NodePool_Status = 4 + // The STOPPING state indicates the node pool is being deleted. + NodePool_STOPPING NodePool_Status = 5 + // The ERROR state indicates the node pool may be unusable. Details + // can be found in the `statusMessage` field. + NodePool_ERROR NodePool_Status = 6 +) + +var NodePool_Status_name = map[int32]string{ + 0: "STATUS_UNSPECIFIED", + 1: "PROVISIONING", + 2: "RUNNING", + 3: "RUNNING_WITH_ERROR", + 4: "RECONCILING", + 5: "STOPPING", + 6: "ERROR", +} +var NodePool_Status_value = map[string]int32{ + "STATUS_UNSPECIFIED": 0, + "PROVISIONING": 1, + "RUNNING": 2, + "RUNNING_WITH_ERROR": 3, + "RECONCILING": 4, + "STOPPING": 5, + "ERROR": 6, +} + +func (x NodePool_Status) String() string { + return proto.EnumName(NodePool_Status_name, int32(x)) +} +func (NodePool_Status) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{39, 0} } + +// Parameters that describe the nodes in a cluster. +type NodeConfig struct { + // The name of a Google Compute Engine [machine + // type](/compute/docs/machine-types) (e.g. + // `n1-standard-1`). + // + // If unspecified, the default machine type is + // `n1-standard-1`. + MachineType string `protobuf:"bytes,1,opt,name=machine_type,json=machineType" json:"machine_type,omitempty"` + // Size of the disk attached to each node, specified in GB. + // The smallest allowed disk size is 10GB. + // + // If unspecified, the default disk size is 100GB. + DiskSizeGb int32 `protobuf:"varint,2,opt,name=disk_size_gb,json=diskSizeGb" json:"disk_size_gb,omitempty"` + // The set of Google API scopes to be made available on all of the + // node VMs under the "default" service account. + // + // The following scopes are recommended, but not required, and by default are + // not included: + // + // * `https://www.googleapis.com/auth/compute` is required for mounting + // persistent storage on your nodes. + // * `https://www.googleapis.com/auth/devstorage.read_only` is required for + // communicating with **gcr.io** + // (the [Google Container Registry](/container-registry/)). + // + // If unspecified, no scopes are added, unless Cloud Logging or Cloud + // Monitoring are enabled, in which case their required scopes will be added. + OauthScopes []string `protobuf:"bytes,3,rep,name=oauth_scopes,json=oauthScopes" json:"oauth_scopes,omitempty"` + // The Google Cloud Platform Service Account to be used by the node VMs. If + // no Service Account is specified, the "default" service account is used. + ServiceAccount string `protobuf:"bytes,9,opt,name=service_account,json=serviceAccount" json:"service_account,omitempty"` + // The metadata key/value pairs assigned to instances in the cluster. + // + // Keys must conform to the regexp [a-zA-Z0-9-_]+ and be less than 128 bytes + // in length. These are reflected as part of a URL in the metadata server. + // Additionally, to avoid ambiguity, keys must not conflict with any other + // metadata keys for the project or be one of the four reserved keys: + // "instance-template", "kube-env", "startup-script", and "user-data" + // + // Values are free-form strings, and only have meaning as interpreted by + // the image running in the instance. The only restriction placed on them is + // that each value's size must be less than or equal to 32 KB. + // + // The total size of all keys and values must be less than 512 KB. + Metadata map[string]string `protobuf:"bytes,4,rep,name=metadata" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // The image type to use for this node. Note that for a given image type, + // the latest version of it will be used. + ImageType string `protobuf:"bytes,5,opt,name=image_type,json=imageType" json:"image_type,omitempty"` + // The map of Kubernetes labels (key/value pairs) to be applied to each node. + // These will added in addition to any default label(s) that + // Kubernetes may apply to the node. + // In case of conflict in label keys, the applied set may differ depending on + // the Kubernetes version -- it's best to assume the behavior is undefined + // and conflicts should be avoided. + // For more information, including usage and the valid values, see: + // https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + Labels map[string]string `protobuf:"bytes,6,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // The number of local SSD disks to be attached to the node. + // + // The limit for this value is dependant upon the maximum number of + // disks available on a machine per zone. See: + // https://cloud.google.com/compute/docs/disks/local-ssd#local_ssd_limits + // for more information. + LocalSsdCount int32 `protobuf:"varint,7,opt,name=local_ssd_count,json=localSsdCount" json:"local_ssd_count,omitempty"` + // The list of instance tags applied to all nodes. Tags are used to identify + // valid sources or targets for network firewalls and are specified by + // the client during cluster or node pool creation. Each tag within the list + // must comply with RFC1035. + Tags []string `protobuf:"bytes,8,rep,name=tags" json:"tags,omitempty"` + // Whether the nodes are created as preemptible VM instances. See: + // https://cloud.google.com/compute/docs/instances/preemptible for more + // information about preemptible VM instances. + Preemptible bool `protobuf:"varint,10,opt,name=preemptible" json:"preemptible,omitempty"` + // A list of hardware accelerators to be attached to each node. + // See https://cloud.google.com/compute/docs/gpus for more information about + // support for GPUs. + Accelerators []*AcceleratorConfig `protobuf:"bytes,11,rep,name=accelerators" json:"accelerators,omitempty"` + // Minimum CPU platform to be used by this instance. The instance may be + // scheduled on the specified or newer CPU platform. Applicable values are the + // friendly names of CPU platforms, such as + // minCpuPlatform: "Intel Haswell" or + // minCpuPlatform: "Intel Sandy Bridge". For more + // information, read [how to specify min CPU platform](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform) + MinCpuPlatform string `protobuf:"bytes,13,opt,name=min_cpu_platform,json=minCpuPlatform" json:"min_cpu_platform,omitempty"` +} + +func (m *NodeConfig) Reset() { *m = NodeConfig{} } +func (m *NodeConfig) String() string { return proto.CompactTextString(m) } +func (*NodeConfig) ProtoMessage() {} +func (*NodeConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *NodeConfig) GetMachineType() string { + if m != nil { + return m.MachineType + } + return "" +} + +func (m *NodeConfig) GetDiskSizeGb() int32 { + if m != nil { + return m.DiskSizeGb + } + return 0 +} + +func (m *NodeConfig) GetOauthScopes() []string { + if m != nil { + return m.OauthScopes + } + return nil +} + +func (m *NodeConfig) GetServiceAccount() string { + if m != nil { + return m.ServiceAccount + } + return "" +} + +func (m *NodeConfig) GetMetadata() map[string]string { + if m != nil { + return m.Metadata + } + return nil +} + +func (m *NodeConfig) GetImageType() string { + if m != nil { + return m.ImageType + } + return "" +} + +func (m *NodeConfig) GetLabels() map[string]string { + if m != nil { + return m.Labels + } + return nil +} + +func (m *NodeConfig) GetLocalSsdCount() int32 { + if m != nil { + return m.LocalSsdCount + } + return 0 +} + +func (m *NodeConfig) GetTags() []string { + if m != nil { + return m.Tags + } + return nil +} + +func (m *NodeConfig) GetPreemptible() bool { + if m != nil { + return m.Preemptible + } + return false +} + +func (m *NodeConfig) GetAccelerators() []*AcceleratorConfig { + if m != nil { + return m.Accelerators + } + return nil +} + +func (m *NodeConfig) GetMinCpuPlatform() string { + if m != nil { + return m.MinCpuPlatform + } + return "" +} + +// The authentication information for accessing the master endpoint. +// Authentication can be done using HTTP basic auth or using client +// certificates. +type MasterAuth struct { + // The username to use for HTTP basic authentication to the master endpoint. + // For clusters v1.6.0 and later, you can disable basic authentication by + // providing an empty username. + Username string `protobuf:"bytes,1,opt,name=username" json:"username,omitempty"` + // The password to use for HTTP basic authentication to the master endpoint. + // Because the master endpoint is open to the Internet, you should create a + // strong password. If a password is provided for cluster creation, username + // must be non-empty. + Password string `protobuf:"bytes,2,opt,name=password" json:"password,omitempty"` + // Configuration for client certificate authentication on the cluster. If no + // configuration is specified, a client certificate is issued. + ClientCertificateConfig *ClientCertificateConfig `protobuf:"bytes,3,opt,name=client_certificate_config,json=clientCertificateConfig" json:"client_certificate_config,omitempty"` + // [Output only] Base64-encoded public certificate that is the root of + // trust for the cluster. + ClusterCaCertificate string `protobuf:"bytes,100,opt,name=cluster_ca_certificate,json=clusterCaCertificate" json:"cluster_ca_certificate,omitempty"` + // [Output only] Base64-encoded public certificate used by clients to + // authenticate to the cluster endpoint. + ClientCertificate string `protobuf:"bytes,101,opt,name=client_certificate,json=clientCertificate" json:"client_certificate,omitempty"` + // [Output only] Base64-encoded private key used by clients to authenticate + // to the cluster endpoint. + ClientKey string `protobuf:"bytes,102,opt,name=client_key,json=clientKey" json:"client_key,omitempty"` +} + +func (m *MasterAuth) Reset() { *m = MasterAuth{} } +func (m *MasterAuth) String() string { return proto.CompactTextString(m) } +func (*MasterAuth) ProtoMessage() {} +func (*MasterAuth) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *MasterAuth) GetUsername() string { + if m != nil { + return m.Username + } + return "" +} + +func (m *MasterAuth) GetPassword() string { + if m != nil { + return m.Password + } + return "" +} + +func (m *MasterAuth) GetClientCertificateConfig() *ClientCertificateConfig { + if m != nil { + return m.ClientCertificateConfig + } + return nil +} + +func (m *MasterAuth) GetClusterCaCertificate() string { + if m != nil { + return m.ClusterCaCertificate + } + return "" +} + +func (m *MasterAuth) GetClientCertificate() string { + if m != nil { + return m.ClientCertificate + } + return "" +} + +func (m *MasterAuth) GetClientKey() string { + if m != nil { + return m.ClientKey + } + return "" +} + +// Configuration for client certificates on the cluster. +type ClientCertificateConfig struct { + // Issue a client certificate. + IssueClientCertificate bool `protobuf:"varint,1,opt,name=issue_client_certificate,json=issueClientCertificate" json:"issue_client_certificate,omitempty"` +} + +func (m *ClientCertificateConfig) Reset() { *m = ClientCertificateConfig{} } +func (m *ClientCertificateConfig) String() string { return proto.CompactTextString(m) } +func (*ClientCertificateConfig) ProtoMessage() {} +func (*ClientCertificateConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *ClientCertificateConfig) GetIssueClientCertificate() bool { + if m != nil { + return m.IssueClientCertificate + } + return false +} + +// Configuration for the addons that can be automatically spun up in the +// cluster, enabling additional functionality. +type AddonsConfig struct { + // Configuration for the HTTP (L7) load balancing controller addon, which + // makes it easy to set up HTTP load balancers for services in a cluster. + HttpLoadBalancing *HttpLoadBalancing `protobuf:"bytes,1,opt,name=http_load_balancing,json=httpLoadBalancing" json:"http_load_balancing,omitempty"` + // Configuration for the horizontal pod autoscaling feature, which + // increases or decreases the number of replica pods a replication controller + // has based on the resource usage of the existing pods. + HorizontalPodAutoscaling *HorizontalPodAutoscaling `protobuf:"bytes,2,opt,name=horizontal_pod_autoscaling,json=horizontalPodAutoscaling" json:"horizontal_pod_autoscaling,omitempty"` + // Configuration for the Kubernetes Dashboard. + KubernetesDashboard *KubernetesDashboard `protobuf:"bytes,3,opt,name=kubernetes_dashboard,json=kubernetesDashboard" json:"kubernetes_dashboard,omitempty"` + // Configuration for NetworkPolicy. This only tracks whether the addon + // is enabled or not on the Master, it does not track whether network policy + // is enabled for the nodes. + NetworkPolicyConfig *NetworkPolicyConfig `protobuf:"bytes,4,opt,name=network_policy_config,json=networkPolicyConfig" json:"network_policy_config,omitempty"` +} + +func (m *AddonsConfig) Reset() { *m = AddonsConfig{} } +func (m *AddonsConfig) String() string { return proto.CompactTextString(m) } +func (*AddonsConfig) ProtoMessage() {} +func (*AddonsConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *AddonsConfig) GetHttpLoadBalancing() *HttpLoadBalancing { + if m != nil { + return m.HttpLoadBalancing + } + return nil +} + +func (m *AddonsConfig) GetHorizontalPodAutoscaling() *HorizontalPodAutoscaling { + if m != nil { + return m.HorizontalPodAutoscaling + } + return nil +} + +func (m *AddonsConfig) GetKubernetesDashboard() *KubernetesDashboard { + if m != nil { + return m.KubernetesDashboard + } + return nil +} + +func (m *AddonsConfig) GetNetworkPolicyConfig() *NetworkPolicyConfig { + if m != nil { + return m.NetworkPolicyConfig + } + return nil +} + +// Configuration options for the HTTP (L7) load balancing controller addon, +// which makes it easy to set up HTTP load balancers for services in a cluster. +type HttpLoadBalancing struct { + // Whether the HTTP Load Balancing controller is enabled in the cluster. + // When enabled, it runs a small pod in the cluster that manages the load + // balancers. + Disabled bool `protobuf:"varint,1,opt,name=disabled" json:"disabled,omitempty"` +} + +func (m *HttpLoadBalancing) Reset() { *m = HttpLoadBalancing{} } +func (m *HttpLoadBalancing) String() string { return proto.CompactTextString(m) } +func (*HttpLoadBalancing) ProtoMessage() {} +func (*HttpLoadBalancing) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *HttpLoadBalancing) GetDisabled() bool { + if m != nil { + return m.Disabled + } + return false +} + +// Configuration options for the horizontal pod autoscaling feature, which +// increases or decreases the number of replica pods a replication controller +// has based on the resource usage of the existing pods. +type HorizontalPodAutoscaling struct { + // Whether the Horizontal Pod Autoscaling feature is enabled in the cluster. + // When enabled, it ensures that a Heapster pod is running in the cluster, + // which is also used by the Cloud Monitoring service. + Disabled bool `protobuf:"varint,1,opt,name=disabled" json:"disabled,omitempty"` +} + +func (m *HorizontalPodAutoscaling) Reset() { *m = HorizontalPodAutoscaling{} } +func (m *HorizontalPodAutoscaling) String() string { return proto.CompactTextString(m) } +func (*HorizontalPodAutoscaling) ProtoMessage() {} +func (*HorizontalPodAutoscaling) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *HorizontalPodAutoscaling) GetDisabled() bool { + if m != nil { + return m.Disabled + } + return false +} + +// Configuration for the Kubernetes Dashboard. +type KubernetesDashboard struct { + // Whether the Kubernetes Dashboard is enabled for this cluster. + Disabled bool `protobuf:"varint,1,opt,name=disabled" json:"disabled,omitempty"` +} + +func (m *KubernetesDashboard) Reset() { *m = KubernetesDashboard{} } +func (m *KubernetesDashboard) String() string { return proto.CompactTextString(m) } +func (*KubernetesDashboard) ProtoMessage() {} +func (*KubernetesDashboard) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *KubernetesDashboard) GetDisabled() bool { + if m != nil { + return m.Disabled + } + return false +} + +// Configuration for NetworkPolicy. This only tracks whether the addon +// is enabled or not on the Master, it does not track whether network policy +// is enabled for the nodes. +type NetworkPolicyConfig struct { + // Whether NetworkPolicy is enabled for this cluster. + Disabled bool `protobuf:"varint,1,opt,name=disabled" json:"disabled,omitempty"` +} + +func (m *NetworkPolicyConfig) Reset() { *m = NetworkPolicyConfig{} } +func (m *NetworkPolicyConfig) String() string { return proto.CompactTextString(m) } +func (*NetworkPolicyConfig) ProtoMessage() {} +func (*NetworkPolicyConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *NetworkPolicyConfig) GetDisabled() bool { + if m != nil { + return m.Disabled + } + return false +} + +// Master authorized networks is a Beta feature. +// Configuration options for the master authorized networks feature. Enabled +// master authorized networks will disallow all external traffic to access +// Kubernetes master through HTTPS except traffic from the given CIDR blocks, +// Google Compute Engine Public IPs and Google Prod IPs. +type MasterAuthorizedNetworksConfig struct { + // Whether or not master authorized networks is enabled. + Enabled bool `protobuf:"varint,1,opt,name=enabled" json:"enabled,omitempty"` + // cidr_blocks define up to 10 external networks that could access + // Kubernetes master through HTTPS. + CidrBlocks []*MasterAuthorizedNetworksConfig_CidrBlock `protobuf:"bytes,2,rep,name=cidr_blocks,json=cidrBlocks" json:"cidr_blocks,omitempty"` +} + +func (m *MasterAuthorizedNetworksConfig) Reset() { *m = MasterAuthorizedNetworksConfig{} } +func (m *MasterAuthorizedNetworksConfig) String() string { return proto.CompactTextString(m) } +func (*MasterAuthorizedNetworksConfig) ProtoMessage() {} +func (*MasterAuthorizedNetworksConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *MasterAuthorizedNetworksConfig) GetEnabled() bool { + if m != nil { + return m.Enabled + } + return false +} + +func (m *MasterAuthorizedNetworksConfig) GetCidrBlocks() []*MasterAuthorizedNetworksConfig_CidrBlock { + if m != nil { + return m.CidrBlocks + } + return nil +} + +// CidrBlock contains an optional name and one CIDR block. +type MasterAuthorizedNetworksConfig_CidrBlock struct { + // display_name is an optional field for users to identify CIDR blocks. + DisplayName string `protobuf:"bytes,1,opt,name=display_name,json=displayName" json:"display_name,omitempty"` + // cidr_block must be specified in CIDR notation. + CidrBlock string `protobuf:"bytes,2,opt,name=cidr_block,json=cidrBlock" json:"cidr_block,omitempty"` +} + +func (m *MasterAuthorizedNetworksConfig_CidrBlock) Reset() { + *m = MasterAuthorizedNetworksConfig_CidrBlock{} +} +func (m *MasterAuthorizedNetworksConfig_CidrBlock) String() string { return proto.CompactTextString(m) } +func (*MasterAuthorizedNetworksConfig_CidrBlock) ProtoMessage() {} +func (*MasterAuthorizedNetworksConfig_CidrBlock) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{8, 0} +} + +func (m *MasterAuthorizedNetworksConfig_CidrBlock) GetDisplayName() string { + if m != nil { + return m.DisplayName + } + return "" +} + +func (m *MasterAuthorizedNetworksConfig_CidrBlock) GetCidrBlock() string { + if m != nil { + return m.CidrBlock + } + return "" +} + +// Configuration for the legacy Attribute Based Access Control authorization +// mode. +type LegacyAbac struct { + // Whether the ABAC authorizer is enabled for this cluster. When enabled, + // identities in the system, including service accounts, nodes, and + // controllers, will have statically granted permissions beyond those + // provided by the RBAC configuration or IAM. + Enabled bool `protobuf:"varint,1,opt,name=enabled" json:"enabled,omitempty"` +} + +func (m *LegacyAbac) Reset() { *m = LegacyAbac{} } +func (m *LegacyAbac) String() string { return proto.CompactTextString(m) } +func (*LegacyAbac) ProtoMessage() {} +func (*LegacyAbac) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *LegacyAbac) GetEnabled() bool { + if m != nil { + return m.Enabled + } + return false +} + +// Configuration options for the NetworkPolicy feature. +// https://kubernetes.io/docs/concepts/services-networking/networkpolicies/ +type NetworkPolicy struct { + // The selected network policy provider. + Provider NetworkPolicy_Provider `protobuf:"varint,1,opt,name=provider,enum=google.container.v1.NetworkPolicy_Provider" json:"provider,omitempty"` + // Whether network policy is enabled on the cluster. + Enabled bool `protobuf:"varint,2,opt,name=enabled" json:"enabled,omitempty"` +} + +func (m *NetworkPolicy) Reset() { *m = NetworkPolicy{} } +func (m *NetworkPolicy) String() string { return proto.CompactTextString(m) } +func (*NetworkPolicy) ProtoMessage() {} +func (*NetworkPolicy) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *NetworkPolicy) GetProvider() NetworkPolicy_Provider { + if m != nil { + return m.Provider + } + return NetworkPolicy_PROVIDER_UNSPECIFIED +} + +func (m *NetworkPolicy) GetEnabled() bool { + if m != nil { + return m.Enabled + } + return false +} + +// Configuration for controlling how IPs are allocated in the cluster. +type IPAllocationPolicy struct { + // Whether alias IPs will be used for pod IPs in the cluster. + UseIpAliases bool `protobuf:"varint,1,opt,name=use_ip_aliases,json=useIpAliases" json:"use_ip_aliases,omitempty"` + // Whether a new subnetwork will be created automatically for the cluster. + // + // This field is only applicable when `use_ip_aliases` is true. + CreateSubnetwork bool `protobuf:"varint,2,opt,name=create_subnetwork,json=createSubnetwork" json:"create_subnetwork,omitempty"` + // A custom subnetwork name to be used if `create_subnetwork` is true. If + // this field is empty, then an automatic name will be chosen for the new + // subnetwork. + SubnetworkName string `protobuf:"bytes,3,opt,name=subnetwork_name,json=subnetworkName" json:"subnetwork_name,omitempty"` + // This field is deprecated, use cluster_ipv4_cidr_block. + ClusterIpv4Cidr string `protobuf:"bytes,4,opt,name=cluster_ipv4_cidr,json=clusterIpv4Cidr" json:"cluster_ipv4_cidr,omitempty"` + // This field is deprecated, use node_ipv4_cidr_block. + NodeIpv4Cidr string `protobuf:"bytes,5,opt,name=node_ipv4_cidr,json=nodeIpv4Cidr" json:"node_ipv4_cidr,omitempty"` + // This field is deprecated, use services_ipv4_cidr_block. + ServicesIpv4Cidr string `protobuf:"bytes,6,opt,name=services_ipv4_cidr,json=servicesIpv4Cidr" json:"services_ipv4_cidr,omitempty"` + // The name of the secondary range to be used for the cluster CIDR + // block. The secondary range will be used for pod IP + // addresses. This must be an existing secondary range associated + // with the cluster subnetwork. + // + // This field is only applicable with use_ip_aliases is true and + // create_subnetwork is false. + ClusterSecondaryRangeName string `protobuf:"bytes,7,opt,name=cluster_secondary_range_name,json=clusterSecondaryRangeName" json:"cluster_secondary_range_name,omitempty"` + // The name of the secondary range to be used as for the services + // CIDR block. The secondary range will be used for service + // ClusterIPs. This must be an existing secondary range associated + // with the cluster subnetwork. + // + // This field is only applicable with use_ip_aliases is true and + // create_subnetwork is false. + ServicesSecondaryRangeName string `protobuf:"bytes,8,opt,name=services_secondary_range_name,json=servicesSecondaryRangeName" json:"services_secondary_range_name,omitempty"` + // The IP address range for the cluster pod IPs. If this field is set, then + // `cluster.cluster_ipv4_cidr` must be left blank. + // + // This field is only applicable when `use_ip_aliases` is true. + // + // Set to blank to have a range chosen with the default size. + // + // Set to /netmask (e.g. `/14`) to have a range chosen with a specific + // netmask. + // + // Set to a + // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. + // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range + // to use. + ClusterIpv4CidrBlock string `protobuf:"bytes,9,opt,name=cluster_ipv4_cidr_block,json=clusterIpv4CidrBlock" json:"cluster_ipv4_cidr_block,omitempty"` + // The IP address range of the instance IPs in this cluster. + // + // This is applicable only if `create_subnetwork` is true. + // + // Set to blank to have a range chosen with the default size. + // + // Set to /netmask (e.g. `/14`) to have a range chosen with a specific + // netmask. + // + // Set to a + // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. + // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range + // to use. + NodeIpv4CidrBlock string `protobuf:"bytes,10,opt,name=node_ipv4_cidr_block,json=nodeIpv4CidrBlock" json:"node_ipv4_cidr_block,omitempty"` + // The IP address range of the services IPs in this cluster. If blank, a range + // will be automatically chosen with the default size. + // + // This field is only applicable when `use_ip_aliases` is true. + // + // Set to blank to have a range chosen with the default size. + // + // Set to /netmask (e.g. `/14`) to have a range chosen with a specific + // netmask. + // + // Set to a + // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. + // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range + // to use. + ServicesIpv4CidrBlock string `protobuf:"bytes,11,opt,name=services_ipv4_cidr_block,json=servicesIpv4CidrBlock" json:"services_ipv4_cidr_block,omitempty"` +} + +func (m *IPAllocationPolicy) Reset() { *m = IPAllocationPolicy{} } +func (m *IPAllocationPolicy) String() string { return proto.CompactTextString(m) } +func (*IPAllocationPolicy) ProtoMessage() {} +func (*IPAllocationPolicy) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } + +func (m *IPAllocationPolicy) GetUseIpAliases() bool { + if m != nil { + return m.UseIpAliases + } + return false +} + +func (m *IPAllocationPolicy) GetCreateSubnetwork() bool { + if m != nil { + return m.CreateSubnetwork + } + return false +} + +func (m *IPAllocationPolicy) GetSubnetworkName() string { + if m != nil { + return m.SubnetworkName + } + return "" +} + +func (m *IPAllocationPolicy) GetClusterIpv4Cidr() string { + if m != nil { + return m.ClusterIpv4Cidr + } + return "" +} + +func (m *IPAllocationPolicy) GetNodeIpv4Cidr() string { + if m != nil { + return m.NodeIpv4Cidr + } + return "" +} + +func (m *IPAllocationPolicy) GetServicesIpv4Cidr() string { + if m != nil { + return m.ServicesIpv4Cidr + } + return "" +} + +func (m *IPAllocationPolicy) GetClusterSecondaryRangeName() string { + if m != nil { + return m.ClusterSecondaryRangeName + } + return "" +} + +func (m *IPAllocationPolicy) GetServicesSecondaryRangeName() string { + if m != nil { + return m.ServicesSecondaryRangeName + } + return "" +} + +func (m *IPAllocationPolicy) GetClusterIpv4CidrBlock() string { + if m != nil { + return m.ClusterIpv4CidrBlock + } + return "" +} + +func (m *IPAllocationPolicy) GetNodeIpv4CidrBlock() string { + if m != nil { + return m.NodeIpv4CidrBlock + } + return "" +} + +func (m *IPAllocationPolicy) GetServicesIpv4CidrBlock() string { + if m != nil { + return m.ServicesIpv4CidrBlock + } + return "" +} + +// A Google Container Engine cluster. +type Cluster struct { + // The name of this cluster. The name must be unique within this project + // and zone, and can be up to 40 characters with the following restrictions: + // + // * Lowercase letters, numbers, and hyphens only. + // * Must start with a letter. + // * Must end with a number or a letter. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // An optional description of this cluster. + Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` + // The number of nodes to create in this cluster. You must ensure that your + // Compute Engine resource quota + // is sufficient for this number of instances. You must also have available + // firewall and routes quota. + // For requests, this field should only be used in lieu of a + // "node_pool" object, since this configuration (along with the + // "node_config") will be used to create a "NodePool" object with an + // auto-generated name. Do not use this and a node_pool at the same time. + InitialNodeCount int32 `protobuf:"varint,3,opt,name=initial_node_count,json=initialNodeCount" json:"initial_node_count,omitempty"` + // Parameters used in creating the cluster's nodes. + // See `nodeConfig` for the description of its properties. + // For requests, this field should only be used in lieu of a + // "node_pool" object, since this configuration (along with the + // "initial_node_count") will be used to create a "NodePool" object with an + // auto-generated name. Do not use this and a node_pool at the same time. + // For responses, this field will be populated with the node configuration of + // the first node pool. + // + // If unspecified, the defaults are used. + NodeConfig *NodeConfig `protobuf:"bytes,4,opt,name=node_config,json=nodeConfig" json:"node_config,omitempty"` + // The authentication information for accessing the master endpoint. + MasterAuth *MasterAuth `protobuf:"bytes,5,opt,name=master_auth,json=masterAuth" json:"master_auth,omitempty"` + // The logging service the cluster should use to write logs. + // Currently available options: + // + // * `logging.googleapis.com` - the Google Cloud Logging service. + // * `none` - no logs will be exported from the cluster. + // * if left as an empty string,`logging.googleapis.com` will be used. + LoggingService string `protobuf:"bytes,6,opt,name=logging_service,json=loggingService" json:"logging_service,omitempty"` + // The monitoring service the cluster should use to write metrics. + // Currently available options: + // + // * `monitoring.googleapis.com` - the Google Cloud Monitoring service. + // * `none` - no metrics will be exported from the cluster. + // * if left as an empty string, `monitoring.googleapis.com` will be used. + MonitoringService string `protobuf:"bytes,7,opt,name=monitoring_service,json=monitoringService" json:"monitoring_service,omitempty"` + // The name of the Google Compute Engine + // [network](/compute/docs/networks-and-firewalls#networks) to which the + // cluster is connected. If left unspecified, the `default` network + // will be used. + Network string `protobuf:"bytes,8,opt,name=network" json:"network,omitempty"` + // The IP address range of the container pods in this cluster, in + // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // notation (e.g. `10.96.0.0/14`). Leave blank to have + // one automatically chosen or specify a `/14` block in `10.0.0.0/8`. + ClusterIpv4Cidr string `protobuf:"bytes,9,opt,name=cluster_ipv4_cidr,json=clusterIpv4Cidr" json:"cluster_ipv4_cidr,omitempty"` + // Configurations for the various addons available to run in the cluster. + AddonsConfig *AddonsConfig `protobuf:"bytes,10,opt,name=addons_config,json=addonsConfig" json:"addons_config,omitempty"` + // The name of the Google Compute Engine + // [subnetwork](/compute/docs/subnetworks) to which the + // cluster is connected. + Subnetwork string `protobuf:"bytes,11,opt,name=subnetwork" json:"subnetwork,omitempty"` + // The node pools associated with this cluster. + // This field should not be set if "node_config" or "initial_node_count" are + // specified. + NodePools []*NodePool `protobuf:"bytes,12,rep,name=node_pools,json=nodePools" json:"node_pools,omitempty"` + // The list of Google Compute Engine + // [locations](/compute/docs/zones#available) in which the cluster's nodes + // should be located. + Locations []string `protobuf:"bytes,13,rep,name=locations" json:"locations,omitempty"` + // Kubernetes alpha features are enabled on this cluster. This includes alpha + // API groups (e.g. v1alpha1) and features that may not be production ready in + // the kubernetes version of the master and nodes. + // The cluster has no SLA for uptime and master/node upgrades are disabled. + // Alpha enabled clusters are automatically deleted thirty days after + // creation. + EnableKubernetesAlpha bool `protobuf:"varint,14,opt,name=enable_kubernetes_alpha,json=enableKubernetesAlpha" json:"enable_kubernetes_alpha,omitempty"` + // The resource labels for the cluster to use to annotate any related + // Google Compute Engine resources. + ResourceLabels map[string]string `protobuf:"bytes,15,rep,name=resource_labels,json=resourceLabels" json:"resource_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // The fingerprint of the set of labels for this cluster. + LabelFingerprint string `protobuf:"bytes,16,opt,name=label_fingerprint,json=labelFingerprint" json:"label_fingerprint,omitempty"` + // Configuration for the legacy ABAC authorization mode. + LegacyAbac *LegacyAbac `protobuf:"bytes,18,opt,name=legacy_abac,json=legacyAbac" json:"legacy_abac,omitempty"` + // Configuration options for the NetworkPolicy feature. + NetworkPolicy *NetworkPolicy `protobuf:"bytes,19,opt,name=network_policy,json=networkPolicy" json:"network_policy,omitempty"` + // Configuration for cluster IP allocation. + IpAllocationPolicy *IPAllocationPolicy `protobuf:"bytes,20,opt,name=ip_allocation_policy,json=ipAllocationPolicy" json:"ip_allocation_policy,omitempty"` + // Master authorized networks is a Beta feature. + // The configuration options for master authorized networks feature. + MasterAuthorizedNetworksConfig *MasterAuthorizedNetworksConfig `protobuf:"bytes,22,opt,name=master_authorized_networks_config,json=masterAuthorizedNetworksConfig" json:"master_authorized_networks_config,omitempty"` + // Configure the maintenance policy for this cluster. + MaintenancePolicy *MaintenancePolicy `protobuf:"bytes,23,opt,name=maintenance_policy,json=maintenancePolicy" json:"maintenance_policy,omitempty"` + // [Output only] Server-defined URL for the resource. + SelfLink string `protobuf:"bytes,100,opt,name=self_link,json=selfLink" json:"self_link,omitempty"` + // [Output only] The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + Zone string `protobuf:"bytes,101,opt,name=zone" json:"zone,omitempty"` + // [Output only] The IP address of this cluster's master endpoint. + // The endpoint can be accessed from the internet at + // `https://username:password@endpoint/`. + // + // See the `masterAuth` property of this resource for username and + // password information. + Endpoint string `protobuf:"bytes,102,opt,name=endpoint" json:"endpoint,omitempty"` + // The initial Kubernetes version for this cluster. Valid versions are those + // found in validMasterVersions returned by getServerConfig. The version can + // be upgraded over time; such upgrades are reflected in + // currentMasterVersion and currentNodeVersion. + InitialClusterVersion string `protobuf:"bytes,103,opt,name=initial_cluster_version,json=initialClusterVersion" json:"initial_cluster_version,omitempty"` + // [Output only] The current software version of the master endpoint. + CurrentMasterVersion string `protobuf:"bytes,104,opt,name=current_master_version,json=currentMasterVersion" json:"current_master_version,omitempty"` + // [Output only] The current version of the node software components. + // If they are currently at multiple versions because they're in the process + // of being upgraded, this reflects the minimum version of all nodes. + CurrentNodeVersion string `protobuf:"bytes,105,opt,name=current_node_version,json=currentNodeVersion" json:"current_node_version,omitempty"` + // [Output only] The time the cluster was created, in + // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + CreateTime string `protobuf:"bytes,106,opt,name=create_time,json=createTime" json:"create_time,omitempty"` + // [Output only] The current status of this cluster. + Status Cluster_Status `protobuf:"varint,107,opt,name=status,enum=google.container.v1.Cluster_Status" json:"status,omitempty"` + // [Output only] Additional information about the current status of this + // cluster, if available. + StatusMessage string `protobuf:"bytes,108,opt,name=status_message,json=statusMessage" json:"status_message,omitempty"` + // [Output only] The size of the address space on each node for hosting + // containers. This is provisioned from within the `container_ipv4_cidr` + // range. + NodeIpv4CidrSize int32 `protobuf:"varint,109,opt,name=node_ipv4_cidr_size,json=nodeIpv4CidrSize" json:"node_ipv4_cidr_size,omitempty"` + // [Output only] The IP address range of the Kubernetes services in + // this cluster, in + // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // notation (e.g. `1.2.3.4/29`). Service addresses are + // typically put in the last `/16` from the container CIDR. + ServicesIpv4Cidr string `protobuf:"bytes,110,opt,name=services_ipv4_cidr,json=servicesIpv4Cidr" json:"services_ipv4_cidr,omitempty"` + // Deprecated. Use node_pools.instance_group_urls. + InstanceGroupUrls []string `protobuf:"bytes,111,rep,name=instance_group_urls,json=instanceGroupUrls" json:"instance_group_urls,omitempty"` + // [Output only] The number of nodes currently in the cluster. + CurrentNodeCount int32 `protobuf:"varint,112,opt,name=current_node_count,json=currentNodeCount" json:"current_node_count,omitempty"` + // [Output only] The time the cluster will be automatically + // deleted in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + ExpireTime string `protobuf:"bytes,113,opt,name=expire_time,json=expireTime" json:"expire_time,omitempty"` +} + +func (m *Cluster) Reset() { *m = Cluster{} } +func (m *Cluster) String() string { return proto.CompactTextString(m) } +func (*Cluster) ProtoMessage() {} +func (*Cluster) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } + +func (m *Cluster) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Cluster) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *Cluster) GetInitialNodeCount() int32 { + if m != nil { + return m.InitialNodeCount + } + return 0 +} + +func (m *Cluster) GetNodeConfig() *NodeConfig { + if m != nil { + return m.NodeConfig + } + return nil +} + +func (m *Cluster) GetMasterAuth() *MasterAuth { + if m != nil { + return m.MasterAuth + } + return nil +} + +func (m *Cluster) GetLoggingService() string { + if m != nil { + return m.LoggingService + } + return "" +} + +func (m *Cluster) GetMonitoringService() string { + if m != nil { + return m.MonitoringService + } + return "" +} + +func (m *Cluster) GetNetwork() string { + if m != nil { + return m.Network + } + return "" +} + +func (m *Cluster) GetClusterIpv4Cidr() string { + if m != nil { + return m.ClusterIpv4Cidr + } + return "" +} + +func (m *Cluster) GetAddonsConfig() *AddonsConfig { + if m != nil { + return m.AddonsConfig + } + return nil +} + +func (m *Cluster) GetSubnetwork() string { + if m != nil { + return m.Subnetwork + } + return "" +} + +func (m *Cluster) GetNodePools() []*NodePool { + if m != nil { + return m.NodePools + } + return nil +} + +func (m *Cluster) GetLocations() []string { + if m != nil { + return m.Locations + } + return nil +} + +func (m *Cluster) GetEnableKubernetesAlpha() bool { + if m != nil { + return m.EnableKubernetesAlpha + } + return false +} + +func (m *Cluster) GetResourceLabels() map[string]string { + if m != nil { + return m.ResourceLabels + } + return nil +} + +func (m *Cluster) GetLabelFingerprint() string { + if m != nil { + return m.LabelFingerprint + } + return "" +} + +func (m *Cluster) GetLegacyAbac() *LegacyAbac { + if m != nil { + return m.LegacyAbac + } + return nil +} + +func (m *Cluster) GetNetworkPolicy() *NetworkPolicy { + if m != nil { + return m.NetworkPolicy + } + return nil +} + +func (m *Cluster) GetIpAllocationPolicy() *IPAllocationPolicy { + if m != nil { + return m.IpAllocationPolicy + } + return nil +} + +func (m *Cluster) GetMasterAuthorizedNetworksConfig() *MasterAuthorizedNetworksConfig { + if m != nil { + return m.MasterAuthorizedNetworksConfig + } + return nil +} + +func (m *Cluster) GetMaintenancePolicy() *MaintenancePolicy { + if m != nil { + return m.MaintenancePolicy + } + return nil +} + +func (m *Cluster) GetSelfLink() string { + if m != nil { + return m.SelfLink + } + return "" +} + +func (m *Cluster) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *Cluster) GetEndpoint() string { + if m != nil { + return m.Endpoint + } + return "" +} + +func (m *Cluster) GetInitialClusterVersion() string { + if m != nil { + return m.InitialClusterVersion + } + return "" +} + +func (m *Cluster) GetCurrentMasterVersion() string { + if m != nil { + return m.CurrentMasterVersion + } + return "" +} + +func (m *Cluster) GetCurrentNodeVersion() string { + if m != nil { + return m.CurrentNodeVersion + } + return "" +} + +func (m *Cluster) GetCreateTime() string { + if m != nil { + return m.CreateTime + } + return "" +} + +func (m *Cluster) GetStatus() Cluster_Status { + if m != nil { + return m.Status + } + return Cluster_STATUS_UNSPECIFIED +} + +func (m *Cluster) GetStatusMessage() string { + if m != nil { + return m.StatusMessage + } + return "" +} + +func (m *Cluster) GetNodeIpv4CidrSize() int32 { + if m != nil { + return m.NodeIpv4CidrSize + } + return 0 +} + +func (m *Cluster) GetServicesIpv4Cidr() string { + if m != nil { + return m.ServicesIpv4Cidr + } + return "" +} + +func (m *Cluster) GetInstanceGroupUrls() []string { + if m != nil { + return m.InstanceGroupUrls + } + return nil +} + +func (m *Cluster) GetCurrentNodeCount() int32 { + if m != nil { + return m.CurrentNodeCount + } + return 0 +} + +func (m *Cluster) GetExpireTime() string { + if m != nil { + return m.ExpireTime + } + return "" +} + +// ClusterUpdate describes an update to the cluster. Exactly one update can +// be applied to a cluster with each request, so at most one field can be +// provided. +type ClusterUpdate struct { + // The Kubernetes version to change the nodes to (typically an + // upgrade). Use `-` to upgrade to the latest version supported by + // the server. + DesiredNodeVersion string `protobuf:"bytes,4,opt,name=desired_node_version,json=desiredNodeVersion" json:"desired_node_version,omitempty"` + // The monitoring service the cluster should use to write metrics. + // Currently available options: + // + // * "monitoring.googleapis.com" - the Google Cloud Monitoring service + // * "none" - no metrics will be exported from the cluster + DesiredMonitoringService string `protobuf:"bytes,5,opt,name=desired_monitoring_service,json=desiredMonitoringService" json:"desired_monitoring_service,omitempty"` + // Configurations for the various addons available to run in the cluster. + DesiredAddonsConfig *AddonsConfig `protobuf:"bytes,6,opt,name=desired_addons_config,json=desiredAddonsConfig" json:"desired_addons_config,omitempty"` + // The node pool to be upgraded. This field is mandatory if + // "desired_node_version", "desired_image_family" or + // "desired_node_pool_autoscaling" is specified and there is more than one + // node pool on the cluster. + DesiredNodePoolId string `protobuf:"bytes,7,opt,name=desired_node_pool_id,json=desiredNodePoolId" json:"desired_node_pool_id,omitempty"` + // The desired image type for the node pool. + // NOTE: Set the "desired_node_pool" field as well. + DesiredImageType string `protobuf:"bytes,8,opt,name=desired_image_type,json=desiredImageType" json:"desired_image_type,omitempty"` + // Autoscaler configuration for the node pool specified in + // desired_node_pool_id. If there is only one pool in the + // cluster and desired_node_pool_id is not provided then + // the change applies to that single node pool. + DesiredNodePoolAutoscaling *NodePoolAutoscaling `protobuf:"bytes,9,opt,name=desired_node_pool_autoscaling,json=desiredNodePoolAutoscaling" json:"desired_node_pool_autoscaling,omitempty"` + // The desired list of Google Compute Engine + // [locations](/compute/docs/zones#available) in which the cluster's nodes + // should be located. Changing the locations a cluster is in will result + // in nodes being either created or removed from the cluster, depending on + // whether locations are being added or removed. + // + // This list must always include the cluster's primary zone. + DesiredLocations []string `protobuf:"bytes,10,rep,name=desired_locations,json=desiredLocations" json:"desired_locations,omitempty"` + // Master authorized networks is a Beta feature. + // The desired configuration options for master authorized networks feature. + DesiredMasterAuthorizedNetworksConfig *MasterAuthorizedNetworksConfig `protobuf:"bytes,12,opt,name=desired_master_authorized_networks_config,json=desiredMasterAuthorizedNetworksConfig" json:"desired_master_authorized_networks_config,omitempty"` + // The Kubernetes version to change the master to. The only valid value is the + // latest supported version. Use "-" to have the server automatically select + // the latest version. + DesiredMasterVersion string `protobuf:"bytes,100,opt,name=desired_master_version,json=desiredMasterVersion" json:"desired_master_version,omitempty"` +} + +func (m *ClusterUpdate) Reset() { *m = ClusterUpdate{} } +func (m *ClusterUpdate) String() string { return proto.CompactTextString(m) } +func (*ClusterUpdate) ProtoMessage() {} +func (*ClusterUpdate) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } + +func (m *ClusterUpdate) GetDesiredNodeVersion() string { + if m != nil { + return m.DesiredNodeVersion + } + return "" +} + +func (m *ClusterUpdate) GetDesiredMonitoringService() string { + if m != nil { + return m.DesiredMonitoringService + } + return "" +} + +func (m *ClusterUpdate) GetDesiredAddonsConfig() *AddonsConfig { + if m != nil { + return m.DesiredAddonsConfig + } + return nil +} + +func (m *ClusterUpdate) GetDesiredNodePoolId() string { + if m != nil { + return m.DesiredNodePoolId + } + return "" +} + +func (m *ClusterUpdate) GetDesiredImageType() string { + if m != nil { + return m.DesiredImageType + } + return "" +} + +func (m *ClusterUpdate) GetDesiredNodePoolAutoscaling() *NodePoolAutoscaling { + if m != nil { + return m.DesiredNodePoolAutoscaling + } + return nil +} + +func (m *ClusterUpdate) GetDesiredLocations() []string { + if m != nil { + return m.DesiredLocations + } + return nil +} + +func (m *ClusterUpdate) GetDesiredMasterAuthorizedNetworksConfig() *MasterAuthorizedNetworksConfig { + if m != nil { + return m.DesiredMasterAuthorizedNetworksConfig + } + return nil +} + +func (m *ClusterUpdate) GetDesiredMasterVersion() string { + if m != nil { + return m.DesiredMasterVersion + } + return "" +} + +// This operation resource represents operations that may have happened or are +// happening on the cluster. All fields are output only. +type Operation struct { + // The server-assigned ID for the operation. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the operation + // is taking place. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The operation type. + OperationType Operation_Type `protobuf:"varint,3,opt,name=operation_type,json=operationType,enum=google.container.v1.Operation_Type" json:"operation_type,omitempty"` + // The current status of the operation. + Status Operation_Status `protobuf:"varint,4,opt,name=status,enum=google.container.v1.Operation_Status" json:"status,omitempty"` + // Detailed operation progress, if available. + Detail string `protobuf:"bytes,8,opt,name=detail" json:"detail,omitempty"` + // If an error has occurred, a textual description of the error. + StatusMessage string `protobuf:"bytes,5,opt,name=status_message,json=statusMessage" json:"status_message,omitempty"` + // Server-defined URL for the resource. + SelfLink string `protobuf:"bytes,6,opt,name=self_link,json=selfLink" json:"self_link,omitempty"` + // Server-defined URL for the target of the operation. + TargetLink string `protobuf:"bytes,7,opt,name=target_link,json=targetLink" json:"target_link,omitempty"` + // [Output only] The time the operation started, in + // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + StartTime string `protobuf:"bytes,10,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + // [Output only] The time the operation completed, in + // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + EndTime string `protobuf:"bytes,11,opt,name=end_time,json=endTime" json:"end_time,omitempty"` +} + +func (m *Operation) Reset() { *m = Operation{} } +func (m *Operation) String() string { return proto.CompactTextString(m) } +func (*Operation) ProtoMessage() {} +func (*Operation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } + +func (m *Operation) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Operation) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *Operation) GetOperationType() Operation_Type { + if m != nil { + return m.OperationType + } + return Operation_TYPE_UNSPECIFIED +} + +func (m *Operation) GetStatus() Operation_Status { + if m != nil { + return m.Status + } + return Operation_STATUS_UNSPECIFIED +} + +func (m *Operation) GetDetail() string { + if m != nil { + return m.Detail + } + return "" +} + +func (m *Operation) GetStatusMessage() string { + if m != nil { + return m.StatusMessage + } + return "" +} + +func (m *Operation) GetSelfLink() string { + if m != nil { + return m.SelfLink + } + return "" +} + +func (m *Operation) GetTargetLink() string { + if m != nil { + return m.TargetLink + } + return "" +} + +func (m *Operation) GetStartTime() string { + if m != nil { + return m.StartTime + } + return "" +} + +func (m *Operation) GetEndTime() string { + if m != nil { + return m.EndTime + } + return "" +} + +// CreateClusterRequest creates a cluster. +type CreateClusterRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // A [cluster + // resource](/container-engine/reference/rest/v1/projects.zones.clusters) + Cluster *Cluster `protobuf:"bytes,3,opt,name=cluster" json:"cluster,omitempty"` +} + +func (m *CreateClusterRequest) Reset() { *m = CreateClusterRequest{} } +func (m *CreateClusterRequest) String() string { return proto.CompactTextString(m) } +func (*CreateClusterRequest) ProtoMessage() {} +func (*CreateClusterRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } + +func (m *CreateClusterRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *CreateClusterRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *CreateClusterRequest) GetCluster() *Cluster { + if m != nil { + return m.Cluster + } + return nil +} + +// GetClusterRequest gets the settings of a cluster. +type GetClusterRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster to retrieve. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` +} + +func (m *GetClusterRequest) Reset() { *m = GetClusterRequest{} } +func (m *GetClusterRequest) String() string { return proto.CompactTextString(m) } +func (*GetClusterRequest) ProtoMessage() {} +func (*GetClusterRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} } + +func (m *GetClusterRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *GetClusterRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *GetClusterRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +// UpdateClusterRequest updates the settings of a cluster. +type UpdateClusterRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster to upgrade. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // A description of the update. + Update *ClusterUpdate `protobuf:"bytes,4,opt,name=update" json:"update,omitempty"` +} + +func (m *UpdateClusterRequest) Reset() { *m = UpdateClusterRequest{} } +func (m *UpdateClusterRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateClusterRequest) ProtoMessage() {} +func (*UpdateClusterRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17} } + +func (m *UpdateClusterRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *UpdateClusterRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *UpdateClusterRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *UpdateClusterRequest) GetUpdate() *ClusterUpdate { + if m != nil { + return m.Update + } + return nil +} + +// UpdateNodePoolRequests update a node pool's image and/or version. +type UpdateNodePoolRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster to upgrade. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The name of the node pool to upgrade. + NodePoolId string `protobuf:"bytes,4,opt,name=node_pool_id,json=nodePoolId" json:"node_pool_id,omitempty"` + // The Kubernetes version to change the nodes to (typically an + // upgrade). Use `-` to upgrade to the latest version supported by + // the server. + NodeVersion string `protobuf:"bytes,5,opt,name=node_version,json=nodeVersion" json:"node_version,omitempty"` + // The desired image type for the node pool. + ImageType string `protobuf:"bytes,6,opt,name=image_type,json=imageType" json:"image_type,omitempty"` +} + +func (m *UpdateNodePoolRequest) Reset() { *m = UpdateNodePoolRequest{} } +func (m *UpdateNodePoolRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateNodePoolRequest) ProtoMessage() {} +func (*UpdateNodePoolRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{18} } + +func (m *UpdateNodePoolRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *UpdateNodePoolRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *UpdateNodePoolRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *UpdateNodePoolRequest) GetNodePoolId() string { + if m != nil { + return m.NodePoolId + } + return "" +} + +func (m *UpdateNodePoolRequest) GetNodeVersion() string { + if m != nil { + return m.NodeVersion + } + return "" +} + +func (m *UpdateNodePoolRequest) GetImageType() string { + if m != nil { + return m.ImageType + } + return "" +} + +// SetNodePoolAutoscalingRequest sets the autoscaler settings of a node pool. +type SetNodePoolAutoscalingRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster to upgrade. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The name of the node pool to upgrade. + NodePoolId string `protobuf:"bytes,4,opt,name=node_pool_id,json=nodePoolId" json:"node_pool_id,omitempty"` + // Autoscaling configuration for the node pool. + Autoscaling *NodePoolAutoscaling `protobuf:"bytes,5,opt,name=autoscaling" json:"autoscaling,omitempty"` +} + +func (m *SetNodePoolAutoscalingRequest) Reset() { *m = SetNodePoolAutoscalingRequest{} } +func (m *SetNodePoolAutoscalingRequest) String() string { return proto.CompactTextString(m) } +func (*SetNodePoolAutoscalingRequest) ProtoMessage() {} +func (*SetNodePoolAutoscalingRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{19} } + +func (m *SetNodePoolAutoscalingRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *SetNodePoolAutoscalingRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *SetNodePoolAutoscalingRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *SetNodePoolAutoscalingRequest) GetNodePoolId() string { + if m != nil { + return m.NodePoolId + } + return "" +} + +func (m *SetNodePoolAutoscalingRequest) GetAutoscaling() *NodePoolAutoscaling { + if m != nil { + return m.Autoscaling + } + return nil +} + +// SetLoggingServiceRequest sets the logging service of a cluster. +type SetLoggingServiceRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster to upgrade. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The logging service the cluster should use to write metrics. + // Currently available options: + // + // * "logging.googleapis.com" - the Google Cloud Logging service + // * "none" - no metrics will be exported from the cluster + LoggingService string `protobuf:"bytes,4,opt,name=logging_service,json=loggingService" json:"logging_service,omitempty"` +} + +func (m *SetLoggingServiceRequest) Reset() { *m = SetLoggingServiceRequest{} } +func (m *SetLoggingServiceRequest) String() string { return proto.CompactTextString(m) } +func (*SetLoggingServiceRequest) ProtoMessage() {} +func (*SetLoggingServiceRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20} } + +func (m *SetLoggingServiceRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *SetLoggingServiceRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *SetLoggingServiceRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *SetLoggingServiceRequest) GetLoggingService() string { + if m != nil { + return m.LoggingService + } + return "" +} + +// SetMonitoringServiceRequest sets the monitoring service of a cluster. +type SetMonitoringServiceRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster to upgrade. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The monitoring service the cluster should use to write metrics. + // Currently available options: + // + // * "monitoring.googleapis.com" - the Google Cloud Monitoring service + // * "none" - no metrics will be exported from the cluster + MonitoringService string `protobuf:"bytes,4,opt,name=monitoring_service,json=monitoringService" json:"monitoring_service,omitempty"` +} + +func (m *SetMonitoringServiceRequest) Reset() { *m = SetMonitoringServiceRequest{} } +func (m *SetMonitoringServiceRequest) String() string { return proto.CompactTextString(m) } +func (*SetMonitoringServiceRequest) ProtoMessage() {} +func (*SetMonitoringServiceRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{21} } + +func (m *SetMonitoringServiceRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *SetMonitoringServiceRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *SetMonitoringServiceRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *SetMonitoringServiceRequest) GetMonitoringService() string { + if m != nil { + return m.MonitoringService + } + return "" +} + +// SetAddonsConfigRequest sets the addons associated with the cluster. +type SetAddonsConfigRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster to upgrade. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The desired configurations for the various addons available to run in the + // cluster. + AddonsConfig *AddonsConfig `protobuf:"bytes,4,opt,name=addons_config,json=addonsConfig" json:"addons_config,omitempty"` +} + +func (m *SetAddonsConfigRequest) Reset() { *m = SetAddonsConfigRequest{} } +func (m *SetAddonsConfigRequest) String() string { return proto.CompactTextString(m) } +func (*SetAddonsConfigRequest) ProtoMessage() {} +func (*SetAddonsConfigRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{22} } + +func (m *SetAddonsConfigRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *SetAddonsConfigRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *SetAddonsConfigRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *SetAddonsConfigRequest) GetAddonsConfig() *AddonsConfig { + if m != nil { + return m.AddonsConfig + } + return nil +} + +// SetLocationsRequest sets the locations of the cluster. +type SetLocationsRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster to upgrade. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The desired list of Google Compute Engine + // [locations](/compute/docs/zones#available) in which the cluster's nodes + // should be located. Changing the locations a cluster is in will result + // in nodes being either created or removed from the cluster, depending on + // whether locations are being added or removed. + // + // This list must always include the cluster's primary zone. + Locations []string `protobuf:"bytes,4,rep,name=locations" json:"locations,omitempty"` +} + +func (m *SetLocationsRequest) Reset() { *m = SetLocationsRequest{} } +func (m *SetLocationsRequest) String() string { return proto.CompactTextString(m) } +func (*SetLocationsRequest) ProtoMessage() {} +func (*SetLocationsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{23} } + +func (m *SetLocationsRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *SetLocationsRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *SetLocationsRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *SetLocationsRequest) GetLocations() []string { + if m != nil { + return m.Locations + } + return nil +} + +// UpdateMasterRequest updates the master of the cluster. +type UpdateMasterRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster to upgrade. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The Kubernetes version to change the master to. The only valid value is the + // latest supported version. Use "-" to have the server automatically select + // the latest version. + MasterVersion string `protobuf:"bytes,4,opt,name=master_version,json=masterVersion" json:"master_version,omitempty"` +} + +func (m *UpdateMasterRequest) Reset() { *m = UpdateMasterRequest{} } +func (m *UpdateMasterRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateMasterRequest) ProtoMessage() {} +func (*UpdateMasterRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{24} } + +func (m *UpdateMasterRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *UpdateMasterRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *UpdateMasterRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *UpdateMasterRequest) GetMasterVersion() string { + if m != nil { + return m.MasterVersion + } + return "" +} + +// SetMasterAuthRequest updates the admin password of a cluster. +type SetMasterAuthRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster to upgrade. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The exact form of action to be taken on the master auth. + Action SetMasterAuthRequest_Action `protobuf:"varint,4,opt,name=action,enum=google.container.v1.SetMasterAuthRequest_Action" json:"action,omitempty"` + // A description of the update. + Update *MasterAuth `protobuf:"bytes,5,opt,name=update" json:"update,omitempty"` +} + +func (m *SetMasterAuthRequest) Reset() { *m = SetMasterAuthRequest{} } +func (m *SetMasterAuthRequest) String() string { return proto.CompactTextString(m) } +func (*SetMasterAuthRequest) ProtoMessage() {} +func (*SetMasterAuthRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{25} } + +func (m *SetMasterAuthRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *SetMasterAuthRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *SetMasterAuthRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *SetMasterAuthRequest) GetAction() SetMasterAuthRequest_Action { + if m != nil { + return m.Action + } + return SetMasterAuthRequest_UNKNOWN +} + +func (m *SetMasterAuthRequest) GetUpdate() *MasterAuth { + if m != nil { + return m.Update + } + return nil +} + +// DeleteClusterRequest deletes a cluster. +type DeleteClusterRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster to delete. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` +} + +func (m *DeleteClusterRequest) Reset() { *m = DeleteClusterRequest{} } +func (m *DeleteClusterRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteClusterRequest) ProtoMessage() {} +func (*DeleteClusterRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{26} } + +func (m *DeleteClusterRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *DeleteClusterRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *DeleteClusterRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +// ListClustersRequest lists clusters. +type ListClustersRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides, or "-" for all zones. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` +} + +func (m *ListClustersRequest) Reset() { *m = ListClustersRequest{} } +func (m *ListClustersRequest) String() string { return proto.CompactTextString(m) } +func (*ListClustersRequest) ProtoMessage() {} +func (*ListClustersRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{27} } + +func (m *ListClustersRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *ListClustersRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +// ListClustersResponse is the result of ListClustersRequest. +type ListClustersResponse struct { + // A list of clusters in the project in the specified zone, or + // across all ones. + Clusters []*Cluster `protobuf:"bytes,1,rep,name=clusters" json:"clusters,omitempty"` + // If any zones are listed here, the list of clusters returned + // may be missing those zones. + MissingZones []string `protobuf:"bytes,2,rep,name=missing_zones,json=missingZones" json:"missing_zones,omitempty"` +} + +func (m *ListClustersResponse) Reset() { *m = ListClustersResponse{} } +func (m *ListClustersResponse) String() string { return proto.CompactTextString(m) } +func (*ListClustersResponse) ProtoMessage() {} +func (*ListClustersResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{28} } + +func (m *ListClustersResponse) GetClusters() []*Cluster { + if m != nil { + return m.Clusters + } + return nil +} + +func (m *ListClustersResponse) GetMissingZones() []string { + if m != nil { + return m.MissingZones + } + return nil +} + +// GetOperationRequest gets a single operation. +type GetOperationRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The server-assigned `name` of the operation. + OperationId string `protobuf:"bytes,3,opt,name=operation_id,json=operationId" json:"operation_id,omitempty"` +} + +func (m *GetOperationRequest) Reset() { *m = GetOperationRequest{} } +func (m *GetOperationRequest) String() string { return proto.CompactTextString(m) } +func (*GetOperationRequest) ProtoMessage() {} +func (*GetOperationRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{29} } + +func (m *GetOperationRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *GetOperationRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *GetOperationRequest) GetOperationId() string { + if m != nil { + return m.OperationId + } + return "" +} + +// ListOperationsRequest lists operations. +type ListOperationsRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine [zone](/compute/docs/zones#available) + // to return operations for, or `-` for all zones. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` +} + +func (m *ListOperationsRequest) Reset() { *m = ListOperationsRequest{} } +func (m *ListOperationsRequest) String() string { return proto.CompactTextString(m) } +func (*ListOperationsRequest) ProtoMessage() {} +func (*ListOperationsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{30} } + +func (m *ListOperationsRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *ListOperationsRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +// CancelOperationRequest cancels a single operation. +type CancelOperationRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the operation resides. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The server-assigned `name` of the operation. + OperationId string `protobuf:"bytes,3,opt,name=operation_id,json=operationId" json:"operation_id,omitempty"` +} + +func (m *CancelOperationRequest) Reset() { *m = CancelOperationRequest{} } +func (m *CancelOperationRequest) String() string { return proto.CompactTextString(m) } +func (*CancelOperationRequest) ProtoMessage() {} +func (*CancelOperationRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{31} } + +func (m *CancelOperationRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *CancelOperationRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *CancelOperationRequest) GetOperationId() string { + if m != nil { + return m.OperationId + } + return "" +} + +// ListOperationsResponse is the result of ListOperationsRequest. +type ListOperationsResponse struct { + // A list of operations in the project in the specified zone. + Operations []*Operation `protobuf:"bytes,1,rep,name=operations" json:"operations,omitempty"` + // If any zones are listed here, the list of operations returned + // may be missing the operations from those zones. + MissingZones []string `protobuf:"bytes,2,rep,name=missing_zones,json=missingZones" json:"missing_zones,omitempty"` +} + +func (m *ListOperationsResponse) Reset() { *m = ListOperationsResponse{} } +func (m *ListOperationsResponse) String() string { return proto.CompactTextString(m) } +func (*ListOperationsResponse) ProtoMessage() {} +func (*ListOperationsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{32} } + +func (m *ListOperationsResponse) GetOperations() []*Operation { + if m != nil { + return m.Operations + } + return nil +} + +func (m *ListOperationsResponse) GetMissingZones() []string { + if m != nil { + return m.MissingZones + } + return nil +} + +// Gets the current Container Engine service configuration. +type GetServerConfigRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine [zone](/compute/docs/zones#available) + // to return operations for. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` +} + +func (m *GetServerConfigRequest) Reset() { *m = GetServerConfigRequest{} } +func (m *GetServerConfigRequest) String() string { return proto.CompactTextString(m) } +func (*GetServerConfigRequest) ProtoMessage() {} +func (*GetServerConfigRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{33} } + +func (m *GetServerConfigRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *GetServerConfigRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +// Container Engine service configuration. +type ServerConfig struct { + // Version of Kubernetes the service deploys by default. + DefaultClusterVersion string `protobuf:"bytes,1,opt,name=default_cluster_version,json=defaultClusterVersion" json:"default_cluster_version,omitempty"` + // List of valid node upgrade target versions. + ValidNodeVersions []string `protobuf:"bytes,3,rep,name=valid_node_versions,json=validNodeVersions" json:"valid_node_versions,omitempty"` + // Default image type. + DefaultImageType string `protobuf:"bytes,4,opt,name=default_image_type,json=defaultImageType" json:"default_image_type,omitempty"` + // List of valid image types. + ValidImageTypes []string `protobuf:"bytes,5,rep,name=valid_image_types,json=validImageTypes" json:"valid_image_types,omitempty"` + // List of valid master versions. + ValidMasterVersions []string `protobuf:"bytes,6,rep,name=valid_master_versions,json=validMasterVersions" json:"valid_master_versions,omitempty"` +} + +func (m *ServerConfig) Reset() { *m = ServerConfig{} } +func (m *ServerConfig) String() string { return proto.CompactTextString(m) } +func (*ServerConfig) ProtoMessage() {} +func (*ServerConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{34} } + +func (m *ServerConfig) GetDefaultClusterVersion() string { + if m != nil { + return m.DefaultClusterVersion + } + return "" +} + +func (m *ServerConfig) GetValidNodeVersions() []string { + if m != nil { + return m.ValidNodeVersions + } + return nil +} + +func (m *ServerConfig) GetDefaultImageType() string { + if m != nil { + return m.DefaultImageType + } + return "" +} + +func (m *ServerConfig) GetValidImageTypes() []string { + if m != nil { + return m.ValidImageTypes + } + return nil +} + +func (m *ServerConfig) GetValidMasterVersions() []string { + if m != nil { + return m.ValidMasterVersions + } + return nil +} + +// CreateNodePoolRequest creates a node pool for a cluster. +type CreateNodePoolRequest struct { + // The Google Developers Console [project ID or project + // number](https://developers.google.com/console/help/new/#projectnumber). + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The node pool to create. + NodePool *NodePool `protobuf:"bytes,4,opt,name=node_pool,json=nodePool" json:"node_pool,omitempty"` +} + +func (m *CreateNodePoolRequest) Reset() { *m = CreateNodePoolRequest{} } +func (m *CreateNodePoolRequest) String() string { return proto.CompactTextString(m) } +func (*CreateNodePoolRequest) ProtoMessage() {} +func (*CreateNodePoolRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{35} } + +func (m *CreateNodePoolRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *CreateNodePoolRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *CreateNodePoolRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *CreateNodePoolRequest) GetNodePool() *NodePool { + if m != nil { + return m.NodePool + } + return nil +} + +// DeleteNodePoolRequest deletes a node pool for a cluster. +type DeleteNodePoolRequest struct { + // The Google Developers Console [project ID or project + // number](https://developers.google.com/console/help/new/#projectnumber). + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The name of the node pool to delete. + NodePoolId string `protobuf:"bytes,4,opt,name=node_pool_id,json=nodePoolId" json:"node_pool_id,omitempty"` +} + +func (m *DeleteNodePoolRequest) Reset() { *m = DeleteNodePoolRequest{} } +func (m *DeleteNodePoolRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteNodePoolRequest) ProtoMessage() {} +func (*DeleteNodePoolRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{36} } + +func (m *DeleteNodePoolRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *DeleteNodePoolRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *DeleteNodePoolRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *DeleteNodePoolRequest) GetNodePoolId() string { + if m != nil { + return m.NodePoolId + } + return "" +} + +// ListNodePoolsRequest lists the node pool(s) for a cluster. +type ListNodePoolsRequest struct { + // The Google Developers Console [project ID or project + // number](https://developers.google.com/console/help/new/#projectnumber). + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` +} + +func (m *ListNodePoolsRequest) Reset() { *m = ListNodePoolsRequest{} } +func (m *ListNodePoolsRequest) String() string { return proto.CompactTextString(m) } +func (*ListNodePoolsRequest) ProtoMessage() {} +func (*ListNodePoolsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{37} } + +func (m *ListNodePoolsRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *ListNodePoolsRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *ListNodePoolsRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +// GetNodePoolRequest retrieves a node pool for a cluster. +type GetNodePoolRequest struct { + // The Google Developers Console [project ID or project + // number](https://developers.google.com/console/help/new/#projectnumber). + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The name of the node pool. + NodePoolId string `protobuf:"bytes,4,opt,name=node_pool_id,json=nodePoolId" json:"node_pool_id,omitempty"` +} + +func (m *GetNodePoolRequest) Reset() { *m = GetNodePoolRequest{} } +func (m *GetNodePoolRequest) String() string { return proto.CompactTextString(m) } +func (*GetNodePoolRequest) ProtoMessage() {} +func (*GetNodePoolRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{38} } + +func (m *GetNodePoolRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *GetNodePoolRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *GetNodePoolRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *GetNodePoolRequest) GetNodePoolId() string { + if m != nil { + return m.NodePoolId + } + return "" +} + +// NodePool contains the name and configuration for a cluster's node pool. +// Node pools are a set of nodes (i.e. VM's), with a common configuration and +// specification, under the control of the cluster master. They may have a set +// of Kubernetes labels applied to them, which may be used to reference them +// during pod scheduling. They may also be resized up or down, to accommodate +// the workload. +type NodePool struct { + // The name of the node pool. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The node configuration of the pool. + Config *NodeConfig `protobuf:"bytes,2,opt,name=config" json:"config,omitempty"` + // The initial node count for the pool. You must ensure that your + // Compute Engine resource quota + // is sufficient for this number of instances. You must also have available + // firewall and routes quota. + InitialNodeCount int32 `protobuf:"varint,3,opt,name=initial_node_count,json=initialNodeCount" json:"initial_node_count,omitempty"` + // [Output only] Server-defined URL for the resource. + SelfLink string `protobuf:"bytes,100,opt,name=self_link,json=selfLink" json:"self_link,omitempty"` + // The version of the Kubernetes of this node. + Version string `protobuf:"bytes,101,opt,name=version" json:"version,omitempty"` + // [Output only] The resource URLs of the [managed instance + // groups](/compute/docs/instance-groups/creating-groups-of-managed-instances) + // associated with this node pool. + InstanceGroupUrls []string `protobuf:"bytes,102,rep,name=instance_group_urls,json=instanceGroupUrls" json:"instance_group_urls,omitempty"` + // [Output only] The status of the nodes in this pool instance. + Status NodePool_Status `protobuf:"varint,103,opt,name=status,enum=google.container.v1.NodePool_Status" json:"status,omitempty"` + // [Output only] Additional information about the current status of this + // node pool instance, if available. + StatusMessage string `protobuf:"bytes,104,opt,name=status_message,json=statusMessage" json:"status_message,omitempty"` + // Autoscaler configuration for this NodePool. Autoscaler is enabled + // only if a valid configuration is present. + Autoscaling *NodePoolAutoscaling `protobuf:"bytes,4,opt,name=autoscaling" json:"autoscaling,omitempty"` + // NodeManagement configuration for this NodePool. + Management *NodeManagement `protobuf:"bytes,5,opt,name=management" json:"management,omitempty"` +} + +func (m *NodePool) Reset() { *m = NodePool{} } +func (m *NodePool) String() string { return proto.CompactTextString(m) } +func (*NodePool) ProtoMessage() {} +func (*NodePool) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{39} } + +func (m *NodePool) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *NodePool) GetConfig() *NodeConfig { + if m != nil { + return m.Config + } + return nil +} + +func (m *NodePool) GetInitialNodeCount() int32 { + if m != nil { + return m.InitialNodeCount + } + return 0 +} + +func (m *NodePool) GetSelfLink() string { + if m != nil { + return m.SelfLink + } + return "" +} + +func (m *NodePool) GetVersion() string { + if m != nil { + return m.Version + } + return "" +} + +func (m *NodePool) GetInstanceGroupUrls() []string { + if m != nil { + return m.InstanceGroupUrls + } + return nil +} + +func (m *NodePool) GetStatus() NodePool_Status { + if m != nil { + return m.Status + } + return NodePool_STATUS_UNSPECIFIED +} + +func (m *NodePool) GetStatusMessage() string { + if m != nil { + return m.StatusMessage + } + return "" +} + +func (m *NodePool) GetAutoscaling() *NodePoolAutoscaling { + if m != nil { + return m.Autoscaling + } + return nil +} + +func (m *NodePool) GetManagement() *NodeManagement { + if m != nil { + return m.Management + } + return nil +} + +// NodeManagement defines the set of node management services turned on for the +// node pool. +type NodeManagement struct { + // A flag that specifies whether node auto-upgrade is enabled for the node + // pool. If enabled, node auto-upgrade helps keep the nodes in your node pool + // up to date with the latest release version of Kubernetes. + AutoUpgrade bool `protobuf:"varint,1,opt,name=auto_upgrade,json=autoUpgrade" json:"auto_upgrade,omitempty"` + // A flag that specifies whether the node auto-repair is enabled for the node + // pool. If enabled, the nodes in this node pool will be monitored and, if + // they fail health checks too many times, an automatic repair action will be + // triggered. + AutoRepair bool `protobuf:"varint,2,opt,name=auto_repair,json=autoRepair" json:"auto_repair,omitempty"` + // Specifies the Auto Upgrade knobs for the node pool. + UpgradeOptions *AutoUpgradeOptions `protobuf:"bytes,10,opt,name=upgrade_options,json=upgradeOptions" json:"upgrade_options,omitempty"` +} + +func (m *NodeManagement) Reset() { *m = NodeManagement{} } +func (m *NodeManagement) String() string { return proto.CompactTextString(m) } +func (*NodeManagement) ProtoMessage() {} +func (*NodeManagement) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{40} } + +func (m *NodeManagement) GetAutoUpgrade() bool { + if m != nil { + return m.AutoUpgrade + } + return false +} + +func (m *NodeManagement) GetAutoRepair() bool { + if m != nil { + return m.AutoRepair + } + return false +} + +func (m *NodeManagement) GetUpgradeOptions() *AutoUpgradeOptions { + if m != nil { + return m.UpgradeOptions + } + return nil +} + +// AutoUpgradeOptions defines the set of options for the user to control how +// the Auto Upgrades will proceed. +type AutoUpgradeOptions struct { + // [Output only] This field is set when upgrades are about to commence + // with the approximate start time for the upgrades, in + // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + AutoUpgradeStartTime string `protobuf:"bytes,1,opt,name=auto_upgrade_start_time,json=autoUpgradeStartTime" json:"auto_upgrade_start_time,omitempty"` + // [Output only] This field is set when upgrades are about to commence + // with the description of the upgrade. + Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` +} + +func (m *AutoUpgradeOptions) Reset() { *m = AutoUpgradeOptions{} } +func (m *AutoUpgradeOptions) String() string { return proto.CompactTextString(m) } +func (*AutoUpgradeOptions) ProtoMessage() {} +func (*AutoUpgradeOptions) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{41} } + +func (m *AutoUpgradeOptions) GetAutoUpgradeStartTime() string { + if m != nil { + return m.AutoUpgradeStartTime + } + return "" +} + +func (m *AutoUpgradeOptions) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +// MaintenancePolicy defines the maintenance policy to be used for the cluster. +type MaintenancePolicy struct { + // Specifies the maintenance window in which maintenance may be performed. + Window *MaintenanceWindow `protobuf:"bytes,1,opt,name=window" json:"window,omitempty"` +} + +func (m *MaintenancePolicy) Reset() { *m = MaintenancePolicy{} } +func (m *MaintenancePolicy) String() string { return proto.CompactTextString(m) } +func (*MaintenancePolicy) ProtoMessage() {} +func (*MaintenancePolicy) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{42} } + +func (m *MaintenancePolicy) GetWindow() *MaintenanceWindow { + if m != nil { + return m.Window + } + return nil +} + +// MaintenanceWindow defines the maintenance window to be used for the cluster. +type MaintenanceWindow struct { + // Types that are valid to be assigned to Policy: + // *MaintenanceWindow_DailyMaintenanceWindow + Policy isMaintenanceWindow_Policy `protobuf_oneof:"policy"` +} + +func (m *MaintenanceWindow) Reset() { *m = MaintenanceWindow{} } +func (m *MaintenanceWindow) String() string { return proto.CompactTextString(m) } +func (*MaintenanceWindow) ProtoMessage() {} +func (*MaintenanceWindow) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{43} } + +type isMaintenanceWindow_Policy interface { + isMaintenanceWindow_Policy() +} + +type MaintenanceWindow_DailyMaintenanceWindow struct { + DailyMaintenanceWindow *DailyMaintenanceWindow `protobuf:"bytes,2,opt,name=daily_maintenance_window,json=dailyMaintenanceWindow,oneof"` +} + +func (*MaintenanceWindow_DailyMaintenanceWindow) isMaintenanceWindow_Policy() {} + +func (m *MaintenanceWindow) GetPolicy() isMaintenanceWindow_Policy { + if m != nil { + return m.Policy + } + return nil +} + +func (m *MaintenanceWindow) GetDailyMaintenanceWindow() *DailyMaintenanceWindow { + if x, ok := m.GetPolicy().(*MaintenanceWindow_DailyMaintenanceWindow); ok { + return x.DailyMaintenanceWindow + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*MaintenanceWindow) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _MaintenanceWindow_OneofMarshaler, _MaintenanceWindow_OneofUnmarshaler, _MaintenanceWindow_OneofSizer, []interface{}{ + (*MaintenanceWindow_DailyMaintenanceWindow)(nil), + } +} + +func _MaintenanceWindow_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*MaintenanceWindow) + // policy + switch x := m.Policy.(type) { + case *MaintenanceWindow_DailyMaintenanceWindow: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.DailyMaintenanceWindow); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("MaintenanceWindow.Policy has unexpected type %T", x) + } + return nil +} + +func _MaintenanceWindow_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*MaintenanceWindow) + switch tag { + case 2: // policy.daily_maintenance_window + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(DailyMaintenanceWindow) + err := b.DecodeMessage(msg) + m.Policy = &MaintenanceWindow_DailyMaintenanceWindow{msg} + return true, err + default: + return false, nil + } +} + +func _MaintenanceWindow_OneofSizer(msg proto.Message) (n int) { + m := msg.(*MaintenanceWindow) + // policy + switch x := m.Policy.(type) { + case *MaintenanceWindow_DailyMaintenanceWindow: + s := proto.Size(x.DailyMaintenanceWindow) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Time window specified for daily maintenance operations. +type DailyMaintenanceWindow struct { + // Time within the maintenance window to start the maintenance operations. + // Time format should be in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) + // format "HH:MM”, where HH : [00-23] and MM : [00-59] GMT. + StartTime string `protobuf:"bytes,2,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + // [Output only] Duration of the time window, automatically chosen to be + // smallest possible in the given scenario. + // Duration will be in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) + // format "PTnHnMnS". + Duration string `protobuf:"bytes,3,opt,name=duration" json:"duration,omitempty"` +} + +func (m *DailyMaintenanceWindow) Reset() { *m = DailyMaintenanceWindow{} } +func (m *DailyMaintenanceWindow) String() string { return proto.CompactTextString(m) } +func (*DailyMaintenanceWindow) ProtoMessage() {} +func (*DailyMaintenanceWindow) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{44} } + +func (m *DailyMaintenanceWindow) GetStartTime() string { + if m != nil { + return m.StartTime + } + return "" +} + +func (m *DailyMaintenanceWindow) GetDuration() string { + if m != nil { + return m.Duration + } + return "" +} + +// SetNodePoolManagementRequest sets the node management properties of a node +// pool. +type SetNodePoolManagementRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster to update. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The name of the node pool to update. + NodePoolId string `protobuf:"bytes,4,opt,name=node_pool_id,json=nodePoolId" json:"node_pool_id,omitempty"` + // NodeManagement configuration for the node pool. + Management *NodeManagement `protobuf:"bytes,5,opt,name=management" json:"management,omitempty"` +} + +func (m *SetNodePoolManagementRequest) Reset() { *m = SetNodePoolManagementRequest{} } +func (m *SetNodePoolManagementRequest) String() string { return proto.CompactTextString(m) } +func (*SetNodePoolManagementRequest) ProtoMessage() {} +func (*SetNodePoolManagementRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{45} } + +func (m *SetNodePoolManagementRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *SetNodePoolManagementRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *SetNodePoolManagementRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *SetNodePoolManagementRequest) GetNodePoolId() string { + if m != nil { + return m.NodePoolId + } + return "" +} + +func (m *SetNodePoolManagementRequest) GetManagement() *NodeManagement { + if m != nil { + return m.Management + } + return nil +} + +// SetNodePoolSizeRequest sets the size a node +// pool. +type SetNodePoolSizeRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster to update. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The name of the node pool to update. + NodePoolId string `protobuf:"bytes,4,opt,name=node_pool_id,json=nodePoolId" json:"node_pool_id,omitempty"` + // The desired node count for the pool. + NodeCount int32 `protobuf:"varint,5,opt,name=node_count,json=nodeCount" json:"node_count,omitempty"` +} + +func (m *SetNodePoolSizeRequest) Reset() { *m = SetNodePoolSizeRequest{} } +func (m *SetNodePoolSizeRequest) String() string { return proto.CompactTextString(m) } +func (*SetNodePoolSizeRequest) ProtoMessage() {} +func (*SetNodePoolSizeRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{46} } + +func (m *SetNodePoolSizeRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *SetNodePoolSizeRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *SetNodePoolSizeRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *SetNodePoolSizeRequest) GetNodePoolId() string { + if m != nil { + return m.NodePoolId + } + return "" +} + +func (m *SetNodePoolSizeRequest) GetNodeCount() int32 { + if m != nil { + return m.NodeCount + } + return 0 +} + +// RollbackNodePoolUpgradeRequest rollbacks the previously Aborted or Failed +// NodePool upgrade. This will be an no-op if the last upgrade successfully +// completed. +type RollbackNodePoolUpgradeRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster to rollback. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The name of the node pool to rollback. + NodePoolId string `protobuf:"bytes,4,opt,name=node_pool_id,json=nodePoolId" json:"node_pool_id,omitempty"` +} + +func (m *RollbackNodePoolUpgradeRequest) Reset() { *m = RollbackNodePoolUpgradeRequest{} } +func (m *RollbackNodePoolUpgradeRequest) String() string { return proto.CompactTextString(m) } +func (*RollbackNodePoolUpgradeRequest) ProtoMessage() {} +func (*RollbackNodePoolUpgradeRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{47} } + +func (m *RollbackNodePoolUpgradeRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *RollbackNodePoolUpgradeRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *RollbackNodePoolUpgradeRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *RollbackNodePoolUpgradeRequest) GetNodePoolId() string { + if m != nil { + return m.NodePoolId + } + return "" +} + +// ListNodePoolsResponse is the result of ListNodePoolsRequest. +type ListNodePoolsResponse struct { + // A list of node pools for a cluster. + NodePools []*NodePool `protobuf:"bytes,1,rep,name=node_pools,json=nodePools" json:"node_pools,omitempty"` +} + +func (m *ListNodePoolsResponse) Reset() { *m = ListNodePoolsResponse{} } +func (m *ListNodePoolsResponse) String() string { return proto.CompactTextString(m) } +func (*ListNodePoolsResponse) ProtoMessage() {} +func (*ListNodePoolsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{48} } + +func (m *ListNodePoolsResponse) GetNodePools() []*NodePool { + if m != nil { + return m.NodePools + } + return nil +} + +// NodePoolAutoscaling contains information required by cluster autoscaler to +// adjust the size of the node pool to the current cluster usage. +type NodePoolAutoscaling struct { + // Is autoscaling enabled for this node pool. + Enabled bool `protobuf:"varint,1,opt,name=enabled" json:"enabled,omitempty"` + // Minimum number of nodes in the NodePool. Must be >= 1 and <= + // max_node_count. + MinNodeCount int32 `protobuf:"varint,2,opt,name=min_node_count,json=minNodeCount" json:"min_node_count,omitempty"` + // Maximum number of nodes in the NodePool. Must be >= min_node_count. There + // has to enough quota to scale up the cluster. + MaxNodeCount int32 `protobuf:"varint,3,opt,name=max_node_count,json=maxNodeCount" json:"max_node_count,omitempty"` +} + +func (m *NodePoolAutoscaling) Reset() { *m = NodePoolAutoscaling{} } +func (m *NodePoolAutoscaling) String() string { return proto.CompactTextString(m) } +func (*NodePoolAutoscaling) ProtoMessage() {} +func (*NodePoolAutoscaling) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{49} } + +func (m *NodePoolAutoscaling) GetEnabled() bool { + if m != nil { + return m.Enabled + } + return false +} + +func (m *NodePoolAutoscaling) GetMinNodeCount() int32 { + if m != nil { + return m.MinNodeCount + } + return 0 +} + +func (m *NodePoolAutoscaling) GetMaxNodeCount() int32 { + if m != nil { + return m.MaxNodeCount + } + return 0 +} + +// SetLabelsRequest sets the Google Cloud Platform labels on a Google Container +// Engine cluster, which will in turn set them for Google Compute Engine +// resources used by that cluster +type SetLabelsRequest struct { + // The Google Developers Console [project ID or project + // number](https://developers.google.com/console/help/new/#projectnumber). + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The labels to set for that cluster. + ResourceLabels map[string]string `protobuf:"bytes,4,rep,name=resource_labels,json=resourceLabels" json:"resource_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // The fingerprint of the previous set of labels for this resource, + // used to detect conflicts. The fingerprint is initially generated by + // Container Engine and changes after every request to modify or update + // labels. You must always provide an up-to-date fingerprint hash when + // updating or changing labels. Make a get() request to the + // resource to get the latest fingerprint. + LabelFingerprint string `protobuf:"bytes,5,opt,name=label_fingerprint,json=labelFingerprint" json:"label_fingerprint,omitempty"` +} + +func (m *SetLabelsRequest) Reset() { *m = SetLabelsRequest{} } +func (m *SetLabelsRequest) String() string { return proto.CompactTextString(m) } +func (*SetLabelsRequest) ProtoMessage() {} +func (*SetLabelsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{50} } + +func (m *SetLabelsRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *SetLabelsRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *SetLabelsRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *SetLabelsRequest) GetResourceLabels() map[string]string { + if m != nil { + return m.ResourceLabels + } + return nil +} + +func (m *SetLabelsRequest) GetLabelFingerprint() string { + if m != nil { + return m.LabelFingerprint + } + return "" +} + +// SetLegacyAbacRequest enables or disables the ABAC authorization mechanism for +// a cluster. +type SetLegacyAbacRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster to update. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // Whether ABAC authorization will be enabled in the cluster. + Enabled bool `protobuf:"varint,4,opt,name=enabled" json:"enabled,omitempty"` +} + +func (m *SetLegacyAbacRequest) Reset() { *m = SetLegacyAbacRequest{} } +func (m *SetLegacyAbacRequest) String() string { return proto.CompactTextString(m) } +func (*SetLegacyAbacRequest) ProtoMessage() {} +func (*SetLegacyAbacRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{51} } + +func (m *SetLegacyAbacRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *SetLegacyAbacRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *SetLegacyAbacRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *SetLegacyAbacRequest) GetEnabled() bool { + if m != nil { + return m.Enabled + } + return false +} + +// StartIPRotationRequest creates a new IP for the cluster and then performs +// a node upgrade on each node pool to point to the new IP. +type StartIPRotationRequest struct { + // The Google Developers Console [project ID or project + // number](https://developers.google.com/console/help/new/#projectnumber). + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` +} + +func (m *StartIPRotationRequest) Reset() { *m = StartIPRotationRequest{} } +func (m *StartIPRotationRequest) String() string { return proto.CompactTextString(m) } +func (*StartIPRotationRequest) ProtoMessage() {} +func (*StartIPRotationRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{52} } + +func (m *StartIPRotationRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *StartIPRotationRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *StartIPRotationRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +// CompleteIPRotationRequest moves the cluster master back into single-IP mode. +type CompleteIPRotationRequest struct { + // The Google Developers Console [project ID or project + // number](https://developers.google.com/console/help/new/#projectnumber). + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` +} + +func (m *CompleteIPRotationRequest) Reset() { *m = CompleteIPRotationRequest{} } +func (m *CompleteIPRotationRequest) String() string { return proto.CompactTextString(m) } +func (*CompleteIPRotationRequest) ProtoMessage() {} +func (*CompleteIPRotationRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{53} } + +func (m *CompleteIPRotationRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *CompleteIPRotationRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *CompleteIPRotationRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +// AcceleratorConfig represents a Hardware Accelerator request. +type AcceleratorConfig struct { + // The number of the accelerator cards exposed to an instance. + AcceleratorCount int64 `protobuf:"varint,1,opt,name=accelerator_count,json=acceleratorCount" json:"accelerator_count,omitempty"` + // The accelerator type resource name. List of supported accelerators + // [here](/compute/docs/gpus/#Introduction) + AcceleratorType string `protobuf:"bytes,2,opt,name=accelerator_type,json=acceleratorType" json:"accelerator_type,omitempty"` +} + +func (m *AcceleratorConfig) Reset() { *m = AcceleratorConfig{} } +func (m *AcceleratorConfig) String() string { return proto.CompactTextString(m) } +func (*AcceleratorConfig) ProtoMessage() {} +func (*AcceleratorConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{54} } + +func (m *AcceleratorConfig) GetAcceleratorCount() int64 { + if m != nil { + return m.AcceleratorCount + } + return 0 +} + +func (m *AcceleratorConfig) GetAcceleratorType() string { + if m != nil { + return m.AcceleratorType + } + return "" +} + +// SetNetworkPolicyRequest enables/disables network policy for a cluster. +type SetNetworkPolicyRequest struct { + // The Google Developers Console [project ID or project + // number](https://developers.google.com/console/help/new/#projectnumber). + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // Configuration options for the NetworkPolicy feature. + NetworkPolicy *NetworkPolicy `protobuf:"bytes,4,opt,name=network_policy,json=networkPolicy" json:"network_policy,omitempty"` +} + +func (m *SetNetworkPolicyRequest) Reset() { *m = SetNetworkPolicyRequest{} } +func (m *SetNetworkPolicyRequest) String() string { return proto.CompactTextString(m) } +func (*SetNetworkPolicyRequest) ProtoMessage() {} +func (*SetNetworkPolicyRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{55} } + +func (m *SetNetworkPolicyRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *SetNetworkPolicyRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *SetNetworkPolicyRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *SetNetworkPolicyRequest) GetNetworkPolicy() *NetworkPolicy { + if m != nil { + return m.NetworkPolicy + } + return nil +} + +// SetMaintenancePolicyRequest sets the maintenance policy for a cluster. +type SetMaintenancePolicyRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster to update. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The maintenance policy to be set for the cluster. An empty field + // clears the existing maintenance policy. + MaintenancePolicy *MaintenancePolicy `protobuf:"bytes,4,opt,name=maintenance_policy,json=maintenancePolicy" json:"maintenance_policy,omitempty"` +} + +func (m *SetMaintenancePolicyRequest) Reset() { *m = SetMaintenancePolicyRequest{} } +func (m *SetMaintenancePolicyRequest) String() string { return proto.CompactTextString(m) } +func (*SetMaintenancePolicyRequest) ProtoMessage() {} +func (*SetMaintenancePolicyRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{56} } + +func (m *SetMaintenancePolicyRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *SetMaintenancePolicyRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *SetMaintenancePolicyRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *SetMaintenancePolicyRequest) GetMaintenancePolicy() *MaintenancePolicy { + if m != nil { + return m.MaintenancePolicy + } + return nil +} + +func init() { + proto.RegisterType((*NodeConfig)(nil), "google.container.v1.NodeConfig") + proto.RegisterType((*MasterAuth)(nil), "google.container.v1.MasterAuth") + proto.RegisterType((*ClientCertificateConfig)(nil), "google.container.v1.ClientCertificateConfig") + proto.RegisterType((*AddonsConfig)(nil), "google.container.v1.AddonsConfig") + proto.RegisterType((*HttpLoadBalancing)(nil), "google.container.v1.HttpLoadBalancing") + proto.RegisterType((*HorizontalPodAutoscaling)(nil), "google.container.v1.HorizontalPodAutoscaling") + proto.RegisterType((*KubernetesDashboard)(nil), "google.container.v1.KubernetesDashboard") + proto.RegisterType((*NetworkPolicyConfig)(nil), "google.container.v1.NetworkPolicyConfig") + proto.RegisterType((*MasterAuthorizedNetworksConfig)(nil), "google.container.v1.MasterAuthorizedNetworksConfig") + proto.RegisterType((*MasterAuthorizedNetworksConfig_CidrBlock)(nil), "google.container.v1.MasterAuthorizedNetworksConfig.CidrBlock") + proto.RegisterType((*LegacyAbac)(nil), "google.container.v1.LegacyAbac") + proto.RegisterType((*NetworkPolicy)(nil), "google.container.v1.NetworkPolicy") + proto.RegisterType((*IPAllocationPolicy)(nil), "google.container.v1.IPAllocationPolicy") + proto.RegisterType((*Cluster)(nil), "google.container.v1.Cluster") + proto.RegisterType((*ClusterUpdate)(nil), "google.container.v1.ClusterUpdate") + proto.RegisterType((*Operation)(nil), "google.container.v1.Operation") + proto.RegisterType((*CreateClusterRequest)(nil), "google.container.v1.CreateClusterRequest") + proto.RegisterType((*GetClusterRequest)(nil), "google.container.v1.GetClusterRequest") + proto.RegisterType((*UpdateClusterRequest)(nil), "google.container.v1.UpdateClusterRequest") + proto.RegisterType((*UpdateNodePoolRequest)(nil), "google.container.v1.UpdateNodePoolRequest") + proto.RegisterType((*SetNodePoolAutoscalingRequest)(nil), "google.container.v1.SetNodePoolAutoscalingRequest") + proto.RegisterType((*SetLoggingServiceRequest)(nil), "google.container.v1.SetLoggingServiceRequest") + proto.RegisterType((*SetMonitoringServiceRequest)(nil), "google.container.v1.SetMonitoringServiceRequest") + proto.RegisterType((*SetAddonsConfigRequest)(nil), "google.container.v1.SetAddonsConfigRequest") + proto.RegisterType((*SetLocationsRequest)(nil), "google.container.v1.SetLocationsRequest") + proto.RegisterType((*UpdateMasterRequest)(nil), "google.container.v1.UpdateMasterRequest") + proto.RegisterType((*SetMasterAuthRequest)(nil), "google.container.v1.SetMasterAuthRequest") + proto.RegisterType((*DeleteClusterRequest)(nil), "google.container.v1.DeleteClusterRequest") + proto.RegisterType((*ListClustersRequest)(nil), "google.container.v1.ListClustersRequest") + proto.RegisterType((*ListClustersResponse)(nil), "google.container.v1.ListClustersResponse") + proto.RegisterType((*GetOperationRequest)(nil), "google.container.v1.GetOperationRequest") + proto.RegisterType((*ListOperationsRequest)(nil), "google.container.v1.ListOperationsRequest") + proto.RegisterType((*CancelOperationRequest)(nil), "google.container.v1.CancelOperationRequest") + proto.RegisterType((*ListOperationsResponse)(nil), "google.container.v1.ListOperationsResponse") + proto.RegisterType((*GetServerConfigRequest)(nil), "google.container.v1.GetServerConfigRequest") + proto.RegisterType((*ServerConfig)(nil), "google.container.v1.ServerConfig") + proto.RegisterType((*CreateNodePoolRequest)(nil), "google.container.v1.CreateNodePoolRequest") + proto.RegisterType((*DeleteNodePoolRequest)(nil), "google.container.v1.DeleteNodePoolRequest") + proto.RegisterType((*ListNodePoolsRequest)(nil), "google.container.v1.ListNodePoolsRequest") + proto.RegisterType((*GetNodePoolRequest)(nil), "google.container.v1.GetNodePoolRequest") + proto.RegisterType((*NodePool)(nil), "google.container.v1.NodePool") + proto.RegisterType((*NodeManagement)(nil), "google.container.v1.NodeManagement") + proto.RegisterType((*AutoUpgradeOptions)(nil), "google.container.v1.AutoUpgradeOptions") + proto.RegisterType((*MaintenancePolicy)(nil), "google.container.v1.MaintenancePolicy") + proto.RegisterType((*MaintenanceWindow)(nil), "google.container.v1.MaintenanceWindow") + proto.RegisterType((*DailyMaintenanceWindow)(nil), "google.container.v1.DailyMaintenanceWindow") + proto.RegisterType((*SetNodePoolManagementRequest)(nil), "google.container.v1.SetNodePoolManagementRequest") + proto.RegisterType((*SetNodePoolSizeRequest)(nil), "google.container.v1.SetNodePoolSizeRequest") + proto.RegisterType((*RollbackNodePoolUpgradeRequest)(nil), "google.container.v1.RollbackNodePoolUpgradeRequest") + proto.RegisterType((*ListNodePoolsResponse)(nil), "google.container.v1.ListNodePoolsResponse") + proto.RegisterType((*NodePoolAutoscaling)(nil), "google.container.v1.NodePoolAutoscaling") + proto.RegisterType((*SetLabelsRequest)(nil), "google.container.v1.SetLabelsRequest") + proto.RegisterType((*SetLegacyAbacRequest)(nil), "google.container.v1.SetLegacyAbacRequest") + proto.RegisterType((*StartIPRotationRequest)(nil), "google.container.v1.StartIPRotationRequest") + proto.RegisterType((*CompleteIPRotationRequest)(nil), "google.container.v1.CompleteIPRotationRequest") + proto.RegisterType((*AcceleratorConfig)(nil), "google.container.v1.AcceleratorConfig") + proto.RegisterType((*SetNetworkPolicyRequest)(nil), "google.container.v1.SetNetworkPolicyRequest") + proto.RegisterType((*SetMaintenancePolicyRequest)(nil), "google.container.v1.SetMaintenancePolicyRequest") + proto.RegisterEnum("google.container.v1.NetworkPolicy_Provider", NetworkPolicy_Provider_name, NetworkPolicy_Provider_value) + proto.RegisterEnum("google.container.v1.Cluster_Status", Cluster_Status_name, Cluster_Status_value) + proto.RegisterEnum("google.container.v1.Operation_Status", Operation_Status_name, Operation_Status_value) + proto.RegisterEnum("google.container.v1.Operation_Type", Operation_Type_name, Operation_Type_value) + proto.RegisterEnum("google.container.v1.SetMasterAuthRequest_Action", SetMasterAuthRequest_Action_name, SetMasterAuthRequest_Action_value) + proto.RegisterEnum("google.container.v1.NodePool_Status", NodePool_Status_name, NodePool_Status_value) +} + +// 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 + +// Client API for ClusterManager service + +type ClusterManagerClient interface { + // Lists all clusters owned by a project in either the specified zone or all + // zones. + ListClusters(ctx context.Context, in *ListClustersRequest, opts ...grpc.CallOption) (*ListClustersResponse, error) + // Gets the details of a specific cluster. + GetCluster(ctx context.Context, in *GetClusterRequest, opts ...grpc.CallOption) (*Cluster, error) + // Creates a cluster, consisting of the specified number and type of Google + // Compute Engine instances. + // + // By default, the cluster is created in the project's + // [default network](/compute/docs/networks-and-firewalls#networks). + // + // One firewall is added for the cluster. After cluster creation, + // the cluster creates routes for each node to allow the containers + // on that node to communicate with all other instances in the + // cluster. + // + // Finally, an entry is added to the project's global metadata indicating + // which CIDR range is being used by the cluster. + CreateCluster(ctx context.Context, in *CreateClusterRequest, opts ...grpc.CallOption) (*Operation, error) + // Updates the settings of a specific cluster. + UpdateCluster(ctx context.Context, in *UpdateClusterRequest, opts ...grpc.CallOption) (*Operation, error) + // Updates the version and/or image type of a specific node pool. + UpdateNodePool(ctx context.Context, in *UpdateNodePoolRequest, opts ...grpc.CallOption) (*Operation, error) + // Sets the autoscaling settings of a specific node pool. + SetNodePoolAutoscaling(ctx context.Context, in *SetNodePoolAutoscalingRequest, opts ...grpc.CallOption) (*Operation, error) + // Sets the logging service of a specific cluster. + SetLoggingService(ctx context.Context, in *SetLoggingServiceRequest, opts ...grpc.CallOption) (*Operation, error) + // Sets the monitoring service of a specific cluster. + SetMonitoringService(ctx context.Context, in *SetMonitoringServiceRequest, opts ...grpc.CallOption) (*Operation, error) + // Sets the addons of a specific cluster. + SetAddonsConfig(ctx context.Context, in *SetAddonsConfigRequest, opts ...grpc.CallOption) (*Operation, error) + // Sets the locations of a specific cluster. + SetLocations(ctx context.Context, in *SetLocationsRequest, opts ...grpc.CallOption) (*Operation, error) + // Updates the master of a specific cluster. + UpdateMaster(ctx context.Context, in *UpdateMasterRequest, opts ...grpc.CallOption) (*Operation, error) + // Used to set master auth materials. Currently supports :- + // Changing the admin password of a specific cluster. + // This can be either via password generation or explicitly set the password. + SetMasterAuth(ctx context.Context, in *SetMasterAuthRequest, opts ...grpc.CallOption) (*Operation, error) + // Deletes the cluster, including the Kubernetes endpoint and all worker + // nodes. + // + // Firewalls and routes that were configured during cluster creation + // are also deleted. + // + // Other Google Compute Engine resources that might be in use by the cluster + // (e.g. load balancer resources) will not be deleted if they weren't present + // at the initial create time. + DeleteCluster(ctx context.Context, in *DeleteClusterRequest, opts ...grpc.CallOption) (*Operation, error) + // Lists all operations in a project in a specific zone or all zones. + ListOperations(ctx context.Context, in *ListOperationsRequest, opts ...grpc.CallOption) (*ListOperationsResponse, error) + // Gets the specified operation. + GetOperation(ctx context.Context, in *GetOperationRequest, opts ...grpc.CallOption) (*Operation, error) + // Cancels the specified operation. + CancelOperation(ctx context.Context, in *CancelOperationRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) + // Returns configuration info about the Container Engine service. + GetServerConfig(ctx context.Context, in *GetServerConfigRequest, opts ...grpc.CallOption) (*ServerConfig, error) + // Lists the node pools for a cluster. + ListNodePools(ctx context.Context, in *ListNodePoolsRequest, opts ...grpc.CallOption) (*ListNodePoolsResponse, error) + // Retrieves the node pool requested. + GetNodePool(ctx context.Context, in *GetNodePoolRequest, opts ...grpc.CallOption) (*NodePool, error) + // Creates a node pool for a cluster. + CreateNodePool(ctx context.Context, in *CreateNodePoolRequest, opts ...grpc.CallOption) (*Operation, error) + // Deletes a node pool from a cluster. + DeleteNodePool(ctx context.Context, in *DeleteNodePoolRequest, opts ...grpc.CallOption) (*Operation, error) + // Roll back the previously Aborted or Failed NodePool upgrade. + // This will be an no-op if the last upgrade successfully completed. + RollbackNodePoolUpgrade(ctx context.Context, in *RollbackNodePoolUpgradeRequest, opts ...grpc.CallOption) (*Operation, error) + // Sets the NodeManagement options for a node pool. + SetNodePoolManagement(ctx context.Context, in *SetNodePoolManagementRequest, opts ...grpc.CallOption) (*Operation, error) + // Sets labels on a cluster. + SetLabels(ctx context.Context, in *SetLabelsRequest, opts ...grpc.CallOption) (*Operation, error) + // Enables or disables the ABAC authorization mechanism on a cluster. + SetLegacyAbac(ctx context.Context, in *SetLegacyAbacRequest, opts ...grpc.CallOption) (*Operation, error) + // Start master IP rotation. + StartIPRotation(ctx context.Context, in *StartIPRotationRequest, opts ...grpc.CallOption) (*Operation, error) + // Completes master IP rotation. + CompleteIPRotation(ctx context.Context, in *CompleteIPRotationRequest, opts ...grpc.CallOption) (*Operation, error) + // Sets the size of a specific node pool. + SetNodePoolSize(ctx context.Context, in *SetNodePoolSizeRequest, opts ...grpc.CallOption) (*Operation, error) + // Enables/Disables Network Policy for a cluster. + SetNetworkPolicy(ctx context.Context, in *SetNetworkPolicyRequest, opts ...grpc.CallOption) (*Operation, error) + // Sets the maintenance policy for a cluster. + SetMaintenancePolicy(ctx context.Context, in *SetMaintenancePolicyRequest, opts ...grpc.CallOption) (*Operation, error) +} + +type clusterManagerClient struct { + cc *grpc.ClientConn +} + +func NewClusterManagerClient(cc *grpc.ClientConn) ClusterManagerClient { + return &clusterManagerClient{cc} +} + +func (c *clusterManagerClient) ListClusters(ctx context.Context, in *ListClustersRequest, opts ...grpc.CallOption) (*ListClustersResponse, error) { + out := new(ListClustersResponse) + err := grpc.Invoke(ctx, "/google.container.v1.ClusterManager/ListClusters", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) GetCluster(ctx context.Context, in *GetClusterRequest, opts ...grpc.CallOption) (*Cluster, error) { + out := new(Cluster) + err := grpc.Invoke(ctx, "/google.container.v1.ClusterManager/GetCluster", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) CreateCluster(ctx context.Context, in *CreateClusterRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1.ClusterManager/CreateCluster", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) UpdateCluster(ctx context.Context, in *UpdateClusterRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1.ClusterManager/UpdateCluster", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) UpdateNodePool(ctx context.Context, in *UpdateNodePoolRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1.ClusterManager/UpdateNodePool", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) SetNodePoolAutoscaling(ctx context.Context, in *SetNodePoolAutoscalingRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1.ClusterManager/SetNodePoolAutoscaling", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) SetLoggingService(ctx context.Context, in *SetLoggingServiceRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1.ClusterManager/SetLoggingService", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) SetMonitoringService(ctx context.Context, in *SetMonitoringServiceRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1.ClusterManager/SetMonitoringService", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) SetAddonsConfig(ctx context.Context, in *SetAddonsConfigRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1.ClusterManager/SetAddonsConfig", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) SetLocations(ctx context.Context, in *SetLocationsRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1.ClusterManager/SetLocations", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) UpdateMaster(ctx context.Context, in *UpdateMasterRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1.ClusterManager/UpdateMaster", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) SetMasterAuth(ctx context.Context, in *SetMasterAuthRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1.ClusterManager/SetMasterAuth", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) DeleteCluster(ctx context.Context, in *DeleteClusterRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1.ClusterManager/DeleteCluster", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) ListOperations(ctx context.Context, in *ListOperationsRequest, opts ...grpc.CallOption) (*ListOperationsResponse, error) { + out := new(ListOperationsResponse) + err := grpc.Invoke(ctx, "/google.container.v1.ClusterManager/ListOperations", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) GetOperation(ctx context.Context, in *GetOperationRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1.ClusterManager/GetOperation", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) CancelOperation(ctx context.Context, in *CancelOperationRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { + out := new(google_protobuf1.Empty) + err := grpc.Invoke(ctx, "/google.container.v1.ClusterManager/CancelOperation", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) GetServerConfig(ctx context.Context, in *GetServerConfigRequest, opts ...grpc.CallOption) (*ServerConfig, error) { + out := new(ServerConfig) + err := grpc.Invoke(ctx, "/google.container.v1.ClusterManager/GetServerConfig", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) ListNodePools(ctx context.Context, in *ListNodePoolsRequest, opts ...grpc.CallOption) (*ListNodePoolsResponse, error) { + out := new(ListNodePoolsResponse) + err := grpc.Invoke(ctx, "/google.container.v1.ClusterManager/ListNodePools", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) GetNodePool(ctx context.Context, in *GetNodePoolRequest, opts ...grpc.CallOption) (*NodePool, error) { + out := new(NodePool) + err := grpc.Invoke(ctx, "/google.container.v1.ClusterManager/GetNodePool", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) CreateNodePool(ctx context.Context, in *CreateNodePoolRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1.ClusterManager/CreateNodePool", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) DeleteNodePool(ctx context.Context, in *DeleteNodePoolRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1.ClusterManager/DeleteNodePool", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) RollbackNodePoolUpgrade(ctx context.Context, in *RollbackNodePoolUpgradeRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1.ClusterManager/RollbackNodePoolUpgrade", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) SetNodePoolManagement(ctx context.Context, in *SetNodePoolManagementRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1.ClusterManager/SetNodePoolManagement", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) SetLabels(ctx context.Context, in *SetLabelsRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1.ClusterManager/SetLabels", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) SetLegacyAbac(ctx context.Context, in *SetLegacyAbacRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1.ClusterManager/SetLegacyAbac", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) StartIPRotation(ctx context.Context, in *StartIPRotationRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1.ClusterManager/StartIPRotation", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) CompleteIPRotation(ctx context.Context, in *CompleteIPRotationRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1.ClusterManager/CompleteIPRotation", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) SetNodePoolSize(ctx context.Context, in *SetNodePoolSizeRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1.ClusterManager/SetNodePoolSize", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) SetNetworkPolicy(ctx context.Context, in *SetNetworkPolicyRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1.ClusterManager/SetNetworkPolicy", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) SetMaintenancePolicy(ctx context.Context, in *SetMaintenancePolicyRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1.ClusterManager/SetMaintenancePolicy", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for ClusterManager service + +type ClusterManagerServer interface { + // Lists all clusters owned by a project in either the specified zone or all + // zones. + ListClusters(context.Context, *ListClustersRequest) (*ListClustersResponse, error) + // Gets the details of a specific cluster. + GetCluster(context.Context, *GetClusterRequest) (*Cluster, error) + // Creates a cluster, consisting of the specified number and type of Google + // Compute Engine instances. + // + // By default, the cluster is created in the project's + // [default network](/compute/docs/networks-and-firewalls#networks). + // + // One firewall is added for the cluster. After cluster creation, + // the cluster creates routes for each node to allow the containers + // on that node to communicate with all other instances in the + // cluster. + // + // Finally, an entry is added to the project's global metadata indicating + // which CIDR range is being used by the cluster. + CreateCluster(context.Context, *CreateClusterRequest) (*Operation, error) + // Updates the settings of a specific cluster. + UpdateCluster(context.Context, *UpdateClusterRequest) (*Operation, error) + // Updates the version and/or image type of a specific node pool. + UpdateNodePool(context.Context, *UpdateNodePoolRequest) (*Operation, error) + // Sets the autoscaling settings of a specific node pool. + SetNodePoolAutoscaling(context.Context, *SetNodePoolAutoscalingRequest) (*Operation, error) + // Sets the logging service of a specific cluster. + SetLoggingService(context.Context, *SetLoggingServiceRequest) (*Operation, error) + // Sets the monitoring service of a specific cluster. + SetMonitoringService(context.Context, *SetMonitoringServiceRequest) (*Operation, error) + // Sets the addons of a specific cluster. + SetAddonsConfig(context.Context, *SetAddonsConfigRequest) (*Operation, error) + // Sets the locations of a specific cluster. + SetLocations(context.Context, *SetLocationsRequest) (*Operation, error) + // Updates the master of a specific cluster. + UpdateMaster(context.Context, *UpdateMasterRequest) (*Operation, error) + // Used to set master auth materials. Currently supports :- + // Changing the admin password of a specific cluster. + // This can be either via password generation or explicitly set the password. + SetMasterAuth(context.Context, *SetMasterAuthRequest) (*Operation, error) + // Deletes the cluster, including the Kubernetes endpoint and all worker + // nodes. + // + // Firewalls and routes that were configured during cluster creation + // are also deleted. + // + // Other Google Compute Engine resources that might be in use by the cluster + // (e.g. load balancer resources) will not be deleted if they weren't present + // at the initial create time. + DeleteCluster(context.Context, *DeleteClusterRequest) (*Operation, error) + // Lists all operations in a project in a specific zone or all zones. + ListOperations(context.Context, *ListOperationsRequest) (*ListOperationsResponse, error) + // Gets the specified operation. + GetOperation(context.Context, *GetOperationRequest) (*Operation, error) + // Cancels the specified operation. + CancelOperation(context.Context, *CancelOperationRequest) (*google_protobuf1.Empty, error) + // Returns configuration info about the Container Engine service. + GetServerConfig(context.Context, *GetServerConfigRequest) (*ServerConfig, error) + // Lists the node pools for a cluster. + ListNodePools(context.Context, *ListNodePoolsRequest) (*ListNodePoolsResponse, error) + // Retrieves the node pool requested. + GetNodePool(context.Context, *GetNodePoolRequest) (*NodePool, error) + // Creates a node pool for a cluster. + CreateNodePool(context.Context, *CreateNodePoolRequest) (*Operation, error) + // Deletes a node pool from a cluster. + DeleteNodePool(context.Context, *DeleteNodePoolRequest) (*Operation, error) + // Roll back the previously Aborted or Failed NodePool upgrade. + // This will be an no-op if the last upgrade successfully completed. + RollbackNodePoolUpgrade(context.Context, *RollbackNodePoolUpgradeRequest) (*Operation, error) + // Sets the NodeManagement options for a node pool. + SetNodePoolManagement(context.Context, *SetNodePoolManagementRequest) (*Operation, error) + // Sets labels on a cluster. + SetLabels(context.Context, *SetLabelsRequest) (*Operation, error) + // Enables or disables the ABAC authorization mechanism on a cluster. + SetLegacyAbac(context.Context, *SetLegacyAbacRequest) (*Operation, error) + // Start master IP rotation. + StartIPRotation(context.Context, *StartIPRotationRequest) (*Operation, error) + // Completes master IP rotation. + CompleteIPRotation(context.Context, *CompleteIPRotationRequest) (*Operation, error) + // Sets the size of a specific node pool. + SetNodePoolSize(context.Context, *SetNodePoolSizeRequest) (*Operation, error) + // Enables/Disables Network Policy for a cluster. + SetNetworkPolicy(context.Context, *SetNetworkPolicyRequest) (*Operation, error) + // Sets the maintenance policy for a cluster. + SetMaintenancePolicy(context.Context, *SetMaintenancePolicyRequest) (*Operation, error) +} + +func RegisterClusterManagerServer(s *grpc.Server, srv ClusterManagerServer) { + s.RegisterService(&_ClusterManager_serviceDesc, srv) +} + +func _ClusterManager_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.(ClusterManagerServer).ListClusters(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1.ClusterManager/ListClusters", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).ListClusters(ctx, req.(*ListClustersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_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.(ClusterManagerServer).GetCluster(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1.ClusterManager/GetCluster", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).GetCluster(ctx, req.(*GetClusterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_CreateCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateClusterRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).CreateCluster(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1.ClusterManager/CreateCluster", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).CreateCluster(ctx, req.(*CreateClusterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_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.(ClusterManagerServer).UpdateCluster(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1.ClusterManager/UpdateCluster", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).UpdateCluster(ctx, req.(*UpdateClusterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_UpdateNodePool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateNodePoolRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).UpdateNodePool(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1.ClusterManager/UpdateNodePool", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).UpdateNodePool(ctx, req.(*UpdateNodePoolRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_SetNodePoolAutoscaling_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetNodePoolAutoscalingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).SetNodePoolAutoscaling(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1.ClusterManager/SetNodePoolAutoscaling", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).SetNodePoolAutoscaling(ctx, req.(*SetNodePoolAutoscalingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_SetLoggingService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetLoggingServiceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).SetLoggingService(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1.ClusterManager/SetLoggingService", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).SetLoggingService(ctx, req.(*SetLoggingServiceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_SetMonitoringService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetMonitoringServiceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).SetMonitoringService(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1.ClusterManager/SetMonitoringService", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).SetMonitoringService(ctx, req.(*SetMonitoringServiceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_SetAddonsConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetAddonsConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).SetAddonsConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1.ClusterManager/SetAddonsConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).SetAddonsConfig(ctx, req.(*SetAddonsConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_SetLocations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetLocationsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).SetLocations(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1.ClusterManager/SetLocations", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).SetLocations(ctx, req.(*SetLocationsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_UpdateMaster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateMasterRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).UpdateMaster(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1.ClusterManager/UpdateMaster", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).UpdateMaster(ctx, req.(*UpdateMasterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_SetMasterAuth_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetMasterAuthRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).SetMasterAuth(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1.ClusterManager/SetMasterAuth", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).SetMasterAuth(ctx, req.(*SetMasterAuthRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_DeleteCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteClusterRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).DeleteCluster(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1.ClusterManager/DeleteCluster", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).DeleteCluster(ctx, req.(*DeleteClusterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_ListOperations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListOperationsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).ListOperations(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1.ClusterManager/ListOperations", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).ListOperations(ctx, req.(*ListOperationsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_GetOperation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetOperationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).GetOperation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1.ClusterManager/GetOperation", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).GetOperation(ctx, req.(*GetOperationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_CancelOperation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CancelOperationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).CancelOperation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1.ClusterManager/CancelOperation", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).CancelOperation(ctx, req.(*CancelOperationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_GetServerConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetServerConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).GetServerConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1.ClusterManager/GetServerConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).GetServerConfig(ctx, req.(*GetServerConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_ListNodePools_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListNodePoolsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).ListNodePools(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1.ClusterManager/ListNodePools", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).ListNodePools(ctx, req.(*ListNodePoolsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_GetNodePool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetNodePoolRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).GetNodePool(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1.ClusterManager/GetNodePool", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).GetNodePool(ctx, req.(*GetNodePoolRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_CreateNodePool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateNodePoolRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).CreateNodePool(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1.ClusterManager/CreateNodePool", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).CreateNodePool(ctx, req.(*CreateNodePoolRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_DeleteNodePool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteNodePoolRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).DeleteNodePool(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1.ClusterManager/DeleteNodePool", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).DeleteNodePool(ctx, req.(*DeleteNodePoolRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_RollbackNodePoolUpgrade_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RollbackNodePoolUpgradeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).RollbackNodePoolUpgrade(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1.ClusterManager/RollbackNodePoolUpgrade", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).RollbackNodePoolUpgrade(ctx, req.(*RollbackNodePoolUpgradeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_SetNodePoolManagement_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetNodePoolManagementRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).SetNodePoolManagement(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1.ClusterManager/SetNodePoolManagement", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).SetNodePoolManagement(ctx, req.(*SetNodePoolManagementRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_SetLabels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetLabelsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).SetLabels(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1.ClusterManager/SetLabels", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).SetLabels(ctx, req.(*SetLabelsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_SetLegacyAbac_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetLegacyAbacRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).SetLegacyAbac(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1.ClusterManager/SetLegacyAbac", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).SetLegacyAbac(ctx, req.(*SetLegacyAbacRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_StartIPRotation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StartIPRotationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).StartIPRotation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1.ClusterManager/StartIPRotation", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).StartIPRotation(ctx, req.(*StartIPRotationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_CompleteIPRotation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CompleteIPRotationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).CompleteIPRotation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1.ClusterManager/CompleteIPRotation", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).CompleteIPRotation(ctx, req.(*CompleteIPRotationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_SetNodePoolSize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetNodePoolSizeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).SetNodePoolSize(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1.ClusterManager/SetNodePoolSize", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).SetNodePoolSize(ctx, req.(*SetNodePoolSizeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_SetNetworkPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetNetworkPolicyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).SetNetworkPolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1.ClusterManager/SetNetworkPolicy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).SetNetworkPolicy(ctx, req.(*SetNetworkPolicyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_SetMaintenancePolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetMaintenancePolicyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).SetMaintenancePolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1.ClusterManager/SetMaintenancePolicy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).SetMaintenancePolicy(ctx, req.(*SetMaintenancePolicyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _ClusterManager_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.container.v1.ClusterManager", + HandlerType: (*ClusterManagerServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListClusters", + Handler: _ClusterManager_ListClusters_Handler, + }, + { + MethodName: "GetCluster", + Handler: _ClusterManager_GetCluster_Handler, + }, + { + MethodName: "CreateCluster", + Handler: _ClusterManager_CreateCluster_Handler, + }, + { + MethodName: "UpdateCluster", + Handler: _ClusterManager_UpdateCluster_Handler, + }, + { + MethodName: "UpdateNodePool", + Handler: _ClusterManager_UpdateNodePool_Handler, + }, + { + MethodName: "SetNodePoolAutoscaling", + Handler: _ClusterManager_SetNodePoolAutoscaling_Handler, + }, + { + MethodName: "SetLoggingService", + Handler: _ClusterManager_SetLoggingService_Handler, + }, + { + MethodName: "SetMonitoringService", + Handler: _ClusterManager_SetMonitoringService_Handler, + }, + { + MethodName: "SetAddonsConfig", + Handler: _ClusterManager_SetAddonsConfig_Handler, + }, + { + MethodName: "SetLocations", + Handler: _ClusterManager_SetLocations_Handler, + }, + { + MethodName: "UpdateMaster", + Handler: _ClusterManager_UpdateMaster_Handler, + }, + { + MethodName: "SetMasterAuth", + Handler: _ClusterManager_SetMasterAuth_Handler, + }, + { + MethodName: "DeleteCluster", + Handler: _ClusterManager_DeleteCluster_Handler, + }, + { + MethodName: "ListOperations", + Handler: _ClusterManager_ListOperations_Handler, + }, + { + MethodName: "GetOperation", + Handler: _ClusterManager_GetOperation_Handler, + }, + { + MethodName: "CancelOperation", + Handler: _ClusterManager_CancelOperation_Handler, + }, + { + MethodName: "GetServerConfig", + Handler: _ClusterManager_GetServerConfig_Handler, + }, + { + MethodName: "ListNodePools", + Handler: _ClusterManager_ListNodePools_Handler, + }, + { + MethodName: "GetNodePool", + Handler: _ClusterManager_GetNodePool_Handler, + }, + { + MethodName: "CreateNodePool", + Handler: _ClusterManager_CreateNodePool_Handler, + }, + { + MethodName: "DeleteNodePool", + Handler: _ClusterManager_DeleteNodePool_Handler, + }, + { + MethodName: "RollbackNodePoolUpgrade", + Handler: _ClusterManager_RollbackNodePoolUpgrade_Handler, + }, + { + MethodName: "SetNodePoolManagement", + Handler: _ClusterManager_SetNodePoolManagement_Handler, + }, + { + MethodName: "SetLabels", + Handler: _ClusterManager_SetLabels_Handler, + }, + { + MethodName: "SetLegacyAbac", + Handler: _ClusterManager_SetLegacyAbac_Handler, + }, + { + MethodName: "StartIPRotation", + Handler: _ClusterManager_StartIPRotation_Handler, + }, + { + MethodName: "CompleteIPRotation", + Handler: _ClusterManager_CompleteIPRotation_Handler, + }, + { + MethodName: "SetNodePoolSize", + Handler: _ClusterManager_SetNodePoolSize_Handler, + }, + { + MethodName: "SetNetworkPolicy", + Handler: _ClusterManager_SetNetworkPolicy_Handler, + }, + { + MethodName: "SetMaintenancePolicy", + Handler: _ClusterManager_SetMaintenancePolicy_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/container/v1/cluster_service.proto", +} + +func init() { proto.RegisterFile("google/container/v1/cluster_service.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 4602 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x5c, 0xdd, 0x8f, 0x23, 0x57, + 0x56, 0xdf, 0xea, 0x76, 0xbb, 0xdb, 0xc7, 0x1f, 0xed, 0xbe, 0xfd, 0xe5, 0x38, 0x33, 0xc9, 0x4c, + 0xe5, 0x6b, 0x32, 0x49, 0xda, 0x99, 0x7c, 0x67, 0x92, 0x0d, 0xf1, 0xb8, 0x9d, 0x1e, 0x67, 0xba, + 0x6d, 0xa7, 0xdc, 0x3d, 0x43, 0xc2, 0xec, 0x96, 0xaa, 0xab, 0x6e, 0xbb, 0x2b, 0x5d, 0xae, 0xaa, + 0xad, 0x2a, 0x77, 0xd2, 0x33, 0x1a, 0x24, 0x56, 0x80, 0x90, 0x10, 0xfb, 0x02, 0x8b, 0xf6, 0x01, + 0xad, 0x10, 0x2c, 0x2b, 0x94, 0x95, 0x40, 0x2c, 0xb0, 0x20, 0x3e, 0x24, 0x5e, 0x58, 0x01, 0x12, + 0xbc, 0xf0, 0x80, 0xe0, 0x85, 0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, 0x78, 0xdf, 0x46, 0x40, 0x35, 0xbc, 0x1c, 0x9f, 0x5d, 0x86, 0xb2, 0x01, 0x29, 0xa7, + 0x84, 0x73, 0x83, 0xc7, 0x00, 0x42, 0xa7, 0x99, 0x6d, 0x82, 0x10, 0x05, 0xbd, 0x0d, 0xd4, 0xaa, + 0xb2, 0x6d, 0x59, 0x86, 0x5b, 0xca, 0x51, 0x77, 0x7d, 0x31, 0xf1, 0x45, 0xb4, 0x2d, 0xcb, 0x90, + 0x32, 0x26, 0xff, 0xe5, 0xa2, 0x0b, 0x90, 0xf1, 0x5d, 0x8d, 0x5b, 0xca, 0xd3, 0xec, 0x79, 0x40, + 0x40, 0xaf, 0xc1, 0x26, 0x73, 0x65, 0x72, 0x28, 0xb2, 0x2b, 0x86, 0x7d, 0xac, 0x94, 0x0a, 0xd4, + 0xad, 0xac, 0xb3, 0xe1, 0x41, 0x4c, 0xab, 0x92, 0x41, 0xf4, 0x21, 0x2c, 0x3b, 0xd8, 0xb5, 0xfa, + 0x8e, 0x8a, 0x65, 0x7e, 0x09, 0x58, 0xa6, 0xc0, 0x5e, 0x4c, 0xc8, 0x0c, 0xa9, 0xe9, 0xb6, 0x24, + 0x2e, 0x13, 0xbe, 0x09, 0x14, 0x9c, 0x08, 0x91, 0xf8, 0x38, 0x3a, 0xa3, 0x7c, 0xa4, 0x9b, 0x5d, + 0xec, 0xd8, 0x8e, 0x6e, 0x7a, 0xa5, 0x22, 0x73, 0x1d, 0x74, 0xe0, 0xbd, 0x01, 0x9d, 0xec, 0x31, + 0x83, 0x06, 0x07, 0x59, 0x39, 0x54, 0xd4, 0x12, 0x1a, 0xb3, 0xc7, 0x06, 0x41, 0x44, 0x02, 0x63, + 0x10, 0x50, 0x1a, 0x50, 0x88, 0xe6, 0x1d, 0xa5, 0x55, 0x3a, 0x89, 0x38, 0x39, 0x54, 0x48, 0xf9, + 0x48, 0xaa, 0x81, 0x3e, 0x84, 0x35, 0xea, 0xbf, 0x7d, 0xf3,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x1f, 0x0a, 0x50, 0x88, 0x42, 0x24, 0xc1, 0x89, 0xa8, 0x2a, 0xf7, 0xed, 0xae, 0xa3, 0x68, + 0xfe, 0xe7, 0x48, 0x54, 0xfd, 0x03, 0x46, 0x42, 0x8f, 0x33, 0x53, 0xca, 0x0e, 0xb6, 0x15, 0xdd, + 0xe1, 0x5f, 0x09, 0x00, 0x21, 0x49, 0x94, 0x82, 0xda, 0xb0, 0xcc, 0xc5, 0x65, 0xcb, 0xf6, 0x2b, + 0x9b, 0xc9, 0x9d, 0xaa, 0xea, 0x60, 0xee, 0x16, 0x63, 0x97, 0x0a, 0xfd, 0xc8, 0xb3, 0xd8, 0x03, + 0x34, 0xca, 0x85, 0x5e, 0x85, 0xcd, 0x30, 0x56, 0x39, 0x54, 0x1f, 0x63, 0xa7, 0x65, 0x2d, 0x04, + 0xbb, 0x13, 0x94, 0xca, 0x26, 0x36, 0xb4, 0xc5, 0x0e, 0xac, 0x8c, 0x74, 0x99, 0xd0, 0x3b, 0x90, + 0xfe, 0x44, 0x37, 0x35, 0xeb, 0x93, 0xb1, 0x1f, 0x57, 0x85, 0xe4, 0xee, 0x50, 0x6e, 0x89, 0x4b, + 0x89, 0xbf, 0x2a, 0x44, 0x66, 0x65, 0xa3, 0xa8, 0x0b, 0x25, 0x4d, 0xd1, 0x8d, 0x33, 0x39, 0xdc, + 0x05, 0xe3, 0xeb, 0xb0, 0xc3, 0x1d, 0xff, 0x69, 0xc9, 0x36, 0x11, 0x1a, 0x99, 0xee, 0xe6, 0xd7, + 0xa4, 0x0d, 0x2d, 0x76, 0xe4, 0xc6, 0x12, 0xa4, 0x59, 0x73, 0x4d, 0xec, 0xc0, 0x46, 0xbc, 0xf4, + 0x50, 0x8d, 0x71, 0x6e, 0xb8, 0xc6, 0x58, 0x86, 0x25, 0xad, 0xcf, 0x12, 0x09, 0xee, 0xd6, 0x82, + 0x67, 0xf1, 0xdf, 0x04, 0xb8, 0x10, 0x2a, 0x17, 0x84, 0x36, 0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78, 0x83, 0xc4, 0xb5, 0xdf, 0xca, 0x13, 0x4a, 0x31, 0xe2, 0x75, 0x0a, + 0xf1, 0x15, 0xf1, 0x61, 0x0d, 0x76, 0x5d, 0xb8, 0x8a, 0x7e, 0x5f, 0x80, 0x7c, 0xa4, 0x11, 0x96, + 0x00, 0x2c, 0xae, 0x59, 0x36, 0x11, 0xd8, 0x0e, 0x05, 0x56, 0x2d, 0x4f, 0x65, 0x3b, 0x82, 0xf2, + 0xef, 0x05, 0x28, 0x44, 0xfb, 0x60, 0xe8, 0xea, 0x18, 0x98, 0x43, 0xf7, 0xed, 0x89, 0x38, 0xbb, + 0x14, 0xa7, 0x22, 0xde, 0x9d, 0x06, 0x67, 0x25, 0xc8, 0x20, 0x2a, 0xf7, 0xc3, 0x89, 0xcb, 0x83, + 0x0a, 0xab, 0x12, 0x13, 0x3d, 0xfe, 0x23, 0x9a, 0xf6, 0x85, 0xd3, 0x8b, 0x97, 0x92, 0x02, 0x6f, + 0x72, 0xb3, 0x6c, 0xa2, 0x5e, 0x06, 0xd5, 0xeb, 0x48, 0x54, 0x66, 0xa3, 0x57, 0xe8, 0xfa, 0x4a, + 0x94, 0xfb, 0x53, 0x01, 0x56, 0x46, 0x5a, 0x5f, 0xe8, 0x85, 0xc4, 0x84, 0x22, 0xae, 0x45, 0x36, + 0x51, 0xa5, 0x16, 0x55, 0xa9, 0x21, 0x6e, 0x4f, 0xa5, 0x12, 0x6f, 0x8e, 0x11, 0xd4, 0x7f, 0xc3, + 0xb2, 0x86, 0xd1, 0xef, 0x8d, 0x92, 0xfb, 0x08, 0x09, 0x3d, 0xb4, 0x89, 0xd8, 0x25, 0x8a, 0x7d, + 0x57, 0xdc, 0x99, 0x0a, 0xfb, 0xa0, 0x75, 0x46, 0xe0, 0xff, 0x91, 0x00, 0xcb, 0x43, 0x6d, 0x33, + 0xf4, 0x5c, 0x12, 0xf2, 0x98, 0xe6, 0xda, 0x44, 0xd0, 0x4d, 0x0a, 0xfa, 0xa6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f, 0x63, 0x51, 0x9d, 0xcd, + 0x35, 0x80, 0x46, 0x75, 0x1f, 0x13, 0x51, 0xee, 0x33, 0x01, 0x32, 0x41, 0xc5, 0x10, 0x3d, 0x75, + 0xae, 0x8a, 0xe2, 0x44, 0x25, 0x6e, 0x53, 0x25, 0xda, 0xe2, 0xad, 0xa9, 0x94, 0x88, 0x96, 0x28, + 0x79, 0x02, 0x9d, 0x8f, 0x54, 0x0d, 0x93, 0xd3, 0xa6, 0x91, 0xca, 0xe2, 0x97, 0x94, 0xf1, 0x0f, + 0xfe, 0xfe, 0x8b, 0x00, 0xfe, 0x0b, 0x92, 0xf1, 0x47, 0x4b, 0x8c, 0x49, 0x19, 0x7f, 0x6c, 0x21, + 0x72, 0x22, 0xe8, 0x3b, 0x14, 0xf4, 0x07, 0xe2, 0xee, 0x74, 0xb9, 0x1e, 0x5d, 0xdc, 0xf6, 0x17, + 0x27, 0xc8, 0xff, 0x4e, 0x00, 0x34, 0x5a, 0xb0, 0x44, 0x5b, 0xf1, 0x4e, 0x34, 0xa9, 0xb2, 0x39, + 0x11, 0xff, 0x47, 0x14, 0xff, 0xbe, 0xd8, 0x9a, 0x0a, 0xbf, 0xea, 0xaf, 0x1f, 0x51, 0xe1, 0x1f, + 0xd8, 0x75, 0x2b, 0xdc, 0xb7, 0x49, 0xbe, 0x6e, 0xc5, 0x74, 0x77, 0x26, 0x82, 0x3f, 0xa6, 0xe0, + 0x0f, 0xc5, 0x6f, 0xcc, 0xec, 0xac, 0x12, 0x34, 0x44, 0x95, 0xbf, 0x12, 0x68, 0xa7, 0x21, 0xfa, + 0x47, 0xe8, 0xcf, 0x27, 0xea, 0x12, 0x53, 0x88, 0x9d, 0xa8, 0xcc, 0xcf, 0x53, 0x65, 0x24, 0x71, + 0x6f, 0xda, 0x5b, 0x43, 0x64, 0x75, 0x02, 0xfe, 0xa7, 0xfc, 0xd6, 0x3e, 0xd2, 0x50, 0x1d, 0xf3, + 0xf5, 0x5f, 0x7c, 0x41, 0x76, 0xa2, 0x12, 0x77, 0xa9, 0x12, 0xb7, 0xc5, 0x0f, 0xa6, 0xbf, 0xfa, + 0x0c, 0x21, 0xb8, 0x2e, 0x5c, 0xbd, 0xf1, 0x43, 0x01, 0x36, 0x55, 0xab, 0x17, 0x87, 0xe1, 0xc6, + 0x6a, 0xcd, 0xff, 0x1b, 0x72, 0x5a, 0x66, 0x68, 0x93, 0x9c, 0xb7, 0x2d, 0x7c, 0xf4, 0x36, 0xe7, + 0xed, 0x5a, 0x86, 0x62, 0x76, 0xb7, 0x2c, 0xa7, 0x5b, 0xe9, 0x62, 0x93, 0x66, 0xc4, 0x15, 0x36, + 0xa4, 0xd8, 0xba, 0x1b, 0xf9, 0xdf, 0x86, 0xde, 0x0a, 0x1e, 0x3e, 0x9b, 0x7b, 0x64, 0x87, 0x89, + 0xd7, 0x0c, 0xab, 0xaf, 0x6d, 0xd5, 0x82, 0x05, 0x6f, 0x5f, 0xfb, 0x27, 0x7f, 0xec, 0x2e, 0x1d, + 0xbb, 0x1b, 0x8c, 0xdd, 0xbd, 0x7d, 0xed, 0x30, 0x4d, 0x17, 0x78, 0xf9, 0xff, 0x03, 0x00, 0x00, + 0xff, 0xff, 0x02, 0x2c, 0x64, 0x0b, 0xcd, 0x48, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/container/v1alpha1/cluster_service.pb.go b/vendor/google.golang.org/genproto/googleapis/container/v1alpha1/cluster_service.pb.go new file mode 100644 index 0000000000..ddf0e22d91 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/container/v1alpha1/cluster_service.pb.go @@ -0,0 +1,5588 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/container/v1alpha1/cluster_service.proto + +/* +Package container is a generated protocol buffer package. + +It is generated from these files: + google/container/v1alpha1/cluster_service.proto + +It has these top-level messages: + NodeConfig + NodeTaint + MasterAuth + ClientCertificateConfig + AddonsConfig + HttpLoadBalancing + HorizontalPodAutoscaling + KubernetesDashboard + NetworkPolicyConfig + MasterAuthorizedNetworksConfig + NetworkPolicy + IPAllocationPolicy + PodSecurityPolicyConfig + Cluster + ClusterUpdate + Operation + CreateClusterRequest + GetClusterRequest + UpdateClusterRequest + UpdateNodePoolRequest + SetNodePoolAutoscalingRequest + SetLoggingServiceRequest + SetMonitoringServiceRequest + SetAddonsConfigRequest + SetLocationsRequest + UpdateMasterRequest + SetMasterAuthRequest + DeleteClusterRequest + ListClustersRequest + ListClustersResponse + GetOperationRequest + ListOperationsRequest + CancelOperationRequest + ListOperationsResponse + GetServerConfigRequest + ServerConfig + CreateNodePoolRequest + DeleteNodePoolRequest + ListNodePoolsRequest + GetNodePoolRequest + NodePool + NodeManagement + AutoUpgradeOptions + MaintenancePolicy + MaintenanceWindow + DailyMaintenanceWindow + SetNodePoolManagementRequest + SetNodePoolSizeRequest + RollbackNodePoolUpgradeRequest + ListNodePoolsResponse + NodePoolAutoscaling + SetLabelsRequest + SetLegacyAbacRequest + StartIPRotationRequest + CompleteIPRotationRequest + AcceleratorConfig + SetNetworkPolicyRequest + SetMaintenancePolicyRequest +*/ +package container + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf1 "github.com/golang/protobuf/ptypes/empty" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Possible values for Effect in taint. +type NodeTaint_Effect int32 + +const ( + // Not set + NodeTaint_EFFECT_UNSPECIFIED NodeTaint_Effect = 0 + // NoSchedule + NodeTaint_NO_SCHEDULE NodeTaint_Effect = 1 + // PreferNoSchedule + NodeTaint_PREFER_NO_SCHEDULE NodeTaint_Effect = 2 + // NoExecute + NodeTaint_NO_EXECUTE NodeTaint_Effect = 3 +) + +var NodeTaint_Effect_name = map[int32]string{ + 0: "EFFECT_UNSPECIFIED", + 1: "NO_SCHEDULE", + 2: "PREFER_NO_SCHEDULE", + 3: "NO_EXECUTE", +} +var NodeTaint_Effect_value = map[string]int32{ + "EFFECT_UNSPECIFIED": 0, + "NO_SCHEDULE": 1, + "PREFER_NO_SCHEDULE": 2, + "NO_EXECUTE": 3, +} + +func (x NodeTaint_Effect) String() string { + return proto.EnumName(NodeTaint_Effect_name, int32(x)) +} +func (NodeTaint_Effect) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{1, 0} } + +// Allowed Network Policy providers. +type NetworkPolicy_Provider int32 + +const ( + // Not set + NetworkPolicy_PROVIDER_UNSPECIFIED NetworkPolicy_Provider = 0 + // Tigera (Calico Felix). + NetworkPolicy_CALICO NetworkPolicy_Provider = 1 +) + +var NetworkPolicy_Provider_name = map[int32]string{ + 0: "PROVIDER_UNSPECIFIED", + 1: "CALICO", +} +var NetworkPolicy_Provider_value = map[string]int32{ + "PROVIDER_UNSPECIFIED": 0, + "CALICO": 1, +} + +func (x NetworkPolicy_Provider) String() string { + return proto.EnumName(NetworkPolicy_Provider_name, int32(x)) +} +func (NetworkPolicy_Provider) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{10, 0} } + +// The current status of the cluster. +type Cluster_Status int32 + +const ( + // Not set. + Cluster_STATUS_UNSPECIFIED Cluster_Status = 0 + // The PROVISIONING state indicates the cluster is being created. + Cluster_PROVISIONING Cluster_Status = 1 + // The RUNNING state indicates the cluster has been created and is fully + // usable. + Cluster_RUNNING Cluster_Status = 2 + // The RECONCILING state indicates that some work is actively being done on + // the cluster, such as upgrading the master or node software. Details can + // be found in the `statusMessage` field. + Cluster_RECONCILING Cluster_Status = 3 + // The STOPPING state indicates the cluster is being deleted. + Cluster_STOPPING Cluster_Status = 4 + // The ERROR state indicates the cluster may be unusable. Details + // can be found in the `statusMessage` field. + Cluster_ERROR Cluster_Status = 5 +) + +var Cluster_Status_name = map[int32]string{ + 0: "STATUS_UNSPECIFIED", + 1: "PROVISIONING", + 2: "RUNNING", + 3: "RECONCILING", + 4: "STOPPING", + 5: "ERROR", +} +var Cluster_Status_value = map[string]int32{ + "STATUS_UNSPECIFIED": 0, + "PROVISIONING": 1, + "RUNNING": 2, + "RECONCILING": 3, + "STOPPING": 4, + "ERROR": 5, +} + +func (x Cluster_Status) String() string { + return proto.EnumName(Cluster_Status_name, int32(x)) +} +func (Cluster_Status) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{13, 0} } + +// Current status of the operation. +type Operation_Status int32 + +const ( + // Not set. + Operation_STATUS_UNSPECIFIED Operation_Status = 0 + // The operation has been created. + Operation_PENDING Operation_Status = 1 + // The operation is currently running. + Operation_RUNNING Operation_Status = 2 + // The operation is done, either cancelled or completed. + Operation_DONE Operation_Status = 3 + // The operation is aborting. + Operation_ABORTING Operation_Status = 4 +) + +var Operation_Status_name = map[int32]string{ + 0: "STATUS_UNSPECIFIED", + 1: "PENDING", + 2: "RUNNING", + 3: "DONE", + 4: "ABORTING", +} +var Operation_Status_value = map[string]int32{ + "STATUS_UNSPECIFIED": 0, + "PENDING": 1, + "RUNNING": 2, + "DONE": 3, + "ABORTING": 4, +} + +func (x Operation_Status) String() string { + return proto.EnumName(Operation_Status_name, int32(x)) +} +func (Operation_Status) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{15, 0} } + +// Operation type. +type Operation_Type int32 + +const ( + // Not set. + Operation_TYPE_UNSPECIFIED Operation_Type = 0 + // Cluster create. + Operation_CREATE_CLUSTER Operation_Type = 1 + // Cluster delete. + Operation_DELETE_CLUSTER Operation_Type = 2 + // A master upgrade. + Operation_UPGRADE_MASTER Operation_Type = 3 + // A node upgrade. + Operation_UPGRADE_NODES Operation_Type = 4 + // Cluster repair. + Operation_REPAIR_CLUSTER Operation_Type = 5 + // Cluster update. + Operation_UPDATE_CLUSTER Operation_Type = 6 + // Node pool create. + Operation_CREATE_NODE_POOL Operation_Type = 7 + // Node pool delete. + Operation_DELETE_NODE_POOL Operation_Type = 8 + // Set node pool management. + Operation_SET_NODE_POOL_MANAGEMENT Operation_Type = 9 + // Automatic node pool repair. + Operation_AUTO_REPAIR_NODES Operation_Type = 10 + // Automatic node upgrade. + Operation_AUTO_UPGRADE_NODES Operation_Type = 11 + // Set labels. + Operation_SET_LABELS Operation_Type = 12 + // Set/generate master auth materials + Operation_SET_MASTER_AUTH Operation_Type = 13 + // Set node pool size. + Operation_SET_NODE_POOL_SIZE Operation_Type = 14 + // Updates network policy for a cluster. + Operation_SET_NETWORK_POLICY Operation_Type = 15 + // Set the maintenance policy. + Operation_SET_MAINTENANCE_POLICY Operation_Type = 16 +) + +var Operation_Type_name = map[int32]string{ + 0: "TYPE_UNSPECIFIED", + 1: "CREATE_CLUSTER", + 2: "DELETE_CLUSTER", + 3: "UPGRADE_MASTER", + 4: "UPGRADE_NODES", + 5: "REPAIR_CLUSTER", + 6: "UPDATE_CLUSTER", + 7: "CREATE_NODE_POOL", + 8: "DELETE_NODE_POOL", + 9: "SET_NODE_POOL_MANAGEMENT", + 10: "AUTO_REPAIR_NODES", + 11: "AUTO_UPGRADE_NODES", + 12: "SET_LABELS", + 13: "SET_MASTER_AUTH", + 14: "SET_NODE_POOL_SIZE", + 15: "SET_NETWORK_POLICY", + 16: "SET_MAINTENANCE_POLICY", +} +var Operation_Type_value = map[string]int32{ + "TYPE_UNSPECIFIED": 0, + "CREATE_CLUSTER": 1, + "DELETE_CLUSTER": 2, + "UPGRADE_MASTER": 3, + "UPGRADE_NODES": 4, + "REPAIR_CLUSTER": 5, + "UPDATE_CLUSTER": 6, + "CREATE_NODE_POOL": 7, + "DELETE_NODE_POOL": 8, + "SET_NODE_POOL_MANAGEMENT": 9, + "AUTO_REPAIR_NODES": 10, + "AUTO_UPGRADE_NODES": 11, + "SET_LABELS": 12, + "SET_MASTER_AUTH": 13, + "SET_NODE_POOL_SIZE": 14, + "SET_NETWORK_POLICY": 15, + "SET_MAINTENANCE_POLICY": 16, +} + +func (x Operation_Type) String() string { + return proto.EnumName(Operation_Type_name, int32(x)) +} +func (Operation_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{15, 1} } + +// Operation type: what type update to perform. +type SetMasterAuthRequest_Action int32 + +const ( + // Operation is unknown and will error out. + SetMasterAuthRequest_UNKNOWN SetMasterAuthRequest_Action = 0 + // Set the password to a user generated value. + SetMasterAuthRequest_SET_PASSWORD SetMasterAuthRequest_Action = 1 + // Generate a new password and set it to that. + SetMasterAuthRequest_GENERATE_PASSWORD SetMasterAuthRequest_Action = 2 + // Set the username. If an empty username is provided, basic authentication + // is disabled for the cluster. If a non-empty username is provided, basic + // authentication is enabled, with either a provided password or a generated + // one. + SetMasterAuthRequest_SET_USERNAME SetMasterAuthRequest_Action = 3 +) + +var SetMasterAuthRequest_Action_name = map[int32]string{ + 0: "UNKNOWN", + 1: "SET_PASSWORD", + 2: "GENERATE_PASSWORD", + 3: "SET_USERNAME", +} +var SetMasterAuthRequest_Action_value = map[string]int32{ + "UNKNOWN": 0, + "SET_PASSWORD": 1, + "GENERATE_PASSWORD": 2, + "SET_USERNAME": 3, +} + +func (x SetMasterAuthRequest_Action) String() string { + return proto.EnumName(SetMasterAuthRequest_Action_name, int32(x)) +} +func (SetMasterAuthRequest_Action) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{26, 0} +} + +// The current status of the node pool instance. +type NodePool_Status int32 + +const ( + // Not set. + NodePool_STATUS_UNSPECIFIED NodePool_Status = 0 + // The PROVISIONING state indicates the node pool is being created. + NodePool_PROVISIONING NodePool_Status = 1 + // The RUNNING state indicates the node pool has been created + // and is fully usable. + NodePool_RUNNING NodePool_Status = 2 + // The RUNNING_WITH_ERROR state indicates the node pool has been created + // and is partially usable. Some error state has occurred and some + // functionality may be impaired. Customer may need to reissue a request + // or trigger a new update. + NodePool_RUNNING_WITH_ERROR NodePool_Status = 3 + // The RECONCILING state indicates that some work is actively being done on + // the node pool, such as upgrading node software. Details can + // be found in the `statusMessage` field. + NodePool_RECONCILING NodePool_Status = 4 + // The STOPPING state indicates the node pool is being deleted. + NodePool_STOPPING NodePool_Status = 5 + // The ERROR state indicates the node pool may be unusable. Details + // can be found in the `statusMessage` field. + NodePool_ERROR NodePool_Status = 6 +) + +var NodePool_Status_name = map[int32]string{ + 0: "STATUS_UNSPECIFIED", + 1: "PROVISIONING", + 2: "RUNNING", + 3: "RUNNING_WITH_ERROR", + 4: "RECONCILING", + 5: "STOPPING", + 6: "ERROR", +} +var NodePool_Status_value = map[string]int32{ + "STATUS_UNSPECIFIED": 0, + "PROVISIONING": 1, + "RUNNING": 2, + "RUNNING_WITH_ERROR": 3, + "RECONCILING": 4, + "STOPPING": 5, + "ERROR": 6, +} + +func (x NodePool_Status) String() string { + return proto.EnumName(NodePool_Status_name, int32(x)) +} +func (NodePool_Status) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{40, 0} } + +// Parameters that describe the nodes in a cluster. +type NodeConfig struct { + // The name of a Google Compute Engine [machine + // type](/compute/docs/machine-types) (e.g. + // `n1-standard-1`). + // + // If unspecified, the default machine type is + // `n1-standard-1`. + MachineType string `protobuf:"bytes,1,opt,name=machine_type,json=machineType" json:"machine_type,omitempty"` + // Size of the disk attached to each node, specified in GB. + // The smallest allowed disk size is 10GB. + // + // If unspecified, the default disk size is 100GB. + DiskSizeGb int32 `protobuf:"varint,2,opt,name=disk_size_gb,json=diskSizeGb" json:"disk_size_gb,omitempty"` + // The set of Google API scopes to be made available on all of the + // node VMs under the "default" service account. + // + // The following scopes are recommended, but not required, and by default are + // not included: + // + // * `https://www.googleapis.com/auth/compute` is required for mounting + // persistent storage on your nodes. + // * `https://www.googleapis.com/auth/devstorage.read_only` is required for + // communicating with **gcr.io** + // (the [Google Container Registry](/container-registry/)). + // + // If unspecified, no scopes are added, unless Cloud Logging or Cloud + // Monitoring are enabled, in which case their required scopes will be added. + OauthScopes []string `protobuf:"bytes,3,rep,name=oauth_scopes,json=oauthScopes" json:"oauth_scopes,omitempty"` + // The Google Cloud Platform Service Account to be used by the node VMs. If + // no Service Account is specified, the "default" service account is used. + ServiceAccount string `protobuf:"bytes,9,opt,name=service_account,json=serviceAccount" json:"service_account,omitempty"` + // The metadata key/value pairs assigned to instances in the cluster. + // + // Keys must conform to the regexp [a-zA-Z0-9-_]+ and be less than 128 bytes + // in length. These are reflected as part of a URL in the metadata server. + // Additionally, to avoid ambiguity, keys must not conflict with any other + // metadata keys for the project or be one of the four reserved keys: + // "instance-template", "kube-env", "startup-script", and "user-data" + // + // Values are free-form strings, and only have meaning as interpreted by + // the image running in the instance. The only restriction placed on them is + // that each value's size must be less than or equal to 32 KB. + // + // The total size of all keys and values must be less than 512 KB. + Metadata map[string]string `protobuf:"bytes,4,rep,name=metadata" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // The image type to use for this node. Note that for a given image type, + // the latest version of it will be used. + ImageType string `protobuf:"bytes,5,opt,name=image_type,json=imageType" json:"image_type,omitempty"` + // The map of Kubernetes labels (key/value pairs) to be applied to each node. + // These will added in addition to any default label(s) that + // Kubernetes may apply to the node. + // In case of conflict in label keys, the applied set may differ depending on + // the Kubernetes version -- it's best to assume the behavior is undefined + // and conflicts should be avoided. + // For more information, including usage and the valid values, see: + // https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + Labels map[string]string `protobuf:"bytes,6,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // The number of local SSD disks to be attached to the node. + // + // The limit for this value is dependant upon the maximum number of + // disks available on a machine per zone. See: + // https://cloud.google.com/compute/docs/disks/local-ssd#local_ssd_limits + // for more information. + LocalSsdCount int32 `protobuf:"varint,7,opt,name=local_ssd_count,json=localSsdCount" json:"local_ssd_count,omitempty"` + // The list of instance tags applied to all nodes. Tags are used to identify + // valid sources or targets for network firewalls and are specified by + // the client during cluster or node pool creation. Each tag within the list + // must comply with RFC1035. + Tags []string `protobuf:"bytes,8,rep,name=tags" json:"tags,omitempty"` + // Whether the nodes are created as preemptible VM instances. See: + // https://cloud.google.com/compute/docs/instances/preemptible for more + // inforamtion about preemptible VM instances. + Preemptible bool `protobuf:"varint,10,opt,name=preemptible" json:"preemptible,omitempty"` + // A list of hardware accelerators to be attached to each node. + // See https://cloud.google.com/compute/docs/gpus for more information about + // support for GPUs. + Accelerators []*AcceleratorConfig `protobuf:"bytes,11,rep,name=accelerators" json:"accelerators,omitempty"` + // Minimum CPU platform to be used by this instance. The instance may be + // scheduled on the specified or newer CPU platform. Applicable values are the + // friendly names of CPU platforms, such as + // minCpuPlatform: "Intel Haswell" or + // minCpuPlatform: "Intel Sandy Bridge". For more + // information, read [how to specify min CPU platform](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform) + MinCpuPlatform string `protobuf:"bytes,13,opt,name=min_cpu_platform,json=minCpuPlatform" json:"min_cpu_platform,omitempty"` + // List of kubernetes taints to be applied to each node. + // + // For more information, including usage and the valid values, see: + // https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ + Taints []*NodeTaint `protobuf:"bytes,15,rep,name=taints" json:"taints,omitempty"` +} + +func (m *NodeConfig) Reset() { *m = NodeConfig{} } +func (m *NodeConfig) String() string { return proto.CompactTextString(m) } +func (*NodeConfig) ProtoMessage() {} +func (*NodeConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *NodeConfig) GetMachineType() string { + if m != nil { + return m.MachineType + } + return "" +} + +func (m *NodeConfig) GetDiskSizeGb() int32 { + if m != nil { + return m.DiskSizeGb + } + return 0 +} + +func (m *NodeConfig) GetOauthScopes() []string { + if m != nil { + return m.OauthScopes + } + return nil +} + +func (m *NodeConfig) GetServiceAccount() string { + if m != nil { + return m.ServiceAccount + } + return "" +} + +func (m *NodeConfig) GetMetadata() map[string]string { + if m != nil { + return m.Metadata + } + return nil +} + +func (m *NodeConfig) GetImageType() string { + if m != nil { + return m.ImageType + } + return "" +} + +func (m *NodeConfig) GetLabels() map[string]string { + if m != nil { + return m.Labels + } + return nil +} + +func (m *NodeConfig) GetLocalSsdCount() int32 { + if m != nil { + return m.LocalSsdCount + } + return 0 +} + +func (m *NodeConfig) GetTags() []string { + if m != nil { + return m.Tags + } + return nil +} + +func (m *NodeConfig) GetPreemptible() bool { + if m != nil { + return m.Preemptible + } + return false +} + +func (m *NodeConfig) GetAccelerators() []*AcceleratorConfig { + if m != nil { + return m.Accelerators + } + return nil +} + +func (m *NodeConfig) GetMinCpuPlatform() string { + if m != nil { + return m.MinCpuPlatform + } + return "" +} + +func (m *NodeConfig) GetTaints() []*NodeTaint { + if m != nil { + return m.Taints + } + return nil +} + +// Kubernetes taint is comprised of three fields: key, value, and effect. Effect +// can only be one of three types: NoSchedule, PreferNoSchedule or NoExecute. +// +// For more information, including usage and the valid values, see: +// https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ +type NodeTaint struct { + // Key for taint. + Key string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` + // Value for taint. + Value string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` + // Effect for taint. + Effect NodeTaint_Effect `protobuf:"varint,3,opt,name=effect,enum=google.container.v1alpha1.NodeTaint_Effect" json:"effect,omitempty"` +} + +func (m *NodeTaint) Reset() { *m = NodeTaint{} } +func (m *NodeTaint) String() string { return proto.CompactTextString(m) } +func (*NodeTaint) ProtoMessage() {} +func (*NodeTaint) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *NodeTaint) GetKey() string { + if m != nil { + return m.Key + } + return "" +} + +func (m *NodeTaint) GetValue() string { + if m != nil { + return m.Value + } + return "" +} + +func (m *NodeTaint) GetEffect() NodeTaint_Effect { + if m != nil { + return m.Effect + } + return NodeTaint_EFFECT_UNSPECIFIED +} + +// The authentication information for accessing the master endpoint. +// Authentication can be done using HTTP basic auth or using client +// certificates. +type MasterAuth struct { + // The username to use for HTTP basic authentication to the master endpoint. + // For clusters v1.6.0 and later, you can disable basic authentication by + // providing an empty username. + Username string `protobuf:"bytes,1,opt,name=username" json:"username,omitempty"` + // The password to use for HTTP basic authentication to the master endpoint. + // Because the master endpoint is open to the Internet, you should create a + // strong password. If a password is provided for cluster creation, username + // must be non-empty. + Password string `protobuf:"bytes,2,opt,name=password" json:"password,omitempty"` + // Configuration for client certificate authentication on the cluster. If no + // configuration is specified, a client certificate is issued. + ClientCertificateConfig *ClientCertificateConfig `protobuf:"bytes,3,opt,name=client_certificate_config,json=clientCertificateConfig" json:"client_certificate_config,omitempty"` + // [Output only] Base64-encoded public certificate that is the root of + // trust for the cluster. + ClusterCaCertificate string `protobuf:"bytes,100,opt,name=cluster_ca_certificate,json=clusterCaCertificate" json:"cluster_ca_certificate,omitempty"` + // [Output only] Base64-encoded public certificate used by clients to + // authenticate to the cluster endpoint. + ClientCertificate string `protobuf:"bytes,101,opt,name=client_certificate,json=clientCertificate" json:"client_certificate,omitempty"` + // [Output only] Base64-encoded private key used by clients to authenticate + // to the cluster endpoint. + ClientKey string `protobuf:"bytes,102,opt,name=client_key,json=clientKey" json:"client_key,omitempty"` +} + +func (m *MasterAuth) Reset() { *m = MasterAuth{} } +func (m *MasterAuth) String() string { return proto.CompactTextString(m) } +func (*MasterAuth) ProtoMessage() {} +func (*MasterAuth) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *MasterAuth) GetUsername() string { + if m != nil { + return m.Username + } + return "" +} + +func (m *MasterAuth) GetPassword() string { + if m != nil { + return m.Password + } + return "" +} + +func (m *MasterAuth) GetClientCertificateConfig() *ClientCertificateConfig { + if m != nil { + return m.ClientCertificateConfig + } + return nil +} + +func (m *MasterAuth) GetClusterCaCertificate() string { + if m != nil { + return m.ClusterCaCertificate + } + return "" +} + +func (m *MasterAuth) GetClientCertificate() string { + if m != nil { + return m.ClientCertificate + } + return "" +} + +func (m *MasterAuth) GetClientKey() string { + if m != nil { + return m.ClientKey + } + return "" +} + +// Configuration for client certificates on the cluster. +type ClientCertificateConfig struct { + // Issue a client certificate. + IssueClientCertificate bool `protobuf:"varint,1,opt,name=issue_client_certificate,json=issueClientCertificate" json:"issue_client_certificate,omitempty"` +} + +func (m *ClientCertificateConfig) Reset() { *m = ClientCertificateConfig{} } +func (m *ClientCertificateConfig) String() string { return proto.CompactTextString(m) } +func (*ClientCertificateConfig) ProtoMessage() {} +func (*ClientCertificateConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *ClientCertificateConfig) GetIssueClientCertificate() bool { + if m != nil { + return m.IssueClientCertificate + } + return false +} + +// Configuration for the addons that can be automatically spun up in the +// cluster, enabling additional functionality. +type AddonsConfig struct { + // Configuration for the HTTP (L7) load balancing controller addon, which + // makes it easy to set up HTTP load balancers for services in a cluster. + HttpLoadBalancing *HttpLoadBalancing `protobuf:"bytes,1,opt,name=http_load_balancing,json=httpLoadBalancing" json:"http_load_balancing,omitempty"` + // Configuration for the horizontal pod autoscaling feature, which + // increases or decreases the number of replica pods a replication controller + // has based on the resource usage of the existing pods. + HorizontalPodAutoscaling *HorizontalPodAutoscaling `protobuf:"bytes,2,opt,name=horizontal_pod_autoscaling,json=horizontalPodAutoscaling" json:"horizontal_pod_autoscaling,omitempty"` + // Configuration for the Kubernetes Dashboard. + KubernetesDashboard *KubernetesDashboard `protobuf:"bytes,3,opt,name=kubernetes_dashboard,json=kubernetesDashboard" json:"kubernetes_dashboard,omitempty"` + // Configuration for NetworkPolicy. This only tracks whether the addon + // is enabled or not on the Master, it does not track whether network policy + // is enabled for the nodes. + NetworkPolicyConfig *NetworkPolicyConfig `protobuf:"bytes,4,opt,name=network_policy_config,json=networkPolicyConfig" json:"network_policy_config,omitempty"` +} + +func (m *AddonsConfig) Reset() { *m = AddonsConfig{} } +func (m *AddonsConfig) String() string { return proto.CompactTextString(m) } +func (*AddonsConfig) ProtoMessage() {} +func (*AddonsConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *AddonsConfig) GetHttpLoadBalancing() *HttpLoadBalancing { + if m != nil { + return m.HttpLoadBalancing + } + return nil +} + +func (m *AddonsConfig) GetHorizontalPodAutoscaling() *HorizontalPodAutoscaling { + if m != nil { + return m.HorizontalPodAutoscaling + } + return nil +} + +func (m *AddonsConfig) GetKubernetesDashboard() *KubernetesDashboard { + if m != nil { + return m.KubernetesDashboard + } + return nil +} + +func (m *AddonsConfig) GetNetworkPolicyConfig() *NetworkPolicyConfig { + if m != nil { + return m.NetworkPolicyConfig + } + return nil +} + +// Configuration options for the HTTP (L7) load balancing controller addon, +// which makes it easy to set up HTTP load balancers for services in a cluster. +type HttpLoadBalancing struct { + // Whether the HTTP Load Balancing controller is enabled in the cluster. + // When enabled, it runs a small pod in the cluster that manages the load + // balancers. + Disabled bool `protobuf:"varint,1,opt,name=disabled" json:"disabled,omitempty"` +} + +func (m *HttpLoadBalancing) Reset() { *m = HttpLoadBalancing{} } +func (m *HttpLoadBalancing) String() string { return proto.CompactTextString(m) } +func (*HttpLoadBalancing) ProtoMessage() {} +func (*HttpLoadBalancing) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *HttpLoadBalancing) GetDisabled() bool { + if m != nil { + return m.Disabled + } + return false +} + +// Configuration options for the horizontal pod autoscaling feature, which +// increases or decreases the number of replica pods a replication controller +// has based on the resource usage of the existing pods. +type HorizontalPodAutoscaling struct { + // Whether the Horizontal Pod Autoscaling feature is enabled in the cluster. + // When enabled, it ensures that a Heapster pod is running in the cluster, + // which is also used by the Cloud Monitoring service. + Disabled bool `protobuf:"varint,1,opt,name=disabled" json:"disabled,omitempty"` +} + +func (m *HorizontalPodAutoscaling) Reset() { *m = HorizontalPodAutoscaling{} } +func (m *HorizontalPodAutoscaling) String() string { return proto.CompactTextString(m) } +func (*HorizontalPodAutoscaling) ProtoMessage() {} +func (*HorizontalPodAutoscaling) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *HorizontalPodAutoscaling) GetDisabled() bool { + if m != nil { + return m.Disabled + } + return false +} + +// Configuration for the Kubernetes Dashboard. +type KubernetesDashboard struct { + // Whether the Kubernetes Dashboard is enabled for this cluster. + Disabled bool `protobuf:"varint,1,opt,name=disabled" json:"disabled,omitempty"` +} + +func (m *KubernetesDashboard) Reset() { *m = KubernetesDashboard{} } +func (m *KubernetesDashboard) String() string { return proto.CompactTextString(m) } +func (*KubernetesDashboard) ProtoMessage() {} +func (*KubernetesDashboard) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *KubernetesDashboard) GetDisabled() bool { + if m != nil { + return m.Disabled + } + return false +} + +// Configuration for NetworkPolicy. This only tracks whether the addon +// is enabled or not on the Master, it does not track whether network policy +// is enabled for the nodes. +type NetworkPolicyConfig struct { + // Whether NetworkPolicy is enabled for this cluster. + Disabled bool `protobuf:"varint,1,opt,name=disabled" json:"disabled,omitempty"` +} + +func (m *NetworkPolicyConfig) Reset() { *m = NetworkPolicyConfig{} } +func (m *NetworkPolicyConfig) String() string { return proto.CompactTextString(m) } +func (*NetworkPolicyConfig) ProtoMessage() {} +func (*NetworkPolicyConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *NetworkPolicyConfig) GetDisabled() bool { + if m != nil { + return m.Disabled + } + return false +} + +// Configuration options for the master authorized networks feature. Enabled +// master authorized networks will disallow all external traffic to access +// Kubernetes master through HTTPS except traffic from the given CIDR blocks, +// Google Compute Engine Public IPs and Google Prod IPs. +type MasterAuthorizedNetworksConfig struct { + // Whether or not master authorized networks is enabled. + Enabled bool `protobuf:"varint,1,opt,name=enabled" json:"enabled,omitempty"` + // cidr_blocks define up to 10 external networks that could access + // Kubernetes master through HTTPS. + CidrBlocks []*MasterAuthorizedNetworksConfig_CidrBlock `protobuf:"bytes,2,rep,name=cidr_blocks,json=cidrBlocks" json:"cidr_blocks,omitempty"` +} + +func (m *MasterAuthorizedNetworksConfig) Reset() { *m = MasterAuthorizedNetworksConfig{} } +func (m *MasterAuthorizedNetworksConfig) String() string { return proto.CompactTextString(m) } +func (*MasterAuthorizedNetworksConfig) ProtoMessage() {} +func (*MasterAuthorizedNetworksConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *MasterAuthorizedNetworksConfig) GetEnabled() bool { + if m != nil { + return m.Enabled + } + return false +} + +func (m *MasterAuthorizedNetworksConfig) GetCidrBlocks() []*MasterAuthorizedNetworksConfig_CidrBlock { + if m != nil { + return m.CidrBlocks + } + return nil +} + +// CidrBlock contains an optional name and one CIDR block. +type MasterAuthorizedNetworksConfig_CidrBlock struct { + // display_name is an optional field for users to identify CIDR blocks. + DisplayName string `protobuf:"bytes,1,opt,name=display_name,json=displayName" json:"display_name,omitempty"` + // cidr_block must be specified in CIDR notation. + CidrBlock string `protobuf:"bytes,2,opt,name=cidr_block,json=cidrBlock" json:"cidr_block,omitempty"` +} + +func (m *MasterAuthorizedNetworksConfig_CidrBlock) Reset() { + *m = MasterAuthorizedNetworksConfig_CidrBlock{} +} +func (m *MasterAuthorizedNetworksConfig_CidrBlock) String() string { return proto.CompactTextString(m) } +func (*MasterAuthorizedNetworksConfig_CidrBlock) ProtoMessage() {} +func (*MasterAuthorizedNetworksConfig_CidrBlock) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{9, 0} +} + +func (m *MasterAuthorizedNetworksConfig_CidrBlock) GetDisplayName() string { + if m != nil { + return m.DisplayName + } + return "" +} + +func (m *MasterAuthorizedNetworksConfig_CidrBlock) GetCidrBlock() string { + if m != nil { + return m.CidrBlock + } + return "" +} + +// Configuration options for the NetworkPolicy feature. +// https://kubernetes.io/docs/concepts/services-networking/networkpolicies/ +type NetworkPolicy struct { + // The selected network policy provider. + Provider NetworkPolicy_Provider `protobuf:"varint,1,opt,name=provider,enum=google.container.v1alpha1.NetworkPolicy_Provider" json:"provider,omitempty"` + // Whether network policy is enabled on the cluster. + Enabled bool `protobuf:"varint,2,opt,name=enabled" json:"enabled,omitempty"` +} + +func (m *NetworkPolicy) Reset() { *m = NetworkPolicy{} } +func (m *NetworkPolicy) String() string { return proto.CompactTextString(m) } +func (*NetworkPolicy) ProtoMessage() {} +func (*NetworkPolicy) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *NetworkPolicy) GetProvider() NetworkPolicy_Provider { + if m != nil { + return m.Provider + } + return NetworkPolicy_PROVIDER_UNSPECIFIED +} + +func (m *NetworkPolicy) GetEnabled() bool { + if m != nil { + return m.Enabled + } + return false +} + +// Configuration for controlling how IPs are allocated in the cluster. +type IPAllocationPolicy struct { + // Whether alias IPs will be used for pod IPs in the cluster. + UseIpAliases bool `protobuf:"varint,1,opt,name=use_ip_aliases,json=useIpAliases" json:"use_ip_aliases,omitempty"` + // Whether a new subnetwork will be created automatically for the cluster. + // + // This field is only applicable when `use_ip_aliases` is true. + CreateSubnetwork bool `protobuf:"varint,2,opt,name=create_subnetwork,json=createSubnetwork" json:"create_subnetwork,omitempty"` + // A custom subnetwork name to be used if `create_subnetwork` is true. If + // this field is empty, then an automatic name will be chosen for the new + // subnetwork. + SubnetworkName string `protobuf:"bytes,3,opt,name=subnetwork_name,json=subnetworkName" json:"subnetwork_name,omitempty"` + // This field is deprecated, use cluster_ipv4_cidr_block. + ClusterIpv4Cidr string `protobuf:"bytes,4,opt,name=cluster_ipv4_cidr,json=clusterIpv4Cidr" json:"cluster_ipv4_cidr,omitempty"` + // This field is deprecated, use node_ipv4_cidr_block. + NodeIpv4Cidr string `protobuf:"bytes,5,opt,name=node_ipv4_cidr,json=nodeIpv4Cidr" json:"node_ipv4_cidr,omitempty"` + // This field is deprecated, use services_ipv4_cidr_block. + ServicesIpv4Cidr string `protobuf:"bytes,6,opt,name=services_ipv4_cidr,json=servicesIpv4Cidr" json:"services_ipv4_cidr,omitempty"` + // The name of the secondary range to be used for the cluster CIDR + // block. The secondary range will be used for pod IP + // addresses. This must be an existing secondary range associated + // with the cluster subnetwork. + // + // This field is only applicable if use_ip_aliases is true and + // create_subnetwork is false. + ClusterSecondaryRangeName string `protobuf:"bytes,7,opt,name=cluster_secondary_range_name,json=clusterSecondaryRangeName" json:"cluster_secondary_range_name,omitempty"` + // The name of the secondary range to be used as for the services + // CIDR block. The secondary range will be used for service + // ClusterIPs. This must be an existing secondary range associated + // with the cluster subnetwork. + // + // This field is only applicable with use_ip_aliases is true and + // create_subnetwork is false. + ServicesSecondaryRangeName string `protobuf:"bytes,8,opt,name=services_secondary_range_name,json=servicesSecondaryRangeName" json:"services_secondary_range_name,omitempty"` + // The IP address range for the cluster pod IPs. If this field is set, then + // `cluster.cluster_ipv4_cidr` must be left blank. + // + // This field is only applicable when `use_ip_aliases` is true. + // + // Set to blank to have a range chosen with the default size. + // + // Set to /netmask (e.g. `/14`) to have a range chosen with a specific + // netmask. + // + // Set to a + // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. + // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range + // to use. + ClusterIpv4CidrBlock string `protobuf:"bytes,9,opt,name=cluster_ipv4_cidr_block,json=clusterIpv4CidrBlock" json:"cluster_ipv4_cidr_block,omitempty"` + // The IP address range of the instance IPs in this cluster. + // + // This is applicable only if `create_subnetwork` is true. + // + // Set to blank to have a range chosen with the default size. + // + // Set to /netmask (e.g. `/14`) to have a range chosen with a specific + // netmask. + // + // Set to a + // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. + // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range + // to use. + NodeIpv4CidrBlock string `protobuf:"bytes,10,opt,name=node_ipv4_cidr_block,json=nodeIpv4CidrBlock" json:"node_ipv4_cidr_block,omitempty"` + // The IP address range of the services IPs in this cluster. If blank, a range + // will be automatically chosen with the default size. + // + // This field is only applicable when `use_ip_aliases` is true. + // + // Set to blank to have a range chosen with the default size. + // + // Set to /netmask (e.g. `/14`) to have a range chosen with a specific + // netmask. + // + // Set to a + // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. + // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range + // to use. + ServicesIpv4CidrBlock string `protobuf:"bytes,11,opt,name=services_ipv4_cidr_block,json=servicesIpv4CidrBlock" json:"services_ipv4_cidr_block,omitempty"` +} + +func (m *IPAllocationPolicy) Reset() { *m = IPAllocationPolicy{} } +func (m *IPAllocationPolicy) String() string { return proto.CompactTextString(m) } +func (*IPAllocationPolicy) ProtoMessage() {} +func (*IPAllocationPolicy) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } + +func (m *IPAllocationPolicy) GetUseIpAliases() bool { + if m != nil { + return m.UseIpAliases + } + return false +} + +func (m *IPAllocationPolicy) GetCreateSubnetwork() bool { + if m != nil { + return m.CreateSubnetwork + } + return false +} + +func (m *IPAllocationPolicy) GetSubnetworkName() string { + if m != nil { + return m.SubnetworkName + } + return "" +} + +func (m *IPAllocationPolicy) GetClusterIpv4Cidr() string { + if m != nil { + return m.ClusterIpv4Cidr + } + return "" +} + +func (m *IPAllocationPolicy) GetNodeIpv4Cidr() string { + if m != nil { + return m.NodeIpv4Cidr + } + return "" +} + +func (m *IPAllocationPolicy) GetServicesIpv4Cidr() string { + if m != nil { + return m.ServicesIpv4Cidr + } + return "" +} + +func (m *IPAllocationPolicy) GetClusterSecondaryRangeName() string { + if m != nil { + return m.ClusterSecondaryRangeName + } + return "" +} + +func (m *IPAllocationPolicy) GetServicesSecondaryRangeName() string { + if m != nil { + return m.ServicesSecondaryRangeName + } + return "" +} + +func (m *IPAllocationPolicy) GetClusterIpv4CidrBlock() string { + if m != nil { + return m.ClusterIpv4CidrBlock + } + return "" +} + +func (m *IPAllocationPolicy) GetNodeIpv4CidrBlock() string { + if m != nil { + return m.NodeIpv4CidrBlock + } + return "" +} + +func (m *IPAllocationPolicy) GetServicesIpv4CidrBlock() string { + if m != nil { + return m.ServicesIpv4CidrBlock + } + return "" +} + +// Configuration for the PodSecurityPolicy feature. +type PodSecurityPolicyConfig struct { + // Enable the PodSecurityPolicy controller for this cluster. If enabled, pods + // must be valid under a PodSecurityPolicy to be created. + Enabled bool `protobuf:"varint,1,opt,name=enabled" json:"enabled,omitempty"` +} + +func (m *PodSecurityPolicyConfig) Reset() { *m = PodSecurityPolicyConfig{} } +func (m *PodSecurityPolicyConfig) String() string { return proto.CompactTextString(m) } +func (*PodSecurityPolicyConfig) ProtoMessage() {} +func (*PodSecurityPolicyConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } + +func (m *PodSecurityPolicyConfig) GetEnabled() bool { + if m != nil { + return m.Enabled + } + return false +} + +// A Google Container Engine cluster. +type Cluster struct { + // The name of this cluster. The name must be unique within this project + // and zone, and can be up to 40 characters with the following restrictions: + // + // * Lowercase letters, numbers, and hyphens only. + // * Must start with a letter. + // * Must end with a number or a letter. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // An optional description of this cluster. + Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` + // The number of nodes to create in this cluster. You must ensure that your + // Compute Engine resource quota + // is sufficient for this number of instances. You must also have available + // firewall and routes quota. + // For requests, this field should only be used in lieu of a + // "node_pool" object, since this configuration (along with the + // "node_config") will be used to create a "NodePool" object with an + // auto-generated name. Do not use this and a node_pool at the same time. + InitialNodeCount int32 `protobuf:"varint,3,opt,name=initial_node_count,json=initialNodeCount" json:"initial_node_count,omitempty"` + // Parameters used in creating the cluster's nodes. + // See `nodeConfig` for the description of its properties. + // For requests, this field should only be used in lieu of a + // "node_pool" object, since this configuration (along with the + // "initial_node_count") will be used to create a "NodePool" object with an + // auto-generated name. Do not use this and a node_pool at the same time. + // For responses, this field will be populated with the node configuration of + // the first node pool. + // + // If unspecified, the defaults are used. + NodeConfig *NodeConfig `protobuf:"bytes,4,opt,name=node_config,json=nodeConfig" json:"node_config,omitempty"` + // The authentication information for accessing the master endpoint. + MasterAuth *MasterAuth `protobuf:"bytes,5,opt,name=master_auth,json=masterAuth" json:"master_auth,omitempty"` + // The logging service the cluster should use to write logs. + // Currently available options: + // + // * `logging.googleapis.com` - the Google Cloud Logging service. + // * `none` - no logs will be exported from the cluster. + // * if left as an empty string,`logging.googleapis.com` will be used. + LoggingService string `protobuf:"bytes,6,opt,name=logging_service,json=loggingService" json:"logging_service,omitempty"` + // The monitoring service the cluster should use to write metrics. + // Currently available options: + // + // * `monitoring.googleapis.com` - the Google Cloud Monitoring service. + // * `none` - no metrics will be exported from the cluster. + // * if left as an empty string, `monitoring.googleapis.com` will be used. + MonitoringService string `protobuf:"bytes,7,opt,name=monitoring_service,json=monitoringService" json:"monitoring_service,omitempty"` + // The name of the Google Compute Engine + // [network](/compute/docs/networks-and-firewalls#networks) to which the + // cluster is connected. If left unspecified, the `default` network + // will be used. + Network string `protobuf:"bytes,8,opt,name=network" json:"network,omitempty"` + // The IP address range of the container pods in this cluster, in + // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // notation (e.g. `10.96.0.0/14`). Leave blank to have + // one automatically chosen or specify a `/14` block in `10.0.0.0/8`. + ClusterIpv4Cidr string `protobuf:"bytes,9,opt,name=cluster_ipv4_cidr,json=clusterIpv4Cidr" json:"cluster_ipv4_cidr,omitempty"` + // Configurations for the various addons available to run in the cluster. + AddonsConfig *AddonsConfig `protobuf:"bytes,10,opt,name=addons_config,json=addonsConfig" json:"addons_config,omitempty"` + // The name of the Google Compute Engine + // [subnetwork](/compute/docs/subnetworks) to which the + // cluster is connected. + Subnetwork string `protobuf:"bytes,11,opt,name=subnetwork" json:"subnetwork,omitempty"` + // The node pools associated with this cluster. + // This field should not be set if "node_config" or "initial_node_count" are + // specified. + NodePools []*NodePool `protobuf:"bytes,12,rep,name=node_pools,json=nodePools" json:"node_pools,omitempty"` + // The list of Google Compute Engine + // [locations](/compute/docs/zones#available) in which the cluster's nodes + // should be located. + Locations []string `protobuf:"bytes,13,rep,name=locations" json:"locations,omitempty"` + // Kubernetes alpha features are enabled on this cluster. This includes alpha + // API groups (e.g. v1alpha1) and features that may not be production ready in + // the kubernetes version of the master and nodes. + // The cluster has no SLA for uptime and master/node upgrades are disabled. + // Alpha enabled clusters are automatically deleted thirty days after + // creation. + EnableKubernetesAlpha bool `protobuf:"varint,14,opt,name=enable_kubernetes_alpha,json=enableKubernetesAlpha" json:"enable_kubernetes_alpha,omitempty"` + // Configuration options for the NetworkPolicy feature. + NetworkPolicy *NetworkPolicy `protobuf:"bytes,19,opt,name=network_policy,json=networkPolicy" json:"network_policy,omitempty"` + // Configuration for cluster IP allocation. + IpAllocationPolicy *IPAllocationPolicy `protobuf:"bytes,20,opt,name=ip_allocation_policy,json=ipAllocationPolicy" json:"ip_allocation_policy,omitempty"` + // The configuration options for master authorized networks feature. + MasterAuthorizedNetworksConfig *MasterAuthorizedNetworksConfig `protobuf:"bytes,22,opt,name=master_authorized_networks_config,json=masterAuthorizedNetworksConfig" json:"master_authorized_networks_config,omitempty"` + // Configure the maintenance policy for this cluster. + MaintenancePolicy *MaintenancePolicy `protobuf:"bytes,23,opt,name=maintenance_policy,json=maintenancePolicy" json:"maintenance_policy,omitempty"` + // Configuration for the PodSecurityPolicy feature. + PodSecurityPolicyConfig *PodSecurityPolicyConfig `protobuf:"bytes,25,opt,name=pod_security_policy_config,json=podSecurityPolicyConfig" json:"pod_security_policy_config,omitempty"` + // [Output only] Server-defined URL for the resource. + SelfLink string `protobuf:"bytes,100,opt,name=self_link,json=selfLink" json:"self_link,omitempty"` + // [Output only] The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use location instead. + Zone string `protobuf:"bytes,101,opt,name=zone" json:"zone,omitempty"` + // [Output only] The IP address of this cluster's master endpoint. + // The endpoint can be accessed from the internet at + // `https://username:password@endpoint/`. + // + // See the `masterAuth` property of this resource for username and + // password information. + Endpoint string `protobuf:"bytes,102,opt,name=endpoint" json:"endpoint,omitempty"` + // The initial Kubernetes version for this cluster. Valid versions are those + // found in validMasterVersions returned by getServerConfig. The version can + // be upgraded over time; such upgrades are reflected in + // currentMasterVersion and currentNodeVersion. + InitialClusterVersion string `protobuf:"bytes,103,opt,name=initial_cluster_version,json=initialClusterVersion" json:"initial_cluster_version,omitempty"` + // [Output only] The current software version of the master endpoint. + CurrentMasterVersion string `protobuf:"bytes,104,opt,name=current_master_version,json=currentMasterVersion" json:"current_master_version,omitempty"` + // [Output only] The current version of the node software components. + // If they are currently at multiple versions because they're in the process + // of being upgraded, this reflects the minimum version of all nodes. + CurrentNodeVersion string `protobuf:"bytes,105,opt,name=current_node_version,json=currentNodeVersion" json:"current_node_version,omitempty"` + // [Output only] The time the cluster was created, in + // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + CreateTime string `protobuf:"bytes,106,opt,name=create_time,json=createTime" json:"create_time,omitempty"` + // [Output only] The current status of this cluster. + Status Cluster_Status `protobuf:"varint,107,opt,name=status,enum=google.container.v1alpha1.Cluster_Status" json:"status,omitempty"` + // [Output only] Additional information about the current status of this + // cluster, if available. + StatusMessage string `protobuf:"bytes,108,opt,name=status_message,json=statusMessage" json:"status_message,omitempty"` + // [Output only] The size of the address space on each node for hosting + // containers. This is provisioned from within the `container_ipv4_cidr` + // range. + NodeIpv4CidrSize int32 `protobuf:"varint,109,opt,name=node_ipv4_cidr_size,json=nodeIpv4CidrSize" json:"node_ipv4_cidr_size,omitempty"` + // [Output only] The IP address range of the Kubernetes services in + // this cluster, in + // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // notation (e.g. `1.2.3.4/29`). Service addresses are + // typically put in the last `/16` from the container CIDR. + ServicesIpv4Cidr string `protobuf:"bytes,110,opt,name=services_ipv4_cidr,json=servicesIpv4Cidr" json:"services_ipv4_cidr,omitempty"` + // [Output only] The resource URLs of [instance + // groups](/compute/docs/instance-groups/) associated with this + // cluster. + InstanceGroupUrls []string `protobuf:"bytes,111,rep,name=instance_group_urls,json=instanceGroupUrls" json:"instance_group_urls,omitempty"` + // [Output only] The number of nodes currently in the cluster. + CurrentNodeCount int32 `protobuf:"varint,112,opt,name=current_node_count,json=currentNodeCount" json:"current_node_count,omitempty"` + // [Output only] The time the cluster will be automatically + // deleted in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + ExpireTime string `protobuf:"bytes,113,opt,name=expire_time,json=expireTime" json:"expire_time,omitempty"` + // [Output only] The name of the Google Compute Engine + // [zone](/compute/docs/regions-zones/regions-zones#available) or + // [region](/compute/docs/regions-zones/regions-zones#available) in which + // the cluster resides. + Location string `protobuf:"bytes,114,opt,name=location" json:"location,omitempty"` +} + +func (m *Cluster) Reset() { *m = Cluster{} } +func (m *Cluster) String() string { return proto.CompactTextString(m) } +func (*Cluster) ProtoMessage() {} +func (*Cluster) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } + +func (m *Cluster) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Cluster) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *Cluster) GetInitialNodeCount() int32 { + if m != nil { + return m.InitialNodeCount + } + return 0 +} + +func (m *Cluster) GetNodeConfig() *NodeConfig { + if m != nil { + return m.NodeConfig + } + return nil +} + +func (m *Cluster) GetMasterAuth() *MasterAuth { + if m != nil { + return m.MasterAuth + } + return nil +} + +func (m *Cluster) GetLoggingService() string { + if m != nil { + return m.LoggingService + } + return "" +} + +func (m *Cluster) GetMonitoringService() string { + if m != nil { + return m.MonitoringService + } + return "" +} + +func (m *Cluster) GetNetwork() string { + if m != nil { + return m.Network + } + return "" +} + +func (m *Cluster) GetClusterIpv4Cidr() string { + if m != nil { + return m.ClusterIpv4Cidr + } + return "" +} + +func (m *Cluster) GetAddonsConfig() *AddonsConfig { + if m != nil { + return m.AddonsConfig + } + return nil +} + +func (m *Cluster) GetSubnetwork() string { + if m != nil { + return m.Subnetwork + } + return "" +} + +func (m *Cluster) GetNodePools() []*NodePool { + if m != nil { + return m.NodePools + } + return nil +} + +func (m *Cluster) GetLocations() []string { + if m != nil { + return m.Locations + } + return nil +} + +func (m *Cluster) GetEnableKubernetesAlpha() bool { + if m != nil { + return m.EnableKubernetesAlpha + } + return false +} + +func (m *Cluster) GetNetworkPolicy() *NetworkPolicy { + if m != nil { + return m.NetworkPolicy + } + return nil +} + +func (m *Cluster) GetIpAllocationPolicy() *IPAllocationPolicy { + if m != nil { + return m.IpAllocationPolicy + } + return nil +} + +func (m *Cluster) GetMasterAuthorizedNetworksConfig() *MasterAuthorizedNetworksConfig { + if m != nil { + return m.MasterAuthorizedNetworksConfig + } + return nil +} + +func (m *Cluster) GetMaintenancePolicy() *MaintenancePolicy { + if m != nil { + return m.MaintenancePolicy + } + return nil +} + +func (m *Cluster) GetPodSecurityPolicyConfig() *PodSecurityPolicyConfig { + if m != nil { + return m.PodSecurityPolicyConfig + } + return nil +} + +func (m *Cluster) GetSelfLink() string { + if m != nil { + return m.SelfLink + } + return "" +} + +func (m *Cluster) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *Cluster) GetEndpoint() string { + if m != nil { + return m.Endpoint + } + return "" +} + +func (m *Cluster) GetInitialClusterVersion() string { + if m != nil { + return m.InitialClusterVersion + } + return "" +} + +func (m *Cluster) GetCurrentMasterVersion() string { + if m != nil { + return m.CurrentMasterVersion + } + return "" +} + +func (m *Cluster) GetCurrentNodeVersion() string { + if m != nil { + return m.CurrentNodeVersion + } + return "" +} + +func (m *Cluster) GetCreateTime() string { + if m != nil { + return m.CreateTime + } + return "" +} + +func (m *Cluster) GetStatus() Cluster_Status { + if m != nil { + return m.Status + } + return Cluster_STATUS_UNSPECIFIED +} + +func (m *Cluster) GetStatusMessage() string { + if m != nil { + return m.StatusMessage + } + return "" +} + +func (m *Cluster) GetNodeIpv4CidrSize() int32 { + if m != nil { + return m.NodeIpv4CidrSize + } + return 0 +} + +func (m *Cluster) GetServicesIpv4Cidr() string { + if m != nil { + return m.ServicesIpv4Cidr + } + return "" +} + +func (m *Cluster) GetInstanceGroupUrls() []string { + if m != nil { + return m.InstanceGroupUrls + } + return nil +} + +func (m *Cluster) GetCurrentNodeCount() int32 { + if m != nil { + return m.CurrentNodeCount + } + return 0 +} + +func (m *Cluster) GetExpireTime() string { + if m != nil { + return m.ExpireTime + } + return "" +} + +func (m *Cluster) GetLocation() string { + if m != nil { + return m.Location + } + return "" +} + +// ClusterUpdate describes an update to the cluster. Exactly one update can +// be applied to a cluster with each request, so at most one field can be +// provided. +type ClusterUpdate struct { + // The Kubernetes version to change the nodes to (typically an + // upgrade). Use `-` to upgrade to the latest version supported by + // the server. + DesiredNodeVersion string `protobuf:"bytes,4,opt,name=desired_node_version,json=desiredNodeVersion" json:"desired_node_version,omitempty"` + // The monitoring service the cluster should use to write metrics. + // Currently available options: + // + // * "monitoring.googleapis.com" - the Google Cloud Monitoring service + // * "none" - no metrics will be exported from the cluster + DesiredMonitoringService string `protobuf:"bytes,5,opt,name=desired_monitoring_service,json=desiredMonitoringService" json:"desired_monitoring_service,omitempty"` + // Configurations for the various addons available to run in the cluster. + DesiredAddonsConfig *AddonsConfig `protobuf:"bytes,6,opt,name=desired_addons_config,json=desiredAddonsConfig" json:"desired_addons_config,omitempty"` + // The node pool to be upgraded. This field is mandatory if + // "desired_node_version", "desired_image_family" or + // "desired_node_pool_autoscaling" is specified and there is more than one + // node pool on the cluster. + DesiredNodePoolId string `protobuf:"bytes,7,opt,name=desired_node_pool_id,json=desiredNodePoolId" json:"desired_node_pool_id,omitempty"` + // The desired image type for the node pool. + // NOTE: Set the "desired_node_pool" field as well. + DesiredImageType string `protobuf:"bytes,8,opt,name=desired_image_type,json=desiredImageType" json:"desired_image_type,omitempty"` + // Autoscaler configuration for the node pool specified in + // desired_node_pool_id. If there is only one pool in the + // cluster and desired_node_pool_id is not provided then + // the change applies to that single node pool. + DesiredNodePoolAutoscaling *NodePoolAutoscaling `protobuf:"bytes,9,opt,name=desired_node_pool_autoscaling,json=desiredNodePoolAutoscaling" json:"desired_node_pool_autoscaling,omitempty"` + // The desired list of Google Compute Engine + // [locations](/compute/docs/zones#available) in which the cluster's nodes + // should be located. Changing the locations a cluster is in will result + // in nodes being either created or removed from the cluster, depending on + // whether locations are being added or removed. + // + // This list must always include the cluster's primary zone. + DesiredLocations []string `protobuf:"bytes,10,rep,name=desired_locations,json=desiredLocations" json:"desired_locations,omitempty"` + // The desired configuration options for master authorized networks feature. + DesiredMasterAuthorizedNetworksConfig *MasterAuthorizedNetworksConfig `protobuf:"bytes,12,opt,name=desired_master_authorized_networks_config,json=desiredMasterAuthorizedNetworksConfig" json:"desired_master_authorized_networks_config,omitempty"` + // The desired configuration options for the PodSecurityPolicy feature. + DesiredPodSecurityPolicyConfig *PodSecurityPolicyConfig `protobuf:"bytes,14,opt,name=desired_pod_security_policy_config,json=desiredPodSecurityPolicyConfig" json:"desired_pod_security_policy_config,omitempty"` + // The Kubernetes version to change the master to. The only valid value is the + // latest supported version. Use "-" to have the server automatically select + // the latest version. + DesiredMasterVersion string `protobuf:"bytes,100,opt,name=desired_master_version,json=desiredMasterVersion" json:"desired_master_version,omitempty"` +} + +func (m *ClusterUpdate) Reset() { *m = ClusterUpdate{} } +func (m *ClusterUpdate) String() string { return proto.CompactTextString(m) } +func (*ClusterUpdate) ProtoMessage() {} +func (*ClusterUpdate) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } + +func (m *ClusterUpdate) GetDesiredNodeVersion() string { + if m != nil { + return m.DesiredNodeVersion + } + return "" +} + +func (m *ClusterUpdate) GetDesiredMonitoringService() string { + if m != nil { + return m.DesiredMonitoringService + } + return "" +} + +func (m *ClusterUpdate) GetDesiredAddonsConfig() *AddonsConfig { + if m != nil { + return m.DesiredAddonsConfig + } + return nil +} + +func (m *ClusterUpdate) GetDesiredNodePoolId() string { + if m != nil { + return m.DesiredNodePoolId + } + return "" +} + +func (m *ClusterUpdate) GetDesiredImageType() string { + if m != nil { + return m.DesiredImageType + } + return "" +} + +func (m *ClusterUpdate) GetDesiredNodePoolAutoscaling() *NodePoolAutoscaling { + if m != nil { + return m.DesiredNodePoolAutoscaling + } + return nil +} + +func (m *ClusterUpdate) GetDesiredLocations() []string { + if m != nil { + return m.DesiredLocations + } + return nil +} + +func (m *ClusterUpdate) GetDesiredMasterAuthorizedNetworksConfig() *MasterAuthorizedNetworksConfig { + if m != nil { + return m.DesiredMasterAuthorizedNetworksConfig + } + return nil +} + +func (m *ClusterUpdate) GetDesiredPodSecurityPolicyConfig() *PodSecurityPolicyConfig { + if m != nil { + return m.DesiredPodSecurityPolicyConfig + } + return nil +} + +func (m *ClusterUpdate) GetDesiredMasterVersion() string { + if m != nil { + return m.DesiredMasterVersion + } + return "" +} + +// This operation resource represents operations that may have happened or are +// happening on the cluster. All fields are output only. +type Operation struct { + // The server-assigned ID for the operation. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the operation + // is taking place. + // This field is deprecated, use location instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The operation type. + OperationType Operation_Type `protobuf:"varint,3,opt,name=operation_type,json=operationType,enum=google.container.v1alpha1.Operation_Type" json:"operation_type,omitempty"` + // The current status of the operation. + Status Operation_Status `protobuf:"varint,4,opt,name=status,enum=google.container.v1alpha1.Operation_Status" json:"status,omitempty"` + // Detailed operation progress, if available. + Detail string `protobuf:"bytes,8,opt,name=detail" json:"detail,omitempty"` + // If an error has occurred, a textual description of the error. + StatusMessage string `protobuf:"bytes,5,opt,name=status_message,json=statusMessage" json:"status_message,omitempty"` + // Server-defined URL for the resource. + SelfLink string `protobuf:"bytes,6,opt,name=self_link,json=selfLink" json:"self_link,omitempty"` + // Server-defined URL for the target of the operation. + TargetLink string `protobuf:"bytes,7,opt,name=target_link,json=targetLink" json:"target_link,omitempty"` + // [Output only] The name of the Google Compute Engine + // [zone](/compute/docs/regions-zones/regions-zones#available) or + // [region](/compute/docs/regions-zones/regions-zones#available) in which + // the cluster resides. + Location string `protobuf:"bytes,9,opt,name=location" json:"location,omitempty"` + // [Output only] The time the operation started, in + // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + StartTime string `protobuf:"bytes,10,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + // [Output only] The time the operation completed, in + // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + EndTime string `protobuf:"bytes,11,opt,name=end_time,json=endTime" json:"end_time,omitempty"` +} + +func (m *Operation) Reset() { *m = Operation{} } +func (m *Operation) String() string { return proto.CompactTextString(m) } +func (*Operation) ProtoMessage() {} +func (*Operation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } + +func (m *Operation) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Operation) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *Operation) GetOperationType() Operation_Type { + if m != nil { + return m.OperationType + } + return Operation_TYPE_UNSPECIFIED +} + +func (m *Operation) GetStatus() Operation_Status { + if m != nil { + return m.Status + } + return Operation_STATUS_UNSPECIFIED +} + +func (m *Operation) GetDetail() string { + if m != nil { + return m.Detail + } + return "" +} + +func (m *Operation) GetStatusMessage() string { + if m != nil { + return m.StatusMessage + } + return "" +} + +func (m *Operation) GetSelfLink() string { + if m != nil { + return m.SelfLink + } + return "" +} + +func (m *Operation) GetTargetLink() string { + if m != nil { + return m.TargetLink + } + return "" +} + +func (m *Operation) GetLocation() string { + if m != nil { + return m.Location + } + return "" +} + +func (m *Operation) GetStartTime() string { + if m != nil { + return m.StartTime + } + return "" +} + +func (m *Operation) GetEndTime() string { + if m != nil { + return m.EndTime + } + return "" +} + +// CreateClusterRequest creates a cluster. +type CreateClusterRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + // This field is deprecated, use parent instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use parent instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // A [cluster + // resource](/container-engine/reference/rest/v1alpha1/projects.zones.clusters) + Cluster *Cluster `protobuf:"bytes,3,opt,name=cluster" json:"cluster,omitempty"` + // The parent (project and location) where the cluster will be created. + // Specified in the format 'projects/*/locations/*'. + Parent string `protobuf:"bytes,5,opt,name=parent" json:"parent,omitempty"` +} + +func (m *CreateClusterRequest) Reset() { *m = CreateClusterRequest{} } +func (m *CreateClusterRequest) String() string { return proto.CompactTextString(m) } +func (*CreateClusterRequest) ProtoMessage() {} +func (*CreateClusterRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} } + +func (m *CreateClusterRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *CreateClusterRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *CreateClusterRequest) GetCluster() *Cluster { + if m != nil { + return m.Cluster + } + return nil +} + +func (m *CreateClusterRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +// GetClusterRequest gets the settings of a cluster. +type GetClusterRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + // This field is deprecated, use name instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use name instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster to retrieve. + // This field is deprecated, use name instead. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The name (project, location, cluster) of the cluster to retrieve. + // Specified in the format 'projects/*/locations/*/clusters/*'. + Name string `protobuf:"bytes,5,opt,name=name" json:"name,omitempty"` +} + +func (m *GetClusterRequest) Reset() { *m = GetClusterRequest{} } +func (m *GetClusterRequest) String() string { return proto.CompactTextString(m) } +func (*GetClusterRequest) ProtoMessage() {} +func (*GetClusterRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17} } + +func (m *GetClusterRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *GetClusterRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *GetClusterRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *GetClusterRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// UpdateClusterRequest updates the settings of a cluster. +type UpdateClusterRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + // This field is deprecated, use name instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use name instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster to upgrade. + // This field is deprecated, use name instead. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // A description of the update. + Update *ClusterUpdate `protobuf:"bytes,4,opt,name=update" json:"update,omitempty"` + // The name (project, location, cluster) of the cluster to update. + // Specified in the format 'projects/*/locations/*/clusters/*'. + Name string `protobuf:"bytes,5,opt,name=name" json:"name,omitempty"` +} + +func (m *UpdateClusterRequest) Reset() { *m = UpdateClusterRequest{} } +func (m *UpdateClusterRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateClusterRequest) ProtoMessage() {} +func (*UpdateClusterRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{18} } + +func (m *UpdateClusterRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *UpdateClusterRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *UpdateClusterRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *UpdateClusterRequest) GetUpdate() *ClusterUpdate { + if m != nil { + return m.Update + } + return nil +} + +func (m *UpdateClusterRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// SetNodePoolVersionRequest updates the version of a node pool. +type UpdateNodePoolRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + // This field is deprecated, use name instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use name instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster to upgrade. + // This field is deprecated, use name instead. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The name of the node pool to upgrade. + // This field is deprecated, use name instead. + NodePoolId string `protobuf:"bytes,4,opt,name=node_pool_id,json=nodePoolId" json:"node_pool_id,omitempty"` + // The Kubernetes version to change the nodes to (typically an + // upgrade). Use `-` to upgrade to the latest version supported by + // the server. + NodeVersion string `protobuf:"bytes,5,opt,name=node_version,json=nodeVersion" json:"node_version,omitempty"` + // The desired image type for the node pool. + ImageType string `protobuf:"bytes,6,opt,name=image_type,json=imageType" json:"image_type,omitempty"` + // The name (project, location, cluster, node pool) of the node pool to update. + // Specified in the format 'projects/*/locations/*/clusters/*/nodePools/*'. + Name string `protobuf:"bytes,8,opt,name=name" json:"name,omitempty"` +} + +func (m *UpdateNodePoolRequest) Reset() { *m = UpdateNodePoolRequest{} } +func (m *UpdateNodePoolRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateNodePoolRequest) ProtoMessage() {} +func (*UpdateNodePoolRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{19} } + +func (m *UpdateNodePoolRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *UpdateNodePoolRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *UpdateNodePoolRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *UpdateNodePoolRequest) GetNodePoolId() string { + if m != nil { + return m.NodePoolId + } + return "" +} + +func (m *UpdateNodePoolRequest) GetNodeVersion() string { + if m != nil { + return m.NodeVersion + } + return "" +} + +func (m *UpdateNodePoolRequest) GetImageType() string { + if m != nil { + return m.ImageType + } + return "" +} + +func (m *UpdateNodePoolRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// SetNodePoolAutoscalingRequest sets the autoscaler settings of a node pool. +type SetNodePoolAutoscalingRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + // This field is deprecated, use name instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use name instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster to upgrade. + // This field is deprecated, use name instead. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The name of the node pool to upgrade. + // This field is deprecated, use name instead. + NodePoolId string `protobuf:"bytes,4,opt,name=node_pool_id,json=nodePoolId" json:"node_pool_id,omitempty"` + // Autoscaling configuration for the node pool. + Autoscaling *NodePoolAutoscaling `protobuf:"bytes,5,opt,name=autoscaling" json:"autoscaling,omitempty"` + // The name (project, location, cluster, node pool) of the node pool to set + // autoscaler settings. Specified in the format + // 'projects/*/locations/*/clusters/*/nodePools/*'. + Name string `protobuf:"bytes,6,opt,name=name" json:"name,omitempty"` +} + +func (m *SetNodePoolAutoscalingRequest) Reset() { *m = SetNodePoolAutoscalingRequest{} } +func (m *SetNodePoolAutoscalingRequest) String() string { return proto.CompactTextString(m) } +func (*SetNodePoolAutoscalingRequest) ProtoMessage() {} +func (*SetNodePoolAutoscalingRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20} } + +func (m *SetNodePoolAutoscalingRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *SetNodePoolAutoscalingRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *SetNodePoolAutoscalingRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *SetNodePoolAutoscalingRequest) GetNodePoolId() string { + if m != nil { + return m.NodePoolId + } + return "" +} + +func (m *SetNodePoolAutoscalingRequest) GetAutoscaling() *NodePoolAutoscaling { + if m != nil { + return m.Autoscaling + } + return nil +} + +func (m *SetNodePoolAutoscalingRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// SetLoggingServiceRequest sets the logging service of a cluster. +type SetLoggingServiceRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + // This field is deprecated, use name instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster to upgrade. + // This field is deprecated, use name instead. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The logging service the cluster should use to write metrics. + // Currently available options: + // + // * "logging.googleapis.com" - the Google Cloud Logging service + // * "none" - no metrics will be exported from the cluster + LoggingService string `protobuf:"bytes,4,opt,name=logging_service,json=loggingService" json:"logging_service,omitempty"` + // The name (project, location, cluster) of the cluster to set logging. + // Specified in the format 'projects/*/locations/*/clusters/*'. + Name string `protobuf:"bytes,5,opt,name=name" json:"name,omitempty"` +} + +func (m *SetLoggingServiceRequest) Reset() { *m = SetLoggingServiceRequest{} } +func (m *SetLoggingServiceRequest) String() string { return proto.CompactTextString(m) } +func (*SetLoggingServiceRequest) ProtoMessage() {} +func (*SetLoggingServiceRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{21} } + +func (m *SetLoggingServiceRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *SetLoggingServiceRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *SetLoggingServiceRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *SetLoggingServiceRequest) GetLoggingService() string { + if m != nil { + return m.LoggingService + } + return "" +} + +func (m *SetLoggingServiceRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// SetMonitoringServiceRequest sets the monitoring service of a cluster. +type SetMonitoringServiceRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + // This field is deprecated, use name instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use name instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster to upgrade. + // This field is deprecated, use name instead. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The monitoring service the cluster should use to write metrics. + // Currently available options: + // + // * "monitoring.googleapis.com" - the Google Cloud Monitoring service + // * "none" - no metrics will be exported from the cluster + MonitoringService string `protobuf:"bytes,4,opt,name=monitoring_service,json=monitoringService" json:"monitoring_service,omitempty"` + // The name (project, location, cluster) of the cluster to set monitoring. + // Specified in the format 'projects/*/locations/*/clusters/*'. + Name string `protobuf:"bytes,6,opt,name=name" json:"name,omitempty"` +} + +func (m *SetMonitoringServiceRequest) Reset() { *m = SetMonitoringServiceRequest{} } +func (m *SetMonitoringServiceRequest) String() string { return proto.CompactTextString(m) } +func (*SetMonitoringServiceRequest) ProtoMessage() {} +func (*SetMonitoringServiceRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{22} } + +func (m *SetMonitoringServiceRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *SetMonitoringServiceRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *SetMonitoringServiceRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *SetMonitoringServiceRequest) GetMonitoringService() string { + if m != nil { + return m.MonitoringService + } + return "" +} + +func (m *SetMonitoringServiceRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// SetAddonsRequest sets the addons associated with the cluster. +type SetAddonsConfigRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + // This field is deprecated, use name instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use name instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster to upgrade. + // This field is deprecated, use name instead. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The desired configurations for the various addons available to run in the + // cluster. + AddonsConfig *AddonsConfig `protobuf:"bytes,4,opt,name=addons_config,json=addonsConfig" json:"addons_config,omitempty"` + // The name (project, location, cluster) of the cluster to set addons. + // Specified in the format 'projects/*/locations/*/clusters/*'. + Name string `protobuf:"bytes,6,opt,name=name" json:"name,omitempty"` +} + +func (m *SetAddonsConfigRequest) Reset() { *m = SetAddonsConfigRequest{} } +func (m *SetAddonsConfigRequest) String() string { return proto.CompactTextString(m) } +func (*SetAddonsConfigRequest) ProtoMessage() {} +func (*SetAddonsConfigRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{23} } + +func (m *SetAddonsConfigRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *SetAddonsConfigRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *SetAddonsConfigRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *SetAddonsConfigRequest) GetAddonsConfig() *AddonsConfig { + if m != nil { + return m.AddonsConfig + } + return nil +} + +func (m *SetAddonsConfigRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// SetLocationsRequest sets the locations of the cluster. +type SetLocationsRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + // This field is deprecated, use name instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use name instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster to upgrade. + // This field is deprecated, use name instead. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The desired list of Google Compute Engine + // [locations](/compute/docs/zones#available) in which the cluster's nodes + // should be located. Changing the locations a cluster is in will result + // in nodes being either created or removed from the cluster, depending on + // whether locations are being added or removed. + // + // This list must always include the cluster's primary zone. + Locations []string `protobuf:"bytes,4,rep,name=locations" json:"locations,omitempty"` + // The name (project, location, cluster) of the cluster to set locations. + // Specified in the format 'projects/*/locations/*/clusters/*'. + Name string `protobuf:"bytes,6,opt,name=name" json:"name,omitempty"` +} + +func (m *SetLocationsRequest) Reset() { *m = SetLocationsRequest{} } +func (m *SetLocationsRequest) String() string { return proto.CompactTextString(m) } +func (*SetLocationsRequest) ProtoMessage() {} +func (*SetLocationsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{24} } + +func (m *SetLocationsRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *SetLocationsRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *SetLocationsRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *SetLocationsRequest) GetLocations() []string { + if m != nil { + return m.Locations + } + return nil +} + +func (m *SetLocationsRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// UpdateMasterRequest updates the master of the cluster. +type UpdateMasterRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use name instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster to upgrade. + // This field is deprecated, use name instead. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The Kubernetes version to change the master to. The only valid value is the + // latest supported version. Use "-" to have the server automatically select + // the latest version. + MasterVersion string `protobuf:"bytes,4,opt,name=master_version,json=masterVersion" json:"master_version,omitempty"` + // The name (project, location, cluster) of the cluster to update. + // Specified in the format 'projects/*/locations/*/clusters/*'. + Name string `protobuf:"bytes,7,opt,name=name" json:"name,omitempty"` +} + +func (m *UpdateMasterRequest) Reset() { *m = UpdateMasterRequest{} } +func (m *UpdateMasterRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateMasterRequest) ProtoMessage() {} +func (*UpdateMasterRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{25} } + +func (m *UpdateMasterRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *UpdateMasterRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *UpdateMasterRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *UpdateMasterRequest) GetMasterVersion() string { + if m != nil { + return m.MasterVersion + } + return "" +} + +func (m *UpdateMasterRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// SetMasterAuthRequest updates the admin password of a cluster. +type SetMasterAuthRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + // This field is deprecated, use name instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use name instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster to upgrade. + // This field is deprecated, use name instead. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The exact form of action to be taken on the master auth. + Action SetMasterAuthRequest_Action `protobuf:"varint,4,opt,name=action,enum=google.container.v1alpha1.SetMasterAuthRequest_Action" json:"action,omitempty"` + // A description of the update. + Update *MasterAuth `protobuf:"bytes,5,opt,name=update" json:"update,omitempty"` + // The name (project, location, cluster) of the cluster to set auth. + // Specified in the format 'projects/*/locations/*/clusters/*'. + Name string `protobuf:"bytes,7,opt,name=name" json:"name,omitempty"` +} + +func (m *SetMasterAuthRequest) Reset() { *m = SetMasterAuthRequest{} } +func (m *SetMasterAuthRequest) String() string { return proto.CompactTextString(m) } +func (*SetMasterAuthRequest) ProtoMessage() {} +func (*SetMasterAuthRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{26} } + +func (m *SetMasterAuthRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *SetMasterAuthRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *SetMasterAuthRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *SetMasterAuthRequest) GetAction() SetMasterAuthRequest_Action { + if m != nil { + return m.Action + } + return SetMasterAuthRequest_UNKNOWN +} + +func (m *SetMasterAuthRequest) GetUpdate() *MasterAuth { + if m != nil { + return m.Update + } + return nil +} + +func (m *SetMasterAuthRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// DeleteClusterRequest deletes a cluster. +type DeleteClusterRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + // This field is deprecated, use name instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use name instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster to delete. + // This field is deprecated, use name instead. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The name (project, location, cluster) of the cluster to delete. + // Specified in the format 'projects/*/locations/*/clusters/*'. + Name string `protobuf:"bytes,4,opt,name=name" json:"name,omitempty"` +} + +func (m *DeleteClusterRequest) Reset() { *m = DeleteClusterRequest{} } +func (m *DeleteClusterRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteClusterRequest) ProtoMessage() {} +func (*DeleteClusterRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{27} } + +func (m *DeleteClusterRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *DeleteClusterRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *DeleteClusterRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *DeleteClusterRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// ListClustersRequest lists clusters. +type ListClustersRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + // This field is deprecated, use parent instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides, or "-" for all zones. + // This field is deprecated, use parent instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The parent (project and location) where the clusters will be listed. + // Specified in the format 'projects/*/locations/*'. + // Location "-" matches all zones and all regions. + Parent string `protobuf:"bytes,4,opt,name=parent" json:"parent,omitempty"` +} + +func (m *ListClustersRequest) Reset() { *m = ListClustersRequest{} } +func (m *ListClustersRequest) String() string { return proto.CompactTextString(m) } +func (*ListClustersRequest) ProtoMessage() {} +func (*ListClustersRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{28} } + +func (m *ListClustersRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *ListClustersRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *ListClustersRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +// ListClustersResponse is the result of ListClustersRequest. +type ListClustersResponse struct { + // A list of clusters in the project in the specified zone, or + // across all ones. + Clusters []*Cluster `protobuf:"bytes,1,rep,name=clusters" json:"clusters,omitempty"` + // If any zones are listed here, the list of clusters returned + // may be missing those zones. + MissingZones []string `protobuf:"bytes,2,rep,name=missing_zones,json=missingZones" json:"missing_zones,omitempty"` +} + +func (m *ListClustersResponse) Reset() { *m = ListClustersResponse{} } +func (m *ListClustersResponse) String() string { return proto.CompactTextString(m) } +func (*ListClustersResponse) ProtoMessage() {} +func (*ListClustersResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{29} } + +func (m *ListClustersResponse) GetClusters() []*Cluster { + if m != nil { + return m.Clusters + } + return nil +} + +func (m *ListClustersResponse) GetMissingZones() []string { + if m != nil { + return m.MissingZones + } + return nil +} + +// GetOperationRequest gets a single operation. +type GetOperationRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + // This field is deprecated, use name instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use name instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The server-assigned `name` of the operation. + // This field is deprecated, use name instead. + OperationId string `protobuf:"bytes,3,opt,name=operation_id,json=operationId" json:"operation_id,omitempty"` + // The name (project, location, operation id) of the operation to get. + // Specified in the format 'projects/*/locations/*/operations/*'. + Name string `protobuf:"bytes,5,opt,name=name" json:"name,omitempty"` +} + +func (m *GetOperationRequest) Reset() { *m = GetOperationRequest{} } +func (m *GetOperationRequest) String() string { return proto.CompactTextString(m) } +func (*GetOperationRequest) ProtoMessage() {} +func (*GetOperationRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{30} } + +func (m *GetOperationRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *GetOperationRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *GetOperationRequest) GetOperationId() string { + if m != nil { + return m.OperationId + } + return "" +} + +func (m *GetOperationRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// ListOperationsRequest lists operations. +type ListOperationsRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + // This field is deprecated, use parent instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine [zone](/compute/docs/zones#available) + // to return operations for, or `-` for all zones. + // This field is deprecated, use parent instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The parent (project and location) where the operations will be listed. + // Specified in the format 'projects/*/locations/*'. + // Location "-" matches all zones and all regions. + Parent string `protobuf:"bytes,4,opt,name=parent" json:"parent,omitempty"` +} + +func (m *ListOperationsRequest) Reset() { *m = ListOperationsRequest{} } +func (m *ListOperationsRequest) String() string { return proto.CompactTextString(m) } +func (*ListOperationsRequest) ProtoMessage() {} +func (*ListOperationsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{31} } + +func (m *ListOperationsRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *ListOperationsRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *ListOperationsRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +// CancelOperationRequest cancels a single operation. +type CancelOperationRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + // This field is deprecated, use name instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the operation resides. + // This field is deprecated, use name instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The server-assigned `name` of the operation. + // This field is deprecated, use name instead. + OperationId string `protobuf:"bytes,3,opt,name=operation_id,json=operationId" json:"operation_id,omitempty"` + // The name (project, location, operation id) of the operation to cancel. + // Specified in the format 'projects/*/locations/*/operations/*'. + Name string `protobuf:"bytes,4,opt,name=name" json:"name,omitempty"` +} + +func (m *CancelOperationRequest) Reset() { *m = CancelOperationRequest{} } +func (m *CancelOperationRequest) String() string { return proto.CompactTextString(m) } +func (*CancelOperationRequest) ProtoMessage() {} +func (*CancelOperationRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{32} } + +func (m *CancelOperationRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *CancelOperationRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *CancelOperationRequest) GetOperationId() string { + if m != nil { + return m.OperationId + } + return "" +} + +func (m *CancelOperationRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// ListOperationsResponse is the result of ListOperationsRequest. +type ListOperationsResponse struct { + // A list of operations in the project in the specified zone. + Operations []*Operation `protobuf:"bytes,1,rep,name=operations" json:"operations,omitempty"` + // If any zones are listed here, the list of operations returned + // may be missing the operations from those zones. + MissingZones []string `protobuf:"bytes,2,rep,name=missing_zones,json=missingZones" json:"missing_zones,omitempty"` +} + +func (m *ListOperationsResponse) Reset() { *m = ListOperationsResponse{} } +func (m *ListOperationsResponse) String() string { return proto.CompactTextString(m) } +func (*ListOperationsResponse) ProtoMessage() {} +func (*ListOperationsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{33} } + +func (m *ListOperationsResponse) GetOperations() []*Operation { + if m != nil { + return m.Operations + } + return nil +} + +func (m *ListOperationsResponse) GetMissingZones() []string { + if m != nil { + return m.MissingZones + } + return nil +} + +// Gets the current Container Engine service configuration. +type GetServerConfigRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + // This field is deprecated, use name instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine [zone](/compute/docs/zones#available) + // to return operations for. + // This field is deprecated, use name instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name (project and location) of the server config to get + // Specified in the format 'projects/*/locations/*'. + Name string `protobuf:"bytes,4,opt,name=name" json:"name,omitempty"` +} + +func (m *GetServerConfigRequest) Reset() { *m = GetServerConfigRequest{} } +func (m *GetServerConfigRequest) String() string { return proto.CompactTextString(m) } +func (*GetServerConfigRequest) ProtoMessage() {} +func (*GetServerConfigRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{34} } + +func (m *GetServerConfigRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *GetServerConfigRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *GetServerConfigRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Container Engine service configuration. +type ServerConfig struct { + // Version of Kubernetes the service deploys by default. + DefaultClusterVersion string `protobuf:"bytes,1,opt,name=default_cluster_version,json=defaultClusterVersion" json:"default_cluster_version,omitempty"` + // List of valid node upgrade target versions. + ValidNodeVersions []string `protobuf:"bytes,3,rep,name=valid_node_versions,json=validNodeVersions" json:"valid_node_versions,omitempty"` + // Default image type. + DefaultImageType string `protobuf:"bytes,4,opt,name=default_image_type,json=defaultImageType" json:"default_image_type,omitempty"` + // List of valid image types. + ValidImageTypes []string `protobuf:"bytes,5,rep,name=valid_image_types,json=validImageTypes" json:"valid_image_types,omitempty"` + // List of valid master versions. + ValidMasterVersions []string `protobuf:"bytes,6,rep,name=valid_master_versions,json=validMasterVersions" json:"valid_master_versions,omitempty"` +} + +func (m *ServerConfig) Reset() { *m = ServerConfig{} } +func (m *ServerConfig) String() string { return proto.CompactTextString(m) } +func (*ServerConfig) ProtoMessage() {} +func (*ServerConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{35} } + +func (m *ServerConfig) GetDefaultClusterVersion() string { + if m != nil { + return m.DefaultClusterVersion + } + return "" +} + +func (m *ServerConfig) GetValidNodeVersions() []string { + if m != nil { + return m.ValidNodeVersions + } + return nil +} + +func (m *ServerConfig) GetDefaultImageType() string { + if m != nil { + return m.DefaultImageType + } + return "" +} + +func (m *ServerConfig) GetValidImageTypes() []string { + if m != nil { + return m.ValidImageTypes + } + return nil +} + +func (m *ServerConfig) GetValidMasterVersions() []string { + if m != nil { + return m.ValidMasterVersions + } + return nil +} + +// CreateNodePoolRequest creates a node pool for a cluster. +type CreateNodePoolRequest struct { + // The Google Developers Console [project ID or project + // number](https://developers.google.com/console/help/new/#projectnumber). + // This field is deprecated, use parent instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use parent instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster. + // This field is deprecated, use parent instead. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The node pool to create. + NodePool *NodePool `protobuf:"bytes,4,opt,name=node_pool,json=nodePool" json:"node_pool,omitempty"` + // The parent (project, location, cluster id) where the node pool will be created. + // Specified in the format 'projects/*/locations/*/clusters/*/nodePools/*'. + Parent string `protobuf:"bytes,6,opt,name=parent" json:"parent,omitempty"` +} + +func (m *CreateNodePoolRequest) Reset() { *m = CreateNodePoolRequest{} } +func (m *CreateNodePoolRequest) String() string { return proto.CompactTextString(m) } +func (*CreateNodePoolRequest) ProtoMessage() {} +func (*CreateNodePoolRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{36} } + +func (m *CreateNodePoolRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *CreateNodePoolRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *CreateNodePoolRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *CreateNodePoolRequest) GetNodePool() *NodePool { + if m != nil { + return m.NodePool + } + return nil +} + +func (m *CreateNodePoolRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +// DeleteNodePoolRequest deletes a node pool for a cluster. +type DeleteNodePoolRequest struct { + // The Google Developers Console [project ID or project + // number](https://developers.google.com/console/help/new/#projectnumber). + // This field is deprecated, use name instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use name instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster. + // This field is deprecated, use name instead. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The name of the node pool to delete. + // This field is deprecated, use name instead. + NodePoolId string `protobuf:"bytes,4,opt,name=node_pool_id,json=nodePoolId" json:"node_pool_id,omitempty"` + // The name (project, location, cluster, node pool id) of the node pool to delete. + // Specified in the format 'projects/*/locations/*/clusters/*/nodePools/*'. + Name string `protobuf:"bytes,6,opt,name=name" json:"name,omitempty"` +} + +func (m *DeleteNodePoolRequest) Reset() { *m = DeleteNodePoolRequest{} } +func (m *DeleteNodePoolRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteNodePoolRequest) ProtoMessage() {} +func (*DeleteNodePoolRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{37} } + +func (m *DeleteNodePoolRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *DeleteNodePoolRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *DeleteNodePoolRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *DeleteNodePoolRequest) GetNodePoolId() string { + if m != nil { + return m.NodePoolId + } + return "" +} + +func (m *DeleteNodePoolRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// ListNodePoolsRequest lists the node pool(s) for a cluster. +type ListNodePoolsRequest struct { + // The Google Developers Console [project ID or project + // number](https://developers.google.com/console/help/new/#projectnumber). + // This field is deprecated, use parent instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use parent instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster. + // This field is deprecated, use parent instead. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The parent (project, location, cluster id) where the node pools will be listed. + // Specified in the format 'projects/*/locations/*/clusters/*'. + Parent string `protobuf:"bytes,5,opt,name=parent" json:"parent,omitempty"` +} + +func (m *ListNodePoolsRequest) Reset() { *m = ListNodePoolsRequest{} } +func (m *ListNodePoolsRequest) String() string { return proto.CompactTextString(m) } +func (*ListNodePoolsRequest) ProtoMessage() {} +func (*ListNodePoolsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{38} } + +func (m *ListNodePoolsRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *ListNodePoolsRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *ListNodePoolsRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *ListNodePoolsRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +// GetNodePoolRequest retrieves a node pool for a cluster. +type GetNodePoolRequest struct { + // The Google Developers Console [project ID or project + // number](https://developers.google.com/console/help/new/#projectnumber). + // This field is deprecated, use name instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use name instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster. + // This field is deprecated, use name instead. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The name of the node pool. + // This field is deprecated, use name instead. + NodePoolId string `protobuf:"bytes,4,opt,name=node_pool_id,json=nodePoolId" json:"node_pool_id,omitempty"` + // The name (project, location, cluster, node pool id) of the node pool to get. + // Specified in the format 'projects/*/locations/*/clusters/*/nodePools/*'. + Name string `protobuf:"bytes,6,opt,name=name" json:"name,omitempty"` +} + +func (m *GetNodePoolRequest) Reset() { *m = GetNodePoolRequest{} } +func (m *GetNodePoolRequest) String() string { return proto.CompactTextString(m) } +func (*GetNodePoolRequest) ProtoMessage() {} +func (*GetNodePoolRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{39} } + +func (m *GetNodePoolRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *GetNodePoolRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *GetNodePoolRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *GetNodePoolRequest) GetNodePoolId() string { + if m != nil { + return m.NodePoolId + } + return "" +} + +func (m *GetNodePoolRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// NodePool contains the name and configuration for a cluster's node pool. +// Node pools are a set of nodes (i.e. VM's), with a common configuration and +// specification, under the control of the cluster master. They may have a set +// of Kubernetes labels applied to them, which may be used to reference them +// during pod scheduling. They may also be resized up or down, to accommodate +// the workload. +type NodePool struct { + // The name of the node pool. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The node configuration of the pool. + Config *NodeConfig `protobuf:"bytes,2,opt,name=config" json:"config,omitempty"` + // The initial node count for the pool. You must ensure that your + // Compute Engine resource quota + // is sufficient for this number of instances. You must also have available + // firewall and routes quota. + InitialNodeCount int32 `protobuf:"varint,3,opt,name=initial_node_count,json=initialNodeCount" json:"initial_node_count,omitempty"` + // Autoscaler configuration for this NodePool. Autoscaler is enabled + // only if a valid configuration is present. + Autoscaling *NodePoolAutoscaling `protobuf:"bytes,4,opt,name=autoscaling" json:"autoscaling,omitempty"` + // NodeManagement configuration for this NodePool. + Management *NodeManagement `protobuf:"bytes,5,opt,name=management" json:"management,omitempty"` + // [Output only] Server-defined URL for the resource. + SelfLink string `protobuf:"bytes,100,opt,name=self_link,json=selfLink" json:"self_link,omitempty"` + // [Output only] The version of the Kubernetes of this node. + Version string `protobuf:"bytes,101,opt,name=version" json:"version,omitempty"` + // [Output only] The resource URLs of [instance + // groups](/compute/docs/instance-groups/) associated with this + // node pool. + InstanceGroupUrls []string `protobuf:"bytes,102,rep,name=instance_group_urls,json=instanceGroupUrls" json:"instance_group_urls,omitempty"` + // [Output only] The status of the nodes in this pool instance. + Status NodePool_Status `protobuf:"varint,103,opt,name=status,enum=google.container.v1alpha1.NodePool_Status" json:"status,omitempty"` + // [Output only] Additional information about the current status of this + // node pool instance, if available. + StatusMessage string `protobuf:"bytes,104,opt,name=status_message,json=statusMessage" json:"status_message,omitempty"` +} + +func (m *NodePool) Reset() { *m = NodePool{} } +func (m *NodePool) String() string { return proto.CompactTextString(m) } +func (*NodePool) ProtoMessage() {} +func (*NodePool) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{40} } + +func (m *NodePool) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *NodePool) GetConfig() *NodeConfig { + if m != nil { + return m.Config + } + return nil +} + +func (m *NodePool) GetInitialNodeCount() int32 { + if m != nil { + return m.InitialNodeCount + } + return 0 +} + +func (m *NodePool) GetAutoscaling() *NodePoolAutoscaling { + if m != nil { + return m.Autoscaling + } + return nil +} + +func (m *NodePool) GetManagement() *NodeManagement { + if m != nil { + return m.Management + } + return nil +} + +func (m *NodePool) GetSelfLink() string { + if m != nil { + return m.SelfLink + } + return "" +} + +func (m *NodePool) GetVersion() string { + if m != nil { + return m.Version + } + return "" +} + +func (m *NodePool) GetInstanceGroupUrls() []string { + if m != nil { + return m.InstanceGroupUrls + } + return nil +} + +func (m *NodePool) GetStatus() NodePool_Status { + if m != nil { + return m.Status + } + return NodePool_STATUS_UNSPECIFIED +} + +func (m *NodePool) GetStatusMessage() string { + if m != nil { + return m.StatusMessage + } + return "" +} + +// NodeManagement defines the set of node management services turned on for the +// node pool. +type NodeManagement struct { + // Whether the nodes will be automatically upgraded. + AutoUpgrade bool `protobuf:"varint,1,opt,name=auto_upgrade,json=autoUpgrade" json:"auto_upgrade,omitempty"` + // Whether the nodes will be automatically repaired. + AutoRepair bool `protobuf:"varint,2,opt,name=auto_repair,json=autoRepair" json:"auto_repair,omitempty"` + // Specifies the Auto Upgrade knobs for the node pool. + UpgradeOptions *AutoUpgradeOptions `protobuf:"bytes,10,opt,name=upgrade_options,json=upgradeOptions" json:"upgrade_options,omitempty"` +} + +func (m *NodeManagement) Reset() { *m = NodeManagement{} } +func (m *NodeManagement) String() string { return proto.CompactTextString(m) } +func (*NodeManagement) ProtoMessage() {} +func (*NodeManagement) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{41} } + +func (m *NodeManagement) GetAutoUpgrade() bool { + if m != nil { + return m.AutoUpgrade + } + return false +} + +func (m *NodeManagement) GetAutoRepair() bool { + if m != nil { + return m.AutoRepair + } + return false +} + +func (m *NodeManagement) GetUpgradeOptions() *AutoUpgradeOptions { + if m != nil { + return m.UpgradeOptions + } + return nil +} + +// AutoUpgradeOptions defines the set of options for the user to control how +// the Auto Upgrades will proceed. +type AutoUpgradeOptions struct { + // [Output only] This field is set when upgrades are about to commence + // with the approximate start time for the upgrades, in + // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + AutoUpgradeStartTime string `protobuf:"bytes,1,opt,name=auto_upgrade_start_time,json=autoUpgradeStartTime" json:"auto_upgrade_start_time,omitempty"` + // [Output only] This field is set when upgrades are about to commence + // with the description of the upgrade. + Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` +} + +func (m *AutoUpgradeOptions) Reset() { *m = AutoUpgradeOptions{} } +func (m *AutoUpgradeOptions) String() string { return proto.CompactTextString(m) } +func (*AutoUpgradeOptions) ProtoMessage() {} +func (*AutoUpgradeOptions) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{42} } + +func (m *AutoUpgradeOptions) GetAutoUpgradeStartTime() string { + if m != nil { + return m.AutoUpgradeStartTime + } + return "" +} + +func (m *AutoUpgradeOptions) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +// MaintenancePolicy defines the maintenance policy to be used for the cluster. +type MaintenancePolicy struct { + // Specifies the maintenance window in which maintenance may be performed. + Window *MaintenanceWindow `protobuf:"bytes,1,opt,name=window" json:"window,omitempty"` +} + +func (m *MaintenancePolicy) Reset() { *m = MaintenancePolicy{} } +func (m *MaintenancePolicy) String() string { return proto.CompactTextString(m) } +func (*MaintenancePolicy) ProtoMessage() {} +func (*MaintenancePolicy) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{43} } + +func (m *MaintenancePolicy) GetWindow() *MaintenanceWindow { + if m != nil { + return m.Window + } + return nil +} + +// MaintenanceWindow defines the maintenance window to be used for the cluster. +type MaintenanceWindow struct { + // Unimplemented, reserved for future use. + // HourlyMaintenanceWindow hourly_maintenance_window = 1; + // + // Types that are valid to be assigned to Policy: + // *MaintenanceWindow_DailyMaintenanceWindow + Policy isMaintenanceWindow_Policy `protobuf_oneof:"policy"` +} + +func (m *MaintenanceWindow) Reset() { *m = MaintenanceWindow{} } +func (m *MaintenanceWindow) String() string { return proto.CompactTextString(m) } +func (*MaintenanceWindow) ProtoMessage() {} +func (*MaintenanceWindow) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{44} } + +type isMaintenanceWindow_Policy interface { + isMaintenanceWindow_Policy() +} + +type MaintenanceWindow_DailyMaintenanceWindow struct { + DailyMaintenanceWindow *DailyMaintenanceWindow `protobuf:"bytes,2,opt,name=daily_maintenance_window,json=dailyMaintenanceWindow,oneof"` +} + +func (*MaintenanceWindow_DailyMaintenanceWindow) isMaintenanceWindow_Policy() {} + +func (m *MaintenanceWindow) GetPolicy() isMaintenanceWindow_Policy { + if m != nil { + return m.Policy + } + return nil +} + +func (m *MaintenanceWindow) GetDailyMaintenanceWindow() *DailyMaintenanceWindow { + if x, ok := m.GetPolicy().(*MaintenanceWindow_DailyMaintenanceWindow); ok { + return x.DailyMaintenanceWindow + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*MaintenanceWindow) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _MaintenanceWindow_OneofMarshaler, _MaintenanceWindow_OneofUnmarshaler, _MaintenanceWindow_OneofSizer, []interface{}{ + (*MaintenanceWindow_DailyMaintenanceWindow)(nil), + } +} + +func _MaintenanceWindow_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*MaintenanceWindow) + // policy + switch x := m.Policy.(type) { + case *MaintenanceWindow_DailyMaintenanceWindow: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.DailyMaintenanceWindow); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("MaintenanceWindow.Policy has unexpected type %T", x) + } + return nil +} + +func _MaintenanceWindow_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*MaintenanceWindow) + switch tag { + case 2: // policy.daily_maintenance_window + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(DailyMaintenanceWindow) + err := b.DecodeMessage(msg) + m.Policy = &MaintenanceWindow_DailyMaintenanceWindow{msg} + return true, err + default: + return false, nil + } +} + +func _MaintenanceWindow_OneofSizer(msg proto.Message) (n int) { + m := msg.(*MaintenanceWindow) + // policy + switch x := m.Policy.(type) { + case *MaintenanceWindow_DailyMaintenanceWindow: + s := proto.Size(x.DailyMaintenanceWindow) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Time window specified for daily maintenance operations. +type DailyMaintenanceWindow struct { + // Time within the maintenance window to start the maintenance operations. + // It must be in format "HH:MM”, where HH : [00-23] and MM : [00-59] GMT. + StartTime string `protobuf:"bytes,2,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + // [Output only] Duration of the time window, automatically chosen to be + // smallest possible in the given scenario. + Duration string `protobuf:"bytes,3,opt,name=duration" json:"duration,omitempty"` +} + +func (m *DailyMaintenanceWindow) Reset() { *m = DailyMaintenanceWindow{} } +func (m *DailyMaintenanceWindow) String() string { return proto.CompactTextString(m) } +func (*DailyMaintenanceWindow) ProtoMessage() {} +func (*DailyMaintenanceWindow) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{45} } + +func (m *DailyMaintenanceWindow) GetStartTime() string { + if m != nil { + return m.StartTime + } + return "" +} + +func (m *DailyMaintenanceWindow) GetDuration() string { + if m != nil { + return m.Duration + } + return "" +} + +// SetNodePoolManagementRequest sets the node management properties of a node +// pool. +type SetNodePoolManagementRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + // This field is deprecated, use name instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use name instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster to update. + // This field is deprecated, use name instead. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The name of the node pool to update. + // This field is deprecated, use name instead. + NodePoolId string `protobuf:"bytes,4,opt,name=node_pool_id,json=nodePoolId" json:"node_pool_id,omitempty"` + // NodeManagement configuration for the node pool. + Management *NodeManagement `protobuf:"bytes,5,opt,name=management" json:"management,omitempty"` + // The name (project, location, cluster, node pool id) of the node pool to set + // management properties. Specified in the format + // 'projects/*/locations/*/clusters/*/nodePools/*'. + Name string `protobuf:"bytes,7,opt,name=name" json:"name,omitempty"` +} + +func (m *SetNodePoolManagementRequest) Reset() { *m = SetNodePoolManagementRequest{} } +func (m *SetNodePoolManagementRequest) String() string { return proto.CompactTextString(m) } +func (*SetNodePoolManagementRequest) ProtoMessage() {} +func (*SetNodePoolManagementRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{46} } + +func (m *SetNodePoolManagementRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *SetNodePoolManagementRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *SetNodePoolManagementRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *SetNodePoolManagementRequest) GetNodePoolId() string { + if m != nil { + return m.NodePoolId + } + return "" +} + +func (m *SetNodePoolManagementRequest) GetManagement() *NodeManagement { + if m != nil { + return m.Management + } + return nil +} + +func (m *SetNodePoolManagementRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// SetNodePoolSizeRequest sets the size a node +// pool. +type SetNodePoolSizeRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use name instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster to update. + // This field is deprecated, use name instead. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The name of the node pool to update. + // This field is deprecated, use name instead. + NodePoolId string `protobuf:"bytes,4,opt,name=node_pool_id,json=nodePoolId" json:"node_pool_id,omitempty"` + // The desired node count for the pool. + NodeCount int32 `protobuf:"varint,5,opt,name=node_count,json=nodeCount" json:"node_count,omitempty"` + // The name (project, location, cluster, node pool id) of the node pool to set + // size. + // Specified in the format 'projects/*/locations/*/clusters/*/nodePools/*'. + Name string `protobuf:"bytes,7,opt,name=name" json:"name,omitempty"` +} + +func (m *SetNodePoolSizeRequest) Reset() { *m = SetNodePoolSizeRequest{} } +func (m *SetNodePoolSizeRequest) String() string { return proto.CompactTextString(m) } +func (*SetNodePoolSizeRequest) ProtoMessage() {} +func (*SetNodePoolSizeRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{47} } + +func (m *SetNodePoolSizeRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *SetNodePoolSizeRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *SetNodePoolSizeRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *SetNodePoolSizeRequest) GetNodePoolId() string { + if m != nil { + return m.NodePoolId + } + return "" +} + +func (m *SetNodePoolSizeRequest) GetNodeCount() int32 { + if m != nil { + return m.NodeCount + } + return 0 +} + +func (m *SetNodePoolSizeRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// RollbackNodePoolUpgradeRequest rollbacks the previously Aborted or Failed +// NodePool upgrade. This will be an no-op if the last upgrade successfully +// completed. +type RollbackNodePoolUpgradeRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + // This field is deprecated, use name instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use name instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster to rollback. + // This field is deprecated, use name instead. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The name of the node pool to rollback. + // This field is deprecated, use name instead. + NodePoolId string `protobuf:"bytes,4,opt,name=node_pool_id,json=nodePoolId" json:"node_pool_id,omitempty"` + // The name (project, location, cluster, node pool id) of the node poll to + // rollback upgrade. + // Specified in the format 'projects/*/locations/*/clusters/*/nodePools/*'. + Name string `protobuf:"bytes,6,opt,name=name" json:"name,omitempty"` +} + +func (m *RollbackNodePoolUpgradeRequest) Reset() { *m = RollbackNodePoolUpgradeRequest{} } +func (m *RollbackNodePoolUpgradeRequest) String() string { return proto.CompactTextString(m) } +func (*RollbackNodePoolUpgradeRequest) ProtoMessage() {} +func (*RollbackNodePoolUpgradeRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{48} } + +func (m *RollbackNodePoolUpgradeRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *RollbackNodePoolUpgradeRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *RollbackNodePoolUpgradeRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *RollbackNodePoolUpgradeRequest) GetNodePoolId() string { + if m != nil { + return m.NodePoolId + } + return "" +} + +func (m *RollbackNodePoolUpgradeRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// ListNodePoolsResponse is the result of ListNodePoolsRequest. +type ListNodePoolsResponse struct { + // A list of node pools for a cluster. + NodePools []*NodePool `protobuf:"bytes,1,rep,name=node_pools,json=nodePools" json:"node_pools,omitempty"` +} + +func (m *ListNodePoolsResponse) Reset() { *m = ListNodePoolsResponse{} } +func (m *ListNodePoolsResponse) String() string { return proto.CompactTextString(m) } +func (*ListNodePoolsResponse) ProtoMessage() {} +func (*ListNodePoolsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{49} } + +func (m *ListNodePoolsResponse) GetNodePools() []*NodePool { + if m != nil { + return m.NodePools + } + return nil +} + +// NodePoolAutoscaling contains information required by cluster autoscaler to +// adjust the size of the node pool to the current cluster usage. +type NodePoolAutoscaling struct { + // Is autoscaling enabled for this node pool. + Enabled bool `protobuf:"varint,1,opt,name=enabled" json:"enabled,omitempty"` + // Minimum number of nodes in the NodePool. Must be >= 1 and <= + // max_node_count. + MinNodeCount int32 `protobuf:"varint,2,opt,name=min_node_count,json=minNodeCount" json:"min_node_count,omitempty"` + // Maximum number of nodes in the NodePool. Must be >= min_node_count. There + // has to enough quota to scale up the cluster. + MaxNodeCount int32 `protobuf:"varint,3,opt,name=max_node_count,json=maxNodeCount" json:"max_node_count,omitempty"` +} + +func (m *NodePoolAutoscaling) Reset() { *m = NodePoolAutoscaling{} } +func (m *NodePoolAutoscaling) String() string { return proto.CompactTextString(m) } +func (*NodePoolAutoscaling) ProtoMessage() {} +func (*NodePoolAutoscaling) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{50} } + +func (m *NodePoolAutoscaling) GetEnabled() bool { + if m != nil { + return m.Enabled + } + return false +} + +func (m *NodePoolAutoscaling) GetMinNodeCount() int32 { + if m != nil { + return m.MinNodeCount + } + return 0 +} + +func (m *NodePoolAutoscaling) GetMaxNodeCount() int32 { + if m != nil { + return m.MaxNodeCount + } + return 0 +} + +// SetLabelsRequest sets the Google Cloud Platform labels on a Google Container +// Engine cluster, which will in turn set them for Google Compute Engine +// resources used by that cluster +type SetLabelsRequest struct { + // The Google Developers Console [project ID or project + // number](https://developers.google.com/console/help/new/#projectnumber). + // This field is deprecated, use name instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use name instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster. + // This field is deprecated, use name instead. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The labels to set for that cluster. + ResourceLabels map[string]string `protobuf:"bytes,4,rep,name=resource_labels,json=resourceLabels" json:"resource_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // The fingerprint of the previous set of labels for this resource, + // used to detect conflicts. The fingerprint is initially generated by + // Container Engine and changes after every request to modify or update + // labels. You must always provide an up-to-date fingerprint hash when + // updating or changing labels. Make a get() request to the + // resource to get the latest fingerprint. + LabelFingerprint string `protobuf:"bytes,5,opt,name=label_fingerprint,json=labelFingerprint" json:"label_fingerprint,omitempty"` + // The name (project, location, cluster id) of the cluster to set labels. + // Specified in the format 'projects/*/locations/*/clusters/*'. + Name string `protobuf:"bytes,7,opt,name=name" json:"name,omitempty"` +} + +func (m *SetLabelsRequest) Reset() { *m = SetLabelsRequest{} } +func (m *SetLabelsRequest) String() string { return proto.CompactTextString(m) } +func (*SetLabelsRequest) ProtoMessage() {} +func (*SetLabelsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{51} } + +func (m *SetLabelsRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *SetLabelsRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *SetLabelsRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *SetLabelsRequest) GetResourceLabels() map[string]string { + if m != nil { + return m.ResourceLabels + } + return nil +} + +func (m *SetLabelsRequest) GetLabelFingerprint() string { + if m != nil { + return m.LabelFingerprint + } + return "" +} + +func (m *SetLabelsRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// SetLegacyAbacRequest enables or disables the ABAC authorization mechanism for +// a cluster. +type SetLegacyAbacRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + // This field is deprecated, use name instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use name instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster to update. + // This field is deprecated, use name instead. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // Whether ABAC authorization will be enabled in the cluster. + Enabled bool `protobuf:"varint,4,opt,name=enabled" json:"enabled,omitempty"` + // The name (project, location, cluster id) of the cluster to set legacy abac. + // Specified in the format 'projects/*/locations/*/clusters/*'. + Name string `protobuf:"bytes,6,opt,name=name" json:"name,omitempty"` +} + +func (m *SetLegacyAbacRequest) Reset() { *m = SetLegacyAbacRequest{} } +func (m *SetLegacyAbacRequest) String() string { return proto.CompactTextString(m) } +func (*SetLegacyAbacRequest) ProtoMessage() {} +func (*SetLegacyAbacRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{52} } + +func (m *SetLegacyAbacRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *SetLegacyAbacRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *SetLegacyAbacRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *SetLegacyAbacRequest) GetEnabled() bool { + if m != nil { + return m.Enabled + } + return false +} + +func (m *SetLegacyAbacRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// StartIPRotationRequest creates a new IP for the cluster and then performs +// a node upgrade on each node pool to point to the new IP. +type StartIPRotationRequest struct { + // The Google Developers Console [project ID or project + // number](https://developers.google.com/console/help/new/#projectnumber). + // This field is deprecated, use name instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use name instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster. + // This field is deprecated, use name instead. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The name (project, location, cluster id) of the cluster to start IP rotation. + // Specified in the format 'projects/*/locations/*/clusters/*'. + Name string `protobuf:"bytes,6,opt,name=name" json:"name,omitempty"` +} + +func (m *StartIPRotationRequest) Reset() { *m = StartIPRotationRequest{} } +func (m *StartIPRotationRequest) String() string { return proto.CompactTextString(m) } +func (*StartIPRotationRequest) ProtoMessage() {} +func (*StartIPRotationRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{53} } + +func (m *StartIPRotationRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *StartIPRotationRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *StartIPRotationRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *StartIPRotationRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// CompleteIPRotationRequest moves the cluster master back into single-IP mode. +type CompleteIPRotationRequest struct { + // The Google Developers Console [project ID or project + // number](https://developers.google.com/console/help/new/#projectnumber). + // This field is deprecated, use name instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use name instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster. + // This field is deprecated, use name instead. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The name (project, location, cluster id) of the cluster to complete IP rotation. + // Specified in the format 'projects/*/locations/*/clusters/*'. + Name string `protobuf:"bytes,7,opt,name=name" json:"name,omitempty"` +} + +func (m *CompleteIPRotationRequest) Reset() { *m = CompleteIPRotationRequest{} } +func (m *CompleteIPRotationRequest) String() string { return proto.CompactTextString(m) } +func (*CompleteIPRotationRequest) ProtoMessage() {} +func (*CompleteIPRotationRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{54} } + +func (m *CompleteIPRotationRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *CompleteIPRotationRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *CompleteIPRotationRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *CompleteIPRotationRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// AcceleratorConfig represents a Hardware Accelerator request. +type AcceleratorConfig struct { + // The number of the accelerator cards exposed to an instance. + AcceleratorCount int64 `protobuf:"varint,1,opt,name=accelerator_count,json=acceleratorCount" json:"accelerator_count,omitempty"` + // The accelerator type resource name. List of supported accelerators + // [here](/compute/docs/gpus/#Introduction) + AcceleratorType string `protobuf:"bytes,2,opt,name=accelerator_type,json=acceleratorType" json:"accelerator_type,omitempty"` +} + +func (m *AcceleratorConfig) Reset() { *m = AcceleratorConfig{} } +func (m *AcceleratorConfig) String() string { return proto.CompactTextString(m) } +func (*AcceleratorConfig) ProtoMessage() {} +func (*AcceleratorConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{55} } + +func (m *AcceleratorConfig) GetAcceleratorCount() int64 { + if m != nil { + return m.AcceleratorCount + } + return 0 +} + +func (m *AcceleratorConfig) GetAcceleratorType() string { + if m != nil { + return m.AcceleratorType + } + return "" +} + +// SetNetworkPolicyRequest enables/disables network policy for a cluster. +type SetNetworkPolicyRequest struct { + // The Google Developers Console [project ID or project + // number](https://developers.google.com/console/help/new/#projectnumber). + // This field is deprecated, use name instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use name instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster. + // This field is deprecated, use name instead. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // Configuration options for the NetworkPolicy feature. + NetworkPolicy *NetworkPolicy `protobuf:"bytes,4,opt,name=network_policy,json=networkPolicy" json:"network_policy,omitempty"` + // The name (project, location, cluster id) of the cluster to set networking + // policy. + // Specified in the format 'projects/*/locations/*/clusters/*'. + Name string `protobuf:"bytes,6,opt,name=name" json:"name,omitempty"` +} + +func (m *SetNetworkPolicyRequest) Reset() { *m = SetNetworkPolicyRequest{} } +func (m *SetNetworkPolicyRequest) String() string { return proto.CompactTextString(m) } +func (*SetNetworkPolicyRequest) ProtoMessage() {} +func (*SetNetworkPolicyRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{56} } + +func (m *SetNetworkPolicyRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *SetNetworkPolicyRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *SetNetworkPolicyRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *SetNetworkPolicyRequest) GetNetworkPolicy() *NetworkPolicy { + if m != nil { + return m.NetworkPolicy + } + return nil +} + +func (m *SetNetworkPolicyRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// SetMaintenancePolicyRequest sets the maintenance policy for a cluster. +type SetMaintenancePolicyRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster to update. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The maintenance policy to be set for the cluster. An empty field + // clears the existing maintenance policy. + MaintenancePolicy *MaintenancePolicy `protobuf:"bytes,4,opt,name=maintenance_policy,json=maintenancePolicy" json:"maintenance_policy,omitempty"` + // The name (project, location, cluster id) of the cluster to set maintenance + // policy. + // Specified in the format 'projects/*/locations/*/clusters/*'. + Name string `protobuf:"bytes,5,opt,name=name" json:"name,omitempty"` +} + +func (m *SetMaintenancePolicyRequest) Reset() { *m = SetMaintenancePolicyRequest{} } +func (m *SetMaintenancePolicyRequest) String() string { return proto.CompactTextString(m) } +func (*SetMaintenancePolicyRequest) ProtoMessage() {} +func (*SetMaintenancePolicyRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{57} } + +func (m *SetMaintenancePolicyRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *SetMaintenancePolicyRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *SetMaintenancePolicyRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *SetMaintenancePolicyRequest) GetMaintenancePolicy() *MaintenancePolicy { + if m != nil { + return m.MaintenancePolicy + } + return nil +} + +func (m *SetMaintenancePolicyRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func init() { + proto.RegisterType((*NodeConfig)(nil), "google.container.v1alpha1.NodeConfig") + proto.RegisterType((*NodeTaint)(nil), "google.container.v1alpha1.NodeTaint") + proto.RegisterType((*MasterAuth)(nil), "google.container.v1alpha1.MasterAuth") + proto.RegisterType((*ClientCertificateConfig)(nil), "google.container.v1alpha1.ClientCertificateConfig") + proto.RegisterType((*AddonsConfig)(nil), "google.container.v1alpha1.AddonsConfig") + proto.RegisterType((*HttpLoadBalancing)(nil), "google.container.v1alpha1.HttpLoadBalancing") + proto.RegisterType((*HorizontalPodAutoscaling)(nil), "google.container.v1alpha1.HorizontalPodAutoscaling") + proto.RegisterType((*KubernetesDashboard)(nil), "google.container.v1alpha1.KubernetesDashboard") + proto.RegisterType((*NetworkPolicyConfig)(nil), "google.container.v1alpha1.NetworkPolicyConfig") + proto.RegisterType((*MasterAuthorizedNetworksConfig)(nil), "google.container.v1alpha1.MasterAuthorizedNetworksConfig") + proto.RegisterType((*MasterAuthorizedNetworksConfig_CidrBlock)(nil), "google.container.v1alpha1.MasterAuthorizedNetworksConfig.CidrBlock") + proto.RegisterType((*NetworkPolicy)(nil), "google.container.v1alpha1.NetworkPolicy") + proto.RegisterType((*IPAllocationPolicy)(nil), "google.container.v1alpha1.IPAllocationPolicy") + proto.RegisterType((*PodSecurityPolicyConfig)(nil), "google.container.v1alpha1.PodSecurityPolicyConfig") + proto.RegisterType((*Cluster)(nil), "google.container.v1alpha1.Cluster") + proto.RegisterType((*ClusterUpdate)(nil), "google.container.v1alpha1.ClusterUpdate") + proto.RegisterType((*Operation)(nil), "google.container.v1alpha1.Operation") + proto.RegisterType((*CreateClusterRequest)(nil), "google.container.v1alpha1.CreateClusterRequest") + proto.RegisterType((*GetClusterRequest)(nil), "google.container.v1alpha1.GetClusterRequest") + proto.RegisterType((*UpdateClusterRequest)(nil), "google.container.v1alpha1.UpdateClusterRequest") + proto.RegisterType((*UpdateNodePoolRequest)(nil), "google.container.v1alpha1.UpdateNodePoolRequest") + proto.RegisterType((*SetNodePoolAutoscalingRequest)(nil), "google.container.v1alpha1.SetNodePoolAutoscalingRequest") + proto.RegisterType((*SetLoggingServiceRequest)(nil), "google.container.v1alpha1.SetLoggingServiceRequest") + proto.RegisterType((*SetMonitoringServiceRequest)(nil), "google.container.v1alpha1.SetMonitoringServiceRequest") + proto.RegisterType((*SetAddonsConfigRequest)(nil), "google.container.v1alpha1.SetAddonsConfigRequest") + proto.RegisterType((*SetLocationsRequest)(nil), "google.container.v1alpha1.SetLocationsRequest") + proto.RegisterType((*UpdateMasterRequest)(nil), "google.container.v1alpha1.UpdateMasterRequest") + proto.RegisterType((*SetMasterAuthRequest)(nil), "google.container.v1alpha1.SetMasterAuthRequest") + proto.RegisterType((*DeleteClusterRequest)(nil), "google.container.v1alpha1.DeleteClusterRequest") + proto.RegisterType((*ListClustersRequest)(nil), "google.container.v1alpha1.ListClustersRequest") + proto.RegisterType((*ListClustersResponse)(nil), "google.container.v1alpha1.ListClustersResponse") + proto.RegisterType((*GetOperationRequest)(nil), "google.container.v1alpha1.GetOperationRequest") + proto.RegisterType((*ListOperationsRequest)(nil), "google.container.v1alpha1.ListOperationsRequest") + proto.RegisterType((*CancelOperationRequest)(nil), "google.container.v1alpha1.CancelOperationRequest") + proto.RegisterType((*ListOperationsResponse)(nil), "google.container.v1alpha1.ListOperationsResponse") + proto.RegisterType((*GetServerConfigRequest)(nil), "google.container.v1alpha1.GetServerConfigRequest") + proto.RegisterType((*ServerConfig)(nil), "google.container.v1alpha1.ServerConfig") + proto.RegisterType((*CreateNodePoolRequest)(nil), "google.container.v1alpha1.CreateNodePoolRequest") + proto.RegisterType((*DeleteNodePoolRequest)(nil), "google.container.v1alpha1.DeleteNodePoolRequest") + proto.RegisterType((*ListNodePoolsRequest)(nil), "google.container.v1alpha1.ListNodePoolsRequest") + proto.RegisterType((*GetNodePoolRequest)(nil), "google.container.v1alpha1.GetNodePoolRequest") + proto.RegisterType((*NodePool)(nil), "google.container.v1alpha1.NodePool") + proto.RegisterType((*NodeManagement)(nil), "google.container.v1alpha1.NodeManagement") + proto.RegisterType((*AutoUpgradeOptions)(nil), "google.container.v1alpha1.AutoUpgradeOptions") + proto.RegisterType((*MaintenancePolicy)(nil), "google.container.v1alpha1.MaintenancePolicy") + proto.RegisterType((*MaintenanceWindow)(nil), "google.container.v1alpha1.MaintenanceWindow") + proto.RegisterType((*DailyMaintenanceWindow)(nil), "google.container.v1alpha1.DailyMaintenanceWindow") + proto.RegisterType((*SetNodePoolManagementRequest)(nil), "google.container.v1alpha1.SetNodePoolManagementRequest") + proto.RegisterType((*SetNodePoolSizeRequest)(nil), "google.container.v1alpha1.SetNodePoolSizeRequest") + proto.RegisterType((*RollbackNodePoolUpgradeRequest)(nil), "google.container.v1alpha1.RollbackNodePoolUpgradeRequest") + proto.RegisterType((*ListNodePoolsResponse)(nil), "google.container.v1alpha1.ListNodePoolsResponse") + proto.RegisterType((*NodePoolAutoscaling)(nil), "google.container.v1alpha1.NodePoolAutoscaling") + proto.RegisterType((*SetLabelsRequest)(nil), "google.container.v1alpha1.SetLabelsRequest") + proto.RegisterType((*SetLegacyAbacRequest)(nil), "google.container.v1alpha1.SetLegacyAbacRequest") + proto.RegisterType((*StartIPRotationRequest)(nil), "google.container.v1alpha1.StartIPRotationRequest") + proto.RegisterType((*CompleteIPRotationRequest)(nil), "google.container.v1alpha1.CompleteIPRotationRequest") + proto.RegisterType((*AcceleratorConfig)(nil), "google.container.v1alpha1.AcceleratorConfig") + proto.RegisterType((*SetNetworkPolicyRequest)(nil), "google.container.v1alpha1.SetNetworkPolicyRequest") + proto.RegisterType((*SetMaintenancePolicyRequest)(nil), "google.container.v1alpha1.SetMaintenancePolicyRequest") + proto.RegisterEnum("google.container.v1alpha1.NodeTaint_Effect", NodeTaint_Effect_name, NodeTaint_Effect_value) + proto.RegisterEnum("google.container.v1alpha1.NetworkPolicy_Provider", NetworkPolicy_Provider_name, NetworkPolicy_Provider_value) + proto.RegisterEnum("google.container.v1alpha1.Cluster_Status", Cluster_Status_name, Cluster_Status_value) + proto.RegisterEnum("google.container.v1alpha1.Operation_Status", Operation_Status_name, Operation_Status_value) + proto.RegisterEnum("google.container.v1alpha1.Operation_Type", Operation_Type_name, Operation_Type_value) + proto.RegisterEnum("google.container.v1alpha1.SetMasterAuthRequest_Action", SetMasterAuthRequest_Action_name, SetMasterAuthRequest_Action_value) + proto.RegisterEnum("google.container.v1alpha1.NodePool_Status", NodePool_Status_name, NodePool_Status_value) +} + +// 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 + +// Client API for ClusterManager service + +type ClusterManagerClient interface { + // Lists all clusters owned by a project in either the specified zone or all + // zones. + ListClusters(ctx context.Context, in *ListClustersRequest, opts ...grpc.CallOption) (*ListClustersResponse, error) + // Gets the details of a specific cluster. + GetCluster(ctx context.Context, in *GetClusterRequest, opts ...grpc.CallOption) (*Cluster, error) + // Creates a cluster, consisting of the specified number and type of Google + // Compute Engine instances. + // + // By default, the cluster is created in the project's + // [default network](/compute/docs/networks-and-firewalls#networks). + // + // One firewall is added for the cluster. After cluster creation, + // the cluster creates routes for each node to allow the containers + // on that node to communicate with all other instances in the + // cluster. + // + // Finally, an entry is added to the project's global metadata indicating + // which CIDR range is being used by the cluster. + CreateCluster(ctx context.Context, in *CreateClusterRequest, opts ...grpc.CallOption) (*Operation, error) + // Updates the settings of a specific cluster. + UpdateCluster(ctx context.Context, in *UpdateClusterRequest, opts ...grpc.CallOption) (*Operation, error) + // Updates the version and/or iamge type of a specific node pool. + UpdateNodePool(ctx context.Context, in *UpdateNodePoolRequest, opts ...grpc.CallOption) (*Operation, error) + // Sets the autoscaling settings of a specific node pool. + SetNodePoolAutoscaling(ctx context.Context, in *SetNodePoolAutoscalingRequest, opts ...grpc.CallOption) (*Operation, error) + // Sets the logging service of a specific cluster. + SetLoggingService(ctx context.Context, in *SetLoggingServiceRequest, opts ...grpc.CallOption) (*Operation, error) + // Sets the monitoring service of a specific cluster. + SetMonitoringService(ctx context.Context, in *SetMonitoringServiceRequest, opts ...grpc.CallOption) (*Operation, error) + // Sets the addons of a specific cluster. + SetAddonsConfig(ctx context.Context, in *SetAddonsConfigRequest, opts ...grpc.CallOption) (*Operation, error) + // Sets the locations of a specific cluster. + SetLocations(ctx context.Context, in *SetLocationsRequest, opts ...grpc.CallOption) (*Operation, error) + // Updates the master of a specific cluster. + UpdateMaster(ctx context.Context, in *UpdateMasterRequest, opts ...grpc.CallOption) (*Operation, error) + // Used to set master auth materials. Currently supports :- + // Changing the admin password of a specific cluster. + // This can be either via password generation or explicitly set. + // Modify basic_auth.csv and reset the K8S API server. + SetMasterAuth(ctx context.Context, in *SetMasterAuthRequest, opts ...grpc.CallOption) (*Operation, error) + // Deletes the cluster, including the Kubernetes endpoint and all worker + // nodes. + // + // Firewalls and routes that were configured during cluster creation + // are also deleted. + // + // Other Google Compute Engine resources that might be in use by the cluster + // (e.g. load balancer resources) will not be deleted if they weren't present + // at the initial create time. + DeleteCluster(ctx context.Context, in *DeleteClusterRequest, opts ...grpc.CallOption) (*Operation, error) + // Lists all operations in a project in a specific zone or all zones. + ListOperations(ctx context.Context, in *ListOperationsRequest, opts ...grpc.CallOption) (*ListOperationsResponse, error) + // Gets the specified operation. + GetOperation(ctx context.Context, in *GetOperationRequest, opts ...grpc.CallOption) (*Operation, error) + // Cancels the specified operation. + CancelOperation(ctx context.Context, in *CancelOperationRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) + // Returns configuration info about the Container Engine service. + GetServerConfig(ctx context.Context, in *GetServerConfigRequest, opts ...grpc.CallOption) (*ServerConfig, error) + // Lists the node pools for a cluster. + ListNodePools(ctx context.Context, in *ListNodePoolsRequest, opts ...grpc.CallOption) (*ListNodePoolsResponse, error) + // Retrieves the node pool requested. + GetNodePool(ctx context.Context, in *GetNodePoolRequest, opts ...grpc.CallOption) (*NodePool, error) + // Creates a node pool for a cluster. + CreateNodePool(ctx context.Context, in *CreateNodePoolRequest, opts ...grpc.CallOption) (*Operation, error) + // Deletes a node pool from a cluster. + DeleteNodePool(ctx context.Context, in *DeleteNodePoolRequest, opts ...grpc.CallOption) (*Operation, error) + // Roll back the previously Aborted or Failed NodePool upgrade. + // This will be an no-op if the last upgrade successfully completed. + RollbackNodePoolUpgrade(ctx context.Context, in *RollbackNodePoolUpgradeRequest, opts ...grpc.CallOption) (*Operation, error) + // Sets the NodeManagement options for a node pool. + SetNodePoolManagement(ctx context.Context, in *SetNodePoolManagementRequest, opts ...grpc.CallOption) (*Operation, error) + // Sets labels on a cluster. + SetLabels(ctx context.Context, in *SetLabelsRequest, opts ...grpc.CallOption) (*Operation, error) + // Enables or disables the ABAC authorization mechanism on a cluster. + SetLegacyAbac(ctx context.Context, in *SetLegacyAbacRequest, opts ...grpc.CallOption) (*Operation, error) + // Start master IP rotation. + StartIPRotation(ctx context.Context, in *StartIPRotationRequest, opts ...grpc.CallOption) (*Operation, error) + // Completes master IP rotation. + CompleteIPRotation(ctx context.Context, in *CompleteIPRotationRequest, opts ...grpc.CallOption) (*Operation, error) + // Sets the size of a specific node pool. + SetNodePoolSize(ctx context.Context, in *SetNodePoolSizeRequest, opts ...grpc.CallOption) (*Operation, error) + // Enables/Disables Network Policy for a cluster. + SetNetworkPolicy(ctx context.Context, in *SetNetworkPolicyRequest, opts ...grpc.CallOption) (*Operation, error) + // Sets the maintenance policy for a cluster. + SetMaintenancePolicy(ctx context.Context, in *SetMaintenancePolicyRequest, opts ...grpc.CallOption) (*Operation, error) +} + +type clusterManagerClient struct { + cc *grpc.ClientConn +} + +func NewClusterManagerClient(cc *grpc.ClientConn) ClusterManagerClient { + return &clusterManagerClient{cc} +} + +func (c *clusterManagerClient) ListClusters(ctx context.Context, in *ListClustersRequest, opts ...grpc.CallOption) (*ListClustersResponse, error) { + out := new(ListClustersResponse) + err := grpc.Invoke(ctx, "/google.container.v1alpha1.ClusterManager/ListClusters", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) GetCluster(ctx context.Context, in *GetClusterRequest, opts ...grpc.CallOption) (*Cluster, error) { + out := new(Cluster) + err := grpc.Invoke(ctx, "/google.container.v1alpha1.ClusterManager/GetCluster", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) CreateCluster(ctx context.Context, in *CreateClusterRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1alpha1.ClusterManager/CreateCluster", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) UpdateCluster(ctx context.Context, in *UpdateClusterRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1alpha1.ClusterManager/UpdateCluster", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) UpdateNodePool(ctx context.Context, in *UpdateNodePoolRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1alpha1.ClusterManager/UpdateNodePool", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) SetNodePoolAutoscaling(ctx context.Context, in *SetNodePoolAutoscalingRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1alpha1.ClusterManager/SetNodePoolAutoscaling", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) SetLoggingService(ctx context.Context, in *SetLoggingServiceRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1alpha1.ClusterManager/SetLoggingService", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) SetMonitoringService(ctx context.Context, in *SetMonitoringServiceRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1alpha1.ClusterManager/SetMonitoringService", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) SetAddonsConfig(ctx context.Context, in *SetAddonsConfigRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1alpha1.ClusterManager/SetAddonsConfig", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) SetLocations(ctx context.Context, in *SetLocationsRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1alpha1.ClusterManager/SetLocations", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) UpdateMaster(ctx context.Context, in *UpdateMasterRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1alpha1.ClusterManager/UpdateMaster", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) SetMasterAuth(ctx context.Context, in *SetMasterAuthRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1alpha1.ClusterManager/SetMasterAuth", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) DeleteCluster(ctx context.Context, in *DeleteClusterRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1alpha1.ClusterManager/DeleteCluster", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) ListOperations(ctx context.Context, in *ListOperationsRequest, opts ...grpc.CallOption) (*ListOperationsResponse, error) { + out := new(ListOperationsResponse) + err := grpc.Invoke(ctx, "/google.container.v1alpha1.ClusterManager/ListOperations", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) GetOperation(ctx context.Context, in *GetOperationRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1alpha1.ClusterManager/GetOperation", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) CancelOperation(ctx context.Context, in *CancelOperationRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { + out := new(google_protobuf1.Empty) + err := grpc.Invoke(ctx, "/google.container.v1alpha1.ClusterManager/CancelOperation", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) GetServerConfig(ctx context.Context, in *GetServerConfigRequest, opts ...grpc.CallOption) (*ServerConfig, error) { + out := new(ServerConfig) + err := grpc.Invoke(ctx, "/google.container.v1alpha1.ClusterManager/GetServerConfig", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) ListNodePools(ctx context.Context, in *ListNodePoolsRequest, opts ...grpc.CallOption) (*ListNodePoolsResponse, error) { + out := new(ListNodePoolsResponse) + err := grpc.Invoke(ctx, "/google.container.v1alpha1.ClusterManager/ListNodePools", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) GetNodePool(ctx context.Context, in *GetNodePoolRequest, opts ...grpc.CallOption) (*NodePool, error) { + out := new(NodePool) + err := grpc.Invoke(ctx, "/google.container.v1alpha1.ClusterManager/GetNodePool", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) CreateNodePool(ctx context.Context, in *CreateNodePoolRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1alpha1.ClusterManager/CreateNodePool", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) DeleteNodePool(ctx context.Context, in *DeleteNodePoolRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1alpha1.ClusterManager/DeleteNodePool", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) RollbackNodePoolUpgrade(ctx context.Context, in *RollbackNodePoolUpgradeRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1alpha1.ClusterManager/RollbackNodePoolUpgrade", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) SetNodePoolManagement(ctx context.Context, in *SetNodePoolManagementRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1alpha1.ClusterManager/SetNodePoolManagement", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) SetLabels(ctx context.Context, in *SetLabelsRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1alpha1.ClusterManager/SetLabels", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) SetLegacyAbac(ctx context.Context, in *SetLegacyAbacRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1alpha1.ClusterManager/SetLegacyAbac", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) StartIPRotation(ctx context.Context, in *StartIPRotationRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1alpha1.ClusterManager/StartIPRotation", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) CompleteIPRotation(ctx context.Context, in *CompleteIPRotationRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1alpha1.ClusterManager/CompleteIPRotation", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) SetNodePoolSize(ctx context.Context, in *SetNodePoolSizeRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1alpha1.ClusterManager/SetNodePoolSize", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) SetNetworkPolicy(ctx context.Context, in *SetNetworkPolicyRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1alpha1.ClusterManager/SetNetworkPolicy", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) SetMaintenancePolicy(ctx context.Context, in *SetMaintenancePolicyRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1alpha1.ClusterManager/SetMaintenancePolicy", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for ClusterManager service + +type ClusterManagerServer interface { + // Lists all clusters owned by a project in either the specified zone or all + // zones. + ListClusters(context.Context, *ListClustersRequest) (*ListClustersResponse, error) + // Gets the details of a specific cluster. + GetCluster(context.Context, *GetClusterRequest) (*Cluster, error) + // Creates a cluster, consisting of the specified number and type of Google + // Compute Engine instances. + // + // By default, the cluster is created in the project's + // [default network](/compute/docs/networks-and-firewalls#networks). + // + // One firewall is added for the cluster. After cluster creation, + // the cluster creates routes for each node to allow the containers + // on that node to communicate with all other instances in the + // cluster. + // + // Finally, an entry is added to the project's global metadata indicating + // which CIDR range is being used by the cluster. + CreateCluster(context.Context, *CreateClusterRequest) (*Operation, error) + // Updates the settings of a specific cluster. + UpdateCluster(context.Context, *UpdateClusterRequest) (*Operation, error) + // Updates the version and/or iamge type of a specific node pool. + UpdateNodePool(context.Context, *UpdateNodePoolRequest) (*Operation, error) + // Sets the autoscaling settings of a specific node pool. + SetNodePoolAutoscaling(context.Context, *SetNodePoolAutoscalingRequest) (*Operation, error) + // Sets the logging service of a specific cluster. + SetLoggingService(context.Context, *SetLoggingServiceRequest) (*Operation, error) + // Sets the monitoring service of a specific cluster. + SetMonitoringService(context.Context, *SetMonitoringServiceRequest) (*Operation, error) + // Sets the addons of a specific cluster. + SetAddonsConfig(context.Context, *SetAddonsConfigRequest) (*Operation, error) + // Sets the locations of a specific cluster. + SetLocations(context.Context, *SetLocationsRequest) (*Operation, error) + // Updates the master of a specific cluster. + UpdateMaster(context.Context, *UpdateMasterRequest) (*Operation, error) + // Used to set master auth materials. Currently supports :- + // Changing the admin password of a specific cluster. + // This can be either via password generation or explicitly set. + // Modify basic_auth.csv and reset the K8S API server. + SetMasterAuth(context.Context, *SetMasterAuthRequest) (*Operation, error) + // Deletes the cluster, including the Kubernetes endpoint and all worker + // nodes. + // + // Firewalls and routes that were configured during cluster creation + // are also deleted. + // + // Other Google Compute Engine resources that might be in use by the cluster + // (e.g. load balancer resources) will not be deleted if they weren't present + // at the initial create time. + DeleteCluster(context.Context, *DeleteClusterRequest) (*Operation, error) + // Lists all operations in a project in a specific zone or all zones. + ListOperations(context.Context, *ListOperationsRequest) (*ListOperationsResponse, error) + // Gets the specified operation. + GetOperation(context.Context, *GetOperationRequest) (*Operation, error) + // Cancels the specified operation. + CancelOperation(context.Context, *CancelOperationRequest) (*google_protobuf1.Empty, error) + // Returns configuration info about the Container Engine service. + GetServerConfig(context.Context, *GetServerConfigRequest) (*ServerConfig, error) + // Lists the node pools for a cluster. + ListNodePools(context.Context, *ListNodePoolsRequest) (*ListNodePoolsResponse, error) + // Retrieves the node pool requested. + GetNodePool(context.Context, *GetNodePoolRequest) (*NodePool, error) + // Creates a node pool for a cluster. + CreateNodePool(context.Context, *CreateNodePoolRequest) (*Operation, error) + // Deletes a node pool from a cluster. + DeleteNodePool(context.Context, *DeleteNodePoolRequest) (*Operation, error) + // Roll back the previously Aborted or Failed NodePool upgrade. + // This will be an no-op if the last upgrade successfully completed. + RollbackNodePoolUpgrade(context.Context, *RollbackNodePoolUpgradeRequest) (*Operation, error) + // Sets the NodeManagement options for a node pool. + SetNodePoolManagement(context.Context, *SetNodePoolManagementRequest) (*Operation, error) + // Sets labels on a cluster. + SetLabels(context.Context, *SetLabelsRequest) (*Operation, error) + // Enables or disables the ABAC authorization mechanism on a cluster. + SetLegacyAbac(context.Context, *SetLegacyAbacRequest) (*Operation, error) + // Start master IP rotation. + StartIPRotation(context.Context, *StartIPRotationRequest) (*Operation, error) + // Completes master IP rotation. + CompleteIPRotation(context.Context, *CompleteIPRotationRequest) (*Operation, error) + // Sets the size of a specific node pool. + SetNodePoolSize(context.Context, *SetNodePoolSizeRequest) (*Operation, error) + // Enables/Disables Network Policy for a cluster. + SetNetworkPolicy(context.Context, *SetNetworkPolicyRequest) (*Operation, error) + // Sets the maintenance policy for a cluster. + SetMaintenancePolicy(context.Context, *SetMaintenancePolicyRequest) (*Operation, error) +} + +func RegisterClusterManagerServer(s *grpc.Server, srv ClusterManagerServer) { + s.RegisterService(&_ClusterManager_serviceDesc, srv) +} + +func _ClusterManager_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.(ClusterManagerServer).ListClusters(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1alpha1.ClusterManager/ListClusters", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).ListClusters(ctx, req.(*ListClustersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_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.(ClusterManagerServer).GetCluster(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1alpha1.ClusterManager/GetCluster", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).GetCluster(ctx, req.(*GetClusterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_CreateCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateClusterRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).CreateCluster(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1alpha1.ClusterManager/CreateCluster", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).CreateCluster(ctx, req.(*CreateClusterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_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.(ClusterManagerServer).UpdateCluster(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1alpha1.ClusterManager/UpdateCluster", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).UpdateCluster(ctx, req.(*UpdateClusterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_UpdateNodePool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateNodePoolRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).UpdateNodePool(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1alpha1.ClusterManager/UpdateNodePool", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).UpdateNodePool(ctx, req.(*UpdateNodePoolRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_SetNodePoolAutoscaling_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetNodePoolAutoscalingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).SetNodePoolAutoscaling(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1alpha1.ClusterManager/SetNodePoolAutoscaling", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).SetNodePoolAutoscaling(ctx, req.(*SetNodePoolAutoscalingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_SetLoggingService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetLoggingServiceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).SetLoggingService(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1alpha1.ClusterManager/SetLoggingService", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).SetLoggingService(ctx, req.(*SetLoggingServiceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_SetMonitoringService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetMonitoringServiceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).SetMonitoringService(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1alpha1.ClusterManager/SetMonitoringService", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).SetMonitoringService(ctx, req.(*SetMonitoringServiceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_SetAddonsConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetAddonsConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).SetAddonsConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1alpha1.ClusterManager/SetAddonsConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).SetAddonsConfig(ctx, req.(*SetAddonsConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_SetLocations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetLocationsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).SetLocations(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1alpha1.ClusterManager/SetLocations", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).SetLocations(ctx, req.(*SetLocationsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_UpdateMaster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateMasterRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).UpdateMaster(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1alpha1.ClusterManager/UpdateMaster", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).UpdateMaster(ctx, req.(*UpdateMasterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_SetMasterAuth_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetMasterAuthRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).SetMasterAuth(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1alpha1.ClusterManager/SetMasterAuth", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).SetMasterAuth(ctx, req.(*SetMasterAuthRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_DeleteCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteClusterRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).DeleteCluster(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1alpha1.ClusterManager/DeleteCluster", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).DeleteCluster(ctx, req.(*DeleteClusterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_ListOperations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListOperationsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).ListOperations(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1alpha1.ClusterManager/ListOperations", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).ListOperations(ctx, req.(*ListOperationsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_GetOperation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetOperationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).GetOperation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1alpha1.ClusterManager/GetOperation", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).GetOperation(ctx, req.(*GetOperationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_CancelOperation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CancelOperationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).CancelOperation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1alpha1.ClusterManager/CancelOperation", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).CancelOperation(ctx, req.(*CancelOperationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_GetServerConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetServerConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).GetServerConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1alpha1.ClusterManager/GetServerConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).GetServerConfig(ctx, req.(*GetServerConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_ListNodePools_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListNodePoolsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).ListNodePools(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1alpha1.ClusterManager/ListNodePools", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).ListNodePools(ctx, req.(*ListNodePoolsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_GetNodePool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetNodePoolRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).GetNodePool(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1alpha1.ClusterManager/GetNodePool", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).GetNodePool(ctx, req.(*GetNodePoolRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_CreateNodePool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateNodePoolRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).CreateNodePool(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1alpha1.ClusterManager/CreateNodePool", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).CreateNodePool(ctx, req.(*CreateNodePoolRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_DeleteNodePool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteNodePoolRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).DeleteNodePool(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1alpha1.ClusterManager/DeleteNodePool", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).DeleteNodePool(ctx, req.(*DeleteNodePoolRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_RollbackNodePoolUpgrade_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RollbackNodePoolUpgradeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).RollbackNodePoolUpgrade(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1alpha1.ClusterManager/RollbackNodePoolUpgrade", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).RollbackNodePoolUpgrade(ctx, req.(*RollbackNodePoolUpgradeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_SetNodePoolManagement_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetNodePoolManagementRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).SetNodePoolManagement(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1alpha1.ClusterManager/SetNodePoolManagement", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).SetNodePoolManagement(ctx, req.(*SetNodePoolManagementRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_SetLabels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetLabelsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).SetLabels(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1alpha1.ClusterManager/SetLabels", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).SetLabels(ctx, req.(*SetLabelsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_SetLegacyAbac_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetLegacyAbacRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).SetLegacyAbac(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1alpha1.ClusterManager/SetLegacyAbac", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).SetLegacyAbac(ctx, req.(*SetLegacyAbacRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_StartIPRotation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StartIPRotationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).StartIPRotation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1alpha1.ClusterManager/StartIPRotation", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).StartIPRotation(ctx, req.(*StartIPRotationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_CompleteIPRotation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CompleteIPRotationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).CompleteIPRotation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1alpha1.ClusterManager/CompleteIPRotation", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).CompleteIPRotation(ctx, req.(*CompleteIPRotationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_SetNodePoolSize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetNodePoolSizeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).SetNodePoolSize(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1alpha1.ClusterManager/SetNodePoolSize", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).SetNodePoolSize(ctx, req.(*SetNodePoolSizeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_SetNetworkPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetNetworkPolicyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).SetNetworkPolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1alpha1.ClusterManager/SetNetworkPolicy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).SetNetworkPolicy(ctx, req.(*SetNetworkPolicyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_SetMaintenancePolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetMaintenancePolicyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).SetMaintenancePolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1alpha1.ClusterManager/SetMaintenancePolicy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).SetMaintenancePolicy(ctx, req.(*SetMaintenancePolicyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _ClusterManager_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.container.v1alpha1.ClusterManager", + HandlerType: (*ClusterManagerServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListClusters", + Handler: _ClusterManager_ListClusters_Handler, + }, + { + MethodName: "GetCluster", + Handler: _ClusterManager_GetCluster_Handler, + }, + { + MethodName: "CreateCluster", + Handler: _ClusterManager_CreateCluster_Handler, + }, + { + MethodName: "UpdateCluster", + Handler: _ClusterManager_UpdateCluster_Handler, + }, + { + MethodName: "UpdateNodePool", + Handler: _ClusterManager_UpdateNodePool_Handler, + }, + { + MethodName: "SetNodePoolAutoscaling", + Handler: _ClusterManager_SetNodePoolAutoscaling_Handler, + }, + { + MethodName: "SetLoggingService", + Handler: _ClusterManager_SetLoggingService_Handler, + }, + { + MethodName: "SetMonitoringService", + Handler: _ClusterManager_SetMonitoringService_Handler, + }, + { + MethodName: "SetAddonsConfig", + Handler: _ClusterManager_SetAddonsConfig_Handler, + }, + { + MethodName: "SetLocations", + Handler: _ClusterManager_SetLocations_Handler, + }, + { + MethodName: "UpdateMaster", + Handler: _ClusterManager_UpdateMaster_Handler, + }, + { + MethodName: "SetMasterAuth", + Handler: _ClusterManager_SetMasterAuth_Handler, + }, + { + MethodName: "DeleteCluster", + Handler: _ClusterManager_DeleteCluster_Handler, + }, + { + MethodName: "ListOperations", + Handler: _ClusterManager_ListOperations_Handler, + }, + { + MethodName: "GetOperation", + Handler: _ClusterManager_GetOperation_Handler, + }, + { + MethodName: "CancelOperation", + Handler: _ClusterManager_CancelOperation_Handler, + }, + { + MethodName: "GetServerConfig", + Handler: _ClusterManager_GetServerConfig_Handler, + }, + { + MethodName: "ListNodePools", + Handler: _ClusterManager_ListNodePools_Handler, + }, + { + MethodName: "GetNodePool", + Handler: _ClusterManager_GetNodePool_Handler, + }, + { + MethodName: "CreateNodePool", + Handler: _ClusterManager_CreateNodePool_Handler, + }, + { + MethodName: "DeleteNodePool", + Handler: _ClusterManager_DeleteNodePool_Handler, + }, + { + MethodName: "RollbackNodePoolUpgrade", + Handler: _ClusterManager_RollbackNodePoolUpgrade_Handler, + }, + { + MethodName: "SetNodePoolManagement", + Handler: _ClusterManager_SetNodePoolManagement_Handler, + }, + { + MethodName: "SetLabels", + Handler: _ClusterManager_SetLabels_Handler, + }, + { + MethodName: "SetLegacyAbac", + Handler: _ClusterManager_SetLegacyAbac_Handler, + }, + { + MethodName: "StartIPRotation", + Handler: _ClusterManager_StartIPRotation_Handler, + }, + { + MethodName: "CompleteIPRotation", + Handler: _ClusterManager_CompleteIPRotation_Handler, + }, + { + MethodName: "SetNodePoolSize", + Handler: _ClusterManager_SetNodePoolSize_Handler, + }, + { + MethodName: "SetNetworkPolicy", + Handler: _ClusterManager_SetNetworkPolicy_Handler, + }, + { + MethodName: "SetMaintenancePolicy", + Handler: _ClusterManager_SetMaintenancePolicy_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/container/v1alpha1/cluster_service.proto", +} + +func init() { proto.RegisterFile("google/container/v1alpha1/cluster_service.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 4786 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08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, 0x09, 0x6c, 0x9c, 0x17, 0x76, 0x22, 0x62, 0x70, 0x2b, + 0x97, 0x7f, 0x9e, 0x86, 0x4c, 0xdd, 0xc1, 0x2e, 0x55, 0x6d, 0x6c, 0xce, 0x1a, 0x44, 0x82, 0x29, + 0x21, 0x12, 0x34, 0x20, 0x6f, 0x07, 0x4c, 0xcc, 0x96, 0xa6, 0xc7, 0x3a, 0xcd, 0x70, 0x97, 0x75, + 0x62, 0x64, 0xea, 0x7c, 0xb8, 0x00, 0xb5, 0xb9, 0x4a, 0xe8, 0x7e, 0x53, 0x63, 0xab, 0x7d, 0xfd, + 0x95, 0x06, 0x1c, 0xf0, 0x2a, 0xa4, 0x0d, 0xec, 0xeb, 0x66, 0x87, 0x9b, 0x36, 0x7f, 0x8a, 0x71, + 0xcc, 0x33, 0x71, 0x8e, 0x39, 0x12, 0x10, 0xd3, 0x03, 0x01, 0xf1, 0x49, 0xc8, 0xfa, 0xba, 0xdb, + 0xc6, 0x3e, 0x1b, 0x66, 0x47, 0x0d, 0x18, 0x89, 0x4e, 0x10, 0x5d, 0x5f, 0x26, 0xea, 0xfa, 0xc8, + 0x85, 0xda, 0xf3, 0x75, 0xd7, 0x67, 0x6e, 0x93, 0x5d, 0x56, 0x32, 0x94, 0x42, 0xbd, 0xe6, 0x25, + 0x1a, 0x58, 0xd9, 0x20, 0x4b, 0x24, 0x67, 0xb1, 0x65, 0x90, 0x21, 0x59, 0x1d, 0xeb, 0x34, 0xb3, + 0x30, 0xdb, 0x50, 0x6a, 0x5b, 0x31, 0xfe, 0x72, 0x0e, 0x52, 0x5b, 0xf5, 0x9a, 0xc2, 0x1c, 0x65, + 0x79, 0xb3, 0xae, 0xee, 0x51, 0x47, 0x29, 0xff, 0xcf, 0x14, 0xa4, 0xa8, 0xd2, 0x97, 0xa1, 0xb0, + 0xf7, 0x4e, 0x43, 0x19, 0x58, 0x10, 0x41, 0xbe, 0xa2, 0x2a, 0xe5, 0x3d, 0x45, 0xab, 0xec, 0xec, + 0x37, 0xf7, 0x14, 0xb5, 0x20, 0x11, 0xda, 0x96, 0xb2, 0xa3, 0x08, 0xb4, 0x29, 0x42, 0xdb, 0x6f, + 0x6c, 0xab, 0xe5, 0x2d, 0x45, 0xdb, 0x2d, 0x53, 0xda, 0x34, 0x5a, 0x84, 0xf9, 0x80, 0x56, 0xab, + 0x6f, 0x29, 0xcd, 0x42, 0x8a, 0x4c, 0x53, 0x95, 0x46, 0xb9, 0xaa, 0x86, 0xac, 0x33, 0x8c, 0x75, + 0x4b, 0xdc, 0x22, 0x4d, 0xc0, 0xf0, 0x6d, 0x09, 0xa7, 0xd6, 0xa8, 0xd7, 0x77, 0x0a, 0xb3, 0x84, + 0xca, 0x37, 0xee, 0x53, 0xe7, 0xd0, 0xe3, 0x50, 0x6c, 0x2a, 0x7b, 0x7d, 0x92, 0xb6, 0x5b, 0xae, + 0x95, 0xb7, 0x95, 0x5d, 0xa5, 0xb6, 0x57, 0xc8, 0xa0, 0x15, 0x58, 0x2c, 0xef, 0xef, 0xd5, 0x35, + 0xbe, 0x2d, 0x03, 0x02, 0x44, 0x81, 0x94, 0x1c, 0x05, 0x98, 0x45, 0x79, 0x00, 0xb2, 0xd8, 0x4e, + 0x79, 0x53, 0xd9, 0x69, 0x16, 0x72, 0x68, 0x09, 0x16, 0xc8, 0x33, 0x93, 0x49, 0x2b, 0xef, 0xef, + 0xdd, 0x29, 0xcc, 0x53, 0xed, 0x47, 0x76, 0x6c, 0x56, 0xdf, 0x55, 0x0a, 0xf9, 0x90, 0xae, 0xec, + 0xdd, 0xaf, 0xab, 0x77, 0xb5, 0x46, 0x7d, 0xa7, 0x5a, 0x79, 0xa7, 0xb0, 0x80, 0x4a, 0xb0, 0xca, + 0x16, 0xa9, 0xd6, 0xf6, 0x94, 0x5a, 0xb9, 0x56, 0x51, 0x82, 0xb1, 0x82, 0xfc, 0x7d, 0x09, 0x96, + 0x2b, 0x34, 0xf3, 0xe0, 0x31, 0x4a, 0xc5, 0x1f,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0x71, 0x71, + 0x62, 0xc7, 0x94, 0x54, 0x52, 0xb1, 0x25, 0x95, 0x38, 0x5b, 0xfc, 0x13, 0x09, 0x1e, 0x6b, 0x62, + 0x7f, 0x28, 0x3d, 0xbd, 0x38, 0xb8, 0xf1, 0x85, 0x9d, 0xd4, 0xa8, 0xc2, 0x4e, 0x9c, 0x82, 0xff, + 0x51, 0x82, 0xd5, 0x26, 0xf6, 0x23, 0x69, 0xf0, 0x85, 0xe1, 0x1d, 0xaa, 0x09, 0xa5, 0xce, 0x53, + 0x13, 0x8a, 0x13, 0xe7, 0x37, 0x25, 0x58, 0xa2, 0xf6, 0xc2, 0xd3, 0xd7, 0x8b, 0x93, 0x25, 0x52, + 0x2d, 0x4a, 0x0d, 0x56, 0x8b, 0xe2, 0xb0, 0x7d, 0x26, 0xc1, 0x12, 0xf3, 0x55, 0x2c, 0x2b, 0xbc, + 0x38, 0x6c, 0xcf, 0x40, 0x7e, 0x20, 0x2b, 0x65, 0x36, 0x31, 0xdf, 0x8d, 0x5c, 0xec, 0x03, 0x90, + 0xb3, 0x02, 0xc8, 0x7f, 0x9d, 0x82, 0x65, 0x62, 0xc4, 0xfd, 0x92, 0xe3, 0x85, 0xa1, 0xac, 0x41, + 0x5a, 0x6f, 0xf9, 0x01, 0xba, 0xfc, 0xcd, 0x97, 0x12, 0xcc, 0x20, 0x0e, 0xd2, 0x7a, 0x99, 0x72, + 0xab, 0x7c, 0x15, 0xf4, 0x46, 0x18, 0x61, 0x4e, 0x55, 0x52, 0x1d, 0x0c, 0x2f, 0xa2, 0x36, 0x1a, + 0x90, 0x66, 0x9b, 0x90, 0x5c, 0x6f, 0xbf, 0x76, 0xb7, 0x56, 0xbf, 0x5f, 0x63, 0x57, 0x67, 0x92, + 0x6f, 0x34, 0xca, 0xcd, 0xe6, 0xfd, 0xba, 0xba, 0x55, 0x90, 0x48, 0x16, 0xb4, 0xad, 0xd4, 0x14, + 0x95, 0x64, 0x54, 0x21, 0x79, 0x2a, 0x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0xd2, 0xb1, 0x7b, 0xc6, 0x7a, 0x25, 0xdc, 0xfc, 0xde, 0x0d, 0xfa, 0x03, 0xf5, + 0x1b, 0xff, 0x10, 0xcc, 0x78, 0x9f, 0xce, 0x78, 0x3f, 0x9c, 0xf1, 0xfe, 0x3d, 0xbe, 0xda, 0x41, + 0x9a, 0x6e, 0xf9, 0xe2, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0xec, 0x17, 0x6d, 0x5d, 0xce, 0x4d, + 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/container/v1beta1/cluster_service.pb.go b/vendor/google.golang.org/genproto/googleapis/container/v1beta1/cluster_service.pb.go new file mode 100644 index 0000000000..9fb21a43b4 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/container/v1beta1/cluster_service.pb.go @@ -0,0 +1,4719 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/container/v1beta1/cluster_service.proto + +/* +Package container is a generated protocol buffer package. + +It is generated from these files: + google/container/v1beta1/cluster_service.proto + +It has these top-level messages: + NodeConfig + NodeTaint + MasterAuth + ClientCertificateConfig + AddonsConfig + HttpLoadBalancing + HorizontalPodAutoscaling + KubernetesDashboard + NetworkPolicyConfig + MasterAuthorizedNetworksConfig + NetworkPolicy + IPAllocationPolicy + PodSecurityPolicyConfig + Cluster + ClusterUpdate + Operation + CreateClusterRequest + GetClusterRequest + UpdateClusterRequest + SetMasterAuthRequest + DeleteClusterRequest + ListClustersRequest + ListClustersResponse + GetOperationRequest + ListOperationsRequest + CancelOperationRequest + ListOperationsResponse + GetServerConfigRequest + ServerConfig + CreateNodePoolRequest + DeleteNodePoolRequest + ListNodePoolsRequest + GetNodePoolRequest + NodePool + NodeManagement + AutoUpgradeOptions + MaintenancePolicy + MaintenanceWindow + DailyMaintenanceWindow + SetNodePoolManagementRequest + RollbackNodePoolUpgradeRequest + ListNodePoolsResponse + NodePoolAutoscaling + SetLabelsRequest + SetLegacyAbacRequest + StartIPRotationRequest + CompleteIPRotationRequest + AcceleratorConfig + SetNetworkPolicyRequest + SetMaintenancePolicyRequest +*/ +package container + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf1 "github.com/golang/protobuf/ptypes/empty" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Possible values for Effect in taint. +type NodeTaint_Effect int32 + +const ( + // Not set + NodeTaint_EFFECT_UNSPECIFIED NodeTaint_Effect = 0 + // NoSchedule + NodeTaint_NO_SCHEDULE NodeTaint_Effect = 1 + // PreferNoSchedule + NodeTaint_PREFER_NO_SCHEDULE NodeTaint_Effect = 2 + // NoExecute + NodeTaint_NO_EXECUTE NodeTaint_Effect = 3 +) + +var NodeTaint_Effect_name = map[int32]string{ + 0: "EFFECT_UNSPECIFIED", + 1: "NO_SCHEDULE", + 2: "PREFER_NO_SCHEDULE", + 3: "NO_EXECUTE", +} +var NodeTaint_Effect_value = map[string]int32{ + "EFFECT_UNSPECIFIED": 0, + "NO_SCHEDULE": 1, + "PREFER_NO_SCHEDULE": 2, + "NO_EXECUTE": 3, +} + +func (x NodeTaint_Effect) String() string { + return proto.EnumName(NodeTaint_Effect_name, int32(x)) +} +func (NodeTaint_Effect) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{1, 0} } + +// Allowed Network Policy providers. +type NetworkPolicy_Provider int32 + +const ( + // Not set + NetworkPolicy_PROVIDER_UNSPECIFIED NetworkPolicy_Provider = 0 + // Tigera (Calico Felix). + NetworkPolicy_CALICO NetworkPolicy_Provider = 1 +) + +var NetworkPolicy_Provider_name = map[int32]string{ + 0: "PROVIDER_UNSPECIFIED", + 1: "CALICO", +} +var NetworkPolicy_Provider_value = map[string]int32{ + "PROVIDER_UNSPECIFIED": 0, + "CALICO": 1, +} + +func (x NetworkPolicy_Provider) String() string { + return proto.EnumName(NetworkPolicy_Provider_name, int32(x)) +} +func (NetworkPolicy_Provider) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{10, 0} } + +// The current status of the cluster. +type Cluster_Status int32 + +const ( + // Not set. + Cluster_STATUS_UNSPECIFIED Cluster_Status = 0 + // The PROVISIONING state indicates the cluster is being created. + Cluster_PROVISIONING Cluster_Status = 1 + // The RUNNING state indicates the cluster has been created and is fully + // usable. + Cluster_RUNNING Cluster_Status = 2 + // The RECONCILING state indicates that some work is actively being done on + // the cluster, such as upgrading the master or node software. Details can + // be found in the `statusMessage` field. + Cluster_RECONCILING Cluster_Status = 3 + // The STOPPING state indicates the cluster is being deleted. + Cluster_STOPPING Cluster_Status = 4 + // The ERROR state indicates the cluster may be unusable. Details + // can be found in the `statusMessage` field. + Cluster_ERROR Cluster_Status = 5 +) + +var Cluster_Status_name = map[int32]string{ + 0: "STATUS_UNSPECIFIED", + 1: "PROVISIONING", + 2: "RUNNING", + 3: "RECONCILING", + 4: "STOPPING", + 5: "ERROR", +} +var Cluster_Status_value = map[string]int32{ + "STATUS_UNSPECIFIED": 0, + "PROVISIONING": 1, + "RUNNING": 2, + "RECONCILING": 3, + "STOPPING": 4, + "ERROR": 5, +} + +func (x Cluster_Status) String() string { + return proto.EnumName(Cluster_Status_name, int32(x)) +} +func (Cluster_Status) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{13, 0} } + +// Current status of the operation. +type Operation_Status int32 + +const ( + // Not set. + Operation_STATUS_UNSPECIFIED Operation_Status = 0 + // The operation has been created. + Operation_PENDING Operation_Status = 1 + // The operation is currently running. + Operation_RUNNING Operation_Status = 2 + // The operation is done, either cancelled or completed. + Operation_DONE Operation_Status = 3 + // The operation is aborting. + Operation_ABORTING Operation_Status = 4 +) + +var Operation_Status_name = map[int32]string{ + 0: "STATUS_UNSPECIFIED", + 1: "PENDING", + 2: "RUNNING", + 3: "DONE", + 4: "ABORTING", +} +var Operation_Status_value = map[string]int32{ + "STATUS_UNSPECIFIED": 0, + "PENDING": 1, + "RUNNING": 2, + "DONE": 3, + "ABORTING": 4, +} + +func (x Operation_Status) String() string { + return proto.EnumName(Operation_Status_name, int32(x)) +} +func (Operation_Status) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{15, 0} } + +// Operation type. +type Operation_Type int32 + +const ( + // Not set. + Operation_TYPE_UNSPECIFIED Operation_Type = 0 + // Cluster create. + Operation_CREATE_CLUSTER Operation_Type = 1 + // Cluster delete. + Operation_DELETE_CLUSTER Operation_Type = 2 + // A master upgrade. + Operation_UPGRADE_MASTER Operation_Type = 3 + // A node upgrade. + Operation_UPGRADE_NODES Operation_Type = 4 + // Cluster repair. + Operation_REPAIR_CLUSTER Operation_Type = 5 + // Cluster update. + Operation_UPDATE_CLUSTER Operation_Type = 6 + // Node pool create. + Operation_CREATE_NODE_POOL Operation_Type = 7 + // Node pool delete. + Operation_DELETE_NODE_POOL Operation_Type = 8 + // Set node pool management. + Operation_SET_NODE_POOL_MANAGEMENT Operation_Type = 9 + // Automatic node pool repair. + Operation_AUTO_REPAIR_NODES Operation_Type = 10 + // Automatic node upgrade. + Operation_AUTO_UPGRADE_NODES Operation_Type = 11 + // Set labels. + Operation_SET_LABELS Operation_Type = 12 + // Set/generate master auth materials + Operation_SET_MASTER_AUTH Operation_Type = 13 + // Set node pool size. + Operation_SET_NODE_POOL_SIZE Operation_Type = 14 + // Updates network policy for a cluster. + Operation_SET_NETWORK_POLICY Operation_Type = 15 + // Set the maintenance policy. + Operation_SET_MAINTENANCE_POLICY Operation_Type = 16 +) + +var Operation_Type_name = map[int32]string{ + 0: "TYPE_UNSPECIFIED", + 1: "CREATE_CLUSTER", + 2: "DELETE_CLUSTER", + 3: "UPGRADE_MASTER", + 4: "UPGRADE_NODES", + 5: "REPAIR_CLUSTER", + 6: "UPDATE_CLUSTER", + 7: "CREATE_NODE_POOL", + 8: "DELETE_NODE_POOL", + 9: "SET_NODE_POOL_MANAGEMENT", + 10: "AUTO_REPAIR_NODES", + 11: "AUTO_UPGRADE_NODES", + 12: "SET_LABELS", + 13: "SET_MASTER_AUTH", + 14: "SET_NODE_POOL_SIZE", + 15: "SET_NETWORK_POLICY", + 16: "SET_MAINTENANCE_POLICY", +} +var Operation_Type_value = map[string]int32{ + "TYPE_UNSPECIFIED": 0, + "CREATE_CLUSTER": 1, + "DELETE_CLUSTER": 2, + "UPGRADE_MASTER": 3, + "UPGRADE_NODES": 4, + "REPAIR_CLUSTER": 5, + "UPDATE_CLUSTER": 6, + "CREATE_NODE_POOL": 7, + "DELETE_NODE_POOL": 8, + "SET_NODE_POOL_MANAGEMENT": 9, + "AUTO_REPAIR_NODES": 10, + "AUTO_UPGRADE_NODES": 11, + "SET_LABELS": 12, + "SET_MASTER_AUTH": 13, + "SET_NODE_POOL_SIZE": 14, + "SET_NETWORK_POLICY": 15, + "SET_MAINTENANCE_POLICY": 16, +} + +func (x Operation_Type) String() string { + return proto.EnumName(Operation_Type_name, int32(x)) +} +func (Operation_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{15, 1} } + +// Operation type: what type update to perform. +type SetMasterAuthRequest_Action int32 + +const ( + // Operation is unknown and will error out. + SetMasterAuthRequest_UNKNOWN SetMasterAuthRequest_Action = 0 + // Set the password to a user generated value. + SetMasterAuthRequest_SET_PASSWORD SetMasterAuthRequest_Action = 1 + // Generate a new password and set it to that. + SetMasterAuthRequest_GENERATE_PASSWORD SetMasterAuthRequest_Action = 2 + // Set the username. If an empty username is provided, basic authentication + // is disabled for the cluster. If a non-empty username is provided, basic + // authentication is enabled, with either a provided password or a generated + // one. + SetMasterAuthRequest_SET_USERNAME SetMasterAuthRequest_Action = 3 +) + +var SetMasterAuthRequest_Action_name = map[int32]string{ + 0: "UNKNOWN", + 1: "SET_PASSWORD", + 2: "GENERATE_PASSWORD", + 3: "SET_USERNAME", +} +var SetMasterAuthRequest_Action_value = map[string]int32{ + "UNKNOWN": 0, + "SET_PASSWORD": 1, + "GENERATE_PASSWORD": 2, + "SET_USERNAME": 3, +} + +func (x SetMasterAuthRequest_Action) String() string { + return proto.EnumName(SetMasterAuthRequest_Action_name, int32(x)) +} +func (SetMasterAuthRequest_Action) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{19, 0} +} + +// The current status of the node pool instance. +type NodePool_Status int32 + +const ( + // Not set. + NodePool_STATUS_UNSPECIFIED NodePool_Status = 0 + // The PROVISIONING state indicates the node pool is being created. + NodePool_PROVISIONING NodePool_Status = 1 + // The RUNNING state indicates the node pool has been created + // and is fully usable. + NodePool_RUNNING NodePool_Status = 2 + // The RUNNING_WITH_ERROR state indicates the node pool has been created + // and is partially usable. Some error state has occurred and some + // functionality may be impaired. Customer may need to reissue a request + // or trigger a new update. + NodePool_RUNNING_WITH_ERROR NodePool_Status = 3 + // The RECONCILING state indicates that some work is actively being done on + // the node pool, such as upgrading node software. Details can + // be found in the `statusMessage` field. + NodePool_RECONCILING NodePool_Status = 4 + // The STOPPING state indicates the node pool is being deleted. + NodePool_STOPPING NodePool_Status = 5 + // The ERROR state indicates the node pool may be unusable. Details + // can be found in the `statusMessage` field. + NodePool_ERROR NodePool_Status = 6 +) + +var NodePool_Status_name = map[int32]string{ + 0: "STATUS_UNSPECIFIED", + 1: "PROVISIONING", + 2: "RUNNING", + 3: "RUNNING_WITH_ERROR", + 4: "RECONCILING", + 5: "STOPPING", + 6: "ERROR", +} +var NodePool_Status_value = map[string]int32{ + "STATUS_UNSPECIFIED": 0, + "PROVISIONING": 1, + "RUNNING": 2, + "RUNNING_WITH_ERROR": 3, + "RECONCILING": 4, + "STOPPING": 5, + "ERROR": 6, +} + +func (x NodePool_Status) String() string { + return proto.EnumName(NodePool_Status_name, int32(x)) +} +func (NodePool_Status) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{33, 0} } + +// Parameters that describe the nodes in a cluster. +type NodeConfig struct { + // The name of a Google Compute Engine [machine + // type](/compute/docs/machine-types) (e.g. + // `n1-standard-1`). + // + // If unspecified, the default machine type is + // `n1-standard-1`. + MachineType string `protobuf:"bytes,1,opt,name=machine_type,json=machineType" json:"machine_type,omitempty"` + // Size of the disk attached to each node, specified in GB. + // The smallest allowed disk size is 10GB. + // + // If unspecified, the default disk size is 100GB. + DiskSizeGb int32 `protobuf:"varint,2,opt,name=disk_size_gb,json=diskSizeGb" json:"disk_size_gb,omitempty"` + // The set of Google API scopes to be made available on all of the + // node VMs under the "default" service account. + // + // The following scopes are recommended, but not required, and by default are + // not included: + // + // * `https://www.googleapis.com/auth/compute` is required for mounting + // persistent storage on your nodes. + // * `https://www.googleapis.com/auth/devstorage.read_only` is required for + // communicating with **gcr.io** + // (the [Google Container Registry](/container-registry/)). + // + // If unspecified, no scopes are added, unless Cloud Logging or Cloud + // Monitoring are enabled, in which case their required scopes will be added. + OauthScopes []string `protobuf:"bytes,3,rep,name=oauth_scopes,json=oauthScopes" json:"oauth_scopes,omitempty"` + // The Google Cloud Platform Service Account to be used by the node VMs. If + // no Service Account is specified, the "default" service account is used. + ServiceAccount string `protobuf:"bytes,9,opt,name=service_account,json=serviceAccount" json:"service_account,omitempty"` + // The metadata key/value pairs assigned to instances in the cluster. + // + // Keys must conform to the regexp [a-zA-Z0-9-_]+ and be less than 128 bytes + // in length. These are reflected as part of a URL in the metadata server. + // Additionally, to avoid ambiguity, keys must not conflict with any other + // metadata keys for the project or be one of the four reserved keys: + // "instance-template", "kube-env", "startup-script", and "user-data" + // + // Values are free-form strings, and only have meaning as interpreted by + // the image running in the instance. The only restriction placed on them is + // that each value's size must be less than or equal to 32 KB. + // + // The total size of all keys and values must be less than 512 KB. + Metadata map[string]string `protobuf:"bytes,4,rep,name=metadata" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // The image type to use for this node. Note that for a given image type, + // the latest version of it will be used. + ImageType string `protobuf:"bytes,5,opt,name=image_type,json=imageType" json:"image_type,omitempty"` + // The map of Kubernetes labels (key/value pairs) to be applied to each node. + // These will added in addition to any default label(s) that + // Kubernetes may apply to the node. + // In case of conflict in label keys, the applied set may differ depending on + // the Kubernetes version -- it's best to assume the behavior is undefined + // and conflicts should be avoided. + // For more information, including usage and the valid values, see: + // https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + Labels map[string]string `protobuf:"bytes,6,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // The number of local SSD disks to be attached to the node. + // + // The limit for this value is dependant upon the maximum number of + // disks available on a machine per zone. See: + // https://cloud.google.com/compute/docs/disks/local-ssd#local_ssd_limits + // for more information. + LocalSsdCount int32 `protobuf:"varint,7,opt,name=local_ssd_count,json=localSsdCount" json:"local_ssd_count,omitempty"` + // The list of instance tags applied to all nodes. Tags are used to identify + // valid sources or targets for network firewalls and are specified by + // the client during cluster or node pool creation. Each tag within the list + // must comply with RFC1035. + Tags []string `protobuf:"bytes,8,rep,name=tags" json:"tags,omitempty"` + // Whether the nodes are created as preemptible VM instances. See: + // https://cloud.google.com/compute/docs/instances/preemptible for more + // inforamtion about preemptible VM instances. + Preemptible bool `protobuf:"varint,10,opt,name=preemptible" json:"preemptible,omitempty"` + // A list of hardware accelerators to be attached to each node. + // See https://cloud.google.com/compute/docs/gpus for more information about + // support for GPUs. + Accelerators []*AcceleratorConfig `protobuf:"bytes,11,rep,name=accelerators" json:"accelerators,omitempty"` + // Minimum CPU platform to be used by this instance. The instance may be + // scheduled on the specified or newer CPU platform. Applicable values are the + // friendly names of CPU platforms, such as + // minCpuPlatform: "Intel Haswell" or + // minCpuPlatform: "Intel Sandy Bridge". For more + // information, read [how to specify min CPU platform](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform) + MinCpuPlatform string `protobuf:"bytes,13,opt,name=min_cpu_platform,json=minCpuPlatform" json:"min_cpu_platform,omitempty"` + // List of kubernetes taints to be applied to each node. + // + // For more information, including usage and the valid values, see: + // https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ + Taints []*NodeTaint `protobuf:"bytes,15,rep,name=taints" json:"taints,omitempty"` +} + +func (m *NodeConfig) Reset() { *m = NodeConfig{} } +func (m *NodeConfig) String() string { return proto.CompactTextString(m) } +func (*NodeConfig) ProtoMessage() {} +func (*NodeConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *NodeConfig) GetMachineType() string { + if m != nil { + return m.MachineType + } + return "" +} + +func (m *NodeConfig) GetDiskSizeGb() int32 { + if m != nil { + return m.DiskSizeGb + } + return 0 +} + +func (m *NodeConfig) GetOauthScopes() []string { + if m != nil { + return m.OauthScopes + } + return nil +} + +func (m *NodeConfig) GetServiceAccount() string { + if m != nil { + return m.ServiceAccount + } + return "" +} + +func (m *NodeConfig) GetMetadata() map[string]string { + if m != nil { + return m.Metadata + } + return nil +} + +func (m *NodeConfig) GetImageType() string { + if m != nil { + return m.ImageType + } + return "" +} + +func (m *NodeConfig) GetLabels() map[string]string { + if m != nil { + return m.Labels + } + return nil +} + +func (m *NodeConfig) GetLocalSsdCount() int32 { + if m != nil { + return m.LocalSsdCount + } + return 0 +} + +func (m *NodeConfig) GetTags() []string { + if m != nil { + return m.Tags + } + return nil +} + +func (m *NodeConfig) GetPreemptible() bool { + if m != nil { + return m.Preemptible + } + return false +} + +func (m *NodeConfig) GetAccelerators() []*AcceleratorConfig { + if m != nil { + return m.Accelerators + } + return nil +} + +func (m *NodeConfig) GetMinCpuPlatform() string { + if m != nil { + return m.MinCpuPlatform + } + return "" +} + +func (m *NodeConfig) GetTaints() []*NodeTaint { + if m != nil { + return m.Taints + } + return nil +} + +// Kubernetes taint is comprised of three fields: key, value, and effect. Effect +// can only be one of three types: NoSchedule, PreferNoSchedule or NoExecute. +// +// For more information, including usage and the valid values, see: +// https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ +type NodeTaint struct { + // Key for taint. + Key string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` + // Value for taint. + Value string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` + // Effect for taint. + Effect NodeTaint_Effect `protobuf:"varint,3,opt,name=effect,enum=google.container.v1beta1.NodeTaint_Effect" json:"effect,omitempty"` +} + +func (m *NodeTaint) Reset() { *m = NodeTaint{} } +func (m *NodeTaint) String() string { return proto.CompactTextString(m) } +func (*NodeTaint) ProtoMessage() {} +func (*NodeTaint) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *NodeTaint) GetKey() string { + if m != nil { + return m.Key + } + return "" +} + +func (m *NodeTaint) GetValue() string { + if m != nil { + return m.Value + } + return "" +} + +func (m *NodeTaint) GetEffect() NodeTaint_Effect { + if m != nil { + return m.Effect + } + return NodeTaint_EFFECT_UNSPECIFIED +} + +// The authentication information for accessing the master endpoint. +// Authentication can be done using HTTP basic auth or using client +// certificates. +type MasterAuth struct { + // The username to use for HTTP basic authentication to the master endpoint. + // For clusters v1.6.0 and later, you can disable basic authentication by + // providing an empty username. + Username string `protobuf:"bytes,1,opt,name=username" json:"username,omitempty"` + // The password to use for HTTP basic authentication to the master endpoint. + // Because the master endpoint is open to the Internet, you should create a + // strong password. If a password is provided for cluster creation, username + // must be non-empty. + Password string `protobuf:"bytes,2,opt,name=password" json:"password,omitempty"` + // Configuration for client certificate authentication on the cluster. If no + // configuration is specified, a client certificate is issued. + ClientCertificateConfig *ClientCertificateConfig `protobuf:"bytes,3,opt,name=client_certificate_config,json=clientCertificateConfig" json:"client_certificate_config,omitempty"` + // [Output only] Base64-encoded public certificate that is the root of + // trust for the cluster. + ClusterCaCertificate string `protobuf:"bytes,100,opt,name=cluster_ca_certificate,json=clusterCaCertificate" json:"cluster_ca_certificate,omitempty"` + // [Output only] Base64-encoded public certificate used by clients to + // authenticate to the cluster endpoint. + ClientCertificate string `protobuf:"bytes,101,opt,name=client_certificate,json=clientCertificate" json:"client_certificate,omitempty"` + // [Output only] Base64-encoded private key used by clients to authenticate + // to the cluster endpoint. + ClientKey string `protobuf:"bytes,102,opt,name=client_key,json=clientKey" json:"client_key,omitempty"` +} + +func (m *MasterAuth) Reset() { *m = MasterAuth{} } +func (m *MasterAuth) String() string { return proto.CompactTextString(m) } +func (*MasterAuth) ProtoMessage() {} +func (*MasterAuth) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *MasterAuth) GetUsername() string { + if m != nil { + return m.Username + } + return "" +} + +func (m *MasterAuth) GetPassword() string { + if m != nil { + return m.Password + } + return "" +} + +func (m *MasterAuth) GetClientCertificateConfig() *ClientCertificateConfig { + if m != nil { + return m.ClientCertificateConfig + } + return nil +} + +func (m *MasterAuth) GetClusterCaCertificate() string { + if m != nil { + return m.ClusterCaCertificate + } + return "" +} + +func (m *MasterAuth) GetClientCertificate() string { + if m != nil { + return m.ClientCertificate + } + return "" +} + +func (m *MasterAuth) GetClientKey() string { + if m != nil { + return m.ClientKey + } + return "" +} + +// Configuration for client certificates on the cluster. +type ClientCertificateConfig struct { + // Issue a client certificate. + IssueClientCertificate bool `protobuf:"varint,1,opt,name=issue_client_certificate,json=issueClientCertificate" json:"issue_client_certificate,omitempty"` +} + +func (m *ClientCertificateConfig) Reset() { *m = ClientCertificateConfig{} } +func (m *ClientCertificateConfig) String() string { return proto.CompactTextString(m) } +func (*ClientCertificateConfig) ProtoMessage() {} +func (*ClientCertificateConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *ClientCertificateConfig) GetIssueClientCertificate() bool { + if m != nil { + return m.IssueClientCertificate + } + return false +} + +// Configuration for the addons that can be automatically spun up in the +// cluster, enabling additional functionality. +type AddonsConfig struct { + // Configuration for the HTTP (L7) load balancing controller addon, which + // makes it easy to set up HTTP load balancers for services in a cluster. + HttpLoadBalancing *HttpLoadBalancing `protobuf:"bytes,1,opt,name=http_load_balancing,json=httpLoadBalancing" json:"http_load_balancing,omitempty"` + // Configuration for the horizontal pod autoscaling feature, which + // increases or decreases the number of replica pods a replication controller + // has based on the resource usage of the existing pods. + HorizontalPodAutoscaling *HorizontalPodAutoscaling `protobuf:"bytes,2,opt,name=horizontal_pod_autoscaling,json=horizontalPodAutoscaling" json:"horizontal_pod_autoscaling,omitempty"` + // Configuration for the Kubernetes Dashboard. + KubernetesDashboard *KubernetesDashboard `protobuf:"bytes,3,opt,name=kubernetes_dashboard,json=kubernetesDashboard" json:"kubernetes_dashboard,omitempty"` + // Configuration for NetworkPolicy. This only tracks whether the addon + // is enabled or not on the Master, it does not track whether network policy + // is enabled for the nodes. + NetworkPolicyConfig *NetworkPolicyConfig `protobuf:"bytes,4,opt,name=network_policy_config,json=networkPolicyConfig" json:"network_policy_config,omitempty"` +} + +func (m *AddonsConfig) Reset() { *m = AddonsConfig{} } +func (m *AddonsConfig) String() string { return proto.CompactTextString(m) } +func (*AddonsConfig) ProtoMessage() {} +func (*AddonsConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *AddonsConfig) GetHttpLoadBalancing() *HttpLoadBalancing { + if m != nil { + return m.HttpLoadBalancing + } + return nil +} + +func (m *AddonsConfig) GetHorizontalPodAutoscaling() *HorizontalPodAutoscaling { + if m != nil { + return m.HorizontalPodAutoscaling + } + return nil +} + +func (m *AddonsConfig) GetKubernetesDashboard() *KubernetesDashboard { + if m != nil { + return m.KubernetesDashboard + } + return nil +} + +func (m *AddonsConfig) GetNetworkPolicyConfig() *NetworkPolicyConfig { + if m != nil { + return m.NetworkPolicyConfig + } + return nil +} + +// Configuration options for the HTTP (L7) load balancing controller addon, +// which makes it easy to set up HTTP load balancers for services in a cluster. +type HttpLoadBalancing struct { + // Whether the HTTP Load Balancing controller is enabled in the cluster. + // When enabled, it runs a small pod in the cluster that manages the load + // balancers. + Disabled bool `protobuf:"varint,1,opt,name=disabled" json:"disabled,omitempty"` +} + +func (m *HttpLoadBalancing) Reset() { *m = HttpLoadBalancing{} } +func (m *HttpLoadBalancing) String() string { return proto.CompactTextString(m) } +func (*HttpLoadBalancing) ProtoMessage() {} +func (*HttpLoadBalancing) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *HttpLoadBalancing) GetDisabled() bool { + if m != nil { + return m.Disabled + } + return false +} + +// Configuration options for the horizontal pod autoscaling feature, which +// increases or decreases the number of replica pods a replication controller +// has based on the resource usage of the existing pods. +type HorizontalPodAutoscaling struct { + // Whether the Horizontal Pod Autoscaling feature is enabled in the cluster. + // When enabled, it ensures that a Heapster pod is running in the cluster, + // which is also used by the Cloud Monitoring service. + Disabled bool `protobuf:"varint,1,opt,name=disabled" json:"disabled,omitempty"` +} + +func (m *HorizontalPodAutoscaling) Reset() { *m = HorizontalPodAutoscaling{} } +func (m *HorizontalPodAutoscaling) String() string { return proto.CompactTextString(m) } +func (*HorizontalPodAutoscaling) ProtoMessage() {} +func (*HorizontalPodAutoscaling) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *HorizontalPodAutoscaling) GetDisabled() bool { + if m != nil { + return m.Disabled + } + return false +} + +// Configuration for the Kubernetes Dashboard. +type KubernetesDashboard struct { + // Whether the Kubernetes Dashboard is enabled for this cluster. + Disabled bool `protobuf:"varint,1,opt,name=disabled" json:"disabled,omitempty"` +} + +func (m *KubernetesDashboard) Reset() { *m = KubernetesDashboard{} } +func (m *KubernetesDashboard) String() string { return proto.CompactTextString(m) } +func (*KubernetesDashboard) ProtoMessage() {} +func (*KubernetesDashboard) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *KubernetesDashboard) GetDisabled() bool { + if m != nil { + return m.Disabled + } + return false +} + +// Configuration for NetworkPolicy. This only tracks whether the addon +// is enabled or not on the Master, it does not track whether network policy +// is enabled for the nodes. +type NetworkPolicyConfig struct { + // Whether NetworkPolicy is enabled for this cluster. + Disabled bool `protobuf:"varint,1,opt,name=disabled" json:"disabled,omitempty"` +} + +func (m *NetworkPolicyConfig) Reset() { *m = NetworkPolicyConfig{} } +func (m *NetworkPolicyConfig) String() string { return proto.CompactTextString(m) } +func (*NetworkPolicyConfig) ProtoMessage() {} +func (*NetworkPolicyConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *NetworkPolicyConfig) GetDisabled() bool { + if m != nil { + return m.Disabled + } + return false +} + +// Configuration options for the master authorized networks feature. Enabled +// master authorized networks will disallow all external traffic to access +// Kubernetes master through HTTPS except traffic from the given CIDR blocks, +// Google Compute Engine Public IPs and Google Prod IPs. +type MasterAuthorizedNetworksConfig struct { + // Whether or not master authorized networks is enabled. + Enabled bool `protobuf:"varint,1,opt,name=enabled" json:"enabled,omitempty"` + // cidr_blocks define up to 10 external networks that could access + // Kubernetes master through HTTPS. + CidrBlocks []*MasterAuthorizedNetworksConfig_CidrBlock `protobuf:"bytes,2,rep,name=cidr_blocks,json=cidrBlocks" json:"cidr_blocks,omitempty"` +} + +func (m *MasterAuthorizedNetworksConfig) Reset() { *m = MasterAuthorizedNetworksConfig{} } +func (m *MasterAuthorizedNetworksConfig) String() string { return proto.CompactTextString(m) } +func (*MasterAuthorizedNetworksConfig) ProtoMessage() {} +func (*MasterAuthorizedNetworksConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *MasterAuthorizedNetworksConfig) GetEnabled() bool { + if m != nil { + return m.Enabled + } + return false +} + +func (m *MasterAuthorizedNetworksConfig) GetCidrBlocks() []*MasterAuthorizedNetworksConfig_CidrBlock { + if m != nil { + return m.CidrBlocks + } + return nil +} + +// CidrBlock contains an optional name and one CIDR block. +type MasterAuthorizedNetworksConfig_CidrBlock struct { + // display_name is an optional field for users to identify CIDR blocks. + DisplayName string `protobuf:"bytes,1,opt,name=display_name,json=displayName" json:"display_name,omitempty"` + // cidr_block must be specified in CIDR notation. + CidrBlock string `protobuf:"bytes,2,opt,name=cidr_block,json=cidrBlock" json:"cidr_block,omitempty"` +} + +func (m *MasterAuthorizedNetworksConfig_CidrBlock) Reset() { + *m = MasterAuthorizedNetworksConfig_CidrBlock{} +} +func (m *MasterAuthorizedNetworksConfig_CidrBlock) String() string { return proto.CompactTextString(m) } +func (*MasterAuthorizedNetworksConfig_CidrBlock) ProtoMessage() {} +func (*MasterAuthorizedNetworksConfig_CidrBlock) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{9, 0} +} + +func (m *MasterAuthorizedNetworksConfig_CidrBlock) GetDisplayName() string { + if m != nil { + return m.DisplayName + } + return "" +} + +func (m *MasterAuthorizedNetworksConfig_CidrBlock) GetCidrBlock() string { + if m != nil { + return m.CidrBlock + } + return "" +} + +// Configuration options for the NetworkPolicy feature. +// https://kubernetes.io/docs/concepts/services-networking/networkpolicies/ +type NetworkPolicy struct { + // The selected network policy provider. + Provider NetworkPolicy_Provider `protobuf:"varint,1,opt,name=provider,enum=google.container.v1beta1.NetworkPolicy_Provider" json:"provider,omitempty"` + // Whether network policy is enabled on the cluster. + Enabled bool `protobuf:"varint,2,opt,name=enabled" json:"enabled,omitempty"` +} + +func (m *NetworkPolicy) Reset() { *m = NetworkPolicy{} } +func (m *NetworkPolicy) String() string { return proto.CompactTextString(m) } +func (*NetworkPolicy) ProtoMessage() {} +func (*NetworkPolicy) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *NetworkPolicy) GetProvider() NetworkPolicy_Provider { + if m != nil { + return m.Provider + } + return NetworkPolicy_PROVIDER_UNSPECIFIED +} + +func (m *NetworkPolicy) GetEnabled() bool { + if m != nil { + return m.Enabled + } + return false +} + +// Configuration for controlling how IPs are allocated in the cluster. +type IPAllocationPolicy struct { + // Whether alias IPs will be used for pod IPs in the cluster. + UseIpAliases bool `protobuf:"varint,1,opt,name=use_ip_aliases,json=useIpAliases" json:"use_ip_aliases,omitempty"` + // Whether a new subnetwork will be created automatically for the cluster. + // + // This field is only applicable when `use_ip_aliases` is true. + CreateSubnetwork bool `protobuf:"varint,2,opt,name=create_subnetwork,json=createSubnetwork" json:"create_subnetwork,omitempty"` + // A custom subnetwork name to be used if `create_subnetwork` is true. If + // this field is empty, then an automatic name will be chosen for the new + // subnetwork. + SubnetworkName string `protobuf:"bytes,3,opt,name=subnetwork_name,json=subnetworkName" json:"subnetwork_name,omitempty"` + // This field is deprecated, use cluster_ipv4_cidr_block. + ClusterIpv4Cidr string `protobuf:"bytes,4,opt,name=cluster_ipv4_cidr,json=clusterIpv4Cidr" json:"cluster_ipv4_cidr,omitempty"` + // This field is deprecated, use node_ipv4_cidr_block. + NodeIpv4Cidr string `protobuf:"bytes,5,opt,name=node_ipv4_cidr,json=nodeIpv4Cidr" json:"node_ipv4_cidr,omitempty"` + // This field is deprecated, use services_ipv4_cidr_block. + ServicesIpv4Cidr string `protobuf:"bytes,6,opt,name=services_ipv4_cidr,json=servicesIpv4Cidr" json:"services_ipv4_cidr,omitempty"` + // The name of the secondary range to be used for the cluster CIDR + // block. The secondary range will be used for pod IP + // addresses. This must be an existing secondary range associated + // with the cluster subnetwork. + // + // This field is only applicable with use_ip_aliases and + // create_subnetwork is false. + ClusterSecondaryRangeName string `protobuf:"bytes,7,opt,name=cluster_secondary_range_name,json=clusterSecondaryRangeName" json:"cluster_secondary_range_name,omitempty"` + // The name of the secondary range to be used as for the services + // CIDR block. The secondary range will be used for service + // ClusterIPs. This must be an existing secondary range associated + // with the cluster subnetwork. + // + // This field is only applicable with use_ip_aliases and + // create_subnetwork is false. + ServicesSecondaryRangeName string `protobuf:"bytes,8,opt,name=services_secondary_range_name,json=servicesSecondaryRangeName" json:"services_secondary_range_name,omitempty"` + // The IP address range for the cluster pod IPs. If this field is set, then + // `cluster.cluster_ipv4_cidr` must be left blank. + // + // This field is only applicable when `use_ip_aliases` is true. + // + // Set to blank to have a range chosen with the default size. + // + // Set to /netmask (e.g. `/14`) to have a range chosen with a specific + // netmask. + // + // Set to a + // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. + // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range + // to use. + ClusterIpv4CidrBlock string `protobuf:"bytes,9,opt,name=cluster_ipv4_cidr_block,json=clusterIpv4CidrBlock" json:"cluster_ipv4_cidr_block,omitempty"` + // The IP address range of the instance IPs in this cluster. + // + // This is applicable only if `create_subnetwork` is true. + // + // Set to blank to have a range chosen with the default size. + // + // Set to /netmask (e.g. `/14`) to have a range chosen with a specific + // netmask. + // + // Set to a + // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. + // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range + // to use. + NodeIpv4CidrBlock string `protobuf:"bytes,10,opt,name=node_ipv4_cidr_block,json=nodeIpv4CidrBlock" json:"node_ipv4_cidr_block,omitempty"` + // The IP address range of the services IPs in this cluster. If blank, a range + // will be automatically chosen with the default size. + // + // This field is only applicable when `use_ip_aliases` is true. + // + // Set to blank to have a range chosen with the default size. + // + // Set to /netmask (e.g. `/14`) to have a range chosen with a specific + // netmask. + // + // Set to a + // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. + // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range + // to use. + ServicesIpv4CidrBlock string `protobuf:"bytes,11,opt,name=services_ipv4_cidr_block,json=servicesIpv4CidrBlock" json:"services_ipv4_cidr_block,omitempty"` +} + +func (m *IPAllocationPolicy) Reset() { *m = IPAllocationPolicy{} } +func (m *IPAllocationPolicy) String() string { return proto.CompactTextString(m) } +func (*IPAllocationPolicy) ProtoMessage() {} +func (*IPAllocationPolicy) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } + +func (m *IPAllocationPolicy) GetUseIpAliases() bool { + if m != nil { + return m.UseIpAliases + } + return false +} + +func (m *IPAllocationPolicy) GetCreateSubnetwork() bool { + if m != nil { + return m.CreateSubnetwork + } + return false +} + +func (m *IPAllocationPolicy) GetSubnetworkName() string { + if m != nil { + return m.SubnetworkName + } + return "" +} + +func (m *IPAllocationPolicy) GetClusterIpv4Cidr() string { + if m != nil { + return m.ClusterIpv4Cidr + } + return "" +} + +func (m *IPAllocationPolicy) GetNodeIpv4Cidr() string { + if m != nil { + return m.NodeIpv4Cidr + } + return "" +} + +func (m *IPAllocationPolicy) GetServicesIpv4Cidr() string { + if m != nil { + return m.ServicesIpv4Cidr + } + return "" +} + +func (m *IPAllocationPolicy) GetClusterSecondaryRangeName() string { + if m != nil { + return m.ClusterSecondaryRangeName + } + return "" +} + +func (m *IPAllocationPolicy) GetServicesSecondaryRangeName() string { + if m != nil { + return m.ServicesSecondaryRangeName + } + return "" +} + +func (m *IPAllocationPolicy) GetClusterIpv4CidrBlock() string { + if m != nil { + return m.ClusterIpv4CidrBlock + } + return "" +} + +func (m *IPAllocationPolicy) GetNodeIpv4CidrBlock() string { + if m != nil { + return m.NodeIpv4CidrBlock + } + return "" +} + +func (m *IPAllocationPolicy) GetServicesIpv4CidrBlock() string { + if m != nil { + return m.ServicesIpv4CidrBlock + } + return "" +} + +// Configuration for the PodSecurityPolicy feature. +type PodSecurityPolicyConfig struct { + // Enable the PodSecurityPolicy controller for this cluster. If enabled, pods + // must be valid under a PodSecurityPolicy to be created. + Enabled bool `protobuf:"varint,1,opt,name=enabled" json:"enabled,omitempty"` +} + +func (m *PodSecurityPolicyConfig) Reset() { *m = PodSecurityPolicyConfig{} } +func (m *PodSecurityPolicyConfig) String() string { return proto.CompactTextString(m) } +func (*PodSecurityPolicyConfig) ProtoMessage() {} +func (*PodSecurityPolicyConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } + +func (m *PodSecurityPolicyConfig) GetEnabled() bool { + if m != nil { + return m.Enabled + } + return false +} + +// A Google Container Engine cluster. +type Cluster struct { + // The name of this cluster. The name must be unique within this project + // and zone, and can be up to 40 characters with the following restrictions: + // + // * Lowercase letters, numbers, and hyphens only. + // * Must start with a letter. + // * Must end with a number or a letter. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // An optional description of this cluster. + Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` + // The number of nodes to create in this cluster. You must ensure that your + // Compute Engine resource quota + // is sufficient for this number of instances. You must also have available + // firewall and routes quota. + // For requests, this field should only be used in lieu of a + // "node_pool" object, since this configuration (along with the + // "node_config") will be used to create a "NodePool" object with an + // auto-generated name. Do not use this and a node_pool at the same time. + InitialNodeCount int32 `protobuf:"varint,3,opt,name=initial_node_count,json=initialNodeCount" json:"initial_node_count,omitempty"` + // Parameters used in creating the cluster's nodes. + // See `nodeConfig` for the description of its properties. + // For requests, this field should only be used in lieu of a + // "node_pool" object, since this configuration (along with the + // "initial_node_count") will be used to create a "NodePool" object with an + // auto-generated name. Do not use this and a node_pool at the same time. + // For responses, this field will be populated with the node configuration of + // the first node pool. + // + // If unspecified, the defaults are used. + NodeConfig *NodeConfig `protobuf:"bytes,4,opt,name=node_config,json=nodeConfig" json:"node_config,omitempty"` + // The authentication information for accessing the master endpoint. + MasterAuth *MasterAuth `protobuf:"bytes,5,opt,name=master_auth,json=masterAuth" json:"master_auth,omitempty"` + // The logging service the cluster should use to write logs. + // Currently available options: + // + // * `logging.googleapis.com` - the Google Cloud Logging service. + // * `none` - no logs will be exported from the cluster. + // * if left as an empty string,`logging.googleapis.com` will be used. + LoggingService string `protobuf:"bytes,6,opt,name=logging_service,json=loggingService" json:"logging_service,omitempty"` + // The monitoring service the cluster should use to write metrics. + // Currently available options: + // + // * `monitoring.googleapis.com` - the Google Cloud Monitoring service. + // * `none` - no metrics will be exported from the cluster. + // * if left as an empty string, `monitoring.googleapis.com` will be used. + MonitoringService string `protobuf:"bytes,7,opt,name=monitoring_service,json=monitoringService" json:"monitoring_service,omitempty"` + // The name of the Google Compute Engine + // [network](/compute/docs/networks-and-firewalls#networks) to which the + // cluster is connected. If left unspecified, the `default` network + // will be used. + Network string `protobuf:"bytes,8,opt,name=network" json:"network,omitempty"` + // The IP address range of the container pods in this cluster, in + // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // notation (e.g. `10.96.0.0/14`). Leave blank to have + // one automatically chosen or specify a `/14` block in `10.0.0.0/8`. + ClusterIpv4Cidr string `protobuf:"bytes,9,opt,name=cluster_ipv4_cidr,json=clusterIpv4Cidr" json:"cluster_ipv4_cidr,omitempty"` + // Configurations for the various addons available to run in the cluster. + AddonsConfig *AddonsConfig `protobuf:"bytes,10,opt,name=addons_config,json=addonsConfig" json:"addons_config,omitempty"` + // The name of the Google Compute Engine + // [subnetwork](/compute/docs/subnetworks) to which the + // cluster is connected. + Subnetwork string `protobuf:"bytes,11,opt,name=subnetwork" json:"subnetwork,omitempty"` + // The node pools associated with this cluster. + // This field should not be set if "node_config" or "initial_node_count" are + // specified. + NodePools []*NodePool `protobuf:"bytes,12,rep,name=node_pools,json=nodePools" json:"node_pools,omitempty"` + // The list of Google Compute Engine + // [locations](/compute/docs/zones#available) in which the cluster's nodes + // should be located. + Locations []string `protobuf:"bytes,13,rep,name=locations" json:"locations,omitempty"` + // Kubernetes alpha features are enabled on this cluster. This includes alpha + // API groups (e.g. v1beta1) and features that may not be production ready in + // the kubernetes version of the master and nodes. + // The cluster has no SLA for uptime and master/node upgrades are disabled. + // Alpha enabled clusters are automatically deleted thirty days after + // creation. + EnableKubernetesAlpha bool `protobuf:"varint,14,opt,name=enable_kubernetes_alpha,json=enableKubernetesAlpha" json:"enable_kubernetes_alpha,omitempty"` + // Configuration options for the NetworkPolicy feature. + NetworkPolicy *NetworkPolicy `protobuf:"bytes,19,opt,name=network_policy,json=networkPolicy" json:"network_policy,omitempty"` + // Configuration for cluster IP allocation. + IpAllocationPolicy *IPAllocationPolicy `protobuf:"bytes,20,opt,name=ip_allocation_policy,json=ipAllocationPolicy" json:"ip_allocation_policy,omitempty"` + // The configuration options for master authorized networks feature. + MasterAuthorizedNetworksConfig *MasterAuthorizedNetworksConfig `protobuf:"bytes,22,opt,name=master_authorized_networks_config,json=masterAuthorizedNetworksConfig" json:"master_authorized_networks_config,omitempty"` + // Configure the maintenance policy for this cluster. + MaintenancePolicy *MaintenancePolicy `protobuf:"bytes,23,opt,name=maintenance_policy,json=maintenancePolicy" json:"maintenance_policy,omitempty"` + // Configuration for the PodSecurityPolicy feature. + PodSecurityPolicyConfig *PodSecurityPolicyConfig `protobuf:"bytes,25,opt,name=pod_security_policy_config,json=podSecurityPolicyConfig" json:"pod_security_policy_config,omitempty"` + // [Output only] Server-defined URL for the resource. + SelfLink string `protobuf:"bytes,100,opt,name=self_link,json=selfLink" json:"self_link,omitempty"` + // [Output only] The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use location instead. + Zone string `protobuf:"bytes,101,opt,name=zone" json:"zone,omitempty"` + // [Output only] The IP address of this cluster's master endpoint. + // The endpoint can be accessed from the internet at + // `https://username:password@endpoint/`. + // + // See the `masterAuth` property of this resource for username and + // password information. + Endpoint string `protobuf:"bytes,102,opt,name=endpoint" json:"endpoint,omitempty"` + // The initial Kubernetes version for this cluster. Valid versions are those + // found in validMasterVersions returned by getServerConfig. The version can + // be upgraded over time; such upgrades are reflected in + // currentMasterVersion and currentNodeVersion. + InitialClusterVersion string `protobuf:"bytes,103,opt,name=initial_cluster_version,json=initialClusterVersion" json:"initial_cluster_version,omitempty"` + // [Output only] The current software version of the master endpoint. + CurrentMasterVersion string `protobuf:"bytes,104,opt,name=current_master_version,json=currentMasterVersion" json:"current_master_version,omitempty"` + // [Output only] The current version of the node software components. + // If they are currently at multiple versions because they're in the process + // of being upgraded, this reflects the minimum version of all nodes. + CurrentNodeVersion string `protobuf:"bytes,105,opt,name=current_node_version,json=currentNodeVersion" json:"current_node_version,omitempty"` + // [Output only] The time the cluster was created, in + // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + CreateTime string `protobuf:"bytes,106,opt,name=create_time,json=createTime" json:"create_time,omitempty"` + // [Output only] The current status of this cluster. + Status Cluster_Status `protobuf:"varint,107,opt,name=status,enum=google.container.v1beta1.Cluster_Status" json:"status,omitempty"` + // [Output only] Additional information about the current status of this + // cluster, if available. + StatusMessage string `protobuf:"bytes,108,opt,name=status_message,json=statusMessage" json:"status_message,omitempty"` + // [Output only] The size of the address space on each node for hosting + // containers. This is provisioned from within the `container_ipv4_cidr` + // range. + NodeIpv4CidrSize int32 `protobuf:"varint,109,opt,name=node_ipv4_cidr_size,json=nodeIpv4CidrSize" json:"node_ipv4_cidr_size,omitempty"` + // [Output only] The IP address range of the Kubernetes services in + // this cluster, in + // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // notation (e.g. `1.2.3.4/29`). Service addresses are + // typically put in the last `/16` from the container CIDR. + ServicesIpv4Cidr string `protobuf:"bytes,110,opt,name=services_ipv4_cidr,json=servicesIpv4Cidr" json:"services_ipv4_cidr,omitempty"` + // [Output only] The resource URLs of [instance + // groups](/compute/docs/instance-groups/) associated with this + // cluster. + InstanceGroupUrls []string `protobuf:"bytes,111,rep,name=instance_group_urls,json=instanceGroupUrls" json:"instance_group_urls,omitempty"` + // [Output only] The number of nodes currently in the cluster. + CurrentNodeCount int32 `protobuf:"varint,112,opt,name=current_node_count,json=currentNodeCount" json:"current_node_count,omitempty"` + // [Output only] The time the cluster will be automatically + // deleted in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + ExpireTime string `protobuf:"bytes,113,opt,name=expire_time,json=expireTime" json:"expire_time,omitempty"` + // [Output only] The name of the Google Compute Engine + // [zone](/compute/docs/regions-zones/regions-zones#available) or + // [region](/compute/docs/regions-zones/regions-zones#available) in which + // the cluster resides. + Location string `protobuf:"bytes,114,opt,name=location" json:"location,omitempty"` +} + +func (m *Cluster) Reset() { *m = Cluster{} } +func (m *Cluster) String() string { return proto.CompactTextString(m) } +func (*Cluster) ProtoMessage() {} +func (*Cluster) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } + +func (m *Cluster) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Cluster) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *Cluster) GetInitialNodeCount() int32 { + if m != nil { + return m.InitialNodeCount + } + return 0 +} + +func (m *Cluster) GetNodeConfig() *NodeConfig { + if m != nil { + return m.NodeConfig + } + return nil +} + +func (m *Cluster) GetMasterAuth() *MasterAuth { + if m != nil { + return m.MasterAuth + } + return nil +} + +func (m *Cluster) GetLoggingService() string { + if m != nil { + return m.LoggingService + } + return "" +} + +func (m *Cluster) GetMonitoringService() string { + if m != nil { + return m.MonitoringService + } + return "" +} + +func (m *Cluster) GetNetwork() string { + if m != nil { + return m.Network + } + return "" +} + +func (m *Cluster) GetClusterIpv4Cidr() string { + if m != nil { + return m.ClusterIpv4Cidr + } + return "" +} + +func (m *Cluster) GetAddonsConfig() *AddonsConfig { + if m != nil { + return m.AddonsConfig + } + return nil +} + +func (m *Cluster) GetSubnetwork() string { + if m != nil { + return m.Subnetwork + } + return "" +} + +func (m *Cluster) GetNodePools() []*NodePool { + if m != nil { + return m.NodePools + } + return nil +} + +func (m *Cluster) GetLocations() []string { + if m != nil { + return m.Locations + } + return nil +} + +func (m *Cluster) GetEnableKubernetesAlpha() bool { + if m != nil { + return m.EnableKubernetesAlpha + } + return false +} + +func (m *Cluster) GetNetworkPolicy() *NetworkPolicy { + if m != nil { + return m.NetworkPolicy + } + return nil +} + +func (m *Cluster) GetIpAllocationPolicy() *IPAllocationPolicy { + if m != nil { + return m.IpAllocationPolicy + } + return nil +} + +func (m *Cluster) GetMasterAuthorizedNetworksConfig() *MasterAuthorizedNetworksConfig { + if m != nil { + return m.MasterAuthorizedNetworksConfig + } + return nil +} + +func (m *Cluster) GetMaintenancePolicy() *MaintenancePolicy { + if m != nil { + return m.MaintenancePolicy + } + return nil +} + +func (m *Cluster) GetPodSecurityPolicyConfig() *PodSecurityPolicyConfig { + if m != nil { + return m.PodSecurityPolicyConfig + } + return nil +} + +func (m *Cluster) GetSelfLink() string { + if m != nil { + return m.SelfLink + } + return "" +} + +func (m *Cluster) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *Cluster) GetEndpoint() string { + if m != nil { + return m.Endpoint + } + return "" +} + +func (m *Cluster) GetInitialClusterVersion() string { + if m != nil { + return m.InitialClusterVersion + } + return "" +} + +func (m *Cluster) GetCurrentMasterVersion() string { + if m != nil { + return m.CurrentMasterVersion + } + return "" +} + +func (m *Cluster) GetCurrentNodeVersion() string { + if m != nil { + return m.CurrentNodeVersion + } + return "" +} + +func (m *Cluster) GetCreateTime() string { + if m != nil { + return m.CreateTime + } + return "" +} + +func (m *Cluster) GetStatus() Cluster_Status { + if m != nil { + return m.Status + } + return Cluster_STATUS_UNSPECIFIED +} + +func (m *Cluster) GetStatusMessage() string { + if m != nil { + return m.StatusMessage + } + return "" +} + +func (m *Cluster) GetNodeIpv4CidrSize() int32 { + if m != nil { + return m.NodeIpv4CidrSize + } + return 0 +} + +func (m *Cluster) GetServicesIpv4Cidr() string { + if m != nil { + return m.ServicesIpv4Cidr + } + return "" +} + +func (m *Cluster) GetInstanceGroupUrls() []string { + if m != nil { + return m.InstanceGroupUrls + } + return nil +} + +func (m *Cluster) GetCurrentNodeCount() int32 { + if m != nil { + return m.CurrentNodeCount + } + return 0 +} + +func (m *Cluster) GetExpireTime() string { + if m != nil { + return m.ExpireTime + } + return "" +} + +func (m *Cluster) GetLocation() string { + if m != nil { + return m.Location + } + return "" +} + +// ClusterUpdate describes an update to the cluster. Exactly one update can +// be applied to a cluster with each request, so at most one field can be +// provided. +type ClusterUpdate struct { + // The Kubernetes version to change the nodes to (typically an + // upgrade). Use `-` to upgrade to the latest version supported by + // the server. + DesiredNodeVersion string `protobuf:"bytes,4,opt,name=desired_node_version,json=desiredNodeVersion" json:"desired_node_version,omitempty"` + // The monitoring service the cluster should use to write metrics. + // Currently available options: + // + // * "monitoring.googleapis.com" - the Google Cloud Monitoring service + // * "none" - no metrics will be exported from the cluster + DesiredMonitoringService string `protobuf:"bytes,5,opt,name=desired_monitoring_service,json=desiredMonitoringService" json:"desired_monitoring_service,omitempty"` + // Configurations for the various addons available to run in the cluster. + DesiredAddonsConfig *AddonsConfig `protobuf:"bytes,6,opt,name=desired_addons_config,json=desiredAddonsConfig" json:"desired_addons_config,omitempty"` + // The node pool to be upgraded. This field is mandatory if + // "desired_node_version", "desired_image_family" or + // "desired_node_pool_autoscaling" is specified and there is more than one + // node pool on the cluster. + DesiredNodePoolId string `protobuf:"bytes,7,opt,name=desired_node_pool_id,json=desiredNodePoolId" json:"desired_node_pool_id,omitempty"` + // The desired image type for the node pool. + // NOTE: Set the "desired_node_pool" field as well. + DesiredImageType string `protobuf:"bytes,8,opt,name=desired_image_type,json=desiredImageType" json:"desired_image_type,omitempty"` + // Autoscaler configuration for the node pool specified in + // desired_node_pool_id. If there is only one pool in the + // cluster and desired_node_pool_id is not provided then + // the change applies to that single node pool. + DesiredNodePoolAutoscaling *NodePoolAutoscaling `protobuf:"bytes,9,opt,name=desired_node_pool_autoscaling,json=desiredNodePoolAutoscaling" json:"desired_node_pool_autoscaling,omitempty"` + // The desired list of Google Compute Engine + // [locations](/compute/docs/zones#available) in which the cluster's nodes + // should be located. Changing the locations a cluster is in will result + // in nodes being either created or removed from the cluster, depending on + // whether locations are being added or removed. + // + // This list must always include the cluster's primary zone. + DesiredLocations []string `protobuf:"bytes,10,rep,name=desired_locations,json=desiredLocations" json:"desired_locations,omitempty"` + // The desired configuration options for master authorized networks feature. + DesiredMasterAuthorizedNetworksConfig *MasterAuthorizedNetworksConfig `protobuf:"bytes,12,opt,name=desired_master_authorized_networks_config,json=desiredMasterAuthorizedNetworksConfig" json:"desired_master_authorized_networks_config,omitempty"` + // The desired configuration options for the PodSecurityPolicy feature. + DesiredPodSecurityPolicyConfig *PodSecurityPolicyConfig `protobuf:"bytes,14,opt,name=desired_pod_security_policy_config,json=desiredPodSecurityPolicyConfig" json:"desired_pod_security_policy_config,omitempty"` + // The Kubernetes version to change the master to. The only valid value is the + // latest supported version. Use "-" to have the server automatically select + // the latest version. + DesiredMasterVersion string `protobuf:"bytes,100,opt,name=desired_master_version,json=desiredMasterVersion" json:"desired_master_version,omitempty"` +} + +func (m *ClusterUpdate) Reset() { *m = ClusterUpdate{} } +func (m *ClusterUpdate) String() string { return proto.CompactTextString(m) } +func (*ClusterUpdate) ProtoMessage() {} +func (*ClusterUpdate) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } + +func (m *ClusterUpdate) GetDesiredNodeVersion() string { + if m != nil { + return m.DesiredNodeVersion + } + return "" +} + +func (m *ClusterUpdate) GetDesiredMonitoringService() string { + if m != nil { + return m.DesiredMonitoringService + } + return "" +} + +func (m *ClusterUpdate) GetDesiredAddonsConfig() *AddonsConfig { + if m != nil { + return m.DesiredAddonsConfig + } + return nil +} + +func (m *ClusterUpdate) GetDesiredNodePoolId() string { + if m != nil { + return m.DesiredNodePoolId + } + return "" +} + +func (m *ClusterUpdate) GetDesiredImageType() string { + if m != nil { + return m.DesiredImageType + } + return "" +} + +func (m *ClusterUpdate) GetDesiredNodePoolAutoscaling() *NodePoolAutoscaling { + if m != nil { + return m.DesiredNodePoolAutoscaling + } + return nil +} + +func (m *ClusterUpdate) GetDesiredLocations() []string { + if m != nil { + return m.DesiredLocations + } + return nil +} + +func (m *ClusterUpdate) GetDesiredMasterAuthorizedNetworksConfig() *MasterAuthorizedNetworksConfig { + if m != nil { + return m.DesiredMasterAuthorizedNetworksConfig + } + return nil +} + +func (m *ClusterUpdate) GetDesiredPodSecurityPolicyConfig() *PodSecurityPolicyConfig { + if m != nil { + return m.DesiredPodSecurityPolicyConfig + } + return nil +} + +func (m *ClusterUpdate) GetDesiredMasterVersion() string { + if m != nil { + return m.DesiredMasterVersion + } + return "" +} + +// This operation resource represents operations that may have happened or are +// happening on the cluster. All fields are output only. +type Operation struct { + // The server-assigned ID for the operation. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the operation + // is taking place. + // This field is deprecated, use location instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The operation type. + OperationType Operation_Type `protobuf:"varint,3,opt,name=operation_type,json=operationType,enum=google.container.v1beta1.Operation_Type" json:"operation_type,omitempty"` + // The current status of the operation. + Status Operation_Status `protobuf:"varint,4,opt,name=status,enum=google.container.v1beta1.Operation_Status" json:"status,omitempty"` + // Detailed operation progress, if available. + Detail string `protobuf:"bytes,8,opt,name=detail" json:"detail,omitempty"` + // If an error has occurred, a textual description of the error. + StatusMessage string `protobuf:"bytes,5,opt,name=status_message,json=statusMessage" json:"status_message,omitempty"` + // Server-defined URL for the resource. + SelfLink string `protobuf:"bytes,6,opt,name=self_link,json=selfLink" json:"self_link,omitempty"` + // Server-defined URL for the target of the operation. + TargetLink string `protobuf:"bytes,7,opt,name=target_link,json=targetLink" json:"target_link,omitempty"` + // [Output only] The name of the Google Compute Engine + // [zone](/compute/docs/regions-zones/regions-zones#available) or + // [region](/compute/docs/regions-zones/regions-zones#available) in which + // the cluster resides. + Location string `protobuf:"bytes,9,opt,name=location" json:"location,omitempty"` + // [Output only] The time the operation started, in + // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + StartTime string `protobuf:"bytes,10,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + // [Output only] The time the operation completed, in + // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + EndTime string `protobuf:"bytes,11,opt,name=end_time,json=endTime" json:"end_time,omitempty"` +} + +func (m *Operation) Reset() { *m = Operation{} } +func (m *Operation) String() string { return proto.CompactTextString(m) } +func (*Operation) ProtoMessage() {} +func (*Operation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } + +func (m *Operation) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Operation) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *Operation) GetOperationType() Operation_Type { + if m != nil { + return m.OperationType + } + return Operation_TYPE_UNSPECIFIED +} + +func (m *Operation) GetStatus() Operation_Status { + if m != nil { + return m.Status + } + return Operation_STATUS_UNSPECIFIED +} + +func (m *Operation) GetDetail() string { + if m != nil { + return m.Detail + } + return "" +} + +func (m *Operation) GetStatusMessage() string { + if m != nil { + return m.StatusMessage + } + return "" +} + +func (m *Operation) GetSelfLink() string { + if m != nil { + return m.SelfLink + } + return "" +} + +func (m *Operation) GetTargetLink() string { + if m != nil { + return m.TargetLink + } + return "" +} + +func (m *Operation) GetLocation() string { + if m != nil { + return m.Location + } + return "" +} + +func (m *Operation) GetStartTime() string { + if m != nil { + return m.StartTime + } + return "" +} + +func (m *Operation) GetEndTime() string { + if m != nil { + return m.EndTime + } + return "" +} + +// CreateClusterRequest creates a cluster. +type CreateClusterRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + // This field is deprecated, use parent instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use parent instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // A [cluster + // resource](/container-engine/reference/rest/v1beta1/projects.zones.clusters) + Cluster *Cluster `protobuf:"bytes,3,opt,name=cluster" json:"cluster,omitempty"` + // The parent (project and location) where the cluster will be created. + // Specified in the format 'projects/*/locations/*'. + Parent string `protobuf:"bytes,5,opt,name=parent" json:"parent,omitempty"` +} + +func (m *CreateClusterRequest) Reset() { *m = CreateClusterRequest{} } +func (m *CreateClusterRequest) String() string { return proto.CompactTextString(m) } +func (*CreateClusterRequest) ProtoMessage() {} +func (*CreateClusterRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} } + +func (m *CreateClusterRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *CreateClusterRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *CreateClusterRequest) GetCluster() *Cluster { + if m != nil { + return m.Cluster + } + return nil +} + +func (m *CreateClusterRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +// GetClusterRequest gets the settings of a cluster. +type GetClusterRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + // This field is deprecated, use name instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use name instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster to retrieve. + // This field is deprecated, use name instead. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The name (project, location, cluster) of the cluster to retrieve. + // Specified in the format 'projects/*/locations/*/clusters/*'. + Name string `protobuf:"bytes,5,opt,name=name" json:"name,omitempty"` +} + +func (m *GetClusterRequest) Reset() { *m = GetClusterRequest{} } +func (m *GetClusterRequest) String() string { return proto.CompactTextString(m) } +func (*GetClusterRequest) ProtoMessage() {} +func (*GetClusterRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17} } + +func (m *GetClusterRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *GetClusterRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *GetClusterRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *GetClusterRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// UpdateClusterRequest updates the settings of a cluster. +type UpdateClusterRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + // This field is deprecated, use name instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use name instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster to upgrade. + // This field is deprecated, use name instead. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // A description of the update. + Update *ClusterUpdate `protobuf:"bytes,4,opt,name=update" json:"update,omitempty"` + // The name (project, location, cluster) of the cluster to update. + // Specified in the format 'projects/*/locations/*/clusters/*'. + Name string `protobuf:"bytes,5,opt,name=name" json:"name,omitempty"` +} + +func (m *UpdateClusterRequest) Reset() { *m = UpdateClusterRequest{} } +func (m *UpdateClusterRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateClusterRequest) ProtoMessage() {} +func (*UpdateClusterRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{18} } + +func (m *UpdateClusterRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *UpdateClusterRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *UpdateClusterRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *UpdateClusterRequest) GetUpdate() *ClusterUpdate { + if m != nil { + return m.Update + } + return nil +} + +func (m *UpdateClusterRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// SetMasterAuthRequest updates the admin password of a cluster. +type SetMasterAuthRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + // This field is deprecated, use name instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use name instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster to upgrade. + // This field is deprecated, use name instead. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The exact form of action to be taken on the master auth. + Action SetMasterAuthRequest_Action `protobuf:"varint,4,opt,name=action,enum=google.container.v1beta1.SetMasterAuthRequest_Action" json:"action,omitempty"` + // A description of the update. + Update *MasterAuth `protobuf:"bytes,5,opt,name=update" json:"update,omitempty"` + // The name (project, location, cluster) of the cluster to set auth. + // Specified in the format 'projects/*/locations/*/clusters/*'. + Name string `protobuf:"bytes,7,opt,name=name" json:"name,omitempty"` +} + +func (m *SetMasterAuthRequest) Reset() { *m = SetMasterAuthRequest{} } +func (m *SetMasterAuthRequest) String() string { return proto.CompactTextString(m) } +func (*SetMasterAuthRequest) ProtoMessage() {} +func (*SetMasterAuthRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{19} } + +func (m *SetMasterAuthRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *SetMasterAuthRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *SetMasterAuthRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *SetMasterAuthRequest) GetAction() SetMasterAuthRequest_Action { + if m != nil { + return m.Action + } + return SetMasterAuthRequest_UNKNOWN +} + +func (m *SetMasterAuthRequest) GetUpdate() *MasterAuth { + if m != nil { + return m.Update + } + return nil +} + +func (m *SetMasterAuthRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// DeleteClusterRequest deletes a cluster. +type DeleteClusterRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + // This field is deprecated, use name instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use name instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster to delete. + // This field is deprecated, use name instead. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The name (project, location, cluster) of the cluster to delete. + // Specified in the format 'projects/*/locations/*/clusters/*'. + Name string `protobuf:"bytes,4,opt,name=name" json:"name,omitempty"` +} + +func (m *DeleteClusterRequest) Reset() { *m = DeleteClusterRequest{} } +func (m *DeleteClusterRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteClusterRequest) ProtoMessage() {} +func (*DeleteClusterRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20} } + +func (m *DeleteClusterRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *DeleteClusterRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *DeleteClusterRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *DeleteClusterRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// ListClustersRequest lists clusters. +type ListClustersRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + // This field is deprecated, use parent instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides, or "-" for all zones. + // This field is deprecated, use parent instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The parent (project and location) where the clusters will be listed. + // Specified in the format 'projects/*/locations/*'. + // Location "-" matches all zones and all regions. + Parent string `protobuf:"bytes,4,opt,name=parent" json:"parent,omitempty"` +} + +func (m *ListClustersRequest) Reset() { *m = ListClustersRequest{} } +func (m *ListClustersRequest) String() string { return proto.CompactTextString(m) } +func (*ListClustersRequest) ProtoMessage() {} +func (*ListClustersRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{21} } + +func (m *ListClustersRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *ListClustersRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *ListClustersRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +// ListClustersResponse is the result of ListClustersRequest. +type ListClustersResponse struct { + // A list of clusters in the project in the specified zone, or + // across all ones. + Clusters []*Cluster `protobuf:"bytes,1,rep,name=clusters" json:"clusters,omitempty"` + // If any zones are listed here, the list of clusters returned + // may be missing those zones. + MissingZones []string `protobuf:"bytes,2,rep,name=missing_zones,json=missingZones" json:"missing_zones,omitempty"` +} + +func (m *ListClustersResponse) Reset() { *m = ListClustersResponse{} } +func (m *ListClustersResponse) String() string { return proto.CompactTextString(m) } +func (*ListClustersResponse) ProtoMessage() {} +func (*ListClustersResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{22} } + +func (m *ListClustersResponse) GetClusters() []*Cluster { + if m != nil { + return m.Clusters + } + return nil +} + +func (m *ListClustersResponse) GetMissingZones() []string { + if m != nil { + return m.MissingZones + } + return nil +} + +// GetOperationRequest gets a single operation. +type GetOperationRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + // This field is deprecated, use name instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use name instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The server-assigned `name` of the operation. + // This field is deprecated, use name instead. + OperationId string `protobuf:"bytes,3,opt,name=operation_id,json=operationId" json:"operation_id,omitempty"` + // The name (project, location, operation id) of the operation to get. + // Specified in the format 'projects/*/locations/*/operations/*'. + Name string `protobuf:"bytes,5,opt,name=name" json:"name,omitempty"` +} + +func (m *GetOperationRequest) Reset() { *m = GetOperationRequest{} } +func (m *GetOperationRequest) String() string { return proto.CompactTextString(m) } +func (*GetOperationRequest) ProtoMessage() {} +func (*GetOperationRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{23} } + +func (m *GetOperationRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *GetOperationRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *GetOperationRequest) GetOperationId() string { + if m != nil { + return m.OperationId + } + return "" +} + +func (m *GetOperationRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// ListOperationsRequest lists operations. +type ListOperationsRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + // This field is deprecated, use parent instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine [zone](/compute/docs/zones#available) + // to return operations for, or `-` for all zones. + // This field is deprecated, use parent instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The parent (project and location) where the operations will be listed. + // Specified in the format 'projects/*/locations/*'. + // Location "-" matches all zones and all regions. + Parent string `protobuf:"bytes,4,opt,name=parent" json:"parent,omitempty"` +} + +func (m *ListOperationsRequest) Reset() { *m = ListOperationsRequest{} } +func (m *ListOperationsRequest) String() string { return proto.CompactTextString(m) } +func (*ListOperationsRequest) ProtoMessage() {} +func (*ListOperationsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{24} } + +func (m *ListOperationsRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *ListOperationsRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *ListOperationsRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +// CancelOperationRequest cancels a single operation. +type CancelOperationRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + // This field is deprecated, use name instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the operation resides. + // This field is deprecated, use name instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The server-assigned `name` of the operation. + // This field is deprecated, use name instead. + OperationId string `protobuf:"bytes,3,opt,name=operation_id,json=operationId" json:"operation_id,omitempty"` + // The name (project, location, operation id) of the operation to cancel. + // Specified in the format 'projects/*/locations/*/operations/*'. + Name string `protobuf:"bytes,4,opt,name=name" json:"name,omitempty"` +} + +func (m *CancelOperationRequest) Reset() { *m = CancelOperationRequest{} } +func (m *CancelOperationRequest) String() string { return proto.CompactTextString(m) } +func (*CancelOperationRequest) ProtoMessage() {} +func (*CancelOperationRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{25} } + +func (m *CancelOperationRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *CancelOperationRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *CancelOperationRequest) GetOperationId() string { + if m != nil { + return m.OperationId + } + return "" +} + +func (m *CancelOperationRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// ListOperationsResponse is the result of ListOperationsRequest. +type ListOperationsResponse struct { + // A list of operations in the project in the specified zone. + Operations []*Operation `protobuf:"bytes,1,rep,name=operations" json:"operations,omitempty"` + // If any zones are listed here, the list of operations returned + // may be missing the operations from those zones. + MissingZones []string `protobuf:"bytes,2,rep,name=missing_zones,json=missingZones" json:"missing_zones,omitempty"` +} + +func (m *ListOperationsResponse) Reset() { *m = ListOperationsResponse{} } +func (m *ListOperationsResponse) String() string { return proto.CompactTextString(m) } +func (*ListOperationsResponse) ProtoMessage() {} +func (*ListOperationsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{26} } + +func (m *ListOperationsResponse) GetOperations() []*Operation { + if m != nil { + return m.Operations + } + return nil +} + +func (m *ListOperationsResponse) GetMissingZones() []string { + if m != nil { + return m.MissingZones + } + return nil +} + +// Gets the current Container Engine service configuration. +type GetServerConfigRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + // This field is deprecated, use name instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine [zone](/compute/docs/zones#available) + // to return operations for. + // This field is deprecated, use name instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name (project and location) of the server config to get + // Specified in the format 'projects/*/locations/*'. + Name string `protobuf:"bytes,4,opt,name=name" json:"name,omitempty"` +} + +func (m *GetServerConfigRequest) Reset() { *m = GetServerConfigRequest{} } +func (m *GetServerConfigRequest) String() string { return proto.CompactTextString(m) } +func (*GetServerConfigRequest) ProtoMessage() {} +func (*GetServerConfigRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{27} } + +func (m *GetServerConfigRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *GetServerConfigRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *GetServerConfigRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Container Engine service configuration. +type ServerConfig struct { + // Version of Kubernetes the service deploys by default. + DefaultClusterVersion string `protobuf:"bytes,1,opt,name=default_cluster_version,json=defaultClusterVersion" json:"default_cluster_version,omitempty"` + // List of valid node upgrade target versions. + ValidNodeVersions []string `protobuf:"bytes,3,rep,name=valid_node_versions,json=validNodeVersions" json:"valid_node_versions,omitempty"` + // Default image type. + DefaultImageType string `protobuf:"bytes,4,opt,name=default_image_type,json=defaultImageType" json:"default_image_type,omitempty"` + // List of valid image types. + ValidImageTypes []string `protobuf:"bytes,5,rep,name=valid_image_types,json=validImageTypes" json:"valid_image_types,omitempty"` + // List of valid master versions. + ValidMasterVersions []string `protobuf:"bytes,6,rep,name=valid_master_versions,json=validMasterVersions" json:"valid_master_versions,omitempty"` +} + +func (m *ServerConfig) Reset() { *m = ServerConfig{} } +func (m *ServerConfig) String() string { return proto.CompactTextString(m) } +func (*ServerConfig) ProtoMessage() {} +func (*ServerConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{28} } + +func (m *ServerConfig) GetDefaultClusterVersion() string { + if m != nil { + return m.DefaultClusterVersion + } + return "" +} + +func (m *ServerConfig) GetValidNodeVersions() []string { + if m != nil { + return m.ValidNodeVersions + } + return nil +} + +func (m *ServerConfig) GetDefaultImageType() string { + if m != nil { + return m.DefaultImageType + } + return "" +} + +func (m *ServerConfig) GetValidImageTypes() []string { + if m != nil { + return m.ValidImageTypes + } + return nil +} + +func (m *ServerConfig) GetValidMasterVersions() []string { + if m != nil { + return m.ValidMasterVersions + } + return nil +} + +// CreateNodePoolRequest creates a node pool for a cluster. +type CreateNodePoolRequest struct { + // The Google Developers Console [project ID or project + // number](https://developers.google.com/console/help/new/#projectnumber). + // This field is deprecated, use parent instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use parent instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster. + // This field is deprecated, use parent instead. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The node pool to create. + NodePool *NodePool `protobuf:"bytes,4,opt,name=node_pool,json=nodePool" json:"node_pool,omitempty"` + // The parent (project, location, cluster id) where the node pool will be created. + // Specified in the format 'projects/*/locations/*/clusters/*/nodePools/*'. + Parent string `protobuf:"bytes,6,opt,name=parent" json:"parent,omitempty"` +} + +func (m *CreateNodePoolRequest) Reset() { *m = CreateNodePoolRequest{} } +func (m *CreateNodePoolRequest) String() string { return proto.CompactTextString(m) } +func (*CreateNodePoolRequest) ProtoMessage() {} +func (*CreateNodePoolRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{29} } + +func (m *CreateNodePoolRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *CreateNodePoolRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *CreateNodePoolRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *CreateNodePoolRequest) GetNodePool() *NodePool { + if m != nil { + return m.NodePool + } + return nil +} + +func (m *CreateNodePoolRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +// DeleteNodePoolRequest deletes a node pool for a cluster. +type DeleteNodePoolRequest struct { + // The Google Developers Console [project ID or project + // number](https://developers.google.com/console/help/new/#projectnumber). + // This field is deprecated, use name instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use name instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster. + // This field is deprecated, use name instead. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The name of the node pool to delete. + // This field is deprecated, use name instead. + NodePoolId string `protobuf:"bytes,4,opt,name=node_pool_id,json=nodePoolId" json:"node_pool_id,omitempty"` + // The name (project, location, cluster, node pool id) of the node pool to delete. + // Specified in the format 'projects/*/locations/*/clusters/*/nodePools/*'. + Name string `protobuf:"bytes,6,opt,name=name" json:"name,omitempty"` +} + +func (m *DeleteNodePoolRequest) Reset() { *m = DeleteNodePoolRequest{} } +func (m *DeleteNodePoolRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteNodePoolRequest) ProtoMessage() {} +func (*DeleteNodePoolRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{30} } + +func (m *DeleteNodePoolRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *DeleteNodePoolRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *DeleteNodePoolRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *DeleteNodePoolRequest) GetNodePoolId() string { + if m != nil { + return m.NodePoolId + } + return "" +} + +func (m *DeleteNodePoolRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// ListNodePoolsRequest lists the node pool(s) for a cluster. +type ListNodePoolsRequest struct { + // The Google Developers Console [project ID or project + // number](https://developers.google.com/console/help/new/#projectnumber). + // This field is deprecated, use parent instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use parent instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster. + // This field is deprecated, use parent instead. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The parent (project, location, cluster id) where the node pools will be listed. + // Specified in the format 'projects/*/locations/*/clusters/*'. + Parent string `protobuf:"bytes,5,opt,name=parent" json:"parent,omitempty"` +} + +func (m *ListNodePoolsRequest) Reset() { *m = ListNodePoolsRequest{} } +func (m *ListNodePoolsRequest) String() string { return proto.CompactTextString(m) } +func (*ListNodePoolsRequest) ProtoMessage() {} +func (*ListNodePoolsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{31} } + +func (m *ListNodePoolsRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *ListNodePoolsRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *ListNodePoolsRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *ListNodePoolsRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +// GetNodePoolRequest retrieves a node pool for a cluster. +type GetNodePoolRequest struct { + // The Google Developers Console [project ID or project + // number](https://developers.google.com/console/help/new/#projectnumber). + // This field is deprecated, use name instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use name instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster. + // This field is deprecated, use name instead. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The name of the node pool. + // This field is deprecated, use name instead. + NodePoolId string `protobuf:"bytes,4,opt,name=node_pool_id,json=nodePoolId" json:"node_pool_id,omitempty"` + // The name (project, location, cluster, node pool id) of the node pool to get. + // Specified in the format 'projects/*/locations/*/clusters/*/nodePools/*'. + Name string `protobuf:"bytes,6,opt,name=name" json:"name,omitempty"` +} + +func (m *GetNodePoolRequest) Reset() { *m = GetNodePoolRequest{} } +func (m *GetNodePoolRequest) String() string { return proto.CompactTextString(m) } +func (*GetNodePoolRequest) ProtoMessage() {} +func (*GetNodePoolRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{32} } + +func (m *GetNodePoolRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *GetNodePoolRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *GetNodePoolRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *GetNodePoolRequest) GetNodePoolId() string { + if m != nil { + return m.NodePoolId + } + return "" +} + +func (m *GetNodePoolRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// NodePool contains the name and configuration for a cluster's node pool. +// Node pools are a set of nodes (i.e. VM's), with a common configuration and +// specification, under the control of the cluster master. They may have a set +// of Kubernetes labels applied to them, which may be used to reference them +// during pod scheduling. They may also be resized up or down, to accommodate +// the workload. +type NodePool struct { + // The name of the node pool. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The node configuration of the pool. + Config *NodeConfig `protobuf:"bytes,2,opt,name=config" json:"config,omitempty"` + // The initial node count for the pool. You must ensure that your + // Compute Engine resource quota + // is sufficient for this number of instances. You must also have available + // firewall and routes quota. + InitialNodeCount int32 `protobuf:"varint,3,opt,name=initial_node_count,json=initialNodeCount" json:"initial_node_count,omitempty"` + // [Output only] Server-defined URL for the resource. + SelfLink string `protobuf:"bytes,100,opt,name=self_link,json=selfLink" json:"self_link,omitempty"` + // [Output only] The version of the Kubernetes of this node. + Version string `protobuf:"bytes,101,opt,name=version" json:"version,omitempty"` + // [Output only] The resource URLs of [instance + // groups](/compute/docs/instance-groups/) associated with this + // node pool. + InstanceGroupUrls []string `protobuf:"bytes,102,rep,name=instance_group_urls,json=instanceGroupUrls" json:"instance_group_urls,omitempty"` + // [Output only] The status of the nodes in this pool instance. + Status NodePool_Status `protobuf:"varint,103,opt,name=status,enum=google.container.v1beta1.NodePool_Status" json:"status,omitempty"` + // [Output only] Additional information about the current status of this + // node pool instance, if available. + StatusMessage string `protobuf:"bytes,104,opt,name=status_message,json=statusMessage" json:"status_message,omitempty"` + // Autoscaler configuration for this NodePool. Autoscaler is enabled + // only if a valid configuration is present. + Autoscaling *NodePoolAutoscaling `protobuf:"bytes,4,opt,name=autoscaling" json:"autoscaling,omitempty"` + // NodeManagement configuration for this NodePool. + Management *NodeManagement `protobuf:"bytes,5,opt,name=management" json:"management,omitempty"` +} + +func (m *NodePool) Reset() { *m = NodePool{} } +func (m *NodePool) String() string { return proto.CompactTextString(m) } +func (*NodePool) ProtoMessage() {} +func (*NodePool) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{33} } + +func (m *NodePool) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *NodePool) GetConfig() *NodeConfig { + if m != nil { + return m.Config + } + return nil +} + +func (m *NodePool) GetInitialNodeCount() int32 { + if m != nil { + return m.InitialNodeCount + } + return 0 +} + +func (m *NodePool) GetSelfLink() string { + if m != nil { + return m.SelfLink + } + return "" +} + +func (m *NodePool) GetVersion() string { + if m != nil { + return m.Version + } + return "" +} + +func (m *NodePool) GetInstanceGroupUrls() []string { + if m != nil { + return m.InstanceGroupUrls + } + return nil +} + +func (m *NodePool) GetStatus() NodePool_Status { + if m != nil { + return m.Status + } + return NodePool_STATUS_UNSPECIFIED +} + +func (m *NodePool) GetStatusMessage() string { + if m != nil { + return m.StatusMessage + } + return "" +} + +func (m *NodePool) GetAutoscaling() *NodePoolAutoscaling { + if m != nil { + return m.Autoscaling + } + return nil +} + +func (m *NodePool) GetManagement() *NodeManagement { + if m != nil { + return m.Management + } + return nil +} + +// NodeManagement defines the set of node management services turned on for the +// node pool. +type NodeManagement struct { + // Whether the nodes will be automatically upgraded. + AutoUpgrade bool `protobuf:"varint,1,opt,name=auto_upgrade,json=autoUpgrade" json:"auto_upgrade,omitempty"` + // Whether the nodes will be automatically repaired. + AutoRepair bool `protobuf:"varint,2,opt,name=auto_repair,json=autoRepair" json:"auto_repair,omitempty"` + // Specifies the Auto Upgrade knobs for the node pool. + UpgradeOptions *AutoUpgradeOptions `protobuf:"bytes,10,opt,name=upgrade_options,json=upgradeOptions" json:"upgrade_options,omitempty"` +} + +func (m *NodeManagement) Reset() { *m = NodeManagement{} } +func (m *NodeManagement) String() string { return proto.CompactTextString(m) } +func (*NodeManagement) ProtoMessage() {} +func (*NodeManagement) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{34} } + +func (m *NodeManagement) GetAutoUpgrade() bool { + if m != nil { + return m.AutoUpgrade + } + return false +} + +func (m *NodeManagement) GetAutoRepair() bool { + if m != nil { + return m.AutoRepair + } + return false +} + +func (m *NodeManagement) GetUpgradeOptions() *AutoUpgradeOptions { + if m != nil { + return m.UpgradeOptions + } + return nil +} + +// AutoUpgradeOptions defines the set of options for the user to control how +// the Auto Upgrades will proceed. +type AutoUpgradeOptions struct { + // [Output only] This field is set when upgrades are about to commence + // with the approximate start time for the upgrades, in + // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + AutoUpgradeStartTime string `protobuf:"bytes,1,opt,name=auto_upgrade_start_time,json=autoUpgradeStartTime" json:"auto_upgrade_start_time,omitempty"` + // [Output only] This field is set when upgrades are about to commence + // with the description of the upgrade. + Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` +} + +func (m *AutoUpgradeOptions) Reset() { *m = AutoUpgradeOptions{} } +func (m *AutoUpgradeOptions) String() string { return proto.CompactTextString(m) } +func (*AutoUpgradeOptions) ProtoMessage() {} +func (*AutoUpgradeOptions) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{35} } + +func (m *AutoUpgradeOptions) GetAutoUpgradeStartTime() string { + if m != nil { + return m.AutoUpgradeStartTime + } + return "" +} + +func (m *AutoUpgradeOptions) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +// MaintenancePolicy defines the maintenance policy to be used for the cluster. +type MaintenancePolicy struct { + // Specifies the maintenance window in which maintenance may be performed. + Window *MaintenanceWindow `protobuf:"bytes,1,opt,name=window" json:"window,omitempty"` +} + +func (m *MaintenancePolicy) Reset() { *m = MaintenancePolicy{} } +func (m *MaintenancePolicy) String() string { return proto.CompactTextString(m) } +func (*MaintenancePolicy) ProtoMessage() {} +func (*MaintenancePolicy) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{36} } + +func (m *MaintenancePolicy) GetWindow() *MaintenanceWindow { + if m != nil { + return m.Window + } + return nil +} + +// MaintenanceWindow defines the maintenance window to be used for the cluster. +type MaintenanceWindow struct { + // Unimplemented, reserved for future use. + // HourlyMaintenanceWindow hourly_maintenance_window = 1; + // + // Types that are valid to be assigned to Policy: + // *MaintenanceWindow_DailyMaintenanceWindow + Policy isMaintenanceWindow_Policy `protobuf_oneof:"policy"` +} + +func (m *MaintenanceWindow) Reset() { *m = MaintenanceWindow{} } +func (m *MaintenanceWindow) String() string { return proto.CompactTextString(m) } +func (*MaintenanceWindow) ProtoMessage() {} +func (*MaintenanceWindow) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{37} } + +type isMaintenanceWindow_Policy interface { + isMaintenanceWindow_Policy() +} + +type MaintenanceWindow_DailyMaintenanceWindow struct { + DailyMaintenanceWindow *DailyMaintenanceWindow `protobuf:"bytes,2,opt,name=daily_maintenance_window,json=dailyMaintenanceWindow,oneof"` +} + +func (*MaintenanceWindow_DailyMaintenanceWindow) isMaintenanceWindow_Policy() {} + +func (m *MaintenanceWindow) GetPolicy() isMaintenanceWindow_Policy { + if m != nil { + return m.Policy + } + return nil +} + +func (m *MaintenanceWindow) GetDailyMaintenanceWindow() *DailyMaintenanceWindow { + if x, ok := m.GetPolicy().(*MaintenanceWindow_DailyMaintenanceWindow); ok { + return x.DailyMaintenanceWindow + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*MaintenanceWindow) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _MaintenanceWindow_OneofMarshaler, _MaintenanceWindow_OneofUnmarshaler, _MaintenanceWindow_OneofSizer, []interface{}{ + (*MaintenanceWindow_DailyMaintenanceWindow)(nil), + } +} + +func _MaintenanceWindow_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*MaintenanceWindow) + // policy + switch x := m.Policy.(type) { + case *MaintenanceWindow_DailyMaintenanceWindow: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.DailyMaintenanceWindow); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("MaintenanceWindow.Policy has unexpected type %T", x) + } + return nil +} + +func _MaintenanceWindow_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*MaintenanceWindow) + switch tag { + case 2: // policy.daily_maintenance_window + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(DailyMaintenanceWindow) + err := b.DecodeMessage(msg) + m.Policy = &MaintenanceWindow_DailyMaintenanceWindow{msg} + return true, err + default: + return false, nil + } +} + +func _MaintenanceWindow_OneofSizer(msg proto.Message) (n int) { + m := msg.(*MaintenanceWindow) + // policy + switch x := m.Policy.(type) { + case *MaintenanceWindow_DailyMaintenanceWindow: + s := proto.Size(x.DailyMaintenanceWindow) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Time window specified for daily maintenance operations. +type DailyMaintenanceWindow struct { + // Time within the maintenance window to start the maintenance operations. + // It must be in format "HH:MM”, where HH : [00-23] and MM : [00-59] GMT. + StartTime string `protobuf:"bytes,2,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + // [Output only] Duration of the time window, automatically chosen to be + // smallest possible in the given scenario. + Duration string `protobuf:"bytes,3,opt,name=duration" json:"duration,omitempty"` +} + +func (m *DailyMaintenanceWindow) Reset() { *m = DailyMaintenanceWindow{} } +func (m *DailyMaintenanceWindow) String() string { return proto.CompactTextString(m) } +func (*DailyMaintenanceWindow) ProtoMessage() {} +func (*DailyMaintenanceWindow) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{38} } + +func (m *DailyMaintenanceWindow) GetStartTime() string { + if m != nil { + return m.StartTime + } + return "" +} + +func (m *DailyMaintenanceWindow) GetDuration() string { + if m != nil { + return m.Duration + } + return "" +} + +// SetNodePoolManagementRequest sets the node management properties of a node +// pool. +type SetNodePoolManagementRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + // This field is deprecated, use name instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use name instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster to update. + // This field is deprecated, use name instead. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The name of the node pool to update. + // This field is deprecated, use name instead. + NodePoolId string `protobuf:"bytes,4,opt,name=node_pool_id,json=nodePoolId" json:"node_pool_id,omitempty"` + // NodeManagement configuration for the node pool. + Management *NodeManagement `protobuf:"bytes,5,opt,name=management" json:"management,omitempty"` + // The name (project, location, cluster, node pool id) of the node pool to set + // management properties. Specified in the format + // 'projects/*/locations/*/clusters/*/nodePools/*'. + Name string `protobuf:"bytes,7,opt,name=name" json:"name,omitempty"` +} + +func (m *SetNodePoolManagementRequest) Reset() { *m = SetNodePoolManagementRequest{} } +func (m *SetNodePoolManagementRequest) String() string { return proto.CompactTextString(m) } +func (*SetNodePoolManagementRequest) ProtoMessage() {} +func (*SetNodePoolManagementRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{39} } + +func (m *SetNodePoolManagementRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *SetNodePoolManagementRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *SetNodePoolManagementRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *SetNodePoolManagementRequest) GetNodePoolId() string { + if m != nil { + return m.NodePoolId + } + return "" +} + +func (m *SetNodePoolManagementRequest) GetManagement() *NodeManagement { + if m != nil { + return m.Management + } + return nil +} + +func (m *SetNodePoolManagementRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// RollbackNodePoolUpgradeRequest rollbacks the previously Aborted or Failed +// NodePool upgrade. This will be an no-op if the last upgrade successfully +// completed. +type RollbackNodePoolUpgradeRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + // This field is deprecated, use name instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use name instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster to rollback. + // This field is deprecated, use name instead. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The name of the node pool to rollback. + // This field is deprecated, use name instead. + NodePoolId string `protobuf:"bytes,4,opt,name=node_pool_id,json=nodePoolId" json:"node_pool_id,omitempty"` + // The name (project, location, cluster, node pool id) of the node poll to + // rollback upgrade. + // Specified in the format 'projects/*/locations/*/clusters/*/nodePools/*'. + Name string `protobuf:"bytes,6,opt,name=name" json:"name,omitempty"` +} + +func (m *RollbackNodePoolUpgradeRequest) Reset() { *m = RollbackNodePoolUpgradeRequest{} } +func (m *RollbackNodePoolUpgradeRequest) String() string { return proto.CompactTextString(m) } +func (*RollbackNodePoolUpgradeRequest) ProtoMessage() {} +func (*RollbackNodePoolUpgradeRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{40} } + +func (m *RollbackNodePoolUpgradeRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *RollbackNodePoolUpgradeRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *RollbackNodePoolUpgradeRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *RollbackNodePoolUpgradeRequest) GetNodePoolId() string { + if m != nil { + return m.NodePoolId + } + return "" +} + +func (m *RollbackNodePoolUpgradeRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// ListNodePoolsResponse is the result of ListNodePoolsRequest. +type ListNodePoolsResponse struct { + // A list of node pools for a cluster. + NodePools []*NodePool `protobuf:"bytes,1,rep,name=node_pools,json=nodePools" json:"node_pools,omitempty"` +} + +func (m *ListNodePoolsResponse) Reset() { *m = ListNodePoolsResponse{} } +func (m *ListNodePoolsResponse) String() string { return proto.CompactTextString(m) } +func (*ListNodePoolsResponse) ProtoMessage() {} +func (*ListNodePoolsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{41} } + +func (m *ListNodePoolsResponse) GetNodePools() []*NodePool { + if m != nil { + return m.NodePools + } + return nil +} + +// NodePoolAutoscaling contains information required by cluster autoscaler to +// adjust the size of the node pool to the current cluster usage. +type NodePoolAutoscaling struct { + // Is autoscaling enabled for this node pool. + Enabled bool `protobuf:"varint,1,opt,name=enabled" json:"enabled,omitempty"` + // Minimum number of nodes in the NodePool. Must be >= 1 and <= + // max_node_count. + MinNodeCount int32 `protobuf:"varint,2,opt,name=min_node_count,json=minNodeCount" json:"min_node_count,omitempty"` + // Maximum number of nodes in the NodePool. Must be >= min_node_count. There + // has to enough quota to scale up the cluster. + MaxNodeCount int32 `protobuf:"varint,3,opt,name=max_node_count,json=maxNodeCount" json:"max_node_count,omitempty"` +} + +func (m *NodePoolAutoscaling) Reset() { *m = NodePoolAutoscaling{} } +func (m *NodePoolAutoscaling) String() string { return proto.CompactTextString(m) } +func (*NodePoolAutoscaling) ProtoMessage() {} +func (*NodePoolAutoscaling) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{42} } + +func (m *NodePoolAutoscaling) GetEnabled() bool { + if m != nil { + return m.Enabled + } + return false +} + +func (m *NodePoolAutoscaling) GetMinNodeCount() int32 { + if m != nil { + return m.MinNodeCount + } + return 0 +} + +func (m *NodePoolAutoscaling) GetMaxNodeCount() int32 { + if m != nil { + return m.MaxNodeCount + } + return 0 +} + +// SetLabelsRequest sets the Google Cloud Platform labels on a Google Container +// Engine cluster, which will in turn set them for Google Compute Engine +// resources used by that cluster +type SetLabelsRequest struct { + // The Google Developers Console [project ID or project + // number](https://developers.google.com/console/help/new/#projectnumber). + // This field is deprecated, use name instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use name instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster. + // This field is deprecated, use name instead. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The labels to set for that cluster. + ResourceLabels map[string]string `protobuf:"bytes,4,rep,name=resource_labels,json=resourceLabels" json:"resource_labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // The fingerprint of the previous set of labels for this resource, + // used to detect conflicts. The fingerprint is initially generated by + // Container Engine and changes after every request to modify or update + // labels. You must always provide an up-to-date fingerprint hash when + // updating or changing labels. Make a get() request to the + // resource to get the latest fingerprint. + LabelFingerprint string `protobuf:"bytes,5,opt,name=label_fingerprint,json=labelFingerprint" json:"label_fingerprint,omitempty"` + // The name (project, location, cluster id) of the cluster to set labels. + // Specified in the format 'projects/*/locations/*/clusters/*'. + Name string `protobuf:"bytes,7,opt,name=name" json:"name,omitempty"` +} + +func (m *SetLabelsRequest) Reset() { *m = SetLabelsRequest{} } +func (m *SetLabelsRequest) String() string { return proto.CompactTextString(m) } +func (*SetLabelsRequest) ProtoMessage() {} +func (*SetLabelsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{43} } + +func (m *SetLabelsRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *SetLabelsRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *SetLabelsRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *SetLabelsRequest) GetResourceLabels() map[string]string { + if m != nil { + return m.ResourceLabels + } + return nil +} + +func (m *SetLabelsRequest) GetLabelFingerprint() string { + if m != nil { + return m.LabelFingerprint + } + return "" +} + +func (m *SetLabelsRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// SetLegacyAbacRequest enables or disables the ABAC authorization mechanism for +// a cluster. +type SetLegacyAbacRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + // This field is deprecated, use name instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use name instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster to update. + // This field is deprecated, use name instead. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // Whether ABAC authorization will be enabled in the cluster. + Enabled bool `protobuf:"varint,4,opt,name=enabled" json:"enabled,omitempty"` + // The name (project, location, cluster id) of the cluster to set legacy abac. + // Specified in the format 'projects/*/locations/*/clusters/*'. + Name string `protobuf:"bytes,6,opt,name=name" json:"name,omitempty"` +} + +func (m *SetLegacyAbacRequest) Reset() { *m = SetLegacyAbacRequest{} } +func (m *SetLegacyAbacRequest) String() string { return proto.CompactTextString(m) } +func (*SetLegacyAbacRequest) ProtoMessage() {} +func (*SetLegacyAbacRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{44} } + +func (m *SetLegacyAbacRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *SetLegacyAbacRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *SetLegacyAbacRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *SetLegacyAbacRequest) GetEnabled() bool { + if m != nil { + return m.Enabled + } + return false +} + +func (m *SetLegacyAbacRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// StartIPRotationRequest creates a new IP for the cluster and then performs +// a node upgrade on each node pool to point to the new IP. +type StartIPRotationRequest struct { + // The Google Developers Console [project ID or project + // number](https://developers.google.com/console/help/new/#projectnumber). + // This field is deprecated, use name instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use name instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster. + // This field is deprecated, use name instead. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The name (project, location, cluster id) of the cluster to start IP rotation. + // Specified in the format 'projects/*/locations/*/clusters/*'. + Name string `protobuf:"bytes,6,opt,name=name" json:"name,omitempty"` +} + +func (m *StartIPRotationRequest) Reset() { *m = StartIPRotationRequest{} } +func (m *StartIPRotationRequest) String() string { return proto.CompactTextString(m) } +func (*StartIPRotationRequest) ProtoMessage() {} +func (*StartIPRotationRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{45} } + +func (m *StartIPRotationRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *StartIPRotationRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *StartIPRotationRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *StartIPRotationRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// CompleteIPRotationRequest moves the cluster master back into single-IP mode. +type CompleteIPRotationRequest struct { + // The Google Developers Console [project ID or project + // number](https://developers.google.com/console/help/new/#projectnumber). + // This field is deprecated, use name instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use name instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster. + // This field is deprecated, use name instead. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The name (project, location, cluster id) of the cluster to complete IP rotation. + // Specified in the format 'projects/*/locations/*/clusters/*'. + Name string `protobuf:"bytes,7,opt,name=name" json:"name,omitempty"` +} + +func (m *CompleteIPRotationRequest) Reset() { *m = CompleteIPRotationRequest{} } +func (m *CompleteIPRotationRequest) String() string { return proto.CompactTextString(m) } +func (*CompleteIPRotationRequest) ProtoMessage() {} +func (*CompleteIPRotationRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{46} } + +func (m *CompleteIPRotationRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *CompleteIPRotationRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *CompleteIPRotationRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *CompleteIPRotationRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// AcceleratorConfig represents a Hardware Accelerator request. +type AcceleratorConfig struct { + // The number of the accelerator cards exposed to an instance. + AcceleratorCount int64 `protobuf:"varint,1,opt,name=accelerator_count,json=acceleratorCount" json:"accelerator_count,omitempty"` + // The accelerator type resource name. List of supported accelerators + // [here](/compute/docs/gpus/#Introduction) + AcceleratorType string `protobuf:"bytes,2,opt,name=accelerator_type,json=acceleratorType" json:"accelerator_type,omitempty"` +} + +func (m *AcceleratorConfig) Reset() { *m = AcceleratorConfig{} } +func (m *AcceleratorConfig) String() string { return proto.CompactTextString(m) } +func (*AcceleratorConfig) ProtoMessage() {} +func (*AcceleratorConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{47} } + +func (m *AcceleratorConfig) GetAcceleratorCount() int64 { + if m != nil { + return m.AcceleratorCount + } + return 0 +} + +func (m *AcceleratorConfig) GetAcceleratorType() string { + if m != nil { + return m.AcceleratorType + } + return "" +} + +// SetNetworkPolicyRequest enables/disables network policy for a cluster. +type SetNetworkPolicyRequest struct { + // The Google Developers Console [project ID or project + // number](https://developers.google.com/console/help/new/#projectnumber). + // This field is deprecated, use name instead. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + // This field is deprecated, use name instead. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster. + // This field is deprecated, use name instead. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // Configuration options for the NetworkPolicy feature. + NetworkPolicy *NetworkPolicy `protobuf:"bytes,4,opt,name=network_policy,json=networkPolicy" json:"network_policy,omitempty"` + // The name (project, location, cluster id) of the cluster to set networking policy. + // Specified in the format 'projects/*/locations/*/clusters/*'. + Name string `protobuf:"bytes,6,opt,name=name" json:"name,omitempty"` +} + +func (m *SetNetworkPolicyRequest) Reset() { *m = SetNetworkPolicyRequest{} } +func (m *SetNetworkPolicyRequest) String() string { return proto.CompactTextString(m) } +func (*SetNetworkPolicyRequest) ProtoMessage() {} +func (*SetNetworkPolicyRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{48} } + +func (m *SetNetworkPolicyRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *SetNetworkPolicyRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *SetNetworkPolicyRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *SetNetworkPolicyRequest) GetNetworkPolicy() *NetworkPolicy { + if m != nil { + return m.NetworkPolicy + } + return nil +} + +func (m *SetNetworkPolicyRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// SetMaintenancePolicyRequest sets the maintenance policy for a cluster. +type SetMaintenancePolicyRequest struct { + // The Google Developers Console [project ID or project + // number](https://support.google.com/cloud/answer/6158840). + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster + // resides. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The name of the cluster to update. + ClusterId string `protobuf:"bytes,3,opt,name=cluster_id,json=clusterId" json:"cluster_id,omitempty"` + // The maintenance policy to be set for the cluster. An empty field + // clears the existing maintenance policy. + MaintenancePolicy *MaintenancePolicy `protobuf:"bytes,4,opt,name=maintenance_policy,json=maintenancePolicy" json:"maintenance_policy,omitempty"` + // The name (project, location, cluster id) of the cluster to set maintenance + // policy. + // Specified in the format 'projects/*/locations/*/clusters/*'. + Name string `protobuf:"bytes,5,opt,name=name" json:"name,omitempty"` +} + +func (m *SetMaintenancePolicyRequest) Reset() { *m = SetMaintenancePolicyRequest{} } +func (m *SetMaintenancePolicyRequest) String() string { return proto.CompactTextString(m) } +func (*SetMaintenancePolicyRequest) ProtoMessage() {} +func (*SetMaintenancePolicyRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{49} } + +func (m *SetMaintenancePolicyRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *SetMaintenancePolicyRequest) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *SetMaintenancePolicyRequest) GetClusterId() string { + if m != nil { + return m.ClusterId + } + return "" +} + +func (m *SetMaintenancePolicyRequest) GetMaintenancePolicy() *MaintenancePolicy { + if m != nil { + return m.MaintenancePolicy + } + return nil +} + +func (m *SetMaintenancePolicyRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func init() { + proto.RegisterType((*NodeConfig)(nil), "google.container.v1beta1.NodeConfig") + proto.RegisterType((*NodeTaint)(nil), "google.container.v1beta1.NodeTaint") + proto.RegisterType((*MasterAuth)(nil), "google.container.v1beta1.MasterAuth") + proto.RegisterType((*ClientCertificateConfig)(nil), "google.container.v1beta1.ClientCertificateConfig") + proto.RegisterType((*AddonsConfig)(nil), "google.container.v1beta1.AddonsConfig") + proto.RegisterType((*HttpLoadBalancing)(nil), "google.container.v1beta1.HttpLoadBalancing") + proto.RegisterType((*HorizontalPodAutoscaling)(nil), "google.container.v1beta1.HorizontalPodAutoscaling") + proto.RegisterType((*KubernetesDashboard)(nil), "google.container.v1beta1.KubernetesDashboard") + proto.RegisterType((*NetworkPolicyConfig)(nil), "google.container.v1beta1.NetworkPolicyConfig") + proto.RegisterType((*MasterAuthorizedNetworksConfig)(nil), "google.container.v1beta1.MasterAuthorizedNetworksConfig") + proto.RegisterType((*MasterAuthorizedNetworksConfig_CidrBlock)(nil), "google.container.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock") + proto.RegisterType((*NetworkPolicy)(nil), "google.container.v1beta1.NetworkPolicy") + proto.RegisterType((*IPAllocationPolicy)(nil), "google.container.v1beta1.IPAllocationPolicy") + proto.RegisterType((*PodSecurityPolicyConfig)(nil), "google.container.v1beta1.PodSecurityPolicyConfig") + proto.RegisterType((*Cluster)(nil), "google.container.v1beta1.Cluster") + proto.RegisterType((*ClusterUpdate)(nil), "google.container.v1beta1.ClusterUpdate") + proto.RegisterType((*Operation)(nil), "google.container.v1beta1.Operation") + proto.RegisterType((*CreateClusterRequest)(nil), "google.container.v1beta1.CreateClusterRequest") + proto.RegisterType((*GetClusterRequest)(nil), "google.container.v1beta1.GetClusterRequest") + proto.RegisterType((*UpdateClusterRequest)(nil), "google.container.v1beta1.UpdateClusterRequest") + proto.RegisterType((*SetMasterAuthRequest)(nil), "google.container.v1beta1.SetMasterAuthRequest") + proto.RegisterType((*DeleteClusterRequest)(nil), "google.container.v1beta1.DeleteClusterRequest") + proto.RegisterType((*ListClustersRequest)(nil), "google.container.v1beta1.ListClustersRequest") + proto.RegisterType((*ListClustersResponse)(nil), "google.container.v1beta1.ListClustersResponse") + proto.RegisterType((*GetOperationRequest)(nil), "google.container.v1beta1.GetOperationRequest") + proto.RegisterType((*ListOperationsRequest)(nil), "google.container.v1beta1.ListOperationsRequest") + proto.RegisterType((*CancelOperationRequest)(nil), "google.container.v1beta1.CancelOperationRequest") + proto.RegisterType((*ListOperationsResponse)(nil), "google.container.v1beta1.ListOperationsResponse") + proto.RegisterType((*GetServerConfigRequest)(nil), "google.container.v1beta1.GetServerConfigRequest") + proto.RegisterType((*ServerConfig)(nil), "google.container.v1beta1.ServerConfig") + proto.RegisterType((*CreateNodePoolRequest)(nil), "google.container.v1beta1.CreateNodePoolRequest") + proto.RegisterType((*DeleteNodePoolRequest)(nil), "google.container.v1beta1.DeleteNodePoolRequest") + proto.RegisterType((*ListNodePoolsRequest)(nil), "google.container.v1beta1.ListNodePoolsRequest") + proto.RegisterType((*GetNodePoolRequest)(nil), "google.container.v1beta1.GetNodePoolRequest") + proto.RegisterType((*NodePool)(nil), "google.container.v1beta1.NodePool") + proto.RegisterType((*NodeManagement)(nil), "google.container.v1beta1.NodeManagement") + proto.RegisterType((*AutoUpgradeOptions)(nil), "google.container.v1beta1.AutoUpgradeOptions") + proto.RegisterType((*MaintenancePolicy)(nil), "google.container.v1beta1.MaintenancePolicy") + proto.RegisterType((*MaintenanceWindow)(nil), "google.container.v1beta1.MaintenanceWindow") + proto.RegisterType((*DailyMaintenanceWindow)(nil), "google.container.v1beta1.DailyMaintenanceWindow") + proto.RegisterType((*SetNodePoolManagementRequest)(nil), "google.container.v1beta1.SetNodePoolManagementRequest") + proto.RegisterType((*RollbackNodePoolUpgradeRequest)(nil), "google.container.v1beta1.RollbackNodePoolUpgradeRequest") + proto.RegisterType((*ListNodePoolsResponse)(nil), "google.container.v1beta1.ListNodePoolsResponse") + proto.RegisterType((*NodePoolAutoscaling)(nil), "google.container.v1beta1.NodePoolAutoscaling") + proto.RegisterType((*SetLabelsRequest)(nil), "google.container.v1beta1.SetLabelsRequest") + proto.RegisterType((*SetLegacyAbacRequest)(nil), "google.container.v1beta1.SetLegacyAbacRequest") + proto.RegisterType((*StartIPRotationRequest)(nil), "google.container.v1beta1.StartIPRotationRequest") + proto.RegisterType((*CompleteIPRotationRequest)(nil), "google.container.v1beta1.CompleteIPRotationRequest") + proto.RegisterType((*AcceleratorConfig)(nil), "google.container.v1beta1.AcceleratorConfig") + proto.RegisterType((*SetNetworkPolicyRequest)(nil), "google.container.v1beta1.SetNetworkPolicyRequest") + proto.RegisterType((*SetMaintenancePolicyRequest)(nil), "google.container.v1beta1.SetMaintenancePolicyRequest") + proto.RegisterEnum("google.container.v1beta1.NodeTaint_Effect", NodeTaint_Effect_name, NodeTaint_Effect_value) + proto.RegisterEnum("google.container.v1beta1.NetworkPolicy_Provider", NetworkPolicy_Provider_name, NetworkPolicy_Provider_value) + proto.RegisterEnum("google.container.v1beta1.Cluster_Status", Cluster_Status_name, Cluster_Status_value) + proto.RegisterEnum("google.container.v1beta1.Operation_Status", Operation_Status_name, Operation_Status_value) + proto.RegisterEnum("google.container.v1beta1.Operation_Type", Operation_Type_name, Operation_Type_value) + proto.RegisterEnum("google.container.v1beta1.SetMasterAuthRequest_Action", SetMasterAuthRequest_Action_name, SetMasterAuthRequest_Action_value) + proto.RegisterEnum("google.container.v1beta1.NodePool_Status", NodePool_Status_name, NodePool_Status_value) +} + +// 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 + +// Client API for ClusterManager service + +type ClusterManagerClient interface { + // Lists all clusters owned by a project in either the specified zone or all + // zones. + ListClusters(ctx context.Context, in *ListClustersRequest, opts ...grpc.CallOption) (*ListClustersResponse, error) + // Gets the details of a specific cluster. + GetCluster(ctx context.Context, in *GetClusterRequest, opts ...grpc.CallOption) (*Cluster, error) + // Creates a cluster, consisting of the specified number and type of Google + // Compute Engine instances. + // + // By default, the cluster is created in the project's + // [default network](/compute/docs/networks-and-firewalls#networks). + // + // One firewall is added for the cluster. After cluster creation, + // the cluster creates routes for each node to allow the containers + // on that node to communicate with all other instances in the + // cluster. + // + // Finally, an entry is added to the project's global metadata indicating + // which CIDR range is being used by the cluster. + CreateCluster(ctx context.Context, in *CreateClusterRequest, opts ...grpc.CallOption) (*Operation, error) + // Updates the settings of a specific cluster. + UpdateCluster(ctx context.Context, in *UpdateClusterRequest, opts ...grpc.CallOption) (*Operation, error) + // Used to set master auth materials. Currently supports :- + // Changing the admin password of a specific cluster. + // This can be either via password generation or explicitly set. + // Modify basic_auth.csv and reset the K8S API server. + SetMasterAuth(ctx context.Context, in *SetMasterAuthRequest, opts ...grpc.CallOption) (*Operation, error) + // Deletes the cluster, including the Kubernetes endpoint and all worker + // nodes. + // + // Firewalls and routes that were configured during cluster creation + // are also deleted. + // + // Other Google Compute Engine resources that might be in use by the cluster + // (e.g. load balancer resources) will not be deleted if they weren't present + // at the initial create time. + DeleteCluster(ctx context.Context, in *DeleteClusterRequest, opts ...grpc.CallOption) (*Operation, error) + // Lists all operations in a project in a specific zone or all zones. + ListOperations(ctx context.Context, in *ListOperationsRequest, opts ...grpc.CallOption) (*ListOperationsResponse, error) + // Gets the specified operation. + GetOperation(ctx context.Context, in *GetOperationRequest, opts ...grpc.CallOption) (*Operation, error) + // Cancels the specified operation. + CancelOperation(ctx context.Context, in *CancelOperationRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) + // Returns configuration info about the Container Engine service. + GetServerConfig(ctx context.Context, in *GetServerConfigRequest, opts ...grpc.CallOption) (*ServerConfig, error) + // Lists the node pools for a cluster. + ListNodePools(ctx context.Context, in *ListNodePoolsRequest, opts ...grpc.CallOption) (*ListNodePoolsResponse, error) + // Retrieves the node pool requested. + GetNodePool(ctx context.Context, in *GetNodePoolRequest, opts ...grpc.CallOption) (*NodePool, error) + // Creates a node pool for a cluster. + CreateNodePool(ctx context.Context, in *CreateNodePoolRequest, opts ...grpc.CallOption) (*Operation, error) + // Deletes a node pool from a cluster. + DeleteNodePool(ctx context.Context, in *DeleteNodePoolRequest, opts ...grpc.CallOption) (*Operation, error) + // Roll back the previously Aborted or Failed NodePool upgrade. + // This will be an no-op if the last upgrade successfully completed. + RollbackNodePoolUpgrade(ctx context.Context, in *RollbackNodePoolUpgradeRequest, opts ...grpc.CallOption) (*Operation, error) + // Sets the NodeManagement options for a node pool. + SetNodePoolManagement(ctx context.Context, in *SetNodePoolManagementRequest, opts ...grpc.CallOption) (*Operation, error) + // Sets labels on a cluster. + SetLabels(ctx context.Context, in *SetLabelsRequest, opts ...grpc.CallOption) (*Operation, error) + // Enables or disables the ABAC authorization mechanism on a cluster. + SetLegacyAbac(ctx context.Context, in *SetLegacyAbacRequest, opts ...grpc.CallOption) (*Operation, error) + // Start master IP rotation. + StartIPRotation(ctx context.Context, in *StartIPRotationRequest, opts ...grpc.CallOption) (*Operation, error) + // Completes master IP rotation. + CompleteIPRotation(ctx context.Context, in *CompleteIPRotationRequest, opts ...grpc.CallOption) (*Operation, error) + // Enables/Disables Network Policy for a cluster. + SetNetworkPolicy(ctx context.Context, in *SetNetworkPolicyRequest, opts ...grpc.CallOption) (*Operation, error) + // Sets the maintenance policy for a cluster. + SetMaintenancePolicy(ctx context.Context, in *SetMaintenancePolicyRequest, opts ...grpc.CallOption) (*Operation, error) +} + +type clusterManagerClient struct { + cc *grpc.ClientConn +} + +func NewClusterManagerClient(cc *grpc.ClientConn) ClusterManagerClient { + return &clusterManagerClient{cc} +} + +func (c *clusterManagerClient) ListClusters(ctx context.Context, in *ListClustersRequest, opts ...grpc.CallOption) (*ListClustersResponse, error) { + out := new(ListClustersResponse) + err := grpc.Invoke(ctx, "/google.container.v1beta1.ClusterManager/ListClusters", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) GetCluster(ctx context.Context, in *GetClusterRequest, opts ...grpc.CallOption) (*Cluster, error) { + out := new(Cluster) + err := grpc.Invoke(ctx, "/google.container.v1beta1.ClusterManager/GetCluster", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) CreateCluster(ctx context.Context, in *CreateClusterRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1beta1.ClusterManager/CreateCluster", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) UpdateCluster(ctx context.Context, in *UpdateClusterRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1beta1.ClusterManager/UpdateCluster", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) SetMasterAuth(ctx context.Context, in *SetMasterAuthRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1beta1.ClusterManager/SetMasterAuth", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) DeleteCluster(ctx context.Context, in *DeleteClusterRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1beta1.ClusterManager/DeleteCluster", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) ListOperations(ctx context.Context, in *ListOperationsRequest, opts ...grpc.CallOption) (*ListOperationsResponse, error) { + out := new(ListOperationsResponse) + err := grpc.Invoke(ctx, "/google.container.v1beta1.ClusterManager/ListOperations", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) GetOperation(ctx context.Context, in *GetOperationRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1beta1.ClusterManager/GetOperation", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) CancelOperation(ctx context.Context, in *CancelOperationRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { + out := new(google_protobuf1.Empty) + err := grpc.Invoke(ctx, "/google.container.v1beta1.ClusterManager/CancelOperation", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) GetServerConfig(ctx context.Context, in *GetServerConfigRequest, opts ...grpc.CallOption) (*ServerConfig, error) { + out := new(ServerConfig) + err := grpc.Invoke(ctx, "/google.container.v1beta1.ClusterManager/GetServerConfig", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) ListNodePools(ctx context.Context, in *ListNodePoolsRequest, opts ...grpc.CallOption) (*ListNodePoolsResponse, error) { + out := new(ListNodePoolsResponse) + err := grpc.Invoke(ctx, "/google.container.v1beta1.ClusterManager/ListNodePools", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) GetNodePool(ctx context.Context, in *GetNodePoolRequest, opts ...grpc.CallOption) (*NodePool, error) { + out := new(NodePool) + err := grpc.Invoke(ctx, "/google.container.v1beta1.ClusterManager/GetNodePool", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) CreateNodePool(ctx context.Context, in *CreateNodePoolRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1beta1.ClusterManager/CreateNodePool", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) DeleteNodePool(ctx context.Context, in *DeleteNodePoolRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1beta1.ClusterManager/DeleteNodePool", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) RollbackNodePoolUpgrade(ctx context.Context, in *RollbackNodePoolUpgradeRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1beta1.ClusterManager/RollbackNodePoolUpgrade", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) SetNodePoolManagement(ctx context.Context, in *SetNodePoolManagementRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1beta1.ClusterManager/SetNodePoolManagement", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) SetLabels(ctx context.Context, in *SetLabelsRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1beta1.ClusterManager/SetLabels", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) SetLegacyAbac(ctx context.Context, in *SetLegacyAbacRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1beta1.ClusterManager/SetLegacyAbac", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) StartIPRotation(ctx context.Context, in *StartIPRotationRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1beta1.ClusterManager/StartIPRotation", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) CompleteIPRotation(ctx context.Context, in *CompleteIPRotationRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1beta1.ClusterManager/CompleteIPRotation", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) SetNetworkPolicy(ctx context.Context, in *SetNetworkPolicyRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1beta1.ClusterManager/SetNetworkPolicy", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterManagerClient) SetMaintenancePolicy(ctx context.Context, in *SetMaintenancePolicyRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.container.v1beta1.ClusterManager/SetMaintenancePolicy", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for ClusterManager service + +type ClusterManagerServer interface { + // Lists all clusters owned by a project in either the specified zone or all + // zones. + ListClusters(context.Context, *ListClustersRequest) (*ListClustersResponse, error) + // Gets the details of a specific cluster. + GetCluster(context.Context, *GetClusterRequest) (*Cluster, error) + // Creates a cluster, consisting of the specified number and type of Google + // Compute Engine instances. + // + // By default, the cluster is created in the project's + // [default network](/compute/docs/networks-and-firewalls#networks). + // + // One firewall is added for the cluster. After cluster creation, + // the cluster creates routes for each node to allow the containers + // on that node to communicate with all other instances in the + // cluster. + // + // Finally, an entry is added to the project's global metadata indicating + // which CIDR range is being used by the cluster. + CreateCluster(context.Context, *CreateClusterRequest) (*Operation, error) + // Updates the settings of a specific cluster. + UpdateCluster(context.Context, *UpdateClusterRequest) (*Operation, error) + // Used to set master auth materials. Currently supports :- + // Changing the admin password of a specific cluster. + // This can be either via password generation or explicitly set. + // Modify basic_auth.csv and reset the K8S API server. + SetMasterAuth(context.Context, *SetMasterAuthRequest) (*Operation, error) + // Deletes the cluster, including the Kubernetes endpoint and all worker + // nodes. + // + // Firewalls and routes that were configured during cluster creation + // are also deleted. + // + // Other Google Compute Engine resources that might be in use by the cluster + // (e.g. load balancer resources) will not be deleted if they weren't present + // at the initial create time. + DeleteCluster(context.Context, *DeleteClusterRequest) (*Operation, error) + // Lists all operations in a project in a specific zone or all zones. + ListOperations(context.Context, *ListOperationsRequest) (*ListOperationsResponse, error) + // Gets the specified operation. + GetOperation(context.Context, *GetOperationRequest) (*Operation, error) + // Cancels the specified operation. + CancelOperation(context.Context, *CancelOperationRequest) (*google_protobuf1.Empty, error) + // Returns configuration info about the Container Engine service. + GetServerConfig(context.Context, *GetServerConfigRequest) (*ServerConfig, error) + // Lists the node pools for a cluster. + ListNodePools(context.Context, *ListNodePoolsRequest) (*ListNodePoolsResponse, error) + // Retrieves the node pool requested. + GetNodePool(context.Context, *GetNodePoolRequest) (*NodePool, error) + // Creates a node pool for a cluster. + CreateNodePool(context.Context, *CreateNodePoolRequest) (*Operation, error) + // Deletes a node pool from a cluster. + DeleteNodePool(context.Context, *DeleteNodePoolRequest) (*Operation, error) + // Roll back the previously Aborted or Failed NodePool upgrade. + // This will be an no-op if the last upgrade successfully completed. + RollbackNodePoolUpgrade(context.Context, *RollbackNodePoolUpgradeRequest) (*Operation, error) + // Sets the NodeManagement options for a node pool. + SetNodePoolManagement(context.Context, *SetNodePoolManagementRequest) (*Operation, error) + // Sets labels on a cluster. + SetLabels(context.Context, *SetLabelsRequest) (*Operation, error) + // Enables or disables the ABAC authorization mechanism on a cluster. + SetLegacyAbac(context.Context, *SetLegacyAbacRequest) (*Operation, error) + // Start master IP rotation. + StartIPRotation(context.Context, *StartIPRotationRequest) (*Operation, error) + // Completes master IP rotation. + CompleteIPRotation(context.Context, *CompleteIPRotationRequest) (*Operation, error) + // Enables/Disables Network Policy for a cluster. + SetNetworkPolicy(context.Context, *SetNetworkPolicyRequest) (*Operation, error) + // Sets the maintenance policy for a cluster. + SetMaintenancePolicy(context.Context, *SetMaintenancePolicyRequest) (*Operation, error) +} + +func RegisterClusterManagerServer(s *grpc.Server, srv ClusterManagerServer) { + s.RegisterService(&_ClusterManager_serviceDesc, srv) +} + +func _ClusterManager_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.(ClusterManagerServer).ListClusters(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1beta1.ClusterManager/ListClusters", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).ListClusters(ctx, req.(*ListClustersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_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.(ClusterManagerServer).GetCluster(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1beta1.ClusterManager/GetCluster", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).GetCluster(ctx, req.(*GetClusterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_CreateCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateClusterRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).CreateCluster(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1beta1.ClusterManager/CreateCluster", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).CreateCluster(ctx, req.(*CreateClusterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_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.(ClusterManagerServer).UpdateCluster(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1beta1.ClusterManager/UpdateCluster", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).UpdateCluster(ctx, req.(*UpdateClusterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_SetMasterAuth_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetMasterAuthRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).SetMasterAuth(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1beta1.ClusterManager/SetMasterAuth", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).SetMasterAuth(ctx, req.(*SetMasterAuthRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_DeleteCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteClusterRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).DeleteCluster(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1beta1.ClusterManager/DeleteCluster", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).DeleteCluster(ctx, req.(*DeleteClusterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_ListOperations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListOperationsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).ListOperations(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1beta1.ClusterManager/ListOperations", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).ListOperations(ctx, req.(*ListOperationsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_GetOperation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetOperationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).GetOperation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1beta1.ClusterManager/GetOperation", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).GetOperation(ctx, req.(*GetOperationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_CancelOperation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CancelOperationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).CancelOperation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1beta1.ClusterManager/CancelOperation", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).CancelOperation(ctx, req.(*CancelOperationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_GetServerConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetServerConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).GetServerConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1beta1.ClusterManager/GetServerConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).GetServerConfig(ctx, req.(*GetServerConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_ListNodePools_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListNodePoolsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).ListNodePools(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1beta1.ClusterManager/ListNodePools", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).ListNodePools(ctx, req.(*ListNodePoolsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_GetNodePool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetNodePoolRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).GetNodePool(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1beta1.ClusterManager/GetNodePool", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).GetNodePool(ctx, req.(*GetNodePoolRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_CreateNodePool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateNodePoolRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).CreateNodePool(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1beta1.ClusterManager/CreateNodePool", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).CreateNodePool(ctx, req.(*CreateNodePoolRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_DeleteNodePool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteNodePoolRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).DeleteNodePool(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1beta1.ClusterManager/DeleteNodePool", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).DeleteNodePool(ctx, req.(*DeleteNodePoolRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_RollbackNodePoolUpgrade_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RollbackNodePoolUpgradeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).RollbackNodePoolUpgrade(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1beta1.ClusterManager/RollbackNodePoolUpgrade", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).RollbackNodePoolUpgrade(ctx, req.(*RollbackNodePoolUpgradeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_SetNodePoolManagement_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetNodePoolManagementRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).SetNodePoolManagement(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1beta1.ClusterManager/SetNodePoolManagement", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).SetNodePoolManagement(ctx, req.(*SetNodePoolManagementRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_SetLabels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetLabelsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).SetLabels(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1beta1.ClusterManager/SetLabels", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).SetLabels(ctx, req.(*SetLabelsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_SetLegacyAbac_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetLegacyAbacRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).SetLegacyAbac(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1beta1.ClusterManager/SetLegacyAbac", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).SetLegacyAbac(ctx, req.(*SetLegacyAbacRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_StartIPRotation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StartIPRotationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).StartIPRotation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1beta1.ClusterManager/StartIPRotation", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).StartIPRotation(ctx, req.(*StartIPRotationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_CompleteIPRotation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CompleteIPRotationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).CompleteIPRotation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1beta1.ClusterManager/CompleteIPRotation", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).CompleteIPRotation(ctx, req.(*CompleteIPRotationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_SetNetworkPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetNetworkPolicyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).SetNetworkPolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1beta1.ClusterManager/SetNetworkPolicy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).SetNetworkPolicy(ctx, req.(*SetNetworkPolicyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ClusterManager_SetMaintenancePolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetMaintenancePolicyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterManagerServer).SetMaintenancePolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.container.v1beta1.ClusterManager/SetMaintenancePolicy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterManagerServer).SetMaintenancePolicy(ctx, req.(*SetMaintenancePolicyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _ClusterManager_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.container.v1beta1.ClusterManager", + HandlerType: (*ClusterManagerServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListClusters", + Handler: _ClusterManager_ListClusters_Handler, + }, + { + MethodName: "GetCluster", + Handler: _ClusterManager_GetCluster_Handler, + }, + { + MethodName: "CreateCluster", + Handler: _ClusterManager_CreateCluster_Handler, + }, + { + MethodName: "UpdateCluster", + Handler: _ClusterManager_UpdateCluster_Handler, + }, + { + MethodName: "SetMasterAuth", + Handler: _ClusterManager_SetMasterAuth_Handler, + }, + { + MethodName: "DeleteCluster", + Handler: _ClusterManager_DeleteCluster_Handler, + }, + { + MethodName: "ListOperations", + Handler: _ClusterManager_ListOperations_Handler, + }, + { + MethodName: "GetOperation", + Handler: _ClusterManager_GetOperation_Handler, + }, + { + MethodName: "CancelOperation", + Handler: _ClusterManager_CancelOperation_Handler, + }, + { + MethodName: "GetServerConfig", + Handler: _ClusterManager_GetServerConfig_Handler, + }, + { + MethodName: "ListNodePools", + Handler: _ClusterManager_ListNodePools_Handler, + }, + { + MethodName: "GetNodePool", + Handler: _ClusterManager_GetNodePool_Handler, + }, + { + MethodName: "CreateNodePool", + Handler: _ClusterManager_CreateNodePool_Handler, + }, + { + MethodName: "DeleteNodePool", + Handler: _ClusterManager_DeleteNodePool_Handler, + }, + { + MethodName: "RollbackNodePoolUpgrade", + Handler: _ClusterManager_RollbackNodePoolUpgrade_Handler, + }, + { + MethodName: "SetNodePoolManagement", + Handler: _ClusterManager_SetNodePoolManagement_Handler, + }, + { + MethodName: "SetLabels", + Handler: _ClusterManager_SetLabels_Handler, + }, + { + MethodName: "SetLegacyAbac", + Handler: _ClusterManager_SetLegacyAbac_Handler, + }, + { + MethodName: "StartIPRotation", + Handler: _ClusterManager_StartIPRotation_Handler, + }, + { + MethodName: "CompleteIPRotation", + Handler: _ClusterManager_CompleteIPRotation_Handler, + }, + { + MethodName: "SetNetworkPolicy", + Handler: _ClusterManager_SetNetworkPolicy_Handler, + }, + { + MethodName: "SetMaintenancePolicy", + Handler: _ClusterManager_SetMaintenancePolicy_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/container/v1beta1/cluster_service.proto", +} + +func init() { proto.RegisterFile("google/container/v1beta1/cluster_service.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 4381 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x7c, 0x5b, 0x6c, 0xe3, 0x56, + 0x7a, 0xf0, 0xd2, 0x17, 0xd9, 0xfa, 0x24, 0xcb, 0xf2, 0xf1, 0x4d, 0x51, 0x26, 0x93, 0x09, 0x93, + 0x4d, 0x26, 0x4e, 0x22, 0xcf, 0x25, 0x99, 0x3f, 0x3b, 0x93, 0xfc, 0xa9, 0x2c, 0x73, 0x6c, 0x75, + 0x6c, 0x49, 0xa5, 0xec, 0x99, 0xcd, 0x34, 0x28, 0x97, 0x26, 0x8f, 0x65, 0xae, 0x29, 0x92, 0x4b, + 0x52, 0x93, 0x78, 0xb6, 0x69, 0xbb, 0xdb, 0xbe, 0xf5, 0xad, 0x05, 0xda, 0x97, 0xa2, 0x01, 0xb6, + 0x40, 0x91, 0xde, 0x80, 0x7d, 0x69, 0x17, 0x2d, 0x50, 0x14, 0x28, 0xd0, 0x97, 0xb6, 0x40, 0xd1, + 0xf6, 0xb1, 0x28, 0xfa, 0xb2, 0xcf, 0x6d, 0x9f, 0x5b, 0x14, 0x28, 0xce, 0x85, 0x14, 0x29, 0x51, + 0x94, 0x6c, 0xaf, 0xd3, 0x7d, 0x13, 0xbf, 0x73, 0xbe, 0xf3, 0x5d, 0xf8, 0xdd, 0x79, 0x6c, 0xa8, + 0x74, 0x6c, 0xbb, 0x63, 0xe2, 0x4d, 0xcd, 0xb6, 0x7c, 0xd5, 0xb0, 0xb0, 0xbb, 0xf9, 0xec, 0xf6, + 0x11, 0xf6, 0xd5, 0xdb, 0x9b, 0x9a, 0xd9, 0xf3, 0x7c, 0xec, 0x2a, 0x1e, 0x76, 0x9f, 0x19, 0x1a, + 0xae, 0x38, 0xae, 0xed, 0xdb, 0xa8, 0xc4, 0xf6, 0x57, 0xc2, 0xfd, 0x15, 0xbe, 0xbf, 0x7c, 0x8d, + 0x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, 0x18, 0x88, 0x54, 0x58, 0xb5, 0xb0, 0xff, 0xa9, 0xed, 0x9e, + 0x2a, 0x8e, 0x6d, 0x1a, 0xda, 0x59, 0x60, 0x85, 0x33, 0xe3, 0x48, 0x34, 0x18, 0x5a, 0x8b, 0x62, + 0x71, 0x0b, 0x5c, 0xb6, 0x86, 0x81, 0xe2, 0x26, 0x2c, 0x0d, 0xa9, 0x97, 0x78, 0x87, 0x6e, 0x78, + 0xea, 0x91, 0x89, 0x75, 0xfe, 0x8e, 0xc3, 0x67, 0xf1, 0x1e, 0x94, 0x46, 0xe9, 0x2a, 0x15, 0xef, + 0x36, 0x2c, 0x27, 0xc8, 0x3d, 0x0e, 0x25, 0x41, 0x8e, 0x54, 0x94, 0x7f, 0x17, 0xe0, 0x7a, 0x3f, + 0x04, 0x10, 0x3e, 0xb1, 0xce, 0xcf, 0x08, 0xac, 0xb0, 0x04, 0x73, 0xd8, 0x8a, 0x62, 0x07, 0x8f, + 0x48, 0x83, 0x9c, 0x66, 0xe8, 0xae, 0x72, 0x64, 0xda, 0xda, 0xa9, 0x57, 0x9a, 0xa2, 0xe1, 0x7c, + 0x6b, 0xb4, 0x92, 0xd3, 0x09, 0x55, 0x6a, 0x86, 0xee, 0x6e, 0x91, 0xa3, 0x64, 0xd0, 0x82, 0x9f, + 0x5e, 0x79, 0x1f, 0xb2, 0xe1, 0x02, 0xa9, 0x0c, 0x74, 0xc3, 0x73, 0x4c, 0xf5, 0x4c, 0x89, 0x84, + 0xa9, 0x1c, 0x87, 0x35, 0x48, 0xa4, 0x22, 0x9e, 0x1b, 0x32, 0xc5, 0x63, 0x55, 0x36, 0x3c, 0x4f, + 0xfc, 0x03, 0x01, 0x16, 0x62, 0x4a, 0x42, 0x7b, 0x30, 0xef, 0xb8, 0xf6, 0x33, 0x43, 0xc7, 0x2e, + 0x3d, 0xaf, 0x90, 0x9a, 0xb4, 0xa3, 0xa8, 0x95, 0x16, 0xc7, 0x93, 0xc3, 0x13, 0xa2, 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xb8, 0x85, 0x8b, 0xff, 0x91, 0x81, 0x6c, 0xd3, 0xc1, 0x2e, 0x55, 0x6c, 0x62, 0x95, 0x1a, 0x24, + 0x81, 0xa9, 0x48, 0x12, 0x68, 0x42, 0xc1, 0x0e, 0x90, 0x98, 0x21, 0x4d, 0x8f, 0x8b, 0x97, 0x21, + 0x91, 0x0a, 0x31, 0x30, 0x79, 0x21, 0xc4, 0xa7, 0xf6, 0xb6, 0x15, 0x06, 0xde, 0x99, 0x71, 0x63, + 0xbd, 0xfe, 0x41, 0x03, 0xa1, 0x77, 0x0d, 0x32, 0x3a, 0xf6, 0x55, 0xc3, 0xe4, 0x56, 0xcd, 0x9f, + 0x12, 0x42, 0xf2, 0x6c, 0x52, 0x48, 0x8e, 0x65, 0xc2, 0xcc, 0x40, 0x26, 0x7c, 0x19, 0x72, 0xbe, + 0xea, 0x76, 0xb0, 0xcf, 0x96, 0x99, 0x97, 0x01, 0x03, 0xd1, 0x0d, 0xd1, 0xa0, 0x97, 0x8d, 0x07, + 0x3d, 0xd2, 0x3f, 0x7b, 0xbe, 0xea, 0xfa, 0x2c, 0x60, 0xb2, 0xe6, 0x24, 0x4b, 0x21, 0x34, 0x5e, + 0xbe, 0x40, 0x33, 0x2a, 0x5b, 0x64, 0xb5, 0xe3, 0x1c, 0xb6, 0x74, 0xb2, 0x24, 0xca, 0x63, 0xc3, + 0x65, 0x0e, 0xe6, 0x5a, 0x52, 0x63, 0x3b, 0x21, 0x52, 0xce, 0xc3, 0xcc, 0x76, 0xb3, 0x21, 0xb1, + 0x10, 0x59, 0xdd, 0x6a, 0xca, 0x07, 0x34, 0x44, 0x8a, 0xff, 0x33, 0x05, 0x33, 0x54, 0xe7, 0x2b, + 0x50, 0x3c, 0xf8, 0xb8, 0x25, 0x0d, 0x1c, 0x88, 0xa0, 0x50, 0x93, 0xa5, 0xea, 0x81, 0xa4, 0xd4, + 0xf6, 0x0e, 0xdb, 0x07, 0x92, 0x5c, 0x14, 0x08, 0x6c, 0x5b, 0xda, 0x93, 0x22, 0xb0, 0x29, 0x02, + 0x3b, 0x6c, 0xed, 0xc8, 0xd5, 0x6d, 0x49, 0xd9, 0xaf, 0x52, 0xd8, 0x34, 0x5a, 0x82, 0x85, 0x00, + 0xd6, 0x68, 0x6e, 0x4b, 0xed, 0xe2, 0x0c, 0xd9, 0x26, 0x4b, 0xad, 0x6a, 0x5d, 0x0e, 0x51, 0x67, + 0x19, 0xea, 0x76, 0x94, 0x44, 0x86, 0x30, 0xc3, 0xc9, 0x12, 0x4c, 0xa5, 0xd5, 0x6c, 0xee, 0x15, + 0xe7, 0x08, 0x94, 0x13, 0xee, 0x43, 0xe7, 0xd1, 0x35, 0x28, 0xb5, 0xa5, 0x83, 0x3e, 0x48, 0xd9, + 0xaf, 0x36, 0xaa, 0x3b, 0xd2, 0xbe, 0xd4, 0x38, 0x28, 0x66, 0xd1, 0x2a, 0x2c, 0x55, 0x0f, 0x0f, + 0x9a, 0x0a, 0x27, 0xcb, 0x18, 0x01, 0xa2, 0x40, 0x0a, 0x8e, 0x33, 0x98, 0x43, 0x05, 0x00, 0x72, + 0xd8, 0x5e, 0x75, 0x4b, 0xda, 0x6b, 0x17, 0xf3, 0x68, 0x19, 0x16, 0xc9, 0x33, 0x93, 0x49, 0xa9, + 0x1e, 0x1e, 0xec, 0x16, 0x17, 0xa8, 0xf6, 0x63, 0x14, 0xdb, 0xf5, 0xa7, 0x52, 0xb1, 0x10, 0xc2, + 0xa5, 0x83, 0x27, 0x4d, 0xf9, 0x91, 0xd2, 0x6a, 0xee, 0xd5, 0x6b, 0x1f, 0x17, 0x17, 0x51, 0x19, + 0xd6, 0xd8, 0x21, 0xf5, 0xc6, 0x81, 0xd4, 0xa8, 0x36, 0x6a, 0x52, 0xb0, 0x56, 0x14, 0x7f, 0x57, + 0x80, 0x95, 0x1a, 0x2d, 0x39, 0x78, 0x76, 0x92, 0xf1, 0x77, 0x7a, 0xd8, 0xf3, 0x89, 0x99, 0x38, + 0xae, 0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57, 0x1f, + 0xaf, 0x4e, 0xeb, 0x1d, 0x58, 0x74, 0xb1, 0x67, 0xf7, 0x5c, 0x0d, 0x2b, 0xfc, 0x0e, 0x2c, 0xbb, + 0x70, 0xfb, 0xff, 0x53, 0x9b, 0xfd, 0x18, 0x5b, 0x15, 0x99, 0x9f, 0x10, 0xbd, 0x11, 0x5b, 0x70, + 0x63, 0x40, 0xf4, 0x16, 0x2c, 0xd1, 0xf3, 0x95, 0x63, 0xc3, 0xea, 0x60, 0xd7, 0x71, 0x8d, 0xb0, + 0xbe, 0x29, 0xd2, 0x85, 0x87, 0x7d, 0x78, 0x92, 0x51, 0x96, 0xab, 0xb0, 0x9c, 0x40, 0xe7, 0x5c, + 0xf7, 0x41, 0x7f, 0x4b, 0xa0, 0xb3, 0x93, 0x3d, 0xdc, 0x51, 0xb5, 0xb3, 0xea, 0x91, 0xaa, 0x5d, + 0x9d, 0x5e, 0x23, 0x46, 0x32, 0x13, 0x37, 0x92, 0x24, 0x2b, 0xfe, 0x25, 0x58, 0xa3, 0xf1, 0xbc, + 0xde, 0x92, 0xf9, 0x35, 0xee, 0xab, 0x1f, 0x3c, 0x44, 0xe9, 0x7f, 0x4f, 0x80, 0x17, 0x6a, 0x76, + 0xd7, 0x21, 0x05, 0xf8, 0x57, 0xc9, 0x43, 0x34, 0xe8, 0x9c, 0xc2, 0xd2, 0xd0, 0x75, 0x65, 0x62, + 0x35, 0x91, 0x0b, 0xcb, 0xdc, 0x5d, 0x08, 0x07, 0xd3, 0x72, 0x51, 0x8d, 0xee, 0x26, 0x8e, 0xf5, + 0x26, 0x44, 0x61, 0xac, 0x2b, 0x63, 0x4c, 0x2d, 0x46, 0xe0, 0xa4, 0xd3, 0x12, 0xff, 0x41, 0x80, + 0x75, 0x12, 0xd4, 0x63, 0x37, 0x0d, 0xae, 0x4c, 0xdc, 0xe1, 0x3b, 0x10, 0x33, 0x97, 0xba, 0x03, + 0x91, 0xf4, 0x0a, 0xff, 0x4d, 0x80, 0x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7f, + 0x03, 0x00, 0x00, 0xff, 0xff, 0x4a, 0x57, 0xdd, 0xd1, 0x5f, 0x41, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/datastore/admin/v1beta1/datastore_admin.pb.go b/vendor/google.golang.org/genproto/googleapis/datastore/admin/v1beta1/datastore_admin.pb.go new file mode 100644 index 0000000000..e9f3136de8 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/datastore/admin/v1beta1/datastore_admin.pb.go @@ -0,0 +1,732 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/datastore/admin/v1beta1/datastore_admin.proto + +/* +Package admin is a generated protocol buffer package. + +It is generated from these files: + google/datastore/admin/v1beta1/datastore_admin.proto + +It has these top-level messages: + CommonMetadata + Progress + ExportEntitiesRequest + ImportEntitiesRequest + ExportEntitiesResponse + ExportEntitiesMetadata + ImportEntitiesMetadata + EntityFilter +*/ +package admin + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_longrunning "google.golang.org/genproto/googleapis/longrunning" +import google_protobuf3 "github.com/golang/protobuf/ptypes/timestamp" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Operation types. +type OperationType int32 + +const ( + // Unspecified. + OperationType_OPERATION_TYPE_UNSPECIFIED OperationType = 0 + // ExportEntities. + OperationType_EXPORT_ENTITIES OperationType = 1 + // ImportEntities. + OperationType_IMPORT_ENTITIES OperationType = 2 +) + +var OperationType_name = map[int32]string{ + 0: "OPERATION_TYPE_UNSPECIFIED", + 1: "EXPORT_ENTITIES", + 2: "IMPORT_ENTITIES", +} +var OperationType_value = map[string]int32{ + "OPERATION_TYPE_UNSPECIFIED": 0, + "EXPORT_ENTITIES": 1, + "IMPORT_ENTITIES": 2, +} + +func (x OperationType) String() string { + return proto.EnumName(OperationType_name, int32(x)) +} +func (OperationType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +// The various possible states for an ongoing Operation. +type CommonMetadata_State int32 + +const ( + // Unspecified. + CommonMetadata_STATE_UNSPECIFIED CommonMetadata_State = 0 + // Request is being prepared for processing. + CommonMetadata_INITIALIZING CommonMetadata_State = 1 + // Request is actively being processed. + CommonMetadata_PROCESSING CommonMetadata_State = 2 + // Request is in the process of being cancelled after user called + // google.longrunning.Operations.CancelOperation on the operation. + CommonMetadata_CANCELLING CommonMetadata_State = 3 + // Request has been processed and is in its finalization stage. + CommonMetadata_FINALIZING CommonMetadata_State = 4 + // Request has completed successfully. + CommonMetadata_SUCCESSFUL CommonMetadata_State = 5 + // Request has finished being processed, but encountered an error. + CommonMetadata_FAILED CommonMetadata_State = 6 + // Request has finished being cancelled after user called + // google.longrunning.Operations.CancelOperation. + CommonMetadata_CANCELLED CommonMetadata_State = 7 +) + +var CommonMetadata_State_name = map[int32]string{ + 0: "STATE_UNSPECIFIED", + 1: "INITIALIZING", + 2: "PROCESSING", + 3: "CANCELLING", + 4: "FINALIZING", + 5: "SUCCESSFUL", + 6: "FAILED", + 7: "CANCELLED", +} +var CommonMetadata_State_value = map[string]int32{ + "STATE_UNSPECIFIED": 0, + "INITIALIZING": 1, + "PROCESSING": 2, + "CANCELLING": 3, + "FINALIZING": 4, + "SUCCESSFUL": 5, + "FAILED": 6, + "CANCELLED": 7, +} + +func (x CommonMetadata_State) String() string { + return proto.EnumName(CommonMetadata_State_name, int32(x)) +} +func (CommonMetadata_State) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 0} } + +// Metadata common to all Datastore Admin operations. +type CommonMetadata struct { + // The time that work began on the operation. + StartTime *google_protobuf3.Timestamp `protobuf:"bytes,1,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + // The time the operation ended, either successfully or otherwise. + EndTime *google_protobuf3.Timestamp `protobuf:"bytes,2,opt,name=end_time,json=endTime" json:"end_time,omitempty"` + // The type of the operation. Can be used as a filter in + // ListOperationsRequest. + OperationType OperationType `protobuf:"varint,3,opt,name=operation_type,json=operationType,enum=google.datastore.admin.v1beta1.OperationType" json:"operation_type,omitempty"` + // The client-assigned labels which were provided when the operation was + // created. May also include additional labels. + Labels map[string]string `protobuf:"bytes,4,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // The current state of the Operation. + State CommonMetadata_State `protobuf:"varint,5,opt,name=state,enum=google.datastore.admin.v1beta1.CommonMetadata_State" json:"state,omitempty"` +} + +func (m *CommonMetadata) Reset() { *m = CommonMetadata{} } +func (m *CommonMetadata) String() string { return proto.CompactTextString(m) } +func (*CommonMetadata) ProtoMessage() {} +func (*CommonMetadata) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *CommonMetadata) GetStartTime() *google_protobuf3.Timestamp { + if m != nil { + return m.StartTime + } + return nil +} + +func (m *CommonMetadata) GetEndTime() *google_protobuf3.Timestamp { + if m != nil { + return m.EndTime + } + return nil +} + +func (m *CommonMetadata) GetOperationType() OperationType { + if m != nil { + return m.OperationType + } + return OperationType_OPERATION_TYPE_UNSPECIFIED +} + +func (m *CommonMetadata) GetLabels() map[string]string { + if m != nil { + return m.Labels + } + return nil +} + +func (m *CommonMetadata) GetState() CommonMetadata_State { + if m != nil { + return m.State + } + return CommonMetadata_STATE_UNSPECIFIED +} + +// Measures the progress of a particular metric. +type Progress struct { + // The amount of work that has been completed. Note that this may be greater + // than work_estimated. + WorkCompleted int64 `protobuf:"varint,1,opt,name=work_completed,json=workCompleted" json:"work_completed,omitempty"` + // An estimate of how much work needs to be performed. May be zero if the + // work estimate is unavailable. + WorkEstimated int64 `protobuf:"varint,2,opt,name=work_estimated,json=workEstimated" json:"work_estimated,omitempty"` +} + +func (m *Progress) Reset() { *m = Progress{} } +func (m *Progress) String() string { return proto.CompactTextString(m) } +func (*Progress) ProtoMessage() {} +func (*Progress) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *Progress) GetWorkCompleted() int64 { + if m != nil { + return m.WorkCompleted + } + return 0 +} + +func (m *Progress) GetWorkEstimated() int64 { + if m != nil { + return m.WorkEstimated + } + return 0 +} + +// The request for +// [google.datastore.admin.v1beta1.DatastoreAdmin.ExportEntities][google.datastore.admin.v1beta1.DatastoreAdmin.ExportEntities]. +type ExportEntitiesRequest struct { + // Project ID against which to make the request. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // Client-assigned labels. + Labels map[string]string `protobuf:"bytes,2,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // Description of what data from the project is included in the export. + EntityFilter *EntityFilter `protobuf:"bytes,3,opt,name=entity_filter,json=entityFilter" json:"entity_filter,omitempty"` + // Location for the export metadata and data files. + // + // The full resource URL of the external storage location. Currently, only + // Google Cloud Storage is supported. So output_url_prefix should be of the + // form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the + // name of the Cloud Storage bucket and `NAMESPACE_PATH` is an optional Cloud + // Storage namespace path (this is not a Cloud Datastore namespace). For more + // information about Cloud Storage namespace paths, see + // [Object name + // considerations](https://cloud.google.com/storage/docs/naming#object-considerations). + // + // The resulting files will be nested deeper than the specified URL prefix. + // The final output URL will be provided in the + // [google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url][google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url] + // field. That value should be used for subsequent ImportEntities operations. + // + // By nesting the data files deeper, the same Cloud Storage bucket can be used + // in multiple ExportEntities operations without conflict. + OutputUrlPrefix string `protobuf:"bytes,4,opt,name=output_url_prefix,json=outputUrlPrefix" json:"output_url_prefix,omitempty"` +} + +func (m *ExportEntitiesRequest) Reset() { *m = ExportEntitiesRequest{} } +func (m *ExportEntitiesRequest) String() string { return proto.CompactTextString(m) } +func (*ExportEntitiesRequest) ProtoMessage() {} +func (*ExportEntitiesRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *ExportEntitiesRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *ExportEntitiesRequest) GetLabels() map[string]string { + if m != nil { + return m.Labels + } + return nil +} + +func (m *ExportEntitiesRequest) GetEntityFilter() *EntityFilter { + if m != nil { + return m.EntityFilter + } + return nil +} + +func (m *ExportEntitiesRequest) GetOutputUrlPrefix() string { + if m != nil { + return m.OutputUrlPrefix + } + return "" +} + +// The request for +// [google.datastore.admin.v1beta1.DatastoreAdmin.ImportEntities][google.datastore.admin.v1beta1.DatastoreAdmin.ImportEntities]. +type ImportEntitiesRequest struct { + // Project ID against which to make the request. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // Client-assigned labels. + Labels map[string]string `protobuf:"bytes,2,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // The full resource URL of the external storage location. Currently, only + // Google Cloud Storage is supported. So input_url should be of the form: + // `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where + // `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is + // an optional Cloud Storage namespace path (this is not a Cloud Datastore + // namespace), and `OVERALL_EXPORT_METADATA_FILE` is the metadata file written + // by the ExportEntities operation. For more information about Cloud Storage + // namespace paths, see + // [Object name + // considerations](https://cloud.google.com/storage/docs/naming#object-considerations). + // + // For more information, see + // [google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url][google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url]. + InputUrl string `protobuf:"bytes,3,opt,name=input_url,json=inputUrl" json:"input_url,omitempty"` + // Optionally specify which kinds/namespaces are to be imported. If provided, + // the list must be a subset of the EntityFilter used in creating the export, + // otherwise a FAILED_PRECONDITION error will be returned. If no filter is + // specified then all entities from the export are imported. + EntityFilter *EntityFilter `protobuf:"bytes,4,opt,name=entity_filter,json=entityFilter" json:"entity_filter,omitempty"` +} + +func (m *ImportEntitiesRequest) Reset() { *m = ImportEntitiesRequest{} } +func (m *ImportEntitiesRequest) String() string { return proto.CompactTextString(m) } +func (*ImportEntitiesRequest) ProtoMessage() {} +func (*ImportEntitiesRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *ImportEntitiesRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *ImportEntitiesRequest) GetLabels() map[string]string { + if m != nil { + return m.Labels + } + return nil +} + +func (m *ImportEntitiesRequest) GetInputUrl() string { + if m != nil { + return m.InputUrl + } + return "" +} + +func (m *ImportEntitiesRequest) GetEntityFilter() *EntityFilter { + if m != nil { + return m.EntityFilter + } + return nil +} + +// The response for +// [google.datastore.admin.v1beta1.DatastoreAdmin.ExportEntities][google.datastore.admin.v1beta1.DatastoreAdmin.ExportEntities]. +type ExportEntitiesResponse struct { + // Location of the output metadata file. This can be used to begin an import + // into Cloud Datastore (this project or another project). See + // [google.datastore.admin.v1beta1.ImportEntitiesRequest.input_url][google.datastore.admin.v1beta1.ImportEntitiesRequest.input_url]. + // Only present if the operation completed successfully. + OutputUrl string `protobuf:"bytes,1,opt,name=output_url,json=outputUrl" json:"output_url,omitempty"` +} + +func (m *ExportEntitiesResponse) Reset() { *m = ExportEntitiesResponse{} } +func (m *ExportEntitiesResponse) String() string { return proto.CompactTextString(m) } +func (*ExportEntitiesResponse) ProtoMessage() {} +func (*ExportEntitiesResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *ExportEntitiesResponse) GetOutputUrl() string { + if m != nil { + return m.OutputUrl + } + return "" +} + +// Metadata for ExportEntities operations. +type ExportEntitiesMetadata struct { + // Metadata common to all Datastore Admin operations. + Common *CommonMetadata `protobuf:"bytes,1,opt,name=common" json:"common,omitempty"` + // An estimate of the number of entities processed. + ProgressEntities *Progress `protobuf:"bytes,2,opt,name=progress_entities,json=progressEntities" json:"progress_entities,omitempty"` + // An estimate of the number of bytes processed. + ProgressBytes *Progress `protobuf:"bytes,3,opt,name=progress_bytes,json=progressBytes" json:"progress_bytes,omitempty"` + // Description of which entities are being exported. + EntityFilter *EntityFilter `protobuf:"bytes,4,opt,name=entity_filter,json=entityFilter" json:"entity_filter,omitempty"` + // Location for the export metadata and data files. This will be the same + // value as the + // [google.datastore.admin.v1beta1.ExportEntitiesRequest.output_url_prefix][google.datastore.admin.v1beta1.ExportEntitiesRequest.output_url_prefix] + // field. The final output location is provided in + // [google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url][google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url]. + OutputUrlPrefix string `protobuf:"bytes,5,opt,name=output_url_prefix,json=outputUrlPrefix" json:"output_url_prefix,omitempty"` +} + +func (m *ExportEntitiesMetadata) Reset() { *m = ExportEntitiesMetadata{} } +func (m *ExportEntitiesMetadata) String() string { return proto.CompactTextString(m) } +func (*ExportEntitiesMetadata) ProtoMessage() {} +func (*ExportEntitiesMetadata) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *ExportEntitiesMetadata) GetCommon() *CommonMetadata { + if m != nil { + return m.Common + } + return nil +} + +func (m *ExportEntitiesMetadata) GetProgressEntities() *Progress { + if m != nil { + return m.ProgressEntities + } + return nil +} + +func (m *ExportEntitiesMetadata) GetProgressBytes() *Progress { + if m != nil { + return m.ProgressBytes + } + return nil +} + +func (m *ExportEntitiesMetadata) GetEntityFilter() *EntityFilter { + if m != nil { + return m.EntityFilter + } + return nil +} + +func (m *ExportEntitiesMetadata) GetOutputUrlPrefix() string { + if m != nil { + return m.OutputUrlPrefix + } + return "" +} + +// Metadata for ImportEntities operations. +type ImportEntitiesMetadata struct { + // Metadata common to all Datastore Admin operations. + Common *CommonMetadata `protobuf:"bytes,1,opt,name=common" json:"common,omitempty"` + // An estimate of the number of entities processed. + ProgressEntities *Progress `protobuf:"bytes,2,opt,name=progress_entities,json=progressEntities" json:"progress_entities,omitempty"` + // An estimate of the number of bytes processed. + ProgressBytes *Progress `protobuf:"bytes,3,opt,name=progress_bytes,json=progressBytes" json:"progress_bytes,omitempty"` + // Description of which entities are being imported. + EntityFilter *EntityFilter `protobuf:"bytes,4,opt,name=entity_filter,json=entityFilter" json:"entity_filter,omitempty"` + // The location of the import metadata file. This will be the same value as + // the [google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url][google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url] + // field. + InputUrl string `protobuf:"bytes,5,opt,name=input_url,json=inputUrl" json:"input_url,omitempty"` +} + +func (m *ImportEntitiesMetadata) Reset() { *m = ImportEntitiesMetadata{} } +func (m *ImportEntitiesMetadata) String() string { return proto.CompactTextString(m) } +func (*ImportEntitiesMetadata) ProtoMessage() {} +func (*ImportEntitiesMetadata) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *ImportEntitiesMetadata) GetCommon() *CommonMetadata { + if m != nil { + return m.Common + } + return nil +} + +func (m *ImportEntitiesMetadata) GetProgressEntities() *Progress { + if m != nil { + return m.ProgressEntities + } + return nil +} + +func (m *ImportEntitiesMetadata) GetProgressBytes() *Progress { + if m != nil { + return m.ProgressBytes + } + return nil +} + +func (m *ImportEntitiesMetadata) GetEntityFilter() *EntityFilter { + if m != nil { + return m.EntityFilter + } + return nil +} + +func (m *ImportEntitiesMetadata) GetInputUrl() string { + if m != nil { + return m.InputUrl + } + return "" +} + +// Identifies a subset of entities in a project. This is specified as +// combinations of kinds and namespaces (either or both of which may be all, as +// described in the following examples). +// Example usage: +// +// Entire project: +// kinds=[], namespace_ids=[] +// +// Kinds Foo and Bar in all namespaces: +// kinds=['Foo', 'Bar'], namespace_ids=[] +// +// Kinds Foo and Bar only in the default namespace: +// kinds=['Foo', 'Bar'], namespace_ids=[''] +// +// Kinds Foo and Bar in both the default and Baz namespaces: +// kinds=['Foo', 'Bar'], namespace_ids=['', 'Baz'] +// +// The entire Baz namespace: +// kinds=[], namespace_ids=['Baz'] +type EntityFilter struct { + // If empty, then this represents all kinds. + Kinds []string `protobuf:"bytes,1,rep,name=kinds" json:"kinds,omitempty"` + // An empty list represents all namespaces. This is the preferred + // usage for projects that don't use namespaces. + // + // An empty string element represents the default namespace. This should be + // used if the project has data in non-default namespaces, but doesn't want to + // include them. + // Each namespace in this list must be unique. + NamespaceIds []string `protobuf:"bytes,2,rep,name=namespace_ids,json=namespaceIds" json:"namespace_ids,omitempty"` +} + +func (m *EntityFilter) Reset() { *m = EntityFilter{} } +func (m *EntityFilter) String() string { return proto.CompactTextString(m) } +func (*EntityFilter) ProtoMessage() {} +func (*EntityFilter) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *EntityFilter) GetKinds() []string { + if m != nil { + return m.Kinds + } + return nil +} + +func (m *EntityFilter) GetNamespaceIds() []string { + if m != nil { + return m.NamespaceIds + } + return nil +} + +func init() { + proto.RegisterType((*CommonMetadata)(nil), "google.datastore.admin.v1beta1.CommonMetadata") + proto.RegisterType((*Progress)(nil), "google.datastore.admin.v1beta1.Progress") + proto.RegisterType((*ExportEntitiesRequest)(nil), "google.datastore.admin.v1beta1.ExportEntitiesRequest") + proto.RegisterType((*ImportEntitiesRequest)(nil), "google.datastore.admin.v1beta1.ImportEntitiesRequest") + proto.RegisterType((*ExportEntitiesResponse)(nil), "google.datastore.admin.v1beta1.ExportEntitiesResponse") + proto.RegisterType((*ExportEntitiesMetadata)(nil), "google.datastore.admin.v1beta1.ExportEntitiesMetadata") + proto.RegisterType((*ImportEntitiesMetadata)(nil), "google.datastore.admin.v1beta1.ImportEntitiesMetadata") + proto.RegisterType((*EntityFilter)(nil), "google.datastore.admin.v1beta1.EntityFilter") + proto.RegisterEnum("google.datastore.admin.v1beta1.OperationType", OperationType_name, OperationType_value) + proto.RegisterEnum("google.datastore.admin.v1beta1.CommonMetadata_State", CommonMetadata_State_name, CommonMetadata_State_value) +} + +// 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 + +// Client API for DatastoreAdmin service + +type DatastoreAdminClient interface { + // Exports a copy of all or a subset of entities from Google Cloud Datastore + // to another storage system, such as Google Cloud Storage. Recent updates to + // entities may not be reflected in the export. The export occurs in the + // background and its progress can be monitored and managed via the + // Operation resource that is created. The output of an export may only be + // used once the associated operation is done. If an export operation is + // cancelled before completion it may leave partial data behind in Google + // Cloud Storage. + ExportEntities(ctx context.Context, in *ExportEntitiesRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Imports entities into Google Cloud Datastore. Existing entities with the + // same key are overwritten. The import occurs in the background and its + // progress can be monitored and managed via the Operation resource that is + // created. If an ImportEntities operation is cancelled, it is possible + // that a subset of the data has already been imported to Cloud Datastore. + ImportEntities(ctx context.Context, in *ImportEntitiesRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) +} + +type datastoreAdminClient struct { + cc *grpc.ClientConn +} + +func NewDatastoreAdminClient(cc *grpc.ClientConn) DatastoreAdminClient { + return &datastoreAdminClient{cc} +} + +func (c *datastoreAdminClient) ExportEntities(ctx context.Context, in *ExportEntitiesRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.datastore.admin.v1beta1.DatastoreAdmin/ExportEntities", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *datastoreAdminClient) ImportEntities(ctx context.Context, in *ImportEntitiesRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.datastore.admin.v1beta1.DatastoreAdmin/ImportEntities", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for DatastoreAdmin service + +type DatastoreAdminServer interface { + // Exports a copy of all or a subset of entities from Google Cloud Datastore + // to another storage system, such as Google Cloud Storage. Recent updates to + // entities may not be reflected in the export. The export occurs in the + // background and its progress can be monitored and managed via the + // Operation resource that is created. The output of an export may only be + // used once the associated operation is done. If an export operation is + // cancelled before completion it may leave partial data behind in Google + // Cloud Storage. + ExportEntities(context.Context, *ExportEntitiesRequest) (*google_longrunning.Operation, error) + // Imports entities into Google Cloud Datastore. Existing entities with the + // same key are overwritten. The import occurs in the background and its + // progress can be monitored and managed via the Operation resource that is + // created. If an ImportEntities operation is cancelled, it is possible + // that a subset of the data has already been imported to Cloud Datastore. + ImportEntities(context.Context, *ImportEntitiesRequest) (*google_longrunning.Operation, error) +} + +func RegisterDatastoreAdminServer(s *grpc.Server, srv DatastoreAdminServer) { + s.RegisterService(&_DatastoreAdmin_serviceDesc, srv) +} + +func _DatastoreAdmin_ExportEntities_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ExportEntitiesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DatastoreAdminServer).ExportEntities(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.datastore.admin.v1beta1.DatastoreAdmin/ExportEntities", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DatastoreAdminServer).ExportEntities(ctx, req.(*ExportEntitiesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DatastoreAdmin_ImportEntities_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ImportEntitiesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DatastoreAdminServer).ImportEntities(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.datastore.admin.v1beta1.DatastoreAdmin/ImportEntities", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DatastoreAdminServer).ImportEntities(ctx, req.(*ImportEntitiesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _DatastoreAdmin_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.datastore.admin.v1beta1.DatastoreAdmin", + HandlerType: (*DatastoreAdminServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ExportEntities", + Handler: _DatastoreAdmin_ExportEntities_Handler, + }, + { + MethodName: "ImportEntities", + Handler: _DatastoreAdmin_ImportEntities_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/datastore/admin/v1beta1/datastore_admin.proto", +} + +func init() { + proto.RegisterFile("google/datastore/admin/v1beta1/datastore_admin.proto", fileDescriptor0) +} + +var fileDescriptor0 = []byte{ + // 996 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x56, 0x41, 0x8f, 0xdb, 0x44, + 0x14, 0xc6, 0xce, 0x26, 0x6d, 0xde, 0x6e, 0xd2, 0xec, 0x94, 0xad, 0xa2, 0x40, 0xcb, 0xca, 0xa5, + 0xd2, 0x6a, 0x05, 0x0e, 0x1b, 0x5a, 0x41, 0x97, 0x53, 0x36, 0xeb, 0x54, 0x46, 0x69, 0x12, 0x1c, + 0x07, 0x75, 0x7b, 0xb1, 0x9c, 0x78, 0x36, 0x32, 0x6b, 0x7b, 0x8c, 0x3d, 0x29, 0x8d, 0x10, 0x17, + 0x2e, 0x1c, 0x38, 0x72, 0xe1, 0x1f, 0x20, 0xf1, 0x1b, 0xb8, 0x70, 0xe1, 0xc2, 0x91, 0xbf, 0xc0, + 0x8f, 0xe0, 0x88, 0x66, 0x3c, 0x76, 0xe2, 0x25, 0x10, 0xca, 0x16, 0x4e, 0xdc, 0xfc, 0xde, 0xbc, + 0xef, 0x9b, 0x37, 0xdf,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5, 0x24, 0xe6, 0xd4, 0x1f, + 0xe7, 0x9d, 0x72, 0xeb, 0x27, 0x19, 0xaa, 0xa7, 0xe9, 0xc9, 0xdb, 0xec, 0xe0, 0xe8, 0x5b, 0x09, + 0xaa, 0xf9, 0xee, 0x45, 0x0f, 0xfe, 0xd1, 0xdf, 0xa4, 0x71, 0x3b, 0x85, 0xad, 0x3c, 0xd9, 0x96, + 0x4f, 0x18, 0xe5, 0x9d, 0x2f, 0x7f, 0xf9, 0xf5, 0x1b, 0xf9, 0x50, 0xb9, 0x97, 0x3d, 0x1b, 0xc5, + 0x04, 0x8e, 0x9b, 0x9f, 0x2f, 0xa7, 0xf3, 0x17, 0xc7, 0x98, 0x93, 0x1f, 0x4b, 0x87, 0x3c, 0xb5, + 0xfc, 0x75, 0xde, 0x9c, 0xda, 0xda, 0xd1, 0xfc, 0xb2, 0x52, 0x73, 0x7d, 0x91, 0xda, 0xc9, 0x77, + 0x12, 0x28, 0x53, 0xe2, 0x6f, 0xc8, 0xe6, 0xe4, 0x66, 0x5e, 0xec, 0x21, 0x7b, 0x24, 0x0e, 0xa5, + 0xa7, 0x1d, 0x01, 0x9b, 0x11, 0xcf, 0x0e, 0x66, 0x2a, 0x89, 0x66, 0xcd, 0x19, 0x0e, 0xf8, 0x13, + 0xb2, 0x99, 0x2c, 0xd9, 0xa1, 0x1b, 0xff, 0xd9, 0x73, 0xfb, 0x03, 0x6e, 0x7d, 0x2f, 0xbf, 0xf9, + 0x28, 0x61, 0xe9, 0x78, 0x64, 0xee, 0xa8, 0xd9, 0x4e, 0x2a, 0xdf, 0x4a, 0xfd, 0xf8, 0xe8, 0x84, + 0x05, 0x4f, 0x4a, 0x9c, 0xf6, 0xdd, 0xdf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x77, 0x71, 0x2d, 0x88, + 0xc4, 0x0b, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/datastore/v1/datastore.pb.go b/vendor/google.golang.org/genproto/googleapis/datastore/v1/datastore.pb.go new file mode 100644 index 0000000000..a62c12eaf1 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/datastore/v1/datastore.pb.go @@ -0,0 +1,1692 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/datastore/v1/datastore.proto + +/* +Package datastore is a generated protocol buffer package. + +It is generated from these files: + google/datastore/v1/datastore.proto + google/datastore/v1/entity.proto + google/datastore/v1/query.proto + +It has these top-level messages: + LookupRequest + LookupResponse + RunQueryRequest + RunQueryResponse + BeginTransactionRequest + BeginTransactionResponse + RollbackRequest + RollbackResponse + CommitRequest + CommitResponse + AllocateIdsRequest + AllocateIdsResponse + ReserveIdsRequest + ReserveIdsResponse + Mutation + MutationResult + ReadOptions + TransactionOptions + PartitionId + Key + ArrayValue + Value + Entity + EntityResult + Query + KindExpression + PropertyReference + Projection + PropertyOrder + Filter + CompositeFilter + PropertyFilter + GqlQuery + GqlQueryParameter + QueryResultBatch +*/ +package datastore + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// The modes available for commits. +type CommitRequest_Mode int32 + +const ( + // Unspecified. This value must not be used. + CommitRequest_MODE_UNSPECIFIED CommitRequest_Mode = 0 + // Transactional: The mutations are either all applied, or none are applied. + // Learn about transactions [here](https://cloud.google.com/datastore/docs/concepts/transactions). + CommitRequest_TRANSACTIONAL CommitRequest_Mode = 1 + // Non-transactional: The mutations may not apply as all or none. + CommitRequest_NON_TRANSACTIONAL CommitRequest_Mode = 2 +) + +var CommitRequest_Mode_name = map[int32]string{ + 0: "MODE_UNSPECIFIED", + 1: "TRANSACTIONAL", + 2: "NON_TRANSACTIONAL", +} +var CommitRequest_Mode_value = map[string]int32{ + "MODE_UNSPECIFIED": 0, + "TRANSACTIONAL": 1, + "NON_TRANSACTIONAL": 2, +} + +func (x CommitRequest_Mode) String() string { + return proto.EnumName(CommitRequest_Mode_name, int32(x)) +} +func (CommitRequest_Mode) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{8, 0} } + +// The possible values for read consistencies. +type ReadOptions_ReadConsistency int32 + +const ( + // Unspecified. This value must not be used. + ReadOptions_READ_CONSISTENCY_UNSPECIFIED ReadOptions_ReadConsistency = 0 + // Strong consistency. + ReadOptions_STRONG ReadOptions_ReadConsistency = 1 + // Eventual consistency. + ReadOptions_EVENTUAL ReadOptions_ReadConsistency = 2 +) + +var ReadOptions_ReadConsistency_name = map[int32]string{ + 0: "READ_CONSISTENCY_UNSPECIFIED", + 1: "STRONG", + 2: "EVENTUAL", +} +var ReadOptions_ReadConsistency_value = map[string]int32{ + "READ_CONSISTENCY_UNSPECIFIED": 0, + "STRONG": 1, + "EVENTUAL": 2, +} + +func (x ReadOptions_ReadConsistency) String() string { + return proto.EnumName(ReadOptions_ReadConsistency_name, int32(x)) +} +func (ReadOptions_ReadConsistency) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{16, 0} +} + +// The request for [Datastore.Lookup][google.datastore.v1.Datastore.Lookup]. +type LookupRequest struct { + // The ID of the project against which to make the request. + ProjectId string `protobuf:"bytes,8,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The options for this lookup request. + ReadOptions *ReadOptions `protobuf:"bytes,1,opt,name=read_options,json=readOptions" json:"read_options,omitempty"` + // Keys of entities to look up. + Keys []*Key `protobuf:"bytes,3,rep,name=keys" json:"keys,omitempty"` +} + +func (m *LookupRequest) Reset() { *m = LookupRequest{} } +func (m *LookupRequest) String() string { return proto.CompactTextString(m) } +func (*LookupRequest) ProtoMessage() {} +func (*LookupRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *LookupRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *LookupRequest) GetReadOptions() *ReadOptions { + if m != nil { + return m.ReadOptions + } + return nil +} + +func (m *LookupRequest) GetKeys() []*Key { + if m != nil { + return m.Keys + } + return nil +} + +// The response for [Datastore.Lookup][google.datastore.v1.Datastore.Lookup]. +type LookupResponse struct { + // Entities found as `ResultType.FULL` entities. The order of results in this + // field is undefined and has no relation to the order of the keys in the + // input. + Found []*EntityResult `protobuf:"bytes,1,rep,name=found" json:"found,omitempty"` + // Entities not found as `ResultType.KEY_ONLY` entities. The order of results + // in this field is undefined and has no relation to the order of the keys + // in the input. + Missing []*EntityResult `protobuf:"bytes,2,rep,name=missing" json:"missing,omitempty"` + // A list of keys that were not looked up due to resource constraints. The + // order of results in this field is undefined and has no relation to the + // order of the keys in the input. + Deferred []*Key `protobuf:"bytes,3,rep,name=deferred" json:"deferred,omitempty"` +} + +func (m *LookupResponse) Reset() { *m = LookupResponse{} } +func (m *LookupResponse) String() string { return proto.CompactTextString(m) } +func (*LookupResponse) ProtoMessage() {} +func (*LookupResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *LookupResponse) GetFound() []*EntityResult { + if m != nil { + return m.Found + } + return nil +} + +func (m *LookupResponse) GetMissing() []*EntityResult { + if m != nil { + return m.Missing + } + return nil +} + +func (m *LookupResponse) GetDeferred() []*Key { + if m != nil { + return m.Deferred + } + return nil +} + +// The request for [Datastore.RunQuery][google.datastore.v1.Datastore.RunQuery]. +type RunQueryRequest struct { + // The ID of the project against which to make the request. + ProjectId string `protobuf:"bytes,8,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // Entities are partitioned into subsets, identified by a partition ID. + // Queries are scoped to a single partition. + // This partition ID is normalized with the standard default context + // partition ID. + PartitionId *PartitionId `protobuf:"bytes,2,opt,name=partition_id,json=partitionId" json:"partition_id,omitempty"` + // The options for this query. + ReadOptions *ReadOptions `protobuf:"bytes,1,opt,name=read_options,json=readOptions" json:"read_options,omitempty"` + // The type of query. + // + // Types that are valid to be assigned to QueryType: + // *RunQueryRequest_Query + // *RunQueryRequest_GqlQuery + QueryType isRunQueryRequest_QueryType `protobuf_oneof:"query_type"` +} + +func (m *RunQueryRequest) Reset() { *m = RunQueryRequest{} } +func (m *RunQueryRequest) String() string { return proto.CompactTextString(m) } +func (*RunQueryRequest) ProtoMessage() {} +func (*RunQueryRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +type isRunQueryRequest_QueryType interface { + isRunQueryRequest_QueryType() +} + +type RunQueryRequest_Query struct { + Query *Query `protobuf:"bytes,3,opt,name=query,oneof"` +} +type RunQueryRequest_GqlQuery struct { + GqlQuery *GqlQuery `protobuf:"bytes,7,opt,name=gql_query,json=gqlQuery,oneof"` +} + +func (*RunQueryRequest_Query) isRunQueryRequest_QueryType() {} +func (*RunQueryRequest_GqlQuery) isRunQueryRequest_QueryType() {} + +func (m *RunQueryRequest) GetQueryType() isRunQueryRequest_QueryType { + if m != nil { + return m.QueryType + } + return nil +} + +func (m *RunQueryRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *RunQueryRequest) GetPartitionId() *PartitionId { + if m != nil { + return m.PartitionId + } + return nil +} + +func (m *RunQueryRequest) GetReadOptions() *ReadOptions { + if m != nil { + return m.ReadOptions + } + return nil +} + +func (m *RunQueryRequest) GetQuery() *Query { + if x, ok := m.GetQueryType().(*RunQueryRequest_Query); ok { + return x.Query + } + return nil +} + +func (m *RunQueryRequest) GetGqlQuery() *GqlQuery { + if x, ok := m.GetQueryType().(*RunQueryRequest_GqlQuery); ok { + return x.GqlQuery + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*RunQueryRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _RunQueryRequest_OneofMarshaler, _RunQueryRequest_OneofUnmarshaler, _RunQueryRequest_OneofSizer, []interface{}{ + (*RunQueryRequest_Query)(nil), + (*RunQueryRequest_GqlQuery)(nil), + } +} + +func _RunQueryRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*RunQueryRequest) + // query_type + switch x := m.QueryType.(type) { + case *RunQueryRequest_Query: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Query); err != nil { + return err + } + case *RunQueryRequest_GqlQuery: + b.EncodeVarint(7<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.GqlQuery); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("RunQueryRequest.QueryType has unexpected type %T", x) + } + return nil +} + +func _RunQueryRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*RunQueryRequest) + switch tag { + case 3: // query_type.query + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Query) + err := b.DecodeMessage(msg) + m.QueryType = &RunQueryRequest_Query{msg} + return true, err + case 7: // query_type.gql_query + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(GqlQuery) + err := b.DecodeMessage(msg) + m.QueryType = &RunQueryRequest_GqlQuery{msg} + return true, err + default: + return false, nil + } +} + +func _RunQueryRequest_OneofSizer(msg proto.Message) (n int) { + m := msg.(*RunQueryRequest) + // query_type + switch x := m.QueryType.(type) { + case *RunQueryRequest_Query: + s := proto.Size(x.Query) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *RunQueryRequest_GqlQuery: + s := proto.Size(x.GqlQuery) + n += proto.SizeVarint(7<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// The response for [Datastore.RunQuery][google.datastore.v1.Datastore.RunQuery]. +type RunQueryResponse struct { + // A batch of query results (always present). + Batch *QueryResultBatch `protobuf:"bytes,1,opt,name=batch" json:"batch,omitempty"` + // The parsed form of the `GqlQuery` from the request, if it was set. + Query *Query `protobuf:"bytes,2,opt,name=query" json:"query,omitempty"` +} + +func (m *RunQueryResponse) Reset() { *m = RunQueryResponse{} } +func (m *RunQueryResponse) String() string { return proto.CompactTextString(m) } +func (*RunQueryResponse) ProtoMessage() {} +func (*RunQueryResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *RunQueryResponse) GetBatch() *QueryResultBatch { + if m != nil { + return m.Batch + } + return nil +} + +func (m *RunQueryResponse) GetQuery() *Query { + if m != nil { + return m.Query + } + return nil +} + +// The request for [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction]. +type BeginTransactionRequest struct { + // The ID of the project against which to make the request. + ProjectId string `protobuf:"bytes,8,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // Options for a new transaction. + TransactionOptions *TransactionOptions `protobuf:"bytes,10,opt,name=transaction_options,json=transactionOptions" json:"transaction_options,omitempty"` +} + +func (m *BeginTransactionRequest) Reset() { *m = BeginTransactionRequest{} } +func (m *BeginTransactionRequest) String() string { return proto.CompactTextString(m) } +func (*BeginTransactionRequest) ProtoMessage() {} +func (*BeginTransactionRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *BeginTransactionRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *BeginTransactionRequest) GetTransactionOptions() *TransactionOptions { + if m != nil { + return m.TransactionOptions + } + return nil +} + +// The response for [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction]. +type BeginTransactionResponse struct { + // The transaction identifier (always present). + Transaction []byte `protobuf:"bytes,1,opt,name=transaction,proto3" json:"transaction,omitempty"` +} + +func (m *BeginTransactionResponse) Reset() { *m = BeginTransactionResponse{} } +func (m *BeginTransactionResponse) String() string { return proto.CompactTextString(m) } +func (*BeginTransactionResponse) ProtoMessage() {} +func (*BeginTransactionResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *BeginTransactionResponse) GetTransaction() []byte { + if m != nil { + return m.Transaction + } + return nil +} + +// The request for [Datastore.Rollback][google.datastore.v1.Datastore.Rollback]. +type RollbackRequest struct { + // The ID of the project against which to make the request. + ProjectId string `protobuf:"bytes,8,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The transaction identifier, returned by a call to + // [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction]. + Transaction []byte `protobuf:"bytes,1,opt,name=transaction,proto3" json:"transaction,omitempty"` +} + +func (m *RollbackRequest) Reset() { *m = RollbackRequest{} } +func (m *RollbackRequest) String() string { return proto.CompactTextString(m) } +func (*RollbackRequest) ProtoMessage() {} +func (*RollbackRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *RollbackRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *RollbackRequest) GetTransaction() []byte { + if m != nil { + return m.Transaction + } + return nil +} + +// The response for [Datastore.Rollback][google.datastore.v1.Datastore.Rollback]. +// (an empty message). +type RollbackResponse struct { +} + +func (m *RollbackResponse) Reset() { *m = RollbackResponse{} } +func (m *RollbackResponse) String() string { return proto.CompactTextString(m) } +func (*RollbackResponse) ProtoMessage() {} +func (*RollbackResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +// The request for [Datastore.Commit][google.datastore.v1.Datastore.Commit]. +type CommitRequest struct { + // The ID of the project against which to make the request. + ProjectId string `protobuf:"bytes,8,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The type of commit to perform. Defaults to `TRANSACTIONAL`. + Mode CommitRequest_Mode `protobuf:"varint,5,opt,name=mode,enum=google.datastore.v1.CommitRequest_Mode" json:"mode,omitempty"` + // Must be set when mode is `TRANSACTIONAL`. + // + // Types that are valid to be assigned to TransactionSelector: + // *CommitRequest_Transaction + TransactionSelector isCommitRequest_TransactionSelector `protobuf_oneof:"transaction_selector"` + // The mutations to perform. + // + // When mode is `TRANSACTIONAL`, mutations affecting a single entity are + // applied in order. The following sequences of mutations affecting a single + // entity are not permitted in a single `Commit` request: + // + // - `insert` followed by `insert` + // - `update` followed by `insert` + // - `upsert` followed by `insert` + // - `delete` followed by `update` + // + // When mode is `NON_TRANSACTIONAL`, no two mutations may affect a single + // entity. + Mutations []*Mutation `protobuf:"bytes,6,rep,name=mutations" json:"mutations,omitempty"` +} + +func (m *CommitRequest) Reset() { *m = CommitRequest{} } +func (m *CommitRequest) String() string { return proto.CompactTextString(m) } +func (*CommitRequest) ProtoMessage() {} +func (*CommitRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +type isCommitRequest_TransactionSelector interface { + isCommitRequest_TransactionSelector() +} + +type CommitRequest_Transaction struct { + Transaction []byte `protobuf:"bytes,1,opt,name=transaction,proto3,oneof"` +} + +func (*CommitRequest_Transaction) isCommitRequest_TransactionSelector() {} + +func (m *CommitRequest) GetTransactionSelector() isCommitRequest_TransactionSelector { + if m != nil { + return m.TransactionSelector + } + return nil +} + +func (m *CommitRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *CommitRequest) GetMode() CommitRequest_Mode { + if m != nil { + return m.Mode + } + return CommitRequest_MODE_UNSPECIFIED +} + +func (m *CommitRequest) GetTransaction() []byte { + if x, ok := m.GetTransactionSelector().(*CommitRequest_Transaction); ok { + return x.Transaction + } + return nil +} + +func (m *CommitRequest) GetMutations() []*Mutation { + if m != nil { + return m.Mutations + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*CommitRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _CommitRequest_OneofMarshaler, _CommitRequest_OneofUnmarshaler, _CommitRequest_OneofSizer, []interface{}{ + (*CommitRequest_Transaction)(nil), + } +} + +func _CommitRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*CommitRequest) + // transaction_selector + switch x := m.TransactionSelector.(type) { + case *CommitRequest_Transaction: + b.EncodeVarint(1<<3 | proto.WireBytes) + b.EncodeRawBytes(x.Transaction) + case nil: + default: + return fmt.Errorf("CommitRequest.TransactionSelector has unexpected type %T", x) + } + return nil +} + +func _CommitRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*CommitRequest) + switch tag { + case 1: // transaction_selector.transaction + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.TransactionSelector = &CommitRequest_Transaction{x} + return true, err + default: + return false, nil + } +} + +func _CommitRequest_OneofSizer(msg proto.Message) (n int) { + m := msg.(*CommitRequest) + // transaction_selector + switch x := m.TransactionSelector.(type) { + case *CommitRequest_Transaction: + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Transaction))) + n += len(x.Transaction) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// The response for [Datastore.Commit][google.datastore.v1.Datastore.Commit]. +type CommitResponse struct { + // The result of performing the mutations. + // The i-th mutation result corresponds to the i-th mutation in the request. + MutationResults []*MutationResult `protobuf:"bytes,3,rep,name=mutation_results,json=mutationResults" json:"mutation_results,omitempty"` + // The number of index entries updated during the commit, or zero if none were + // updated. + IndexUpdates int32 `protobuf:"varint,4,opt,name=index_updates,json=indexUpdates" json:"index_updates,omitempty"` +} + +func (m *CommitResponse) Reset() { *m = CommitResponse{} } +func (m *CommitResponse) String() string { return proto.CompactTextString(m) } +func (*CommitResponse) ProtoMessage() {} +func (*CommitResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *CommitResponse) GetMutationResults() []*MutationResult { + if m != nil { + return m.MutationResults + } + return nil +} + +func (m *CommitResponse) GetIndexUpdates() int32 { + if m != nil { + return m.IndexUpdates + } + return 0 +} + +// The request for [Datastore.AllocateIds][google.datastore.v1.Datastore.AllocateIds]. +type AllocateIdsRequest struct { + // The ID of the project against which to make the request. + ProjectId string `protobuf:"bytes,8,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // A list of keys with incomplete key paths for which to allocate IDs. + // No key may be reserved/read-only. + Keys []*Key `protobuf:"bytes,1,rep,name=keys" json:"keys,omitempty"` +} + +func (m *AllocateIdsRequest) Reset() { *m = AllocateIdsRequest{} } +func (m *AllocateIdsRequest) String() string { return proto.CompactTextString(m) } +func (*AllocateIdsRequest) ProtoMessage() {} +func (*AllocateIdsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *AllocateIdsRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *AllocateIdsRequest) GetKeys() []*Key { + if m != nil { + return m.Keys + } + return nil +} + +// The response for [Datastore.AllocateIds][google.datastore.v1.Datastore.AllocateIds]. +type AllocateIdsResponse struct { + // The keys specified in the request (in the same order), each with + // its key path completed with a newly allocated ID. + Keys []*Key `protobuf:"bytes,1,rep,name=keys" json:"keys,omitempty"` +} + +func (m *AllocateIdsResponse) Reset() { *m = AllocateIdsResponse{} } +func (m *AllocateIdsResponse) String() string { return proto.CompactTextString(m) } +func (*AllocateIdsResponse) ProtoMessage() {} +func (*AllocateIdsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } + +func (m *AllocateIdsResponse) GetKeys() []*Key { + if m != nil { + return m.Keys + } + return nil +} + +// The request for [Datastore.ReserveIds][google.datastore.v1.Datastore.ReserveIds]. +type ReserveIdsRequest struct { + // The ID of the project against which to make the request. + ProjectId string `protobuf:"bytes,8,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // If not empty, the ID of the database against which to make the request. + DatabaseId string `protobuf:"bytes,9,opt,name=database_id,json=databaseId" json:"database_id,omitempty"` + // A list of keys with complete key paths whose numeric IDs should not be + // auto-allocated. + Keys []*Key `protobuf:"bytes,1,rep,name=keys" json:"keys,omitempty"` +} + +func (m *ReserveIdsRequest) Reset() { *m = ReserveIdsRequest{} } +func (m *ReserveIdsRequest) String() string { return proto.CompactTextString(m) } +func (*ReserveIdsRequest) ProtoMessage() {} +func (*ReserveIdsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } + +func (m *ReserveIdsRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *ReserveIdsRequest) GetDatabaseId() string { + if m != nil { + return m.DatabaseId + } + return "" +} + +func (m *ReserveIdsRequest) GetKeys() []*Key { + if m != nil { + return m.Keys + } + return nil +} + +// The response for [Datastore.ReserveIds][google.datastore.v1.Datastore.ReserveIds]. +type ReserveIdsResponse struct { +} + +func (m *ReserveIdsResponse) Reset() { *m = ReserveIdsResponse{} } +func (m *ReserveIdsResponse) String() string { return proto.CompactTextString(m) } +func (*ReserveIdsResponse) ProtoMessage() {} +func (*ReserveIdsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } + +// A mutation to apply to an entity. +type Mutation struct { + // The mutation operation. + // + // For `insert`, `update`, and `upsert`: + // - The entity's key must not be reserved/read-only. + // - No property in the entity may have a reserved name, + // not even a property in an entity in a value. + // - No value in the entity may have meaning 18, + // not even a value in an entity in another value. + // + // Types that are valid to be assigned to Operation: + // *Mutation_Insert + // *Mutation_Update + // *Mutation_Upsert + // *Mutation_Delete + Operation isMutation_Operation `protobuf_oneof:"operation"` + // When set, the server will detect whether or not this mutation conflicts + // with the current version of the entity on the server. Conflicting mutations + // are not applied, and are marked as such in MutationResult. + // + // Types that are valid to be assigned to ConflictDetectionStrategy: + // *Mutation_BaseVersion + ConflictDetectionStrategy isMutation_ConflictDetectionStrategy `protobuf_oneof:"conflict_detection_strategy"` +} + +func (m *Mutation) Reset() { *m = Mutation{} } +func (m *Mutation) String() string { return proto.CompactTextString(m) } +func (*Mutation) ProtoMessage() {} +func (*Mutation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } + +type isMutation_Operation interface { + isMutation_Operation() +} +type isMutation_ConflictDetectionStrategy interface { + isMutation_ConflictDetectionStrategy() +} + +type Mutation_Insert struct { + Insert *Entity `protobuf:"bytes,4,opt,name=insert,oneof"` +} +type Mutation_Update struct { + Update *Entity `protobuf:"bytes,5,opt,name=update,oneof"` +} +type Mutation_Upsert struct { + Upsert *Entity `protobuf:"bytes,6,opt,name=upsert,oneof"` +} +type Mutation_Delete struct { + Delete *Key `protobuf:"bytes,7,opt,name=delete,oneof"` +} +type Mutation_BaseVersion struct { + BaseVersion int64 `protobuf:"varint,8,opt,name=base_version,json=baseVersion,oneof"` +} + +func (*Mutation_Insert) isMutation_Operation() {} +func (*Mutation_Update) isMutation_Operation() {} +func (*Mutation_Upsert) isMutation_Operation() {} +func (*Mutation_Delete) isMutation_Operation() {} +func (*Mutation_BaseVersion) isMutation_ConflictDetectionStrategy() {} + +func (m *Mutation) GetOperation() isMutation_Operation { + if m != nil { + return m.Operation + } + return nil +} +func (m *Mutation) GetConflictDetectionStrategy() isMutation_ConflictDetectionStrategy { + if m != nil { + return m.ConflictDetectionStrategy + } + return nil +} + +func (m *Mutation) GetInsert() *Entity { + if x, ok := m.GetOperation().(*Mutation_Insert); ok { + return x.Insert + } + return nil +} + +func (m *Mutation) GetUpdate() *Entity { + if x, ok := m.GetOperation().(*Mutation_Update); ok { + return x.Update + } + return nil +} + +func (m *Mutation) GetUpsert() *Entity { + if x, ok := m.GetOperation().(*Mutation_Upsert); ok { + return x.Upsert + } + return nil +} + +func (m *Mutation) GetDelete() *Key { + if x, ok := m.GetOperation().(*Mutation_Delete); ok { + return x.Delete + } + return nil +} + +func (m *Mutation) GetBaseVersion() int64 { + if x, ok := m.GetConflictDetectionStrategy().(*Mutation_BaseVersion); ok { + return x.BaseVersion + } + return 0 +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Mutation) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _Mutation_OneofMarshaler, _Mutation_OneofUnmarshaler, _Mutation_OneofSizer, []interface{}{ + (*Mutation_Insert)(nil), + (*Mutation_Update)(nil), + (*Mutation_Upsert)(nil), + (*Mutation_Delete)(nil), + (*Mutation_BaseVersion)(nil), + } +} + +func _Mutation_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Mutation) + // operation + switch x := m.Operation.(type) { + case *Mutation_Insert: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Insert); err != nil { + return err + } + case *Mutation_Update: + b.EncodeVarint(5<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Update); err != nil { + return err + } + case *Mutation_Upsert: + b.EncodeVarint(6<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Upsert); err != nil { + return err + } + case *Mutation_Delete: + b.EncodeVarint(7<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Delete); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("Mutation.Operation has unexpected type %T", x) + } + // conflict_detection_strategy + switch x := m.ConflictDetectionStrategy.(type) { + case *Mutation_BaseVersion: + b.EncodeVarint(8<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.BaseVersion)) + case nil: + default: + return fmt.Errorf("Mutation.ConflictDetectionStrategy has unexpected type %T", x) + } + return nil +} + +func _Mutation_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Mutation) + switch tag { + case 4: // operation.insert + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Entity) + err := b.DecodeMessage(msg) + m.Operation = &Mutation_Insert{msg} + return true, err + case 5: // operation.update + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Entity) + err := b.DecodeMessage(msg) + m.Operation = &Mutation_Update{msg} + return true, err + case 6: // operation.upsert + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Entity) + err := b.DecodeMessage(msg) + m.Operation = &Mutation_Upsert{msg} + return true, err + case 7: // operation.delete + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Key) + err := b.DecodeMessage(msg) + m.Operation = &Mutation_Delete{msg} + return true, err + case 8: // conflict_detection_strategy.base_version + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.ConflictDetectionStrategy = &Mutation_BaseVersion{int64(x)} + return true, err + default: + return false, nil + } +} + +func _Mutation_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Mutation) + // operation + switch x := m.Operation.(type) { + case *Mutation_Insert: + s := proto.Size(x.Insert) + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Mutation_Update: + s := proto.Size(x.Update) + n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Mutation_Upsert: + s := proto.Size(x.Upsert) + n += proto.SizeVarint(6<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Mutation_Delete: + s := proto.Size(x.Delete) + n += proto.SizeVarint(7<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + // conflict_detection_strategy + switch x := m.ConflictDetectionStrategy.(type) { + case *Mutation_BaseVersion: + n += proto.SizeVarint(8<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.BaseVersion)) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// The result of applying a mutation. +type MutationResult struct { + // The automatically allocated key. + // Set only when the mutation allocated a key. + Key *Key `protobuf:"bytes,3,opt,name=key" json:"key,omitempty"` + // The version of the entity on the server after processing the mutation. If + // the mutation doesn't change anything on the server, then the version will + // be the version of the current entity or, if no entity is present, a version + // that is strictly greater than the version of any previous entity and less + // than the version of any possible future entity. + Version int64 `protobuf:"varint,4,opt,name=version" json:"version,omitempty"` + // Whether a conflict was detected for this mutation. Always false when a + // conflict detection strategy field is not set in the mutation. + ConflictDetected bool `protobuf:"varint,5,opt,name=conflict_detected,json=conflictDetected" json:"conflict_detected,omitempty"` +} + +func (m *MutationResult) Reset() { *m = MutationResult{} } +func (m *MutationResult) String() string { return proto.CompactTextString(m) } +func (*MutationResult) ProtoMessage() {} +func (*MutationResult) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } + +func (m *MutationResult) GetKey() *Key { + if m != nil { + return m.Key + } + return nil +} + +func (m *MutationResult) GetVersion() int64 { + if m != nil { + return m.Version + } + return 0 +} + +func (m *MutationResult) GetConflictDetected() bool { + if m != nil { + return m.ConflictDetected + } + return false +} + +// The options shared by read requests. +type ReadOptions struct { + // If not specified, lookups and ancestor queries default to + // `read_consistency`=`STRONG`, global queries default to + // `read_consistency`=`EVENTUAL`. + // + // Types that are valid to be assigned to ConsistencyType: + // *ReadOptions_ReadConsistency_ + // *ReadOptions_Transaction + ConsistencyType isReadOptions_ConsistencyType `protobuf_oneof:"consistency_type"` +} + +func (m *ReadOptions) Reset() { *m = ReadOptions{} } +func (m *ReadOptions) String() string { return proto.CompactTextString(m) } +func (*ReadOptions) ProtoMessage() {} +func (*ReadOptions) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} } + +type isReadOptions_ConsistencyType interface { + isReadOptions_ConsistencyType() +} + +type ReadOptions_ReadConsistency_ struct { + ReadConsistency ReadOptions_ReadConsistency `protobuf:"varint,1,opt,name=read_consistency,json=readConsistency,enum=google.datastore.v1.ReadOptions_ReadConsistency,oneof"` +} +type ReadOptions_Transaction struct { + Transaction []byte `protobuf:"bytes,2,opt,name=transaction,proto3,oneof"` +} + +func (*ReadOptions_ReadConsistency_) isReadOptions_ConsistencyType() {} +func (*ReadOptions_Transaction) isReadOptions_ConsistencyType() {} + +func (m *ReadOptions) GetConsistencyType() isReadOptions_ConsistencyType { + if m != nil { + return m.ConsistencyType + } + return nil +} + +func (m *ReadOptions) GetReadConsistency() ReadOptions_ReadConsistency { + if x, ok := m.GetConsistencyType().(*ReadOptions_ReadConsistency_); ok { + return x.ReadConsistency + } + return ReadOptions_READ_CONSISTENCY_UNSPECIFIED +} + +func (m *ReadOptions) GetTransaction() []byte { + if x, ok := m.GetConsistencyType().(*ReadOptions_Transaction); ok { + return x.Transaction + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*ReadOptions) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _ReadOptions_OneofMarshaler, _ReadOptions_OneofUnmarshaler, _ReadOptions_OneofSizer, []interface{}{ + (*ReadOptions_ReadConsistency_)(nil), + (*ReadOptions_Transaction)(nil), + } +} + +func _ReadOptions_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*ReadOptions) + // consistency_type + switch x := m.ConsistencyType.(type) { + case *ReadOptions_ReadConsistency_: + b.EncodeVarint(1<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.ReadConsistency)) + case *ReadOptions_Transaction: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeRawBytes(x.Transaction) + case nil: + default: + return fmt.Errorf("ReadOptions.ConsistencyType has unexpected type %T", x) + } + return nil +} + +func _ReadOptions_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*ReadOptions) + switch tag { + case 1: // consistency_type.read_consistency + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.ConsistencyType = &ReadOptions_ReadConsistency_{ReadOptions_ReadConsistency(x)} + return true, err + case 2: // consistency_type.transaction + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.ConsistencyType = &ReadOptions_Transaction{x} + return true, err + default: + return false, nil + } +} + +func _ReadOptions_OneofSizer(msg proto.Message) (n int) { + m := msg.(*ReadOptions) + // consistency_type + switch x := m.ConsistencyType.(type) { + case *ReadOptions_ReadConsistency_: + n += proto.SizeVarint(1<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.ReadConsistency)) + case *ReadOptions_Transaction: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Transaction))) + n += len(x.Transaction) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Options for beginning a new transaction. +// +// Transactions can be created explicitly with calls to +// [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction] or implicitly by setting +// [ReadOptions.new_transaction][google.datastore.v1.ReadOptions.new_transaction] in read requests. +type TransactionOptions struct { + // The `mode` of the transaction, indicating whether write operations are + // supported. + // + // Types that are valid to be assigned to Mode: + // *TransactionOptions_ReadWrite_ + // *TransactionOptions_ReadOnly_ + Mode isTransactionOptions_Mode `protobuf_oneof:"mode"` +} + +func (m *TransactionOptions) Reset() { *m = TransactionOptions{} } +func (m *TransactionOptions) String() string { return proto.CompactTextString(m) } +func (*TransactionOptions) ProtoMessage() {} +func (*TransactionOptions) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17} } + +type isTransactionOptions_Mode interface { + isTransactionOptions_Mode() +} + +type TransactionOptions_ReadWrite_ struct { + ReadWrite *TransactionOptions_ReadWrite `protobuf:"bytes,1,opt,name=read_write,json=readWrite,oneof"` +} +type TransactionOptions_ReadOnly_ struct { + ReadOnly *TransactionOptions_ReadOnly `protobuf:"bytes,2,opt,name=read_only,json=readOnly,oneof"` +} + +func (*TransactionOptions_ReadWrite_) isTransactionOptions_Mode() {} +func (*TransactionOptions_ReadOnly_) isTransactionOptions_Mode() {} + +func (m *TransactionOptions) GetMode() isTransactionOptions_Mode { + if m != nil { + return m.Mode + } + return nil +} + +func (m *TransactionOptions) GetReadWrite() *TransactionOptions_ReadWrite { + if x, ok := m.GetMode().(*TransactionOptions_ReadWrite_); ok { + return x.ReadWrite + } + return nil +} + +func (m *TransactionOptions) GetReadOnly() *TransactionOptions_ReadOnly { + if x, ok := m.GetMode().(*TransactionOptions_ReadOnly_); ok { + return x.ReadOnly + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*TransactionOptions) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _TransactionOptions_OneofMarshaler, _TransactionOptions_OneofUnmarshaler, _TransactionOptions_OneofSizer, []interface{}{ + (*TransactionOptions_ReadWrite_)(nil), + (*TransactionOptions_ReadOnly_)(nil), + } +} + +func _TransactionOptions_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*TransactionOptions) + // mode + switch x := m.Mode.(type) { + case *TransactionOptions_ReadWrite_: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ReadWrite); err != nil { + return err + } + case *TransactionOptions_ReadOnly_: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ReadOnly); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("TransactionOptions.Mode has unexpected type %T", x) + } + return nil +} + +func _TransactionOptions_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*TransactionOptions) + switch tag { + case 1: // mode.read_write + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(TransactionOptions_ReadWrite) + err := b.DecodeMessage(msg) + m.Mode = &TransactionOptions_ReadWrite_{msg} + return true, err + case 2: // mode.read_only + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(TransactionOptions_ReadOnly) + err := b.DecodeMessage(msg) + m.Mode = &TransactionOptions_ReadOnly_{msg} + return true, err + default: + return false, nil + } +} + +func _TransactionOptions_OneofSizer(msg proto.Message) (n int) { + m := msg.(*TransactionOptions) + // mode + switch x := m.Mode.(type) { + case *TransactionOptions_ReadWrite_: + s := proto.Size(x.ReadWrite) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *TransactionOptions_ReadOnly_: + s := proto.Size(x.ReadOnly) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Options specific to read / write transactions. +type TransactionOptions_ReadWrite struct { + // The transaction identifier of the transaction being retried. + PreviousTransaction []byte `protobuf:"bytes,1,opt,name=previous_transaction,json=previousTransaction,proto3" json:"previous_transaction,omitempty"` +} + +func (m *TransactionOptions_ReadWrite) Reset() { *m = TransactionOptions_ReadWrite{} } +func (m *TransactionOptions_ReadWrite) String() string { return proto.CompactTextString(m) } +func (*TransactionOptions_ReadWrite) ProtoMessage() {} +func (*TransactionOptions_ReadWrite) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{17, 0} +} + +func (m *TransactionOptions_ReadWrite) GetPreviousTransaction() []byte { + if m != nil { + return m.PreviousTransaction + } + return nil +} + +// Options specific to read-only transactions. +type TransactionOptions_ReadOnly struct { +} + +func (m *TransactionOptions_ReadOnly) Reset() { *m = TransactionOptions_ReadOnly{} } +func (m *TransactionOptions_ReadOnly) String() string { return proto.CompactTextString(m) } +func (*TransactionOptions_ReadOnly) ProtoMessage() {} +func (*TransactionOptions_ReadOnly) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17, 1} } + +func init() { + proto.RegisterType((*LookupRequest)(nil), "google.datastore.v1.LookupRequest") + proto.RegisterType((*LookupResponse)(nil), "google.datastore.v1.LookupResponse") + proto.RegisterType((*RunQueryRequest)(nil), "google.datastore.v1.RunQueryRequest") + proto.RegisterType((*RunQueryResponse)(nil), "google.datastore.v1.RunQueryResponse") + proto.RegisterType((*BeginTransactionRequest)(nil), "google.datastore.v1.BeginTransactionRequest") + proto.RegisterType((*BeginTransactionResponse)(nil), "google.datastore.v1.BeginTransactionResponse") + proto.RegisterType((*RollbackRequest)(nil), "google.datastore.v1.RollbackRequest") + proto.RegisterType((*RollbackResponse)(nil), "google.datastore.v1.RollbackResponse") + proto.RegisterType((*CommitRequest)(nil), "google.datastore.v1.CommitRequest") + proto.RegisterType((*CommitResponse)(nil), "google.datastore.v1.CommitResponse") + proto.RegisterType((*AllocateIdsRequest)(nil), "google.datastore.v1.AllocateIdsRequest") + proto.RegisterType((*AllocateIdsResponse)(nil), "google.datastore.v1.AllocateIdsResponse") + proto.RegisterType((*ReserveIdsRequest)(nil), "google.datastore.v1.ReserveIdsRequest") + proto.RegisterType((*ReserveIdsResponse)(nil), "google.datastore.v1.ReserveIdsResponse") + proto.RegisterType((*Mutation)(nil), "google.datastore.v1.Mutation") + proto.RegisterType((*MutationResult)(nil), "google.datastore.v1.MutationResult") + proto.RegisterType((*ReadOptions)(nil), "google.datastore.v1.ReadOptions") + proto.RegisterType((*TransactionOptions)(nil), "google.datastore.v1.TransactionOptions") + proto.RegisterType((*TransactionOptions_ReadWrite)(nil), "google.datastore.v1.TransactionOptions.ReadWrite") + proto.RegisterType((*TransactionOptions_ReadOnly)(nil), "google.datastore.v1.TransactionOptions.ReadOnly") + proto.RegisterEnum("google.datastore.v1.CommitRequest_Mode", CommitRequest_Mode_name, CommitRequest_Mode_value) + proto.RegisterEnum("google.datastore.v1.ReadOptions_ReadConsistency", ReadOptions_ReadConsistency_name, ReadOptions_ReadConsistency_value) +} + +// 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 + +// Client API for Datastore service + +type DatastoreClient interface { + // Looks up entities by key. + Lookup(ctx context.Context, in *LookupRequest, opts ...grpc.CallOption) (*LookupResponse, error) + // Queries for entities. + RunQuery(ctx context.Context, in *RunQueryRequest, opts ...grpc.CallOption) (*RunQueryResponse, error) + // Begins a new transaction. + BeginTransaction(ctx context.Context, in *BeginTransactionRequest, opts ...grpc.CallOption) (*BeginTransactionResponse, error) + // Commits a transaction, optionally creating, deleting or modifying some + // entities. + Commit(ctx context.Context, in *CommitRequest, opts ...grpc.CallOption) (*CommitResponse, error) + // Rolls back a transaction. + Rollback(ctx context.Context, in *RollbackRequest, opts ...grpc.CallOption) (*RollbackResponse, error) + // Allocates IDs for the given keys, which is useful for referencing an entity + // before it is inserted. + AllocateIds(ctx context.Context, in *AllocateIdsRequest, opts ...grpc.CallOption) (*AllocateIdsResponse, error) + // Prevents the supplied keys' IDs from being auto-allocated by Cloud + // Datastore. + ReserveIds(ctx context.Context, in *ReserveIdsRequest, opts ...grpc.CallOption) (*ReserveIdsResponse, error) +} + +type datastoreClient struct { + cc *grpc.ClientConn +} + +func NewDatastoreClient(cc *grpc.ClientConn) DatastoreClient { + return &datastoreClient{cc} +} + +func (c *datastoreClient) Lookup(ctx context.Context, in *LookupRequest, opts ...grpc.CallOption) (*LookupResponse, error) { + out := new(LookupResponse) + err := grpc.Invoke(ctx, "/google.datastore.v1.Datastore/Lookup", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *datastoreClient) RunQuery(ctx context.Context, in *RunQueryRequest, opts ...grpc.CallOption) (*RunQueryResponse, error) { + out := new(RunQueryResponse) + err := grpc.Invoke(ctx, "/google.datastore.v1.Datastore/RunQuery", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *datastoreClient) BeginTransaction(ctx context.Context, in *BeginTransactionRequest, opts ...grpc.CallOption) (*BeginTransactionResponse, error) { + out := new(BeginTransactionResponse) + err := grpc.Invoke(ctx, "/google.datastore.v1.Datastore/BeginTransaction", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *datastoreClient) Commit(ctx context.Context, in *CommitRequest, opts ...grpc.CallOption) (*CommitResponse, error) { + out := new(CommitResponse) + err := grpc.Invoke(ctx, "/google.datastore.v1.Datastore/Commit", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *datastoreClient) Rollback(ctx context.Context, in *RollbackRequest, opts ...grpc.CallOption) (*RollbackResponse, error) { + out := new(RollbackResponse) + err := grpc.Invoke(ctx, "/google.datastore.v1.Datastore/Rollback", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *datastoreClient) AllocateIds(ctx context.Context, in *AllocateIdsRequest, opts ...grpc.CallOption) (*AllocateIdsResponse, error) { + out := new(AllocateIdsResponse) + err := grpc.Invoke(ctx, "/google.datastore.v1.Datastore/AllocateIds", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *datastoreClient) ReserveIds(ctx context.Context, in *ReserveIdsRequest, opts ...grpc.CallOption) (*ReserveIdsResponse, error) { + out := new(ReserveIdsResponse) + err := grpc.Invoke(ctx, "/google.datastore.v1.Datastore/ReserveIds", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for Datastore service + +type DatastoreServer interface { + // Looks up entities by key. + Lookup(context.Context, *LookupRequest) (*LookupResponse, error) + // Queries for entities. + RunQuery(context.Context, *RunQueryRequest) (*RunQueryResponse, error) + // Begins a new transaction. + BeginTransaction(context.Context, *BeginTransactionRequest) (*BeginTransactionResponse, error) + // Commits a transaction, optionally creating, deleting or modifying some + // entities. + Commit(context.Context, *CommitRequest) (*CommitResponse, error) + // Rolls back a transaction. + Rollback(context.Context, *RollbackRequest) (*RollbackResponse, error) + // Allocates IDs for the given keys, which is useful for referencing an entity + // before it is inserted. + AllocateIds(context.Context, *AllocateIdsRequest) (*AllocateIdsResponse, error) + // Prevents the supplied keys' IDs from being auto-allocated by Cloud + // Datastore. + ReserveIds(context.Context, *ReserveIdsRequest) (*ReserveIdsResponse, error) +} + +func RegisterDatastoreServer(s *grpc.Server, srv DatastoreServer) { + s.RegisterService(&_Datastore_serviceDesc, srv) +} + +func _Datastore_Lookup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LookupRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DatastoreServer).Lookup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.datastore.v1.Datastore/Lookup", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DatastoreServer).Lookup(ctx, req.(*LookupRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Datastore_RunQuery_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RunQueryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DatastoreServer).RunQuery(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.datastore.v1.Datastore/RunQuery", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DatastoreServer).RunQuery(ctx, req.(*RunQueryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Datastore_BeginTransaction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BeginTransactionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DatastoreServer).BeginTransaction(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.datastore.v1.Datastore/BeginTransaction", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DatastoreServer).BeginTransaction(ctx, req.(*BeginTransactionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Datastore_Commit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CommitRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DatastoreServer).Commit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.datastore.v1.Datastore/Commit", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DatastoreServer).Commit(ctx, req.(*CommitRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Datastore_Rollback_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RollbackRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DatastoreServer).Rollback(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.datastore.v1.Datastore/Rollback", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DatastoreServer).Rollback(ctx, req.(*RollbackRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Datastore_AllocateIds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AllocateIdsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DatastoreServer).AllocateIds(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.datastore.v1.Datastore/AllocateIds", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DatastoreServer).AllocateIds(ctx, req.(*AllocateIdsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Datastore_ReserveIds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ReserveIdsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DatastoreServer).ReserveIds(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.datastore.v1.Datastore/ReserveIds", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DatastoreServer).ReserveIds(ctx, req.(*ReserveIdsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Datastore_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.datastore.v1.Datastore", + HandlerType: (*DatastoreServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Lookup", + Handler: _Datastore_Lookup_Handler, + }, + { + MethodName: "RunQuery", + Handler: _Datastore_RunQuery_Handler, + }, + { + MethodName: "BeginTransaction", + Handler: _Datastore_BeginTransaction_Handler, + }, + { + MethodName: "Commit", + Handler: _Datastore_Commit_Handler, + }, + { + MethodName: "Rollback", + Handler: _Datastore_Rollback_Handler, + }, + { + MethodName: "AllocateIds", + Handler: _Datastore_AllocateIds_Handler, + }, + { + MethodName: "ReserveIds", + Handler: _Datastore_ReserveIds_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/datastore/v1/datastore.proto", +} + +func init() { proto.RegisterFile("google/datastore/v1/datastore.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 1390 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xdf, 0x6f, 0x1b, 0xc5, + 0x13, 0xcf, 0x3a, 0x89, 0x63, 0x8f, 0xf3, 0xc3, 0xd9, 0xe4, 0xfb, 0xad, 0x71, 0x5b, 0xd5, 0x5c, + 0x1a, 0x1a, 0xd2, 0xd6, 0x4e, 0x0c, 0x15, 0x52, 0x53, 0x21, 0xc5, 0x8e, 0xdb, 0x58, 0x34, 0x76, + 0xd8, 0xa4, 0xe1, 0x87, 0x8a, 0xac, 0x8b, 0x6f, 0x6b, 0x8e, 0x9c, 0x6f, 0x2f, 0x77, 0xeb, 0x80, + 0x85, 0xa8, 0x54, 0x10, 0xbc, 0xc1, 0x43, 0xf9, 0x0b, 0xfa, 0xc2, 0x03, 0xe2, 0x91, 0x27, 0xc4, + 0x5f, 0xc0, 0x2b, 0xff, 0x02, 0x8f, 0xbc, 0xf1, 0x0f, 0xa0, 0xdb, 0xdb, 0xb3, 0x7d, 0xce, 0x5d, + 0xec, 0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, 0x27, 0xee, 0xe6, 0x98, 0x93, 0x4b, 0x44, 0xff, 0x81, 0x0b, 0xdc, 0x9d, + 0x20, 0x49, 0xdb, 0x3f, 0xe0, 0x3a, 0x24, 0xbd, 0xd5, 0xc4, 0x34, 0xfc, 0x39, 0xbc, 0x71, 0x19, + 0x93, 0x75, 0xd3, 0x10, 0x4b, 0x83, 0x2d, 0x7f, 0x67, 0xdf, 0x85, 0x64, 0xcf, 0x15, 0xde, 0x84, + 0x65, 0xcb, 0xa6, 0x67, 0x3a, 0xeb, 0x38, 0x8d, 0xf3, 0x33, 0x6b, 0xc9, 0xbf, 0x1b, 0xb0, 0x9d, + 0x05, 0x48, 0xf8, 0x76, 0x4b, 0x71, 0x6f, 0x04, 0x15, 0xff, 0x9e, 0x81, 0xe4, 0x8e, 0x4f, 0x06, + 0x3f, 0x87, 0xb8, 0xb7, 0x83, 0x62, 0x25, 0x94, 0x69, 0x60, 0x89, 0xce, 0xae, 0x5c, 0xa8, 0x23, + 0x7b, 0xc4, 0xed, 0xaf, 0xff, 0xfc, 0xeb, 0xc7, 0xd8, 0xaa, 0x92, 0x73, 0x97, 0x72, 0xd9, 0x9f, + 0x9c, 0xc2, 0x97, 0xfd, 0xde, 0xf5, 0xd5, 0x7d, 0x43, 0x20, 0xee, 0xa3, 0x75, 0xfc, 0x1d, 0x82, + 0x84, 0xbf, 0x08, 0xe1, 0x9b, 0xe1, 0xcf, 0x2e, 0xb8, 0x64, 0x66, 0x57, 0x47, 0x68, 0x49, 0x1a, + 0x77, 0x05, 0x8d, 0x5b, 0x8a, 0x12, 0x4d, 0xc3, 0x96, 0x18, 0x97, 0xc8, 0x4f, 0x08, 0xd2, 0xc3, + 0x9b, 0x07, 0xbe, 0x13, 0xea, 0x2a, 0x62, 0x69, 0xca, 0xde, 0x1d, 0x53, 0x5b, 0x12, 0xbc, 0x27, + 0x08, 0x16, 0x94, 0xf5, 0x68, 0x82, 0xc7, 0x43, 0x58, 0x97, 0xe8, 0x73, 0x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d, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x25, 0x27, 0xe9, 0x95, 0x51, 0x10, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/datastore/v1/entity.pb.go b/vendor/google.golang.org/genproto/googleapis/datastore/v1/entity.pb.go new file mode 100644 index 0000000000..d1d078dbeb --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/datastore/v1/entity.pb.go @@ -0,0 +1,763 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/datastore/v1/entity.proto + +package datastore + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf1 "github.com/golang/protobuf/ptypes/struct" +import google_protobuf2 "github.com/golang/protobuf/ptypes/timestamp" +import google_type "google.golang.org/genproto/googleapis/type/latlng" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// A partition ID identifies a grouping of entities. The grouping is always +// by project and namespace, however the namespace ID may be empty. +// +// A partition ID contains several dimensions: +// project ID and namespace ID. +// +// Partition dimensions: +// +// - May be `""`. +// - Must be valid UTF-8 bytes. +// - Must have values that match regex `[A-Za-z\d\.\-_]{1,100}` +// If the value of any dimension matches regex `__.*__`, the partition is +// reserved/read-only. +// A reserved/read-only partition ID is forbidden in certain documented +// contexts. +// +// Foreign partition IDs (in which the project ID does +// not match the context project ID ) are discouraged. +// Reads and writes of foreign partition IDs may fail if the project is not in an active state. +type PartitionId struct { + // The ID of the project to which the entities belong. + ProjectId string `protobuf:"bytes,2,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // If not empty, the ID of the namespace to which the entities belong. + NamespaceId string `protobuf:"bytes,4,opt,name=namespace_id,json=namespaceId" json:"namespace_id,omitempty"` +} + +func (m *PartitionId) Reset() { *m = PartitionId{} } +func (m *PartitionId) String() string { return proto.CompactTextString(m) } +func (*PartitionId) ProtoMessage() {} +func (*PartitionId) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +func (m *PartitionId) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *PartitionId) GetNamespaceId() string { + if m != nil { + return m.NamespaceId + } + return "" +} + +// A unique identifier for an entity. +// If a key's partition ID or any of its path kinds or names are +// reserved/read-only, the key is reserved/read-only. +// A reserved/read-only key is forbidden in certain documented contexts. +type Key struct { + // Entities are partitioned into subsets, currently identified by a project + // ID and namespace ID. + // Queries are scoped to a single partition. + PartitionId *PartitionId `protobuf:"bytes,1,opt,name=partition_id,json=partitionId" json:"partition_id,omitempty"` + // The entity path. + // An entity path consists of one or more elements composed of a kind and a + // string or numerical identifier, which identify entities. The first + // element identifies a _root entity_, the second element identifies + // a _child_ of the root entity, the third element identifies a child of the + // second entity, and so forth. The entities identified by all prefixes of + // the path are called the element's _ancestors_. + // + // An entity path is always fully complete: *all* of the entity's ancestors + // are required to be in the path along with the entity identifier itself. + // The only exception is that in some documented cases, the identifier in the + // last path element (for the entity) itself may be omitted. For example, + // the last path element of the key of `Mutation.insert` may have no + // identifier. + // + // A path can never be empty, and a path can have at most 100 elements. + Path []*Key_PathElement `protobuf:"bytes,2,rep,name=path" json:"path,omitempty"` +} + +func (m *Key) Reset() { *m = Key{} } +func (m *Key) String() string { return proto.CompactTextString(m) } +func (*Key) ProtoMessage() {} +func (*Key) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} } + +func (m *Key) GetPartitionId() *PartitionId { + if m != nil { + return m.PartitionId + } + return nil +} + +func (m *Key) GetPath() []*Key_PathElement { + if m != nil { + return m.Path + } + return nil +} + +// A (kind, ID/name) pair used to construct a key path. +// +// If either name or ID is set, the element is complete. +// If neither is set, the element is incomplete. +type Key_PathElement struct { + // The kind of the entity. + // A kind matching regex `__.*__` is reserved/read-only. + // A kind must not contain more than 1500 bytes when UTF-8 encoded. + // Cannot be `""`. + Kind string `protobuf:"bytes,1,opt,name=kind" json:"kind,omitempty"` + // The type of ID. + // + // Types that are valid to be assigned to IdType: + // *Key_PathElement_Id + // *Key_PathElement_Name + IdType isKey_PathElement_IdType `protobuf_oneof:"id_type"` +} + +func (m *Key_PathElement) Reset() { *m = Key_PathElement{} } +func (m *Key_PathElement) String() string { return proto.CompactTextString(m) } +func (*Key_PathElement) ProtoMessage() {} +func (*Key_PathElement) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1, 0} } + +type isKey_PathElement_IdType interface { + isKey_PathElement_IdType() +} + +type Key_PathElement_Id struct { + Id int64 `protobuf:"varint,2,opt,name=id,oneof"` +} +type Key_PathElement_Name struct { + Name string `protobuf:"bytes,3,opt,name=name,oneof"` +} + +func (*Key_PathElement_Id) isKey_PathElement_IdType() {} +func (*Key_PathElement_Name) isKey_PathElement_IdType() {} + +func (m *Key_PathElement) GetIdType() isKey_PathElement_IdType { + if m != nil { + return m.IdType + } + return nil +} + +func (m *Key_PathElement) GetKind() string { + if m != nil { + return m.Kind + } + return "" +} + +func (m *Key_PathElement) GetId() int64 { + if x, ok := m.GetIdType().(*Key_PathElement_Id); ok { + return x.Id + } + return 0 +} + +func (m *Key_PathElement) GetName() string { + if x, ok := m.GetIdType().(*Key_PathElement_Name); ok { + return x.Name + } + return "" +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Key_PathElement) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _Key_PathElement_OneofMarshaler, _Key_PathElement_OneofUnmarshaler, _Key_PathElement_OneofSizer, []interface{}{ + (*Key_PathElement_Id)(nil), + (*Key_PathElement_Name)(nil), + } +} + +func _Key_PathElement_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Key_PathElement) + // id_type + switch x := m.IdType.(type) { + case *Key_PathElement_Id: + b.EncodeVarint(2<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.Id)) + case *Key_PathElement_Name: + b.EncodeVarint(3<<3 | proto.WireBytes) + b.EncodeStringBytes(x.Name) + case nil: + default: + return fmt.Errorf("Key_PathElement.IdType has unexpected type %T", x) + } + return nil +} + +func _Key_PathElement_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Key_PathElement) + switch tag { + case 2: // id_type.id + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.IdType = &Key_PathElement_Id{int64(x)} + return true, err + case 3: // id_type.name + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.IdType = &Key_PathElement_Name{x} + return true, err + default: + return false, nil + } +} + +func _Key_PathElement_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Key_PathElement) + // id_type + switch x := m.IdType.(type) { + case *Key_PathElement_Id: + n += proto.SizeVarint(2<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.Id)) + case *Key_PathElement_Name: + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Name))) + n += len(x.Name) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// An array value. +type ArrayValue struct { + // Values in the array. + // The order of this array may not be preserved if it contains a mix of + // indexed and unindexed values. + Values []*Value `protobuf:"bytes,1,rep,name=values" json:"values,omitempty"` +} + +func (m *ArrayValue) Reset() { *m = ArrayValue{} } +func (m *ArrayValue) String() string { return proto.CompactTextString(m) } +func (*ArrayValue) ProtoMessage() {} +func (*ArrayValue) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} } + +func (m *ArrayValue) GetValues() []*Value { + if m != nil { + return m.Values + } + return nil +} + +// A message that can hold any of the supported value types and associated +// metadata. +type Value struct { + // Must have a value set. + // + // Types that are valid to be assigned to ValueType: + // *Value_NullValue + // *Value_BooleanValue + // *Value_IntegerValue + // *Value_DoubleValue + // *Value_TimestampValue + // *Value_KeyValue + // *Value_StringValue + // *Value_BlobValue + // *Value_GeoPointValue + // *Value_EntityValue + // *Value_ArrayValue + ValueType isValue_ValueType `protobuf_oneof:"value_type"` + // The `meaning` field should only be populated for backwards compatibility. + Meaning int32 `protobuf:"varint,14,opt,name=meaning" json:"meaning,omitempty"` + // If the value should be excluded from all indexes including those defined + // explicitly. + ExcludeFromIndexes bool `protobuf:"varint,19,opt,name=exclude_from_indexes,json=excludeFromIndexes" json:"exclude_from_indexes,omitempty"` +} + +func (m *Value) Reset() { *m = Value{} } +func (m *Value) String() string { return proto.CompactTextString(m) } +func (*Value) ProtoMessage() {} +func (*Value) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{3} } + +type isValue_ValueType interface { + isValue_ValueType() +} + +type Value_NullValue struct { + NullValue google_protobuf1.NullValue `protobuf:"varint,11,opt,name=null_value,json=nullValue,enum=google.protobuf.NullValue,oneof"` +} +type Value_BooleanValue struct { + BooleanValue bool `protobuf:"varint,1,opt,name=boolean_value,json=booleanValue,oneof"` +} +type Value_IntegerValue struct { + IntegerValue int64 `protobuf:"varint,2,opt,name=integer_value,json=integerValue,oneof"` +} +type Value_DoubleValue struct { + DoubleValue float64 `protobuf:"fixed64,3,opt,name=double_value,json=doubleValue,oneof"` +} +type Value_TimestampValue struct { + TimestampValue *google_protobuf2.Timestamp `protobuf:"bytes,10,opt,name=timestamp_value,json=timestampValue,oneof"` +} +type Value_KeyValue struct { + KeyValue *Key `protobuf:"bytes,5,opt,name=key_value,json=keyValue,oneof"` +} +type Value_StringValue struct { + StringValue string `protobuf:"bytes,17,opt,name=string_value,json=stringValue,oneof"` +} +type Value_BlobValue struct { + BlobValue []byte `protobuf:"bytes,18,opt,name=blob_value,json=blobValue,proto3,oneof"` +} +type Value_GeoPointValue struct { + GeoPointValue *google_type.LatLng `protobuf:"bytes,8,opt,name=geo_point_value,json=geoPointValue,oneof"` +} +type Value_EntityValue struct { + EntityValue *Entity `protobuf:"bytes,6,opt,name=entity_value,json=entityValue,oneof"` +} +type Value_ArrayValue struct { + ArrayValue *ArrayValue `protobuf:"bytes,9,opt,name=array_value,json=arrayValue,oneof"` +} + +func (*Value_NullValue) isValue_ValueType() {} +func (*Value_BooleanValue) isValue_ValueType() {} +func (*Value_IntegerValue) isValue_ValueType() {} +func (*Value_DoubleValue) isValue_ValueType() {} +func (*Value_TimestampValue) isValue_ValueType() {} +func (*Value_KeyValue) isValue_ValueType() {} +func (*Value_StringValue) isValue_ValueType() {} +func (*Value_BlobValue) isValue_ValueType() {} +func (*Value_GeoPointValue) isValue_ValueType() {} +func (*Value_EntityValue) isValue_ValueType() {} +func (*Value_ArrayValue) isValue_ValueType() {} + +func (m *Value) GetValueType() isValue_ValueType { + if m != nil { + return m.ValueType + } + return nil +} + +func (m *Value) GetNullValue() google_protobuf1.NullValue { + if x, ok := m.GetValueType().(*Value_NullValue); ok { + return x.NullValue + } + return google_protobuf1.NullValue_NULL_VALUE +} + +func (m *Value) GetBooleanValue() bool { + if x, ok := m.GetValueType().(*Value_BooleanValue); ok { + return x.BooleanValue + } + return false +} + +func (m *Value) GetIntegerValue() int64 { + if x, ok := m.GetValueType().(*Value_IntegerValue); ok { + return x.IntegerValue + } + return 0 +} + +func (m *Value) GetDoubleValue() float64 { + if x, ok := m.GetValueType().(*Value_DoubleValue); ok { + return x.DoubleValue + } + return 0 +} + +func (m *Value) GetTimestampValue() *google_protobuf2.Timestamp { + if x, ok := m.GetValueType().(*Value_TimestampValue); ok { + return x.TimestampValue + } + return nil +} + +func (m *Value) GetKeyValue() *Key { + if x, ok := m.GetValueType().(*Value_KeyValue); ok { + return x.KeyValue + } + return nil +} + +func (m *Value) GetStringValue() string { + if x, ok := m.GetValueType().(*Value_StringValue); ok { + return x.StringValue + } + return "" +} + +func (m *Value) GetBlobValue() []byte { + if x, ok := m.GetValueType().(*Value_BlobValue); ok { + return x.BlobValue + } + return nil +} + +func (m *Value) GetGeoPointValue() *google_type.LatLng { + if x, ok := m.GetValueType().(*Value_GeoPointValue); ok { + return x.GeoPointValue + } + return nil +} + +func (m *Value) GetEntityValue() *Entity { + if x, ok := m.GetValueType().(*Value_EntityValue); ok { + return x.EntityValue + } + return nil +} + +func (m *Value) GetArrayValue() *ArrayValue { + if x, ok := m.GetValueType().(*Value_ArrayValue); ok { + return x.ArrayValue + } + return nil +} + +func (m *Value) GetMeaning() int32 { + if m != nil { + return m.Meaning + } + return 0 +} + +func (m *Value) GetExcludeFromIndexes() bool { + if m != nil { + return m.ExcludeFromIndexes + } + return false +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Value) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _Value_OneofMarshaler, _Value_OneofUnmarshaler, _Value_OneofSizer, []interface{}{ + (*Value_NullValue)(nil), + (*Value_BooleanValue)(nil), + (*Value_IntegerValue)(nil), + (*Value_DoubleValue)(nil), + (*Value_TimestampValue)(nil), + (*Value_KeyValue)(nil), + (*Value_StringValue)(nil), + (*Value_BlobValue)(nil), + (*Value_GeoPointValue)(nil), + (*Value_EntityValue)(nil), + (*Value_ArrayValue)(nil), + } +} + +func _Value_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Value) + // value_type + switch x := m.ValueType.(type) { + case *Value_NullValue: + b.EncodeVarint(11<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.NullValue)) + case *Value_BooleanValue: + t := uint64(0) + if x.BooleanValue { + t = 1 + } + b.EncodeVarint(1<<3 | proto.WireVarint) + b.EncodeVarint(t) + case *Value_IntegerValue: + b.EncodeVarint(2<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.IntegerValue)) + case *Value_DoubleValue: + b.EncodeVarint(3<<3 | proto.WireFixed64) + b.EncodeFixed64(math.Float64bits(x.DoubleValue)) + case *Value_TimestampValue: + b.EncodeVarint(10<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.TimestampValue); err != nil { + return err + } + case *Value_KeyValue: + b.EncodeVarint(5<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.KeyValue); err != nil { + return err + } + case *Value_StringValue: + b.EncodeVarint(17<<3 | proto.WireBytes) + b.EncodeStringBytes(x.StringValue) + case *Value_BlobValue: + b.EncodeVarint(18<<3 | proto.WireBytes) + b.EncodeRawBytes(x.BlobValue) + case *Value_GeoPointValue: + b.EncodeVarint(8<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.GeoPointValue); err != nil { + return err + } + case *Value_EntityValue: + b.EncodeVarint(6<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.EntityValue); err != nil { + return err + } + case *Value_ArrayValue: + b.EncodeVarint(9<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ArrayValue); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("Value.ValueType has unexpected type %T", x) + } + return nil +} + +func _Value_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Value) + switch tag { + case 11: // value_type.null_value + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.ValueType = &Value_NullValue{google_protobuf1.NullValue(x)} + return true, err + case 1: // value_type.boolean_value + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.ValueType = &Value_BooleanValue{x != 0} + return true, err + case 2: // value_type.integer_value + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.ValueType = &Value_IntegerValue{int64(x)} + return true, err + case 3: // value_type.double_value + if wire != proto.WireFixed64 { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeFixed64() + m.ValueType = &Value_DoubleValue{math.Float64frombits(x)} + return true, err + case 10: // value_type.timestamp_value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(google_protobuf2.Timestamp) + err := b.DecodeMessage(msg) + m.ValueType = &Value_TimestampValue{msg} + return true, err + case 5: // value_type.key_value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Key) + err := b.DecodeMessage(msg) + m.ValueType = &Value_KeyValue{msg} + return true, err + case 17: // value_type.string_value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.ValueType = &Value_StringValue{x} + return true, err + case 18: // value_type.blob_value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.ValueType = &Value_BlobValue{x} + return true, err + case 8: // value_type.geo_point_value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(google_type.LatLng) + err := b.DecodeMessage(msg) + m.ValueType = &Value_GeoPointValue{msg} + return true, err + case 6: // value_type.entity_value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Entity) + err := b.DecodeMessage(msg) + m.ValueType = &Value_EntityValue{msg} + return true, err + case 9: // value_type.array_value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ArrayValue) + err := b.DecodeMessage(msg) + m.ValueType = &Value_ArrayValue{msg} + return true, err + default: + return false, nil + } +} + +func _Value_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Value) + // value_type + switch x := m.ValueType.(type) { + case *Value_NullValue: + n += proto.SizeVarint(11<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.NullValue)) + case *Value_BooleanValue: + n += proto.SizeVarint(1<<3 | proto.WireVarint) + n += 1 + case *Value_IntegerValue: + n += proto.SizeVarint(2<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.IntegerValue)) + case *Value_DoubleValue: + n += proto.SizeVarint(3<<3 | proto.WireFixed64) + n += 8 + case *Value_TimestampValue: + s := proto.Size(x.TimestampValue) + n += proto.SizeVarint(10<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Value_KeyValue: + s := proto.Size(x.KeyValue) + n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Value_StringValue: + n += proto.SizeVarint(17<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.StringValue))) + n += len(x.StringValue) + case *Value_BlobValue: + n += proto.SizeVarint(18<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.BlobValue))) + n += len(x.BlobValue) + case *Value_GeoPointValue: + s := proto.Size(x.GeoPointValue) + n += proto.SizeVarint(8<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Value_EntityValue: + s := proto.Size(x.EntityValue) + n += proto.SizeVarint(6<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Value_ArrayValue: + s := proto.Size(x.ArrayValue) + n += proto.SizeVarint(9<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// A Datastore data object. +// +// An entity is limited to 1 megabyte when stored. That _roughly_ +// corresponds to a limit of 1 megabyte for the serialized form of this +// message. +type Entity struct { + // The entity's key. + // + // An entity must have a key, unless otherwise documented (for example, + // an entity in `Value.entity_value` may have no key). + // An entity's kind is its key path's last element's kind, + // or null if it has no key. + Key *Key `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` + // The entity's properties. + // The map's keys are property names. + // A property name matching regex `__.*__` is reserved. + // A reserved property name is forbidden in certain documented contexts. + // The name must not contain more than 500 characters. + // The name cannot be `""`. + Properties map[string]*Value `protobuf:"bytes,3,rep,name=properties" json:"properties,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *Entity) Reset() { *m = Entity{} } +func (m *Entity) String() string { return proto.CompactTextString(m) } +func (*Entity) ProtoMessage() {} +func (*Entity) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{4} } + +func (m *Entity) GetKey() *Key { + if m != nil { + return m.Key + } + return nil +} + +func (m *Entity) GetProperties() map[string]*Value { + if m != nil { + return m.Properties + } + return nil +} + +func init() { + proto.RegisterType((*PartitionId)(nil), "google.datastore.v1.PartitionId") + proto.RegisterType((*Key)(nil), "google.datastore.v1.Key") + proto.RegisterType((*Key_PathElement)(nil), "google.datastore.v1.Key.PathElement") + proto.RegisterType((*ArrayValue)(nil), "google.datastore.v1.ArrayValue") + proto.RegisterType((*Value)(nil), "google.datastore.v1.Value") + proto.RegisterType((*Entity)(nil), "google.datastore.v1.Entity") +} + +func init() { proto.RegisterFile("google/datastore/v1/entity.proto", fileDescriptor1) } + +var fileDescriptor1 = []byte{ + // 780 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x94, 0xff, 0x6e, 0xdc, 0x44, + 0x10, 0xc7, 0xed, 0xbb, 0x5c, 0x1a, 0x8f, 0xdd, 0xa4, 0x6c, 0x2a, 0x61, 0x02, 0x28, 0x26, 0x80, + 0x74, 0x02, 0xc9, 0x6e, 0xc2, 0x1f, 0x54, 0x14, 0xa4, 0x72, 0x25, 0xe0, 0x28, 0x15, 0x9c, 0x56, + 0x55, 0x24, 0x50, 0xa4, 0xd3, 0xde, 0x79, 0xeb, 0x2e, 0x67, 0xef, 0x5a, 0xf6, 0x3a, 0xaa, 0xdf, + 0x05, 0xf1, 0x00, 0x3c, 0x0a, 0x8f, 0x80, 0x78, 0x18, 0xb4, 0x3f, 0xec, 0x0b, 0xed, 0x35, 0xff, + 0x79, 0x67, 0x3e, 0xdf, 0xd9, 0xef, 0xec, 0xce, 0x1a, 0xa2, 0x5c, 0x88, 0xbc, 0xa0, 0x49, 0x46, + 0x24, 0x69, 0xa4, 0xa8, 0x69, 0x72, 0x73, 0x9a, 0x50, 0x2e, 0x99, 0xec, 0xe2, 0xaa, 0x16, 0x52, + 0xa0, 0x43, 0x43, 0xc4, 0x03, 0x11, 0xdf, 0x9c, 0x1e, 0x7d, 0x64, 0x65, 0xa4, 0x62, 0x09, 0xe1, + 0x5c, 0x48, 0x22, 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x67, 0x76, 0x7c, 0x04, 0x93, 0xcd, 0x44, 0xdf, 0xfd, 0xf4, 0x0c, 0xf8, 0xcd, + 0xe8, 0xb1, 0x3b, 0xfb, 0xd3, 0x85, 0xf7, 0x57, 0xa2, 0xdc, 0x06, 0xcf, 0x7c, 0x63, 0x6d, 0xae, + 0x86, 0x78, 0xee, 0xfe, 0xf6, 0xad, 0x65, 0x72, 0x51, 0x10, 0x9e, 0xc7, 0xa2, 0xce, 0x93, 0x9c, + 0x72, 0x3d, 0xe2, 0x89, 0x49, 0x91, 0x8a, 0x35, 0xff, 0xfb, 0xcb, 0x3f, 0x19, 0x16, 0x7f, 0x8d, + 0x3e, 0xf8, 0xc9, 0xc8, 0x9f, 0x15, 0xa2, 0xcd, 0xe2, 0x1f, 0x86, 0x8d, 0xae, 0x4e, 0xff, 0xee, + 0x73, 0xd7, 0x3a, 0x77, 0x3d, 0xe4, 0xae, 0xaf, 0x4e, 0x97, 0xbb, 0x7a, 0x83, 0xaf, 0xfe, 0x0b, + 0x00, 0x00, 0xff, 0xff, 0xf3, 0xdd, 0x11, 0x96, 0x45, 0x06, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/datastore/v1/query.pb.go b/vendor/google.golang.org/genproto/googleapis/datastore/v1/query.pb.go new file mode 100644 index 0000000000..bdfcc174f6 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/datastore/v1/query.pb.go @@ -0,0 +1,970 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/datastore/v1/query.proto + +package datastore + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf3 "github.com/golang/protobuf/ptypes/wrappers" +import _ "google.golang.org/genproto/googleapis/type/latlng" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Specifies what data the 'entity' field contains. +// A `ResultType` is either implied (for example, in `LookupResponse.missing` +// from `datastore.proto`, it is always `KEY_ONLY`) or specified by context +// (for example, in message `QueryResultBatch`, field `entity_result_type` +// specifies a `ResultType` for all the values in field `entity_results`). +type EntityResult_ResultType int32 + +const ( + // Unspecified. This value is never used. + EntityResult_RESULT_TYPE_UNSPECIFIED EntityResult_ResultType = 0 + // The key and properties. + EntityResult_FULL EntityResult_ResultType = 1 + // A projected subset of properties. The entity may have no key. + EntityResult_PROJECTION EntityResult_ResultType = 2 + // Only the key. + EntityResult_KEY_ONLY EntityResult_ResultType = 3 +) + +var EntityResult_ResultType_name = map[int32]string{ + 0: "RESULT_TYPE_UNSPECIFIED", + 1: "FULL", + 2: "PROJECTION", + 3: "KEY_ONLY", +} +var EntityResult_ResultType_value = map[string]int32{ + "RESULT_TYPE_UNSPECIFIED": 0, + "FULL": 1, + "PROJECTION": 2, + "KEY_ONLY": 3, +} + +func (x EntityResult_ResultType) String() string { + return proto.EnumName(EntityResult_ResultType_name, int32(x)) +} +func (EntityResult_ResultType) EnumDescriptor() ([]byte, []int) { return fileDescriptor2, []int{0, 0} } + +// The sort direction. +type PropertyOrder_Direction int32 + +const ( + // Unspecified. This value must not be used. + PropertyOrder_DIRECTION_UNSPECIFIED PropertyOrder_Direction = 0 + // Ascending. + PropertyOrder_ASCENDING PropertyOrder_Direction = 1 + // Descending. + PropertyOrder_DESCENDING PropertyOrder_Direction = 2 +) + +var PropertyOrder_Direction_name = map[int32]string{ + 0: "DIRECTION_UNSPECIFIED", + 1: "ASCENDING", + 2: "DESCENDING", +} +var PropertyOrder_Direction_value = map[string]int32{ + "DIRECTION_UNSPECIFIED": 0, + "ASCENDING": 1, + "DESCENDING": 2, +} + +func (x PropertyOrder_Direction) String() string { + return proto.EnumName(PropertyOrder_Direction_name, int32(x)) +} +func (PropertyOrder_Direction) EnumDescriptor() ([]byte, []int) { return fileDescriptor2, []int{5, 0} } + +// A composite filter operator. +type CompositeFilter_Operator int32 + +const ( + // Unspecified. This value must not be used. + CompositeFilter_OPERATOR_UNSPECIFIED CompositeFilter_Operator = 0 + // The results are required to satisfy each of the combined filters. + CompositeFilter_AND CompositeFilter_Operator = 1 +) + +var CompositeFilter_Operator_name = map[int32]string{ + 0: "OPERATOR_UNSPECIFIED", + 1: "AND", +} +var CompositeFilter_Operator_value = map[string]int32{ + "OPERATOR_UNSPECIFIED": 0, + "AND": 1, +} + +func (x CompositeFilter_Operator) String() string { + return proto.EnumName(CompositeFilter_Operator_name, int32(x)) +} +func (CompositeFilter_Operator) EnumDescriptor() ([]byte, []int) { return fileDescriptor2, []int{7, 0} } + +// A property filter operator. +type PropertyFilter_Operator int32 + +const ( + // Unspecified. This value must not be used. + PropertyFilter_OPERATOR_UNSPECIFIED PropertyFilter_Operator = 0 + // Less than. + PropertyFilter_LESS_THAN PropertyFilter_Operator = 1 + // Less than or equal. + PropertyFilter_LESS_THAN_OR_EQUAL PropertyFilter_Operator = 2 + // Greater than. + PropertyFilter_GREATER_THAN PropertyFilter_Operator = 3 + // Greater than or equal. + PropertyFilter_GREATER_THAN_OR_EQUAL PropertyFilter_Operator = 4 + // Equal. + PropertyFilter_EQUAL PropertyFilter_Operator = 5 + // Has ancestor. + PropertyFilter_HAS_ANCESTOR PropertyFilter_Operator = 11 +) + +var PropertyFilter_Operator_name = map[int32]string{ + 0: "OPERATOR_UNSPECIFIED", + 1: "LESS_THAN", + 2: "LESS_THAN_OR_EQUAL", + 3: "GREATER_THAN", + 4: "GREATER_THAN_OR_EQUAL", + 5: "EQUAL", + 11: "HAS_ANCESTOR", +} +var PropertyFilter_Operator_value = map[string]int32{ + "OPERATOR_UNSPECIFIED": 0, + "LESS_THAN": 1, + "LESS_THAN_OR_EQUAL": 2, + "GREATER_THAN": 3, + "GREATER_THAN_OR_EQUAL": 4, + "EQUAL": 5, + "HAS_ANCESTOR": 11, +} + +func (x PropertyFilter_Operator) String() string { + return proto.EnumName(PropertyFilter_Operator_name, int32(x)) +} +func (PropertyFilter_Operator) EnumDescriptor() ([]byte, []int) { return fileDescriptor2, []int{8, 0} } + +// The possible values for the `more_results` field. +type QueryResultBatch_MoreResultsType int32 + +const ( + // Unspecified. This value is never used. + QueryResultBatch_MORE_RESULTS_TYPE_UNSPECIFIED QueryResultBatch_MoreResultsType = 0 + // There may be additional batches to fetch from this query. + QueryResultBatch_NOT_FINISHED QueryResultBatch_MoreResultsType = 1 + // The query is finished, but there may be more results after the limit. + QueryResultBatch_MORE_RESULTS_AFTER_LIMIT QueryResultBatch_MoreResultsType = 2 + // The query is finished, but there may be more results after the end + // cursor. + QueryResultBatch_MORE_RESULTS_AFTER_CURSOR QueryResultBatch_MoreResultsType = 4 + // The query is finished, and there are no more results. + QueryResultBatch_NO_MORE_RESULTS QueryResultBatch_MoreResultsType = 3 +) + +var QueryResultBatch_MoreResultsType_name = map[int32]string{ + 0: "MORE_RESULTS_TYPE_UNSPECIFIED", + 1: "NOT_FINISHED", + 2: "MORE_RESULTS_AFTER_LIMIT", + 4: "MORE_RESULTS_AFTER_CURSOR", + 3: "NO_MORE_RESULTS", +} +var QueryResultBatch_MoreResultsType_value = map[string]int32{ + "MORE_RESULTS_TYPE_UNSPECIFIED": 0, + "NOT_FINISHED": 1, + "MORE_RESULTS_AFTER_LIMIT": 2, + "MORE_RESULTS_AFTER_CURSOR": 4, + "NO_MORE_RESULTS": 3, +} + +func (x QueryResultBatch_MoreResultsType) String() string { + return proto.EnumName(QueryResultBatch_MoreResultsType_name, int32(x)) +} +func (QueryResultBatch_MoreResultsType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor2, []int{11, 0} +} + +// The result of fetching an entity from Datastore. +type EntityResult struct { + // The resulting entity. + Entity *Entity `protobuf:"bytes,1,opt,name=entity" json:"entity,omitempty"` + // The version of the entity, a strictly positive number that monotonically + // increases with changes to the entity. + // + // This field is set for [`FULL`][google.datastore.v1.EntityResult.ResultType.FULL] entity + // results. + // + // For [missing][google.datastore.v1.LookupResponse.missing] entities in `LookupResponse`, this + // is the version of the snapshot that was used to look up the entity, and it + // is always set except for eventually consistent reads. + Version int64 `protobuf:"varint,4,opt,name=version" json:"version,omitempty"` + // A cursor that points to the position after the result entity. + // Set only when the `EntityResult` is part of a `QueryResultBatch` message. + Cursor []byte `protobuf:"bytes,3,opt,name=cursor,proto3" json:"cursor,omitempty"` +} + +func (m *EntityResult) Reset() { *m = EntityResult{} } +func (m *EntityResult) String() string { return proto.CompactTextString(m) } +func (*EntityResult) ProtoMessage() {} +func (*EntityResult) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} } + +func (m *EntityResult) GetEntity() *Entity { + if m != nil { + return m.Entity + } + return nil +} + +func (m *EntityResult) GetVersion() int64 { + if m != nil { + return m.Version + } + return 0 +} + +func (m *EntityResult) GetCursor() []byte { + if m != nil { + return m.Cursor + } + return nil +} + +// A query for entities. +type Query struct { + // The projection to return. Defaults to returning all properties. + Projection []*Projection `protobuf:"bytes,2,rep,name=projection" json:"projection,omitempty"` + // The kinds to query (if empty, returns entities of all kinds). + // Currently at most 1 kind may be specified. + Kind []*KindExpression `protobuf:"bytes,3,rep,name=kind" json:"kind,omitempty"` + // The filter to apply. + Filter *Filter `protobuf:"bytes,4,opt,name=filter" json:"filter,omitempty"` + // The order to apply to the query results (if empty, order is unspecified). + Order []*PropertyOrder `protobuf:"bytes,5,rep,name=order" json:"order,omitempty"` + // The properties to make distinct. The query results will contain the first + // result for each distinct combination of values for the given properties + // (if empty, all results are returned). + DistinctOn []*PropertyReference `protobuf:"bytes,6,rep,name=distinct_on,json=distinctOn" json:"distinct_on,omitempty"` + // A starting point for the query results. Query cursors are + // returned in query result batches and + // [can only be used to continue the same query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets). + StartCursor []byte `protobuf:"bytes,7,opt,name=start_cursor,json=startCursor,proto3" json:"start_cursor,omitempty"` + // An ending point for the query results. Query cursors are + // returned in query result batches and + // [can only be used to limit the same query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets). + EndCursor []byte `protobuf:"bytes,8,opt,name=end_cursor,json=endCursor,proto3" json:"end_cursor,omitempty"` + // The number of results to skip. Applies before limit, but after all other + // constraints. Optional. Must be >= 0 if specified. + Offset int32 `protobuf:"varint,10,opt,name=offset" json:"offset,omitempty"` + // The maximum number of results to return. Applies after all other + // constraints. Optional. + // Unspecified is interpreted as no limit. + // Must be >= 0 if specified. + Limit *google_protobuf3.Int32Value `protobuf:"bytes,12,opt,name=limit" json:"limit,omitempty"` +} + +func (m *Query) Reset() { *m = Query{} } +func (m *Query) String() string { return proto.CompactTextString(m) } +func (*Query) ProtoMessage() {} +func (*Query) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{1} } + +func (m *Query) GetProjection() []*Projection { + if m != nil { + return m.Projection + } + return nil +} + +func (m *Query) GetKind() []*KindExpression { + if m != nil { + return m.Kind + } + return nil +} + +func (m *Query) GetFilter() *Filter { + if m != nil { + return m.Filter + } + return nil +} + +func (m *Query) GetOrder() []*PropertyOrder { + if m != nil { + return m.Order + } + return nil +} + +func (m *Query) GetDistinctOn() []*PropertyReference { + if m != nil { + return m.DistinctOn + } + return nil +} + +func (m *Query) GetStartCursor() []byte { + if m != nil { + return m.StartCursor + } + return nil +} + +func (m *Query) GetEndCursor() []byte { + if m != nil { + return m.EndCursor + } + return nil +} + +func (m *Query) GetOffset() int32 { + if m != nil { + return m.Offset + } + return 0 +} + +func (m *Query) GetLimit() *google_protobuf3.Int32Value { + if m != nil { + return m.Limit + } + return nil +} + +// A representation of a kind. +type KindExpression struct { + // The name of the kind. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *KindExpression) Reset() { *m = KindExpression{} } +func (m *KindExpression) String() string { return proto.CompactTextString(m) } +func (*KindExpression) ProtoMessage() {} +func (*KindExpression) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{2} } + +func (m *KindExpression) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// A reference to a property relative to the kind expressions. +type PropertyReference struct { + // The name of the property. + // If name includes "."s, it may be interpreted as a property name path. + Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` +} + +func (m *PropertyReference) Reset() { *m = PropertyReference{} } +func (m *PropertyReference) String() string { return proto.CompactTextString(m) } +func (*PropertyReference) ProtoMessage() {} +func (*PropertyReference) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{3} } + +func (m *PropertyReference) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// A representation of a property in a projection. +type Projection struct { + // The property to project. + Property *PropertyReference `protobuf:"bytes,1,opt,name=property" json:"property,omitempty"` +} + +func (m *Projection) Reset() { *m = Projection{} } +func (m *Projection) String() string { return proto.CompactTextString(m) } +func (*Projection) ProtoMessage() {} +func (*Projection) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{4} } + +func (m *Projection) GetProperty() *PropertyReference { + if m != nil { + return m.Property + } + return nil +} + +// The desired order for a specific property. +type PropertyOrder struct { + // The property to order by. + Property *PropertyReference `protobuf:"bytes,1,opt,name=property" json:"property,omitempty"` + // The direction to order by. Defaults to `ASCENDING`. + Direction PropertyOrder_Direction `protobuf:"varint,2,opt,name=direction,enum=google.datastore.v1.PropertyOrder_Direction" json:"direction,omitempty"` +} + +func (m *PropertyOrder) Reset() { *m = PropertyOrder{} } +func (m *PropertyOrder) String() string { return proto.CompactTextString(m) } +func (*PropertyOrder) ProtoMessage() {} +func (*PropertyOrder) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{5} } + +func (m *PropertyOrder) GetProperty() *PropertyReference { + if m != nil { + return m.Property + } + return nil +} + +func (m *PropertyOrder) GetDirection() PropertyOrder_Direction { + if m != nil { + return m.Direction + } + return PropertyOrder_DIRECTION_UNSPECIFIED +} + +// A holder for any type of filter. +type Filter struct { + // The type of filter. + // + // Types that are valid to be assigned to FilterType: + // *Filter_CompositeFilter + // *Filter_PropertyFilter + FilterType isFilter_FilterType `protobuf_oneof:"filter_type"` +} + +func (m *Filter) Reset() { *m = Filter{} } +func (m *Filter) String() string { return proto.CompactTextString(m) } +func (*Filter) ProtoMessage() {} +func (*Filter) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{6} } + +type isFilter_FilterType interface { + isFilter_FilterType() +} + +type Filter_CompositeFilter struct { + CompositeFilter *CompositeFilter `protobuf:"bytes,1,opt,name=composite_filter,json=compositeFilter,oneof"` +} +type Filter_PropertyFilter struct { + PropertyFilter *PropertyFilter `protobuf:"bytes,2,opt,name=property_filter,json=propertyFilter,oneof"` +} + +func (*Filter_CompositeFilter) isFilter_FilterType() {} +func (*Filter_PropertyFilter) isFilter_FilterType() {} + +func (m *Filter) GetFilterType() isFilter_FilterType { + if m != nil { + return m.FilterType + } + return nil +} + +func (m *Filter) GetCompositeFilter() *CompositeFilter { + if x, ok := m.GetFilterType().(*Filter_CompositeFilter); ok { + return x.CompositeFilter + } + return nil +} + +func (m *Filter) GetPropertyFilter() *PropertyFilter { + if x, ok := m.GetFilterType().(*Filter_PropertyFilter); ok { + return x.PropertyFilter + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Filter) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _Filter_OneofMarshaler, _Filter_OneofUnmarshaler, _Filter_OneofSizer, []interface{}{ + (*Filter_CompositeFilter)(nil), + (*Filter_PropertyFilter)(nil), + } +} + +func _Filter_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Filter) + // filter_type + switch x := m.FilterType.(type) { + case *Filter_CompositeFilter: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.CompositeFilter); err != nil { + return err + } + case *Filter_PropertyFilter: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.PropertyFilter); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("Filter.FilterType has unexpected type %T", x) + } + return nil +} + +func _Filter_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Filter) + switch tag { + case 1: // filter_type.composite_filter + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(CompositeFilter) + err := b.DecodeMessage(msg) + m.FilterType = &Filter_CompositeFilter{msg} + return true, err + case 2: // filter_type.property_filter + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(PropertyFilter) + err := b.DecodeMessage(msg) + m.FilterType = &Filter_PropertyFilter{msg} + return true, err + default: + return false, nil + } +} + +func _Filter_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Filter) + // filter_type + switch x := m.FilterType.(type) { + case *Filter_CompositeFilter: + s := proto.Size(x.CompositeFilter) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Filter_PropertyFilter: + s := proto.Size(x.PropertyFilter) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// A filter that merges multiple other filters using the given operator. +type CompositeFilter struct { + // The operator for combining multiple filters. + Op CompositeFilter_Operator `protobuf:"varint,1,opt,name=op,enum=google.datastore.v1.CompositeFilter_Operator" json:"op,omitempty"` + // The list of filters to combine. + // Must contain at least one filter. + Filters []*Filter `protobuf:"bytes,2,rep,name=filters" json:"filters,omitempty"` +} + +func (m *CompositeFilter) Reset() { *m = CompositeFilter{} } +func (m *CompositeFilter) String() string { return proto.CompactTextString(m) } +func (*CompositeFilter) ProtoMessage() {} +func (*CompositeFilter) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{7} } + +func (m *CompositeFilter) GetOp() CompositeFilter_Operator { + if m != nil { + return m.Op + } + return CompositeFilter_OPERATOR_UNSPECIFIED +} + +func (m *CompositeFilter) GetFilters() []*Filter { + if m != nil { + return m.Filters + } + return nil +} + +// A filter on a specific property. +type PropertyFilter struct { + // The property to filter by. + Property *PropertyReference `protobuf:"bytes,1,opt,name=property" json:"property,omitempty"` + // The operator to filter by. + Op PropertyFilter_Operator `protobuf:"varint,2,opt,name=op,enum=google.datastore.v1.PropertyFilter_Operator" json:"op,omitempty"` + // The value to compare the property to. + Value *Value `protobuf:"bytes,3,opt,name=value" json:"value,omitempty"` +} + +func (m *PropertyFilter) Reset() { *m = PropertyFilter{} } +func (m *PropertyFilter) String() string { return proto.CompactTextString(m) } +func (*PropertyFilter) ProtoMessage() {} +func (*PropertyFilter) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{8} } + +func (m *PropertyFilter) GetProperty() *PropertyReference { + if m != nil { + return m.Property + } + return nil +} + +func (m *PropertyFilter) GetOp() PropertyFilter_Operator { + if m != nil { + return m.Op + } + return PropertyFilter_OPERATOR_UNSPECIFIED +} + +func (m *PropertyFilter) GetValue() *Value { + if m != nil { + return m.Value + } + return nil +} + +// A [GQL query](https://cloud.google.com/datastore/docs/apis/gql/gql_reference). +type GqlQuery struct { + // A string of the format described + // [here](https://cloud.google.com/datastore/docs/apis/gql/gql_reference). + QueryString string `protobuf:"bytes,1,opt,name=query_string,json=queryString" json:"query_string,omitempty"` + // When false, the query string must not contain any literals and instead must + // bind all values. For example, + // `SELECT * FROM Kind WHERE a = 'string literal'` is not allowed, while + // `SELECT * FROM Kind WHERE a = @value` is. + AllowLiterals bool `protobuf:"varint,2,opt,name=allow_literals,json=allowLiterals" json:"allow_literals,omitempty"` + // For each non-reserved named binding site in the query string, there must be + // a named parameter with that name, but not necessarily the inverse. + // + // Key must match regex `[A-Za-z_$][A-Za-z_$0-9]*`, must not match regex + // `__.*__`, and must not be `""`. + NamedBindings map[string]*GqlQueryParameter `protobuf:"bytes,5,rep,name=named_bindings,json=namedBindings" json:"named_bindings,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // Numbered binding site @1 references the first numbered parameter, + // effectively using 1-based indexing, rather than the usual 0. + // + // For each binding site numbered i in `query_string`, there must be an i-th + // numbered parameter. The inverse must also be true. + PositionalBindings []*GqlQueryParameter `protobuf:"bytes,4,rep,name=positional_bindings,json=positionalBindings" json:"positional_bindings,omitempty"` +} + +func (m *GqlQuery) Reset() { *m = GqlQuery{} } +func (m *GqlQuery) String() string { return proto.CompactTextString(m) } +func (*GqlQuery) ProtoMessage() {} +func (*GqlQuery) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{9} } + +func (m *GqlQuery) GetQueryString() string { + if m != nil { + return m.QueryString + } + return "" +} + +func (m *GqlQuery) GetAllowLiterals() bool { + if m != nil { + return m.AllowLiterals + } + return false +} + +func (m *GqlQuery) GetNamedBindings() map[string]*GqlQueryParameter { + if m != nil { + return m.NamedBindings + } + return nil +} + +func (m *GqlQuery) GetPositionalBindings() []*GqlQueryParameter { + if m != nil { + return m.PositionalBindings + } + return nil +} + +// A binding parameter for a GQL query. +type GqlQueryParameter struct { + // The type of parameter. + // + // Types that are valid to be assigned to ParameterType: + // *GqlQueryParameter_Value + // *GqlQueryParameter_Cursor + ParameterType isGqlQueryParameter_ParameterType `protobuf_oneof:"parameter_type"` +} + +func (m *GqlQueryParameter) Reset() { *m = GqlQueryParameter{} } +func (m *GqlQueryParameter) String() string { return proto.CompactTextString(m) } +func (*GqlQueryParameter) ProtoMessage() {} +func (*GqlQueryParameter) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{10} } + +type isGqlQueryParameter_ParameterType interface { + isGqlQueryParameter_ParameterType() +} + +type GqlQueryParameter_Value struct { + Value *Value `protobuf:"bytes,2,opt,name=value,oneof"` +} +type GqlQueryParameter_Cursor struct { + Cursor []byte `protobuf:"bytes,3,opt,name=cursor,proto3,oneof"` +} + +func (*GqlQueryParameter_Value) isGqlQueryParameter_ParameterType() {} +func (*GqlQueryParameter_Cursor) isGqlQueryParameter_ParameterType() {} + +func (m *GqlQueryParameter) GetParameterType() isGqlQueryParameter_ParameterType { + if m != nil { + return m.ParameterType + } + return nil +} + +func (m *GqlQueryParameter) GetValue() *Value { + if x, ok := m.GetParameterType().(*GqlQueryParameter_Value); ok { + return x.Value + } + return nil +} + +func (m *GqlQueryParameter) GetCursor() []byte { + if x, ok := m.GetParameterType().(*GqlQueryParameter_Cursor); ok { + return x.Cursor + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*GqlQueryParameter) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _GqlQueryParameter_OneofMarshaler, _GqlQueryParameter_OneofUnmarshaler, _GqlQueryParameter_OneofSizer, []interface{}{ + (*GqlQueryParameter_Value)(nil), + (*GqlQueryParameter_Cursor)(nil), + } +} + +func _GqlQueryParameter_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*GqlQueryParameter) + // parameter_type + switch x := m.ParameterType.(type) { + case *GqlQueryParameter_Value: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Value); err != nil { + return err + } + case *GqlQueryParameter_Cursor: + b.EncodeVarint(3<<3 | proto.WireBytes) + b.EncodeRawBytes(x.Cursor) + case nil: + default: + return fmt.Errorf("GqlQueryParameter.ParameterType has unexpected type %T", x) + } + return nil +} + +func _GqlQueryParameter_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*GqlQueryParameter) + switch tag { + case 2: // parameter_type.value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Value) + err := b.DecodeMessage(msg) + m.ParameterType = &GqlQueryParameter_Value{msg} + return true, err + case 3: // parameter_type.cursor + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.ParameterType = &GqlQueryParameter_Cursor{x} + return true, err + default: + return false, nil + } +} + +func _GqlQueryParameter_OneofSizer(msg proto.Message) (n int) { + m := msg.(*GqlQueryParameter) + // parameter_type + switch x := m.ParameterType.(type) { + case *GqlQueryParameter_Value: + s := proto.Size(x.Value) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *GqlQueryParameter_Cursor: + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Cursor))) + n += len(x.Cursor) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// A batch of results produced by a query. +type QueryResultBatch struct { + // The number of results skipped, typically because of an offset. + SkippedResults int32 `protobuf:"varint,6,opt,name=skipped_results,json=skippedResults" json:"skipped_results,omitempty"` + // A cursor that points to the position after the last skipped result. + // Will be set when `skipped_results` != 0. + SkippedCursor []byte `protobuf:"bytes,3,opt,name=skipped_cursor,json=skippedCursor,proto3" json:"skipped_cursor,omitempty"` + // The result type for every entity in `entity_results`. + EntityResultType EntityResult_ResultType `protobuf:"varint,1,opt,name=entity_result_type,json=entityResultType,enum=google.datastore.v1.EntityResult_ResultType" json:"entity_result_type,omitempty"` + // The results for this batch. + EntityResults []*EntityResult `protobuf:"bytes,2,rep,name=entity_results,json=entityResults" json:"entity_results,omitempty"` + // A cursor that points to the position after the last result in the batch. + EndCursor []byte `protobuf:"bytes,4,opt,name=end_cursor,json=endCursor,proto3" json:"end_cursor,omitempty"` + // The state of the query after the current batch. + MoreResults QueryResultBatch_MoreResultsType `protobuf:"varint,5,opt,name=more_results,json=moreResults,enum=google.datastore.v1.QueryResultBatch_MoreResultsType" json:"more_results,omitempty"` + // The version number of the snapshot this batch was returned from. + // This applies to the range of results from the query's `start_cursor` (or + // the beginning of the query if no cursor was given) to this batch's + // `end_cursor` (not the query's `end_cursor`). + // + // In a single transaction, subsequent query result batches for the same query + // can have a greater snapshot version number. Each batch's snapshot version + // is valid for all preceding batches. + // The value will be zero for eventually consistent queries. + SnapshotVersion int64 `protobuf:"varint,7,opt,name=snapshot_version,json=snapshotVersion" json:"snapshot_version,omitempty"` +} + +func (m *QueryResultBatch) Reset() { *m = QueryResultBatch{} } +func (m *QueryResultBatch) String() string { return proto.CompactTextString(m) } +func (*QueryResultBatch) ProtoMessage() {} +func (*QueryResultBatch) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{11} } + +func (m *QueryResultBatch) GetSkippedResults() int32 { + if m != nil { + return m.SkippedResults + } + return 0 +} + +func (m *QueryResultBatch) GetSkippedCursor() []byte { + if m != nil { + return m.SkippedCursor + } + return nil +} + +func (m *QueryResultBatch) GetEntityResultType() EntityResult_ResultType { + if m != nil { + return m.EntityResultType + } + return EntityResult_RESULT_TYPE_UNSPECIFIED +} + +func (m *QueryResultBatch) GetEntityResults() []*EntityResult { + if m != nil { + return m.EntityResults + } + return nil +} + +func (m *QueryResultBatch) GetEndCursor() []byte { + if m != nil { + return m.EndCursor + } + return nil +} + +func (m *QueryResultBatch) GetMoreResults() QueryResultBatch_MoreResultsType { + if m != nil { + return m.MoreResults + } + return QueryResultBatch_MORE_RESULTS_TYPE_UNSPECIFIED +} + +func (m *QueryResultBatch) GetSnapshotVersion() int64 { + if m != nil { + return m.SnapshotVersion + } + return 0 +} + +func init() { + proto.RegisterType((*EntityResult)(nil), "google.datastore.v1.EntityResult") + proto.RegisterType((*Query)(nil), "google.datastore.v1.Query") + proto.RegisterType((*KindExpression)(nil), "google.datastore.v1.KindExpression") + proto.RegisterType((*PropertyReference)(nil), "google.datastore.v1.PropertyReference") + proto.RegisterType((*Projection)(nil), "google.datastore.v1.Projection") + proto.RegisterType((*PropertyOrder)(nil), "google.datastore.v1.PropertyOrder") + proto.RegisterType((*Filter)(nil), "google.datastore.v1.Filter") + proto.RegisterType((*CompositeFilter)(nil), "google.datastore.v1.CompositeFilter") + proto.RegisterType((*PropertyFilter)(nil), "google.datastore.v1.PropertyFilter") + proto.RegisterType((*GqlQuery)(nil), "google.datastore.v1.GqlQuery") + proto.RegisterType((*GqlQueryParameter)(nil), "google.datastore.v1.GqlQueryParameter") + proto.RegisterType((*QueryResultBatch)(nil), "google.datastore.v1.QueryResultBatch") + proto.RegisterEnum("google.datastore.v1.EntityResult_ResultType", EntityResult_ResultType_name, EntityResult_ResultType_value) + proto.RegisterEnum("google.datastore.v1.PropertyOrder_Direction", PropertyOrder_Direction_name, PropertyOrder_Direction_value) + proto.RegisterEnum("google.datastore.v1.CompositeFilter_Operator", CompositeFilter_Operator_name, CompositeFilter_Operator_value) + proto.RegisterEnum("google.datastore.v1.PropertyFilter_Operator", PropertyFilter_Operator_name, PropertyFilter_Operator_value) + proto.RegisterEnum("google.datastore.v1.QueryResultBatch_MoreResultsType", QueryResultBatch_MoreResultsType_name, QueryResultBatch_MoreResultsType_value) +} + +func init() { proto.RegisterFile("google/datastore/v1/query.proto", fileDescriptor2) } + +var fileDescriptor2 = []byte{ + // 1313 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xdd, 0x72, 0xd3, 0x46, + 0x14, 0x8e, 0x64, 0x3b, 0x89, 0x8f, 0xff, 0xc4, 0xd2, 0x82, 0x08, 0x50, 0x12, 0x41, 0x4b, 0x3a, + 0x03, 0x36, 0x31, 0xc3, 0x94, 0x69, 0xe9, 0x74, 0xfc, 0xa3, 0xc4, 0x06, 0x63, 0x39, 0x6b, 0x27, + 0x14, 0x86, 0x19, 0x8d, 0xb0, 0x37, 0x46, 0x45, 0x96, 0xc4, 0x4a, 0x09, 0xcd, 0x83, 0x74, 0xa6, + 0x37, 0x7d, 0x81, 0x3e, 0x40, 0x2f, 0xfa, 0x00, 0x6d, 0xa7, 0xcf, 0xd0, 0xeb, 0x5e, 0xf7, 0x11, + 0x3a, 0xda, 0x5d, 0xf9, 0x2f, 0xc6, 0xe4, 0x82, 0x3b, 0xed, 0xd9, 0xef, 0xfb, 0xce, 0x9e, 0xb3, + 0x67, 0x8f, 0x0e, 0xdc, 0x18, 0x7a, 0xde, 0xd0, 0x21, 0xa5, 0x81, 0x15, 0x5a, 0x41, 0xe8, 0x51, + 0x52, 0x3a, 0xd9, 0x29, 0xb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, 0x2b, 0x49, 0x74, 0x11, 0x0a, 0x6d, + 0xc3, 0x9c, 0x46, 0x28, 0x89, 0xea, 0x2f, 0x12, 0x5c, 0xee, 0x7b, 0xa3, 0x45, 0xf9, 0xa8, 0x02, + 0xaf, 0xea, 0x68, 0x9a, 0xe9, 0x48, 0x2f, 0x1e, 0x09, 0xc8, 0xd0, 0x73, 0x2c, 0x77, 0x58, 0xf4, + 0xe8, 0xb0, 0x34, 0x24, 0x2e, 0x9b, 0x75, 0x4a, 0x7c, 0xcb, 0xf2, 0xed, 0x60, 0x66, 0x92, 0xff, + 0x66, 0xbc, 0xf8, 0x55, 0xbe, 0xb2, 0xc7, 0xe9, 0x35, 0xc7, 0x3b, 0x1e, 0x14, 0xeb, 0x63, 0x3f, + 0x87, 0x3b, 0x7f, 0xc7, 0x7b, 0x2f, 0xd9, 0xde, 0xcb, 0xf1, 0xde, 0xcb, 0xc3, 0x9d, 0x57, 0xab, + 0xcc, 0xc1, 0xfd, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0xcd, 0x38, 0x05, 0xaa, 0x7d, 0x0c, 0x00, + 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/datastore/v1beta3/datastore.pb.go b/vendor/google.golang.org/genproto/googleapis/datastore/v1beta3/datastore.pb.go new file mode 100644 index 0000000000..4330f528b0 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/datastore/v1beta3/datastore.pb.go @@ -0,0 +1,1693 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/datastore/v1beta3/datastore.proto + +/* +Package datastore is a generated protocol buffer package. + +It is generated from these files: + google/datastore/v1beta3/datastore.proto + google/datastore/v1beta3/entity.proto + google/datastore/v1beta3/query.proto + +It has these top-level messages: + LookupRequest + LookupResponse + RunQueryRequest + RunQueryResponse + BeginTransactionRequest + BeginTransactionResponse + RollbackRequest + RollbackResponse + CommitRequest + CommitResponse + AllocateIdsRequest + AllocateIdsResponse + ReserveIdsRequest + ReserveIdsResponse + Mutation + MutationResult + ReadOptions + TransactionOptions + PartitionId + Key + ArrayValue + Value + Entity + EntityResult + Query + KindExpression + PropertyReference + Projection + PropertyOrder + Filter + CompositeFilter + PropertyFilter + GqlQuery + GqlQueryParameter + QueryResultBatch +*/ +package datastore + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// The modes available for commits. +type CommitRequest_Mode int32 + +const ( + // Unspecified. This value must not be used. + CommitRequest_MODE_UNSPECIFIED CommitRequest_Mode = 0 + // Transactional: The mutations are either all applied, or none are applied. + // Learn about transactions [here](https://cloud.google.com/datastore/docs/concepts/transactions). + CommitRequest_TRANSACTIONAL CommitRequest_Mode = 1 + // Non-transactional: The mutations may not apply as all or none. + CommitRequest_NON_TRANSACTIONAL CommitRequest_Mode = 2 +) + +var CommitRequest_Mode_name = map[int32]string{ + 0: "MODE_UNSPECIFIED", + 1: "TRANSACTIONAL", + 2: "NON_TRANSACTIONAL", +} +var CommitRequest_Mode_value = map[string]int32{ + "MODE_UNSPECIFIED": 0, + "TRANSACTIONAL": 1, + "NON_TRANSACTIONAL": 2, +} + +func (x CommitRequest_Mode) String() string { + return proto.EnumName(CommitRequest_Mode_name, int32(x)) +} +func (CommitRequest_Mode) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{8, 0} } + +// The possible values for read consistencies. +type ReadOptions_ReadConsistency int32 + +const ( + // Unspecified. This value must not be used. + ReadOptions_READ_CONSISTENCY_UNSPECIFIED ReadOptions_ReadConsistency = 0 + // Strong consistency. + ReadOptions_STRONG ReadOptions_ReadConsistency = 1 + // Eventual consistency. + ReadOptions_EVENTUAL ReadOptions_ReadConsistency = 2 +) + +var ReadOptions_ReadConsistency_name = map[int32]string{ + 0: "READ_CONSISTENCY_UNSPECIFIED", + 1: "STRONG", + 2: "EVENTUAL", +} +var ReadOptions_ReadConsistency_value = map[string]int32{ + "READ_CONSISTENCY_UNSPECIFIED": 0, + "STRONG": 1, + "EVENTUAL": 2, +} + +func (x ReadOptions_ReadConsistency) String() string { + return proto.EnumName(ReadOptions_ReadConsistency_name, int32(x)) +} +func (ReadOptions_ReadConsistency) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{16, 0} +} + +// The request for [Datastore.Lookup][google.datastore.v1beta3.Datastore.Lookup]. +type LookupRequest struct { + // The ID of the project against which to make the request. + ProjectId string `protobuf:"bytes,8,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The options for this lookup request. + ReadOptions *ReadOptions `protobuf:"bytes,1,opt,name=read_options,json=readOptions" json:"read_options,omitempty"` + // Keys of entities to look up. + Keys []*Key `protobuf:"bytes,3,rep,name=keys" json:"keys,omitempty"` +} + +func (m *LookupRequest) Reset() { *m = LookupRequest{} } +func (m *LookupRequest) String() string { return proto.CompactTextString(m) } +func (*LookupRequest) ProtoMessage() {} +func (*LookupRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *LookupRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *LookupRequest) GetReadOptions() *ReadOptions { + if m != nil { + return m.ReadOptions + } + return nil +} + +func (m *LookupRequest) GetKeys() []*Key { + if m != nil { + return m.Keys + } + return nil +} + +// The response for [Datastore.Lookup][google.datastore.v1beta3.Datastore.Lookup]. +type LookupResponse struct { + // Entities found as `ResultType.FULL` entities. The order of results in this + // field is undefined and has no relation to the order of the keys in the + // input. + Found []*EntityResult `protobuf:"bytes,1,rep,name=found" json:"found,omitempty"` + // Entities not found as `ResultType.KEY_ONLY` entities. The order of results + // in this field is undefined and has no relation to the order of the keys + // in the input. + Missing []*EntityResult `protobuf:"bytes,2,rep,name=missing" json:"missing,omitempty"` + // A list of keys that were not looked up due to resource constraints. The + // order of results in this field is undefined and has no relation to the + // order of the keys in the input. + Deferred []*Key `protobuf:"bytes,3,rep,name=deferred" json:"deferred,omitempty"` +} + +func (m *LookupResponse) Reset() { *m = LookupResponse{} } +func (m *LookupResponse) String() string { return proto.CompactTextString(m) } +func (*LookupResponse) ProtoMessage() {} +func (*LookupResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *LookupResponse) GetFound() []*EntityResult { + if m != nil { + return m.Found + } + return nil +} + +func (m *LookupResponse) GetMissing() []*EntityResult { + if m != nil { + return m.Missing + } + return nil +} + +func (m *LookupResponse) GetDeferred() []*Key { + if m != nil { + return m.Deferred + } + return nil +} + +// The request for [Datastore.RunQuery][google.datastore.v1beta3.Datastore.RunQuery]. +type RunQueryRequest struct { + // The ID of the project against which to make the request. + ProjectId string `protobuf:"bytes,8,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // Entities are partitioned into subsets, identified by a partition ID. + // Queries are scoped to a single partition. + // This partition ID is normalized with the standard default context + // partition ID. + PartitionId *PartitionId `protobuf:"bytes,2,opt,name=partition_id,json=partitionId" json:"partition_id,omitempty"` + // The options for this query. + ReadOptions *ReadOptions `protobuf:"bytes,1,opt,name=read_options,json=readOptions" json:"read_options,omitempty"` + // The type of query. + // + // Types that are valid to be assigned to QueryType: + // *RunQueryRequest_Query + // *RunQueryRequest_GqlQuery + QueryType isRunQueryRequest_QueryType `protobuf_oneof:"query_type"` +} + +func (m *RunQueryRequest) Reset() { *m = RunQueryRequest{} } +func (m *RunQueryRequest) String() string { return proto.CompactTextString(m) } +func (*RunQueryRequest) ProtoMessage() {} +func (*RunQueryRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +type isRunQueryRequest_QueryType interface { + isRunQueryRequest_QueryType() +} + +type RunQueryRequest_Query struct { + Query *Query `protobuf:"bytes,3,opt,name=query,oneof"` +} +type RunQueryRequest_GqlQuery struct { + GqlQuery *GqlQuery `protobuf:"bytes,7,opt,name=gql_query,json=gqlQuery,oneof"` +} + +func (*RunQueryRequest_Query) isRunQueryRequest_QueryType() {} +func (*RunQueryRequest_GqlQuery) isRunQueryRequest_QueryType() {} + +func (m *RunQueryRequest) GetQueryType() isRunQueryRequest_QueryType { + if m != nil { + return m.QueryType + } + return nil +} + +func (m *RunQueryRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *RunQueryRequest) GetPartitionId() *PartitionId { + if m != nil { + return m.PartitionId + } + return nil +} + +func (m *RunQueryRequest) GetReadOptions() *ReadOptions { + if m != nil { + return m.ReadOptions + } + return nil +} + +func (m *RunQueryRequest) GetQuery() *Query { + if x, ok := m.GetQueryType().(*RunQueryRequest_Query); ok { + return x.Query + } + return nil +} + +func (m *RunQueryRequest) GetGqlQuery() *GqlQuery { + if x, ok := m.GetQueryType().(*RunQueryRequest_GqlQuery); ok { + return x.GqlQuery + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*RunQueryRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _RunQueryRequest_OneofMarshaler, _RunQueryRequest_OneofUnmarshaler, _RunQueryRequest_OneofSizer, []interface{}{ + (*RunQueryRequest_Query)(nil), + (*RunQueryRequest_GqlQuery)(nil), + } +} + +func _RunQueryRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*RunQueryRequest) + // query_type + switch x := m.QueryType.(type) { + case *RunQueryRequest_Query: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Query); err != nil { + return err + } + case *RunQueryRequest_GqlQuery: + b.EncodeVarint(7<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.GqlQuery); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("RunQueryRequest.QueryType has unexpected type %T", x) + } + return nil +} + +func _RunQueryRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*RunQueryRequest) + switch tag { + case 3: // query_type.query + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Query) + err := b.DecodeMessage(msg) + m.QueryType = &RunQueryRequest_Query{msg} + return true, err + case 7: // query_type.gql_query + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(GqlQuery) + err := b.DecodeMessage(msg) + m.QueryType = &RunQueryRequest_GqlQuery{msg} + return true, err + default: + return false, nil + } +} + +func _RunQueryRequest_OneofSizer(msg proto.Message) (n int) { + m := msg.(*RunQueryRequest) + // query_type + switch x := m.QueryType.(type) { + case *RunQueryRequest_Query: + s := proto.Size(x.Query) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *RunQueryRequest_GqlQuery: + s := proto.Size(x.GqlQuery) + n += proto.SizeVarint(7<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// The response for [Datastore.RunQuery][google.datastore.v1beta3.Datastore.RunQuery]. +type RunQueryResponse struct { + // A batch of query results (always present). + Batch *QueryResultBatch `protobuf:"bytes,1,opt,name=batch" json:"batch,omitempty"` + // The parsed form of the `GqlQuery` from the request, if it was set. + Query *Query `protobuf:"bytes,2,opt,name=query" json:"query,omitempty"` +} + +func (m *RunQueryResponse) Reset() { *m = RunQueryResponse{} } +func (m *RunQueryResponse) String() string { return proto.CompactTextString(m) } +func (*RunQueryResponse) ProtoMessage() {} +func (*RunQueryResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *RunQueryResponse) GetBatch() *QueryResultBatch { + if m != nil { + return m.Batch + } + return nil +} + +func (m *RunQueryResponse) GetQuery() *Query { + if m != nil { + return m.Query + } + return nil +} + +// The request for [Datastore.BeginTransaction][google.datastore.v1beta3.Datastore.BeginTransaction]. +type BeginTransactionRequest struct { + // The ID of the project against which to make the request. + ProjectId string `protobuf:"bytes,8,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // Options for a new transaction. + TransactionOptions *TransactionOptions `protobuf:"bytes,10,opt,name=transaction_options,json=transactionOptions" json:"transaction_options,omitempty"` +} + +func (m *BeginTransactionRequest) Reset() { *m = BeginTransactionRequest{} } +func (m *BeginTransactionRequest) String() string { return proto.CompactTextString(m) } +func (*BeginTransactionRequest) ProtoMessage() {} +func (*BeginTransactionRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *BeginTransactionRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *BeginTransactionRequest) GetTransactionOptions() *TransactionOptions { + if m != nil { + return m.TransactionOptions + } + return nil +} + +// The response for [Datastore.BeginTransaction][google.datastore.v1beta3.Datastore.BeginTransaction]. +type BeginTransactionResponse struct { + // The transaction identifier (always present). + Transaction []byte `protobuf:"bytes,1,opt,name=transaction,proto3" json:"transaction,omitempty"` +} + +func (m *BeginTransactionResponse) Reset() { *m = BeginTransactionResponse{} } +func (m *BeginTransactionResponse) String() string { return proto.CompactTextString(m) } +func (*BeginTransactionResponse) ProtoMessage() {} +func (*BeginTransactionResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *BeginTransactionResponse) GetTransaction() []byte { + if m != nil { + return m.Transaction + } + return nil +} + +// The request for [Datastore.Rollback][google.datastore.v1beta3.Datastore.Rollback]. +type RollbackRequest struct { + // The ID of the project against which to make the request. + ProjectId string `protobuf:"bytes,8,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The transaction identifier, returned by a call to + // [Datastore.BeginTransaction][google.datastore.v1beta3.Datastore.BeginTransaction]. + Transaction []byte `protobuf:"bytes,1,opt,name=transaction,proto3" json:"transaction,omitempty"` +} + +func (m *RollbackRequest) Reset() { *m = RollbackRequest{} } +func (m *RollbackRequest) String() string { return proto.CompactTextString(m) } +func (*RollbackRequest) ProtoMessage() {} +func (*RollbackRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *RollbackRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *RollbackRequest) GetTransaction() []byte { + if m != nil { + return m.Transaction + } + return nil +} + +// The response for [Datastore.Rollback][google.datastore.v1beta3.Datastore.Rollback]. +// (an empty message). +type RollbackResponse struct { +} + +func (m *RollbackResponse) Reset() { *m = RollbackResponse{} } +func (m *RollbackResponse) String() string { return proto.CompactTextString(m) } +func (*RollbackResponse) ProtoMessage() {} +func (*RollbackResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +// The request for [Datastore.Commit][google.datastore.v1beta3.Datastore.Commit]. +type CommitRequest struct { + // The ID of the project against which to make the request. + ProjectId string `protobuf:"bytes,8,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The type of commit to perform. Defaults to `TRANSACTIONAL`. + Mode CommitRequest_Mode `protobuf:"varint,5,opt,name=mode,enum=google.datastore.v1beta3.CommitRequest_Mode" json:"mode,omitempty"` + // Must be set when mode is `TRANSACTIONAL`. + // + // Types that are valid to be assigned to TransactionSelector: + // *CommitRequest_Transaction + TransactionSelector isCommitRequest_TransactionSelector `protobuf_oneof:"transaction_selector"` + // The mutations to perform. + // + // When mode is `TRANSACTIONAL`, mutations affecting a single entity are + // applied in order. The following sequences of mutations affecting a single + // entity are not permitted in a single `Commit` request: + // + // - `insert` followed by `insert` + // - `update` followed by `insert` + // - `upsert` followed by `insert` + // - `delete` followed by `update` + // + // When mode is `NON_TRANSACTIONAL`, no two mutations may affect a single + // entity. + Mutations []*Mutation `protobuf:"bytes,6,rep,name=mutations" json:"mutations,omitempty"` +} + +func (m *CommitRequest) Reset() { *m = CommitRequest{} } +func (m *CommitRequest) String() string { return proto.CompactTextString(m) } +func (*CommitRequest) ProtoMessage() {} +func (*CommitRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +type isCommitRequest_TransactionSelector interface { + isCommitRequest_TransactionSelector() +} + +type CommitRequest_Transaction struct { + Transaction []byte `protobuf:"bytes,1,opt,name=transaction,proto3,oneof"` +} + +func (*CommitRequest_Transaction) isCommitRequest_TransactionSelector() {} + +func (m *CommitRequest) GetTransactionSelector() isCommitRequest_TransactionSelector { + if m != nil { + return m.TransactionSelector + } + return nil +} + +func (m *CommitRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *CommitRequest) GetMode() CommitRequest_Mode { + if m != nil { + return m.Mode + } + return CommitRequest_MODE_UNSPECIFIED +} + +func (m *CommitRequest) GetTransaction() []byte { + if x, ok := m.GetTransactionSelector().(*CommitRequest_Transaction); ok { + return x.Transaction + } + return nil +} + +func (m *CommitRequest) GetMutations() []*Mutation { + if m != nil { + return m.Mutations + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*CommitRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _CommitRequest_OneofMarshaler, _CommitRequest_OneofUnmarshaler, _CommitRequest_OneofSizer, []interface{}{ + (*CommitRequest_Transaction)(nil), + } +} + +func _CommitRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*CommitRequest) + // transaction_selector + switch x := m.TransactionSelector.(type) { + case *CommitRequest_Transaction: + b.EncodeVarint(1<<3 | proto.WireBytes) + b.EncodeRawBytes(x.Transaction) + case nil: + default: + return fmt.Errorf("CommitRequest.TransactionSelector has unexpected type %T", x) + } + return nil +} + +func _CommitRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*CommitRequest) + switch tag { + case 1: // transaction_selector.transaction + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.TransactionSelector = &CommitRequest_Transaction{x} + return true, err + default: + return false, nil + } +} + +func _CommitRequest_OneofSizer(msg proto.Message) (n int) { + m := msg.(*CommitRequest) + // transaction_selector + switch x := m.TransactionSelector.(type) { + case *CommitRequest_Transaction: + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Transaction))) + n += len(x.Transaction) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// The response for [Datastore.Commit][google.datastore.v1beta3.Datastore.Commit]. +type CommitResponse struct { + // The result of performing the mutations. + // The i-th mutation result corresponds to the i-th mutation in the request. + MutationResults []*MutationResult `protobuf:"bytes,3,rep,name=mutation_results,json=mutationResults" json:"mutation_results,omitempty"` + // The number of index entries updated during the commit, or zero if none were + // updated. + IndexUpdates int32 `protobuf:"varint,4,opt,name=index_updates,json=indexUpdates" json:"index_updates,omitempty"` +} + +func (m *CommitResponse) Reset() { *m = CommitResponse{} } +func (m *CommitResponse) String() string { return proto.CompactTextString(m) } +func (*CommitResponse) ProtoMessage() {} +func (*CommitResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *CommitResponse) GetMutationResults() []*MutationResult { + if m != nil { + return m.MutationResults + } + return nil +} + +func (m *CommitResponse) GetIndexUpdates() int32 { + if m != nil { + return m.IndexUpdates + } + return 0 +} + +// The request for [Datastore.AllocateIds][google.datastore.v1beta3.Datastore.AllocateIds]. +type AllocateIdsRequest struct { + // The ID of the project against which to make the request. + ProjectId string `protobuf:"bytes,8,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // A list of keys with incomplete key paths for which to allocate IDs. + // No key may be reserved/read-only. + Keys []*Key `protobuf:"bytes,1,rep,name=keys" json:"keys,omitempty"` +} + +func (m *AllocateIdsRequest) Reset() { *m = AllocateIdsRequest{} } +func (m *AllocateIdsRequest) String() string { return proto.CompactTextString(m) } +func (*AllocateIdsRequest) ProtoMessage() {} +func (*AllocateIdsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *AllocateIdsRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *AllocateIdsRequest) GetKeys() []*Key { + if m != nil { + return m.Keys + } + return nil +} + +// The response for [Datastore.AllocateIds][google.datastore.v1beta3.Datastore.AllocateIds]. +type AllocateIdsResponse struct { + // The keys specified in the request (in the same order), each with + // its key path completed with a newly allocated ID. + Keys []*Key `protobuf:"bytes,1,rep,name=keys" json:"keys,omitempty"` +} + +func (m *AllocateIdsResponse) Reset() { *m = AllocateIdsResponse{} } +func (m *AllocateIdsResponse) String() string { return proto.CompactTextString(m) } +func (*AllocateIdsResponse) ProtoMessage() {} +func (*AllocateIdsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } + +func (m *AllocateIdsResponse) GetKeys() []*Key { + if m != nil { + return m.Keys + } + return nil +} + +// The request for [Datastore.ReserveIds][google.datastore.v1beta3.Datastore.ReserveIds]. +type ReserveIdsRequest struct { + // The ID of the project against which to make the request. + ProjectId string `protobuf:"bytes,8,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // If not empty, the ID of the database against which to make the request. + DatabaseId string `protobuf:"bytes,9,opt,name=database_id,json=databaseId" json:"database_id,omitempty"` + // A list of keys with complete key paths whose numeric IDs should not be + // auto-allocated. + Keys []*Key `protobuf:"bytes,1,rep,name=keys" json:"keys,omitempty"` +} + +func (m *ReserveIdsRequest) Reset() { *m = ReserveIdsRequest{} } +func (m *ReserveIdsRequest) String() string { return proto.CompactTextString(m) } +func (*ReserveIdsRequest) ProtoMessage() {} +func (*ReserveIdsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } + +func (m *ReserveIdsRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *ReserveIdsRequest) GetDatabaseId() string { + if m != nil { + return m.DatabaseId + } + return "" +} + +func (m *ReserveIdsRequest) GetKeys() []*Key { + if m != nil { + return m.Keys + } + return nil +} + +// The response for [Datastore.ReserveIds][google.datastore.v1beta3.Datastore.ReserveIds]. +type ReserveIdsResponse struct { +} + +func (m *ReserveIdsResponse) Reset() { *m = ReserveIdsResponse{} } +func (m *ReserveIdsResponse) String() string { return proto.CompactTextString(m) } +func (*ReserveIdsResponse) ProtoMessage() {} +func (*ReserveIdsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } + +// A mutation to apply to an entity. +type Mutation struct { + // The mutation operation. + // + // For `insert`, `update`, and `upsert`: + // - The entity's key must not be reserved/read-only. + // - No property in the entity may have a reserved name, + // not even a property in an entity in a value. + // - No value in the entity may have meaning 18, + // not even a value in an entity in another value. + // + // Types that are valid to be assigned to Operation: + // *Mutation_Insert + // *Mutation_Update + // *Mutation_Upsert + // *Mutation_Delete + Operation isMutation_Operation `protobuf_oneof:"operation"` + // When set, the server will detect whether or not this mutation conflicts + // with the current version of the entity on the server. Conflicting mutations + // are not applied, and are marked as such in MutationResult. + // + // Types that are valid to be assigned to ConflictDetectionStrategy: + // *Mutation_BaseVersion + ConflictDetectionStrategy isMutation_ConflictDetectionStrategy `protobuf_oneof:"conflict_detection_strategy"` +} + +func (m *Mutation) Reset() { *m = Mutation{} } +func (m *Mutation) String() string { return proto.CompactTextString(m) } +func (*Mutation) ProtoMessage() {} +func (*Mutation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } + +type isMutation_Operation interface { + isMutation_Operation() +} +type isMutation_ConflictDetectionStrategy interface { + isMutation_ConflictDetectionStrategy() +} + +type Mutation_Insert struct { + Insert *Entity `protobuf:"bytes,4,opt,name=insert,oneof"` +} +type Mutation_Update struct { + Update *Entity `protobuf:"bytes,5,opt,name=update,oneof"` +} +type Mutation_Upsert struct { + Upsert *Entity `protobuf:"bytes,6,opt,name=upsert,oneof"` +} +type Mutation_Delete struct { + Delete *Key `protobuf:"bytes,7,opt,name=delete,oneof"` +} +type Mutation_BaseVersion struct { + BaseVersion int64 `protobuf:"varint,8,opt,name=base_version,json=baseVersion,oneof"` +} + +func (*Mutation_Insert) isMutation_Operation() {} +func (*Mutation_Update) isMutation_Operation() {} +func (*Mutation_Upsert) isMutation_Operation() {} +func (*Mutation_Delete) isMutation_Operation() {} +func (*Mutation_BaseVersion) isMutation_ConflictDetectionStrategy() {} + +func (m *Mutation) GetOperation() isMutation_Operation { + if m != nil { + return m.Operation + } + return nil +} +func (m *Mutation) GetConflictDetectionStrategy() isMutation_ConflictDetectionStrategy { + if m != nil { + return m.ConflictDetectionStrategy + } + return nil +} + +func (m *Mutation) GetInsert() *Entity { + if x, ok := m.GetOperation().(*Mutation_Insert); ok { + return x.Insert + } + return nil +} + +func (m *Mutation) GetUpdate() *Entity { + if x, ok := m.GetOperation().(*Mutation_Update); ok { + return x.Update + } + return nil +} + +func (m *Mutation) GetUpsert() *Entity { + if x, ok := m.GetOperation().(*Mutation_Upsert); ok { + return x.Upsert + } + return nil +} + +func (m *Mutation) GetDelete() *Key { + if x, ok := m.GetOperation().(*Mutation_Delete); ok { + return x.Delete + } + return nil +} + +func (m *Mutation) GetBaseVersion() int64 { + if x, ok := m.GetConflictDetectionStrategy().(*Mutation_BaseVersion); ok { + return x.BaseVersion + } + return 0 +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Mutation) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _Mutation_OneofMarshaler, _Mutation_OneofUnmarshaler, _Mutation_OneofSizer, []interface{}{ + (*Mutation_Insert)(nil), + (*Mutation_Update)(nil), + (*Mutation_Upsert)(nil), + (*Mutation_Delete)(nil), + (*Mutation_BaseVersion)(nil), + } +} + +func _Mutation_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Mutation) + // operation + switch x := m.Operation.(type) { + case *Mutation_Insert: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Insert); err != nil { + return err + } + case *Mutation_Update: + b.EncodeVarint(5<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Update); err != nil { + return err + } + case *Mutation_Upsert: + b.EncodeVarint(6<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Upsert); err != nil { + return err + } + case *Mutation_Delete: + b.EncodeVarint(7<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Delete); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("Mutation.Operation has unexpected type %T", x) + } + // conflict_detection_strategy + switch x := m.ConflictDetectionStrategy.(type) { + case *Mutation_BaseVersion: + b.EncodeVarint(8<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.BaseVersion)) + case nil: + default: + return fmt.Errorf("Mutation.ConflictDetectionStrategy has unexpected type %T", x) + } + return nil +} + +func _Mutation_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Mutation) + switch tag { + case 4: // operation.insert + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Entity) + err := b.DecodeMessage(msg) + m.Operation = &Mutation_Insert{msg} + return true, err + case 5: // operation.update + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Entity) + err := b.DecodeMessage(msg) + m.Operation = &Mutation_Update{msg} + return true, err + case 6: // operation.upsert + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Entity) + err := b.DecodeMessage(msg) + m.Operation = &Mutation_Upsert{msg} + return true, err + case 7: // operation.delete + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Key) + err := b.DecodeMessage(msg) + m.Operation = &Mutation_Delete{msg} + return true, err + case 8: // conflict_detection_strategy.base_version + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.ConflictDetectionStrategy = &Mutation_BaseVersion{int64(x)} + return true, err + default: + return false, nil + } +} + +func _Mutation_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Mutation) + // operation + switch x := m.Operation.(type) { + case *Mutation_Insert: + s := proto.Size(x.Insert) + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Mutation_Update: + s := proto.Size(x.Update) + n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Mutation_Upsert: + s := proto.Size(x.Upsert) + n += proto.SizeVarint(6<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Mutation_Delete: + s := proto.Size(x.Delete) + n += proto.SizeVarint(7<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + // conflict_detection_strategy + switch x := m.ConflictDetectionStrategy.(type) { + case *Mutation_BaseVersion: + n += proto.SizeVarint(8<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.BaseVersion)) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// The result of applying a mutation. +type MutationResult struct { + // The automatically allocated key. + // Set only when the mutation allocated a key. + Key *Key `protobuf:"bytes,3,opt,name=key" json:"key,omitempty"` + // The version of the entity on the server after processing the mutation. If + // the mutation doesn't change anything on the server, then the version will + // be the version of the current entity or, if no entity is present, a version + // that is strictly greater than the version of any previous entity and less + // than the version of any possible future entity. + Version int64 `protobuf:"varint,4,opt,name=version" json:"version,omitempty"` + // Whether a conflict was detected for this mutation. Always false when a + // conflict detection strategy field is not set in the mutation. + ConflictDetected bool `protobuf:"varint,5,opt,name=conflict_detected,json=conflictDetected" json:"conflict_detected,omitempty"` +} + +func (m *MutationResult) Reset() { *m = MutationResult{} } +func (m *MutationResult) String() string { return proto.CompactTextString(m) } +func (*MutationResult) ProtoMessage() {} +func (*MutationResult) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } + +func (m *MutationResult) GetKey() *Key { + if m != nil { + return m.Key + } + return nil +} + +func (m *MutationResult) GetVersion() int64 { + if m != nil { + return m.Version + } + return 0 +} + +func (m *MutationResult) GetConflictDetected() bool { + if m != nil { + return m.ConflictDetected + } + return false +} + +// The options shared by read requests. +type ReadOptions struct { + // If not specified, lookups and ancestor queries default to + // `read_consistency`=`STRONG`, global queries default to + // `read_consistency`=`EVENTUAL`. + // + // Types that are valid to be assigned to ConsistencyType: + // *ReadOptions_ReadConsistency_ + // *ReadOptions_Transaction + ConsistencyType isReadOptions_ConsistencyType `protobuf_oneof:"consistency_type"` +} + +func (m *ReadOptions) Reset() { *m = ReadOptions{} } +func (m *ReadOptions) String() string { return proto.CompactTextString(m) } +func (*ReadOptions) ProtoMessage() {} +func (*ReadOptions) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} } + +type isReadOptions_ConsistencyType interface { + isReadOptions_ConsistencyType() +} + +type ReadOptions_ReadConsistency_ struct { + ReadConsistency ReadOptions_ReadConsistency `protobuf:"varint,1,opt,name=read_consistency,json=readConsistency,enum=google.datastore.v1beta3.ReadOptions_ReadConsistency,oneof"` +} +type ReadOptions_Transaction struct { + Transaction []byte `protobuf:"bytes,2,opt,name=transaction,proto3,oneof"` +} + +func (*ReadOptions_ReadConsistency_) isReadOptions_ConsistencyType() {} +func (*ReadOptions_Transaction) isReadOptions_ConsistencyType() {} + +func (m *ReadOptions) GetConsistencyType() isReadOptions_ConsistencyType { + if m != nil { + return m.ConsistencyType + } + return nil +} + +func (m *ReadOptions) GetReadConsistency() ReadOptions_ReadConsistency { + if x, ok := m.GetConsistencyType().(*ReadOptions_ReadConsistency_); ok { + return x.ReadConsistency + } + return ReadOptions_READ_CONSISTENCY_UNSPECIFIED +} + +func (m *ReadOptions) GetTransaction() []byte { + if x, ok := m.GetConsistencyType().(*ReadOptions_Transaction); ok { + return x.Transaction + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*ReadOptions) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _ReadOptions_OneofMarshaler, _ReadOptions_OneofUnmarshaler, _ReadOptions_OneofSizer, []interface{}{ + (*ReadOptions_ReadConsistency_)(nil), + (*ReadOptions_Transaction)(nil), + } +} + +func _ReadOptions_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*ReadOptions) + // consistency_type + switch x := m.ConsistencyType.(type) { + case *ReadOptions_ReadConsistency_: + b.EncodeVarint(1<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.ReadConsistency)) + case *ReadOptions_Transaction: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeRawBytes(x.Transaction) + case nil: + default: + return fmt.Errorf("ReadOptions.ConsistencyType has unexpected type %T", x) + } + return nil +} + +func _ReadOptions_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*ReadOptions) + switch tag { + case 1: // consistency_type.read_consistency + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.ConsistencyType = &ReadOptions_ReadConsistency_{ReadOptions_ReadConsistency(x)} + return true, err + case 2: // consistency_type.transaction + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.ConsistencyType = &ReadOptions_Transaction{x} + return true, err + default: + return false, nil + } +} + +func _ReadOptions_OneofSizer(msg proto.Message) (n int) { + m := msg.(*ReadOptions) + // consistency_type + switch x := m.ConsistencyType.(type) { + case *ReadOptions_ReadConsistency_: + n += proto.SizeVarint(1<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.ReadConsistency)) + case *ReadOptions_Transaction: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Transaction))) + n += len(x.Transaction) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Options for beginning a new transaction. +// +// Transactions can be created explicitly with calls to +// [Datastore.BeginTransaction][google.datastore.v1beta3.Datastore.BeginTransaction] or implicitly by setting +// [ReadOptions.new_transaction][google.datastore.v1beta3.ReadOptions.new_transaction] in read requests. +type TransactionOptions struct { + // The `mode` of the transaction, indicating whether write operations are + // supported. + // + // Types that are valid to be assigned to Mode: + // *TransactionOptions_ReadWrite_ + // *TransactionOptions_ReadOnly_ + Mode isTransactionOptions_Mode `protobuf_oneof:"mode"` +} + +func (m *TransactionOptions) Reset() { *m = TransactionOptions{} } +func (m *TransactionOptions) String() string { return proto.CompactTextString(m) } +func (*TransactionOptions) ProtoMessage() {} +func (*TransactionOptions) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17} } + +type isTransactionOptions_Mode interface { + isTransactionOptions_Mode() +} + +type TransactionOptions_ReadWrite_ struct { + ReadWrite *TransactionOptions_ReadWrite `protobuf:"bytes,1,opt,name=read_write,json=readWrite,oneof"` +} +type TransactionOptions_ReadOnly_ struct { + ReadOnly *TransactionOptions_ReadOnly `protobuf:"bytes,2,opt,name=read_only,json=readOnly,oneof"` +} + +func (*TransactionOptions_ReadWrite_) isTransactionOptions_Mode() {} +func (*TransactionOptions_ReadOnly_) isTransactionOptions_Mode() {} + +func (m *TransactionOptions) GetMode() isTransactionOptions_Mode { + if m != nil { + return m.Mode + } + return nil +} + +func (m *TransactionOptions) GetReadWrite() *TransactionOptions_ReadWrite { + if x, ok := m.GetMode().(*TransactionOptions_ReadWrite_); ok { + return x.ReadWrite + } + return nil +} + +func (m *TransactionOptions) GetReadOnly() *TransactionOptions_ReadOnly { + if x, ok := m.GetMode().(*TransactionOptions_ReadOnly_); ok { + return x.ReadOnly + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*TransactionOptions) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _TransactionOptions_OneofMarshaler, _TransactionOptions_OneofUnmarshaler, _TransactionOptions_OneofSizer, []interface{}{ + (*TransactionOptions_ReadWrite_)(nil), + (*TransactionOptions_ReadOnly_)(nil), + } +} + +func _TransactionOptions_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*TransactionOptions) + // mode + switch x := m.Mode.(type) { + case *TransactionOptions_ReadWrite_: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ReadWrite); err != nil { + return err + } + case *TransactionOptions_ReadOnly_: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ReadOnly); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("TransactionOptions.Mode has unexpected type %T", x) + } + return nil +} + +func _TransactionOptions_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*TransactionOptions) + switch tag { + case 1: // mode.read_write + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(TransactionOptions_ReadWrite) + err := b.DecodeMessage(msg) + m.Mode = &TransactionOptions_ReadWrite_{msg} + return true, err + case 2: // mode.read_only + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(TransactionOptions_ReadOnly) + err := b.DecodeMessage(msg) + m.Mode = &TransactionOptions_ReadOnly_{msg} + return true, err + default: + return false, nil + } +} + +func _TransactionOptions_OneofSizer(msg proto.Message) (n int) { + m := msg.(*TransactionOptions) + // mode + switch x := m.Mode.(type) { + case *TransactionOptions_ReadWrite_: + s := proto.Size(x.ReadWrite) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *TransactionOptions_ReadOnly_: + s := proto.Size(x.ReadOnly) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Options specific to read / write transactions. +type TransactionOptions_ReadWrite struct { + // The transaction identifier of the transaction being retried. + PreviousTransaction []byte `protobuf:"bytes,1,opt,name=previous_transaction,json=previousTransaction,proto3" json:"previous_transaction,omitempty"` +} + +func (m *TransactionOptions_ReadWrite) Reset() { *m = TransactionOptions_ReadWrite{} } +func (m *TransactionOptions_ReadWrite) String() string { return proto.CompactTextString(m) } +func (*TransactionOptions_ReadWrite) ProtoMessage() {} +func (*TransactionOptions_ReadWrite) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{17, 0} +} + +func (m *TransactionOptions_ReadWrite) GetPreviousTransaction() []byte { + if m != nil { + return m.PreviousTransaction + } + return nil +} + +// Options specific to read-only transactions. +type TransactionOptions_ReadOnly struct { +} + +func (m *TransactionOptions_ReadOnly) Reset() { *m = TransactionOptions_ReadOnly{} } +func (m *TransactionOptions_ReadOnly) String() string { return proto.CompactTextString(m) } +func (*TransactionOptions_ReadOnly) ProtoMessage() {} +func (*TransactionOptions_ReadOnly) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17, 1} } + +func init() { + proto.RegisterType((*LookupRequest)(nil), "google.datastore.v1beta3.LookupRequest") + proto.RegisterType((*LookupResponse)(nil), "google.datastore.v1beta3.LookupResponse") + proto.RegisterType((*RunQueryRequest)(nil), "google.datastore.v1beta3.RunQueryRequest") + proto.RegisterType((*RunQueryResponse)(nil), "google.datastore.v1beta3.RunQueryResponse") + proto.RegisterType((*BeginTransactionRequest)(nil), "google.datastore.v1beta3.BeginTransactionRequest") + proto.RegisterType((*BeginTransactionResponse)(nil), "google.datastore.v1beta3.BeginTransactionResponse") + proto.RegisterType((*RollbackRequest)(nil), "google.datastore.v1beta3.RollbackRequest") + proto.RegisterType((*RollbackResponse)(nil), "google.datastore.v1beta3.RollbackResponse") + proto.RegisterType((*CommitRequest)(nil), "google.datastore.v1beta3.CommitRequest") + proto.RegisterType((*CommitResponse)(nil), "google.datastore.v1beta3.CommitResponse") + proto.RegisterType((*AllocateIdsRequest)(nil), "google.datastore.v1beta3.AllocateIdsRequest") + proto.RegisterType((*AllocateIdsResponse)(nil), "google.datastore.v1beta3.AllocateIdsResponse") + proto.RegisterType((*ReserveIdsRequest)(nil), "google.datastore.v1beta3.ReserveIdsRequest") + proto.RegisterType((*ReserveIdsResponse)(nil), "google.datastore.v1beta3.ReserveIdsResponse") + proto.RegisterType((*Mutation)(nil), "google.datastore.v1beta3.Mutation") + proto.RegisterType((*MutationResult)(nil), "google.datastore.v1beta3.MutationResult") + proto.RegisterType((*ReadOptions)(nil), "google.datastore.v1beta3.ReadOptions") + proto.RegisterType((*TransactionOptions)(nil), "google.datastore.v1beta3.TransactionOptions") + proto.RegisterType((*TransactionOptions_ReadWrite)(nil), "google.datastore.v1beta3.TransactionOptions.ReadWrite") + proto.RegisterType((*TransactionOptions_ReadOnly)(nil), "google.datastore.v1beta3.TransactionOptions.ReadOnly") + proto.RegisterEnum("google.datastore.v1beta3.CommitRequest_Mode", CommitRequest_Mode_name, CommitRequest_Mode_value) + proto.RegisterEnum("google.datastore.v1beta3.ReadOptions_ReadConsistency", ReadOptions_ReadConsistency_name, ReadOptions_ReadConsistency_value) +} + +// 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 + +// Client API for Datastore service + +type DatastoreClient interface { + // Looks up entities by key. + Lookup(ctx context.Context, in *LookupRequest, opts ...grpc.CallOption) (*LookupResponse, error) + // Queries for entities. + RunQuery(ctx context.Context, in *RunQueryRequest, opts ...grpc.CallOption) (*RunQueryResponse, error) + // Begins a new transaction. + BeginTransaction(ctx context.Context, in *BeginTransactionRequest, opts ...grpc.CallOption) (*BeginTransactionResponse, error) + // Commits a transaction, optionally creating, deleting or modifying some + // entities. + Commit(ctx context.Context, in *CommitRequest, opts ...grpc.CallOption) (*CommitResponse, error) + // Rolls back a transaction. + Rollback(ctx context.Context, in *RollbackRequest, opts ...grpc.CallOption) (*RollbackResponse, error) + // Allocates IDs for the given keys, which is useful for referencing an entity + // before it is inserted. + AllocateIds(ctx context.Context, in *AllocateIdsRequest, opts ...grpc.CallOption) (*AllocateIdsResponse, error) + // Prevents the supplied keys' IDs from being auto-allocated by Cloud + // Datastore. + ReserveIds(ctx context.Context, in *ReserveIdsRequest, opts ...grpc.CallOption) (*ReserveIdsResponse, error) +} + +type datastoreClient struct { + cc *grpc.ClientConn +} + +func NewDatastoreClient(cc *grpc.ClientConn) DatastoreClient { + return &datastoreClient{cc} +} + +func (c *datastoreClient) Lookup(ctx context.Context, in *LookupRequest, opts ...grpc.CallOption) (*LookupResponse, error) { + out := new(LookupResponse) + err := grpc.Invoke(ctx, "/google.datastore.v1beta3.Datastore/Lookup", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *datastoreClient) RunQuery(ctx context.Context, in *RunQueryRequest, opts ...grpc.CallOption) (*RunQueryResponse, error) { + out := new(RunQueryResponse) + err := grpc.Invoke(ctx, "/google.datastore.v1beta3.Datastore/RunQuery", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *datastoreClient) BeginTransaction(ctx context.Context, in *BeginTransactionRequest, opts ...grpc.CallOption) (*BeginTransactionResponse, error) { + out := new(BeginTransactionResponse) + err := grpc.Invoke(ctx, "/google.datastore.v1beta3.Datastore/BeginTransaction", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *datastoreClient) Commit(ctx context.Context, in *CommitRequest, opts ...grpc.CallOption) (*CommitResponse, error) { + out := new(CommitResponse) + err := grpc.Invoke(ctx, "/google.datastore.v1beta3.Datastore/Commit", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *datastoreClient) Rollback(ctx context.Context, in *RollbackRequest, opts ...grpc.CallOption) (*RollbackResponse, error) { + out := new(RollbackResponse) + err := grpc.Invoke(ctx, "/google.datastore.v1beta3.Datastore/Rollback", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *datastoreClient) AllocateIds(ctx context.Context, in *AllocateIdsRequest, opts ...grpc.CallOption) (*AllocateIdsResponse, error) { + out := new(AllocateIdsResponse) + err := grpc.Invoke(ctx, "/google.datastore.v1beta3.Datastore/AllocateIds", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *datastoreClient) ReserveIds(ctx context.Context, in *ReserveIdsRequest, opts ...grpc.CallOption) (*ReserveIdsResponse, error) { + out := new(ReserveIdsResponse) + err := grpc.Invoke(ctx, "/google.datastore.v1beta3.Datastore/ReserveIds", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for Datastore service + +type DatastoreServer interface { + // Looks up entities by key. + Lookup(context.Context, *LookupRequest) (*LookupResponse, error) + // Queries for entities. + RunQuery(context.Context, *RunQueryRequest) (*RunQueryResponse, error) + // Begins a new transaction. + BeginTransaction(context.Context, *BeginTransactionRequest) (*BeginTransactionResponse, error) + // Commits a transaction, optionally creating, deleting or modifying some + // entities. + Commit(context.Context, *CommitRequest) (*CommitResponse, error) + // Rolls back a transaction. + Rollback(context.Context, *RollbackRequest) (*RollbackResponse, error) + // Allocates IDs for the given keys, which is useful for referencing an entity + // before it is inserted. + AllocateIds(context.Context, *AllocateIdsRequest) (*AllocateIdsResponse, error) + // Prevents the supplied keys' IDs from being auto-allocated by Cloud + // Datastore. + ReserveIds(context.Context, *ReserveIdsRequest) (*ReserveIdsResponse, error) +} + +func RegisterDatastoreServer(s *grpc.Server, srv DatastoreServer) { + s.RegisterService(&_Datastore_serviceDesc, srv) +} + +func _Datastore_Lookup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LookupRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DatastoreServer).Lookup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.datastore.v1beta3.Datastore/Lookup", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DatastoreServer).Lookup(ctx, req.(*LookupRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Datastore_RunQuery_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RunQueryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DatastoreServer).RunQuery(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.datastore.v1beta3.Datastore/RunQuery", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DatastoreServer).RunQuery(ctx, req.(*RunQueryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Datastore_BeginTransaction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BeginTransactionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DatastoreServer).BeginTransaction(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.datastore.v1beta3.Datastore/BeginTransaction", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DatastoreServer).BeginTransaction(ctx, req.(*BeginTransactionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Datastore_Commit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CommitRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DatastoreServer).Commit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.datastore.v1beta3.Datastore/Commit", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DatastoreServer).Commit(ctx, req.(*CommitRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Datastore_Rollback_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RollbackRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DatastoreServer).Rollback(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.datastore.v1beta3.Datastore/Rollback", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DatastoreServer).Rollback(ctx, req.(*RollbackRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Datastore_AllocateIds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AllocateIdsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DatastoreServer).AllocateIds(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.datastore.v1beta3.Datastore/AllocateIds", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DatastoreServer).AllocateIds(ctx, req.(*AllocateIdsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Datastore_ReserveIds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ReserveIdsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DatastoreServer).ReserveIds(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.datastore.v1beta3.Datastore/ReserveIds", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DatastoreServer).ReserveIds(ctx, req.(*ReserveIdsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Datastore_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.datastore.v1beta3.Datastore", + HandlerType: (*DatastoreServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Lookup", + Handler: _Datastore_Lookup_Handler, + }, + { + MethodName: "RunQuery", + Handler: _Datastore_RunQuery_Handler, + }, + { + MethodName: "BeginTransaction", + Handler: _Datastore_BeginTransaction_Handler, + }, + { + MethodName: "Commit", + Handler: _Datastore_Commit_Handler, + }, + { + MethodName: "Rollback", + Handler: _Datastore_Rollback_Handler, + }, + { + MethodName: "AllocateIds", + Handler: _Datastore_AllocateIds_Handler, + }, + { + MethodName: "ReserveIds", + Handler: _Datastore_ReserveIds_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/datastore/v1beta3/datastore.proto", +} + +func init() { proto.RegisterFile("google/datastore/v1beta3/datastore.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 1403 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0xcf, 0x6f, 0x1b, 0xc5, + 0x17, 0xcf, 0x38, 0x89, 0x6b, 0x3f, 0xe7, 0x87, 0x33, 0xcd, 0xf7, 0x8b, 0x65, 0x5a, 0x6a, 0x6d, + 0x29, 0x75, 0xd3, 0x62, 0x13, 0xb7, 0xa1, 0x22, 0x54, 0x28, 0xb6, 0xe3, 0xd6, 0x16, 0x8d, 0x1d, + 0x26, 0x6e, 0x2a, 0x50, 0x91, 0xb5, 0xf6, 0x4e, 0xcc, 0x92, 0xf5, 0xce, 0x66, 0x77, 0x1c, 0x88, + 0x10, 0x17, 0x0e, 0x08, 0x81, 0x38, 0x21, 0xd4, 0x13, 0x07, 0xae, 0x70, 0x2e, 0x7f, 0x03, 0x02, + 0x89, 0x0b, 0x07, 0xfe, 0x01, 0xfe, 0x08, 0x8e, 0x68, 0x67, 0x67, 0xfd, 0x2b, 0xb5, 0xbd, 0xae, + 0xb8, 0x79, 0xdf, 0x7e, 0x3e, 0xef, 0x7d, 0xe6, 0xbd, 0xd9, 0xf7, 0x5e, 0x02, 0xe9, 0x36, 0x63, + 0x6d, 0x83, 0x66, 0x35, 0x95, 0xab, 0x0e, 0x67, 0x36, 0xcd, 0x9e, 0x6e, 0x36, 0x29, 0x57, 0x6f, + 0xf7, 0x2d, 0x19, 0xcb, 0x66,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, 0x26, 0xd6, 0x77, 0x78, + 0x19, 0x9c, 0x58, 0xdf, 0xd1, 0x1d, 0x2f, 0x70, 0x7d, 0x25, 0xd1, 0xd5, 0xf5, 0x23, 0x82, 0xd8, + 0xc0, 0xa8, 0xc7, 0x13, 0x16, 0xbd, 0xf3, 0x9b, 0x47, 0xf2, 0xf5, 0x80, 0x68, 0x29, 0x70, 0x4b, + 0x08, 0xcc, 0x2a, 0x1b, 0x53, 0x04, 0xaa, 0x7d, 0xae, 0xab, 0xf1, 0x07, 0x04, 0xd0, 0x9f, 0xdd, + 0xf8, 0xe6, 0xa4, 0x9e, 0x3d, 0xb2, 0x69, 0x24, 0x6f, 0x05, 0x03, 0x4b, 0x81, 0x77, 0x84, 0xc0, + 0x8c, 0x72, 0x63, 0x5a, 0x06, 0x7b, 0xd4, 0x6d, 0xb4, 0x51, 0x78, 0x86, 0xe0, 0x52, 0x8b, 0x75, + 0xc6, 0x46, 0x2a, 0xac, 0xf4, 0xfa, 0xce, 0xbe, 0xcd, 0x38, 0xdb, 0x47, 0x1f, 0xe4, 0x25, 0xb6, + 0xcd, 0x0c, 0xd5, 0x6c, 0x67, 0x98, 0xdd, 0xce, 0xb6, 0xa9, 0x29, 0xfe, 0x8b, 0x90, 0xf5, 0x5e, + 0xa9, 0x96, 0xee, 0x9c, 0xff, 0x77, 0xc3, 0xdb, 0x3d, 0xcb, 0x4f, 0xa1, 0x57, 0x1e, 0x78, 0x3e, + 0x8a, 0x06, 0xeb, 0x6a, 0x99, 0x5e, 0x88, 0xcc, 0xe1, 0x66, 0xc1, 0x85, 0xfe, 0xe6, 0x03, 0x9e, + 0x08, 0xc0, 0x93, 0x1e, 0xe0, 0xc9, 0xa1, 0xe7, 0xab, 0x19, 0x16, 0xf1, 0x6e, 0xff, 0x1b, 0x00, + 0x00, 0xff, 0xff, 0x6a, 0xaa, 0xbe, 0x57, 0x66, 0x11, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/datastore/v1beta3/entity.pb.go b/vendor/google.golang.org/genproto/googleapis/datastore/v1beta3/entity.pb.go new file mode 100644 index 0000000000..390ca207b5 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/datastore/v1beta3/entity.pb.go @@ -0,0 +1,764 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/datastore/v1beta3/entity.proto + +package datastore + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf1 "github.com/golang/protobuf/ptypes/struct" +import google_protobuf2 "github.com/golang/protobuf/ptypes/timestamp" +import google_type "google.golang.org/genproto/googleapis/type/latlng" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// A partition ID identifies a grouping of entities. The grouping is always +// by project and namespace, however the namespace ID may be empty. +// +// A partition ID contains several dimensions: +// project ID and namespace ID. +// +// Partition dimensions: +// +// - May be `""`. +// - Must be valid UTF-8 bytes. +// - Must have values that match regex `[A-Za-z\d\.\-_]{1,100}` +// If the value of any dimension matches regex `__.*__`, the partition is +// reserved/read-only. +// A reserved/read-only partition ID is forbidden in certain documented +// contexts. +// +// Foreign partition IDs (in which the project ID does +// not match the context project ID ) are discouraged. +// Reads and writes of foreign partition IDs may fail if the project is not in an active state. +type PartitionId struct { + // The ID of the project to which the entities belong. + ProjectId string `protobuf:"bytes,2,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // If not empty, the ID of the namespace to which the entities belong. + NamespaceId string `protobuf:"bytes,4,opt,name=namespace_id,json=namespaceId" json:"namespace_id,omitempty"` +} + +func (m *PartitionId) Reset() { *m = PartitionId{} } +func (m *PartitionId) String() string { return proto.CompactTextString(m) } +func (*PartitionId) ProtoMessage() {} +func (*PartitionId) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +func (m *PartitionId) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *PartitionId) GetNamespaceId() string { + if m != nil { + return m.NamespaceId + } + return "" +} + +// A unique identifier for an entity. +// If a key's partition ID or any of its path kinds or names are +// reserved/read-only, the key is reserved/read-only. +// A reserved/read-only key is forbidden in certain documented contexts. +type Key struct { + // Entities are partitioned into subsets, currently identified by a project + // ID and namespace ID. + // Queries are scoped to a single partition. + PartitionId *PartitionId `protobuf:"bytes,1,opt,name=partition_id,json=partitionId" json:"partition_id,omitempty"` + // The entity path. + // An entity path consists of one or more elements composed of a kind and a + // string or numerical identifier, which identify entities. The first + // element identifies a _root entity_, the second element identifies + // a _child_ of the root entity, the third element identifies a child of the + // second entity, and so forth. The entities identified by all prefixes of + // the path are called the element's _ancestors_. + // + // An entity path is always fully complete: *all* of the entity's ancestors + // are required to be in the path along with the entity identifier itself. + // The only exception is that in some documented cases, the identifier in the + // last path element (for the entity) itself may be omitted. For example, + // the last path element of the key of `Mutation.insert` may have no + // identifier. + // + // A path can never be empty, and a path can have at most 100 elements. + Path []*Key_PathElement `protobuf:"bytes,2,rep,name=path" json:"path,omitempty"` +} + +func (m *Key) Reset() { *m = Key{} } +func (m *Key) String() string { return proto.CompactTextString(m) } +func (*Key) ProtoMessage() {} +func (*Key) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} } + +func (m *Key) GetPartitionId() *PartitionId { + if m != nil { + return m.PartitionId + } + return nil +} + +func (m *Key) GetPath() []*Key_PathElement { + if m != nil { + return m.Path + } + return nil +} + +// A (kind, ID/name) pair used to construct a key path. +// +// If either name or ID is set, the element is complete. +// If neither is set, the element is incomplete. +type Key_PathElement struct { + // The kind of the entity. + // A kind matching regex `__.*__` is reserved/read-only. + // A kind must not contain more than 1500 bytes when UTF-8 encoded. + // Cannot be `""`. + Kind string `protobuf:"bytes,1,opt,name=kind" json:"kind,omitempty"` + // The type of ID. + // + // Types that are valid to be assigned to IdType: + // *Key_PathElement_Id + // *Key_PathElement_Name + IdType isKey_PathElement_IdType `protobuf_oneof:"id_type"` +} + +func (m *Key_PathElement) Reset() { *m = Key_PathElement{} } +func (m *Key_PathElement) String() string { return proto.CompactTextString(m) } +func (*Key_PathElement) ProtoMessage() {} +func (*Key_PathElement) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1, 0} } + +type isKey_PathElement_IdType interface { + isKey_PathElement_IdType() +} + +type Key_PathElement_Id struct { + Id int64 `protobuf:"varint,2,opt,name=id,oneof"` +} +type Key_PathElement_Name struct { + Name string `protobuf:"bytes,3,opt,name=name,oneof"` +} + +func (*Key_PathElement_Id) isKey_PathElement_IdType() {} +func (*Key_PathElement_Name) isKey_PathElement_IdType() {} + +func (m *Key_PathElement) GetIdType() isKey_PathElement_IdType { + if m != nil { + return m.IdType + } + return nil +} + +func (m *Key_PathElement) GetKind() string { + if m != nil { + return m.Kind + } + return "" +} + +func (m *Key_PathElement) GetId() int64 { + if x, ok := m.GetIdType().(*Key_PathElement_Id); ok { + return x.Id + } + return 0 +} + +func (m *Key_PathElement) GetName() string { + if x, ok := m.GetIdType().(*Key_PathElement_Name); ok { + return x.Name + } + return "" +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Key_PathElement) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _Key_PathElement_OneofMarshaler, _Key_PathElement_OneofUnmarshaler, _Key_PathElement_OneofSizer, []interface{}{ + (*Key_PathElement_Id)(nil), + (*Key_PathElement_Name)(nil), + } +} + +func _Key_PathElement_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Key_PathElement) + // id_type + switch x := m.IdType.(type) { + case *Key_PathElement_Id: + b.EncodeVarint(2<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.Id)) + case *Key_PathElement_Name: + b.EncodeVarint(3<<3 | proto.WireBytes) + b.EncodeStringBytes(x.Name) + case nil: + default: + return fmt.Errorf("Key_PathElement.IdType has unexpected type %T", x) + } + return nil +} + +func _Key_PathElement_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Key_PathElement) + switch tag { + case 2: // id_type.id + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.IdType = &Key_PathElement_Id{int64(x)} + return true, err + case 3: // id_type.name + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.IdType = &Key_PathElement_Name{x} + return true, err + default: + return false, nil + } +} + +func _Key_PathElement_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Key_PathElement) + // id_type + switch x := m.IdType.(type) { + case *Key_PathElement_Id: + n += proto.SizeVarint(2<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.Id)) + case *Key_PathElement_Name: + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Name))) + n += len(x.Name) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// An array value. +type ArrayValue struct { + // Values in the array. + // The order of this array may not be preserved if it contains a mix of + // indexed and unindexed values. + Values []*Value `protobuf:"bytes,1,rep,name=values" json:"values,omitempty"` +} + +func (m *ArrayValue) Reset() { *m = ArrayValue{} } +func (m *ArrayValue) String() string { return proto.CompactTextString(m) } +func (*ArrayValue) ProtoMessage() {} +func (*ArrayValue) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} } + +func (m *ArrayValue) GetValues() []*Value { + if m != nil { + return m.Values + } + return nil +} + +// A message that can hold any of the supported value types and associated +// metadata. +type Value struct { + // Must have a value set. + // + // Types that are valid to be assigned to ValueType: + // *Value_NullValue + // *Value_BooleanValue + // *Value_IntegerValue + // *Value_DoubleValue + // *Value_TimestampValue + // *Value_KeyValue + // *Value_StringValue + // *Value_BlobValue + // *Value_GeoPointValue + // *Value_EntityValue + // *Value_ArrayValue + ValueType isValue_ValueType `protobuf_oneof:"value_type"` + // The `meaning` field should only be populated for backwards compatibility. + Meaning int32 `protobuf:"varint,14,opt,name=meaning" json:"meaning,omitempty"` + // If the value should be excluded from all indexes including those defined + // explicitly. + ExcludeFromIndexes bool `protobuf:"varint,19,opt,name=exclude_from_indexes,json=excludeFromIndexes" json:"exclude_from_indexes,omitempty"` +} + +func (m *Value) Reset() { *m = Value{} } +func (m *Value) String() string { return proto.CompactTextString(m) } +func (*Value) ProtoMessage() {} +func (*Value) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{3} } + +type isValue_ValueType interface { + isValue_ValueType() +} + +type Value_NullValue struct { + NullValue google_protobuf1.NullValue `protobuf:"varint,11,opt,name=null_value,json=nullValue,enum=google.protobuf.NullValue,oneof"` +} +type Value_BooleanValue struct { + BooleanValue bool `protobuf:"varint,1,opt,name=boolean_value,json=booleanValue,oneof"` +} +type Value_IntegerValue struct { + IntegerValue int64 `protobuf:"varint,2,opt,name=integer_value,json=integerValue,oneof"` +} +type Value_DoubleValue struct { + DoubleValue float64 `protobuf:"fixed64,3,opt,name=double_value,json=doubleValue,oneof"` +} +type Value_TimestampValue struct { + TimestampValue *google_protobuf2.Timestamp `protobuf:"bytes,10,opt,name=timestamp_value,json=timestampValue,oneof"` +} +type Value_KeyValue struct { + KeyValue *Key `protobuf:"bytes,5,opt,name=key_value,json=keyValue,oneof"` +} +type Value_StringValue struct { + StringValue string `protobuf:"bytes,17,opt,name=string_value,json=stringValue,oneof"` +} +type Value_BlobValue struct { + BlobValue []byte `protobuf:"bytes,18,opt,name=blob_value,json=blobValue,proto3,oneof"` +} +type Value_GeoPointValue struct { + GeoPointValue *google_type.LatLng `protobuf:"bytes,8,opt,name=geo_point_value,json=geoPointValue,oneof"` +} +type Value_EntityValue struct { + EntityValue *Entity `protobuf:"bytes,6,opt,name=entity_value,json=entityValue,oneof"` +} +type Value_ArrayValue struct { + ArrayValue *ArrayValue `protobuf:"bytes,9,opt,name=array_value,json=arrayValue,oneof"` +} + +func (*Value_NullValue) isValue_ValueType() {} +func (*Value_BooleanValue) isValue_ValueType() {} +func (*Value_IntegerValue) isValue_ValueType() {} +func (*Value_DoubleValue) isValue_ValueType() {} +func (*Value_TimestampValue) isValue_ValueType() {} +func (*Value_KeyValue) isValue_ValueType() {} +func (*Value_StringValue) isValue_ValueType() {} +func (*Value_BlobValue) isValue_ValueType() {} +func (*Value_GeoPointValue) isValue_ValueType() {} +func (*Value_EntityValue) isValue_ValueType() {} +func (*Value_ArrayValue) isValue_ValueType() {} + +func (m *Value) GetValueType() isValue_ValueType { + if m != nil { + return m.ValueType + } + return nil +} + +func (m *Value) GetNullValue() google_protobuf1.NullValue { + if x, ok := m.GetValueType().(*Value_NullValue); ok { + return x.NullValue + } + return google_protobuf1.NullValue_NULL_VALUE +} + +func (m *Value) GetBooleanValue() bool { + if x, ok := m.GetValueType().(*Value_BooleanValue); ok { + return x.BooleanValue + } + return false +} + +func (m *Value) GetIntegerValue() int64 { + if x, ok := m.GetValueType().(*Value_IntegerValue); ok { + return x.IntegerValue + } + return 0 +} + +func (m *Value) GetDoubleValue() float64 { + if x, ok := m.GetValueType().(*Value_DoubleValue); ok { + return x.DoubleValue + } + return 0 +} + +func (m *Value) GetTimestampValue() *google_protobuf2.Timestamp { + if x, ok := m.GetValueType().(*Value_TimestampValue); ok { + return x.TimestampValue + } + return nil +} + +func (m *Value) GetKeyValue() *Key { + if x, ok := m.GetValueType().(*Value_KeyValue); ok { + return x.KeyValue + } + return nil +} + +func (m *Value) GetStringValue() string { + if x, ok := m.GetValueType().(*Value_StringValue); ok { + return x.StringValue + } + return "" +} + +func (m *Value) GetBlobValue() []byte { + if x, ok := m.GetValueType().(*Value_BlobValue); ok { + return x.BlobValue + } + return nil +} + +func (m *Value) GetGeoPointValue() *google_type.LatLng { + if x, ok := m.GetValueType().(*Value_GeoPointValue); ok { + return x.GeoPointValue + } + return nil +} + +func (m *Value) GetEntityValue() *Entity { + if x, ok := m.GetValueType().(*Value_EntityValue); ok { + return x.EntityValue + } + return nil +} + +func (m *Value) GetArrayValue() *ArrayValue { + if x, ok := m.GetValueType().(*Value_ArrayValue); ok { + return x.ArrayValue + } + return nil +} + +func (m *Value) GetMeaning() int32 { + if m != nil { + return m.Meaning + } + return 0 +} + +func (m *Value) GetExcludeFromIndexes() bool { + if m != nil { + return m.ExcludeFromIndexes + } + return false +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Value) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _Value_OneofMarshaler, _Value_OneofUnmarshaler, _Value_OneofSizer, []interface{}{ + (*Value_NullValue)(nil), + (*Value_BooleanValue)(nil), + (*Value_IntegerValue)(nil), + (*Value_DoubleValue)(nil), + (*Value_TimestampValue)(nil), + (*Value_KeyValue)(nil), + (*Value_StringValue)(nil), + (*Value_BlobValue)(nil), + (*Value_GeoPointValue)(nil), + (*Value_EntityValue)(nil), + (*Value_ArrayValue)(nil), + } +} + +func _Value_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Value) + // value_type + switch x := m.ValueType.(type) { + case *Value_NullValue: + b.EncodeVarint(11<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.NullValue)) + case *Value_BooleanValue: + t := uint64(0) + if x.BooleanValue { + t = 1 + } + b.EncodeVarint(1<<3 | proto.WireVarint) + b.EncodeVarint(t) + case *Value_IntegerValue: + b.EncodeVarint(2<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.IntegerValue)) + case *Value_DoubleValue: + b.EncodeVarint(3<<3 | proto.WireFixed64) + b.EncodeFixed64(math.Float64bits(x.DoubleValue)) + case *Value_TimestampValue: + b.EncodeVarint(10<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.TimestampValue); err != nil { + return err + } + case *Value_KeyValue: + b.EncodeVarint(5<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.KeyValue); err != nil { + return err + } + case *Value_StringValue: + b.EncodeVarint(17<<3 | proto.WireBytes) + b.EncodeStringBytes(x.StringValue) + case *Value_BlobValue: + b.EncodeVarint(18<<3 | proto.WireBytes) + b.EncodeRawBytes(x.BlobValue) + case *Value_GeoPointValue: + b.EncodeVarint(8<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.GeoPointValue); err != nil { + return err + } + case *Value_EntityValue: + b.EncodeVarint(6<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.EntityValue); err != nil { + return err + } + case *Value_ArrayValue: + b.EncodeVarint(9<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ArrayValue); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("Value.ValueType has unexpected type %T", x) + } + return nil +} + +func _Value_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Value) + switch tag { + case 11: // value_type.null_value + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.ValueType = &Value_NullValue{google_protobuf1.NullValue(x)} + return true, err + case 1: // value_type.boolean_value + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.ValueType = &Value_BooleanValue{x != 0} + return true, err + case 2: // value_type.integer_value + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.ValueType = &Value_IntegerValue{int64(x)} + return true, err + case 3: // value_type.double_value + if wire != proto.WireFixed64 { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeFixed64() + m.ValueType = &Value_DoubleValue{math.Float64frombits(x)} + return true, err + case 10: // value_type.timestamp_value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(google_protobuf2.Timestamp) + err := b.DecodeMessage(msg) + m.ValueType = &Value_TimestampValue{msg} + return true, err + case 5: // value_type.key_value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Key) + err := b.DecodeMessage(msg) + m.ValueType = &Value_KeyValue{msg} + return true, err + case 17: // value_type.string_value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.ValueType = &Value_StringValue{x} + return true, err + case 18: // value_type.blob_value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.ValueType = &Value_BlobValue{x} + return true, err + case 8: // value_type.geo_point_value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(google_type.LatLng) + err := b.DecodeMessage(msg) + m.ValueType = &Value_GeoPointValue{msg} + return true, err + case 6: // value_type.entity_value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Entity) + err := b.DecodeMessage(msg) + m.ValueType = &Value_EntityValue{msg} + return true, err + case 9: // value_type.array_value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ArrayValue) + err := b.DecodeMessage(msg) + m.ValueType = &Value_ArrayValue{msg} + return true, err + default: + return false, nil + } +} + +func _Value_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Value) + // value_type + switch x := m.ValueType.(type) { + case *Value_NullValue: + n += proto.SizeVarint(11<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.NullValue)) + case *Value_BooleanValue: + n += proto.SizeVarint(1<<3 | proto.WireVarint) + n += 1 + case *Value_IntegerValue: + n += proto.SizeVarint(2<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.IntegerValue)) + case *Value_DoubleValue: + n += proto.SizeVarint(3<<3 | proto.WireFixed64) + n += 8 + case *Value_TimestampValue: + s := proto.Size(x.TimestampValue) + n += proto.SizeVarint(10<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Value_KeyValue: + s := proto.Size(x.KeyValue) + n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Value_StringValue: + n += proto.SizeVarint(17<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.StringValue))) + n += len(x.StringValue) + case *Value_BlobValue: + n += proto.SizeVarint(18<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.BlobValue))) + n += len(x.BlobValue) + case *Value_GeoPointValue: + s := proto.Size(x.GeoPointValue) + n += proto.SizeVarint(8<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Value_EntityValue: + s := proto.Size(x.EntityValue) + n += proto.SizeVarint(6<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Value_ArrayValue: + s := proto.Size(x.ArrayValue) + n += proto.SizeVarint(9<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// A Datastore data object. +// +// An entity is limited to 1 megabyte when stored. That _roughly_ +// corresponds to a limit of 1 megabyte for the serialized form of this +// message. +type Entity struct { + // The entity's key. + // + // An entity must have a key, unless otherwise documented (for example, + // an entity in `Value.entity_value` may have no key). + // An entity's kind is its key path's last element's kind, + // or null if it has no key. + Key *Key `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` + // The entity's properties. + // The map's keys are property names. + // A property name matching regex `__.*__` is reserved. + // A reserved property name is forbidden in certain documented contexts. + // The name must not contain more than 500 characters. + // The name cannot be `""`. + Properties map[string]*Value `protobuf:"bytes,3,rep,name=properties" json:"properties,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *Entity) Reset() { *m = Entity{} } +func (m *Entity) String() string { return proto.CompactTextString(m) } +func (*Entity) ProtoMessage() {} +func (*Entity) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{4} } + +func (m *Entity) GetKey() *Key { + if m != nil { + return m.Key + } + return nil +} + +func (m *Entity) GetProperties() map[string]*Value { + if m != nil { + return m.Properties + } + return nil +} + +func init() { + proto.RegisterType((*PartitionId)(nil), "google.datastore.v1beta3.PartitionId") + proto.RegisterType((*Key)(nil), "google.datastore.v1beta3.Key") + proto.RegisterType((*Key_PathElement)(nil), "google.datastore.v1beta3.Key.PathElement") + proto.RegisterType((*ArrayValue)(nil), "google.datastore.v1beta3.ArrayValue") + proto.RegisterType((*Value)(nil), "google.datastore.v1beta3.Value") + proto.RegisterType((*Entity)(nil), "google.datastore.v1beta3.Entity") +} + +func init() { proto.RegisterFile("google/datastore/v1beta3/entity.proto", fileDescriptor1) } + +var fileDescriptor1 = []byte{ + // 789 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x95, 0xdf, 0x8e, 0xdb, 0x44, + 0x14, 0xc6, 0xed, 0x64, 0xb3, 0x5d, 0x1f, 0xbb, 0xbb, 0x65, 0xda, 0x0b, 0x2b, 0x6a, 0xd9, 0x10, + 0x58, 0x29, 0xdc, 0xd8, 0xed, 0x56, 0x08, 0x44, 0xe9, 0x45, 0x03, 0xa1, 0x8e, 0x5a, 0x41, 0x34, + 0xaa, 0xf6, 0x02, 0xad, 0x88, 0x26, 0xf1, 0xd4, 0x1d, 0x62, 0xcf, 0x58, 0xf6, 0xb8, 0xaa, 0x5f, + 0x09, 0xee, 0x78, 0x0c, 0x9e, 0x83, 0x3b, 0x5e, 0x02, 0xcd, 0x1f, 0x3b, 0xab, 0x56, 0x29, 0xdc, + 0x79, 0xce, 0xf9, 0x9d, 0x6f, 0xbe, 0x99, 0x73, 0x26, 0x81, 0x8b, 0x4c, 0x88, 0x2c, 0xa7, 0x71, + 0x4a, 0x24, 0xa9, 0xa5, 0xa8, 0x68, 0xfc, 0xf6, 0xd1, 0x86, 0x4a, 0xf2, 0x38, 0xa6, 0x5c, 0x32, + 0xd9, 0x46, 0x65, 0x25, 0xa4, 0x40, 0xa1, 0xc1, 0xa2, 0x1e, 0x8b, 0x2c, 0x36, 0xbe, 0x6f, 0x05, + 0x48, 0xc9, 0x62, 0xc2, 0xb9, 0x90, 0x44, 0x32, 0xc1, 0x6b, 0x53, 0xd7, 0x67, 0xf5, 0x6a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d4, + 0xff, 0xc7, 0xc3, 0x34, 0xf4, 0xb7, 0x83, 0x6f, 0xdc, 0xf9, 0x9f, 0x2e, 0xdc, 0xdf, 0x8a, 0xe2, + 0x60, 0xc5, 0xdc, 0x37, 0x26, 0x57, 0x6a, 0xce, 0x57, 0xee, 0x2f, 0xcf, 0x2c, 0x98, 0x89, 0x9c, + 0xf0, 0x2c, 0x12, 0x55, 0x16, 0x67, 0x94, 0xeb, 0x57, 0x10, 0x9b, 0x14, 0x29, 0x59, 0xfd, 0xe1, + 0x3f, 0xc4, 0x93, 0x3e, 0xf2, 0xfb, 0xe0, 0xd3, 0xe7, 0x46, 0xe3, 0xfb, 0x5c, 0x34, 0x69, 0xf4, + 0x43, 0xbf, 0xe5, 0xd5, 0xa3, 0xb9, 0x42, 0xff, 0xea, 0x80, 0x6b, 0x0d, 0x5c, 0xf7, 0xc0, 0xf5, + 0x95, 0xd1, 0xda, 0x1c, 0xeb, 0xfd, 0x1e, 0xff, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x2c, 0x6d, 0x30, + 0xe2, 0x90, 0x06, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/datastore/v1beta3/query.pb.go b/vendor/google.golang.org/genproto/googleapis/datastore/v1beta3/query.pb.go new file mode 100644 index 0000000000..b2f2ce0104 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/datastore/v1beta3/query.pb.go @@ -0,0 +1,970 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/datastore/v1beta3/query.proto + +package datastore + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf3 "github.com/golang/protobuf/ptypes/wrappers" +import _ "google.golang.org/genproto/googleapis/type/latlng" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Specifies what data the 'entity' field contains. +// A `ResultType` is either implied (for example, in `LookupResponse.missing` +// from `datastore.proto`, it is always `KEY_ONLY`) or specified by context +// (for example, in message `QueryResultBatch`, field `entity_result_type` +// specifies a `ResultType` for all the values in field `entity_results`). +type EntityResult_ResultType int32 + +const ( + // Unspecified. This value is never used. + EntityResult_RESULT_TYPE_UNSPECIFIED EntityResult_ResultType = 0 + // The key and properties. + EntityResult_FULL EntityResult_ResultType = 1 + // A projected subset of properties. The entity may have no key. + EntityResult_PROJECTION EntityResult_ResultType = 2 + // Only the key. + EntityResult_KEY_ONLY EntityResult_ResultType = 3 +) + +var EntityResult_ResultType_name = map[int32]string{ + 0: "RESULT_TYPE_UNSPECIFIED", + 1: "FULL", + 2: "PROJECTION", + 3: "KEY_ONLY", +} +var EntityResult_ResultType_value = map[string]int32{ + "RESULT_TYPE_UNSPECIFIED": 0, + "FULL": 1, + "PROJECTION": 2, + "KEY_ONLY": 3, +} + +func (x EntityResult_ResultType) String() string { + return proto.EnumName(EntityResult_ResultType_name, int32(x)) +} +func (EntityResult_ResultType) EnumDescriptor() ([]byte, []int) { return fileDescriptor2, []int{0, 0} } + +// The sort direction. +type PropertyOrder_Direction int32 + +const ( + // Unspecified. This value must not be used. + PropertyOrder_DIRECTION_UNSPECIFIED PropertyOrder_Direction = 0 + // Ascending. + PropertyOrder_ASCENDING PropertyOrder_Direction = 1 + // Descending. + PropertyOrder_DESCENDING PropertyOrder_Direction = 2 +) + +var PropertyOrder_Direction_name = map[int32]string{ + 0: "DIRECTION_UNSPECIFIED", + 1: "ASCENDING", + 2: "DESCENDING", +} +var PropertyOrder_Direction_value = map[string]int32{ + "DIRECTION_UNSPECIFIED": 0, + "ASCENDING": 1, + "DESCENDING": 2, +} + +func (x PropertyOrder_Direction) String() string { + return proto.EnumName(PropertyOrder_Direction_name, int32(x)) +} +func (PropertyOrder_Direction) EnumDescriptor() ([]byte, []int) { return fileDescriptor2, []int{5, 0} } + +// A composite filter operator. +type CompositeFilter_Operator int32 + +const ( + // Unspecified. This value must not be used. + CompositeFilter_OPERATOR_UNSPECIFIED CompositeFilter_Operator = 0 + // The results are required to satisfy each of the combined filters. + CompositeFilter_AND CompositeFilter_Operator = 1 +) + +var CompositeFilter_Operator_name = map[int32]string{ + 0: "OPERATOR_UNSPECIFIED", + 1: "AND", +} +var CompositeFilter_Operator_value = map[string]int32{ + "OPERATOR_UNSPECIFIED": 0, + "AND": 1, +} + +func (x CompositeFilter_Operator) String() string { + return proto.EnumName(CompositeFilter_Operator_name, int32(x)) +} +func (CompositeFilter_Operator) EnumDescriptor() ([]byte, []int) { return fileDescriptor2, []int{7, 0} } + +// A property filter operator. +type PropertyFilter_Operator int32 + +const ( + // Unspecified. This value must not be used. + PropertyFilter_OPERATOR_UNSPECIFIED PropertyFilter_Operator = 0 + // Less than. + PropertyFilter_LESS_THAN PropertyFilter_Operator = 1 + // Less than or equal. + PropertyFilter_LESS_THAN_OR_EQUAL PropertyFilter_Operator = 2 + // Greater than. + PropertyFilter_GREATER_THAN PropertyFilter_Operator = 3 + // Greater than or equal. + PropertyFilter_GREATER_THAN_OR_EQUAL PropertyFilter_Operator = 4 + // Equal. + PropertyFilter_EQUAL PropertyFilter_Operator = 5 + // Has ancestor. + PropertyFilter_HAS_ANCESTOR PropertyFilter_Operator = 11 +) + +var PropertyFilter_Operator_name = map[int32]string{ + 0: "OPERATOR_UNSPECIFIED", + 1: "LESS_THAN", + 2: "LESS_THAN_OR_EQUAL", + 3: "GREATER_THAN", + 4: "GREATER_THAN_OR_EQUAL", + 5: "EQUAL", + 11: "HAS_ANCESTOR", +} +var PropertyFilter_Operator_value = map[string]int32{ + "OPERATOR_UNSPECIFIED": 0, + "LESS_THAN": 1, + "LESS_THAN_OR_EQUAL": 2, + "GREATER_THAN": 3, + "GREATER_THAN_OR_EQUAL": 4, + "EQUAL": 5, + "HAS_ANCESTOR": 11, +} + +func (x PropertyFilter_Operator) String() string { + return proto.EnumName(PropertyFilter_Operator_name, int32(x)) +} +func (PropertyFilter_Operator) EnumDescriptor() ([]byte, []int) { return fileDescriptor2, []int{8, 0} } + +// The possible values for the `more_results` field. +type QueryResultBatch_MoreResultsType int32 + +const ( + // Unspecified. This value is never used. + QueryResultBatch_MORE_RESULTS_TYPE_UNSPECIFIED QueryResultBatch_MoreResultsType = 0 + // There may be additional batches to fetch from this query. + QueryResultBatch_NOT_FINISHED QueryResultBatch_MoreResultsType = 1 + // The query is finished, but there may be more results after the limit. + QueryResultBatch_MORE_RESULTS_AFTER_LIMIT QueryResultBatch_MoreResultsType = 2 + // The query is finished, but there may be more results after the end + // cursor. + QueryResultBatch_MORE_RESULTS_AFTER_CURSOR QueryResultBatch_MoreResultsType = 4 + // The query is finished, and there are no more results. + QueryResultBatch_NO_MORE_RESULTS QueryResultBatch_MoreResultsType = 3 +) + +var QueryResultBatch_MoreResultsType_name = map[int32]string{ + 0: "MORE_RESULTS_TYPE_UNSPECIFIED", + 1: "NOT_FINISHED", + 2: "MORE_RESULTS_AFTER_LIMIT", + 4: "MORE_RESULTS_AFTER_CURSOR", + 3: "NO_MORE_RESULTS", +} +var QueryResultBatch_MoreResultsType_value = map[string]int32{ + "MORE_RESULTS_TYPE_UNSPECIFIED": 0, + "NOT_FINISHED": 1, + "MORE_RESULTS_AFTER_LIMIT": 2, + "MORE_RESULTS_AFTER_CURSOR": 4, + "NO_MORE_RESULTS": 3, +} + +func (x QueryResultBatch_MoreResultsType) String() string { + return proto.EnumName(QueryResultBatch_MoreResultsType_name, int32(x)) +} +func (QueryResultBatch_MoreResultsType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor2, []int{11, 0} +} + +// The result of fetching an entity from Datastore. +type EntityResult struct { + // The resulting entity. + Entity *Entity `protobuf:"bytes,1,opt,name=entity" json:"entity,omitempty"` + // The version of the entity, a strictly positive number that monotonically + // increases with changes to the entity. + // + // This field is set for [`FULL`][google.datastore.v1beta3.EntityResult.ResultType.FULL] entity + // results. + // + // For [missing][google.datastore.v1beta3.LookupResponse.missing] entities in `LookupResponse`, this + // is the version of the snapshot that was used to look up the entity, and it + // is always set except for eventually consistent reads. + Version int64 `protobuf:"varint,4,opt,name=version" json:"version,omitempty"` + // A cursor that points to the position after the result entity. + // Set only when the `EntityResult` is part of a `QueryResultBatch` message. + Cursor []byte `protobuf:"bytes,3,opt,name=cursor,proto3" json:"cursor,omitempty"` +} + +func (m *EntityResult) Reset() { *m = EntityResult{} } +func (m *EntityResult) String() string { return proto.CompactTextString(m) } +func (*EntityResult) ProtoMessage() {} +func (*EntityResult) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} } + +func (m *EntityResult) GetEntity() *Entity { + if m != nil { + return m.Entity + } + return nil +} + +func (m *EntityResult) GetVersion() int64 { + if m != nil { + return m.Version + } + return 0 +} + +func (m *EntityResult) GetCursor() []byte { + if m != nil { + return m.Cursor + } + return nil +} + +// A query for entities. +type Query struct { + // The projection to return. Defaults to returning all properties. + Projection []*Projection `protobuf:"bytes,2,rep,name=projection" json:"projection,omitempty"` + // The kinds to query (if empty, returns entities of all kinds). + // Currently at most 1 kind may be specified. + Kind []*KindExpression `protobuf:"bytes,3,rep,name=kind" json:"kind,omitempty"` + // The filter to apply. + Filter *Filter `protobuf:"bytes,4,opt,name=filter" json:"filter,omitempty"` + // The order to apply to the query results (if empty, order is unspecified). + Order []*PropertyOrder `protobuf:"bytes,5,rep,name=order" json:"order,omitempty"` + // The properties to make distinct. The query results will contain the first + // result for each distinct combination of values for the given properties + // (if empty, all results are returned). + DistinctOn []*PropertyReference `protobuf:"bytes,6,rep,name=distinct_on,json=distinctOn" json:"distinct_on,omitempty"` + // A starting point for the query results. Query cursors are + // returned in query result batches and + // [can only be used to continue the same query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets). + StartCursor []byte `protobuf:"bytes,7,opt,name=start_cursor,json=startCursor,proto3" json:"start_cursor,omitempty"` + // An ending point for the query results. Query cursors are + // returned in query result batches and + // [can only be used to limit the same query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets). + EndCursor []byte `protobuf:"bytes,8,opt,name=end_cursor,json=endCursor,proto3" json:"end_cursor,omitempty"` + // The number of results to skip. Applies before limit, but after all other + // constraints. Optional. Must be >= 0 if specified. + Offset int32 `protobuf:"varint,10,opt,name=offset" json:"offset,omitempty"` + // The maximum number of results to return. Applies after all other + // constraints. Optional. + // Unspecified is interpreted as no limit. + // Must be >= 0 if specified. + Limit *google_protobuf3.Int32Value `protobuf:"bytes,12,opt,name=limit" json:"limit,omitempty"` +} + +func (m *Query) Reset() { *m = Query{} } +func (m *Query) String() string { return proto.CompactTextString(m) } +func (*Query) ProtoMessage() {} +func (*Query) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{1} } + +func (m *Query) GetProjection() []*Projection { + if m != nil { + return m.Projection + } + return nil +} + +func (m *Query) GetKind() []*KindExpression { + if m != nil { + return m.Kind + } + return nil +} + +func (m *Query) GetFilter() *Filter { + if m != nil { + return m.Filter + } + return nil +} + +func (m *Query) GetOrder() []*PropertyOrder { + if m != nil { + return m.Order + } + return nil +} + +func (m *Query) GetDistinctOn() []*PropertyReference { + if m != nil { + return m.DistinctOn + } + return nil +} + +func (m *Query) GetStartCursor() []byte { + if m != nil { + return m.StartCursor + } + return nil +} + +func (m *Query) GetEndCursor() []byte { + if m != nil { + return m.EndCursor + } + return nil +} + +func (m *Query) GetOffset() int32 { + if m != nil { + return m.Offset + } + return 0 +} + +func (m *Query) GetLimit() *google_protobuf3.Int32Value { + if m != nil { + return m.Limit + } + return nil +} + +// A representation of a kind. +type KindExpression struct { + // The name of the kind. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *KindExpression) Reset() { *m = KindExpression{} } +func (m *KindExpression) String() string { return proto.CompactTextString(m) } +func (*KindExpression) ProtoMessage() {} +func (*KindExpression) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{2} } + +func (m *KindExpression) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// A reference to a property relative to the kind expressions. +type PropertyReference struct { + // The name of the property. + // If name includes "."s, it may be interpreted as a property name path. + Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` +} + +func (m *PropertyReference) Reset() { *m = PropertyReference{} } +func (m *PropertyReference) String() string { return proto.CompactTextString(m) } +func (*PropertyReference) ProtoMessage() {} +func (*PropertyReference) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{3} } + +func (m *PropertyReference) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// A representation of a property in a projection. +type Projection struct { + // The property to project. + Property *PropertyReference `protobuf:"bytes,1,opt,name=property" json:"property,omitempty"` +} + +func (m *Projection) Reset() { *m = Projection{} } +func (m *Projection) String() string { return proto.CompactTextString(m) } +func (*Projection) ProtoMessage() {} +func (*Projection) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{4} } + +func (m *Projection) GetProperty() *PropertyReference { + if m != nil { + return m.Property + } + return nil +} + +// The desired order for a specific property. +type PropertyOrder struct { + // The property to order by. + Property *PropertyReference `protobuf:"bytes,1,opt,name=property" json:"property,omitempty"` + // The direction to order by. Defaults to `ASCENDING`. + Direction PropertyOrder_Direction `protobuf:"varint,2,opt,name=direction,enum=google.datastore.v1beta3.PropertyOrder_Direction" json:"direction,omitempty"` +} + +func (m *PropertyOrder) Reset() { *m = PropertyOrder{} } +func (m *PropertyOrder) String() string { return proto.CompactTextString(m) } +func (*PropertyOrder) ProtoMessage() {} +func (*PropertyOrder) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{5} } + +func (m *PropertyOrder) GetProperty() *PropertyReference { + if m != nil { + return m.Property + } + return nil +} + +func (m *PropertyOrder) GetDirection() PropertyOrder_Direction { + if m != nil { + return m.Direction + } + return PropertyOrder_DIRECTION_UNSPECIFIED +} + +// A holder for any type of filter. +type Filter struct { + // The type of filter. + // + // Types that are valid to be assigned to FilterType: + // *Filter_CompositeFilter + // *Filter_PropertyFilter + FilterType isFilter_FilterType `protobuf_oneof:"filter_type"` +} + +func (m *Filter) Reset() { *m = Filter{} } +func (m *Filter) String() string { return proto.CompactTextString(m) } +func (*Filter) ProtoMessage() {} +func (*Filter) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{6} } + +type isFilter_FilterType interface { + isFilter_FilterType() +} + +type Filter_CompositeFilter struct { + CompositeFilter *CompositeFilter `protobuf:"bytes,1,opt,name=composite_filter,json=compositeFilter,oneof"` +} +type Filter_PropertyFilter struct { + PropertyFilter *PropertyFilter `protobuf:"bytes,2,opt,name=property_filter,json=propertyFilter,oneof"` +} + +func (*Filter_CompositeFilter) isFilter_FilterType() {} +func (*Filter_PropertyFilter) isFilter_FilterType() {} + +func (m *Filter) GetFilterType() isFilter_FilterType { + if m != nil { + return m.FilterType + } + return nil +} + +func (m *Filter) GetCompositeFilter() *CompositeFilter { + if x, ok := m.GetFilterType().(*Filter_CompositeFilter); ok { + return x.CompositeFilter + } + return nil +} + +func (m *Filter) GetPropertyFilter() *PropertyFilter { + if x, ok := m.GetFilterType().(*Filter_PropertyFilter); ok { + return x.PropertyFilter + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Filter) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _Filter_OneofMarshaler, _Filter_OneofUnmarshaler, _Filter_OneofSizer, []interface{}{ + (*Filter_CompositeFilter)(nil), + (*Filter_PropertyFilter)(nil), + } +} + +func _Filter_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Filter) + // filter_type + switch x := m.FilterType.(type) { + case *Filter_CompositeFilter: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.CompositeFilter); err != nil { + return err + } + case *Filter_PropertyFilter: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.PropertyFilter); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("Filter.FilterType has unexpected type %T", x) + } + return nil +} + +func _Filter_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Filter) + switch tag { + case 1: // filter_type.composite_filter + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(CompositeFilter) + err := b.DecodeMessage(msg) + m.FilterType = &Filter_CompositeFilter{msg} + return true, err + case 2: // filter_type.property_filter + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(PropertyFilter) + err := b.DecodeMessage(msg) + m.FilterType = &Filter_PropertyFilter{msg} + return true, err + default: + return false, nil + } +} + +func _Filter_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Filter) + // filter_type + switch x := m.FilterType.(type) { + case *Filter_CompositeFilter: + s := proto.Size(x.CompositeFilter) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Filter_PropertyFilter: + s := proto.Size(x.PropertyFilter) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// A filter that merges multiple other filters using the given operator. +type CompositeFilter struct { + // The operator for combining multiple filters. + Op CompositeFilter_Operator `protobuf:"varint,1,opt,name=op,enum=google.datastore.v1beta3.CompositeFilter_Operator" json:"op,omitempty"` + // The list of filters to combine. + // Must contain at least one filter. + Filters []*Filter `protobuf:"bytes,2,rep,name=filters" json:"filters,omitempty"` +} + +func (m *CompositeFilter) Reset() { *m = CompositeFilter{} } +func (m *CompositeFilter) String() string { return proto.CompactTextString(m) } +func (*CompositeFilter) ProtoMessage() {} +func (*CompositeFilter) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{7} } + +func (m *CompositeFilter) GetOp() CompositeFilter_Operator { + if m != nil { + return m.Op + } + return CompositeFilter_OPERATOR_UNSPECIFIED +} + +func (m *CompositeFilter) GetFilters() []*Filter { + if m != nil { + return m.Filters + } + return nil +} + +// A filter on a specific property. +type PropertyFilter struct { + // The property to filter by. + Property *PropertyReference `protobuf:"bytes,1,opt,name=property" json:"property,omitempty"` + // The operator to filter by. + Op PropertyFilter_Operator `protobuf:"varint,2,opt,name=op,enum=google.datastore.v1beta3.PropertyFilter_Operator" json:"op,omitempty"` + // The value to compare the property to. + Value *Value `protobuf:"bytes,3,opt,name=value" json:"value,omitempty"` +} + +func (m *PropertyFilter) Reset() { *m = PropertyFilter{} } +func (m *PropertyFilter) String() string { return proto.CompactTextString(m) } +func (*PropertyFilter) ProtoMessage() {} +func (*PropertyFilter) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{8} } + +func (m *PropertyFilter) GetProperty() *PropertyReference { + if m != nil { + return m.Property + } + return nil +} + +func (m *PropertyFilter) GetOp() PropertyFilter_Operator { + if m != nil { + return m.Op + } + return PropertyFilter_OPERATOR_UNSPECIFIED +} + +func (m *PropertyFilter) GetValue() *Value { + if m != nil { + return m.Value + } + return nil +} + +// A [GQL query](https://cloud.google.com/datastore/docs/apis/gql/gql_reference). +type GqlQuery struct { + // A string of the format described + // [here](https://cloud.google.com/datastore/docs/apis/gql/gql_reference). + QueryString string `protobuf:"bytes,1,opt,name=query_string,json=queryString" json:"query_string,omitempty"` + // When false, the query string must not contain any literals and instead must + // bind all values. For example, + // `SELECT * FROM Kind WHERE a = 'string literal'` is not allowed, while + // `SELECT * FROM Kind WHERE a = @value` is. + AllowLiterals bool `protobuf:"varint,2,opt,name=allow_literals,json=allowLiterals" json:"allow_literals,omitempty"` + // For each non-reserved named binding site in the query string, there must be + // a named parameter with that name, but not necessarily the inverse. + // + // Key must match regex `[A-Za-z_$][A-Za-z_$0-9]*`, must not match regex + // `__.*__`, and must not be `""`. + NamedBindings map[string]*GqlQueryParameter `protobuf:"bytes,5,rep,name=named_bindings,json=namedBindings" json:"named_bindings,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // Numbered binding site @1 references the first numbered parameter, + // effectively using 1-based indexing, rather than the usual 0. + // + // For each binding site numbered i in `query_string`, there must be an i-th + // numbered parameter. The inverse must also be true. + PositionalBindings []*GqlQueryParameter `protobuf:"bytes,4,rep,name=positional_bindings,json=positionalBindings" json:"positional_bindings,omitempty"` +} + +func (m *GqlQuery) Reset() { *m = GqlQuery{} } +func (m *GqlQuery) String() string { return proto.CompactTextString(m) } +func (*GqlQuery) ProtoMessage() {} +func (*GqlQuery) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{9} } + +func (m *GqlQuery) GetQueryString() string { + if m != nil { + return m.QueryString + } + return "" +} + +func (m *GqlQuery) GetAllowLiterals() bool { + if m != nil { + return m.AllowLiterals + } + return false +} + +func (m *GqlQuery) GetNamedBindings() map[string]*GqlQueryParameter { + if m != nil { + return m.NamedBindings + } + return nil +} + +func (m *GqlQuery) GetPositionalBindings() []*GqlQueryParameter { + if m != nil { + return m.PositionalBindings + } + return nil +} + +// A binding parameter for a GQL query. +type GqlQueryParameter struct { + // The type of parameter. + // + // Types that are valid to be assigned to ParameterType: + // *GqlQueryParameter_Value + // *GqlQueryParameter_Cursor + ParameterType isGqlQueryParameter_ParameterType `protobuf_oneof:"parameter_type"` +} + +func (m *GqlQueryParameter) Reset() { *m = GqlQueryParameter{} } +func (m *GqlQueryParameter) String() string { return proto.CompactTextString(m) } +func (*GqlQueryParameter) ProtoMessage() {} +func (*GqlQueryParameter) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{10} } + +type isGqlQueryParameter_ParameterType interface { + isGqlQueryParameter_ParameterType() +} + +type GqlQueryParameter_Value struct { + Value *Value `protobuf:"bytes,2,opt,name=value,oneof"` +} +type GqlQueryParameter_Cursor struct { + Cursor []byte `protobuf:"bytes,3,opt,name=cursor,proto3,oneof"` +} + +func (*GqlQueryParameter_Value) isGqlQueryParameter_ParameterType() {} +func (*GqlQueryParameter_Cursor) isGqlQueryParameter_ParameterType() {} + +func (m *GqlQueryParameter) GetParameterType() isGqlQueryParameter_ParameterType { + if m != nil { + return m.ParameterType + } + return nil +} + +func (m *GqlQueryParameter) GetValue() *Value { + if x, ok := m.GetParameterType().(*GqlQueryParameter_Value); ok { + return x.Value + } + return nil +} + +func (m *GqlQueryParameter) GetCursor() []byte { + if x, ok := m.GetParameterType().(*GqlQueryParameter_Cursor); ok { + return x.Cursor + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*GqlQueryParameter) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _GqlQueryParameter_OneofMarshaler, _GqlQueryParameter_OneofUnmarshaler, _GqlQueryParameter_OneofSizer, []interface{}{ + (*GqlQueryParameter_Value)(nil), + (*GqlQueryParameter_Cursor)(nil), + } +} + +func _GqlQueryParameter_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*GqlQueryParameter) + // parameter_type + switch x := m.ParameterType.(type) { + case *GqlQueryParameter_Value: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Value); err != nil { + return err + } + case *GqlQueryParameter_Cursor: + b.EncodeVarint(3<<3 | proto.WireBytes) + b.EncodeRawBytes(x.Cursor) + case nil: + default: + return fmt.Errorf("GqlQueryParameter.ParameterType has unexpected type %T", x) + } + return nil +} + +func _GqlQueryParameter_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*GqlQueryParameter) + switch tag { + case 2: // parameter_type.value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Value) + err := b.DecodeMessage(msg) + m.ParameterType = &GqlQueryParameter_Value{msg} + return true, err + case 3: // parameter_type.cursor + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.ParameterType = &GqlQueryParameter_Cursor{x} + return true, err + default: + return false, nil + } +} + +func _GqlQueryParameter_OneofSizer(msg proto.Message) (n int) { + m := msg.(*GqlQueryParameter) + // parameter_type + switch x := m.ParameterType.(type) { + case *GqlQueryParameter_Value: + s := proto.Size(x.Value) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *GqlQueryParameter_Cursor: + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Cursor))) + n += len(x.Cursor) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// A batch of results produced by a query. +type QueryResultBatch struct { + // The number of results skipped, typically because of an offset. + SkippedResults int32 `protobuf:"varint,6,opt,name=skipped_results,json=skippedResults" json:"skipped_results,omitempty"` + // A cursor that points to the position after the last skipped result. + // Will be set when `skipped_results` != 0. + SkippedCursor []byte `protobuf:"bytes,3,opt,name=skipped_cursor,json=skippedCursor,proto3" json:"skipped_cursor,omitempty"` + // The result type for every entity in `entity_results`. + EntityResultType EntityResult_ResultType `protobuf:"varint,1,opt,name=entity_result_type,json=entityResultType,enum=google.datastore.v1beta3.EntityResult_ResultType" json:"entity_result_type,omitempty"` + // The results for this batch. + EntityResults []*EntityResult `protobuf:"bytes,2,rep,name=entity_results,json=entityResults" json:"entity_results,omitempty"` + // A cursor that points to the position after the last result in the batch. + EndCursor []byte `protobuf:"bytes,4,opt,name=end_cursor,json=endCursor,proto3" json:"end_cursor,omitempty"` + // The state of the query after the current batch. + MoreResults QueryResultBatch_MoreResultsType `protobuf:"varint,5,opt,name=more_results,json=moreResults,enum=google.datastore.v1beta3.QueryResultBatch_MoreResultsType" json:"more_results,omitempty"` + // The version number of the snapshot this batch was returned from. + // This applies to the range of results from the query's `start_cursor` (or + // the beginning of the query if no cursor was given) to this batch's + // `end_cursor` (not the query's `end_cursor`). + // + // In a single transaction, subsequent query result batches for the same query + // can have a greater snapshot version number. Each batch's snapshot version + // is valid for all preceding batches. + // The value will be zero for eventually consistent queries. + SnapshotVersion int64 `protobuf:"varint,7,opt,name=snapshot_version,json=snapshotVersion" json:"snapshot_version,omitempty"` +} + +func (m *QueryResultBatch) Reset() { *m = QueryResultBatch{} } +func (m *QueryResultBatch) String() string { return proto.CompactTextString(m) } +func (*QueryResultBatch) ProtoMessage() {} +func (*QueryResultBatch) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{11} } + +func (m *QueryResultBatch) GetSkippedResults() int32 { + if m != nil { + return m.SkippedResults + } + return 0 +} + +func (m *QueryResultBatch) GetSkippedCursor() []byte { + if m != nil { + return m.SkippedCursor + } + return nil +} + +func (m *QueryResultBatch) GetEntityResultType() EntityResult_ResultType { + if m != nil { + return m.EntityResultType + } + return EntityResult_RESULT_TYPE_UNSPECIFIED +} + +func (m *QueryResultBatch) GetEntityResults() []*EntityResult { + if m != nil { + return m.EntityResults + } + return nil +} + +func (m *QueryResultBatch) GetEndCursor() []byte { + if m != nil { + return m.EndCursor + } + return nil +} + +func (m *QueryResultBatch) GetMoreResults() QueryResultBatch_MoreResultsType { + if m != nil { + return m.MoreResults + } + return QueryResultBatch_MORE_RESULTS_TYPE_UNSPECIFIED +} + +func (m *QueryResultBatch) GetSnapshotVersion() int64 { + if m != nil { + return m.SnapshotVersion + } + return 0 +} + +func init() { + proto.RegisterType((*EntityResult)(nil), "google.datastore.v1beta3.EntityResult") + proto.RegisterType((*Query)(nil), "google.datastore.v1beta3.Query") + proto.RegisterType((*KindExpression)(nil), "google.datastore.v1beta3.KindExpression") + proto.RegisterType((*PropertyReference)(nil), "google.datastore.v1beta3.PropertyReference") + proto.RegisterType((*Projection)(nil), "google.datastore.v1beta3.Projection") + proto.RegisterType((*PropertyOrder)(nil), "google.datastore.v1beta3.PropertyOrder") + proto.RegisterType((*Filter)(nil), "google.datastore.v1beta3.Filter") + proto.RegisterType((*CompositeFilter)(nil), "google.datastore.v1beta3.CompositeFilter") + proto.RegisterType((*PropertyFilter)(nil), "google.datastore.v1beta3.PropertyFilter") + proto.RegisterType((*GqlQuery)(nil), "google.datastore.v1beta3.GqlQuery") + proto.RegisterType((*GqlQueryParameter)(nil), "google.datastore.v1beta3.GqlQueryParameter") + proto.RegisterType((*QueryResultBatch)(nil), "google.datastore.v1beta3.QueryResultBatch") + proto.RegisterEnum("google.datastore.v1beta3.EntityResult_ResultType", EntityResult_ResultType_name, EntityResult_ResultType_value) + proto.RegisterEnum("google.datastore.v1beta3.PropertyOrder_Direction", PropertyOrder_Direction_name, PropertyOrder_Direction_value) + proto.RegisterEnum("google.datastore.v1beta3.CompositeFilter_Operator", CompositeFilter_Operator_name, CompositeFilter_Operator_value) + proto.RegisterEnum("google.datastore.v1beta3.PropertyFilter_Operator", PropertyFilter_Operator_name, PropertyFilter_Operator_value) + proto.RegisterEnum("google.datastore.v1beta3.QueryResultBatch_MoreResultsType", QueryResultBatch_MoreResultsType_name, QueryResultBatch_MoreResultsType_value) +} + +func init() { proto.RegisterFile("google/datastore/v1beta3/query.proto", fileDescriptor2) } + +var fileDescriptor2 = []byte{ + // 1323 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xcb, 0x6e, 0xdb, 0x46, + 0x14, 0x35, 0xa9, 0x87, 0xa5, 0xab, 0x17, 0x33, 0x69, 0x53, 0xc6, 0x79, 0xd4, 0x21, 0x92, 0x46, + 0x41, 0x51, 0x09, 0x56, 0x10, 0x34, 0x48, 0xdb, 0x85, 0x1e, 0xb4, 0xad, 0x46, 0x16, 0x95, 0x91, + 0x6c, 0x20, 0x85, 0x0b, 0x82, 0x96, 0xc6, 0x0a, 0x1b, 0x8a, 0x64, 0xc8, 0x71, 0x12, 0x7f, 0x48, + 0x81, 0x7e, 0x43, 0x77, 0xfd, 0x83, 0x2e, 0xba, 0x2a, 0xd0, 0x6d, 0xb7, 0xfd, 0x80, 0x6e, 0xfa, + 0x07, 0x2d, 0x38, 0x33, 0xd4, 0xcb, 0x51, 0xe4, 0x02, 0xd9, 0x69, 0xee, 0x9c, 0x73, 0xee, 0xcc, + 0xe1, 0x9d, 0x99, 0x2b, 0xb8, 0x3b, 0xf6, 0xbc, 0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5, 0x77, 0xa3, + 0x5b, 0xa4, 0xd3, 0x3e, 0x68, 0x0f, 0x14, 0x19, 0xdd, 0x82, 0xeb, 0xef, 0x98, 0x6d, 0x1e, 0xe2, + 0xbe, 0x81, 0x95, 0x24, 0xba, 0x0a, 0xa5, 0xae, 0x61, 0xce, 0x23, 0x94, 0x44, 0xe3, 0x17, 0x09, + 0x6e, 0x0e, 0xbd, 0xc9, 0x4a, 0x53, 0x1a, 0xc0, 0xcb, 0x3d, 0xea, 0x93, 0x7a, 0xd2, 0x77, 0x75, + 0x81, 0x1b, 0x7b, 0x8e, 0xe5, 0x8e, 0x2b, 0x5e, 0x30, 0xae, 0x8e, 0x89, 0xcb, 0xba, 0xa8, 0x2a, + 0x9f, 0xb2, 0x7c, 0x3b, 0xbc, 0xf8, 0x37, 0xe2, 0xab, 0x69, 0xe4, 0x67, 0xf9, 0xf6, 0x1e, 0xd7, + 0x68, 0x3a, 0xde, 0xd9, 0xa8, 0xd2, 0x9a, 0x66, 0x3c, 0xda, 0x69, 0x44, 0xd0, 0xdf, 0x63, 0xc0, + 0x31, 0x03, 0x1c, 0x4f, 0x01, 0xc7, 0x47, 0x5c, 0xeb, 0x24, 0xcd, 0xf2, 0x3d, 0xfc, 0x2f, 0x00, + 0x00, 0xff, 0xff, 0x61, 0xdf, 0x90, 0xd9, 0x13, 0x0d, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/devtools/build/v1/build_events.pb.go b/vendor/google.golang.org/genproto/googleapis/devtools/build/v1/build_events.pb.go new file mode 100644 index 0000000000..dc5d7a502d --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/devtools/build/v1/build_events.pb.go @@ -0,0 +1,834 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/devtools/build/v1/build_events.proto + +/* +Package build is a generated protocol buffer package. + +It is generated from these files: + google/devtools/build/v1/build_events.proto + google/devtools/build/v1/build_status.proto + google/devtools/build/v1/publish_build_event.proto + +It has these top-level messages: + BuildEvent + StreamId + BuildStatus + PublishLifecycleEventRequest + PublishBuildToolEventStreamResponse + OrderedBuildEvent + PublishBuildToolEventStreamRequest +*/ +package build + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf1 "github.com/golang/protobuf/ptypes/any" +import google_protobuf2 "github.com/golang/protobuf/ptypes/timestamp" +import google_protobuf3 "github.com/golang/protobuf/ptypes/wrappers" +import _ "google.golang.org/genproto/googleapis/rpc/status" + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// The type of console output stream. +type ConsoleOutputStream int32 + +const ( + // Unspecified or unknown. + ConsoleOutputStream_UNKNOWN ConsoleOutputStream = 0 + // Normal output stream. + ConsoleOutputStream_STDOUT ConsoleOutputStream = 1 + // Error output stream. + ConsoleOutputStream_STDERR ConsoleOutputStream = 2 +) + +var ConsoleOutputStream_name = map[int32]string{ + 0: "UNKNOWN", + 1: "STDOUT", + 2: "STDERR", +} +var ConsoleOutputStream_value = map[string]int32{ + "UNKNOWN": 0, + "STDOUT": 1, + "STDERR": 2, +} + +func (x ConsoleOutputStream) String() string { + return proto.EnumName(ConsoleOutputStream_name, int32(x)) +} +func (ConsoleOutputStream) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +// How did the event stream finish. +type BuildEvent_BuildComponentStreamFinished_FinishType int32 + +const ( + // Unknown or unspecified; callers should never set this value. + BuildEvent_BuildComponentStreamFinished_FINISH_TYPE_UNSPECIFIED BuildEvent_BuildComponentStreamFinished_FinishType = 0 + // Set by the event publisher to indicate a build event stream is + // finished. + BuildEvent_BuildComponentStreamFinished_FINISHED BuildEvent_BuildComponentStreamFinished_FinishType = 1 + // Set by the WatchBuild RPC server when the publisher of a build event + // stream stops publishing events without publishing a + // BuildComponentStreamFinished event whose type equals FINISHED. + BuildEvent_BuildComponentStreamFinished_EXPIRED BuildEvent_BuildComponentStreamFinished_FinishType = 2 +) + +var BuildEvent_BuildComponentStreamFinished_FinishType_name = map[int32]string{ + 0: "FINISH_TYPE_UNSPECIFIED", + 1: "FINISHED", + 2: "EXPIRED", +} +var BuildEvent_BuildComponentStreamFinished_FinishType_value = map[string]int32{ + "FINISH_TYPE_UNSPECIFIED": 0, + "FINISHED": 1, + "EXPIRED": 2, +} + +func (x BuildEvent_BuildComponentStreamFinished_FinishType) String() string { + return proto.EnumName(BuildEvent_BuildComponentStreamFinished_FinishType_name, int32(x)) +} +func (BuildEvent_BuildComponentStreamFinished_FinishType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{0, 5, 0} +} + +// Which build component generates this event stream. Each build component +// may generate one event stream. +type StreamId_BuildComponent int32 + +const ( + // Unknown or unspecified; callers should never set this value. + StreamId_UNKNOWN_COMPONENT StreamId_BuildComponent = 0 + // A component that coordinates builds. + StreamId_CONTROLLER StreamId_BuildComponent = 1 + // A component that runs executables needed to complete a build. + StreamId_WORKER StreamId_BuildComponent = 2 + // A component that builds something. + StreamId_TOOL StreamId_BuildComponent = 3 +) + +var StreamId_BuildComponent_name = map[int32]string{ + 0: "UNKNOWN_COMPONENT", + 1: "CONTROLLER", + 2: "WORKER", + 3: "TOOL", +} +var StreamId_BuildComponent_value = map[string]int32{ + "UNKNOWN_COMPONENT": 0, + "CONTROLLER": 1, + "WORKER": 2, + "TOOL": 3, +} + +func (x StreamId_BuildComponent) String() string { + return proto.EnumName(StreamId_BuildComponent_name, int32(x)) +} +func (StreamId_BuildComponent) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{1, 0} } + +// An event representing some state change that occured in the build. This +// message does not include field for uniquely identifying an event. +type BuildEvent struct { + // The timestamp of this event. + EventTime *google_protobuf2.Timestamp `protobuf:"bytes,1,opt,name=event_time,json=eventTime" json:"event_time,omitempty"` + // ////////////////////////////////////////////////////////////////////////// + // Events that indicate a state change of a build request in the build + // queue. + // + // Types that are valid to be assigned to Event: + // *BuildEvent_InvocationAttemptStarted_ + // *BuildEvent_InvocationAttemptFinished_ + // *BuildEvent_BuildEnqueued_ + // *BuildEvent_BuildFinished_ + // *BuildEvent_ConsoleOutput_ + // *BuildEvent_ComponentStreamFinished + // *BuildEvent_BazelEvent + // *BuildEvent_BuildExecutionEvent + // *BuildEvent_SourceFetchEvent + Event isBuildEvent_Event `protobuf_oneof:"event"` +} + +func (m *BuildEvent) Reset() { *m = BuildEvent{} } +func (m *BuildEvent) String() string { return proto.CompactTextString(m) } +func (*BuildEvent) ProtoMessage() {} +func (*BuildEvent) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +type isBuildEvent_Event interface { + isBuildEvent_Event() +} + +type BuildEvent_InvocationAttemptStarted_ struct { + InvocationAttemptStarted *BuildEvent_InvocationAttemptStarted `protobuf:"bytes,51,opt,name=invocation_attempt_started,json=invocationAttemptStarted,oneof"` +} +type BuildEvent_InvocationAttemptFinished_ struct { + InvocationAttemptFinished *BuildEvent_InvocationAttemptFinished `protobuf:"bytes,52,opt,name=invocation_attempt_finished,json=invocationAttemptFinished,oneof"` +} +type BuildEvent_BuildEnqueued_ struct { + BuildEnqueued *BuildEvent_BuildEnqueued `protobuf:"bytes,53,opt,name=build_enqueued,json=buildEnqueued,oneof"` +} +type BuildEvent_BuildFinished_ struct { + BuildFinished *BuildEvent_BuildFinished `protobuf:"bytes,55,opt,name=build_finished,json=buildFinished,oneof"` +} +type BuildEvent_ConsoleOutput_ struct { + ConsoleOutput *BuildEvent_ConsoleOutput `protobuf:"bytes,56,opt,name=console_output,json=consoleOutput,oneof"` +} +type BuildEvent_ComponentStreamFinished struct { + ComponentStreamFinished *BuildEvent_BuildComponentStreamFinished `protobuf:"bytes,59,opt,name=component_stream_finished,json=componentStreamFinished,oneof"` +} +type BuildEvent_BazelEvent struct { + BazelEvent *google_protobuf1.Any `protobuf:"bytes,60,opt,name=bazel_event,json=bazelEvent,oneof"` +} +type BuildEvent_BuildExecutionEvent struct { + BuildExecutionEvent *google_protobuf1.Any `protobuf:"bytes,61,opt,name=build_execution_event,json=buildExecutionEvent,oneof"` +} +type BuildEvent_SourceFetchEvent struct { + SourceFetchEvent *google_protobuf1.Any `protobuf:"bytes,62,opt,name=source_fetch_event,json=sourceFetchEvent,oneof"` +} + +func (*BuildEvent_InvocationAttemptStarted_) isBuildEvent_Event() {} +func (*BuildEvent_InvocationAttemptFinished_) isBuildEvent_Event() {} +func (*BuildEvent_BuildEnqueued_) isBuildEvent_Event() {} +func (*BuildEvent_BuildFinished_) isBuildEvent_Event() {} +func (*BuildEvent_ConsoleOutput_) isBuildEvent_Event() {} +func (*BuildEvent_ComponentStreamFinished) isBuildEvent_Event() {} +func (*BuildEvent_BazelEvent) isBuildEvent_Event() {} +func (*BuildEvent_BuildExecutionEvent) isBuildEvent_Event() {} +func (*BuildEvent_SourceFetchEvent) isBuildEvent_Event() {} + +func (m *BuildEvent) GetEvent() isBuildEvent_Event { + if m != nil { + return m.Event + } + return nil +} + +func (m *BuildEvent) GetEventTime() *google_protobuf2.Timestamp { + if m != nil { + return m.EventTime + } + return nil +} + +func (m *BuildEvent) GetInvocationAttemptStarted() *BuildEvent_InvocationAttemptStarted { + if x, ok := m.GetEvent().(*BuildEvent_InvocationAttemptStarted_); ok { + return x.InvocationAttemptStarted + } + return nil +} + +func (m *BuildEvent) GetInvocationAttemptFinished() *BuildEvent_InvocationAttemptFinished { + if x, ok := m.GetEvent().(*BuildEvent_InvocationAttemptFinished_); ok { + return x.InvocationAttemptFinished + } + return nil +} + +func (m *BuildEvent) GetBuildEnqueued() *BuildEvent_BuildEnqueued { + if x, ok := m.GetEvent().(*BuildEvent_BuildEnqueued_); ok { + return x.BuildEnqueued + } + return nil +} + +func (m *BuildEvent) GetBuildFinished() *BuildEvent_BuildFinished { + if x, ok := m.GetEvent().(*BuildEvent_BuildFinished_); ok { + return x.BuildFinished + } + return nil +} + +func (m *BuildEvent) GetConsoleOutput() *BuildEvent_ConsoleOutput { + if x, ok := m.GetEvent().(*BuildEvent_ConsoleOutput_); ok { + return x.ConsoleOutput + } + return nil +} + +func (m *BuildEvent) GetComponentStreamFinished() *BuildEvent_BuildComponentStreamFinished { + if x, ok := m.GetEvent().(*BuildEvent_ComponentStreamFinished); ok { + return x.ComponentStreamFinished + } + return nil +} + +func (m *BuildEvent) GetBazelEvent() *google_protobuf1.Any { + if x, ok := m.GetEvent().(*BuildEvent_BazelEvent); ok { + return x.BazelEvent + } + return nil +} + +func (m *BuildEvent) GetBuildExecutionEvent() *google_protobuf1.Any { + if x, ok := m.GetEvent().(*BuildEvent_BuildExecutionEvent); ok { + return x.BuildExecutionEvent + } + return nil +} + +func (m *BuildEvent) GetSourceFetchEvent() *google_protobuf1.Any { + if x, ok := m.GetEvent().(*BuildEvent_SourceFetchEvent); ok { + return x.SourceFetchEvent + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*BuildEvent) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _BuildEvent_OneofMarshaler, _BuildEvent_OneofUnmarshaler, _BuildEvent_OneofSizer, []interface{}{ + (*BuildEvent_InvocationAttemptStarted_)(nil), + (*BuildEvent_InvocationAttemptFinished_)(nil), + (*BuildEvent_BuildEnqueued_)(nil), + (*BuildEvent_BuildFinished_)(nil), + (*BuildEvent_ConsoleOutput_)(nil), + (*BuildEvent_ComponentStreamFinished)(nil), + (*BuildEvent_BazelEvent)(nil), + (*BuildEvent_BuildExecutionEvent)(nil), + (*BuildEvent_SourceFetchEvent)(nil), + } +} + +func _BuildEvent_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*BuildEvent) + // event + switch x := m.Event.(type) { + case *BuildEvent_InvocationAttemptStarted_: + b.EncodeVarint(51<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.InvocationAttemptStarted); err != nil { + return err + } + case *BuildEvent_InvocationAttemptFinished_: + b.EncodeVarint(52<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.InvocationAttemptFinished); err != nil { + return err + } + case *BuildEvent_BuildEnqueued_: + b.EncodeVarint(53<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BuildEnqueued); err != nil { + return err + } + case *BuildEvent_BuildFinished_: + b.EncodeVarint(55<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BuildFinished); err != nil { + return err + } + case *BuildEvent_ConsoleOutput_: + b.EncodeVarint(56<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ConsoleOutput); err != nil { + return err + } + case *BuildEvent_ComponentStreamFinished: + b.EncodeVarint(59<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ComponentStreamFinished); err != nil { + return err + } + case *BuildEvent_BazelEvent: + b.EncodeVarint(60<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BazelEvent); err != nil { + return err + } + case *BuildEvent_BuildExecutionEvent: + b.EncodeVarint(61<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BuildExecutionEvent); err != nil { + return err + } + case *BuildEvent_SourceFetchEvent: + b.EncodeVarint(62<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.SourceFetchEvent); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("BuildEvent.Event has unexpected type %T", x) + } + return nil +} + +func _BuildEvent_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*BuildEvent) + switch tag { + case 51: // event.invocation_attempt_started + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(BuildEvent_InvocationAttemptStarted) + err := b.DecodeMessage(msg) + m.Event = &BuildEvent_InvocationAttemptStarted_{msg} + return true, err + case 52: // event.invocation_attempt_finished + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(BuildEvent_InvocationAttemptFinished) + err := b.DecodeMessage(msg) + m.Event = &BuildEvent_InvocationAttemptFinished_{msg} + return true, err + case 53: // event.build_enqueued + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(BuildEvent_BuildEnqueued) + err := b.DecodeMessage(msg) + m.Event = &BuildEvent_BuildEnqueued_{msg} + return true, err + case 55: // event.build_finished + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(BuildEvent_BuildFinished) + err := b.DecodeMessage(msg) + m.Event = &BuildEvent_BuildFinished_{msg} + return true, err + case 56: // event.console_output + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(BuildEvent_ConsoleOutput) + err := b.DecodeMessage(msg) + m.Event = &BuildEvent_ConsoleOutput_{msg} + return true, err + case 59: // event.component_stream_finished + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(BuildEvent_BuildComponentStreamFinished) + err := b.DecodeMessage(msg) + m.Event = &BuildEvent_ComponentStreamFinished{msg} + return true, err + case 60: // event.bazel_event + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(google_protobuf1.Any) + err := b.DecodeMessage(msg) + m.Event = &BuildEvent_BazelEvent{msg} + return true, err + case 61: // event.build_execution_event + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(google_protobuf1.Any) + err := b.DecodeMessage(msg) + m.Event = &BuildEvent_BuildExecutionEvent{msg} + return true, err + case 62: // event.source_fetch_event + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(google_protobuf1.Any) + err := b.DecodeMessage(msg) + m.Event = &BuildEvent_SourceFetchEvent{msg} + return true, err + default: + return false, nil + } +} + +func _BuildEvent_OneofSizer(msg proto.Message) (n int) { + m := msg.(*BuildEvent) + // event + switch x := m.Event.(type) { + case *BuildEvent_InvocationAttemptStarted_: + s := proto.Size(x.InvocationAttemptStarted) + n += proto.SizeVarint(51<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *BuildEvent_InvocationAttemptFinished_: + s := proto.Size(x.InvocationAttemptFinished) + n += proto.SizeVarint(52<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *BuildEvent_BuildEnqueued_: + s := proto.Size(x.BuildEnqueued) + n += proto.SizeVarint(53<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *BuildEvent_BuildFinished_: + s := proto.Size(x.BuildFinished) + n += proto.SizeVarint(55<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *BuildEvent_ConsoleOutput_: + s := proto.Size(x.ConsoleOutput) + n += proto.SizeVarint(56<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *BuildEvent_ComponentStreamFinished: + s := proto.Size(x.ComponentStreamFinished) + n += proto.SizeVarint(59<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *BuildEvent_BazelEvent: + s := proto.Size(x.BazelEvent) + n += proto.SizeVarint(60<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *BuildEvent_BuildExecutionEvent: + s := proto.Size(x.BuildExecutionEvent) + n += proto.SizeVarint(61<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *BuildEvent_SourceFetchEvent: + s := proto.Size(x.SourceFetchEvent) + n += proto.SizeVarint(62<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Notification that the build system has attempted to run the build tool. +type BuildEvent_InvocationAttemptStarted struct { + // The number of the invocation attempt, starting at 1 and increasing by 1 + // for each new attempt. Can be used to determine if there is a later + // invocation attempt replacing the current one a client is processing. + AttemptNumber int64 `protobuf:"varint,1,opt,name=attempt_number,json=attemptNumber" json:"attempt_number,omitempty"` +} + +func (m *BuildEvent_InvocationAttemptStarted) Reset() { *m = BuildEvent_InvocationAttemptStarted{} } +func (m *BuildEvent_InvocationAttemptStarted) String() string { return proto.CompactTextString(m) } +func (*BuildEvent_InvocationAttemptStarted) ProtoMessage() {} +func (*BuildEvent_InvocationAttemptStarted) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{0, 0} +} + +func (m *BuildEvent_InvocationAttemptStarted) GetAttemptNumber() int64 { + if m != nil { + return m.AttemptNumber + } + return 0 +} + +// Notification that an invocation attempt has finished. +type BuildEvent_InvocationAttemptFinished struct { + // The exit code of the build tool. + ExitCode *google_protobuf3.Int32Value `protobuf:"bytes,2,opt,name=exit_code,json=exitCode" json:"exit_code,omitempty"` + // Final status of the invocation. + InvocationStatus *BuildStatus `protobuf:"bytes,3,opt,name=invocation_status,json=invocationStatus" json:"invocation_status,omitempty"` +} + +func (m *BuildEvent_InvocationAttemptFinished) Reset() { *m = BuildEvent_InvocationAttemptFinished{} } +func (m *BuildEvent_InvocationAttemptFinished) String() string { return proto.CompactTextString(m) } +func (*BuildEvent_InvocationAttemptFinished) ProtoMessage() {} +func (*BuildEvent_InvocationAttemptFinished) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{0, 1} +} + +func (m *BuildEvent_InvocationAttemptFinished) GetExitCode() *google_protobuf3.Int32Value { + if m != nil { + return m.ExitCode + } + return nil +} + +func (m *BuildEvent_InvocationAttemptFinished) GetInvocationStatus() *BuildStatus { + if m != nil { + return m.InvocationStatus + } + return nil +} + +// Notification that the build request is enqueued. It could happen when +// a new build request is inserted into the build queue, or when a +// build request is put back into the build queue due to a previous build +// failure. +type BuildEvent_BuildEnqueued struct { +} + +func (m *BuildEvent_BuildEnqueued) Reset() { *m = BuildEvent_BuildEnqueued{} } +func (m *BuildEvent_BuildEnqueued) String() string { return proto.CompactTextString(m) } +func (*BuildEvent_BuildEnqueued) ProtoMessage() {} +func (*BuildEvent_BuildEnqueued) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 2} } + +// Notification that the build request has finished, and no further +// invocations will occur. Note that this applies to the entire Build. +// Individual invocations trigger InvocationFinished when they finish. +type BuildEvent_BuildFinished struct { + // Final status of the build. + Status *BuildStatus `protobuf:"bytes,1,opt,name=status" json:"status,omitempty"` +} + +func (m *BuildEvent_BuildFinished) Reset() { *m = BuildEvent_BuildFinished{} } +func (m *BuildEvent_BuildFinished) String() string { return proto.CompactTextString(m) } +func (*BuildEvent_BuildFinished) ProtoMessage() {} +func (*BuildEvent_BuildFinished) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 3} } + +func (m *BuildEvent_BuildFinished) GetStatus() *BuildStatus { + if m != nil { + return m.Status + } + return nil +} + +// Textual output written to standard output or standard error. +type BuildEvent_ConsoleOutput struct { + // The output stream type. + Type ConsoleOutputStream `protobuf:"varint,1,opt,name=type,enum=google.devtools.build.v1.ConsoleOutputStream" json:"type,omitempty"` + // The output stream content. + // + // Types that are valid to be assigned to Output: + // *BuildEvent_ConsoleOutput_TextOutput + // *BuildEvent_ConsoleOutput_BinaryOutput + Output isBuildEvent_ConsoleOutput_Output `protobuf_oneof:"output"` +} + +func (m *BuildEvent_ConsoleOutput) Reset() { *m = BuildEvent_ConsoleOutput{} } +func (m *BuildEvent_ConsoleOutput) String() string { return proto.CompactTextString(m) } +func (*BuildEvent_ConsoleOutput) ProtoMessage() {} +func (*BuildEvent_ConsoleOutput) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 4} } + +type isBuildEvent_ConsoleOutput_Output interface { + isBuildEvent_ConsoleOutput_Output() +} + +type BuildEvent_ConsoleOutput_TextOutput struct { + TextOutput string `protobuf:"bytes,2,opt,name=text_output,json=textOutput,oneof"` +} +type BuildEvent_ConsoleOutput_BinaryOutput struct { + BinaryOutput []byte `protobuf:"bytes,3,opt,name=binary_output,json=binaryOutput,proto3,oneof"` +} + +func (*BuildEvent_ConsoleOutput_TextOutput) isBuildEvent_ConsoleOutput_Output() {} +func (*BuildEvent_ConsoleOutput_BinaryOutput) isBuildEvent_ConsoleOutput_Output() {} + +func (m *BuildEvent_ConsoleOutput) GetOutput() isBuildEvent_ConsoleOutput_Output { + if m != nil { + return m.Output + } + return nil +} + +func (m *BuildEvent_ConsoleOutput) GetType() ConsoleOutputStream { + if m != nil { + return m.Type + } + return ConsoleOutputStream_UNKNOWN +} + +func (m *BuildEvent_ConsoleOutput) GetTextOutput() string { + if x, ok := m.GetOutput().(*BuildEvent_ConsoleOutput_TextOutput); ok { + return x.TextOutput + } + return "" +} + +func (m *BuildEvent_ConsoleOutput) GetBinaryOutput() []byte { + if x, ok := m.GetOutput().(*BuildEvent_ConsoleOutput_BinaryOutput); ok { + return x.BinaryOutput + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*BuildEvent_ConsoleOutput) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _BuildEvent_ConsoleOutput_OneofMarshaler, _BuildEvent_ConsoleOutput_OneofUnmarshaler, _BuildEvent_ConsoleOutput_OneofSizer, []interface{}{ + (*BuildEvent_ConsoleOutput_TextOutput)(nil), + (*BuildEvent_ConsoleOutput_BinaryOutput)(nil), + } +} + +func _BuildEvent_ConsoleOutput_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*BuildEvent_ConsoleOutput) + // output + switch x := m.Output.(type) { + case *BuildEvent_ConsoleOutput_TextOutput: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeStringBytes(x.TextOutput) + case *BuildEvent_ConsoleOutput_BinaryOutput: + b.EncodeVarint(3<<3 | proto.WireBytes) + b.EncodeRawBytes(x.BinaryOutput) + case nil: + default: + return fmt.Errorf("BuildEvent_ConsoleOutput.Output has unexpected type %T", x) + } + return nil +} + +func _BuildEvent_ConsoleOutput_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*BuildEvent_ConsoleOutput) + switch tag { + case 2: // output.text_output + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Output = &BuildEvent_ConsoleOutput_TextOutput{x} + return true, err + case 3: // output.binary_output + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.Output = &BuildEvent_ConsoleOutput_BinaryOutput{x} + return true, err + default: + return false, nil + } +} + +func _BuildEvent_ConsoleOutput_OneofSizer(msg proto.Message) (n int) { + m := msg.(*BuildEvent_ConsoleOutput) + // output + switch x := m.Output.(type) { + case *BuildEvent_ConsoleOutput_TextOutput: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.TextOutput))) + n += len(x.TextOutput) + case *BuildEvent_ConsoleOutput_BinaryOutput: + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.BinaryOutput))) + n += len(x.BinaryOutput) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Notification of the end of a build event stream published by a build +// component other than CONTROLLER (See StreamId.BuildComponents). +type BuildEvent_BuildComponentStreamFinished struct { + // How the event stream finished. + Type BuildEvent_BuildComponentStreamFinished_FinishType `protobuf:"varint,1,opt,name=type,enum=google.devtools.build.v1.BuildEvent_BuildComponentStreamFinished_FinishType" json:"type,omitempty"` +} + +func (m *BuildEvent_BuildComponentStreamFinished) Reset() { + *m = BuildEvent_BuildComponentStreamFinished{} +} +func (m *BuildEvent_BuildComponentStreamFinished) String() string { return proto.CompactTextString(m) } +func (*BuildEvent_BuildComponentStreamFinished) ProtoMessage() {} +func (*BuildEvent_BuildComponentStreamFinished) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{0, 5} +} + +func (m *BuildEvent_BuildComponentStreamFinished) GetType() BuildEvent_BuildComponentStreamFinished_FinishType { + if m != nil { + return m.Type + } + return BuildEvent_BuildComponentStreamFinished_FINISH_TYPE_UNSPECIFIED +} + +// Unique identifier for a build event stream. +type StreamId struct { + // The id of a Build message. + BuildId string `protobuf:"bytes,1,opt,name=build_id,json=buildId" json:"build_id,omitempty"` + // The unique invocation ID within this build. + // It should be the same as {invocation} (below) during the migration. + InvocationId string `protobuf:"bytes,6,opt,name=invocation_id,json=invocationId" json:"invocation_id,omitempty"` + // The component that emitted this event. + Component StreamId_BuildComponent `protobuf:"varint,3,opt,name=component,enum=google.devtools.build.v1.StreamId_BuildComponent" json:"component,omitempty"` +} + +func (m *StreamId) Reset() { *m = StreamId{} } +func (m *StreamId) String() string { return proto.CompactTextString(m) } +func (*StreamId) ProtoMessage() {} +func (*StreamId) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *StreamId) GetBuildId() string { + if m != nil { + return m.BuildId + } + return "" +} + +func (m *StreamId) GetInvocationId() string { + if m != nil { + return m.InvocationId + } + return "" +} + +func (m *StreamId) GetComponent() StreamId_BuildComponent { + if m != nil { + return m.Component + } + return StreamId_UNKNOWN_COMPONENT +} + +func init() { + proto.RegisterType((*BuildEvent)(nil), "google.devtools.build.v1.BuildEvent") + proto.RegisterType((*BuildEvent_InvocationAttemptStarted)(nil), "google.devtools.build.v1.BuildEvent.InvocationAttemptStarted") + proto.RegisterType((*BuildEvent_InvocationAttemptFinished)(nil), "google.devtools.build.v1.BuildEvent.InvocationAttemptFinished") + proto.RegisterType((*BuildEvent_BuildEnqueued)(nil), "google.devtools.build.v1.BuildEvent.BuildEnqueued") + proto.RegisterType((*BuildEvent_BuildFinished)(nil), "google.devtools.build.v1.BuildEvent.BuildFinished") + proto.RegisterType((*BuildEvent_ConsoleOutput)(nil), "google.devtools.build.v1.BuildEvent.ConsoleOutput") + proto.RegisterType((*BuildEvent_BuildComponentStreamFinished)(nil), "google.devtools.build.v1.BuildEvent.BuildComponentStreamFinished") + proto.RegisterType((*StreamId)(nil), "google.devtools.build.v1.StreamId") + proto.RegisterEnum("google.devtools.build.v1.ConsoleOutputStream", ConsoleOutputStream_name, ConsoleOutputStream_value) + proto.RegisterEnum("google.devtools.build.v1.BuildEvent_BuildComponentStreamFinished_FinishType", BuildEvent_BuildComponentStreamFinished_FinishType_name, BuildEvent_BuildComponentStreamFinished_FinishType_value) + proto.RegisterEnum("google.devtools.build.v1.StreamId_BuildComponent", StreamId_BuildComponent_name, StreamId_BuildComponent_value) +} + +func init() { proto.RegisterFile("google/devtools/build/v1/build_events.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 927 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0x6d, 0x6f, 0xe3, 0x44, + 0x10, 0x8e, 0xdb, 0xa3, 0x4d, 0xa7, 0x49, 0xce, 0xb7, 0xc7, 0xa9, 0x8e, 0x5b, 0xf1, 0x52, 0x54, + 0x09, 0x81, 0x70, 0xd4, 0x14, 0x74, 0x07, 0x47, 0x4f, 0xca, 0x8b, 0xab, 0x98, 0xeb, 0xd9, 0xd1, + 0x26, 0xe5, 0x78, 0xf9, 0x10, 0x1c, 0x7b, 0x9b, 0xb3, 0x94, 0x78, 0x8d, 0xbd, 0x0e, 0x0d, 0x12, + 0x82, 0x5f, 0x83, 0xc4, 0x1f, 0xe1, 0xc7, 0xf0, 0x07, 0xe0, 0x23, 0xf2, 0xee, 0xba, 0x49, 0xda, + 0xa6, 0x77, 0x85, 0x6f, 0xbb, 0x33, 0xcf, 0x3c, 0xcf, 0xcc, 0xec, 0x8c, 0x65, 0xf8, 0x78, 0x44, + 0xe9, 0x68, 0x4c, 0x6a, 0x3e, 0x99, 0x32, 0x4a, 0xc7, 0x49, 0x6d, 0x98, 0x06, 0x63, 0xbf, 0x36, + 0x3d, 0x14, 0x87, 0x01, 0x99, 0x92, 0x90, 0x25, 0x46, 0x14, 0x53, 0x46, 0x91, 0x26, 0xc0, 0x46, + 0x0e, 0x36, 0x38, 0xc6, 0x98, 0x1e, 0xea, 0x7b, 0x92, 0xc6, 0x8d, 0x82, 0x9a, 0x1b, 0x86, 0x94, + 0xb9, 0x2c, 0xa0, 0xa1, 0x8c, 0xd3, 0x5f, 0x27, 0x92, 0x30, 0x97, 0xa5, 0x39, 0xb8, 0x2a, 0xc1, + 0xfc, 0x36, 0x4c, 0xcf, 0x6b, 0x6e, 0x38, 0x93, 0xae, 0x77, 0xaf, 0xba, 0x58, 0x30, 0x21, 0x09, + 0x73, 0x27, 0x91, 0x04, 0xbc, 0x73, 0x15, 0xf0, 0x53, 0xec, 0x46, 0x11, 0x89, 0x73, 0xee, 0x1d, + 0xe9, 0x8f, 0x23, 0xaf, 0xb6, 0x28, 0xba, 0xff, 0x77, 0x09, 0xa0, 0x99, 0xe5, 0x62, 0x66, 0xf5, + 0xa2, 0xcf, 0x01, 0x78, 0xe1, 0x83, 0x4c, 0x40, 0x53, 0xde, 0x53, 0x3e, 0xdc, 0xae, 0xeb, 0x86, + 0xac, 0x3e, 0x27, 0x37, 0xfa, 0xb9, 0x3a, 0xde, 0xe2, 0xe8, 0xec, 0x8e, 0x7e, 0x01, 0x3d, 0x08, + 0xa7, 0xd4, 0xe3, 0x0d, 0x18, 0xb8, 0x8c, 0x91, 0x49, 0xc4, 0xb2, 0x0a, 0x63, 0x46, 0x7c, 0xed, + 0x88, 0x53, 0x1d, 0x1b, 0xab, 0x1a, 0x69, 0xcc, 0x93, 0x30, 0xac, 0x4b, 0x9a, 0x86, 0x60, 0xe9, + 0x09, 0x92, 0x4e, 0x01, 0x6b, 0xc1, 0x0a, 0x1f, 0xfa, 0x4d, 0x81, 0xdd, 0x1b, 0xf4, 0xcf, 0x83, + 0x30, 0x48, 0x5e, 0x11, 0x5f, 0xfb, 0x94, 0x27, 0xf0, 0xec, 0xbf, 0x25, 0x70, 0x22, 0x59, 0x3a, + 0x05, 0x5c, 0x0d, 0x56, 0x39, 0xd1, 0xf7, 0x50, 0x91, 0xb3, 0x13, 0xfe, 0x98, 0x92, 0x94, 0xf8, + 0xda, 0x67, 0x5c, 0xb4, 0xfe, 0x46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 0xfc, 0x45, 0xbb, 0xd9, 0x86, 0x76, 0x95, 0xef, 0x8e, + 0x25, 0x78, 0x44, 0xc7, 0x6e, 0x38, 0x32, 0x68, 0x3c, 0xaa, 0x8d, 0x48, 0xc8, 0xf7, 0xb7, 0x26, + 0x5c, 0x6e, 0x14, 0x24, 0xd7, 0x7f, 0x4b, 0x9e, 0xf2, 0xc3, 0x3f, 0x8a, 0x32, 0xdc, 0xe0, 0xe0, + 0xa3, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x84, 0x0f, 0x0f, 0xdf, 0x27, 0x09, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/devtools/build/v1/build_status.pb.go b/vendor/google.golang.org/genproto/googleapis/devtools/build/v1/build_status.pb.go new file mode 100644 index 0000000000..940ddd69e1 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/devtools/build/v1/build_status.pb.go @@ -0,0 +1,130 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/devtools/build/v1/build_status.proto + +package build + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf1 "github.com/golang/protobuf/ptypes/any" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// The end result of the Build. +type BuildStatus_Result int32 + +const ( + // Unspecified or unknown. + BuildStatus_UNKNOWN_STATUS BuildStatus_Result = 0 + // Build was successful and tests (if requested) all pass. + BuildStatus_COMMAND_SUCCEEDED BuildStatus_Result = 1 + // Build error and/or test failure. + BuildStatus_COMMAND_FAILED BuildStatus_Result = 2 + // Unable to obtain a result due to input provided by the user. + BuildStatus_USER_ERROR BuildStatus_Result = 3 + // Unable to obtain a result due to a failure within the build system. + BuildStatus_SYSTEM_ERROR BuildStatus_Result = 4 + // Build required too many resources, such as build tool RAM. + BuildStatus_RESOURCE_EXHAUSTED BuildStatus_Result = 5 + // An invocation attempt time exceeded its deadline. + BuildStatus_INVOCATION_DEADLINE_EXCEEDED BuildStatus_Result = 6 + // Build request time exceeded the request_deadline + BuildStatus_REQUEST_DEADLINE_EXCEEDED BuildStatus_Result = 8 + // The build was cancelled by a call to CancelBuild. + BuildStatus_CANCELLED BuildStatus_Result = 7 +) + +var BuildStatus_Result_name = map[int32]string{ + 0: "UNKNOWN_STATUS", + 1: "COMMAND_SUCCEEDED", + 2: "COMMAND_FAILED", + 3: "USER_ERROR", + 4: "SYSTEM_ERROR", + 5: "RESOURCE_EXHAUSTED", + 6: "INVOCATION_DEADLINE_EXCEEDED", + 8: "REQUEST_DEADLINE_EXCEEDED", + 7: "CANCELLED", +} +var BuildStatus_Result_value = map[string]int32{ + "UNKNOWN_STATUS": 0, + "COMMAND_SUCCEEDED": 1, + "COMMAND_FAILED": 2, + "USER_ERROR": 3, + "SYSTEM_ERROR": 4, + "RESOURCE_EXHAUSTED": 5, + "INVOCATION_DEADLINE_EXCEEDED": 6, + "REQUEST_DEADLINE_EXCEEDED": 8, + "CANCELLED": 7, +} + +func (x BuildStatus_Result) String() string { + return proto.EnumName(BuildStatus_Result_name, int32(x)) +} +func (BuildStatus_Result) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{0, 0} } + +// Status used for both invocation attempt and overall build completion. +type BuildStatus struct { + // The end result. + Result BuildStatus_Result `protobuf:"varint,1,opt,name=result,enum=google.devtools.build.v1.BuildStatus_Result" json:"result,omitempty"` + // Fine-grained diagnostic information to complement the status. + Details *google_protobuf1.Any `protobuf:"bytes,2,opt,name=details" json:"details,omitempty"` +} + +func (m *BuildStatus) Reset() { *m = BuildStatus{} } +func (m *BuildStatus) String() string { return proto.CompactTextString(m) } +func (*BuildStatus) ProtoMessage() {} +func (*BuildStatus) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +func (m *BuildStatus) GetResult() BuildStatus_Result { + if m != nil { + return m.Result + } + return BuildStatus_UNKNOWN_STATUS +} + +func (m *BuildStatus) GetDetails() *google_protobuf1.Any { + if m != nil { + return m.Details + } + return nil +} + +func init() { + proto.RegisterType((*BuildStatus)(nil), "google.devtools.build.v1.BuildStatus") + proto.RegisterEnum("google.devtools.build.v1.BuildStatus_Result", BuildStatus_Result_name, BuildStatus_Result_value) +} + +func init() { proto.RegisterFile("google/devtools/build/v1/build_status.proto", fileDescriptor1) } + +var fileDescriptor1 = []byte{ + // 390 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0x4f, 0x0b, 0xd3, 0x30, + 0x18, 0xc6, 0xcd, 0xd4, 0x4e, 0x33, 0x1d, 0x35, 0xa8, 0x6c, 0x63, 0xc2, 0xd8, 0x69, 0xa0, 0xa4, + 0x6c, 0x1e, 0xc5, 0x43, 0xd6, 0x44, 0x2c, 0x6e, 0xe9, 0x4c, 0x5a, 0xff, 0x5d, 0x4a, 0xe6, 0x6a, + 0x29, 0xd4, 0x66, 0xac, 0xe9, 0x60, 0x1f, 0xd3, 0x93, 0x5f, 0xc5, 0xa3, 0xf4, 0x1f, 0x0c, 0x74, + 0xb7, 0xf4, 0x7d, 0x7e, 0xcf, 0xf3, 0xbe, 0x3c, 0x14, 0xbe, 0x4c, 0xb4, 0x4e, 0xb2, 0xd8, 0x39, + 0xc4, 0x67, 0xa3, 0x75, 0x56, 0x38, 0xfb, 0x32, 0xcd, 0x0e, 0xce, 0x79, 0xd9, 0x3c, 0xa2, 0xc2, + 0x28, 0x53, 0x16, 0xf8, 0x78, 0xd2, 0x46, 0xa3, 0x51, 0x03, 0xe3, 0x0e, 0xc6, 0x35, 0x83, 0xcf, + 0xcb, 0xc9, 0xb4, 0x8d, 0x51, 0xc7, 0xd4, 0x51, 0x79, 0xae, 0x8d, 0x32, 0xa9, 0xce, 0x5b, 0xdf, + 0x64, 0xdc, 0xaa, 0xf5, 0xd7, 0xbe, 0xfc, 0xe1, 0xa8, 0xfc, 0xd2, 0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 0xa6, 0xba, 0xa4, 0xbf, 0x36, 0x70, 0xfa, 0x5d, 0xff, 0xbc, 0x59, 0xdf, 0xda, + 0xbe, 0xea, 0x6f, 0x57, 0xb5, 0xb2, 0x03, 0xdf, 0xde, 0xb6, 0x74, 0xa2, 0x33, 0x95, 0x27, 0x58, + 0x9f, 0x12, 0x27, 0x89, 0xf3, 0xba, 0x33, 0xa7, 0x91, 0xd4, 0x31, 0x2d, 0xfe, 0xfd, 0x59, 0xde, + 0xd4, 0x8f, 0x3f, 0x00, 0xec, 0xad, 0x1a, 0x7e, 0xfd, 0x37, 0x00, 0x00, 0xff, 0xff, 0xd6, 0x3d, + 0xf5, 0x87, 0x58, 0x02, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/devtools/build/v1/publish_build_event.pb.go b/vendor/google.golang.org/genproto/googleapis/devtools/build/v1/publish_build_event.pb.go new file mode 100644 index 0000000000..ee9fd227b6 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/devtools/build/v1/publish_build_event.pb.go @@ -0,0 +1,465 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/devtools/build/v1/publish_build_event.proto + +package build + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf4 "github.com/golang/protobuf/ptypes/duration" +import google_protobuf5 "github.com/golang/protobuf/ptypes/empty" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// The service level of the build request. Backends only uses this value when +// the BuildEnqueued event is published to determine what level of service +// this build should receive. +type PublishLifecycleEventRequest_ServiceLevel int32 + +const ( + // Non-interactive builds can tolerate longer event latencies. This is the + // default ServiceLevel if callers do not specify one. + PublishLifecycleEventRequest_NONINTERACTIVE PublishLifecycleEventRequest_ServiceLevel = 0 + // The events of an interactive build should be delivered with low latency. + PublishLifecycleEventRequest_INTERACTIVE PublishLifecycleEventRequest_ServiceLevel = 1 +) + +var PublishLifecycleEventRequest_ServiceLevel_name = map[int32]string{ + 0: "NONINTERACTIVE", + 1: "INTERACTIVE", +} +var PublishLifecycleEventRequest_ServiceLevel_value = map[string]int32{ + "NONINTERACTIVE": 0, + "INTERACTIVE": 1, +} + +func (x PublishLifecycleEventRequest_ServiceLevel) String() string { + return proto.EnumName(PublishLifecycleEventRequest_ServiceLevel_name, int32(x)) +} +func (PublishLifecycleEventRequest_ServiceLevel) EnumDescriptor() ([]byte, []int) { + return fileDescriptor2, []int{0, 0} +} + +// Publishes 'lifecycle events' that update the high-level state of a build: +// - BuildEnqueued: When a build is scheduled. +// - InvocationAttemptStarted: When work for a build starts; there can be +// multiple invocations for a build (e.g. retries). +// - InvocationAttemptCompleted: When work for a build finishes. +// - BuildFinished: When a build is finished. +type PublishLifecycleEventRequest struct { + // The interactivity of this build. + ServiceLevel PublishLifecycleEventRequest_ServiceLevel `protobuf:"varint,1,opt,name=service_level,json=serviceLevel,enum=google.devtools.build.v1.PublishLifecycleEventRequest_ServiceLevel" json:"service_level,omitempty"` + // The lifecycle build event. If this is a build tool event, the RPC will fail + // with INVALID_REQUEST. + BuildEvent *OrderedBuildEvent `protobuf:"bytes,2,opt,name=build_event,json=buildEvent" json:"build_event,omitempty"` + // If the next event for this build or invocation (depending on the event + // type) hasn't been published after this duration from when {build_event} + // is written to BES, consider this stream expired. If this field is not set, + // BES backend will use its own default value. + StreamTimeout *google_protobuf4.Duration `protobuf:"bytes,3,opt,name=stream_timeout,json=streamTimeout" json:"stream_timeout,omitempty"` + // Additional information about a build request. These are define by the event + // publishers, and the Build Event Service does not validate or interpret + // them. They are used while notifying internal systems of new builds and + // invocations if the OrderedBuildEvent.event type is + // BuildEnqueued/InvocationAttemptStarted. + NotificationKeywords []string `protobuf:"bytes,4,rep,name=notification_keywords,json=notificationKeywords" json:"notification_keywords,omitempty"` + // This field identifies which project (if any) the build is associated with. + ProjectId string `protobuf:"bytes,6,opt,name=project_id,json=projectId" json:"project_id,omitempty"` +} + +func (m *PublishLifecycleEventRequest) Reset() { *m = PublishLifecycleEventRequest{} } +func (m *PublishLifecycleEventRequest) String() string { return proto.CompactTextString(m) } +func (*PublishLifecycleEventRequest) ProtoMessage() {} +func (*PublishLifecycleEventRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} } + +func (m *PublishLifecycleEventRequest) GetServiceLevel() PublishLifecycleEventRequest_ServiceLevel { + if m != nil { + return m.ServiceLevel + } + return PublishLifecycleEventRequest_NONINTERACTIVE +} + +func (m *PublishLifecycleEventRequest) GetBuildEvent() *OrderedBuildEvent { + if m != nil { + return m.BuildEvent + } + return nil +} + +func (m *PublishLifecycleEventRequest) GetStreamTimeout() *google_protobuf4.Duration { + if m != nil { + return m.StreamTimeout + } + return nil +} + +func (m *PublishLifecycleEventRequest) GetNotificationKeywords() []string { + if m != nil { + return m.NotificationKeywords + } + return nil +} + +func (m *PublishLifecycleEventRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +// States which event has been committed. Any failure to commit will cause +// RPC errors, hence not recorded by this proto. +type PublishBuildToolEventStreamResponse struct { + // The stream that contains this event. + StreamId *StreamId `protobuf:"bytes,1,opt,name=stream_id,json=streamId" json:"stream_id,omitempty"` + // The sequence number of this event that has been committed. + SequenceNumber int64 `protobuf:"varint,2,opt,name=sequence_number,json=sequenceNumber" json:"sequence_number,omitempty"` +} + +func (m *PublishBuildToolEventStreamResponse) Reset() { *m = PublishBuildToolEventStreamResponse{} } +func (m *PublishBuildToolEventStreamResponse) String() string { return proto.CompactTextString(m) } +func (*PublishBuildToolEventStreamResponse) ProtoMessage() {} +func (*PublishBuildToolEventStreamResponse) Descriptor() ([]byte, []int) { + return fileDescriptor2, []int{1} +} + +func (m *PublishBuildToolEventStreamResponse) GetStreamId() *StreamId { + if m != nil { + return m.StreamId + } + return nil +} + +func (m *PublishBuildToolEventStreamResponse) GetSequenceNumber() int64 { + if m != nil { + return m.SequenceNumber + } + return 0 +} + +// Build event with contextual information about the stream it belongs to and +// its position in that stream. +type OrderedBuildEvent struct { + // Which build event stream this event belongs to. + StreamId *StreamId `protobuf:"bytes,1,opt,name=stream_id,json=streamId" json:"stream_id,omitempty"` + // The position of this event in the stream. The sequence numbers for a build + // event stream should be a sequence of consecutive natural numbers starting + // from one. (1, 2, 3, ...) + SequenceNumber int64 `protobuf:"varint,2,opt,name=sequence_number,json=sequenceNumber" json:"sequence_number,omitempty"` + // The actual event. + Event *BuildEvent `protobuf:"bytes,3,opt,name=event" json:"event,omitempty"` +} + +func (m *OrderedBuildEvent) Reset() { *m = OrderedBuildEvent{} } +func (m *OrderedBuildEvent) String() string { return proto.CompactTextString(m) } +func (*OrderedBuildEvent) ProtoMessage() {} +func (*OrderedBuildEvent) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{2} } + +func (m *OrderedBuildEvent) GetStreamId() *StreamId { + if m != nil { + return m.StreamId + } + return nil +} + +func (m *OrderedBuildEvent) GetSequenceNumber() int64 { + if m != nil { + return m.SequenceNumber + } + return 0 +} + +func (m *OrderedBuildEvent) GetEvent() *BuildEvent { + if m != nil { + return m.Event + } + return nil +} + +type PublishBuildToolEventStreamRequest struct { + // Which build event stream this event belongs to. + StreamId *StreamId `protobuf:"bytes,1,opt,name=stream_id,json=streamId" json:"stream_id,omitempty"` + // The position of this event in the stream. The sequence numbers for a build + // event stream should be a sequence of consecutive natural numbers starting + // from one. (1, 2, 3, ...) + SequenceNumber int64 `protobuf:"varint,2,opt,name=sequence_number,json=sequenceNumber" json:"sequence_number,omitempty"` + // The actual event. + Event *BuildEvent `protobuf:"bytes,3,opt,name=event" json:"event,omitempty"` + // The build event with position info. + // New publishing clients should use this field rather than the 3 above. + OrderedBuildEvent *OrderedBuildEvent `protobuf:"bytes,4,opt,name=ordered_build_event,json=orderedBuildEvent" json:"ordered_build_event,omitempty"` + // The keywords to be attached to the notification which notifies the start + // of a new build event stream. BES only reads this field when sequence_number + // or ordered_build_event.sequence_number is 1 in this message. If this field + // is empty, BES will not publish notification messages for this stream. + NotificationKeywords []string `protobuf:"bytes,5,rep,name=notification_keywords,json=notificationKeywords" json:"notification_keywords,omitempty"` +} + +func (m *PublishBuildToolEventStreamRequest) Reset() { *m = PublishBuildToolEventStreamRequest{} } +func (m *PublishBuildToolEventStreamRequest) String() string { return proto.CompactTextString(m) } +func (*PublishBuildToolEventStreamRequest) ProtoMessage() {} +func (*PublishBuildToolEventStreamRequest) Descriptor() ([]byte, []int) { + return fileDescriptor2, []int{3} +} + +func (m *PublishBuildToolEventStreamRequest) GetStreamId() *StreamId { + if m != nil { + return m.StreamId + } + return nil +} + +func (m *PublishBuildToolEventStreamRequest) GetSequenceNumber() int64 { + if m != nil { + return m.SequenceNumber + } + return 0 +} + +func (m *PublishBuildToolEventStreamRequest) GetEvent() *BuildEvent { + if m != nil { + return m.Event + } + return nil +} + +func (m *PublishBuildToolEventStreamRequest) GetOrderedBuildEvent() *OrderedBuildEvent { + if m != nil { + return m.OrderedBuildEvent + } + return nil +} + +func (m *PublishBuildToolEventStreamRequest) GetNotificationKeywords() []string { + if m != nil { + return m.NotificationKeywords + } + return nil +} + +func init() { + proto.RegisterType((*PublishLifecycleEventRequest)(nil), "google.devtools.build.v1.PublishLifecycleEventRequest") + proto.RegisterType((*PublishBuildToolEventStreamResponse)(nil), "google.devtools.build.v1.PublishBuildToolEventStreamResponse") + proto.RegisterType((*OrderedBuildEvent)(nil), "google.devtools.build.v1.OrderedBuildEvent") + proto.RegisterType((*PublishBuildToolEventStreamRequest)(nil), "google.devtools.build.v1.PublishBuildToolEventStreamRequest") + proto.RegisterEnum("google.devtools.build.v1.PublishLifecycleEventRequest_ServiceLevel", PublishLifecycleEventRequest_ServiceLevel_name, PublishLifecycleEventRequest_ServiceLevel_value) +} + +// 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 + +// Client API for PublishBuildEvent service + +type PublishBuildEventClient interface { + // Publish a build event stating the new state of a build (typically from the + // build queue). If the event is a BuildEnqueued event, also register the new + // build request ID and its build type to BES. + // + // The backend will persist the event and deliver it to registered frontend + // jobs immediately without batching. + // + // The commit status of the request is reported by the RPC's util_status() + // function. The error code is the canoncial error code defined in + // //util/task/codes.proto. + PublishLifecycleEvent(ctx context.Context, in *PublishLifecycleEventRequest, opts ...grpc.CallOption) (*google_protobuf5.Empty, error) + // Publish build tool events belonging to the same stream to a backend job + // using bidirectional streaming. + PublishBuildToolEventStream(ctx context.Context, opts ...grpc.CallOption) (PublishBuildEvent_PublishBuildToolEventStreamClient, error) +} + +type publishBuildEventClient struct { + cc *grpc.ClientConn +} + +func NewPublishBuildEventClient(cc *grpc.ClientConn) PublishBuildEventClient { + return &publishBuildEventClient{cc} +} + +func (c *publishBuildEventClient) PublishLifecycleEvent(ctx context.Context, in *PublishLifecycleEventRequest, opts ...grpc.CallOption) (*google_protobuf5.Empty, error) { + out := new(google_protobuf5.Empty) + err := grpc.Invoke(ctx, "/google.devtools.build.v1.PublishBuildEvent/PublishLifecycleEvent", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *publishBuildEventClient) PublishBuildToolEventStream(ctx context.Context, opts ...grpc.CallOption) (PublishBuildEvent_PublishBuildToolEventStreamClient, error) { + stream, err := grpc.NewClientStream(ctx, &_PublishBuildEvent_serviceDesc.Streams[0], c.cc, "/google.devtools.build.v1.PublishBuildEvent/PublishBuildToolEventStream", opts...) + if err != nil { + return nil, err + } + x := &publishBuildEventPublishBuildToolEventStreamClient{stream} + return x, nil +} + +type PublishBuildEvent_PublishBuildToolEventStreamClient interface { + Send(*OrderedBuildEvent) error + Recv() (*PublishBuildToolEventStreamResponse, error) + grpc.ClientStream +} + +type publishBuildEventPublishBuildToolEventStreamClient struct { + grpc.ClientStream +} + +func (x *publishBuildEventPublishBuildToolEventStreamClient) Send(m *OrderedBuildEvent) error { + return x.ClientStream.SendMsg(m) +} + +func (x *publishBuildEventPublishBuildToolEventStreamClient) Recv() (*PublishBuildToolEventStreamResponse, error) { + m := new(PublishBuildToolEventStreamResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// Server API for PublishBuildEvent service + +type PublishBuildEventServer interface { + // Publish a build event stating the new state of a build (typically from the + // build queue). If the event is a BuildEnqueued event, also register the new + // build request ID and its build type to BES. + // + // The backend will persist the event and deliver it to registered frontend + // jobs immediately without batching. + // + // The commit status of the request is reported by the RPC's util_status() + // function. The error code is the canoncial error code defined in + // //util/task/codes.proto. + PublishLifecycleEvent(context.Context, *PublishLifecycleEventRequest) (*google_protobuf5.Empty, error) + // Publish build tool events belonging to the same stream to a backend job + // using bidirectional streaming. + PublishBuildToolEventStream(PublishBuildEvent_PublishBuildToolEventStreamServer) error +} + +func RegisterPublishBuildEventServer(s *grpc.Server, srv PublishBuildEventServer) { + s.RegisterService(&_PublishBuildEvent_serviceDesc, srv) +} + +func _PublishBuildEvent_PublishLifecycleEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PublishLifecycleEventRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PublishBuildEventServer).PublishLifecycleEvent(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.build.v1.PublishBuildEvent/PublishLifecycleEvent", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PublishBuildEventServer).PublishLifecycleEvent(ctx, req.(*PublishLifecycleEventRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PublishBuildEvent_PublishBuildToolEventStream_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(PublishBuildEventServer).PublishBuildToolEventStream(&publishBuildEventPublishBuildToolEventStreamServer{stream}) +} + +type PublishBuildEvent_PublishBuildToolEventStreamServer interface { + Send(*PublishBuildToolEventStreamResponse) error + Recv() (*OrderedBuildEvent, error) + grpc.ServerStream +} + +type publishBuildEventPublishBuildToolEventStreamServer struct { + grpc.ServerStream +} + +func (x *publishBuildEventPublishBuildToolEventStreamServer) Send(m *PublishBuildToolEventStreamResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *publishBuildEventPublishBuildToolEventStreamServer) Recv() (*OrderedBuildEvent, error) { + m := new(OrderedBuildEvent) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +var _PublishBuildEvent_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.devtools.build.v1.PublishBuildEvent", + HandlerType: (*PublishBuildEventServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "PublishLifecycleEvent", + Handler: _PublishBuildEvent_PublishLifecycleEvent_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "PublishBuildToolEventStream", + Handler: _PublishBuildEvent_PublishBuildToolEventStream_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "google/devtools/build/v1/publish_build_event.proto", +} + +func init() { proto.RegisterFile("google/devtools/build/v1/publish_build_event.proto", fileDescriptor2) } + +var fileDescriptor2 = []byte{ + // 666 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0xcf, 0x6e, 0xd3, 0x4e, + 0x10, 0xfe, 0x6d, 0xd2, 0x56, 0xbf, 0x6c, 0xda, 0x94, 0x2e, 0x14, 0x4c, 0xda, 0xa2, 0xc8, 0x20, + 0x88, 0xa8, 0x64, 0xd3, 0x54, 0xe2, 0x50, 0x54, 0xfe, 0xa4, 0xe4, 0x10, 0x51, 0xa5, 0x95, 0x1b, + 0x71, 0x80, 0x83, 0xe5, 0xd8, 0xd3, 0x74, 0xa9, 0xe3, 0x35, 0xde, 0xb5, 0x51, 0xaf, 0xbc, 0x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0x10, 0x78, 0x87, 0xa9, 0x1a, 0x87, 0xe8, 0xd5, 0x6e, 0xe6, 0x39, 0x64, + 0xbe, 0x13, 0x0c, 0x0d, 0x16, 0x0d, 0xcd, 0x21, 0x04, 0x52, 0x2b, 0x53, 0x99, 0x9c, 0x90, 0xf2, + 0xc9, 0x9f, 0xcd, 0x23, 0xf9, 0xf1, 0x03, 0xa1, 0xc1, 0x82, 0x74, 0xde, 0xfe, 0x19, 0x00, 0x00, + 0xff, 0xff, 0x85, 0x4c, 0x16, 0x72, 0x04, 0x07, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/devtools/cloudbuild/v1/cloudbuild.pb.go b/vendor/google.golang.org/genproto/googleapis/devtools/cloudbuild/v1/cloudbuild.pb.go new file mode 100644 index 0000000000..fbd3b6cde4 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/devtools/cloudbuild/v1/cloudbuild.pb.go @@ -0,0 +1,2524 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/devtools/cloudbuild/v1/cloudbuild.proto + +/* +Package cloudbuild is a generated protocol buffer package. + +It is generated from these files: + google/devtools/cloudbuild/v1/cloudbuild.proto + +It has these top-level messages: + RetryBuildRequest + RunBuildTriggerRequest + StorageSource + RepoSource + Source + BuiltImage + BuildStep + Volume + Results + Build + BuildOperationMetadata + SourceProvenance + FileHashes + Hash + Secret + CreateBuildRequest + GetBuildRequest + ListBuildsRequest + ListBuildsResponse + CancelBuildRequest + BuildTrigger + CreateBuildTriggerRequest + GetBuildTriggerRequest + ListBuildTriggersRequest + ListBuildTriggersResponse + DeleteBuildTriggerRequest + UpdateBuildTriggerRequest + BuildOptions +*/ +package cloudbuild + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import _ "google.golang.org/genproto/googleapis/cloud/audit" +import google_longrunning "google.golang.org/genproto/googleapis/longrunning" +import google_protobuf4 "github.com/golang/protobuf/ptypes/duration" +import google_protobuf3 "github.com/golang/protobuf/ptypes/empty" +import google_protobuf5 "github.com/golang/protobuf/ptypes/timestamp" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Possible status of a build. +type Build_Status int32 + +const ( + // Status of the build is unknown. + Build_STATUS_UNKNOWN Build_Status = 0 + // Build is queued; work has not yet begun. + Build_QUEUED Build_Status = 1 + // Build is being executed. + Build_WORKING Build_Status = 2 + // Build finished successfully. + Build_SUCCESS Build_Status = 3 + // Build failed to complete successfully. + Build_FAILURE Build_Status = 4 + // Build failed due to an internal cause. + Build_INTERNAL_ERROR Build_Status = 5 + // Build took longer than was allowed. + Build_TIMEOUT Build_Status = 6 + // Build was canceled by a user. + Build_CANCELLED Build_Status = 7 +) + +var Build_Status_name = map[int32]string{ + 0: "STATUS_UNKNOWN", + 1: "QUEUED", + 2: "WORKING", + 3: "SUCCESS", + 4: "FAILURE", + 5: "INTERNAL_ERROR", + 6: "TIMEOUT", + 7: "CANCELLED", +} +var Build_Status_value = map[string]int32{ + "STATUS_UNKNOWN": 0, + "QUEUED": 1, + "WORKING": 2, + "SUCCESS": 3, + "FAILURE": 4, + "INTERNAL_ERROR": 5, + "TIMEOUT": 6, + "CANCELLED": 7, +} + +func (x Build_Status) String() string { + return proto.EnumName(Build_Status_name, int32(x)) +} +func (Build_Status) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{9, 0} } + +// Specifies the hash algorithm, if any. +type Hash_HashType int32 + +const ( + // No hash requested. + Hash_NONE Hash_HashType = 0 + // Use a sha256 hash. + Hash_SHA256 Hash_HashType = 1 +) + +var Hash_HashType_name = map[int32]string{ + 0: "NONE", + 1: "SHA256", +} +var Hash_HashType_value = map[string]int32{ + "NONE": 0, + "SHA256": 1, +} + +func (x Hash_HashType) String() string { + return proto.EnumName(Hash_HashType_name, int32(x)) +} +func (Hash_HashType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{13, 0} } + +// Specifies the manner in which the build should be verified, if at all. +type BuildOptions_VerifyOption int32 + +const ( + // Not a verifiable build. (default) + BuildOptions_NOT_VERIFIED BuildOptions_VerifyOption = 0 + // Verified build. + BuildOptions_VERIFIED BuildOptions_VerifyOption = 1 +) + +var BuildOptions_VerifyOption_name = map[int32]string{ + 0: "NOT_VERIFIED", + 1: "VERIFIED", +} +var BuildOptions_VerifyOption_value = map[string]int32{ + "NOT_VERIFIED": 0, + "VERIFIED": 1, +} + +func (x BuildOptions_VerifyOption) String() string { + return proto.EnumName(BuildOptions_VerifyOption_name, int32(x)) +} +func (BuildOptions_VerifyOption) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{27, 0} +} + +// Supported VM sizes. +type BuildOptions_MachineType int32 + +const ( + // Standard machine type. + BuildOptions_UNSPECIFIED BuildOptions_MachineType = 0 + // Medium size. + BuildOptions_N1_HIGHCPU_8 BuildOptions_MachineType = 1 + // Large size. + BuildOptions_N1_HIGHCPU_32 BuildOptions_MachineType = 2 +) + +var BuildOptions_MachineType_name = map[int32]string{ + 0: "UNSPECIFIED", + 1: "N1_HIGHCPU_8", + 2: "N1_HIGHCPU_32", +} +var BuildOptions_MachineType_value = map[string]int32{ + "UNSPECIFIED": 0, + "N1_HIGHCPU_8": 1, + "N1_HIGHCPU_32": 2, +} + +func (x BuildOptions_MachineType) String() string { + return proto.EnumName(BuildOptions_MachineType_name, int32(x)) +} +func (BuildOptions_MachineType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{27, 1} } + +// Specifies the behavior when there is an error in the substitution checks. +type BuildOptions_SubstitutionOption int32 + +const ( + // Fails the build if error in substitutions checks, like missing + // a substitution in the template or in the map. + BuildOptions_MUST_MATCH BuildOptions_SubstitutionOption = 0 + // Do not fail the build if error in substitutions checks. + BuildOptions_ALLOW_LOOSE BuildOptions_SubstitutionOption = 1 +) + +var BuildOptions_SubstitutionOption_name = map[int32]string{ + 0: "MUST_MATCH", + 1: "ALLOW_LOOSE", +} +var BuildOptions_SubstitutionOption_value = map[string]int32{ + "MUST_MATCH": 0, + "ALLOW_LOOSE": 1, +} + +func (x BuildOptions_SubstitutionOption) String() string { + return proto.EnumName(BuildOptions_SubstitutionOption_name, int32(x)) +} +func (BuildOptions_SubstitutionOption) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{27, 2} +} + +// Specifies the behavior when writing build logs to Google Cloud Storage. +type BuildOptions_LogStreamingOption int32 + +const ( + // Service may automatically determine build log streaming behavior. + BuildOptions_STREAM_DEFAULT BuildOptions_LogStreamingOption = 0 + // Build logs should be streamed to Google Cloud Storage. + BuildOptions_STREAM_ON BuildOptions_LogStreamingOption = 1 + // Build logs should not be streamed to Google Cloud Storage; they will be + // written when the build is completed. + BuildOptions_STREAM_OFF BuildOptions_LogStreamingOption = 2 +) + +var BuildOptions_LogStreamingOption_name = map[int32]string{ + 0: "STREAM_DEFAULT", + 1: "STREAM_ON", + 2: "STREAM_OFF", +} +var BuildOptions_LogStreamingOption_value = map[string]int32{ + "STREAM_DEFAULT": 0, + "STREAM_ON": 1, + "STREAM_OFF": 2, +} + +func (x BuildOptions_LogStreamingOption) String() string { + return proto.EnumName(BuildOptions_LogStreamingOption_name, int32(x)) +} +func (BuildOptions_LogStreamingOption) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{27, 3} +} + +// RetryBuildRequest specifies a build to retry. +type RetryBuildRequest struct { + // ID of the project. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // Build ID of the original build. + Id string `protobuf:"bytes,2,opt,name=id" json:"id,omitempty"` +} + +func (m *RetryBuildRequest) Reset() { *m = RetryBuildRequest{} } +func (m *RetryBuildRequest) String() string { return proto.CompactTextString(m) } +func (*RetryBuildRequest) ProtoMessage() {} +func (*RetryBuildRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *RetryBuildRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *RetryBuildRequest) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +// RunBuildTriggerRequest specifies a build trigger to run and the source to +// use. +type RunBuildTriggerRequest struct { + // ID of the project. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // ID of the trigger. + TriggerId string `protobuf:"bytes,2,opt,name=trigger_id,json=triggerId" json:"trigger_id,omitempty"` + // Source to build against this trigger. + Source *RepoSource `protobuf:"bytes,3,opt,name=source" json:"source,omitempty"` +} + +func (m *RunBuildTriggerRequest) Reset() { *m = RunBuildTriggerRequest{} } +func (m *RunBuildTriggerRequest) String() string { return proto.CompactTextString(m) } +func (*RunBuildTriggerRequest) ProtoMessage() {} +func (*RunBuildTriggerRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *RunBuildTriggerRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *RunBuildTriggerRequest) GetTriggerId() string { + if m != nil { + return m.TriggerId + } + return "" +} + +func (m *RunBuildTriggerRequest) GetSource() *RepoSource { + if m != nil { + return m.Source + } + return nil +} + +// StorageSource describes the location of the source in an archive file in +// Google Cloud Storage. +type StorageSource struct { + // Google Cloud Storage bucket containing source (see + // [Bucket Name + // Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). + Bucket string `protobuf:"bytes,1,opt,name=bucket" json:"bucket,omitempty"` + // Google Cloud Storage object containing source. + // + // This object must be a gzipped archive file (.tar.gz) containing source to + // build. + Object string `protobuf:"bytes,2,opt,name=object" json:"object,omitempty"` + // Google Cloud Storage generation for the object. If the generation is + // omitted, the latest generation will be used. + Generation int64 `protobuf:"varint,3,opt,name=generation" json:"generation,omitempty"` +} + +func (m *StorageSource) Reset() { *m = StorageSource{} } +func (m *StorageSource) String() string { return proto.CompactTextString(m) } +func (*StorageSource) ProtoMessage() {} +func (*StorageSource) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *StorageSource) GetBucket() string { + if m != nil { + return m.Bucket + } + return "" +} + +func (m *StorageSource) GetObject() string { + if m != nil { + return m.Object + } + return "" +} + +func (m *StorageSource) GetGeneration() int64 { + if m != nil { + return m.Generation + } + return 0 +} + +// RepoSource describes the location of the source in a Google Cloud Source +// Repository. +type RepoSource struct { + // ID of the project that owns the repo. If omitted, the project ID requesting + // the build is assumed. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // Name of the repo. If omitted, the name "default" is assumed. + RepoName string `protobuf:"bytes,2,opt,name=repo_name,json=repoName" json:"repo_name,omitempty"` + // A revision within the source repository must be specified in + // one of these ways. + // + // Types that are valid to be assigned to Revision: + // *RepoSource_BranchName + // *RepoSource_TagName + // *RepoSource_CommitSha + Revision isRepoSource_Revision `protobuf_oneof:"revision"` + // Directory, relative to the source root, in which to run the build. + Dir string `protobuf:"bytes,7,opt,name=dir" json:"dir,omitempty"` +} + +func (m *RepoSource) Reset() { *m = RepoSource{} } +func (m *RepoSource) String() string { return proto.CompactTextString(m) } +func (*RepoSource) ProtoMessage() {} +func (*RepoSource) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +type isRepoSource_Revision interface { + isRepoSource_Revision() +} + +type RepoSource_BranchName struct { + BranchName string `protobuf:"bytes,3,opt,name=branch_name,json=branchName,oneof"` +} +type RepoSource_TagName struct { + TagName string `protobuf:"bytes,4,opt,name=tag_name,json=tagName,oneof"` +} +type RepoSource_CommitSha struct { + CommitSha string `protobuf:"bytes,5,opt,name=commit_sha,json=commitSha,oneof"` +} + +func (*RepoSource_BranchName) isRepoSource_Revision() {} +func (*RepoSource_TagName) isRepoSource_Revision() {} +func (*RepoSource_CommitSha) isRepoSource_Revision() {} + +func (m *RepoSource) GetRevision() isRepoSource_Revision { + if m != nil { + return m.Revision + } + return nil +} + +func (m *RepoSource) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *RepoSource) GetRepoName() string { + if m != nil { + return m.RepoName + } + return "" +} + +func (m *RepoSource) GetBranchName() string { + if x, ok := m.GetRevision().(*RepoSource_BranchName); ok { + return x.BranchName + } + return "" +} + +func (m *RepoSource) GetTagName() string { + if x, ok := m.GetRevision().(*RepoSource_TagName); ok { + return x.TagName + } + return "" +} + +func (m *RepoSource) GetCommitSha() string { + if x, ok := m.GetRevision().(*RepoSource_CommitSha); ok { + return x.CommitSha + } + return "" +} + +func (m *RepoSource) GetDir() string { + if m != nil { + return m.Dir + } + return "" +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*RepoSource) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _RepoSource_OneofMarshaler, _RepoSource_OneofUnmarshaler, _RepoSource_OneofSizer, []interface{}{ + (*RepoSource_BranchName)(nil), + (*RepoSource_TagName)(nil), + (*RepoSource_CommitSha)(nil), + } +} + +func _RepoSource_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*RepoSource) + // revision + switch x := m.Revision.(type) { + case *RepoSource_BranchName: + b.EncodeVarint(3<<3 | proto.WireBytes) + b.EncodeStringBytes(x.BranchName) + case *RepoSource_TagName: + b.EncodeVarint(4<<3 | proto.WireBytes) + b.EncodeStringBytes(x.TagName) + case *RepoSource_CommitSha: + b.EncodeVarint(5<<3 | proto.WireBytes) + b.EncodeStringBytes(x.CommitSha) + case nil: + default: + return fmt.Errorf("RepoSource.Revision has unexpected type %T", x) + } + return nil +} + +func _RepoSource_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*RepoSource) + switch tag { + case 3: // revision.branch_name + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Revision = &RepoSource_BranchName{x} + return true, err + case 4: // revision.tag_name + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Revision = &RepoSource_TagName{x} + return true, err + case 5: // revision.commit_sha + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Revision = &RepoSource_CommitSha{x} + return true, err + default: + return false, nil + } +} + +func _RepoSource_OneofSizer(msg proto.Message) (n int) { + m := msg.(*RepoSource) + // revision + switch x := m.Revision.(type) { + case *RepoSource_BranchName: + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.BranchName))) + n += len(x.BranchName) + case *RepoSource_TagName: + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.TagName))) + n += len(x.TagName) + case *RepoSource_CommitSha: + n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.CommitSha))) + n += len(x.CommitSha) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Source describes the location of the source in a supported storage +// service. +type Source struct { + // Describes location of source. + // + // Types that are valid to be assigned to Source: + // *Source_StorageSource + // *Source_RepoSource + Source isSource_Source `protobuf_oneof:"source"` +} + +func (m *Source) Reset() { *m = Source{} } +func (m *Source) String() string { return proto.CompactTextString(m) } +func (*Source) ProtoMessage() {} +func (*Source) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +type isSource_Source interface { + isSource_Source() +} + +type Source_StorageSource struct { + StorageSource *StorageSource `protobuf:"bytes,2,opt,name=storage_source,json=storageSource,oneof"` +} +type Source_RepoSource struct { + RepoSource *RepoSource `protobuf:"bytes,3,opt,name=repo_source,json=repoSource,oneof"` +} + +func (*Source_StorageSource) isSource_Source() {} +func (*Source_RepoSource) isSource_Source() {} + +func (m *Source) GetSource() isSource_Source { + if m != nil { + return m.Source + } + return nil +} + +func (m *Source) GetStorageSource() *StorageSource { + if x, ok := m.GetSource().(*Source_StorageSource); ok { + return x.StorageSource + } + return nil +} + +func (m *Source) GetRepoSource() *RepoSource { + if x, ok := m.GetSource().(*Source_RepoSource); ok { + return x.RepoSource + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Source) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _Source_OneofMarshaler, _Source_OneofUnmarshaler, _Source_OneofSizer, []interface{}{ + (*Source_StorageSource)(nil), + (*Source_RepoSource)(nil), + } +} + +func _Source_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Source) + // source + switch x := m.Source.(type) { + case *Source_StorageSource: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.StorageSource); err != nil { + return err + } + case *Source_RepoSource: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.RepoSource); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("Source.Source has unexpected type %T", x) + } + return nil +} + +func _Source_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Source) + switch tag { + case 2: // source.storage_source + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(StorageSource) + err := b.DecodeMessage(msg) + m.Source = &Source_StorageSource{msg} + return true, err + case 3: // source.repo_source + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(RepoSource) + err := b.DecodeMessage(msg) + m.Source = &Source_RepoSource{msg} + return true, err + default: + return false, nil + } +} + +func _Source_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Source) + // source + switch x := m.Source.(type) { + case *Source_StorageSource: + s := proto.Size(x.StorageSource) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Source_RepoSource: + s := proto.Size(x.RepoSource) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// BuiltImage describes an image built by the pipeline. +type BuiltImage struct { + // Name used to push the container image to Google Container Registry, as + // presented to `docker push`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Docker Registry 2.0 digest. + Digest string `protobuf:"bytes,3,opt,name=digest" json:"digest,omitempty"` +} + +func (m *BuiltImage) Reset() { *m = BuiltImage{} } +func (m *BuiltImage) String() string { return proto.CompactTextString(m) } +func (*BuiltImage) ProtoMessage() {} +func (*BuiltImage) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *BuiltImage) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *BuiltImage) GetDigest() string { + if m != nil { + return m.Digest + } + return "" +} + +// BuildStep describes a step to perform in the build pipeline. +type BuildStep struct { + // The name of the container image that will run this particular build step. + // + // If the image is already available in the host's Docker daemon's cache, it + // will be run directly. If not, the host will attempt to pull the image + // first, using the builder service account's credentials if necessary. + // + // The Docker daemon's cache will already have the latest versions of all of + // the officially supported build steps + // ([https://github.com/GoogleCloudPlatform/cloud-builders](https://github.com/GoogleCloudPlatform/cloud-builders)). + // The Docker daemon will also have cached many of the layers for some popular + // images, like "ubuntu", "debian", but they will be refreshed at the time you + // attempt to use them. + // + // If you built an image in a previous build step, it will be stored in the + // host's Docker daemon's cache and is available to use as the name for a + // later build step. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // A list of environment variable definitions to be used when running a step. + // + // The elements are of the form "KEY=VALUE" for the environment variable "KEY" + // being given the value "VALUE". + Env []string `protobuf:"bytes,2,rep,name=env" json:"env,omitempty"` + // A list of arguments that will be presented to the step when it is started. + // + // If the image used to run the step's container has an entrypoint, these args + // will be used as arguments to that entrypoint. If the image does not define + // an entrypoint, the first element in args will be used as the entrypoint, + // and the remainder will be used as arguments. + Args []string `protobuf:"bytes,3,rep,name=args" json:"args,omitempty"` + // Working directory (relative to project source root) to use when running + // this operation's container. + Dir string `protobuf:"bytes,4,opt,name=dir" json:"dir,omitempty"` + // Optional unique identifier for this build step, used in wait_for to + // reference this build step as a dependency. + Id string `protobuf:"bytes,5,opt,name=id" json:"id,omitempty"` + // The ID(s) of the step(s) that this build step depends on. + // This build step will not start until all the build steps in wait_for + // have completed successfully. If wait_for is empty, this build step will + // start when all previous build steps in the Build.Steps list have completed + // successfully. + WaitFor []string `protobuf:"bytes,6,rep,name=wait_for,json=waitFor" json:"wait_for,omitempty"` + // Optional entrypoint to be used instead of the build step image's default + // If unset, the image's default will be used. + Entrypoint string `protobuf:"bytes,7,opt,name=entrypoint" json:"entrypoint,omitempty"` + // A list of environment variables which are encrypted using a Cloud KMS + // crypto key. These values must be specified in the build's secrets. + SecretEnv []string `protobuf:"bytes,8,rep,name=secret_env,json=secretEnv" json:"secret_env,omitempty"` + // List of volumes to mount into the build step. + // + // Each volume will be created as an empty volume prior to execution of the + // build step. Upon completion of the build, volumes and their contents will + // be discarded. + // + // Using a named volume in only one step is not valid as it is indicative + // of a mis-configured build request. + Volumes []*Volume `protobuf:"bytes,9,rep,name=volumes" json:"volumes,omitempty"` +} + +func (m *BuildStep) Reset() { *m = BuildStep{} } +func (m *BuildStep) String() string { return proto.CompactTextString(m) } +func (*BuildStep) ProtoMessage() {} +func (*BuildStep) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *BuildStep) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *BuildStep) GetEnv() []string { + if m != nil { + return m.Env + } + return nil +} + +func (m *BuildStep) GetArgs() []string { + if m != nil { + return m.Args + } + return nil +} + +func (m *BuildStep) GetDir() string { + if m != nil { + return m.Dir + } + return "" +} + +func (m *BuildStep) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *BuildStep) GetWaitFor() []string { + if m != nil { + return m.WaitFor + } + return nil +} + +func (m *BuildStep) GetEntrypoint() string { + if m != nil { + return m.Entrypoint + } + return "" +} + +func (m *BuildStep) GetSecretEnv() []string { + if m != nil { + return m.SecretEnv + } + return nil +} + +func (m *BuildStep) GetVolumes() []*Volume { + if m != nil { + return m.Volumes + } + return nil +} + +// Volume describes a Docker container volume which is mounted into build steps +// in order to persist files across build step execution. +type Volume struct { + // Name of the volume to mount. + // + // Volume names must be unique per build step and must be valid names for + // Docker volumes. Each named volume must be used by at least two build steps. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Path at which to mount the volume. + // + // Paths must be absolute and cannot conflict with other volume paths on the + // same build step or with certain reserved volume paths. + Path string `protobuf:"bytes,2,opt,name=path" json:"path,omitempty"` +} + +func (m *Volume) Reset() { *m = Volume{} } +func (m *Volume) String() string { return proto.CompactTextString(m) } +func (*Volume) ProtoMessage() {} +func (*Volume) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *Volume) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Volume) GetPath() string { + if m != nil { + return m.Path + } + return "" +} + +// Results describes the artifacts created by the build pipeline. +type Results struct { + // Images that were built as a part of the build. + Images []*BuiltImage `protobuf:"bytes,2,rep,name=images" json:"images,omitempty"` + // List of build step digests, in order corresponding to build step indices. + BuildStepImages []string `protobuf:"bytes,3,rep,name=build_step_images,json=buildStepImages" json:"build_step_images,omitempty"` +} + +func (m *Results) Reset() { *m = Results{} } +func (m *Results) String() string { return proto.CompactTextString(m) } +func (*Results) ProtoMessage() {} +func (*Results) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *Results) GetImages() []*BuiltImage { + if m != nil { + return m.Images + } + return nil +} + +func (m *Results) GetBuildStepImages() []string { + if m != nil { + return m.BuildStepImages + } + return nil +} + +// A build resource in the Container Builder API. +// +// At a high level, a Build describes where to find source code, how to build +// it (for example, the builder image to run on the source), and what tag to +// apply to the built image when it is pushed to Google Container Registry. +// +// Fields can include the following variables which will be expanded when the +// build is created: +// +// - $PROJECT_ID: the project ID of the build. +// - $BUILD_ID: the autogenerated ID of the build. +// - $REPO_NAME: the source repository name specified by RepoSource. +// - $BRANCH_NAME: the branch name specified by RepoSource. +// - $TAG_NAME: the tag name specified by RepoSource. +// - $REVISION_ID or $COMMIT_SHA: the commit SHA specified by RepoSource or +// resolved from the specified branch or tag. +// - $SHORT_SHA: first 7 characters of $REVISION_ID or $COMMIT_SHA. +type Build struct { + // Unique identifier of the build. + // @OutputOnly + Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + // ID of the project. + // @OutputOnly. + ProjectId string `protobuf:"bytes,16,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // Status of the build. + // @OutputOnly + Status Build_Status `protobuf:"varint,2,opt,name=status,enum=google.devtools.cloudbuild.v1.Build_Status" json:"status,omitempty"` + // Customer-readable message about the current status. + // @OutputOnly + StatusDetail string `protobuf:"bytes,24,opt,name=status_detail,json=statusDetail" json:"status_detail,omitempty"` + // Describes where to find the source files to build. + Source *Source `protobuf:"bytes,3,opt,name=source" json:"source,omitempty"` + // Describes the operations to be performed on the workspace. + Steps []*BuildStep `protobuf:"bytes,11,rep,name=steps" json:"steps,omitempty"` + // Results of the build. + // @OutputOnly + Results *Results `protobuf:"bytes,10,opt,name=results" json:"results,omitempty"` + // Time at which the request to create the build was received. + // @OutputOnly + CreateTime *google_protobuf5.Timestamp `protobuf:"bytes,6,opt,name=create_time,json=createTime" json:"create_time,omitempty"` + // Time at which execution of the build was started. + // @OutputOnly + StartTime *google_protobuf5.Timestamp `protobuf:"bytes,7,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + // Time at which execution of the build was finished. + // + // The difference between finish_time and start_time is the duration of the + // build's execution. + // @OutputOnly + FinishTime *google_protobuf5.Timestamp `protobuf:"bytes,8,opt,name=finish_time,json=finishTime" json:"finish_time,omitempty"` + // Amount of time that this build should be allowed to run, to second + // granularity. If this amount of time elapses, work on the build will cease + // and the build status will be TIMEOUT. + // + // Default time is ten minutes. + Timeout *google_protobuf4.Duration `protobuf:"bytes,12,opt,name=timeout" json:"timeout,omitempty"` + // A list of images to be pushed upon the successful completion of all build + // steps. + // + // The images will be pushed using the builder service account's credentials. + // + // The digests of the pushed images will be stored in the Build resource's + // results field. + // + // If any of the images fail to be pushed, the build is marked FAILURE. + Images []string `protobuf:"bytes,13,rep,name=images" json:"images,omitempty"` + // Google Cloud Storage bucket where logs should be written (see + // [Bucket Name + // Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). + // Logs file names will be of the format `${logs_bucket}/log-${build_id}.txt`. + LogsBucket string `protobuf:"bytes,19,opt,name=logs_bucket,json=logsBucket" json:"logs_bucket,omitempty"` + // A permanent fixed identifier for source. + // @OutputOnly + SourceProvenance *SourceProvenance `protobuf:"bytes,21,opt,name=source_provenance,json=sourceProvenance" json:"source_provenance,omitempty"` + // The ID of the BuildTrigger that triggered this build, if it was + // triggered automatically. + // @OutputOnly + BuildTriggerId string `protobuf:"bytes,22,opt,name=build_trigger_id,json=buildTriggerId" json:"build_trigger_id,omitempty"` + // Special options for this build. + Options *BuildOptions `protobuf:"bytes,23,opt,name=options" json:"options,omitempty"` + // URL to logs for this build in Google Cloud Logging. + // @OutputOnly + LogUrl string `protobuf:"bytes,25,opt,name=log_url,json=logUrl" json:"log_url,omitempty"` + // Substitutions data for Build resource. + Substitutions map[string]string `protobuf:"bytes,29,rep,name=substitutions" json:"substitutions,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // Tags for annotation of a Build. These are not docker tags. + Tags []string `protobuf:"bytes,31,rep,name=tags" json:"tags,omitempty"` + // Secrets to decrypt using Cloud KMS. + Secrets []*Secret `protobuf:"bytes,32,rep,name=secrets" json:"secrets,omitempty"` +} + +func (m *Build) Reset() { *m = Build{} } +func (m *Build) String() string { return proto.CompactTextString(m) } +func (*Build) ProtoMessage() {} +func (*Build) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *Build) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *Build) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *Build) GetStatus() Build_Status { + if m != nil { + return m.Status + } + return Build_STATUS_UNKNOWN +} + +func (m *Build) GetStatusDetail() string { + if m != nil { + return m.StatusDetail + } + return "" +} + +func (m *Build) GetSource() *Source { + if m != nil { + return m.Source + } + return nil +} + +func (m *Build) GetSteps() []*BuildStep { + if m != nil { + return m.Steps + } + return nil +} + +func (m *Build) GetResults() *Results { + if m != nil { + return m.Results + } + return nil +} + +func (m *Build) GetCreateTime() *google_protobuf5.Timestamp { + if m != nil { + return m.CreateTime + } + return nil +} + +func (m *Build) GetStartTime() *google_protobuf5.Timestamp { + if m != nil { + return m.StartTime + } + return nil +} + +func (m *Build) GetFinishTime() *google_protobuf5.Timestamp { + if m != nil { + return m.FinishTime + } + return nil +} + +func (m *Build) GetTimeout() *google_protobuf4.Duration { + if m != nil { + return m.Timeout + } + return nil +} + +func (m *Build) GetImages() []string { + if m != nil { + return m.Images + } + return nil +} + +func (m *Build) GetLogsBucket() string { + if m != nil { + return m.LogsBucket + } + return "" +} + +func (m *Build) GetSourceProvenance() *SourceProvenance { + if m != nil { + return m.SourceProvenance + } + return nil +} + +func (m *Build) GetBuildTriggerId() string { + if m != nil { + return m.BuildTriggerId + } + return "" +} + +func (m *Build) GetOptions() *BuildOptions { + if m != nil { + return m.Options + } + return nil +} + +func (m *Build) GetLogUrl() string { + if m != nil { + return m.LogUrl + } + return "" +} + +func (m *Build) GetSubstitutions() map[string]string { + if m != nil { + return m.Substitutions + } + return nil +} + +func (m *Build) GetTags() []string { + if m != nil { + return m.Tags + } + return nil +} + +func (m *Build) GetSecrets() []*Secret { + if m != nil { + return m.Secrets + } + return nil +} + +// Metadata for build operations. +type BuildOperationMetadata struct { + // The build that the operation is tracking. + Build *Build `protobuf:"bytes,1,opt,name=build" json:"build,omitempty"` +} + +func (m *BuildOperationMetadata) Reset() { *m = BuildOperationMetadata{} } +func (m *BuildOperationMetadata) String() string { return proto.CompactTextString(m) } +func (*BuildOperationMetadata) ProtoMessage() {} +func (*BuildOperationMetadata) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *BuildOperationMetadata) GetBuild() *Build { + if m != nil { + return m.Build + } + return nil +} + +// Provenance of the source. Ways to find the original source, or verify that +// some source was used for this build. +type SourceProvenance struct { + // A copy of the build's source.storage_source, if exists, with any + // generations resolved. + ResolvedStorageSource *StorageSource `protobuf:"bytes,3,opt,name=resolved_storage_source,json=resolvedStorageSource" json:"resolved_storage_source,omitempty"` + // A copy of the build's source.repo_source, if exists, with any + // revisions resolved. + ResolvedRepoSource *RepoSource `protobuf:"bytes,6,opt,name=resolved_repo_source,json=resolvedRepoSource" json:"resolved_repo_source,omitempty"` + // Hash(es) of the build source, which can be used to verify that the original + // source integrity was maintained in the build. Note that FileHashes will + // only be populated if BuildOptions has requested a SourceProvenanceHash. + // + // The keys to this map are file paths used as build source and the values + // contain the hash values for those files. + // + // If the build source came in a single package such as a gzipped tarfile + // (.tar.gz), the FileHash will be for the single path to that file. + // @OutputOnly + FileHashes map[string]*FileHashes `protobuf:"bytes,4,rep,name=file_hashes,json=fileHashes" json:"file_hashes,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *SourceProvenance) Reset() { *m = SourceProvenance{} } +func (m *SourceProvenance) String() string { return proto.CompactTextString(m) } +func (*SourceProvenance) ProtoMessage() {} +func (*SourceProvenance) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } + +func (m *SourceProvenance) GetResolvedStorageSource() *StorageSource { + if m != nil { + return m.ResolvedStorageSource + } + return nil +} + +func (m *SourceProvenance) GetResolvedRepoSource() *RepoSource { + if m != nil { + return m.ResolvedRepoSource + } + return nil +} + +func (m *SourceProvenance) GetFileHashes() map[string]*FileHashes { + if m != nil { + return m.FileHashes + } + return nil +} + +// Container message for hashes of byte content of files, used in +// SourceProvenance messages to verify integrity of source input to the build. +type FileHashes struct { + // Collection of file hashes. + FileHash []*Hash `protobuf:"bytes,1,rep,name=file_hash,json=fileHash" json:"file_hash,omitempty"` +} + +func (m *FileHashes) Reset() { *m = FileHashes{} } +func (m *FileHashes) String() string { return proto.CompactTextString(m) } +func (*FileHashes) ProtoMessage() {} +func (*FileHashes) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } + +func (m *FileHashes) GetFileHash() []*Hash { + if m != nil { + return m.FileHash + } + return nil +} + +// Container message for hash values. +type Hash struct { + // The type of hash that was performed. + Type Hash_HashType `protobuf:"varint,1,opt,name=type,enum=google.devtools.cloudbuild.v1.Hash_HashType" json:"type,omitempty"` + // The hash value. + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (m *Hash) Reset() { *m = Hash{} } +func (m *Hash) String() string { return proto.CompactTextString(m) } +func (*Hash) ProtoMessage() {} +func (*Hash) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } + +func (m *Hash) GetType() Hash_HashType { + if m != nil { + return m.Type + } + return Hash_NONE +} + +func (m *Hash) GetValue() []byte { + if m != nil { + return m.Value + } + return nil +} + +// Secret pairs a set of secret environment variables containing encrypted +// values with the Cloud KMS key to use to decrypt the value. +type Secret struct { + // Cloud KMS key name to use to decrypt these envs. + KmsKeyName string `protobuf:"bytes,1,opt,name=kms_key_name,json=kmsKeyName" json:"kms_key_name,omitempty"` + // Map of environment variable name to its encrypted value. + // + // Secret environment variables must be unique across all of a build's + // secrets, and must be used by at least one build step. Values can be at most + // 1 KB in size. There can be at most ten secret values across all of a + // build's secrets. + SecretEnv map[string][]byte `protobuf:"bytes,3,rep,name=secret_env,json=secretEnv" json:"secret_env,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (m *Secret) Reset() { *m = Secret{} } +func (m *Secret) String() string { return proto.CompactTextString(m) } +func (*Secret) ProtoMessage() {} +func (*Secret) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } + +func (m *Secret) GetKmsKeyName() string { + if m != nil { + return m.KmsKeyName + } + return "" +} + +func (m *Secret) GetSecretEnv() map[string][]byte { + if m != nil { + return m.SecretEnv + } + return nil +} + +// Request to create a new build. +type CreateBuildRequest struct { + // ID of the project. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // Build resource to create. + Build *Build `protobuf:"bytes,2,opt,name=build" json:"build,omitempty"` +} + +func (m *CreateBuildRequest) Reset() { *m = CreateBuildRequest{} } +func (m *CreateBuildRequest) String() string { return proto.CompactTextString(m) } +func (*CreateBuildRequest) ProtoMessage() {} +func (*CreateBuildRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } + +func (m *CreateBuildRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *CreateBuildRequest) GetBuild() *Build { + if m != nil { + return m.Build + } + return nil +} + +// Request to get a build. +type GetBuildRequest struct { + // ID of the project. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // ID of the build. + Id string `protobuf:"bytes,2,opt,name=id" json:"id,omitempty"` +} + +func (m *GetBuildRequest) Reset() { *m = GetBuildRequest{} } +func (m *GetBuildRequest) String() string { return proto.CompactTextString(m) } +func (*GetBuildRequest) ProtoMessage() {} +func (*GetBuildRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} } + +func (m *GetBuildRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *GetBuildRequest) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +// Request to list builds. +type ListBuildsRequest struct { + // ID of the project. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // Number of results to return in the list. + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // Token to provide to skip to a particular spot in the list. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` + // The raw filter text to constrain the results. + Filter string `protobuf:"bytes,8,opt,name=filter" json:"filter,omitempty"` +} + +func (m *ListBuildsRequest) Reset() { *m = ListBuildsRequest{} } +func (m *ListBuildsRequest) String() string { return proto.CompactTextString(m) } +func (*ListBuildsRequest) ProtoMessage() {} +func (*ListBuildsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17} } + +func (m *ListBuildsRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *ListBuildsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListBuildsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +func (m *ListBuildsRequest) GetFilter() string { + if m != nil { + return m.Filter + } + return "" +} + +// Response including listed builds. +type ListBuildsResponse struct { + // Builds will be sorted by create_time, descending. + Builds []*Build `protobuf:"bytes,1,rep,name=builds" json:"builds,omitempty"` + // Token to receive the next page of results. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListBuildsResponse) Reset() { *m = ListBuildsResponse{} } +func (m *ListBuildsResponse) String() string { return proto.CompactTextString(m) } +func (*ListBuildsResponse) ProtoMessage() {} +func (*ListBuildsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{18} } + +func (m *ListBuildsResponse) GetBuilds() []*Build { + if m != nil { + return m.Builds + } + return nil +} + +func (m *ListBuildsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// Request to cancel an ongoing build. +type CancelBuildRequest struct { + // ID of the project. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // ID of the build. + Id string `protobuf:"bytes,2,opt,name=id" json:"id,omitempty"` +} + +func (m *CancelBuildRequest) Reset() { *m = CancelBuildRequest{} } +func (m *CancelBuildRequest) String() string { return proto.CompactTextString(m) } +func (*CancelBuildRequest) ProtoMessage() {} +func (*CancelBuildRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{19} } + +func (m *CancelBuildRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *CancelBuildRequest) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +// Configuration for an automated build in response to source repository +// changes. +type BuildTrigger struct { + // Unique identifier of the trigger. + // + // @OutputOnly + Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + // Human-readable description of this trigger. + Description string `protobuf:"bytes,10,opt,name=description" json:"description,omitempty"` + // Template describing the types of source changes to trigger a build. + // + // Branch and tag names in trigger templates are interpreted as regular + // expressions. Any branch or tag change that matches that regular expression + // will trigger a build. + TriggerTemplate *RepoSource `protobuf:"bytes,7,opt,name=trigger_template,json=triggerTemplate" json:"trigger_template,omitempty"` + // Template describing the Build request to make when the trigger is matched. + // + // Types that are valid to be assigned to BuildTemplate: + // *BuildTrigger_Build + // *BuildTrigger_Filename + BuildTemplate isBuildTrigger_BuildTemplate `protobuf_oneof:"build_template"` + // Time when the trigger was created. + // + // @OutputOnly + CreateTime *google_protobuf5.Timestamp `protobuf:"bytes,5,opt,name=create_time,json=createTime" json:"create_time,omitempty"` + // If true, the trigger will never result in a build. + Disabled bool `protobuf:"varint,9,opt,name=disabled" json:"disabled,omitempty"` + // Substitutions data for Build resource. + Substitutions map[string]string `protobuf:"bytes,11,rep,name=substitutions" json:"substitutions,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *BuildTrigger) Reset() { *m = BuildTrigger{} } +func (m *BuildTrigger) String() string { return proto.CompactTextString(m) } +func (*BuildTrigger) ProtoMessage() {} +func (*BuildTrigger) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20} } + +type isBuildTrigger_BuildTemplate interface { + isBuildTrigger_BuildTemplate() +} + +type BuildTrigger_Build struct { + Build *Build `protobuf:"bytes,4,opt,name=build,oneof"` +} +type BuildTrigger_Filename struct { + Filename string `protobuf:"bytes,8,opt,name=filename,oneof"` +} + +func (*BuildTrigger_Build) isBuildTrigger_BuildTemplate() {} +func (*BuildTrigger_Filename) isBuildTrigger_BuildTemplate() {} + +func (m *BuildTrigger) GetBuildTemplate() isBuildTrigger_BuildTemplate { + if m != nil { + return m.BuildTemplate + } + return nil +} + +func (m *BuildTrigger) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *BuildTrigger) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *BuildTrigger) GetTriggerTemplate() *RepoSource { + if m != nil { + return m.TriggerTemplate + } + return nil +} + +func (m *BuildTrigger) GetBuild() *Build { + if x, ok := m.GetBuildTemplate().(*BuildTrigger_Build); ok { + return x.Build + } + return nil +} + +func (m *BuildTrigger) GetFilename() string { + if x, ok := m.GetBuildTemplate().(*BuildTrigger_Filename); ok { + return x.Filename + } + return "" +} + +func (m *BuildTrigger) GetCreateTime() *google_protobuf5.Timestamp { + if m != nil { + return m.CreateTime + } + return nil +} + +func (m *BuildTrigger) GetDisabled() bool { + if m != nil { + return m.Disabled + } + return false +} + +func (m *BuildTrigger) GetSubstitutions() map[string]string { + if m != nil { + return m.Substitutions + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*BuildTrigger) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _BuildTrigger_OneofMarshaler, _BuildTrigger_OneofUnmarshaler, _BuildTrigger_OneofSizer, []interface{}{ + (*BuildTrigger_Build)(nil), + (*BuildTrigger_Filename)(nil), + } +} + +func _BuildTrigger_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*BuildTrigger) + // build_template + switch x := m.BuildTemplate.(type) { + case *BuildTrigger_Build: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Build); err != nil { + return err + } + case *BuildTrigger_Filename: + b.EncodeVarint(8<<3 | proto.WireBytes) + b.EncodeStringBytes(x.Filename) + case nil: + default: + return fmt.Errorf("BuildTrigger.BuildTemplate has unexpected type %T", x) + } + return nil +} + +func _BuildTrigger_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*BuildTrigger) + switch tag { + case 4: // build_template.build + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Build) + err := b.DecodeMessage(msg) + m.BuildTemplate = &BuildTrigger_Build{msg} + return true, err + case 8: // build_template.filename + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.BuildTemplate = &BuildTrigger_Filename{x} + return true, err + default: + return false, nil + } +} + +func _BuildTrigger_OneofSizer(msg proto.Message) (n int) { + m := msg.(*BuildTrigger) + // build_template + switch x := m.BuildTemplate.(type) { + case *BuildTrigger_Build: + s := proto.Size(x.Build) + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *BuildTrigger_Filename: + n += proto.SizeVarint(8<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Filename))) + n += len(x.Filename) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Request to create a new BuildTrigger. +type CreateBuildTriggerRequest struct { + // ID of the project for which to configure automatic builds. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // BuildTrigger to create. + Trigger *BuildTrigger `protobuf:"bytes,2,opt,name=trigger" json:"trigger,omitempty"` +} + +func (m *CreateBuildTriggerRequest) Reset() { *m = CreateBuildTriggerRequest{} } +func (m *CreateBuildTriggerRequest) String() string { return proto.CompactTextString(m) } +func (*CreateBuildTriggerRequest) ProtoMessage() {} +func (*CreateBuildTriggerRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{21} } + +func (m *CreateBuildTriggerRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *CreateBuildTriggerRequest) GetTrigger() *BuildTrigger { + if m != nil { + return m.Trigger + } + return nil +} + +// Returns the BuildTrigger with the specified ID. +type GetBuildTriggerRequest struct { + // ID of the project that owns the trigger. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // ID of the BuildTrigger to get. + TriggerId string `protobuf:"bytes,2,opt,name=trigger_id,json=triggerId" json:"trigger_id,omitempty"` +} + +func (m *GetBuildTriggerRequest) Reset() { *m = GetBuildTriggerRequest{} } +func (m *GetBuildTriggerRequest) String() string { return proto.CompactTextString(m) } +func (*GetBuildTriggerRequest) ProtoMessage() {} +func (*GetBuildTriggerRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{22} } + +func (m *GetBuildTriggerRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *GetBuildTriggerRequest) GetTriggerId() string { + if m != nil { + return m.TriggerId + } + return "" +} + +// Request to list existing BuildTriggers. +type ListBuildTriggersRequest struct { + // ID of the project for which to list BuildTriggers. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` +} + +func (m *ListBuildTriggersRequest) Reset() { *m = ListBuildTriggersRequest{} } +func (m *ListBuildTriggersRequest) String() string { return proto.CompactTextString(m) } +func (*ListBuildTriggersRequest) ProtoMessage() {} +func (*ListBuildTriggersRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{23} } + +func (m *ListBuildTriggersRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +// Response containing existing BuildTriggers. +type ListBuildTriggersResponse struct { + // BuildTriggers for the project, sorted by create_time descending. + Triggers []*BuildTrigger `protobuf:"bytes,1,rep,name=triggers" json:"triggers,omitempty"` +} + +func (m *ListBuildTriggersResponse) Reset() { *m = ListBuildTriggersResponse{} } +func (m *ListBuildTriggersResponse) String() string { return proto.CompactTextString(m) } +func (*ListBuildTriggersResponse) ProtoMessage() {} +func (*ListBuildTriggersResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{24} } + +func (m *ListBuildTriggersResponse) GetTriggers() []*BuildTrigger { + if m != nil { + return m.Triggers + } + return nil +} + +// Request to delete a BuildTrigger. +type DeleteBuildTriggerRequest struct { + // ID of the project that owns the trigger. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // ID of the BuildTrigger to delete. + TriggerId string `protobuf:"bytes,2,opt,name=trigger_id,json=triggerId" json:"trigger_id,omitempty"` +} + +func (m *DeleteBuildTriggerRequest) Reset() { *m = DeleteBuildTriggerRequest{} } +func (m *DeleteBuildTriggerRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteBuildTriggerRequest) ProtoMessage() {} +func (*DeleteBuildTriggerRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{25} } + +func (m *DeleteBuildTriggerRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *DeleteBuildTriggerRequest) GetTriggerId() string { + if m != nil { + return m.TriggerId + } + return "" +} + +// Request to update an existing BuildTrigger. +type UpdateBuildTriggerRequest struct { + // ID of the project that owns the trigger. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // ID of the BuildTrigger to update. + TriggerId string `protobuf:"bytes,2,opt,name=trigger_id,json=triggerId" json:"trigger_id,omitempty"` + // BuildTrigger to update. + Trigger *BuildTrigger `protobuf:"bytes,3,opt,name=trigger" json:"trigger,omitempty"` +} + +func (m *UpdateBuildTriggerRequest) Reset() { *m = UpdateBuildTriggerRequest{} } +func (m *UpdateBuildTriggerRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateBuildTriggerRequest) ProtoMessage() {} +func (*UpdateBuildTriggerRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{26} } + +func (m *UpdateBuildTriggerRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *UpdateBuildTriggerRequest) GetTriggerId() string { + if m != nil { + return m.TriggerId + } + return "" +} + +func (m *UpdateBuildTriggerRequest) GetTrigger() *BuildTrigger { + if m != nil { + return m.Trigger + } + return nil +} + +// Optional arguments to enable specific features of builds. +type BuildOptions struct { + // Requested hash for SourceProvenance. + SourceProvenanceHash []Hash_HashType `protobuf:"varint,1,rep,packed,name=source_provenance_hash,json=sourceProvenanceHash,enum=google.devtools.cloudbuild.v1.Hash_HashType" json:"source_provenance_hash,omitempty"` + // Requested verifiability options. + RequestedVerifyOption BuildOptions_VerifyOption `protobuf:"varint,2,opt,name=requested_verify_option,json=requestedVerifyOption,enum=google.devtools.cloudbuild.v1.BuildOptions_VerifyOption" json:"requested_verify_option,omitempty"` + // GCE VM size to run the build on. + MachineType BuildOptions_MachineType `protobuf:"varint,3,opt,name=machine_type,json=machineType,enum=google.devtools.cloudbuild.v1.BuildOptions_MachineType" json:"machine_type,omitempty"` + // Requested disk size for the VM that runs the build. Note that this is *NOT* + // "disk free"; some of the space will be used by the operating system and + // build utilities. Also note that this is the minimum disk size that will be + // allocated for the build -- the build may run with a larger disk than + // requested. At present, the maximum disk size is 1000GB; builds that request + // more than the maximum are rejected with an error. + DiskSizeGb int64 `protobuf:"varint,6,opt,name=disk_size_gb,json=diskSizeGb" json:"disk_size_gb,omitempty"` + // SubstitutionOption to allow unmatch substitutions. + SubstitutionOption BuildOptions_SubstitutionOption `protobuf:"varint,4,opt,name=substitution_option,json=substitutionOption,enum=google.devtools.cloudbuild.v1.BuildOptions_SubstitutionOption" json:"substitution_option,omitempty"` + // LogStreamingOption to define build log streaming behavior to Google Cloud + // Storage. + LogStreamingOption BuildOptions_LogStreamingOption `protobuf:"varint,5,opt,name=log_streaming_option,json=logStreamingOption,enum=google.devtools.cloudbuild.v1.BuildOptions_LogStreamingOption" json:"log_streaming_option,omitempty"` +} + +func (m *BuildOptions) Reset() { *m = BuildOptions{} } +func (m *BuildOptions) String() string { return proto.CompactTextString(m) } +func (*BuildOptions) ProtoMessage() {} +func (*BuildOptions) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{27} } + +func (m *BuildOptions) GetSourceProvenanceHash() []Hash_HashType { + if m != nil { + return m.SourceProvenanceHash + } + return nil +} + +func (m *BuildOptions) GetRequestedVerifyOption() BuildOptions_VerifyOption { + if m != nil { + return m.RequestedVerifyOption + } + return BuildOptions_NOT_VERIFIED +} + +func (m *BuildOptions) GetMachineType() BuildOptions_MachineType { + if m != nil { + return m.MachineType + } + return BuildOptions_UNSPECIFIED +} + +func (m *BuildOptions) GetDiskSizeGb() int64 { + if m != nil { + return m.DiskSizeGb + } + return 0 +} + +func (m *BuildOptions) GetSubstitutionOption() BuildOptions_SubstitutionOption { + if m != nil { + return m.SubstitutionOption + } + return BuildOptions_MUST_MATCH +} + +func (m *BuildOptions) GetLogStreamingOption() BuildOptions_LogStreamingOption { + if m != nil { + return m.LogStreamingOption + } + return BuildOptions_STREAM_DEFAULT +} + +func init() { + proto.RegisterType((*RetryBuildRequest)(nil), "google.devtools.cloudbuild.v1.RetryBuildRequest") + proto.RegisterType((*RunBuildTriggerRequest)(nil), "google.devtools.cloudbuild.v1.RunBuildTriggerRequest") + proto.RegisterType((*StorageSource)(nil), "google.devtools.cloudbuild.v1.StorageSource") + proto.RegisterType((*RepoSource)(nil), "google.devtools.cloudbuild.v1.RepoSource") + proto.RegisterType((*Source)(nil), "google.devtools.cloudbuild.v1.Source") + proto.RegisterType((*BuiltImage)(nil), "google.devtools.cloudbuild.v1.BuiltImage") + proto.RegisterType((*BuildStep)(nil), "google.devtools.cloudbuild.v1.BuildStep") + proto.RegisterType((*Volume)(nil), "google.devtools.cloudbuild.v1.Volume") + proto.RegisterType((*Results)(nil), "google.devtools.cloudbuild.v1.Results") + proto.RegisterType((*Build)(nil), "google.devtools.cloudbuild.v1.Build") + proto.RegisterType((*BuildOperationMetadata)(nil), "google.devtools.cloudbuild.v1.BuildOperationMetadata") + proto.RegisterType((*SourceProvenance)(nil), "google.devtools.cloudbuild.v1.SourceProvenance") + proto.RegisterType((*FileHashes)(nil), "google.devtools.cloudbuild.v1.FileHashes") + proto.RegisterType((*Hash)(nil), "google.devtools.cloudbuild.v1.Hash") + proto.RegisterType((*Secret)(nil), "google.devtools.cloudbuild.v1.Secret") + proto.RegisterType((*CreateBuildRequest)(nil), "google.devtools.cloudbuild.v1.CreateBuildRequest") + proto.RegisterType((*GetBuildRequest)(nil), "google.devtools.cloudbuild.v1.GetBuildRequest") + proto.RegisterType((*ListBuildsRequest)(nil), "google.devtools.cloudbuild.v1.ListBuildsRequest") + proto.RegisterType((*ListBuildsResponse)(nil), "google.devtools.cloudbuild.v1.ListBuildsResponse") + proto.RegisterType((*CancelBuildRequest)(nil), "google.devtools.cloudbuild.v1.CancelBuildRequest") + proto.RegisterType((*BuildTrigger)(nil), "google.devtools.cloudbuild.v1.BuildTrigger") + proto.RegisterType((*CreateBuildTriggerRequest)(nil), "google.devtools.cloudbuild.v1.CreateBuildTriggerRequest") + proto.RegisterType((*GetBuildTriggerRequest)(nil), "google.devtools.cloudbuild.v1.GetBuildTriggerRequest") + proto.RegisterType((*ListBuildTriggersRequest)(nil), "google.devtools.cloudbuild.v1.ListBuildTriggersRequest") + proto.RegisterType((*ListBuildTriggersResponse)(nil), "google.devtools.cloudbuild.v1.ListBuildTriggersResponse") + proto.RegisterType((*DeleteBuildTriggerRequest)(nil), "google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest") + proto.RegisterType((*UpdateBuildTriggerRequest)(nil), "google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest") + proto.RegisterType((*BuildOptions)(nil), "google.devtools.cloudbuild.v1.BuildOptions") + proto.RegisterEnum("google.devtools.cloudbuild.v1.Build_Status", Build_Status_name, Build_Status_value) + proto.RegisterEnum("google.devtools.cloudbuild.v1.Hash_HashType", Hash_HashType_name, Hash_HashType_value) + proto.RegisterEnum("google.devtools.cloudbuild.v1.BuildOptions_VerifyOption", BuildOptions_VerifyOption_name, BuildOptions_VerifyOption_value) + proto.RegisterEnum("google.devtools.cloudbuild.v1.BuildOptions_MachineType", BuildOptions_MachineType_name, BuildOptions_MachineType_value) + proto.RegisterEnum("google.devtools.cloudbuild.v1.BuildOptions_SubstitutionOption", BuildOptions_SubstitutionOption_name, BuildOptions_SubstitutionOption_value) + proto.RegisterEnum("google.devtools.cloudbuild.v1.BuildOptions_LogStreamingOption", BuildOptions_LogStreamingOption_name, BuildOptions_LogStreamingOption_value) +} + +// 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 + +// Client API for CloudBuild service + +type CloudBuildClient interface { + // Starts a build with the specified configuration. + // + // The long-running Operation returned by this method will include the ID of + // the build, which can be passed to GetBuild to determine its status (e.g., + // success or failure). + CreateBuild(ctx context.Context, in *CreateBuildRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Returns information about a previously requested build. + // + // The Build that is returned includes its status (e.g., success or failure, + // or in-progress), and timing information. + GetBuild(ctx context.Context, in *GetBuildRequest, opts ...grpc.CallOption) (*Build, error) + // Lists previously requested builds. + // + // Previously requested builds may still be in-progress, or may have finished + // successfully or unsuccessfully. + ListBuilds(ctx context.Context, in *ListBuildsRequest, opts ...grpc.CallOption) (*ListBuildsResponse, error) + // Cancels a requested build in progress. + CancelBuild(ctx context.Context, in *CancelBuildRequest, opts ...grpc.CallOption) (*Build, error) + // Creates a new BuildTrigger. + // + // This API is experimental. + CreateBuildTrigger(ctx context.Context, in *CreateBuildTriggerRequest, opts ...grpc.CallOption) (*BuildTrigger, error) + // Gets information about a BuildTrigger. + // + // This API is experimental. + GetBuildTrigger(ctx context.Context, in *GetBuildTriggerRequest, opts ...grpc.CallOption) (*BuildTrigger, error) + // Lists existing BuildTrigger. + // + // This API is experimental. + ListBuildTriggers(ctx context.Context, in *ListBuildTriggersRequest, opts ...grpc.CallOption) (*ListBuildTriggersResponse, error) + // Deletes an BuildTrigger by its project ID and trigger ID. + // + // This API is experimental. + DeleteBuildTrigger(ctx context.Context, in *DeleteBuildTriggerRequest, opts ...grpc.CallOption) (*google_protobuf3.Empty, error) + // Updates an BuildTrigger by its project ID and trigger ID. + // + // This API is experimental. + UpdateBuildTrigger(ctx context.Context, in *UpdateBuildTriggerRequest, opts ...grpc.CallOption) (*BuildTrigger, error) + // Runs a BuildTrigger at a particular source revision. + RunBuildTrigger(ctx context.Context, in *RunBuildTriggerRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Creates a new build based on the given build. + // + // This API creates a new build using the original build request, which may + // or may not result in an identical build. + // + // For triggered builds: + // + // * Triggered builds resolve to a precise revision, so a retry of a triggered + // build will result in a build that uses the same revision. + // + // For non-triggered builds that specify RepoSource: + // + // * If the original build built from the tip of a branch, the retried build + // will build from the tip of that branch, which may not be the same revision + // as the original build. + // * If the original build specified a commit sha or revision ID, the retried + // build will use the identical source. + // + // For builds that specify StorageSource: + // + // * If the original build pulled source from Cloud Storage without specifying + // the generation of the object, the new build will use the current object, + // which may be different from the original build source. + // * If the original build pulled source from Cloud Storage and specified the + // generation of the object, the new build will attempt to use the same + // object, which may or may not be available depending on the bucket's + // lifecycle management settings. + RetryBuild(ctx context.Context, in *RetryBuildRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) +} + +type cloudBuildClient struct { + cc *grpc.ClientConn +} + +func NewCloudBuildClient(cc *grpc.ClientConn) CloudBuildClient { + return &cloudBuildClient{cc} +} + +func (c *cloudBuildClient) CreateBuild(ctx context.Context, in *CreateBuildRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.devtools.cloudbuild.v1.CloudBuild/CreateBuild", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *cloudBuildClient) GetBuild(ctx context.Context, in *GetBuildRequest, opts ...grpc.CallOption) (*Build, error) { + out := new(Build) + err := grpc.Invoke(ctx, "/google.devtools.cloudbuild.v1.CloudBuild/GetBuild", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *cloudBuildClient) ListBuilds(ctx context.Context, in *ListBuildsRequest, opts ...grpc.CallOption) (*ListBuildsResponse, error) { + out := new(ListBuildsResponse) + err := grpc.Invoke(ctx, "/google.devtools.cloudbuild.v1.CloudBuild/ListBuilds", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *cloudBuildClient) CancelBuild(ctx context.Context, in *CancelBuildRequest, opts ...grpc.CallOption) (*Build, error) { + out := new(Build) + err := grpc.Invoke(ctx, "/google.devtools.cloudbuild.v1.CloudBuild/CancelBuild", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *cloudBuildClient) CreateBuildTrigger(ctx context.Context, in *CreateBuildTriggerRequest, opts ...grpc.CallOption) (*BuildTrigger, error) { + out := new(BuildTrigger) + err := grpc.Invoke(ctx, "/google.devtools.cloudbuild.v1.CloudBuild/CreateBuildTrigger", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *cloudBuildClient) GetBuildTrigger(ctx context.Context, in *GetBuildTriggerRequest, opts ...grpc.CallOption) (*BuildTrigger, error) { + out := new(BuildTrigger) + err := grpc.Invoke(ctx, "/google.devtools.cloudbuild.v1.CloudBuild/GetBuildTrigger", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *cloudBuildClient) ListBuildTriggers(ctx context.Context, in *ListBuildTriggersRequest, opts ...grpc.CallOption) (*ListBuildTriggersResponse, error) { + out := new(ListBuildTriggersResponse) + err := grpc.Invoke(ctx, "/google.devtools.cloudbuild.v1.CloudBuild/ListBuildTriggers", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *cloudBuildClient) DeleteBuildTrigger(ctx context.Context, in *DeleteBuildTriggerRequest, opts ...grpc.CallOption) (*google_protobuf3.Empty, error) { + out := new(google_protobuf3.Empty) + err := grpc.Invoke(ctx, "/google.devtools.cloudbuild.v1.CloudBuild/DeleteBuildTrigger", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *cloudBuildClient) UpdateBuildTrigger(ctx context.Context, in *UpdateBuildTriggerRequest, opts ...grpc.CallOption) (*BuildTrigger, error) { + out := new(BuildTrigger) + err := grpc.Invoke(ctx, "/google.devtools.cloudbuild.v1.CloudBuild/UpdateBuildTrigger", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *cloudBuildClient) RunBuildTrigger(ctx context.Context, in *RunBuildTriggerRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.devtools.cloudbuild.v1.CloudBuild/RunBuildTrigger", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *cloudBuildClient) RetryBuild(ctx context.Context, in *RetryBuildRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.devtools.cloudbuild.v1.CloudBuild/RetryBuild", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for CloudBuild service + +type CloudBuildServer interface { + // Starts a build with the specified configuration. + // + // The long-running Operation returned by this method will include the ID of + // the build, which can be passed to GetBuild to determine its status (e.g., + // success or failure). + CreateBuild(context.Context, *CreateBuildRequest) (*google_longrunning.Operation, error) + // Returns information about a previously requested build. + // + // The Build that is returned includes its status (e.g., success or failure, + // or in-progress), and timing information. + GetBuild(context.Context, *GetBuildRequest) (*Build, error) + // Lists previously requested builds. + // + // Previously requested builds may still be in-progress, or may have finished + // successfully or unsuccessfully. + ListBuilds(context.Context, *ListBuildsRequest) (*ListBuildsResponse, error) + // Cancels a requested build in progress. + CancelBuild(context.Context, *CancelBuildRequest) (*Build, error) + // Creates a new BuildTrigger. + // + // This API is experimental. + CreateBuildTrigger(context.Context, *CreateBuildTriggerRequest) (*BuildTrigger, error) + // Gets information about a BuildTrigger. + // + // This API is experimental. + GetBuildTrigger(context.Context, *GetBuildTriggerRequest) (*BuildTrigger, error) + // Lists existing BuildTrigger. + // + // This API is experimental. + ListBuildTriggers(context.Context, *ListBuildTriggersRequest) (*ListBuildTriggersResponse, error) + // Deletes an BuildTrigger by its project ID and trigger ID. + // + // This API is experimental. + DeleteBuildTrigger(context.Context, *DeleteBuildTriggerRequest) (*google_protobuf3.Empty, error) + // Updates an BuildTrigger by its project ID and trigger ID. + // + // This API is experimental. + UpdateBuildTrigger(context.Context, *UpdateBuildTriggerRequest) (*BuildTrigger, error) + // Runs a BuildTrigger at a particular source revision. + RunBuildTrigger(context.Context, *RunBuildTriggerRequest) (*google_longrunning.Operation, error) + // Creates a new build based on the given build. + // + // This API creates a new build using the original build request, which may + // or may not result in an identical build. + // + // For triggered builds: + // + // * Triggered builds resolve to a precise revision, so a retry of a triggered + // build will result in a build that uses the same revision. + // + // For non-triggered builds that specify RepoSource: + // + // * If the original build built from the tip of a branch, the retried build + // will build from the tip of that branch, which may not be the same revision + // as the original build. + // * If the original build specified a commit sha or revision ID, the retried + // build will use the identical source. + // + // For builds that specify StorageSource: + // + // * If the original build pulled source from Cloud Storage without specifying + // the generation of the object, the new build will use the current object, + // which may be different from the original build source. + // * If the original build pulled source from Cloud Storage and specified the + // generation of the object, the new build will attempt to use the same + // object, which may or may not be available depending on the bucket's + // lifecycle management settings. + RetryBuild(context.Context, *RetryBuildRequest) (*google_longrunning.Operation, error) +} + +func RegisterCloudBuildServer(s *grpc.Server, srv CloudBuildServer) { + s.RegisterService(&_CloudBuild_serviceDesc, srv) +} + +func _CloudBuild_CreateBuild_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateBuildRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CloudBuildServer).CreateBuild(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.cloudbuild.v1.CloudBuild/CreateBuild", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CloudBuildServer).CreateBuild(ctx, req.(*CreateBuildRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CloudBuild_GetBuild_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetBuildRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CloudBuildServer).GetBuild(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.cloudbuild.v1.CloudBuild/GetBuild", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CloudBuildServer).GetBuild(ctx, req.(*GetBuildRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CloudBuild_ListBuilds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListBuildsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CloudBuildServer).ListBuilds(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.cloudbuild.v1.CloudBuild/ListBuilds", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CloudBuildServer).ListBuilds(ctx, req.(*ListBuildsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CloudBuild_CancelBuild_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CancelBuildRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CloudBuildServer).CancelBuild(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.cloudbuild.v1.CloudBuild/CancelBuild", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CloudBuildServer).CancelBuild(ctx, req.(*CancelBuildRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CloudBuild_CreateBuildTrigger_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateBuildTriggerRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CloudBuildServer).CreateBuildTrigger(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.cloudbuild.v1.CloudBuild/CreateBuildTrigger", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CloudBuildServer).CreateBuildTrigger(ctx, req.(*CreateBuildTriggerRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CloudBuild_GetBuildTrigger_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetBuildTriggerRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CloudBuildServer).GetBuildTrigger(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.cloudbuild.v1.CloudBuild/GetBuildTrigger", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CloudBuildServer).GetBuildTrigger(ctx, req.(*GetBuildTriggerRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CloudBuild_ListBuildTriggers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListBuildTriggersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CloudBuildServer).ListBuildTriggers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.cloudbuild.v1.CloudBuild/ListBuildTriggers", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CloudBuildServer).ListBuildTriggers(ctx, req.(*ListBuildTriggersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CloudBuild_DeleteBuildTrigger_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteBuildTriggerRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CloudBuildServer).DeleteBuildTrigger(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.cloudbuild.v1.CloudBuild/DeleteBuildTrigger", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CloudBuildServer).DeleteBuildTrigger(ctx, req.(*DeleteBuildTriggerRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CloudBuild_UpdateBuildTrigger_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateBuildTriggerRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CloudBuildServer).UpdateBuildTrigger(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.cloudbuild.v1.CloudBuild/UpdateBuildTrigger", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CloudBuildServer).UpdateBuildTrigger(ctx, req.(*UpdateBuildTriggerRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CloudBuild_RunBuildTrigger_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RunBuildTriggerRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CloudBuildServer).RunBuildTrigger(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.cloudbuild.v1.CloudBuild/RunBuildTrigger", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CloudBuildServer).RunBuildTrigger(ctx, req.(*RunBuildTriggerRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CloudBuild_RetryBuild_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RetryBuildRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CloudBuildServer).RetryBuild(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.cloudbuild.v1.CloudBuild/RetryBuild", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CloudBuildServer).RetryBuild(ctx, req.(*RetryBuildRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _CloudBuild_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.devtools.cloudbuild.v1.CloudBuild", + HandlerType: (*CloudBuildServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateBuild", + Handler: _CloudBuild_CreateBuild_Handler, + }, + { + MethodName: "GetBuild", + Handler: _CloudBuild_GetBuild_Handler, + }, + { + MethodName: "ListBuilds", + Handler: _CloudBuild_ListBuilds_Handler, + }, + { + MethodName: "CancelBuild", + Handler: _CloudBuild_CancelBuild_Handler, + }, + { + MethodName: "CreateBuildTrigger", + Handler: _CloudBuild_CreateBuildTrigger_Handler, + }, + { + MethodName: "GetBuildTrigger", + Handler: _CloudBuild_GetBuildTrigger_Handler, + }, + { + MethodName: "ListBuildTriggers", + Handler: _CloudBuild_ListBuildTriggers_Handler, + }, + { + MethodName: "DeleteBuildTrigger", + Handler: _CloudBuild_DeleteBuildTrigger_Handler, + }, + { + MethodName: "UpdateBuildTrigger", + Handler: _CloudBuild_UpdateBuildTrigger_Handler, + }, + { + MethodName: "RunBuildTrigger", + Handler: _CloudBuild_RunBuildTrigger_Handler, + }, + { + MethodName: "RetryBuild", + Handler: _CloudBuild_RetryBuild_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/devtools/cloudbuild/v1/cloudbuild.proto", +} + +func init() { proto.RegisterFile("google/devtools/cloudbuild/v1/cloudbuild.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 2467 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x59, 0x5b, 0x73, 0x23, 0x47, + 0x15, 0xf6, 0x48, 0xb2, 0x2e, 0x47, 0xbe, 0xcc, 0x76, 0x36, 0xce, 0x58, 0x9b, 0xcd, 0x9a, 0xc9, + 0x05, 0x67, 0x93, 0x48, 0xb1, 0x97, 0x64, 0x1d, 0xe7, 0x66, 0x5b, 0x96, 0x2f, 0xb5, 0xb6, 0xbc, + 0x8c, 0xa4, 0xdd, 0x22, 0x40, 0x0d, 0x23, 0x4d, 0x7b, 0x3c, 0x78, 0x34, 0x33, 0xcc, 0xb4, 0x44, + 0xbc, 0x5b, 0x5b, 0x40, 0xaa, 0xe0, 0x15, 0xaa, 0x28, 0x1e, 0x28, 0x1e, 0xb8, 0x3c, 0x53, 0x14, + 0x05, 0x0f, 0x54, 0x51, 0x95, 0x67, 0x7e, 0x00, 0x3f, 0x01, 0x7e, 0x08, 0xd5, 0x97, 0x91, 0x46, + 0xd2, 0x2e, 0x23, 0x65, 0xe1, 0xc5, 0xee, 0x3e, 0xdd, 0xe7, 0xf4, 0xe9, 0x73, 0xfd, 0x5a, 0x03, + 0x65, 0xcb, 0xf3, 0x2c, 0x07, 0x57, 0x4c, 0xdc, 0x27, 0x9e, 0xe7, 0x84, 0x95, 0x8e, 0xe3, 0xf5, + 0xcc, 0x76, 0xcf, 0x76, 0xcc, 0x4a, 0x7f, 0x23, 0x36, 0x2b, 0xfb, 0x81, 0x47, 0x3c, 0x74, 0x93, + 0xef, 0x2f, 0x47, 0xfb, 0xcb, 0xb1, 0x1d, 0xfd, 0x8d, 0xd2, 0xcb, 0x42, 0x9c, 0xe1, 0xdb, 0x15, + 0xc3, 0x75, 0x3d, 0x62, 0x10, 0x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x39, 0x11, 0x62, 0xe8, 0x65, 0x60, 0x25, 0x82, 0x25, 0x61, 0x5e, 0x3c, + 0x14, 0x07, 0x94, 0x71, 0x00, 0x38, 0x3f, 0x13, 0x00, 0x2c, 0x41, 0xde, 0xb4, 0x43, 0xa3, 0xed, + 0x60, 0x53, 0x29, 0xac, 0x49, 0xeb, 0x79, 0x6d, 0x30, 0x47, 0xe6, 0x38, 0x9c, 0xe0, 0x18, 0xf7, + 0x93, 0x69, 0x94, 0x17, 0x0e, 0x48, 0x46, 0x15, 0xcf, 0x0f, 0x00, 0xf6, 0x64, 0x58, 0x12, 0x00, + 0x4c, 0x98, 0x5b, 0xfd, 0x89, 0x04, 0xab, 0xb1, 0x2a, 0x30, 0xdb, 0xcf, 0x1c, 0x35, 0xc8, 0x09, + 0xf7, 0x89, 0x72, 0xf0, 0xd6, 0x0c, 0x17, 0xd6, 0x22, 0x5e, 0xf5, 0x01, 0xac, 0x44, 0x75, 0xe1, + 0x7f, 0xf9, 0x33, 0x8b, 0xfa, 0x01, 0x28, 0x83, 0x24, 0x15, 0x82, 0xa7, 0xac, 0x19, 0xaa, 0x09, + 0xab, 0x4f, 0x61, 0x15, 0x69, 0x7e, 0x08, 0x79, 0x71, 0x48, 0x94, 0xe8, 0x33, 0xdd, 0x7b, 0xc0, + 0xac, 0x7e, 0x0b, 0x56, 0xf7, 0xb1, 0x83, 0xbf, 0x92, 0xed, 0x13, 0xee, 0xfe, 0x3b, 0x09, 0x56, + 0x5b, 0xbe, 0x69, 0xfc, 0x1f, 0x64, 0xc7, 0xdd, 0x9e, 0x7e, 0x0e, 0xb7, 0xff, 0x3d, 0x2b, 0x4a, + 0x90, 0x80, 0xed, 0xa8, 0x0d, 0x2b, 0x13, 0x8f, 0x8f, 0x21, 0x44, 0x98, 0xb5, 0xb9, 0x5f, 0x1f, + 0x7f, 0x7e, 0x30, 0xb8, 0xe0, 0x53, 0x58, 0xc8, 0x8c, 0x80, 0x4d, 0xbd, 0x8f, 0x03, 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 0x97, 0x49, 0x75, 0xbe, 0xca, 0x74, 0xfd, 0x58, 0xbd, 0x33, 0xab, 0xae, 0x41, 0xcf, + 0xdd, 0x8e, 0x7e, 0xeb, 0xff, 0x15, 0xfb, 0x78, 0x18, 0x7d, 0x7e, 0x4d, 0xac, 0xb4, 0x13, 0x5f, + 0x6a, 0x93, 0x94, 0x7c, 0x9f, 0x29, 0xf9, 0xae, 0xfa, 0xd6, 0x74, 0x25, 0x2c, 0xa0, 0xf2, 0xb7, + 0xa5, 0xdb, 0x7b, 0x97, 0xa0, 0x74, 0xbc, 0x6e, 0x24, 0x7b, 0x44, 0x89, 0xfb, 0xd2, 0x67, 0x87, + 0x82, 0x6e, 0x79, 0x8e, 0xe1, 0x5a, 0x65, 0x2f, 0xb0, 0x2a, 0x16, 0x76, 0x59, 0x08, 0x56, 0xf8, + 0x92, 0xe1, 0xdb, 0xe1, 0x33, 0x3e, 0xb3, 0x7f, 0x38, 0x9c, 0xfd, 0x21, 0x95, 0x3e, 0xac, 0xee, + 0xb5, 0xb3, 0x8c, 0xf3, 0xce, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xba, 0xc5, 0x54, 0x96, 0x9f, + 0x1f, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/devtools/clouddebugger/v2/controller.pb.go b/vendor/google.golang.org/genproto/googleapis/devtools/clouddebugger/v2/controller.pb.go new file mode 100644 index 0000000000..1e54c283d1 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/devtools/clouddebugger/v2/controller.pb.go @@ -0,0 +1,475 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/devtools/clouddebugger/v2/controller.proto + +/* +Package clouddebugger is a generated protocol buffer package. + +It is generated from these files: + google/devtools/clouddebugger/v2/controller.proto + google/devtools/clouddebugger/v2/data.proto + google/devtools/clouddebugger/v2/debugger.proto + +It has these top-level messages: + RegisterDebuggeeRequest + RegisterDebuggeeResponse + ListActiveBreakpointsRequest + ListActiveBreakpointsResponse + UpdateActiveBreakpointRequest + UpdateActiveBreakpointResponse + FormatMessage + StatusMessage + SourceLocation + Variable + StackFrame + Breakpoint + Debuggee + SetBreakpointRequest + SetBreakpointResponse + GetBreakpointRequest + GetBreakpointResponse + DeleteBreakpointRequest + ListBreakpointsRequest + ListBreakpointsResponse + ListDebuggeesRequest + ListDebuggeesResponse +*/ +package clouddebugger + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import _ "github.com/golang/protobuf/ptypes/empty" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Request to register a debuggee. +type RegisterDebuggeeRequest struct { + // Debuggee information to register. + // The fields `project`, `uniquifier`, `description` and `agent_version` + // of the debuggee must be set. + Debuggee *Debuggee `protobuf:"bytes,1,opt,name=debuggee" json:"debuggee,omitempty"` +} + +func (m *RegisterDebuggeeRequest) Reset() { *m = RegisterDebuggeeRequest{} } +func (m *RegisterDebuggeeRequest) String() string { return proto.CompactTextString(m) } +func (*RegisterDebuggeeRequest) ProtoMessage() {} +func (*RegisterDebuggeeRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *RegisterDebuggeeRequest) GetDebuggee() *Debuggee { + if m != nil { + return m.Debuggee + } + return nil +} + +// Response for registering a debuggee. +type RegisterDebuggeeResponse struct { + // Debuggee resource. + // The field `id` is guranteed to be set (in addition to the echoed fields). + // If the field `is_disabled` is set to `true`, the agent should disable + // itself by removing all breakpoints and detaching from the application. + // It should however continue to poll `RegisterDebuggee` until reenabled. + Debuggee *Debuggee `protobuf:"bytes,1,opt,name=debuggee" json:"debuggee,omitempty"` +} + +func (m *RegisterDebuggeeResponse) Reset() { *m = RegisterDebuggeeResponse{} } +func (m *RegisterDebuggeeResponse) String() string { return proto.CompactTextString(m) } +func (*RegisterDebuggeeResponse) ProtoMessage() {} +func (*RegisterDebuggeeResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *RegisterDebuggeeResponse) GetDebuggee() *Debuggee { + if m != nil { + return m.Debuggee + } + return nil +} + +// Request to list active breakpoints. +type ListActiveBreakpointsRequest struct { + // Identifies the debuggee. + DebuggeeId string `protobuf:"bytes,1,opt,name=debuggee_id,json=debuggeeId" json:"debuggee_id,omitempty"` + // A token that, if specified, blocks the method call until the list + // of active breakpoints has changed, or a server-selected timeout has + // expired. The value should be set from the `next_wait_token` field in + // the last response. The initial value should be set to `"init"`. + WaitToken string `protobuf:"bytes,2,opt,name=wait_token,json=waitToken" json:"wait_token,omitempty"` + // If set to `true` (recommended), returns `google.rpc.Code.OK` status and + // sets the `wait_expired` response field to `true` when the server-selected + // timeout has expired. + // + // If set to `false` (deprecated), returns `google.rpc.Code.ABORTED` status + // when the server-selected timeout has expired. + SuccessOnTimeout bool `protobuf:"varint,3,opt,name=success_on_timeout,json=successOnTimeout" json:"success_on_timeout,omitempty"` +} + +func (m *ListActiveBreakpointsRequest) Reset() { *m = ListActiveBreakpointsRequest{} } +func (m *ListActiveBreakpointsRequest) String() string { return proto.CompactTextString(m) } +func (*ListActiveBreakpointsRequest) ProtoMessage() {} +func (*ListActiveBreakpointsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *ListActiveBreakpointsRequest) GetDebuggeeId() string { + if m != nil { + return m.DebuggeeId + } + return "" +} + +func (m *ListActiveBreakpointsRequest) GetWaitToken() string { + if m != nil { + return m.WaitToken + } + return "" +} + +func (m *ListActiveBreakpointsRequest) GetSuccessOnTimeout() bool { + if m != nil { + return m.SuccessOnTimeout + } + return false +} + +// Response for listing active breakpoints. +type ListActiveBreakpointsResponse struct { + // List of all active breakpoints. + // The fields `id` and `location` are guaranteed to be set on each breakpoint. + Breakpoints []*Breakpoint `protobuf:"bytes,1,rep,name=breakpoints" json:"breakpoints,omitempty"` + // A token that can be used in the next method call to block until + // the list of breakpoints changes. + NextWaitToken string `protobuf:"bytes,2,opt,name=next_wait_token,json=nextWaitToken" json:"next_wait_token,omitempty"` + // If set to `true`, indicates that there is no change to the + // list of active breakpoints and the server-selected timeout has expired. + // The `breakpoints` field would be empty and should be ignored. + WaitExpired bool `protobuf:"varint,3,opt,name=wait_expired,json=waitExpired" json:"wait_expired,omitempty"` +} + +func (m *ListActiveBreakpointsResponse) Reset() { *m = ListActiveBreakpointsResponse{} } +func (m *ListActiveBreakpointsResponse) String() string { return proto.CompactTextString(m) } +func (*ListActiveBreakpointsResponse) ProtoMessage() {} +func (*ListActiveBreakpointsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *ListActiveBreakpointsResponse) GetBreakpoints() []*Breakpoint { + if m != nil { + return m.Breakpoints + } + return nil +} + +func (m *ListActiveBreakpointsResponse) GetNextWaitToken() string { + if m != nil { + return m.NextWaitToken + } + return "" +} + +func (m *ListActiveBreakpointsResponse) GetWaitExpired() bool { + if m != nil { + return m.WaitExpired + } + return false +} + +// Request to update an active breakpoint. +type UpdateActiveBreakpointRequest struct { + // Identifies the debuggee being debugged. + DebuggeeId string `protobuf:"bytes,1,opt,name=debuggee_id,json=debuggeeId" json:"debuggee_id,omitempty"` + // Updated breakpoint information. + // The field `id` must be set. + // The agent must echo all Breakpoint specification fields in the update. + Breakpoint *Breakpoint `protobuf:"bytes,2,opt,name=breakpoint" json:"breakpoint,omitempty"` +} + +func (m *UpdateActiveBreakpointRequest) Reset() { *m = UpdateActiveBreakpointRequest{} } +func (m *UpdateActiveBreakpointRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateActiveBreakpointRequest) ProtoMessage() {} +func (*UpdateActiveBreakpointRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *UpdateActiveBreakpointRequest) GetDebuggeeId() string { + if m != nil { + return m.DebuggeeId + } + return "" +} + +func (m *UpdateActiveBreakpointRequest) GetBreakpoint() *Breakpoint { + if m != nil { + return m.Breakpoint + } + return nil +} + +// Response for updating an active breakpoint. +// The message is defined to allow future extensions. +type UpdateActiveBreakpointResponse struct { +} + +func (m *UpdateActiveBreakpointResponse) Reset() { *m = UpdateActiveBreakpointResponse{} } +func (m *UpdateActiveBreakpointResponse) String() string { return proto.CompactTextString(m) } +func (*UpdateActiveBreakpointResponse) ProtoMessage() {} +func (*UpdateActiveBreakpointResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func init() { + proto.RegisterType((*RegisterDebuggeeRequest)(nil), "google.devtools.clouddebugger.v2.RegisterDebuggeeRequest") + proto.RegisterType((*RegisterDebuggeeResponse)(nil), "google.devtools.clouddebugger.v2.RegisterDebuggeeResponse") + proto.RegisterType((*ListActiveBreakpointsRequest)(nil), "google.devtools.clouddebugger.v2.ListActiveBreakpointsRequest") + proto.RegisterType((*ListActiveBreakpointsResponse)(nil), "google.devtools.clouddebugger.v2.ListActiveBreakpointsResponse") + proto.RegisterType((*UpdateActiveBreakpointRequest)(nil), "google.devtools.clouddebugger.v2.UpdateActiveBreakpointRequest") + proto.RegisterType((*UpdateActiveBreakpointResponse)(nil), "google.devtools.clouddebugger.v2.UpdateActiveBreakpointResponse") +} + +// 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 + +// Client API for Controller2 service + +type Controller2Client interface { + // Registers the debuggee with the controller service. + // + // All agents attached to the same application must call this method with + // exactly the same request content to get back the same stable `debuggee_id`. + // Agents should call this method again whenever `google.rpc.Code.NOT_FOUND` + // is returned from any controller method. + // + // This protocol allows the controller service to disable debuggees, recover + // from data loss, or change the `debuggee_id` format. Agents must handle + // `debuggee_id` value changing upon re-registration. + RegisterDebuggee(ctx context.Context, in *RegisterDebuggeeRequest, opts ...grpc.CallOption) (*RegisterDebuggeeResponse, error) + // Returns the list of all active breakpoints for the debuggee. + // + // The breakpoint specification (`location`, `condition`, and `expressions` + // fields) is semantically immutable, although the field values may + // change. For example, an agent may update the location line number + // to reflect the actual line where the breakpoint was set, but this + // doesn't change the breakpoint semantics. + // + // This means that an agent does not need to check if a breakpoint has changed + // when it encounters the same breakpoint on a successive call. + // Moreover, an agent should remember the breakpoints that are completed + // until the controller removes them from the active list to avoid + // setting those breakpoints again. + ListActiveBreakpoints(ctx context.Context, in *ListActiveBreakpointsRequest, opts ...grpc.CallOption) (*ListActiveBreakpointsResponse, error) + // Updates the breakpoint state or mutable fields. + // The entire Breakpoint message must be sent back to the controller service. + // + // Updates to active breakpoint fields are only allowed if the new value + // does not change the breakpoint specification. Updates to the `location`, + // `condition` and `expressions` fields should not alter the breakpoint + // semantics. These may only make changes such as canonicalizing a value + // or snapping the location to the correct line of code. + UpdateActiveBreakpoint(ctx context.Context, in *UpdateActiveBreakpointRequest, opts ...grpc.CallOption) (*UpdateActiveBreakpointResponse, error) +} + +type controller2Client struct { + cc *grpc.ClientConn +} + +func NewController2Client(cc *grpc.ClientConn) Controller2Client { + return &controller2Client{cc} +} + +func (c *controller2Client) RegisterDebuggee(ctx context.Context, in *RegisterDebuggeeRequest, opts ...grpc.CallOption) (*RegisterDebuggeeResponse, error) { + out := new(RegisterDebuggeeResponse) + err := grpc.Invoke(ctx, "/google.devtools.clouddebugger.v2.Controller2/RegisterDebuggee", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *controller2Client) ListActiveBreakpoints(ctx context.Context, in *ListActiveBreakpointsRequest, opts ...grpc.CallOption) (*ListActiveBreakpointsResponse, error) { + out := new(ListActiveBreakpointsResponse) + err := grpc.Invoke(ctx, "/google.devtools.clouddebugger.v2.Controller2/ListActiveBreakpoints", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *controller2Client) UpdateActiveBreakpoint(ctx context.Context, in *UpdateActiveBreakpointRequest, opts ...grpc.CallOption) (*UpdateActiveBreakpointResponse, error) { + out := new(UpdateActiveBreakpointResponse) + err := grpc.Invoke(ctx, "/google.devtools.clouddebugger.v2.Controller2/UpdateActiveBreakpoint", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for Controller2 service + +type Controller2Server interface { + // Registers the debuggee with the controller service. + // + // All agents attached to the same application must call this method with + // exactly the same request content to get back the same stable `debuggee_id`. + // Agents should call this method again whenever `google.rpc.Code.NOT_FOUND` + // is returned from any controller method. + // + // This protocol allows the controller service to disable debuggees, recover + // from data loss, or change the `debuggee_id` format. Agents must handle + // `debuggee_id` value changing upon re-registration. + RegisterDebuggee(context.Context, *RegisterDebuggeeRequest) (*RegisterDebuggeeResponse, error) + // Returns the list of all active breakpoints for the debuggee. + // + // The breakpoint specification (`location`, `condition`, and `expressions` + // fields) is semantically immutable, although the field values may + // change. For example, an agent may update the location line number + // to reflect the actual line where the breakpoint was set, but this + // doesn't change the breakpoint semantics. + // + // This means that an agent does not need to check if a breakpoint has changed + // when it encounters the same breakpoint on a successive call. + // Moreover, an agent should remember the breakpoints that are completed + // until the controller removes them from the active list to avoid + // setting those breakpoints again. + ListActiveBreakpoints(context.Context, *ListActiveBreakpointsRequest) (*ListActiveBreakpointsResponse, error) + // Updates the breakpoint state or mutable fields. + // The entire Breakpoint message must be sent back to the controller service. + // + // Updates to active breakpoint fields are only allowed if the new value + // does not change the breakpoint specification. Updates to the `location`, + // `condition` and `expressions` fields should not alter the breakpoint + // semantics. These may only make changes such as canonicalizing a value + // or snapping the location to the correct line of code. + UpdateActiveBreakpoint(context.Context, *UpdateActiveBreakpointRequest) (*UpdateActiveBreakpointResponse, error) +} + +func RegisterController2Server(s *grpc.Server, srv Controller2Server) { + s.RegisterService(&_Controller2_serviceDesc, srv) +} + +func _Controller2_RegisterDebuggee_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RegisterDebuggeeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(Controller2Server).RegisterDebuggee(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.clouddebugger.v2.Controller2/RegisterDebuggee", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(Controller2Server).RegisterDebuggee(ctx, req.(*RegisterDebuggeeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Controller2_ListActiveBreakpoints_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListActiveBreakpointsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(Controller2Server).ListActiveBreakpoints(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.clouddebugger.v2.Controller2/ListActiveBreakpoints", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(Controller2Server).ListActiveBreakpoints(ctx, req.(*ListActiveBreakpointsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Controller2_UpdateActiveBreakpoint_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateActiveBreakpointRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(Controller2Server).UpdateActiveBreakpoint(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.clouddebugger.v2.Controller2/UpdateActiveBreakpoint", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(Controller2Server).UpdateActiveBreakpoint(ctx, req.(*UpdateActiveBreakpointRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Controller2_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.devtools.clouddebugger.v2.Controller2", + HandlerType: (*Controller2Server)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "RegisterDebuggee", + Handler: _Controller2_RegisterDebuggee_Handler, + }, + { + MethodName: "ListActiveBreakpoints", + Handler: _Controller2_ListActiveBreakpoints_Handler, + }, + { + MethodName: "UpdateActiveBreakpoint", + Handler: _Controller2_UpdateActiveBreakpoint_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/devtools/clouddebugger/v2/controller.proto", +} + +func init() { proto.RegisterFile("google/devtools/clouddebugger/v2/controller.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 589 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xdd, 0x6a, 0xd4, 0x40, + 0x14, 0x66, 0x5a, 0x94, 0xf6, 0x44, 0x69, 0x19, 0x50, 0x43, 0x6c, 0x75, 0x1b, 0xa4, 0x94, 0x5a, + 0x32, 0x18, 0xbd, 0x71, 0x05, 0x7f, 0xb6, 0x6a, 0x11, 0x5a, 0x2d, 0x4b, 0x55, 0xf0, 0x66, 0xc9, + 0x26, 0xc7, 0x30, 0x34, 0x9d, 0x89, 0x99, 0xc9, 0x5a, 0x29, 0xbd, 0xf1, 0x56, 0xf1, 0xc6, 0x47, + 0xf0, 0xce, 0x17, 0x10, 0x7c, 0x0d, 0x7d, 0x04, 0xaf, 0x7c, 0x0a, 0xc9, 0xdf, 0xee, 0xf6, 0x67, + 0x9b, 0x76, 0xf1, 0x32, 0xdf, 0x9c, 0xef, 0x3b, 0xdf, 0x37, 0x39, 0x73, 0xe0, 0x56, 0x28, 0x65, + 0x18, 0x21, 0x0b, 0xb0, 0xa7, 0xa5, 0x8c, 0x14, 0xf3, 0x23, 0x99, 0x06, 0x01, 0x76, 0xd3, 0x30, + 0xc4, 0x84, 0xf5, 0x5c, 0xe6, 0x4b, 0xa1, 0x13, 0x19, 0x45,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 0xe1, 0xeb, 0xc4, 0x69, 0xb4, 0x1e, 0x8e, 0x2f, 0x50, 0x26, 0xdb, 0xc8, + 0x93, 0xad, 0x59, 0xad, 0xb3, 0x27, 0x63, 0x7b, 0x83, 0x0f, 0x87, 0x07, 0xfb, 0x4d, 0xb2, 0xdc, + 0xfa, 0x46, 0xe0, 0x86, 0x2f, 0x77, 0x6a, 0x6d, 0xb5, 0x66, 0x06, 0x33, 0xbb, 0x99, 0x6d, 0xe3, + 0x4d, 0xf2, 0x66, 0xa3, 0x24, 0x85, 0x32, 0xf2, 0x44, 0xe8, 0xc8, 0x24, 0x64, 0x21, 0x8a, 0x7c, + 0x57, 0xb3, 0xe2, 0xc8, 0x8b, 0xb9, 0x1a, 0xbd, 0xf8, 0xef, 0x1d, 0x00, 0xbe, 0x4f, 0x98, 0x6b, + 0x85, 0xde, 0x6a, 0x06, 0x57, 0x9b, 0x33, 0x71, 0x5e, 0xb9, 0xdd, 0xf3, 0xb9, 0xe8, 0xed, 0x7f, + 0x01, 0x00, 0x00, 0xff, 0xff, 0x05, 0xef, 0x37, 0xb4, 0xbf, 0x06, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/devtools/clouddebugger/v2/data.pb.go b/vendor/google.golang.org/genproto/googleapis/devtools/clouddebugger/v2/data.pb.go new file mode 100644 index 0000000000..b41e215e81 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/devtools/clouddebugger/v2/data.pb.go @@ -0,0 +1,889 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/devtools/clouddebugger/v2/data.proto + +package clouddebugger + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_devtools_source_v1 "google.golang.org/genproto/googleapis/devtools/source/v1" +import google_protobuf1 "github.com/golang/protobuf/ptypes/timestamp" +import google_protobuf2 "github.com/golang/protobuf/ptypes/wrappers" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Enumerates references to which the message applies. +type StatusMessage_Reference int32 + +const ( + // Status doesn't refer to any particular input. + StatusMessage_UNSPECIFIED StatusMessage_Reference = 0 + // Status applies to the breakpoint and is related to its location. + StatusMessage_BREAKPOINT_SOURCE_LOCATION StatusMessage_Reference = 3 + // Status applies to the breakpoint and is related to its condition. + StatusMessage_BREAKPOINT_CONDITION StatusMessage_Reference = 4 + // Status applies to the breakpoint and is related to its expressions. + StatusMessage_BREAKPOINT_EXPRESSION StatusMessage_Reference = 7 + // Status applies to the breakpoint and is related to its age. + StatusMessage_BREAKPOINT_AGE StatusMessage_Reference = 8 + // Status applies to the entire variable. + StatusMessage_VARIABLE_NAME StatusMessage_Reference = 5 + // Status applies to variable value (variable name is valid). + StatusMessage_VARIABLE_VALUE StatusMessage_Reference = 6 +) + +var StatusMessage_Reference_name = map[int32]string{ + 0: "UNSPECIFIED", + 3: "BREAKPOINT_SOURCE_LOCATION", + 4: "BREAKPOINT_CONDITION", + 7: "BREAKPOINT_EXPRESSION", + 8: "BREAKPOINT_AGE", + 5: "VARIABLE_NAME", + 6: "VARIABLE_VALUE", +} +var StatusMessage_Reference_value = map[string]int32{ + "UNSPECIFIED": 0, + "BREAKPOINT_SOURCE_LOCATION": 3, + "BREAKPOINT_CONDITION": 4, + "BREAKPOINT_EXPRESSION": 7, + "BREAKPOINT_AGE": 8, + "VARIABLE_NAME": 5, + "VARIABLE_VALUE": 6, +} + +func (x StatusMessage_Reference) String() string { + return proto.EnumName(StatusMessage_Reference_name, int32(x)) +} +func (StatusMessage_Reference) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{1, 0} } + +// Actions that can be taken when a breakpoint hits. +// Agents should reject breakpoints with unsupported or unknown action values. +type Breakpoint_Action int32 + +const ( + // Capture stack frame and variables and update the breakpoint. + // The data is only captured once. After that the breakpoint is set + // in a final state. + Breakpoint_CAPTURE Breakpoint_Action = 0 + // Log each breakpoint hit. The breakpoint remains active until + // deleted or expired. + Breakpoint_LOG Breakpoint_Action = 1 +) + +var Breakpoint_Action_name = map[int32]string{ + 0: "CAPTURE", + 1: "LOG", +} +var Breakpoint_Action_value = map[string]int32{ + "CAPTURE": 0, + "LOG": 1, +} + +func (x Breakpoint_Action) String() string { + return proto.EnumName(Breakpoint_Action_name, int32(x)) +} +func (Breakpoint_Action) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{5, 0} } + +// Log severity levels. +type Breakpoint_LogLevel int32 + +const ( + // Information log message. + Breakpoint_INFO Breakpoint_LogLevel = 0 + // Warning log message. + Breakpoint_WARNING Breakpoint_LogLevel = 1 + // Error log message. + Breakpoint_ERROR Breakpoint_LogLevel = 2 +) + +var Breakpoint_LogLevel_name = map[int32]string{ + 0: "INFO", + 1: "WARNING", + 2: "ERROR", +} +var Breakpoint_LogLevel_value = map[string]int32{ + "INFO": 0, + "WARNING": 1, + "ERROR": 2, +} + +func (x Breakpoint_LogLevel) String() string { + return proto.EnumName(Breakpoint_LogLevel_name, int32(x)) +} +func (Breakpoint_LogLevel) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{5, 1} } + +// Represents a message with parameters. +type FormatMessage struct { + // Format template for the message. The `format` uses placeholders `$0`, + // `$1`, etc. to reference parameters. `$$` can be used to denote the `$` + // character. + // + // Examples: + // + // * `Failed to load '$0' which helps debug $1 the first time it + // is loaded. Again, $0 is very important.` + // * `Please pay $$10 to use $0 instead of $1.` + Format string `protobuf:"bytes,1,opt,name=format" json:"format,omitempty"` + // Optional parameters to be embedded into the message. + Parameters []string `protobuf:"bytes,2,rep,name=parameters" json:"parameters,omitempty"` +} + +func (m *FormatMessage) Reset() { *m = FormatMessage{} } +func (m *FormatMessage) String() string { return proto.CompactTextString(m) } +func (*FormatMessage) ProtoMessage() {} +func (*FormatMessage) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +func (m *FormatMessage) GetFormat() string { + if m != nil { + return m.Format + } + return "" +} + +func (m *FormatMessage) GetParameters() []string { + if m != nil { + return m.Parameters + } + return nil +} + +// Represents a contextual status message. +// The message can indicate an error or informational status, and refer to +// specific parts of the containing object. +// For example, the `Breakpoint.status` field can indicate an error referring +// to the `BREAKPOINT_SOURCE_LOCATION` with the message `Location not found`. +type StatusMessage struct { + // Distinguishes errors from informational messages. + IsError bool `protobuf:"varint,1,opt,name=is_error,json=isError" json:"is_error,omitempty"` + // Reference to which the message applies. + RefersTo StatusMessage_Reference `protobuf:"varint,2,opt,name=refers_to,json=refersTo,enum=google.devtools.clouddebugger.v2.StatusMessage_Reference" json:"refers_to,omitempty"` + // Status message text. + Description *FormatMessage `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` +} + +func (m *StatusMessage) Reset() { *m = StatusMessage{} } +func (m *StatusMessage) String() string { return proto.CompactTextString(m) } +func (*StatusMessage) ProtoMessage() {} +func (*StatusMessage) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} } + +func (m *StatusMessage) GetIsError() bool { + if m != nil { + return m.IsError + } + return false +} + +func (m *StatusMessage) GetRefersTo() StatusMessage_Reference { + if m != nil { + return m.RefersTo + } + return StatusMessage_UNSPECIFIED +} + +func (m *StatusMessage) GetDescription() *FormatMessage { + if m != nil { + return m.Description + } + return nil +} + +// Represents a location in the source code. +type SourceLocation struct { + // Path to the source file within the source context of the target binary. + Path string `protobuf:"bytes,1,opt,name=path" json:"path,omitempty"` + // Line inside the file. The first line in the file has the value `1`. + Line int32 `protobuf:"varint,2,opt,name=line" json:"line,omitempty"` +} + +func (m *SourceLocation) Reset() { *m = SourceLocation{} } +func (m *SourceLocation) String() string { return proto.CompactTextString(m) } +func (*SourceLocation) ProtoMessage() {} +func (*SourceLocation) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} } + +func (m *SourceLocation) GetPath() string { + if m != nil { + return m.Path + } + return "" +} + +func (m *SourceLocation) GetLine() int32 { + if m != nil { + return m.Line + } + return 0 +} + +// Represents a variable or an argument possibly of a compound object type. +// Note how the following variables are represented: +// +// 1) A simple variable: +// +// int x = 5 +// +// { name: "x", value: "5", type: "int" } // Captured variable +// +// 2) A compound object: +// +// struct T { +// int m1; +// int m2; +// }; +// T x = { 3, 7 }; +// +// { // Captured variable +// name: "x", +// type: "T", +// members { name: "m1", value: "3", type: "int" }, +// members { name: "m2", value: "7", type: "int" } +// } +// +// 3) A pointer where the pointee was captured: +// +// T x = { 3, 7 }; +// T* p = &x; +// +// { // Captured variable +// name: "p", +// type: "T*", +// value: "0x00500500", +// members { name: "m1", value: "3", type: "int" }, +// members { name: "m2", value: "7", type: "int" } +// } +// +// 4) A pointer where the pointee was not captured: +// +// T* p = new T; +// +// { // Captured variable +// name: "p", +// type: "T*", +// value: "0x00400400" +// status { is_error: true, description { format: "unavailable" } } +// } +// +// The status should describe the reason for the missing value, +// such as ``, ``, ``. +// +// Note that a null pointer should not have members. +// +// 5) An unnamed value: +// +// int* p = new int(7); +// +// { // Captured variable +// name: "p", +// value: "0x00500500", +// type: "int*", +// members { value: "7", type: "int" } } +// +// 6) An unnamed pointer where the pointee was not captured: +// +// int* p = new int(7); +// int** pp = &p; +// +// { // Captured variable +// name: "pp", +// value: "0x00500500", +// type: "int**", +// members { +// value: "0x00400400", +// type: "int*" +// status { +// is_error: true, +// description: { format: "unavailable" } } +// } +// } +// } +// +// To optimize computation, memory and network traffic, variables that +// repeat in the output multiple times can be stored once in a shared +// variable table and be referenced using the `var_table_index` field. The +// variables stored in the shared table are nameless and are essentially +// a partition of the complete variable. To reconstruct the complete +// variable, merge the referencing variable with the referenced variable. +// +// When using the shared variable table, the following variables: +// +// T x = { 3, 7 }; +// T* p = &x; +// T& r = x; +// +// { name: "x", var_table_index: 3, type: "T" } // Captured variables +// { name: "p", value "0x00500500", type="T*", var_table_index: 3 } +// { name: "r", type="T&", var_table_index: 3 } +// +// { // Shared variable table entry #3: +// members { name: "m1", value: "3", type: "int" }, +// members { name: "m2", value: "7", type: "int" } +// } +// +// Note that the pointer address is stored with the referencing variable +// and not with the referenced variable. This allows the referenced variable +// to be shared between pointers and references. +// +// The type field is optional. The debugger agent may or may not support it. +type Variable struct { + // Name of the variable, if any. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Simple value of the variable. + Value string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` + // Variable type (e.g. `MyClass`). If the variable is split with + // `var_table_index`, `type` goes next to `value`. The interpretation of + // a type is agent specific. It is recommended to include the dynamic type + // rather than a static type of an object. + Type string `protobuf:"bytes,6,opt,name=type" json:"type,omitempty"` + // Members contained or pointed to by the variable. + Members []*Variable `protobuf:"bytes,3,rep,name=members" json:"members,omitempty"` + // Reference to a variable in the shared variable table. More than + // one variable can reference the same variable in the table. The + // `var_table_index` field is an index into `variable_table` in Breakpoint. + VarTableIndex *google_protobuf2.Int32Value `protobuf:"bytes,4,opt,name=var_table_index,json=varTableIndex" json:"var_table_index,omitempty"` + // Status associated with the variable. This field will usually stay + // unset. A status of a single variable only applies to that variable or + // expression. The rest of breakpoint data still remains valid. Variables + // might be reported in error state even when breakpoint is not in final + // state. + // + // The message may refer to variable name with `refers_to` set to + // `VARIABLE_NAME`. Alternatively `refers_to` will be set to `VARIABLE_VALUE`. + // In either case variable value and members will be unset. + // + // Example of error message applied to name: `Invalid expression syntax`. + // + // Example of information message applied to value: `Not captured`. + // + // Examples of error message applied to value: + // + // * `Malformed string`, + // * `Field f not found in class C` + // * `Null pointer dereference` + Status *StatusMessage `protobuf:"bytes,5,opt,name=status" json:"status,omitempty"` +} + +func (m *Variable) Reset() { *m = Variable{} } +func (m *Variable) String() string { return proto.CompactTextString(m) } +func (*Variable) ProtoMessage() {} +func (*Variable) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{3} } + +func (m *Variable) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Variable) GetValue() string { + if m != nil { + return m.Value + } + return "" +} + +func (m *Variable) GetType() string { + if m != nil { + return m.Type + } + return "" +} + +func (m *Variable) GetMembers() []*Variable { + if m != nil { + return m.Members + } + return nil +} + +func (m *Variable) GetVarTableIndex() *google_protobuf2.Int32Value { + if m != nil { + return m.VarTableIndex + } + return nil +} + +func (m *Variable) GetStatus() *StatusMessage { + if m != nil { + return m.Status + } + return nil +} + +// Represents a stack frame context. +type StackFrame struct { + // Demangled function name at the call site. + Function string `protobuf:"bytes,1,opt,name=function" json:"function,omitempty"` + // Source location of the call site. + Location *SourceLocation `protobuf:"bytes,2,opt,name=location" json:"location,omitempty"` + // Set of arguments passed to this function. + // Note that this might not be populated for all stack frames. + Arguments []*Variable `protobuf:"bytes,3,rep,name=arguments" json:"arguments,omitempty"` + // Set of local variables at the stack frame location. + // Note that this might not be populated for all stack frames. + Locals []*Variable `protobuf:"bytes,4,rep,name=locals" json:"locals,omitempty"` +} + +func (m *StackFrame) Reset() { *m = StackFrame{} } +func (m *StackFrame) String() string { return proto.CompactTextString(m) } +func (*StackFrame) ProtoMessage() {} +func (*StackFrame) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{4} } + +func (m *StackFrame) GetFunction() string { + if m != nil { + return m.Function + } + return "" +} + +func (m *StackFrame) GetLocation() *SourceLocation { + if m != nil { + return m.Location + } + return nil +} + +func (m *StackFrame) GetArguments() []*Variable { + if m != nil { + return m.Arguments + } + return nil +} + +func (m *StackFrame) GetLocals() []*Variable { + if m != nil { + return m.Locals + } + return nil +} + +// Represents the breakpoint specification, status and results. +type Breakpoint struct { + // Breakpoint identifier, unique in the scope of the debuggee. + Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + // Action that the agent should perform when the code at the + // breakpoint location is hit. + Action Breakpoint_Action `protobuf:"varint,13,opt,name=action,enum=google.devtools.clouddebugger.v2.Breakpoint_Action" json:"action,omitempty"` + // Breakpoint source location. + Location *SourceLocation `protobuf:"bytes,2,opt,name=location" json:"location,omitempty"` + // Condition that triggers the breakpoint. + // The condition is a compound boolean expression composed using expressions + // in a programming language at the source location. + Condition string `protobuf:"bytes,3,opt,name=condition" json:"condition,omitempty"` + // List of read-only expressions to evaluate at the breakpoint location. + // The expressions are composed using expressions in the programming language + // at the source location. If the breakpoint action is `LOG`, the evaluated + // expressions are included in log statements. + Expressions []string `protobuf:"bytes,4,rep,name=expressions" json:"expressions,omitempty"` + // Only relevant when action is `LOG`. Defines the message to log when + // the breakpoint hits. The message may include parameter placeholders `$0`, + // `$1`, etc. These placeholders are replaced with the evaluated value + // of the appropriate expression. Expressions not referenced in + // `log_message_format` are not logged. + // + // Example: `Message received, id = $0, count = $1` with + // `expressions` = `[ message.id, message.count ]`. + LogMessageFormat string `protobuf:"bytes,14,opt,name=log_message_format,json=logMessageFormat" json:"log_message_format,omitempty"` + // Indicates the severity of the log. Only relevant when action is `LOG`. + LogLevel Breakpoint_LogLevel `protobuf:"varint,15,opt,name=log_level,json=logLevel,enum=google.devtools.clouddebugger.v2.Breakpoint_LogLevel" json:"log_level,omitempty"` + // When true, indicates that this is a final result and the + // breakpoint state will not change from here on. + IsFinalState bool `protobuf:"varint,5,opt,name=is_final_state,json=isFinalState" json:"is_final_state,omitempty"` + // Time this breakpoint was created by the server in seconds resolution. + CreateTime *google_protobuf1.Timestamp `protobuf:"bytes,11,opt,name=create_time,json=createTime" json:"create_time,omitempty"` + // Time this breakpoint was finalized as seen by the server in seconds + // resolution. + FinalTime *google_protobuf1.Timestamp `protobuf:"bytes,12,opt,name=final_time,json=finalTime" json:"final_time,omitempty"` + // E-mail address of the user that created this breakpoint + UserEmail string `protobuf:"bytes,16,opt,name=user_email,json=userEmail" json:"user_email,omitempty"` + // Breakpoint status. + // + // The status includes an error flag and a human readable message. + // This field is usually unset. The message can be either + // informational or an error message. Regardless, clients should always + // display the text message back to the user. + // + // Error status indicates complete failure of the breakpoint. + // + // Example (non-final state): `Still loading symbols...` + // + // Examples (final state): + // + // * `Invalid line number` referring to location + // * `Field f not found in class C` referring to condition + Status *StatusMessage `protobuf:"bytes,10,opt,name=status" json:"status,omitempty"` + // The stack at breakpoint time. + StackFrames []*StackFrame `protobuf:"bytes,7,rep,name=stack_frames,json=stackFrames" json:"stack_frames,omitempty"` + // Values of evaluated expressions at breakpoint time. + // The evaluated expressions appear in exactly the same order they + // are listed in the `expressions` field. + // The `name` field holds the original expression text, the `value` or + // `members` field holds the result of the evaluated expression. + // If the expression cannot be evaluated, the `status` inside the `Variable` + // will indicate an error and contain the error text. + EvaluatedExpressions []*Variable `protobuf:"bytes,8,rep,name=evaluated_expressions,json=evaluatedExpressions" json:"evaluated_expressions,omitempty"` + // The `variable_table` exists to aid with computation, memory and network + // traffic optimization. It enables storing a variable once and reference + // it from multiple variables, including variables stored in the + // `variable_table` itself. + // For example, the same `this` object, which may appear at many levels of + // the stack, can have all of its data stored once in this table. The + // stack frame variables then would hold only a reference to it. + // + // The variable `var_table_index` field is an index into this repeated field. + // The stored objects are nameless and get their name from the referencing + // variable. The effective variable is a merge of the referencing variable + // and the referenced variable. + VariableTable []*Variable `protobuf:"bytes,9,rep,name=variable_table,json=variableTable" json:"variable_table,omitempty"` + // A set of custom breakpoint properties, populated by the agent, to be + // displayed to the user. + Labels map[string]string `protobuf:"bytes,17,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *Breakpoint) Reset() { *m = Breakpoint{} } +func (m *Breakpoint) String() string { return proto.CompactTextString(m) } +func (*Breakpoint) ProtoMessage() {} +func (*Breakpoint) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{5} } + +func (m *Breakpoint) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *Breakpoint) GetAction() Breakpoint_Action { + if m != nil { + return m.Action + } + return Breakpoint_CAPTURE +} + +func (m *Breakpoint) GetLocation() *SourceLocation { + if m != nil { + return m.Location + } + return nil +} + +func (m *Breakpoint) GetCondition() string { + if m != nil { + return m.Condition + } + return "" +} + +func (m *Breakpoint) GetExpressions() []string { + if m != nil { + return m.Expressions + } + return nil +} + +func (m *Breakpoint) GetLogMessageFormat() string { + if m != nil { + return m.LogMessageFormat + } + return "" +} + +func (m *Breakpoint) GetLogLevel() Breakpoint_LogLevel { + if m != nil { + return m.LogLevel + } + return Breakpoint_INFO +} + +func (m *Breakpoint) GetIsFinalState() bool { + if m != nil { + return m.IsFinalState + } + return false +} + +func (m *Breakpoint) GetCreateTime() *google_protobuf1.Timestamp { + if m != nil { + return m.CreateTime + } + return nil +} + +func (m *Breakpoint) GetFinalTime() *google_protobuf1.Timestamp { + if m != nil { + return m.FinalTime + } + return nil +} + +func (m *Breakpoint) GetUserEmail() string { + if m != nil { + return m.UserEmail + } + return "" +} + +func (m *Breakpoint) GetStatus() *StatusMessage { + if m != nil { + return m.Status + } + return nil +} + +func (m *Breakpoint) GetStackFrames() []*StackFrame { + if m != nil { + return m.StackFrames + } + return nil +} + +func (m *Breakpoint) GetEvaluatedExpressions() []*Variable { + if m != nil { + return m.EvaluatedExpressions + } + return nil +} + +func (m *Breakpoint) GetVariableTable() []*Variable { + if m != nil { + return m.VariableTable + } + return nil +} + +func (m *Breakpoint) GetLabels() map[string]string { + if m != nil { + return m.Labels + } + return nil +} + +// Represents the debugged application. The application may include one or more +// replicated processes executing the same code. Each of these processes is +// attached with a debugger agent, carrying out the debugging commands. +// Agents attached to the same debuggee identify themselves as such by using +// exactly the same Debuggee message value when registering. +type Debuggee struct { + // Unique identifier for the debuggee generated by the controller service. + Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + // Project the debuggee is associated with. + // Use project number or id when registering a Google Cloud Platform project. + Project string `protobuf:"bytes,2,opt,name=project" json:"project,omitempty"` + // Uniquifier to further distiguish the application. + // It is possible that different applications might have identical values in + // the debuggee message, thus, incorrectly identified as a single application + // by the Controller service. This field adds salt to further distiguish the + // application. Agents should consider seeding this field with value that + // identifies the code, binary, configuration and environment. + Uniquifier string `protobuf:"bytes,3,opt,name=uniquifier" json:"uniquifier,omitempty"` + // Human readable description of the debuggee. + // Including a human-readable project name, environment name and version + // information is recommended. + Description string `protobuf:"bytes,4,opt,name=description" json:"description,omitempty"` + // If set to `true`, indicates that Controller service does not detect any + // activity from the debuggee agents and the application is possibly stopped. + IsInactive bool `protobuf:"varint,5,opt,name=is_inactive,json=isInactive" json:"is_inactive,omitempty"` + // Version ID of the agent. + // Schema: `domain/language-platform/vmajor.minor` (for example + // `google.com/java-gcp/v1.1`). + AgentVersion string `protobuf:"bytes,6,opt,name=agent_version,json=agentVersion" json:"agent_version,omitempty"` + // If set to `true`, indicates that the agent should disable itself and + // detach from the debuggee. + IsDisabled bool `protobuf:"varint,7,opt,name=is_disabled,json=isDisabled" json:"is_disabled,omitempty"` + // Human readable message to be displayed to the user about this debuggee. + // Absence of this field indicates no status. The message can be either + // informational or an error status. + Status *StatusMessage `protobuf:"bytes,8,opt,name=status" json:"status,omitempty"` + // References to the locations and revisions of the source code used in the + // deployed application. + SourceContexts []*google_devtools_source_v1.SourceContext `protobuf:"bytes,9,rep,name=source_contexts,json=sourceContexts" json:"source_contexts,omitempty"` + // References to the locations and revisions of the source code used in the + // deployed application. + // + // NOTE: this field is experimental and can be ignored. + ExtSourceContexts []*google_devtools_source_v1.ExtendedSourceContext `protobuf:"bytes,13,rep,name=ext_source_contexts,json=extSourceContexts" json:"ext_source_contexts,omitempty"` + // A set of custom debuggee properties, populated by the agent, to be + // displayed to the user. + Labels map[string]string `protobuf:"bytes,11,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *Debuggee) Reset() { *m = Debuggee{} } +func (m *Debuggee) String() string { return proto.CompactTextString(m) } +func (*Debuggee) ProtoMessage() {} +func (*Debuggee) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{6} } + +func (m *Debuggee) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *Debuggee) GetProject() string { + if m != nil { + return m.Project + } + return "" +} + +func (m *Debuggee) GetUniquifier() string { + if m != nil { + return m.Uniquifier + } + return "" +} + +func (m *Debuggee) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *Debuggee) GetIsInactive() bool { + if m != nil { + return m.IsInactive + } + return false +} + +func (m *Debuggee) GetAgentVersion() string { + if m != nil { + return m.AgentVersion + } + return "" +} + +func (m *Debuggee) GetIsDisabled() bool { + if m != nil { + return m.IsDisabled + } + return false +} + +func (m *Debuggee) GetStatus() *StatusMessage { + if m != nil { + return m.Status + } + return nil +} + +func (m *Debuggee) GetSourceContexts() []*google_devtools_source_v1.SourceContext { + if m != nil { + return m.SourceContexts + } + return nil +} + +func (m *Debuggee) GetExtSourceContexts() []*google_devtools_source_v1.ExtendedSourceContext { + if m != nil { + return m.ExtSourceContexts + } + return nil +} + +func (m *Debuggee) GetLabels() map[string]string { + if m != nil { + return m.Labels + } + return nil +} + +func init() { + proto.RegisterType((*FormatMessage)(nil), "google.devtools.clouddebugger.v2.FormatMessage") + proto.RegisterType((*StatusMessage)(nil), "google.devtools.clouddebugger.v2.StatusMessage") + proto.RegisterType((*SourceLocation)(nil), "google.devtools.clouddebugger.v2.SourceLocation") + proto.RegisterType((*Variable)(nil), "google.devtools.clouddebugger.v2.Variable") + proto.RegisterType((*StackFrame)(nil), "google.devtools.clouddebugger.v2.StackFrame") + proto.RegisterType((*Breakpoint)(nil), "google.devtools.clouddebugger.v2.Breakpoint") + proto.RegisterType((*Debuggee)(nil), "google.devtools.clouddebugger.v2.Debuggee") + proto.RegisterEnum("google.devtools.clouddebugger.v2.StatusMessage_Reference", StatusMessage_Reference_name, StatusMessage_Reference_value) + proto.RegisterEnum("google.devtools.clouddebugger.v2.Breakpoint_Action", Breakpoint_Action_name, Breakpoint_Action_value) + proto.RegisterEnum("google.devtools.clouddebugger.v2.Breakpoint_LogLevel", Breakpoint_LogLevel_name, Breakpoint_LogLevel_value) +} + +func init() { proto.RegisterFile("google/devtools/clouddebugger/v2/data.proto", fileDescriptor1) } + +var fileDescriptor1 = []byte{ + // 1251 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00,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30, 0xde, 0xaf, 0x11, 0x9e, 0xc3, 0xde, + 0xe6, 0x37, 0x21, 0xd7, 0xbe, 0x3a, 0x7c, 0x4b, 0x31, 0xe1, 0xb5, 0x56, 0x0f, 0xf4, 0x78, 0xec, + 0x25, 0x09, 0xb8, 0xc6, 0xb3, 0x4b, 0x8e, 0x7e, 0x80, 0x8f, 0xe8, 0xa5, 0x70, 0xde, 0x94, 0xad, + 0x2a, 0xd9, 0xfb, 0xff, 0x21, 0x6b, 0x5f, 0x0a, 0x1a, 0xba, 0xd4, 0xdd, 0x94, 0xbf, 0x4e, 0x2f, + 0xc5, 0x64, 0xf3, 0x84, 0xe1, 0xda, 0xb8, 0x15, 0x25, 0xfa, 0xd5, 0xf6, 0x5f, 0x9f, 0x9a, 0xe1, + 0x03, 0xdb, 0xf6, 0xe8, 0xb7, 0x1c, 0xdc, 0x9d, 0x45, 0x8b, 0xad, 0x0f, 0x70, 0x64, 0x1e, 0x13, + 0x41, 0xc6, 0x72, 0xf8, 0x8d, 0x73, 0xdf, 0x3f, 0xd3, 0x74, 0x2f, 0x0a, 0x48, 0xe8, 0xb5, 0x22, + 0xe6, 0xb5, 0x3d, 0x1a, 0xaa, 0xd1, 0xd8, 0x4e, 0xb6, 0x48, 0xec, 0xf3, 0x7f, 0xff, 0xb7, 0xf0, + 0x64, 0x03, 0xf8, 0x3d, 0x6f, 0x9d, 0x26, 0x7a, 0x3d, 0x09, 0xa7, 0xbf, 0x95, 0xb5, 0xa6, 0x9d, + 0x8b, 0x92, 0x12, 0x7d, 0xf8, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x06, 0xfd, 0x4c, 0xc8, 0x81, + 0x0c, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/devtools/clouddebugger/v2/debugger.pb.go b/vendor/google.golang.org/genproto/googleapis/devtools/clouddebugger/v2/debugger.pb.go new file mode 100644 index 0000000000..7454ee2e04 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/devtools/clouddebugger/v2/debugger.pb.go @@ -0,0 +1,647 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/devtools/clouddebugger/v2/debugger.proto + +package clouddebugger + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf3 "github.com/golang/protobuf/ptypes/empty" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Request to set a breakpoint +type SetBreakpointRequest struct { + // ID of the debuggee where the breakpoint is to be set. + DebuggeeId string `protobuf:"bytes,1,opt,name=debuggee_id,json=debuggeeId" json:"debuggee_id,omitempty"` + // Breakpoint specification to set. + // The field `location` of the breakpoint must be set. + Breakpoint *Breakpoint `protobuf:"bytes,2,opt,name=breakpoint" json:"breakpoint,omitempty"` + // The client version making the call. + // Schema: `domain/type/version` (e.g., `google.com/intellij/v1`). + ClientVersion string `protobuf:"bytes,4,opt,name=client_version,json=clientVersion" json:"client_version,omitempty"` +} + +func (m *SetBreakpointRequest) Reset() { *m = SetBreakpointRequest{} } +func (m *SetBreakpointRequest) String() string { return proto.CompactTextString(m) } +func (*SetBreakpointRequest) ProtoMessage() {} +func (*SetBreakpointRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} } + +func (m *SetBreakpointRequest) GetDebuggeeId() string { + if m != nil { + return m.DebuggeeId + } + return "" +} + +func (m *SetBreakpointRequest) GetBreakpoint() *Breakpoint { + if m != nil { + return m.Breakpoint + } + return nil +} + +func (m *SetBreakpointRequest) GetClientVersion() string { + if m != nil { + return m.ClientVersion + } + return "" +} + +// Response for setting a breakpoint. +type SetBreakpointResponse struct { + // Breakpoint resource. + // The field `id` is guaranteed to be set (in addition to the echoed fileds). + Breakpoint *Breakpoint `protobuf:"bytes,1,opt,name=breakpoint" json:"breakpoint,omitempty"` +} + +func (m *SetBreakpointResponse) Reset() { *m = SetBreakpointResponse{} } +func (m *SetBreakpointResponse) String() string { return proto.CompactTextString(m) } +func (*SetBreakpointResponse) ProtoMessage() {} +func (*SetBreakpointResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{1} } + +func (m *SetBreakpointResponse) GetBreakpoint() *Breakpoint { + if m != nil { + return m.Breakpoint + } + return nil +} + +// Request to get breakpoint information. +type GetBreakpointRequest struct { + // ID of the debuggee whose breakpoint to get. + DebuggeeId string `protobuf:"bytes,1,opt,name=debuggee_id,json=debuggeeId" json:"debuggee_id,omitempty"` + // ID of the breakpoint to get. + BreakpointId string `protobuf:"bytes,2,opt,name=breakpoint_id,json=breakpointId" json:"breakpoint_id,omitempty"` + // The client version making the call. + // Schema: `domain/type/version` (e.g., `google.com/intellij/v1`). + ClientVersion string `protobuf:"bytes,4,opt,name=client_version,json=clientVersion" json:"client_version,omitempty"` +} + +func (m *GetBreakpointRequest) Reset() { *m = GetBreakpointRequest{} } +func (m *GetBreakpointRequest) String() string { return proto.CompactTextString(m) } +func (*GetBreakpointRequest) ProtoMessage() {} +func (*GetBreakpointRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{2} } + +func (m *GetBreakpointRequest) GetDebuggeeId() string { + if m != nil { + return m.DebuggeeId + } + return "" +} + +func (m *GetBreakpointRequest) GetBreakpointId() string { + if m != nil { + return m.BreakpointId + } + return "" +} + +func (m *GetBreakpointRequest) GetClientVersion() string { + if m != nil { + return m.ClientVersion + } + return "" +} + +// Response for getting breakpoint information. +type GetBreakpointResponse struct { + // Complete breakpoint state. + // The fields `id` and `location` are guaranteed to be set. + Breakpoint *Breakpoint `protobuf:"bytes,1,opt,name=breakpoint" json:"breakpoint,omitempty"` +} + +func (m *GetBreakpointResponse) Reset() { *m = GetBreakpointResponse{} } +func (m *GetBreakpointResponse) String() string { return proto.CompactTextString(m) } +func (*GetBreakpointResponse) ProtoMessage() {} +func (*GetBreakpointResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{3} } + +func (m *GetBreakpointResponse) GetBreakpoint() *Breakpoint { + if m != nil { + return m.Breakpoint + } + return nil +} + +// Request to delete a breakpoint. +type DeleteBreakpointRequest struct { + // ID of the debuggee whose breakpoint to delete. + DebuggeeId string `protobuf:"bytes,1,opt,name=debuggee_id,json=debuggeeId" json:"debuggee_id,omitempty"` + // ID of the breakpoint to delete. + BreakpointId string `protobuf:"bytes,2,opt,name=breakpoint_id,json=breakpointId" json:"breakpoint_id,omitempty"` + // The client version making the call. + // Schema: `domain/type/version` (e.g., `google.com/intellij/v1`). + ClientVersion string `protobuf:"bytes,3,opt,name=client_version,json=clientVersion" json:"client_version,omitempty"` +} + +func (m *DeleteBreakpointRequest) Reset() { *m = DeleteBreakpointRequest{} } +func (m *DeleteBreakpointRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteBreakpointRequest) ProtoMessage() {} +func (*DeleteBreakpointRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{4} } + +func (m *DeleteBreakpointRequest) GetDebuggeeId() string { + if m != nil { + return m.DebuggeeId + } + return "" +} + +func (m *DeleteBreakpointRequest) GetBreakpointId() string { + if m != nil { + return m.BreakpointId + } + return "" +} + +func (m *DeleteBreakpointRequest) GetClientVersion() string { + if m != nil { + return m.ClientVersion + } + return "" +} + +// Request to list breakpoints. +type ListBreakpointsRequest struct { + // ID of the debuggee whose breakpoints to list. + DebuggeeId string `protobuf:"bytes,1,opt,name=debuggee_id,json=debuggeeId" json:"debuggee_id,omitempty"` + // When set to `true`, the response includes the list of breakpoints set by + // any user. Otherwise, it includes only breakpoints set by the caller. + IncludeAllUsers bool `protobuf:"varint,2,opt,name=include_all_users,json=includeAllUsers" json:"include_all_users,omitempty"` + // When set to `true`, the response includes active and inactive + // breakpoints. Otherwise, it includes only active breakpoints. + IncludeInactive bool `protobuf:"varint,3,opt,name=include_inactive,json=includeInactive" json:"include_inactive,omitempty"` + // When set, the response includes only breakpoints with the specified action. + Action *ListBreakpointsRequest_BreakpointActionValue `protobuf:"bytes,4,opt,name=action" json:"action,omitempty"` + // This field is deprecated. The following fields are always stripped out of + // the result: `stack_frames`, `evaluated_expressions` and `variable_table`. + StripResults bool `protobuf:"varint,5,opt,name=strip_results,json=stripResults" json:"strip_results,omitempty"` + // A wait token that, if specified, blocks the call until the breakpoints + // list has changed, or a server selected timeout has expired. The value + // should be set from the last response. The error code + // `google.rpc.Code.ABORTED` (RPC) is returned on wait timeout, which + // should be called again with the same `wait_token`. + WaitToken string `protobuf:"bytes,6,opt,name=wait_token,json=waitToken" json:"wait_token,omitempty"` + // The client version making the call. + // Schema: `domain/type/version` (e.g., `google.com/intellij/v1`). + ClientVersion string `protobuf:"bytes,8,opt,name=client_version,json=clientVersion" json:"client_version,omitempty"` +} + +func (m *ListBreakpointsRequest) Reset() { *m = ListBreakpointsRequest{} } +func (m *ListBreakpointsRequest) String() string { return proto.CompactTextString(m) } +func (*ListBreakpointsRequest) ProtoMessage() {} +func (*ListBreakpointsRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{5} } + +func (m *ListBreakpointsRequest) GetDebuggeeId() string { + if m != nil { + return m.DebuggeeId + } + return "" +} + +func (m *ListBreakpointsRequest) GetIncludeAllUsers() bool { + if m != nil { + return m.IncludeAllUsers + } + return false +} + +func (m *ListBreakpointsRequest) GetIncludeInactive() bool { + if m != nil { + return m.IncludeInactive + } + return false +} + +func (m *ListBreakpointsRequest) GetAction() *ListBreakpointsRequest_BreakpointActionValue { + if m != nil { + return m.Action + } + return nil +} + +func (m *ListBreakpointsRequest) GetStripResults() bool { + if m != nil { + return m.StripResults + } + return false +} + +func (m *ListBreakpointsRequest) GetWaitToken() string { + if m != nil { + return m.WaitToken + } + return "" +} + +func (m *ListBreakpointsRequest) GetClientVersion() string { + if m != nil { + return m.ClientVersion + } + return "" +} + +// Wrapper message for `Breakpoint.Action`. Defines a filter on the action +// field of breakpoints. +type ListBreakpointsRequest_BreakpointActionValue struct { + // Only breakpoints with the specified action will pass the filter. + Value Breakpoint_Action `protobuf:"varint,1,opt,name=value,enum=google.devtools.clouddebugger.v2.Breakpoint_Action" json:"value,omitempty"` +} + +func (m *ListBreakpointsRequest_BreakpointActionValue) Reset() { + *m = ListBreakpointsRequest_BreakpointActionValue{} +} +func (m *ListBreakpointsRequest_BreakpointActionValue) String() string { + return proto.CompactTextString(m) +} +func (*ListBreakpointsRequest_BreakpointActionValue) ProtoMessage() {} +func (*ListBreakpointsRequest_BreakpointActionValue) Descriptor() ([]byte, []int) { + return fileDescriptor2, []int{5, 0} +} + +func (m *ListBreakpointsRequest_BreakpointActionValue) GetValue() Breakpoint_Action { + if m != nil { + return m.Value + } + return Breakpoint_CAPTURE +} + +// Response for listing breakpoints. +type ListBreakpointsResponse struct { + // List of breakpoints matching the request. + // The fields `id` and `location` are guaranteed to be set on each breakpoint. + // The fields: `stack_frames`, `evaluated_expressions` and `variable_table` + // are cleared on each breakpoint regardless of its status. + Breakpoints []*Breakpoint `protobuf:"bytes,1,rep,name=breakpoints" json:"breakpoints,omitempty"` + // A wait token that can be used in the next call to `list` (REST) or + // `ListBreakpoints` (RPC) to block until the list of breakpoints has changes. + NextWaitToken string `protobuf:"bytes,2,opt,name=next_wait_token,json=nextWaitToken" json:"next_wait_token,omitempty"` +} + +func (m *ListBreakpointsResponse) Reset() { *m = ListBreakpointsResponse{} } +func (m *ListBreakpointsResponse) String() string { return proto.CompactTextString(m) } +func (*ListBreakpointsResponse) ProtoMessage() {} +func (*ListBreakpointsResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{6} } + +func (m *ListBreakpointsResponse) GetBreakpoints() []*Breakpoint { + if m != nil { + return m.Breakpoints + } + return nil +} + +func (m *ListBreakpointsResponse) GetNextWaitToken() string { + if m != nil { + return m.NextWaitToken + } + return "" +} + +// Request to list debuggees. +type ListDebuggeesRequest struct { + // Project number of a Google Cloud project whose debuggees to list. + Project string `protobuf:"bytes,2,opt,name=project" json:"project,omitempty"` + // When set to `true`, the result includes all debuggees. Otherwise, the + // result includes only debuggees that are active. + IncludeInactive bool `protobuf:"varint,3,opt,name=include_inactive,json=includeInactive" json:"include_inactive,omitempty"` + // The client version making the call. + // Schema: `domain/type/version` (e.g., `google.com/intellij/v1`). + ClientVersion string `protobuf:"bytes,4,opt,name=client_version,json=clientVersion" json:"client_version,omitempty"` +} + +func (m *ListDebuggeesRequest) Reset() { *m = ListDebuggeesRequest{} } +func (m *ListDebuggeesRequest) String() string { return proto.CompactTextString(m) } +func (*ListDebuggeesRequest) ProtoMessage() {} +func (*ListDebuggeesRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{7} } + +func (m *ListDebuggeesRequest) GetProject() string { + if m != nil { + return m.Project + } + return "" +} + +func (m *ListDebuggeesRequest) GetIncludeInactive() bool { + if m != nil { + return m.IncludeInactive + } + return false +} + +func (m *ListDebuggeesRequest) GetClientVersion() string { + if m != nil { + return m.ClientVersion + } + return "" +} + +// Response for listing debuggees. +type ListDebuggeesResponse struct { + // List of debuggees accessible to the calling user. + // The fields `debuggee.id` and `description` are guaranteed to be set. + // The `description` field is a human readable field provided by agents and + // can be displayed to users. + Debuggees []*Debuggee `protobuf:"bytes,1,rep,name=debuggees" json:"debuggees,omitempty"` +} + +func (m *ListDebuggeesResponse) Reset() { *m = ListDebuggeesResponse{} } +func (m *ListDebuggeesResponse) String() string { return proto.CompactTextString(m) } +func (*ListDebuggeesResponse) ProtoMessage() {} +func (*ListDebuggeesResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{8} } + +func (m *ListDebuggeesResponse) GetDebuggees() []*Debuggee { + if m != nil { + return m.Debuggees + } + return nil +} + +func init() { + proto.RegisterType((*SetBreakpointRequest)(nil), "google.devtools.clouddebugger.v2.SetBreakpointRequest") + proto.RegisterType((*SetBreakpointResponse)(nil), "google.devtools.clouddebugger.v2.SetBreakpointResponse") + proto.RegisterType((*GetBreakpointRequest)(nil), "google.devtools.clouddebugger.v2.GetBreakpointRequest") + proto.RegisterType((*GetBreakpointResponse)(nil), "google.devtools.clouddebugger.v2.GetBreakpointResponse") + proto.RegisterType((*DeleteBreakpointRequest)(nil), "google.devtools.clouddebugger.v2.DeleteBreakpointRequest") + proto.RegisterType((*ListBreakpointsRequest)(nil), "google.devtools.clouddebugger.v2.ListBreakpointsRequest") + proto.RegisterType((*ListBreakpointsRequest_BreakpointActionValue)(nil), "google.devtools.clouddebugger.v2.ListBreakpointsRequest.BreakpointActionValue") + proto.RegisterType((*ListBreakpointsResponse)(nil), "google.devtools.clouddebugger.v2.ListBreakpointsResponse") + proto.RegisterType((*ListDebuggeesRequest)(nil), "google.devtools.clouddebugger.v2.ListDebuggeesRequest") + proto.RegisterType((*ListDebuggeesResponse)(nil), "google.devtools.clouddebugger.v2.ListDebuggeesResponse") +} + +// 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 + +// Client API for Debugger2 service + +type Debugger2Client interface { + // Sets the breakpoint to the debuggee. + SetBreakpoint(ctx context.Context, in *SetBreakpointRequest, opts ...grpc.CallOption) (*SetBreakpointResponse, error) + // Gets breakpoint information. + GetBreakpoint(ctx context.Context, in *GetBreakpointRequest, opts ...grpc.CallOption) (*GetBreakpointResponse, error) + // Deletes the breakpoint from the debuggee. + DeleteBreakpoint(ctx context.Context, in *DeleteBreakpointRequest, opts ...grpc.CallOption) (*google_protobuf3.Empty, error) + // Lists all breakpoints for the debuggee. + ListBreakpoints(ctx context.Context, in *ListBreakpointsRequest, opts ...grpc.CallOption) (*ListBreakpointsResponse, error) + // Lists all the debuggees that the user has access to. + ListDebuggees(ctx context.Context, in *ListDebuggeesRequest, opts ...grpc.CallOption) (*ListDebuggeesResponse, error) +} + +type debugger2Client struct { + cc *grpc.ClientConn +} + +func NewDebugger2Client(cc *grpc.ClientConn) Debugger2Client { + return &debugger2Client{cc} +} + +func (c *debugger2Client) SetBreakpoint(ctx context.Context, in *SetBreakpointRequest, opts ...grpc.CallOption) (*SetBreakpointResponse, error) { + out := new(SetBreakpointResponse) + err := grpc.Invoke(ctx, "/google.devtools.clouddebugger.v2.Debugger2/SetBreakpoint", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *debugger2Client) GetBreakpoint(ctx context.Context, in *GetBreakpointRequest, opts ...grpc.CallOption) (*GetBreakpointResponse, error) { + out := new(GetBreakpointResponse) + err := grpc.Invoke(ctx, "/google.devtools.clouddebugger.v2.Debugger2/GetBreakpoint", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *debugger2Client) DeleteBreakpoint(ctx context.Context, in *DeleteBreakpointRequest, opts ...grpc.CallOption) (*google_protobuf3.Empty, error) { + out := new(google_protobuf3.Empty) + err := grpc.Invoke(ctx, "/google.devtools.clouddebugger.v2.Debugger2/DeleteBreakpoint", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *debugger2Client) ListBreakpoints(ctx context.Context, in *ListBreakpointsRequest, opts ...grpc.CallOption) (*ListBreakpointsResponse, error) { + out := new(ListBreakpointsResponse) + err := grpc.Invoke(ctx, "/google.devtools.clouddebugger.v2.Debugger2/ListBreakpoints", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *debugger2Client) ListDebuggees(ctx context.Context, in *ListDebuggeesRequest, opts ...grpc.CallOption) (*ListDebuggeesResponse, error) { + out := new(ListDebuggeesResponse) + err := grpc.Invoke(ctx, "/google.devtools.clouddebugger.v2.Debugger2/ListDebuggees", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for Debugger2 service + +type Debugger2Server interface { + // Sets the breakpoint to the debuggee. + SetBreakpoint(context.Context, *SetBreakpointRequest) (*SetBreakpointResponse, error) + // Gets breakpoint information. + GetBreakpoint(context.Context, *GetBreakpointRequest) (*GetBreakpointResponse, error) + // Deletes the breakpoint from the debuggee. + DeleteBreakpoint(context.Context, *DeleteBreakpointRequest) (*google_protobuf3.Empty, error) + // Lists all breakpoints for the debuggee. + ListBreakpoints(context.Context, *ListBreakpointsRequest) (*ListBreakpointsResponse, error) + // Lists all the debuggees that the user has access to. + ListDebuggees(context.Context, *ListDebuggeesRequest) (*ListDebuggeesResponse, error) +} + +func RegisterDebugger2Server(s *grpc.Server, srv Debugger2Server) { + s.RegisterService(&_Debugger2_serviceDesc, srv) +} + +func _Debugger2_SetBreakpoint_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetBreakpointRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(Debugger2Server).SetBreakpoint(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.clouddebugger.v2.Debugger2/SetBreakpoint", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(Debugger2Server).SetBreakpoint(ctx, req.(*SetBreakpointRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Debugger2_GetBreakpoint_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetBreakpointRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(Debugger2Server).GetBreakpoint(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.clouddebugger.v2.Debugger2/GetBreakpoint", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(Debugger2Server).GetBreakpoint(ctx, req.(*GetBreakpointRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Debugger2_DeleteBreakpoint_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteBreakpointRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(Debugger2Server).DeleteBreakpoint(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.clouddebugger.v2.Debugger2/DeleteBreakpoint", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(Debugger2Server).DeleteBreakpoint(ctx, req.(*DeleteBreakpointRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Debugger2_ListBreakpoints_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListBreakpointsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(Debugger2Server).ListBreakpoints(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.clouddebugger.v2.Debugger2/ListBreakpoints", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(Debugger2Server).ListBreakpoints(ctx, req.(*ListBreakpointsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Debugger2_ListDebuggees_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListDebuggeesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(Debugger2Server).ListDebuggees(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.clouddebugger.v2.Debugger2/ListDebuggees", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(Debugger2Server).ListDebuggees(ctx, req.(*ListDebuggeesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Debugger2_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.devtools.clouddebugger.v2.Debugger2", + HandlerType: (*Debugger2Server)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SetBreakpoint", + Handler: _Debugger2_SetBreakpoint_Handler, + }, + { + MethodName: "GetBreakpoint", + Handler: _Debugger2_GetBreakpoint_Handler, + }, + { + MethodName: "DeleteBreakpoint", + Handler: _Debugger2_DeleteBreakpoint_Handler, + }, + { + MethodName: "ListBreakpoints", + Handler: _Debugger2_ListBreakpoints_Handler, + }, + { + MethodName: "ListDebuggees", + Handler: _Debugger2_ListDebuggees_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/devtools/clouddebugger/v2/debugger.proto", +} + +func init() { proto.RegisterFile("google/devtools/clouddebugger/v2/debugger.proto", fileDescriptor2) } + +var fileDescriptor2 = []byte{ + // 781 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xcb, 0x6e, 0xd3, 0x4c, + 0x18, 0xd5, 0xa4, 0x7f, 0x2f, 0xf9, 0xd2, 0xb4, 0xfd, 0x47, 0xbd, 0x58, 0xe1, 0x16, 0x99, 0x8b, + 0x4a, 0x41, 0x36, 0x72, 0x11, 0xb4, 0xb0, 0xa1, 0xa1, 0x28, 0x8d, 0x54, 0xaa, 0x2a, 0x40, 0x91, + 0xd8, 0x44, 0x4e, 0x3c, 0xb5, 0x4c, 0x5d, 0x8f, 0xf1, 0x8c, 0x03, 0xa8, 0xea, 0xa6, 0x48, 0xec, + 0x11, 0x2f, 0x00, 0x5b, 0x84, 0xc4, 0x13, 0x20, 0xb1, 0x43, 0x62, 0xcb, 0x2b, 0xf0, 0x20, 0xc8, + 0xf6, 0xb8, 0x71, 0x82, 0x21, 0x71, 0x2a, 0x75, 0xe7, 0x9c, 0xcc, 0x77, 0x7c, 0xce, 0x99, 0x6f, + 0xbe, 0x31, 0xa8, 0x26, 0xa5, 0xa6, 0x4d, 0x54, 0x83, 0xb4, 0x39, 0xa5, 0x36, 0x53, 0x5b, 0x36, + 0xf5, 0x0d, 0x83, 0x34, 0x7d, 0xd3, 0x24, 0x9e, 0xda, 0xd6, 0xd4, 0xf8, 0x59, 0x71, 0x3d, 0xca, + 0x29, 0x2e, 0x47, 0x05, 0x4a, 0x5c, 0xa0, 0x74, 0x15, 0x28, 0x6d, 0xad, 0x74, 0x56, 0x50, 0xea, + 0xae, 0xa5, 0xea, 0x8e, 0x43, 0xb9, 0xce, 0x2d, 0xea, 0xb0, 0xa8, 0xbe, 0x74, 0xad, 0xff, 0x0b, + 0x75, 0xae, 0x8b, 0xc5, 0x67, 0xc4, 0xe2, 0xf0, 0x57, 0xd3, 0xdf, 0x55, 0xc9, 0xbe, 0xcb, 0x5f, + 0x47, 0x7f, 0xca, 0x9f, 0x11, 0xcc, 0x3e, 0x22, 0xbc, 0xe2, 0x11, 0x7d, 0xcf, 0xa5, 0x96, 0xc3, + 0xeb, 0xe4, 0x85, 0x4f, 0x18, 0xc7, 0x17, 0xa0, 0x20, 0xf8, 0x48, 0xc3, 0x32, 0x24, 0x54, 0x46, + 0x8b, 0xf9, 0x3a, 0xc4, 0x50, 0xcd, 0xc0, 0x9b, 0x00, 0xcd, 0xe3, 0x2a, 0x29, 0x57, 0x46, 0x8b, + 0x05, 0xed, 0xba, 0xd2, 0xcf, 0x98, 0x92, 0x78, 0x53, 0xa2, 0x1e, 0x5f, 0x86, 0xa9, 0x96, 0x6d, + 0x11, 0x87, 0x37, 0xda, 0xc4, 0x63, 0x16, 0x75, 0xa4, 0xff, 0xc2, 0x37, 0x16, 0x23, 0x74, 0x27, + 0x02, 0x65, 0x02, 0x73, 0x3d, 0x6a, 0x99, 0x4b, 0x1d, 0x46, 0x7a, 0xd4, 0xa0, 0x93, 0xa9, 0x91, + 0xdf, 0x20, 0x98, 0xad, 0x0e, 0x95, 0xca, 0x45, 0x28, 0x76, 0x78, 0x82, 0x25, 0xb9, 0x70, 0xc9, + 0x64, 0x07, 0xac, 0x19, 0x19, 0xcc, 0x56, 0x4f, 0xc1, 0xec, 0x5b, 0x04, 0x0b, 0xeb, 0xc4, 0x26, + 0x9c, 0x9c, 0x9e, 0xdf, 0x91, 0x34, 0xbf, 0xdf, 0x47, 0x60, 0x7e, 0xd3, 0x62, 0x09, 0xc7, 0x6c, + 0x60, 0x1d, 0x4b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a, 0x9b, + 0x1a, 0x83, 0x74, 0x50, 0xea, 0x49, 0x97, 0xcf, 0x87, 0xe2, 0x25, 0x3c, 0x9f, 0x2e, 0xbe, 0xf2, + 0x11, 0xc1, 0xa5, 0x16, 0xdd, 0xef, 0x4b, 0x5f, 0x29, 0xc6, 0xa7, 0x7c, 0x3b, 0xd8, 0xf0, 0x6d, + 0xf4, 0xec, 0xa1, 0x28, 0x31, 0xa9, 0xad, 0x3b, 0xa6, 0x42, 0x3d, 0x53, 0x35, 0x89, 0x13, 0xb6, + 0x83, 0xf8, 0x42, 0xd5, 0x5d, 0x8b, 0xfd, 0xfd, 0xa3, 0xf1, 0x6e, 0x17, 0xf0, 0x29, 0x27, 0x55, + 0x23, 0xbe, 0xfb, 0x01, 0x1c, 0xcf, 0x1a, 0x4f, 0xd9, 0xd1, 0x9a, 0x63, 0x21, 0xe9, 0xf2, 0xef, + 0x00, 0x00, 0x00, 0xff, 0xff, 0x66, 0xf8, 0x5d, 0x68, 0xf9, 0x0a, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/devtools/clouderrorreporting/v1beta1/common.pb.go b/vendor/google.golang.org/genproto/googleapis/devtools/clouderrorreporting/v1beta1/common.pb.go new file mode 100644 index 0000000000..2d4317dc64 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/devtools/clouderrorreporting/v1beta1/common.pb.go @@ -0,0 +1,434 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/devtools/clouderrorreporting/v1beta1/common.proto + +/* +Package clouderrorreporting is a generated protocol buffer package. + +It is generated from these files: + google/devtools/clouderrorreporting/v1beta1/common.proto + google/devtools/clouderrorreporting/v1beta1/error_group_service.proto + google/devtools/clouderrorreporting/v1beta1/error_stats_service.proto + google/devtools/clouderrorreporting/v1beta1/report_errors_service.proto + +It has these top-level messages: + ErrorGroup + TrackingIssue + ErrorEvent + ServiceContext + ErrorContext + HttpRequestContext + SourceLocation + GetGroupRequest + UpdateGroupRequest + ListGroupStatsRequest + ListGroupStatsResponse + ErrorGroupStats + TimedCount + ListEventsRequest + ListEventsResponse + QueryTimeRange + ServiceContextFilter + DeleteEventsRequest + DeleteEventsResponse + ReportErrorEventRequest + ReportErrorEventResponse + ReportedErrorEvent +*/ +package clouderrorreporting + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import _ "google.golang.org/genproto/googleapis/api/monitoredres" +import google_protobuf1 "github.com/golang/protobuf/ptypes/timestamp" + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Description of a group of similar error events. +type ErrorGroup struct { + // The group resource name. + // Example: projects/my-project-123/groups/my-groupid + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Group IDs are unique for a given project. If the same kind of error + // occurs in different service contexts, it will receive the same group ID. + GroupId string `protobuf:"bytes,2,opt,name=group_id,json=groupId" json:"group_id,omitempty"` + // Associated tracking issues. + TrackingIssues []*TrackingIssue `protobuf:"bytes,3,rep,name=tracking_issues,json=trackingIssues" json:"tracking_issues,omitempty"` +} + +func (m *ErrorGroup) Reset() { *m = ErrorGroup{} } +func (m *ErrorGroup) String() string { return proto.CompactTextString(m) } +func (*ErrorGroup) ProtoMessage() {} +func (*ErrorGroup) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *ErrorGroup) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ErrorGroup) GetGroupId() string { + if m != nil { + return m.GroupId + } + return "" +} + +func (m *ErrorGroup) GetTrackingIssues() []*TrackingIssue { + if m != nil { + return m.TrackingIssues + } + return nil +} + +// Information related to tracking the progress on resolving the error. +type TrackingIssue struct { + // A URL pointing to a related entry in an issue tracking system. + // Example: https://github.com/user/project/issues/4 + Url string `protobuf:"bytes,1,opt,name=url" json:"url,omitempty"` +} + +func (m *TrackingIssue) Reset() { *m = TrackingIssue{} } +func (m *TrackingIssue) String() string { return proto.CompactTextString(m) } +func (*TrackingIssue) ProtoMessage() {} +func (*TrackingIssue) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *TrackingIssue) GetUrl() string { + if m != nil { + return m.Url + } + return "" +} + +// An error event which is returned by the Error Reporting system. +type ErrorEvent struct { + // Time when the event occurred as provided in the error report. + // If the report did not contain a timestamp, the time the error was received + // by the Error Reporting system is used. + EventTime *google_protobuf1.Timestamp `protobuf:"bytes,1,opt,name=event_time,json=eventTime" json:"event_time,omitempty"` + // The `ServiceContext` for which this error was reported. + ServiceContext *ServiceContext `protobuf:"bytes,2,opt,name=service_context,json=serviceContext" json:"service_context,omitempty"` + // The stack trace that was reported or logged by the service. + Message string `protobuf:"bytes,3,opt,name=message" json:"message,omitempty"` + // Data about the context in which the error occurred. + Context *ErrorContext `protobuf:"bytes,5,opt,name=context" json:"context,omitempty"` +} + +func (m *ErrorEvent) Reset() { *m = ErrorEvent{} } +func (m *ErrorEvent) String() string { return proto.CompactTextString(m) } +func (*ErrorEvent) ProtoMessage() {} +func (*ErrorEvent) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *ErrorEvent) GetEventTime() *google_protobuf1.Timestamp { + if m != nil { + return m.EventTime + } + return nil +} + +func (m *ErrorEvent) GetServiceContext() *ServiceContext { + if m != nil { + return m.ServiceContext + } + return nil +} + +func (m *ErrorEvent) GetMessage() string { + if m != nil { + return m.Message + } + return "" +} + +func (m *ErrorEvent) GetContext() *ErrorContext { + if m != nil { + return m.Context + } + return nil +} + +// Describes a running service that sends errors. +// Its version changes over time and multiple versions can run in parallel. +type ServiceContext struct { + // An identifier of the service, such as the name of the + // executable, job, or Google App Engine service name. This field is expected + // to have a low number of values that are relatively stable over time, as + // opposed to `version`, which can be changed whenever new code is deployed. + // + // Contains the service name for error reports extracted from Google + // App Engine logs or `default` if the App Engine default service is used. + Service string `protobuf:"bytes,2,opt,name=service" json:"service,omitempty"` + // Represents the source code version that the developer provided, + // which could represent a version label or a Git SHA-1 hash, for example. + Version string `protobuf:"bytes,3,opt,name=version" json:"version,omitempty"` + // Type of the MonitoredResource. List of possible values: + // https://cloud.google.com/monitoring/api/resources + // + // Value is set automatically for incoming errors and must not be set when + // reporting errors. + ResourceType string `protobuf:"bytes,4,opt,name=resource_type,json=resourceType" json:"resource_type,omitempty"` +} + +func (m *ServiceContext) Reset() { *m = ServiceContext{} } +func (m *ServiceContext) String() string { return proto.CompactTextString(m) } +func (*ServiceContext) ProtoMessage() {} +func (*ServiceContext) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *ServiceContext) GetService() string { + if m != nil { + return m.Service + } + return "" +} + +func (m *ServiceContext) GetVersion() string { + if m != nil { + return m.Version + } + return "" +} + +func (m *ServiceContext) GetResourceType() string { + if m != nil { + return m.ResourceType + } + return "" +} + +// A description of the context in which an error occurred. +// This data should be provided by the application when reporting an error, +// unless the +// error report has been generated automatically from Google App Engine logs. +type ErrorContext struct { + // The HTTP request which was processed when the error was + // triggered. + HttpRequest *HttpRequestContext `protobuf:"bytes,1,opt,name=http_request,json=httpRequest" json:"http_request,omitempty"` + // The user who caused or was affected by the crash. + // This can be a user ID, an email address, or an arbitrary token that + // uniquely identifies the user. + // When sending an error report, leave this field empty if the user was not + // logged in. In this case the + // Error Reporting system will use other data, such as remote IP address, to + // distinguish affected users. See `affected_users_count` in + // `ErrorGroupStats`. + User string `protobuf:"bytes,2,opt,name=user" json:"user,omitempty"` + // The location in the source code where the decision was made to + // report the error, usually the place where it was logged. + // For a logged exception this would be the source line where the + // exception is logged, usually close to the place where it was + // caught. This value is in contrast to `Exception.cause_location`, + // which describes the source line where the exception was thrown. + ReportLocation *SourceLocation `protobuf:"bytes,3,opt,name=report_location,json=reportLocation" json:"report_location,omitempty"` +} + +func (m *ErrorContext) Reset() { *m = ErrorContext{} } +func (m *ErrorContext) String() string { return proto.CompactTextString(m) } +func (*ErrorContext) ProtoMessage() {} +func (*ErrorContext) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *ErrorContext) GetHttpRequest() *HttpRequestContext { + if m != nil { + return m.HttpRequest + } + return nil +} + +func (m *ErrorContext) GetUser() string { + if m != nil { + return m.User + } + return "" +} + +func (m *ErrorContext) GetReportLocation() *SourceLocation { + if m != nil { + return m.ReportLocation + } + return nil +} + +// HTTP request data that is related to a reported error. +// This data should be provided by the application when reporting an error, +// unless the +// error report has been generated automatically from Google App Engine logs. +type HttpRequestContext struct { + // The type of HTTP request, such as `GET`, `POST`, etc. + Method string `protobuf:"bytes,1,opt,name=method" json:"method,omitempty"` + // The URL of the request. + Url string `protobuf:"bytes,2,opt,name=url" json:"url,omitempty"` + // The user agent information that is provided with the request. + UserAgent string `protobuf:"bytes,3,opt,name=user_agent,json=userAgent" json:"user_agent,omitempty"` + // The referrer information that is provided with the request. + Referrer string `protobuf:"bytes,4,opt,name=referrer" json:"referrer,omitempty"` + // The HTTP response status code for the request. + ResponseStatusCode int32 `protobuf:"varint,5,opt,name=response_status_code,json=responseStatusCode" json:"response_status_code,omitempty"` + // The IP address from which the request originated. + // This can be IPv4, IPv6, or a token which is derived from the + // IP address, depending on the data that has been provided + // in the error report. + RemoteIp string `protobuf:"bytes,6,opt,name=remote_ip,json=remoteIp" json:"remote_ip,omitempty"` +} + +func (m *HttpRequestContext) Reset() { *m = HttpRequestContext{} } +func (m *HttpRequestContext) String() string { return proto.CompactTextString(m) } +func (*HttpRequestContext) ProtoMessage() {} +func (*HttpRequestContext) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *HttpRequestContext) GetMethod() string { + if m != nil { + return m.Method + } + return "" +} + +func (m *HttpRequestContext) GetUrl() string { + if m != nil { + return m.Url + } + return "" +} + +func (m *HttpRequestContext) GetUserAgent() string { + if m != nil { + return m.UserAgent + } + return "" +} + +func (m *HttpRequestContext) GetReferrer() string { + if m != nil { + return m.Referrer + } + return "" +} + +func (m *HttpRequestContext) GetResponseStatusCode() int32 { + if m != nil { + return m.ResponseStatusCode + } + return 0 +} + +func (m *HttpRequestContext) GetRemoteIp() string { + if m != nil { + return m.RemoteIp + } + return "" +} + +// Indicates a location in the source code of the service for which +// errors are reported. +// This data should be provided by the application when reporting an error, +// unless the error report has been generated automatically from Google App +// Engine logs. All fields are optional. +type SourceLocation struct { + // The source code filename, which can include a truncated relative + // path, or a full path from a production machine. + FilePath string `protobuf:"bytes,1,opt,name=file_path,json=filePath" json:"file_path,omitempty"` + // 1-based. 0 indicates that the line number is unknown. + LineNumber int32 `protobuf:"varint,2,opt,name=line_number,json=lineNumber" json:"line_number,omitempty"` + // Human-readable name of a function or method. + // The value can include optional context like the class or package name. + // For example, `my.package.MyClass.method` in case of Java. + FunctionName string `protobuf:"bytes,4,opt,name=function_name,json=functionName" json:"function_name,omitempty"` +} + +func (m *SourceLocation) Reset() { *m = SourceLocation{} } +func (m *SourceLocation) String() string { return proto.CompactTextString(m) } +func (*SourceLocation) ProtoMessage() {} +func (*SourceLocation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *SourceLocation) GetFilePath() string { + if m != nil { + return m.FilePath + } + return "" +} + +func (m *SourceLocation) GetLineNumber() int32 { + if m != nil { + return m.LineNumber + } + return 0 +} + +func (m *SourceLocation) GetFunctionName() string { + if m != nil { + return m.FunctionName + } + return "" +} + +func init() { + proto.RegisterType((*ErrorGroup)(nil), "google.devtools.clouderrorreporting.v1beta1.ErrorGroup") + proto.RegisterType((*TrackingIssue)(nil), "google.devtools.clouderrorreporting.v1beta1.TrackingIssue") + proto.RegisterType((*ErrorEvent)(nil), "google.devtools.clouderrorreporting.v1beta1.ErrorEvent") + proto.RegisterType((*ServiceContext)(nil), "google.devtools.clouderrorreporting.v1beta1.ServiceContext") + proto.RegisterType((*ErrorContext)(nil), "google.devtools.clouderrorreporting.v1beta1.ErrorContext") + proto.RegisterType((*HttpRequestContext)(nil), "google.devtools.clouderrorreporting.v1beta1.HttpRequestContext") + proto.RegisterType((*SourceLocation)(nil), "google.devtools.clouderrorreporting.v1beta1.SourceLocation") +} + +func init() { + proto.RegisterFile("google/devtools/clouderrorreporting/v1beta1/common.proto", fileDescriptor0) +} + +var fileDescriptor0 = []byte{ + // 705 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xcd, 0x6e, 0x13, 0x31, + 0x10, 0x56, 0x92, 0xfe, 0xc5, 0x69, 0x53, 0x64, 0x21, 0x14, 0x02, 0xa8, 0x25, 0xbd, 0x54, 0x42, + 0xda, 0xa5, 0xe5, 0x42, 0xe9, 0x01, 0xd1, 0xa8, 0x2a, 0x95, 0x50, 0x55, 0x6d, 0xaa, 0x1e, 0x50, + 0x85, 0xe5, 0xec, 0x4e, 0x36, 0x16, 0xbb, 0xb6, 0xb1, 0xbd, 0x11, 0x7d, 0x17, 0x0e, 0x9c, 0x79, + 0x12, 0xc4, 0xb3, 0xf4, 0x21, 0x90, 0xbd, 0x76, 0x69, 0xd4, 0x1e, 0xc8, 0xcd, 0x33, 0xf3, 0xcd, + 0x37, 0xf3, 0x8d, 0xc7, 0x46, 0x6f, 0x73, 0x21, 0xf2, 0x02, 0xe2, 0x0c, 0x66, 0x46, 0x88, 0x42, + 0xc7, 0x69, 0x21, 0xaa, 0x0c, 0x94, 0x12, 0x4a, 0x81, 0x14, 0xca, 0x30, 0x9e, 0xc7, 0xb3, 0xbd, + 0x31, 0x18, 0xba, 0x17, 0xa7, 0xa2, 0x2c, 0x05, 0x8f, 0xa4, 0x12, 0x46, 0xe0, 0x57, 0x75, 0x66, + 0x14, 0x32, 0xa3, 0x07, 0x32, 0x23, 0x9f, 0xd9, 0x7f, 0xee, 0xcb, 0x50, 0xc9, 0x62, 0xca, 0xb9, + 0x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x00, 0x00, 0x00, 0xff, 0xff, 0x24, 0x65, 0x84, 0x33, 0x41, 0x06, 0x00, + 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/devtools/clouderrorreporting/v1beta1/error_group_service.pb.go b/vendor/google.golang.org/genproto/googleapis/devtools/clouderrorreporting/v1beta1/error_group_service.pb.go new file mode 100644 index 0000000000..3ac9e4d7ed --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/devtools/clouderrorreporting/v1beta1/error_group_service.pb.go @@ -0,0 +1,211 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/devtools/clouderrorreporting/v1beta1/error_group_service.proto + +package clouderrorreporting + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// A request to return an individual group. +type GetGroupRequest struct { + // [Required] The group resource name. Written as + // projects/projectID/groups/group_name. + // Call + // + // groupStats.list to return a list of groups belonging to + // this project. + // + // Example: projects/my-project-123/groups/my-group + GroupName string `protobuf:"bytes,1,opt,name=group_name,json=groupName" json:"group_name,omitempty"` +} + +func (m *GetGroupRequest) Reset() { *m = GetGroupRequest{} } +func (m *GetGroupRequest) String() string { return proto.CompactTextString(m) } +func (*GetGroupRequest) ProtoMessage() {} +func (*GetGroupRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +func (m *GetGroupRequest) GetGroupName() string { + if m != nil { + return m.GroupName + } + return "" +} + +// A request to replace the existing data for the given group. +type UpdateGroupRequest struct { + // [Required] The group which replaces the resource on the server. + Group *ErrorGroup `protobuf:"bytes,1,opt,name=group" json:"group,omitempty"` +} + +func (m *UpdateGroupRequest) Reset() { *m = UpdateGroupRequest{} } +func (m *UpdateGroupRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateGroupRequest) ProtoMessage() {} +func (*UpdateGroupRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} } + +func (m *UpdateGroupRequest) GetGroup() *ErrorGroup { + if m != nil { + return m.Group + } + return nil +} + +func init() { + proto.RegisterType((*GetGroupRequest)(nil), "google.devtools.clouderrorreporting.v1beta1.GetGroupRequest") + proto.RegisterType((*UpdateGroupRequest)(nil), "google.devtools.clouderrorreporting.v1beta1.UpdateGroupRequest") +} + +// 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 + +// Client API for ErrorGroupService service + +type ErrorGroupServiceClient interface { + // Get the specified group. + GetGroup(ctx context.Context, in *GetGroupRequest, opts ...grpc.CallOption) (*ErrorGroup, error) + // Replace the data for the specified group. + // Fails if the group does not exist. + UpdateGroup(ctx context.Context, in *UpdateGroupRequest, opts ...grpc.CallOption) (*ErrorGroup, error) +} + +type errorGroupServiceClient struct { + cc *grpc.ClientConn +} + +func NewErrorGroupServiceClient(cc *grpc.ClientConn) ErrorGroupServiceClient { + return &errorGroupServiceClient{cc} +} + +func (c *errorGroupServiceClient) GetGroup(ctx context.Context, in *GetGroupRequest, opts ...grpc.CallOption) (*ErrorGroup, error) { + out := new(ErrorGroup) + err := grpc.Invoke(ctx, "/google.devtools.clouderrorreporting.v1beta1.ErrorGroupService/GetGroup", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *errorGroupServiceClient) UpdateGroup(ctx context.Context, in *UpdateGroupRequest, opts ...grpc.CallOption) (*ErrorGroup, error) { + out := new(ErrorGroup) + err := grpc.Invoke(ctx, "/google.devtools.clouderrorreporting.v1beta1.ErrorGroupService/UpdateGroup", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for ErrorGroupService service + +type ErrorGroupServiceServer interface { + // Get the specified group. + GetGroup(context.Context, *GetGroupRequest) (*ErrorGroup, error) + // Replace the data for the specified group. + // Fails if the group does not exist. + UpdateGroup(context.Context, *UpdateGroupRequest) (*ErrorGroup, error) +} + +func RegisterErrorGroupServiceServer(s *grpc.Server, srv ErrorGroupServiceServer) { + s.RegisterService(&_ErrorGroupService_serviceDesc, srv) +} + +func _ErrorGroupService_GetGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetGroupRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ErrorGroupServiceServer).GetGroup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.clouderrorreporting.v1beta1.ErrorGroupService/GetGroup", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ErrorGroupServiceServer).GetGroup(ctx, req.(*GetGroupRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ErrorGroupService_UpdateGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateGroupRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ErrorGroupServiceServer).UpdateGroup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.clouderrorreporting.v1beta1.ErrorGroupService/UpdateGroup", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ErrorGroupServiceServer).UpdateGroup(ctx, req.(*UpdateGroupRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _ErrorGroupService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.devtools.clouderrorreporting.v1beta1.ErrorGroupService", + HandlerType: (*ErrorGroupServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetGroup", + Handler: _ErrorGroupService_GetGroup_Handler, + }, + { + MethodName: "UpdateGroup", + Handler: _ErrorGroupService_UpdateGroup_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/devtools/clouderrorreporting/v1beta1/error_group_service.proto", +} + +func init() { + proto.RegisterFile("google/devtools/clouderrorreporting/v1beta1/error_group_service.proto", fileDescriptor1) +} + +var fileDescriptor1 = []byte{ + // 398 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0xcb, 0x4a, 0x23, 0x41, + 0x14, 0x86, 0xe9, 0x0c, 0x33, 0x4c, 0x2a, 0x8b, 0x61, 0x6a, 0x31, 0x0c, 0xcd, 0x0c, 0x48, 0xdc, + 0x68, 0x02, 0x55, 0x76, 0x5c, 0x18, 0xbc, 0x20, 0x44, 0x42, 0x56, 0x4a, 0x88, 0x98, 0x85, 0x04, + 0x43, 0xa5, 0x53, 0x14, 0x2d, 0xdd, 0x75, 0xda, 0xea, 0x4a, 0x36, 0xe2, 0xc6, 0x07, 0x70, 0xe3, + 0x5b, 0xb8, 0xf6, 0x05, 0xdc, 0xba, 0xf5, 0x15, 0x7c, 0x07, 0xb7, 0xd2, 0x55, 0xb9, 0x98, 0x8b, + 0x60, 0x67, 0x7b, 0x2e, 0xff, 0xff, 0xd5, 0x5f, 0x07, 0xd5, 0x05, 0x80, 0x08, 0x39, 0xed, 0xf3, + 0xa1, 0x06, 0x08, 0x13, 0xea, 0x87, 0x30, 0xe8, 0x73, 0xa5, 0x40, 0x29, 0x1e, 0x83, 0xd2, 0x81, + 0x14, 0x74, 0xe8, 0xf5, 0xb8, 0x66, 0x1e, 0x35, 0xe5, 0xae, 0x50, 0x30, 0x88, 0xbb, 0x09, 0x57, + 0xc3, 0xc0, 0xe7, 0x24, 0x56, 0xa0, 0x01, 0x97, 0xad, 0x0c, 0x19, 0xcb, 0x90, 0x25, 0x32, 0x64, + 0x24, 0xe3, 0xfe, 0x1b, 0x79, 0xb2, 0x38, 0xa0, 0x4c, 0x4a, 0xd0, 0x4c, 0x07, 0x20, 0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, 0x49, 0x6d, 0x8b, 0xc5, 0x41, 0xf2, 0xa5, 0x73, 0xde, 0x5b, 0xd2, 0x7b, + 0xc8, 0xad, 0x37, 0xac, 0xc1, 0x51, 0xda, 0xb4, 0x09, 0xb4, 0x26, 0x7c, 0x6d, 0xaf, 0x96, 0x6e, + 0x3e, 0x8f, 0xa7, 0x3a, 0x66, 0xaa, 0x33, 0x3b, 0xd5, 0x69, 0x5b, 0xfd, 0xde, 0x0f, 0x83, 0xb5, + 0xfd, 0x1e, 0x00, 0x00, 0xff, 0xff, 0xc2, 0x0a, 0xfa, 0x93, 0xf6, 0x03, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/devtools/clouderrorreporting/v1beta1/error_stats_service.pb.go b/vendor/google.golang.org/genproto/googleapis/devtools/clouderrorreporting/v1beta1/error_stats_service.pb.go new file mode 100644 index 0000000000..f1b2544dd3 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/devtools/clouderrorreporting/v1beta1/error_stats_service.pb.go @@ -0,0 +1,910 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/devtools/clouderrorreporting/v1beta1/error_stats_service.proto + +package clouderrorreporting + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf2 "github.com/golang/protobuf/ptypes/duration" +import google_protobuf1 "github.com/golang/protobuf/ptypes/timestamp" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Specifies how the time periods of error group counts are aligned. +type TimedCountAlignment int32 + +const ( + // No alignment specified. + TimedCountAlignment_ERROR_COUNT_ALIGNMENT_UNSPECIFIED TimedCountAlignment = 0 + // The time periods shall be consecutive, have width equal to the + // requested duration, and be aligned at the `alignment_time` provided in + // the request. + // The `alignment_time` does not have to be inside the query period but + // even if it is outside, only time periods are returned which overlap + // with the query period. + // A rounded alignment will typically result in a + // different size of the first or the last time period. + TimedCountAlignment_ALIGNMENT_EQUAL_ROUNDED TimedCountAlignment = 1 + // The time periods shall be consecutive, have width equal to the + // requested duration, and be aligned at the end of the requested time + // period. This can result in a different size of the + // first time period. + TimedCountAlignment_ALIGNMENT_EQUAL_AT_END TimedCountAlignment = 2 +) + +var TimedCountAlignment_name = map[int32]string{ + 0: "ERROR_COUNT_ALIGNMENT_UNSPECIFIED", + 1: "ALIGNMENT_EQUAL_ROUNDED", + 2: "ALIGNMENT_EQUAL_AT_END", +} +var TimedCountAlignment_value = map[string]int32{ + "ERROR_COUNT_ALIGNMENT_UNSPECIFIED": 0, + "ALIGNMENT_EQUAL_ROUNDED": 1, + "ALIGNMENT_EQUAL_AT_END": 2, +} + +func (x TimedCountAlignment) String() string { + return proto.EnumName(TimedCountAlignment_name, int32(x)) +} +func (TimedCountAlignment) EnumDescriptor() ([]byte, []int) { return fileDescriptor2, []int{0} } + +// A sorting order of error groups. +type ErrorGroupOrder int32 + +const ( + // No group order specified. + ErrorGroupOrder_GROUP_ORDER_UNSPECIFIED ErrorGroupOrder = 0 + // Total count of errors in the given time window in descending order. + ErrorGroupOrder_COUNT_DESC ErrorGroupOrder = 1 + // Timestamp when the group was last seen in the given time window + // in descending order. + ErrorGroupOrder_LAST_SEEN_DESC ErrorGroupOrder = 2 + // Timestamp when the group was created in descending order. + ErrorGroupOrder_CREATED_DESC ErrorGroupOrder = 3 + // Number of affected users in the given time window in descending order. + ErrorGroupOrder_AFFECTED_USERS_DESC ErrorGroupOrder = 4 +) + +var ErrorGroupOrder_name = map[int32]string{ + 0: "GROUP_ORDER_UNSPECIFIED", + 1: "COUNT_DESC", + 2: "LAST_SEEN_DESC", + 3: "CREATED_DESC", + 4: "AFFECTED_USERS_DESC", +} +var ErrorGroupOrder_value = map[string]int32{ + "GROUP_ORDER_UNSPECIFIED": 0, + "COUNT_DESC": 1, + "LAST_SEEN_DESC": 2, + "CREATED_DESC": 3, + "AFFECTED_USERS_DESC": 4, +} + +func (x ErrorGroupOrder) String() string { + return proto.EnumName(ErrorGroupOrder_name, int32(x)) +} +func (ErrorGroupOrder) EnumDescriptor() ([]byte, []int) { return fileDescriptor2, []int{1} } + +// The supported time ranges. +type QueryTimeRange_Period int32 + +const ( + // Do not use. + QueryTimeRange_PERIOD_UNSPECIFIED QueryTimeRange_Period = 0 + // Retrieve data for the last hour. + // Recommended minimum timed count duration: 1 min. + QueryTimeRange_PERIOD_1_HOUR QueryTimeRange_Period = 1 + // Retrieve data for the last 6 hours. + // Recommended minimum timed count duration: 10 min. + QueryTimeRange_PERIOD_6_HOURS QueryTimeRange_Period = 2 + // Retrieve data for the last day. + // Recommended minimum timed count duration: 1 hour. + QueryTimeRange_PERIOD_1_DAY QueryTimeRange_Period = 3 + // Retrieve data for the last week. + // Recommended minimum timed count duration: 6 hours. + QueryTimeRange_PERIOD_1_WEEK QueryTimeRange_Period = 4 + // Retrieve data for the last 30 days. + // Recommended minimum timed count duration: 1 day. + QueryTimeRange_PERIOD_30_DAYS QueryTimeRange_Period = 5 +) + +var QueryTimeRange_Period_name = map[int32]string{ + 0: "PERIOD_UNSPECIFIED", + 1: "PERIOD_1_HOUR", + 2: "PERIOD_6_HOURS", + 3: "PERIOD_1_DAY", + 4: "PERIOD_1_WEEK", + 5: "PERIOD_30_DAYS", +} +var QueryTimeRange_Period_value = map[string]int32{ + "PERIOD_UNSPECIFIED": 0, + "PERIOD_1_HOUR": 1, + "PERIOD_6_HOURS": 2, + "PERIOD_1_DAY": 3, + "PERIOD_1_WEEK": 4, + "PERIOD_30_DAYS": 5, +} + +func (x QueryTimeRange_Period) String() string { + return proto.EnumName(QueryTimeRange_Period_name, int32(x)) +} +func (QueryTimeRange_Period) EnumDescriptor() ([]byte, []int) { return fileDescriptor2, []int{6, 0} } + +// Specifies a set of `ErrorGroupStats` to return. +type ListGroupStatsRequest struct { + // [Required] The resource name of the Google Cloud Platform project. Written + // as projects/ plus the + // Google Cloud + // Platform project ID. + // + // Example: projects/my-project-123. + ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName" json:"project_name,omitempty"` + // [Optional] List all ErrorGroupStats with these IDs. + GroupId []string `protobuf:"bytes,2,rep,name=group_id,json=groupId" json:"group_id,omitempty"` + // [Optional] List only ErrorGroupStats which belong to a service + // context that matches the filter. + // Data for all service contexts is returned if this field is not specified. + ServiceFilter *ServiceContextFilter `protobuf:"bytes,3,opt,name=service_filter,json=serviceFilter" json:"service_filter,omitempty"` + // [Optional] List data for the given time range. + // If not set a default time range is used. The field time_range_begin + // in the response will specify the beginning of this time range. + // Only ErrorGroupStats with a non-zero count in the given time + // range are returned, unless the request contains an explicit group_id list. + // If a group_id list is given, also ErrorGroupStats with zero + // occurrences are returned. + TimeRange *QueryTimeRange `protobuf:"bytes,5,opt,name=time_range,json=timeRange" json:"time_range,omitempty"` + // [Optional] The preferred duration for a single returned `TimedCount`. + // If not set, no timed counts are returned. + TimedCountDuration *google_protobuf2.Duration `protobuf:"bytes,6,opt,name=timed_count_duration,json=timedCountDuration" json:"timed_count_duration,omitempty"` + // [Optional] The alignment of the timed counts to be returned. + // Default is `ALIGNMENT_EQUAL_AT_END`. + Alignment TimedCountAlignment `protobuf:"varint,7,opt,name=alignment,enum=google.devtools.clouderrorreporting.v1beta1.TimedCountAlignment" json:"alignment,omitempty"` + // [Optional] Time where the timed counts shall be aligned if rounded + // alignment is chosen. Default is 00:00 UTC. + AlignmentTime *google_protobuf1.Timestamp `protobuf:"bytes,8,opt,name=alignment_time,json=alignmentTime" json:"alignment_time,omitempty"` + // [Optional] The sort order in which the results are returned. + // Default is `COUNT_DESC`. + Order ErrorGroupOrder `protobuf:"varint,9,opt,name=order,enum=google.devtools.clouderrorreporting.v1beta1.ErrorGroupOrder" json:"order,omitempty"` + // [Optional] The maximum number of results to return per response. + // Default is 20. + PageSize int32 `protobuf:"varint,11,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // [Optional] A `next_page_token` provided by a previous response. To view + // additional results, pass this token along with the identical query + // parameters as the first request. + PageToken string `protobuf:"bytes,12,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListGroupStatsRequest) Reset() { *m = ListGroupStatsRequest{} } +func (m *ListGroupStatsRequest) String() string { return proto.CompactTextString(m) } +func (*ListGroupStatsRequest) ProtoMessage() {} +func (*ListGroupStatsRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} } + +func (m *ListGroupStatsRequest) GetProjectName() string { + if m != nil { + return m.ProjectName + } + return "" +} + +func (m *ListGroupStatsRequest) GetGroupId() []string { + if m != nil { + return m.GroupId + } + return nil +} + +func (m *ListGroupStatsRequest) GetServiceFilter() *ServiceContextFilter { + if m != nil { + return m.ServiceFilter + } + return nil +} + +func (m *ListGroupStatsRequest) GetTimeRange() *QueryTimeRange { + if m != nil { + return m.TimeRange + } + return nil +} + +func (m *ListGroupStatsRequest) GetTimedCountDuration() *google_protobuf2.Duration { + if m != nil { + return m.TimedCountDuration + } + return nil +} + +func (m *ListGroupStatsRequest) GetAlignment() TimedCountAlignment { + if m != nil { + return m.Alignment + } + return TimedCountAlignment_ERROR_COUNT_ALIGNMENT_UNSPECIFIED +} + +func (m *ListGroupStatsRequest) GetAlignmentTime() *google_protobuf1.Timestamp { + if m != nil { + return m.AlignmentTime + } + return nil +} + +func (m *ListGroupStatsRequest) GetOrder() ErrorGroupOrder { + if m != nil { + return m.Order + } + return ErrorGroupOrder_GROUP_ORDER_UNSPECIFIED +} + +func (m *ListGroupStatsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListGroupStatsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// Contains a set of requested error group stats. +type ListGroupStatsResponse struct { + // The error group stats which match the given request. + ErrorGroupStats []*ErrorGroupStats `protobuf:"bytes,1,rep,name=error_group_stats,json=errorGroupStats" json:"error_group_stats,omitempty"` + // If non-empty, more results are available. + // Pass this token, along with the same query parameters as the first + // request, to view the next page of results. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` + // The timestamp specifies the start time to which the request was restricted. + // The start time is set based on the requested time range. It may be adjusted + // to a later time if a project has exceeded the storage quota and older data + // has been deleted. + TimeRangeBegin *google_protobuf1.Timestamp `protobuf:"bytes,4,opt,name=time_range_begin,json=timeRangeBegin" json:"time_range_begin,omitempty"` +} + +func (m *ListGroupStatsResponse) Reset() { *m = ListGroupStatsResponse{} } +func (m *ListGroupStatsResponse) String() string { return proto.CompactTextString(m) } +func (*ListGroupStatsResponse) ProtoMessage() {} +func (*ListGroupStatsResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{1} } + +func (m *ListGroupStatsResponse) GetErrorGroupStats() []*ErrorGroupStats { + if m != nil { + return m.ErrorGroupStats + } + return nil +} + +func (m *ListGroupStatsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +func (m *ListGroupStatsResponse) GetTimeRangeBegin() *google_protobuf1.Timestamp { + if m != nil { + return m.TimeRangeBegin + } + return nil +} + +// Data extracted for a specific group based on certain filter criteria, +// such as a given time period and/or service filter. +type ErrorGroupStats struct { + // Group data that is independent of the filter criteria. + Group *ErrorGroup `protobuf:"bytes,1,opt,name=group" json:"group,omitempty"` + // Approximate total number of events in the given group that match + // the filter criteria. + Count int64 `protobuf:"varint,2,opt,name=count" json:"count,omitempty"` + // Approximate number of affected users in the given group that + // match the filter criteria. + // Users are distinguished by data in the `ErrorContext` of the + // individual error events, such as their login name or their remote + // IP address in case of HTTP requests. + // The number of affected users can be zero even if the number of + // errors is non-zero if no data was provided from which the + // affected user could be deduced. + // Users are counted based on data in the request + // context that was provided in the error report. If more users are + // implicitly affected, such as due to a crash of the whole service, + // this is not reflected here. + AffectedUsersCount int64 `protobuf:"varint,3,opt,name=affected_users_count,json=affectedUsersCount" json:"affected_users_count,omitempty"` + // Approximate number of occurrences over time. + // Timed counts returned by ListGroups are guaranteed to be: + // + // - Inside the requested time interval + // - Non-overlapping, and + // - Ordered by ascending time. + TimedCounts []*TimedCount `protobuf:"bytes,4,rep,name=timed_counts,json=timedCounts" json:"timed_counts,omitempty"` + // Approximate first occurrence that was ever seen for this group + // and which matches the given filter criteria, ignoring the + // time_range that was specified in the request. + FirstSeenTime *google_protobuf1.Timestamp `protobuf:"bytes,5,opt,name=first_seen_time,json=firstSeenTime" json:"first_seen_time,omitempty"` + // Approximate last occurrence that was ever seen for this group and + // which matches the given filter criteria, ignoring the time_range + // that was specified in the request. + LastSeenTime *google_protobuf1.Timestamp `protobuf:"bytes,6,opt,name=last_seen_time,json=lastSeenTime" json:"last_seen_time,omitempty"` + // Service contexts with a non-zero error count for the given filter + // criteria. This list can be truncated if multiple services are affected. + // Refer to `num_affected_services` for the total count. + AffectedServices []*ServiceContext `protobuf:"bytes,7,rep,name=affected_services,json=affectedServices" json:"affected_services,omitempty"` + // The total number of services with a non-zero error count for the given + // filter criteria. + NumAffectedServices int32 `protobuf:"varint,8,opt,name=num_affected_services,json=numAffectedServices" json:"num_affected_services,omitempty"` + // An arbitrary event that is chosen as representative for the whole group. + // The representative event is intended to be used as a quick preview for + // the whole group. Events in the group are usually sufficiently similar + // to each other such that showing an arbitrary representative provides + // insight into the characteristics of the group as a whole. + Representative *ErrorEvent `protobuf:"bytes,9,opt,name=representative" json:"representative,omitempty"` +} + +func (m *ErrorGroupStats) Reset() { *m = ErrorGroupStats{} } +func (m *ErrorGroupStats) String() string { return proto.CompactTextString(m) } +func (*ErrorGroupStats) ProtoMessage() {} +func (*ErrorGroupStats) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{2} } + +func (m *ErrorGroupStats) GetGroup() *ErrorGroup { + if m != nil { + return m.Group + } + return nil +} + +func (m *ErrorGroupStats) GetCount() int64 { + if m != nil { + return m.Count + } + return 0 +} + +func (m *ErrorGroupStats) GetAffectedUsersCount() int64 { + if m != nil { + return m.AffectedUsersCount + } + return 0 +} + +func (m *ErrorGroupStats) GetTimedCounts() []*TimedCount { + if m != nil { + return m.TimedCounts + } + return nil +} + +func (m *ErrorGroupStats) GetFirstSeenTime() *google_protobuf1.Timestamp { + if m != nil { + return m.FirstSeenTime + } + return nil +} + +func (m *ErrorGroupStats) GetLastSeenTime() *google_protobuf1.Timestamp { + if m != nil { + return m.LastSeenTime + } + return nil +} + +func (m *ErrorGroupStats) GetAffectedServices() []*ServiceContext { + if m != nil { + return m.AffectedServices + } + return nil +} + +func (m *ErrorGroupStats) GetNumAffectedServices() int32 { + if m != nil { + return m.NumAffectedServices + } + return 0 +} + +func (m *ErrorGroupStats) GetRepresentative() *ErrorEvent { + if m != nil { + return m.Representative + } + return nil +} + +// The number of errors in a given time period. +// All numbers are approximate since the error events are sampled +// before counting them. +type TimedCount struct { + // Approximate number of occurrences in the given time period. + Count int64 `protobuf:"varint,1,opt,name=count" json:"count,omitempty"` + // Start of the time period to which `count` refers (included). + StartTime *google_protobuf1.Timestamp `protobuf:"bytes,2,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + // End of the time period to which `count` refers (excluded). + EndTime *google_protobuf1.Timestamp `protobuf:"bytes,3,opt,name=end_time,json=endTime" json:"end_time,omitempty"` +} + +func (m *TimedCount) Reset() { *m = TimedCount{} } +func (m *TimedCount) String() string { return proto.CompactTextString(m) } +func (*TimedCount) ProtoMessage() {} +func (*TimedCount) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{3} } + +func (m *TimedCount) GetCount() int64 { + if m != nil { + return m.Count + } + return 0 +} + +func (m *TimedCount) GetStartTime() *google_protobuf1.Timestamp { + if m != nil { + return m.StartTime + } + return nil +} + +func (m *TimedCount) GetEndTime() *google_protobuf1.Timestamp { + if m != nil { + return m.EndTime + } + return nil +} + +// Specifies a set of error events to return. +type ListEventsRequest struct { + // [Required] The resource name of the Google Cloud Platform project. Written + // as `projects/` plus the + // [Google Cloud Platform project + // ID](https://support.google.com/cloud/answer/6158840). + // Example: `projects/my-project-123`. + ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName" json:"project_name,omitempty"` + // [Required] The group for which events shall be returned. + GroupId string `protobuf:"bytes,2,opt,name=group_id,json=groupId" json:"group_id,omitempty"` + // [Optional] List only ErrorGroups which belong to a service context that + // matches the filter. + // Data for all service contexts is returned if this field is not specified. + ServiceFilter *ServiceContextFilter `protobuf:"bytes,3,opt,name=service_filter,json=serviceFilter" json:"service_filter,omitempty"` + // [Optional] List only data for the given time range. + // If not set a default time range is used. The field time_range_begin + // in the response will specify the beginning of this time range. + TimeRange *QueryTimeRange `protobuf:"bytes,4,opt,name=time_range,json=timeRange" json:"time_range,omitempty"` + // [Optional] The maximum number of results to return per response. + PageSize int32 `protobuf:"varint,6,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // [Optional] A `next_page_token` provided by a previous response. + PageToken string `protobuf:"bytes,7,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListEventsRequest) Reset() { *m = ListEventsRequest{} } +func (m *ListEventsRequest) String() string { return proto.CompactTextString(m) } +func (*ListEventsRequest) ProtoMessage() {} +func (*ListEventsRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{4} } + +func (m *ListEventsRequest) GetProjectName() string { + if m != nil { + return m.ProjectName + } + return "" +} + +func (m *ListEventsRequest) GetGroupId() string { + if m != nil { + return m.GroupId + } + return "" +} + +func (m *ListEventsRequest) GetServiceFilter() *ServiceContextFilter { + if m != nil { + return m.ServiceFilter + } + return nil +} + +func (m *ListEventsRequest) GetTimeRange() *QueryTimeRange { + if m != nil { + return m.TimeRange + } + return nil +} + +func (m *ListEventsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListEventsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// Contains a set of requested error events. +type ListEventsResponse struct { + // The error events which match the given request. + ErrorEvents []*ErrorEvent `protobuf:"bytes,1,rep,name=error_events,json=errorEvents" json:"error_events,omitempty"` + // If non-empty, more results are available. + // Pass this token, along with the same query parameters as the first + // request, to view the next page of results. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` + // The timestamp specifies the start time to which the request was restricted. + TimeRangeBegin *google_protobuf1.Timestamp `protobuf:"bytes,4,opt,name=time_range_begin,json=timeRangeBegin" json:"time_range_begin,omitempty"` +} + +func (m *ListEventsResponse) Reset() { *m = ListEventsResponse{} } +func (m *ListEventsResponse) String() string { return proto.CompactTextString(m) } +func (*ListEventsResponse) ProtoMessage() {} +func (*ListEventsResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{5} } + +func (m *ListEventsResponse) GetErrorEvents() []*ErrorEvent { + if m != nil { + return m.ErrorEvents + } + return nil +} + +func (m *ListEventsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +func (m *ListEventsResponse) GetTimeRangeBegin() *google_protobuf1.Timestamp { + if m != nil { + return m.TimeRangeBegin + } + return nil +} + +// Requests might be rejected or the resulting timed count durations might be +// adjusted for lower durations. +type QueryTimeRange struct { + // Restricts the query to the specified time range. + Period QueryTimeRange_Period `protobuf:"varint,1,opt,name=period,enum=google.devtools.clouderrorreporting.v1beta1.QueryTimeRange_Period" json:"period,omitempty"` +} + +func (m *QueryTimeRange) Reset() { *m = QueryTimeRange{} } +func (m *QueryTimeRange) String() string { return proto.CompactTextString(m) } +func (*QueryTimeRange) ProtoMessage() {} +func (*QueryTimeRange) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{6} } + +func (m *QueryTimeRange) GetPeriod() QueryTimeRange_Period { + if m != nil { + return m.Period + } + return QueryTimeRange_PERIOD_UNSPECIFIED +} + +// Specifies criteria for filtering a subset of service contexts. +// The fields in the filter correspond to the fields in `ServiceContext`. +// Only exact, case-sensitive matches are supported. +// If a field is unset or empty, it matches arbitrary values. +type ServiceContextFilter struct { + // [Optional] The exact value to match against + // [`ServiceContext.service`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.service). + Service string `protobuf:"bytes,2,opt,name=service" json:"service,omitempty"` + // [Optional] The exact value to match against + // [`ServiceContext.version`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.version). + Version string `protobuf:"bytes,3,opt,name=version" json:"version,omitempty"` + // [Optional] The exact value to match against + // [`ServiceContext.resource_type`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.resource_type). + ResourceType string `protobuf:"bytes,4,opt,name=resource_type,json=resourceType" json:"resource_type,omitempty"` +} + +func (m *ServiceContextFilter) Reset() { *m = ServiceContextFilter{} } +func (m *ServiceContextFilter) String() string { return proto.CompactTextString(m) } +func (*ServiceContextFilter) ProtoMessage() {} +func (*ServiceContextFilter) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{7} } + +func (m *ServiceContextFilter) GetService() string { + if m != nil { + return m.Service + } + return "" +} + +func (m *ServiceContextFilter) GetVersion() string { + if m != nil { + return m.Version + } + return "" +} + +func (m *ServiceContextFilter) GetResourceType() string { + if m != nil { + return m.ResourceType + } + return "" +} + +// Deletes all events in the project. +type DeleteEventsRequest struct { + // [Required] The resource name of the Google Cloud Platform project. Written + // as `projects/` plus the + // [Google Cloud Platform project + // ID](https://support.google.com/cloud/answer/6158840). + // Example: `projects/my-project-123`. + ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName" json:"project_name,omitempty"` +} + +func (m *DeleteEventsRequest) Reset() { *m = DeleteEventsRequest{} } +func (m *DeleteEventsRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteEventsRequest) ProtoMessage() {} +func (*DeleteEventsRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{8} } + +func (m *DeleteEventsRequest) GetProjectName() string { + if m != nil { + return m.ProjectName + } + return "" +} + +// Response message for deleting error events. +type DeleteEventsResponse struct { +} + +func (m *DeleteEventsResponse) Reset() { *m = DeleteEventsResponse{} } +func (m *DeleteEventsResponse) String() string { return proto.CompactTextString(m) } +func (*DeleteEventsResponse) ProtoMessage() {} +func (*DeleteEventsResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{9} } + +func init() { + proto.RegisterType((*ListGroupStatsRequest)(nil), "google.devtools.clouderrorreporting.v1beta1.ListGroupStatsRequest") + proto.RegisterType((*ListGroupStatsResponse)(nil), "google.devtools.clouderrorreporting.v1beta1.ListGroupStatsResponse") + proto.RegisterType((*ErrorGroupStats)(nil), "google.devtools.clouderrorreporting.v1beta1.ErrorGroupStats") + proto.RegisterType((*TimedCount)(nil), "google.devtools.clouderrorreporting.v1beta1.TimedCount") + proto.RegisterType((*ListEventsRequest)(nil), "google.devtools.clouderrorreporting.v1beta1.ListEventsRequest") + proto.RegisterType((*ListEventsResponse)(nil), "google.devtools.clouderrorreporting.v1beta1.ListEventsResponse") + proto.RegisterType((*QueryTimeRange)(nil), "google.devtools.clouderrorreporting.v1beta1.QueryTimeRange") + proto.RegisterType((*ServiceContextFilter)(nil), "google.devtools.clouderrorreporting.v1beta1.ServiceContextFilter") + proto.RegisterType((*DeleteEventsRequest)(nil), "google.devtools.clouderrorreporting.v1beta1.DeleteEventsRequest") + proto.RegisterType((*DeleteEventsResponse)(nil), "google.devtools.clouderrorreporting.v1beta1.DeleteEventsResponse") + proto.RegisterEnum("google.devtools.clouderrorreporting.v1beta1.TimedCountAlignment", TimedCountAlignment_name, TimedCountAlignment_value) + proto.RegisterEnum("google.devtools.clouderrorreporting.v1beta1.ErrorGroupOrder", ErrorGroupOrder_name, ErrorGroupOrder_value) + proto.RegisterEnum("google.devtools.clouderrorreporting.v1beta1.QueryTimeRange_Period", QueryTimeRange_Period_name, QueryTimeRange_Period_value) +} + +// 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 + +// Client API for ErrorStatsService service + +type ErrorStatsServiceClient interface { + // Lists the specified groups. + ListGroupStats(ctx context.Context, in *ListGroupStatsRequest, opts ...grpc.CallOption) (*ListGroupStatsResponse, error) + // Lists the specified events. + ListEvents(ctx context.Context, in *ListEventsRequest, opts ...grpc.CallOption) (*ListEventsResponse, error) + // Deletes all error events of a given project. + DeleteEvents(ctx context.Context, in *DeleteEventsRequest, opts ...grpc.CallOption) (*DeleteEventsResponse, error) +} + +type errorStatsServiceClient struct { + cc *grpc.ClientConn +} + +func NewErrorStatsServiceClient(cc *grpc.ClientConn) ErrorStatsServiceClient { + return &errorStatsServiceClient{cc} +} + +func (c *errorStatsServiceClient) ListGroupStats(ctx context.Context, in *ListGroupStatsRequest, opts ...grpc.CallOption) (*ListGroupStatsResponse, error) { + out := new(ListGroupStatsResponse) + err := grpc.Invoke(ctx, "/google.devtools.clouderrorreporting.v1beta1.ErrorStatsService/ListGroupStats", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *errorStatsServiceClient) ListEvents(ctx context.Context, in *ListEventsRequest, opts ...grpc.CallOption) (*ListEventsResponse, error) { + out := new(ListEventsResponse) + err := grpc.Invoke(ctx, "/google.devtools.clouderrorreporting.v1beta1.ErrorStatsService/ListEvents", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *errorStatsServiceClient) DeleteEvents(ctx context.Context, in *DeleteEventsRequest, opts ...grpc.CallOption) (*DeleteEventsResponse, error) { + out := new(DeleteEventsResponse) + err := grpc.Invoke(ctx, "/google.devtools.clouderrorreporting.v1beta1.ErrorStatsService/DeleteEvents", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for ErrorStatsService service + +type ErrorStatsServiceServer interface { + // Lists the specified groups. + ListGroupStats(context.Context, *ListGroupStatsRequest) (*ListGroupStatsResponse, error) + // Lists the specified events. + ListEvents(context.Context, *ListEventsRequest) (*ListEventsResponse, error) + // Deletes all error events of a given project. + DeleteEvents(context.Context, *DeleteEventsRequest) (*DeleteEventsResponse, error) +} + +func RegisterErrorStatsServiceServer(s *grpc.Server, srv ErrorStatsServiceServer) { + s.RegisterService(&_ErrorStatsService_serviceDesc, srv) +} + +func _ErrorStatsService_ListGroupStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListGroupStatsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ErrorStatsServiceServer).ListGroupStats(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.clouderrorreporting.v1beta1.ErrorStatsService/ListGroupStats", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ErrorStatsServiceServer).ListGroupStats(ctx, req.(*ListGroupStatsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ErrorStatsService_ListEvents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListEventsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ErrorStatsServiceServer).ListEvents(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.clouderrorreporting.v1beta1.ErrorStatsService/ListEvents", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ErrorStatsServiceServer).ListEvents(ctx, req.(*ListEventsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ErrorStatsService_DeleteEvents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteEventsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ErrorStatsServiceServer).DeleteEvents(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.clouderrorreporting.v1beta1.ErrorStatsService/DeleteEvents", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ErrorStatsServiceServer).DeleteEvents(ctx, req.(*DeleteEventsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _ErrorStatsService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.devtools.clouderrorreporting.v1beta1.ErrorStatsService", + HandlerType: (*ErrorStatsServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListGroupStats", + Handler: _ErrorStatsService_ListGroupStats_Handler, + }, + { + MethodName: "ListEvents", + Handler: _ErrorStatsService_ListEvents_Handler, + }, + { + MethodName: "DeleteEvents", + Handler: _ErrorStatsService_DeleteEvents_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/devtools/clouderrorreporting/v1beta1/error_stats_service.proto", +} + +func init() { + proto.RegisterFile("google/devtools/clouderrorreporting/v1beta1/error_stats_service.proto", fileDescriptor2) +} + +var fileDescriptor2 = []byte{ + // 1328 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0xcd, 0x6f, 0x1b, 0x45, + 0x14, 0x67, 0xed, 0x38, 0x89, 0x9f, 0x1d, 0xc7, 0x99, 0xa4, 0xe9, 0xd6, 0xe5, 0x23, 0x75, 0x05, + 0x0a, 0xa9, 0xb0, 0x9b, 0x54, 0xa5, 0x45, 0xe5, 0xa3, 0x8e, 0xbd, 0x09, 0x51, 0x53, 0xdb, 0x1d, + 0xdb, 0x45, 0x44, 0x55, 0x57, 0x1b, 0xfb, 0xc5, 0x5d, 0xb0, 0x77, 0x97, 0xdd, 0x71, 0xd4, 0x16, + 0x55, 0x42, 0xdc, 0x38, 0xc3, 0x8d, 0xff, 0x80, 0xbf, 0x82, 0x13, 0x07, 0x4e, 0x48, 0xbd, 0x73, + 0xe2, 0x0e, 0xe2, 0xc2, 0x15, 0xcd, 0xc7, 0xfa, 0xab, 0x11, 0xa9, 0x1d, 0x84, 0xb8, 0xed, 0xbc, + 0x37, 0xef, 0xf7, 0x3e, 0xe6, 0xf7, 0xde, 0xcc, 0x82, 0xd1, 0x76, 0xdd, 0x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, 0xde, 0x7e, 0x89, 0x34, 0xe4, 0x40, 0x24, 0x3f, 0x69, 0x90, 0x1c, 0xa6, 0x2e, 0x99, 0xec, + 0x51, 0x7f, 0x42, 0xbf, 0x64, 0x0a, 0x67, 0x40, 0x18, 0x4d, 0x64, 0xe3, 0xe5, 0x13, 0xd9, 0xfe, + 0x4b, 0x03, 0xfe, 0x73, 0x39, 0x89, 0xef, 0xed, 0xd5, 0x17, 0x58, 0x5a, 0xe5, 0x83, 0xb8, 0xaa, + 0x1d, 0x3c, 0x54, 0x30, 0x6d, 0xb7, 0x63, 0x39, 0xed, 0x9c, 0xeb, 0xb7, 0xf3, 0x6d, 0x74, 0xc4, + 0x98, 0xce, 0x4b, 0x95, 0xe5, 0xd9, 0xc1, 0x4b, 0xfd, 0xf2, 0xde, 0x3a, 0x41, 0xf7, 0x43, 0xe4, + 0xf2, 0xae, 0x74, 0x50, 0xe4, 0x4a, 0x79, 0xc5, 0xd0, 0x7e, 0x7c, 0xf7, 0x37, 0xb7, 0xb9, 0xe5, + 0xcf, 0xe1, 0xae, 0x07, 0x62, 0xd7, 0x83, 0xd1, 0x5d, 0x0f, 0xee, 0x4b, 0xfc, 0xc3, 0x59, 0x11, + 0xd6, 0xb5, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0xb8, 0x90, 0xe3, 0x06, 0x1a, 0x10, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/devtools/clouderrorreporting/v1beta1/report_errors_service.pb.go b/vendor/google.golang.org/genproto/googleapis/devtools/clouderrorreporting/v1beta1/report_errors_service.pb.go new file mode 100644 index 0000000000..326ee8f327 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/devtools/clouderrorreporting/v1beta1/report_errors_service.pb.go @@ -0,0 +1,243 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/devtools/clouderrorreporting/v1beta1/report_errors_service.proto + +package clouderrorreporting + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf1 "github.com/golang/protobuf/ptypes/timestamp" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// A request for reporting an individual error event. +type ReportErrorEventRequest struct { + // [Required] The resource name of the Google Cloud Platform project. Written + // as `projects/` plus the + // [Google Cloud Platform project ID](https://support.google.com/cloud/answer/6158840). + // Example: `projects/my-project-123`. + ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName" json:"project_name,omitempty"` + // [Required] The error event to be reported. + Event *ReportedErrorEvent `protobuf:"bytes,2,opt,name=event" json:"event,omitempty"` +} + +func (m *ReportErrorEventRequest) Reset() { *m = ReportErrorEventRequest{} } +func (m *ReportErrorEventRequest) String() string { return proto.CompactTextString(m) } +func (*ReportErrorEventRequest) ProtoMessage() {} +func (*ReportErrorEventRequest) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} } + +func (m *ReportErrorEventRequest) GetProjectName() string { + if m != nil { + return m.ProjectName + } + return "" +} + +func (m *ReportErrorEventRequest) GetEvent() *ReportedErrorEvent { + if m != nil { + return m.Event + } + return nil +} + +// Response for reporting an individual error event. +// Data may be added to this message in the future. +type ReportErrorEventResponse struct { +} + +func (m *ReportErrorEventResponse) Reset() { *m = ReportErrorEventResponse{} } +func (m *ReportErrorEventResponse) String() string { return proto.CompactTextString(m) } +func (*ReportErrorEventResponse) ProtoMessage() {} +func (*ReportErrorEventResponse) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{1} } + +// An error event which is reported to the Error Reporting system. +type ReportedErrorEvent struct { + // [Optional] Time when the event occurred. + // If not provided, the time when the event was received by the + // Error Reporting system will be used. + EventTime *google_protobuf1.Timestamp `protobuf:"bytes,1,opt,name=event_time,json=eventTime" json:"event_time,omitempty"` + // [Required] The service context in which this error has occurred. + ServiceContext *ServiceContext `protobuf:"bytes,2,opt,name=service_context,json=serviceContext" json:"service_context,omitempty"` + // [Required] A message describing the error. The message can contain an + // exception stack in one of the supported programming languages and formats. + // In that case, the message is parsed and detailed exception information + // is returned when retrieving the error event again. + Message string `protobuf:"bytes,3,opt,name=message" json:"message,omitempty"` + // [Optional] A description of the context in which the error occurred. + Context *ErrorContext `protobuf:"bytes,4,opt,name=context" json:"context,omitempty"` +} + +func (m *ReportedErrorEvent) Reset() { *m = ReportedErrorEvent{} } +func (m *ReportedErrorEvent) String() string { return proto.CompactTextString(m) } +func (*ReportedErrorEvent) ProtoMessage() {} +func (*ReportedErrorEvent) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{2} } + +func (m *ReportedErrorEvent) GetEventTime() *google_protobuf1.Timestamp { + if m != nil { + return m.EventTime + } + return nil +} + +func (m *ReportedErrorEvent) GetServiceContext() *ServiceContext { + if m != nil { + return m.ServiceContext + } + return nil +} + +func (m *ReportedErrorEvent) GetMessage() string { + if m != nil { + return m.Message + } + return "" +} + +func (m *ReportedErrorEvent) GetContext() *ErrorContext { + if m != nil { + return m.Context + } + return nil +} + +func init() { + proto.RegisterType((*ReportErrorEventRequest)(nil), "google.devtools.clouderrorreporting.v1beta1.ReportErrorEventRequest") + proto.RegisterType((*ReportErrorEventResponse)(nil), "google.devtools.clouderrorreporting.v1beta1.ReportErrorEventResponse") + proto.RegisterType((*ReportedErrorEvent)(nil), "google.devtools.clouderrorreporting.v1beta1.ReportedErrorEvent") +} + +// 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 + +// Client API for ReportErrorsService service + +type ReportErrorsServiceClient interface { + // Report an individual error event. + // + // This endpoint accepts either an OAuth token, + // or an + // API key + // for authentication. To use an API key, append it to the URL as the value of + // a `key` parameter. For example: + //
POST https://clouderrorreporting.googleapis.com/v1beta1/projects/example-project/events:report?key=123ABC456
+ ReportErrorEvent(ctx context.Context, in *ReportErrorEventRequest, opts ...grpc.CallOption) (*ReportErrorEventResponse, error) +} + +type reportErrorsServiceClient struct { + cc *grpc.ClientConn +} + +func NewReportErrorsServiceClient(cc *grpc.ClientConn) ReportErrorsServiceClient { + return &reportErrorsServiceClient{cc} +} + +func (c *reportErrorsServiceClient) ReportErrorEvent(ctx context.Context, in *ReportErrorEventRequest, opts ...grpc.CallOption) (*ReportErrorEventResponse, error) { + out := new(ReportErrorEventResponse) + err := grpc.Invoke(ctx, "/google.devtools.clouderrorreporting.v1beta1.ReportErrorsService/ReportErrorEvent", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for ReportErrorsService service + +type ReportErrorsServiceServer interface { + // Report an individual error event. + // + // This endpoint accepts either an OAuth token, + // or an + // API key + // for authentication. To use an API key, append it to the URL as the value of + // a `key` parameter. For example: + //
POST https://clouderrorreporting.googleapis.com/v1beta1/projects/example-project/events:report?key=123ABC456
+ ReportErrorEvent(context.Context, *ReportErrorEventRequest) (*ReportErrorEventResponse, error) +} + +func RegisterReportErrorsServiceServer(s *grpc.Server, srv ReportErrorsServiceServer) { + s.RegisterService(&_ReportErrorsService_serviceDesc, srv) +} + +func _ReportErrorsService_ReportErrorEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ReportErrorEventRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReportErrorsServiceServer).ReportErrorEvent(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.clouderrorreporting.v1beta1.ReportErrorsService/ReportErrorEvent", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReportErrorsServiceServer).ReportErrorEvent(ctx, req.(*ReportErrorEventRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _ReportErrorsService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.devtools.clouderrorreporting.v1beta1.ReportErrorsService", + HandlerType: (*ReportErrorsServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ReportErrorEvent", + Handler: _ReportErrorsService_ReportErrorEvent_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/devtools/clouderrorreporting/v1beta1/report_errors_service.proto", +} + +func init() { + proto.RegisterFile("google/devtools/clouderrorreporting/v1beta1/report_errors_service.proto", fileDescriptor3) +} + +var fileDescriptor3 = []byte{ + // 490 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x93, 0xcd, 0x8a, 0x13, 0x41, + 0x10, 0xc7, 0x99, 0xf8, 0xb1, 0x6c, 0x47, 0x54, 0xda, 0x83, 0xc3, 0x20, 0xb8, 0xc6, 0xcb, 0xa2, + 0x30, 0x6d, 0xe2, 0xc5, 0xec, 0x22, 0x0b, 0x59, 0xc3, 0xde, 0x64, 0x99, 0xd5, 0x3d, 0x48, 0x70, + 0xe8, 0x4c, 0xca, 0x61, 0x24, 0xd3, 0x35, 0x76, 0x77, 0x82, 0x20, 0x5e, 0x7c, 0x85, 0x7d, 0x05, + 0x4f, 0x3e, 0x8a, 0x57, 0x5f, 0xc0, 0x83, 0x0f, 0xa1, 0x37, 0xe9, 0xaf, 0x25, 0x6b, 0x72, 0x70, + 0xf4, 0x58, 0xd3, 0x55, 0xbf, 0xff, 0xbf, 0x3e, 0x86, 0x1c, 0x95, 0x88, 0xe5, 0x1c, 0xd8, 0x0c, + 0x96, 0x1a, 0x71, 0xae, 0x58, 0x31, 0xc7, 0xc5, 0x0c, 0xa4, 0x44, 0x29, 0xa1, 0x41, 0xa9, 0x2b, + 0x51, 0xb2, 0x65, 0x7f, 0x0a, 0x9a, 0xf7, 0x99, 0xfb, 0x92, 0xdb, 0x57, 0x95, 0x2b, 0x90, 0xcb, + 0xaa, 0x80, 0xb4, 0x91, 0xa8, 0x91, 0x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, 0x7c, 0xc9, + 0x0e, 0x32, 0x84, 0xf4, 0x84, 0x6c, 0x05, 0xdd, 0xcb, 0x56, 0x77, 0xd8, 0x4a, 0xd7, 0x0e, 0x21, + 0xa8, 0x06, 0xd2, 0xe0, 0x67, 0x44, 0x6e, 0xad, 0xcc, 0x50, 0x79, 0x77, 0xf4, 0x7b, 0x44, 0x6e, + 0xfe, 0x39, 0x5b, 0xfa, 0xec, 0x1f, 0xf6, 0xb6, 0x76, 0x2f, 0xc9, 0xf8, 0x3f, 0x29, 0x7e, 0xc1, + 0x07, 0x9f, 0xbe, 0xfd, 0x38, 0xeb, 0x0c, 0x7b, 0x8f, 0xce, 0x4f, 0xfa, 0xc3, 0xea, 0x19, 0x3e, + 0xf5, 0x81, 0x62, 0x0f, 0x3e, 0x32, 0xbb, 0x44, 0xb5, 0xe7, 0xe8, 0x7b, 0xee, 0x7a, 0x46, 0xbf, + 0x22, 0x62, 0xfe, 0x82, 0x36, 0x6e, 0x46, 0xf1, 0x86, 0x59, 0x1d, 0x9b, 0xab, 0x39, 0x8e, 0x5e, + 0xbd, 0xf6, 0xa0, 0x12, 0xe7, 0x5c, 0x94, 0x29, 0xca, 0x92, 0x95, 0x20, 0xec, 0x4d, 0x31, 0xf7, + 0xc4, 0x9b, 0x4a, 0xfd, 0xd5, 0xdf, 0xb9, 0xbf, 0xe1, 0xed, 0x4b, 0xe7, 0xfe, 0x91, 0x13, 0x38, + 0x34, 0x8f, 0x6e, 0x9f, 0xd9, 0xb9, 0xc3, 0xd3, 0xfe, 0xc8, 0x54, 0x7e, 0x0d, 0x59, 0x13, 0x9b, + 0x35, 0xb9, 0x98, 0x35, 0x39, 0x75, 0xfc, 0xe9, 0x55, 0x6b, 0xeb, 0xf1, 0xef, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x2c, 0xd1, 0x8e, 0x76, 0xc7, 0x04, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/devtools/cloudprofiler/v2/profiler.pb.go b/vendor/google.golang.org/genproto/googleapis/devtools/cloudprofiler/v2/profiler.pb.go new file mode 100644 index 0000000000..01450fe7a2 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/devtools/cloudprofiler/v2/profiler.pb.go @@ -0,0 +1,469 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/devtools/cloudprofiler/v2/profiler.proto + +/* +Package cloudprofiler is a generated protocol buffer package. + +It is generated from these files: + google/devtools/cloudprofiler/v2/profiler.proto + +It has these top-level messages: + CreateProfileRequest + UpdateProfileRequest + Profile + Deployment +*/ +package cloudprofiler + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf1 "github.com/golang/protobuf/ptypes/duration" +import _ "github.com/golang/protobuf/ptypes/timestamp" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// ProfileType is type of profiling data. +// NOTE: the enumeration member names are used (in lowercase) as unique string +// identifiers of profile types, so they must not be renamed. +type ProfileType int32 + +const ( + // Unspecified profile type. + ProfileType_PROFILE_TYPE_UNSPECIFIED ProfileType = 0 + // Thread CPU time sampling. + ProfileType_CPU ProfileType = 1 + // Wallclock time sampling. More expensive as stops all threads. + ProfileType_WALL ProfileType = 2 + // Heap allocation sampling. + ProfileType_HEAP ProfileType = 3 + // Single-shot collection of all thread stacks. + ProfileType_THREADS ProfileType = 4 + // Synchronization contention profile. + ProfileType_CONTENTION ProfileType = 5 +) + +var ProfileType_name = map[int32]string{ + 0: "PROFILE_TYPE_UNSPECIFIED", + 1: "CPU", + 2: "WALL", + 3: "HEAP", + 4: "THREADS", + 5: "CONTENTION", +} +var ProfileType_value = map[string]int32{ + "PROFILE_TYPE_UNSPECIFIED": 0, + "CPU": 1, + "WALL": 2, + "HEAP": 3, + "THREADS": 4, + "CONTENTION": 5, +} + +func (x ProfileType) String() string { + return proto.EnumName(ProfileType_name, int32(x)) +} +func (ProfileType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +// CreateProfileRequest describes a profile resource creation request. +// Deployment field must be populated for both online and offline modes. +// For the online mode, profile field is not set and the profile_type specifies +// the list of profile types supported by the agent. The creation call will hang +// until a profile of one of these types needs to be collected. For offline +// mode, profile field must be set, profile_type must be empty, and deployment +// field must be identical to the deployment in the profile. +type CreateProfileRequest struct { + // Deployment details. + Deployment *Deployment `protobuf:"bytes,1,opt,name=deployment" json:"deployment,omitempty"` + // Online mode: One or more profile types that the agent is capable of + // providing. + ProfileType []ProfileType `protobuf:"varint,2,rep,packed,name=profile_type,json=profileType,enum=google.devtools.cloudprofiler.v2.ProfileType" json:"profile_type,omitempty"` + // Offline mode: Contents of the profile to create. + Profile *Profile `protobuf:"bytes,3,opt,name=profile" json:"profile,omitempty"` +} + +func (m *CreateProfileRequest) Reset() { *m = CreateProfileRequest{} } +func (m *CreateProfileRequest) String() string { return proto.CompactTextString(m) } +func (*CreateProfileRequest) ProtoMessage() {} +func (*CreateProfileRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *CreateProfileRequest) GetDeployment() *Deployment { + if m != nil { + return m.Deployment + } + return nil +} + +func (m *CreateProfileRequest) GetProfileType() []ProfileType { + if m != nil { + return m.ProfileType + } + return nil +} + +func (m *CreateProfileRequest) GetProfile() *Profile { + if m != nil { + return m.Profile + } + return nil +} + +// UpdateProfileRequest contains the profile to update. +type UpdateProfileRequest struct { + // Profile to update + Profile *Profile `protobuf:"bytes,1,opt,name=profile" json:"profile,omitempty"` +} + +func (m *UpdateProfileRequest) Reset() { *m = UpdateProfileRequest{} } +func (m *UpdateProfileRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateProfileRequest) ProtoMessage() {} +func (*UpdateProfileRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *UpdateProfileRequest) GetProfile() *Profile { + if m != nil { + return m.Profile + } + return nil +} + +// Profile resource. +type Profile struct { + // Opaque, server-assigned, unique ID for this profile. + // Output only. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Type of profile. + // Input (for the offline mode) or output (for the online mode). + ProfileType ProfileType `protobuf:"varint,2,opt,name=profile_type,json=profileType,enum=google.devtools.cloudprofiler.v2.ProfileType" json:"profile_type,omitempty"` + // Deployment this profile corresponds to. + Deployment *Deployment `protobuf:"bytes,3,opt,name=deployment" json:"deployment,omitempty"` + // Duration of the profiling session. + // Input (for the offline mode) or output (for the online mode). + // The field represents requested profiling duration. It may slightly differ + // from the effective profiling duration, which is recorded in the profile + // data, in case the profiling can't be stopped immediately (e.g. in case + // stopping the profiling is handled asynchronously). + Duration *google_protobuf1.Duration `protobuf:"bytes,4,opt,name=duration" json:"duration,omitempty"` + // Profile bytes, as a gzip compressed serialized proto, the format is + // https://github.com/google/pprof/blob/master/proto/profile.proto. + ProfileBytes []byte `protobuf:"bytes,5,opt,name=profile_bytes,json=profileBytes,proto3" json:"profile_bytes,omitempty"` + // Labels associated to this specific profile. These labels will get merged + // with the deployment labels for the final data set. + // See documentation on deployment labels for validation rules and limits. + // Input only, will not be populated on responses. + Labels map[string]string `protobuf:"bytes,6,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *Profile) Reset() { *m = Profile{} } +func (m *Profile) String() string { return proto.CompactTextString(m) } +func (*Profile) ProtoMessage() {} +func (*Profile) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *Profile) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Profile) GetProfileType() ProfileType { + if m != nil { + return m.ProfileType + } + return ProfileType_PROFILE_TYPE_UNSPECIFIED +} + +func (m *Profile) GetDeployment() *Deployment { + if m != nil { + return m.Deployment + } + return nil +} + +func (m *Profile) GetDuration() *google_protobuf1.Duration { + if m != nil { + return m.Duration + } + return nil +} + +func (m *Profile) GetProfileBytes() []byte { + if m != nil { + return m.ProfileBytes + } + return nil +} + +func (m *Profile) GetLabels() map[string]string { + if m != nil { + return m.Labels + } + return nil +} + +// Deployment contains the deployment identification information. +type Deployment struct { + // Project ID is the ID of a cloud project. + // Validation regex: `^[a-z][-a-z0-9:.]{4,61}[a-z0-9]$`. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // Target is the service name used to group related deployments: + // * Service name for GAE Flex / Standard. + // * Cluster and container name for GKE. + // * User-specified string for direct GCE profiling (e.g. Java). + // * Job name for Dataflow. + // Validation regex: `^[a-z]([-a-z0-9_.]{0,253}[a-z0-9])?$`. + Target string `protobuf:"bytes,2,opt,name=target" json:"target,omitempty"` + // Labels identify the deployment within the user universe and same target. + // Validation regex for label names: `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. + // Value for an individual label must be <= 512 bytes, the total + // size of all label names and values must be <= 1024 bytes. + // + // Label named "language" can be used to record the programming language of + // the profiled deployment. The standard choices for the value include "java", + // "go", "python", "ruby", "nodejs", "php", "dotnet". + // + // For deployments running on Google Cloud Platform, "zone" or "region" label + // should be present describing the deployment location. An example of a zone + // is "us-central1-a", an example of a region is "us-central1" or + // "us-central". + Labels map[string]string `protobuf:"bytes,3,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *Deployment) Reset() { *m = Deployment{} } +func (m *Deployment) String() string { return proto.CompactTextString(m) } +func (*Deployment) ProtoMessage() {} +func (*Deployment) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *Deployment) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *Deployment) GetTarget() string { + if m != nil { + return m.Target + } + return "" +} + +func (m *Deployment) GetLabels() map[string]string { + if m != nil { + return m.Labels + } + return nil +} + +func init() { + proto.RegisterType((*CreateProfileRequest)(nil), "google.devtools.cloudprofiler.v2.CreateProfileRequest") + proto.RegisterType((*UpdateProfileRequest)(nil), "google.devtools.cloudprofiler.v2.UpdateProfileRequest") + proto.RegisterType((*Profile)(nil), "google.devtools.cloudprofiler.v2.Profile") + proto.RegisterType((*Deployment)(nil), "google.devtools.cloudprofiler.v2.Deployment") + proto.RegisterEnum("google.devtools.cloudprofiler.v2.ProfileType", ProfileType_name, ProfileType_value) +} + +// 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 + +// Client API for ProfilerService service + +type ProfilerServiceClient interface { + // CreateProfile creates a new profile resource. + // + // In the online creation mode: + // * The server ensures that the new profiles are created at a constant rate + // per deployment, so the creation request may hang for some time until the + // next profile session is available. + // * The request may fail with ABORTED error if the creation is not + // available within ~1m, the response will indicate the duration of the + // backoff the client should take before attempting creating a profile + // again. The backoff duration is returned in google.rpc.RetryInfo extension + // on the response status. To a gRPC client, the extension will be return as + // a binary-serialized proto in the trailing metadata item named + // "google.rpc.retryinfo-bin". + // + // In the offline creation mode: + // * The client provides the profile to create along with the profile bytes, + // the server records it. + CreateProfile(ctx context.Context, in *CreateProfileRequest, opts ...grpc.CallOption) (*Profile, error) + // UpdateProfile updates the profile bytes and labels on the profile resource + // created in the online mode. + UpdateProfile(ctx context.Context, in *UpdateProfileRequest, opts ...grpc.CallOption) (*Profile, error) +} + +type profilerServiceClient struct { + cc *grpc.ClientConn +} + +func NewProfilerServiceClient(cc *grpc.ClientConn) ProfilerServiceClient { + return &profilerServiceClient{cc} +} + +func (c *profilerServiceClient) CreateProfile(ctx context.Context, in *CreateProfileRequest, opts ...grpc.CallOption) (*Profile, error) { + out := new(Profile) + err := grpc.Invoke(ctx, "/google.devtools.cloudprofiler.v2.ProfilerService/CreateProfile", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *profilerServiceClient) UpdateProfile(ctx context.Context, in *UpdateProfileRequest, opts ...grpc.CallOption) (*Profile, error) { + out := new(Profile) + err := grpc.Invoke(ctx, "/google.devtools.cloudprofiler.v2.ProfilerService/UpdateProfile", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for ProfilerService service + +type ProfilerServiceServer interface { + // CreateProfile creates a new profile resource. + // + // In the online creation mode: + // * The server ensures that the new profiles are created at a constant rate + // per deployment, so the creation request may hang for some time until the + // next profile session is available. + // * The request may fail with ABORTED error if the creation is not + // available within ~1m, the response will indicate the duration of the + // backoff the client should take before attempting creating a profile + // again. The backoff duration is returned in google.rpc.RetryInfo extension + // on the response status. To a gRPC client, the extension will be return as + // a binary-serialized proto in the trailing metadata item named + // "google.rpc.retryinfo-bin". + // + // In the offline creation mode: + // * The client provides the profile to create along with the profile bytes, + // the server records it. + CreateProfile(context.Context, *CreateProfileRequest) (*Profile, error) + // UpdateProfile updates the profile bytes and labels on the profile resource + // created in the online mode. + UpdateProfile(context.Context, *UpdateProfileRequest) (*Profile, error) +} + +func RegisterProfilerServiceServer(s *grpc.Server, srv ProfilerServiceServer) { + s.RegisterService(&_ProfilerService_serviceDesc, srv) +} + +func _ProfilerService_CreateProfile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateProfileRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProfilerServiceServer).CreateProfile(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.cloudprofiler.v2.ProfilerService/CreateProfile", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProfilerServiceServer).CreateProfile(ctx, req.(*CreateProfileRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ProfilerService_UpdateProfile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateProfileRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProfilerServiceServer).UpdateProfile(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.cloudprofiler.v2.ProfilerService/UpdateProfile", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProfilerServiceServer).UpdateProfile(ctx, req.(*UpdateProfileRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _ProfilerService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.devtools.cloudprofiler.v2.ProfilerService", + HandlerType: (*ProfilerServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateProfile", + Handler: _ProfilerService_CreateProfile_Handler, + }, + { + MethodName: "UpdateProfile", + Handler: _ProfilerService_UpdateProfile_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/devtools/cloudprofiler/v2/profiler.proto", +} + +func init() { proto.RegisterFile("google/devtools/cloudprofiler/v2/profiler.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 661 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xcd, 0x6e, 0xd3, 0x40, + 0x10, 0x66, 0xe3, 0x34, 0x69, 0x27, 0x6d, 0xb1, 0x56, 0x15, 0x32, 0x51, 0x81, 0x28, 0x5c, 0x42, + 0x44, 0x6d, 0xc9, 0x55, 0x51, 0x5b, 0xc4, 0xa1, 0x4d, 0x5c, 0x35, 0x52, 0x9a, 0x58, 0x6e, 0x2a, + 0x04, 0x1c, 0x22, 0xa7, 0xde, 0x5a, 0x06, 0xc7, 0x6b, 0xec, 0x4d, 0xa4, 0xa8, 0xea, 0x85, 0x57, + 0xe0, 0x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0x9f, 0x5a, 0xca, 0x61, 0xfb, 0xf5, 0x09, 0x3f, 0xc6, 0xa6, 0xae, 0xe9, 0xd9, 0x32, + 0x0d, 0x6c, 0xc5, 0x26, 0x5e, 0xfc, 0x3d, 0xf2, 0x9f, 0x8f, 0xe9, 0x3b, 0xe1, 0xdf, 0x7f, 0x40, + 0xcf, 0x67, 0x12, 0xbd, 0x5c, 0x8c, 0xdc, 0xfe, 0x15, 0x00, 0x00, 0xff, 0xff, 0x83, 0x3f, 0xa6, + 0xd9, 0xb9, 0x06, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/devtools/cloudtrace/v1/trace.pb.go b/vendor/google.golang.org/genproto/googleapis/devtools/cloudtrace/v1/trace.pb.go new file mode 100644 index 0000000000..cc15feed1a --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/devtools/cloudtrace/v1/trace.pb.go @@ -0,0 +1,724 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/devtools/cloudtrace/v1/trace.proto + +/* +Package cloudtrace is a generated protocol buffer package. + +It is generated from these files: + google/devtools/cloudtrace/v1/trace.proto + +It has these top-level messages: + Trace + Traces + TraceSpan + ListTracesRequest + ListTracesResponse + GetTraceRequest + PatchTracesRequest +*/ +package cloudtrace + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf1 "github.com/golang/protobuf/ptypes/empty" +import google_protobuf2 "github.com/golang/protobuf/ptypes/timestamp" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Type of span. Can be used to specify additional relationships between spans +// in addition to a parent/child relationship. +type TraceSpan_SpanKind int32 + +const ( + // Unspecified. + TraceSpan_SPAN_KIND_UNSPECIFIED TraceSpan_SpanKind = 0 + // Indicates that the span covers server-side handling of an RPC or other + // remote network request. + TraceSpan_RPC_SERVER TraceSpan_SpanKind = 1 + // Indicates that the span covers the client-side wrapper around an RPC or + // other remote request. + TraceSpan_RPC_CLIENT TraceSpan_SpanKind = 2 +) + +var TraceSpan_SpanKind_name = map[int32]string{ + 0: "SPAN_KIND_UNSPECIFIED", + 1: "RPC_SERVER", + 2: "RPC_CLIENT", +} +var TraceSpan_SpanKind_value = map[string]int32{ + "SPAN_KIND_UNSPECIFIED": 0, + "RPC_SERVER": 1, + "RPC_CLIENT": 2, +} + +func (x TraceSpan_SpanKind) String() string { + return proto.EnumName(TraceSpan_SpanKind_name, int32(x)) +} +func (TraceSpan_SpanKind) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{2, 0} } + +// Type of data returned for traces in the list. +type ListTracesRequest_ViewType int32 + +const ( + // Default is `MINIMAL` if unspecified. + ListTracesRequest_VIEW_TYPE_UNSPECIFIED ListTracesRequest_ViewType = 0 + // Minimal view of the trace record that contains only the project + // and trace IDs. + ListTracesRequest_MINIMAL ListTracesRequest_ViewType = 1 + // Root span view of the trace record that returns the root spans along + // with the minimal trace data. + ListTracesRequest_ROOTSPAN ListTracesRequest_ViewType = 2 + // Complete view of the trace record that contains the actual trace data. + // This is equivalent to calling the REST `get` or RPC `GetTrace` method + // using the ID of each listed trace. + ListTracesRequest_COMPLETE ListTracesRequest_ViewType = 3 +) + +var ListTracesRequest_ViewType_name = map[int32]string{ + 0: "VIEW_TYPE_UNSPECIFIED", + 1: "MINIMAL", + 2: "ROOTSPAN", + 3: "COMPLETE", +} +var ListTracesRequest_ViewType_value = map[string]int32{ + "VIEW_TYPE_UNSPECIFIED": 0, + "MINIMAL": 1, + "ROOTSPAN": 2, + "COMPLETE": 3, +} + +func (x ListTracesRequest_ViewType) String() string { + return proto.EnumName(ListTracesRequest_ViewType_name, int32(x)) +} +func (ListTracesRequest_ViewType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{3, 0} +} + +// A trace describes how long it takes for an application to perform an +// operation. It consists of a set of spans, each of which represent a single +// timed event within the operation. +type Trace struct { + // Project ID of the Cloud project where the trace data is stored. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // Globally unique identifier for the trace. This identifier is a 128-bit + // numeric value formatted as a 32-byte hex string. + TraceId string `protobuf:"bytes,2,opt,name=trace_id,json=traceId" json:"trace_id,omitempty"` + // Collection of spans in the trace. + Spans []*TraceSpan `protobuf:"bytes,3,rep,name=spans" json:"spans,omitempty"` +} + +func (m *Trace) Reset() { *m = Trace{} } +func (m *Trace) String() string { return proto.CompactTextString(m) } +func (*Trace) ProtoMessage() {} +func (*Trace) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *Trace) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *Trace) GetTraceId() string { + if m != nil { + return m.TraceId + } + return "" +} + +func (m *Trace) GetSpans() []*TraceSpan { + if m != nil { + return m.Spans + } + return nil +} + +// List of new or updated traces. +type Traces struct { + // List of traces. + Traces []*Trace `protobuf:"bytes,1,rep,name=traces" json:"traces,omitempty"` +} + +func (m *Traces) Reset() { *m = Traces{} } +func (m *Traces) String() string { return proto.CompactTextString(m) } +func (*Traces) ProtoMessage() {} +func (*Traces) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *Traces) GetTraces() []*Trace { + if m != nil { + return m.Traces + } + return nil +} + +// A span represents a single timed event within a trace. Spans can be nested +// and form a trace tree. Often, a trace contains a root span that describes the +// end-to-end latency of an operation and, optionally, one or more subspans for +// its suboperations. Spans do not need to be contiguous. There may be gaps +// between spans in a trace. +type TraceSpan struct { + // Identifier for the span. Must be a 64-bit integer other than 0 and + // unique within a trace. + SpanId uint64 `protobuf:"fixed64,1,opt,name=span_id,json=spanId" json:"span_id,omitempty"` + // Distinguishes between spans generated in a particular context. For example, + // two spans with the same name may be distinguished using `RPC_CLIENT` + // and `RPC_SERVER` to identify queueing latency associated with the span. + Kind TraceSpan_SpanKind `protobuf:"varint,2,opt,name=kind,enum=google.devtools.cloudtrace.v1.TraceSpan_SpanKind" json:"kind,omitempty"` + // Name of the span. Must be less than 128 bytes. The span name is sanitized + // and displayed in the Stackdriver Trace tool in the + // {% dynamic print site_values.console_name %}. + // The name may be a method name or some other per-call site name. + // For the same executable and the same call point, a best practice is + // to use a consistent name, which makes it easier to correlate + // cross-trace spans. + Name string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"` + // Start time of the span in nanoseconds from the UNIX epoch. + StartTime *google_protobuf2.Timestamp `protobuf:"bytes,4,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + // End time of the span in nanoseconds from the UNIX epoch. + EndTime *google_protobuf2.Timestamp `protobuf:"bytes,5,opt,name=end_time,json=endTime" json:"end_time,omitempty"` + // ID of the parent span, if any. Optional. + ParentSpanId uint64 `protobuf:"fixed64,6,opt,name=parent_span_id,json=parentSpanId" json:"parent_span_id,omitempty"` + // Collection of labels associated with the span. Label keys must be less than + // 128 bytes. Label values must be less than 16 kilobytes (10MB for + // `/stacktrace` values). + // + // Some predefined label keys exist, or you may create your own. When creating + // your own, we recommend the following formats: + // + // * `/category/product/key` for agents of well-known products (e.g. + // `/db/mongodb/read_size`). + // * `short_host/path/key` for domain-specific keys (e.g. + // `foo.com/myproduct/bar`) + // + // Predefined labels include: + // + // * `/agent` + // * `/component` + // * `/error/message` + // * `/error/name` + // * `/http/client_city` + // * `/http/client_country` + // * `/http/client_protocol` + // * `/http/client_region` + // * `/http/host` + // * `/http/method` + // * `/http/redirected_url` + // * `/http/request/size` + // * `/http/response/size` + // * `/http/status_code` + // * `/http/url` + // * `/http/user_agent` + // * `/pid` + // * `/stacktrace` + // * `/tid` + Labels map[string]string `protobuf:"bytes,7,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *TraceSpan) Reset() { *m = TraceSpan{} } +func (m *TraceSpan) String() string { return proto.CompactTextString(m) } +func (*TraceSpan) ProtoMessage() {} +func (*TraceSpan) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *TraceSpan) GetSpanId() uint64 { + if m != nil { + return m.SpanId + } + return 0 +} + +func (m *TraceSpan) GetKind() TraceSpan_SpanKind { + if m != nil { + return m.Kind + } + return TraceSpan_SPAN_KIND_UNSPECIFIED +} + +func (m *TraceSpan) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *TraceSpan) GetStartTime() *google_protobuf2.Timestamp { + if m != nil { + return m.StartTime + } + return nil +} + +func (m *TraceSpan) GetEndTime() *google_protobuf2.Timestamp { + if m != nil { + return m.EndTime + } + return nil +} + +func (m *TraceSpan) GetParentSpanId() uint64 { + if m != nil { + return m.ParentSpanId + } + return 0 +} + +func (m *TraceSpan) GetLabels() map[string]string { + if m != nil { + return m.Labels + } + return nil +} + +// The request message for the `ListTraces` method. All fields are required +// unless specified. +type ListTracesRequest struct { + // ID of the Cloud project where the trace data is stored. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // Type of data returned for traces in the list. Optional. Default is + // `MINIMAL`. + View ListTracesRequest_ViewType `protobuf:"varint,2,opt,name=view,enum=google.devtools.cloudtrace.v1.ListTracesRequest_ViewType" json:"view,omitempty"` + // Maximum number of traces to return. If not specified or <= 0, the + // implementation selects a reasonable value. The implementation may + // return fewer traces than the requested page size. Optional. + PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // Token identifying the page of results to return. If provided, use the + // value of the `next_page_token` field from a previous request. Optional. + PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` + // Start of the time interval (inclusive) during which the trace data was + // collected from the application. + StartTime *google_protobuf2.Timestamp `protobuf:"bytes,5,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + // End of the time interval (inclusive) during which the trace data was + // collected from the application. + EndTime *google_protobuf2.Timestamp `protobuf:"bytes,6,opt,name=end_time,json=endTime" json:"end_time,omitempty"` + // An optional filter against labels for the request. + // + // By default, searches use prefix matching. To specify exact match, prepend + // a plus symbol (`+`) to the search term. + // Multiple terms are ANDed. Syntax: + // + // * `root:NAME_PREFIX` or `NAME_PREFIX`: Return traces where any root + // span starts with `NAME_PREFIX`. + // * `+root:NAME` or `+NAME`: Return traces where any root span's name is + // exactly `NAME`. + // * `span:NAME_PREFIX`: Return traces where any span starts with + // `NAME_PREFIX`. + // * `+span:NAME`: Return traces where any span's name is exactly + // `NAME`. + // * `latency:DURATION`: Return traces whose overall latency is + // greater or equal to than `DURATION`. Accepted units are nanoseconds + // (`ns`), milliseconds (`ms`), and seconds (`s`). Default is `ms`. For + // example, `latency:24ms` returns traces whose overall latency + // is greater than or equal to 24 milliseconds. + // * `label:LABEL_KEY`: Return all traces containing the specified + // label key (exact match, case-sensitive) regardless of the key:value + // pair's value (including empty values). + // * `LABEL_KEY:VALUE_PREFIX`: Return all traces containing the specified + // label key (exact match, case-sensitive) whose value starts with + // `VALUE_PREFIX`. Both a key and a value must be specified. + // * `+LABEL_KEY:VALUE`: Return all traces containing a key:value pair + // exactly matching the specified text. Both a key and a value must be + // specified. + // * `method:VALUE`: Equivalent to `/http/method:VALUE`. + // * `url:VALUE`: Equivalent to `/http/url:VALUE`. + Filter string `protobuf:"bytes,7,opt,name=filter" json:"filter,omitempty"` + // Field used to sort the returned traces. Optional. + // Can be one of the following: + // + // * `trace_id` + // * `name` (`name` field of root span in the trace) + // * `duration` (difference between `end_time` and `start_time` fields of + // the root span) + // * `start` (`start_time` field of the root span) + // + // Descending order can be specified by appending `desc` to the sort field + // (for example, `name desc`). + // + // Only one sort field is permitted. + OrderBy string `protobuf:"bytes,8,opt,name=order_by,json=orderBy" json:"order_by,omitempty"` +} + +func (m *ListTracesRequest) Reset() { *m = ListTracesRequest{} } +func (m *ListTracesRequest) String() string { return proto.CompactTextString(m) } +func (*ListTracesRequest) ProtoMessage() {} +func (*ListTracesRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *ListTracesRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *ListTracesRequest) GetView() ListTracesRequest_ViewType { + if m != nil { + return m.View + } + return ListTracesRequest_VIEW_TYPE_UNSPECIFIED +} + +func (m *ListTracesRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListTracesRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +func (m *ListTracesRequest) GetStartTime() *google_protobuf2.Timestamp { + if m != nil { + return m.StartTime + } + return nil +} + +func (m *ListTracesRequest) GetEndTime() *google_protobuf2.Timestamp { + if m != nil { + return m.EndTime + } + return nil +} + +func (m *ListTracesRequest) GetFilter() string { + if m != nil { + return m.Filter + } + return "" +} + +func (m *ListTracesRequest) GetOrderBy() string { + if m != nil { + return m.OrderBy + } + return "" +} + +// The response message for the `ListTraces` method. +type ListTracesResponse struct { + // List of trace records returned. + Traces []*Trace `protobuf:"bytes,1,rep,name=traces" json:"traces,omitempty"` + // If defined, indicates that there are more traces that match the request + // and that this value should be passed to the next request to continue + // retrieving additional traces. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListTracesResponse) Reset() { *m = ListTracesResponse{} } +func (m *ListTracesResponse) String() string { return proto.CompactTextString(m) } +func (*ListTracesResponse) ProtoMessage() {} +func (*ListTracesResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *ListTracesResponse) GetTraces() []*Trace { + if m != nil { + return m.Traces + } + return nil +} + +func (m *ListTracesResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// The request message for the `GetTrace` method. +type GetTraceRequest struct { + // ID of the Cloud project where the trace data is stored. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // ID of the trace to return. + TraceId string `protobuf:"bytes,2,opt,name=trace_id,json=traceId" json:"trace_id,omitempty"` +} + +func (m *GetTraceRequest) Reset() { *m = GetTraceRequest{} } +func (m *GetTraceRequest) String() string { return proto.CompactTextString(m) } +func (*GetTraceRequest) ProtoMessage() {} +func (*GetTraceRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *GetTraceRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *GetTraceRequest) GetTraceId() string { + if m != nil { + return m.TraceId + } + return "" +} + +// The request message for the `PatchTraces` method. +type PatchTracesRequest struct { + // ID of the Cloud project where the trace data is stored. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The body of the message. + Traces *Traces `protobuf:"bytes,2,opt,name=traces" json:"traces,omitempty"` +} + +func (m *PatchTracesRequest) Reset() { *m = PatchTracesRequest{} } +func (m *PatchTracesRequest) String() string { return proto.CompactTextString(m) } +func (*PatchTracesRequest) ProtoMessage() {} +func (*PatchTracesRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *PatchTracesRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *PatchTracesRequest) GetTraces() *Traces { + if m != nil { + return m.Traces + } + return nil +} + +func init() { + proto.RegisterType((*Trace)(nil), "google.devtools.cloudtrace.v1.Trace") + proto.RegisterType((*Traces)(nil), "google.devtools.cloudtrace.v1.Traces") + proto.RegisterType((*TraceSpan)(nil), "google.devtools.cloudtrace.v1.TraceSpan") + proto.RegisterType((*ListTracesRequest)(nil), "google.devtools.cloudtrace.v1.ListTracesRequest") + proto.RegisterType((*ListTracesResponse)(nil), "google.devtools.cloudtrace.v1.ListTracesResponse") + proto.RegisterType((*GetTraceRequest)(nil), "google.devtools.cloudtrace.v1.GetTraceRequest") + proto.RegisterType((*PatchTracesRequest)(nil), "google.devtools.cloudtrace.v1.PatchTracesRequest") + proto.RegisterEnum("google.devtools.cloudtrace.v1.TraceSpan_SpanKind", TraceSpan_SpanKind_name, TraceSpan_SpanKind_value) + proto.RegisterEnum("google.devtools.cloudtrace.v1.ListTracesRequest_ViewType", ListTracesRequest_ViewType_name, ListTracesRequest_ViewType_value) +} + +// 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 + +// Client API for TraceService service + +type TraceServiceClient interface { + // Returns of a list of traces that match the specified filter conditions. + ListTraces(ctx context.Context, in *ListTracesRequest, opts ...grpc.CallOption) (*ListTracesResponse, error) + // Gets a single trace by its ID. + GetTrace(ctx context.Context, in *GetTraceRequest, opts ...grpc.CallOption) (*Trace, error) + // Sends new traces to Stackdriver Trace or updates existing traces. If the ID + // of a trace that you send matches that of an existing trace, any fields + // in the existing trace and its spans are overwritten by the provided values, + // and any new fields provided are merged with the existing trace data. If the + // ID does not match, a new trace is created. + PatchTraces(ctx context.Context, in *PatchTracesRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) +} + +type traceServiceClient struct { + cc *grpc.ClientConn +} + +func NewTraceServiceClient(cc *grpc.ClientConn) TraceServiceClient { + return &traceServiceClient{cc} +} + +func (c *traceServiceClient) ListTraces(ctx context.Context, in *ListTracesRequest, opts ...grpc.CallOption) (*ListTracesResponse, error) { + out := new(ListTracesResponse) + err := grpc.Invoke(ctx, "/google.devtools.cloudtrace.v1.TraceService/ListTraces", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *traceServiceClient) GetTrace(ctx context.Context, in *GetTraceRequest, opts ...grpc.CallOption) (*Trace, error) { + out := new(Trace) + err := grpc.Invoke(ctx, "/google.devtools.cloudtrace.v1.TraceService/GetTrace", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *traceServiceClient) PatchTraces(ctx context.Context, in *PatchTracesRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { + out := new(google_protobuf1.Empty) + err := grpc.Invoke(ctx, "/google.devtools.cloudtrace.v1.TraceService/PatchTraces", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for TraceService service + +type TraceServiceServer interface { + // Returns of a list of traces that match the specified filter conditions. + ListTraces(context.Context, *ListTracesRequest) (*ListTracesResponse, error) + // Gets a single trace by its ID. + GetTrace(context.Context, *GetTraceRequest) (*Trace, error) + // Sends new traces to Stackdriver Trace or updates existing traces. If the ID + // of a trace that you send matches that of an existing trace, any fields + // in the existing trace and its spans are overwritten by the provided values, + // and any new fields provided are merged with the existing trace data. If the + // ID does not match, a new trace is created. + PatchTraces(context.Context, *PatchTracesRequest) (*google_protobuf1.Empty, error) +} + +func RegisterTraceServiceServer(s *grpc.Server, srv TraceServiceServer) { + s.RegisterService(&_TraceService_serviceDesc, srv) +} + +func _TraceService_ListTraces_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListTracesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TraceServiceServer).ListTraces(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.cloudtrace.v1.TraceService/ListTraces", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TraceServiceServer).ListTraces(ctx, req.(*ListTracesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TraceService_GetTrace_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetTraceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TraceServiceServer).GetTrace(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.cloudtrace.v1.TraceService/GetTrace", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TraceServiceServer).GetTrace(ctx, req.(*GetTraceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TraceService_PatchTraces_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PatchTracesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TraceServiceServer).PatchTraces(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.cloudtrace.v1.TraceService/PatchTraces", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TraceServiceServer).PatchTraces(ctx, req.(*PatchTracesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _TraceService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.devtools.cloudtrace.v1.TraceService", + HandlerType: (*TraceServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListTraces", + Handler: _TraceService_ListTraces_Handler, + }, + { + MethodName: "GetTrace", + Handler: _TraceService_GetTrace_Handler, + }, + { + MethodName: "PatchTraces", + Handler: _TraceService_PatchTraces_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/devtools/cloudtrace/v1/trace.proto", +} + +func init() { proto.RegisterFile("google/devtools/cloudtrace/v1/trace.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 898 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xdd, 0x6e, 0x1b, 0x45, + 0x14, 0x66, 0xed, 0x78, 0x6d, 0x1f, 0x87, 0xd4, 0x8c, 0x68, 0x71, 0x5d, 0x2a, 0xc2, 0xaa, 0x20, + 0x03, 0x62, 0xb7, 0x76, 0x41, 0x22, 0xe5, 0x47, 0x6a, 0xdc, 0x6d, 0xb4, 0x8a, 0xe3, 0xac, 0xd6, + 0xc6, 0x08, 0x14, 0x69, 0x35, 0xf1, 0x4e, 0xcd, 0x12, 0x7b, 0x66, 0xd9, 0x99, 0xb8, 0x38, 0x55, + 0x2f, 0xe0, 0x92, 0x5b, 0xc4, 0x15, 0x6f, 0xd0, 0x4b, 0x1e, 0x83, 0x3b, 0xc4, 0x2b, 0x20, 0xf1, + 0x1a, 0x68, 0x66, 0x76, 0x9b, 0x28, 0x51, 0x63, 0x07, 0x6e, 0xa2, 0x39, 0x67, 0xce, 0xef, 0xf7, + 0x7d, 0x93, 0x35, 0xbc, 0x37, 0x61, 0x6c, 0x32, 0x25, 0x4e, 0x44, 0xe6, 0x82, 0xb1, 0x29, 0x77, + 0xc6, 0x53, 0x76, 0x1c, 0x89, 0x14, 0x8f, 0x89, 0x33, 0x6f, 0x3b, 0xea, 0x60, 0x27, 0x29, 0x13, + 0x0c, 0xdd, 0xd6, 0xa1, 0x76, 0x1e, 0x6a, 0x9f, 0x86, 0xda, 0xf3, 0x76, 0xf3, 0xcd, 0xac, 0x12, + 0x4e, 0x62, 0x07, 0x53, 0xca, 0x04, 0x16, 0x31, 0xa3, 0x5c, 0x27, 0x37, 0x6f, 0x65, 0xb7, 0xca, + 0x3a, 0x3c, 0x7e, 0xec, 0x90, 0x59, 0x22, 0x16, 0xd9, 0xe5, 0x5b, 0xe7, 0x2f, 0x45, 0x3c, 0x23, + 0x5c, 0xe0, 0x59, 0xa2, 0x03, 0xac, 0x1f, 0x0d, 0x28, 0x0d, 0x65, 0x23, 0x74, 0x1b, 0x20, 0x49, + 0xd9, 0x77, 0x64, 0x2c, 0xc2, 0x38, 0x6a, 0x18, 0x9b, 0x46, 0xab, 0x1a, 0x54, 0x33, 0x8f, 0x17, + 0xa1, 0x9b, 0x50, 0x51, 0x03, 0xc9, 0xcb, 0x82, 0xba, 0x2c, 0x2b, 0xdb, 0x8b, 0xd0, 0x17, 0x50, + 0xe2, 0x09, 0xa6, 0xbc, 0x51, 0xdc, 0x2c, 0xb6, 0x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xa1, 0x9f, 0x0d, 0xa8, + 0x9d, 0xe1, 0x0e, 0x2d, 0x03, 0xe1, 0x22, 0xcf, 0xcd, 0x1b, 0x17, 0x9e, 0x9b, 0x2b, 0x3f, 0xb8, + 0xd6, 0x5d, 0x35, 0xcf, 0xfb, 0x9d, 0xa5, 0xe0, 0xdc, 0xcf, 0x38, 0xdd, 0x7e, 0x6e, 0xc0, 0xdb, + 0x63, 0x36, 0xbb, 0x7c, 0x84, 0x6d, 0x50, 0xed, 0x7d, 0xd9, 0xcc, 0x37, 0xbe, 0xd9, 0xc9, 0x82, + 0x27, 0x6c, 0x8a, 0xe9, 0xc4, 0x66, 0xe9, 0xc4, 0x99, 0x10, 0xaa, 0x46, 0x71, 0xf4, 0x15, 0x4e, + 0x62, 0xfe, 0x92, 0x1f, 0x1d, 0x9f, 0x9e, 0x5a, 0xcf, 0x0b, 0xd7, 0x77, 0x74, 0xa5, 0xae, 0xf4, + 0x69, 0x4c, 0xed, 0x51, 0xfb, 0x8f, 0xdc, 0x7f, 0xa0, 0xfc, 0x07, 0xca, 0x7f, 0x30, 0x6a, 0x1f, + 0x9a, 0xaa, 0xc7, 0xbd, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x08, 0xd9, 0xf5, 0xea, 0xd7, 0x08, + 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/devtools/cloudtrace/v2/trace.pb.go b/vendor/google.golang.org/genproto/googleapis/devtools/cloudtrace/v2/trace.pb.go new file mode 100644 index 0000000000..d12eb37e5c --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/devtools/cloudtrace/v2/trace.pb.go @@ -0,0 +1,1086 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/devtools/cloudtrace/v2/trace.proto + +/* +Package cloudtrace is a generated protocol buffer package. + +It is generated from these files: + google/devtools/cloudtrace/v2/trace.proto + google/devtools/cloudtrace/v2/tracing.proto + +It has these top-level messages: + Span + AttributeValue + StackTrace + Module + TruncatableString + BatchWriteSpansRequest +*/ +package cloudtrace + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf1 "github.com/golang/protobuf/ptypes/timestamp" +import google_protobuf2 "github.com/golang/protobuf/ptypes/wrappers" +import google_rpc "google.golang.org/genproto/googleapis/rpc/status" + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Indicates whether the message was sent or received. +type Span_TimeEvent_MessageEvent_Type int32 + +const ( + // Unknown event type. + Span_TimeEvent_MessageEvent_TYPE_UNSPECIFIED Span_TimeEvent_MessageEvent_Type = 0 + // Indicates a sent message. + Span_TimeEvent_MessageEvent_SENT Span_TimeEvent_MessageEvent_Type = 1 + // Indicates a received message. + Span_TimeEvent_MessageEvent_RECEIVED Span_TimeEvent_MessageEvent_Type = 2 +) + +var Span_TimeEvent_MessageEvent_Type_name = map[int32]string{ + 0: "TYPE_UNSPECIFIED", + 1: "SENT", + 2: "RECEIVED", +} +var Span_TimeEvent_MessageEvent_Type_value = map[string]int32{ + "TYPE_UNSPECIFIED": 0, + "SENT": 1, + "RECEIVED": 2, +} + +func (x Span_TimeEvent_MessageEvent_Type) String() string { + return proto.EnumName(Span_TimeEvent_MessageEvent_Type_name, int32(x)) +} +func (Span_TimeEvent_MessageEvent_Type) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{0, 1, 1, 0} +} + +// The relationship of the current span relative to the linked span: child, +// parent, or unspecified. +type Span_Link_Type int32 + +const ( + // The relationship of the two spans is unknown. + Span_Link_TYPE_UNSPECIFIED Span_Link_Type = 0 + // The linked span is a child of the current span. + Span_Link_CHILD_LINKED_SPAN Span_Link_Type = 1 + // The linked span is a parent of the current span. + Span_Link_PARENT_LINKED_SPAN Span_Link_Type = 2 +) + +var Span_Link_Type_name = map[int32]string{ + 0: "TYPE_UNSPECIFIED", + 1: "CHILD_LINKED_SPAN", + 2: "PARENT_LINKED_SPAN", +} +var Span_Link_Type_value = map[string]int32{ + "TYPE_UNSPECIFIED": 0, + "CHILD_LINKED_SPAN": 1, + "PARENT_LINKED_SPAN": 2, +} + +func (x Span_Link_Type) String() string { + return proto.EnumName(Span_Link_Type_name, int32(x)) +} +func (Span_Link_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 3, 0} } + +// A span represents a single operation within a trace. Spans can be +// nested to form a trace tree. Often, a trace contains a root span +// that describes the end-to-end latency, and one or more subspans for +// its sub-operations. A trace can also contain multiple root spans, +// or none at all. Spans do not need to be contiguous—there may be +// gaps or overlaps between spans in a trace. +type Span struct { + // The resource name of the span in the following format: + // + // projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/[SPAN_ID] + // + // [TRACE_ID] is a unique identifier for a trace within a project. + // [SPAN_ID] is a unique identifier for a span within a trace, + // assigned when the span is created. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The [SPAN_ID] portion of the span's resource name. + // The ID is a 16-character hexadecimal encoding of an 8-byte array. + SpanId string `protobuf:"bytes,2,opt,name=span_id,json=spanId" json:"span_id,omitempty"` + // The [SPAN_ID] of this span's parent span. If this is a root span, + // then this field must be empty. + ParentSpanId string `protobuf:"bytes,3,opt,name=parent_span_id,json=parentSpanId" json:"parent_span_id,omitempty"` + // A description of the span's operation (up to 128 bytes). + // Stackdriver Trace displays the description in the + // {% dynamic print site_values.console_name %}. + // For example, the display name can be a qualified method name or a file name + // and a line number where the operation is called. A best practice is to use + // the same display name within an application and at the same call point. + // This makes it easier to correlate spans in different traces. + DisplayName *TruncatableString `protobuf:"bytes,4,opt,name=display_name,json=displayName" json:"display_name,omitempty"` + // The start time of the span. On the client side, this is the time kept by + // the local machine where the span execution starts. On the server side, this + // is the time when the server's application handler starts running. + StartTime *google_protobuf1.Timestamp `protobuf:"bytes,5,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + // The end time of the span. On the client side, this is the time kept by + // the local machine where the span execution ends. On the server side, this + // is the time when the server application handler stops running. + EndTime *google_protobuf1.Timestamp `protobuf:"bytes,6,opt,name=end_time,json=endTime" json:"end_time,omitempty"` + // A set of attributes on the span. There is a limit of 32 attributes per + // span. + Attributes *Span_Attributes `protobuf:"bytes,7,opt,name=attributes" json:"attributes,omitempty"` + // Stack trace captured at the start of the span. + StackTrace *StackTrace `protobuf:"bytes,8,opt,name=stack_trace,json=stackTrace" json:"stack_trace,omitempty"` + // The included time events. There can be up to 32 annotations and 128 message + // events per span. + TimeEvents *Span_TimeEvents `protobuf:"bytes,9,opt,name=time_events,json=timeEvents" json:"time_events,omitempty"` + // A maximum of 128 links are allowed per Span. + Links *Span_Links `protobuf:"bytes,10,opt,name=links" json:"links,omitempty"` + // An optional final status for this span. + Status *google_rpc.Status `protobuf:"bytes,11,opt,name=status" json:"status,omitempty"` + // A highly recommended but not required flag that identifies when a trace + // crosses a process boundary. True when the parent_span belongs to the + // same process as the current span. + SameProcessAsParentSpan *google_protobuf2.BoolValue `protobuf:"bytes,12,opt,name=same_process_as_parent_span,json=sameProcessAsParentSpan" json:"same_process_as_parent_span,omitempty"` + // An optional number of child spans that were generated while this span + // was active. If set, allows implementation to detect missing child spans. + ChildSpanCount *google_protobuf2.Int32Value `protobuf:"bytes,13,opt,name=child_span_count,json=childSpanCount" json:"child_span_count,omitempty"` +} + +func (m *Span) Reset() { *m = Span{} } +func (m *Span) String() string { return proto.CompactTextString(m) } +func (*Span) ProtoMessage() {} +func (*Span) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *Span) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Span) GetSpanId() string { + if m != nil { + return m.SpanId + } + return "" +} + +func (m *Span) GetParentSpanId() string { + if m != nil { + return m.ParentSpanId + } + return "" +} + +func (m *Span) GetDisplayName() *TruncatableString { + if m != nil { + return m.DisplayName + } + return nil +} + +func (m *Span) GetStartTime() *google_protobuf1.Timestamp { + if m != nil { + return m.StartTime + } + return nil +} + +func (m *Span) GetEndTime() *google_protobuf1.Timestamp { + if m != nil { + return m.EndTime + } + return nil +} + +func (m *Span) GetAttributes() *Span_Attributes { + if m != nil { + return m.Attributes + } + return nil +} + +func (m *Span) GetStackTrace() *StackTrace { + if m != nil { + return m.StackTrace + } + return nil +} + +func (m *Span) GetTimeEvents() *Span_TimeEvents { + if m != nil { + return m.TimeEvents + } + return nil +} + +func (m *Span) GetLinks() *Span_Links { + if m != nil { + return m.Links + } + return nil +} + +func (m *Span) GetStatus() *google_rpc.Status { + if m != nil { + return m.Status + } + return nil +} + +func (m *Span) GetSameProcessAsParentSpan() *google_protobuf2.BoolValue { + if m != nil { + return m.SameProcessAsParentSpan + } + return nil +} + +func (m *Span) GetChildSpanCount() *google_protobuf2.Int32Value { + if m != nil { + return m.ChildSpanCount + } + return nil +} + +// A set of attributes, each in the format `[KEY]:[VALUE]`. +type Span_Attributes struct { + // The set of attributes. Each attribute's key can be up to 128 bytes + // long. The value can be a string up to 256 bytes, an integer, or the + // Boolean values `true` and `false`. For example: + // + // "/instance_id": "my-instance" + // "/http/user_agent": "" + // "/http/request_bytes": 300 + // "abc.com/myattribute": true + AttributeMap map[string]*AttributeValue `protobuf:"bytes,1,rep,name=attribute_map,json=attributeMap" json:"attribute_map,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // The number of attributes that were discarded. Attributes can be discarded + // because their keys are too long or because there are too many attributes. + // If this value is 0 then all attributes are valid. + DroppedAttributesCount int32 `protobuf:"varint,2,opt,name=dropped_attributes_count,json=droppedAttributesCount" json:"dropped_attributes_count,omitempty"` +} + +func (m *Span_Attributes) Reset() { *m = Span_Attributes{} } +func (m *Span_Attributes) String() string { return proto.CompactTextString(m) } +func (*Span_Attributes) ProtoMessage() {} +func (*Span_Attributes) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 0} } + +func (m *Span_Attributes) GetAttributeMap() map[string]*AttributeValue { + if m != nil { + return m.AttributeMap + } + return nil +} + +func (m *Span_Attributes) GetDroppedAttributesCount() int32 { + if m != nil { + return m.DroppedAttributesCount + } + return 0 +} + +// A time-stamped annotation or message event in the Span. +type Span_TimeEvent struct { + // The timestamp indicating the time the event occurred. + Time *google_protobuf1.Timestamp `protobuf:"bytes,1,opt,name=time" json:"time,omitempty"` + // A `TimeEvent` can contain either an `Annotation` object or a + // `MessageEvent` object, but not both. + // + // Types that are valid to be assigned to Value: + // *Span_TimeEvent_Annotation_ + // *Span_TimeEvent_MessageEvent_ + Value isSpan_TimeEvent_Value `protobuf_oneof:"value"` +} + +func (m *Span_TimeEvent) Reset() { *m = Span_TimeEvent{} } +func (m *Span_TimeEvent) String() string { return proto.CompactTextString(m) } +func (*Span_TimeEvent) ProtoMessage() {} +func (*Span_TimeEvent) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 1} } + +type isSpan_TimeEvent_Value interface { + isSpan_TimeEvent_Value() +} + +type Span_TimeEvent_Annotation_ struct { + Annotation *Span_TimeEvent_Annotation `protobuf:"bytes,2,opt,name=annotation,oneof"` +} +type Span_TimeEvent_MessageEvent_ struct { + MessageEvent *Span_TimeEvent_MessageEvent `protobuf:"bytes,3,opt,name=message_event,json=messageEvent,oneof"` +} + +func (*Span_TimeEvent_Annotation_) isSpan_TimeEvent_Value() {} +func (*Span_TimeEvent_MessageEvent_) isSpan_TimeEvent_Value() {} + +func (m *Span_TimeEvent) GetValue() isSpan_TimeEvent_Value { + if m != nil { + return m.Value + } + return nil +} + +func (m *Span_TimeEvent) GetTime() *google_protobuf1.Timestamp { + if m != nil { + return m.Time + } + return nil +} + +func (m *Span_TimeEvent) GetAnnotation() *Span_TimeEvent_Annotation { + if x, ok := m.GetValue().(*Span_TimeEvent_Annotation_); ok { + return x.Annotation + } + return nil +} + +func (m *Span_TimeEvent) GetMessageEvent() *Span_TimeEvent_MessageEvent { + if x, ok := m.GetValue().(*Span_TimeEvent_MessageEvent_); ok { + return x.MessageEvent + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Span_TimeEvent) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _Span_TimeEvent_OneofMarshaler, _Span_TimeEvent_OneofUnmarshaler, _Span_TimeEvent_OneofSizer, []interface{}{ + (*Span_TimeEvent_Annotation_)(nil), + (*Span_TimeEvent_MessageEvent_)(nil), + } +} + +func _Span_TimeEvent_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Span_TimeEvent) + // value + switch x := m.Value.(type) { + case *Span_TimeEvent_Annotation_: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Annotation); err != nil { + return err + } + case *Span_TimeEvent_MessageEvent_: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.MessageEvent); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("Span_TimeEvent.Value has unexpected type %T", x) + } + return nil +} + +func _Span_TimeEvent_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Span_TimeEvent) + switch tag { + case 2: // value.annotation + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Span_TimeEvent_Annotation) + err := b.DecodeMessage(msg) + m.Value = &Span_TimeEvent_Annotation_{msg} + return true, err + case 3: // value.message_event + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Span_TimeEvent_MessageEvent) + err := b.DecodeMessage(msg) + m.Value = &Span_TimeEvent_MessageEvent_{msg} + return true, err + default: + return false, nil + } +} + +func _Span_TimeEvent_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Span_TimeEvent) + // value + switch x := m.Value.(type) { + case *Span_TimeEvent_Annotation_: + s := proto.Size(x.Annotation) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Span_TimeEvent_MessageEvent_: + s := proto.Size(x.MessageEvent) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Text annotation with a set of attributes. +type Span_TimeEvent_Annotation struct { + // A user-supplied message describing the event. The maximum length for + // the description is 256 bytes. + Description *TruncatableString `protobuf:"bytes,1,opt,name=description" json:"description,omitempty"` + // A set of attributes on the annotation. There is a limit of 4 attributes + // per Annotation. + Attributes *Span_Attributes `protobuf:"bytes,2,opt,name=attributes" json:"attributes,omitempty"` +} + +func (m *Span_TimeEvent_Annotation) Reset() { *m = Span_TimeEvent_Annotation{} } +func (m *Span_TimeEvent_Annotation) String() string { return proto.CompactTextString(m) } +func (*Span_TimeEvent_Annotation) ProtoMessage() {} +func (*Span_TimeEvent_Annotation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 1, 0} } + +func (m *Span_TimeEvent_Annotation) GetDescription() *TruncatableString { + if m != nil { + return m.Description + } + return nil +} + +func (m *Span_TimeEvent_Annotation) GetAttributes() *Span_Attributes { + if m != nil { + return m.Attributes + } + return nil +} + +// An event describing a message sent/received between Spans. +type Span_TimeEvent_MessageEvent struct { + // Type of MessageEvent. Indicates whether the message was sent or + // received. + Type Span_TimeEvent_MessageEvent_Type `protobuf:"varint,1,opt,name=type,enum=google.devtools.cloudtrace.v2.Span_TimeEvent_MessageEvent_Type" json:"type,omitempty"` + // An identifier for the MessageEvent's message that can be used to match + // SENT and RECEIVED MessageEvents. It is recommended to be unique within + // a Span. + Id int64 `protobuf:"varint,2,opt,name=id" json:"id,omitempty"` + // The number of uncompressed bytes sent or received. + UncompressedSizeBytes int64 `protobuf:"varint,3,opt,name=uncompressed_size_bytes,json=uncompressedSizeBytes" json:"uncompressed_size_bytes,omitempty"` + // The number of compressed bytes sent or received. If missing assumed to + // be the same size as uncompressed. + CompressedSizeBytes int64 `protobuf:"varint,4,opt,name=compressed_size_bytes,json=compressedSizeBytes" json:"compressed_size_bytes,omitempty"` +} + +func (m *Span_TimeEvent_MessageEvent) Reset() { *m = Span_TimeEvent_MessageEvent{} } +func (m *Span_TimeEvent_MessageEvent) String() string { return proto.CompactTextString(m) } +func (*Span_TimeEvent_MessageEvent) ProtoMessage() {} +func (*Span_TimeEvent_MessageEvent) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{0, 1, 1} +} + +func (m *Span_TimeEvent_MessageEvent) GetType() Span_TimeEvent_MessageEvent_Type { + if m != nil { + return m.Type + } + return Span_TimeEvent_MessageEvent_TYPE_UNSPECIFIED +} + +func (m *Span_TimeEvent_MessageEvent) GetId() int64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *Span_TimeEvent_MessageEvent) GetUncompressedSizeBytes() int64 { + if m != nil { + return m.UncompressedSizeBytes + } + return 0 +} + +func (m *Span_TimeEvent_MessageEvent) GetCompressedSizeBytes() int64 { + if m != nil { + return m.CompressedSizeBytes + } + return 0 +} + +// A collection of `TimeEvent`s. A `TimeEvent` is a time-stamped annotation +// on the span, consisting of either user-supplied key:value pairs, or +// details of a message sent/received between Spans. +type Span_TimeEvents struct { + // A collection of `TimeEvent`s. + TimeEvent []*Span_TimeEvent `protobuf:"bytes,1,rep,name=time_event,json=timeEvent" json:"time_event,omitempty"` + // The number of dropped annotations in all the included time events. + // If the value is 0, then no annotations were dropped. + DroppedAnnotationsCount int32 `protobuf:"varint,2,opt,name=dropped_annotations_count,json=droppedAnnotationsCount" json:"dropped_annotations_count,omitempty"` + // The number of dropped message events in all the included time events. + // If the value is 0, then no message events were dropped. + DroppedMessageEventsCount int32 `protobuf:"varint,3,opt,name=dropped_message_events_count,json=droppedMessageEventsCount" json:"dropped_message_events_count,omitempty"` +} + +func (m *Span_TimeEvents) Reset() { *m = Span_TimeEvents{} } +func (m *Span_TimeEvents) String() string { return proto.CompactTextString(m) } +func (*Span_TimeEvents) ProtoMessage() {} +func (*Span_TimeEvents) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 2} } + +func (m *Span_TimeEvents) GetTimeEvent() []*Span_TimeEvent { + if m != nil { + return m.TimeEvent + } + return nil +} + +func (m *Span_TimeEvents) GetDroppedAnnotationsCount() int32 { + if m != nil { + return m.DroppedAnnotationsCount + } + return 0 +} + +func (m *Span_TimeEvents) GetDroppedMessageEventsCount() int32 { + if m != nil { + return m.DroppedMessageEventsCount + } + return 0 +} + +// A pointer from the current span to another span in the same trace or in a +// different trace. For example, this can be used in batching operations, +// where a single batch handler processes multiple requests from different +// traces or when the handler receives a request from a different project. +type Span_Link struct { + // `TRACE_ID` identifies a trace within a project. + TraceId string `protobuf:"bytes,1,opt,name=trace_id,json=traceId" json:"trace_id,omitempty"` + // `SPAN_ID` identifies a span within a trace. + SpanId string `protobuf:"bytes,2,opt,name=span_id,json=spanId" json:"span_id,omitempty"` + // The relationship of the current span relative to the linked span. + Type Span_Link_Type `protobuf:"varint,3,opt,name=type,enum=google.devtools.cloudtrace.v2.Span_Link_Type" json:"type,omitempty"` + // A set of attributes on the link. There is a limit of 32 attributes per + // link. + Attributes *Span_Attributes `protobuf:"bytes,4,opt,name=attributes" json:"attributes,omitempty"` +} + +func (m *Span_Link) Reset() { *m = Span_Link{} } +func (m *Span_Link) String() string { return proto.CompactTextString(m) } +func (*Span_Link) ProtoMessage() {} +func (*Span_Link) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 3} } + +func (m *Span_Link) GetTraceId() string { + if m != nil { + return m.TraceId + } + return "" +} + +func (m *Span_Link) GetSpanId() string { + if m != nil { + return m.SpanId + } + return "" +} + +func (m *Span_Link) GetType() Span_Link_Type { + if m != nil { + return m.Type + } + return Span_Link_TYPE_UNSPECIFIED +} + +func (m *Span_Link) GetAttributes() *Span_Attributes { + if m != nil { + return m.Attributes + } + return nil +} + +// A collection of links, which are references from this span to a span +// in the same or different trace. +type Span_Links struct { + // A collection of links. + Link []*Span_Link `protobuf:"bytes,1,rep,name=link" json:"link,omitempty"` + // The number of dropped links after the maximum size was enforced. If + // this value is 0, then no links were dropped. + DroppedLinksCount int32 `protobuf:"varint,2,opt,name=dropped_links_count,json=droppedLinksCount" json:"dropped_links_count,omitempty"` +} + +func (m *Span_Links) Reset() { *m = Span_Links{} } +func (m *Span_Links) String() string { return proto.CompactTextString(m) } +func (*Span_Links) ProtoMessage() {} +func (*Span_Links) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 4} } + +func (m *Span_Links) GetLink() []*Span_Link { + if m != nil { + return m.Link + } + return nil +} + +func (m *Span_Links) GetDroppedLinksCount() int32 { + if m != nil { + return m.DroppedLinksCount + } + return 0 +} + +// The allowed types for [VALUE] in a `[KEY]:[VALUE]` attribute. +type AttributeValue struct { + // The type of the value. + // + // Types that are valid to be assigned to Value: + // *AttributeValue_StringValue + // *AttributeValue_IntValue + // *AttributeValue_BoolValue + Value isAttributeValue_Value `protobuf_oneof:"value"` +} + +func (m *AttributeValue) Reset() { *m = AttributeValue{} } +func (m *AttributeValue) String() string { return proto.CompactTextString(m) } +func (*AttributeValue) ProtoMessage() {} +func (*AttributeValue) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +type isAttributeValue_Value interface { + isAttributeValue_Value() +} + +type AttributeValue_StringValue struct { + StringValue *TruncatableString `protobuf:"bytes,1,opt,name=string_value,json=stringValue,oneof"` +} +type AttributeValue_IntValue struct { + IntValue int64 `protobuf:"varint,2,opt,name=int_value,json=intValue,oneof"` +} +type AttributeValue_BoolValue struct { + BoolValue bool `protobuf:"varint,3,opt,name=bool_value,json=boolValue,oneof"` +} + +func (*AttributeValue_StringValue) isAttributeValue_Value() {} +func (*AttributeValue_IntValue) isAttributeValue_Value() {} +func (*AttributeValue_BoolValue) isAttributeValue_Value() {} + +func (m *AttributeValue) GetValue() isAttributeValue_Value { + if m != nil { + return m.Value + } + return nil +} + +func (m *AttributeValue) GetStringValue() *TruncatableString { + if x, ok := m.GetValue().(*AttributeValue_StringValue); ok { + return x.StringValue + } + return nil +} + +func (m *AttributeValue) GetIntValue() int64 { + if x, ok := m.GetValue().(*AttributeValue_IntValue); ok { + return x.IntValue + } + return 0 +} + +func (m *AttributeValue) GetBoolValue() bool { + if x, ok := m.GetValue().(*AttributeValue_BoolValue); ok { + return x.BoolValue + } + return false +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*AttributeValue) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _AttributeValue_OneofMarshaler, _AttributeValue_OneofUnmarshaler, _AttributeValue_OneofSizer, []interface{}{ + (*AttributeValue_StringValue)(nil), + (*AttributeValue_IntValue)(nil), + (*AttributeValue_BoolValue)(nil), + } +} + +func _AttributeValue_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*AttributeValue) + // value + switch x := m.Value.(type) { + case *AttributeValue_StringValue: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.StringValue); err != nil { + return err + } + case *AttributeValue_IntValue: + b.EncodeVarint(2<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.IntValue)) + case *AttributeValue_BoolValue: + t := uint64(0) + if x.BoolValue { + t = 1 + } + b.EncodeVarint(3<<3 | proto.WireVarint) + b.EncodeVarint(t) + case nil: + default: + return fmt.Errorf("AttributeValue.Value has unexpected type %T", x) + } + return nil +} + +func _AttributeValue_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*AttributeValue) + switch tag { + case 1: // value.string_value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(TruncatableString) + err := b.DecodeMessage(msg) + m.Value = &AttributeValue_StringValue{msg} + return true, err + case 2: // value.int_value + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Value = &AttributeValue_IntValue{int64(x)} + return true, err + case 3: // value.bool_value + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Value = &AttributeValue_BoolValue{x != 0} + return true, err + default: + return false, nil + } +} + +func _AttributeValue_OneofSizer(msg proto.Message) (n int) { + m := msg.(*AttributeValue) + // value + switch x := m.Value.(type) { + case *AttributeValue_StringValue: + s := proto.Size(x.StringValue) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *AttributeValue_IntValue: + n += proto.SizeVarint(2<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.IntValue)) + case *AttributeValue_BoolValue: + n += proto.SizeVarint(3<<3 | proto.WireVarint) + n += 1 + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// A call stack appearing in a trace. +type StackTrace struct { + // Stack frames in this stack trace. A maximum of 128 frames are allowed. + StackFrames *StackTrace_StackFrames `protobuf:"bytes,1,opt,name=stack_frames,json=stackFrames" json:"stack_frames,omitempty"` + // The hash ID is used to conserve network bandwidth for duplicate + // stack traces within a single trace. + // + // Often multiple spans will have identical stack traces. + // The first occurrence of a stack trace should contain both the + // `stackFrame` content and a value in `stackTraceHashId`. + // + // Subsequent spans within the same request can refer + // to that stack trace by only setting `stackTraceHashId`. + StackTraceHashId int64 `protobuf:"varint,2,opt,name=stack_trace_hash_id,json=stackTraceHashId" json:"stack_trace_hash_id,omitempty"` +} + +func (m *StackTrace) Reset() { *m = StackTrace{} } +func (m *StackTrace) String() string { return proto.CompactTextString(m) } +func (*StackTrace) ProtoMessage() {} +func (*StackTrace) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *StackTrace) GetStackFrames() *StackTrace_StackFrames { + if m != nil { + return m.StackFrames + } + return nil +} + +func (m *StackTrace) GetStackTraceHashId() int64 { + if m != nil { + return m.StackTraceHashId + } + return 0 +} + +// Represents a single stack frame in a stack trace. +type StackTrace_StackFrame struct { + // The fully-qualified name that uniquely identifies the function or + // method that is active in this frame (up to 1024 bytes). + FunctionName *TruncatableString `protobuf:"bytes,1,opt,name=function_name,json=functionName" json:"function_name,omitempty"` + // An un-mangled function name, if `function_name` is + // [mangled](http://www.avabodh.com/cxxin/namemangling.html). The name can + // be fully-qualified (up to 1024 bytes). + OriginalFunctionName *TruncatableString `protobuf:"bytes,2,opt,name=original_function_name,json=originalFunctionName" json:"original_function_name,omitempty"` + // The name of the source file where the function call appears (up to 256 + // bytes). + FileName *TruncatableString `protobuf:"bytes,3,opt,name=file_name,json=fileName" json:"file_name,omitempty"` + // The line number in `file_name` where the function call appears. + LineNumber int64 `protobuf:"varint,4,opt,name=line_number,json=lineNumber" json:"line_number,omitempty"` + // The column number where the function call appears, if available. + // This is important in JavaScript because of its anonymous functions. + ColumnNumber int64 `protobuf:"varint,5,opt,name=column_number,json=columnNumber" json:"column_number,omitempty"` + // The binary module from where the code was loaded. + LoadModule *Module `protobuf:"bytes,6,opt,name=load_module,json=loadModule" json:"load_module,omitempty"` + // The version of the deployed source code (up to 128 bytes). + SourceVersion *TruncatableString `protobuf:"bytes,7,opt,name=source_version,json=sourceVersion" json:"source_version,omitempty"` +} + +func (m *StackTrace_StackFrame) Reset() { *m = StackTrace_StackFrame{} } +func (m *StackTrace_StackFrame) String() string { return proto.CompactTextString(m) } +func (*StackTrace_StackFrame) ProtoMessage() {} +func (*StackTrace_StackFrame) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2, 0} } + +func (m *StackTrace_StackFrame) GetFunctionName() *TruncatableString { + if m != nil { + return m.FunctionName + } + return nil +} + +func (m *StackTrace_StackFrame) GetOriginalFunctionName() *TruncatableString { + if m != nil { + return m.OriginalFunctionName + } + return nil +} + +func (m *StackTrace_StackFrame) GetFileName() *TruncatableString { + if m != nil { + return m.FileName + } + return nil +} + +func (m *StackTrace_StackFrame) GetLineNumber() int64 { + if m != nil { + return m.LineNumber + } + return 0 +} + +func (m *StackTrace_StackFrame) GetColumnNumber() int64 { + if m != nil { + return m.ColumnNumber + } + return 0 +} + +func (m *StackTrace_StackFrame) GetLoadModule() *Module { + if m != nil { + return m.LoadModule + } + return nil +} + +func (m *StackTrace_StackFrame) GetSourceVersion() *TruncatableString { + if m != nil { + return m.SourceVersion + } + return nil +} + +// A collection of stack frames, which can be truncated. +type StackTrace_StackFrames struct { + // Stack frames in this call stack. + Frame []*StackTrace_StackFrame `protobuf:"bytes,1,rep,name=frame" json:"frame,omitempty"` + // The number of stack frames that were dropped because there + // were too many stack frames. + // If this value is 0, then no stack frames were dropped. + DroppedFramesCount int32 `protobuf:"varint,2,opt,name=dropped_frames_count,json=droppedFramesCount" json:"dropped_frames_count,omitempty"` +} + +func (m *StackTrace_StackFrames) Reset() { *m = StackTrace_StackFrames{} } +func (m *StackTrace_StackFrames) String() string { return proto.CompactTextString(m) } +func (*StackTrace_StackFrames) ProtoMessage() {} +func (*StackTrace_StackFrames) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2, 1} } + +func (m *StackTrace_StackFrames) GetFrame() []*StackTrace_StackFrame { + if m != nil { + return m.Frame + } + return nil +} + +func (m *StackTrace_StackFrames) GetDroppedFramesCount() int32 { + if m != nil { + return m.DroppedFramesCount + } + return 0 +} + +// Binary module. +type Module struct { + // For example: main binary, kernel modules, and dynamic libraries + // such as libc.so, sharedlib.so (up to 256 bytes). + Module *TruncatableString `protobuf:"bytes,1,opt,name=module" json:"module,omitempty"` + // A unique identifier for the module, usually a hash of its + // contents (up to 128 bytes). + BuildId *TruncatableString `protobuf:"bytes,2,opt,name=build_id,json=buildId" json:"build_id,omitempty"` +} + +func (m *Module) Reset() { *m = Module{} } +func (m *Module) String() string { return proto.CompactTextString(m) } +func (*Module) ProtoMessage() {} +func (*Module) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *Module) GetModule() *TruncatableString { + if m != nil { + return m.Module + } + return nil +} + +func (m *Module) GetBuildId() *TruncatableString { + if m != nil { + return m.BuildId + } + return nil +} + +// Represents a string that might be shortened to a specified length. +type TruncatableString struct { + // The shortened string. For example, if the original string was 500 + // bytes long and the limit of the string was 128 bytes, then this + // value contains the first 128 bytes of the 500-byte string. Note that + // truncation always happens on the character boundary, to ensure that + // truncated string is still valid UTF8. In case of multi-byte characters, + // size of truncated string can be less than truncation limit. + Value string `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"` + // The number of bytes removed from the original string. If this + // value is 0, then the string was not shortened. + TruncatedByteCount int32 `protobuf:"varint,2,opt,name=truncated_byte_count,json=truncatedByteCount" json:"truncated_byte_count,omitempty"` +} + +func (m *TruncatableString) Reset() { *m = TruncatableString{} } +func (m *TruncatableString) String() string { return proto.CompactTextString(m) } +func (*TruncatableString) ProtoMessage() {} +func (*TruncatableString) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *TruncatableString) GetValue() string { + if m != nil { + return m.Value + } + return "" +} + +func (m *TruncatableString) GetTruncatedByteCount() int32 { + if m != nil { + return m.TruncatedByteCount + } + return 0 +} + +func init() { + proto.RegisterType((*Span)(nil), "google.devtools.cloudtrace.v2.Span") + proto.RegisterType((*Span_Attributes)(nil), "google.devtools.cloudtrace.v2.Span.Attributes") + proto.RegisterType((*Span_TimeEvent)(nil), "google.devtools.cloudtrace.v2.Span.TimeEvent") + proto.RegisterType((*Span_TimeEvent_Annotation)(nil), "google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation") + proto.RegisterType((*Span_TimeEvent_MessageEvent)(nil), "google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent") + proto.RegisterType((*Span_TimeEvents)(nil), "google.devtools.cloudtrace.v2.Span.TimeEvents") + proto.RegisterType((*Span_Link)(nil), "google.devtools.cloudtrace.v2.Span.Link") + proto.RegisterType((*Span_Links)(nil), "google.devtools.cloudtrace.v2.Span.Links") + proto.RegisterType((*AttributeValue)(nil), "google.devtools.cloudtrace.v2.AttributeValue") + proto.RegisterType((*StackTrace)(nil), "google.devtools.cloudtrace.v2.StackTrace") + proto.RegisterType((*StackTrace_StackFrame)(nil), "google.devtools.cloudtrace.v2.StackTrace.StackFrame") + proto.RegisterType((*StackTrace_StackFrames)(nil), "google.devtools.cloudtrace.v2.StackTrace.StackFrames") + proto.RegisterType((*Module)(nil), "google.devtools.cloudtrace.v2.Module") + proto.RegisterType((*TruncatableString)(nil), "google.devtools.cloudtrace.v2.TruncatableString") + proto.RegisterEnum("google.devtools.cloudtrace.v2.Span_TimeEvent_MessageEvent_Type", Span_TimeEvent_MessageEvent_Type_name, Span_TimeEvent_MessageEvent_Type_value) + proto.RegisterEnum("google.devtools.cloudtrace.v2.Span_Link_Type", Span_Link_Type_name, Span_Link_Type_value) +} + +func init() { proto.RegisterFile("google/devtools/cloudtrace/v2/trace.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 1425 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x57, 0x4b, 0x6f, 0xdb, 0xc6, + 0x16, 0x36, 0xf5, 0xd6, 0x91, 0x6c, 0xc8, 0x13, 0x3b, 0x56, 0x94, 0xe4, 0x26, 0xd7, 0xf7, 0x16, + 0x70, 0x0a, 0x98, 0x0a, 0x94, 0xa4, 0x48, 0xd3, 0x02, 0xa9, 0x1f, 0x72, 0xa4, 0xc4, 0x56, 0x05, + 0x4a, 0x71, 0xd3, 0x34, 0x00, 0x31, 0x22, 0xc7, 0x32, 0x11, 0x8a, 0x24, 0x38, 0x43, 0x17, 0xce, + 0xae, 0xeb, 0xae, 0xbb, 0x29, 0x50, 0x74, 0x59, 0x20, 0xab, 0xfc, 0x8e, 0x2e, 0xba, 0xed, 0x7f, + 0xe9, 0xaa, 0x98, 0x07, 0x49, 0x29, 0x2f, 0xdb, 0xca, 0x6e, 0x66, 0xce, 0xf9, 0x3e, 0x9e, 0x33, + 0x73,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xe0, 0xd0, 0x0f, + 0xfc, 0x6d, 0x7f, 0x95, 0xee, 0x5e, 0x67, 0x56, 0x1f, 0x49, 0xa6, 0x1d, 0x7e, 0xa6, 0xcb, 0x47, + 0x3d, 0x6c, 0xfd, 0x19, 0x9f, 0xbf, 0x10, 0xe7, 0x2f, 0xc4, 0xf9, 0x8b, 0xc3, 0xd6, 0xa8, 0x20, + 0xbe, 0x71, 0xe7, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x7b, 0x3c, 0x8a, 0x77, 0xd0, 0x0f, 0x00, + 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/devtools/cloudtrace/v2/tracing.pb.go b/vendor/google.golang.org/genproto/googleapis/devtools/cloudtrace/v2/tracing.pb.go new file mode 100644 index 0000000000..da4cefa296 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/devtools/cloudtrace/v2/tracing.pb.go @@ -0,0 +1,202 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/devtools/cloudtrace/v2/tracing.proto + +package cloudtrace + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf4 "github.com/golang/protobuf/ptypes/empty" +import _ "github.com/golang/protobuf/ptypes/timestamp" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// The request message for the `BatchWriteSpans` method. +type BatchWriteSpansRequest struct { + // Required. Name of the project where the spans belong. The format is + // `projects/PROJECT_ID`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // A collection of spans. + Spans []*Span `protobuf:"bytes,2,rep,name=spans" json:"spans,omitempty"` +} + +func (m *BatchWriteSpansRequest) Reset() { *m = BatchWriteSpansRequest{} } +func (m *BatchWriteSpansRequest) String() string { return proto.CompactTextString(m) } +func (*BatchWriteSpansRequest) ProtoMessage() {} +func (*BatchWriteSpansRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +func (m *BatchWriteSpansRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *BatchWriteSpansRequest) GetSpans() []*Span { + if m != nil { + return m.Spans + } + return nil +} + +func init() { + proto.RegisterType((*BatchWriteSpansRequest)(nil), "google.devtools.cloudtrace.v2.BatchWriteSpansRequest") +} + +// 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 + +// Client API for TraceService service + +type TraceServiceClient interface { + // Sends new spans to Stackdriver Trace or updates existing traces. If the + // name of a trace that you send matches that of an existing trace, new spans + // are added to the existing trace. Attempt to update existing spans results + // undefined behavior. If the name does not match, a new trace is created + // with given set of spans. + BatchWriteSpans(ctx context.Context, in *BatchWriteSpansRequest, opts ...grpc.CallOption) (*google_protobuf4.Empty, error) + // Creates a new Span. + CreateSpan(ctx context.Context, in *Span, opts ...grpc.CallOption) (*Span, error) +} + +type traceServiceClient struct { + cc *grpc.ClientConn +} + +func NewTraceServiceClient(cc *grpc.ClientConn) TraceServiceClient { + return &traceServiceClient{cc} +} + +func (c *traceServiceClient) BatchWriteSpans(ctx context.Context, in *BatchWriteSpansRequest, opts ...grpc.CallOption) (*google_protobuf4.Empty, error) { + out := new(google_protobuf4.Empty) + err := grpc.Invoke(ctx, "/google.devtools.cloudtrace.v2.TraceService/BatchWriteSpans", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *traceServiceClient) CreateSpan(ctx context.Context, in *Span, opts ...grpc.CallOption) (*Span, error) { + out := new(Span) + err := grpc.Invoke(ctx, "/google.devtools.cloudtrace.v2.TraceService/CreateSpan", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for TraceService service + +type TraceServiceServer interface { + // Sends new spans to Stackdriver Trace or updates existing traces. If the + // name of a trace that you send matches that of an existing trace, new spans + // are added to the existing trace. Attempt to update existing spans results + // undefined behavior. If the name does not match, a new trace is created + // with given set of spans. + BatchWriteSpans(context.Context, *BatchWriteSpansRequest) (*google_protobuf4.Empty, error) + // Creates a new Span. + CreateSpan(context.Context, *Span) (*Span, error) +} + +func RegisterTraceServiceServer(s *grpc.Server, srv TraceServiceServer) { + s.RegisterService(&_TraceService_serviceDesc, srv) +} + +func _TraceService_BatchWriteSpans_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BatchWriteSpansRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TraceServiceServer).BatchWriteSpans(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.cloudtrace.v2.TraceService/BatchWriteSpans", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TraceServiceServer).BatchWriteSpans(ctx, req.(*BatchWriteSpansRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TraceService_CreateSpan_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Span) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TraceServiceServer).CreateSpan(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.cloudtrace.v2.TraceService/CreateSpan", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TraceServiceServer).CreateSpan(ctx, req.(*Span)) + } + return interceptor(ctx, in, info, handler) +} + +var _TraceService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.devtools.cloudtrace.v2.TraceService", + HandlerType: (*TraceServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "BatchWriteSpans", + Handler: _TraceService_BatchWriteSpans_Handler, + }, + { + MethodName: "CreateSpan", + Handler: _TraceService_CreateSpan_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/devtools/cloudtrace/v2/tracing.proto", +} + +func init() { proto.RegisterFile("google/devtools/cloudtrace/v2/tracing.proto", fileDescriptor1) } + +var fileDescriptor1 = []byte{ + // 406 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x4f, 0x8b, 0x13, 0x31, + 0x18, 0xc6, 0xc9, 0xf8, 0x07, 0x8c, 0x82, 0x10, 0xb0, 0x94, 0x51, 0xb1, 0x8e, 0xa0, 0x75, 0x2a, + 0x09, 0x8e, 0x78, 0xb0, 0xe2, 0xa5, 0x45, 0x7a, 0x2d, 0xad, 0x54, 0x90, 0x5e, 0xd2, 0x69, 0x8c, + 0x91, 0x99, 0x64, 0x9c, 0xa4, 0x03, 0x22, 0xbd, 0x78, 0xf3, 0xac, 0x9f, 0x42, 0xf6, 0xb2, 0x5f, + 0x63, 0xaf, 0xfb, 0x15, 0xf6, 0x83, 0x2c, 0x49, 0x66, 0xb6, 0x50, 0xba, 0x6d, 0x6f, 0xc9, 0xfb, + 0xfe, 0xf2, 0xbc, 0xef, 0xf3, 0xcc, 0xc0, 0x1e, 0x57, 0x8a, 0x67, 0x8c, 0x2c, 0x59, 0x65, 0x94, + 0xca, 0x34, 0x49, 0x33, 0xb5, 0x5a, 0x9a, 0x92, 0xa6, 0x8c, 0x54, 0x09, 0xb1, 0x07, 0x21, 0x39, + 0x2e, 0x4a, 0x65, 0x14, 0x7a, 0xec, 0x61, 0xdc, 0xc0, 0x78, 0x03, 0xe3, 0x2a, 0x09, 0x1f, 0xd5, + 0x5a, 0xb4, 0x10, 0x84, 0x4a, 0xa9, 0x0c, 0x35, 0x42, 0x49, 0xed, 0x1f, 0x87, 0x2f, 0x0f, 0x4f, + 0x62, 0x35, 0xfa, 0xb0, 0x46, 0xdd, 0x6d, 0xb1, 0xfa, 0x4a, 0x58, 0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 0xbe, 0x8c, 0x6a, 0x9c, 0xab, 0x8c, 0x4a, 0x8e, 0x55, 0xc9, 0x09, 0x67, 0xd2, + 0x45, 0x43, 0x7c, 0x8b, 0x16, 0x42, 0x5f, 0xf3, 0x6b, 0xbd, 0xdf, 0xdc, 0xfe, 0x07, 0x0f, 0x46, + 0x5e, 0x69, 0x68, 0x6b, 0xd8, 0x7d, 0x3d, 0x3c, 0x4b, 0xce, 0x9a, 0xfa, 0xdc, 0xd5, 0xe7, 0xae, + 0x3e, 0x9f, 0x25, 0x8b, 0xdb, 0x6e, 0xc6, 0x9b, 0xcb, 0x00, 0x00, 0x00, 0xff, 0xff, 0x36, 0x80, + 0xe7, 0x5c, 0x27, 0x03, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/devtools/containeranalysis/v1alpha1/bill_of_materials.pb.go b/vendor/google.golang.org/genproto/googleapis/devtools/containeranalysis/v1alpha1/bill_of_materials.pb.go new file mode 100644 index 0000000000..9773761d48 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/devtools/containeranalysis/v1alpha1/bill_of_materials.pb.go @@ -0,0 +1,329 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/devtools/containeranalysis/v1alpha1/bill_of_materials.proto + +/* +Package containeranalysis is a generated protocol buffer package. + +It is generated from these files: + google/devtools/containeranalysis/v1alpha1/bill_of_materials.proto + google/devtools/containeranalysis/v1alpha1/containeranalysis.proto + google/devtools/containeranalysis/v1alpha1/image_basis.proto + google/devtools/containeranalysis/v1alpha1/package_vulnerability.proto + google/devtools/containeranalysis/v1alpha1/provenance.proto + google/devtools/containeranalysis/v1alpha1/source_context.proto + +It has these top-level messages: + PackageManager + Occurrence + Note + Deployable + Discovery + BuildType + BuildSignature + BuildDetails + GetOccurrenceRequest + ListOccurrencesRequest + ListOccurrencesResponse + DeleteOccurrenceRequest + CreateOccurrenceRequest + UpdateOccurrenceRequest + GetNoteRequest + GetOccurrenceNoteRequest + ListNotesRequest + ListNotesResponse + DeleteNoteRequest + CreateNoteRequest + UpdateNoteRequest + ListNoteOccurrencesRequest + ListNoteOccurrencesResponse + OperationMetadata + GetVulnzOccurrencesSummaryRequest + GetVulnzOccurrencesSummaryResponse + DockerImage + VulnerabilityType + BuildProvenance + Source + FileHashes + Hash + StorageSource + RepoSource + Command + Artifact + SourceContext + AliasContext + CloudRepoSourceContext + GerritSourceContext + GitSourceContext + RepoId + ProjectRepoId +*/ +package containeranalysis + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Instruction set architectures supported by various package managers. +type PackageManager_Architecture int32 + +const ( + // Unknown architecture + PackageManager_ARCHITECTURE_UNSPECIFIED PackageManager_Architecture = 0 + // X86 architecture + PackageManager_X86 PackageManager_Architecture = 1 + // X64 architecture + PackageManager_X64 PackageManager_Architecture = 2 +) + +var PackageManager_Architecture_name = map[int32]string{ + 0: "ARCHITECTURE_UNSPECIFIED", + 1: "X86", + 2: "X64", +} +var PackageManager_Architecture_value = map[string]int32{ + "ARCHITECTURE_UNSPECIFIED": 0, + "X86": 1, + "X64": 2, +} + +func (x PackageManager_Architecture) String() string { + return proto.EnumName(PackageManager_Architecture_name, int32(x)) +} +func (PackageManager_Architecture) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{0, 0} +} + +// PackageManager provides metadata about available / installed packages. +type PackageManager struct { +} + +func (m *PackageManager) Reset() { *m = PackageManager{} } +func (m *PackageManager) String() string { return proto.CompactTextString(m) } +func (*PackageManager) ProtoMessage() {} +func (*PackageManager) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +// This represents a particular channel of distribution for a given package. +// e.g. Debian's jessie-backports dpkg mirror +type PackageManager_Distribution struct { + // The cpe_uri in [cpe format](https://cpe.mitre.org/specification/) + // denoting the package manager version distributing a package. + CpeUri string `protobuf:"bytes,1,opt,name=cpe_uri,json=cpeUri" json:"cpe_uri,omitempty"` + // The CPU architecture for which packages in this distribution + // channel were built + Architecture PackageManager_Architecture `protobuf:"varint,2,opt,name=architecture,enum=google.devtools.containeranalysis.v1alpha1.PackageManager_Architecture" json:"architecture,omitempty"` + // The latest available version of this package in + // this distribution channel. + LatestVersion *VulnerabilityType_Version `protobuf:"bytes,3,opt,name=latest_version,json=latestVersion" json:"latest_version,omitempty"` + // A freeform string denoting the maintainer of this package. + Maintainer string `protobuf:"bytes,4,opt,name=maintainer" json:"maintainer,omitempty"` + // The distribution channel-specific homepage for this package. + Url string `protobuf:"bytes,6,opt,name=url" json:"url,omitempty"` + // The distribution channel-specific description of this package. + Description string `protobuf:"bytes,7,opt,name=description" json:"description,omitempty"` +} + +func (m *PackageManager_Distribution) Reset() { *m = PackageManager_Distribution{} } +func (m *PackageManager_Distribution) String() string { return proto.CompactTextString(m) } +func (*PackageManager_Distribution) ProtoMessage() {} +func (*PackageManager_Distribution) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 0} } + +func (m *PackageManager_Distribution) GetCpeUri() string { + if m != nil { + return m.CpeUri + } + return "" +} + +func (m *PackageManager_Distribution) GetArchitecture() PackageManager_Architecture { + if m != nil { + return m.Architecture + } + return PackageManager_ARCHITECTURE_UNSPECIFIED +} + +func (m *PackageManager_Distribution) GetLatestVersion() *VulnerabilityType_Version { + if m != nil { + return m.LatestVersion + } + return nil +} + +func (m *PackageManager_Distribution) GetMaintainer() string { + if m != nil { + return m.Maintainer + } + return "" +} + +func (m *PackageManager_Distribution) GetUrl() string { + if m != nil { + return m.Url + } + return "" +} + +func (m *PackageManager_Distribution) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +// An occurrence of a particular package installation found within a +// system's filesystem. +// e.g. glibc was found in /var/lib/dpkg/status +type PackageManager_Location struct { + // The cpe_uri in [cpe format](https://cpe.mitre.org/specification/) + // denoting the package manager version distributing a package. + CpeUri string `protobuf:"bytes,1,opt,name=cpe_uri,json=cpeUri" json:"cpe_uri,omitempty"` + // The version installed at this location. + Version *VulnerabilityType_Version `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"` + // The path from which we gathered that this package/version is installed. + Path string `protobuf:"bytes,3,opt,name=path" json:"path,omitempty"` +} + +func (m *PackageManager_Location) Reset() { *m = PackageManager_Location{} } +func (m *PackageManager_Location) String() string { return proto.CompactTextString(m) } +func (*PackageManager_Location) ProtoMessage() {} +func (*PackageManager_Location) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 1} } + +func (m *PackageManager_Location) GetCpeUri() string { + if m != nil { + return m.CpeUri + } + return "" +} + +func (m *PackageManager_Location) GetVersion() *VulnerabilityType_Version { + if m != nil { + return m.Version + } + return nil +} + +func (m *PackageManager_Location) GetPath() string { + if m != nil { + return m.Path + } + return "" +} + +// This represents a particular package that is distributed over +// various channels. +// e.g. glibc (aka libc6) is distributed by many, at various versions. +type PackageManager_Package struct { + // The name of the package. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The various channels by which a package is distributed. + Distribution []*PackageManager_Distribution `protobuf:"bytes,10,rep,name=distribution" json:"distribution,omitempty"` +} + +func (m *PackageManager_Package) Reset() { *m = PackageManager_Package{} } +func (m *PackageManager_Package) String() string { return proto.CompactTextString(m) } +func (*PackageManager_Package) ProtoMessage() {} +func (*PackageManager_Package) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 2} } + +func (m *PackageManager_Package) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *PackageManager_Package) GetDistribution() []*PackageManager_Distribution { + if m != nil { + return m.Distribution + } + return nil +} + +// This represents how a particular software package may be installed on +// a system. +type PackageManager_Installation struct { + // Output only. The name of the installed package. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // All of the places within the filesystem versions of this package + // have been found. + Location []*PackageManager_Location `protobuf:"bytes,2,rep,name=location" json:"location,omitempty"` +} + +func (m *PackageManager_Installation) Reset() { *m = PackageManager_Installation{} } +func (m *PackageManager_Installation) String() string { return proto.CompactTextString(m) } +func (*PackageManager_Installation) ProtoMessage() {} +func (*PackageManager_Installation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 3} } + +func (m *PackageManager_Installation) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *PackageManager_Installation) GetLocation() []*PackageManager_Location { + if m != nil { + return m.Location + } + return nil +} + +func init() { + proto.RegisterType((*PackageManager)(nil), "google.devtools.containeranalysis.v1alpha1.PackageManager") + proto.RegisterType((*PackageManager_Distribution)(nil), "google.devtools.containeranalysis.v1alpha1.PackageManager.Distribution") + proto.RegisterType((*PackageManager_Location)(nil), "google.devtools.containeranalysis.v1alpha1.PackageManager.Location") + proto.RegisterType((*PackageManager_Package)(nil), "google.devtools.containeranalysis.v1alpha1.PackageManager.Package") + proto.RegisterType((*PackageManager_Installation)(nil), "google.devtools.containeranalysis.v1alpha1.PackageManager.Installation") + proto.RegisterEnum("google.devtools.containeranalysis.v1alpha1.PackageManager_Architecture", PackageManager_Architecture_name, PackageManager_Architecture_value) +} + +func init() { + proto.RegisterFile("google/devtools/containeranalysis/v1alpha1/bill_of_materials.proto", fileDescriptor0) +} + +var fileDescriptor0 = []byte{ + // 522 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x93, 0xd1, 0x8a, 0xd3, 0x4e, + 0x14, 0xc6, 0xff, 0x49, 0x97, 0x76, 0xf7, 0xb4, 0xff, 0x52, 0xe6, 0xc6, 0x10, 0x16, 0x29, 0x0b, + 0x42, 0xf1, 0x22, 0x61, 0x57, 0x59, 0x04, 0x41, 0xe8, 0x76, 0xbb, 0x6b, 0x41, 0xa5, 0xc4, 0x76, + 0x11, 0xbd, 0x08, 0xa7, 0xe9, 0x98, 0x0e, 0x3b, 0x9d, 0x09, 0x93, 0x49, 0xa1, 0xd7, 0xde, 0x89, + 0x0f, 0xe0, 0xb5, 0x0f, 0xa5, 0xaf, 0x23, 0x99, 0x24, 0x92, 0xb2, 0x2a, 0xbb, 0xac, 0x77, 0x27, + 0xf3, 0x85, 0xdf, 0xf9, 0xce, 0x77, 0x66, 0xe0, 0x2c, 0x96, 0x32, 0xe6, 0xd4, 0x5f, 0xd2, 0x8d, + 0x96, 0x92, 0xa7, 0x7e, 0x24, 0x85, 0x46, 0x26, 0xa8, 0x42, 0x81, 0x7c, 0x9b, 0xb2, 0xd4, 0xdf, + 0x1c, 0x23, 0x4f, 0x56, 0x78, 0xec, 0x2f, 0x18, 0xe7, 0xa1, 0xfc, 0x18, 0xae, 0x51, 0x53, 0xc5, + 0x90, 0xa7, 0x5e, 0xa2, 0xa4, 0x96, 0xe4, 0x71, 0xc1, 0xf0, 0x2a, 0x86, 0x77, 0x83, 0xe1, 0x55, + 0x0c, 0xf7, 0xb0, 0xec, 0x87, 0x09, 0xf3, 0x51, 0x08, 0xa9, 0x51, 0x33, 0x29, 0x4a, 0x92, 0x7b, + 0x71, 0x07, 0x37, 0x09, 0x46, 0xd7, 0x18, 0xd3, 0x70, 0x93, 0xf1, 0x5c, 0x5f, 0x30, 0xce, 0xf4, + 0xb6, 0xe0, 0x1c, 0xfd, 0x68, 0x42, 0x77, 0x5a, 0xe8, 0xaf, 0x51, 0x60, 0x4c, 0x95, 0xfb, 0xdd, + 0x86, 0xce, 0x39, 0x4b, 0xb5, 0x62, 0x8b, 0x2c, 0x6f, 0x49, 0x1e, 0x40, 0x2b, 0x4a, 0x68, 0x98, + 0x29, 0xe6, 0x58, 0x7d, 0x6b, 0x70, 0x10, 0x34, 0xa3, 0x84, 0xce, 0x15, 0x23, 0xd7, 0xd0, 0x41, + 0x15, 0xad, 0x98, 0xa6, 0x91, 0xce, 0x14, 0x75, 0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 0x02, + 0x3a, 0xf5, 0xdb, 0x48, 0x0e, 0xc1, 0x19, 0x06, 0xa3, 0x97, 0x93, 0xd9, 0x78, 0x34, 0x9b, 0x07, + 0xe3, 0x70, 0xfe, 0xe6, 0xed, 0x74, 0x3c, 0x9a, 0x5c, 0x4c, 0xc6, 0xe7, 0xbd, 0xff, 0x48, 0x0b, + 0x1a, 0xef, 0x9e, 0x9d, 0xf6, 0x2c, 0x53, 0x9c, 0x3e, 0xed, 0xd9, 0x67, 0x5f, 0x2c, 0x78, 0x14, + 0xc9, 0x75, 0x65, 0xea, 0xcf, 0x5e, 0xa6, 0xd6, 0xfb, 0x0f, 0xe5, 0x4f, 0xb1, 0xe4, 0x28, 0x62, + 0x4f, 0xaa, 0xd8, 0x8f, 0xa9, 0x30, 0x2f, 0xd4, 0x2f, 0x24, 0x4c, 0x58, 0x7a, 0x9b, 0xc7, 0xfe, + 0xfc, 0x86, 0xf4, 0xcd, 0x6e, 0x5c, 0x8e, 0x86, 0x8b, 0xa6, 0xa1, 0x3d, 0xf9, 0x19, 0x00, 0x00, + 0xff, 0xff, 0xfa, 0x4f, 0xa4, 0x56, 0xc7, 0x04, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/devtools/containeranalysis/v1alpha1/containeranalysis.pb.go b/vendor/google.golang.org/genproto/googleapis/devtools/containeranalysis/v1alpha1/containeranalysis.pb.go new file mode 100644 index 0000000000..5c051b34d7 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/devtools/containeranalysis/v1alpha1/containeranalysis.pb.go @@ -0,0 +1,2526 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/devtools/containeranalysis/v1alpha1/containeranalysis.proto + +package containeranalysis + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_iam_v11 "google.golang.org/genproto/googleapis/iam/v1" +import google_iam_v1 "google.golang.org/genproto/googleapis/iam/v1" +import google_longrunning "google.golang.org/genproto/googleapis/longrunning" +import _ "github.com/golang/protobuf/ptypes/any" +import google_protobuf3 "github.com/golang/protobuf/ptypes/empty" +import google_protobuf4 "google.golang.org/genproto/protobuf/field_mask" +import google_protobuf1 "github.com/golang/protobuf/ptypes/timestamp" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This must be 1:1 with members of our oneofs, it can be used for filtering +// Note and Occurrence on their kind. +type Note_Kind int32 + +const ( + // Unknown + Note_KIND_UNSPECIFIED Note_Kind = 0 + // The note and occurrence represent a package vulnerability. + Note_PACKAGE_VULNERABILITY Note_Kind = 2 + // The note and occurrence assert build provenance. + Note_BUILD_DETAILS Note_Kind = 3 + // This represents an image basis relationship. + Note_IMAGE_BASIS Note_Kind = 4 + // This represents a package installed via a package manager. + Note_PACKAGE_MANAGER Note_Kind = 5 + // The note and occurrence track deployment events. + Note_DEPLOYABLE Note_Kind = 6 + // The note and occurrence track the initial discovery status of a resource. + Note_DISCOVERY Note_Kind = 7 +) + +var Note_Kind_name = map[int32]string{ + 0: "KIND_UNSPECIFIED", + 2: "PACKAGE_VULNERABILITY", + 3: "BUILD_DETAILS", + 4: "IMAGE_BASIS", + 5: "PACKAGE_MANAGER", + 6: "DEPLOYABLE", + 7: "DISCOVERY", +} +var Note_Kind_value = map[string]int32{ + "KIND_UNSPECIFIED": 0, + "PACKAGE_VULNERABILITY": 2, + "BUILD_DETAILS": 3, + "IMAGE_BASIS": 4, + "PACKAGE_MANAGER": 5, + "DEPLOYABLE": 6, + "DISCOVERY": 7, +} + +func (x Note_Kind) String() string { + return proto.EnumName(Note_Kind_name, int32(x)) +} +func (Note_Kind) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{1, 0} } + +// Types of platforms. +type Deployable_Deployment_Platform int32 + +const ( + // Unknown + Deployable_Deployment_PLATFORM_UNSPECIFIED Deployable_Deployment_Platform = 0 + // Google Container Engine + Deployable_Deployment_GKE Deployable_Deployment_Platform = 1 + // Google App Engine: Flexible Environment + Deployable_Deployment_FLEX Deployable_Deployment_Platform = 2 + // Custom user-defined platform + Deployable_Deployment_CUSTOM Deployable_Deployment_Platform = 3 +) + +var Deployable_Deployment_Platform_name = map[int32]string{ + 0: "PLATFORM_UNSPECIFIED", + 1: "GKE", + 2: "FLEX", + 3: "CUSTOM", +} +var Deployable_Deployment_Platform_value = map[string]int32{ + "PLATFORM_UNSPECIFIED": 0, + "GKE": 1, + "FLEX": 2, + "CUSTOM": 3, +} + +func (x Deployable_Deployment_Platform) String() string { + return proto.EnumName(Deployable_Deployment_Platform_name, int32(x)) +} +func (Deployable_Deployment_Platform) EnumDescriptor() ([]byte, []int) { + return fileDescriptor1, []int{2, 0, 0} +} + +// Public key formats +type BuildSignature_KeyType int32 + +const ( + // `KeyType` is not set. + BuildSignature_KEY_TYPE_UNSPECIFIED BuildSignature_KeyType = 0 + // `PGP ASCII Armored` public key. + BuildSignature_PGP_ASCII_ARMORED BuildSignature_KeyType = 1 + // `PKIX PEM` public key. + BuildSignature_PKIX_PEM BuildSignature_KeyType = 2 +) + +var BuildSignature_KeyType_name = map[int32]string{ + 0: "KEY_TYPE_UNSPECIFIED", + 1: "PGP_ASCII_ARMORED", + 2: "PKIX_PEM", +} +var BuildSignature_KeyType_value = map[string]int32{ + "KEY_TYPE_UNSPECIFIED": 0, + "PGP_ASCII_ARMORED": 1, + "PKIX_PEM": 2, +} + +func (x BuildSignature_KeyType) String() string { + return proto.EnumName(BuildSignature_KeyType_name, int32(x)) +} +func (BuildSignature_KeyType) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{5, 0} } + +// `Occurrence` includes information about analysis occurrences for an image. +type Occurrence struct { + // Output only. The name of the `Occurrence` in the form + // "projects/{project_id}/occurrences/{OCCURRENCE_ID}" + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The unique URL of the image or the container for which the `Occurrence` + // applies. For example, https://gcr.io/project/image@sha256:foo This field + // can be used as a filter in list requests. + ResourceUrl string `protobuf:"bytes,2,opt,name=resource_url,json=resourceUrl" json:"resource_url,omitempty"` + // An analysis note associated with this image, in the form + // "providers/{provider_id}/notes/{NOTE_ID}" + // This field can be used as a filter in list requests. + NoteName string `protobuf:"bytes,3,opt,name=note_name,json=noteName" json:"note_name,omitempty"` + // Output only. This explicitly denotes which of the `Occurrence` details are + // specified. This field can be used as a filter in list requests. + Kind Note_Kind `protobuf:"varint,6,opt,name=kind,enum=google.devtools.containeranalysis.v1alpha1.Note_Kind" json:"kind,omitempty"` + // Describes the details of the vulnerability `Note` found in this resource. + // + // Types that are valid to be assigned to Details: + // *Occurrence_VulnerabilityDetails + // *Occurrence_BuildDetails + // *Occurrence_DerivedImage + // *Occurrence_Installation + // *Occurrence_Deployment + // *Occurrence_Discovered + Details isOccurrence_Details `protobuf_oneof:"details"` + // A description of actions that can be taken to remedy the `Note` + Remediation string `protobuf:"bytes,5,opt,name=remediation" json:"remediation,omitempty"` + // Output only. The time this `Occurrence` was created. + CreateTime *google_protobuf1.Timestamp `protobuf:"bytes,9,opt,name=create_time,json=createTime" json:"create_time,omitempty"` + // Output only. The time this `Occurrence` was last updated. + UpdateTime *google_protobuf1.Timestamp `protobuf:"bytes,10,opt,name=update_time,json=updateTime" json:"update_time,omitempty"` +} + +func (m *Occurrence) Reset() { *m = Occurrence{} } +func (m *Occurrence) String() string { return proto.CompactTextString(m) } +func (*Occurrence) ProtoMessage() {} +func (*Occurrence) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +type isOccurrence_Details interface { + isOccurrence_Details() +} + +type Occurrence_VulnerabilityDetails struct { + VulnerabilityDetails *VulnerabilityType_VulnerabilityDetails `protobuf:"bytes,8,opt,name=vulnerability_details,json=vulnerabilityDetails,oneof"` +} +type Occurrence_BuildDetails struct { + BuildDetails *BuildDetails `protobuf:"bytes,7,opt,name=build_details,json=buildDetails,oneof"` +} +type Occurrence_DerivedImage struct { + DerivedImage *DockerImage_Derived `protobuf:"bytes,11,opt,name=derived_image,json=derivedImage,oneof"` +} +type Occurrence_Installation struct { + Installation *PackageManager_Installation `protobuf:"bytes,12,opt,name=installation,oneof"` +} +type Occurrence_Deployment struct { + Deployment *Deployable_Deployment `protobuf:"bytes,14,opt,name=deployment,oneof"` +} +type Occurrence_Discovered struct { + Discovered *Discovery_Discovered `protobuf:"bytes,15,opt,name=discovered,oneof"` +} + +func (*Occurrence_VulnerabilityDetails) isOccurrence_Details() {} +func (*Occurrence_BuildDetails) isOccurrence_Details() {} +func (*Occurrence_DerivedImage) isOccurrence_Details() {} +func (*Occurrence_Installation) isOccurrence_Details() {} +func (*Occurrence_Deployment) isOccurrence_Details() {} +func (*Occurrence_Discovered) isOccurrence_Details() {} + +func (m *Occurrence) GetDetails() isOccurrence_Details { + if m != nil { + return m.Details + } + return nil +} + +func (m *Occurrence) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Occurrence) GetResourceUrl() string { + if m != nil { + return m.ResourceUrl + } + return "" +} + +func (m *Occurrence) GetNoteName() string { + if m != nil { + return m.NoteName + } + return "" +} + +func (m *Occurrence) GetKind() Note_Kind { + if m != nil { + return m.Kind + } + return Note_KIND_UNSPECIFIED +} + +func (m *Occurrence) GetVulnerabilityDetails() *VulnerabilityType_VulnerabilityDetails { + if x, ok := m.GetDetails().(*Occurrence_VulnerabilityDetails); ok { + return x.VulnerabilityDetails + } + return nil +} + +func (m *Occurrence) GetBuildDetails() *BuildDetails { + if x, ok := m.GetDetails().(*Occurrence_BuildDetails); ok { + return x.BuildDetails + } + return nil +} + +func (m *Occurrence) GetDerivedImage() *DockerImage_Derived { + if x, ok := m.GetDetails().(*Occurrence_DerivedImage); ok { + return x.DerivedImage + } + return nil +} + +func (m *Occurrence) GetInstallation() *PackageManager_Installation { + if x, ok := m.GetDetails().(*Occurrence_Installation); ok { + return x.Installation + } + return nil +} + +func (m *Occurrence) GetDeployment() *Deployable_Deployment { + if x, ok := m.GetDetails().(*Occurrence_Deployment); ok { + return x.Deployment + } + return nil +} + +func (m *Occurrence) GetDiscovered() *Discovery_Discovered { + if x, ok := m.GetDetails().(*Occurrence_Discovered); ok { + return x.Discovered + } + return nil +} + +func (m *Occurrence) GetRemediation() string { + if m != nil { + return m.Remediation + } + return "" +} + +func (m *Occurrence) GetCreateTime() *google_protobuf1.Timestamp { + if m != nil { + return m.CreateTime + } + return nil +} + +func (m *Occurrence) GetUpdateTime() *google_protobuf1.Timestamp { + if m != nil { + return m.UpdateTime + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Occurrence) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _Occurrence_OneofMarshaler, _Occurrence_OneofUnmarshaler, _Occurrence_OneofSizer, []interface{}{ + (*Occurrence_VulnerabilityDetails)(nil), + (*Occurrence_BuildDetails)(nil), + (*Occurrence_DerivedImage)(nil), + (*Occurrence_Installation)(nil), + (*Occurrence_Deployment)(nil), + (*Occurrence_Discovered)(nil), + } +} + +func _Occurrence_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Occurrence) + // details + switch x := m.Details.(type) { + case *Occurrence_VulnerabilityDetails: + b.EncodeVarint(8<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.VulnerabilityDetails); err != nil { + return err + } + case *Occurrence_BuildDetails: + b.EncodeVarint(7<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BuildDetails); err != nil { + return err + } + case *Occurrence_DerivedImage: + b.EncodeVarint(11<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.DerivedImage); err != nil { + return err + } + case *Occurrence_Installation: + b.EncodeVarint(12<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Installation); err != nil { + return err + } + case *Occurrence_Deployment: + b.EncodeVarint(14<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Deployment); err != nil { + return err + } + case *Occurrence_Discovered: + b.EncodeVarint(15<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Discovered); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("Occurrence.Details has unexpected type %T", x) + } + return nil +} + +func _Occurrence_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Occurrence) + switch tag { + case 8: // details.vulnerability_details + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(VulnerabilityType_VulnerabilityDetails) + err := b.DecodeMessage(msg) + m.Details = &Occurrence_VulnerabilityDetails{msg} + return true, err + case 7: // details.build_details + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(BuildDetails) + err := b.DecodeMessage(msg) + m.Details = &Occurrence_BuildDetails{msg} + return true, err + case 11: // details.derived_image + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(DockerImage_Derived) + err := b.DecodeMessage(msg) + m.Details = &Occurrence_DerivedImage{msg} + return true, err + case 12: // details.installation + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(PackageManager_Installation) + err := b.DecodeMessage(msg) + m.Details = &Occurrence_Installation{msg} + return true, err + case 14: // details.deployment + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Deployable_Deployment) + err := b.DecodeMessage(msg) + m.Details = &Occurrence_Deployment{msg} + return true, err + case 15: // details.discovered + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Discovery_Discovered) + err := b.DecodeMessage(msg) + m.Details = &Occurrence_Discovered{msg} + return true, err + default: + return false, nil + } +} + +func _Occurrence_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Occurrence) + // details + switch x := m.Details.(type) { + case *Occurrence_VulnerabilityDetails: + s := proto.Size(x.VulnerabilityDetails) + n += proto.SizeVarint(8<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Occurrence_BuildDetails: + s := proto.Size(x.BuildDetails) + n += proto.SizeVarint(7<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Occurrence_DerivedImage: + s := proto.Size(x.DerivedImage) + n += proto.SizeVarint(11<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Occurrence_Installation: + s := proto.Size(x.Installation) + n += proto.SizeVarint(12<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Occurrence_Deployment: + s := proto.Size(x.Deployment) + n += proto.SizeVarint(14<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Occurrence_Discovered: + s := proto.Size(x.Discovered) + n += proto.SizeVarint(15<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Provides a detailed description of a `Note`. +type Note struct { + // The name of the note in the form + // "providers/{provider_id}/notes/{NOTE_ID}" + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // A one sentence description of this `Note`. + ShortDescription string `protobuf:"bytes,3,opt,name=short_description,json=shortDescription" json:"short_description,omitempty"` + // A detailed description of this `Note`. + LongDescription string `protobuf:"bytes,4,opt,name=long_description,json=longDescription" json:"long_description,omitempty"` + // Output only. This explicitly denotes which kind of note is specified. This + // field can be used as a filter in list requests. + Kind Note_Kind `protobuf:"varint,9,opt,name=kind,enum=google.devtools.containeranalysis.v1alpha1.Note_Kind" json:"kind,omitempty"` + // The type of note. + // + // Types that are valid to be assigned to NoteType: + // *Note_VulnerabilityType + // *Note_BuildType + // *Note_BaseImage + // *Note_Package + // *Note_Deployable + // *Note_Discovery + NoteType isNote_NoteType `protobuf_oneof:"note_type"` + // URLs associated with this note + RelatedUrl []*Note_RelatedUrl `protobuf:"bytes,7,rep,name=related_url,json=relatedUrl" json:"related_url,omitempty"` + // Time of expiration for this note, null if note does not expire. + ExpirationTime *google_protobuf1.Timestamp `protobuf:"bytes,10,opt,name=expiration_time,json=expirationTime" json:"expiration_time,omitempty"` + // Output only. The time this note was created. This field can be used as a + // filter in list requests. + CreateTime *google_protobuf1.Timestamp `protobuf:"bytes,11,opt,name=create_time,json=createTime" json:"create_time,omitempty"` + // Output only. The time this note was last updated. This field can be used as + // a filter in list requests. + UpdateTime *google_protobuf1.Timestamp `protobuf:"bytes,12,opt,name=update_time,json=updateTime" json:"update_time,omitempty"` +} + +func (m *Note) Reset() { *m = Note{} } +func (m *Note) String() string { return proto.CompactTextString(m) } +func (*Note) ProtoMessage() {} +func (*Note) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} } + +type isNote_NoteType interface { + isNote_NoteType() +} + +type Note_VulnerabilityType struct { + VulnerabilityType *VulnerabilityType `protobuf:"bytes,6,opt,name=vulnerability_type,json=vulnerabilityType,oneof"` +} +type Note_BuildType struct { + BuildType *BuildType `protobuf:"bytes,8,opt,name=build_type,json=buildType,oneof"` +} +type Note_BaseImage struct { + BaseImage *DockerImage_Basis `protobuf:"bytes,13,opt,name=base_image,json=baseImage,oneof"` +} +type Note_Package struct { + Package *PackageManager_Package `protobuf:"bytes,14,opt,name=package,oneof"` +} +type Note_Deployable struct { + Deployable *Deployable `protobuf:"bytes,17,opt,name=deployable,oneof"` +} +type Note_Discovery struct { + Discovery *Discovery `protobuf:"bytes,18,opt,name=discovery,oneof"` +} + +func (*Note_VulnerabilityType) isNote_NoteType() {} +func (*Note_BuildType) isNote_NoteType() {} +func (*Note_BaseImage) isNote_NoteType() {} +func (*Note_Package) isNote_NoteType() {} +func (*Note_Deployable) isNote_NoteType() {} +func (*Note_Discovery) isNote_NoteType() {} + +func (m *Note) GetNoteType() isNote_NoteType { + if m != nil { + return m.NoteType + } + return nil +} + +func (m *Note) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Note) GetShortDescription() string { + if m != nil { + return m.ShortDescription + } + return "" +} + +func (m *Note) GetLongDescription() string { + if m != nil { + return m.LongDescription + } + return "" +} + +func (m *Note) GetKind() Note_Kind { + if m != nil { + return m.Kind + } + return Note_KIND_UNSPECIFIED +} + +func (m *Note) GetVulnerabilityType() *VulnerabilityType { + if x, ok := m.GetNoteType().(*Note_VulnerabilityType); ok { + return x.VulnerabilityType + } + return nil +} + +func (m *Note) GetBuildType() *BuildType { + if x, ok := m.GetNoteType().(*Note_BuildType); ok { + return x.BuildType + } + return nil +} + +func (m *Note) GetBaseImage() *DockerImage_Basis { + if x, ok := m.GetNoteType().(*Note_BaseImage); ok { + return x.BaseImage + } + return nil +} + +func (m *Note) GetPackage() *PackageManager_Package { + if x, ok := m.GetNoteType().(*Note_Package); ok { + return x.Package + } + return nil +} + +func (m *Note) GetDeployable() *Deployable { + if x, ok := m.GetNoteType().(*Note_Deployable); ok { + return x.Deployable + } + return nil +} + +func (m *Note) GetDiscovery() *Discovery { + if x, ok := m.GetNoteType().(*Note_Discovery); ok { + return x.Discovery + } + return nil +} + +func (m *Note) GetRelatedUrl() []*Note_RelatedUrl { + if m != nil { + return m.RelatedUrl + } + return nil +} + +func (m *Note) GetExpirationTime() *google_protobuf1.Timestamp { + if m != nil { + return m.ExpirationTime + } + return nil +} + +func (m *Note) GetCreateTime() *google_protobuf1.Timestamp { + if m != nil { + return m.CreateTime + } + return nil +} + +func (m *Note) GetUpdateTime() *google_protobuf1.Timestamp { + if m != nil { + return m.UpdateTime + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Note) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _Note_OneofMarshaler, _Note_OneofUnmarshaler, _Note_OneofSizer, []interface{}{ + (*Note_VulnerabilityType)(nil), + (*Note_BuildType)(nil), + (*Note_BaseImage)(nil), + (*Note_Package)(nil), + (*Note_Deployable)(nil), + (*Note_Discovery)(nil), + } +} + +func _Note_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Note) + // note_type + switch x := m.NoteType.(type) { + case *Note_VulnerabilityType: + b.EncodeVarint(6<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.VulnerabilityType); err != nil { + return err + } + case *Note_BuildType: + b.EncodeVarint(8<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BuildType); err != nil { + return err + } + case *Note_BaseImage: + b.EncodeVarint(13<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BaseImage); err != nil { + return err + } + case *Note_Package: + b.EncodeVarint(14<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Package); err != nil { + return err + } + case *Note_Deployable: + b.EncodeVarint(17<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Deployable); err != nil { + return err + } + case *Note_Discovery: + b.EncodeVarint(18<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Discovery); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("Note.NoteType has unexpected type %T", x) + } + return nil +} + +func _Note_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Note) + switch tag { + case 6: // note_type.vulnerability_type + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(VulnerabilityType) + err := b.DecodeMessage(msg) + m.NoteType = &Note_VulnerabilityType{msg} + return true, err + case 8: // note_type.build_type + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(BuildType) + err := b.DecodeMessage(msg) + m.NoteType = &Note_BuildType{msg} + return true, err + case 13: // note_type.base_image + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(DockerImage_Basis) + err := b.DecodeMessage(msg) + m.NoteType = &Note_BaseImage{msg} + return true, err + case 14: // note_type.package + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(PackageManager_Package) + err := b.DecodeMessage(msg) + m.NoteType = &Note_Package{msg} + return true, err + case 17: // note_type.deployable + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Deployable) + err := b.DecodeMessage(msg) + m.NoteType = &Note_Deployable{msg} + return true, err + case 18: // note_type.discovery + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Discovery) + err := b.DecodeMessage(msg) + m.NoteType = &Note_Discovery{msg} + return true, err + default: + return false, nil + } +} + +func _Note_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Note) + // note_type + switch x := m.NoteType.(type) { + case *Note_VulnerabilityType: + s := proto.Size(x.VulnerabilityType) + n += proto.SizeVarint(6<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Note_BuildType: + s := proto.Size(x.BuildType) + n += proto.SizeVarint(8<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Note_BaseImage: + s := proto.Size(x.BaseImage) + n += proto.SizeVarint(13<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Note_Package: + s := proto.Size(x.Package) + n += proto.SizeVarint(14<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Note_Deployable: + s := proto.Size(x.Deployable) + n += proto.SizeVarint(17<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Note_Discovery: + s := proto.Size(x.Discovery) + n += proto.SizeVarint(18<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Metadata for any related URL information +type Note_RelatedUrl struct { + // Specific URL to associate with the note + Url string `protobuf:"bytes,1,opt,name=url" json:"url,omitempty"` + // Label to describe usage of the URL + Label string `protobuf:"bytes,2,opt,name=label" json:"label,omitempty"` +} + +func (m *Note_RelatedUrl) Reset() { *m = Note_RelatedUrl{} } +func (m *Note_RelatedUrl) String() string { return proto.CompactTextString(m) } +func (*Note_RelatedUrl) ProtoMessage() {} +func (*Note_RelatedUrl) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1, 0} } + +func (m *Note_RelatedUrl) GetUrl() string { + if m != nil { + return m.Url + } + return "" +} + +func (m *Note_RelatedUrl) GetLabel() string { + if m != nil { + return m.Label + } + return "" +} + +// An artifact that can be deployed in some runtime. +type Deployable struct { + // Resource URI for the artifact being deployed. + ResourceUri []string `protobuf:"bytes,1,rep,name=resource_uri,json=resourceUri" json:"resource_uri,omitempty"` +} + +func (m *Deployable) Reset() { *m = Deployable{} } +func (m *Deployable) String() string { return proto.CompactTextString(m) } +func (*Deployable) ProtoMessage() {} +func (*Deployable) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} } + +func (m *Deployable) GetResourceUri() []string { + if m != nil { + return m.ResourceUri + } + return nil +} + +// The period during which some deployable was active in a runtime. +type Deployable_Deployment struct { + // Identity of the user that triggered this deployment. + UserEmail string `protobuf:"bytes,1,opt,name=user_email,json=userEmail" json:"user_email,omitempty"` + // Beginning of the lifetime of this deployment. + DeployTime *google_protobuf1.Timestamp `protobuf:"bytes,2,opt,name=deploy_time,json=deployTime" json:"deploy_time,omitempty"` + // End of the lifetime of this deployment. + UndeployTime *google_protobuf1.Timestamp `protobuf:"bytes,3,opt,name=undeploy_time,json=undeployTime" json:"undeploy_time,omitempty"` + // Configuration used to create this deployment. + Config string `protobuf:"bytes,8,opt,name=config" json:"config,omitempty"` + // Address of the runtime element hosting this deployment. + Address string `protobuf:"bytes,5,opt,name=address" json:"address,omitempty"` + // Output only. Resource URI for the artifact being deployed taken from the + // deployable field with the same name. + ResourceUri []string `protobuf:"bytes,6,rep,name=resource_uri,json=resourceUri" json:"resource_uri,omitempty"` + // Platform hosting this deployment. + Platform Deployable_Deployment_Platform `protobuf:"varint,7,opt,name=platform,enum=google.devtools.containeranalysis.v1alpha1.Deployable_Deployment_Platform" json:"platform,omitempty"` +} + +func (m *Deployable_Deployment) Reset() { *m = Deployable_Deployment{} } +func (m *Deployable_Deployment) String() string { return proto.CompactTextString(m) } +func (*Deployable_Deployment) ProtoMessage() {} +func (*Deployable_Deployment) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2, 0} } + +func (m *Deployable_Deployment) GetUserEmail() string { + if m != nil { + return m.UserEmail + } + return "" +} + +func (m *Deployable_Deployment) GetDeployTime() *google_protobuf1.Timestamp { + if m != nil { + return m.DeployTime + } + return nil +} + +func (m *Deployable_Deployment) GetUndeployTime() *google_protobuf1.Timestamp { + if m != nil { + return m.UndeployTime + } + return nil +} + +func (m *Deployable_Deployment) GetConfig() string { + if m != nil { + return m.Config + } + return "" +} + +func (m *Deployable_Deployment) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *Deployable_Deployment) GetResourceUri() []string { + if m != nil { + return m.ResourceUri + } + return nil +} + +func (m *Deployable_Deployment) GetPlatform() Deployable_Deployment_Platform { + if m != nil { + return m.Platform + } + return Deployable_Deployment_PLATFORM_UNSPECIFIED +} + +// A note that indicates a type of analysis a provider would perform. This note +// exists in a provider's project. A `Discovery` occurrence is created in a +// consumer's project at the start of analysis. The occurrence's operation will +// indicate the status of the analysis. Absence of an occurrence linked to this +// note for a resource indicates that analysis hasn't started. +type Discovery struct { + // The kind of analysis that is handled by this discovery. + AnalysisKind Note_Kind `protobuf:"varint,1,opt,name=analysis_kind,json=analysisKind,enum=google.devtools.containeranalysis.v1alpha1.Note_Kind" json:"analysis_kind,omitempty"` +} + +func (m *Discovery) Reset() { *m = Discovery{} } +func (m *Discovery) String() string { return proto.CompactTextString(m) } +func (*Discovery) ProtoMessage() {} +func (*Discovery) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{3} } + +func (m *Discovery) GetAnalysisKind() Note_Kind { + if m != nil { + return m.AnalysisKind + } + return Note_KIND_UNSPECIFIED +} + +// Provides information about the scan status of a discovered resource. +type Discovery_Discovered struct { + // Output only. An operation that indicates the status of the current scan. + Operation *google_longrunning.Operation `protobuf:"bytes,1,opt,name=operation" json:"operation,omitempty"` +} + +func (m *Discovery_Discovered) Reset() { *m = Discovery_Discovered{} } +func (m *Discovery_Discovered) String() string { return proto.CompactTextString(m) } +func (*Discovery_Discovered) ProtoMessage() {} +func (*Discovery_Discovered) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{3, 0} } + +func (m *Discovery_Discovered) GetOperation() *google_longrunning.Operation { + if m != nil { + return m.Operation + } + return nil +} + +// Note holding the version of the provider's builder and the signature of +// the provenance message in linked BuildDetails. +type BuildType struct { + // Version of the builder which produced this Note. + BuilderVersion string `protobuf:"bytes,1,opt,name=builder_version,json=builderVersion" json:"builder_version,omitempty"` + // Signature of the build in Occurrences pointing to the Note containing this + // `BuilderDetails`. + Signature *BuildSignature `protobuf:"bytes,2,opt,name=signature" json:"signature,omitempty"` +} + +func (m *BuildType) Reset() { *m = BuildType{} } +func (m *BuildType) String() string { return proto.CompactTextString(m) } +func (*BuildType) ProtoMessage() {} +func (*BuildType) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{4} } + +func (m *BuildType) GetBuilderVersion() string { + if m != nil { + return m.BuilderVersion + } + return "" +} + +func (m *BuildType) GetSignature() *BuildSignature { + if m != nil { + return m.Signature + } + return nil +} + +// Message encapsulating the signature of the verified build. +type BuildSignature struct { + // Public key of the builder which can be used to verify that the related + // findings are valid and unchanged. If `key_type` is empty, this defaults + // to PEM encoded public keys. + // + // This field may be empty if `key_id` references an external key. + // + // For Cloud Container Builder based signatures, this is a PEM encoded public + // key. To verify the Cloud Container Builder signature, place the contents of + // this field into a file (public.pem). The signature field is base64-decoded + // into its binary representation in signature.bin, and the provenance bytes + // from `BuildDetails` are base64-decoded into a binary representation in + // signed.bin. OpenSSL can then verify the signature: + // `openssl sha256 -verify public.pem -signature signature.bin signed.bin` + PublicKey string `protobuf:"bytes,1,opt,name=public_key,json=publicKey" json:"public_key,omitempty"` + // Signature of the related `BuildProvenance`, encoded in a base64 string. + Signature string `protobuf:"bytes,2,opt,name=signature" json:"signature,omitempty"` + // An Id for the key used to sign. This could be either an Id for the key + // stored in `public_key` (such as the Id or fingerprint for a PGP key, or the + // CN for a cert), or a reference to an external key (such as a reference to a + // key in Cloud Key Management Service). + KeyId string `protobuf:"bytes,3,opt,name=key_id,json=keyId" json:"key_id,omitempty"` + // The type of the key, either stored in `public_key` or referenced in + // `key_id` + KeyType BuildSignature_KeyType `protobuf:"varint,4,opt,name=key_type,json=keyType,enum=google.devtools.containeranalysis.v1alpha1.BuildSignature_KeyType" json:"key_type,omitempty"` +} + +func (m *BuildSignature) Reset() { *m = BuildSignature{} } +func (m *BuildSignature) String() string { return proto.CompactTextString(m) } +func (*BuildSignature) ProtoMessage() {} +func (*BuildSignature) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{5} } + +func (m *BuildSignature) GetPublicKey() string { + if m != nil { + return m.PublicKey + } + return "" +} + +func (m *BuildSignature) GetSignature() string { + if m != nil { + return m.Signature + } + return "" +} + +func (m *BuildSignature) GetKeyId() string { + if m != nil { + return m.KeyId + } + return "" +} + +func (m *BuildSignature) GetKeyType() BuildSignature_KeyType { + if m != nil { + return m.KeyType + } + return BuildSignature_KEY_TYPE_UNSPECIFIED +} + +// Message encapsulating build provenance details. +type BuildDetails struct { + // The actual provenance + Provenance *BuildProvenance `protobuf:"bytes,1,opt,name=provenance" json:"provenance,omitempty"` + // Serialized JSON representation of the provenance, used in generating the + // `BuildSignature` in the corresponding Result. After verifying the + // signature, `provenance_bytes` can be unmarshalled and compared to the + // provenance to confirm that it is unchanged. A base64-encoded string + // representation of the provenance bytes is used for the signature in order + // to interoperate with openssl which expects this format for signature + // verification. + // + // The serialized form is captured both to avoid ambiguity in how the + // provenance is marshalled to json as well to prevent incompatibilities with + // future changes. + ProvenanceBytes string `protobuf:"bytes,2,opt,name=provenance_bytes,json=provenanceBytes" json:"provenance_bytes,omitempty"` +} + +func (m *BuildDetails) Reset() { *m = BuildDetails{} } +func (m *BuildDetails) String() string { return proto.CompactTextString(m) } +func (*BuildDetails) ProtoMessage() {} +func (*BuildDetails) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{6} } + +func (m *BuildDetails) GetProvenance() *BuildProvenance { + if m != nil { + return m.Provenance + } + return nil +} + +func (m *BuildDetails) GetProvenanceBytes() string { + if m != nil { + return m.ProvenanceBytes + } + return "" +} + +// Request to get a Occurrence. +type GetOccurrenceRequest struct { + // The name of the occurrence of the form + // "projects/{project_id}/occurrences/{OCCURRENCE_ID}" + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetOccurrenceRequest) Reset() { *m = GetOccurrenceRequest{} } +func (m *GetOccurrenceRequest) String() string { return proto.CompactTextString(m) } +func (*GetOccurrenceRequest) ProtoMessage() {} +func (*GetOccurrenceRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{7} } + +func (m *GetOccurrenceRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Request to list occurrences. +type ListOccurrencesRequest struct { + // The name field contains the project Id. For example: + // "projects/{project_id} + // @Deprecated + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // This contains the project Id for example: projects/{project_id}. + Parent string `protobuf:"bytes,5,opt,name=parent" json:"parent,omitempty"` + // The filter expression. + Filter string `protobuf:"bytes,2,opt,name=filter" json:"filter,omitempty"` + // Number of occurrences to return in the list. + PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // Token to provide to skip to a particular spot in the list. + PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListOccurrencesRequest) Reset() { *m = ListOccurrencesRequest{} } +func (m *ListOccurrencesRequest) String() string { return proto.CompactTextString(m) } +func (*ListOccurrencesRequest) ProtoMessage() {} +func (*ListOccurrencesRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{8} } + +func (m *ListOccurrencesRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ListOccurrencesRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *ListOccurrencesRequest) GetFilter() string { + if m != nil { + return m.Filter + } + return "" +} + +func (m *ListOccurrencesRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListOccurrencesRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// Response including listed active occurrences. +type ListOccurrencesResponse struct { + // The occurrences requested. + Occurrences []*Occurrence `protobuf:"bytes,1,rep,name=occurrences" json:"occurrences,omitempty"` + // The next pagination token in the list response. It should be used as + // `page_token` for the following request. An empty value means no more + // results. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListOccurrencesResponse) Reset() { *m = ListOccurrencesResponse{} } +func (m *ListOccurrencesResponse) String() string { return proto.CompactTextString(m) } +func (*ListOccurrencesResponse) ProtoMessage() {} +func (*ListOccurrencesResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{9} } + +func (m *ListOccurrencesResponse) GetOccurrences() []*Occurrence { + if m != nil { + return m.Occurrences + } + return nil +} + +func (m *ListOccurrencesResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// Request to delete a occurrence +type DeleteOccurrenceRequest struct { + // The name of the occurrence in the form of + // "projects/{project_id}/occurrences/{OCCURRENCE_ID}" + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *DeleteOccurrenceRequest) Reset() { *m = DeleteOccurrenceRequest{} } +func (m *DeleteOccurrenceRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteOccurrenceRequest) ProtoMessage() {} +func (*DeleteOccurrenceRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{10} } + +func (m *DeleteOccurrenceRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Request to insert a new occurrence. +type CreateOccurrenceRequest struct { + // The name of the project. Should be of the form "projects/{project_id}". + // @Deprecated + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // This field contains the project Id for example: "projects/{project_id}" + Parent string `protobuf:"bytes,3,opt,name=parent" json:"parent,omitempty"` + // The occurrence to be inserted + Occurrence *Occurrence `protobuf:"bytes,2,opt,name=occurrence" json:"occurrence,omitempty"` +} + +func (m *CreateOccurrenceRequest) Reset() { *m = CreateOccurrenceRequest{} } +func (m *CreateOccurrenceRequest) String() string { return proto.CompactTextString(m) } +func (*CreateOccurrenceRequest) ProtoMessage() {} +func (*CreateOccurrenceRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{11} } + +func (m *CreateOccurrenceRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *CreateOccurrenceRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *CreateOccurrenceRequest) GetOccurrence() *Occurrence { + if m != nil { + return m.Occurrence + } + return nil +} + +// Request to update an existing occurrence +type UpdateOccurrenceRequest struct { + // The name of the occurrence. + // Should be of the form "projects/{project_id}/occurrences/{OCCURRENCE_ID}". + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The updated occurrence. + Occurrence *Occurrence `protobuf:"bytes,2,opt,name=occurrence" json:"occurrence,omitempty"` + // The fields to update. + UpdateMask *google_protobuf4.FieldMask `protobuf:"bytes,3,opt,name=update_mask,json=updateMask" json:"update_mask,omitempty"` +} + +func (m *UpdateOccurrenceRequest) Reset() { *m = UpdateOccurrenceRequest{} } +func (m *UpdateOccurrenceRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateOccurrenceRequest) ProtoMessage() {} +func (*UpdateOccurrenceRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{12} } + +func (m *UpdateOccurrenceRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *UpdateOccurrenceRequest) GetOccurrence() *Occurrence { + if m != nil { + return m.Occurrence + } + return nil +} + +func (m *UpdateOccurrenceRequest) GetUpdateMask() *google_protobuf4.FieldMask { + if m != nil { + return m.UpdateMask + } + return nil +} + +// Request to get a Note. +type GetNoteRequest struct { + // The name of the note in the form of + // "providers/{provider_id}/notes/{NOTE_ID}" + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetNoteRequest) Reset() { *m = GetNoteRequest{} } +func (m *GetNoteRequest) String() string { return proto.CompactTextString(m) } +func (*GetNoteRequest) ProtoMessage() {} +func (*GetNoteRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{13} } + +func (m *GetNoteRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Request to get the note to which this occurrence is attached. +type GetOccurrenceNoteRequest struct { + // The name of the occurrence in the form + // "projects/{project_id}/occurrences/{OCCURRENCE_ID}" + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetOccurrenceNoteRequest) Reset() { *m = GetOccurrenceNoteRequest{} } +func (m *GetOccurrenceNoteRequest) String() string { return proto.CompactTextString(m) } +func (*GetOccurrenceNoteRequest) ProtoMessage() {} +func (*GetOccurrenceNoteRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{14} } + +func (m *GetOccurrenceNoteRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Request to list notes. +type ListNotesRequest struct { + // The name field will contain the project Id for example: + // "providers/{provider_id} + // @Deprecated + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // This field contains the project Id for example: + // "project/{project_id} + Parent string `protobuf:"bytes,5,opt,name=parent" json:"parent,omitempty"` + // The filter expression. + Filter string `protobuf:"bytes,2,opt,name=filter" json:"filter,omitempty"` + // Number of notes to return in the list. + PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // Token to provide to skip to a particular spot in the list. + PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListNotesRequest) Reset() { *m = ListNotesRequest{} } +func (m *ListNotesRequest) String() string { return proto.CompactTextString(m) } +func (*ListNotesRequest) ProtoMessage() {} +func (*ListNotesRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{15} } + +func (m *ListNotesRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ListNotesRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *ListNotesRequest) GetFilter() string { + if m != nil { + return m.Filter + } + return "" +} + +func (m *ListNotesRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListNotesRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// Response including listed notes. +type ListNotesResponse struct { + // The occurrences requested + Notes []*Note `protobuf:"bytes,1,rep,name=notes" json:"notes,omitempty"` + // The next pagination token in the list response. It should be used as + // page_token for the following request. An empty value means no more result. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListNotesResponse) Reset() { *m = ListNotesResponse{} } +func (m *ListNotesResponse) String() string { return proto.CompactTextString(m) } +func (*ListNotesResponse) ProtoMessage() {} +func (*ListNotesResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{16} } + +func (m *ListNotesResponse) GetNotes() []*Note { + if m != nil { + return m.Notes + } + return nil +} + +func (m *ListNotesResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// Request to delete a note +type DeleteNoteRequest struct { + // The name of the note in the form of + // "providers/{provider_id}/notes/{NOTE_ID}" + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *DeleteNoteRequest) Reset() { *m = DeleteNoteRequest{} } +func (m *DeleteNoteRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteNoteRequest) ProtoMessage() {} +func (*DeleteNoteRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{17} } + +func (m *DeleteNoteRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Request to insert a new note +type CreateNoteRequest struct { + // The name of the project. + // Should be of the form "providers/{provider_id}". + // @Deprecated + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // This field contains the project Id for example: + // "project/{project_id} + Parent string `protobuf:"bytes,4,opt,name=parent" json:"parent,omitempty"` + // The ID to use for this note. + NoteId string `protobuf:"bytes,2,opt,name=note_id,json=noteId" json:"note_id,omitempty"` + // The Note to be inserted + Note *Note `protobuf:"bytes,3,opt,name=note" json:"note,omitempty"` +} + +func (m *CreateNoteRequest) Reset() { *m = CreateNoteRequest{} } +func (m *CreateNoteRequest) String() string { return proto.CompactTextString(m) } +func (*CreateNoteRequest) ProtoMessage() {} +func (*CreateNoteRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{18} } + +func (m *CreateNoteRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *CreateNoteRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *CreateNoteRequest) GetNoteId() string { + if m != nil { + return m.NoteId + } + return "" +} + +func (m *CreateNoteRequest) GetNote() *Note { + if m != nil { + return m.Note + } + return nil +} + +// Request to update an existing note +type UpdateNoteRequest struct { + // The name of the note. + // Should be of the form "projects/{provider_id}/notes/{note_id}". + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The updated note. + Note *Note `protobuf:"bytes,2,opt,name=note" json:"note,omitempty"` + // The fields to update. + UpdateMask *google_protobuf4.FieldMask `protobuf:"bytes,3,opt,name=update_mask,json=updateMask" json:"update_mask,omitempty"` +} + +func (m *UpdateNoteRequest) Reset() { *m = UpdateNoteRequest{} } +func (m *UpdateNoteRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateNoteRequest) ProtoMessage() {} +func (*UpdateNoteRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{19} } + +func (m *UpdateNoteRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *UpdateNoteRequest) GetNote() *Note { + if m != nil { + return m.Note + } + return nil +} + +func (m *UpdateNoteRequest) GetUpdateMask() *google_protobuf4.FieldMask { + if m != nil { + return m.UpdateMask + } + return nil +} + +// Request to list occurrences. +type ListNoteOccurrencesRequest struct { + // The name field will contain the note name for example: + // "provider/{provider_id}/notes/{note_id}" + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The filter expression. + Filter string `protobuf:"bytes,2,opt,name=filter" json:"filter,omitempty"` + // Number of notes to return in the list. + PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // Token to provide to skip to a particular spot in the list. + PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListNoteOccurrencesRequest) Reset() { *m = ListNoteOccurrencesRequest{} } +func (m *ListNoteOccurrencesRequest) String() string { return proto.CompactTextString(m) } +func (*ListNoteOccurrencesRequest) ProtoMessage() {} +func (*ListNoteOccurrencesRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{20} } + +func (m *ListNoteOccurrencesRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ListNoteOccurrencesRequest) GetFilter() string { + if m != nil { + return m.Filter + } + return "" +} + +func (m *ListNoteOccurrencesRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListNoteOccurrencesRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// Response including listed occurrences for a note. +type ListNoteOccurrencesResponse struct { + // The occurrences attached to the specified note. + Occurrences []*Occurrence `protobuf:"bytes,1,rep,name=occurrences" json:"occurrences,omitempty"` + // Token to receive the next page of notes. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListNoteOccurrencesResponse) Reset() { *m = ListNoteOccurrencesResponse{} } +func (m *ListNoteOccurrencesResponse) String() string { return proto.CompactTextString(m) } +func (*ListNoteOccurrencesResponse) ProtoMessage() {} +func (*ListNoteOccurrencesResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{21} } + +func (m *ListNoteOccurrencesResponse) GetOccurrences() []*Occurrence { + if m != nil { + return m.Occurrences + } + return nil +} + +func (m *ListNoteOccurrencesResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// Metadata for all operations used and required for all operations +// that created by Container Analysis Providers +type OperationMetadata struct { + // Output only. The time this operation was created. + CreateTime *google_protobuf1.Timestamp `protobuf:"bytes,1,opt,name=create_time,json=createTime" json:"create_time,omitempty"` + // Output only. The time that this operation was marked completed or failed. + EndTime *google_protobuf1.Timestamp `protobuf:"bytes,2,opt,name=end_time,json=endTime" json:"end_time,omitempty"` +} + +func (m *OperationMetadata) Reset() { *m = OperationMetadata{} } +func (m *OperationMetadata) String() string { return proto.CompactTextString(m) } +func (*OperationMetadata) ProtoMessage() {} +func (*OperationMetadata) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{22} } + +func (m *OperationMetadata) GetCreateTime() *google_protobuf1.Timestamp { + if m != nil { + return m.CreateTime + } + return nil +} + +func (m *OperationMetadata) GetEndTime() *google_protobuf1.Timestamp { + if m != nil { + return m.EndTime + } + return nil +} + +// Request to get the vulnz summary for some set of vulnerability Occurrences. +type GetVulnzOccurrencesSummaryRequest struct { + // This contains the project Id for example: projects/{project_id} + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // The filter expression. + Filter string `protobuf:"bytes,2,opt,name=filter" json:"filter,omitempty"` +} + +func (m *GetVulnzOccurrencesSummaryRequest) Reset() { *m = GetVulnzOccurrencesSummaryRequest{} } +func (m *GetVulnzOccurrencesSummaryRequest) String() string { return proto.CompactTextString(m) } +func (*GetVulnzOccurrencesSummaryRequest) ProtoMessage() {} +func (*GetVulnzOccurrencesSummaryRequest) Descriptor() ([]byte, []int) { + return fileDescriptor1, []int{23} +} + +func (m *GetVulnzOccurrencesSummaryRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *GetVulnzOccurrencesSummaryRequest) GetFilter() string { + if m != nil { + return m.Filter + } + return "" +} + +// A summary of how many vulnz occurrences there are per severity type. +// counts by groups, or if we should have different summary messages +// like this. +type GetVulnzOccurrencesSummaryResponse struct { + // A map of how many occurrences were found for each severity. + Counts []*GetVulnzOccurrencesSummaryResponse_SeverityCount `protobuf:"bytes,1,rep,name=counts" json:"counts,omitempty"` +} + +func (m *GetVulnzOccurrencesSummaryResponse) Reset() { *m = GetVulnzOccurrencesSummaryResponse{} } +func (m *GetVulnzOccurrencesSummaryResponse) String() string { return proto.CompactTextString(m) } +func (*GetVulnzOccurrencesSummaryResponse) ProtoMessage() {} +func (*GetVulnzOccurrencesSummaryResponse) Descriptor() ([]byte, []int) { + return fileDescriptor1, []int{24} +} + +func (m *GetVulnzOccurrencesSummaryResponse) GetCounts() []*GetVulnzOccurrencesSummaryResponse_SeverityCount { + if m != nil { + return m.Counts + } + return nil +} + +// The number of occurrences created for a specific severity. +type GetVulnzOccurrencesSummaryResponse_SeverityCount struct { + // The severity of the occurrences. + Severity VulnerabilityType_Severity `protobuf:"varint,1,opt,name=severity,enum=google.devtools.containeranalysis.v1alpha1.VulnerabilityType_Severity" json:"severity,omitempty"` + // The number of occurrences with the severity. + Count int64 `protobuf:"varint,2,opt,name=count" json:"count,omitempty"` +} + +func (m *GetVulnzOccurrencesSummaryResponse_SeverityCount) Reset() { + *m = GetVulnzOccurrencesSummaryResponse_SeverityCount{} +} +func (m *GetVulnzOccurrencesSummaryResponse_SeverityCount) String() string { + return proto.CompactTextString(m) +} +func (*GetVulnzOccurrencesSummaryResponse_SeverityCount) ProtoMessage() {} +func (*GetVulnzOccurrencesSummaryResponse_SeverityCount) Descriptor() ([]byte, []int) { + return fileDescriptor1, []int{24, 0} +} + +func (m *GetVulnzOccurrencesSummaryResponse_SeverityCount) GetSeverity() VulnerabilityType_Severity { + if m != nil { + return m.Severity + } + return VulnerabilityType_SEVERITY_UNSPECIFIED +} + +func (m *GetVulnzOccurrencesSummaryResponse_SeverityCount) GetCount() int64 { + if m != nil { + return m.Count + } + return 0 +} + +func init() { + proto.RegisterType((*Occurrence)(nil), "google.devtools.containeranalysis.v1alpha1.Occurrence") + proto.RegisterType((*Note)(nil), "google.devtools.containeranalysis.v1alpha1.Note") + proto.RegisterType((*Note_RelatedUrl)(nil), "google.devtools.containeranalysis.v1alpha1.Note.RelatedUrl") + proto.RegisterType((*Deployable)(nil), "google.devtools.containeranalysis.v1alpha1.Deployable") + proto.RegisterType((*Deployable_Deployment)(nil), "google.devtools.containeranalysis.v1alpha1.Deployable.Deployment") + proto.RegisterType((*Discovery)(nil), "google.devtools.containeranalysis.v1alpha1.Discovery") + proto.RegisterType((*Discovery_Discovered)(nil), "google.devtools.containeranalysis.v1alpha1.Discovery.Discovered") + proto.RegisterType((*BuildType)(nil), "google.devtools.containeranalysis.v1alpha1.BuildType") + proto.RegisterType((*BuildSignature)(nil), "google.devtools.containeranalysis.v1alpha1.BuildSignature") + proto.RegisterType((*BuildDetails)(nil), "google.devtools.containeranalysis.v1alpha1.BuildDetails") + proto.RegisterType((*GetOccurrenceRequest)(nil), "google.devtools.containeranalysis.v1alpha1.GetOccurrenceRequest") + proto.RegisterType((*ListOccurrencesRequest)(nil), "google.devtools.containeranalysis.v1alpha1.ListOccurrencesRequest") + proto.RegisterType((*ListOccurrencesResponse)(nil), "google.devtools.containeranalysis.v1alpha1.ListOccurrencesResponse") + proto.RegisterType((*DeleteOccurrenceRequest)(nil), "google.devtools.containeranalysis.v1alpha1.DeleteOccurrenceRequest") + proto.RegisterType((*CreateOccurrenceRequest)(nil), "google.devtools.containeranalysis.v1alpha1.CreateOccurrenceRequest") + proto.RegisterType((*UpdateOccurrenceRequest)(nil), "google.devtools.containeranalysis.v1alpha1.UpdateOccurrenceRequest") + proto.RegisterType((*GetNoteRequest)(nil), "google.devtools.containeranalysis.v1alpha1.GetNoteRequest") + proto.RegisterType((*GetOccurrenceNoteRequest)(nil), "google.devtools.containeranalysis.v1alpha1.GetOccurrenceNoteRequest") + proto.RegisterType((*ListNotesRequest)(nil), "google.devtools.containeranalysis.v1alpha1.ListNotesRequest") + proto.RegisterType((*ListNotesResponse)(nil), "google.devtools.containeranalysis.v1alpha1.ListNotesResponse") + proto.RegisterType((*DeleteNoteRequest)(nil), "google.devtools.containeranalysis.v1alpha1.DeleteNoteRequest") + proto.RegisterType((*CreateNoteRequest)(nil), "google.devtools.containeranalysis.v1alpha1.CreateNoteRequest") + proto.RegisterType((*UpdateNoteRequest)(nil), "google.devtools.containeranalysis.v1alpha1.UpdateNoteRequest") + proto.RegisterType((*ListNoteOccurrencesRequest)(nil), "google.devtools.containeranalysis.v1alpha1.ListNoteOccurrencesRequest") + proto.RegisterType((*ListNoteOccurrencesResponse)(nil), "google.devtools.containeranalysis.v1alpha1.ListNoteOccurrencesResponse") + proto.RegisterType((*OperationMetadata)(nil), "google.devtools.containeranalysis.v1alpha1.OperationMetadata") + proto.RegisterType((*GetVulnzOccurrencesSummaryRequest)(nil), "google.devtools.containeranalysis.v1alpha1.GetVulnzOccurrencesSummaryRequest") + proto.RegisterType((*GetVulnzOccurrencesSummaryResponse)(nil), "google.devtools.containeranalysis.v1alpha1.GetVulnzOccurrencesSummaryResponse") + proto.RegisterType((*GetVulnzOccurrencesSummaryResponse_SeverityCount)(nil), "google.devtools.containeranalysis.v1alpha1.GetVulnzOccurrencesSummaryResponse.SeverityCount") + proto.RegisterEnum("google.devtools.containeranalysis.v1alpha1.Note_Kind", Note_Kind_name, Note_Kind_value) + proto.RegisterEnum("google.devtools.containeranalysis.v1alpha1.Deployable_Deployment_Platform", Deployable_Deployment_Platform_name, Deployable_Deployment_Platform_value) + proto.RegisterEnum("google.devtools.containeranalysis.v1alpha1.BuildSignature_KeyType", BuildSignature_KeyType_name, BuildSignature_KeyType_value) +} + +// 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 + +// Client API for ContainerAnalysis service + +type ContainerAnalysisClient interface { + // Returns the requested `Occurrence`. + GetOccurrence(ctx context.Context, in *GetOccurrenceRequest, opts ...grpc.CallOption) (*Occurrence, error) + // Lists active `Occurrences` for a given project matching the filters. + ListOccurrences(ctx context.Context, in *ListOccurrencesRequest, opts ...grpc.CallOption) (*ListOccurrencesResponse, error) + // Deletes the given `Occurrence` from the system. Use this when + // an `Occurrence` is no longer applicable for the given resource. + DeleteOccurrence(ctx context.Context, in *DeleteOccurrenceRequest, opts ...grpc.CallOption) (*google_protobuf3.Empty, error) + // Creates a new `Occurrence`. Use this method to create `Occurrences` + // for a resource. + CreateOccurrence(ctx context.Context, in *CreateOccurrenceRequest, opts ...grpc.CallOption) (*Occurrence, error) + // Updates an existing occurrence. + UpdateOccurrence(ctx context.Context, in *UpdateOccurrenceRequest, opts ...grpc.CallOption) (*Occurrence, error) + // Gets the `Note` attached to the given `Occurrence`. + GetOccurrenceNote(ctx context.Context, in *GetOccurrenceNoteRequest, opts ...grpc.CallOption) (*Note, error) + // Returns the requested `Note`. + GetNote(ctx context.Context, in *GetNoteRequest, opts ...grpc.CallOption) (*Note, error) + // Lists all `Notes` for a given project. + ListNotes(ctx context.Context, in *ListNotesRequest, opts ...grpc.CallOption) (*ListNotesResponse, error) + // Deletes the given `Note` from the system. + DeleteNote(ctx context.Context, in *DeleteNoteRequest, opts ...grpc.CallOption) (*google_protobuf3.Empty, error) + // Creates a new `Note`. + CreateNote(ctx context.Context, in *CreateNoteRequest, opts ...grpc.CallOption) (*Note, error) + // Updates an existing `Note`. + UpdateNote(ctx context.Context, in *UpdateNoteRequest, opts ...grpc.CallOption) (*Note, error) + // Lists `Occurrences` referencing the specified `Note`. Use this method to + // get all occurrences referencing your `Note` across all your customer + // projects. + ListNoteOccurrences(ctx context.Context, in *ListNoteOccurrencesRequest, opts ...grpc.CallOption) (*ListNoteOccurrencesResponse, error) + // Gets a summary of the number and severity of occurrences. + GetVulnzOccurrencesSummary(ctx context.Context, in *GetVulnzOccurrencesSummaryRequest, opts ...grpc.CallOption) (*GetVulnzOccurrencesSummaryResponse, error) + // Sets the access control policy on the specified `Note` or `Occurrence`. + // Requires `containeranalysis.notes.setIamPolicy` or + // `containeranalysis.occurrences.setIamPolicy` permission if the resource is + // a `Note` or an `Occurrence`, respectively. + // Attempting to call this method without these permissions will result in a ` + // `PERMISSION_DENIED` error. + // Attempting to call this method on a non-existent resource will result in a + // `NOT_FOUND` error if the user has `containeranalysis.notes.list` permission + // on a `Note` or `containeranalysis.occurrences.list` on an `Occurrence`, or + // a `PERMISSION_DENIED` error otherwise. The resource takes the following + // formats: `projects/{projectid}/occurrences/{occurrenceid}` for occurrences + // and projects/{projectid}/notes/{noteid} for notes + SetIamPolicy(ctx context.Context, in *google_iam_v11.SetIamPolicyRequest, opts ...grpc.CallOption) (*google_iam_v1.Policy, error) + // Gets the access control policy for a note or an `Occurrence` resource. + // Requires `containeranalysis.notes.setIamPolicy` or + // `containeranalysis.occurrences.setIamPolicy` permission if the resource is + // a note or occurrence, respectively. + // Attempting to call this method on a resource without the required + // permission will result in a `PERMISSION_DENIED` error. Attempting to call + // this method on a non-existent resource will result in a `NOT_FOUND` error + // if the user has list permission on the project, or a `PERMISSION_DENIED` + // error otherwise. The resource takes the following formats: + // `projects/{PROJECT_ID}/occurrences/{OCCURRENCE_ID}` for occurrences and + // projects/{PROJECT_ID}/notes/{NOTE_ID} for notes + GetIamPolicy(ctx context.Context, in *google_iam_v11.GetIamPolicyRequest, opts ...grpc.CallOption) (*google_iam_v1.Policy, error) + // Returns the permissions that a caller has on the specified note or + // occurrence resource. Requires list permission on the project (for example, + // "storage.objects.list" on the containing bucket for testing permission of + // an object). Attempting to call this method on a non-existent resource will + // result in a `NOT_FOUND` error if the user has list permission on the + // project, or a `PERMISSION_DENIED` error otherwise. The resource takes the + // following formats: `projects/{PROJECT_ID}/occurrences/{OCCURRENCE_ID}` for + // `Occurrences` and `projects/{PROJECT_ID}/notes/{NOTE_ID}` for `Notes` + TestIamPermissions(ctx context.Context, in *google_iam_v11.TestIamPermissionsRequest, opts ...grpc.CallOption) (*google_iam_v11.TestIamPermissionsResponse, error) +} + +type containerAnalysisClient struct { + cc *grpc.ClientConn +} + +func NewContainerAnalysisClient(cc *grpc.ClientConn) ContainerAnalysisClient { + return &containerAnalysisClient{cc} +} + +func (c *containerAnalysisClient) GetOccurrence(ctx context.Context, in *GetOccurrenceRequest, opts ...grpc.CallOption) (*Occurrence, error) { + out := new(Occurrence) + err := grpc.Invoke(ctx, "/google.devtools.containeranalysis.v1alpha1.ContainerAnalysis/GetOccurrence", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *containerAnalysisClient) ListOccurrences(ctx context.Context, in *ListOccurrencesRequest, opts ...grpc.CallOption) (*ListOccurrencesResponse, error) { + out := new(ListOccurrencesResponse) + err := grpc.Invoke(ctx, "/google.devtools.containeranalysis.v1alpha1.ContainerAnalysis/ListOccurrences", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *containerAnalysisClient) DeleteOccurrence(ctx context.Context, in *DeleteOccurrenceRequest, opts ...grpc.CallOption) (*google_protobuf3.Empty, error) { + out := new(google_protobuf3.Empty) + err := grpc.Invoke(ctx, "/google.devtools.containeranalysis.v1alpha1.ContainerAnalysis/DeleteOccurrence", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *containerAnalysisClient) CreateOccurrence(ctx context.Context, in *CreateOccurrenceRequest, opts ...grpc.CallOption) (*Occurrence, error) { + out := new(Occurrence) + err := grpc.Invoke(ctx, "/google.devtools.containeranalysis.v1alpha1.ContainerAnalysis/CreateOccurrence", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *containerAnalysisClient) UpdateOccurrence(ctx context.Context, in *UpdateOccurrenceRequest, opts ...grpc.CallOption) (*Occurrence, error) { + out := new(Occurrence) + err := grpc.Invoke(ctx, "/google.devtools.containeranalysis.v1alpha1.ContainerAnalysis/UpdateOccurrence", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *containerAnalysisClient) GetOccurrenceNote(ctx context.Context, in *GetOccurrenceNoteRequest, opts ...grpc.CallOption) (*Note, error) { + out := new(Note) + err := grpc.Invoke(ctx, "/google.devtools.containeranalysis.v1alpha1.ContainerAnalysis/GetOccurrenceNote", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *containerAnalysisClient) GetNote(ctx context.Context, in *GetNoteRequest, opts ...grpc.CallOption) (*Note, error) { + out := new(Note) + err := grpc.Invoke(ctx, "/google.devtools.containeranalysis.v1alpha1.ContainerAnalysis/GetNote", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *containerAnalysisClient) ListNotes(ctx context.Context, in *ListNotesRequest, opts ...grpc.CallOption) (*ListNotesResponse, error) { + out := new(ListNotesResponse) + err := grpc.Invoke(ctx, "/google.devtools.containeranalysis.v1alpha1.ContainerAnalysis/ListNotes", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *containerAnalysisClient) DeleteNote(ctx context.Context, in *DeleteNoteRequest, opts ...grpc.CallOption) (*google_protobuf3.Empty, error) { + out := new(google_protobuf3.Empty) + err := grpc.Invoke(ctx, "/google.devtools.containeranalysis.v1alpha1.ContainerAnalysis/DeleteNote", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *containerAnalysisClient) CreateNote(ctx context.Context, in *CreateNoteRequest, opts ...grpc.CallOption) (*Note, error) { + out := new(Note) + err := grpc.Invoke(ctx, "/google.devtools.containeranalysis.v1alpha1.ContainerAnalysis/CreateNote", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *containerAnalysisClient) UpdateNote(ctx context.Context, in *UpdateNoteRequest, opts ...grpc.CallOption) (*Note, error) { + out := new(Note) + err := grpc.Invoke(ctx, "/google.devtools.containeranalysis.v1alpha1.ContainerAnalysis/UpdateNote", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *containerAnalysisClient) ListNoteOccurrences(ctx context.Context, in *ListNoteOccurrencesRequest, opts ...grpc.CallOption) (*ListNoteOccurrencesResponse, error) { + out := new(ListNoteOccurrencesResponse) + err := grpc.Invoke(ctx, "/google.devtools.containeranalysis.v1alpha1.ContainerAnalysis/ListNoteOccurrences", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *containerAnalysisClient) GetVulnzOccurrencesSummary(ctx context.Context, in *GetVulnzOccurrencesSummaryRequest, opts ...grpc.CallOption) (*GetVulnzOccurrencesSummaryResponse, error) { + out := new(GetVulnzOccurrencesSummaryResponse) + err := grpc.Invoke(ctx, "/google.devtools.containeranalysis.v1alpha1.ContainerAnalysis/GetVulnzOccurrencesSummary", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *containerAnalysisClient) SetIamPolicy(ctx context.Context, in *google_iam_v11.SetIamPolicyRequest, opts ...grpc.CallOption) (*google_iam_v1.Policy, error) { + out := new(google_iam_v1.Policy) + err := grpc.Invoke(ctx, "/google.devtools.containeranalysis.v1alpha1.ContainerAnalysis/SetIamPolicy", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *containerAnalysisClient) GetIamPolicy(ctx context.Context, in *google_iam_v11.GetIamPolicyRequest, opts ...grpc.CallOption) (*google_iam_v1.Policy, error) { + out := new(google_iam_v1.Policy) + err := grpc.Invoke(ctx, "/google.devtools.containeranalysis.v1alpha1.ContainerAnalysis/GetIamPolicy", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *containerAnalysisClient) TestIamPermissions(ctx context.Context, in *google_iam_v11.TestIamPermissionsRequest, opts ...grpc.CallOption) (*google_iam_v11.TestIamPermissionsResponse, error) { + out := new(google_iam_v11.TestIamPermissionsResponse) + err := grpc.Invoke(ctx, "/google.devtools.containeranalysis.v1alpha1.ContainerAnalysis/TestIamPermissions", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for ContainerAnalysis service + +type ContainerAnalysisServer interface { + // Returns the requested `Occurrence`. + GetOccurrence(context.Context, *GetOccurrenceRequest) (*Occurrence, error) + // Lists active `Occurrences` for a given project matching the filters. + ListOccurrences(context.Context, *ListOccurrencesRequest) (*ListOccurrencesResponse, error) + // Deletes the given `Occurrence` from the system. Use this when + // an `Occurrence` is no longer applicable for the given resource. + DeleteOccurrence(context.Context, *DeleteOccurrenceRequest) (*google_protobuf3.Empty, error) + // Creates a new `Occurrence`. Use this method to create `Occurrences` + // for a resource. + CreateOccurrence(context.Context, *CreateOccurrenceRequest) (*Occurrence, error) + // Updates an existing occurrence. + UpdateOccurrence(context.Context, *UpdateOccurrenceRequest) (*Occurrence, error) + // Gets the `Note` attached to the given `Occurrence`. + GetOccurrenceNote(context.Context, *GetOccurrenceNoteRequest) (*Note, error) + // Returns the requested `Note`. + GetNote(context.Context, *GetNoteRequest) (*Note, error) + // Lists all `Notes` for a given project. + ListNotes(context.Context, *ListNotesRequest) (*ListNotesResponse, error) + // Deletes the given `Note` from the system. + DeleteNote(context.Context, *DeleteNoteRequest) (*google_protobuf3.Empty, error) + // Creates a new `Note`. + CreateNote(context.Context, *CreateNoteRequest) (*Note, error) + // Updates an existing `Note`. + UpdateNote(context.Context, *UpdateNoteRequest) (*Note, error) + // Lists `Occurrences` referencing the specified `Note`. Use this method to + // get all occurrences referencing your `Note` across all your customer + // projects. + ListNoteOccurrences(context.Context, *ListNoteOccurrencesRequest) (*ListNoteOccurrencesResponse, error) + // Gets a summary of the number and severity of occurrences. + GetVulnzOccurrencesSummary(context.Context, *GetVulnzOccurrencesSummaryRequest) (*GetVulnzOccurrencesSummaryResponse, error) + // Sets the access control policy on the specified `Note` or `Occurrence`. + // Requires `containeranalysis.notes.setIamPolicy` or + // `containeranalysis.occurrences.setIamPolicy` permission if the resource is + // a `Note` or an `Occurrence`, respectively. + // Attempting to call this method without these permissions will result in a ` + // `PERMISSION_DENIED` error. + // Attempting to call this method on a non-existent resource will result in a + // `NOT_FOUND` error if the user has `containeranalysis.notes.list` permission + // on a `Note` or `containeranalysis.occurrences.list` on an `Occurrence`, or + // a `PERMISSION_DENIED` error otherwise. The resource takes the following + // formats: `projects/{projectid}/occurrences/{occurrenceid}` for occurrences + // and projects/{projectid}/notes/{noteid} for notes + SetIamPolicy(context.Context, *google_iam_v11.SetIamPolicyRequest) (*google_iam_v1.Policy, error) + // Gets the access control policy for a note or an `Occurrence` resource. + // Requires `containeranalysis.notes.setIamPolicy` or + // `containeranalysis.occurrences.setIamPolicy` permission if the resource is + // a note or occurrence, respectively. + // Attempting to call this method on a resource without the required + // permission will result in a `PERMISSION_DENIED` error. Attempting to call + // this method on a non-existent resource will result in a `NOT_FOUND` error + // if the user has list permission on the project, or a `PERMISSION_DENIED` + // error otherwise. The resource takes the following formats: + // `projects/{PROJECT_ID}/occurrences/{OCCURRENCE_ID}` for occurrences and + // projects/{PROJECT_ID}/notes/{NOTE_ID} for notes + GetIamPolicy(context.Context, *google_iam_v11.GetIamPolicyRequest) (*google_iam_v1.Policy, error) + // Returns the permissions that a caller has on the specified note or + // occurrence resource. Requires list permission on the project (for example, + // "storage.objects.list" on the containing bucket for testing permission of + // an object). Attempting to call this method on a non-existent resource will + // result in a `NOT_FOUND` error if the user has list permission on the + // project, or a `PERMISSION_DENIED` error otherwise. The resource takes the + // following formats: `projects/{PROJECT_ID}/occurrences/{OCCURRENCE_ID}` for + // `Occurrences` and `projects/{PROJECT_ID}/notes/{NOTE_ID}` for `Notes` + TestIamPermissions(context.Context, *google_iam_v11.TestIamPermissionsRequest) (*google_iam_v11.TestIamPermissionsResponse, error) +} + +func RegisterContainerAnalysisServer(s *grpc.Server, srv ContainerAnalysisServer) { + s.RegisterService(&_ContainerAnalysis_serviceDesc, srv) +} + +func _ContainerAnalysis_GetOccurrence_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetOccurrenceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContainerAnalysisServer).GetOccurrence(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.containeranalysis.v1alpha1.ContainerAnalysis/GetOccurrence", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContainerAnalysisServer).GetOccurrence(ctx, req.(*GetOccurrenceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ContainerAnalysis_ListOccurrences_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListOccurrencesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContainerAnalysisServer).ListOccurrences(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.containeranalysis.v1alpha1.ContainerAnalysis/ListOccurrences", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContainerAnalysisServer).ListOccurrences(ctx, req.(*ListOccurrencesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ContainerAnalysis_DeleteOccurrence_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteOccurrenceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContainerAnalysisServer).DeleteOccurrence(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.containeranalysis.v1alpha1.ContainerAnalysis/DeleteOccurrence", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContainerAnalysisServer).DeleteOccurrence(ctx, req.(*DeleteOccurrenceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ContainerAnalysis_CreateOccurrence_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateOccurrenceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContainerAnalysisServer).CreateOccurrence(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.containeranalysis.v1alpha1.ContainerAnalysis/CreateOccurrence", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContainerAnalysisServer).CreateOccurrence(ctx, req.(*CreateOccurrenceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ContainerAnalysis_UpdateOccurrence_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateOccurrenceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContainerAnalysisServer).UpdateOccurrence(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.containeranalysis.v1alpha1.ContainerAnalysis/UpdateOccurrence", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContainerAnalysisServer).UpdateOccurrence(ctx, req.(*UpdateOccurrenceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ContainerAnalysis_GetOccurrenceNote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetOccurrenceNoteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContainerAnalysisServer).GetOccurrenceNote(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.containeranalysis.v1alpha1.ContainerAnalysis/GetOccurrenceNote", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContainerAnalysisServer).GetOccurrenceNote(ctx, req.(*GetOccurrenceNoteRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ContainerAnalysis_GetNote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetNoteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContainerAnalysisServer).GetNote(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.containeranalysis.v1alpha1.ContainerAnalysis/GetNote", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContainerAnalysisServer).GetNote(ctx, req.(*GetNoteRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ContainerAnalysis_ListNotes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListNotesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContainerAnalysisServer).ListNotes(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.containeranalysis.v1alpha1.ContainerAnalysis/ListNotes", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContainerAnalysisServer).ListNotes(ctx, req.(*ListNotesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ContainerAnalysis_DeleteNote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteNoteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContainerAnalysisServer).DeleteNote(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.containeranalysis.v1alpha1.ContainerAnalysis/DeleteNote", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContainerAnalysisServer).DeleteNote(ctx, req.(*DeleteNoteRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ContainerAnalysis_CreateNote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateNoteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContainerAnalysisServer).CreateNote(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.containeranalysis.v1alpha1.ContainerAnalysis/CreateNote", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContainerAnalysisServer).CreateNote(ctx, req.(*CreateNoteRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ContainerAnalysis_UpdateNote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateNoteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContainerAnalysisServer).UpdateNote(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.containeranalysis.v1alpha1.ContainerAnalysis/UpdateNote", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContainerAnalysisServer).UpdateNote(ctx, req.(*UpdateNoteRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ContainerAnalysis_ListNoteOccurrences_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListNoteOccurrencesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContainerAnalysisServer).ListNoteOccurrences(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.containeranalysis.v1alpha1.ContainerAnalysis/ListNoteOccurrences", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContainerAnalysisServer).ListNoteOccurrences(ctx, req.(*ListNoteOccurrencesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ContainerAnalysis_GetVulnzOccurrencesSummary_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetVulnzOccurrencesSummaryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContainerAnalysisServer).GetVulnzOccurrencesSummary(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.containeranalysis.v1alpha1.ContainerAnalysis/GetVulnzOccurrencesSummary", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContainerAnalysisServer).GetVulnzOccurrencesSummary(ctx, req.(*GetVulnzOccurrencesSummaryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ContainerAnalysis_SetIamPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(google_iam_v11.SetIamPolicyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContainerAnalysisServer).SetIamPolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.containeranalysis.v1alpha1.ContainerAnalysis/SetIamPolicy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContainerAnalysisServer).SetIamPolicy(ctx, req.(*google_iam_v11.SetIamPolicyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ContainerAnalysis_GetIamPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(google_iam_v11.GetIamPolicyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContainerAnalysisServer).GetIamPolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.containeranalysis.v1alpha1.ContainerAnalysis/GetIamPolicy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContainerAnalysisServer).GetIamPolicy(ctx, req.(*google_iam_v11.GetIamPolicyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ContainerAnalysis_TestIamPermissions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(google_iam_v11.TestIamPermissionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContainerAnalysisServer).TestIamPermissions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.containeranalysis.v1alpha1.ContainerAnalysis/TestIamPermissions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContainerAnalysisServer).TestIamPermissions(ctx, req.(*google_iam_v11.TestIamPermissionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _ContainerAnalysis_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.devtools.containeranalysis.v1alpha1.ContainerAnalysis", + HandlerType: (*ContainerAnalysisServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetOccurrence", + Handler: _ContainerAnalysis_GetOccurrence_Handler, + }, + { + MethodName: "ListOccurrences", + Handler: _ContainerAnalysis_ListOccurrences_Handler, + }, + { + MethodName: "DeleteOccurrence", + Handler: _ContainerAnalysis_DeleteOccurrence_Handler, + }, + { + MethodName: "CreateOccurrence", + Handler: _ContainerAnalysis_CreateOccurrence_Handler, + }, + { + MethodName: "UpdateOccurrence", + Handler: _ContainerAnalysis_UpdateOccurrence_Handler, + }, + { + MethodName: "GetOccurrenceNote", + Handler: _ContainerAnalysis_GetOccurrenceNote_Handler, + }, + { + MethodName: "GetNote", + Handler: _ContainerAnalysis_GetNote_Handler, + }, + { + MethodName: "ListNotes", + Handler: _ContainerAnalysis_ListNotes_Handler, + }, + { + MethodName: "DeleteNote", + Handler: _ContainerAnalysis_DeleteNote_Handler, + }, + { + MethodName: "CreateNote", + Handler: _ContainerAnalysis_CreateNote_Handler, + }, + { + MethodName: "UpdateNote", + Handler: _ContainerAnalysis_UpdateNote_Handler, + }, + { + MethodName: "ListNoteOccurrences", + Handler: _ContainerAnalysis_ListNoteOccurrences_Handler, + }, + { + MethodName: "GetVulnzOccurrencesSummary", + Handler: _ContainerAnalysis_GetVulnzOccurrencesSummary_Handler, + }, + { + MethodName: "SetIamPolicy", + Handler: _ContainerAnalysis_SetIamPolicy_Handler, + }, + { + MethodName: "GetIamPolicy", + Handler: _ContainerAnalysis_GetIamPolicy_Handler, + }, + { + MethodName: "TestIamPermissions", + Handler: _ContainerAnalysis_TestIamPermissions_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/devtools/containeranalysis/v1alpha1/containeranalysis.proto", +} + +func init() { + proto.RegisterFile("google/devtools/containeranalysis/v1alpha1/containeranalysis.proto", fileDescriptor1) +} + +var fileDescriptor1 = []byte{ + // 2432 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x5a, 0xdd, 0x6f, 0x23, 0x57, + 0x15, 0xdf, 0x89, 0x93, 0x38, 0x3e, 0xce, 0x87, 0x7d, 0xbb, 0xdb, 0xb8, 0x6e, 0x0b, 0xe9, 0x94, + 0xd2, 0x6d, 0x16, 0x6c, 0x12, 0xba, 0x14, 0x92, 0xae, 0xb6, 0xfe, 0x8a, 0xd7, 0xe4, 0xcb, 0x1a, + 0x27, 0xd1, 0x6e, 0x5b, 0x3a, 0xba, 0xf6, 0xdc, 0xb8, 0x83, 0xc7, 0x33, 0xc3, 0xcc, 0xd8, 0xaa, + 0x17, 0xf5, 0x05, 0x90, 0x50, 0x11, 0x5f, 0x02, 0x09, 0x21, 0x21, 0x40, 0xaa, 0x10, 0x12, 0xf0, + 0x52, 0x21, 0xf1, 0xc6, 0x13, 0xe2, 0x15, 0x5e, 0x78, 0x46, 0x7d, 0xe1, 0x81, 0x37, 0xfe, 0x05, + 0x74, 0xef, 0xdc, 0x6b, 0x8f, 0x3f, 0x92, 0x78, 0xe2, 0xad, 0xd4, 0xa7, 0x9d, 0x7b, 0xee, 0xb9, + 0xbf, 0x73, 0xee, 0x99, 0xf3, 0xf1, 0x9b, 0xac, 0x21, 0xdf, 0xb4, 0xac, 0xa6, 0x41, 0xb2, 0x1a, + 0xe9, 0x7a, 0x96, 0x65, 0xb8, 0xd9, 0x86, 0x65, 0x7a, 0x58, 0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0x53, 0xa1, 0xc7, 0x33, 0x45, 0x1f, 0x8c, 0xda, + 0xe1, 0xb8, 0x4c, 0x8e, 0xda, 0xb0, 0xac, 0x9b, 0xae, 0x87, 0x0d, 0x83, 0x25, 0x65, 0x6a, 0x99, + 0x99, 0x29, 0x87, 0x31, 0x53, 0xf5, 0x4b, 0xef, 0x10, 0x9b, 0xb8, 0x49, 0x9c, 0x4c, 0x25, 0x00, + 0x47, 0xcd, 0x05, 0xe1, 0x51, 0x03, 0x40, 0x23, 0xb6, 0x61, 0xf5, 0xda, 0xc4, 0xf4, 0x52, 0xab, + 0xcc, 0x58, 0x2e, 0xd4, 0x9d, 0xd8, 0x69, 0x5c, 0x37, 0x08, 0x7f, 0xa4, 0x40, 0x0f, 0x6e, 0x28, + 0x01, 0x58, 0x54, 0x07, 0xd0, 0x74, 0xb7, 0x61, 0x75, 0x89, 0x43, 0xb4, 0xd4, 0x1a, 0x33, 0xf2, + 0x46, 0x28, 0x23, 0xfc, 0x74, 0xaf, 0xff, 0xc4, 0x22, 0x17, 0x40, 0x45, 0x1b, 0x10, 0x77, 0x48, + 0x9b, 0x68, 0xba, 0x1f, 0xb6, 0x05, 0x51, 0x16, 0x7d, 0x11, 0xda, 0x85, 0x78, 0xc3, 0x21, 0xd8, + 0x23, 0x2a, 0x2d, 0xbb, 0x54, 0x8c, 0xb9, 0x91, 0x16, 0x6e, 0x88, 0x9a, 0xcc, 0x9c, 0x88, 0x9a, + 0x54, 0xc0, 0x57, 0xa7, 0x02, 0x7a, 0xb8, 0x63, 0x6b, 0xfd, 0xc3, 0x70, 0xf5, 0x61, 0x5f, 0x9d, + 0x0a, 0xf2, 0x31, 0x88, 0xf2, 0xb4, 0x94, 0xff, 0x1b, 0x83, 0x79, 0x5a, 0x47, 0x13, 0x6b, 0xfb, + 0x0e, 0x24, 0xdd, 0x77, 0x2d, 0xc7, 0x53, 0x35, 0xe2, 0x36, 0x1c, 0xdd, 0x66, 0x37, 0xf1, 0x0b, + 0x38, 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 0x27, 0xc4, 0x65, 0x42, 0xe2, 0xb4, 0x75, 0xd7, 0xd5, 0x2d, + 0xd3, 0x45, 0xb7, 0x47, 0xcc, 0x8d, 0xab, 0x08, 0xc7, 0x5e, 0x99, 0x42, 0x93, 0xbf, 0xb9, 0x12, + 0x73, 0xf6, 0xbe, 0xbc, 0x33, 0xad, 0xb3, 0xde, 0x18, 0xd6, 0x8e, 0xb4, 0x99, 0xff, 0xa1, 0x04, + 0x2f, 0x35, 0xac, 0xb6, 0xb0, 0x7b, 0x71, 0x36, 0x55, 0xa5, 0x37, 0xdf, 0xe2, 0x4a, 0x4d, 0xcb, + 0xc0, 0x66, 0x33, 0x63, 0x39, 0xcd, 0x6c, 0x93, 0x98, 0xac, 0x09, 0x67, 0xfd, 0x2d, 0x6c, 0xeb, + 0xee, 0x34, 0xbf, 0xde, 0xd9, 0x1d, 0xdb, 0xfa, 0x70, 0x2e, 0x52, 0x2e, 0xe4, 0xea, 0x8b, 0x0c, + 0xed, 0xcb, 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff, 0x50, 0x37, 0x6f, 0x01, 0x62, 0x25, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/devtools/containeranalysis/v1alpha1/image_basis.pb.go b/vendor/google.golang.org/genproto/googleapis/devtools/containeranalysis/v1alpha1/image_basis.pb.go new file mode 100644 index 0000000000..fbafe4cfc7 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/devtools/containeranalysis/v1alpha1/image_basis.pb.go @@ -0,0 +1,324 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/devtools/containeranalysis/v1alpha1/image_basis.proto + +package containeranalysis + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Instructions from dockerfile +type DockerImage_Layer_Directive int32 + +const ( + // Default value for unsupported/missing directive + DockerImage_Layer_DIRECTIVE_UNSPECIFIED DockerImage_Layer_Directive = 0 + // https://docs.docker.com/reference/builder/#maintainer + DockerImage_Layer_MAINTAINER DockerImage_Layer_Directive = 1 + // https://docs.docker.com/reference/builder/#run + DockerImage_Layer_RUN DockerImage_Layer_Directive = 2 + // https://docs.docker.com/reference/builder/#cmd + DockerImage_Layer_CMD DockerImage_Layer_Directive = 3 + // https://docs.docker.com/reference/builder/#label + DockerImage_Layer_LABEL DockerImage_Layer_Directive = 4 + // https://docs.docker.com/reference/builder/#expose + DockerImage_Layer_EXPOSE DockerImage_Layer_Directive = 5 + // https://docs.docker.com/reference/builder/#env + DockerImage_Layer_ENV DockerImage_Layer_Directive = 6 + // https://docs.docker.com/reference/builder/#add + DockerImage_Layer_ADD DockerImage_Layer_Directive = 7 + // https://docs.docker.com/reference/builder/#copy + DockerImage_Layer_COPY DockerImage_Layer_Directive = 8 + // https://docs.docker.com/reference/builder/#entrypoint + DockerImage_Layer_ENTRYPOINT DockerImage_Layer_Directive = 9 + // https://docs.docker.com/reference/builder/#volume + DockerImage_Layer_VOLUME DockerImage_Layer_Directive = 10 + // https://docs.docker.com/reference/builder/#user + DockerImage_Layer_USER DockerImage_Layer_Directive = 11 + // https://docs.docker.com/reference/builder/#workdir + DockerImage_Layer_WORKDIR DockerImage_Layer_Directive = 12 + // https://docs.docker.com/reference/builder/#arg + DockerImage_Layer_ARG DockerImage_Layer_Directive = 13 + // https://docs.docker.com/reference/builder/#onbuild + DockerImage_Layer_ONBUILD DockerImage_Layer_Directive = 14 + // https://docs.docker.com/reference/builder/#stopsignal + DockerImage_Layer_STOPSIGNAL DockerImage_Layer_Directive = 15 + // https://docs.docker.com/reference/builder/#healthcheck + DockerImage_Layer_HEALTHCHECK DockerImage_Layer_Directive = 16 + // https://docs.docker.com/reference/builder/#shell + DockerImage_Layer_SHELL DockerImage_Layer_Directive = 17 +) + +var DockerImage_Layer_Directive_name = map[int32]string{ + 0: "DIRECTIVE_UNSPECIFIED", + 1: "MAINTAINER", + 2: "RUN", + 3: "CMD", + 4: "LABEL", + 5: "EXPOSE", + 6: "ENV", + 7: "ADD", + 8: "COPY", + 9: "ENTRYPOINT", + 10: "VOLUME", + 11: "USER", + 12: "WORKDIR", + 13: "ARG", + 14: "ONBUILD", + 15: "STOPSIGNAL", + 16: "HEALTHCHECK", + 17: "SHELL", +} +var DockerImage_Layer_Directive_value = map[string]int32{ + "DIRECTIVE_UNSPECIFIED": 0, + "MAINTAINER": 1, + "RUN": 2, + "CMD": 3, + "LABEL": 4, + "EXPOSE": 5, + "ENV": 6, + "ADD": 7, + "COPY": 8, + "ENTRYPOINT": 9, + "VOLUME": 10, + "USER": 11, + "WORKDIR": 12, + "ARG": 13, + "ONBUILD": 14, + "STOPSIGNAL": 15, + "HEALTHCHECK": 16, + "SHELL": 17, +} + +func (x DockerImage_Layer_Directive) String() string { + return proto.EnumName(DockerImage_Layer_Directive_name, int32(x)) +} +func (DockerImage_Layer_Directive) EnumDescriptor() ([]byte, []int) { + return fileDescriptor2, []int{0, 0, 0} +} + +// DockerImage holds types defining base image notes +// and derived image occurrences. +type DockerImage struct { +} + +func (m *DockerImage) Reset() { *m = DockerImage{} } +func (m *DockerImage) String() string { return proto.CompactTextString(m) } +func (*DockerImage) ProtoMessage() {} +func (*DockerImage) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} } + +// Layer holds metadata specific to a layer of a Docker image. +type DockerImage_Layer struct { + // The recovered Dockerfile directive used to construct this layer. + Directive DockerImage_Layer_Directive `protobuf:"varint,1,opt,name=directive,enum=google.devtools.containeranalysis.v1alpha1.DockerImage_Layer_Directive" json:"directive,omitempty"` + // The recovered arguments to the Dockerfile directive. + Arguments string `protobuf:"bytes,2,opt,name=arguments" json:"arguments,omitempty"` +} + +func (m *DockerImage_Layer) Reset() { *m = DockerImage_Layer{} } +func (m *DockerImage_Layer) String() string { return proto.CompactTextString(m) } +func (*DockerImage_Layer) ProtoMessage() {} +func (*DockerImage_Layer) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0, 0} } + +func (m *DockerImage_Layer) GetDirective() DockerImage_Layer_Directive { + if m != nil { + return m.Directive + } + return DockerImage_Layer_DIRECTIVE_UNSPECIFIED +} + +func (m *DockerImage_Layer) GetArguments() string { + if m != nil { + return m.Arguments + } + return "" +} + +// A set of properties that uniquely identify a given Docker image. +type DockerImage_Fingerprint struct { + // The layer-id of the final layer in the Docker image's v1 + // representation. + // This field can be used as a filter in list requests. + V1Name string `protobuf:"bytes,1,opt,name=v1_name,json=v1Name" json:"v1_name,omitempty"` + // The ordered list of v2 blobs that represent a given image. + V2Blob []string `protobuf:"bytes,2,rep,name=v2_blob,json=v2Blob" json:"v2_blob,omitempty"` + // Output only. The name of the image's v2 blobs computed via: + // [bottom] := v2_blob[bottom] + // [N] := sha256(v2_blob[N] + " " + v2_name[N+1]) + // Only the name of the final blob is kept. + // This field can be used as a filter in list requests. + V2Name string `protobuf:"bytes,3,opt,name=v2_name,json=v2Name" json:"v2_name,omitempty"` +} + +func (m *DockerImage_Fingerprint) Reset() { *m = DockerImage_Fingerprint{} } +func (m *DockerImage_Fingerprint) String() string { return proto.CompactTextString(m) } +func (*DockerImage_Fingerprint) ProtoMessage() {} +func (*DockerImage_Fingerprint) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0, 1} } + +func (m *DockerImage_Fingerprint) GetV1Name() string { + if m != nil { + return m.V1Name + } + return "" +} + +func (m *DockerImage_Fingerprint) GetV2Blob() []string { + if m != nil { + return m.V2Blob + } + return nil +} + +func (m *DockerImage_Fingerprint) GetV2Name() string { + if m != nil { + return m.V2Name + } + return "" +} + +// Basis describes the base image portion (Note) of the DockerImage +// relationship. Linked occurrences are derived from this or an +// equivalent image via: +// FROM +// Or an equivalent reference, e.g. a tag of the resource_url. +type DockerImage_Basis struct { + // The resource_url for the resource representing the basis of + // associated occurrence images. + ResourceUrl string `protobuf:"bytes,1,opt,name=resource_url,json=resourceUrl" json:"resource_url,omitempty"` + // The fingerprint of the base image + Fingerprint *DockerImage_Fingerprint `protobuf:"bytes,2,opt,name=fingerprint" json:"fingerprint,omitempty"` +} + +func (m *DockerImage_Basis) Reset() { *m = DockerImage_Basis{} } +func (m *DockerImage_Basis) String() string { return proto.CompactTextString(m) } +func (*DockerImage_Basis) ProtoMessage() {} +func (*DockerImage_Basis) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0, 2} } + +func (m *DockerImage_Basis) GetResourceUrl() string { + if m != nil { + return m.ResourceUrl + } + return "" +} + +func (m *DockerImage_Basis) GetFingerprint() *DockerImage_Fingerprint { + if m != nil { + return m.Fingerprint + } + return nil +} + +// Derived describes the derived image portion (Occurrence) of the +// DockerImage relationship. This image would be produced from a Dockerfile +// with FROM . +type DockerImage_Derived struct { + // The fingerprint of the derived image + Fingerprint *DockerImage_Fingerprint `protobuf:"bytes,1,opt,name=fingerprint" json:"fingerprint,omitempty"` + // Output only. The number of layers by which this image differs from + // the associated image basis. + Distance uint32 `protobuf:"varint,2,opt,name=distance" json:"distance,omitempty"` + // This contains layer-specific metadata, if populated it + // has length "distance" and is ordered with [distance] being the + // layer immediately following the base image and [1] + // being the final layer. + LayerInfo []*DockerImage_Layer `protobuf:"bytes,3,rep,name=layer_info,json=layerInfo" json:"layer_info,omitempty"` + // Output only.This contains the base image url for the derived image + // Occurrence + BaseResourceUrl string `protobuf:"bytes,4,opt,name=base_resource_url,json=baseResourceUrl" json:"base_resource_url,omitempty"` +} + +func (m *DockerImage_Derived) Reset() { *m = DockerImage_Derived{} } +func (m *DockerImage_Derived) String() string { return proto.CompactTextString(m) } +func (*DockerImage_Derived) ProtoMessage() {} +func (*DockerImage_Derived) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0, 3} } + +func (m *DockerImage_Derived) GetFingerprint() *DockerImage_Fingerprint { + if m != nil { + return m.Fingerprint + } + return nil +} + +func (m *DockerImage_Derived) GetDistance() uint32 { + if m != nil { + return m.Distance + } + return 0 +} + +func (m *DockerImage_Derived) GetLayerInfo() []*DockerImage_Layer { + if m != nil { + return m.LayerInfo + } + return nil +} + +func (m *DockerImage_Derived) GetBaseResourceUrl() string { + if m != nil { + return m.BaseResourceUrl + } + return "" +} + +func init() { + proto.RegisterType((*DockerImage)(nil), "google.devtools.containeranalysis.v1alpha1.DockerImage") + proto.RegisterType((*DockerImage_Layer)(nil), "google.devtools.containeranalysis.v1alpha1.DockerImage.Layer") + proto.RegisterType((*DockerImage_Fingerprint)(nil), "google.devtools.containeranalysis.v1alpha1.DockerImage.Fingerprint") + proto.RegisterType((*DockerImage_Basis)(nil), "google.devtools.containeranalysis.v1alpha1.DockerImage.Basis") + proto.RegisterType((*DockerImage_Derived)(nil), "google.devtools.containeranalysis.v1alpha1.DockerImage.Derived") + proto.RegisterEnum("google.devtools.containeranalysis.v1alpha1.DockerImage_Layer_Directive", DockerImage_Layer_Directive_name, DockerImage_Layer_Directive_value) +} + +func init() { + proto.RegisterFile("google/devtools/containeranalysis/v1alpha1/image_basis.proto", fileDescriptor2) +} + +var fileDescriptor2 = []byte{ + // 627 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x94, 0xdf, 0x6e, 0xda, 0x30, + 0x14, 0xc6, 0x17, 0x28, 0xd0, 0x9c, 0xf4, 0x8f, 0x6b, 0x69, 0x1a, 0x43, 0xbd, 0x60, 0x95, 0x26, + 0x55, 0xbd, 0x08, 0x82, 0x5d, 0x6e, 0xbb, 0x80, 0xc4, 0x85, 0xa8, 0x69, 0x40, 0x06, 0xba, 0x76, + 0x9b, 0x84, 0x0c, 0xb8, 0x59, 0xb4, 0x60, 0x23, 0x27, 0x45, 0xea, 0x3b, 0xec, 0x66, 0x37, 0x7d, + 0x80, 0x3d, 0xe1, 0xde, 0x60, 0x93, 0x53, 0x28, 0xdd, 0xaa, 0x49, 0xd5, 0xa6, 0xdd, 0x99, 0xf3, + 0xf9, 0xfb, 0x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/vendor/google.golang.org/genproto/googleapis/devtools/containeranalysis/v1alpha1/package_vulnerability.pb.go b/vendor/google.golang.org/genproto/googleapis/devtools/containeranalysis/v1alpha1/package_vulnerability.pb.go new file mode 100644 index 0000000000..20a81674ce --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/devtools/containeranalysis/v1alpha1/package_vulnerability.pb.go @@ -0,0 +1,468 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/devtools/containeranalysis/v1alpha1/package_vulnerability.proto + +package containeranalysis + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Note provider-assigned severity/impact ranking +type VulnerabilityType_Severity int32 + +const ( + // Unknown Impact + VulnerabilityType_SEVERITY_UNSPECIFIED VulnerabilityType_Severity = 0 + // Minimal Impact + VulnerabilityType_MINIMAL VulnerabilityType_Severity = 1 + // Low Impact + VulnerabilityType_LOW VulnerabilityType_Severity = 2 + // Medium Impact + VulnerabilityType_MEDIUM VulnerabilityType_Severity = 3 + // High Impact + VulnerabilityType_HIGH VulnerabilityType_Severity = 4 + // Critical Impact + VulnerabilityType_CRITICAL VulnerabilityType_Severity = 5 +) + +var VulnerabilityType_Severity_name = map[int32]string{ + 0: "SEVERITY_UNSPECIFIED", + 1: "MINIMAL", + 2: "LOW", + 3: "MEDIUM", + 4: "HIGH", + 5: "CRITICAL", +} +var VulnerabilityType_Severity_value = map[string]int32{ + "SEVERITY_UNSPECIFIED": 0, + "MINIMAL": 1, + "LOW": 2, + "MEDIUM": 3, + "HIGH": 4, + "CRITICAL": 5, +} + +func (x VulnerabilityType_Severity) String() string { + return proto.EnumName(VulnerabilityType_Severity_name, int32(x)) +} +func (VulnerabilityType_Severity) EnumDescriptor() ([]byte, []int) { + return fileDescriptor3, []int{0, 0} +} + +// Whether this is an ordinary package version or a +// sentinel MIN/MAX version. +type VulnerabilityType_Version_VersionKind int32 + +const ( + // A standard package version, defined by the other fields. + VulnerabilityType_Version_NORMAL VulnerabilityType_Version_VersionKind = 0 + // A special version representing negative infinity, + // other fields are ignored. + VulnerabilityType_Version_MINIMUM VulnerabilityType_Version_VersionKind = 1 + // A special version representing positive infinity, + // other fields are ignored. + VulnerabilityType_Version_MAXIMUM VulnerabilityType_Version_VersionKind = 2 +) + +var VulnerabilityType_Version_VersionKind_name = map[int32]string{ + 0: "NORMAL", + 1: "MINIMUM", + 2: "MAXIMUM", +} +var VulnerabilityType_Version_VersionKind_value = map[string]int32{ + "NORMAL": 0, + "MINIMUM": 1, + "MAXIMUM": 2, +} + +func (x VulnerabilityType_Version_VersionKind) String() string { + return proto.EnumName(VulnerabilityType_Version_VersionKind_name, int32(x)) +} +func (VulnerabilityType_Version_VersionKind) EnumDescriptor() ([]byte, []int) { + return fileDescriptor3, []int{0, 0, 0} +} + +// VulnerabilityType provides metadata about a security vulnerability. +type VulnerabilityType struct { + // The CVSS score for this Vulnerability. + CvssScore float32 `protobuf:"fixed32,2,opt,name=cvss_score,json=cvssScore" json:"cvss_score,omitempty"` + // Note provider assigned impact of the vulnerability + Severity VulnerabilityType_Severity `protobuf:"varint,3,opt,name=severity,enum=google.devtools.containeranalysis.v1alpha1.VulnerabilityType_Severity" json:"severity,omitempty"` + // All information about the package to specifically identify this + // vulnerability. One entry per (version range and cpe_uri) the + // package vulnerability has manifested in. + Details []*VulnerabilityType_Detail `protobuf:"bytes,4,rep,name=details" json:"details,omitempty"` +} + +func (m *VulnerabilityType) Reset() { *m = VulnerabilityType{} } +func (m *VulnerabilityType) String() string { return proto.CompactTextString(m) } +func (*VulnerabilityType) ProtoMessage() {} +func (*VulnerabilityType) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} } + +func (m *VulnerabilityType) GetCvssScore() float32 { + if m != nil { + return m.CvssScore + } + return 0 +} + +func (m *VulnerabilityType) GetSeverity() VulnerabilityType_Severity { + if m != nil { + return m.Severity + } + return VulnerabilityType_SEVERITY_UNSPECIFIED +} + +func (m *VulnerabilityType) GetDetails() []*VulnerabilityType_Detail { + if m != nil { + return m.Details + } + return nil +} + +// Version contains structured information about the version of the package. +// For a discussion of this in Debian/Ubuntu: +// http://serverfault.com/questions/604541/debian-packages-version-convention +// For a discussion of this in Redhat/Fedora/Centos: +// http://blog.jasonantman.com/2014/07/how-yum-and-rpm-compare-versions/ +type VulnerabilityType_Version struct { + // Used to correct mistakes in the version numbering scheme. + Epoch int32 `protobuf:"varint,1,opt,name=epoch" json:"epoch,omitempty"` + // The main part of the version name. + Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` + // The iteration of the package build from the above version. + Revision string `protobuf:"bytes,3,opt,name=revision" json:"revision,omitempty"` + // Distinguish between sentinel MIN/MAX versions and normal versions. + // If kind is not NORMAL, then the other fields are ignored. + Kind VulnerabilityType_Version_VersionKind `protobuf:"varint,5,opt,name=kind,enum=google.devtools.containeranalysis.v1alpha1.VulnerabilityType_Version_VersionKind" json:"kind,omitempty"` +} + +func (m *VulnerabilityType_Version) Reset() { *m = VulnerabilityType_Version{} } +func (m *VulnerabilityType_Version) String() string { return proto.CompactTextString(m) } +func (*VulnerabilityType_Version) ProtoMessage() {} +func (*VulnerabilityType_Version) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0, 0} } + +func (m *VulnerabilityType_Version) GetEpoch() int32 { + if m != nil { + return m.Epoch + } + return 0 +} + +func (m *VulnerabilityType_Version) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *VulnerabilityType_Version) GetRevision() string { + if m != nil { + return m.Revision + } + return "" +} + +func (m *VulnerabilityType_Version) GetKind() VulnerabilityType_Version_VersionKind { + if m != nil { + return m.Kind + } + return VulnerabilityType_Version_NORMAL +} + +// Identifies all occurrences of this vulnerability in the package for a +// specific distro/location +// For example: glibc in cpe:/o:debian:debian_linux:8 for versions 2.1 - 2.2 +type VulnerabilityType_Detail struct { + // The cpe_uri in [cpe format] (https://cpe.mitre.org/specification/) in + // which the vulnerability manifests. Examples include distro or storage + // location for vulnerable jar. + // This field can be used as a filter in list requests. + CpeUri string `protobuf:"bytes,1,opt,name=cpe_uri,json=cpeUri" json:"cpe_uri,omitempty"` + // The name of the package where the vulnerability was found. + // This field can be used as a filter in list requests. + Package string `protobuf:"bytes,8,opt,name=package" json:"package,omitempty"` + // The min version of the package in which the vulnerability exists. + MinAffectedVersion *VulnerabilityType_Version `protobuf:"bytes,6,opt,name=min_affected_version,json=minAffectedVersion" json:"min_affected_version,omitempty"` + // The max version of the package in which the vulnerability exists. + // This field can be used as a filter in list requests. + MaxAffectedVersion *VulnerabilityType_Version `protobuf:"bytes,7,opt,name=max_affected_version,json=maxAffectedVersion" json:"max_affected_version,omitempty"` + // The severity (eg: distro assigned severity) for this vulnerability. + SeverityName string `protobuf:"bytes,4,opt,name=severity_name,json=severityName" json:"severity_name,omitempty"` + // A vendor-specific description of this note. + Description string `protobuf:"bytes,9,opt,name=description" json:"description,omitempty"` + // The fix for this specific package version. + FixedLocation *VulnerabilityType_VulnerabilityLocation `protobuf:"bytes,5,opt,name=fixed_location,json=fixedLocation" json:"fixed_location,omitempty"` + // The type of package; whether native or non native(ruby gems, + // node.js packages etc) + PackageType string `protobuf:"bytes,10,opt,name=package_type,json=packageType" json:"package_type,omitempty"` +} + +func (m *VulnerabilityType_Detail) Reset() { *m = VulnerabilityType_Detail{} } +func (m *VulnerabilityType_Detail) String() string { return proto.CompactTextString(m) } +func (*VulnerabilityType_Detail) ProtoMessage() {} +func (*VulnerabilityType_Detail) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0, 1} } + +func (m *VulnerabilityType_Detail) GetCpeUri() string { + if m != nil { + return m.CpeUri + } + return "" +} + +func (m *VulnerabilityType_Detail) GetPackage() string { + if m != nil { + return m.Package + } + return "" +} + +func (m *VulnerabilityType_Detail) GetMinAffectedVersion() *VulnerabilityType_Version { + if m != nil { + return m.MinAffectedVersion + } + return nil +} + +func (m *VulnerabilityType_Detail) GetMaxAffectedVersion() *VulnerabilityType_Version { + if m != nil { + return m.MaxAffectedVersion + } + return nil +} + +func (m *VulnerabilityType_Detail) GetSeverityName() string { + if m != nil { + return m.SeverityName + } + return "" +} + +func (m *VulnerabilityType_Detail) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *VulnerabilityType_Detail) GetFixedLocation() *VulnerabilityType_VulnerabilityLocation { + if m != nil { + return m.FixedLocation + } + return nil +} + +func (m *VulnerabilityType_Detail) GetPackageType() string { + if m != nil { + return m.PackageType + } + return "" +} + +// Used by Occurrence to point to where the vulnerability exists and how +// to fix it. +type VulnerabilityType_VulnerabilityDetails struct { + // The type of package; whether native or non native(ruby gems, + // node.js packages etc) + Type string `protobuf:"bytes,3,opt,name=type" json:"type,omitempty"` + // Output only. The note provider assigned Severity of the vulnerability. + Severity VulnerabilityType_Severity `protobuf:"varint,4,opt,name=severity,enum=google.devtools.containeranalysis.v1alpha1.VulnerabilityType_Severity" json:"severity,omitempty"` + // Output only. The CVSS score of this vulnerability. CVSS score is on a + // scale of 0-10 where 0 indicates low severity and 10 indicates high + // severity. + CvssScore float32 `protobuf:"fixed32,5,opt,name=cvss_score,json=cvssScore" json:"cvss_score,omitempty"` + // The set of affected locations and their fixes (if available) within + // the associated resource. + PackageIssue []*VulnerabilityType_PackageIssue `protobuf:"bytes,6,rep,name=package_issue,json=packageIssue" json:"package_issue,omitempty"` +} + +func (m *VulnerabilityType_VulnerabilityDetails) Reset() { + *m = VulnerabilityType_VulnerabilityDetails{} +} +func (m *VulnerabilityType_VulnerabilityDetails) String() string { return proto.CompactTextString(m) } +func (*VulnerabilityType_VulnerabilityDetails) ProtoMessage() {} +func (*VulnerabilityType_VulnerabilityDetails) Descriptor() ([]byte, []int) { + return fileDescriptor3, []int{0, 2} +} + +func (m *VulnerabilityType_VulnerabilityDetails) GetType() string { + if m != nil { + return m.Type + } + return "" +} + +func (m *VulnerabilityType_VulnerabilityDetails) GetSeverity() VulnerabilityType_Severity { + if m != nil { + return m.Severity + } + return VulnerabilityType_SEVERITY_UNSPECIFIED +} + +func (m *VulnerabilityType_VulnerabilityDetails) GetCvssScore() float32 { + if m != nil { + return m.CvssScore + } + return 0 +} + +func (m *VulnerabilityType_VulnerabilityDetails) GetPackageIssue() []*VulnerabilityType_PackageIssue { + if m != nil { + return m.PackageIssue + } + return nil +} + +// This message wraps a location affected by a vulnerability and its +// associated fix (if one is available). +type VulnerabilityType_PackageIssue struct { + // The location of the vulnerability. + AffectedLocation *VulnerabilityType_VulnerabilityLocation `protobuf:"bytes,1,opt,name=affected_location,json=affectedLocation" json:"affected_location,omitempty"` + // The location of the available fix for vulnerability. + FixedLocation *VulnerabilityType_VulnerabilityLocation `protobuf:"bytes,2,opt,name=fixed_location,json=fixedLocation" json:"fixed_location,omitempty"` + // The severity (eg: distro assigned severity) for this vulnerability. + SeverityName string `protobuf:"bytes,3,opt,name=severity_name,json=severityName" json:"severity_name,omitempty"` +} + +func (m *VulnerabilityType_PackageIssue) Reset() { *m = VulnerabilityType_PackageIssue{} } +func (m *VulnerabilityType_PackageIssue) String() string { return proto.CompactTextString(m) } +func (*VulnerabilityType_PackageIssue) ProtoMessage() {} +func (*VulnerabilityType_PackageIssue) Descriptor() ([]byte, []int) { + return fileDescriptor3, []int{0, 3} +} + +func (m *VulnerabilityType_PackageIssue) GetAffectedLocation() *VulnerabilityType_VulnerabilityLocation { + if m != nil { + return m.AffectedLocation + } + return nil +} + +func (m *VulnerabilityType_PackageIssue) GetFixedLocation() *VulnerabilityType_VulnerabilityLocation { + if m != nil { + return m.FixedLocation + } + return nil +} + +func (m *VulnerabilityType_PackageIssue) GetSeverityName() string { + if m != nil { + return m.SeverityName + } + return "" +} + +// The location of the vulnerability +type VulnerabilityType_VulnerabilityLocation struct { + // The cpe_uri in [cpe format] (https://cpe.mitre.org/specification/) + // format. Examples include distro or storage location for vulnerable jar. + // This field can be used as a filter in list requests. + CpeUri string `protobuf:"bytes,1,opt,name=cpe_uri,json=cpeUri" json:"cpe_uri,omitempty"` + // The package being described. + Package string `protobuf:"bytes,2,opt,name=package" json:"package,omitempty"` + // The version of the package being described. + // This field can be used as a filter in list requests. + Version *VulnerabilityType_Version `protobuf:"bytes,4,opt,name=version" json:"version,omitempty"` +} + +func (m *VulnerabilityType_VulnerabilityLocation) Reset() { + *m = VulnerabilityType_VulnerabilityLocation{} +} +func (m *VulnerabilityType_VulnerabilityLocation) String() string { return proto.CompactTextString(m) } +func (*VulnerabilityType_VulnerabilityLocation) ProtoMessage() {} +func (*VulnerabilityType_VulnerabilityLocation) Descriptor() ([]byte, []int) { + return fileDescriptor3, []int{0, 4} +} + +func (m *VulnerabilityType_VulnerabilityLocation) GetCpeUri() string { + if m != nil { + return m.CpeUri + } + return "" +} + +func (m *VulnerabilityType_VulnerabilityLocation) GetPackage() string { + if m != nil { + return m.Package + } + return "" +} + +func (m *VulnerabilityType_VulnerabilityLocation) GetVersion() *VulnerabilityType_Version { + if m != nil { + return m.Version + } + return nil +} + +func init() { + proto.RegisterType((*VulnerabilityType)(nil), "google.devtools.containeranalysis.v1alpha1.VulnerabilityType") + proto.RegisterType((*VulnerabilityType_Version)(nil), "google.devtools.containeranalysis.v1alpha1.VulnerabilityType.Version") + proto.RegisterType((*VulnerabilityType_Detail)(nil), "google.devtools.containeranalysis.v1alpha1.VulnerabilityType.Detail") + proto.RegisterType((*VulnerabilityType_VulnerabilityDetails)(nil), "google.devtools.containeranalysis.v1alpha1.VulnerabilityType.VulnerabilityDetails") + proto.RegisterType((*VulnerabilityType_PackageIssue)(nil), "google.devtools.containeranalysis.v1alpha1.VulnerabilityType.PackageIssue") + proto.RegisterType((*VulnerabilityType_VulnerabilityLocation)(nil), "google.devtools.containeranalysis.v1alpha1.VulnerabilityType.VulnerabilityLocation") + proto.RegisterEnum("google.devtools.containeranalysis.v1alpha1.VulnerabilityType_Severity", VulnerabilityType_Severity_name, VulnerabilityType_Severity_value) + proto.RegisterEnum("google.devtools.containeranalysis.v1alpha1.VulnerabilityType_Version_VersionKind", VulnerabilityType_Version_VersionKind_name, VulnerabilityType_Version_VersionKind_value) +} + +func init() { + proto.RegisterFile("google/devtools/containeranalysis/v1alpha1/package_vulnerability.proto", fileDescriptor3) +} + +var fileDescriptor3 = []byte{ + // 750 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xcf, 0x6e, 0xda, 0x4c, + 0x10, 0xff, 0x6c, 0x0c, 0x86, 0x81, 0x44, 0xce, 0x8a, 0x4f, 0x9f, 0x85, 0xbe, 0x4a, 0x34, 0x55, + 0x25, 0xd4, 0x83, 0x51, 0xc8, 0xb1, 0x27, 0x0a, 0x24, 0x71, 0x0b, 0x24, 0x35, 0x21, 0xfd, 0x27, + 0xc5, 0xda, 0x98, 0x0d, 0x59, 0xc5, 0x78, 0x2d, 0xdb, 0xa1, 0xa1, 0xa7, 0x3e, 0x40, 0x6f, 0xbd, + 0xf7, 0xd0, 0x6b, 0x6f, 0x7d, 0xa0, 0xbe, 0x40, 0x5f, 0xa2, 0xf2, 0xda, 0x8b, 0x20, 0xb4, 0x52, + 0x24, 0x92, 0x9e, 0xf0, 0xcc, 0x78, 0x7f, 0xbf, 0x99, 0x9d, 0xdf, 0x0c, 0x86, 0xbd, 0x31, 0x63, + 0x63, 0x97, 0xd4, 0x47, 0x64, 0x1a, 0x31, 0xe6, 0x86, 0x75, 0x87, 0x79, 0x11, 0xa6, 0x1e, 0x09, + 0xb0, 0x87, 0xdd, 0x59, 0x48, 0xc3, 0xfa, 0x74, 0x07, 0xbb, 0xfe, 0x05, 0xde, 0xa9, 0xfb, 0xd8, + 0xb9, 0xc4, 0x63, 0x62, 0x4f, 0xaf, 0xdc, 0x38, 0x7e, 0x46, 0x5d, 0x1a, 0xcd, 0x0c, 0x3f, 0x60, + 0x11, 0x43, 0x4f, 0x12, 0x1c, 0x43, 0xe0, 0x18, 0x2b, 0x38, 0x86, 0xc0, 0xa9, 0xfc, 0x9f, 0x72, + 0x62, 0x9f, 0xd6, 0xb1, 0xe7, 0xb1, 0x08, 0x47, 0x94, 0x79, 0x61, 0x82, 0xb4, 0xfd, 0x63, 0x13, + 0xb6, 0x4e, 0x16, 0x19, 0x8e, 0x67, 0x3e, 0x41, 0x0f, 0x00, 0x9c, 0x69, 0x18, 0xda, 0xa1, 0xc3, + 0x02, 0xa2, 0xcb, 0x55, 0xa9, 0x26, 0x5b, 0x85, 0xd8, 0x33, 0x88, 0x1d, 0xe8, 0x0c, 0xf2, 0x21, + 0x99, 0x92, 0x80, 0x46, 0x33, 0x3d, 0x53, 0x95, 0x6a, 0x9b, 0x8d, 0x3d, 0xe3, 0xf6, 0x19, 0x19, + 0x2b, 0x7c, 0xc6, 0x20, 0x45, 0xb3, 0xe6, 0xb8, 0xe8, 0x14, 0xd4, 0x11, 0x89, 0x30, 0x75, 0x43, + 0x5d, 0xa9, 0x66, 0x6a, 0xc5, 0x46, 0x7b, 0x3d, 0x8a, 0x36, 0x07, 0xb3, 0x04, 0x68, 0xe5, 0xa7, + 0x04, 0xea, 0x09, 0x09, 0x42, 0xca, 0x3c, 0x54, 0x86, 0x2c, 0xf1, 0x99, 0x73, 0xa1, 0x4b, 0x55, + 0xa9, 0x96, 0xb5, 0x12, 0x03, 0x21, 0x50, 0x3c, 0x3c, 0x49, 0xca, 0x2f, 0x58, 0xfc, 0x19, 0x55, + 0x20, 0x1f, 0x90, 0x29, 0x8d, 0x4f, 0xf1, 0xca, 0x0b, 0xd6, 0xdc, 0x46, 0x04, 0x94, 0x4b, 0xea, + 0x8d, 0xf4, 0x2c, 0xbf, 0x91, 0x97, 0xeb, 0xa5, 0x9b, 0xa6, 0x26, 0x7e, 0x5f, 0x50, 0x6f, 0x64, + 0x71, 0xf8, 0xed, 0x5d, 0x28, 0x2e, 0x38, 0x11, 0x40, 0xae, 0x7f, 0x68, 0xf5, 0x9a, 0x5d, 0xed, + 0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be, 0x34, 0x66, 0x2e, + 0xf6, 0xc6, 0x06, 0x0b, 0xc6, 0xf5, 0x31, 0xf1, 0xf8, 0x1f, 0x75, 0x3d, 0x09, 0x61, 0x9f, 0x86, + 0xb7, 0xf9, 0x7a, 0x78, 0xba, 0x12, 0xfa, 0x2a, 0x67, 0xf6, 0x5b, 0xcd, 0xb3, 0x1c, 0x47, 0xdb, + 0xfd, 0x15, 0x00, 0x00, 0xff, 0xff, 0xe7, 0xe7, 0xb7, 0xf5, 0x8a, 0x08, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/devtools/containeranalysis/v1alpha1/provenance.pb.go b/vendor/google.golang.org/genproto/googleapis/devtools/containeranalysis/v1alpha1/provenance.pb.go new file mode 100644 index 0000000000..fa3e9b8c44 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/devtools/containeranalysis/v1alpha1/provenance.pb.go @@ -0,0 +1,797 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/devtools/containeranalysis/v1alpha1/provenance.proto + +package containeranalysis + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf1 "github.com/golang/protobuf/ptypes/timestamp" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Specifies the hash algorithm, if any. +type Hash_HashType int32 + +const ( + // No hash requested. + Hash_NONE Hash_HashType = 0 + // A sha256 hash. + Hash_SHA256 Hash_HashType = 1 +) + +var Hash_HashType_name = map[int32]string{ + 0: "NONE", + 1: "SHA256", +} +var Hash_HashType_value = map[string]int32{ + "NONE": 0, + "SHA256": 1, +} + +func (x Hash_HashType) String() string { + return proto.EnumName(Hash_HashType_name, int32(x)) +} +func (Hash_HashType) EnumDescriptor() ([]byte, []int) { return fileDescriptor4, []int{3, 0} } + +// Provenance of a build. Contains all information needed to verify the full +// details about the build from source to completion. +type BuildProvenance struct { + // Unique identifier of the build. + Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + // ID of the project. + ProjectId string `protobuf:"bytes,2,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // Commands requested by the build. + Commands []*Command `protobuf:"bytes,5,rep,name=commands" json:"commands,omitempty"` + // Output of the build. + BuiltArtifacts []*Artifact `protobuf:"bytes,6,rep,name=built_artifacts,json=builtArtifacts" json:"built_artifacts,omitempty"` + // Time at which the build was created. + CreateTime *google_protobuf1.Timestamp `protobuf:"bytes,7,opt,name=create_time,json=createTime" json:"create_time,omitempty"` + // Time at which execution of the build was started. + StartTime *google_protobuf1.Timestamp `protobuf:"bytes,8,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + // Time at which execution of the build was finished. + FinishTime *google_protobuf1.Timestamp `protobuf:"bytes,9,opt,name=finish_time,json=finishTime" json:"finish_time,omitempty"` + // E-mail address of the user who initiated this build. Note that this was the + // user's e-mail address at the time the build was initiated; this address may + // not represent the same end-user for all time. + Creator string `protobuf:"bytes,11,opt,name=creator" json:"creator,omitempty"` + // Google Cloud Storage bucket where logs were written. + LogsBucket string `protobuf:"bytes,13,opt,name=logs_bucket,json=logsBucket" json:"logs_bucket,omitempty"` + // Details of the Source input to the build. + SourceProvenance *Source `protobuf:"bytes,14,opt,name=source_provenance,json=sourceProvenance" json:"source_provenance,omitempty"` + // Trigger identifier if the build was triggered automatically; empty if not. + TriggerId string `protobuf:"bytes,15,opt,name=trigger_id,json=triggerId" json:"trigger_id,omitempty"` + // Special options applied to this build. This is a catch-all field where + // build providers can enter any desired additional details. + BuildOptions map[string]string `protobuf:"bytes,16,rep,name=build_options,json=buildOptions" json:"build_options,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // Version string of the builder at the time this build was executed. + BuilderVersion string `protobuf:"bytes,17,opt,name=builder_version,json=builderVersion" json:"builder_version,omitempty"` +} + +func (m *BuildProvenance) Reset() { *m = BuildProvenance{} } +func (m *BuildProvenance) String() string { return proto.CompactTextString(m) } +func (*BuildProvenance) ProtoMessage() {} +func (*BuildProvenance) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{0} } + +func (m *BuildProvenance) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *BuildProvenance) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *BuildProvenance) GetCommands() []*Command { + if m != nil { + return m.Commands + } + return nil +} + +func (m *BuildProvenance) GetBuiltArtifacts() []*Artifact { + if m != nil { + return m.BuiltArtifacts + } + return nil +} + +func (m *BuildProvenance) GetCreateTime() *google_protobuf1.Timestamp { + if m != nil { + return m.CreateTime + } + return nil +} + +func (m *BuildProvenance) GetStartTime() *google_protobuf1.Timestamp { + if m != nil { + return m.StartTime + } + return nil +} + +func (m *BuildProvenance) GetFinishTime() *google_protobuf1.Timestamp { + if m != nil { + return m.FinishTime + } + return nil +} + +func (m *BuildProvenance) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *BuildProvenance) GetLogsBucket() string { + if m != nil { + return m.LogsBucket + } + return "" +} + +func (m *BuildProvenance) GetSourceProvenance() *Source { + if m != nil { + return m.SourceProvenance + } + return nil +} + +func (m *BuildProvenance) GetTriggerId() string { + if m != nil { + return m.TriggerId + } + return "" +} + +func (m *BuildProvenance) GetBuildOptions() map[string]string { + if m != nil { + return m.BuildOptions + } + return nil +} + +func (m *BuildProvenance) GetBuilderVersion() string { + if m != nil { + return m.BuilderVersion + } + return "" +} + +// Source describes the location of the source used for the build. +type Source struct { + // Source location information. + // + // Types that are valid to be assigned to Source: + // *Source_StorageSource + // *Source_RepoSource + Source isSource_Source `protobuf_oneof:"source"` + // If provided, the input binary artifacts for the build came from this + // location. + ArtifactStorageSource *StorageSource `protobuf:"bytes,4,opt,name=artifact_storage_source,json=artifactStorageSource" json:"artifact_storage_source,omitempty"` + // Hash(es) of the build source, which can be used to verify that the original + // source integrity was maintained in the build. + // + // The keys to this map are file paths used as build source and the values + // contain the hash values for those files. + // + // If the build source came in a single package such as a gzipped tarfile + // (.tar.gz), the FileHash will be for the single path to that file. + FileHashes map[string]*FileHashes `protobuf:"bytes,3,rep,name=file_hashes,json=fileHashes" json:"file_hashes,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // If provided, the source code used for the build came from this location. + Context *SourceContext `protobuf:"bytes,7,opt,name=context" json:"context,omitempty"` + // If provided, some of the source code used for the build may be found in + // these locations, in the case where the source repository had multiple + // remotes or submodules. This list will not include the context specified in + // the context field. + AdditionalContexts []*SourceContext `protobuf:"bytes,8,rep,name=additional_contexts,json=additionalContexts" json:"additional_contexts,omitempty"` +} + +func (m *Source) Reset() { *m = Source{} } +func (m *Source) String() string { return proto.CompactTextString(m) } +func (*Source) ProtoMessage() {} +func (*Source) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{1} } + +type isSource_Source interface { + isSource_Source() +} + +type Source_StorageSource struct { + StorageSource *StorageSource `protobuf:"bytes,1,opt,name=storage_source,json=storageSource,oneof"` +} +type Source_RepoSource struct { + RepoSource *RepoSource `protobuf:"bytes,2,opt,name=repo_source,json=repoSource,oneof"` +} + +func (*Source_StorageSource) isSource_Source() {} +func (*Source_RepoSource) isSource_Source() {} + +func (m *Source) GetSource() isSource_Source { + if m != nil { + return m.Source + } + return nil +} + +func (m *Source) GetStorageSource() *StorageSource { + if x, ok := m.GetSource().(*Source_StorageSource); ok { + return x.StorageSource + } + return nil +} + +func (m *Source) GetRepoSource() *RepoSource { + if x, ok := m.GetSource().(*Source_RepoSource); ok { + return x.RepoSource + } + return nil +} + +func (m *Source) GetArtifactStorageSource() *StorageSource { + if m != nil { + return m.ArtifactStorageSource + } + return nil +} + +func (m *Source) GetFileHashes() map[string]*FileHashes { + if m != nil { + return m.FileHashes + } + return nil +} + +func (m *Source) GetContext() *SourceContext { + if m != nil { + return m.Context + } + return nil +} + +func (m *Source) GetAdditionalContexts() []*SourceContext { + if m != nil { + return m.AdditionalContexts + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Source) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _Source_OneofMarshaler, _Source_OneofUnmarshaler, _Source_OneofSizer, []interface{}{ + (*Source_StorageSource)(nil), + (*Source_RepoSource)(nil), + } +} + +func _Source_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Source) + // source + switch x := m.Source.(type) { + case *Source_StorageSource: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.StorageSource); err != nil { + return err + } + case *Source_RepoSource: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.RepoSource); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("Source.Source has unexpected type %T", x) + } + return nil +} + +func _Source_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Source) + switch tag { + case 1: // source.storage_source + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(StorageSource) + err := b.DecodeMessage(msg) + m.Source = &Source_StorageSource{msg} + return true, err + case 2: // source.repo_source + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(RepoSource) + err := b.DecodeMessage(msg) + m.Source = &Source_RepoSource{msg} + return true, err + default: + return false, nil + } +} + +func _Source_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Source) + // source + switch x := m.Source.(type) { + case *Source_StorageSource: + s := proto.Size(x.StorageSource) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Source_RepoSource: + s := proto.Size(x.RepoSource) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Container message for hashes of byte content of files, used in Source +// messages to verify integrity of source input to the build. +type FileHashes struct { + // Collection of file hashes. + FileHash []*Hash `protobuf:"bytes,1,rep,name=file_hash,json=fileHash" json:"file_hash,omitempty"` +} + +func (m *FileHashes) Reset() { *m = FileHashes{} } +func (m *FileHashes) String() string { return proto.CompactTextString(m) } +func (*FileHashes) ProtoMessage() {} +func (*FileHashes) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{2} } + +func (m *FileHashes) GetFileHash() []*Hash { + if m != nil { + return m.FileHash + } + return nil +} + +// Container message for hash values. +type Hash struct { + // The type of hash that was performed. + Type Hash_HashType `protobuf:"varint,1,opt,name=type,enum=google.devtools.containeranalysis.v1alpha1.Hash_HashType" json:"type,omitempty"` + // The hash value. + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (m *Hash) Reset() { *m = Hash{} } +func (m *Hash) String() string { return proto.CompactTextString(m) } +func (*Hash) ProtoMessage() {} +func (*Hash) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{3} } + +func (m *Hash) GetType() Hash_HashType { + if m != nil { + return m.Type + } + return Hash_NONE +} + +func (m *Hash) GetValue() []byte { + if m != nil { + return m.Value + } + return nil +} + +// StorageSource describes the location of the source in an archive file in +// Google Cloud Storage. +type StorageSource struct { + // Google Cloud Storage bucket containing source (see [Bucket Name + // Requirements] + // (https://cloud.google.com/storage/docs/bucket-naming#requirements)). + Bucket string `protobuf:"bytes,1,opt,name=bucket" json:"bucket,omitempty"` + // Google Cloud Storage object containing source. + Object string `protobuf:"bytes,2,opt,name=object" json:"object,omitempty"` + // Google Cloud Storage generation for the object. + Generation int64 `protobuf:"varint,3,opt,name=generation" json:"generation,omitempty"` +} + +func (m *StorageSource) Reset() { *m = StorageSource{} } +func (m *StorageSource) String() string { return proto.CompactTextString(m) } +func (*StorageSource) ProtoMessage() {} +func (*StorageSource) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{4} } + +func (m *StorageSource) GetBucket() string { + if m != nil { + return m.Bucket + } + return "" +} + +func (m *StorageSource) GetObject() string { + if m != nil { + return m.Object + } + return "" +} + +func (m *StorageSource) GetGeneration() int64 { + if m != nil { + return m.Generation + } + return 0 +} + +// RepoSource describes the location of the source in a Google Cloud Source +// Repository. +type RepoSource struct { + // ID of the project that owns the repo. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // Name of the repo. + RepoName string `protobuf:"bytes,2,opt,name=repo_name,json=repoName" json:"repo_name,omitempty"` + // A revision within the source repository must be specified in + // one of these ways. + // + // Types that are valid to be assigned to Revision: + // *RepoSource_BranchName + // *RepoSource_TagName + // *RepoSource_CommitSha + Revision isRepoSource_Revision `protobuf_oneof:"revision"` +} + +func (m *RepoSource) Reset() { *m = RepoSource{} } +func (m *RepoSource) String() string { return proto.CompactTextString(m) } +func (*RepoSource) ProtoMessage() {} +func (*RepoSource) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{5} } + +type isRepoSource_Revision interface { + isRepoSource_Revision() +} + +type RepoSource_BranchName struct { + BranchName string `protobuf:"bytes,3,opt,name=branch_name,json=branchName,oneof"` +} +type RepoSource_TagName struct { + TagName string `protobuf:"bytes,4,opt,name=tag_name,json=tagName,oneof"` +} +type RepoSource_CommitSha struct { + CommitSha string `protobuf:"bytes,5,opt,name=commit_sha,json=commitSha,oneof"` +} + +func (*RepoSource_BranchName) isRepoSource_Revision() {} +func (*RepoSource_TagName) isRepoSource_Revision() {} +func (*RepoSource_CommitSha) isRepoSource_Revision() {} + +func (m *RepoSource) GetRevision() isRepoSource_Revision { + if m != nil { + return m.Revision + } + return nil +} + +func (m *RepoSource) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *RepoSource) GetRepoName() string { + if m != nil { + return m.RepoName + } + return "" +} + +func (m *RepoSource) GetBranchName() string { + if x, ok := m.GetRevision().(*RepoSource_BranchName); ok { + return x.BranchName + } + return "" +} + +func (m *RepoSource) GetTagName() string { + if x, ok := m.GetRevision().(*RepoSource_TagName); ok { + return x.TagName + } + return "" +} + +func (m *RepoSource) GetCommitSha() string { + if x, ok := m.GetRevision().(*RepoSource_CommitSha); ok { + return x.CommitSha + } + return "" +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*RepoSource) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _RepoSource_OneofMarshaler, _RepoSource_OneofUnmarshaler, _RepoSource_OneofSizer, []interface{}{ + (*RepoSource_BranchName)(nil), + (*RepoSource_TagName)(nil), + (*RepoSource_CommitSha)(nil), + } +} + +func _RepoSource_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*RepoSource) + // revision + switch x := m.Revision.(type) { + case *RepoSource_BranchName: + b.EncodeVarint(3<<3 | proto.WireBytes) + b.EncodeStringBytes(x.BranchName) + case *RepoSource_TagName: + b.EncodeVarint(4<<3 | proto.WireBytes) + b.EncodeStringBytes(x.TagName) + case *RepoSource_CommitSha: + b.EncodeVarint(5<<3 | proto.WireBytes) + b.EncodeStringBytes(x.CommitSha) + case nil: + default: + return fmt.Errorf("RepoSource.Revision has unexpected type %T", x) + } + return nil +} + +func _RepoSource_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*RepoSource) + switch tag { + case 3: // revision.branch_name + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Revision = &RepoSource_BranchName{x} + return true, err + case 4: // revision.tag_name + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Revision = &RepoSource_TagName{x} + return true, err + case 5: // revision.commit_sha + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Revision = &RepoSource_CommitSha{x} + return true, err + default: + return false, nil + } +} + +func _RepoSource_OneofSizer(msg proto.Message) (n int) { + m := msg.(*RepoSource) + // revision + switch x := m.Revision.(type) { + case *RepoSource_BranchName: + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.BranchName))) + n += len(x.BranchName) + case *RepoSource_TagName: + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.TagName))) + n += len(x.TagName) + case *RepoSource_CommitSha: + n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.CommitSha))) + n += len(x.CommitSha) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Command describes a step performed as part of the build pipeline. +type Command struct { + // Name of the command, as presented on the command line, or if the command is + // packaged as a Docker container, as presented to `docker pull`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Environment variables set before running this Command. + Env []string `protobuf:"bytes,2,rep,name=env" json:"env,omitempty"` + // Command-line arguments used when executing this Command. + Args []string `protobuf:"bytes,3,rep,name=args" json:"args,omitempty"` + // Working directory (relative to project source root) used when running + // this Command. + Dir string `protobuf:"bytes,4,opt,name=dir" json:"dir,omitempty"` + // Optional unique identifier for this Command, used in wait_for to reference + // this Command as a dependency. + Id string `protobuf:"bytes,5,opt,name=id" json:"id,omitempty"` + // The ID(s) of the Command(s) that this Command depends on. + WaitFor []string `protobuf:"bytes,6,rep,name=wait_for,json=waitFor" json:"wait_for,omitempty"` +} + +func (m *Command) Reset() { *m = Command{} } +func (m *Command) String() string { return proto.CompactTextString(m) } +func (*Command) ProtoMessage() {} +func (*Command) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{6} } + +func (m *Command) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Command) GetEnv() []string { + if m != nil { + return m.Env + } + return nil +} + +func (m *Command) GetArgs() []string { + if m != nil { + return m.Args + } + return nil +} + +func (m *Command) GetDir() string { + if m != nil { + return m.Dir + } + return "" +} + +func (m *Command) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *Command) GetWaitFor() []string { + if m != nil { + return m.WaitFor + } + return nil +} + +// Artifact describes a build product. +type Artifact struct { + // Name of the artifact. This may be the path to a binary or jar file, or in + // the case of a container build, the name used to push the container image to + // Google Container Registry, as presented to `docker push`. + // + // This field is deprecated in favor of the plural `names` field; it continues + // to exist here to allow existing BuildProvenance serialized to json in + // google.devtools.containeranalysis.v1alpha1.BuildDetails.provenance_bytes to + // deserialize back into proto. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Hash or checksum value of a binary, or Docker Registry 2.0 digest of a + // container. + Checksum string `protobuf:"bytes,2,opt,name=checksum" json:"checksum,omitempty"` + // Artifact ID, if any; for container images, this will be a URL by digest + // like gcr.io/projectID/imagename@sha256:123456 + Id string `protobuf:"bytes,3,opt,name=id" json:"id,omitempty"` + // Related artifact names. This may be the path to a binary or jar file, or in + // the case of a container build, the name used to push the container image to + // Google Container Registry, as presented to `docker push`. Note that a + // single Artifact ID can have multiple names, for example if two tags are + // applied to one image. + Names []string `protobuf:"bytes,4,rep,name=names" json:"names,omitempty"` +} + +func (m *Artifact) Reset() { *m = Artifact{} } +func (m *Artifact) String() string { return proto.CompactTextString(m) } +func (*Artifact) ProtoMessage() {} +func (*Artifact) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{7} } + +func (m *Artifact) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Artifact) GetChecksum() string { + if m != nil { + return m.Checksum + } + return "" +} + +func (m *Artifact) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *Artifact) GetNames() []string { + if m != nil { + return m.Names + } + return nil +} + +func init() { + proto.RegisterType((*BuildProvenance)(nil), "google.devtools.containeranalysis.v1alpha1.BuildProvenance") + proto.RegisterType((*Source)(nil), "google.devtools.containeranalysis.v1alpha1.Source") + proto.RegisterType((*FileHashes)(nil), "google.devtools.containeranalysis.v1alpha1.FileHashes") + proto.RegisterType((*Hash)(nil), "google.devtools.containeranalysis.v1alpha1.Hash") + proto.RegisterType((*StorageSource)(nil), "google.devtools.containeranalysis.v1alpha1.StorageSource") + proto.RegisterType((*RepoSource)(nil), "google.devtools.containeranalysis.v1alpha1.RepoSource") + proto.RegisterType((*Command)(nil), "google.devtools.containeranalysis.v1alpha1.Command") + proto.RegisterType((*Artifact)(nil), "google.devtools.containeranalysis.v1alpha1.Artifact") + proto.RegisterEnum("google.devtools.containeranalysis.v1alpha1.Hash_HashType", Hash_HashType_name, Hash_HashType_value) +} + +func init() { + proto.RegisterFile("google/devtools/containeranalysis/v1alpha1/provenance.proto", fileDescriptor4) +} + +var fileDescriptor4 = []byte{ + // 1026 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xdd, 0x6e, 0x1b, 0x45, + 0x14, 0xee, 0xfa, 0x77, 0xf7, 0xb8, 0x71, 0x92, 0xa1, 0xc0, 0xe2, 0x52, 0x62, 0x2c, 0x21, 0x22, + 0x2e, 0x6c, 0x9a, 0x42, 0x45, 0xc8, 0x45, 0x15, 0x47, 0x2d, 0xa9, 0x44, 0x92, 0x6a, 0x53, 0x21, + 0x41, 0x85, 0x96, 0xf1, 0xee, 0x78, 0x3d, 0xcd, 0x7a, 0x67, 0x99, 0x19, 0x1b, 0x7c, 0xc7, 0x03, + 0xc0, 0x4b, 0xf0, 0x0e, 0xdc, 0xf2, 0x2e, 0xbc, 0x09, 0x9a, 0x9f, 0xb5, 0x1d, 0xa7, 0x55, 0xbb, + 0xea, 0xcd, 0x6a, 0xce, 0x37, 0xe7, 0x7c, 0x67, 0xe6, 0xcc, 0x77, 0x66, 0x16, 0x8e, 0x12, 0xc6, + 0x92, 0x94, 0x0c, 0x62, 0x32, 0x97, 0x8c, 0xa5, 0x62, 0x10, 0xb1, 0x4c, 0x62, 0x9a, 0x11, 0x8e, + 0x33, 0x9c, 0x2e, 0x04, 0x15, 0x83, 0xf9, 0x7d, 0x9c, 0xe6, 0x13, 0x7c, 0x7f, 0x90, 0x73, 0x36, + 0x27, 0x19, 0xce, 0x22, 0xd2, 0xcf, 0x39, 0x93, 0x0c, 0x7d, 0x61, 0x82, 0xfb, 0x45, 0x70, 0xff, + 0x46, 0x70, 0xbf, 0x08, 0xee, 0x7c, 0x6c, 0x13, 0xe1, 0x9c, 0x0e, 0x70, 0x96, 0x31, 0x89, 0x25, + 0x65, 0x99, 0x30, 0x4c, 0x9d, 0x47, 0x25, 0x96, 0x21, 0xd8, 0x8c, 0x47, 0x24, 0x54, 0x1e, 0xe4, + 0x77, 0x69, 0x09, 0xf6, 0x2c, 0x81, 0xb6, 0x46, 0xb3, 0xf1, 0x40, 0xd2, 0x29, 0x11, 0x12, 0x4f, + 0x73, 0xe3, 0xd0, 0xfb, 0xb7, 0x01, 0xdb, 0xc3, 0x19, 0x4d, 0xe3, 0x67, 0xcb, 0x5d, 0xa0, 0x36, + 0x54, 0x68, 0xec, 0x3b, 0x5d, 0x67, 0xdf, 0x0b, 0x2a, 0x34, 0x46, 0xf7, 0x00, 0x72, 0xce, 0x5e, + 0x92, 0x48, 0x86, 0x34, 0xf6, 0x2b, 0x1a, 0xf7, 0x2c, 0xf2, 0x34, 0x46, 0x17, 0xe0, 0x46, 0x6c, + 0x3a, 0xc5, 0x59, 0x2c, 0xfc, 0x7a, 0xb7, 0xba, 0xdf, 0x3a, 0x78, 0xd0, 0x7f, 0xfb, 0x0a, 0xf4, + 0x4f, 0x4c, 0x6c, 0xb0, 0x24, 0x41, 0x3f, 0xc3, 0xf6, 0x68, 0x46, 0x53, 0x19, 0x62, 0x2e, 0xe9, + 0x18, 0x47, 0x52, 0xf8, 0x0d, 0xcd, 0xfb, 0x55, 0x19, 0xde, 0x63, 0x1b, 0x1c, 0xb4, 0x35, 0x59, + 0x61, 0x0a, 0x74, 0x04, 0xad, 0x88, 0x13, 0x2c, 0x49, 0xa8, 0x8a, 0xe1, 0x37, 0xbb, 0xce, 0x7e, + 0xeb, 0xa0, 0x53, 0x50, 0x17, 0x95, 0xea, 0x3f, 0x2f, 0x2a, 0x15, 0x80, 0x71, 0x57, 0x00, 0x3a, + 0x04, 0x10, 0x12, 0x73, 0x69, 0x62, 0xdd, 0x37, 0xc6, 0x7a, 0xda, 0x5b, 0x87, 0x1e, 0x41, 0x6b, + 0x4c, 0x33, 0x2a, 0x26, 0x26, 0xd6, 0x7b, 0x73, 0x5e, 0xe3, 0xae, 0x83, 0x7d, 0x68, 0xea, 0x55, + 0x30, 0xee, 0xb7, 0xf4, 0x01, 0x14, 0x26, 0xda, 0x83, 0x56, 0xca, 0x12, 0x11, 0x8e, 0x66, 0xd1, + 0x15, 0x91, 0xfe, 0x96, 0x9e, 0x05, 0x05, 0x0d, 0x35, 0x82, 0x42, 0xd8, 0xb5, 0xda, 0x58, 0x29, + 0xd5, 0x6f, 0xeb, 0xec, 0x07, 0x65, 0x0a, 0x7a, 0xa9, 0x49, 0x82, 0x1d, 0x43, 0xb6, 0xa6, 0x97, + 0x7b, 0x00, 0x92, 0xd3, 0x24, 0x21, 0x5c, 0xe9, 0x63, 0xdb, 0xe8, 0xc3, 0x22, 0x4f, 0x63, 0xc4, + 0x61, 0x4b, 0x9d, 0x40, 0x1c, 0xb2, 0x5c, 0x6b, 0xdb, 0xdf, 0xd1, 0x87, 0x79, 0x56, 0x26, 0xf7, + 0x86, 0x44, 0x8d, 0x7d, 0x61, 0xf8, 0x1e, 0x67, 0x92, 0x2f, 0x82, 0xdb, 0xa3, 0x35, 0x08, 0x7d, + 0x6e, 0x24, 0x14, 0x13, 0x1e, 0xce, 0x09, 0x17, 0x94, 0x65, 0xfe, 0xae, 0x5e, 0x57, 0xdb, 0xc2, + 0x3f, 0x18, 0xb4, 0xf3, 0x08, 0x76, 0x6f, 0x70, 0xa1, 0x1d, 0xa8, 0x5e, 0x91, 0x85, 0xed, 0x00, + 0x35, 0x44, 0x77, 0xa0, 0x3e, 0xc7, 0xe9, 0x8c, 0x58, 0xf5, 0x1b, 0xe3, 0xdb, 0xca, 0x37, 0x4e, + 0xef, 0xbf, 0x3a, 0x34, 0x4c, 0x65, 0xd0, 0x08, 0xda, 0x42, 0x32, 0x8e, 0x13, 0x12, 0x9a, 0x1a, + 0x69, 0x86, 0xd6, 0xc1, 0x61, 0xa9, 0x2a, 0x1b, 0x06, 0x43, 0x79, 0x7a, 0x2b, 0xd8, 0x12, 0xeb, + 0x00, 0xfa, 0x11, 0x5a, 0x9c, 0xe4, 0xac, 0x48, 0x50, 0xd1, 0x09, 0x1e, 0x96, 0x49, 0x10, 0x90, + 0x9c, 0x2d, 0xd9, 0x81, 0x2f, 0x2d, 0xf4, 0x2b, 0x7c, 0x58, 0x34, 0x5c, 0xb8, 0xb1, 0x8f, 0xda, + 0x3b, 0xee, 0x23, 0x78, 0xbf, 0x60, 0xbe, 0x06, 0xa3, 0x48, 0xb5, 0x44, 0x4a, 0xc2, 0x09, 0x16, + 0x13, 0x22, 0xfc, 0xaa, 0x16, 0xc6, 0xb0, 0xbc, 0x28, 0xfb, 0x4f, 0x68, 0x4a, 0x4e, 0x35, 0x89, + 0x51, 0x03, 0x8c, 0x97, 0x00, 0xba, 0x84, 0xa6, 0xbd, 0x14, 0x6d, 0xaf, 0x1f, 0x96, 0x4f, 0x70, + 0x62, 0x08, 0x82, 0x82, 0x09, 0xbd, 0x84, 0xf7, 0x70, 0x1c, 0x53, 0x25, 0x1a, 0x9c, 0x16, 0x97, + 0xae, 0xf0, 0x5d, 0xbd, 0x83, 0x77, 0x48, 0x80, 0x56, 0xac, 0x16, 0x12, 0x9d, 0x19, 0x6c, 0x6f, + 0xec, 0xef, 0x15, 0x0a, 0xfd, 0x7e, 0x5d, 0xa1, 0x25, 0x25, 0xb1, 0x62, 0x5f, 0x53, 0xf6, 0xd0, + 0x85, 0x86, 0x39, 0xfe, 0xde, 0x0b, 0x80, 0x95, 0x0b, 0x3a, 0x03, 0x6f, 0x79, 0x68, 0xbe, 0xa3, + 0x37, 0xfc, 0x65, 0x99, 0x6c, 0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0xbd, 0x3f, 0x1c, 0x68, 0xda, 0xc7, + 0x1a, 0x21, 0xa8, 0x69, 0x46, 0xb3, 0x5c, 0x3d, 0x56, 0x9a, 0x24, 0xd9, 0xdc, 0xaf, 0x74, 0xab, + 0x4a, 0x93, 0x24, 0x9b, 0x2b, 0x2f, 0xcc, 0x13, 0xd3, 0xd7, 0x5e, 0xa0, 0xc7, 0xca, 0x2b, 0xa6, + 0xdc, 0x2c, 0x25, 0x50, 0x43, 0xfb, 0xbb, 0x51, 0x5f, 0xfe, 0x6e, 0x7c, 0x04, 0xee, 0x6f, 0x98, + 0xca, 0x70, 0xcc, 0xb8, 0x7e, 0xf7, 0xbd, 0xa0, 0xa9, 0xec, 0x27, 0x8c, 0xf7, 0x7e, 0x01, 0xb7, + 0x78, 0xc7, 0x5f, 0xb9, 0x84, 0x0e, 0xb8, 0xd1, 0x84, 0x44, 0x57, 0x62, 0x36, 0x2d, 0x6a, 0x55, + 0xd8, 0x36, 0x4d, 0x75, 0x99, 0xe6, 0x0e, 0xd4, 0x55, 0x8c, 0xf0, 0x6b, 0x3a, 0x87, 0x31, 0x86, + 0x7f, 0x3a, 0xf0, 0x59, 0xc4, 0xa6, 0x85, 0xf8, 0x5e, 0xaf, 0xb9, 0x67, 0xce, 0x4f, 0x2f, 0xac, + 0x53, 0xc2, 0x52, 0x9c, 0x25, 0x7d, 0xc6, 0x93, 0x41, 0x42, 0x32, 0xfd, 0x90, 0x0f, 0xcc, 0x14, + 0xce, 0xa9, 0x78, 0x9b, 0x9f, 0xb7, 0xa3, 0x1b, 0x53, 0x7f, 0x57, 0xaa, 0xdf, 0x9d, 0x1c, 0x8f, + 0x1a, 0x9a, 0xed, 0xc1, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0x91, 0xec, 0x1b, 0x85, 0x90, 0x0a, + 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/devtools/containeranalysis/v1alpha1/source_context.pb.go b/vendor/google.golang.org/genproto/googleapis/devtools/containeranalysis/v1alpha1/source_context.pb.go new file mode 100644 index 0000000000..3ab29ad90f --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/devtools/containeranalysis/v1alpha1/source_context.pb.go @@ -0,0 +1,751 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/devtools/containeranalysis/v1alpha1/source_context.proto + +package containeranalysis + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// The type of an alias. +type AliasContext_Kind int32 + +const ( + // Unknown. + AliasContext_KIND_UNSPECIFIED AliasContext_Kind = 0 + // Git tag. + AliasContext_FIXED AliasContext_Kind = 1 + // Git branch. + AliasContext_MOVABLE AliasContext_Kind = 2 + // Used to specify non-standard aliases. For example, if a Git repo has a + // ref named "refs/foo/bar". + AliasContext_OTHER AliasContext_Kind = 4 +) + +var AliasContext_Kind_name = map[int32]string{ + 0: "KIND_UNSPECIFIED", + 1: "FIXED", + 2: "MOVABLE", + 4: "OTHER", +} +var AliasContext_Kind_value = map[string]int32{ + "KIND_UNSPECIFIED": 0, + "FIXED": 1, + "MOVABLE": 2, + "OTHER": 4, +} + +func (x AliasContext_Kind) String() string { + return proto.EnumName(AliasContext_Kind_name, int32(x)) +} +func (AliasContext_Kind) EnumDescriptor() ([]byte, []int) { return fileDescriptor5, []int{1, 0} } + +// A SourceContext is a reference to a tree of files. A SourceContext together +// with a path point to a unique revision of a single file or directory. +type SourceContext struct { + // A SourceContext can refer any one of the following types of repositories. + // + // Types that are valid to be assigned to Context: + // *SourceContext_CloudRepo + // *SourceContext_Gerrit + // *SourceContext_Git + Context isSourceContext_Context `protobuf_oneof:"context"` + // Labels with user defined metadata. + Labels map[string]string `protobuf:"bytes,4,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *SourceContext) Reset() { *m = SourceContext{} } +func (m *SourceContext) String() string { return proto.CompactTextString(m) } +func (*SourceContext) ProtoMessage() {} +func (*SourceContext) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{0} } + +type isSourceContext_Context interface { + isSourceContext_Context() +} + +type SourceContext_CloudRepo struct { + CloudRepo *CloudRepoSourceContext `protobuf:"bytes,1,opt,name=cloud_repo,json=cloudRepo,oneof"` +} +type SourceContext_Gerrit struct { + Gerrit *GerritSourceContext `protobuf:"bytes,2,opt,name=gerrit,oneof"` +} +type SourceContext_Git struct { + Git *GitSourceContext `protobuf:"bytes,3,opt,name=git,oneof"` +} + +func (*SourceContext_CloudRepo) isSourceContext_Context() {} +func (*SourceContext_Gerrit) isSourceContext_Context() {} +func (*SourceContext_Git) isSourceContext_Context() {} + +func (m *SourceContext) GetContext() isSourceContext_Context { + if m != nil { + return m.Context + } + return nil +} + +func (m *SourceContext) GetCloudRepo() *CloudRepoSourceContext { + if x, ok := m.GetContext().(*SourceContext_CloudRepo); ok { + return x.CloudRepo + } + return nil +} + +func (m *SourceContext) GetGerrit() *GerritSourceContext { + if x, ok := m.GetContext().(*SourceContext_Gerrit); ok { + return x.Gerrit + } + return nil +} + +func (m *SourceContext) GetGit() *GitSourceContext { + if x, ok := m.GetContext().(*SourceContext_Git); ok { + return x.Git + } + return nil +} + +func (m *SourceContext) GetLabels() map[string]string { + if m != nil { + return m.Labels + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*SourceContext) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _SourceContext_OneofMarshaler, _SourceContext_OneofUnmarshaler, _SourceContext_OneofSizer, []interface{}{ + (*SourceContext_CloudRepo)(nil), + (*SourceContext_Gerrit)(nil), + (*SourceContext_Git)(nil), + } +} + +func _SourceContext_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*SourceContext) + // context + switch x := m.Context.(type) { + case *SourceContext_CloudRepo: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.CloudRepo); err != nil { + return err + } + case *SourceContext_Gerrit: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Gerrit); err != nil { + return err + } + case *SourceContext_Git: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Git); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("SourceContext.Context has unexpected type %T", x) + } + return nil +} + +func _SourceContext_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*SourceContext) + switch tag { + case 1: // context.cloud_repo + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(CloudRepoSourceContext) + err := b.DecodeMessage(msg) + m.Context = &SourceContext_CloudRepo{msg} + return true, err + case 2: // context.gerrit + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(GerritSourceContext) + err := b.DecodeMessage(msg) + m.Context = &SourceContext_Gerrit{msg} + return true, err + case 3: // context.git + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(GitSourceContext) + err := b.DecodeMessage(msg) + m.Context = &SourceContext_Git{msg} + return true, err + default: + return false, nil + } +} + +func _SourceContext_OneofSizer(msg proto.Message) (n int) { + m := msg.(*SourceContext) + // context + switch x := m.Context.(type) { + case *SourceContext_CloudRepo: + s := proto.Size(x.CloudRepo) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *SourceContext_Gerrit: + s := proto.Size(x.Gerrit) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *SourceContext_Git: + s := proto.Size(x.Git) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// An alias to a repo revision. +type AliasContext struct { + // The alias kind. + Kind AliasContext_Kind `protobuf:"varint,1,opt,name=kind,enum=google.devtools.containeranalysis.v1alpha1.AliasContext_Kind" json:"kind,omitempty"` + // The alias name. + Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` +} + +func (m *AliasContext) Reset() { *m = AliasContext{} } +func (m *AliasContext) String() string { return proto.CompactTextString(m) } +func (*AliasContext) ProtoMessage() {} +func (*AliasContext) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{1} } + +func (m *AliasContext) GetKind() AliasContext_Kind { + if m != nil { + return m.Kind + } + return AliasContext_KIND_UNSPECIFIED +} + +func (m *AliasContext) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// A CloudRepoSourceContext denotes a particular revision in a Google Cloud +// Source Repo. +type CloudRepoSourceContext struct { + // The ID of the repo. + RepoId *RepoId `protobuf:"bytes,1,opt,name=repo_id,json=repoId" json:"repo_id,omitempty"` + // A revision in a Cloud Repo can be identified by either its revision ID or + // its alias. + // + // Types that are valid to be assigned to Revision: + // *CloudRepoSourceContext_RevisionId + // *CloudRepoSourceContext_AliasContext + Revision isCloudRepoSourceContext_Revision `protobuf_oneof:"revision"` +} + +func (m *CloudRepoSourceContext) Reset() { *m = CloudRepoSourceContext{} } +func (m *CloudRepoSourceContext) String() string { return proto.CompactTextString(m) } +func (*CloudRepoSourceContext) ProtoMessage() {} +func (*CloudRepoSourceContext) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{2} } + +type isCloudRepoSourceContext_Revision interface { + isCloudRepoSourceContext_Revision() +} + +type CloudRepoSourceContext_RevisionId struct { + RevisionId string `protobuf:"bytes,2,opt,name=revision_id,json=revisionId,oneof"` +} +type CloudRepoSourceContext_AliasContext struct { + AliasContext *AliasContext `protobuf:"bytes,3,opt,name=alias_context,json=aliasContext,oneof"` +} + +func (*CloudRepoSourceContext_RevisionId) isCloudRepoSourceContext_Revision() {} +func (*CloudRepoSourceContext_AliasContext) isCloudRepoSourceContext_Revision() {} + +func (m *CloudRepoSourceContext) GetRevision() isCloudRepoSourceContext_Revision { + if m != nil { + return m.Revision + } + return nil +} + +func (m *CloudRepoSourceContext) GetRepoId() *RepoId { + if m != nil { + return m.RepoId + } + return nil +} + +func (m *CloudRepoSourceContext) GetRevisionId() string { + if x, ok := m.GetRevision().(*CloudRepoSourceContext_RevisionId); ok { + return x.RevisionId + } + return "" +} + +func (m *CloudRepoSourceContext) GetAliasContext() *AliasContext { + if x, ok := m.GetRevision().(*CloudRepoSourceContext_AliasContext); ok { + return x.AliasContext + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*CloudRepoSourceContext) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _CloudRepoSourceContext_OneofMarshaler, _CloudRepoSourceContext_OneofUnmarshaler, _CloudRepoSourceContext_OneofSizer, []interface{}{ + (*CloudRepoSourceContext_RevisionId)(nil), + (*CloudRepoSourceContext_AliasContext)(nil), + } +} + +func _CloudRepoSourceContext_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*CloudRepoSourceContext) + // revision + switch x := m.Revision.(type) { + case *CloudRepoSourceContext_RevisionId: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeStringBytes(x.RevisionId) + case *CloudRepoSourceContext_AliasContext: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.AliasContext); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("CloudRepoSourceContext.Revision has unexpected type %T", x) + } + return nil +} + +func _CloudRepoSourceContext_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*CloudRepoSourceContext) + switch tag { + case 2: // revision.revision_id + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Revision = &CloudRepoSourceContext_RevisionId{x} + return true, err + case 3: // revision.alias_context + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(AliasContext) + err := b.DecodeMessage(msg) + m.Revision = &CloudRepoSourceContext_AliasContext{msg} + return true, err + default: + return false, nil + } +} + +func _CloudRepoSourceContext_OneofSizer(msg proto.Message) (n int) { + m := msg.(*CloudRepoSourceContext) + // revision + switch x := m.Revision.(type) { + case *CloudRepoSourceContext_RevisionId: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.RevisionId))) + n += len(x.RevisionId) + case *CloudRepoSourceContext_AliasContext: + s := proto.Size(x.AliasContext) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// A SourceContext referring to a Gerrit project. +type GerritSourceContext struct { + // The URI of a running Gerrit instance. + HostUri string `protobuf:"bytes,1,opt,name=host_uri,json=hostUri" json:"host_uri,omitempty"` + // The full project name within the host. Projects may be nested, so + // "project/subproject" is a valid project name. The "repo name" is + // the hostURI/project. + GerritProject string `protobuf:"bytes,2,opt,name=gerrit_project,json=gerritProject" json:"gerrit_project,omitempty"` + // A revision in a Gerrit project can be identified by either its revision ID + // or its alias. + // + // Types that are valid to be assigned to Revision: + // *GerritSourceContext_RevisionId + // *GerritSourceContext_AliasContext + Revision isGerritSourceContext_Revision `protobuf_oneof:"revision"` +} + +func (m *GerritSourceContext) Reset() { *m = GerritSourceContext{} } +func (m *GerritSourceContext) String() string { return proto.CompactTextString(m) } +func (*GerritSourceContext) ProtoMessage() {} +func (*GerritSourceContext) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{3} } + +type isGerritSourceContext_Revision interface { + isGerritSourceContext_Revision() +} + +type GerritSourceContext_RevisionId struct { + RevisionId string `protobuf:"bytes,3,opt,name=revision_id,json=revisionId,oneof"` +} +type GerritSourceContext_AliasContext struct { + AliasContext *AliasContext `protobuf:"bytes,4,opt,name=alias_context,json=aliasContext,oneof"` +} + +func (*GerritSourceContext_RevisionId) isGerritSourceContext_Revision() {} +func (*GerritSourceContext_AliasContext) isGerritSourceContext_Revision() {} + +func (m *GerritSourceContext) GetRevision() isGerritSourceContext_Revision { + if m != nil { + return m.Revision + } + return nil +} + +func (m *GerritSourceContext) GetHostUri() string { + if m != nil { + return m.HostUri + } + return "" +} + +func (m *GerritSourceContext) GetGerritProject() string { + if m != nil { + return m.GerritProject + } + return "" +} + +func (m *GerritSourceContext) GetRevisionId() string { + if x, ok := m.GetRevision().(*GerritSourceContext_RevisionId); ok { + return x.RevisionId + } + return "" +} + +func (m *GerritSourceContext) GetAliasContext() *AliasContext { + if x, ok := m.GetRevision().(*GerritSourceContext_AliasContext); ok { + return x.AliasContext + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*GerritSourceContext) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _GerritSourceContext_OneofMarshaler, _GerritSourceContext_OneofUnmarshaler, _GerritSourceContext_OneofSizer, []interface{}{ + (*GerritSourceContext_RevisionId)(nil), + (*GerritSourceContext_AliasContext)(nil), + } +} + +func _GerritSourceContext_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*GerritSourceContext) + // revision + switch x := m.Revision.(type) { + case *GerritSourceContext_RevisionId: + b.EncodeVarint(3<<3 | proto.WireBytes) + b.EncodeStringBytes(x.RevisionId) + case *GerritSourceContext_AliasContext: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.AliasContext); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("GerritSourceContext.Revision has unexpected type %T", x) + } + return nil +} + +func _GerritSourceContext_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*GerritSourceContext) + switch tag { + case 3: // revision.revision_id + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Revision = &GerritSourceContext_RevisionId{x} + return true, err + case 4: // revision.alias_context + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(AliasContext) + err := b.DecodeMessage(msg) + m.Revision = &GerritSourceContext_AliasContext{msg} + return true, err + default: + return false, nil + } +} + +func _GerritSourceContext_OneofSizer(msg proto.Message) (n int) { + m := msg.(*GerritSourceContext) + // revision + switch x := m.Revision.(type) { + case *GerritSourceContext_RevisionId: + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.RevisionId))) + n += len(x.RevisionId) + case *GerritSourceContext_AliasContext: + s := proto.Size(x.AliasContext) + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// A GitSourceContext denotes a particular revision in a third party Git +// repository (e.g., GitHub). +type GitSourceContext struct { + // Git repository URL. + Url string `protobuf:"bytes,1,opt,name=url" json:"url,omitempty"` + // Required. + // Git commit hash. + RevisionId string `protobuf:"bytes,2,opt,name=revision_id,json=revisionId" json:"revision_id,omitempty"` +} + +func (m *GitSourceContext) Reset() { *m = GitSourceContext{} } +func (m *GitSourceContext) String() string { return proto.CompactTextString(m) } +func (*GitSourceContext) ProtoMessage() {} +func (*GitSourceContext) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{4} } + +func (m *GitSourceContext) GetUrl() string { + if m != nil { + return m.Url + } + return "" +} + +func (m *GitSourceContext) GetRevisionId() string { + if m != nil { + return m.RevisionId + } + return "" +} + +// A unique identifier for a Cloud Repo. +type RepoId struct { + // A cloud repo can be identified by either its project ID and repository name + // combination, or its globally unique identifier. + // + // Types that are valid to be assigned to Id: + // *RepoId_ProjectRepoId + // *RepoId_Uid + Id isRepoId_Id `protobuf_oneof:"id"` +} + +func (m *RepoId) Reset() { *m = RepoId{} } +func (m *RepoId) String() string { return proto.CompactTextString(m) } +func (*RepoId) ProtoMessage() {} +func (*RepoId) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{5} } + +type isRepoId_Id interface { + isRepoId_Id() +} + +type RepoId_ProjectRepoId struct { + ProjectRepoId *ProjectRepoId `protobuf:"bytes,1,opt,name=project_repo_id,json=projectRepoId,oneof"` +} +type RepoId_Uid struct { + Uid string `protobuf:"bytes,2,opt,name=uid,oneof"` +} + +func (*RepoId_ProjectRepoId) isRepoId_Id() {} +func (*RepoId_Uid) isRepoId_Id() {} + +func (m *RepoId) GetId() isRepoId_Id { + if m != nil { + return m.Id + } + return nil +} + +func (m *RepoId) GetProjectRepoId() *ProjectRepoId { + if x, ok := m.GetId().(*RepoId_ProjectRepoId); ok { + return x.ProjectRepoId + } + return nil +} + +func (m *RepoId) GetUid() string { + if x, ok := m.GetId().(*RepoId_Uid); ok { + return x.Uid + } + return "" +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*RepoId) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _RepoId_OneofMarshaler, _RepoId_OneofUnmarshaler, _RepoId_OneofSizer, []interface{}{ + (*RepoId_ProjectRepoId)(nil), + (*RepoId_Uid)(nil), + } +} + +func _RepoId_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*RepoId) + // id + switch x := m.Id.(type) { + case *RepoId_ProjectRepoId: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ProjectRepoId); err != nil { + return err + } + case *RepoId_Uid: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeStringBytes(x.Uid) + case nil: + default: + return fmt.Errorf("RepoId.Id has unexpected type %T", x) + } + return nil +} + +func _RepoId_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*RepoId) + switch tag { + case 1: // id.project_repo_id + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ProjectRepoId) + err := b.DecodeMessage(msg) + m.Id = &RepoId_ProjectRepoId{msg} + return true, err + case 2: // id.uid + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Id = &RepoId_Uid{x} + return true, err + default: + return false, nil + } +} + +func _RepoId_OneofSizer(msg proto.Message) (n int) { + m := msg.(*RepoId) + // id + switch x := m.Id.(type) { + case *RepoId_ProjectRepoId: + s := proto.Size(x.ProjectRepoId) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *RepoId_Uid: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Uid))) + n += len(x.Uid) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Selects a repo using a Google Cloud Platform project ID (e.g., +// winged-cargo-31) and a repo name within that project. +type ProjectRepoId struct { + // The ID of the project. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the repo. Leave empty for the default repo. + RepoName string `protobuf:"bytes,2,opt,name=repo_name,json=repoName" json:"repo_name,omitempty"` +} + +func (m *ProjectRepoId) Reset() { *m = ProjectRepoId{} } +func (m *ProjectRepoId) String() string { return proto.CompactTextString(m) } +func (*ProjectRepoId) ProtoMessage() {} +func (*ProjectRepoId) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{6} } + +func (m *ProjectRepoId) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *ProjectRepoId) GetRepoName() string { + if m != nil { + return m.RepoName + } + return "" +} + +func init() { + proto.RegisterType((*SourceContext)(nil), "google.devtools.containeranalysis.v1alpha1.SourceContext") + proto.RegisterType((*AliasContext)(nil), "google.devtools.containeranalysis.v1alpha1.AliasContext") + proto.RegisterType((*CloudRepoSourceContext)(nil), "google.devtools.containeranalysis.v1alpha1.CloudRepoSourceContext") + proto.RegisterType((*GerritSourceContext)(nil), "google.devtools.containeranalysis.v1alpha1.GerritSourceContext") + proto.RegisterType((*GitSourceContext)(nil), "google.devtools.containeranalysis.v1alpha1.GitSourceContext") + proto.RegisterType((*RepoId)(nil), "google.devtools.containeranalysis.v1alpha1.RepoId") + proto.RegisterType((*ProjectRepoId)(nil), "google.devtools.containeranalysis.v1alpha1.ProjectRepoId") + proto.RegisterEnum("google.devtools.containeranalysis.v1alpha1.AliasContext_Kind", AliasContext_Kind_name, AliasContext_Kind_value) +} + +func init() { + proto.RegisterFile("google/devtools/containeranalysis/v1alpha1/source_context.proto", fileDescriptor5) +} + +var fileDescriptor5 = []byte{ + // 675 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x95, 0x5d, 0x4e, 0xdb, 0x4a, + 0x14, 0xc7, 0xe3, 0x38, 0x24, 0xf8, 0x84, 0x70, 0xa3, 0xb9, 0xe8, 0x2a, 0x97, 0x7b, 0xab, 0x52, + 0x4b, 0x48, 0xa8, 0x0f, 0xb6, 0x48, 0x5f, 0xa0, 0x1f, 0x42, 0x24, 0x18, 0x62, 0x85, 0x42, 0x6a, + 0x4a, 0xd5, 0x0f, 0x55, 0xd6, 0x60, 0x8f, 0xcc, 0x14, 0xe3, 0xb1, 0xc6, 0x76, 0x54, 0x56, 0xd0, + 0x97, 0xae, 0xa2, 0x8b, 0xe8, 0x12, 0xba, 0x95, 0xae, 0xa0, 0xef, 0xd5, 0x8c, 0x6d, 0xc9, 0x01, + 0x2a, 0x91, 0x4a, 0x7d, 0xca, 0xcc, 0x99, 0x99, 0xdf, 0xf9, 0x9f, 0x33, 0xff, 0x89, 0x61, 0x27, + 0x60, 0x2c, 0x08, 0x89, 0xe9, 0x93, 0x69, 0xca, 0x58, 0x98, 0x98, 0x1e, 0x8b, 0x52, 0x4c, 0x23, + 0xc2, 0x71, 0x84, 0xc3, 0xab, 0x84, 0x26, 0xe6, 0x74, 0x13, 0x87, 0xf1, 0x39, 0xde, 0x34, 0x13, + 0x96, 0x71, 0x8f, 0xb8, 0x62, 0x07, 0xf9, 0x98, 0x1a, 0x31, 0x67, 0x29, 0x43, 0x0f, 0x73, 0x80, + 0x51, 0x02, 0x8c, 0x1b, 0x00, 0xa3, 0x04, 0xac, 0xfe, 0x5f, 0x24, 0xc3, 0x31, 0x35, 0x71, 0x14, + 0xb1, 0x14, 0xa7, 0x94, 0x45, 0x49, 0x4e, 0xd2, 0xbf, 0xa9, 0xd0, 0x39, 0x91, 0x29, 0x86, 0x79, + 0x06, 0xe4, 0x01, 0x78, 0x21, 0xcb, 0x7c, 0x97, 0x93, 0x98, 0xf5, 0x94, 0x35, 0x65, 0xa3, 0xdd, + 0x1f, 0x18, 0x77, 0x4f, 0x68, 0x0c, 0xc5, 0x69, 0x87, 0xc4, 0x6c, 0x86, 0x3b, 0xaa, 0x39, 0x9a, + 0x57, 0xae, 0xa0, 0x37, 0xd0, 0x0c, 0x08, 0xe7, 0x34, 0xed, 0xd5, 0x65, 0x82, 0x9d, 0x79, 0x12, + 0x1c, 0xc8, 0x93, 0xd7, 0xe9, 0x05, 0x10, 0x4d, 0x40, 0x0d, 0x68, 0xda, 0x53, 0x25, 0xf7, 0xe9, + 0x5c, 0xdc, 0x9b, 0x50, 0x81, 0x42, 0xef, 0xa1, 0x19, 0xe2, 0x33, 0x12, 0x26, 0xbd, 0xc6, 0x9a, + 0xba, 0xd1, 0xee, 0x5b, 0xf3, 0x40, 0x67, 0x88, 0xc6, 0xa1, 0xe4, 0x58, 0x51, 0xca, 0xaf, 0x9c, + 0x02, 0xba, 0xba, 0x0d, 0xed, 0x4a, 0x18, 0x75, 0x41, 0xbd, 0x20, 0x57, 0xb2, 0xf1, 0x9a, 0x23, + 0x86, 0x68, 0x05, 0x16, 0xa6, 0x38, 0xcc, 0x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9a, 0x92, 0xf6, 0xe8, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xcf, 0x59, 0x43, 0xa4, + 0x06, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/devtools/remoteexecution/v1test/remote_execution.pb.go b/vendor/google.golang.org/genproto/googleapis/devtools/remoteexecution/v1test/remote_execution.pb.go new file mode 100644 index 0000000000..c6cfc2807d --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/devtools/remoteexecution/v1test/remote_execution.pb.go @@ -0,0 +1,2120 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/devtools/remoteexecution/v1test/remote_execution.proto + +/* +Package remoteexecution is a generated protocol buffer package. + +It is generated from these files: + google/devtools/remoteexecution/v1test/remote_execution.proto + +It has these top-level messages: + Action + Command + Platform + Directory + FileNode + DirectoryNode + Digest + ActionResult + OutputFile + Tree + OutputDirectory + ExecuteRequest + LogFile + ExecuteResponse + ExecuteOperationMetadata + GetActionResultRequest + UpdateActionResultRequest + FindMissingBlobsRequest + FindMissingBlobsResponse + UpdateBlobRequest + BatchUpdateBlobsRequest + BatchUpdateBlobsResponse + GetTreeRequest + GetTreeResponse + ToolDetails + RequestMetadata +*/ +package remoteexecution + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_longrunning "google.golang.org/genproto/googleapis/longrunning" +import google_protobuf3 "github.com/golang/protobuf/ptypes/duration" +import google_rpc "google.golang.org/genproto/googleapis/rpc/status" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// The current stage of execution. +type ExecuteOperationMetadata_Stage int32 + +const ( + ExecuteOperationMetadata_UNKNOWN ExecuteOperationMetadata_Stage = 0 + // Checking the result against the cache. + ExecuteOperationMetadata_CACHE_CHECK ExecuteOperationMetadata_Stage = 1 + // Currently idle, awaiting a free machine to execute. + ExecuteOperationMetadata_QUEUED ExecuteOperationMetadata_Stage = 2 + // Currently being executed by a worker. + ExecuteOperationMetadata_EXECUTING ExecuteOperationMetadata_Stage = 3 + // Finished execution. + ExecuteOperationMetadata_COMPLETED ExecuteOperationMetadata_Stage = 4 +) + +var ExecuteOperationMetadata_Stage_name = map[int32]string{ + 0: "UNKNOWN", + 1: "CACHE_CHECK", + 2: "QUEUED", + 3: "EXECUTING", + 4: "COMPLETED", +} +var ExecuteOperationMetadata_Stage_value = map[string]int32{ + "UNKNOWN": 0, + "CACHE_CHECK": 1, + "QUEUED": 2, + "EXECUTING": 3, + "COMPLETED": 4, +} + +func (x ExecuteOperationMetadata_Stage) String() string { + return proto.EnumName(ExecuteOperationMetadata_Stage_name, int32(x)) +} +func (ExecuteOperationMetadata_Stage) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{14, 0} +} + +// An `Action` captures all the information about an execution which is required +// to reproduce it. +// +// `Action`s are the core component of the [Execution] service. A single +// `Action` represents a repeatable action that can be performed by the +// execution service. `Action`s can be succinctly identified by the digest of +// their wire format encoding and, once an `Action` has been executed, will be +// cached in the action cache. Future requests can then use the cached result +// rather than needing to run afresh. +// +// When a server completes execution of an +// [Action][google.devtools.remoteexecution.v1test.Action], it MAY choose to +// cache the [result][google.devtools.remoteexecution.v1test.ActionResult] in +// the [ActionCache][google.devtools.remoteexecution.v1test.ActionCache] unless +// `do_not_cache` is `true`. Clients SHOULD expect the server to do so. By +// default, future calls to [Execute][] the same `Action` will also serve their +// results from the cache. Clients must take care to understand the caching +// behaviour. Ideally, all `Action`s will be reproducible so that serving a +// result from cache is always desirable and correct. +type Action struct { + // The digest of the [Command][google.devtools.remoteexecution.v1test.Command] + // to run, which MUST be present in the + // [ContentAddressableStorage][google.devtools.remoteexecution.v1test.ContentAddressableStorage]. + CommandDigest *Digest `protobuf:"bytes,1,opt,name=command_digest,json=commandDigest" json:"command_digest,omitempty"` + // The digest of the root + // [Directory][google.devtools.remoteexecution.v1test.Directory] for the input + // files. The files in the directory tree are available in the correct + // location on the build machine before the command is executed. The root + // directory, as well as every subdirectory and content blob referred to, MUST + // be in the + // [ContentAddressableStorage][google.devtools.remoteexecution.v1test.ContentAddressableStorage]. + InputRootDigest *Digest `protobuf:"bytes,2,opt,name=input_root_digest,json=inputRootDigest" json:"input_root_digest,omitempty"` + // A list of the output files that the client expects to retrieve from the + // action. Only the listed files, as well as directories listed in + // `output_directories`, will be returned to the client as output. + // Other files that may be created during command execution are discarded. + // + // The paths are specified using forward slashes (`/`) as path separators, + // even if the execution platform natively uses a different separator. The + // path MUST NOT include a trailing slash. + // + // In order to ensure consistent hashing of the same Action, the output paths + // MUST be sorted lexicographically by code point (or, equivalently, by UTF-8 + // bytes). + OutputFiles []string `protobuf:"bytes,3,rep,name=output_files,json=outputFiles" json:"output_files,omitempty"` + // A list of the output directories that the client expects to retrieve from + // the action. Only the contents of the indicated directories (recursively + // including the contents of their subdirectories) will be + // returned, as well as files listed in `output_files`. Other files that may + // be created during command execution are discarded. + // + // The paths are specified using forward slashes (`/`) as path separators, + // even if the execution platform natively uses a different separator. The + // path MUST NOT include a trailing slash, unless the path is `"/"` (which, + // although not recommended, can be used to capture the entire working + // directory tree, including inputs). + // + // In order to ensure consistent hashing of the same Action, the output paths + // MUST be sorted lexicographically by code point (or, equivalently, by UTF-8 + // bytes). + OutputDirectories []string `protobuf:"bytes,4,rep,name=output_directories,json=outputDirectories" json:"output_directories,omitempty"` + // The platform requirements for the execution environment. The server MAY + // choose to execute the action on any worker satisfying the requirements, so + // the client SHOULD ensure that running the action on any such worker will + // have the same result. + Platform *Platform `protobuf:"bytes,5,opt,name=platform" json:"platform,omitempty"` + // A timeout after which the execution should be killed. If the timeout is + // absent, then the client is specifying that the execution should continue + // as long as the server will let it. The server SHOULD impose a timeout if + // the client does not specify one, however, if the client does specify a + // timeout that is longer than the server's maximum timeout, the server MUST + // reject the request. + // + // The timeout is a part of the + // [Action][google.devtools.remoteexecution.v1test.Action] message, and + // therefore two `Actions` with different timeouts are different, even if they + // are otherwise identical. This is because, if they were not, running an + // `Action` with a lower timeout than is required might result in a cache hit + // from an execution run with a longer timeout, hiding the fact that the + // timeout is too short. By encoding it directly in the `Action`, a lower + // timeout will result in a cache miss and the execution timeout will fail + // immediately, rather than whenever the cache entry gets evicted. + Timeout *google_protobuf3.Duration `protobuf:"bytes,6,opt,name=timeout" json:"timeout,omitempty"` + // If true, then the `Action`'s result cannot be cached. + DoNotCache bool `protobuf:"varint,7,opt,name=do_not_cache,json=doNotCache" json:"do_not_cache,omitempty"` +} + +func (m *Action) Reset() { *m = Action{} } +func (m *Action) String() string { return proto.CompactTextString(m) } +func (*Action) ProtoMessage() {} +func (*Action) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *Action) GetCommandDigest() *Digest { + if m != nil { + return m.CommandDigest + } + return nil +} + +func (m *Action) GetInputRootDigest() *Digest { + if m != nil { + return m.InputRootDigest + } + return nil +} + +func (m *Action) GetOutputFiles() []string { + if m != nil { + return m.OutputFiles + } + return nil +} + +func (m *Action) GetOutputDirectories() []string { + if m != nil { + return m.OutputDirectories + } + return nil +} + +func (m *Action) GetPlatform() *Platform { + if m != nil { + return m.Platform + } + return nil +} + +func (m *Action) GetTimeout() *google_protobuf3.Duration { + if m != nil { + return m.Timeout + } + return nil +} + +func (m *Action) GetDoNotCache() bool { + if m != nil { + return m.DoNotCache + } + return false +} + +// A `Command` is the actual command executed by a worker running an +// [Action][google.devtools.remoteexecution.v1test.Action]. +// +// Except as otherwise required, the environment (such as which system +// libraries or binaries are available, and what filesystems are mounted where) +// is defined by and specific to the implementation of the remote execution API. +type Command struct { + // The arguments to the command. The first argument must be the path to the + // executable, which must be either a relative path, in which case it is + // evaluated with respect to the input root, or an absolute path. The `PATH` + // environment variable, or similar functionality on other systems, is not + // used to determine which executable to run. + // + // The working directory will always be the input root. + Arguments []string `protobuf:"bytes,1,rep,name=arguments" json:"arguments,omitempty"` + // The environment variables to set when running the program. The worker may + // provide its own default environment variables; these defaults can be + // overridden using this field. Additional variables can also be specified. + // + // In order to ensure that equivalent `Command`s always hash to the same + // value, the environment variables MUST be lexicographically sorted by name. + // Sorting of strings is done by code point, equivalently, by the UTF-8 bytes. + EnvironmentVariables []*Command_EnvironmentVariable `protobuf:"bytes,2,rep,name=environment_variables,json=environmentVariables" json:"environment_variables,omitempty"` +} + +func (m *Command) Reset() { *m = Command{} } +func (m *Command) String() string { return proto.CompactTextString(m) } +func (*Command) ProtoMessage() {} +func (*Command) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *Command) GetArguments() []string { + if m != nil { + return m.Arguments + } + return nil +} + +func (m *Command) GetEnvironmentVariables() []*Command_EnvironmentVariable { + if m != nil { + return m.EnvironmentVariables + } + return nil +} + +// An `EnvironmentVariable` is one variable to set in the running program's +// environment. +type Command_EnvironmentVariable struct { + // The variable name. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The variable value. + Value string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` +} + +func (m *Command_EnvironmentVariable) Reset() { *m = Command_EnvironmentVariable{} } +func (m *Command_EnvironmentVariable) String() string { return proto.CompactTextString(m) } +func (*Command_EnvironmentVariable) ProtoMessage() {} +func (*Command_EnvironmentVariable) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1, 0} } + +func (m *Command_EnvironmentVariable) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Command_EnvironmentVariable) GetValue() string { + if m != nil { + return m.Value + } + return "" +} + +// A `Platform` is a set of requirements, such as hardware, operation system, or +// compiler toolchain, for an +// [Action][google.devtools.remoteexecution.v1test.Action]'s execution +// environment. A `Platform` is represented as a series of key-value pairs +// representing the properties that are required of the platform. +// +// This message is currently being redeveloped since it is an overly simplistic +// model of platforms. +type Platform struct { + // The properties that make up this platform. In order to ensure that + // equivalent `Platform`s always hash to the same value, the properties MUST + // be lexicographically sorted by name, and then by value. Sorting of strings + // is done by code point, equivalently, by the UTF-8 bytes. + Properties []*Platform_Property `protobuf:"bytes,1,rep,name=properties" json:"properties,omitempty"` +} + +func (m *Platform) Reset() { *m = Platform{} } +func (m *Platform) String() string { return proto.CompactTextString(m) } +func (*Platform) ProtoMessage() {} +func (*Platform) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *Platform) GetProperties() []*Platform_Property { + if m != nil { + return m.Properties + } + return nil +} + +// A single property for the environment. The server is responsible for +// specifying the property `name`s that it accepts. If an unknown `name` is +// provided in the requirements for an +// [Action][google.devtools.remoteexecution.v1test.Action], the server SHOULD +// reject the execution request. If permitted by the server, the same `name` +// may occur multiple times. +// +// The server is also responsible for specifying the interpretation of +// property `value`s. For instance, a property describing how much RAM must be +// available may be interpreted as allowing a worker with 16GB to fulfill a +// request for 8GB, while a property describing the OS environment on which +// the action must be performed may require an exact match with the worker's +// OS. +// +// The server MAY use the `value` of one or more properties to determine how +// it sets up the execution environment, such as by making specific system +// files available to the worker. +type Platform_Property struct { + // The property name. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The property value. + Value string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` +} + +func (m *Platform_Property) Reset() { *m = Platform_Property{} } +func (m *Platform_Property) String() string { return proto.CompactTextString(m) } +func (*Platform_Property) ProtoMessage() {} +func (*Platform_Property) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2, 0} } + +func (m *Platform_Property) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Platform_Property) GetValue() string { + if m != nil { + return m.Value + } + return "" +} + +// A `Directory` represents a directory node in a file tree, containing zero or +// more children [FileNodes][google.devtools.remoteexecution.v1test.FileNode] +// and [DirectoryNodes][google.devtools.remoteexecution.v1test.DirectoryNode]. +// Each `Node` contains its name in the directory, the digest of its content +// (either a file blob or a `Directory` proto), as well as possibly some +// metadata about the file or directory. +// +// In order to ensure that two equivalent directory trees hash to the same +// value, the following restrictions MUST be obeyed when constructing a +// a `Directory`: +// - Every child in the directory must have a path of exactly one segment. +// Multiple levels of directory hierarchy may not be collapsed. +// - Each child in the directory must have a unique path segment (file name). +// - The files and directories in the directory must each be sorted in +// lexicographical order by path. The path strings must be sorted by code +// point, equivalently, by UTF-8 bytes. +// +// A `Directory` that obeys the restrictions is said to be in canonical form. +// +// As an example, the following could be used for a file named `bar` and a +// directory named `foo` with an executable file named `baz` (hashes shortened +// for readability): +// +// ```json +// // (Directory proto) +// { +// files: [ +// { +// name: "bar", +// digest: { +// hash: "4a73bc9d03...", +// size: 65534 +// } +// } +// ], +// directories: [ +// { +// name: "foo", +// digest: { +// hash: "4cf2eda940...", +// size: 43 +// } +// } +// ] +// } +// +// // (Directory proto with hash "4cf2eda940..." and size 43) +// { +// files: [ +// { +// name: "baz", +// digest: { +// hash: "b2c941073e...", +// size: 1294, +// }, +// is_executable: true +// } +// ] +// } +// ``` +type Directory struct { + // The files in the directory. + Files []*FileNode `protobuf:"bytes,1,rep,name=files" json:"files,omitempty"` + // The subdirectories in the directory. + Directories []*DirectoryNode `protobuf:"bytes,2,rep,name=directories" json:"directories,omitempty"` +} + +func (m *Directory) Reset() { *m = Directory{} } +func (m *Directory) String() string { return proto.CompactTextString(m) } +func (*Directory) ProtoMessage() {} +func (*Directory) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *Directory) GetFiles() []*FileNode { + if m != nil { + return m.Files + } + return nil +} + +func (m *Directory) GetDirectories() []*DirectoryNode { + if m != nil { + return m.Directories + } + return nil +} + +// A `FileNode` represents a single file and associated metadata. +type FileNode struct { + // The name of the file. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The digest of the file's content. + Digest *Digest `protobuf:"bytes,2,opt,name=digest" json:"digest,omitempty"` + // True if file is executable, false otherwise. + IsExecutable bool `protobuf:"varint,4,opt,name=is_executable,json=isExecutable" json:"is_executable,omitempty"` +} + +func (m *FileNode) Reset() { *m = FileNode{} } +func (m *FileNode) String() string { return proto.CompactTextString(m) } +func (*FileNode) ProtoMessage() {} +func (*FileNode) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *FileNode) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *FileNode) GetDigest() *Digest { + if m != nil { + return m.Digest + } + return nil +} + +func (m *FileNode) GetIsExecutable() bool { + if m != nil { + return m.IsExecutable + } + return false +} + +// A `DirectoryNode` represents a child of a +// [Directory][google.devtools.remoteexecution.v1test.Directory] which is itself +// a `Directory` and its associated metadata. +type DirectoryNode struct { + // The name of the directory. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The digest of the + // [Directory][google.devtools.remoteexecution.v1test.Directory] object + // represented. See [Digest][google.devtools.remoteexecution.v1test.Digest] + // for information about how to take the digest of a proto message. + Digest *Digest `protobuf:"bytes,2,opt,name=digest" json:"digest,omitempty"` +} + +func (m *DirectoryNode) Reset() { *m = DirectoryNode{} } +func (m *DirectoryNode) String() string { return proto.CompactTextString(m) } +func (*DirectoryNode) ProtoMessage() {} +func (*DirectoryNode) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *DirectoryNode) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *DirectoryNode) GetDigest() *Digest { + if m != nil { + return m.Digest + } + return nil +} + +// A content digest. A digest for a given blob consists of the size of the blob +// and its hash. The hash algorithm to use is defined by the server, but servers +// SHOULD use SHA-256. +// +// The size is considered to be an integral part of the digest and cannot be +// separated. That is, even if the `hash` field is correctly specified but +// `size_bytes` is not, the server MUST reject the request. +// +// The reason for including the size in the digest is as follows: in a great +// many cases, the server needs to know the size of the blob it is about to work +// with prior to starting an operation with it, such as flattening Merkle tree +// structures or streaming it to a worker. Technically, the server could +// implement a separate metadata store, but this results in a significantly more +// complicated implementation as opposed to having the client specify the size +// up-front (or storing the size along with the digest in every message where +// digests are embedded). This does mean that the API leaks some implementation +// details of (what we consider to be) a reasonable server implementation, but +// we consider this to be a worthwhile tradeoff. +// +// When a `Digest` is used to refer to a proto message, it always refers to the +// message in binary encoded form. To ensure consistent hashing, clients and +// servers MUST ensure that they serialize messages according to the following +// rules, even if there are alternate valid encodings for the same message. +// - Fields are serialized in tag order. +// - There are no unknown fields. +// - There are no duplicate fields. +// - Fields are serialized according to the default semantics for their type. +// +// Most protocol buffer implementations will always follow these rules when +// serializing, but care should be taken to avoid shortcuts. For instance, +// concatenating two messages to merge them may produce duplicate fields. +type Digest struct { + // The hash. In the case of SHA-256, it will always be a lowercase hex string + // exactly 64 characters long. + Hash string `protobuf:"bytes,1,opt,name=hash" json:"hash,omitempty"` + // The size of the blob, in bytes. + SizeBytes int64 `protobuf:"varint,2,opt,name=size_bytes,json=sizeBytes" json:"size_bytes,omitempty"` +} + +func (m *Digest) Reset() { *m = Digest{} } +func (m *Digest) String() string { return proto.CompactTextString(m) } +func (*Digest) ProtoMessage() {} +func (*Digest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *Digest) GetHash() string { + if m != nil { + return m.Hash + } + return "" +} + +func (m *Digest) GetSizeBytes() int64 { + if m != nil { + return m.SizeBytes + } + return 0 +} + +// An ActionResult represents the result of an +// [Action][google.devtools.remoteexecution.v1test.Action] being run. +type ActionResult struct { + // The output files of the action. For each output file requested, if the + // corresponding file existed after the action completed, a single entry will + // be present in the output list. + // + // If the action does not produce the requested output, or produces a + // directory where a regular file is expected or vice versa, then that output + // will be omitted from the list. The server is free to arrange the output + // list as desired; clients MUST NOT assume that the output list is sorted. + OutputFiles []*OutputFile `protobuf:"bytes,2,rep,name=output_files,json=outputFiles" json:"output_files,omitempty"` + // The output directories of the action. For each output directory requested, + // if the corresponding directory existed after the action completed, a single + // entry will be present in the output list, which will contain the digest of + // a [Tree][google.devtools.remoteexecution.v1.test.Tree] message containing + // the directory tree. + OutputDirectories []*OutputDirectory `protobuf:"bytes,3,rep,name=output_directories,json=outputDirectories" json:"output_directories,omitempty"` + // The exit code of the command. + ExitCode int32 `protobuf:"varint,4,opt,name=exit_code,json=exitCode" json:"exit_code,omitempty"` + // The standard output buffer of the action. The server will determine, based + // on the size of the buffer, whether to return it in raw form or to return + // a digest in `stdout_digest` that points to the buffer. If neither is set, + // then the buffer is empty. The client SHOULD NOT assume it will get one of + // the raw buffer or a digest on any given request and should be prepared to + // handle either. + StdoutRaw []byte `protobuf:"bytes,5,opt,name=stdout_raw,json=stdoutRaw,proto3" json:"stdout_raw,omitempty"` + // The digest for a blob containing the standard output of the action, which + // can be retrieved from the + // [ContentAddressableStorage][google.devtools.remoteexecution.v1test.ContentAddressableStorage]. + // See `stdout_raw` for when this will be set. + StdoutDigest *Digest `protobuf:"bytes,6,opt,name=stdout_digest,json=stdoutDigest" json:"stdout_digest,omitempty"` + // The standard error buffer of the action. The server will determine, based + // on the size of the buffer, whether to return it in raw form or to return + // a digest in `stderr_digest` that points to the buffer. If neither is set, + // then the buffer is empty. The client SHOULD NOT assume it will get one of + // the raw buffer or a digest on any given request and should be prepared to + // handle either. + StderrRaw []byte `protobuf:"bytes,7,opt,name=stderr_raw,json=stderrRaw,proto3" json:"stderr_raw,omitempty"` + // The digest for a blob containing the standard error of the action, which + // can be retrieved from the + // [ContentAddressableStorage][google.devtools.remoteexecution.v1test.ContentAddressableStorage]. + // See `stderr_raw` for when this will be set. + StderrDigest *Digest `protobuf:"bytes,8,opt,name=stderr_digest,json=stderrDigest" json:"stderr_digest,omitempty"` +} + +func (m *ActionResult) Reset() { *m = ActionResult{} } +func (m *ActionResult) String() string { return proto.CompactTextString(m) } +func (*ActionResult) ProtoMessage() {} +func (*ActionResult) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *ActionResult) GetOutputFiles() []*OutputFile { + if m != nil { + return m.OutputFiles + } + return nil +} + +func (m *ActionResult) GetOutputDirectories() []*OutputDirectory { + if m != nil { + return m.OutputDirectories + } + return nil +} + +func (m *ActionResult) GetExitCode() int32 { + if m != nil { + return m.ExitCode + } + return 0 +} + +func (m *ActionResult) GetStdoutRaw() []byte { + if m != nil { + return m.StdoutRaw + } + return nil +} + +func (m *ActionResult) GetStdoutDigest() *Digest { + if m != nil { + return m.StdoutDigest + } + return nil +} + +func (m *ActionResult) GetStderrRaw() []byte { + if m != nil { + return m.StderrRaw + } + return nil +} + +func (m *ActionResult) GetStderrDigest() *Digest { + if m != nil { + return m.StderrDigest + } + return nil +} + +// An `OutputFile` is similar to a +// [FileNode][google.devtools.remoteexecution.v1test.FileNode], but it is +// tailored for output as part of an `ActionResult`. It allows a full file path +// rather than only a name, and allows the server to include content inline. +// +// `OutputFile` is binary-compatible with `FileNode`. +type OutputFile struct { + // The full path of the file relative to the input root, including the + // filename. The path separator is a forward slash `/`. + Path string `protobuf:"bytes,1,opt,name=path" json:"path,omitempty"` + // The digest of the file's content. + Digest *Digest `protobuf:"bytes,2,opt,name=digest" json:"digest,omitempty"` + // The raw content of the file. + // + // This field may be used by the server to provide the content of a file + // inline in an + // [ActionResult][google.devtools.remoteexecution.v1test.ActionResult] and + // avoid requiring that the client make a separate call to + // [ContentAddressableStorage.GetBlob] to retrieve it. + // + // The client SHOULD NOT assume that it will get raw content with any request, + // and always be prepared to retrieve it via `digest`. + Content []byte `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"` + // True if file is executable, false otherwise. + IsExecutable bool `protobuf:"varint,4,opt,name=is_executable,json=isExecutable" json:"is_executable,omitempty"` +} + +func (m *OutputFile) Reset() { *m = OutputFile{} } +func (m *OutputFile) String() string { return proto.CompactTextString(m) } +func (*OutputFile) ProtoMessage() {} +func (*OutputFile) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *OutputFile) GetPath() string { + if m != nil { + return m.Path + } + return "" +} + +func (m *OutputFile) GetDigest() *Digest { + if m != nil { + return m.Digest + } + return nil +} + +func (m *OutputFile) GetContent() []byte { + if m != nil { + return m.Content + } + return nil +} + +func (m *OutputFile) GetIsExecutable() bool { + if m != nil { + return m.IsExecutable + } + return false +} + +// A `Tree` contains all the +// [Directory][google.devtools.remoteexecution.v1test.Directory] protos in a +// single directory Merkle tree, compressed into one message. +type Tree struct { + // The root directory in the tree. + Root *Directory `protobuf:"bytes,1,opt,name=root" json:"root,omitempty"` + // All the child directories: the directories referred to by the root and, + // recursively, all its children. In order to reconstruct the directory tree, + // the client must take the digests of each of the child directories and then + // build up a tree starting from the `root`. + Children []*Directory `protobuf:"bytes,2,rep,name=children" json:"children,omitempty"` +} + +func (m *Tree) Reset() { *m = Tree{} } +func (m *Tree) String() string { return proto.CompactTextString(m) } +func (*Tree) ProtoMessage() {} +func (*Tree) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *Tree) GetRoot() *Directory { + if m != nil { + return m.Root + } + return nil +} + +func (m *Tree) GetChildren() []*Directory { + if m != nil { + return m.Children + } + return nil +} + +// An `OutputDirectory` is the output in an `ActionResult` corresponding to a +// directory's full contents rather than a single file. +type OutputDirectory struct { + // The full path of the directory relative to the input root, including the + // filename. The path separator is a forward slash `/`. + Path string `protobuf:"bytes,1,opt,name=path" json:"path,omitempty"` + // DEPRECATED: This field is deprecated and should no longer be used. + Digest *Digest `protobuf:"bytes,2,opt,name=digest" json:"digest,omitempty"` + // The digest of the encoded + // [Tree][google.devtools.remoteexecution.v1test.Tree] proto containing the + // directory's contents. + TreeDigest *Digest `protobuf:"bytes,3,opt,name=tree_digest,json=treeDigest" json:"tree_digest,omitempty"` +} + +func (m *OutputDirectory) Reset() { *m = OutputDirectory{} } +func (m *OutputDirectory) String() string { return proto.CompactTextString(m) } +func (*OutputDirectory) ProtoMessage() {} +func (*OutputDirectory) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *OutputDirectory) GetPath() string { + if m != nil { + return m.Path + } + return "" +} + +func (m *OutputDirectory) GetDigest() *Digest { + if m != nil { + return m.Digest + } + return nil +} + +func (m *OutputDirectory) GetTreeDigest() *Digest { + if m != nil { + return m.TreeDigest + } + return nil +} + +// A request message for +// [Execution.Execute][google.devtools.remoteexecution.v1test.Execution.Execute]. +type ExecuteRequest struct { + // The instance of the execution system to operate against. A server may + // support multiple instances of the execution system (with their own workers, + // storage, caches, etc.). The server MAY require use of this field to select + // between them in an implementation-defined fashion, otherwise it can be + // omitted. + InstanceName string `protobuf:"bytes,1,opt,name=instance_name,json=instanceName" json:"instance_name,omitempty"` + // The action to be performed. + Action *Action `protobuf:"bytes,2,opt,name=action" json:"action,omitempty"` + // If true, the action will be executed anew even if its result was already + // present in the cache. If false, the result may be served from the + // [ActionCache][google.devtools.remoteexecution.v1test.ActionCache]. + SkipCacheLookup bool `protobuf:"varint,3,opt,name=skip_cache_lookup,json=skipCacheLookup" json:"skip_cache_lookup,omitempty"` + // DEPRECATED: This field should be ignored by clients and servers and will be + // removed. + TotalInputFileCount int32 `protobuf:"varint,4,opt,name=total_input_file_count,json=totalInputFileCount" json:"total_input_file_count,omitempty"` + // DEPRECATED: This field should be ignored by clients and servers and will be + // removed. + TotalInputFileBytes int64 `protobuf:"varint,5,opt,name=total_input_file_bytes,json=totalInputFileBytes" json:"total_input_file_bytes,omitempty"` +} + +func (m *ExecuteRequest) Reset() { *m = ExecuteRequest{} } +func (m *ExecuteRequest) String() string { return proto.CompactTextString(m) } +func (*ExecuteRequest) ProtoMessage() {} +func (*ExecuteRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } + +func (m *ExecuteRequest) GetInstanceName() string { + if m != nil { + return m.InstanceName + } + return "" +} + +func (m *ExecuteRequest) GetAction() *Action { + if m != nil { + return m.Action + } + return nil +} + +func (m *ExecuteRequest) GetSkipCacheLookup() bool { + if m != nil { + return m.SkipCacheLookup + } + return false +} + +func (m *ExecuteRequest) GetTotalInputFileCount() int32 { + if m != nil { + return m.TotalInputFileCount + } + return 0 +} + +func (m *ExecuteRequest) GetTotalInputFileBytes() int64 { + if m != nil { + return m.TotalInputFileBytes + } + return 0 +} + +// A `LogFile` is a log stored in the CAS. +type LogFile struct { + // The digest of the log contents. + Digest *Digest `protobuf:"bytes,1,opt,name=digest" json:"digest,omitempty"` + // This is a hint as to the purpose of the log, and is set to true if the log + // is human-readable text that can be usefully displayed to a user, and false + // otherwise. For instance, if a command-line client wishes to print the + // server logs to the terminal for a failed action, this allows it to avoid + // displaying a binary file. + HumanReadable bool `protobuf:"varint,2,opt,name=human_readable,json=humanReadable" json:"human_readable,omitempty"` +} + +func (m *LogFile) Reset() { *m = LogFile{} } +func (m *LogFile) String() string { return proto.CompactTextString(m) } +func (*LogFile) ProtoMessage() {} +func (*LogFile) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } + +func (m *LogFile) GetDigest() *Digest { + if m != nil { + return m.Digest + } + return nil +} + +func (m *LogFile) GetHumanReadable() bool { + if m != nil { + return m.HumanReadable + } + return false +} + +// The response message for +// [Execution.Execute][google.devtools.remoteexecution.v1test.Execution.Execute], +// which will be contained in the [response +// field][google.longrunning.Operation.response] of the +// [Operation][google.longrunning.Operation]. +type ExecuteResponse struct { + // The result of the action. + Result *ActionResult `protobuf:"bytes,1,opt,name=result" json:"result,omitempty"` + // True if the result was served from cache, false if it was executed. + CachedResult bool `protobuf:"varint,2,opt,name=cached_result,json=cachedResult" json:"cached_result,omitempty"` + // If the status has a code other than `OK`, it indicates that the action did + // not finish execution. For example, if the operation times out during + // execution, the status will have a `DEADLINE_EXCEEDED` code. Servers MUST + // use this field for errors in execution, rather than the error field on the + // `Operation` object. + // + // If the status code is other than `OK`, then the result MUST NOT be cached. + // For an error status, the `result` field is optional; the server may + // populate the output-, stdout-, and stderr-related fields if it has any + // information available, such as the stdout and stderr of a timed-out action. + Status *google_rpc.Status `protobuf:"bytes,3,opt,name=status" json:"status,omitempty"` + // An optional list of additional log outputs the server wishes to provide. A + // server can use this to return execution-specific logs however it wishes. + // This is intended primarily to make it easier for users to debug issues that + // may be outside of the actual job execution, such as by identifying the + // worker executing the action or by providing logs from the worker's setup + // phase. The keys SHOULD be human readable so that a client can display them + // to a user. + ServerLogs map[string]*LogFile `protobuf:"bytes,4,rep,name=server_logs,json=serverLogs" json:"server_logs,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *ExecuteResponse) Reset() { *m = ExecuteResponse{} } +func (m *ExecuteResponse) String() string { return proto.CompactTextString(m) } +func (*ExecuteResponse) ProtoMessage() {} +func (*ExecuteResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } + +func (m *ExecuteResponse) GetResult() *ActionResult { + if m != nil { + return m.Result + } + return nil +} + +func (m *ExecuteResponse) GetCachedResult() bool { + if m != nil { + return m.CachedResult + } + return false +} + +func (m *ExecuteResponse) GetStatus() *google_rpc.Status { + if m != nil { + return m.Status + } + return nil +} + +func (m *ExecuteResponse) GetServerLogs() map[string]*LogFile { + if m != nil { + return m.ServerLogs + } + return nil +} + +// Metadata about an ongoing +// [execution][google.devtools.remoteexecution.v1test.Execution.Execute], which +// will be contained in the [metadata +// field][google.longrunning.Operation.response] of the +// [Operation][google.longrunning.Operation]. +type ExecuteOperationMetadata struct { + Stage ExecuteOperationMetadata_Stage `protobuf:"varint,1,opt,name=stage,enum=google.devtools.remoteexecution.v1test.ExecuteOperationMetadata_Stage" json:"stage,omitempty"` + // The digest of the [Action][google.devtools.remoteexecution.v1test.Action] + // being executed. + ActionDigest *Digest `protobuf:"bytes,2,opt,name=action_digest,json=actionDigest" json:"action_digest,omitempty"` + // If set, the client can use this name with + // [ByteStream.Read][google.bytestream.ByteStream.Read] to stream the + // standard output. + StdoutStreamName string `protobuf:"bytes,3,opt,name=stdout_stream_name,json=stdoutStreamName" json:"stdout_stream_name,omitempty"` + // If set, the client can use this name with + // [ByteStream.Read][google.bytestream.ByteStream.Read] to stream the + // standard error. + StderrStreamName string `protobuf:"bytes,4,opt,name=stderr_stream_name,json=stderrStreamName" json:"stderr_stream_name,omitempty"` +} + +func (m *ExecuteOperationMetadata) Reset() { *m = ExecuteOperationMetadata{} } +func (m *ExecuteOperationMetadata) String() string { return proto.CompactTextString(m) } +func (*ExecuteOperationMetadata) ProtoMessage() {} +func (*ExecuteOperationMetadata) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } + +func (m *ExecuteOperationMetadata) GetStage() ExecuteOperationMetadata_Stage { + if m != nil { + return m.Stage + } + return ExecuteOperationMetadata_UNKNOWN +} + +func (m *ExecuteOperationMetadata) GetActionDigest() *Digest { + if m != nil { + return m.ActionDigest + } + return nil +} + +func (m *ExecuteOperationMetadata) GetStdoutStreamName() string { + if m != nil { + return m.StdoutStreamName + } + return "" +} + +func (m *ExecuteOperationMetadata) GetStderrStreamName() string { + if m != nil { + return m.StderrStreamName + } + return "" +} + +// A request message for +// [ActionCache.GetActionResult][google.devtools.remoteexecution.v1test.ActionCache.GetActionResult]. +type GetActionResultRequest struct { + // The instance of the execution system to operate against. A server may + // support multiple instances of the execution system (with their own workers, + // storage, caches, etc.). The server MAY require use of this field to select + // between them in an implementation-defined fashion, otherwise it can be + // omitted. + InstanceName string `protobuf:"bytes,1,opt,name=instance_name,json=instanceName" json:"instance_name,omitempty"` + // The digest of the [Action][google.devtools.remoteexecution.v1test.Action] + // whose result is requested. + ActionDigest *Digest `protobuf:"bytes,2,opt,name=action_digest,json=actionDigest" json:"action_digest,omitempty"` +} + +func (m *GetActionResultRequest) Reset() { *m = GetActionResultRequest{} } +func (m *GetActionResultRequest) String() string { return proto.CompactTextString(m) } +func (*GetActionResultRequest) ProtoMessage() {} +func (*GetActionResultRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } + +func (m *GetActionResultRequest) GetInstanceName() string { + if m != nil { + return m.InstanceName + } + return "" +} + +func (m *GetActionResultRequest) GetActionDigest() *Digest { + if m != nil { + return m.ActionDigest + } + return nil +} + +// A request message for +// [ActionCache.UpdateActionResult][google.devtools.remoteexecution.v1test.ActionCache.UpdateActionResult]. +type UpdateActionResultRequest struct { + // The instance of the execution system to operate against. A server may + // support multiple instances of the execution system (with their own workers, + // storage, caches, etc.). The server MAY require use of this field to select + // between them in an implementation-defined fashion, otherwise it can be + // omitted. + InstanceName string `protobuf:"bytes,1,opt,name=instance_name,json=instanceName" json:"instance_name,omitempty"` + // The digest of the [Action][google.devtools.remoteexecution.v1test.Action] + // whose result is being uploaded. + ActionDigest *Digest `protobuf:"bytes,2,opt,name=action_digest,json=actionDigest" json:"action_digest,omitempty"` + // The [ActionResult][google.devtools.remoteexecution.v1test.ActionResult] + // to store in the cache. + ActionResult *ActionResult `protobuf:"bytes,3,opt,name=action_result,json=actionResult" json:"action_result,omitempty"` +} + +func (m *UpdateActionResultRequest) Reset() { *m = UpdateActionResultRequest{} } +func (m *UpdateActionResultRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateActionResultRequest) ProtoMessage() {} +func (*UpdateActionResultRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} } + +func (m *UpdateActionResultRequest) GetInstanceName() string { + if m != nil { + return m.InstanceName + } + return "" +} + +func (m *UpdateActionResultRequest) GetActionDigest() *Digest { + if m != nil { + return m.ActionDigest + } + return nil +} + +func (m *UpdateActionResultRequest) GetActionResult() *ActionResult { + if m != nil { + return m.ActionResult + } + return nil +} + +// A request message for +// [ContentAddressableStorage.FindMissingBlobs][google.devtools.remoteexecution.v1test.ContentAddressableStorage.FindMissingBlobs]. +type FindMissingBlobsRequest struct { + // The instance of the execution system to operate against. A server may + // support multiple instances of the execution system (with their own workers, + // storage, caches, etc.). The server MAY require use of this field to select + // between them in an implementation-defined fashion, otherwise it can be + // omitted. + InstanceName string `protobuf:"bytes,1,opt,name=instance_name,json=instanceName" json:"instance_name,omitempty"` + // A list of the blobs to check. + BlobDigests []*Digest `protobuf:"bytes,2,rep,name=blob_digests,json=blobDigests" json:"blob_digests,omitempty"` +} + +func (m *FindMissingBlobsRequest) Reset() { *m = FindMissingBlobsRequest{} } +func (m *FindMissingBlobsRequest) String() string { return proto.CompactTextString(m) } +func (*FindMissingBlobsRequest) ProtoMessage() {} +func (*FindMissingBlobsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17} } + +func (m *FindMissingBlobsRequest) GetInstanceName() string { + if m != nil { + return m.InstanceName + } + return "" +} + +func (m *FindMissingBlobsRequest) GetBlobDigests() []*Digest { + if m != nil { + return m.BlobDigests + } + return nil +} + +// A response message for +// [ContentAddressableStorage.FindMissingBlobs][google.devtools.remoteexecution.v1test.ContentAddressableStorage.FindMissingBlobs]. +type FindMissingBlobsResponse struct { + // A list of the blobs requested *not* present in the storage. + MissingBlobDigests []*Digest `protobuf:"bytes,2,rep,name=missing_blob_digests,json=missingBlobDigests" json:"missing_blob_digests,omitempty"` +} + +func (m *FindMissingBlobsResponse) Reset() { *m = FindMissingBlobsResponse{} } +func (m *FindMissingBlobsResponse) String() string { return proto.CompactTextString(m) } +func (*FindMissingBlobsResponse) ProtoMessage() {} +func (*FindMissingBlobsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{18} } + +func (m *FindMissingBlobsResponse) GetMissingBlobDigests() []*Digest { + if m != nil { + return m.MissingBlobDigests + } + return nil +} + +// A single request message for +// [ContentAddressableStorage.BatchUpdateBlobs][google.devtools.remoteexecution.v1test.ContentAddressableStorage.BatchUpdateBlobs]. +type UpdateBlobRequest struct { + // The digest of the blob. This MUST be the digest of `data`. + ContentDigest *Digest `protobuf:"bytes,1,opt,name=content_digest,json=contentDigest" json:"content_digest,omitempty"` + // The raw binary data. + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` +} + +func (m *UpdateBlobRequest) Reset() { *m = UpdateBlobRequest{} } +func (m *UpdateBlobRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateBlobRequest) ProtoMessage() {} +func (*UpdateBlobRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{19} } + +func (m *UpdateBlobRequest) GetContentDigest() *Digest { + if m != nil { + return m.ContentDigest + } + return nil +} + +func (m *UpdateBlobRequest) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +// A request message for +// [ContentAddressableStorage.BatchUpdateBlobs][google.devtools.remoteexecution.v1test.ContentAddressableStorage.BatchUpdateBlobs]. +type BatchUpdateBlobsRequest struct { + // The instance of the execution system to operate against. A server may + // support multiple instances of the execution system (with their own workers, + // storage, caches, etc.). The server MAY require use of this field to select + // between them in an implementation-defined fashion, otherwise it can be + // omitted. + InstanceName string `protobuf:"bytes,1,opt,name=instance_name,json=instanceName" json:"instance_name,omitempty"` + // The individual upload requests. + Requests []*UpdateBlobRequest `protobuf:"bytes,2,rep,name=requests" json:"requests,omitempty"` +} + +func (m *BatchUpdateBlobsRequest) Reset() { *m = BatchUpdateBlobsRequest{} } +func (m *BatchUpdateBlobsRequest) String() string { return proto.CompactTextString(m) } +func (*BatchUpdateBlobsRequest) ProtoMessage() {} +func (*BatchUpdateBlobsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20} } + +func (m *BatchUpdateBlobsRequest) GetInstanceName() string { + if m != nil { + return m.InstanceName + } + return "" +} + +func (m *BatchUpdateBlobsRequest) GetRequests() []*UpdateBlobRequest { + if m != nil { + return m.Requests + } + return nil +} + +// A response message for +// [ContentAddressableStorage.BatchUpdateBlobs][google.devtools.remoteexecution.v1test.ContentAddressableStorage.BatchUpdateBlobs]. +type BatchUpdateBlobsResponse struct { + // The responses to the requests. + Responses []*BatchUpdateBlobsResponse_Response `protobuf:"bytes,1,rep,name=responses" json:"responses,omitempty"` +} + +func (m *BatchUpdateBlobsResponse) Reset() { *m = BatchUpdateBlobsResponse{} } +func (m *BatchUpdateBlobsResponse) String() string { return proto.CompactTextString(m) } +func (*BatchUpdateBlobsResponse) ProtoMessage() {} +func (*BatchUpdateBlobsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{21} } + +func (m *BatchUpdateBlobsResponse) GetResponses() []*BatchUpdateBlobsResponse_Response { + if m != nil { + return m.Responses + } + return nil +} + +// A response corresponding to a single blob that the client tried to upload. +type BatchUpdateBlobsResponse_Response struct { + // The digest to which this response corresponds. + BlobDigest *Digest `protobuf:"bytes,1,opt,name=blob_digest,json=blobDigest" json:"blob_digest,omitempty"` + // The result of attempting to upload that blob. + Status *google_rpc.Status `protobuf:"bytes,2,opt,name=status" json:"status,omitempty"` +} + +func (m *BatchUpdateBlobsResponse_Response) Reset() { *m = BatchUpdateBlobsResponse_Response{} } +func (m *BatchUpdateBlobsResponse_Response) String() string { return proto.CompactTextString(m) } +func (*BatchUpdateBlobsResponse_Response) ProtoMessage() {} +func (*BatchUpdateBlobsResponse_Response) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{21, 0} +} + +func (m *BatchUpdateBlobsResponse_Response) GetBlobDigest() *Digest { + if m != nil { + return m.BlobDigest + } + return nil +} + +func (m *BatchUpdateBlobsResponse_Response) GetStatus() *google_rpc.Status { + if m != nil { + return m.Status + } + return nil +} + +// A request message for +// [ContentAddressableStorage.GetTree][google.devtools.remoteexecution.v1test.ContentAddressableStorage.GetTree]. +// This message is deprecated and should no longer be used. +type GetTreeRequest struct { + // The instance of the execution system to operate against. A server may + // support multiple instances of the execution system (with their own workers, + // storage, caches, etc.). The server MAY require use of this field to select + // between them in an implementation-defined fashion, otherwise it can be + // omitted. + InstanceName string `protobuf:"bytes,1,opt,name=instance_name,json=instanceName" json:"instance_name,omitempty"` + // The digest of the root, which must be an encoded + // [Directory][google.devtools.remoteexecution.v1test.Directory] message + // stored in the + // [ContentAddressableStorage][google.devtools.remoteexecution.v1test.ContentAddressableStorage]. + RootDigest *Digest `protobuf:"bytes,2,opt,name=root_digest,json=rootDigest" json:"root_digest,omitempty"` + // A maximum page size to request. If present, the server will request no more + // than this many items. Regardless of whether a page size is specified, the + // server may place its own limit on the number of items to be returned and + // require the client to retrieve more items using a subsequent request. + PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // A page token, which must be a value received in a previous + // [GetTreeResponse][google.devtools.remoteexecution.v1test.GetTreeResponse]. + // If present, the server will use it to return the following page of results. + PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *GetTreeRequest) Reset() { *m = GetTreeRequest{} } +func (m *GetTreeRequest) String() string { return proto.CompactTextString(m) } +func (*GetTreeRequest) ProtoMessage() {} +func (*GetTreeRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{22} } + +func (m *GetTreeRequest) GetInstanceName() string { + if m != nil { + return m.InstanceName + } + return "" +} + +func (m *GetTreeRequest) GetRootDigest() *Digest { + if m != nil { + return m.RootDigest + } + return nil +} + +func (m *GetTreeRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *GetTreeRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// A response message for +// [ContentAddressableStorage.GetTree][google.devtools.remoteexecution.v1test.ContentAddressableStorage.GetTree]. +// This message is deprecated and should no longer be used. +type GetTreeResponse struct { + // The directories descended from the requested root. + Directories []*Directory `protobuf:"bytes,1,rep,name=directories" json:"directories,omitempty"` + // If present, signifies that there are more results which the client can + // retrieve by passing this as the page_token in a subsequent + // [request][google.devtools.remoteexecution.v1test.GetTreeRequest]. + // If empty, signifies that this is the last page of results. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *GetTreeResponse) Reset() { *m = GetTreeResponse{} } +func (m *GetTreeResponse) String() string { return proto.CompactTextString(m) } +func (*GetTreeResponse) ProtoMessage() {} +func (*GetTreeResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{23} } + +func (m *GetTreeResponse) GetDirectories() []*Directory { + if m != nil { + return m.Directories + } + return nil +} + +func (m *GetTreeResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// Details for the tool used to call the API. +type ToolDetails struct { + // Name of the tool, e.g. bazel. + ToolName string `protobuf:"bytes,1,opt,name=tool_name,json=toolName" json:"tool_name,omitempty"` + // Version of the tool used for the request, e.g. 5.0.3. + ToolVersion string `protobuf:"bytes,2,opt,name=tool_version,json=toolVersion" json:"tool_version,omitempty"` +} + +func (m *ToolDetails) Reset() { *m = ToolDetails{} } +func (m *ToolDetails) String() string { return proto.CompactTextString(m) } +func (*ToolDetails) ProtoMessage() {} +func (*ToolDetails) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{24} } + +func (m *ToolDetails) GetToolName() string { + if m != nil { + return m.ToolName + } + return "" +} + +func (m *ToolDetails) GetToolVersion() string { + if m != nil { + return m.ToolVersion + } + return "" +} + +// An optional Metadata to attach to any RPC request to tell the server about an +// external context of the request. The server may use this for logging or other +// purposes. To use it, the client attaches the header to the call using the +// canonical proto serialization: +// name: google.devtools.remoteexecution.v1test.requestmetadata-bin +// contents: the base64 encoded binary RequestMetadata message. +type RequestMetadata struct { + // The details for the tool invoking the requests. + ToolDetails *ToolDetails `protobuf:"bytes,1,opt,name=tool_details,json=toolDetails" json:"tool_details,omitempty"` + // An identifier that ties multiple requests to the same action. + // For example, multiple requests to the CAS, Action Cache, and Execution + // API are used in order to compile foo.cc. + ActionId string `protobuf:"bytes,2,opt,name=action_id,json=actionId" json:"action_id,omitempty"` + // An identifier that ties multiple actions together to a final result. + // For example, multiple actions are required to build and run foo_test. + ToolInvocationId string `protobuf:"bytes,3,opt,name=tool_invocation_id,json=toolInvocationId" json:"tool_invocation_id,omitempty"` + // An identifier to tie multiple tool invocations together. For example, + // runs of foo_test, bar_test and baz_test on a post-submit of a given patch. + CorrelatedInvocationsId string `protobuf:"bytes,4,opt,name=correlated_invocations_id,json=correlatedInvocationsId" json:"correlated_invocations_id,omitempty"` +} + +func (m *RequestMetadata) Reset() { *m = RequestMetadata{} } +func (m *RequestMetadata) String() string { return proto.CompactTextString(m) } +func (*RequestMetadata) ProtoMessage() {} +func (*RequestMetadata) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{25} } + +func (m *RequestMetadata) GetToolDetails() *ToolDetails { + if m != nil { + return m.ToolDetails + } + return nil +} + +func (m *RequestMetadata) GetActionId() string { + if m != nil { + return m.ActionId + } + return "" +} + +func (m *RequestMetadata) GetToolInvocationId() string { + if m != nil { + return m.ToolInvocationId + } + return "" +} + +func (m *RequestMetadata) GetCorrelatedInvocationsId() string { + if m != nil { + return m.CorrelatedInvocationsId + } + return "" +} + +func init() { + proto.RegisterType((*Action)(nil), "google.devtools.remoteexecution.v1test.Action") + proto.RegisterType((*Command)(nil), "google.devtools.remoteexecution.v1test.Command") + proto.RegisterType((*Command_EnvironmentVariable)(nil), "google.devtools.remoteexecution.v1test.Command.EnvironmentVariable") + proto.RegisterType((*Platform)(nil), "google.devtools.remoteexecution.v1test.Platform") + proto.RegisterType((*Platform_Property)(nil), "google.devtools.remoteexecution.v1test.Platform.Property") + proto.RegisterType((*Directory)(nil), "google.devtools.remoteexecution.v1test.Directory") + proto.RegisterType((*FileNode)(nil), "google.devtools.remoteexecution.v1test.FileNode") + proto.RegisterType((*DirectoryNode)(nil), "google.devtools.remoteexecution.v1test.DirectoryNode") + proto.RegisterType((*Digest)(nil), "google.devtools.remoteexecution.v1test.Digest") + proto.RegisterType((*ActionResult)(nil), "google.devtools.remoteexecution.v1test.ActionResult") + proto.RegisterType((*OutputFile)(nil), "google.devtools.remoteexecution.v1test.OutputFile") + proto.RegisterType((*Tree)(nil), "google.devtools.remoteexecution.v1test.Tree") + proto.RegisterType((*OutputDirectory)(nil), "google.devtools.remoteexecution.v1test.OutputDirectory") + proto.RegisterType((*ExecuteRequest)(nil), "google.devtools.remoteexecution.v1test.ExecuteRequest") + proto.RegisterType((*LogFile)(nil), "google.devtools.remoteexecution.v1test.LogFile") + proto.RegisterType((*ExecuteResponse)(nil), "google.devtools.remoteexecution.v1test.ExecuteResponse") + proto.RegisterType((*ExecuteOperationMetadata)(nil), "google.devtools.remoteexecution.v1test.ExecuteOperationMetadata") + proto.RegisterType((*GetActionResultRequest)(nil), "google.devtools.remoteexecution.v1test.GetActionResultRequest") + proto.RegisterType((*UpdateActionResultRequest)(nil), "google.devtools.remoteexecution.v1test.UpdateActionResultRequest") + proto.RegisterType((*FindMissingBlobsRequest)(nil), "google.devtools.remoteexecution.v1test.FindMissingBlobsRequest") + proto.RegisterType((*FindMissingBlobsResponse)(nil), "google.devtools.remoteexecution.v1test.FindMissingBlobsResponse") + proto.RegisterType((*UpdateBlobRequest)(nil), "google.devtools.remoteexecution.v1test.UpdateBlobRequest") + proto.RegisterType((*BatchUpdateBlobsRequest)(nil), "google.devtools.remoteexecution.v1test.BatchUpdateBlobsRequest") + proto.RegisterType((*BatchUpdateBlobsResponse)(nil), "google.devtools.remoteexecution.v1test.BatchUpdateBlobsResponse") + proto.RegisterType((*BatchUpdateBlobsResponse_Response)(nil), "google.devtools.remoteexecution.v1test.BatchUpdateBlobsResponse.Response") + proto.RegisterType((*GetTreeRequest)(nil), "google.devtools.remoteexecution.v1test.GetTreeRequest") + proto.RegisterType((*GetTreeResponse)(nil), "google.devtools.remoteexecution.v1test.GetTreeResponse") + proto.RegisterType((*ToolDetails)(nil), "google.devtools.remoteexecution.v1test.ToolDetails") + proto.RegisterType((*RequestMetadata)(nil), "google.devtools.remoteexecution.v1test.RequestMetadata") + proto.RegisterEnum("google.devtools.remoteexecution.v1test.ExecuteOperationMetadata_Stage", ExecuteOperationMetadata_Stage_name, ExecuteOperationMetadata_Stage_value) +} + +// 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 + +// Client API for Execution service + +type ExecutionClient interface { + // Execute an action remotely. + // + // In order to execute an action, the client must first upload all of the + // inputs, as well as the + // [Command][google.devtools.remoteexecution.v1test.Command] to run, into the + // [ContentAddressableStorage][google.devtools.remoteexecution.v1test.ContentAddressableStorage]. + // It then calls `Execute` with an + // [Action][google.devtools.remoteexecution.v1test.Action] referring to them. + // The server will run the action and eventually return the result. + // + // The input `Action`'s fields MUST meet the various canonicalization + // requirements specified in the documentation for their types so that it has + // the same digest as other logically equivalent `Action`s. The server MAY + // enforce the requirements and return errors if a non-canonical input is + // received. It MAY also proceed without verifying some or all of the + // requirements, such as for performance reasons. If the server does not + // verify the requirement, then it will treat the `Action` as distinct from + // another logically equivalent action if they hash differently. + // + // Returns a [google.longrunning.Operation][google.longrunning.Operation] + // describing the resulting execution, with eventual `response` + // [ExecuteResponse][google.devtools.remoteexecution.v1test.ExecuteResponse]. + // The `metadata` on the operation is of type + // [ExecuteOperationMetadata][google.devtools.remoteexecution.v1test.ExecuteOperationMetadata]. + // + // To query the operation, you can use the + // [Operations API][google.longrunning.Operations.GetOperation]. If you wish + // to allow the server to stream operations updates, rather than requiring + // client polling, you can use the + // [Watcher API][google.watcher.v1.Watcher.Watch] with the Operation's `name` + // as the `target`. + // + // When using the Watcher API, the initial `data` will be the `Operation` at + // the time of the request. Updates will be provided periodically by the + // server until the `Operation` completes, at which point the response message + // will (assuming no error) be at `data.response`. + // + // The server NEED NOT implement other methods or functionality of the + // Operation and Watcher APIs. + // + // Errors discovered during creation of the `Operation` will be reported + // as gRPC Status errors, while errors that occurred while running the + // action will be reported in the `status` field of the `ExecuteResponse`. The + // server MUST NOT set the `error` field of the `Operation` proto. + // The possible errors include: + // * `INVALID_ARGUMENT`: One or more arguments are invalid. + // * `FAILED_PRECONDITION`: One or more errors occurred in setting up the + // action requested, such as a missing input or command or no worker being + // available. The client may be able to fix the errors and retry. + // * `RESOURCE_EXHAUSTED`: There is insufficient quota of some resource to run + // the action. + // * `UNAVAILABLE`: Due to a transient condition, such as all workers being + // occupied (and the server does not support a queue), the action could not + // be started. The client should retry. + // * `INTERNAL`: An internal error occurred in the execution engine or the + // worker. + // * `DEADLINE_EXCEEDED`: The execution timed out. + // + // In the case of a missing input or command, the server SHOULD additionally + // send a [PreconditionFailure][google.rpc.PreconditionFailure] error detail + // where, for each requested blob not present in the CAS, there is a + // `Violation` with a `type` of `MISSING` and a `subject` of + // `"blobs/{hash}/{size}"` indicating the digest of the missing blob. + Execute(ctx context.Context, in *ExecuteRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) +} + +type executionClient struct { + cc *grpc.ClientConn +} + +func NewExecutionClient(cc *grpc.ClientConn) ExecutionClient { + return &executionClient{cc} +} + +func (c *executionClient) Execute(ctx context.Context, in *ExecuteRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.devtools.remoteexecution.v1test.Execution/Execute", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for Execution service + +type ExecutionServer interface { + // Execute an action remotely. + // + // In order to execute an action, the client must first upload all of the + // inputs, as well as the + // [Command][google.devtools.remoteexecution.v1test.Command] to run, into the + // [ContentAddressableStorage][google.devtools.remoteexecution.v1test.ContentAddressableStorage]. + // It then calls `Execute` with an + // [Action][google.devtools.remoteexecution.v1test.Action] referring to them. + // The server will run the action and eventually return the result. + // + // The input `Action`'s fields MUST meet the various canonicalization + // requirements specified in the documentation for their types so that it has + // the same digest as other logically equivalent `Action`s. The server MAY + // enforce the requirements and return errors if a non-canonical input is + // received. It MAY also proceed without verifying some or all of the + // requirements, such as for performance reasons. If the server does not + // verify the requirement, then it will treat the `Action` as distinct from + // another logically equivalent action if they hash differently. + // + // Returns a [google.longrunning.Operation][google.longrunning.Operation] + // describing the resulting execution, with eventual `response` + // [ExecuteResponse][google.devtools.remoteexecution.v1test.ExecuteResponse]. + // The `metadata` on the operation is of type + // [ExecuteOperationMetadata][google.devtools.remoteexecution.v1test.ExecuteOperationMetadata]. + // + // To query the operation, you can use the + // [Operations API][google.longrunning.Operations.GetOperation]. If you wish + // to allow the server to stream operations updates, rather than requiring + // client polling, you can use the + // [Watcher API][google.watcher.v1.Watcher.Watch] with the Operation's `name` + // as the `target`. + // + // When using the Watcher API, the initial `data` will be the `Operation` at + // the time of the request. Updates will be provided periodically by the + // server until the `Operation` completes, at which point the response message + // will (assuming no error) be at `data.response`. + // + // The server NEED NOT implement other methods or functionality of the + // Operation and Watcher APIs. + // + // Errors discovered during creation of the `Operation` will be reported + // as gRPC Status errors, while errors that occurred while running the + // action will be reported in the `status` field of the `ExecuteResponse`. The + // server MUST NOT set the `error` field of the `Operation` proto. + // The possible errors include: + // * `INVALID_ARGUMENT`: One or more arguments are invalid. + // * `FAILED_PRECONDITION`: One or more errors occurred in setting up the + // action requested, such as a missing input or command or no worker being + // available. The client may be able to fix the errors and retry. + // * `RESOURCE_EXHAUSTED`: There is insufficient quota of some resource to run + // the action. + // * `UNAVAILABLE`: Due to a transient condition, such as all workers being + // occupied (and the server does not support a queue), the action could not + // be started. The client should retry. + // * `INTERNAL`: An internal error occurred in the execution engine or the + // worker. + // * `DEADLINE_EXCEEDED`: The execution timed out. + // + // In the case of a missing input or command, the server SHOULD additionally + // send a [PreconditionFailure][google.rpc.PreconditionFailure] error detail + // where, for each requested blob not present in the CAS, there is a + // `Violation` with a `type` of `MISSING` and a `subject` of + // `"blobs/{hash}/{size}"` indicating the digest of the missing blob. + Execute(context.Context, *ExecuteRequest) (*google_longrunning.Operation, error) +} + +func RegisterExecutionServer(s *grpc.Server, srv ExecutionServer) { + s.RegisterService(&_Execution_serviceDesc, srv) +} + +func _Execution_Execute_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ExecuteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ExecutionServer).Execute(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.remoteexecution.v1test.Execution/Execute", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ExecutionServer).Execute(ctx, req.(*ExecuteRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Execution_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.devtools.remoteexecution.v1test.Execution", + HandlerType: (*ExecutionServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Execute", + Handler: _Execution_Execute_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/devtools/remoteexecution/v1test/remote_execution.proto", +} + +// Client API for ActionCache service + +type ActionCacheClient interface { + // Retrieve a cached execution result. + // + // Errors: + // * `NOT_FOUND`: The requested `ActionResult` is not in the cache. + GetActionResult(ctx context.Context, in *GetActionResultRequest, opts ...grpc.CallOption) (*ActionResult, error) + // Upload a new execution result. + // + // This method is intended for servers which implement the distributed cache + // independently of the + // [Execution][google.devtools.remoteexecution.v1test.Execution] API. As a + // result, it is OPTIONAL for servers to implement. + // + // Errors: + // * `NOT_IMPLEMENTED`: This method is not supported by the server. + // * `RESOURCE_EXHAUSTED`: There is insufficient storage space to add the + // entry to the cache. + UpdateActionResult(ctx context.Context, in *UpdateActionResultRequest, opts ...grpc.CallOption) (*ActionResult, error) +} + +type actionCacheClient struct { + cc *grpc.ClientConn +} + +func NewActionCacheClient(cc *grpc.ClientConn) ActionCacheClient { + return &actionCacheClient{cc} +} + +func (c *actionCacheClient) GetActionResult(ctx context.Context, in *GetActionResultRequest, opts ...grpc.CallOption) (*ActionResult, error) { + out := new(ActionResult) + err := grpc.Invoke(ctx, "/google.devtools.remoteexecution.v1test.ActionCache/GetActionResult", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *actionCacheClient) UpdateActionResult(ctx context.Context, in *UpdateActionResultRequest, opts ...grpc.CallOption) (*ActionResult, error) { + out := new(ActionResult) + err := grpc.Invoke(ctx, "/google.devtools.remoteexecution.v1test.ActionCache/UpdateActionResult", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for ActionCache service + +type ActionCacheServer interface { + // Retrieve a cached execution result. + // + // Errors: + // * `NOT_FOUND`: The requested `ActionResult` is not in the cache. + GetActionResult(context.Context, *GetActionResultRequest) (*ActionResult, error) + // Upload a new execution result. + // + // This method is intended for servers which implement the distributed cache + // independently of the + // [Execution][google.devtools.remoteexecution.v1test.Execution] API. As a + // result, it is OPTIONAL for servers to implement. + // + // Errors: + // * `NOT_IMPLEMENTED`: This method is not supported by the server. + // * `RESOURCE_EXHAUSTED`: There is insufficient storage space to add the + // entry to the cache. + UpdateActionResult(context.Context, *UpdateActionResultRequest) (*ActionResult, error) +} + +func RegisterActionCacheServer(s *grpc.Server, srv ActionCacheServer) { + s.RegisterService(&_ActionCache_serviceDesc, srv) +} + +func _ActionCache_GetActionResult_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetActionResultRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ActionCacheServer).GetActionResult(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.remoteexecution.v1test.ActionCache/GetActionResult", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ActionCacheServer).GetActionResult(ctx, req.(*GetActionResultRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ActionCache_UpdateActionResult_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateActionResultRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ActionCacheServer).UpdateActionResult(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.remoteexecution.v1test.ActionCache/UpdateActionResult", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ActionCacheServer).UpdateActionResult(ctx, req.(*UpdateActionResultRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _ActionCache_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.devtools.remoteexecution.v1test.ActionCache", + HandlerType: (*ActionCacheServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetActionResult", + Handler: _ActionCache_GetActionResult_Handler, + }, + { + MethodName: "UpdateActionResult", + Handler: _ActionCache_UpdateActionResult_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/devtools/remoteexecution/v1test/remote_execution.proto", +} + +// Client API for ContentAddressableStorage service + +type ContentAddressableStorageClient interface { + // Determine if blobs are present in the CAS. + // + // Clients can use this API before uploading blobs to determine which ones are + // already present in the CAS and do not need to be uploaded again. + // + // There are no method-specific errors. + FindMissingBlobs(ctx context.Context, in *FindMissingBlobsRequest, opts ...grpc.CallOption) (*FindMissingBlobsResponse, error) + // Upload many blobs at once. + // + // The client MUST NOT upload blobs with a combined total size of more than 10 + // MiB using this API. Such requests should either be split into smaller + // chunks or uploaded using the + // [ByteStream API][google.bytestream.ByteStream], as appropriate. + // + // This request is equivalent to calling [UpdateBlob][] on each individual + // blob, in parallel. The requests may succeed or fail independently. + // + // Errors: + // * `INVALID_ARGUMENT`: The client attempted to upload more than 10 MiB of + // data. + // + // Individual requests may return the following errors, additionally: + // * `RESOURCE_EXHAUSTED`: There is insufficient disk quota to store the blob. + // * `INVALID_ARGUMENT`: The + // [Digest][google.devtools.remoteexecution.v1test.Digest] does not match the + // provided data. + BatchUpdateBlobs(ctx context.Context, in *BatchUpdateBlobsRequest, opts ...grpc.CallOption) (*BatchUpdateBlobsResponse, error) + // DEPRECATED: This method is deprecated and should no longer be used. + GetTree(ctx context.Context, in *GetTreeRequest, opts ...grpc.CallOption) (*GetTreeResponse, error) +} + +type contentAddressableStorageClient struct { + cc *grpc.ClientConn +} + +func NewContentAddressableStorageClient(cc *grpc.ClientConn) ContentAddressableStorageClient { + return &contentAddressableStorageClient{cc} +} + +func (c *contentAddressableStorageClient) FindMissingBlobs(ctx context.Context, in *FindMissingBlobsRequest, opts ...grpc.CallOption) (*FindMissingBlobsResponse, error) { + out := new(FindMissingBlobsResponse) + err := grpc.Invoke(ctx, "/google.devtools.remoteexecution.v1test.ContentAddressableStorage/FindMissingBlobs", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *contentAddressableStorageClient) BatchUpdateBlobs(ctx context.Context, in *BatchUpdateBlobsRequest, opts ...grpc.CallOption) (*BatchUpdateBlobsResponse, error) { + out := new(BatchUpdateBlobsResponse) + err := grpc.Invoke(ctx, "/google.devtools.remoteexecution.v1test.ContentAddressableStorage/BatchUpdateBlobs", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *contentAddressableStorageClient) GetTree(ctx context.Context, in *GetTreeRequest, opts ...grpc.CallOption) (*GetTreeResponse, error) { + out := new(GetTreeResponse) + err := grpc.Invoke(ctx, "/google.devtools.remoteexecution.v1test.ContentAddressableStorage/GetTree", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for ContentAddressableStorage service + +type ContentAddressableStorageServer interface { + // Determine if blobs are present in the CAS. + // + // Clients can use this API before uploading blobs to determine which ones are + // already present in the CAS and do not need to be uploaded again. + // + // There are no method-specific errors. + FindMissingBlobs(context.Context, *FindMissingBlobsRequest) (*FindMissingBlobsResponse, error) + // Upload many blobs at once. + // + // The client MUST NOT upload blobs with a combined total size of more than 10 + // MiB using this API. Such requests should either be split into smaller + // chunks or uploaded using the + // [ByteStream API][google.bytestream.ByteStream], as appropriate. + // + // This request is equivalent to calling [UpdateBlob][] on each individual + // blob, in parallel. The requests may succeed or fail independently. + // + // Errors: + // * `INVALID_ARGUMENT`: The client attempted to upload more than 10 MiB of + // data. + // + // Individual requests may return the following errors, additionally: + // * `RESOURCE_EXHAUSTED`: There is insufficient disk quota to store the blob. + // * `INVALID_ARGUMENT`: The + // [Digest][google.devtools.remoteexecution.v1test.Digest] does not match the + // provided data. + BatchUpdateBlobs(context.Context, *BatchUpdateBlobsRequest) (*BatchUpdateBlobsResponse, error) + // DEPRECATED: This method is deprecated and should no longer be used. + GetTree(context.Context, *GetTreeRequest) (*GetTreeResponse, error) +} + +func RegisterContentAddressableStorageServer(s *grpc.Server, srv ContentAddressableStorageServer) { + s.RegisterService(&_ContentAddressableStorage_serviceDesc, srv) +} + +func _ContentAddressableStorage_FindMissingBlobs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FindMissingBlobsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContentAddressableStorageServer).FindMissingBlobs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.remoteexecution.v1test.ContentAddressableStorage/FindMissingBlobs", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContentAddressableStorageServer).FindMissingBlobs(ctx, req.(*FindMissingBlobsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ContentAddressableStorage_BatchUpdateBlobs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BatchUpdateBlobsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContentAddressableStorageServer).BatchUpdateBlobs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.remoteexecution.v1test.ContentAddressableStorage/BatchUpdateBlobs", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContentAddressableStorageServer).BatchUpdateBlobs(ctx, req.(*BatchUpdateBlobsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ContentAddressableStorage_GetTree_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetTreeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContentAddressableStorageServer).GetTree(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.remoteexecution.v1test.ContentAddressableStorage/GetTree", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContentAddressableStorageServer).GetTree(ctx, req.(*GetTreeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _ContentAddressableStorage_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.devtools.remoteexecution.v1test.ContentAddressableStorage", + HandlerType: (*ContentAddressableStorageServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "FindMissingBlobs", + Handler: _ContentAddressableStorage_FindMissingBlobs_Handler, + }, + { + MethodName: "BatchUpdateBlobs", + Handler: _ContentAddressableStorage_BatchUpdateBlobs_Handler, + }, + { + MethodName: "GetTree", + Handler: _ContentAddressableStorage_GetTree_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/devtools/remoteexecution/v1test/remote_execution.proto", +} + +func init() { + proto.RegisterFile("google/devtools/remoteexecution/v1test/remote_execution.proto", fileDescriptor0) +} + +var fileDescriptor0 = []byte{ + // 2025 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x59, 0xdd, 0x6f, 0x23, 0x57, + 0x15, 0x67, 0xec, 0x24, 0xb6, 0x8f, 0x9d, 0x75, 0xf6, 0x76, 0xe9, 0x7a, 0xdd, 0x2e, 0x4a, 0xa7, + 0xa2, 0x8a, 0xa2, 0x62, 0xb3, 0xde, 0x96, 0x85, 0x54, 0xa5, 0x6c, 0x1c, 0x27, 0x8d, 0x9a, 0xaf, + 0x4e, 0xe2, 0x74, 0xbb, 0xaa, 0x34, 0x9d, 0x78, 0x6e, 0xc6, 0xa3, 0xd8, 0x73, 0xcd, 0xbd, 0xd7, + 0x69, 0xd2, 0x65, 0x79, 0xe0, 0x05, 0x09, 0x04, 0x12, 0x54, 0x08, 0x24, 0x78, 0x42, 0x42, 0x48, + 0x88, 0x27, 0xfe, 0x00, 0x24, 0xf8, 0x03, 0x78, 0x80, 0x17, 0x9e, 0x11, 0x2f, 0xbc, 0xf1, 0xdc, + 0x07, 0x84, 0xee, 0xc7, 0x7c, 0xd8, 0xc9, 0xb2, 0x63, 0x67, 0x57, 0xe2, 0xcd, 0x73, 0xce, 0x3d, + 0xbf, 0xf3, 0x79, 0xcf, 0x39, 0x33, 0x86, 0xb7, 0x3d, 0x42, 0xbc, 0x1e, 0xae, 0xbb, 0xf8, 0x94, + 0x13, 0xd2, 0x63, 0x75, 0x8a, 0xfb, 0x84, 0x63, 0x7c, 0x86, 0x3b, 0x43, 0xee, 0x93, 0xa0, 0x7e, + 0x7a, 0x87, 0x63, 0xc6, 0x35, 0xd9, 0x8e, 0xe8, 0xb5, 0x01, 0x25, 0x9c, 0xa0, 0xd7, 0x94, 0x78, + 0x2d, 0x14, 0xaf, 0x8d, 0x89, 0xd7, 0x94, 0x78, 0xf5, 0x65, 0xad, 0xc6, 0x19, 0xf8, 0x75, 0x27, + 0x08, 0x08, 0x77, 0x04, 0x97, 0x29, 0x94, 0xea, 0xab, 0x9a, 0xdb, 0x23, 0x81, 0x47, 0x87, 0x41, + 0xe0, 0x07, 0x5e, 0x9d, 0x0c, 0x30, 0x1d, 0x39, 0xf4, 0x25, 0x7d, 0x48, 0x3e, 0x1d, 0x0d, 0x8f, + 0xeb, 0xee, 0x50, 0x1d, 0xd0, 0xfc, 0x9b, 0x9a, 0x4f, 0x07, 0x9d, 0x3a, 0xe3, 0x0e, 0x1f, 0x6a, + 0x41, 0xf3, 0x0f, 0x59, 0x98, 0xbb, 0xdf, 0x11, 0x27, 0x51, 0x1b, 0xae, 0x75, 0x48, 0xbf, 0xef, + 0x04, 0xae, 0xed, 0xfa, 0x1e, 0x66, 0xbc, 0x62, 0x2c, 0x1a, 0x4b, 0xc5, 0x46, 0xad, 0x96, 0xce, + 0x8f, 0xda, 0x9a, 0x94, 0xb2, 0xe6, 0x35, 0x8a, 0x7a, 0x44, 0x0f, 0xe1, 0xba, 0x1f, 0x0c, 0x86, + 0xdc, 0xa6, 0x84, 0xf0, 0x10, 0x39, 0x33, 0x15, 0x72, 0x59, 0x02, 0x59, 0x84, 0x70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 0x49, 0x52, 0xb2, 0x42, 0x3d, 0xa5, 0x65, + 0xf5, 0x4f, 0x06, 0x2c, 0x77, 0x48, 0x3f, 0xa5, 0x71, 0xab, 0x37, 0x2c, 0x49, 0x8f, 0x3a, 0xee, + 0x1e, 0x25, 0x9c, 0xec, 0x19, 0x0f, 0xdb, 0x5a, 0xde, 0x23, 0x3d, 0x27, 0xf0, 0x6a, 0x84, 0x7a, + 0x75, 0x0f, 0x07, 0xf2, 0x6f, 0x91, 0xba, 0x62, 0x39, 0x03, 0x9f, 0x3d, 0xed, 0xaf, 0xb7, 0xb7, + 0xc6, 0xc8, 0xbf, 0xce, 0x64, 0xad, 0xd6, 0x83, 0xdf, 0x65, 0x6e, 0x6f, 0x28, 0xf4, 0x31, 0xe5, + 0xb5, 0xc3, 0x3b, 0x07, 0x98, 0xf1, 0xa3, 0x39, 0xa9, 0xe7, 0xee, 0x7f, 0x03, 0x00, 0x00, 0xff, + 0xff, 0xf0, 0x8a, 0x2f, 0x43, 0xe1, 0x1b, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/devtools/source/v1/source_context.pb.go b/vendor/google.golang.org/genproto/googleapis/devtools/source/v1/source_context.pb.go new file mode 100644 index 0000000000..e67b5c20e1 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/devtools/source/v1/source_context.pb.go @@ -0,0 +1,945 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/devtools/source/v1/source_context.proto + +/* +Package source is a generated protocol buffer package. + +It is generated from these files: + google/devtools/source/v1/source_context.proto + +It has these top-level messages: + SourceContext + ExtendedSourceContext + AliasContext + CloudRepoSourceContext + CloudWorkspaceSourceContext + GerritSourceContext + GitSourceContext + RepoId + ProjectRepoId + CloudWorkspaceId +*/ +package source + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// The type of an Alias. +type AliasContext_Kind int32 + +const ( + // Do not use. + AliasContext_ANY AliasContext_Kind = 0 + // Git tag + AliasContext_FIXED AliasContext_Kind = 1 + // Git branch + AliasContext_MOVABLE AliasContext_Kind = 2 + // OTHER is used to specify non-standard aliases, those not of the kinds + // above. For example, if a Git repo has a ref named "refs/foo/bar", it + // is considered to be of kind OTHER. + AliasContext_OTHER AliasContext_Kind = 4 +) + +var AliasContext_Kind_name = map[int32]string{ + 0: "ANY", + 1: "FIXED", + 2: "MOVABLE", + 4: "OTHER", +} +var AliasContext_Kind_value = map[string]int32{ + "ANY": 0, + "FIXED": 1, + "MOVABLE": 2, + "OTHER": 4, +} + +func (x AliasContext_Kind) String() string { + return proto.EnumName(AliasContext_Kind_name, int32(x)) +} +func (AliasContext_Kind) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{2, 0} } + +// A SourceContext is a reference to a tree of files. A SourceContext together +// with a path point to a unique revision of a single file or directory. +type SourceContext struct { + // A SourceContext can refer any one of the following types of repositories. + // + // Types that are valid to be assigned to Context: + // *SourceContext_CloudRepo + // *SourceContext_CloudWorkspace + // *SourceContext_Gerrit + // *SourceContext_Git + Context isSourceContext_Context `protobuf_oneof:"context"` +} + +func (m *SourceContext) Reset() { *m = SourceContext{} } +func (m *SourceContext) String() string { return proto.CompactTextString(m) } +func (*SourceContext) ProtoMessage() {} +func (*SourceContext) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +type isSourceContext_Context interface { + isSourceContext_Context() +} + +type SourceContext_CloudRepo struct { + CloudRepo *CloudRepoSourceContext `protobuf:"bytes,1,opt,name=cloud_repo,json=cloudRepo,oneof"` +} +type SourceContext_CloudWorkspace struct { + CloudWorkspace *CloudWorkspaceSourceContext `protobuf:"bytes,2,opt,name=cloud_workspace,json=cloudWorkspace,oneof"` +} +type SourceContext_Gerrit struct { + Gerrit *GerritSourceContext `protobuf:"bytes,3,opt,name=gerrit,oneof"` +} +type SourceContext_Git struct { + Git *GitSourceContext `protobuf:"bytes,6,opt,name=git,oneof"` +} + +func (*SourceContext_CloudRepo) isSourceContext_Context() {} +func (*SourceContext_CloudWorkspace) isSourceContext_Context() {} +func (*SourceContext_Gerrit) isSourceContext_Context() {} +func (*SourceContext_Git) isSourceContext_Context() {} + +func (m *SourceContext) GetContext() isSourceContext_Context { + if m != nil { + return m.Context + } + return nil +} + +func (m *SourceContext) GetCloudRepo() *CloudRepoSourceContext { + if x, ok := m.GetContext().(*SourceContext_CloudRepo); ok { + return x.CloudRepo + } + return nil +} + +func (m *SourceContext) GetCloudWorkspace() *CloudWorkspaceSourceContext { + if x, ok := m.GetContext().(*SourceContext_CloudWorkspace); ok { + return x.CloudWorkspace + } + return nil +} + +func (m *SourceContext) GetGerrit() *GerritSourceContext { + if x, ok := m.GetContext().(*SourceContext_Gerrit); ok { + return x.Gerrit + } + return nil +} + +func (m *SourceContext) GetGit() *GitSourceContext { + if x, ok := m.GetContext().(*SourceContext_Git); ok { + return x.Git + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*SourceContext) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _SourceContext_OneofMarshaler, _SourceContext_OneofUnmarshaler, _SourceContext_OneofSizer, []interface{}{ + (*SourceContext_CloudRepo)(nil), + (*SourceContext_CloudWorkspace)(nil), + (*SourceContext_Gerrit)(nil), + (*SourceContext_Git)(nil), + } +} + +func _SourceContext_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*SourceContext) + // context + switch x := m.Context.(type) { + case *SourceContext_CloudRepo: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.CloudRepo); err != nil { + return err + } + case *SourceContext_CloudWorkspace: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.CloudWorkspace); err != nil { + return err + } + case *SourceContext_Gerrit: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Gerrit); err != nil { + return err + } + case *SourceContext_Git: + b.EncodeVarint(6<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Git); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("SourceContext.Context has unexpected type %T", x) + } + return nil +} + +func _SourceContext_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*SourceContext) + switch tag { + case 1: // context.cloud_repo + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(CloudRepoSourceContext) + err := b.DecodeMessage(msg) + m.Context = &SourceContext_CloudRepo{msg} + return true, err + case 2: // context.cloud_workspace + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(CloudWorkspaceSourceContext) + err := b.DecodeMessage(msg) + m.Context = &SourceContext_CloudWorkspace{msg} + return true, err + case 3: // context.gerrit + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(GerritSourceContext) + err := b.DecodeMessage(msg) + m.Context = &SourceContext_Gerrit{msg} + return true, err + case 6: // context.git + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(GitSourceContext) + err := b.DecodeMessage(msg) + m.Context = &SourceContext_Git{msg} + return true, err + default: + return false, nil + } +} + +func _SourceContext_OneofSizer(msg proto.Message) (n int) { + m := msg.(*SourceContext) + // context + switch x := m.Context.(type) { + case *SourceContext_CloudRepo: + s := proto.Size(x.CloudRepo) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *SourceContext_CloudWorkspace: + s := proto.Size(x.CloudWorkspace) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *SourceContext_Gerrit: + s := proto.Size(x.Gerrit) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *SourceContext_Git: + s := proto.Size(x.Git) + n += proto.SizeVarint(6<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// An ExtendedSourceContext is a SourceContext combined with additional +// details describing the context. +type ExtendedSourceContext struct { + // Any source context. + Context *SourceContext `protobuf:"bytes,1,opt,name=context" json:"context,omitempty"` + // Labels with user defined metadata. + Labels map[string]string `protobuf:"bytes,2,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *ExtendedSourceContext) Reset() { *m = ExtendedSourceContext{} } +func (m *ExtendedSourceContext) String() string { return proto.CompactTextString(m) } +func (*ExtendedSourceContext) ProtoMessage() {} +func (*ExtendedSourceContext) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *ExtendedSourceContext) GetContext() *SourceContext { + if m != nil { + return m.Context + } + return nil +} + +func (m *ExtendedSourceContext) GetLabels() map[string]string { + if m != nil { + return m.Labels + } + return nil +} + +// An alias to a repo revision. +type AliasContext struct { + // The alias kind. + Kind AliasContext_Kind `protobuf:"varint,1,opt,name=kind,enum=google.devtools.source.v1.AliasContext_Kind" json:"kind,omitempty"` + // The alias name. + Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` +} + +func (m *AliasContext) Reset() { *m = AliasContext{} } +func (m *AliasContext) String() string { return proto.CompactTextString(m) } +func (*AliasContext) ProtoMessage() {} +func (*AliasContext) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *AliasContext) GetKind() AliasContext_Kind { + if m != nil { + return m.Kind + } + return AliasContext_ANY +} + +func (m *AliasContext) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// A CloudRepoSourceContext denotes a particular revision in a cloud +// repo (a repo hosted by the Google Cloud Platform). +type CloudRepoSourceContext struct { + // The ID of the repo. + RepoId *RepoId `protobuf:"bytes,1,opt,name=repo_id,json=repoId" json:"repo_id,omitempty"` + // A revision in a cloud repository can be identified by either its revision + // ID or its Alias. + // + // Types that are valid to be assigned to Revision: + // *CloudRepoSourceContext_RevisionId + // *CloudRepoSourceContext_AliasName + // *CloudRepoSourceContext_AliasContext + Revision isCloudRepoSourceContext_Revision `protobuf_oneof:"revision"` +} + +func (m *CloudRepoSourceContext) Reset() { *m = CloudRepoSourceContext{} } +func (m *CloudRepoSourceContext) String() string { return proto.CompactTextString(m) } +func (*CloudRepoSourceContext) ProtoMessage() {} +func (*CloudRepoSourceContext) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +type isCloudRepoSourceContext_Revision interface { + isCloudRepoSourceContext_Revision() +} + +type CloudRepoSourceContext_RevisionId struct { + RevisionId string `protobuf:"bytes,2,opt,name=revision_id,json=revisionId,oneof"` +} +type CloudRepoSourceContext_AliasName struct { + AliasName string `protobuf:"bytes,3,opt,name=alias_name,json=aliasName,oneof"` +} +type CloudRepoSourceContext_AliasContext struct { + AliasContext *AliasContext `protobuf:"bytes,4,opt,name=alias_context,json=aliasContext,oneof"` +} + +func (*CloudRepoSourceContext_RevisionId) isCloudRepoSourceContext_Revision() {} +func (*CloudRepoSourceContext_AliasName) isCloudRepoSourceContext_Revision() {} +func (*CloudRepoSourceContext_AliasContext) isCloudRepoSourceContext_Revision() {} + +func (m *CloudRepoSourceContext) GetRevision() isCloudRepoSourceContext_Revision { + if m != nil { + return m.Revision + } + return nil +} + +func (m *CloudRepoSourceContext) GetRepoId() *RepoId { + if m != nil { + return m.RepoId + } + return nil +} + +func (m *CloudRepoSourceContext) GetRevisionId() string { + if x, ok := m.GetRevision().(*CloudRepoSourceContext_RevisionId); ok { + return x.RevisionId + } + return "" +} + +func (m *CloudRepoSourceContext) GetAliasName() string { + if x, ok := m.GetRevision().(*CloudRepoSourceContext_AliasName); ok { + return x.AliasName + } + return "" +} + +func (m *CloudRepoSourceContext) GetAliasContext() *AliasContext { + if x, ok := m.GetRevision().(*CloudRepoSourceContext_AliasContext); ok { + return x.AliasContext + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*CloudRepoSourceContext) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _CloudRepoSourceContext_OneofMarshaler, _CloudRepoSourceContext_OneofUnmarshaler, _CloudRepoSourceContext_OneofSizer, []interface{}{ + (*CloudRepoSourceContext_RevisionId)(nil), + (*CloudRepoSourceContext_AliasName)(nil), + (*CloudRepoSourceContext_AliasContext)(nil), + } +} + +func _CloudRepoSourceContext_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*CloudRepoSourceContext) + // revision + switch x := m.Revision.(type) { + case *CloudRepoSourceContext_RevisionId: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeStringBytes(x.RevisionId) + case *CloudRepoSourceContext_AliasName: + b.EncodeVarint(3<<3 | proto.WireBytes) + b.EncodeStringBytes(x.AliasName) + case *CloudRepoSourceContext_AliasContext: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.AliasContext); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("CloudRepoSourceContext.Revision has unexpected type %T", x) + } + return nil +} + +func _CloudRepoSourceContext_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*CloudRepoSourceContext) + switch tag { + case 2: // revision.revision_id + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Revision = &CloudRepoSourceContext_RevisionId{x} + return true, err + case 3: // revision.alias_name + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Revision = &CloudRepoSourceContext_AliasName{x} + return true, err + case 4: // revision.alias_context + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(AliasContext) + err := b.DecodeMessage(msg) + m.Revision = &CloudRepoSourceContext_AliasContext{msg} + return true, err + default: + return false, nil + } +} + +func _CloudRepoSourceContext_OneofSizer(msg proto.Message) (n int) { + m := msg.(*CloudRepoSourceContext) + // revision + switch x := m.Revision.(type) { + case *CloudRepoSourceContext_RevisionId: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.RevisionId))) + n += len(x.RevisionId) + case *CloudRepoSourceContext_AliasName: + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.AliasName))) + n += len(x.AliasName) + case *CloudRepoSourceContext_AliasContext: + s := proto.Size(x.AliasContext) + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// A CloudWorkspaceSourceContext denotes a workspace at a particular snapshot. +type CloudWorkspaceSourceContext struct { + // The ID of the workspace. + WorkspaceId *CloudWorkspaceId `protobuf:"bytes,1,opt,name=workspace_id,json=workspaceId" json:"workspace_id,omitempty"` + // The ID of the snapshot. + // An empty snapshot_id refers to the most recent snapshot. + SnapshotId string `protobuf:"bytes,2,opt,name=snapshot_id,json=snapshotId" json:"snapshot_id,omitempty"` +} + +func (m *CloudWorkspaceSourceContext) Reset() { *m = CloudWorkspaceSourceContext{} } +func (m *CloudWorkspaceSourceContext) String() string { return proto.CompactTextString(m) } +func (*CloudWorkspaceSourceContext) ProtoMessage() {} +func (*CloudWorkspaceSourceContext) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *CloudWorkspaceSourceContext) GetWorkspaceId() *CloudWorkspaceId { + if m != nil { + return m.WorkspaceId + } + return nil +} + +func (m *CloudWorkspaceSourceContext) GetSnapshotId() string { + if m != nil { + return m.SnapshotId + } + return "" +} + +// A SourceContext referring to a Gerrit project. +type GerritSourceContext struct { + // The URI of a running Gerrit instance. + HostUri string `protobuf:"bytes,1,opt,name=host_uri,json=hostUri" json:"host_uri,omitempty"` + // The full project name within the host. Projects may be nested, so + // "project/subproject" is a valid project name. + // The "repo name" is hostURI/project. + GerritProject string `protobuf:"bytes,2,opt,name=gerrit_project,json=gerritProject" json:"gerrit_project,omitempty"` + // A revision in a Gerrit project can be identified by either its revision ID + // or its alias. + // + // Types that are valid to be assigned to Revision: + // *GerritSourceContext_RevisionId + // *GerritSourceContext_AliasName + // *GerritSourceContext_AliasContext + Revision isGerritSourceContext_Revision `protobuf_oneof:"revision"` +} + +func (m *GerritSourceContext) Reset() { *m = GerritSourceContext{} } +func (m *GerritSourceContext) String() string { return proto.CompactTextString(m) } +func (*GerritSourceContext) ProtoMessage() {} +func (*GerritSourceContext) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +type isGerritSourceContext_Revision interface { + isGerritSourceContext_Revision() +} + +type GerritSourceContext_RevisionId struct { + RevisionId string `protobuf:"bytes,3,opt,name=revision_id,json=revisionId,oneof"` +} +type GerritSourceContext_AliasName struct { + AliasName string `protobuf:"bytes,4,opt,name=alias_name,json=aliasName,oneof"` +} +type GerritSourceContext_AliasContext struct { + AliasContext *AliasContext `protobuf:"bytes,5,opt,name=alias_context,json=aliasContext,oneof"` +} + +func (*GerritSourceContext_RevisionId) isGerritSourceContext_Revision() {} +func (*GerritSourceContext_AliasName) isGerritSourceContext_Revision() {} +func (*GerritSourceContext_AliasContext) isGerritSourceContext_Revision() {} + +func (m *GerritSourceContext) GetRevision() isGerritSourceContext_Revision { + if m != nil { + return m.Revision + } + return nil +} + +func (m *GerritSourceContext) GetHostUri() string { + if m != nil { + return m.HostUri + } + return "" +} + +func (m *GerritSourceContext) GetGerritProject() string { + if m != nil { + return m.GerritProject + } + return "" +} + +func (m *GerritSourceContext) GetRevisionId() string { + if x, ok := m.GetRevision().(*GerritSourceContext_RevisionId); ok { + return x.RevisionId + } + return "" +} + +func (m *GerritSourceContext) GetAliasName() string { + if x, ok := m.GetRevision().(*GerritSourceContext_AliasName); ok { + return x.AliasName + } + return "" +} + +func (m *GerritSourceContext) GetAliasContext() *AliasContext { + if x, ok := m.GetRevision().(*GerritSourceContext_AliasContext); ok { + return x.AliasContext + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*GerritSourceContext) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _GerritSourceContext_OneofMarshaler, _GerritSourceContext_OneofUnmarshaler, _GerritSourceContext_OneofSizer, []interface{}{ + (*GerritSourceContext_RevisionId)(nil), + (*GerritSourceContext_AliasName)(nil), + (*GerritSourceContext_AliasContext)(nil), + } +} + +func _GerritSourceContext_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*GerritSourceContext) + // revision + switch x := m.Revision.(type) { + case *GerritSourceContext_RevisionId: + b.EncodeVarint(3<<3 | proto.WireBytes) + b.EncodeStringBytes(x.RevisionId) + case *GerritSourceContext_AliasName: + b.EncodeVarint(4<<3 | proto.WireBytes) + b.EncodeStringBytes(x.AliasName) + case *GerritSourceContext_AliasContext: + b.EncodeVarint(5<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.AliasContext); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("GerritSourceContext.Revision has unexpected type %T", x) + } + return nil +} + +func _GerritSourceContext_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*GerritSourceContext) + switch tag { + case 3: // revision.revision_id + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Revision = &GerritSourceContext_RevisionId{x} + return true, err + case 4: // revision.alias_name + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Revision = &GerritSourceContext_AliasName{x} + return true, err + case 5: // revision.alias_context + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(AliasContext) + err := b.DecodeMessage(msg) + m.Revision = &GerritSourceContext_AliasContext{msg} + return true, err + default: + return false, nil + } +} + +func _GerritSourceContext_OneofSizer(msg proto.Message) (n int) { + m := msg.(*GerritSourceContext) + // revision + switch x := m.Revision.(type) { + case *GerritSourceContext_RevisionId: + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.RevisionId))) + n += len(x.RevisionId) + case *GerritSourceContext_AliasName: + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.AliasName))) + n += len(x.AliasName) + case *GerritSourceContext_AliasContext: + s := proto.Size(x.AliasContext) + n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// A GitSourceContext denotes a particular revision in a third party Git +// repository (e.g. GitHub). +type GitSourceContext struct { + // Git repository URL. + Url string `protobuf:"bytes,1,opt,name=url" json:"url,omitempty"` + // Git commit hash. + // required. + RevisionId string `protobuf:"bytes,2,opt,name=revision_id,json=revisionId" json:"revision_id,omitempty"` +} + +func (m *GitSourceContext) Reset() { *m = GitSourceContext{} } +func (m *GitSourceContext) String() string { return proto.CompactTextString(m) } +func (*GitSourceContext) ProtoMessage() {} +func (*GitSourceContext) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *GitSourceContext) GetUrl() string { + if m != nil { + return m.Url + } + return "" +} + +func (m *GitSourceContext) GetRevisionId() string { + if m != nil { + return m.RevisionId + } + return "" +} + +// A unique identifier for a cloud repo. +type RepoId struct { + // A cloud repository can be identified by either its project ID and + // repository name combination, or its globally unique identifier. + // + // Types that are valid to be assigned to Id: + // *RepoId_ProjectRepoId + // *RepoId_Uid + Id isRepoId_Id `protobuf_oneof:"id"` +} + +func (m *RepoId) Reset() { *m = RepoId{} } +func (m *RepoId) String() string { return proto.CompactTextString(m) } +func (*RepoId) ProtoMessage() {} +func (*RepoId) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +type isRepoId_Id interface { + isRepoId_Id() +} + +type RepoId_ProjectRepoId struct { + ProjectRepoId *ProjectRepoId `protobuf:"bytes,1,opt,name=project_repo_id,json=projectRepoId,oneof"` +} +type RepoId_Uid struct { + Uid string `protobuf:"bytes,2,opt,name=uid,oneof"` +} + +func (*RepoId_ProjectRepoId) isRepoId_Id() {} +func (*RepoId_Uid) isRepoId_Id() {} + +func (m *RepoId) GetId() isRepoId_Id { + if m != nil { + return m.Id + } + return nil +} + +func (m *RepoId) GetProjectRepoId() *ProjectRepoId { + if x, ok := m.GetId().(*RepoId_ProjectRepoId); ok { + return x.ProjectRepoId + } + return nil +} + +func (m *RepoId) GetUid() string { + if x, ok := m.GetId().(*RepoId_Uid); ok { + return x.Uid + } + return "" +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*RepoId) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _RepoId_OneofMarshaler, _RepoId_OneofUnmarshaler, _RepoId_OneofSizer, []interface{}{ + (*RepoId_ProjectRepoId)(nil), + (*RepoId_Uid)(nil), + } +} + +func _RepoId_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*RepoId) + // id + switch x := m.Id.(type) { + case *RepoId_ProjectRepoId: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ProjectRepoId); err != nil { + return err + } + case *RepoId_Uid: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeStringBytes(x.Uid) + case nil: + default: + return fmt.Errorf("RepoId.Id has unexpected type %T", x) + } + return nil +} + +func _RepoId_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*RepoId) + switch tag { + case 1: // id.project_repo_id + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ProjectRepoId) + err := b.DecodeMessage(msg) + m.Id = &RepoId_ProjectRepoId{msg} + return true, err + case 2: // id.uid + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Id = &RepoId_Uid{x} + return true, err + default: + return false, nil + } +} + +func _RepoId_OneofSizer(msg proto.Message) (n int) { + m := msg.(*RepoId) + // id + switch x := m.Id.(type) { + case *RepoId_ProjectRepoId: + s := proto.Size(x.ProjectRepoId) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *RepoId_Uid: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Uid))) + n += len(x.Uid) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Selects a repo using a Google Cloud Platform project ID +// (e.g. winged-cargo-31) and a repo name within that project. +type ProjectRepoId struct { + // The ID of the project. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The name of the repo. Leave empty for the default repo. + RepoName string `protobuf:"bytes,2,opt,name=repo_name,json=repoName" json:"repo_name,omitempty"` +} + +func (m *ProjectRepoId) Reset() { *m = ProjectRepoId{} } +func (m *ProjectRepoId) String() string { return proto.CompactTextString(m) } +func (*ProjectRepoId) ProtoMessage() {} +func (*ProjectRepoId) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *ProjectRepoId) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *ProjectRepoId) GetRepoName() string { + if m != nil { + return m.RepoName + } + return "" +} + +// A CloudWorkspaceId is a unique identifier for a cloud workspace. +// A cloud workspace is a place associated with a repo where modified files +// can be stored before they are committed. +type CloudWorkspaceId struct { + // The ID of the repo containing the workspace. + RepoId *RepoId `protobuf:"bytes,1,opt,name=repo_id,json=repoId" json:"repo_id,omitempty"` + // The unique name of the workspace within the repo. This is the name + // chosen by the client in the Source API's CreateWorkspace method. + Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` +} + +func (m *CloudWorkspaceId) Reset() { *m = CloudWorkspaceId{} } +func (m *CloudWorkspaceId) String() string { return proto.CompactTextString(m) } +func (*CloudWorkspaceId) ProtoMessage() {} +func (*CloudWorkspaceId) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *CloudWorkspaceId) GetRepoId() *RepoId { + if m != nil { + return m.RepoId + } + return nil +} + +func (m *CloudWorkspaceId) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func init() { + proto.RegisterType((*SourceContext)(nil), "google.devtools.source.v1.SourceContext") + proto.RegisterType((*ExtendedSourceContext)(nil), "google.devtools.source.v1.ExtendedSourceContext") + proto.RegisterType((*AliasContext)(nil), "google.devtools.source.v1.AliasContext") + proto.RegisterType((*CloudRepoSourceContext)(nil), "google.devtools.source.v1.CloudRepoSourceContext") + proto.RegisterType((*CloudWorkspaceSourceContext)(nil), "google.devtools.source.v1.CloudWorkspaceSourceContext") + proto.RegisterType((*GerritSourceContext)(nil), "google.devtools.source.v1.GerritSourceContext") + proto.RegisterType((*GitSourceContext)(nil), "google.devtools.source.v1.GitSourceContext") + proto.RegisterType((*RepoId)(nil), "google.devtools.source.v1.RepoId") + proto.RegisterType((*ProjectRepoId)(nil), "google.devtools.source.v1.ProjectRepoId") + proto.RegisterType((*CloudWorkspaceId)(nil), "google.devtools.source.v1.CloudWorkspaceId") + proto.RegisterEnum("google.devtools.source.v1.AliasContext_Kind", AliasContext_Kind_name, AliasContext_Kind_value) +} + +func init() { proto.RegisterFile("google/devtools/source/v1/source_context.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 780 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xcb, 0x4e, 0xdb, 0x4c, + 0x14, 0x8e, 0xe3, 0x90, 0xe0, 0x13, 0x02, 0xd1, 0xfc, 0x7f, 0xab, 0x00, 0x45, 0x80, 0xa5, 0xaa, + 0x48, 0x54, 0x8e, 0x92, 0x4a, 0x55, 0x4b, 0x2b, 0x51, 0x02, 0x29, 0x89, 0xa0, 0x01, 0x4d, 0x29, + 0xbd, 0x6c, 0x22, 0x63, 0x8f, 0x8c, 0x8b, 0xf1, 0x58, 0xb6, 0x13, 0xe0, 0x25, 0xba, 0xe6, 0x19, + 0xfa, 0x4c, 0x7d, 0x84, 0x2e, 0x2b, 0x75, 0x5b, 0xcd, 0xc5, 0x90, 0x84, 0x60, 0x90, 0xda, 0x95, + 0x67, 0x8e, 0xbf, 0xef, 0x3b, 0x67, 0xce, 0x65, 0x06, 0x0c, 0x87, 0x52, 0xc7, 0x23, 0x55, 0x9b, + 0xf4, 0x63, 0x4a, 0xbd, 0xa8, 0x1a, 0xd1, 0x5e, 0x68, 0x91, 0x6a, 0xbf, 0x26, 0x57, 0x5d, 0x8b, + 0xfa, 0x31, 0x39, 0x8f, 0x8d, 0x20, 0xa4, 0x31, 0x45, 0xb3, 0x02, 0x6f, 0x24, 0x78, 0x43, 0xa0, + 0x8c, 0x7e, 0x6d, 0xee, 0x91, 0x94, 0x32, 0x03, 0xb7, 0x6a, 0xfa, 0x3e, 0x8d, 0xcd, 0xd8, 0xa5, + 0x7e, 0x24, 0x88, 0xfa, 0x8f, 0x2c, 0x94, 0xde, 0x73, 0xec, 0xa6, 0x10, 0x44, 0x18, 0xc0, 0xf2, + 0x68, 0xcf, 0xee, 0x86, 0x24, 0xa0, 0x15, 0x65, 0x49, 0x59, 0x29, 0xd6, 0x6b, 0xc6, 0xad, 0xfa, + 0xc6, 0x26, 0x03, 0x63, 0x12, 0xd0, 0x21, 0x99, 0x56, 0x06, 0x6b, 0x56, 0xf2, 0x07, 0x99, 0x30, + 0x23, 0x34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xab, 0xef, 0xd9, 0xc5, 0x6d, 0xa1, 0xc0, 0x8f, 0x68, + 0x6c, 0x91, 0xfe, 0x01, 0x77, 0x2c, 0xbc, 0x19, 0x87, 0xb5, 0xa3, 0x3c, 0x57, 0x7b, 0xf6, 0x27, + 0x00, 0x00, 0xff, 0xff, 0x9e, 0xd0, 0x5c, 0x10, 0xe7, 0x07, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/devtools/sourcerepo/v1/sourcerepo.pb.go b/vendor/google.golang.org/genproto/googleapis/devtools/sourcerepo/v1/sourcerepo.pb.go new file mode 100644 index 0000000000..47994ed980 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/devtools/sourcerepo/v1/sourcerepo.pb.go @@ -0,0 +1,636 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/devtools/sourcerepo/v1/sourcerepo.proto + +/* +Package sourcerepo is a generated protocol buffer package. + +It is generated from these files: + google/devtools/sourcerepo/v1/sourcerepo.proto + +It has these top-level messages: + Repo + MirrorConfig + GetRepoRequest + ListReposRequest + ListReposResponse + CreateRepoRequest + DeleteRepoRequest +*/ +package sourcerepo + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_iam_v11 "google.golang.org/genproto/googleapis/iam/v1" +import google_iam_v1 "google.golang.org/genproto/googleapis/iam/v1" +import google_protobuf1 "github.com/golang/protobuf/ptypes/empty" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// A repository (or repo) is a Git repository storing versioned source content. +type Repo struct { + // Resource name of the repository, of the form + // `projects//repos/`. The repo name may contain slashes. + // eg, `projects/myproject/repos/name/with/slash` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The disk usage of the repo, in bytes. Read-only field. Size is only + // returned by GetRepo. + Size int64 `protobuf:"varint,2,opt,name=size" json:"size,omitempty"` + // URL to clone the repository from Google Cloud Source Repositories. + // Read-only field. + Url string `protobuf:"bytes,3,opt,name=url" json:"url,omitempty"` + // How this repository mirrors a repository managed by another service. + // Read-only field. + MirrorConfig *MirrorConfig `protobuf:"bytes,4,opt,name=mirror_config,json=mirrorConfig" json:"mirror_config,omitempty"` +} + +func (m *Repo) Reset() { *m = Repo{} } +func (m *Repo) String() string { return proto.CompactTextString(m) } +func (*Repo) ProtoMessage() {} +func (*Repo) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *Repo) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Repo) GetSize() int64 { + if m != nil { + return m.Size + } + return 0 +} + +func (m *Repo) GetUrl() string { + if m != nil { + return m.Url + } + return "" +} + +func (m *Repo) GetMirrorConfig() *MirrorConfig { + if m != nil { + return m.MirrorConfig + } + return nil +} + +// Configuration to automatically mirror a repository from another +// hosting service, for example GitHub or BitBucket. +type MirrorConfig struct { + // URL of the main repository at the other hosting service. + Url string `protobuf:"bytes,1,opt,name=url" json:"url,omitempty"` + // ID of the webhook listening to updates to trigger mirroring. + // Removing this webhook from the other hosting service will stop + // Google Cloud Source Repositories from receiving notifications, + // and thereby disabling mirroring. + WebhookId string `protobuf:"bytes,2,opt,name=webhook_id,json=webhookId" json:"webhook_id,omitempty"` + // ID of the SSH deploy key at the other hosting service. + // Removing this key from the other service would deauthorize + // Google Cloud Source Repositories from mirroring. + DeployKeyId string `protobuf:"bytes,3,opt,name=deploy_key_id,json=deployKeyId" json:"deploy_key_id,omitempty"` +} + +func (m *MirrorConfig) Reset() { *m = MirrorConfig{} } +func (m *MirrorConfig) String() string { return proto.CompactTextString(m) } +func (*MirrorConfig) ProtoMessage() {} +func (*MirrorConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *MirrorConfig) GetUrl() string { + if m != nil { + return m.Url + } + return "" +} + +func (m *MirrorConfig) GetWebhookId() string { + if m != nil { + return m.WebhookId + } + return "" +} + +func (m *MirrorConfig) GetDeployKeyId() string { + if m != nil { + return m.DeployKeyId + } + return "" +} + +// Request for GetRepo. +type GetRepoRequest struct { + // The name of the requested repository. Values are of the form + // `projects//repos/`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetRepoRequest) Reset() { *m = GetRepoRequest{} } +func (m *GetRepoRequest) String() string { return proto.CompactTextString(m) } +func (*GetRepoRequest) ProtoMessage() {} +func (*GetRepoRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *GetRepoRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Request for ListRepos. +type ListReposRequest struct { + // The project ID whose repos should be listed. Values are of the form + // `projects/`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Maximum number of repositories to return; between 1 and 500. + // If not set or zero, defaults to 100 at the server. + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // Resume listing repositories where a prior ListReposResponse + // left off. This is an opaque token that must be obtained from + // a recent, prior ListReposResponse's next_page_token field. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListReposRequest) Reset() { *m = ListReposRequest{} } +func (m *ListReposRequest) String() string { return proto.CompactTextString(m) } +func (*ListReposRequest) ProtoMessage() {} +func (*ListReposRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *ListReposRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ListReposRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListReposRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// Response for ListRepos. The size is not set in the returned repositories. +type ListReposResponse struct { + // The listed repos. + Repos []*Repo `protobuf:"bytes,1,rep,name=repos" json:"repos,omitempty"` + // If non-empty, additional repositories exist within the project. These + // can be retrieved by including this value in the next ListReposRequest's + // page_token field. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListReposResponse) Reset() { *m = ListReposResponse{} } +func (m *ListReposResponse) String() string { return proto.CompactTextString(m) } +func (*ListReposResponse) ProtoMessage() {} +func (*ListReposResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *ListReposResponse) GetRepos() []*Repo { + if m != nil { + return m.Repos + } + return nil +} + +func (m *ListReposResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// Request for CreateRepo +type CreateRepoRequest struct { + // The project in which to create the repo. Values are of the form + // `projects/`. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // The repo to create. Only name should be set; setting other fields + // is an error. The project in the name should match the parent field. + Repo *Repo `protobuf:"bytes,2,opt,name=repo" json:"repo,omitempty"` +} + +func (m *CreateRepoRequest) Reset() { *m = CreateRepoRequest{} } +func (m *CreateRepoRequest) String() string { return proto.CompactTextString(m) } +func (*CreateRepoRequest) ProtoMessage() {} +func (*CreateRepoRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *CreateRepoRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *CreateRepoRequest) GetRepo() *Repo { + if m != nil { + return m.Repo + } + return nil +} + +// Request for DeleteRepo. +type DeleteRepoRequest struct { + // The name of the repo to delete. Values are of the form + // `projects//repos/`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *DeleteRepoRequest) Reset() { *m = DeleteRepoRequest{} } +func (m *DeleteRepoRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteRepoRequest) ProtoMessage() {} +func (*DeleteRepoRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *DeleteRepoRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func init() { + proto.RegisterType((*Repo)(nil), "google.devtools.sourcerepo.v1.Repo") + proto.RegisterType((*MirrorConfig)(nil), "google.devtools.sourcerepo.v1.MirrorConfig") + proto.RegisterType((*GetRepoRequest)(nil), "google.devtools.sourcerepo.v1.GetRepoRequest") + proto.RegisterType((*ListReposRequest)(nil), "google.devtools.sourcerepo.v1.ListReposRequest") + proto.RegisterType((*ListReposResponse)(nil), "google.devtools.sourcerepo.v1.ListReposResponse") + proto.RegisterType((*CreateRepoRequest)(nil), "google.devtools.sourcerepo.v1.CreateRepoRequest") + proto.RegisterType((*DeleteRepoRequest)(nil), "google.devtools.sourcerepo.v1.DeleteRepoRequest") +} + +// 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 + +// Client API for SourceRepo service + +type SourceRepoClient interface { + // Returns all repos belonging to a project. The sizes of the repos are + // not set by ListRepos. To get the size of a repo, use GetRepo. + ListRepos(ctx context.Context, in *ListReposRequest, opts ...grpc.CallOption) (*ListReposResponse, error) + // Returns information about a repo. + GetRepo(ctx context.Context, in *GetRepoRequest, opts ...grpc.CallOption) (*Repo, error) + // Creates a repo in the given project with the given name. + // + // If the named repository already exists, `CreateRepo` returns + // `ALREADY_EXISTS`. + CreateRepo(ctx context.Context, in *CreateRepoRequest, opts ...grpc.CallOption) (*Repo, error) + // Deletes a repo. + DeleteRepo(ctx context.Context, in *DeleteRepoRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) + // Sets the access control policy on the specified resource. Replaces any + // existing policy. + SetIamPolicy(ctx context.Context, in *google_iam_v11.SetIamPolicyRequest, opts ...grpc.CallOption) (*google_iam_v1.Policy, error) + // Gets the access control policy for a resource. + // Returns an empty policy if the resource exists and does not have a policy + // set. + GetIamPolicy(ctx context.Context, in *google_iam_v11.GetIamPolicyRequest, opts ...grpc.CallOption) (*google_iam_v1.Policy, error) + // Returns permissions that a caller has on the specified resource. + // If the resource does not exist, this will return an empty set of + // permissions, not a NOT_FOUND error. + TestIamPermissions(ctx context.Context, in *google_iam_v11.TestIamPermissionsRequest, opts ...grpc.CallOption) (*google_iam_v11.TestIamPermissionsResponse, error) +} + +type sourceRepoClient struct { + cc *grpc.ClientConn +} + +func NewSourceRepoClient(cc *grpc.ClientConn) SourceRepoClient { + return &sourceRepoClient{cc} +} + +func (c *sourceRepoClient) ListRepos(ctx context.Context, in *ListReposRequest, opts ...grpc.CallOption) (*ListReposResponse, error) { + out := new(ListReposResponse) + err := grpc.Invoke(ctx, "/google.devtools.sourcerepo.v1.SourceRepo/ListRepos", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *sourceRepoClient) GetRepo(ctx context.Context, in *GetRepoRequest, opts ...grpc.CallOption) (*Repo, error) { + out := new(Repo) + err := grpc.Invoke(ctx, "/google.devtools.sourcerepo.v1.SourceRepo/GetRepo", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *sourceRepoClient) CreateRepo(ctx context.Context, in *CreateRepoRequest, opts ...grpc.CallOption) (*Repo, error) { + out := new(Repo) + err := grpc.Invoke(ctx, "/google.devtools.sourcerepo.v1.SourceRepo/CreateRepo", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *sourceRepoClient) DeleteRepo(ctx context.Context, in *DeleteRepoRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { + out := new(google_protobuf1.Empty) + err := grpc.Invoke(ctx, "/google.devtools.sourcerepo.v1.SourceRepo/DeleteRepo", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *sourceRepoClient) SetIamPolicy(ctx context.Context, in *google_iam_v11.SetIamPolicyRequest, opts ...grpc.CallOption) (*google_iam_v1.Policy, error) { + out := new(google_iam_v1.Policy) + err := grpc.Invoke(ctx, "/google.devtools.sourcerepo.v1.SourceRepo/SetIamPolicy", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *sourceRepoClient) GetIamPolicy(ctx context.Context, in *google_iam_v11.GetIamPolicyRequest, opts ...grpc.CallOption) (*google_iam_v1.Policy, error) { + out := new(google_iam_v1.Policy) + err := grpc.Invoke(ctx, "/google.devtools.sourcerepo.v1.SourceRepo/GetIamPolicy", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *sourceRepoClient) TestIamPermissions(ctx context.Context, in *google_iam_v11.TestIamPermissionsRequest, opts ...grpc.CallOption) (*google_iam_v11.TestIamPermissionsResponse, error) { + out := new(google_iam_v11.TestIamPermissionsResponse) + err := grpc.Invoke(ctx, "/google.devtools.sourcerepo.v1.SourceRepo/TestIamPermissions", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for SourceRepo service + +type SourceRepoServer interface { + // Returns all repos belonging to a project. The sizes of the repos are + // not set by ListRepos. To get the size of a repo, use GetRepo. + ListRepos(context.Context, *ListReposRequest) (*ListReposResponse, error) + // Returns information about a repo. + GetRepo(context.Context, *GetRepoRequest) (*Repo, error) + // Creates a repo in the given project with the given name. + // + // If the named repository already exists, `CreateRepo` returns + // `ALREADY_EXISTS`. + CreateRepo(context.Context, *CreateRepoRequest) (*Repo, error) + // Deletes a repo. + DeleteRepo(context.Context, *DeleteRepoRequest) (*google_protobuf1.Empty, error) + // Sets the access control policy on the specified resource. Replaces any + // existing policy. + SetIamPolicy(context.Context, *google_iam_v11.SetIamPolicyRequest) (*google_iam_v1.Policy, error) + // Gets the access control policy for a resource. + // Returns an empty policy if the resource exists and does not have a policy + // set. + GetIamPolicy(context.Context, *google_iam_v11.GetIamPolicyRequest) (*google_iam_v1.Policy, error) + // Returns permissions that a caller has on the specified resource. + // If the resource does not exist, this will return an empty set of + // permissions, not a NOT_FOUND error. + TestIamPermissions(context.Context, *google_iam_v11.TestIamPermissionsRequest) (*google_iam_v11.TestIamPermissionsResponse, error) +} + +func RegisterSourceRepoServer(s *grpc.Server, srv SourceRepoServer) { + s.RegisterService(&_SourceRepo_serviceDesc, srv) +} + +func _SourceRepo_ListRepos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListReposRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SourceRepoServer).ListRepos(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.sourcerepo.v1.SourceRepo/ListRepos", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SourceRepoServer).ListRepos(ctx, req.(*ListReposRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SourceRepo_GetRepo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetRepoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SourceRepoServer).GetRepo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.sourcerepo.v1.SourceRepo/GetRepo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SourceRepoServer).GetRepo(ctx, req.(*GetRepoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SourceRepo_CreateRepo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateRepoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SourceRepoServer).CreateRepo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.sourcerepo.v1.SourceRepo/CreateRepo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SourceRepoServer).CreateRepo(ctx, req.(*CreateRepoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SourceRepo_DeleteRepo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteRepoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SourceRepoServer).DeleteRepo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.sourcerepo.v1.SourceRepo/DeleteRepo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SourceRepoServer).DeleteRepo(ctx, req.(*DeleteRepoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SourceRepo_SetIamPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(google_iam_v11.SetIamPolicyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SourceRepoServer).SetIamPolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.sourcerepo.v1.SourceRepo/SetIamPolicy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SourceRepoServer).SetIamPolicy(ctx, req.(*google_iam_v11.SetIamPolicyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SourceRepo_GetIamPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(google_iam_v11.GetIamPolicyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SourceRepoServer).GetIamPolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.sourcerepo.v1.SourceRepo/GetIamPolicy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SourceRepoServer).GetIamPolicy(ctx, req.(*google_iam_v11.GetIamPolicyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SourceRepo_TestIamPermissions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(google_iam_v11.TestIamPermissionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SourceRepoServer).TestIamPermissions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.devtools.sourcerepo.v1.SourceRepo/TestIamPermissions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SourceRepoServer).TestIamPermissions(ctx, req.(*google_iam_v11.TestIamPermissionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _SourceRepo_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.devtools.sourcerepo.v1.SourceRepo", + HandlerType: (*SourceRepoServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListRepos", + Handler: _SourceRepo_ListRepos_Handler, + }, + { + MethodName: "GetRepo", + Handler: _SourceRepo_GetRepo_Handler, + }, + { + MethodName: "CreateRepo", + Handler: _SourceRepo_CreateRepo_Handler, + }, + { + MethodName: "DeleteRepo", + Handler: _SourceRepo_DeleteRepo_Handler, + }, + { + MethodName: "SetIamPolicy", + Handler: _SourceRepo_SetIamPolicy_Handler, + }, + { + MethodName: "GetIamPolicy", + Handler: _SourceRepo_GetIamPolicy_Handler, + }, + { + MethodName: "TestIamPermissions", + Handler: _SourceRepo_TestIamPermissions_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/devtools/sourcerepo/v1/sourcerepo.proto", +} + +func init() { proto.RegisterFile("google/devtools/sourcerepo/v1/sourcerepo.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 743 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0xd1, 0x6e, 0xd3, 0x4a, + 0x10, 0xd5, 0x36, 0x69, 0x7b, 0x33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f, 0x88, 0x56, 0x82, 0x33, 0x74, 0x68, 0x59, 0x86, 0x1b, 0xd7, 0xbc, + 0x5d, 0x58, 0x3b, 0x0c, 0xd0, 0x14, 0x98, 0x34, 0x61, 0x1d, 0x16, 0x7c, 0x33, 0x40, 0x4f, 0x44, + 0xc7, 0x8b, 0x76, 0x74, 0x1f, 0xb2, 0xb2, 0xbb, 0xea, 0x94, 0x52, 0x8e, 0x2a, 0xd0, 0x6e, 0xc3, + 0xda, 0x33, 0x74, 0x70, 0x94, 0x65, 0x82, 0x85, 0x7b, 0xbf, 0x16, 0x01, 0x8e, 0x55, 0x17, 0x35, + 0x90, 0x57, 0x04, 0x72, 0xd7, 0xb6, 0x50, 0x63, 0x06, 0xe1, 0xcd, 0x4b, 0x2a, 0xde, 0x4b, 0x5f, + 0x10, 0x3a, 0xae, 0x6d, 0x5d, 0xfc, 0xf8, 0x79, 0x35, 0x57, 0xa2, 0x1b, 0xf2, 0x0b, 0xfa, 0x24, + 0x25, 0x3d, 0xf1, 0x03, 0xf6, 0x16, 0x3b, 0x82, 0x1b, 0xd5, 0x73, 0x23, 0xf4, 0xf6, 0x92, 0xc0, + 0x62, 0x34, 0x36, 0xf4, 0xee, 0x0c, 0x8a, 0xd1, 0xf1, 0x2a, 0xa6, 0xf1, 0x4c, 0xdb, 0x56, 0x22, + 0xca, 0x74, 0x73, 0x92, 0x88, 0x50, 0x83, 0x51, 0xad, 0x9e, 0xd3, 0xaf, 0x04, 0x60, 0x78, 0x79, + 0x74, 0xd6, 0x69, 0xc7, 0xee, 0x39, 0x9d, 0x9a, 0x1d, 0xa5, 0xe6, 0x96, 0x56, 0x52, 0x6a, 0xc2, + 0x49, 0x18, 0x37, 0xa5, 0xa6, 0x2e, 0x9a, 0x7e, 0x06, 0x18, 0x5e, 0xf4, 0x4c, 0x45, 0x63, 0x33, + 0x51, 0x5c, 0x8f, 0x2b, 0xe2, 0x87, 0x4a, 0x7f, 0x2e, 0x1f, 0xaa, 0xd8, 0x92, 0xea, 0x2c, 0x4b, + 0x2e, 0x09, 0xe4, 0x8f, 0x51, 0x1c, 0x99, 0x6e, 0x43, 0x3d, 0x7f, 0x54, 0x8b, 0x1b, 0xda, 0xa6, + 0x2b, 0x29, 0x93, 0xc9, 0x98, 0xf4, 0x9f, 0x1b, 0x98, 0x30, 0xab, 0xd5, 0x14, 0xe7, 0x03, 0xcd, + 0x50, 0x9c, 0x01, 0x86, 0xda, 0x27, 0xf2, 0xd6, 0x78, 0xa2, 0x6d, 0x8d, 0x54, 0xe9, 0x05, 0x81, + 0x7c, 0x7d, 0x9a, 0x8e, 0x7a, 0x7a, 0x1d, 0xfb, 0x4a, 0xc7, 0x2e, 0x4d, 0xa3, 0xc3, 0x4a, 0x72, + 0x7e, 0x27, 0x40, 0x4f, 0x90, 0xab, 0x08, 0x06, 0xae, 0xcd, 0xb9, 0xfc, 0x9b, 0xd0, 0xca, 0x0d, + 0x9a, 0x71, 0x48, 0x2c, 0xe8, 0x4e, 0x0a, 0x64, 0xf4, 0xe1, 0x3c, 0x55, 0x22, 0x6b, 0xda, 0xc3, + 0x14, 0x22, 0xc5, 0x58, 0x9b, 0x1a, 0xa9, 0x1e, 0x7c, 0x81, 0xff, 0x3a, 0xcc, 0x9d, 0x3e, 0x31, + 0x07, 0x2b, 0xc3, 0xc7, 0xa1, 0x21, 0x27, 0xa4, 0x41, 0x5e, 0xd7, 0xa3, 0x0a, 0x8b, 0x39, 0xa6, + 0x67, 0xe9, 0x2c, 0xb0, 0x0c, 0x0b, 0x3d, 0x35, 0x3f, 0x46, 0x98, 0x32, 0x7d, 0x9b, 0xff, 0xe1, + 0x17, 0xfd, 0x78, 0xb8, 0x6b, 0x2f, 0xa8, 0x9a, 0xfb, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x31, + 0x75, 0x14, 0x03, 0xd5, 0x07, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/example/library/v1/library.pb.go b/vendor/google.golang.org/genproto/googleapis/example/library/v1/library.pb.go new file mode 100644 index 0000000000..5fa997526a --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/example/library/v1/library.pb.go @@ -0,0 +1,981 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/example/library/v1/library.proto + +/* +Package library is a generated protocol buffer package. + +It is generated from these files: + google/example/library/v1/library.proto + +It has these top-level messages: + Book + Shelf + CreateShelfRequest + GetShelfRequest + ListShelvesRequest + ListShelvesResponse + DeleteShelfRequest + MergeShelvesRequest + CreateBookRequest + GetBookRequest + ListBooksRequest + ListBooksResponse + UpdateBookRequest + DeleteBookRequest + MoveBookRequest +*/ +package library + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf1 "github.com/golang/protobuf/ptypes/empty" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// A single book in the library. +type Book struct { + // The resource name of the book. + // Book names have the form `shelves/{shelf_id}/books/{book_id}`. + // The name is ignored when creating a book. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The name of the book author. + Author string `protobuf:"bytes,2,opt,name=author" json:"author,omitempty"` + // The title of the book. + Title string `protobuf:"bytes,3,opt,name=title" json:"title,omitempty"` + // Value indicating whether the book has been read. + Read bool `protobuf:"varint,4,opt,name=read" json:"read,omitempty"` +} + +func (m *Book) Reset() { *m = Book{} } +func (m *Book) String() string { return proto.CompactTextString(m) } +func (*Book) ProtoMessage() {} +func (*Book) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *Book) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Book) GetAuthor() string { + if m != nil { + return m.Author + } + return "" +} + +func (m *Book) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *Book) GetRead() bool { + if m != nil { + return m.Read + } + return false +} + +// A Shelf contains a collection of books with a theme. +type Shelf struct { + // The resource name of the shelf. + // Shelf names have the form `shelves/{shelf_id}`. + // The name is ignored when creating a shelf. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The theme of the shelf + Theme string `protobuf:"bytes,2,opt,name=theme" json:"theme,omitempty"` +} + +func (m *Shelf) Reset() { *m = Shelf{} } +func (m *Shelf) String() string { return proto.CompactTextString(m) } +func (*Shelf) ProtoMessage() {} +func (*Shelf) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *Shelf) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Shelf) GetTheme() string { + if m != nil { + return m.Theme + } + return "" +} + +// Request message for LibraryService.CreateShelf. +type CreateShelfRequest struct { + // The shelf to create. + Shelf *Shelf `protobuf:"bytes,1,opt,name=shelf" json:"shelf,omitempty"` +} + +func (m *CreateShelfRequest) Reset() { *m = CreateShelfRequest{} } +func (m *CreateShelfRequest) String() string { return proto.CompactTextString(m) } +func (*CreateShelfRequest) ProtoMessage() {} +func (*CreateShelfRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *CreateShelfRequest) GetShelf() *Shelf { + if m != nil { + return m.Shelf + } + return nil +} + +// Request message for LibraryService.GetShelf. +type GetShelfRequest struct { + // The name of the shelf to retrieve. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetShelfRequest) Reset() { *m = GetShelfRequest{} } +func (m *GetShelfRequest) String() string { return proto.CompactTextString(m) } +func (*GetShelfRequest) ProtoMessage() {} +func (*GetShelfRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *GetShelfRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Request message for LibraryService.ListShelves. +type ListShelvesRequest struct { + // Requested page size. Server may return fewer shelves than requested. + // If unspecified, server will pick an appropriate default. + PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // A token identifying a page of results the server should return. + // Typically, this is the value of + // [ListShelvesResponse.next_page_token][google.example.library.v1.ListShelvesResponse.next_page_token] + // returned from the previous call to `ListShelves` method. + PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListShelvesRequest) Reset() { *m = ListShelvesRequest{} } +func (m *ListShelvesRequest) String() string { return proto.CompactTextString(m) } +func (*ListShelvesRequest) ProtoMessage() {} +func (*ListShelvesRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *ListShelvesRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListShelvesRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// Response message for LibraryService.ListShelves. +type ListShelvesResponse struct { + // The list of shelves. + Shelves []*Shelf `protobuf:"bytes,1,rep,name=shelves" json:"shelves,omitempty"` + // A token to retrieve next page of results. + // Pass this value in the + // [ListShelvesRequest.page_token][google.example.library.v1.ListShelvesRequest.page_token] + // field in the subsequent call to `ListShelves` method to retrieve the next + // page of results. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListShelvesResponse) Reset() { *m = ListShelvesResponse{} } +func (m *ListShelvesResponse) String() string { return proto.CompactTextString(m) } +func (*ListShelvesResponse) ProtoMessage() {} +func (*ListShelvesResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *ListShelvesResponse) GetShelves() []*Shelf { + if m != nil { + return m.Shelves + } + return nil +} + +func (m *ListShelvesResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// Request message for LibraryService.DeleteShelf. +type DeleteShelfRequest struct { + // The name of the shelf to delete. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *DeleteShelfRequest) Reset() { *m = DeleteShelfRequest{} } +func (m *DeleteShelfRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteShelfRequest) ProtoMessage() {} +func (*DeleteShelfRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *DeleteShelfRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Describes the shelf being removed (other_shelf_name) and updated +// (name) in this merge. +type MergeShelvesRequest struct { + // The name of the shelf we're adding books to. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The name of the shelf we're removing books from and deleting. + OtherShelfName string `protobuf:"bytes,2,opt,name=other_shelf_name,json=otherShelfName" json:"other_shelf_name,omitempty"` +} + +func (m *MergeShelvesRequest) Reset() { *m = MergeShelvesRequest{} } +func (m *MergeShelvesRequest) String() string { return proto.CompactTextString(m) } +func (*MergeShelvesRequest) ProtoMessage() {} +func (*MergeShelvesRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *MergeShelvesRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *MergeShelvesRequest) GetOtherShelfName() string { + if m != nil { + return m.OtherShelfName + } + return "" +} + +// Request message for LibraryService.CreateBook. +type CreateBookRequest struct { + // The name of the shelf in which the book is created. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The book to create. + Book *Book `protobuf:"bytes,2,opt,name=book" json:"book,omitempty"` +} + +func (m *CreateBookRequest) Reset() { *m = CreateBookRequest{} } +func (m *CreateBookRequest) String() string { return proto.CompactTextString(m) } +func (*CreateBookRequest) ProtoMessage() {} +func (*CreateBookRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *CreateBookRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *CreateBookRequest) GetBook() *Book { + if m != nil { + return m.Book + } + return nil +} + +// Request message for LibraryService.GetBook. +type GetBookRequest struct { + // The name of the book to retrieve. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetBookRequest) Reset() { *m = GetBookRequest{} } +func (m *GetBookRequest) String() string { return proto.CompactTextString(m) } +func (*GetBookRequest) ProtoMessage() {} +func (*GetBookRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *GetBookRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Request message for LibraryService.ListBooks. +type ListBooksRequest struct { + // The name of the shelf whose books we'd like to list. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Requested page size. Server may return fewer books than requested. + // If unspecified, server will pick an appropriate default. + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // A token identifying a page of results the server should return. + // Typically, this is the value of + // [ListBooksResponse.next_page_token][google.example.library.v1.ListBooksResponse.next_page_token]. + // returned from the previous call to `ListBooks` method. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListBooksRequest) Reset() { *m = ListBooksRequest{} } +func (m *ListBooksRequest) String() string { return proto.CompactTextString(m) } +func (*ListBooksRequest) ProtoMessage() {} +func (*ListBooksRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *ListBooksRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ListBooksRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListBooksRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// Response message for LibraryService.ListBooks. +type ListBooksResponse struct { + // The list of books. + Books []*Book `protobuf:"bytes,1,rep,name=books" json:"books,omitempty"` + // A token to retrieve next page of results. + // Pass this value in the + // [ListBooksRequest.page_token][google.example.library.v1.ListBooksRequest.page_token] + // field in the subsequent call to `ListBooks` method to retrieve the next + // page of results. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListBooksResponse) Reset() { *m = ListBooksResponse{} } +func (m *ListBooksResponse) String() string { return proto.CompactTextString(m) } +func (*ListBooksResponse) ProtoMessage() {} +func (*ListBooksResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } + +func (m *ListBooksResponse) GetBooks() []*Book { + if m != nil { + return m.Books + } + return nil +} + +func (m *ListBooksResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// Request message for LibraryService.UpdateBook. +type UpdateBookRequest struct { + // The name of the book to update. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The book to update with. The name must match or be empty. + Book *Book `protobuf:"bytes,2,opt,name=book" json:"book,omitempty"` +} + +func (m *UpdateBookRequest) Reset() { *m = UpdateBookRequest{} } +func (m *UpdateBookRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateBookRequest) ProtoMessage() {} +func (*UpdateBookRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } + +func (m *UpdateBookRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *UpdateBookRequest) GetBook() *Book { + if m != nil { + return m.Book + } + return nil +} + +// Request message for LibraryService.DeleteBook. +type DeleteBookRequest struct { + // The name of the book to delete. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *DeleteBookRequest) Reset() { *m = DeleteBookRequest{} } +func (m *DeleteBookRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteBookRequest) ProtoMessage() {} +func (*DeleteBookRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } + +func (m *DeleteBookRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Describes what book to move (name) and what shelf we're moving it +// to (other_shelf_name). +type MoveBookRequest struct { + // The name of the book to move. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The name of the destination shelf. + OtherShelfName string `protobuf:"bytes,2,opt,name=other_shelf_name,json=otherShelfName" json:"other_shelf_name,omitempty"` +} + +func (m *MoveBookRequest) Reset() { *m = MoveBookRequest{} } +func (m *MoveBookRequest) String() string { return proto.CompactTextString(m) } +func (*MoveBookRequest) ProtoMessage() {} +func (*MoveBookRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } + +func (m *MoveBookRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *MoveBookRequest) GetOtherShelfName() string { + if m != nil { + return m.OtherShelfName + } + return "" +} + +func init() { + proto.RegisterType((*Book)(nil), "google.example.library.v1.Book") + proto.RegisterType((*Shelf)(nil), "google.example.library.v1.Shelf") + proto.RegisterType((*CreateShelfRequest)(nil), "google.example.library.v1.CreateShelfRequest") + proto.RegisterType((*GetShelfRequest)(nil), "google.example.library.v1.GetShelfRequest") + proto.RegisterType((*ListShelvesRequest)(nil), "google.example.library.v1.ListShelvesRequest") + proto.RegisterType((*ListShelvesResponse)(nil), "google.example.library.v1.ListShelvesResponse") + proto.RegisterType((*DeleteShelfRequest)(nil), "google.example.library.v1.DeleteShelfRequest") + proto.RegisterType((*MergeShelvesRequest)(nil), "google.example.library.v1.MergeShelvesRequest") + proto.RegisterType((*CreateBookRequest)(nil), "google.example.library.v1.CreateBookRequest") + proto.RegisterType((*GetBookRequest)(nil), "google.example.library.v1.GetBookRequest") + proto.RegisterType((*ListBooksRequest)(nil), "google.example.library.v1.ListBooksRequest") + proto.RegisterType((*ListBooksResponse)(nil), "google.example.library.v1.ListBooksResponse") + proto.RegisterType((*UpdateBookRequest)(nil), "google.example.library.v1.UpdateBookRequest") + proto.RegisterType((*DeleteBookRequest)(nil), "google.example.library.v1.DeleteBookRequest") + proto.RegisterType((*MoveBookRequest)(nil), "google.example.library.v1.MoveBookRequest") +} + +// 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 + +// Client API for LibraryService service + +type LibraryServiceClient interface { + // Creates a shelf, and returns the new Shelf. + CreateShelf(ctx context.Context, in *CreateShelfRequest, opts ...grpc.CallOption) (*Shelf, error) + // Gets a shelf. Returns NOT_FOUND if the shelf does not exist. + GetShelf(ctx context.Context, in *GetShelfRequest, opts ...grpc.CallOption) (*Shelf, error) + // Lists shelves. The order is unspecified but deterministic. Newly created + // shelves will not necessarily be added to the end of this list. + ListShelves(ctx context.Context, in *ListShelvesRequest, opts ...grpc.CallOption) (*ListShelvesResponse, error) + // Deletes a shelf. Returns NOT_FOUND if the shelf does not exist. + DeleteShelf(ctx context.Context, in *DeleteShelfRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) + // Merges two shelves by adding all books from the shelf named + // `other_shelf_name` to shelf `name`, and deletes + // `other_shelf_name`. Returns the updated shelf. + // The book ids of the moved books may not be the same as the original books. + // + // Returns NOT_FOUND if either shelf does not exist. + // This call is a no-op if the specified shelves are the same. + MergeShelves(ctx context.Context, in *MergeShelvesRequest, opts ...grpc.CallOption) (*Shelf, error) + // Creates a book, and returns the new Book. + CreateBook(ctx context.Context, in *CreateBookRequest, opts ...grpc.CallOption) (*Book, error) + // Gets a book. Returns NOT_FOUND if the book does not exist. + GetBook(ctx context.Context, in *GetBookRequest, opts ...grpc.CallOption) (*Book, error) + // Lists books in a shelf. The order is unspecified but deterministic. Newly + // created books will not necessarily be added to the end of this list. + // Returns NOT_FOUND if the shelf does not exist. + ListBooks(ctx context.Context, in *ListBooksRequest, opts ...grpc.CallOption) (*ListBooksResponse, error) + // Deletes a book. Returns NOT_FOUND if the book does not exist. + DeleteBook(ctx context.Context, in *DeleteBookRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) + // Updates a book. Returns INVALID_ARGUMENT if the name of the book + // is non-empty and does equal the previous name. + UpdateBook(ctx context.Context, in *UpdateBookRequest, opts ...grpc.CallOption) (*Book, error) + // Moves a book to another shelf, and returns the new book. The book + // id of the new book may not be the same as the original book. + MoveBook(ctx context.Context, in *MoveBookRequest, opts ...grpc.CallOption) (*Book, error) +} + +type libraryServiceClient struct { + cc *grpc.ClientConn +} + +func NewLibraryServiceClient(cc *grpc.ClientConn) LibraryServiceClient { + return &libraryServiceClient{cc} +} + +func (c *libraryServiceClient) CreateShelf(ctx context.Context, in *CreateShelfRequest, opts ...grpc.CallOption) (*Shelf, error) { + out := new(Shelf) + err := grpc.Invoke(ctx, "/google.example.library.v1.LibraryService/CreateShelf", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *libraryServiceClient) GetShelf(ctx context.Context, in *GetShelfRequest, opts ...grpc.CallOption) (*Shelf, error) { + out := new(Shelf) + err := grpc.Invoke(ctx, "/google.example.library.v1.LibraryService/GetShelf", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *libraryServiceClient) ListShelves(ctx context.Context, in *ListShelvesRequest, opts ...grpc.CallOption) (*ListShelvesResponse, error) { + out := new(ListShelvesResponse) + err := grpc.Invoke(ctx, "/google.example.library.v1.LibraryService/ListShelves", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *libraryServiceClient) DeleteShelf(ctx context.Context, in *DeleteShelfRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { + out := new(google_protobuf1.Empty) + err := grpc.Invoke(ctx, "/google.example.library.v1.LibraryService/DeleteShelf", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *libraryServiceClient) MergeShelves(ctx context.Context, in *MergeShelvesRequest, opts ...grpc.CallOption) (*Shelf, error) { + out := new(Shelf) + err := grpc.Invoke(ctx, "/google.example.library.v1.LibraryService/MergeShelves", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *libraryServiceClient) CreateBook(ctx context.Context, in *CreateBookRequest, opts ...grpc.CallOption) (*Book, error) { + out := new(Book) + err := grpc.Invoke(ctx, "/google.example.library.v1.LibraryService/CreateBook", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *libraryServiceClient) GetBook(ctx context.Context, in *GetBookRequest, opts ...grpc.CallOption) (*Book, error) { + out := new(Book) + err := grpc.Invoke(ctx, "/google.example.library.v1.LibraryService/GetBook", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *libraryServiceClient) ListBooks(ctx context.Context, in *ListBooksRequest, opts ...grpc.CallOption) (*ListBooksResponse, error) { + out := new(ListBooksResponse) + err := grpc.Invoke(ctx, "/google.example.library.v1.LibraryService/ListBooks", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *libraryServiceClient) DeleteBook(ctx context.Context, in *DeleteBookRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { + out := new(google_protobuf1.Empty) + err := grpc.Invoke(ctx, "/google.example.library.v1.LibraryService/DeleteBook", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *libraryServiceClient) UpdateBook(ctx context.Context, in *UpdateBookRequest, opts ...grpc.CallOption) (*Book, error) { + out := new(Book) + err := grpc.Invoke(ctx, "/google.example.library.v1.LibraryService/UpdateBook", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *libraryServiceClient) MoveBook(ctx context.Context, in *MoveBookRequest, opts ...grpc.CallOption) (*Book, error) { + out := new(Book) + err := grpc.Invoke(ctx, "/google.example.library.v1.LibraryService/MoveBook", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for LibraryService service + +type LibraryServiceServer interface { + // Creates a shelf, and returns the new Shelf. + CreateShelf(context.Context, *CreateShelfRequest) (*Shelf, error) + // Gets a shelf. Returns NOT_FOUND if the shelf does not exist. + GetShelf(context.Context, *GetShelfRequest) (*Shelf, error) + // Lists shelves. The order is unspecified but deterministic. Newly created + // shelves will not necessarily be added to the end of this list. + ListShelves(context.Context, *ListShelvesRequest) (*ListShelvesResponse, error) + // Deletes a shelf. Returns NOT_FOUND if the shelf does not exist. + DeleteShelf(context.Context, *DeleteShelfRequest) (*google_protobuf1.Empty, error) + // Merges two shelves by adding all books from the shelf named + // `other_shelf_name` to shelf `name`, and deletes + // `other_shelf_name`. Returns the updated shelf. + // The book ids of the moved books may not be the same as the original books. + // + // Returns NOT_FOUND if either shelf does not exist. + // This call is a no-op if the specified shelves are the same. + MergeShelves(context.Context, *MergeShelvesRequest) (*Shelf, error) + // Creates a book, and returns the new Book. + CreateBook(context.Context, *CreateBookRequest) (*Book, error) + // Gets a book. Returns NOT_FOUND if the book does not exist. + GetBook(context.Context, *GetBookRequest) (*Book, error) + // Lists books in a shelf. The order is unspecified but deterministic. Newly + // created books will not necessarily be added to the end of this list. + // Returns NOT_FOUND if the shelf does not exist. + ListBooks(context.Context, *ListBooksRequest) (*ListBooksResponse, error) + // Deletes a book. Returns NOT_FOUND if the book does not exist. + DeleteBook(context.Context, *DeleteBookRequest) (*google_protobuf1.Empty, error) + // Updates a book. Returns INVALID_ARGUMENT if the name of the book + // is non-empty and does equal the previous name. + UpdateBook(context.Context, *UpdateBookRequest) (*Book, error) + // Moves a book to another shelf, and returns the new book. The book + // id of the new book may not be the same as the original book. + MoveBook(context.Context, *MoveBookRequest) (*Book, error) +} + +func RegisterLibraryServiceServer(s *grpc.Server, srv LibraryServiceServer) { + s.RegisterService(&_LibraryService_serviceDesc, srv) +} + +func _LibraryService_CreateShelf_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateShelfRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LibraryServiceServer).CreateShelf(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.example.library.v1.LibraryService/CreateShelf", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LibraryServiceServer).CreateShelf(ctx, req.(*CreateShelfRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LibraryService_GetShelf_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetShelfRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LibraryServiceServer).GetShelf(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.example.library.v1.LibraryService/GetShelf", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LibraryServiceServer).GetShelf(ctx, req.(*GetShelfRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LibraryService_ListShelves_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListShelvesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LibraryServiceServer).ListShelves(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.example.library.v1.LibraryService/ListShelves", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LibraryServiceServer).ListShelves(ctx, req.(*ListShelvesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LibraryService_DeleteShelf_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteShelfRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LibraryServiceServer).DeleteShelf(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.example.library.v1.LibraryService/DeleteShelf", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LibraryServiceServer).DeleteShelf(ctx, req.(*DeleteShelfRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LibraryService_MergeShelves_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MergeShelvesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LibraryServiceServer).MergeShelves(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.example.library.v1.LibraryService/MergeShelves", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LibraryServiceServer).MergeShelves(ctx, req.(*MergeShelvesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LibraryService_CreateBook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateBookRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LibraryServiceServer).CreateBook(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.example.library.v1.LibraryService/CreateBook", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LibraryServiceServer).CreateBook(ctx, req.(*CreateBookRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LibraryService_GetBook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetBookRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LibraryServiceServer).GetBook(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.example.library.v1.LibraryService/GetBook", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LibraryServiceServer).GetBook(ctx, req.(*GetBookRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LibraryService_ListBooks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListBooksRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LibraryServiceServer).ListBooks(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.example.library.v1.LibraryService/ListBooks", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LibraryServiceServer).ListBooks(ctx, req.(*ListBooksRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LibraryService_DeleteBook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteBookRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LibraryServiceServer).DeleteBook(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.example.library.v1.LibraryService/DeleteBook", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LibraryServiceServer).DeleteBook(ctx, req.(*DeleteBookRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LibraryService_UpdateBook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateBookRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LibraryServiceServer).UpdateBook(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.example.library.v1.LibraryService/UpdateBook", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LibraryServiceServer).UpdateBook(ctx, req.(*UpdateBookRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LibraryService_MoveBook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MoveBookRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LibraryServiceServer).MoveBook(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.example.library.v1.LibraryService/MoveBook", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LibraryServiceServer).MoveBook(ctx, req.(*MoveBookRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _LibraryService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.example.library.v1.LibraryService", + HandlerType: (*LibraryServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateShelf", + Handler: _LibraryService_CreateShelf_Handler, + }, + { + MethodName: "GetShelf", + Handler: _LibraryService_GetShelf_Handler, + }, + { + MethodName: "ListShelves", + Handler: _LibraryService_ListShelves_Handler, + }, + { + MethodName: "DeleteShelf", + Handler: _LibraryService_DeleteShelf_Handler, + }, + { + MethodName: "MergeShelves", + Handler: _LibraryService_MergeShelves_Handler, + }, + { + MethodName: "CreateBook", + Handler: _LibraryService_CreateBook_Handler, + }, + { + MethodName: "GetBook", + Handler: _LibraryService_GetBook_Handler, + }, + { + MethodName: "ListBooks", + Handler: _LibraryService_ListBooks_Handler, + }, + { + MethodName: "DeleteBook", + Handler: _LibraryService_DeleteBook_Handler, + }, + { + MethodName: "UpdateBook", + Handler: _LibraryService_UpdateBook_Handler, + }, + { + MethodName: "MoveBook", + Handler: _LibraryService_MoveBook_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/example/library/v1/library.proto", +} + +func init() { proto.RegisterFile("google/example/library/v1/library.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 838 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xdb, 0x4e, 0xdb, 0x48, + 0x18, 0x96, 0x21, 0x81, 0xf0, 0x87, 0x53, 0x06, 0x84, 0xb2, 0x26, 0x2c, 0xd9, 0x11, 0x87, 0x6c, + 0x96, 0xb5, 0x05, 0x68, 0xf7, 0x22, 0x55, 0xa5, 0x8a, 0xb6, 0xe2, 0x06, 0xda, 0x28, 0x69, 0x6f, + 0x2a, 0xa4, 0xc8, 0x81, 0xc1, 0xb1, 0x48, 0x3c, 0xc6, 0x36, 0x11, 0x07, 0xf5, 0xa2, 0x95, 0x10, + 0x52, 0x6f, 0xfb, 0x0a, 0x7d, 0xa3, 0xbe, 0x42, 0x1f, 0xa4, 0x9a, 0x83, 0xc1, 0x24, 0x66,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14, 0x62, 0x31, 0x64, + 0x7f, 0xff, 0x83, 0x2c, 0x93, 0x19, 0x75, 0x37, 0x35, 0x29, 0x81, 0x1e, 0xb9, 0xb5, 0x47, 0x50, + 0x78, 0xef, 0x9d, 0xfc, 0xae, 0xda, 0x6e, 0x42, 0x41, 0x0c, 0x4e, 0x5a, 0x79, 0xdf, 0xc2, 0xdc, + 0x21, 0xed, 0xa7, 0x8a, 0x18, 0x79, 0x66, 0x76, 0xbe, 0xe5, 0x61, 0xf6, 0x40, 0x68, 0x6a, 0x12, + 0xbf, 0xef, 0x1c, 0x13, 0x74, 0x0d, 0xf9, 0x98, 0x0f, 0xa0, 0x7f, 0x15, 0x29, 0x0c, 0xfb, 0x85, + 0x9e, 0xfa, 0xac, 0xb0, 0xfe, 0xf9, 0xfb, 0x8f, 0xaf, 0x63, 0x8b, 0x38, 0xcf, 0x9c, 0x56, 0x3e, + 0xb1, 0x9a, 0x70, 0x0d, 0xd4, 0x87, 0x5c, 0xe4, 0x1a, 0xa8, 0xaa, 0x60, 0x1a, 0xb0, 0x96, 0x11, + 0xa2, 0x96, 0x78, 0xd4, 0x25, 0xb4, 0xc8, 0xa2, 0xde, 0xb0, 0x8a, 0x3c, 0x97, 0xb1, 0xcd, 0xea, + 0x47, 0xf4, 0x49, 0x83, 0x7c, 0xcc, 0x35, 0x94, 0x49, 0x0f, 0xfb, 0x95, 0x6e, 0x8c, 0x0a, 0x17, + 0xc3, 0x8a, 0x17, 0xb8, 0x98, 0x19, 0x14, 0x2f, 0x01, 0xf2, 0x21, 0x1f, 0x73, 0x0f, 0xa5, 0x84, + 0x61, 0x97, 0xd1, 0x97, 0x22, 0x78, 0xf4, 0x63, 0x63, 0xbc, 0x66, 0x3f, 0x36, 0x51, 0xde, 0xd5, + 0xe4, 0xbc, 0xef, 0x34, 0x98, 0x8e, 0x1b, 0x11, 0x52, 0x65, 0x92, 0xe0, 0x58, 0x23, 0x14, 0x7e, + 0x9d, 0x0b, 0x58, 0xc5, 0x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0x2c, 0xcf, 0x09, 0x12, 0xfe, + 0xfb, 0x3e, 0x93, 0x9f, 0xed, 0x09, 0x0e, 0xde, 0xfd, 0x19, 0x00, 0x00, 0xff, 0xff, 0x2b, 0x13, + 0xc5, 0x7e, 0x27, 0x0b, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/firestore/admin/v1beta1/firestore_admin.pb.go b/vendor/google.golang.org/genproto/googleapis/firestore/admin/v1beta1/firestore_admin.pb.go new file mode 100644 index 0000000000..13914e22bc --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/firestore/admin/v1beta1/firestore_admin.pb.go @@ -0,0 +1,583 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/firestore/admin/v1beta1/firestore_admin.proto + +/* +Package admin is a generated protocol buffer package. + +It is generated from these files: + google/firestore/admin/v1beta1/firestore_admin.proto + google/firestore/admin/v1beta1/index.proto + +It has these top-level messages: + IndexOperationMetadata + Progress + CreateIndexRequest + GetIndexRequest + ListIndexesRequest + DeleteIndexRequest + ListIndexesResponse + IndexField + Index +*/ +package admin + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_longrunning "google.golang.org/genproto/googleapis/longrunning" +import google_protobuf2 "github.com/golang/protobuf/ptypes/empty" +import google_protobuf3 "github.com/golang/protobuf/ptypes/timestamp" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// The type of index operation. +type IndexOperationMetadata_OperationType int32 + +const ( + // Unspecified. Never set by server. + IndexOperationMetadata_OPERATION_TYPE_UNSPECIFIED IndexOperationMetadata_OperationType = 0 + // The operation is creating the index. Initiated by a `CreateIndex` call. + IndexOperationMetadata_CREATING_INDEX IndexOperationMetadata_OperationType = 1 +) + +var IndexOperationMetadata_OperationType_name = map[int32]string{ + 0: "OPERATION_TYPE_UNSPECIFIED", + 1: "CREATING_INDEX", +} +var IndexOperationMetadata_OperationType_value = map[string]int32{ + "OPERATION_TYPE_UNSPECIFIED": 0, + "CREATING_INDEX": 1, +} + +func (x IndexOperationMetadata_OperationType) String() string { + return proto.EnumName(IndexOperationMetadata_OperationType_name, int32(x)) +} +func (IndexOperationMetadata_OperationType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{0, 0} +} + +// Metadata for index operations. This metadata populates +// the metadata field of [google.longrunning.Operation][google.longrunning.Operation]. +type IndexOperationMetadata struct { + // The time that work began on the operation. + StartTime *google_protobuf3.Timestamp `protobuf:"bytes,1,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + // The time the operation ended, either successfully or otherwise. Unset if + // the operation is still active. + EndTime *google_protobuf3.Timestamp `protobuf:"bytes,2,opt,name=end_time,json=endTime" json:"end_time,omitempty"` + // The index resource that this operation is acting on. For example: + // `projects/{project_id}/databases/{database_id}/indexes/{index_id}` + Index string `protobuf:"bytes,3,opt,name=index" json:"index,omitempty"` + // The type of index operation. + OperationType IndexOperationMetadata_OperationType `protobuf:"varint,4,opt,name=operation_type,json=operationType,enum=google.firestore.admin.v1beta1.IndexOperationMetadata_OperationType" json:"operation_type,omitempty"` + // True if the [google.longrunning.Operation] was cancelled. If the + // cancellation is in progress, cancelled will be true but + // [google.longrunning.Operation.done][google.longrunning.Operation.done] will be false. + Cancelled bool `protobuf:"varint,5,opt,name=cancelled" json:"cancelled,omitempty"` + // Progress of the existing operation, measured in number of documents. + DocumentProgress *Progress `protobuf:"bytes,6,opt,name=document_progress,json=documentProgress" json:"document_progress,omitempty"` +} + +func (m *IndexOperationMetadata) Reset() { *m = IndexOperationMetadata{} } +func (m *IndexOperationMetadata) String() string { return proto.CompactTextString(m) } +func (*IndexOperationMetadata) ProtoMessage() {} +func (*IndexOperationMetadata) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *IndexOperationMetadata) GetStartTime() *google_protobuf3.Timestamp { + if m != nil { + return m.StartTime + } + return nil +} + +func (m *IndexOperationMetadata) GetEndTime() *google_protobuf3.Timestamp { + if m != nil { + return m.EndTime + } + return nil +} + +func (m *IndexOperationMetadata) GetIndex() string { + if m != nil { + return m.Index + } + return "" +} + +func (m *IndexOperationMetadata) GetOperationType() IndexOperationMetadata_OperationType { + if m != nil { + return m.OperationType + } + return IndexOperationMetadata_OPERATION_TYPE_UNSPECIFIED +} + +func (m *IndexOperationMetadata) GetCancelled() bool { + if m != nil { + return m.Cancelled + } + return false +} + +func (m *IndexOperationMetadata) GetDocumentProgress() *Progress { + if m != nil { + return m.DocumentProgress + } + return nil +} + +// Measures the progress of a particular metric. +type Progress struct { + // An estimate of how much work has been completed. Note that this may be + // greater than `work_estimated`. + WorkCompleted int64 `protobuf:"varint,1,opt,name=work_completed,json=workCompleted" json:"work_completed,omitempty"` + // An estimate of how much work needs to be performed. Zero if the + // work estimate is unavailable. May change as work progresses. + WorkEstimated int64 `protobuf:"varint,2,opt,name=work_estimated,json=workEstimated" json:"work_estimated,omitempty"` +} + +func (m *Progress) Reset() { *m = Progress{} } +func (m *Progress) String() string { return proto.CompactTextString(m) } +func (*Progress) ProtoMessage() {} +func (*Progress) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *Progress) GetWorkCompleted() int64 { + if m != nil { + return m.WorkCompleted + } + return 0 +} + +func (m *Progress) GetWorkEstimated() int64 { + if m != nil { + return m.WorkEstimated + } + return 0 +} + +// The request for [FirestoreAdmin.CreateIndex][google.firestore.admin.v1beta1.FirestoreAdmin.CreateIndex]. +type CreateIndexRequest struct { + // The name of the database this index will apply to. For example: + // `projects/{project_id}/databases/{database_id}` + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // The index to create. The name and state fields are output only and will be + // ignored. Certain single field indexes cannot be created or deleted. + Index *Index `protobuf:"bytes,2,opt,name=index" json:"index,omitempty"` +} + +func (m *CreateIndexRequest) Reset() { *m = CreateIndexRequest{} } +func (m *CreateIndexRequest) String() string { return proto.CompactTextString(m) } +func (*CreateIndexRequest) ProtoMessage() {} +func (*CreateIndexRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *CreateIndexRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *CreateIndexRequest) GetIndex() *Index { + if m != nil { + return m.Index + } + return nil +} + +// The request for [FirestoreAdmin.GetIndex][google.firestore.admin.v1beta1.FirestoreAdmin.GetIndex]. +type GetIndexRequest struct { + // The name of the index. For example: + // `projects/{project_id}/databases/{database_id}/indexes/{index_id}` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetIndexRequest) Reset() { *m = GetIndexRequest{} } +func (m *GetIndexRequest) String() string { return proto.CompactTextString(m) } +func (*GetIndexRequest) ProtoMessage() {} +func (*GetIndexRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *GetIndexRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// The request for [FirestoreAdmin.ListIndexes][google.firestore.admin.v1beta1.FirestoreAdmin.ListIndexes]. +type ListIndexesRequest struct { + // The database name. For example: + // `projects/{project_id}/databases/{database_id}` + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + Filter string `protobuf:"bytes,2,opt,name=filter" json:"filter,omitempty"` + // The standard List page size. + PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // The standard List page token. + PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListIndexesRequest) Reset() { *m = ListIndexesRequest{} } +func (m *ListIndexesRequest) String() string { return proto.CompactTextString(m) } +func (*ListIndexesRequest) ProtoMessage() {} +func (*ListIndexesRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *ListIndexesRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *ListIndexesRequest) GetFilter() string { + if m != nil { + return m.Filter + } + return "" +} + +func (m *ListIndexesRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListIndexesRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// The request for [FirestoreAdmin.DeleteIndex][google.firestore.admin.v1beta1.FirestoreAdmin.DeleteIndex]. +type DeleteIndexRequest struct { + // The index name. For example: + // `projects/{project_id}/databases/{database_id}/indexes/{index_id}` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *DeleteIndexRequest) Reset() { *m = DeleteIndexRequest{} } +func (m *DeleteIndexRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteIndexRequest) ProtoMessage() {} +func (*DeleteIndexRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *DeleteIndexRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// The response for [FirestoreAdmin.ListIndexes][google.firestore.admin.v1beta1.FirestoreAdmin.ListIndexes]. +type ListIndexesResponse struct { + // The indexes. + Indexes []*Index `protobuf:"bytes,1,rep,name=indexes" json:"indexes,omitempty"` + // The standard List next-page token. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListIndexesResponse) Reset() { *m = ListIndexesResponse{} } +func (m *ListIndexesResponse) String() string { return proto.CompactTextString(m) } +func (*ListIndexesResponse) ProtoMessage() {} +func (*ListIndexesResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *ListIndexesResponse) GetIndexes() []*Index { + if m != nil { + return m.Indexes + } + return nil +} + +func (m *ListIndexesResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +func init() { + proto.RegisterType((*IndexOperationMetadata)(nil), "google.firestore.admin.v1beta1.IndexOperationMetadata") + proto.RegisterType((*Progress)(nil), "google.firestore.admin.v1beta1.Progress") + proto.RegisterType((*CreateIndexRequest)(nil), "google.firestore.admin.v1beta1.CreateIndexRequest") + proto.RegisterType((*GetIndexRequest)(nil), "google.firestore.admin.v1beta1.GetIndexRequest") + proto.RegisterType((*ListIndexesRequest)(nil), "google.firestore.admin.v1beta1.ListIndexesRequest") + proto.RegisterType((*DeleteIndexRequest)(nil), "google.firestore.admin.v1beta1.DeleteIndexRequest") + proto.RegisterType((*ListIndexesResponse)(nil), "google.firestore.admin.v1beta1.ListIndexesResponse") + proto.RegisterEnum("google.firestore.admin.v1beta1.IndexOperationMetadata_OperationType", IndexOperationMetadata_OperationType_name, IndexOperationMetadata_OperationType_value) +} + +// 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 + +// Client API for FirestoreAdmin service + +type FirestoreAdminClient interface { + // Creates the specified index. + // A newly created index's initial state is `CREATING`. On completion of the + // returned [google.longrunning.Operation][google.longrunning.Operation], the state will be `READY`. + // If the index already exists, the call will return an `ALREADY_EXISTS` + // status. + // + // During creation, the process could result in an error, in which case the + // index will move to the `ERROR` state. The process can be recovered by + // fixing the data that caused the error, removing the index with + // [delete][google.firestore.admin.v1beta1.FirestoreAdmin.DeleteIndex], then re-creating the index with + // [create][google.firestore.admin.v1beta1.FirestoreAdmin.CreateIndex]. + // + // Indexes with a single field cannot be created. + CreateIndex(ctx context.Context, in *CreateIndexRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Lists the indexes that match the specified filters. + ListIndexes(ctx context.Context, in *ListIndexesRequest, opts ...grpc.CallOption) (*ListIndexesResponse, error) + // Gets an index. + GetIndex(ctx context.Context, in *GetIndexRequest, opts ...grpc.CallOption) (*Index, error) + // Deletes an index. + DeleteIndex(ctx context.Context, in *DeleteIndexRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) +} + +type firestoreAdminClient struct { + cc *grpc.ClientConn +} + +func NewFirestoreAdminClient(cc *grpc.ClientConn) FirestoreAdminClient { + return &firestoreAdminClient{cc} +} + +func (c *firestoreAdminClient) CreateIndex(ctx context.Context, in *CreateIndexRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.firestore.admin.v1beta1.FirestoreAdmin/CreateIndex", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *firestoreAdminClient) ListIndexes(ctx context.Context, in *ListIndexesRequest, opts ...grpc.CallOption) (*ListIndexesResponse, error) { + out := new(ListIndexesResponse) + err := grpc.Invoke(ctx, "/google.firestore.admin.v1beta1.FirestoreAdmin/ListIndexes", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *firestoreAdminClient) GetIndex(ctx context.Context, in *GetIndexRequest, opts ...grpc.CallOption) (*Index, error) { + out := new(Index) + err := grpc.Invoke(ctx, "/google.firestore.admin.v1beta1.FirestoreAdmin/GetIndex", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *firestoreAdminClient) DeleteIndex(ctx context.Context, in *DeleteIndexRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) { + out := new(google_protobuf2.Empty) + err := grpc.Invoke(ctx, "/google.firestore.admin.v1beta1.FirestoreAdmin/DeleteIndex", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for FirestoreAdmin service + +type FirestoreAdminServer interface { + // Creates the specified index. + // A newly created index's initial state is `CREATING`. On completion of the + // returned [google.longrunning.Operation][google.longrunning.Operation], the state will be `READY`. + // If the index already exists, the call will return an `ALREADY_EXISTS` + // status. + // + // During creation, the process could result in an error, in which case the + // index will move to the `ERROR` state. The process can be recovered by + // fixing the data that caused the error, removing the index with + // [delete][google.firestore.admin.v1beta1.FirestoreAdmin.DeleteIndex], then re-creating the index with + // [create][google.firestore.admin.v1beta1.FirestoreAdmin.CreateIndex]. + // + // Indexes with a single field cannot be created. + CreateIndex(context.Context, *CreateIndexRequest) (*google_longrunning.Operation, error) + // Lists the indexes that match the specified filters. + ListIndexes(context.Context, *ListIndexesRequest) (*ListIndexesResponse, error) + // Gets an index. + GetIndex(context.Context, *GetIndexRequest) (*Index, error) + // Deletes an index. + DeleteIndex(context.Context, *DeleteIndexRequest) (*google_protobuf2.Empty, error) +} + +func RegisterFirestoreAdminServer(s *grpc.Server, srv FirestoreAdminServer) { + s.RegisterService(&_FirestoreAdmin_serviceDesc, srv) +} + +func _FirestoreAdmin_CreateIndex_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateIndexRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FirestoreAdminServer).CreateIndex(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.firestore.admin.v1beta1.FirestoreAdmin/CreateIndex", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FirestoreAdminServer).CreateIndex(ctx, req.(*CreateIndexRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _FirestoreAdmin_ListIndexes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListIndexesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FirestoreAdminServer).ListIndexes(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.firestore.admin.v1beta1.FirestoreAdmin/ListIndexes", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FirestoreAdminServer).ListIndexes(ctx, req.(*ListIndexesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _FirestoreAdmin_GetIndex_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetIndexRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FirestoreAdminServer).GetIndex(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.firestore.admin.v1beta1.FirestoreAdmin/GetIndex", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FirestoreAdminServer).GetIndex(ctx, req.(*GetIndexRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _FirestoreAdmin_DeleteIndex_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteIndexRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FirestoreAdminServer).DeleteIndex(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.firestore.admin.v1beta1.FirestoreAdmin/DeleteIndex", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FirestoreAdminServer).DeleteIndex(ctx, req.(*DeleteIndexRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _FirestoreAdmin_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.firestore.admin.v1beta1.FirestoreAdmin", + HandlerType: (*FirestoreAdminServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateIndex", + Handler: _FirestoreAdmin_CreateIndex_Handler, + }, + { + MethodName: "ListIndexes", + Handler: _FirestoreAdmin_ListIndexes_Handler, + }, + { + MethodName: "GetIndex", + Handler: _FirestoreAdmin_GetIndex_Handler, + }, + { + MethodName: "DeleteIndex", + Handler: _FirestoreAdmin_DeleteIndex_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/firestore/admin/v1beta1/firestore_admin.proto", +} + +func init() { + proto.RegisterFile("google/firestore/admin/v1beta1/firestore_admin.proto", fileDescriptor0) +} + +var fileDescriptor0 = []byte{ + // 841 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0xdd, 0x6e, 0xe3, 0x44, + 0x14, 0xc6, 0xe9, 0xcf, 0x26, 0xa7, 0x6a, 0xb6, 0xcc, 0xa2, 0x2a, 0xf2, 0xfe, 0x10, 0x19, 0x8a, + 0xa2, 0x5c, 0xd8, 0x34, 0x0b, 0x12, 0xcb, 0x0a, 0xad, 0x5a, 0xd7, 0xad, 0x22, 0x41, 0x1b, 0xb9, + 0x59, 0xb4, 0x70, 0x63, 0x4d, 0xe3, 0x53, 0xcb, 0xd4, 0x9e, 0x31, 0x9e, 0x09, 0x6c, 0x17, 0x2d, + 0x42, 0xbc, 0xc2, 0xde, 0xee, 0x0d, 0x5c, 0x72, 0x81, 0x78, 0x0b, 0x1e, 0x80, 0x57, 0xe0, 0x41, + 0x90, 0xc7, 0x9e, 0x34, 0xd9, 0x6e, 0x71, 0x7b, 0x97, 0xf3, 0xcd, 0xf9, 0xbe, 0xf3, 0x9d, 0x39, + 0xc7, 0x13, 0xf8, 0x24, 0xe2, 0x3c, 0x4a, 0xd0, 0x39, 0x8d, 0x73, 0x14, 0x92, 0xe7, 0xe8, 0xd0, + 0x30, 0x8d, 0x99, 0xf3, 0xc3, 0xf6, 0x09, 0x4a, 0xba, 0x7d, 0x81, 0x07, 0x0a, 0xb7, 0xb3, 0x9c, + 0x4b, 0x4e, 0x1e, 0x94, 0x2c, 0x7b, 0x76, 0x6a, 0x97, 0xa7, 0x15, 0xcb, 0xbc, 0x57, 0xa9, 0xd2, + 0x2c, 0x76, 0x28, 0x63, 0x5c, 0x52, 0x19, 0x73, 0x26, 0x4a, 0xb6, 0xd9, 0xaf, 0xa9, 0x19, 0xb3, + 0x10, 0x9f, 0x57, 0xb9, 0x1f, 0x54, 0xb9, 0x09, 0x67, 0x51, 0x3e, 0x65, 0x2c, 0x66, 0x91, 0xc3, + 0x33, 0xcc, 0x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, 0x24, 0xaf, 0x0c, 0x58, 0x9b, 0xdb, 0xd9, 0xfa, 0x1b, 0xbd, + 0xbc, 0xe0, 0xe6, 0xe6, 0xa5, 0x77, 0xdc, 0x2b, 0xfe, 0x6e, 0xb4, 0xab, 0xfe, 0x8d, 0x5d, 0xed, + 0xfe, 0x69, 0x80, 0x35, 0xe1, 0x69, 0x8d, 0x97, 0xdd, 0x3b, 0x8b, 0x2b, 0x3c, 0x2a, 0xca, 0x8f, + 0x8c, 0x6f, 0xdd, 0x8a, 0x16, 0xf1, 0x84, 0xb2, 0xc8, 0xe6, 0x79, 0xe4, 0x44, 0xc8, 0x94, 0x39, + 0xa7, 0x3c, 0xa2, 0x59, 0x2c, 0xae, 0xfa, 0xb7, 0x7d, 0xac, 0xa2, 0xdf, 0x1b, 0xcb, 0x07, 0xee, + 0xfe, 0xf1, 0x1f, 0x8d, 0x0f, 0x0f, 0x4a, 0x31, 0x37, 0xe1, 0xd3, 0xd0, 0x9e, 0x15, 0xb4, 0x55, + 0x45, 0xfb, 0xeb, 0xed, 0xdd, 0x82, 0x73, 0xb2, 0xaa, 0xd4, 0x1f, 0xfe, 0x17, 0x00, 0x00, 0xff, + 0xff, 0x6b, 0x78, 0x44, 0x07, 0x3e, 0x08, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/firestore/admin/v1beta1/index.pb.go b/vendor/google.golang.org/genproto/googleapis/firestore/admin/v1beta1/index.pb.go new file mode 100644 index 0000000000..609b679ced --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/firestore/admin/v1beta1/index.pb.go @@ -0,0 +1,205 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/firestore/admin/v1beta1/index.proto + +package admin + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// The mode determines how a field is indexed. +type IndexField_Mode int32 + +const ( + // The mode is unspecified. + IndexField_MODE_UNSPECIFIED IndexField_Mode = 0 + // The field's values are indexed so as to support sequencing in + // ascending order and also query by <, >, <=, >=, and =. + IndexField_ASCENDING IndexField_Mode = 2 + // The field's values are indexed so as to support sequencing in + // descending order and also query by <, >, <=, >=, and =. + IndexField_DESCENDING IndexField_Mode = 3 +) + +var IndexField_Mode_name = map[int32]string{ + 0: "MODE_UNSPECIFIED", + 2: "ASCENDING", + 3: "DESCENDING", +} +var IndexField_Mode_value = map[string]int32{ + "MODE_UNSPECIFIED": 0, + "ASCENDING": 2, + "DESCENDING": 3, +} + +func (x IndexField_Mode) String() string { + return proto.EnumName(IndexField_Mode_name, int32(x)) +} +func (IndexField_Mode) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{0, 0} } + +// The state of an index. During index creation, an index will be in the +// `CREATING` state. If the index is created successfully, it will transition +// to the `READY` state. If the index is not able to be created, it will +// transition to the `ERROR` state. +type Index_State int32 + +const ( + // The state is unspecified. + Index_STATE_UNSPECIFIED Index_State = 0 + // The index is being created. + // There is an active long-running operation for the index. + // The index is updated when writing a document. + // Some index data may exist. + Index_CREATING Index_State = 3 + // The index is ready to be used. + // The index is updated when writing a document. + // The index is fully populated from all stored documents it applies to. + Index_READY Index_State = 2 + // The index was being created, but something went wrong. + // There is no active long-running operation for the index, + // and the most recently finished long-running operation failed. + // The index is not updated when writing a document. + // Some index data may exist. + Index_ERROR Index_State = 5 +) + +var Index_State_name = map[int32]string{ + 0: "STATE_UNSPECIFIED", + 3: "CREATING", + 2: "READY", + 5: "ERROR", +} +var Index_State_value = map[string]int32{ + "STATE_UNSPECIFIED": 0, + "CREATING": 3, + "READY": 2, + "ERROR": 5, +} + +func (x Index_State) String() string { + return proto.EnumName(Index_State_name, int32(x)) +} +func (Index_State) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{1, 0} } + +// A field of an index. +type IndexField struct { + // The path of the field. Must match the field path specification described + // by [google.firestore.v1beta1.Document.fields][fields]. + // Special field path `__name__` may be used by itself or at the end of a + // path. `__type__` may be used only at the end of path. + FieldPath string `protobuf:"bytes,1,opt,name=field_path,json=fieldPath" json:"field_path,omitempty"` + // The field's mode. + Mode IndexField_Mode `protobuf:"varint,2,opt,name=mode,enum=google.firestore.admin.v1beta1.IndexField_Mode" json:"mode,omitempty"` +} + +func (m *IndexField) Reset() { *m = IndexField{} } +func (m *IndexField) String() string { return proto.CompactTextString(m) } +func (*IndexField) ProtoMessage() {} +func (*IndexField) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +func (m *IndexField) GetFieldPath() string { + if m != nil { + return m.FieldPath + } + return "" +} + +func (m *IndexField) GetMode() IndexField_Mode { + if m != nil { + return m.Mode + } + return IndexField_MODE_UNSPECIFIED +} + +// An index definition. +type Index struct { + // The resource name of the index. + // Output only. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The collection ID to which this index applies. Required. + CollectionId string `protobuf:"bytes,2,opt,name=collection_id,json=collectionId" json:"collection_id,omitempty"` + // The fields to index. + Fields []*IndexField `protobuf:"bytes,3,rep,name=fields" json:"fields,omitempty"` + // The state of the index. + // Output only. + State Index_State `protobuf:"varint,6,opt,name=state,enum=google.firestore.admin.v1beta1.Index_State" json:"state,omitempty"` +} + +func (m *Index) Reset() { *m = Index{} } +func (m *Index) String() string { return proto.CompactTextString(m) } +func (*Index) ProtoMessage() {} +func (*Index) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} } + +func (m *Index) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Index) GetCollectionId() string { + if m != nil { + return m.CollectionId + } + return "" +} + +func (m *Index) GetFields() []*IndexField { + if m != nil { + return m.Fields + } + return nil +} + +func (m *Index) GetState() Index_State { + if m != nil { + return m.State + } + return Index_STATE_UNSPECIFIED +} + +func init() { + proto.RegisterType((*IndexField)(nil), "google.firestore.admin.v1beta1.IndexField") + proto.RegisterType((*Index)(nil), "google.firestore.admin.v1beta1.Index") + proto.RegisterEnum("google.firestore.admin.v1beta1.IndexField_Mode", IndexField_Mode_name, IndexField_Mode_value) + proto.RegisterEnum("google.firestore.admin.v1beta1.Index_State", Index_State_name, Index_State_value) +} + +func init() { proto.RegisterFile("google/firestore/admin/v1beta1/index.proto", fileDescriptor1) } + +var fileDescriptor1 = []byte{ + // 422 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0x4f, 0x8b, 0x13, 0x31, + 0x1c, 0x75, 0xa6, 0x9d, 0xe2, 0xfc, 0xdc, 0x5d, 0xc6, 0xa0, 0x50, 0x44, 0xa5, 0x8c, 0x1e, 0xca, + 0x0a, 0x19, 0xba, 0x1e, 0xf7, 0x34, 0xff, 0x5a, 0xe6, 0xb0, 0xdd, 0x92, 0xa9, 0x82, 0x5e, 0x4a, + 0xb6, 0xc9, 0xce, 0x06, 0xa6, 0x49, 0x99, 0x89, 0xe2, 0x77, 0xf0, 0x5b, 0x08, 0x5e, 0x04, 0xbf, + 0xa3, 0x24, 0x33, 0x74, 0x41, 0xd0, 0xed, 0xed, 0xf7, 0x92, 0xf7, 0x5e, 0xde, 0x4b, 0x02, 0xe7, + 0x95, 0x52, 0x55, 0xcd, 0xa3, 0x5b, 0xd1, 0xf0, 0x56, 0xab, 0x86, 0x47, 0x94, 0xed, 0x84, 0x8c, + 0xbe, 0xce, 0x6e, 0xb8, 0xa6, 0xb3, 0x48, 0x48, 0xc6, 0xbf, 0xe1, 0x7d, 0xa3, 0xb4, 0x42, 0xaf, + 0x3b, 0x2e, 0x3e, 0x70, 0xb1, 0xe5, 0xe2, 0x9e, 0xfb, 0xe2, 0x65, 0xef, 0x45, 0xf7, 0x22, 0xa2, + 0x52, 0x2a, 0x4d, 0xb5, 0x50, 0xb2, 0xed, 0xd4, 0xe1, 0x6f, 0x07, 0xa0, 0x30, 0x6e, 0x73, 0xc1, + 0x6b, 0x86,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, 0x02, 0xd7, 0x8c, 0x39, 0x21, 0xd7, 0x24, 0xf0, 0x92, + 0x9f, 0x0e, 0x84, 0x5b, 0xb5, 0x7b, 0xe0, 0xf4, 0xa4, 0x7b, 0xe1, 0x95, 0x79, 0xf0, 0x95, 0xf3, + 0x39, 0xed, 0xd9, 0x95, 0xaa, 0xa9, 0xac, 0xb0, 0x6a, 0xaa, 0xa8, 0xe2, 0xd2, 0x7e, 0x87, 0xa8, + 0xdb, 0xa2, 0x7b, 0xd1, 0xfe, 0xeb, 0xef, 0x5d, 0x5a, 0xf4, 0xc3, 0x1d, 0x2e, 0xd2, 0x79, 0xf9, + 0xcb, 0x7d, 0xbb, 0xe8, 0xcc, 0xd2, 0x5a, 0x7d, 0x61, 0x78, 0x7e, 0x08, 0x10, 0xdb, 0x00, 0x1f, + 0x67, 0x89, 0xd1, 0xdc, 0x8c, 0xac, 0xfb, 0xfb, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x08, 0xcb, + 0x38, 0x95, 0xd8, 0x02, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/firestore/v1beta1/common.pb.go b/vendor/google.golang.org/genproto/googleapis/firestore/v1beta1/common.pb.go new file mode 100644 index 0000000000..51b0b903d2 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/firestore/v1beta1/common.pb.go @@ -0,0 +1,498 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/firestore/v1beta1/common.proto + +/* +Package firestore is a generated protocol buffer package. + +It is generated from these files: + google/firestore/v1beta1/common.proto + google/firestore/v1beta1/document.proto + google/firestore/v1beta1/firestore.proto + google/firestore/v1beta1/query.proto + google/firestore/v1beta1/write.proto + +It has these top-level messages: + DocumentMask + Precondition + TransactionOptions + Document + Value + ArrayValue + MapValue + GetDocumentRequest + ListDocumentsRequest + ListDocumentsResponse + CreateDocumentRequest + UpdateDocumentRequest + DeleteDocumentRequest + BatchGetDocumentsRequest + BatchGetDocumentsResponse + BeginTransactionRequest + BeginTransactionResponse + CommitRequest + CommitResponse + RollbackRequest + RunQueryRequest + RunQueryResponse + WriteRequest + WriteResponse + ListenRequest + ListenResponse + Target + TargetChange + ListCollectionIdsRequest + ListCollectionIdsResponse + StructuredQuery + Cursor + Write + DocumentTransform + WriteResult + DocumentChange + DocumentDelete + DocumentRemove + ExistenceFilter +*/ +package firestore + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf1 "github.com/golang/protobuf/ptypes/timestamp" + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// A set of field paths on a document. +// Used to restrict a get or update operation on a document to a subset of its +// fields. +// This is different from standard field masks, as this is always scoped to a +// [Document][google.firestore.v1beta1.Document], and takes in account the dynamic nature of [Value][google.firestore.v1beta1.Value]. +type DocumentMask struct { + // The list of field paths in the mask. See [Document.fields][google.firestore.v1beta1.Document.fields] for a field + // path syntax reference. + FieldPaths []string `protobuf:"bytes,1,rep,name=field_paths,json=fieldPaths" json:"field_paths,omitempty"` +} + +func (m *DocumentMask) Reset() { *m = DocumentMask{} } +func (m *DocumentMask) String() string { return proto.CompactTextString(m) } +func (*DocumentMask) ProtoMessage() {} +func (*DocumentMask) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *DocumentMask) GetFieldPaths() []string { + if m != nil { + return m.FieldPaths + } + return nil +} + +// A precondition on a document, used for conditional operations. +type Precondition struct { + // The type of precondition. + // + // Types that are valid to be assigned to ConditionType: + // *Precondition_Exists + // *Precondition_UpdateTime + ConditionType isPrecondition_ConditionType `protobuf_oneof:"condition_type"` +} + +func (m *Precondition) Reset() { *m = Precondition{} } +func (m *Precondition) String() string { return proto.CompactTextString(m) } +func (*Precondition) ProtoMessage() {} +func (*Precondition) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +type isPrecondition_ConditionType interface { + isPrecondition_ConditionType() +} + +type Precondition_Exists struct { + Exists bool `protobuf:"varint,1,opt,name=exists,oneof"` +} +type Precondition_UpdateTime struct { + UpdateTime *google_protobuf1.Timestamp `protobuf:"bytes,2,opt,name=update_time,json=updateTime,oneof"` +} + +func (*Precondition_Exists) isPrecondition_ConditionType() {} +func (*Precondition_UpdateTime) isPrecondition_ConditionType() {} + +func (m *Precondition) GetConditionType() isPrecondition_ConditionType { + if m != nil { + return m.ConditionType + } + return nil +} + +func (m *Precondition) GetExists() bool { + if x, ok := m.GetConditionType().(*Precondition_Exists); ok { + return x.Exists + } + return false +} + +func (m *Precondition) GetUpdateTime() *google_protobuf1.Timestamp { + if x, ok := m.GetConditionType().(*Precondition_UpdateTime); ok { + return x.UpdateTime + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Precondition) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _Precondition_OneofMarshaler, _Precondition_OneofUnmarshaler, _Precondition_OneofSizer, []interface{}{ + (*Precondition_Exists)(nil), + (*Precondition_UpdateTime)(nil), + } +} + +func _Precondition_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Precondition) + // condition_type + switch x := m.ConditionType.(type) { + case *Precondition_Exists: + t := uint64(0) + if x.Exists { + t = 1 + } + b.EncodeVarint(1<<3 | proto.WireVarint) + b.EncodeVarint(t) + case *Precondition_UpdateTime: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.UpdateTime); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("Precondition.ConditionType has unexpected type %T", x) + } + return nil +} + +func _Precondition_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Precondition) + switch tag { + case 1: // condition_type.exists + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.ConditionType = &Precondition_Exists{x != 0} + return true, err + case 2: // condition_type.update_time + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(google_protobuf1.Timestamp) + err := b.DecodeMessage(msg) + m.ConditionType = &Precondition_UpdateTime{msg} + return true, err + default: + return false, nil + } +} + +func _Precondition_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Precondition) + // condition_type + switch x := m.ConditionType.(type) { + case *Precondition_Exists: + n += proto.SizeVarint(1<<3 | proto.WireVarint) + n += 1 + case *Precondition_UpdateTime: + s := proto.Size(x.UpdateTime) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Options for creating a new transaction. +type TransactionOptions struct { + // The mode of the transaction. + // + // Types that are valid to be assigned to Mode: + // *TransactionOptions_ReadOnly_ + // *TransactionOptions_ReadWrite_ + Mode isTransactionOptions_Mode `protobuf_oneof:"mode"` +} + +func (m *TransactionOptions) Reset() { *m = TransactionOptions{} } +func (m *TransactionOptions) String() string { return proto.CompactTextString(m) } +func (*TransactionOptions) ProtoMessage() {} +func (*TransactionOptions) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +type isTransactionOptions_Mode interface { + isTransactionOptions_Mode() +} + +type TransactionOptions_ReadOnly_ struct { + ReadOnly *TransactionOptions_ReadOnly `protobuf:"bytes,2,opt,name=read_only,json=readOnly,oneof"` +} +type TransactionOptions_ReadWrite_ struct { + ReadWrite *TransactionOptions_ReadWrite `protobuf:"bytes,3,opt,name=read_write,json=readWrite,oneof"` +} + +func (*TransactionOptions_ReadOnly_) isTransactionOptions_Mode() {} +func (*TransactionOptions_ReadWrite_) isTransactionOptions_Mode() {} + +func (m *TransactionOptions) GetMode() isTransactionOptions_Mode { + if m != nil { + return m.Mode + } + return nil +} + +func (m *TransactionOptions) GetReadOnly() *TransactionOptions_ReadOnly { + if x, ok := m.GetMode().(*TransactionOptions_ReadOnly_); ok { + return x.ReadOnly + } + return nil +} + +func (m *TransactionOptions) GetReadWrite() *TransactionOptions_ReadWrite { + if x, ok := m.GetMode().(*TransactionOptions_ReadWrite_); ok { + return x.ReadWrite + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*TransactionOptions) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _TransactionOptions_OneofMarshaler, _TransactionOptions_OneofUnmarshaler, _TransactionOptions_OneofSizer, []interface{}{ + (*TransactionOptions_ReadOnly_)(nil), + (*TransactionOptions_ReadWrite_)(nil), + } +} + +func _TransactionOptions_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*TransactionOptions) + // mode + switch x := m.Mode.(type) { + case *TransactionOptions_ReadOnly_: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ReadOnly); err != nil { + return err + } + case *TransactionOptions_ReadWrite_: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ReadWrite); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("TransactionOptions.Mode has unexpected type %T", x) + } + return nil +} + +func _TransactionOptions_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*TransactionOptions) + switch tag { + case 2: // mode.read_only + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(TransactionOptions_ReadOnly) + err := b.DecodeMessage(msg) + m.Mode = &TransactionOptions_ReadOnly_{msg} + return true, err + case 3: // mode.read_write + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(TransactionOptions_ReadWrite) + err := b.DecodeMessage(msg) + m.Mode = &TransactionOptions_ReadWrite_{msg} + return true, err + default: + return false, nil + } +} + +func _TransactionOptions_OneofSizer(msg proto.Message) (n int) { + m := msg.(*TransactionOptions) + // mode + switch x := m.Mode.(type) { + case *TransactionOptions_ReadOnly_: + s := proto.Size(x.ReadOnly) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *TransactionOptions_ReadWrite_: + s := proto.Size(x.ReadWrite) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Options for a transaction that can be used to read and write documents. +type TransactionOptions_ReadWrite struct { + // An optional transaction to retry. + RetryTransaction []byte `protobuf:"bytes,1,opt,name=retry_transaction,json=retryTransaction,proto3" json:"retry_transaction,omitempty"` +} + +func (m *TransactionOptions_ReadWrite) Reset() { *m = TransactionOptions_ReadWrite{} } +func (m *TransactionOptions_ReadWrite) String() string { return proto.CompactTextString(m) } +func (*TransactionOptions_ReadWrite) ProtoMessage() {} +func (*TransactionOptions_ReadWrite) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2, 0} } + +func (m *TransactionOptions_ReadWrite) GetRetryTransaction() []byte { + if m != nil { + return m.RetryTransaction + } + return nil +} + +// Options for a transaction that can only be used to read documents. +type TransactionOptions_ReadOnly struct { + // The consistency mode for this transaction. If not set, defaults to strong + // consistency. + // + // Types that are valid to be assigned to ConsistencySelector: + // *TransactionOptions_ReadOnly_ReadTime + ConsistencySelector isTransactionOptions_ReadOnly_ConsistencySelector `protobuf_oneof:"consistency_selector"` +} + +func (m *TransactionOptions_ReadOnly) Reset() { *m = TransactionOptions_ReadOnly{} } +func (m *TransactionOptions_ReadOnly) String() string { return proto.CompactTextString(m) } +func (*TransactionOptions_ReadOnly) ProtoMessage() {} +func (*TransactionOptions_ReadOnly) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2, 1} } + +type isTransactionOptions_ReadOnly_ConsistencySelector interface { + isTransactionOptions_ReadOnly_ConsistencySelector() +} + +type TransactionOptions_ReadOnly_ReadTime struct { + ReadTime *google_protobuf1.Timestamp `protobuf:"bytes,2,opt,name=read_time,json=readTime,oneof"` +} + +func (*TransactionOptions_ReadOnly_ReadTime) isTransactionOptions_ReadOnly_ConsistencySelector() {} + +func (m *TransactionOptions_ReadOnly) GetConsistencySelector() isTransactionOptions_ReadOnly_ConsistencySelector { + if m != nil { + return m.ConsistencySelector + } + return nil +} + +func (m *TransactionOptions_ReadOnly) GetReadTime() *google_protobuf1.Timestamp { + if x, ok := m.GetConsistencySelector().(*TransactionOptions_ReadOnly_ReadTime); ok { + return x.ReadTime + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*TransactionOptions_ReadOnly) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _TransactionOptions_ReadOnly_OneofMarshaler, _TransactionOptions_ReadOnly_OneofUnmarshaler, _TransactionOptions_ReadOnly_OneofSizer, []interface{}{ + (*TransactionOptions_ReadOnly_ReadTime)(nil), + } +} + +func _TransactionOptions_ReadOnly_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*TransactionOptions_ReadOnly) + // consistency_selector + switch x := m.ConsistencySelector.(type) { + case *TransactionOptions_ReadOnly_ReadTime: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ReadTime); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("TransactionOptions_ReadOnly.ConsistencySelector has unexpected type %T", x) + } + return nil +} + +func _TransactionOptions_ReadOnly_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*TransactionOptions_ReadOnly) + switch tag { + case 2: // consistency_selector.read_time + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(google_protobuf1.Timestamp) + err := b.DecodeMessage(msg) + m.ConsistencySelector = &TransactionOptions_ReadOnly_ReadTime{msg} + return true, err + default: + return false, nil + } +} + +func _TransactionOptions_ReadOnly_OneofSizer(msg proto.Message) (n int) { + m := msg.(*TransactionOptions_ReadOnly) + // consistency_selector + switch x := m.ConsistencySelector.(type) { + case *TransactionOptions_ReadOnly_ReadTime: + s := proto.Size(x.ReadTime) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +func init() { + proto.RegisterType((*DocumentMask)(nil), "google.firestore.v1beta1.DocumentMask") + proto.RegisterType((*Precondition)(nil), "google.firestore.v1beta1.Precondition") + proto.RegisterType((*TransactionOptions)(nil), "google.firestore.v1beta1.TransactionOptions") + proto.RegisterType((*TransactionOptions_ReadWrite)(nil), "google.firestore.v1beta1.TransactionOptions.ReadWrite") + proto.RegisterType((*TransactionOptions_ReadOnly)(nil), "google.firestore.v1beta1.TransactionOptions.ReadOnly") +} + +func init() { proto.RegisterFile("google/firestore/v1beta1/common.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 468 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x52, 0xef, 0x8a, 0xd3, 0x40, + 0x10, 0x6f, 0x7a, 0xc7, 0xd1, 0x4e, 0x8b, 0x9c, 0x41, 0x24, 0x84, 0xc3, 0x3b, 0x0a, 0x42, 0x41, + 0xd8, 0x50, 0x45, 0x51, 0xc4, 0x0f, 0xa6, 0x72, 0xd7, 0x2f, 0x72, 0x25, 0x96, 0x3b, 0x90, 0x4a, + 0xd8, 0x26, 0xd3, 0xb8, 0x98, 0xec, 0x84, 0xdd, 0xad, 0x9a, 0xd7, 0xf1, 0xa3, 0x6f, 0xe0, 0x2b, + 0xf8, 0x1c, 0x3e, 0x88, 0x64, 0x93, 0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0x2c, 0xac, 0x37, 0x7e, 0xee, 0x01, 0x6b, 0x0b, 0x58, 0x77, 0x80, 0xf5, 0x55, + 0x43, 0xb9, 0x39, 0xb2, 0xb2, 0x4f, 0x7e, 0x07, 0x00, 0x00, 0xff, 0xff, 0x91, 0x06, 0xe4, 0x5b, + 0x57, 0x03, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/firestore/v1beta1/document.pb.go b/vendor/google.golang.org/genproto/googleapis/firestore/v1beta1/document.pb.go new file mode 100644 index 0000000000..d30f25a2eb --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/firestore/v1beta1/document.pb.go @@ -0,0 +1,566 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/firestore/v1beta1/document.proto + +package firestore + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf2 "github.com/golang/protobuf/ptypes/struct" +import google_protobuf1 "github.com/golang/protobuf/ptypes/timestamp" +import google_type "google.golang.org/genproto/googleapis/type/latlng" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// A Firestore document. +// +// Must not exceed 1 MiB - 4 bytes. +type Document struct { + // The resource name of the document, for example + // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The document's fields. + // + // The map keys represent field names. + // + // A simple field name contains only characters `a` to `z`, `A` to `Z`, + // `0` to `9`, or `_`, and must not start with `0` to `9` or `_`. For example, + // `foo_bar_17`. + // + // Field names matching the regular expression `__.*__` are reserved. Reserved + // field names are forbidden except in certain documented contexts. The map + // keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be + // empty. + // + // Field paths may be used in other contexts to refer to structured fields + // defined here. For `map_value`, the field path is represented by the simple + // or quoted field names of the containing fields, delimited by `.`. For + // example, the structured field + // `"foo" : { map_value: { "x&y" : { string_value: "hello" }}}` would be + // represented by the field path `foo.x&y`. + // + // Within a field path, a quoted field name starts and ends with `` ` `` and + // may contain any character. Some characters, including `` ` ``, must be + // escaped using a `\`. For example, `` `x&y` `` represents `x&y` and + // `` `bak\`tik` `` represents `` bak`tik ``. + Fields map[string]*Value `protobuf:"bytes,2,rep,name=fields" json:"fields,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // Output only. The time at which the document was created. + // + // This value increases monotonically when a document is deleted then + // recreated. It can also be compared to values from other documents and + // the `read_time` of a query. + CreateTime *google_protobuf1.Timestamp `protobuf:"bytes,3,opt,name=create_time,json=createTime" json:"create_time,omitempty"` + // Output only. The time at which the document was last changed. + // + // This value is initally set to the `create_time` then increases + // monotonically with each change to the document. It can also be + // compared to values from other documents and the `read_time` of a query. + UpdateTime *google_protobuf1.Timestamp `protobuf:"bytes,4,opt,name=update_time,json=updateTime" json:"update_time,omitempty"` +} + +func (m *Document) Reset() { *m = Document{} } +func (m *Document) String() string { return proto.CompactTextString(m) } +func (*Document) ProtoMessage() {} +func (*Document) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +func (m *Document) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Document) GetFields() map[string]*Value { + if m != nil { + return m.Fields + } + return nil +} + +func (m *Document) GetCreateTime() *google_protobuf1.Timestamp { + if m != nil { + return m.CreateTime + } + return nil +} + +func (m *Document) GetUpdateTime() *google_protobuf1.Timestamp { + if m != nil { + return m.UpdateTime + } + return nil +} + +// A message that can hold any of the supported value types. +type Value struct { + // Must have a value set. + // + // Types that are valid to be assigned to ValueType: + // *Value_NullValue + // *Value_BooleanValue + // *Value_IntegerValue + // *Value_DoubleValue + // *Value_TimestampValue + // *Value_StringValue + // *Value_BytesValue + // *Value_ReferenceValue + // *Value_GeoPointValue + // *Value_ArrayValue + // *Value_MapValue + ValueType isValue_ValueType `protobuf_oneof:"value_type"` +} + +func (m *Value) Reset() { *m = Value{} } +func (m *Value) String() string { return proto.CompactTextString(m) } +func (*Value) ProtoMessage() {} +func (*Value) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} } + +type isValue_ValueType interface { + isValue_ValueType() +} + +type Value_NullValue struct { + NullValue google_protobuf2.NullValue `protobuf:"varint,11,opt,name=null_value,json=nullValue,enum=google.protobuf.NullValue,oneof"` +} +type Value_BooleanValue struct { + BooleanValue bool `protobuf:"varint,1,opt,name=boolean_value,json=booleanValue,oneof"` +} +type Value_IntegerValue struct { + IntegerValue int64 `protobuf:"varint,2,opt,name=integer_value,json=integerValue,oneof"` +} +type Value_DoubleValue struct { + DoubleValue float64 `protobuf:"fixed64,3,opt,name=double_value,json=doubleValue,oneof"` +} +type Value_TimestampValue struct { + TimestampValue *google_protobuf1.Timestamp `protobuf:"bytes,10,opt,name=timestamp_value,json=timestampValue,oneof"` +} +type Value_StringValue struct { + StringValue string `protobuf:"bytes,17,opt,name=string_value,json=stringValue,oneof"` +} +type Value_BytesValue struct { + BytesValue []byte `protobuf:"bytes,18,opt,name=bytes_value,json=bytesValue,proto3,oneof"` +} +type Value_ReferenceValue struct { + ReferenceValue string `protobuf:"bytes,5,opt,name=reference_value,json=referenceValue,oneof"` +} +type Value_GeoPointValue struct { + GeoPointValue *google_type.LatLng `protobuf:"bytes,8,opt,name=geo_point_value,json=geoPointValue,oneof"` +} +type Value_ArrayValue struct { + ArrayValue *ArrayValue `protobuf:"bytes,9,opt,name=array_value,json=arrayValue,oneof"` +} +type Value_MapValue struct { + MapValue *MapValue `protobuf:"bytes,6,opt,name=map_value,json=mapValue,oneof"` +} + +func (*Value_NullValue) isValue_ValueType() {} +func (*Value_BooleanValue) isValue_ValueType() {} +func (*Value_IntegerValue) isValue_ValueType() {} +func (*Value_DoubleValue) isValue_ValueType() {} +func (*Value_TimestampValue) isValue_ValueType() {} +func (*Value_StringValue) isValue_ValueType() {} +func (*Value_BytesValue) isValue_ValueType() {} +func (*Value_ReferenceValue) isValue_ValueType() {} +func (*Value_GeoPointValue) isValue_ValueType() {} +func (*Value_ArrayValue) isValue_ValueType() {} +func (*Value_MapValue) isValue_ValueType() {} + +func (m *Value) GetValueType() isValue_ValueType { + if m != nil { + return m.ValueType + } + return nil +} + +func (m *Value) GetNullValue() google_protobuf2.NullValue { + if x, ok := m.GetValueType().(*Value_NullValue); ok { + return x.NullValue + } + return google_protobuf2.NullValue_NULL_VALUE +} + +func (m *Value) GetBooleanValue() bool { + if x, ok := m.GetValueType().(*Value_BooleanValue); ok { + return x.BooleanValue + } + return false +} + +func (m *Value) GetIntegerValue() int64 { + if x, ok := m.GetValueType().(*Value_IntegerValue); ok { + return x.IntegerValue + } + return 0 +} + +func (m *Value) GetDoubleValue() float64 { + if x, ok := m.GetValueType().(*Value_DoubleValue); ok { + return x.DoubleValue + } + return 0 +} + +func (m *Value) GetTimestampValue() *google_protobuf1.Timestamp { + if x, ok := m.GetValueType().(*Value_TimestampValue); ok { + return x.TimestampValue + } + return nil +} + +func (m *Value) GetStringValue() string { + if x, ok := m.GetValueType().(*Value_StringValue); ok { + return x.StringValue + } + return "" +} + +func (m *Value) GetBytesValue() []byte { + if x, ok := m.GetValueType().(*Value_BytesValue); ok { + return x.BytesValue + } + return nil +} + +func (m *Value) GetReferenceValue() string { + if x, ok := m.GetValueType().(*Value_ReferenceValue); ok { + return x.ReferenceValue + } + return "" +} + +func (m *Value) GetGeoPointValue() *google_type.LatLng { + if x, ok := m.GetValueType().(*Value_GeoPointValue); ok { + return x.GeoPointValue + } + return nil +} + +func (m *Value) GetArrayValue() *ArrayValue { + if x, ok := m.GetValueType().(*Value_ArrayValue); ok { + return x.ArrayValue + } + return nil +} + +func (m *Value) GetMapValue() *MapValue { + if x, ok := m.GetValueType().(*Value_MapValue); ok { + return x.MapValue + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Value) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _Value_OneofMarshaler, _Value_OneofUnmarshaler, _Value_OneofSizer, []interface{}{ + (*Value_NullValue)(nil), + (*Value_BooleanValue)(nil), + (*Value_IntegerValue)(nil), + (*Value_DoubleValue)(nil), + (*Value_TimestampValue)(nil), + (*Value_StringValue)(nil), + (*Value_BytesValue)(nil), + (*Value_ReferenceValue)(nil), + (*Value_GeoPointValue)(nil), + (*Value_ArrayValue)(nil), + (*Value_MapValue)(nil), + } +} + +func _Value_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Value) + // value_type + switch x := m.ValueType.(type) { + case *Value_NullValue: + b.EncodeVarint(11<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.NullValue)) + case *Value_BooleanValue: + t := uint64(0) + if x.BooleanValue { + t = 1 + } + b.EncodeVarint(1<<3 | proto.WireVarint) + b.EncodeVarint(t) + case *Value_IntegerValue: + b.EncodeVarint(2<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.IntegerValue)) + case *Value_DoubleValue: + b.EncodeVarint(3<<3 | proto.WireFixed64) + b.EncodeFixed64(math.Float64bits(x.DoubleValue)) + case *Value_TimestampValue: + b.EncodeVarint(10<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.TimestampValue); err != nil { + return err + } + case *Value_StringValue: + b.EncodeVarint(17<<3 | proto.WireBytes) + b.EncodeStringBytes(x.StringValue) + case *Value_BytesValue: + b.EncodeVarint(18<<3 | proto.WireBytes) + b.EncodeRawBytes(x.BytesValue) + case *Value_ReferenceValue: + b.EncodeVarint(5<<3 | proto.WireBytes) + b.EncodeStringBytes(x.ReferenceValue) + case *Value_GeoPointValue: + b.EncodeVarint(8<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.GeoPointValue); err != nil { + return err + } + case *Value_ArrayValue: + b.EncodeVarint(9<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ArrayValue); err != nil { + return err + } + case *Value_MapValue: + b.EncodeVarint(6<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.MapValue); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("Value.ValueType has unexpected type %T", x) + } + return nil +} + +func _Value_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Value) + switch tag { + case 11: // value_type.null_value + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.ValueType = &Value_NullValue{google_protobuf2.NullValue(x)} + return true, err + case 1: // value_type.boolean_value + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.ValueType = &Value_BooleanValue{x != 0} + return true, err + case 2: // value_type.integer_value + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.ValueType = &Value_IntegerValue{int64(x)} + return true, err + case 3: // value_type.double_value + if wire != proto.WireFixed64 { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeFixed64() + m.ValueType = &Value_DoubleValue{math.Float64frombits(x)} + return true, err + case 10: // value_type.timestamp_value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(google_protobuf1.Timestamp) + err := b.DecodeMessage(msg) + m.ValueType = &Value_TimestampValue{msg} + return true, err + case 17: // value_type.string_value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.ValueType = &Value_StringValue{x} + return true, err + case 18: // value_type.bytes_value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.ValueType = &Value_BytesValue{x} + return true, err + case 5: // value_type.reference_value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.ValueType = &Value_ReferenceValue{x} + return true, err + case 8: // value_type.geo_point_value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(google_type.LatLng) + err := b.DecodeMessage(msg) + m.ValueType = &Value_GeoPointValue{msg} + return true, err + case 9: // value_type.array_value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ArrayValue) + err := b.DecodeMessage(msg) + m.ValueType = &Value_ArrayValue{msg} + return true, err + case 6: // value_type.map_value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(MapValue) + err := b.DecodeMessage(msg) + m.ValueType = &Value_MapValue{msg} + return true, err + default: + return false, nil + } +} + +func _Value_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Value) + // value_type + switch x := m.ValueType.(type) { + case *Value_NullValue: + n += proto.SizeVarint(11<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.NullValue)) + case *Value_BooleanValue: + n += proto.SizeVarint(1<<3 | proto.WireVarint) + n += 1 + case *Value_IntegerValue: + n += proto.SizeVarint(2<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.IntegerValue)) + case *Value_DoubleValue: + n += proto.SizeVarint(3<<3 | proto.WireFixed64) + n += 8 + case *Value_TimestampValue: + s := proto.Size(x.TimestampValue) + n += proto.SizeVarint(10<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Value_StringValue: + n += proto.SizeVarint(17<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.StringValue))) + n += len(x.StringValue) + case *Value_BytesValue: + n += proto.SizeVarint(18<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.BytesValue))) + n += len(x.BytesValue) + case *Value_ReferenceValue: + n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.ReferenceValue))) + n += len(x.ReferenceValue) + case *Value_GeoPointValue: + s := proto.Size(x.GeoPointValue) + n += proto.SizeVarint(8<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Value_ArrayValue: + s := proto.Size(x.ArrayValue) + n += proto.SizeVarint(9<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Value_MapValue: + s := proto.Size(x.MapValue) + n += proto.SizeVarint(6<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// An array value. +type ArrayValue struct { + // Values in the array. + Values []*Value `protobuf:"bytes,1,rep,name=values" json:"values,omitempty"` +} + +func (m *ArrayValue) Reset() { *m = ArrayValue{} } +func (m *ArrayValue) String() string { return proto.CompactTextString(m) } +func (*ArrayValue) ProtoMessage() {} +func (*ArrayValue) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} } + +func (m *ArrayValue) GetValues() []*Value { + if m != nil { + return m.Values + } + return nil +} + +// A map value. +type MapValue struct { + // The map's fields. + // + // The map keys represent field names. Field names matching the regular + // expression `__.*__` are reserved. Reserved field names are forbidden except + // in certain documented contexts. The map keys, represented as UTF-8, must + // not exceed 1,500 bytes and cannot be empty. + Fields map[string]*Value `protobuf:"bytes,1,rep,name=fields" json:"fields,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *MapValue) Reset() { *m = MapValue{} } +func (m *MapValue) String() string { return proto.CompactTextString(m) } +func (*MapValue) ProtoMessage() {} +func (*MapValue) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{3} } + +func (m *MapValue) GetFields() map[string]*Value { + if m != nil { + return m.Fields + } + return nil +} + +func init() { + proto.RegisterType((*Document)(nil), "google.firestore.v1beta1.Document") + proto.RegisterType((*Value)(nil), "google.firestore.v1beta1.Value") + proto.RegisterType((*ArrayValue)(nil), "google.firestore.v1beta1.ArrayValue") + proto.RegisterType((*MapValue)(nil), "google.firestore.v1beta1.MapValue") +} + +func init() { proto.RegisterFile("google/firestore/v1beta1/document.proto", fileDescriptor1) } + +var fileDescriptor1 = []byte{ + // 655 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x94, 0xcf, 0x6e, 0xd3, 0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x83, 0xbd, 0x39, 0xcb, 0xd7, 0x2a, 0xc6, 0xdb, 0xf6, 0xcf, 0x72, 0x21, 0x8f, 0xe4, 0x85, 0x77, + 0x75, 0x6c, 0xd0, 0x94, 0x11, 0x44, 0xd3, 0x90, 0xf1, 0x34, 0x4a, 0x31, 0x55, 0x07, 0x36, 0xd2, + 0x2d, 0x54, 0x64, 0xe5, 0xdf, 0xbf, 0xe3, 0x23, 0x57, 0xf9, 0x56, 0x6f, 0x9e, 0x9d, 0x4c, 0x3e, + 0x7f, 0xaf, 0x3f, 0x3e, 0xd3, 0x56, 0x27, 0x84, 0x55, 0x8b, 0x70, 0xe2, 0x66, 0x5f, 0x1e, 0x8c, + 0xa5, 0xe2, 0xd6, 0x02, 0xd7, 0x0a, 0xb8, 0x76, 0xc0, 0xf5, 0xa5, 0xb6, 0x4c, 0x5a, 0x6a, 0xec, + 0xab, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x9e, 0x27, 0x82, 0xde, 0x04, 0x06, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/firestore/v1beta1/firestore.pb.go b/vendor/google.golang.org/genproto/googleapis/firestore/v1beta1/firestore.pb.go new file mode 100644 index 0000000000..bd7b520ca2 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/firestore/v1beta1/firestore.pb.go @@ -0,0 +1,3125 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/firestore/v1beta1/firestore.proto + +package firestore + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf4 "github.com/golang/protobuf/ptypes/empty" +import google_protobuf1 "github.com/golang/protobuf/ptypes/timestamp" +import google_rpc "google.golang.org/genproto/googleapis/rpc/status" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// The type of change. +type TargetChange_TargetChangeType int32 + +const ( + // No change has occurred. Used only to send an updated `resume_token`. + TargetChange_NO_CHANGE TargetChange_TargetChangeType = 0 + // The targets have been added. + TargetChange_ADD TargetChange_TargetChangeType = 1 + // The targets have been removed. + TargetChange_REMOVE TargetChange_TargetChangeType = 2 + // The targets reflect all changes committed before the targets were added + // to the stream. + // + // This will be sent after or with a `read_time` that is greater than or + // equal to the time at which the targets were added. + // + // Listeners can wait for this change if read-after-write semantics + // are desired. + TargetChange_CURRENT TargetChange_TargetChangeType = 3 + // The targets have been reset, and a new initial state for the targets + // will be returned in subsequent changes. + // + // After the initial state is complete, `CURRENT` will be returned even + // if the target was previously indicated to be `CURRENT`. + TargetChange_RESET TargetChange_TargetChangeType = 4 +) + +var TargetChange_TargetChangeType_name = map[int32]string{ + 0: "NO_CHANGE", + 1: "ADD", + 2: "REMOVE", + 3: "CURRENT", + 4: "RESET", +} +var TargetChange_TargetChangeType_value = map[string]int32{ + "NO_CHANGE": 0, + "ADD": 1, + "REMOVE": 2, + "CURRENT": 3, + "RESET": 4, +} + +func (x TargetChange_TargetChangeType) String() string { + return proto.EnumName(TargetChange_TargetChangeType_name, int32(x)) +} +func (TargetChange_TargetChangeType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor2, []int{20, 0} +} + +// The request for [Firestore.GetDocument][google.firestore.v1beta1.Firestore.GetDocument]. +type GetDocumentRequest struct { + // The resource name of the Document to get. In the format: + // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The fields to return. If not set, returns all fields. + // + // If the document has a field that is not present in this mask, that field + // will not be returned in the response. + Mask *DocumentMask `protobuf:"bytes,2,opt,name=mask" json:"mask,omitempty"` + // The consistency mode for this transaction. + // If not set, defaults to strong consistency. + // + // Types that are valid to be assigned to ConsistencySelector: + // *GetDocumentRequest_Transaction + // *GetDocumentRequest_ReadTime + ConsistencySelector isGetDocumentRequest_ConsistencySelector `protobuf_oneof:"consistency_selector"` +} + +func (m *GetDocumentRequest) Reset() { *m = GetDocumentRequest{} } +func (m *GetDocumentRequest) String() string { return proto.CompactTextString(m) } +func (*GetDocumentRequest) ProtoMessage() {} +func (*GetDocumentRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} } + +type isGetDocumentRequest_ConsistencySelector interface { + isGetDocumentRequest_ConsistencySelector() +} + +type GetDocumentRequest_Transaction struct { + Transaction []byte `protobuf:"bytes,3,opt,name=transaction,proto3,oneof"` +} +type GetDocumentRequest_ReadTime struct { + ReadTime *google_protobuf1.Timestamp `protobuf:"bytes,5,opt,name=read_time,json=readTime,oneof"` +} + +func (*GetDocumentRequest_Transaction) isGetDocumentRequest_ConsistencySelector() {} +func (*GetDocumentRequest_ReadTime) isGetDocumentRequest_ConsistencySelector() {} + +func (m *GetDocumentRequest) GetConsistencySelector() isGetDocumentRequest_ConsistencySelector { + if m != nil { + return m.ConsistencySelector + } + return nil +} + +func (m *GetDocumentRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *GetDocumentRequest) GetMask() *DocumentMask { + if m != nil { + return m.Mask + } + return nil +} + +func (m *GetDocumentRequest) GetTransaction() []byte { + if x, ok := m.GetConsistencySelector().(*GetDocumentRequest_Transaction); ok { + return x.Transaction + } + return nil +} + +func (m *GetDocumentRequest) GetReadTime() *google_protobuf1.Timestamp { + if x, ok := m.GetConsistencySelector().(*GetDocumentRequest_ReadTime); ok { + return x.ReadTime + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*GetDocumentRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _GetDocumentRequest_OneofMarshaler, _GetDocumentRequest_OneofUnmarshaler, _GetDocumentRequest_OneofSizer, []interface{}{ + (*GetDocumentRequest_Transaction)(nil), + (*GetDocumentRequest_ReadTime)(nil), + } +} + +func _GetDocumentRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*GetDocumentRequest) + // consistency_selector + switch x := m.ConsistencySelector.(type) { + case *GetDocumentRequest_Transaction: + b.EncodeVarint(3<<3 | proto.WireBytes) + b.EncodeRawBytes(x.Transaction) + case *GetDocumentRequest_ReadTime: + b.EncodeVarint(5<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ReadTime); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("GetDocumentRequest.ConsistencySelector has unexpected type %T", x) + } + return nil +} + +func _GetDocumentRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*GetDocumentRequest) + switch tag { + case 3: // consistency_selector.transaction + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.ConsistencySelector = &GetDocumentRequest_Transaction{x} + return true, err + case 5: // consistency_selector.read_time + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(google_protobuf1.Timestamp) + err := b.DecodeMessage(msg) + m.ConsistencySelector = &GetDocumentRequest_ReadTime{msg} + return true, err + default: + return false, nil + } +} + +func _GetDocumentRequest_OneofSizer(msg proto.Message) (n int) { + m := msg.(*GetDocumentRequest) + // consistency_selector + switch x := m.ConsistencySelector.(type) { + case *GetDocumentRequest_Transaction: + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Transaction))) + n += len(x.Transaction) + case *GetDocumentRequest_ReadTime: + s := proto.Size(x.ReadTime) + n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// The request for [Firestore.ListDocuments][google.firestore.v1beta1.Firestore.ListDocuments]. +type ListDocumentsRequest struct { + // The parent resource name. In the format: + // `projects/{project_id}/databases/{database_id}/documents` or + // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + // For example: + // `projects/my-project/databases/my-database/documents` or + // `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // The collection ID, relative to `parent`, to list. For example: `chatrooms` + // or `messages`. + CollectionId string `protobuf:"bytes,2,opt,name=collection_id,json=collectionId" json:"collection_id,omitempty"` + // The maximum number of documents to return. + PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // The `next_page_token` value returned from a previous List request, if any. + PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` + // The order to sort results by. For example: `priority desc, name`. + OrderBy string `protobuf:"bytes,6,opt,name=order_by,json=orderBy" json:"order_by,omitempty"` + // The fields to return. If not set, returns all fields. + // + // If a document has a field that is not present in this mask, that field + // will not be returned in the response. + Mask *DocumentMask `protobuf:"bytes,7,opt,name=mask" json:"mask,omitempty"` + // The consistency mode for this transaction. + // If not set, defaults to strong consistency. + // + // Types that are valid to be assigned to ConsistencySelector: + // *ListDocumentsRequest_Transaction + // *ListDocumentsRequest_ReadTime + ConsistencySelector isListDocumentsRequest_ConsistencySelector `protobuf_oneof:"consistency_selector"` + // If the list should show missing documents. A missing document is a + // document that does not exist but has sub-documents. These documents will + // be returned with a key but will not have fields, [Document.create_time][google.firestore.v1beta1.Document.create_time], + // or [Document.update_time][google.firestore.v1beta1.Document.update_time] set. + // + // Requests with `show_missing` may not specify `where` or + // `order_by`. + ShowMissing bool `protobuf:"varint,12,opt,name=show_missing,json=showMissing" json:"show_missing,omitempty"` +} + +func (m *ListDocumentsRequest) Reset() { *m = ListDocumentsRequest{} } +func (m *ListDocumentsRequest) String() string { return proto.CompactTextString(m) } +func (*ListDocumentsRequest) ProtoMessage() {} +func (*ListDocumentsRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{1} } + +type isListDocumentsRequest_ConsistencySelector interface { + isListDocumentsRequest_ConsistencySelector() +} + +type ListDocumentsRequest_Transaction struct { + Transaction []byte `protobuf:"bytes,8,opt,name=transaction,proto3,oneof"` +} +type ListDocumentsRequest_ReadTime struct { + ReadTime *google_protobuf1.Timestamp `protobuf:"bytes,10,opt,name=read_time,json=readTime,oneof"` +} + +func (*ListDocumentsRequest_Transaction) isListDocumentsRequest_ConsistencySelector() {} +func (*ListDocumentsRequest_ReadTime) isListDocumentsRequest_ConsistencySelector() {} + +func (m *ListDocumentsRequest) GetConsistencySelector() isListDocumentsRequest_ConsistencySelector { + if m != nil { + return m.ConsistencySelector + } + return nil +} + +func (m *ListDocumentsRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *ListDocumentsRequest) GetCollectionId() string { + if m != nil { + return m.CollectionId + } + return "" +} + +func (m *ListDocumentsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListDocumentsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +func (m *ListDocumentsRequest) GetOrderBy() string { + if m != nil { + return m.OrderBy + } + return "" +} + +func (m *ListDocumentsRequest) GetMask() *DocumentMask { + if m != nil { + return m.Mask + } + return nil +} + +func (m *ListDocumentsRequest) GetTransaction() []byte { + if x, ok := m.GetConsistencySelector().(*ListDocumentsRequest_Transaction); ok { + return x.Transaction + } + return nil +} + +func (m *ListDocumentsRequest) GetReadTime() *google_protobuf1.Timestamp { + if x, ok := m.GetConsistencySelector().(*ListDocumentsRequest_ReadTime); ok { + return x.ReadTime + } + return nil +} + +func (m *ListDocumentsRequest) GetShowMissing() bool { + if m != nil { + return m.ShowMissing + } + return false +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*ListDocumentsRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _ListDocumentsRequest_OneofMarshaler, _ListDocumentsRequest_OneofUnmarshaler, _ListDocumentsRequest_OneofSizer, []interface{}{ + (*ListDocumentsRequest_Transaction)(nil), + (*ListDocumentsRequest_ReadTime)(nil), + } +} + +func _ListDocumentsRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*ListDocumentsRequest) + // consistency_selector + switch x := m.ConsistencySelector.(type) { + case *ListDocumentsRequest_Transaction: + b.EncodeVarint(8<<3 | proto.WireBytes) + b.EncodeRawBytes(x.Transaction) + case *ListDocumentsRequest_ReadTime: + b.EncodeVarint(10<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ReadTime); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("ListDocumentsRequest.ConsistencySelector has unexpected type %T", x) + } + return nil +} + +func _ListDocumentsRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*ListDocumentsRequest) + switch tag { + case 8: // consistency_selector.transaction + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.ConsistencySelector = &ListDocumentsRequest_Transaction{x} + return true, err + case 10: // consistency_selector.read_time + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(google_protobuf1.Timestamp) + err := b.DecodeMessage(msg) + m.ConsistencySelector = &ListDocumentsRequest_ReadTime{msg} + return true, err + default: + return false, nil + } +} + +func _ListDocumentsRequest_OneofSizer(msg proto.Message) (n int) { + m := msg.(*ListDocumentsRequest) + // consistency_selector + switch x := m.ConsistencySelector.(type) { + case *ListDocumentsRequest_Transaction: + n += proto.SizeVarint(8<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Transaction))) + n += len(x.Transaction) + case *ListDocumentsRequest_ReadTime: + s := proto.Size(x.ReadTime) + n += proto.SizeVarint(10<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// The response for [Firestore.ListDocuments][google.firestore.v1beta1.Firestore.ListDocuments]. +type ListDocumentsResponse struct { + // The Documents found. + Documents []*Document `protobuf:"bytes,1,rep,name=documents" json:"documents,omitempty"` + // The next page token. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListDocumentsResponse) Reset() { *m = ListDocumentsResponse{} } +func (m *ListDocumentsResponse) String() string { return proto.CompactTextString(m) } +func (*ListDocumentsResponse) ProtoMessage() {} +func (*ListDocumentsResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{2} } + +func (m *ListDocumentsResponse) GetDocuments() []*Document { + if m != nil { + return m.Documents + } + return nil +} + +func (m *ListDocumentsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// The request for [Firestore.CreateDocument][google.firestore.v1beta1.Firestore.CreateDocument]. +type CreateDocumentRequest struct { + // The parent resource. For example: + // `projects/{project_id}/databases/{database_id}/documents` or + // `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}` + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // The collection ID, relative to `parent`, to list. For example: `chatrooms`. + CollectionId string `protobuf:"bytes,2,opt,name=collection_id,json=collectionId" json:"collection_id,omitempty"` + // The client-assigned document ID to use for this document. + // + // Optional. If not specified, an ID will be assigned by the service. + DocumentId string `protobuf:"bytes,3,opt,name=document_id,json=documentId" json:"document_id,omitempty"` + // The document to create. `name` must not be set. + Document *Document `protobuf:"bytes,4,opt,name=document" json:"document,omitempty"` + // The fields to return. If not set, returns all fields. + // + // If the document has a field that is not present in this mask, that field + // will not be returned in the response. + Mask *DocumentMask `protobuf:"bytes,5,opt,name=mask" json:"mask,omitempty"` +} + +func (m *CreateDocumentRequest) Reset() { *m = CreateDocumentRequest{} } +func (m *CreateDocumentRequest) String() string { return proto.CompactTextString(m) } +func (*CreateDocumentRequest) ProtoMessage() {} +func (*CreateDocumentRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{3} } + +func (m *CreateDocumentRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *CreateDocumentRequest) GetCollectionId() string { + if m != nil { + return m.CollectionId + } + return "" +} + +func (m *CreateDocumentRequest) GetDocumentId() string { + if m != nil { + return m.DocumentId + } + return "" +} + +func (m *CreateDocumentRequest) GetDocument() *Document { + if m != nil { + return m.Document + } + return nil +} + +func (m *CreateDocumentRequest) GetMask() *DocumentMask { + if m != nil { + return m.Mask + } + return nil +} + +// The request for [Firestore.UpdateDocument][google.firestore.v1beta1.Firestore.UpdateDocument]. +type UpdateDocumentRequest struct { + // The updated document. + // Creates the document if it does not already exist. + Document *Document `protobuf:"bytes,1,opt,name=document" json:"document,omitempty"` + // The fields to update. + // None of the field paths in the mask may contain a reserved name. + // + // If the document exists on the server and has fields not referenced in the + // mask, they are left unchanged. + // Fields referenced in the mask, but not present in the input document, are + // deleted from the document on the server. + UpdateMask *DocumentMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask" json:"update_mask,omitempty"` + // The fields to return. If not set, returns all fields. + // + // If the document has a field that is not present in this mask, that field + // will not be returned in the response. + Mask *DocumentMask `protobuf:"bytes,3,opt,name=mask" json:"mask,omitempty"` + // An optional precondition on the document. + // The request will fail if this is set and not met by the target document. + CurrentDocument *Precondition `protobuf:"bytes,4,opt,name=current_document,json=currentDocument" json:"current_document,omitempty"` +} + +func (m *UpdateDocumentRequest) Reset() { *m = UpdateDocumentRequest{} } +func (m *UpdateDocumentRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateDocumentRequest) ProtoMessage() {} +func (*UpdateDocumentRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{4} } + +func (m *UpdateDocumentRequest) GetDocument() *Document { + if m != nil { + return m.Document + } + return nil +} + +func (m *UpdateDocumentRequest) GetUpdateMask() *DocumentMask { + if m != nil { + return m.UpdateMask + } + return nil +} + +func (m *UpdateDocumentRequest) GetMask() *DocumentMask { + if m != nil { + return m.Mask + } + return nil +} + +func (m *UpdateDocumentRequest) GetCurrentDocument() *Precondition { + if m != nil { + return m.CurrentDocument + } + return nil +} + +// The request for [Firestore.DeleteDocument][google.firestore.v1beta1.Firestore.DeleteDocument]. +type DeleteDocumentRequest struct { + // The resource name of the Document to delete. In the format: + // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // An optional precondition on the document. + // The request will fail if this is set and not met by the target document. + CurrentDocument *Precondition `protobuf:"bytes,2,opt,name=current_document,json=currentDocument" json:"current_document,omitempty"` +} + +func (m *DeleteDocumentRequest) Reset() { *m = DeleteDocumentRequest{} } +func (m *DeleteDocumentRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteDocumentRequest) ProtoMessage() {} +func (*DeleteDocumentRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{5} } + +func (m *DeleteDocumentRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *DeleteDocumentRequest) GetCurrentDocument() *Precondition { + if m != nil { + return m.CurrentDocument + } + return nil +} + +// The request for [Firestore.BatchGetDocuments][google.firestore.v1beta1.Firestore.BatchGetDocuments]. +type BatchGetDocumentsRequest struct { + // The database name. In the format: + // `projects/{project_id}/databases/{database_id}`. + Database string `protobuf:"bytes,1,opt,name=database" json:"database,omitempty"` + // The names of the documents to retrieve. In the format: + // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + // The request will fail if any of the document is not a child resource of the + // given `database`. Duplicate names will be elided. + Documents []string `protobuf:"bytes,2,rep,name=documents" json:"documents,omitempty"` + // The fields to return. If not set, returns all fields. + // + // If a document has a field that is not present in this mask, that field will + // not be returned in the response. + Mask *DocumentMask `protobuf:"bytes,3,opt,name=mask" json:"mask,omitempty"` + // The consistency mode for this transaction. + // If not set, defaults to strong consistency. + // + // Types that are valid to be assigned to ConsistencySelector: + // *BatchGetDocumentsRequest_Transaction + // *BatchGetDocumentsRequest_NewTransaction + // *BatchGetDocumentsRequest_ReadTime + ConsistencySelector isBatchGetDocumentsRequest_ConsistencySelector `protobuf_oneof:"consistency_selector"` +} + +func (m *BatchGetDocumentsRequest) Reset() { *m = BatchGetDocumentsRequest{} } +func (m *BatchGetDocumentsRequest) String() string { return proto.CompactTextString(m) } +func (*BatchGetDocumentsRequest) ProtoMessage() {} +func (*BatchGetDocumentsRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{6} } + +type isBatchGetDocumentsRequest_ConsistencySelector interface { + isBatchGetDocumentsRequest_ConsistencySelector() +} + +type BatchGetDocumentsRequest_Transaction struct { + Transaction []byte `protobuf:"bytes,4,opt,name=transaction,proto3,oneof"` +} +type BatchGetDocumentsRequest_NewTransaction struct { + NewTransaction *TransactionOptions `protobuf:"bytes,5,opt,name=new_transaction,json=newTransaction,oneof"` +} +type BatchGetDocumentsRequest_ReadTime struct { + ReadTime *google_protobuf1.Timestamp `protobuf:"bytes,7,opt,name=read_time,json=readTime,oneof"` +} + +func (*BatchGetDocumentsRequest_Transaction) isBatchGetDocumentsRequest_ConsistencySelector() {} +func (*BatchGetDocumentsRequest_NewTransaction) isBatchGetDocumentsRequest_ConsistencySelector() {} +func (*BatchGetDocumentsRequest_ReadTime) isBatchGetDocumentsRequest_ConsistencySelector() {} + +func (m *BatchGetDocumentsRequest) GetConsistencySelector() isBatchGetDocumentsRequest_ConsistencySelector { + if m != nil { + return m.ConsistencySelector + } + return nil +} + +func (m *BatchGetDocumentsRequest) GetDatabase() string { + if m != nil { + return m.Database + } + return "" +} + +func (m *BatchGetDocumentsRequest) GetDocuments() []string { + if m != nil { + return m.Documents + } + return nil +} + +func (m *BatchGetDocumentsRequest) GetMask() *DocumentMask { + if m != nil { + return m.Mask + } + return nil +} + +func (m *BatchGetDocumentsRequest) GetTransaction() []byte { + if x, ok := m.GetConsistencySelector().(*BatchGetDocumentsRequest_Transaction); ok { + return x.Transaction + } + return nil +} + +func (m *BatchGetDocumentsRequest) GetNewTransaction() *TransactionOptions { + if x, ok := m.GetConsistencySelector().(*BatchGetDocumentsRequest_NewTransaction); ok { + return x.NewTransaction + } + return nil +} + +func (m *BatchGetDocumentsRequest) GetReadTime() *google_protobuf1.Timestamp { + if x, ok := m.GetConsistencySelector().(*BatchGetDocumentsRequest_ReadTime); ok { + return x.ReadTime + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*BatchGetDocumentsRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _BatchGetDocumentsRequest_OneofMarshaler, _BatchGetDocumentsRequest_OneofUnmarshaler, _BatchGetDocumentsRequest_OneofSizer, []interface{}{ + (*BatchGetDocumentsRequest_Transaction)(nil), + (*BatchGetDocumentsRequest_NewTransaction)(nil), + (*BatchGetDocumentsRequest_ReadTime)(nil), + } +} + +func _BatchGetDocumentsRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*BatchGetDocumentsRequest) + // consistency_selector + switch x := m.ConsistencySelector.(type) { + case *BatchGetDocumentsRequest_Transaction: + b.EncodeVarint(4<<3 | proto.WireBytes) + b.EncodeRawBytes(x.Transaction) + case *BatchGetDocumentsRequest_NewTransaction: + b.EncodeVarint(5<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.NewTransaction); err != nil { + return err + } + case *BatchGetDocumentsRequest_ReadTime: + b.EncodeVarint(7<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ReadTime); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("BatchGetDocumentsRequest.ConsistencySelector has unexpected type %T", x) + } + return nil +} + +func _BatchGetDocumentsRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*BatchGetDocumentsRequest) + switch tag { + case 4: // consistency_selector.transaction + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.ConsistencySelector = &BatchGetDocumentsRequest_Transaction{x} + return true, err + case 5: // consistency_selector.new_transaction + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(TransactionOptions) + err := b.DecodeMessage(msg) + m.ConsistencySelector = &BatchGetDocumentsRequest_NewTransaction{msg} + return true, err + case 7: // consistency_selector.read_time + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(google_protobuf1.Timestamp) + err := b.DecodeMessage(msg) + m.ConsistencySelector = &BatchGetDocumentsRequest_ReadTime{msg} + return true, err + default: + return false, nil + } +} + +func _BatchGetDocumentsRequest_OneofSizer(msg proto.Message) (n int) { + m := msg.(*BatchGetDocumentsRequest) + // consistency_selector + switch x := m.ConsistencySelector.(type) { + case *BatchGetDocumentsRequest_Transaction: + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Transaction))) + n += len(x.Transaction) + case *BatchGetDocumentsRequest_NewTransaction: + s := proto.Size(x.NewTransaction) + n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *BatchGetDocumentsRequest_ReadTime: + s := proto.Size(x.ReadTime) + n += proto.SizeVarint(7<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// The streamed response for [Firestore.BatchGetDocuments][google.firestore.v1beta1.Firestore.BatchGetDocuments]. +type BatchGetDocumentsResponse struct { + // A single result. + // This can be empty if the server is just returning a transaction. + // + // Types that are valid to be assigned to Result: + // *BatchGetDocumentsResponse_Found + // *BatchGetDocumentsResponse_Missing + Result isBatchGetDocumentsResponse_Result `protobuf_oneof:"result"` + // The transaction that was started as part of this request. + // Will only be set in the first response, and only if + // [BatchGetDocumentsRequest.new_transaction][google.firestore.v1beta1.BatchGetDocumentsRequest.new_transaction] was set in the request. + Transaction []byte `protobuf:"bytes,3,opt,name=transaction,proto3" json:"transaction,omitempty"` + // The time at which the document was read. + // This may be monotically increasing, in this case the previous documents in + // the result stream are guaranteed not to have changed between their + // read_time and this one. + ReadTime *google_protobuf1.Timestamp `protobuf:"bytes,4,opt,name=read_time,json=readTime" json:"read_time,omitempty"` +} + +func (m *BatchGetDocumentsResponse) Reset() { *m = BatchGetDocumentsResponse{} } +func (m *BatchGetDocumentsResponse) String() string { return proto.CompactTextString(m) } +func (*BatchGetDocumentsResponse) ProtoMessage() {} +func (*BatchGetDocumentsResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{7} } + +type isBatchGetDocumentsResponse_Result interface { + isBatchGetDocumentsResponse_Result() +} + +type BatchGetDocumentsResponse_Found struct { + Found *Document `protobuf:"bytes,1,opt,name=found,oneof"` +} +type BatchGetDocumentsResponse_Missing struct { + Missing string `protobuf:"bytes,2,opt,name=missing,oneof"` +} + +func (*BatchGetDocumentsResponse_Found) isBatchGetDocumentsResponse_Result() {} +func (*BatchGetDocumentsResponse_Missing) isBatchGetDocumentsResponse_Result() {} + +func (m *BatchGetDocumentsResponse) GetResult() isBatchGetDocumentsResponse_Result { + if m != nil { + return m.Result + } + return nil +} + +func (m *BatchGetDocumentsResponse) GetFound() *Document { + if x, ok := m.GetResult().(*BatchGetDocumentsResponse_Found); ok { + return x.Found + } + return nil +} + +func (m *BatchGetDocumentsResponse) GetMissing() string { + if x, ok := m.GetResult().(*BatchGetDocumentsResponse_Missing); ok { + return x.Missing + } + return "" +} + +func (m *BatchGetDocumentsResponse) GetTransaction() []byte { + if m != nil { + return m.Transaction + } + return nil +} + +func (m *BatchGetDocumentsResponse) GetReadTime() *google_protobuf1.Timestamp { + if m != nil { + return m.ReadTime + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*BatchGetDocumentsResponse) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _BatchGetDocumentsResponse_OneofMarshaler, _BatchGetDocumentsResponse_OneofUnmarshaler, _BatchGetDocumentsResponse_OneofSizer, []interface{}{ + (*BatchGetDocumentsResponse_Found)(nil), + (*BatchGetDocumentsResponse_Missing)(nil), + } +} + +func _BatchGetDocumentsResponse_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*BatchGetDocumentsResponse) + // result + switch x := m.Result.(type) { + case *BatchGetDocumentsResponse_Found: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Found); err != nil { + return err + } + case *BatchGetDocumentsResponse_Missing: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeStringBytes(x.Missing) + case nil: + default: + return fmt.Errorf("BatchGetDocumentsResponse.Result has unexpected type %T", x) + } + return nil +} + +func _BatchGetDocumentsResponse_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*BatchGetDocumentsResponse) + switch tag { + case 1: // result.found + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Document) + err := b.DecodeMessage(msg) + m.Result = &BatchGetDocumentsResponse_Found{msg} + return true, err + case 2: // result.missing + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Result = &BatchGetDocumentsResponse_Missing{x} + return true, err + default: + return false, nil + } +} + +func _BatchGetDocumentsResponse_OneofSizer(msg proto.Message) (n int) { + m := msg.(*BatchGetDocumentsResponse) + // result + switch x := m.Result.(type) { + case *BatchGetDocumentsResponse_Found: + s := proto.Size(x.Found) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *BatchGetDocumentsResponse_Missing: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Missing))) + n += len(x.Missing) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// The request for [Firestore.BeginTransaction][google.firestore.v1beta1.Firestore.BeginTransaction]. +type BeginTransactionRequest struct { + // The database name. In the format: + // `projects/{project_id}/databases/{database_id}`. + Database string `protobuf:"bytes,1,opt,name=database" json:"database,omitempty"` + // The options for the transaction. + // Defaults to a read-write transaction. + Options *TransactionOptions `protobuf:"bytes,2,opt,name=options" json:"options,omitempty"` +} + +func (m *BeginTransactionRequest) Reset() { *m = BeginTransactionRequest{} } +func (m *BeginTransactionRequest) String() string { return proto.CompactTextString(m) } +func (*BeginTransactionRequest) ProtoMessage() {} +func (*BeginTransactionRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{8} } + +func (m *BeginTransactionRequest) GetDatabase() string { + if m != nil { + return m.Database + } + return "" +} + +func (m *BeginTransactionRequest) GetOptions() *TransactionOptions { + if m != nil { + return m.Options + } + return nil +} + +// The response for [Firestore.BeginTransaction][google.firestore.v1beta1.Firestore.BeginTransaction]. +type BeginTransactionResponse struct { + // The transaction that was started. + Transaction []byte `protobuf:"bytes,1,opt,name=transaction,proto3" json:"transaction,omitempty"` +} + +func (m *BeginTransactionResponse) Reset() { *m = BeginTransactionResponse{} } +func (m *BeginTransactionResponse) String() string { return proto.CompactTextString(m) } +func (*BeginTransactionResponse) ProtoMessage() {} +func (*BeginTransactionResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{9} } + +func (m *BeginTransactionResponse) GetTransaction() []byte { + if m != nil { + return m.Transaction + } + return nil +} + +// The request for [Firestore.Commit][google.firestore.v1beta1.Firestore.Commit]. +type CommitRequest struct { + // The database name. In the format: + // `projects/{project_id}/databases/{database_id}`. + Database string `protobuf:"bytes,1,opt,name=database" json:"database,omitempty"` + // The writes to apply. + // + // Always executed atomically and in order. + Writes []*Write `protobuf:"bytes,2,rep,name=writes" json:"writes,omitempty"` + // If set, applies all writes in this transaction, and commits it. + Transaction []byte `protobuf:"bytes,3,opt,name=transaction,proto3" json:"transaction,omitempty"` +} + +func (m *CommitRequest) Reset() { *m = CommitRequest{} } +func (m *CommitRequest) String() string { return proto.CompactTextString(m) } +func (*CommitRequest) ProtoMessage() {} +func (*CommitRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{10} } + +func (m *CommitRequest) GetDatabase() string { + if m != nil { + return m.Database + } + return "" +} + +func (m *CommitRequest) GetWrites() []*Write { + if m != nil { + return m.Writes + } + return nil +} + +func (m *CommitRequest) GetTransaction() []byte { + if m != nil { + return m.Transaction + } + return nil +} + +// The response for [Firestore.Commit][google.firestore.v1beta1.Firestore.Commit]. +type CommitResponse struct { + // The result of applying the writes. + // + // This i-th write result corresponds to the i-th write in the + // request. + WriteResults []*WriteResult `protobuf:"bytes,1,rep,name=write_results,json=writeResults" json:"write_results,omitempty"` + // The time at which the commit occurred. + CommitTime *google_protobuf1.Timestamp `protobuf:"bytes,2,opt,name=commit_time,json=commitTime" json:"commit_time,omitempty"` +} + +func (m *CommitResponse) Reset() { *m = CommitResponse{} } +func (m *CommitResponse) String() string { return proto.CompactTextString(m) } +func (*CommitResponse) ProtoMessage() {} +func (*CommitResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{11} } + +func (m *CommitResponse) GetWriteResults() []*WriteResult { + if m != nil { + return m.WriteResults + } + return nil +} + +func (m *CommitResponse) GetCommitTime() *google_protobuf1.Timestamp { + if m != nil { + return m.CommitTime + } + return nil +} + +// The request for [Firestore.Rollback][google.firestore.v1beta1.Firestore.Rollback]. +type RollbackRequest struct { + // The database name. In the format: + // `projects/{project_id}/databases/{database_id}`. + Database string `protobuf:"bytes,1,opt,name=database" json:"database,omitempty"` + // The transaction to roll back. + Transaction []byte `protobuf:"bytes,2,opt,name=transaction,proto3" json:"transaction,omitempty"` +} + +func (m *RollbackRequest) Reset() { *m = RollbackRequest{} } +func (m *RollbackRequest) String() string { return proto.CompactTextString(m) } +func (*RollbackRequest) ProtoMessage() {} +func (*RollbackRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{12} } + +func (m *RollbackRequest) GetDatabase() string { + if m != nil { + return m.Database + } + return "" +} + +func (m *RollbackRequest) GetTransaction() []byte { + if m != nil { + return m.Transaction + } + return nil +} + +// The request for [Firestore.RunQuery][google.firestore.v1beta1.Firestore.RunQuery]. +type RunQueryRequest struct { + // The parent resource name. In the format: + // `projects/{project_id}/databases/{database_id}/documents` or + // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + // For example: + // `projects/my-project/databases/my-database/documents` or + // `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // The query to run. + // + // Types that are valid to be assigned to QueryType: + // *RunQueryRequest_StructuredQuery + QueryType isRunQueryRequest_QueryType `protobuf_oneof:"query_type"` + // The consistency mode for this transaction. + // If not set, defaults to strong consistency. + // + // Types that are valid to be assigned to ConsistencySelector: + // *RunQueryRequest_Transaction + // *RunQueryRequest_NewTransaction + // *RunQueryRequest_ReadTime + ConsistencySelector isRunQueryRequest_ConsistencySelector `protobuf_oneof:"consistency_selector"` +} + +func (m *RunQueryRequest) Reset() { *m = RunQueryRequest{} } +func (m *RunQueryRequest) String() string { return proto.CompactTextString(m) } +func (*RunQueryRequest) ProtoMessage() {} +func (*RunQueryRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{13} } + +type isRunQueryRequest_QueryType interface { + isRunQueryRequest_QueryType() +} +type isRunQueryRequest_ConsistencySelector interface { + isRunQueryRequest_ConsistencySelector() +} + +type RunQueryRequest_StructuredQuery struct { + StructuredQuery *StructuredQuery `protobuf:"bytes,2,opt,name=structured_query,json=structuredQuery,oneof"` +} +type RunQueryRequest_Transaction struct { + Transaction []byte `protobuf:"bytes,5,opt,name=transaction,proto3,oneof"` +} +type RunQueryRequest_NewTransaction struct { + NewTransaction *TransactionOptions `protobuf:"bytes,6,opt,name=new_transaction,json=newTransaction,oneof"` +} +type RunQueryRequest_ReadTime struct { + ReadTime *google_protobuf1.Timestamp `protobuf:"bytes,7,opt,name=read_time,json=readTime,oneof"` +} + +func (*RunQueryRequest_StructuredQuery) isRunQueryRequest_QueryType() {} +func (*RunQueryRequest_Transaction) isRunQueryRequest_ConsistencySelector() {} +func (*RunQueryRequest_NewTransaction) isRunQueryRequest_ConsistencySelector() {} +func (*RunQueryRequest_ReadTime) isRunQueryRequest_ConsistencySelector() {} + +func (m *RunQueryRequest) GetQueryType() isRunQueryRequest_QueryType { + if m != nil { + return m.QueryType + } + return nil +} +func (m *RunQueryRequest) GetConsistencySelector() isRunQueryRequest_ConsistencySelector { + if m != nil { + return m.ConsistencySelector + } + return nil +} + +func (m *RunQueryRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *RunQueryRequest) GetStructuredQuery() *StructuredQuery { + if x, ok := m.GetQueryType().(*RunQueryRequest_StructuredQuery); ok { + return x.StructuredQuery + } + return nil +} + +func (m *RunQueryRequest) GetTransaction() []byte { + if x, ok := m.GetConsistencySelector().(*RunQueryRequest_Transaction); ok { + return x.Transaction + } + return nil +} + +func (m *RunQueryRequest) GetNewTransaction() *TransactionOptions { + if x, ok := m.GetConsistencySelector().(*RunQueryRequest_NewTransaction); ok { + return x.NewTransaction + } + return nil +} + +func (m *RunQueryRequest) GetReadTime() *google_protobuf1.Timestamp { + if x, ok := m.GetConsistencySelector().(*RunQueryRequest_ReadTime); ok { + return x.ReadTime + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*RunQueryRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _RunQueryRequest_OneofMarshaler, _RunQueryRequest_OneofUnmarshaler, _RunQueryRequest_OneofSizer, []interface{}{ + (*RunQueryRequest_StructuredQuery)(nil), + (*RunQueryRequest_Transaction)(nil), + (*RunQueryRequest_NewTransaction)(nil), + (*RunQueryRequest_ReadTime)(nil), + } +} + +func _RunQueryRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*RunQueryRequest) + // query_type + switch x := m.QueryType.(type) { + case *RunQueryRequest_StructuredQuery: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.StructuredQuery); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("RunQueryRequest.QueryType has unexpected type %T", x) + } + // consistency_selector + switch x := m.ConsistencySelector.(type) { + case *RunQueryRequest_Transaction: + b.EncodeVarint(5<<3 | proto.WireBytes) + b.EncodeRawBytes(x.Transaction) + case *RunQueryRequest_NewTransaction: + b.EncodeVarint(6<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.NewTransaction); err != nil { + return err + } + case *RunQueryRequest_ReadTime: + b.EncodeVarint(7<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ReadTime); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("RunQueryRequest.ConsistencySelector has unexpected type %T", x) + } + return nil +} + +func _RunQueryRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*RunQueryRequest) + switch tag { + case 2: // query_type.structured_query + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(StructuredQuery) + err := b.DecodeMessage(msg) + m.QueryType = &RunQueryRequest_StructuredQuery{msg} + return true, err + case 5: // consistency_selector.transaction + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.ConsistencySelector = &RunQueryRequest_Transaction{x} + return true, err + case 6: // consistency_selector.new_transaction + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(TransactionOptions) + err := b.DecodeMessage(msg) + m.ConsistencySelector = &RunQueryRequest_NewTransaction{msg} + return true, err + case 7: // consistency_selector.read_time + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(google_protobuf1.Timestamp) + err := b.DecodeMessage(msg) + m.ConsistencySelector = &RunQueryRequest_ReadTime{msg} + return true, err + default: + return false, nil + } +} + +func _RunQueryRequest_OneofSizer(msg proto.Message) (n int) { + m := msg.(*RunQueryRequest) + // query_type + switch x := m.QueryType.(type) { + case *RunQueryRequest_StructuredQuery: + s := proto.Size(x.StructuredQuery) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + // consistency_selector + switch x := m.ConsistencySelector.(type) { + case *RunQueryRequest_Transaction: + n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Transaction))) + n += len(x.Transaction) + case *RunQueryRequest_NewTransaction: + s := proto.Size(x.NewTransaction) + n += proto.SizeVarint(6<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *RunQueryRequest_ReadTime: + s := proto.Size(x.ReadTime) + n += proto.SizeVarint(7<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// The response for [Firestore.RunQuery][google.firestore.v1beta1.Firestore.RunQuery]. +type RunQueryResponse struct { + // The transaction that was started as part of this request. + // Can only be set in the first response, and only if + // [RunQueryRequest.new_transaction][google.firestore.v1beta1.RunQueryRequest.new_transaction] was set in the request. + // If set, no other fields will be set in this response. + Transaction []byte `protobuf:"bytes,2,opt,name=transaction,proto3" json:"transaction,omitempty"` + // A query result. + // Not set when reporting partial progress. + Document *Document `protobuf:"bytes,1,opt,name=document" json:"document,omitempty"` + // The time at which the document was read. This may be monotonically + // increasing; in this case, the previous documents in the result stream are + // guaranteed not to have changed between their `read_time` and this one. + // + // If the query returns no results, a response with `read_time` and no + // `document` will be sent, and this represents the time at which the query + // was run. + ReadTime *google_protobuf1.Timestamp `protobuf:"bytes,3,opt,name=read_time,json=readTime" json:"read_time,omitempty"` + // The number of results that have been skipped due to an offset between + // the last response and the current response. + SkippedResults int32 `protobuf:"varint,4,opt,name=skipped_results,json=skippedResults" json:"skipped_results,omitempty"` +} + +func (m *RunQueryResponse) Reset() { *m = RunQueryResponse{} } +func (m *RunQueryResponse) String() string { return proto.CompactTextString(m) } +func (*RunQueryResponse) ProtoMessage() {} +func (*RunQueryResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{14} } + +func (m *RunQueryResponse) GetTransaction() []byte { + if m != nil { + return m.Transaction + } + return nil +} + +func (m *RunQueryResponse) GetDocument() *Document { + if m != nil { + return m.Document + } + return nil +} + +func (m *RunQueryResponse) GetReadTime() *google_protobuf1.Timestamp { + if m != nil { + return m.ReadTime + } + return nil +} + +func (m *RunQueryResponse) GetSkippedResults() int32 { + if m != nil { + return m.SkippedResults + } + return 0 +} + +// The request for [Firestore.Write][google.firestore.v1beta1.Firestore.Write]. +// +// The first request creates a stream, or resumes an existing one from a token. +// +// When creating a new stream, the server replies with a response containing +// only an ID and a token, to use in the next request. +// +// When resuming a stream, the server first streams any responses later than the +// given token, then a response containing only an up-to-date token, to use in +// the next request. +type WriteRequest struct { + // The database name. In the format: + // `projects/{project_id}/databases/{database_id}`. + // This is only required in the first message. + Database string `protobuf:"bytes,1,opt,name=database" json:"database,omitempty"` + // The ID of the write stream to resume. + // This may only be set in the first message. When left empty, a new write + // stream will be created. + StreamId string `protobuf:"bytes,2,opt,name=stream_id,json=streamId" json:"stream_id,omitempty"` + // The writes to apply. + // + // Always executed atomically and in order. + // This must be empty on the first request. + // This may be empty on the last request. + // This must not be empty on all other requests. + Writes []*Write `protobuf:"bytes,3,rep,name=writes" json:"writes,omitempty"` + // A stream token that was previously sent by the server. + // + // The client should set this field to the token from the most recent + // [WriteResponse][google.firestore.v1beta1.WriteResponse] it has received. This acknowledges that the client has + // received responses up to this token. After sending this token, earlier + // tokens may not be used anymore. + // + // The server may close the stream if there are too many unacknowledged + // responses. + // + // Leave this field unset when creating a new stream. To resume a stream at + // a specific point, set this field and the `stream_id` field. + // + // Leave this field unset when creating a new stream. + StreamToken []byte `protobuf:"bytes,4,opt,name=stream_token,json=streamToken,proto3" json:"stream_token,omitempty"` + // Labels associated with this write request. + Labels map[string]string `protobuf:"bytes,5,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *WriteRequest) Reset() { *m = WriteRequest{} } +func (m *WriteRequest) String() string { return proto.CompactTextString(m) } +func (*WriteRequest) ProtoMessage() {} +func (*WriteRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{15} } + +func (m *WriteRequest) GetDatabase() string { + if m != nil { + return m.Database + } + return "" +} + +func (m *WriteRequest) GetStreamId() string { + if m != nil { + return m.StreamId + } + return "" +} + +func (m *WriteRequest) GetWrites() []*Write { + if m != nil { + return m.Writes + } + return nil +} + +func (m *WriteRequest) GetStreamToken() []byte { + if m != nil { + return m.StreamToken + } + return nil +} + +func (m *WriteRequest) GetLabels() map[string]string { + if m != nil { + return m.Labels + } + return nil +} + +// The response for [Firestore.Write][google.firestore.v1beta1.Firestore.Write]. +type WriteResponse struct { + // The ID of the stream. + // Only set on the first message, when a new stream was created. + StreamId string `protobuf:"bytes,1,opt,name=stream_id,json=streamId" json:"stream_id,omitempty"` + // A token that represents the position of this response in the stream. + // This can be used by a client to resume the stream at this point. + // + // This field is always set. + StreamToken []byte `protobuf:"bytes,2,opt,name=stream_token,json=streamToken,proto3" json:"stream_token,omitempty"` + // The result of applying the writes. + // + // This i-th write result corresponds to the i-th write in the + // request. + WriteResults []*WriteResult `protobuf:"bytes,3,rep,name=write_results,json=writeResults" json:"write_results,omitempty"` + // The time at which the commit occurred. + CommitTime *google_protobuf1.Timestamp `protobuf:"bytes,4,opt,name=commit_time,json=commitTime" json:"commit_time,omitempty"` +} + +func (m *WriteResponse) Reset() { *m = WriteResponse{} } +func (m *WriteResponse) String() string { return proto.CompactTextString(m) } +func (*WriteResponse) ProtoMessage() {} +func (*WriteResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{16} } + +func (m *WriteResponse) GetStreamId() string { + if m != nil { + return m.StreamId + } + return "" +} + +func (m *WriteResponse) GetStreamToken() []byte { + if m != nil { + return m.StreamToken + } + return nil +} + +func (m *WriteResponse) GetWriteResults() []*WriteResult { + if m != nil { + return m.WriteResults + } + return nil +} + +func (m *WriteResponse) GetCommitTime() *google_protobuf1.Timestamp { + if m != nil { + return m.CommitTime + } + return nil +} + +// A request for [Firestore.Listen][google.firestore.v1beta1.Firestore.Listen] +type ListenRequest struct { + // The database name. In the format: + // `projects/{project_id}/databases/{database_id}`. + Database string `protobuf:"bytes,1,opt,name=database" json:"database,omitempty"` + // The supported target changes. + // + // Types that are valid to be assigned to TargetChange: + // *ListenRequest_AddTarget + // *ListenRequest_RemoveTarget + TargetChange isListenRequest_TargetChange `protobuf_oneof:"target_change"` + // Labels associated with this target change. + Labels map[string]string `protobuf:"bytes,4,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *ListenRequest) Reset() { *m = ListenRequest{} } +func (m *ListenRequest) String() string { return proto.CompactTextString(m) } +func (*ListenRequest) ProtoMessage() {} +func (*ListenRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{17} } + +type isListenRequest_TargetChange interface { + isListenRequest_TargetChange() +} + +type ListenRequest_AddTarget struct { + AddTarget *Target `protobuf:"bytes,2,opt,name=add_target,json=addTarget,oneof"` +} +type ListenRequest_RemoveTarget struct { + RemoveTarget int32 `protobuf:"varint,3,opt,name=remove_target,json=removeTarget,oneof"` +} + +func (*ListenRequest_AddTarget) isListenRequest_TargetChange() {} +func (*ListenRequest_RemoveTarget) isListenRequest_TargetChange() {} + +func (m *ListenRequest) GetTargetChange() isListenRequest_TargetChange { + if m != nil { + return m.TargetChange + } + return nil +} + +func (m *ListenRequest) GetDatabase() string { + if m != nil { + return m.Database + } + return "" +} + +func (m *ListenRequest) GetAddTarget() *Target { + if x, ok := m.GetTargetChange().(*ListenRequest_AddTarget); ok { + return x.AddTarget + } + return nil +} + +func (m *ListenRequest) GetRemoveTarget() int32 { + if x, ok := m.GetTargetChange().(*ListenRequest_RemoveTarget); ok { + return x.RemoveTarget + } + return 0 +} + +func (m *ListenRequest) GetLabels() map[string]string { + if m != nil { + return m.Labels + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*ListenRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _ListenRequest_OneofMarshaler, _ListenRequest_OneofUnmarshaler, _ListenRequest_OneofSizer, []interface{}{ + (*ListenRequest_AddTarget)(nil), + (*ListenRequest_RemoveTarget)(nil), + } +} + +func _ListenRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*ListenRequest) + // target_change + switch x := m.TargetChange.(type) { + case *ListenRequest_AddTarget: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.AddTarget); err != nil { + return err + } + case *ListenRequest_RemoveTarget: + b.EncodeVarint(3<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.RemoveTarget)) + case nil: + default: + return fmt.Errorf("ListenRequest.TargetChange has unexpected type %T", x) + } + return nil +} + +func _ListenRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*ListenRequest) + switch tag { + case 2: // target_change.add_target + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Target) + err := b.DecodeMessage(msg) + m.TargetChange = &ListenRequest_AddTarget{msg} + return true, err + case 3: // target_change.remove_target + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.TargetChange = &ListenRequest_RemoveTarget{int32(x)} + return true, err + default: + return false, nil + } +} + +func _ListenRequest_OneofSizer(msg proto.Message) (n int) { + m := msg.(*ListenRequest) + // target_change + switch x := m.TargetChange.(type) { + case *ListenRequest_AddTarget: + s := proto.Size(x.AddTarget) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *ListenRequest_RemoveTarget: + n += proto.SizeVarint(3<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.RemoveTarget)) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// The response for [Firestore.Listen][google.firestore.v1beta1.Firestore.Listen]. +type ListenResponse struct { + // The supported responses. + // + // Types that are valid to be assigned to ResponseType: + // *ListenResponse_TargetChange + // *ListenResponse_DocumentChange + // *ListenResponse_DocumentDelete + // *ListenResponse_DocumentRemove + // *ListenResponse_Filter + ResponseType isListenResponse_ResponseType `protobuf_oneof:"response_type"` +} + +func (m *ListenResponse) Reset() { *m = ListenResponse{} } +func (m *ListenResponse) String() string { return proto.CompactTextString(m) } +func (*ListenResponse) ProtoMessage() {} +func (*ListenResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{18} } + +type isListenResponse_ResponseType interface { + isListenResponse_ResponseType() +} + +type ListenResponse_TargetChange struct { + TargetChange *TargetChange `protobuf:"bytes,2,opt,name=target_change,json=targetChange,oneof"` +} +type ListenResponse_DocumentChange struct { + DocumentChange *DocumentChange `protobuf:"bytes,3,opt,name=document_change,json=documentChange,oneof"` +} +type ListenResponse_DocumentDelete struct { + DocumentDelete *DocumentDelete `protobuf:"bytes,4,opt,name=document_delete,json=documentDelete,oneof"` +} +type ListenResponse_DocumentRemove struct { + DocumentRemove *DocumentRemove `protobuf:"bytes,6,opt,name=document_remove,json=documentRemove,oneof"` +} +type ListenResponse_Filter struct { + Filter *ExistenceFilter `protobuf:"bytes,5,opt,name=filter,oneof"` +} + +func (*ListenResponse_TargetChange) isListenResponse_ResponseType() {} +func (*ListenResponse_DocumentChange) isListenResponse_ResponseType() {} +func (*ListenResponse_DocumentDelete) isListenResponse_ResponseType() {} +func (*ListenResponse_DocumentRemove) isListenResponse_ResponseType() {} +func (*ListenResponse_Filter) isListenResponse_ResponseType() {} + +func (m *ListenResponse) GetResponseType() isListenResponse_ResponseType { + if m != nil { + return m.ResponseType + } + return nil +} + +func (m *ListenResponse) GetTargetChange() *TargetChange { + if x, ok := m.GetResponseType().(*ListenResponse_TargetChange); ok { + return x.TargetChange + } + return nil +} + +func (m *ListenResponse) GetDocumentChange() *DocumentChange { + if x, ok := m.GetResponseType().(*ListenResponse_DocumentChange); ok { + return x.DocumentChange + } + return nil +} + +func (m *ListenResponse) GetDocumentDelete() *DocumentDelete { + if x, ok := m.GetResponseType().(*ListenResponse_DocumentDelete); ok { + return x.DocumentDelete + } + return nil +} + +func (m *ListenResponse) GetDocumentRemove() *DocumentRemove { + if x, ok := m.GetResponseType().(*ListenResponse_DocumentRemove); ok { + return x.DocumentRemove + } + return nil +} + +func (m *ListenResponse) GetFilter() *ExistenceFilter { + if x, ok := m.GetResponseType().(*ListenResponse_Filter); ok { + return x.Filter + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*ListenResponse) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _ListenResponse_OneofMarshaler, _ListenResponse_OneofUnmarshaler, _ListenResponse_OneofSizer, []interface{}{ + (*ListenResponse_TargetChange)(nil), + (*ListenResponse_DocumentChange)(nil), + (*ListenResponse_DocumentDelete)(nil), + (*ListenResponse_DocumentRemove)(nil), + (*ListenResponse_Filter)(nil), + } +} + +func _ListenResponse_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*ListenResponse) + // response_type + switch x := m.ResponseType.(type) { + case *ListenResponse_TargetChange: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.TargetChange); err != nil { + return err + } + case *ListenResponse_DocumentChange: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.DocumentChange); err != nil { + return err + } + case *ListenResponse_DocumentDelete: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.DocumentDelete); err != nil { + return err + } + case *ListenResponse_DocumentRemove: + b.EncodeVarint(6<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.DocumentRemove); err != nil { + return err + } + case *ListenResponse_Filter: + b.EncodeVarint(5<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Filter); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("ListenResponse.ResponseType has unexpected type %T", x) + } + return nil +} + +func _ListenResponse_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*ListenResponse) + switch tag { + case 2: // response_type.target_change + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(TargetChange) + err := b.DecodeMessage(msg) + m.ResponseType = &ListenResponse_TargetChange{msg} + return true, err + case 3: // response_type.document_change + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(DocumentChange) + err := b.DecodeMessage(msg) + m.ResponseType = &ListenResponse_DocumentChange{msg} + return true, err + case 4: // response_type.document_delete + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(DocumentDelete) + err := b.DecodeMessage(msg) + m.ResponseType = &ListenResponse_DocumentDelete{msg} + return true, err + case 6: // response_type.document_remove + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(DocumentRemove) + err := b.DecodeMessage(msg) + m.ResponseType = &ListenResponse_DocumentRemove{msg} + return true, err + case 5: // response_type.filter + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ExistenceFilter) + err := b.DecodeMessage(msg) + m.ResponseType = &ListenResponse_Filter{msg} + return true, err + default: + return false, nil + } +} + +func _ListenResponse_OneofSizer(msg proto.Message) (n int) { + m := msg.(*ListenResponse) + // response_type + switch x := m.ResponseType.(type) { + case *ListenResponse_TargetChange: + s := proto.Size(x.TargetChange) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *ListenResponse_DocumentChange: + s := proto.Size(x.DocumentChange) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *ListenResponse_DocumentDelete: + s := proto.Size(x.DocumentDelete) + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *ListenResponse_DocumentRemove: + s := proto.Size(x.DocumentRemove) + n += proto.SizeVarint(6<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *ListenResponse_Filter: + s := proto.Size(x.Filter) + n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// A specification of a set of documents to listen to. +type Target struct { + // The type of target to listen to. + // + // Types that are valid to be assigned to TargetType: + // *Target_Query + // *Target_Documents + TargetType isTarget_TargetType `protobuf_oneof:"target_type"` + // When to start listening. + // + // If not specified, all matching Documents are returned before any + // subsequent changes. + // + // Types that are valid to be assigned to ResumeType: + // *Target_ResumeToken + // *Target_ReadTime + ResumeType isTarget_ResumeType `protobuf_oneof:"resume_type"` + // A client provided target ID. + // + // If not set, the server will assign an ID for the target. + // + // Used for resuming a target without changing IDs. The IDs can either be + // client-assigned or be server-assigned in a previous stream. All targets + // with client provided IDs must be added before adding a target that needs + // a server-assigned id. + TargetId int32 `protobuf:"varint,5,opt,name=target_id,json=targetId" json:"target_id,omitempty"` + // If the target should be removed once it is current and consistent. + Once bool `protobuf:"varint,6,opt,name=once" json:"once,omitempty"` +} + +func (m *Target) Reset() { *m = Target{} } +func (m *Target) String() string { return proto.CompactTextString(m) } +func (*Target) ProtoMessage() {} +func (*Target) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{19} } + +type isTarget_TargetType interface { + isTarget_TargetType() +} +type isTarget_ResumeType interface { + isTarget_ResumeType() +} + +type Target_Query struct { + Query *Target_QueryTarget `protobuf:"bytes,2,opt,name=query,oneof"` +} +type Target_Documents struct { + Documents *Target_DocumentsTarget `protobuf:"bytes,3,opt,name=documents,oneof"` +} +type Target_ResumeToken struct { + ResumeToken []byte `protobuf:"bytes,4,opt,name=resume_token,json=resumeToken,proto3,oneof"` +} +type Target_ReadTime struct { + ReadTime *google_protobuf1.Timestamp `protobuf:"bytes,11,opt,name=read_time,json=readTime,oneof"` +} + +func (*Target_Query) isTarget_TargetType() {} +func (*Target_Documents) isTarget_TargetType() {} +func (*Target_ResumeToken) isTarget_ResumeType() {} +func (*Target_ReadTime) isTarget_ResumeType() {} + +func (m *Target) GetTargetType() isTarget_TargetType { + if m != nil { + return m.TargetType + } + return nil +} +func (m *Target) GetResumeType() isTarget_ResumeType { + if m != nil { + return m.ResumeType + } + return nil +} + +func (m *Target) GetQuery() *Target_QueryTarget { + if x, ok := m.GetTargetType().(*Target_Query); ok { + return x.Query + } + return nil +} + +func (m *Target) GetDocuments() *Target_DocumentsTarget { + if x, ok := m.GetTargetType().(*Target_Documents); ok { + return x.Documents + } + return nil +} + +func (m *Target) GetResumeToken() []byte { + if x, ok := m.GetResumeType().(*Target_ResumeToken); ok { + return x.ResumeToken + } + return nil +} + +func (m *Target) GetReadTime() *google_protobuf1.Timestamp { + if x, ok := m.GetResumeType().(*Target_ReadTime); ok { + return x.ReadTime + } + return nil +} + +func (m *Target) GetTargetId() int32 { + if m != nil { + return m.TargetId + } + return 0 +} + +func (m *Target) GetOnce() bool { + if m != nil { + return m.Once + } + return false +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Target) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _Target_OneofMarshaler, _Target_OneofUnmarshaler, _Target_OneofSizer, []interface{}{ + (*Target_Query)(nil), + (*Target_Documents)(nil), + (*Target_ResumeToken)(nil), + (*Target_ReadTime)(nil), + } +} + +func _Target_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Target) + // target_type + switch x := m.TargetType.(type) { + case *Target_Query: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Query); err != nil { + return err + } + case *Target_Documents: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Documents); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("Target.TargetType has unexpected type %T", x) + } + // resume_type + switch x := m.ResumeType.(type) { + case *Target_ResumeToken: + b.EncodeVarint(4<<3 | proto.WireBytes) + b.EncodeRawBytes(x.ResumeToken) + case *Target_ReadTime: + b.EncodeVarint(11<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ReadTime); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("Target.ResumeType has unexpected type %T", x) + } + return nil +} + +func _Target_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Target) + switch tag { + case 2: // target_type.query + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Target_QueryTarget) + err := b.DecodeMessage(msg) + m.TargetType = &Target_Query{msg} + return true, err + case 3: // target_type.documents + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Target_DocumentsTarget) + err := b.DecodeMessage(msg) + m.TargetType = &Target_Documents{msg} + return true, err + case 4: // resume_type.resume_token + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.ResumeType = &Target_ResumeToken{x} + return true, err + case 11: // resume_type.read_time + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(google_protobuf1.Timestamp) + err := b.DecodeMessage(msg) + m.ResumeType = &Target_ReadTime{msg} + return true, err + default: + return false, nil + } +} + +func _Target_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Target) + // target_type + switch x := m.TargetType.(type) { + case *Target_Query: + s := proto.Size(x.Query) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Target_Documents: + s := proto.Size(x.Documents) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + // resume_type + switch x := m.ResumeType.(type) { + case *Target_ResumeToken: + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.ResumeToken))) + n += len(x.ResumeToken) + case *Target_ReadTime: + s := proto.Size(x.ReadTime) + n += proto.SizeVarint(11<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// A target specified by a set of documents names. +type Target_DocumentsTarget struct { + // The names of the documents to retrieve. In the format: + // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + // The request will fail if any of the document is not a child resource of + // the given `database`. Duplicate names will be elided. + Documents []string `protobuf:"bytes,2,rep,name=documents" json:"documents,omitempty"` +} + +func (m *Target_DocumentsTarget) Reset() { *m = Target_DocumentsTarget{} } +func (m *Target_DocumentsTarget) String() string { return proto.CompactTextString(m) } +func (*Target_DocumentsTarget) ProtoMessage() {} +func (*Target_DocumentsTarget) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{19, 0} } + +func (m *Target_DocumentsTarget) GetDocuments() []string { + if m != nil { + return m.Documents + } + return nil +} + +// A target specified by a query. +type Target_QueryTarget struct { + // The parent resource name. In the format: + // `projects/{project_id}/databases/{database_id}/documents` or + // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + // For example: + // `projects/my-project/databases/my-database/documents` or + // `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // The query to run. + // + // Types that are valid to be assigned to QueryType: + // *Target_QueryTarget_StructuredQuery + QueryType isTarget_QueryTarget_QueryType `protobuf_oneof:"query_type"` +} + +func (m *Target_QueryTarget) Reset() { *m = Target_QueryTarget{} } +func (m *Target_QueryTarget) String() string { return proto.CompactTextString(m) } +func (*Target_QueryTarget) ProtoMessage() {} +func (*Target_QueryTarget) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{19, 1} } + +type isTarget_QueryTarget_QueryType interface { + isTarget_QueryTarget_QueryType() +} + +type Target_QueryTarget_StructuredQuery struct { + StructuredQuery *StructuredQuery `protobuf:"bytes,2,opt,name=structured_query,json=structuredQuery,oneof"` +} + +func (*Target_QueryTarget_StructuredQuery) isTarget_QueryTarget_QueryType() {} + +func (m *Target_QueryTarget) GetQueryType() isTarget_QueryTarget_QueryType { + if m != nil { + return m.QueryType + } + return nil +} + +func (m *Target_QueryTarget) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *Target_QueryTarget) GetStructuredQuery() *StructuredQuery { + if x, ok := m.GetQueryType().(*Target_QueryTarget_StructuredQuery); ok { + return x.StructuredQuery + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Target_QueryTarget) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _Target_QueryTarget_OneofMarshaler, _Target_QueryTarget_OneofUnmarshaler, _Target_QueryTarget_OneofSizer, []interface{}{ + (*Target_QueryTarget_StructuredQuery)(nil), + } +} + +func _Target_QueryTarget_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Target_QueryTarget) + // query_type + switch x := m.QueryType.(type) { + case *Target_QueryTarget_StructuredQuery: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.StructuredQuery); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("Target_QueryTarget.QueryType has unexpected type %T", x) + } + return nil +} + +func _Target_QueryTarget_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Target_QueryTarget) + switch tag { + case 2: // query_type.structured_query + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(StructuredQuery) + err := b.DecodeMessage(msg) + m.QueryType = &Target_QueryTarget_StructuredQuery{msg} + return true, err + default: + return false, nil + } +} + +func _Target_QueryTarget_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Target_QueryTarget) + // query_type + switch x := m.QueryType.(type) { + case *Target_QueryTarget_StructuredQuery: + s := proto.Size(x.StructuredQuery) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Targets being watched have changed. +type TargetChange struct { + // The type of change that occurred. + TargetChangeType TargetChange_TargetChangeType `protobuf:"varint,1,opt,name=target_change_type,json=targetChangeType,enum=google.firestore.v1beta1.TargetChange_TargetChangeType" json:"target_change_type,omitempty"` + // The target IDs of targets that have changed. + // + // If empty, the change applies to all targets. + // + // For `target_change_type=ADD`, the order of the target IDs matches the order + // of the requests to add the targets. This allows clients to unambiguously + // associate server-assigned target IDs with added targets. + // + // For other states, the order of the target IDs is not defined. + TargetIds []int32 `protobuf:"varint,2,rep,packed,name=target_ids,json=targetIds" json:"target_ids,omitempty"` + // The error that resulted in this change, if applicable. + Cause *google_rpc.Status `protobuf:"bytes,3,opt,name=cause" json:"cause,omitempty"` + // A token that can be used to resume the stream for the given `target_ids`, + // or all targets if `target_ids` is empty. + // + // Not set on every target change. + ResumeToken []byte `protobuf:"bytes,4,opt,name=resume_token,json=resumeToken,proto3" json:"resume_token,omitempty"` + // The consistent `read_time` for the given `target_ids` (omitted when the + // target_ids are not at a consistent snapshot). + // + // The stream is guaranteed to send a `read_time` with `target_ids` empty + // whenever the entire stream reaches a new consistent snapshot. ADD, + // CURRENT, and RESET messages are guaranteed to (eventually) result in a + // new consistent snapshot (while NO_CHANGE and REMOVE messages are not). + // + // For a given stream, `read_time` is guaranteed to be monotonically + // increasing. + ReadTime *google_protobuf1.Timestamp `protobuf:"bytes,6,opt,name=read_time,json=readTime" json:"read_time,omitempty"` +} + +func (m *TargetChange) Reset() { *m = TargetChange{} } +func (m *TargetChange) String() string { return proto.CompactTextString(m) } +func (*TargetChange) ProtoMessage() {} +func (*TargetChange) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{20} } + +func (m *TargetChange) GetTargetChangeType() TargetChange_TargetChangeType { + if m != nil { + return m.TargetChangeType + } + return TargetChange_NO_CHANGE +} + +func (m *TargetChange) GetTargetIds() []int32 { + if m != nil { + return m.TargetIds + } + return nil +} + +func (m *TargetChange) GetCause() *google_rpc.Status { + if m != nil { + return m.Cause + } + return nil +} + +func (m *TargetChange) GetResumeToken() []byte { + if m != nil { + return m.ResumeToken + } + return nil +} + +func (m *TargetChange) GetReadTime() *google_protobuf1.Timestamp { + if m != nil { + return m.ReadTime + } + return nil +} + +// The request for [Firestore.ListCollectionIds][google.firestore.v1beta1.Firestore.ListCollectionIds]. +type ListCollectionIdsRequest struct { + // The parent document. In the format: + // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + // For example: + // `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // The maximum number of results to return. + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // A page token. Must be a value from + // [ListCollectionIdsResponse][google.firestore.v1beta1.ListCollectionIdsResponse]. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListCollectionIdsRequest) Reset() { *m = ListCollectionIdsRequest{} } +func (m *ListCollectionIdsRequest) String() string { return proto.CompactTextString(m) } +func (*ListCollectionIdsRequest) ProtoMessage() {} +func (*ListCollectionIdsRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{21} } + +func (m *ListCollectionIdsRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *ListCollectionIdsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListCollectionIdsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// The response from [Firestore.ListCollectionIds][google.firestore.v1beta1.Firestore.ListCollectionIds]. +type ListCollectionIdsResponse struct { + // The collection ids. + CollectionIds []string `protobuf:"bytes,1,rep,name=collection_ids,json=collectionIds" json:"collection_ids,omitempty"` + // A page token that may be used to continue the list. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListCollectionIdsResponse) Reset() { *m = ListCollectionIdsResponse{} } +func (m *ListCollectionIdsResponse) String() string { return proto.CompactTextString(m) } +func (*ListCollectionIdsResponse) ProtoMessage() {} +func (*ListCollectionIdsResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{22} } + +func (m *ListCollectionIdsResponse) GetCollectionIds() []string { + if m != nil { + return m.CollectionIds + } + return nil +} + +func (m *ListCollectionIdsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +func init() { + proto.RegisterType((*GetDocumentRequest)(nil), "google.firestore.v1beta1.GetDocumentRequest") + proto.RegisterType((*ListDocumentsRequest)(nil), "google.firestore.v1beta1.ListDocumentsRequest") + proto.RegisterType((*ListDocumentsResponse)(nil), "google.firestore.v1beta1.ListDocumentsResponse") + proto.RegisterType((*CreateDocumentRequest)(nil), "google.firestore.v1beta1.CreateDocumentRequest") + proto.RegisterType((*UpdateDocumentRequest)(nil), "google.firestore.v1beta1.UpdateDocumentRequest") + proto.RegisterType((*DeleteDocumentRequest)(nil), "google.firestore.v1beta1.DeleteDocumentRequest") + proto.RegisterType((*BatchGetDocumentsRequest)(nil), "google.firestore.v1beta1.BatchGetDocumentsRequest") + proto.RegisterType((*BatchGetDocumentsResponse)(nil), "google.firestore.v1beta1.BatchGetDocumentsResponse") + proto.RegisterType((*BeginTransactionRequest)(nil), "google.firestore.v1beta1.BeginTransactionRequest") + proto.RegisterType((*BeginTransactionResponse)(nil), "google.firestore.v1beta1.BeginTransactionResponse") + proto.RegisterType((*CommitRequest)(nil), "google.firestore.v1beta1.CommitRequest") + proto.RegisterType((*CommitResponse)(nil), "google.firestore.v1beta1.CommitResponse") + proto.RegisterType((*RollbackRequest)(nil), "google.firestore.v1beta1.RollbackRequest") + proto.RegisterType((*RunQueryRequest)(nil), "google.firestore.v1beta1.RunQueryRequest") + proto.RegisterType((*RunQueryResponse)(nil), "google.firestore.v1beta1.RunQueryResponse") + proto.RegisterType((*WriteRequest)(nil), "google.firestore.v1beta1.WriteRequest") + proto.RegisterType((*WriteResponse)(nil), "google.firestore.v1beta1.WriteResponse") + proto.RegisterType((*ListenRequest)(nil), "google.firestore.v1beta1.ListenRequest") + proto.RegisterType((*ListenResponse)(nil), "google.firestore.v1beta1.ListenResponse") + proto.RegisterType((*Target)(nil), "google.firestore.v1beta1.Target") + proto.RegisterType((*Target_DocumentsTarget)(nil), "google.firestore.v1beta1.Target.DocumentsTarget") + proto.RegisterType((*Target_QueryTarget)(nil), "google.firestore.v1beta1.Target.QueryTarget") + proto.RegisterType((*TargetChange)(nil), "google.firestore.v1beta1.TargetChange") + proto.RegisterType((*ListCollectionIdsRequest)(nil), "google.firestore.v1beta1.ListCollectionIdsRequest") + proto.RegisterType((*ListCollectionIdsResponse)(nil), "google.firestore.v1beta1.ListCollectionIdsResponse") + proto.RegisterEnum("google.firestore.v1beta1.TargetChange_TargetChangeType", TargetChange_TargetChangeType_name, TargetChange_TargetChangeType_value) +} + +// 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 + +// Client API for Firestore service + +type FirestoreClient interface { + // Gets a single document. + GetDocument(ctx context.Context, in *GetDocumentRequest, opts ...grpc.CallOption) (*Document, error) + // Lists documents. + ListDocuments(ctx context.Context, in *ListDocumentsRequest, opts ...grpc.CallOption) (*ListDocumentsResponse, error) + // Creates a new document. + CreateDocument(ctx context.Context, in *CreateDocumentRequest, opts ...grpc.CallOption) (*Document, error) + // Updates or inserts a document. + UpdateDocument(ctx context.Context, in *UpdateDocumentRequest, opts ...grpc.CallOption) (*Document, error) + // Deletes a document. + DeleteDocument(ctx context.Context, in *DeleteDocumentRequest, opts ...grpc.CallOption) (*google_protobuf4.Empty, error) + // Gets multiple documents. + // + // Documents returned by this method are not guaranteed to be returned in the + // same order that they were requested. + BatchGetDocuments(ctx context.Context, in *BatchGetDocumentsRequest, opts ...grpc.CallOption) (Firestore_BatchGetDocumentsClient, error) + // Starts a new transaction. + BeginTransaction(ctx context.Context, in *BeginTransactionRequest, opts ...grpc.CallOption) (*BeginTransactionResponse, error) + // Commits a transaction, while optionally updating documents. + Commit(ctx context.Context, in *CommitRequest, opts ...grpc.CallOption) (*CommitResponse, error) + // Rolls back a transaction. + Rollback(ctx context.Context, in *RollbackRequest, opts ...grpc.CallOption) (*google_protobuf4.Empty, error) + // Runs a query. + RunQuery(ctx context.Context, in *RunQueryRequest, opts ...grpc.CallOption) (Firestore_RunQueryClient, error) + // Streams batches of document updates and deletes, in order. + Write(ctx context.Context, opts ...grpc.CallOption) (Firestore_WriteClient, error) + // Listens to changes. + Listen(ctx context.Context, opts ...grpc.CallOption) (Firestore_ListenClient, error) + // Lists all the collection IDs underneath a document. + ListCollectionIds(ctx context.Context, in *ListCollectionIdsRequest, opts ...grpc.CallOption) (*ListCollectionIdsResponse, error) +} + +type firestoreClient struct { + cc *grpc.ClientConn +} + +func NewFirestoreClient(cc *grpc.ClientConn) FirestoreClient { + return &firestoreClient{cc} +} + +func (c *firestoreClient) GetDocument(ctx context.Context, in *GetDocumentRequest, opts ...grpc.CallOption) (*Document, error) { + out := new(Document) + err := grpc.Invoke(ctx, "/google.firestore.v1beta1.Firestore/GetDocument", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *firestoreClient) ListDocuments(ctx context.Context, in *ListDocumentsRequest, opts ...grpc.CallOption) (*ListDocumentsResponse, error) { + out := new(ListDocumentsResponse) + err := grpc.Invoke(ctx, "/google.firestore.v1beta1.Firestore/ListDocuments", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *firestoreClient) CreateDocument(ctx context.Context, in *CreateDocumentRequest, opts ...grpc.CallOption) (*Document, error) { + out := new(Document) + err := grpc.Invoke(ctx, "/google.firestore.v1beta1.Firestore/CreateDocument", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *firestoreClient) UpdateDocument(ctx context.Context, in *UpdateDocumentRequest, opts ...grpc.CallOption) (*Document, error) { + out := new(Document) + err := grpc.Invoke(ctx, "/google.firestore.v1beta1.Firestore/UpdateDocument", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *firestoreClient) DeleteDocument(ctx context.Context, in *DeleteDocumentRequest, opts ...grpc.CallOption) (*google_protobuf4.Empty, error) { + out := new(google_protobuf4.Empty) + err := grpc.Invoke(ctx, "/google.firestore.v1beta1.Firestore/DeleteDocument", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *firestoreClient) BatchGetDocuments(ctx context.Context, in *BatchGetDocumentsRequest, opts ...grpc.CallOption) (Firestore_BatchGetDocumentsClient, error) { + stream, err := grpc.NewClientStream(ctx, &_Firestore_serviceDesc.Streams[0], c.cc, "/google.firestore.v1beta1.Firestore/BatchGetDocuments", opts...) + if err != nil { + return nil, err + } + x := &firestoreBatchGetDocumentsClient{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 Firestore_BatchGetDocumentsClient interface { + Recv() (*BatchGetDocumentsResponse, error) + grpc.ClientStream +} + +type firestoreBatchGetDocumentsClient struct { + grpc.ClientStream +} + +func (x *firestoreBatchGetDocumentsClient) Recv() (*BatchGetDocumentsResponse, error) { + m := new(BatchGetDocumentsResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *firestoreClient) BeginTransaction(ctx context.Context, in *BeginTransactionRequest, opts ...grpc.CallOption) (*BeginTransactionResponse, error) { + out := new(BeginTransactionResponse) + err := grpc.Invoke(ctx, "/google.firestore.v1beta1.Firestore/BeginTransaction", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *firestoreClient) Commit(ctx context.Context, in *CommitRequest, opts ...grpc.CallOption) (*CommitResponse, error) { + out := new(CommitResponse) + err := grpc.Invoke(ctx, "/google.firestore.v1beta1.Firestore/Commit", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *firestoreClient) Rollback(ctx context.Context, in *RollbackRequest, opts ...grpc.CallOption) (*google_protobuf4.Empty, error) { + out := new(google_protobuf4.Empty) + err := grpc.Invoke(ctx, "/google.firestore.v1beta1.Firestore/Rollback", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *firestoreClient) RunQuery(ctx context.Context, in *RunQueryRequest, opts ...grpc.CallOption) (Firestore_RunQueryClient, error) { + stream, err := grpc.NewClientStream(ctx, &_Firestore_serviceDesc.Streams[1], c.cc, "/google.firestore.v1beta1.Firestore/RunQuery", opts...) + if err != nil { + return nil, err + } + x := &firestoreRunQueryClient{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 Firestore_RunQueryClient interface { + Recv() (*RunQueryResponse, error) + grpc.ClientStream +} + +type firestoreRunQueryClient struct { + grpc.ClientStream +} + +func (x *firestoreRunQueryClient) Recv() (*RunQueryResponse, error) { + m := new(RunQueryResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *firestoreClient) Write(ctx context.Context, opts ...grpc.CallOption) (Firestore_WriteClient, error) { + stream, err := grpc.NewClientStream(ctx, &_Firestore_serviceDesc.Streams[2], c.cc, "/google.firestore.v1beta1.Firestore/Write", opts...) + if err != nil { + return nil, err + } + x := &firestoreWriteClient{stream} + return x, nil +} + +type Firestore_WriteClient interface { + Send(*WriteRequest) error + Recv() (*WriteResponse, error) + grpc.ClientStream +} + +type firestoreWriteClient struct { + grpc.ClientStream +} + +func (x *firestoreWriteClient) Send(m *WriteRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *firestoreWriteClient) Recv() (*WriteResponse, error) { + m := new(WriteResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *firestoreClient) Listen(ctx context.Context, opts ...grpc.CallOption) (Firestore_ListenClient, error) { + stream, err := grpc.NewClientStream(ctx, &_Firestore_serviceDesc.Streams[3], c.cc, "/google.firestore.v1beta1.Firestore/Listen", opts...) + if err != nil { + return nil, err + } + x := &firestoreListenClient{stream} + return x, nil +} + +type Firestore_ListenClient interface { + Send(*ListenRequest) error + Recv() (*ListenResponse, error) + grpc.ClientStream +} + +type firestoreListenClient struct { + grpc.ClientStream +} + +func (x *firestoreListenClient) Send(m *ListenRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *firestoreListenClient) Recv() (*ListenResponse, error) { + m := new(ListenResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *firestoreClient) ListCollectionIds(ctx context.Context, in *ListCollectionIdsRequest, opts ...grpc.CallOption) (*ListCollectionIdsResponse, error) { + out := new(ListCollectionIdsResponse) + err := grpc.Invoke(ctx, "/google.firestore.v1beta1.Firestore/ListCollectionIds", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for Firestore service + +type FirestoreServer interface { + // Gets a single document. + GetDocument(context.Context, *GetDocumentRequest) (*Document, error) + // Lists documents. + ListDocuments(context.Context, *ListDocumentsRequest) (*ListDocumentsResponse, error) + // Creates a new document. + CreateDocument(context.Context, *CreateDocumentRequest) (*Document, error) + // Updates or inserts a document. + UpdateDocument(context.Context, *UpdateDocumentRequest) (*Document, error) + // Deletes a document. + DeleteDocument(context.Context, *DeleteDocumentRequest) (*google_protobuf4.Empty, error) + // Gets multiple documents. + // + // Documents returned by this method are not guaranteed to be returned in the + // same order that they were requested. + BatchGetDocuments(*BatchGetDocumentsRequest, Firestore_BatchGetDocumentsServer) error + // Starts a new transaction. + BeginTransaction(context.Context, *BeginTransactionRequest) (*BeginTransactionResponse, error) + // Commits a transaction, while optionally updating documents. + Commit(context.Context, *CommitRequest) (*CommitResponse, error) + // Rolls back a transaction. + Rollback(context.Context, *RollbackRequest) (*google_protobuf4.Empty, error) + // Runs a query. + RunQuery(*RunQueryRequest, Firestore_RunQueryServer) error + // Streams batches of document updates and deletes, in order. + Write(Firestore_WriteServer) error + // Listens to changes. + Listen(Firestore_ListenServer) error + // Lists all the collection IDs underneath a document. + ListCollectionIds(context.Context, *ListCollectionIdsRequest) (*ListCollectionIdsResponse, error) +} + +func RegisterFirestoreServer(s *grpc.Server, srv FirestoreServer) { + s.RegisterService(&_Firestore_serviceDesc, srv) +} + +func _Firestore_GetDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetDocumentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FirestoreServer).GetDocument(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.firestore.v1beta1.Firestore/GetDocument", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FirestoreServer).GetDocument(ctx, req.(*GetDocumentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Firestore_ListDocuments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListDocumentsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FirestoreServer).ListDocuments(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.firestore.v1beta1.Firestore/ListDocuments", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FirestoreServer).ListDocuments(ctx, req.(*ListDocumentsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Firestore_CreateDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateDocumentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FirestoreServer).CreateDocument(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.firestore.v1beta1.Firestore/CreateDocument", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FirestoreServer).CreateDocument(ctx, req.(*CreateDocumentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Firestore_UpdateDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateDocumentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FirestoreServer).UpdateDocument(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.firestore.v1beta1.Firestore/UpdateDocument", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FirestoreServer).UpdateDocument(ctx, req.(*UpdateDocumentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Firestore_DeleteDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteDocumentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FirestoreServer).DeleteDocument(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.firestore.v1beta1.Firestore/DeleteDocument", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FirestoreServer).DeleteDocument(ctx, req.(*DeleteDocumentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Firestore_BatchGetDocuments_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(BatchGetDocumentsRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(FirestoreServer).BatchGetDocuments(m, &firestoreBatchGetDocumentsServer{stream}) +} + +type Firestore_BatchGetDocumentsServer interface { + Send(*BatchGetDocumentsResponse) error + grpc.ServerStream +} + +type firestoreBatchGetDocumentsServer struct { + grpc.ServerStream +} + +func (x *firestoreBatchGetDocumentsServer) Send(m *BatchGetDocumentsResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _Firestore_BeginTransaction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BeginTransactionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FirestoreServer).BeginTransaction(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.firestore.v1beta1.Firestore/BeginTransaction", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FirestoreServer).BeginTransaction(ctx, req.(*BeginTransactionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Firestore_Commit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CommitRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FirestoreServer).Commit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.firestore.v1beta1.Firestore/Commit", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FirestoreServer).Commit(ctx, req.(*CommitRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Firestore_Rollback_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RollbackRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FirestoreServer).Rollback(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.firestore.v1beta1.Firestore/Rollback", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FirestoreServer).Rollback(ctx, req.(*RollbackRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Firestore_RunQuery_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(RunQueryRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(FirestoreServer).RunQuery(m, &firestoreRunQueryServer{stream}) +} + +type Firestore_RunQueryServer interface { + Send(*RunQueryResponse) error + grpc.ServerStream +} + +type firestoreRunQueryServer struct { + grpc.ServerStream +} + +func (x *firestoreRunQueryServer) Send(m *RunQueryResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _Firestore_Write_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(FirestoreServer).Write(&firestoreWriteServer{stream}) +} + +type Firestore_WriteServer interface { + Send(*WriteResponse) error + Recv() (*WriteRequest, error) + grpc.ServerStream +} + +type firestoreWriteServer struct { + grpc.ServerStream +} + +func (x *firestoreWriteServer) Send(m *WriteResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *firestoreWriteServer) Recv() (*WriteRequest, error) { + m := new(WriteRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _Firestore_Listen_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(FirestoreServer).Listen(&firestoreListenServer{stream}) +} + +type Firestore_ListenServer interface { + Send(*ListenResponse) error + Recv() (*ListenRequest, error) + grpc.ServerStream +} + +type firestoreListenServer struct { + grpc.ServerStream +} + +func (x *firestoreListenServer) Send(m *ListenResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *firestoreListenServer) Recv() (*ListenRequest, error) { + m := new(ListenRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _Firestore_ListCollectionIds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListCollectionIdsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FirestoreServer).ListCollectionIds(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.firestore.v1beta1.Firestore/ListCollectionIds", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FirestoreServer).ListCollectionIds(ctx, req.(*ListCollectionIdsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Firestore_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.firestore.v1beta1.Firestore", + HandlerType: (*FirestoreServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetDocument", + Handler: _Firestore_GetDocument_Handler, + }, + { + MethodName: "ListDocuments", + Handler: _Firestore_ListDocuments_Handler, + }, + { + MethodName: "CreateDocument", + Handler: _Firestore_CreateDocument_Handler, + }, + { + MethodName: "UpdateDocument", + Handler: _Firestore_UpdateDocument_Handler, + }, + { + MethodName: "DeleteDocument", + Handler: _Firestore_DeleteDocument_Handler, + }, + { + MethodName: "BeginTransaction", + Handler: _Firestore_BeginTransaction_Handler, + }, + { + MethodName: "Commit", + Handler: _Firestore_Commit_Handler, + }, + { + MethodName: "Rollback", + Handler: _Firestore_Rollback_Handler, + }, + { + MethodName: "ListCollectionIds", + Handler: _Firestore_ListCollectionIds_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "BatchGetDocuments", + Handler: _Firestore_BatchGetDocuments_Handler, + ServerStreams: true, + }, + { + StreamName: "RunQuery", + Handler: _Firestore_RunQuery_Handler, + ServerStreams: true, + }, + { + StreamName: "Write", + Handler: _Firestore_Write_Handler, + ServerStreams: true, + ClientStreams: true, + }, + { + StreamName: "Listen", + Handler: _Firestore_Listen_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "google/firestore/v1beta1/firestore.proto", +} + +func init() { proto.RegisterFile("google/firestore/v1beta1/firestore.proto", fileDescriptor2) } + +var fileDescriptor2 = []byte{ + // 2180 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x59, 0xcd, 0x8f, 0x1b, 0x49, + 0x15, 0x77, 0xf9, 0x6b, 0xec, 0xe7, 0x8f, 0xf1, 0x96, 0x92, 0xac, 0xe3, 0x64, 0xc9, 0xd0, 0x4b, + 0x12, 0x63, 0xad, 0xec, 0x64, 0x22, 0x14, 0xd6, 0x21, 0xcb, 0x66, 0x66, 0x9c, 0xf1, 0x84, 0x24, + 0x33, 0xe9, 0x99, 0x4d, 0x24, 0x14, 0xc9, 0xea, 0xe9, 0xae, 0x38, 0xbd, 0x63, 0x77, 0x7b, 0xbb, + 0xcb, 0x99, 0x9d, 0x5d, 0x0d, 0x02, 0x0e, 0x5c, 0x90, 0xb8, 0x70, 0x00, 0x2e, 0x1c, 0xd8, 0x03, + 0xd2, 0x22, 0xe0, 0x82, 0xc4, 0x05, 0x21, 0x71, 0x43, 0x20, 0x4e, 0x48, 0x08, 0x89, 0x03, 0x1c, + 0x38, 0x71, 0xe3, 0x3f, 0x40, 0x5d, 0x55, 0xdd, 0xee, 0x6e, 0x7f, 0xb5, 0x3d, 0x11, 0xb7, 0xae, + 0xe7, 0x57, 0xaf, 0xde, 0xc7, 0xef, 0xbd, 0x7a, 0xf5, 0x0c, 0xd5, 0xae, 0x69, 0x76, 0x7b, 0xa4, + 0xf1, 0x42, 0xb7, 0x88, 0x4d, 0x4d, 0x8b, 0x34, 0x5e, 0xdd, 0x3c, 0x24, 0x54, 0xb9, 0x39, 0xa2, + 0xd4, 0x07, 0x96, 0x49, 0x4d, 0x5c, 0xe6, 0x9c, 0xf5, 0x11, 0x5d, 0x70, 0x56, 0x2e, 0x0b, 0x19, + 0xca, 0x40, 0x6f, 0x28, 0x86, 0x61, 0x52, 0x85, 0xea, 0xa6, 0x61, 0xf3, 0x7d, 0x95, 0xab, 0x53, + 0x4f, 0x50, 0xcd, 0x7e, 0xdf, 0x34, 0x04, 0xd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02, 0xe4, + 0x84, 0xbd, 0xee, 0xd2, 0x75, 0xaf, 0x03, 0x88, 0xff, 0xc4, 0x21, 0xef, 0x4f, 0x43, 0x4c, 0x00, + 0x07, 0xb2, 0x98, 0xb1, 0x31, 0xc5, 0x8b, 0xeb, 0xb7, 0xa3, 0xa5, 0x72, 0x60, 0x71, 0x70, 0x32, + 0x20, 0x72, 0x89, 0x86, 0x28, 0xf8, 0x2d, 0x00, 0x2f, 0x0a, 0xdc, 0x85, 0x29, 0x39, 0xeb, 0x86, + 0xc1, 0xc6, 0x55, 0x48, 0xa9, 0xca, 0xd0, 0x76, 0x53, 0x1e, 0xbb, 0x07, 0x5b, 0x03, 0xb5, 0xbe, + 0xcf, 0xe6, 0x7e, 0x32, 0x67, 0x70, 0x6e, 0x99, 0x71, 0xb8, 0x04, 0xc1, 0x12, 0x68, 0x23, 0xd2, + 0xd1, 0xdb, 0x08, 0xe9, 0x31, 0x94, 0xc2, 0xa6, 0xe0, 0x02, 0x64, 0x1f, 0xef, 0x76, 0x36, 0xdb, + 0xf7, 0x1e, 0x6f, 0xb7, 0x4a, 0x31, 0xbc, 0x02, 0x89, 0x7b, 0x5b, 0x5b, 0x25, 0x84, 0x01, 0xd2, + 0x72, 0xeb, 0xd1, 0xee, 0xd3, 0x56, 0x29, 0x8e, 0x73, 0xb0, 0xb2, 0xf9, 0x81, 0x2c, 0xb7, 0x1e, + 0x1f, 0x94, 0x12, 0x38, 0x0b, 0x29, 0xb9, 0xb5, 0xdf, 0x3a, 0x28, 0x25, 0x25, 0x03, 0xca, 0x4e, + 0xcd, 0xdc, 0xf4, 0x0d, 0x5f, 0xe6, 0x4e, 0xf2, 0x02, 0x43, 0xba, 0xf8, 0xcc, 0x21, 0x5d, 0x22, + 0x34, 0xa4, 0x93, 0x3e, 0x84, 0x8b, 0x13, 0xce, 0x13, 0xe5, 0xfa, 0x2a, 0x14, 0x03, 0xa3, 0x21, + 0xfe, 0x20, 0xc8, 0xca, 0x05, 0xff, 0x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0xd4, 0xea, 0x0f, + 0xe8, 0x89, 0x8b, 0xec, 0xda, 0x92, 0xc8, 0xfe, 0x23, 0x82, 0x37, 0xc6, 0x66, 0x43, 0x78, 0xc6, + 0x93, 0x61, 0xda, 0xac, 0xae, 0x72, 0x6b, 0xa1, 0x3d, 0x02, 0xe5, 0x6d, 0xa6, 0xfd, 0x86, 0x74, + 0xd7, 0xe7, 0x6b, 0xa1, 0xed, 0x14, 0x0b, 0x4e, 0x47, 0x26, 0x34, 0x0f, 0x85, 0xdc, 0x26, 0xaa, + 0xdd, 0x40, 0xf8, 0xcf, 0x08, 0x4a, 0xe1, 0x69, 0x0c, 0xbe, 0x39, 0x43, 0xab, 0xc9, 0x83, 0xa3, + 0xca, 0xfa, 0x22, 0x5b, 0x84, 0x1d, 0x02, 0x33, 0x7e, 0xd0, 0x2f, 0x62, 0x47, 0x48, 0x6c, 0x13, + 0xd5, 0xf0, 0x67, 0x08, 0xd2, 0x7c, 0x26, 0x83, 0xaf, 0xcf, 0x48, 0x53, 0xff, 0xf8, 0xa8, 0x52, + 0x9d, 0xcf, 0x28, 0xf4, 0xbd, 0xcf, 0xf4, 0x7d, 0x5f, 0xba, 0xb3, 0x94, 0xbe, 0xfc, 0x29, 0xe4, + 0x68, 0xf9, 0x23, 0x04, 0x19, 0x77, 0x3c, 0x83, 0x67, 0xf4, 0x21, 0xa1, 0x11, 0xce, 0x54, 0x34, + 0x9f, 0x0d, 0x0f, 0x96, 0x38, 0xc5, 0xd1, 0xec, 0x17, 0x8e, 0x66, 0x62, 0x08, 0x31, 0x53, 0xb3, + 0xe0, 0x28, 0xa8, 0x52, 0x8b, 0xc2, 0x3a, 0xdd, 0x8b, 0x11, 0x4b, 0xdd, 0x69, 0xd3, 0x12, 0xc2, + 0x38, 0x76, 0x3f, 0x43, 0x90, 0x62, 0x8f, 0x55, 0x7c, 0x2d, 0xda, 0x6b, 0xbd, 0x72, 0x7d, 0xfe, + 0xab, 0x97, 0x2b, 0xd9, 0x62, 0x4a, 0x7e, 0x5d, 0x6a, 0x2e, 0xe5, 0x52, 0xf6, 0x68, 0x6e, 0xa2, + 0x5a, 0x15, 0xdd, 0x40, 0xf8, 0xe7, 0x08, 0xd2, 0xfc, 0x19, 0x37, 0x0b, 0x93, 0x81, 0xa7, 0xe5, + 0x2c, 0x4c, 0x06, 0x5f, 0x84, 0x67, 0xc4, 0x64, 0x8f, 0x09, 0x73, 0x35, 0xfd, 0x0b, 0x82, 0x37, + 0xc6, 0x9a, 0x99, 0x59, 0x65, 0x6d, 0x5a, 0xa7, 0x55, 0xb9, 0xb5, 0xd0, 0x9e, 0xe0, 0xe5, 0x2d, + 0x6d, 0x2d, 0x01, 0x8c, 0x5e, 0x58, 0x6a, 0x13, 0xd5, 0x36, 0x7e, 0x87, 0xe0, 0xb2, 0x6a, 0xf6, + 0xa7, 0xea, 0xb2, 0x51, 0xf4, 0xba, 0xa9, 0x3d, 0x27, 0xa3, 0xf6, 0xd0, 0x37, 0xef, 0x09, 0xde, + 0xae, 0xd9, 0x53, 0x8c, 0x6e, 0xdd, 0xb4, 0xba, 0x8d, 0x2e, 0x31, 0x58, 0xbe, 0x35, 0xf8, 0x4f, + 0xca, 0x40, 0xb7, 0xc7, 0xff, 0x7f, 0xbf, 0xe3, 0x51, 0x7e, 0x16, 0x4f, 0x6e, 0x6f, 0xde, 0xdf, + 0xff, 0x3c, 0xfe, 0x85, 0x6d, 0x2e, 0x6a, 0xb3, 0x67, 0x0e, 0xb5, 0xba, 0x77, 0x52, 0xfd, 0xe9, + 0xcd, 0x0d, 0x67, 0xc7, 0x9f, 0x5c, 0x86, 0xe7, 0x8c, 0xe1, 0xb9, 0xc7, 0xf0, 0xfc, 0x29, 0x17, + 0x79, 0x98, 0x66, 0xc7, 0xde, 0xfa, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x63, 0xa1, 0x5f, 0x1d, + 0xcd, 0x20, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/firestore/v1beta1/query.pb.go b/vendor/google.golang.org/genproto/googleapis/firestore/v1beta1/query.pb.go new file mode 100644 index 0000000000..98e5e20791 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/firestore/v1beta1/query.pb.go @@ -0,0 +1,783 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/firestore/v1beta1/query.proto + +package firestore + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf3 "github.com/golang/protobuf/ptypes/wrappers" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// A sort direction. +type StructuredQuery_Direction int32 + +const ( + // Unspecified. + StructuredQuery_DIRECTION_UNSPECIFIED StructuredQuery_Direction = 0 + // Ascending. + StructuredQuery_ASCENDING StructuredQuery_Direction = 1 + // Descending. + StructuredQuery_DESCENDING StructuredQuery_Direction = 2 +) + +var StructuredQuery_Direction_name = map[int32]string{ + 0: "DIRECTION_UNSPECIFIED", + 1: "ASCENDING", + 2: "DESCENDING", +} +var StructuredQuery_Direction_value = map[string]int32{ + "DIRECTION_UNSPECIFIED": 0, + "ASCENDING": 1, + "DESCENDING": 2, +} + +func (x StructuredQuery_Direction) String() string { + return proto.EnumName(StructuredQuery_Direction_name, int32(x)) +} +func (StructuredQuery_Direction) EnumDescriptor() ([]byte, []int) { return fileDescriptor3, []int{0, 0} } + +// A composite filter operator. +type StructuredQuery_CompositeFilter_Operator int32 + +const ( + // Unspecified. This value must not be used. + StructuredQuery_CompositeFilter_OPERATOR_UNSPECIFIED StructuredQuery_CompositeFilter_Operator = 0 + // The results are required to satisfy each of the combined filters. + StructuredQuery_CompositeFilter_AND StructuredQuery_CompositeFilter_Operator = 1 +) + +var StructuredQuery_CompositeFilter_Operator_name = map[int32]string{ + 0: "OPERATOR_UNSPECIFIED", + 1: "AND", +} +var StructuredQuery_CompositeFilter_Operator_value = map[string]int32{ + "OPERATOR_UNSPECIFIED": 0, + "AND": 1, +} + +func (x StructuredQuery_CompositeFilter_Operator) String() string { + return proto.EnumName(StructuredQuery_CompositeFilter_Operator_name, int32(x)) +} +func (StructuredQuery_CompositeFilter_Operator) EnumDescriptor() ([]byte, []int) { + return fileDescriptor3, []int{0, 2, 0} +} + +// A field filter operator. +type StructuredQuery_FieldFilter_Operator int32 + +const ( + // Unspecified. This value must not be used. + StructuredQuery_FieldFilter_OPERATOR_UNSPECIFIED StructuredQuery_FieldFilter_Operator = 0 + // Less than. Requires that the field come first in `order_by`. + StructuredQuery_FieldFilter_LESS_THAN StructuredQuery_FieldFilter_Operator = 1 + // Less than or equal. Requires that the field come first in `order_by`. + StructuredQuery_FieldFilter_LESS_THAN_OR_EQUAL StructuredQuery_FieldFilter_Operator = 2 + // Greater than. Requires that the field come first in `order_by`. + StructuredQuery_FieldFilter_GREATER_THAN StructuredQuery_FieldFilter_Operator = 3 + // Greater than or equal. Requires that the field come first in + // `order_by`. + StructuredQuery_FieldFilter_GREATER_THAN_OR_EQUAL StructuredQuery_FieldFilter_Operator = 4 + // Equal. + StructuredQuery_FieldFilter_EQUAL StructuredQuery_FieldFilter_Operator = 5 +) + +var StructuredQuery_FieldFilter_Operator_name = map[int32]string{ + 0: "OPERATOR_UNSPECIFIED", + 1: "LESS_THAN", + 2: "LESS_THAN_OR_EQUAL", + 3: "GREATER_THAN", + 4: "GREATER_THAN_OR_EQUAL", + 5: "EQUAL", +} +var StructuredQuery_FieldFilter_Operator_value = map[string]int32{ + "OPERATOR_UNSPECIFIED": 0, + "LESS_THAN": 1, + "LESS_THAN_OR_EQUAL": 2, + "GREATER_THAN": 3, + "GREATER_THAN_OR_EQUAL": 4, + "EQUAL": 5, +} + +func (x StructuredQuery_FieldFilter_Operator) String() string { + return proto.EnumName(StructuredQuery_FieldFilter_Operator_name, int32(x)) +} +func (StructuredQuery_FieldFilter_Operator) EnumDescriptor() ([]byte, []int) { + return fileDescriptor3, []int{0, 3, 0} +} + +// A unary operator. +type StructuredQuery_UnaryFilter_Operator int32 + +const ( + // Unspecified. This value must not be used. + StructuredQuery_UnaryFilter_OPERATOR_UNSPECIFIED StructuredQuery_UnaryFilter_Operator = 0 + // Test if a field is equal to NaN. + StructuredQuery_UnaryFilter_IS_NAN StructuredQuery_UnaryFilter_Operator = 2 + // Test if an exprestion evaluates to Null. + StructuredQuery_UnaryFilter_IS_NULL StructuredQuery_UnaryFilter_Operator = 3 +) + +var StructuredQuery_UnaryFilter_Operator_name = map[int32]string{ + 0: "OPERATOR_UNSPECIFIED", + 2: "IS_NAN", + 3: "IS_NULL", +} +var StructuredQuery_UnaryFilter_Operator_value = map[string]int32{ + "OPERATOR_UNSPECIFIED": 0, + "IS_NAN": 2, + "IS_NULL": 3, +} + +func (x StructuredQuery_UnaryFilter_Operator) String() string { + return proto.EnumName(StructuredQuery_UnaryFilter_Operator_name, int32(x)) +} +func (StructuredQuery_UnaryFilter_Operator) EnumDescriptor() ([]byte, []int) { + return fileDescriptor3, []int{0, 4, 0} +} + +// A Firestore query. +type StructuredQuery struct { + // The projection to return. + Select *StructuredQuery_Projection `protobuf:"bytes,1,opt,name=select" json:"select,omitempty"` + // The collections to query. + From []*StructuredQuery_CollectionSelector `protobuf:"bytes,2,rep,name=from" json:"from,omitempty"` + // The filter to apply. + Where *StructuredQuery_Filter `protobuf:"bytes,3,opt,name=where" json:"where,omitempty"` + // The order to apply to the query results. + // + // Firestore guarantees a stable ordering through the following rules: + // + // * Any field required to appear in `order_by`, that is not already + // specified in `order_by`, is appended to the order in field name order + // by default. + // * If an order on `__name__` is not specified, it is appended by default. + // + // Fields are appended with the same sort direction as the last order + // specified, or 'ASCENDING' if no order was specified. For example: + // + // * `SELECT * FROM Foo ORDER BY A` becomes + // `SELECT * FROM Foo ORDER BY A, __name__` + // * `SELECT * FROM Foo ORDER BY A DESC` becomes + // `SELECT * FROM Foo ORDER BY A DESC, __name__ DESC` + // * `SELECT * FROM Foo WHERE A > 1` becomes + // `SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__` + OrderBy []*StructuredQuery_Order `protobuf:"bytes,4,rep,name=order_by,json=orderBy" json:"order_by,omitempty"` + // A starting point for the query results. + StartAt *Cursor `protobuf:"bytes,7,opt,name=start_at,json=startAt" json:"start_at,omitempty"` + // A end point for the query results. + EndAt *Cursor `protobuf:"bytes,8,opt,name=end_at,json=endAt" json:"end_at,omitempty"` + // The number of results to skip. + // + // Applies before limit, but after all other constraints. Must be >= 0 if + // specified. + Offset int32 `protobuf:"varint,6,opt,name=offset" json:"offset,omitempty"` + // The maximum number of results to return. + // + // Applies after all other constraints. + // Must be >= 0 if specified. + Limit *google_protobuf3.Int32Value `protobuf:"bytes,5,opt,name=limit" json:"limit,omitempty"` +} + +func (m *StructuredQuery) Reset() { *m = StructuredQuery{} } +func (m *StructuredQuery) String() string { return proto.CompactTextString(m) } +func (*StructuredQuery) ProtoMessage() {} +func (*StructuredQuery) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} } + +func (m *StructuredQuery) GetSelect() *StructuredQuery_Projection { + if m != nil { + return m.Select + } + return nil +} + +func (m *StructuredQuery) GetFrom() []*StructuredQuery_CollectionSelector { + if m != nil { + return m.From + } + return nil +} + +func (m *StructuredQuery) GetWhere() *StructuredQuery_Filter { + if m != nil { + return m.Where + } + return nil +} + +func (m *StructuredQuery) GetOrderBy() []*StructuredQuery_Order { + if m != nil { + return m.OrderBy + } + return nil +} + +func (m *StructuredQuery) GetStartAt() *Cursor { + if m != nil { + return m.StartAt + } + return nil +} + +func (m *StructuredQuery) GetEndAt() *Cursor { + if m != nil { + return m.EndAt + } + return nil +} + +func (m *StructuredQuery) GetOffset() int32 { + if m != nil { + return m.Offset + } + return 0 +} + +func (m *StructuredQuery) GetLimit() *google_protobuf3.Int32Value { + if m != nil { + return m.Limit + } + return nil +} + +// A selection of a collection, such as `messages as m1`. +type StructuredQuery_CollectionSelector struct { + // The collection ID. + // When set, selects only collections with this ID. + CollectionId string `protobuf:"bytes,2,opt,name=collection_id,json=collectionId" json:"collection_id,omitempty"` + // When false, selects only collections that are immediate children of + // the `parent` specified in the containing `RunQueryRequest`. + // When true, selects all descendant collections. + AllDescendants bool `protobuf:"varint,3,opt,name=all_descendants,json=allDescendants" json:"all_descendants,omitempty"` +} + +func (m *StructuredQuery_CollectionSelector) Reset() { *m = StructuredQuery_CollectionSelector{} } +func (m *StructuredQuery_CollectionSelector) String() string { return proto.CompactTextString(m) } +func (*StructuredQuery_CollectionSelector) ProtoMessage() {} +func (*StructuredQuery_CollectionSelector) Descriptor() ([]byte, []int) { + return fileDescriptor3, []int{0, 0} +} + +func (m *StructuredQuery_CollectionSelector) GetCollectionId() string { + if m != nil { + return m.CollectionId + } + return "" +} + +func (m *StructuredQuery_CollectionSelector) GetAllDescendants() bool { + if m != nil { + return m.AllDescendants + } + return false +} + +// A filter. +type StructuredQuery_Filter struct { + // The type of filter. + // + // Types that are valid to be assigned to FilterType: + // *StructuredQuery_Filter_CompositeFilter + // *StructuredQuery_Filter_FieldFilter + // *StructuredQuery_Filter_UnaryFilter + FilterType isStructuredQuery_Filter_FilterType `protobuf_oneof:"filter_type"` +} + +func (m *StructuredQuery_Filter) Reset() { *m = StructuredQuery_Filter{} } +func (m *StructuredQuery_Filter) String() string { return proto.CompactTextString(m) } +func (*StructuredQuery_Filter) ProtoMessage() {} +func (*StructuredQuery_Filter) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0, 1} } + +type isStructuredQuery_Filter_FilterType interface { + isStructuredQuery_Filter_FilterType() +} + +type StructuredQuery_Filter_CompositeFilter struct { + CompositeFilter *StructuredQuery_CompositeFilter `protobuf:"bytes,1,opt,name=composite_filter,json=compositeFilter,oneof"` +} +type StructuredQuery_Filter_FieldFilter struct { + FieldFilter *StructuredQuery_FieldFilter `protobuf:"bytes,2,opt,name=field_filter,json=fieldFilter,oneof"` +} +type StructuredQuery_Filter_UnaryFilter struct { + UnaryFilter *StructuredQuery_UnaryFilter `protobuf:"bytes,3,opt,name=unary_filter,json=unaryFilter,oneof"` +} + +func (*StructuredQuery_Filter_CompositeFilter) isStructuredQuery_Filter_FilterType() {} +func (*StructuredQuery_Filter_FieldFilter) isStructuredQuery_Filter_FilterType() {} +func (*StructuredQuery_Filter_UnaryFilter) isStructuredQuery_Filter_FilterType() {} + +func (m *StructuredQuery_Filter) GetFilterType() isStructuredQuery_Filter_FilterType { + if m != nil { + return m.FilterType + } + return nil +} + +func (m *StructuredQuery_Filter) GetCompositeFilter() *StructuredQuery_CompositeFilter { + if x, ok := m.GetFilterType().(*StructuredQuery_Filter_CompositeFilter); ok { + return x.CompositeFilter + } + return nil +} + +func (m *StructuredQuery_Filter) GetFieldFilter() *StructuredQuery_FieldFilter { + if x, ok := m.GetFilterType().(*StructuredQuery_Filter_FieldFilter); ok { + return x.FieldFilter + } + return nil +} + +func (m *StructuredQuery_Filter) GetUnaryFilter() *StructuredQuery_UnaryFilter { + if x, ok := m.GetFilterType().(*StructuredQuery_Filter_UnaryFilter); ok { + return x.UnaryFilter + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*StructuredQuery_Filter) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _StructuredQuery_Filter_OneofMarshaler, _StructuredQuery_Filter_OneofUnmarshaler, _StructuredQuery_Filter_OneofSizer, []interface{}{ + (*StructuredQuery_Filter_CompositeFilter)(nil), + (*StructuredQuery_Filter_FieldFilter)(nil), + (*StructuredQuery_Filter_UnaryFilter)(nil), + } +} + +func _StructuredQuery_Filter_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*StructuredQuery_Filter) + // filter_type + switch x := m.FilterType.(type) { + case *StructuredQuery_Filter_CompositeFilter: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.CompositeFilter); err != nil { + return err + } + case *StructuredQuery_Filter_FieldFilter: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.FieldFilter); err != nil { + return err + } + case *StructuredQuery_Filter_UnaryFilter: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.UnaryFilter); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("StructuredQuery_Filter.FilterType has unexpected type %T", x) + } + return nil +} + +func _StructuredQuery_Filter_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*StructuredQuery_Filter) + switch tag { + case 1: // filter_type.composite_filter + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(StructuredQuery_CompositeFilter) + err := b.DecodeMessage(msg) + m.FilterType = &StructuredQuery_Filter_CompositeFilter{msg} + return true, err + case 2: // filter_type.field_filter + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(StructuredQuery_FieldFilter) + err := b.DecodeMessage(msg) + m.FilterType = &StructuredQuery_Filter_FieldFilter{msg} + return true, err + case 3: // filter_type.unary_filter + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(StructuredQuery_UnaryFilter) + err := b.DecodeMessage(msg) + m.FilterType = &StructuredQuery_Filter_UnaryFilter{msg} + return true, err + default: + return false, nil + } +} + +func _StructuredQuery_Filter_OneofSizer(msg proto.Message) (n int) { + m := msg.(*StructuredQuery_Filter) + // filter_type + switch x := m.FilterType.(type) { + case *StructuredQuery_Filter_CompositeFilter: + s := proto.Size(x.CompositeFilter) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *StructuredQuery_Filter_FieldFilter: + s := proto.Size(x.FieldFilter) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *StructuredQuery_Filter_UnaryFilter: + s := proto.Size(x.UnaryFilter) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// A filter that merges multiple other filters using the given operator. +type StructuredQuery_CompositeFilter struct { + // The operator for combining multiple filters. + Op StructuredQuery_CompositeFilter_Operator `protobuf:"varint,1,opt,name=op,enum=google.firestore.v1beta1.StructuredQuery_CompositeFilter_Operator" json:"op,omitempty"` + // The list of filters to combine. + // Must contain at least one filter. + Filters []*StructuredQuery_Filter `protobuf:"bytes,2,rep,name=filters" json:"filters,omitempty"` +} + +func (m *StructuredQuery_CompositeFilter) Reset() { *m = StructuredQuery_CompositeFilter{} } +func (m *StructuredQuery_CompositeFilter) String() string { return proto.CompactTextString(m) } +func (*StructuredQuery_CompositeFilter) ProtoMessage() {} +func (*StructuredQuery_CompositeFilter) Descriptor() ([]byte, []int) { + return fileDescriptor3, []int{0, 2} +} + +func (m *StructuredQuery_CompositeFilter) GetOp() StructuredQuery_CompositeFilter_Operator { + if m != nil { + return m.Op + } + return StructuredQuery_CompositeFilter_OPERATOR_UNSPECIFIED +} + +func (m *StructuredQuery_CompositeFilter) GetFilters() []*StructuredQuery_Filter { + if m != nil { + return m.Filters + } + return nil +} + +// A filter on a specific field. +type StructuredQuery_FieldFilter struct { + // The field to filter by. + Field *StructuredQuery_FieldReference `protobuf:"bytes,1,opt,name=field" json:"field,omitempty"` + // The operator to filter by. + Op StructuredQuery_FieldFilter_Operator `protobuf:"varint,2,opt,name=op,enum=google.firestore.v1beta1.StructuredQuery_FieldFilter_Operator" json:"op,omitempty"` + // The value to compare to. + Value *Value `protobuf:"bytes,3,opt,name=value" json:"value,omitempty"` +} + +func (m *StructuredQuery_FieldFilter) Reset() { *m = StructuredQuery_FieldFilter{} } +func (m *StructuredQuery_FieldFilter) String() string { return proto.CompactTextString(m) } +func (*StructuredQuery_FieldFilter) ProtoMessage() {} +func (*StructuredQuery_FieldFilter) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0, 3} } + +func (m *StructuredQuery_FieldFilter) GetField() *StructuredQuery_FieldReference { + if m != nil { + return m.Field + } + return nil +} + +func (m *StructuredQuery_FieldFilter) GetOp() StructuredQuery_FieldFilter_Operator { + if m != nil { + return m.Op + } + return StructuredQuery_FieldFilter_OPERATOR_UNSPECIFIED +} + +func (m *StructuredQuery_FieldFilter) GetValue() *Value { + if m != nil { + return m.Value + } + return nil +} + +// A filter with a single operand. +type StructuredQuery_UnaryFilter struct { + // The unary operator to apply. + Op StructuredQuery_UnaryFilter_Operator `protobuf:"varint,1,opt,name=op,enum=google.firestore.v1beta1.StructuredQuery_UnaryFilter_Operator" json:"op,omitempty"` + // The argument to the filter. + // + // Types that are valid to be assigned to OperandType: + // *StructuredQuery_UnaryFilter_Field + OperandType isStructuredQuery_UnaryFilter_OperandType `protobuf_oneof:"operand_type"` +} + +func (m *StructuredQuery_UnaryFilter) Reset() { *m = StructuredQuery_UnaryFilter{} } +func (m *StructuredQuery_UnaryFilter) String() string { return proto.CompactTextString(m) } +func (*StructuredQuery_UnaryFilter) ProtoMessage() {} +func (*StructuredQuery_UnaryFilter) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0, 4} } + +type isStructuredQuery_UnaryFilter_OperandType interface { + isStructuredQuery_UnaryFilter_OperandType() +} + +type StructuredQuery_UnaryFilter_Field struct { + Field *StructuredQuery_FieldReference `protobuf:"bytes,2,opt,name=field,oneof"` +} + +func (*StructuredQuery_UnaryFilter_Field) isStructuredQuery_UnaryFilter_OperandType() {} + +func (m *StructuredQuery_UnaryFilter) GetOperandType() isStructuredQuery_UnaryFilter_OperandType { + if m != nil { + return m.OperandType + } + return nil +} + +func (m *StructuredQuery_UnaryFilter) GetOp() StructuredQuery_UnaryFilter_Operator { + if m != nil { + return m.Op + } + return StructuredQuery_UnaryFilter_OPERATOR_UNSPECIFIED +} + +func (m *StructuredQuery_UnaryFilter) GetField() *StructuredQuery_FieldReference { + if x, ok := m.GetOperandType().(*StructuredQuery_UnaryFilter_Field); ok { + return x.Field + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*StructuredQuery_UnaryFilter) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _StructuredQuery_UnaryFilter_OneofMarshaler, _StructuredQuery_UnaryFilter_OneofUnmarshaler, _StructuredQuery_UnaryFilter_OneofSizer, []interface{}{ + (*StructuredQuery_UnaryFilter_Field)(nil), + } +} + +func _StructuredQuery_UnaryFilter_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*StructuredQuery_UnaryFilter) + // operand_type + switch x := m.OperandType.(type) { + case *StructuredQuery_UnaryFilter_Field: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Field); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("StructuredQuery_UnaryFilter.OperandType has unexpected type %T", x) + } + return nil +} + +func _StructuredQuery_UnaryFilter_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*StructuredQuery_UnaryFilter) + switch tag { + case 2: // operand_type.field + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(StructuredQuery_FieldReference) + err := b.DecodeMessage(msg) + m.OperandType = &StructuredQuery_UnaryFilter_Field{msg} + return true, err + default: + return false, nil + } +} + +func _StructuredQuery_UnaryFilter_OneofSizer(msg proto.Message) (n int) { + m := msg.(*StructuredQuery_UnaryFilter) + // operand_type + switch x := m.OperandType.(type) { + case *StructuredQuery_UnaryFilter_Field: + s := proto.Size(x.Field) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// An order on a field. +type StructuredQuery_Order struct { + // The field to order by. + Field *StructuredQuery_FieldReference `protobuf:"bytes,1,opt,name=field" json:"field,omitempty"` + // The direction to order by. Defaults to `ASCENDING`. + Direction StructuredQuery_Direction `protobuf:"varint,2,opt,name=direction,enum=google.firestore.v1beta1.StructuredQuery_Direction" json:"direction,omitempty"` +} + +func (m *StructuredQuery_Order) Reset() { *m = StructuredQuery_Order{} } +func (m *StructuredQuery_Order) String() string { return proto.CompactTextString(m) } +func (*StructuredQuery_Order) ProtoMessage() {} +func (*StructuredQuery_Order) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0, 5} } + +func (m *StructuredQuery_Order) GetField() *StructuredQuery_FieldReference { + if m != nil { + return m.Field + } + return nil +} + +func (m *StructuredQuery_Order) GetDirection() StructuredQuery_Direction { + if m != nil { + return m.Direction + } + return StructuredQuery_DIRECTION_UNSPECIFIED +} + +// A reference to a field, such as `max(messages.time) as max_time`. +type StructuredQuery_FieldReference struct { + FieldPath string `protobuf:"bytes,2,opt,name=field_path,json=fieldPath" json:"field_path,omitempty"` +} + +func (m *StructuredQuery_FieldReference) Reset() { *m = StructuredQuery_FieldReference{} } +func (m *StructuredQuery_FieldReference) String() string { return proto.CompactTextString(m) } +func (*StructuredQuery_FieldReference) ProtoMessage() {} +func (*StructuredQuery_FieldReference) Descriptor() ([]byte, []int) { + return fileDescriptor3, []int{0, 6} +} + +func (m *StructuredQuery_FieldReference) GetFieldPath() string { + if m != nil { + return m.FieldPath + } + return "" +} + +// The projection of document's fields to return. +type StructuredQuery_Projection struct { + // The fields to return. + // + // If empty, all fields are returned. To only return the name + // of the document, use `['__name__']`. + Fields []*StructuredQuery_FieldReference `protobuf:"bytes,2,rep,name=fields" json:"fields,omitempty"` +} + +func (m *StructuredQuery_Projection) Reset() { *m = StructuredQuery_Projection{} } +func (m *StructuredQuery_Projection) String() string { return proto.CompactTextString(m) } +func (*StructuredQuery_Projection) ProtoMessage() {} +func (*StructuredQuery_Projection) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0, 7} } + +func (m *StructuredQuery_Projection) GetFields() []*StructuredQuery_FieldReference { + if m != nil { + return m.Fields + } + return nil +} + +// A position in a query result set. +type Cursor struct { + // The values that represent a position, in the order they appear in + // the order by clause of a query. + // + // Can contain fewer values than specified in the order by clause. + Values []*Value `protobuf:"bytes,1,rep,name=values" json:"values,omitempty"` + // If the position is just before or just after the given values, relative + // to the sort order defined by the query. + Before bool `protobuf:"varint,2,opt,name=before" json:"before,omitempty"` +} + +func (m *Cursor) Reset() { *m = Cursor{} } +func (m *Cursor) String() string { return proto.CompactTextString(m) } +func (*Cursor) ProtoMessage() {} +func (*Cursor) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{1} } + +func (m *Cursor) GetValues() []*Value { + if m != nil { + return m.Values + } + return nil +} + +func (m *Cursor) GetBefore() bool { + if m != nil { + return m.Before + } + return false +} + +func init() { + proto.RegisterType((*StructuredQuery)(nil), "google.firestore.v1beta1.StructuredQuery") + proto.RegisterType((*StructuredQuery_CollectionSelector)(nil), "google.firestore.v1beta1.StructuredQuery.CollectionSelector") + proto.RegisterType((*StructuredQuery_Filter)(nil), "google.firestore.v1beta1.StructuredQuery.Filter") + proto.RegisterType((*StructuredQuery_CompositeFilter)(nil), "google.firestore.v1beta1.StructuredQuery.CompositeFilter") + proto.RegisterType((*StructuredQuery_FieldFilter)(nil), "google.firestore.v1beta1.StructuredQuery.FieldFilter") + proto.RegisterType((*StructuredQuery_UnaryFilter)(nil), "google.firestore.v1beta1.StructuredQuery.UnaryFilter") + proto.RegisterType((*StructuredQuery_Order)(nil), "google.firestore.v1beta1.StructuredQuery.Order") + proto.RegisterType((*StructuredQuery_FieldReference)(nil), "google.firestore.v1beta1.StructuredQuery.FieldReference") + proto.RegisterType((*StructuredQuery_Projection)(nil), "google.firestore.v1beta1.StructuredQuery.Projection") + proto.RegisterType((*Cursor)(nil), "google.firestore.v1beta1.Cursor") + proto.RegisterEnum("google.firestore.v1beta1.StructuredQuery_Direction", StructuredQuery_Direction_name, StructuredQuery_Direction_value) + proto.RegisterEnum("google.firestore.v1beta1.StructuredQuery_CompositeFilter_Operator", StructuredQuery_CompositeFilter_Operator_name, StructuredQuery_CompositeFilter_Operator_value) + proto.RegisterEnum("google.firestore.v1beta1.StructuredQuery_FieldFilter_Operator", StructuredQuery_FieldFilter_Operator_name, StructuredQuery_FieldFilter_Operator_value) + proto.RegisterEnum("google.firestore.v1beta1.StructuredQuery_UnaryFilter_Operator", StructuredQuery_UnaryFilter_Operator_name, StructuredQuery_UnaryFilter_Operator_value) +} + +func init() { proto.RegisterFile("google/firestore/v1beta1/query.proto", fileDescriptor3) } + +var fileDescriptor3 = []byte{ + // 970 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0xdd, 0x6e, 0xe3, 0x44, + 0x14, 0xc7, 0xd7, 0x4e, 0xf3, 0x75, 0xd2, 0x0f, 0x6b, 0x04, 0x2b, 0x13, 0x96, 0xa5, 0x0a, 0x48, + 0xdb, 0x1b, 0x1c, 0xda, 0xb2, 0x02, 0xb4, 0x80, 0xe4, 0x24, 0x6e, 0x9b, 0x55, 0xe5, 0xa4, 0x93, + 0xb6, 0x12, 0xab, 0x0a, 0xcb, 0xb1, 0xc7, 0xa9, 0x91, 0xeb, 0x31, 0xe3, 0xf1, 0xae, 0x7a, 0xcd, + 0x9b, 0x70, 0xb9, 0x2f, 0x00, 0xcf, 0xc0, 0x53, 0x70, 0xcd, 0x23, 0x70, 0x81, 0x90, 0xc7, 0xe3, + 0xa4, 0xdd, 0xaa, 0x22, 0x29, 0xdc, 0xe5, 0x1c, 0x9f, 0xf3, 0x9b, 0xe3, 0xff, 0x39, 0xc7, 0x13, + 0xf8, 0x74, 0x46, 0xe9, 0x2c, 0x22, 0xdd, 0x20, 0x64, 0x24, 0xe5, 0x94, 0x91, 0xee, 0xeb, 0xdd, + 0x29, 0xe1, 0xee, 0x6e, 0xf7, 0xa7, 0x8c, 0xb0, 0x6b, 0x23, 0x61, 0x94, 0x53, 0xa4, 0x17, 0x51, + 0xc6, 0x3c, 0xca, 0x90, 0x51, 0xed, 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 0x32, 0x22, + 0x44, 0x68, 0x60, 0x69, 0xf5, 0x7e, 0x53, 0xe0, 0x89, 0x47, 0xaf, 0xee, 0xc5, 0xf4, 0x40, 0xbc, + 0xe0, 0x38, 0xbf, 0x10, 0xc7, 0xca, 0x2b, 0x53, 0xc6, 0xcd, 0x68, 0xe4, 0xc6, 0x33, 0x83, 0xb2, + 0x59, 0x77, 0x46, 0x62, 0x71, 0x5d, 0x76, 0x8b, 0x47, 0x6e, 0x12, 0xa6, 0x77, 0xff, 0x6e, 0xbd, + 0x98, 0x7b, 0x7e, 0x51, 0xd7, 0x0e, 0xfb, 0x07, 0x93, 0xb7, 0xea, 0xd3, 0xc3, 0x02, 0xd5, 0x8f, + 0x68, 0xe6, 0x1b, 0x07, 0xf3, 0x83, 0xcf, 0x77, 0x7b, 0x79, 0xc6, 0xef, 0x65, 0xc0, 0x85, 0x08, + 0xb8, 0x98, 0x07, 0x5c, 0x9c, 0x17, 0xc8, 0x69, 0x4d, 0x1c, 0xbb, 0xff, 0x4f, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x4c, 0xc9, 0x73, 0x9b, 0x42, 0x0a, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/firestore/v1beta1/write.pb.go b/vendor/google.golang.org/genproto/googleapis/firestore/v1beta1/write.pb.go new file mode 100644 index 0000000000..fca9fdd5e9 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/firestore/v1beta1/write.pb.go @@ -0,0 +1,612 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/firestore/v1beta1/write.proto + +package firestore + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf1 "github.com/golang/protobuf/ptypes/timestamp" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// A value that is calculated by the server. +type DocumentTransform_FieldTransform_ServerValue int32 + +const ( + // Unspecified. This value must not be used. + DocumentTransform_FieldTransform_SERVER_VALUE_UNSPECIFIED DocumentTransform_FieldTransform_ServerValue = 0 + // The time at which the server processed the request, with millisecond + // precision. + DocumentTransform_FieldTransform_REQUEST_TIME DocumentTransform_FieldTransform_ServerValue = 1 +) + +var DocumentTransform_FieldTransform_ServerValue_name = map[int32]string{ + 0: "SERVER_VALUE_UNSPECIFIED", + 1: "REQUEST_TIME", +} +var DocumentTransform_FieldTransform_ServerValue_value = map[string]int32{ + "SERVER_VALUE_UNSPECIFIED": 0, + "REQUEST_TIME": 1, +} + +func (x DocumentTransform_FieldTransform_ServerValue) String() string { + return proto.EnumName(DocumentTransform_FieldTransform_ServerValue_name, int32(x)) +} +func (DocumentTransform_FieldTransform_ServerValue) EnumDescriptor() ([]byte, []int) { + return fileDescriptor4, []int{1, 0, 0} +} + +// A write on a document. +type Write struct { + // The operation to execute. + // + // Types that are valid to be assigned to Operation: + // *Write_Update + // *Write_Delete + // *Write_Transform + Operation isWrite_Operation `protobuf_oneof:"operation"` + // The fields to update in this write. + // + // This field can be set only when the operation is `update`. + // None of the field paths in the mask may contain a reserved name. + // If the document exists on the server and has fields not referenced in the + // mask, they are left unchanged. + // Fields referenced in the mask, but not present in the input document, are + // deleted from the document on the server. + // The field paths in this mask must not contain a reserved field name. + UpdateMask *DocumentMask `protobuf:"bytes,3,opt,name=update_mask,json=updateMask" json:"update_mask,omitempty"` + // An optional precondition on the document. + // + // The write will fail if this is set and not met by the target document. + CurrentDocument *Precondition `protobuf:"bytes,4,opt,name=current_document,json=currentDocument" json:"current_document,omitempty"` +} + +func (m *Write) Reset() { *m = Write{} } +func (m *Write) String() string { return proto.CompactTextString(m) } +func (*Write) ProtoMessage() {} +func (*Write) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{0} } + +type isWrite_Operation interface { + isWrite_Operation() +} + +type Write_Update struct { + Update *Document `protobuf:"bytes,1,opt,name=update,oneof"` +} +type Write_Delete struct { + Delete string `protobuf:"bytes,2,opt,name=delete,oneof"` +} +type Write_Transform struct { + Transform *DocumentTransform `protobuf:"bytes,6,opt,name=transform,oneof"` +} + +func (*Write_Update) isWrite_Operation() {} +func (*Write_Delete) isWrite_Operation() {} +func (*Write_Transform) isWrite_Operation() {} + +func (m *Write) GetOperation() isWrite_Operation { + if m != nil { + return m.Operation + } + return nil +} + +func (m *Write) GetUpdate() *Document { + if x, ok := m.GetOperation().(*Write_Update); ok { + return x.Update + } + return nil +} + +func (m *Write) GetDelete() string { + if x, ok := m.GetOperation().(*Write_Delete); ok { + return x.Delete + } + return "" +} + +func (m *Write) GetTransform() *DocumentTransform { + if x, ok := m.GetOperation().(*Write_Transform); ok { + return x.Transform + } + return nil +} + +func (m *Write) GetUpdateMask() *DocumentMask { + if m != nil { + return m.UpdateMask + } + return nil +} + +func (m *Write) GetCurrentDocument() *Precondition { + if m != nil { + return m.CurrentDocument + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Write) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _Write_OneofMarshaler, _Write_OneofUnmarshaler, _Write_OneofSizer, []interface{}{ + (*Write_Update)(nil), + (*Write_Delete)(nil), + (*Write_Transform)(nil), + } +} + +func _Write_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Write) + // operation + switch x := m.Operation.(type) { + case *Write_Update: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Update); err != nil { + return err + } + case *Write_Delete: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeStringBytes(x.Delete) + case *Write_Transform: + b.EncodeVarint(6<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Transform); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("Write.Operation has unexpected type %T", x) + } + return nil +} + +func _Write_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Write) + switch tag { + case 1: // operation.update + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Document) + err := b.DecodeMessage(msg) + m.Operation = &Write_Update{msg} + return true, err + case 2: // operation.delete + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Operation = &Write_Delete{x} + return true, err + case 6: // operation.transform + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(DocumentTransform) + err := b.DecodeMessage(msg) + m.Operation = &Write_Transform{msg} + return true, err + default: + return false, nil + } +} + +func _Write_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Write) + // operation + switch x := m.Operation.(type) { + case *Write_Update: + s := proto.Size(x.Update) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Write_Delete: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Delete))) + n += len(x.Delete) + case *Write_Transform: + s := proto.Size(x.Transform) + n += proto.SizeVarint(6<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// A transformation of a document. +type DocumentTransform struct { + // The name of the document to transform. + Document string `protobuf:"bytes,1,opt,name=document" json:"document,omitempty"` + // The list of transformations to apply to the fields of the document, in + // order. + // This must not be empty. + FieldTransforms []*DocumentTransform_FieldTransform `protobuf:"bytes,2,rep,name=field_transforms,json=fieldTransforms" json:"field_transforms,omitempty"` +} + +func (m *DocumentTransform) Reset() { *m = DocumentTransform{} } +func (m *DocumentTransform) String() string { return proto.CompactTextString(m) } +func (*DocumentTransform) ProtoMessage() {} +func (*DocumentTransform) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{1} } + +func (m *DocumentTransform) GetDocument() string { + if m != nil { + return m.Document + } + return "" +} + +func (m *DocumentTransform) GetFieldTransforms() []*DocumentTransform_FieldTransform { + if m != nil { + return m.FieldTransforms + } + return nil +} + +// A transformation of a field of the document. +type DocumentTransform_FieldTransform struct { + // The path of the field. See [Document.fields][google.firestore.v1beta1.Document.fields] for the field path syntax + // reference. + FieldPath string `protobuf:"bytes,1,opt,name=field_path,json=fieldPath" json:"field_path,omitempty"` + // The transformation to apply on the field. + // + // Types that are valid to be assigned to TransformType: + // *DocumentTransform_FieldTransform_SetToServerValue + TransformType isDocumentTransform_FieldTransform_TransformType `protobuf_oneof:"transform_type"` +} + +func (m *DocumentTransform_FieldTransform) Reset() { *m = DocumentTransform_FieldTransform{} } +func (m *DocumentTransform_FieldTransform) String() string { return proto.CompactTextString(m) } +func (*DocumentTransform_FieldTransform) ProtoMessage() {} +func (*DocumentTransform_FieldTransform) Descriptor() ([]byte, []int) { + return fileDescriptor4, []int{1, 0} +} + +type isDocumentTransform_FieldTransform_TransformType interface { + isDocumentTransform_FieldTransform_TransformType() +} + +type DocumentTransform_FieldTransform_SetToServerValue struct { + SetToServerValue DocumentTransform_FieldTransform_ServerValue `protobuf:"varint,2,opt,name=set_to_server_value,json=setToServerValue,enum=google.firestore.v1beta1.DocumentTransform_FieldTransform_ServerValue,oneof"` +} + +func (*DocumentTransform_FieldTransform_SetToServerValue) isDocumentTransform_FieldTransform_TransformType() { +} + +func (m *DocumentTransform_FieldTransform) GetTransformType() isDocumentTransform_FieldTransform_TransformType { + if m != nil { + return m.TransformType + } + return nil +} + +func (m *DocumentTransform_FieldTransform) GetFieldPath() string { + if m != nil { + return m.FieldPath + } + return "" +} + +func (m *DocumentTransform_FieldTransform) GetSetToServerValue() DocumentTransform_FieldTransform_ServerValue { + if x, ok := m.GetTransformType().(*DocumentTransform_FieldTransform_SetToServerValue); ok { + return x.SetToServerValue + } + return DocumentTransform_FieldTransform_SERVER_VALUE_UNSPECIFIED +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*DocumentTransform_FieldTransform) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _DocumentTransform_FieldTransform_OneofMarshaler, _DocumentTransform_FieldTransform_OneofUnmarshaler, _DocumentTransform_FieldTransform_OneofSizer, []interface{}{ + (*DocumentTransform_FieldTransform_SetToServerValue)(nil), + } +} + +func _DocumentTransform_FieldTransform_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*DocumentTransform_FieldTransform) + // transform_type + switch x := m.TransformType.(type) { + case *DocumentTransform_FieldTransform_SetToServerValue: + b.EncodeVarint(2<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.SetToServerValue)) + case nil: + default: + return fmt.Errorf("DocumentTransform_FieldTransform.TransformType has unexpected type %T", x) + } + return nil +} + +func _DocumentTransform_FieldTransform_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*DocumentTransform_FieldTransform) + switch tag { + case 2: // transform_type.set_to_server_value + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.TransformType = &DocumentTransform_FieldTransform_SetToServerValue{DocumentTransform_FieldTransform_ServerValue(x)} + return true, err + default: + return false, nil + } +} + +func _DocumentTransform_FieldTransform_OneofSizer(msg proto.Message) (n int) { + m := msg.(*DocumentTransform_FieldTransform) + // transform_type + switch x := m.TransformType.(type) { + case *DocumentTransform_FieldTransform_SetToServerValue: + n += proto.SizeVarint(2<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.SetToServerValue)) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// The result of applying a write. +type WriteResult struct { + // The last update time of the document after applying the write. Not set + // after a `delete`. + // + // If the write did not actually change the document, this will be the + // previous update_time. + UpdateTime *google_protobuf1.Timestamp `protobuf:"bytes,1,opt,name=update_time,json=updateTime" json:"update_time,omitempty"` + // The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1beta1.DocumentTransform.FieldTransform], in the + // same order. + TransformResults []*Value `protobuf:"bytes,2,rep,name=transform_results,json=transformResults" json:"transform_results,omitempty"` +} + +func (m *WriteResult) Reset() { *m = WriteResult{} } +func (m *WriteResult) String() string { return proto.CompactTextString(m) } +func (*WriteResult) ProtoMessage() {} +func (*WriteResult) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{2} } + +func (m *WriteResult) GetUpdateTime() *google_protobuf1.Timestamp { + if m != nil { + return m.UpdateTime + } + return nil +} + +func (m *WriteResult) GetTransformResults() []*Value { + if m != nil { + return m.TransformResults + } + return nil +} + +// A [Document][google.firestore.v1beta1.Document] has changed. +// +// May be the result of multiple [writes][google.firestore.v1beta1.Write], including deletes, that +// ultimately resulted in a new value for the [Document][google.firestore.v1beta1.Document]. +// +// Multiple [DocumentChange][google.firestore.v1beta1.DocumentChange] messages may be returned for the same logical +// change, if multiple targets are affected. +type DocumentChange struct { + // The new state of the [Document][google.firestore.v1beta1.Document]. + // + // If `mask` is set, contains only fields that were updated or added. + Document *Document `protobuf:"bytes,1,opt,name=document" json:"document,omitempty"` + // A set of target IDs of targets that match this document. + TargetIds []int32 `protobuf:"varint,5,rep,packed,name=target_ids,json=targetIds" json:"target_ids,omitempty"` + // A set of target IDs for targets that no longer match this document. + RemovedTargetIds []int32 `protobuf:"varint,6,rep,packed,name=removed_target_ids,json=removedTargetIds" json:"removed_target_ids,omitempty"` +} + +func (m *DocumentChange) Reset() { *m = DocumentChange{} } +func (m *DocumentChange) String() string { return proto.CompactTextString(m) } +func (*DocumentChange) ProtoMessage() {} +func (*DocumentChange) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{3} } + +func (m *DocumentChange) GetDocument() *Document { + if m != nil { + return m.Document + } + return nil +} + +func (m *DocumentChange) GetTargetIds() []int32 { + if m != nil { + return m.TargetIds + } + return nil +} + +func (m *DocumentChange) GetRemovedTargetIds() []int32 { + if m != nil { + return m.RemovedTargetIds + } + return nil +} + +// A [Document][google.firestore.v1beta1.Document] has been deleted. +// +// May be the result of multiple [writes][google.firestore.v1beta1.Write], including updates, the +// last of which deleted the [Document][google.firestore.v1beta1.Document]. +// +// Multiple [DocumentDelete][google.firestore.v1beta1.DocumentDelete] messages may be returned for the same logical +// delete, if multiple targets are affected. +type DocumentDelete struct { + // The resource name of the [Document][google.firestore.v1beta1.Document] that was deleted. + Document string `protobuf:"bytes,1,opt,name=document" json:"document,omitempty"` + // A set of target IDs for targets that previously matched this entity. + RemovedTargetIds []int32 `protobuf:"varint,6,rep,packed,name=removed_target_ids,json=removedTargetIds" json:"removed_target_ids,omitempty"` + // The read timestamp at which the delete was observed. + // + // Greater or equal to the `commit_time` of the delete. + ReadTime *google_protobuf1.Timestamp `protobuf:"bytes,4,opt,name=read_time,json=readTime" json:"read_time,omitempty"` +} + +func (m *DocumentDelete) Reset() { *m = DocumentDelete{} } +func (m *DocumentDelete) String() string { return proto.CompactTextString(m) } +func (*DocumentDelete) ProtoMessage() {} +func (*DocumentDelete) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{4} } + +func (m *DocumentDelete) GetDocument() string { + if m != nil { + return m.Document + } + return "" +} + +func (m *DocumentDelete) GetRemovedTargetIds() []int32 { + if m != nil { + return m.RemovedTargetIds + } + return nil +} + +func (m *DocumentDelete) GetReadTime() *google_protobuf1.Timestamp { + if m != nil { + return m.ReadTime + } + return nil +} + +// A [Document][google.firestore.v1beta1.Document] has been removed from the view of the targets. +// +// Sent if the document is no longer relevant to a target and is out of view. +// Can be sent instead of a DocumentDelete or a DocumentChange if the server +// can not send the new value of the document. +// +// Multiple [DocumentRemove][google.firestore.v1beta1.DocumentRemove] messages may be returned for the same logical +// write or delete, if multiple targets are affected. +type DocumentRemove struct { + // The resource name of the [Document][google.firestore.v1beta1.Document] that has gone out of view. + Document string `protobuf:"bytes,1,opt,name=document" json:"document,omitempty"` + // A set of target IDs for targets that previously matched this document. + RemovedTargetIds []int32 `protobuf:"varint,2,rep,packed,name=removed_target_ids,json=removedTargetIds" json:"removed_target_ids,omitempty"` + // The read timestamp at which the remove was observed. + // + // Greater or equal to the `commit_time` of the change/delete/remove. + ReadTime *google_protobuf1.Timestamp `protobuf:"bytes,4,opt,name=read_time,json=readTime" json:"read_time,omitempty"` +} + +func (m *DocumentRemove) Reset() { *m = DocumentRemove{} } +func (m *DocumentRemove) String() string { return proto.CompactTextString(m) } +func (*DocumentRemove) ProtoMessage() {} +func (*DocumentRemove) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{5} } + +func (m *DocumentRemove) GetDocument() string { + if m != nil { + return m.Document + } + return "" +} + +func (m *DocumentRemove) GetRemovedTargetIds() []int32 { + if m != nil { + return m.RemovedTargetIds + } + return nil +} + +func (m *DocumentRemove) GetReadTime() *google_protobuf1.Timestamp { + if m != nil { + return m.ReadTime + } + return nil +} + +// A digest of all the documents that match a given target. +type ExistenceFilter struct { + // The target ID to which this filter applies. + TargetId int32 `protobuf:"varint,1,opt,name=target_id,json=targetId" json:"target_id,omitempty"` + // The total count of documents that match [target_id][google.firestore.v1beta1.ExistenceFilter.target_id]. + // + // If different from the count of documents in the client that match, the + // client must manually determine which documents no longer match the target. + Count int32 `protobuf:"varint,2,opt,name=count" json:"count,omitempty"` +} + +func (m *ExistenceFilter) Reset() { *m = ExistenceFilter{} } +func (m *ExistenceFilter) String() string { return proto.CompactTextString(m) } +func (*ExistenceFilter) ProtoMessage() {} +func (*ExistenceFilter) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{6} } + +func (m *ExistenceFilter) GetTargetId() int32 { + if m != nil { + return m.TargetId + } + return 0 +} + +func (m *ExistenceFilter) GetCount() int32 { + if m != nil { + return m.Count + } + return 0 +} + +func init() { + proto.RegisterType((*Write)(nil), "google.firestore.v1beta1.Write") + proto.RegisterType((*DocumentTransform)(nil), "google.firestore.v1beta1.DocumentTransform") + proto.RegisterType((*DocumentTransform_FieldTransform)(nil), "google.firestore.v1beta1.DocumentTransform.FieldTransform") + proto.RegisterType((*WriteResult)(nil), "google.firestore.v1beta1.WriteResult") + proto.RegisterType((*DocumentChange)(nil), "google.firestore.v1beta1.DocumentChange") + proto.RegisterType((*DocumentDelete)(nil), "google.firestore.v1beta1.DocumentDelete") + proto.RegisterType((*DocumentRemove)(nil), "google.firestore.v1beta1.DocumentRemove") + proto.RegisterType((*ExistenceFilter)(nil), "google.firestore.v1beta1.ExistenceFilter") + proto.RegisterEnum("google.firestore.v1beta1.DocumentTransform_FieldTransform_ServerValue", DocumentTransform_FieldTransform_ServerValue_name, DocumentTransform_FieldTransform_ServerValue_value) +} + +func init() { proto.RegisterFile("google/firestore/v1beta1/write.proto", fileDescriptor4) } + +var fileDescriptor4 = []byte{ + // 756 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xcd, 0x8e, 0xe3, 0x44, + 0x10, 0x8e, 0x93, 0x49, 0x34, 0xae, 0xa0, 0x8c, 0xb7, 0xe1, 0x60, 0x85, 0x59, 0x36, 0x8a, 0xf8, + 0x89, 0x04, 0x72, 0x34, 0xc3, 0x01, 0x89, 0x05, 0xa4, 0x4d, 0xe2, 0xcc, 0x44, 0xec, 0xa2, 0x6c, + 0x27, 0x13, 0x24, 0x34, 0x92, 0xd5, 0x13, 0x77, 0x3c, 0xd6, 0xda, 0x6e, 0xab, 0xbb, 0x9d, 0x85, + 0xd7, 0x80, 0x0b, 0x17, 0x2e, 0x1c, 0x79, 0x02, 0x9e, 0x81, 0x3b, 0x0f, 0xc3, 0x0d, 0xb9, 0xdb, + 0xf6, 0x66, 0x58, 0x85, 0xb0, 0x23, 0x6e, 0xae, 0xea, 0xaf, 0xbe, 0xfa, 0xea, 0x4f, 0x86, 0xf7, + 0x03, 0xc6, 0x82, 0x88, 0x0e, 0x37, 0x21, 0xa7, 0x42, 0x32, 0x4e, 0x87, 0xdb, 0xb3, 0x1b, 0x2a, + 0xc9, 0xd9, 0xf0, 0x25, 0x0f, 0x25, 0x75, 0x52, 0xce, 0x24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5, 0xca, 0xf3, 0x5c, + 0xc9, 0xdc, 0xf8, 0xee, 0x49, 0x81, 0x0b, 0x58, 0x44, 0x92, 0xc0, 0x61, 0x3c, 0x18, 0x06, 0x34, + 0x51, 0x3a, 0x87, 0xfa, 0x89, 0xa4, 0xa1, 0x78, 0xfd, 0x8f, 0xf1, 0xb8, 0xf2, 0xfc, 0x5a, 0x3f, + 0xba, 0x18, 0x4f, 0x17, 0xbf, 0xd5, 0xdf, 0xbb, 0xd0, 0x54, 0xe3, 0x88, 0x65, 0xbe, 0x33, 0xad, + 0x12, 0xaf, 0xce, 0x46, 0x79, 0xc4, 0x1f, 0x25, 0xe0, 0x5a, 0x01, 0xae, 0x2b, 0xc0, 0xf5, 0x4a, + 0x53, 0xde, 0xb4, 0x54, 0xda, 0x4f, 0xff, 0x0e, 0x00, 0x00, 0xff, 0xff, 0xba, 0xb7, 0x73, 0xcf, + 0x2c, 0x07, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/genomics/v1/annotations.pb.go b/vendor/google.golang.org/genproto/googleapis/genomics/v1/annotations.pb.go new file mode 100644 index 0000000000..7f2c5348be --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/genomics/v1/annotations.pb.go @@ -0,0 +1,2227 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/genomics/v1/annotations.proto + +/* +Package genomics is a generated protocol buffer package. + +It is generated from these files: + google/genomics/v1/annotations.proto + google/genomics/v1/cigar.proto + google/genomics/v1/datasets.proto + google/genomics/v1/operations.proto + google/genomics/v1/position.proto + google/genomics/v1/range.proto + google/genomics/v1/readalignment.proto + google/genomics/v1/readgroup.proto + google/genomics/v1/readgroupset.proto + google/genomics/v1/reads.proto + google/genomics/v1/references.proto + google/genomics/v1/variants.proto + +It has these top-level messages: + AnnotationSet + Annotation + VariantAnnotation + Transcript + ExternalId + CreateAnnotationSetRequest + GetAnnotationSetRequest + UpdateAnnotationSetRequest + DeleteAnnotationSetRequest + SearchAnnotationSetsRequest + SearchAnnotationSetsResponse + CreateAnnotationRequest + BatchCreateAnnotationsRequest + BatchCreateAnnotationsResponse + GetAnnotationRequest + UpdateAnnotationRequest + DeleteAnnotationRequest + SearchAnnotationsRequest + SearchAnnotationsResponse + CigarUnit + Dataset + ListDatasetsRequest + ListDatasetsResponse + CreateDatasetRequest + UpdateDatasetRequest + DeleteDatasetRequest + UndeleteDatasetRequest + GetDatasetRequest + OperationMetadata + OperationEvent + Position + Range + LinearAlignment + Read + ReadGroup + ReadGroupSet + SearchReadGroupSetsRequest + SearchReadGroupSetsResponse + ImportReadGroupSetsRequest + ImportReadGroupSetsResponse + ExportReadGroupSetRequest + UpdateReadGroupSetRequest + DeleteReadGroupSetRequest + GetReadGroupSetRequest + ListCoverageBucketsRequest + CoverageBucket + ListCoverageBucketsResponse + SearchReadsRequest + SearchReadsResponse + StreamReadsRequest + StreamReadsResponse + Reference + ReferenceSet + SearchReferenceSetsRequest + SearchReferenceSetsResponse + GetReferenceSetRequest + SearchReferencesRequest + SearchReferencesResponse + GetReferenceRequest + ListBasesRequest + ListBasesResponse + VariantSetMetadata + VariantSet + Variant + VariantCall + CallSet + ReferenceBound + ImportVariantsRequest + ImportVariantsResponse + CreateVariantSetRequest + ExportVariantSetRequest + GetVariantSetRequest + SearchVariantSetsRequest + SearchVariantSetsResponse + DeleteVariantSetRequest + UpdateVariantSetRequest + SearchVariantsRequest + SearchVariantsResponse + CreateVariantRequest + UpdateVariantRequest + DeleteVariantRequest + GetVariantRequest + MergeVariantsRequest + SearchCallSetsRequest + SearchCallSetsResponse + CreateCallSetRequest + UpdateCallSetRequest + DeleteCallSetRequest + GetCallSetRequest + StreamVariantsRequest + StreamVariantsResponse +*/ +package genomics + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf1 "github.com/golang/protobuf/ptypes/empty" +import google_protobuf2 "google.golang.org/genproto/protobuf/field_mask" +import google_protobuf3 "github.com/golang/protobuf/ptypes/struct" +import google_protobuf4 "github.com/golang/protobuf/ptypes/wrappers" +import google_rpc "google.golang.org/genproto/googleapis/rpc/status" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// When an [Annotation][google.genomics.v1.Annotation] or +// [AnnotationSet][google.genomics.v1.AnnotationSet] is created, if `type` is +// not specified it will be set to `GENERIC`. +type AnnotationType int32 + +const ( + AnnotationType_ANNOTATION_TYPE_UNSPECIFIED AnnotationType = 0 + // A `GENERIC` annotation type should be used when no other annotation + // type will suffice. This represents an untyped annotation of the reference + // genome. + AnnotationType_GENERIC AnnotationType = 1 + // A `VARIANT` annotation type. + AnnotationType_VARIANT AnnotationType = 2 + // A `GENE` annotation type represents the existence of a gene at the + // associated reference coordinates. The start coordinate is typically the + // gene's transcription start site and the end is typically the end of the + // gene's last exon. + AnnotationType_GENE AnnotationType = 3 + // A `TRANSCRIPT` annotation type represents the assertion that a + // particular region of the reference genome may be transcribed as RNA. + AnnotationType_TRANSCRIPT AnnotationType = 4 +) + +var AnnotationType_name = map[int32]string{ + 0: "ANNOTATION_TYPE_UNSPECIFIED", + 1: "GENERIC", + 2: "VARIANT", + 3: "GENE", + 4: "TRANSCRIPT", +} +var AnnotationType_value = map[string]int32{ + "ANNOTATION_TYPE_UNSPECIFIED": 0, + "GENERIC": 1, + "VARIANT": 2, + "GENE": 3, + "TRANSCRIPT": 4, +} + +func (x AnnotationType) String() string { + return proto.EnumName(AnnotationType_name, int32(x)) +} +func (AnnotationType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +type VariantAnnotation_Type int32 + +const ( + VariantAnnotation_TYPE_UNSPECIFIED VariantAnnotation_Type = 0 + // `TYPE_OTHER` should be used when no other Type will suffice. + // Further explanation of the variant type may be included in the + // [info][google.genomics.v1.Annotation.info] field. + VariantAnnotation_TYPE_OTHER VariantAnnotation_Type = 1 + // `INSERTION` indicates an insertion. + VariantAnnotation_INSERTION VariantAnnotation_Type = 2 + // `DELETION` indicates a deletion. + VariantAnnotation_DELETION VariantAnnotation_Type = 3 + // `SUBSTITUTION` indicates a block substitution of + // two or more nucleotides. + VariantAnnotation_SUBSTITUTION VariantAnnotation_Type = 4 + // `SNP` indicates a single nucleotide polymorphism. + VariantAnnotation_SNP VariantAnnotation_Type = 5 + // `STRUCTURAL` indicates a large structural variant, + // including chromosomal fusions, inversions, etc. + VariantAnnotation_STRUCTURAL VariantAnnotation_Type = 6 + // `CNV` indicates a variation in copy number. + VariantAnnotation_CNV VariantAnnotation_Type = 7 +) + +var VariantAnnotation_Type_name = map[int32]string{ + 0: "TYPE_UNSPECIFIED", + 1: "TYPE_OTHER", + 2: "INSERTION", + 3: "DELETION", + 4: "SUBSTITUTION", + 5: "SNP", + 6: "STRUCTURAL", + 7: "CNV", +} +var VariantAnnotation_Type_value = map[string]int32{ + "TYPE_UNSPECIFIED": 0, + "TYPE_OTHER": 1, + "INSERTION": 2, + "DELETION": 3, + "SUBSTITUTION": 4, + "SNP": 5, + "STRUCTURAL": 6, + "CNV": 7, +} + +func (x VariantAnnotation_Type) String() string { + return proto.EnumName(VariantAnnotation_Type_name, int32(x)) +} +func (VariantAnnotation_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{2, 0} } + +type VariantAnnotation_Effect int32 + +const ( + VariantAnnotation_EFFECT_UNSPECIFIED VariantAnnotation_Effect = 0 + // `EFFECT_OTHER` should be used when no other Effect + // will suffice. + VariantAnnotation_EFFECT_OTHER VariantAnnotation_Effect = 1 + // `FRAMESHIFT` indicates a mutation in which the insertion or + // deletion of nucleotides resulted in a frameshift change. + VariantAnnotation_FRAMESHIFT VariantAnnotation_Effect = 2 + // `FRAME_PRESERVING_INDEL` indicates a mutation in which a + // multiple of three nucleotides has been inserted or deleted, resulting + // in no change to the reading frame of the coding sequence. + VariantAnnotation_FRAME_PRESERVING_INDEL VariantAnnotation_Effect = 3 + // `SYNONYMOUS_SNP` indicates a single nucleotide polymorphism + // mutation that results in no amino acid change. + VariantAnnotation_SYNONYMOUS_SNP VariantAnnotation_Effect = 4 + // `NONSYNONYMOUS_SNP` indicates a single nucleotide + // polymorphism mutation that results in an amino acid change. + VariantAnnotation_NONSYNONYMOUS_SNP VariantAnnotation_Effect = 5 + // `STOP_GAIN` indicates a mutation that leads to the creation + // of a stop codon at the variant site. Frameshift mutations creating + // downstream stop codons do not count as `STOP_GAIN`. + VariantAnnotation_STOP_GAIN VariantAnnotation_Effect = 6 + // `STOP_LOSS` indicates a mutation that eliminates a + // stop codon at the variant site. + VariantAnnotation_STOP_LOSS VariantAnnotation_Effect = 7 + // `SPLICE_SITE_DISRUPTION` indicates that this variant is + // found in a splice site for the associated transcript, and alters the + // normal splicing pattern. + VariantAnnotation_SPLICE_SITE_DISRUPTION VariantAnnotation_Effect = 8 +) + +var VariantAnnotation_Effect_name = map[int32]string{ + 0: "EFFECT_UNSPECIFIED", + 1: "EFFECT_OTHER", + 2: "FRAMESHIFT", + 3: "FRAME_PRESERVING_INDEL", + 4: "SYNONYMOUS_SNP", + 5: "NONSYNONYMOUS_SNP", + 6: "STOP_GAIN", + 7: "STOP_LOSS", + 8: "SPLICE_SITE_DISRUPTION", +} +var VariantAnnotation_Effect_value = map[string]int32{ + "EFFECT_UNSPECIFIED": 0, + "EFFECT_OTHER": 1, + "FRAMESHIFT": 2, + "FRAME_PRESERVING_INDEL": 3, + "SYNONYMOUS_SNP": 4, + "NONSYNONYMOUS_SNP": 5, + "STOP_GAIN": 6, + "STOP_LOSS": 7, + "SPLICE_SITE_DISRUPTION": 8, +} + +func (x VariantAnnotation_Effect) String() string { + return proto.EnumName(VariantAnnotation_Effect_name, int32(x)) +} +func (VariantAnnotation_Effect) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{2, 1} } + +type VariantAnnotation_ClinicalSignificance int32 + +const ( + VariantAnnotation_CLINICAL_SIGNIFICANCE_UNSPECIFIED VariantAnnotation_ClinicalSignificance = 0 + // `OTHER` should be used when no other clinical significance + // value will suffice. + VariantAnnotation_CLINICAL_SIGNIFICANCE_OTHER VariantAnnotation_ClinicalSignificance = 1 + VariantAnnotation_UNCERTAIN VariantAnnotation_ClinicalSignificance = 2 + VariantAnnotation_BENIGN VariantAnnotation_ClinicalSignificance = 3 + VariantAnnotation_LIKELY_BENIGN VariantAnnotation_ClinicalSignificance = 4 + VariantAnnotation_LIKELY_PATHOGENIC VariantAnnotation_ClinicalSignificance = 5 + VariantAnnotation_PATHOGENIC VariantAnnotation_ClinicalSignificance = 6 + VariantAnnotation_DRUG_RESPONSE VariantAnnotation_ClinicalSignificance = 7 + VariantAnnotation_HISTOCOMPATIBILITY VariantAnnotation_ClinicalSignificance = 8 + VariantAnnotation_CONFERS_SENSITIVITY VariantAnnotation_ClinicalSignificance = 9 + VariantAnnotation_RISK_FACTOR VariantAnnotation_ClinicalSignificance = 10 + VariantAnnotation_ASSOCIATION VariantAnnotation_ClinicalSignificance = 11 + VariantAnnotation_PROTECTIVE VariantAnnotation_ClinicalSignificance = 12 + // `MULTIPLE_REPORTED` should be used when multiple clinical + // signficances are reported for a variant. The original clinical + // significance values may be provided in the `info` field. + VariantAnnotation_MULTIPLE_REPORTED VariantAnnotation_ClinicalSignificance = 13 +) + +var VariantAnnotation_ClinicalSignificance_name = map[int32]string{ + 0: "CLINICAL_SIGNIFICANCE_UNSPECIFIED", + 1: "CLINICAL_SIGNIFICANCE_OTHER", + 2: "UNCERTAIN", + 3: "BENIGN", + 4: "LIKELY_BENIGN", + 5: "LIKELY_PATHOGENIC", + 6: "PATHOGENIC", + 7: "DRUG_RESPONSE", + 8: "HISTOCOMPATIBILITY", + 9: "CONFERS_SENSITIVITY", + 10: "RISK_FACTOR", + 11: "ASSOCIATION", + 12: "PROTECTIVE", + 13: "MULTIPLE_REPORTED", +} +var VariantAnnotation_ClinicalSignificance_value = map[string]int32{ + "CLINICAL_SIGNIFICANCE_UNSPECIFIED": 0, + "CLINICAL_SIGNIFICANCE_OTHER": 1, + "UNCERTAIN": 2, + "BENIGN": 3, + "LIKELY_BENIGN": 4, + "LIKELY_PATHOGENIC": 5, + "PATHOGENIC": 6, + "DRUG_RESPONSE": 7, + "HISTOCOMPATIBILITY": 8, + "CONFERS_SENSITIVITY": 9, + "RISK_FACTOR": 10, + "ASSOCIATION": 11, + "PROTECTIVE": 12, + "MULTIPLE_REPORTED": 13, +} + +func (x VariantAnnotation_ClinicalSignificance) String() string { + return proto.EnumName(VariantAnnotation_ClinicalSignificance_name, int32(x)) +} +func (VariantAnnotation_ClinicalSignificance) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{2, 2} +} + +// An annotation set is a logical grouping of annotations that share consistent +// type information and provenance. Examples of annotation sets include 'all +// genes from refseq', and 'all variant annotations from ClinVar'. +type AnnotationSet struct { + // The server-generated annotation set ID, unique across all annotation sets. + Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + // The dataset to which this annotation set belongs. + DatasetId string `protobuf:"bytes,2,opt,name=dataset_id,json=datasetId" json:"dataset_id,omitempty"` + // The ID of the reference set that defines the coordinate space for this + // set's annotations. + ReferenceSetId string `protobuf:"bytes,3,opt,name=reference_set_id,json=referenceSetId" json:"reference_set_id,omitempty"` + // The display name for this annotation set. + Name string `protobuf:"bytes,4,opt,name=name" json:"name,omitempty"` + // The source URI describing the file from which this annotation set was + // generated, if any. + SourceUri string `protobuf:"bytes,5,opt,name=source_uri,json=sourceUri" json:"source_uri,omitempty"` + // The type of annotations contained within this set. + Type AnnotationType `protobuf:"varint,6,opt,name=type,enum=google.genomics.v1.AnnotationType" json:"type,omitempty"` + // A map of additional read alignment information. This must be of the form + // map (string key mapping to a list of string values). + Info map[string]*google_protobuf3.ListValue `protobuf:"bytes,17,rep,name=info" json:"info,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *AnnotationSet) Reset() { *m = AnnotationSet{} } +func (m *AnnotationSet) String() string { return proto.CompactTextString(m) } +func (*AnnotationSet) ProtoMessage() {} +func (*AnnotationSet) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *AnnotationSet) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *AnnotationSet) GetDatasetId() string { + if m != nil { + return m.DatasetId + } + return "" +} + +func (m *AnnotationSet) GetReferenceSetId() string { + if m != nil { + return m.ReferenceSetId + } + return "" +} + +func (m *AnnotationSet) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *AnnotationSet) GetSourceUri() string { + if m != nil { + return m.SourceUri + } + return "" +} + +func (m *AnnotationSet) GetType() AnnotationType { + if m != nil { + return m.Type + } + return AnnotationType_ANNOTATION_TYPE_UNSPECIFIED +} + +func (m *AnnotationSet) GetInfo() map[string]*google_protobuf3.ListValue { + if m != nil { + return m.Info + } + return nil +} + +// An annotation describes a region of reference genome. The value of an +// annotation may be one of several canonical types, supplemented by arbitrary +// info tags. An annotation is not inherently associated with a specific +// sample or individual (though a client could choose to use annotations in +// this way). Example canonical annotation types are `GENE` and +// `VARIANT`. +type Annotation struct { + // The server-generated annotation ID, unique across all annotations. + Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + // The annotation set to which this annotation belongs. + AnnotationSetId string `protobuf:"bytes,2,opt,name=annotation_set_id,json=annotationSetId" json:"annotation_set_id,omitempty"` + // The display name of this annotation. + Name string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"` + // The ID of the Google Genomics reference associated with this range. + ReferenceId string `protobuf:"bytes,4,opt,name=reference_id,json=referenceId" json:"reference_id,omitempty"` + // The display name corresponding to the reference specified by + // `referenceId`, for example `chr1`, `1`, or `chrX`. + ReferenceName string `protobuf:"bytes,5,opt,name=reference_name,json=referenceName" json:"reference_name,omitempty"` + // The start position of the range on the reference, 0-based inclusive. + Start int64 `protobuf:"varint,6,opt,name=start" json:"start,omitempty"` + // The end position of the range on the reference, 0-based exclusive. + End int64 `protobuf:"varint,7,opt,name=end" json:"end,omitempty"` + // Whether this range refers to the reverse strand, as opposed to the forward + // strand. Note that regardless of this field, the start/end position of the + // range always refer to the forward strand. + ReverseStrand bool `protobuf:"varint,8,opt,name=reverse_strand,json=reverseStrand" json:"reverse_strand,omitempty"` + // The data type for this annotation. Must match the containing annotation + // set's type. + Type AnnotationType `protobuf:"varint,9,opt,name=type,enum=google.genomics.v1.AnnotationType" json:"type,omitempty"` + // Types that are valid to be assigned to Value: + // *Annotation_Variant + // *Annotation_Transcript + Value isAnnotation_Value `protobuf_oneof:"value"` + // A map of additional read alignment information. This must be of the form + // map (string key mapping to a list of string values). + Info map[string]*google_protobuf3.ListValue `protobuf:"bytes,12,rep,name=info" json:"info,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *Annotation) Reset() { *m = Annotation{} } +func (m *Annotation) String() string { return proto.CompactTextString(m) } +func (*Annotation) ProtoMessage() {} +func (*Annotation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +type isAnnotation_Value interface { + isAnnotation_Value() +} + +type Annotation_Variant struct { + Variant *VariantAnnotation `protobuf:"bytes,10,opt,name=variant,oneof"` +} +type Annotation_Transcript struct { + Transcript *Transcript `protobuf:"bytes,11,opt,name=transcript,oneof"` +} + +func (*Annotation_Variant) isAnnotation_Value() {} +func (*Annotation_Transcript) isAnnotation_Value() {} + +func (m *Annotation) GetValue() isAnnotation_Value { + if m != nil { + return m.Value + } + return nil +} + +func (m *Annotation) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *Annotation) GetAnnotationSetId() string { + if m != nil { + return m.AnnotationSetId + } + return "" +} + +func (m *Annotation) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Annotation) GetReferenceId() string { + if m != nil { + return m.ReferenceId + } + return "" +} + +func (m *Annotation) GetReferenceName() string { + if m != nil { + return m.ReferenceName + } + return "" +} + +func (m *Annotation) GetStart() int64 { + if m != nil { + return m.Start + } + return 0 +} + +func (m *Annotation) GetEnd() int64 { + if m != nil { + return m.End + } + return 0 +} + +func (m *Annotation) GetReverseStrand() bool { + if m != nil { + return m.ReverseStrand + } + return false +} + +func (m *Annotation) GetType() AnnotationType { + if m != nil { + return m.Type + } + return AnnotationType_ANNOTATION_TYPE_UNSPECIFIED +} + +func (m *Annotation) GetVariant() *VariantAnnotation { + if x, ok := m.GetValue().(*Annotation_Variant); ok { + return x.Variant + } + return nil +} + +func (m *Annotation) GetTranscript() *Transcript { + if x, ok := m.GetValue().(*Annotation_Transcript); ok { + return x.Transcript + } + return nil +} + +func (m *Annotation) GetInfo() map[string]*google_protobuf3.ListValue { + if m != nil { + return m.Info + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Annotation) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _Annotation_OneofMarshaler, _Annotation_OneofUnmarshaler, _Annotation_OneofSizer, []interface{}{ + (*Annotation_Variant)(nil), + (*Annotation_Transcript)(nil), + } +} + +func _Annotation_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Annotation) + // value + switch x := m.Value.(type) { + case *Annotation_Variant: + b.EncodeVarint(10<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Variant); err != nil { + return err + } + case *Annotation_Transcript: + b.EncodeVarint(11<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Transcript); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("Annotation.Value has unexpected type %T", x) + } + return nil +} + +func _Annotation_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Annotation) + switch tag { + case 10: // value.variant + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(VariantAnnotation) + err := b.DecodeMessage(msg) + m.Value = &Annotation_Variant{msg} + return true, err + case 11: // value.transcript + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Transcript) + err := b.DecodeMessage(msg) + m.Value = &Annotation_Transcript{msg} + return true, err + default: + return false, nil + } +} + +func _Annotation_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Annotation) + // value + switch x := m.Value.(type) { + case *Annotation_Variant: + s := proto.Size(x.Variant) + n += proto.SizeVarint(10<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Annotation_Transcript: + s := proto.Size(x.Transcript) + n += proto.SizeVarint(11<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +type VariantAnnotation struct { + // Type has been adapted from ClinVar's list of variant types. + Type VariantAnnotation_Type `protobuf:"varint,1,opt,name=type,enum=google.genomics.v1.VariantAnnotation_Type" json:"type,omitempty"` + // Effect of the variant on the coding sequence. + Effect VariantAnnotation_Effect `protobuf:"varint,2,opt,name=effect,enum=google.genomics.v1.VariantAnnotation_Effect" json:"effect,omitempty"` + // The alternate allele for this variant. If multiple alternate alleles + // exist at this location, create a separate variant for each one, as they + // may represent distinct conditions. + AlternateBases string `protobuf:"bytes,3,opt,name=alternate_bases,json=alternateBases" json:"alternate_bases,omitempty"` + // Google annotation ID of the gene affected by this variant. This should + // be provided when the variant is created. + GeneId string `protobuf:"bytes,4,opt,name=gene_id,json=geneId" json:"gene_id,omitempty"` + // Google annotation IDs of the transcripts affected by this variant. These + // should be provided when the variant is created. + TranscriptIds []string `protobuf:"bytes,5,rep,name=transcript_ids,json=transcriptIds" json:"transcript_ids,omitempty"` + // The set of conditions associated with this variant. + // A condition describes the way a variant influences human health. + Conditions []*VariantAnnotation_ClinicalCondition `protobuf:"bytes,6,rep,name=conditions" json:"conditions,omitempty"` + // Describes the clinical significance of a variant. + // It is adapted from the ClinVar controlled vocabulary for clinical + // significance described at: + // http://www.ncbi.nlm.nih.gov/clinvar/docs/clinsig/ + ClinicalSignificance VariantAnnotation_ClinicalSignificance `protobuf:"varint,7,opt,name=clinical_significance,json=clinicalSignificance,enum=google.genomics.v1.VariantAnnotation_ClinicalSignificance" json:"clinical_significance,omitempty"` +} + +func (m *VariantAnnotation) Reset() { *m = VariantAnnotation{} } +func (m *VariantAnnotation) String() string { return proto.CompactTextString(m) } +func (*VariantAnnotation) ProtoMessage() {} +func (*VariantAnnotation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *VariantAnnotation) GetType() VariantAnnotation_Type { + if m != nil { + return m.Type + } + return VariantAnnotation_TYPE_UNSPECIFIED +} + +func (m *VariantAnnotation) GetEffect() VariantAnnotation_Effect { + if m != nil { + return m.Effect + } + return VariantAnnotation_EFFECT_UNSPECIFIED +} + +func (m *VariantAnnotation) GetAlternateBases() string { + if m != nil { + return m.AlternateBases + } + return "" +} + +func (m *VariantAnnotation) GetGeneId() string { + if m != nil { + return m.GeneId + } + return "" +} + +func (m *VariantAnnotation) GetTranscriptIds() []string { + if m != nil { + return m.TranscriptIds + } + return nil +} + +func (m *VariantAnnotation) GetConditions() []*VariantAnnotation_ClinicalCondition { + if m != nil { + return m.Conditions + } + return nil +} + +func (m *VariantAnnotation) GetClinicalSignificance() VariantAnnotation_ClinicalSignificance { + if m != nil { + return m.ClinicalSignificance + } + return VariantAnnotation_CLINICAL_SIGNIFICANCE_UNSPECIFIED +} + +type VariantAnnotation_ClinicalCondition struct { + // A set of names for the condition. + Names []string `protobuf:"bytes,1,rep,name=names" json:"names,omitempty"` + // The set of external IDs for this condition. + ExternalIds []*ExternalId `protobuf:"bytes,2,rep,name=external_ids,json=externalIds" json:"external_ids,omitempty"` + // The MedGen concept id associated with this gene. + // Search for these IDs at http://www.ncbi.nlm.nih.gov/medgen/ + ConceptId string `protobuf:"bytes,3,opt,name=concept_id,json=conceptId" json:"concept_id,omitempty"` + // The OMIM id for this condition. + // Search for these IDs at http://omim.org/ + OmimId string `protobuf:"bytes,4,opt,name=omim_id,json=omimId" json:"omim_id,omitempty"` +} + +func (m *VariantAnnotation_ClinicalCondition) Reset() { *m = VariantAnnotation_ClinicalCondition{} } +func (m *VariantAnnotation_ClinicalCondition) String() string { return proto.CompactTextString(m) } +func (*VariantAnnotation_ClinicalCondition) ProtoMessage() {} +func (*VariantAnnotation_ClinicalCondition) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{2, 0} +} + +func (m *VariantAnnotation_ClinicalCondition) GetNames() []string { + if m != nil { + return m.Names + } + return nil +} + +func (m *VariantAnnotation_ClinicalCondition) GetExternalIds() []*ExternalId { + if m != nil { + return m.ExternalIds + } + return nil +} + +func (m *VariantAnnotation_ClinicalCondition) GetConceptId() string { + if m != nil { + return m.ConceptId + } + return "" +} + +func (m *VariantAnnotation_ClinicalCondition) GetOmimId() string { + if m != nil { + return m.OmimId + } + return "" +} + +// A transcript represents the assertion that a particular region of the +// reference genome may be transcribed as RNA. +type Transcript struct { + // The annotation ID of the gene from which this transcript is transcribed. + GeneId string `protobuf:"bytes,1,opt,name=gene_id,json=geneId" json:"gene_id,omitempty"` + // The exons that compose + // this transcript. This field should be unset for genomes where transcript + // splicing does not occur, for example prokaryotes. + // + // Introns are regions of the transcript that are not included in the + // spliced RNA product. Though not explicitly modeled here, intron ranges can + // be deduced; all regions of this transcript that are not exons are introns. + // + // Exonic sequences do not necessarily code for a translational product + // (amino acids). Only the regions of exons bounded by the + // [codingSequence][google.genomics.v1.Transcript.coding_sequence] correspond + // to coding DNA sequence. + // + // Exons are ordered by start position and may not overlap. + Exons []*Transcript_Exon `protobuf:"bytes,2,rep,name=exons" json:"exons,omitempty"` + // The range of the coding sequence for this transcript, if any. To determine + // the exact ranges of coding sequence, intersect this range with those of the + // [exons][google.genomics.v1.Transcript.exons], if any. If there are any + // [exons][google.genomics.v1.Transcript.exons], the + // [codingSequence][google.genomics.v1.Transcript.coding_sequence] must start + // and end within them. + // + // Note that in some cases, the reference genome will not exactly match the + // observed mRNA transcript e.g. due to variance in the source genome from + // reference. In these cases, + // [exon.frame][google.genomics.v1.Transcript.Exon.frame] will not necessarily + // match the expected reference reading frame and coding exon reference bases + // cannot necessarily be concatenated to produce the original transcript mRNA. + CodingSequence *Transcript_CodingSequence `protobuf:"bytes,3,opt,name=coding_sequence,json=codingSequence" json:"coding_sequence,omitempty"` +} + +func (m *Transcript) Reset() { *m = Transcript{} } +func (m *Transcript) String() string { return proto.CompactTextString(m) } +func (*Transcript) ProtoMessage() {} +func (*Transcript) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *Transcript) GetGeneId() string { + if m != nil { + return m.GeneId + } + return "" +} + +func (m *Transcript) GetExons() []*Transcript_Exon { + if m != nil { + return m.Exons + } + return nil +} + +func (m *Transcript) GetCodingSequence() *Transcript_CodingSequence { + if m != nil { + return m.CodingSequence + } + return nil +} + +type Transcript_Exon struct { + // The start position of the exon on this annotation's reference sequence, + // 0-based inclusive. Note that this is relative to the reference start, and + // **not** the containing annotation start. + Start int64 `protobuf:"varint,1,opt,name=start" json:"start,omitempty"` + // The end position of the exon on this annotation's reference sequence, + // 0-based exclusive. Note that this is relative to the reference start, and + // *not* the containing annotation start. + End int64 `protobuf:"varint,2,opt,name=end" json:"end,omitempty"` + // The frame of this exon. Contains a value of 0, 1, or 2, which indicates + // the offset of the first coding base of the exon within the reading frame + // of the coding DNA sequence, if any. This field is dependent on the + // strandedness of this annotation (see + // [Annotation.reverse_strand][google.genomics.v1.Annotation.reverse_strand]). + // For forward stranded annotations, this offset is relative to the + // [exon.start][google.genomics.v1.Transcript.Exon.start]. For reverse + // strand annotations, this offset is relative to the + // [exon.end][google.genomics.v1.Transcript.Exon.end] `- 1`. + // + // Unset if this exon does not intersect the coding sequence. Upon creation + // of a transcript, the frame must be populated for all or none of the + // coding exons. + Frame *google_protobuf4.Int32Value `protobuf:"bytes,3,opt,name=frame" json:"frame,omitempty"` +} + +func (m *Transcript_Exon) Reset() { *m = Transcript_Exon{} } +func (m *Transcript_Exon) String() string { return proto.CompactTextString(m) } +func (*Transcript_Exon) ProtoMessage() {} +func (*Transcript_Exon) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3, 0} } + +func (m *Transcript_Exon) GetStart() int64 { + if m != nil { + return m.Start + } + return 0 +} + +func (m *Transcript_Exon) GetEnd() int64 { + if m != nil { + return m.End + } + return 0 +} + +func (m *Transcript_Exon) GetFrame() *google_protobuf4.Int32Value { + if m != nil { + return m.Frame + } + return nil +} + +type Transcript_CodingSequence struct { + // The start of the coding sequence on this annotation's reference sequence, + // 0-based inclusive. Note that this position is relative to the reference + // start, and *not* the containing annotation start. + Start int64 `protobuf:"varint,1,opt,name=start" json:"start,omitempty"` + // The end of the coding sequence on this annotation's reference sequence, + // 0-based exclusive. Note that this position is relative to the reference + // start, and *not* the containing annotation start. + End int64 `protobuf:"varint,2,opt,name=end" json:"end,omitempty"` +} + +func (m *Transcript_CodingSequence) Reset() { *m = Transcript_CodingSequence{} } +func (m *Transcript_CodingSequence) String() string { return proto.CompactTextString(m) } +func (*Transcript_CodingSequence) ProtoMessage() {} +func (*Transcript_CodingSequence) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3, 1} } + +func (m *Transcript_CodingSequence) GetStart() int64 { + if m != nil { + return m.Start + } + return 0 +} + +func (m *Transcript_CodingSequence) GetEnd() int64 { + if m != nil { + return m.End + } + return 0 +} + +type ExternalId struct { + // The name of the source of this data. + SourceName string `protobuf:"bytes,1,opt,name=source_name,json=sourceName" json:"source_name,omitempty"` + // The id used by the source of this data. + Id string `protobuf:"bytes,2,opt,name=id" json:"id,omitempty"` +} + +func (m *ExternalId) Reset() { *m = ExternalId{} } +func (m *ExternalId) String() string { return proto.CompactTextString(m) } +func (*ExternalId) ProtoMessage() {} +func (*ExternalId) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *ExternalId) GetSourceName() string { + if m != nil { + return m.SourceName + } + return "" +} + +func (m *ExternalId) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +type CreateAnnotationSetRequest struct { + // The annotation set to create. + AnnotationSet *AnnotationSet `protobuf:"bytes,1,opt,name=annotation_set,json=annotationSet" json:"annotation_set,omitempty"` +} + +func (m *CreateAnnotationSetRequest) Reset() { *m = CreateAnnotationSetRequest{} } +func (m *CreateAnnotationSetRequest) String() string { return proto.CompactTextString(m) } +func (*CreateAnnotationSetRequest) ProtoMessage() {} +func (*CreateAnnotationSetRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *CreateAnnotationSetRequest) GetAnnotationSet() *AnnotationSet { + if m != nil { + return m.AnnotationSet + } + return nil +} + +type GetAnnotationSetRequest struct { + // The ID of the annotation set to be retrieved. + AnnotationSetId string `protobuf:"bytes,1,opt,name=annotation_set_id,json=annotationSetId" json:"annotation_set_id,omitempty"` +} + +func (m *GetAnnotationSetRequest) Reset() { *m = GetAnnotationSetRequest{} } +func (m *GetAnnotationSetRequest) String() string { return proto.CompactTextString(m) } +func (*GetAnnotationSetRequest) ProtoMessage() {} +func (*GetAnnotationSetRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *GetAnnotationSetRequest) GetAnnotationSetId() string { + if m != nil { + return m.AnnotationSetId + } + return "" +} + +type UpdateAnnotationSetRequest struct { + // The ID of the annotation set to be updated. + AnnotationSetId string `protobuf:"bytes,1,opt,name=annotation_set_id,json=annotationSetId" json:"annotation_set_id,omitempty"` + // The new annotation set. + AnnotationSet *AnnotationSet `protobuf:"bytes,2,opt,name=annotation_set,json=annotationSet" json:"annotation_set,omitempty"` + // An optional mask specifying which fields to update. Mutable fields are + // [name][google.genomics.v1.AnnotationSet.name], + // [source_uri][google.genomics.v1.AnnotationSet.source_uri], and + // [info][google.genomics.v1.AnnotationSet.info]. If unspecified, all + // mutable fields will be updated. + UpdateMask *google_protobuf2.FieldMask `protobuf:"bytes,3,opt,name=update_mask,json=updateMask" json:"update_mask,omitempty"` +} + +func (m *UpdateAnnotationSetRequest) Reset() { *m = UpdateAnnotationSetRequest{} } +func (m *UpdateAnnotationSetRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateAnnotationSetRequest) ProtoMessage() {} +func (*UpdateAnnotationSetRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *UpdateAnnotationSetRequest) GetAnnotationSetId() string { + if m != nil { + return m.AnnotationSetId + } + return "" +} + +func (m *UpdateAnnotationSetRequest) GetAnnotationSet() *AnnotationSet { + if m != nil { + return m.AnnotationSet + } + return nil +} + +func (m *UpdateAnnotationSetRequest) GetUpdateMask() *google_protobuf2.FieldMask { + if m != nil { + return m.UpdateMask + } + return nil +} + +type DeleteAnnotationSetRequest struct { + // The ID of the annotation set to be deleted. + AnnotationSetId string `protobuf:"bytes,1,opt,name=annotation_set_id,json=annotationSetId" json:"annotation_set_id,omitempty"` +} + +func (m *DeleteAnnotationSetRequest) Reset() { *m = DeleteAnnotationSetRequest{} } +func (m *DeleteAnnotationSetRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteAnnotationSetRequest) ProtoMessage() {} +func (*DeleteAnnotationSetRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *DeleteAnnotationSetRequest) GetAnnotationSetId() string { + if m != nil { + return m.AnnotationSetId + } + return "" +} + +type SearchAnnotationSetsRequest struct { + // Required. The dataset IDs to search within. Caller must have `READ` access + // to these datasets. + DatasetIds []string `protobuf:"bytes,1,rep,name=dataset_ids,json=datasetIds" json:"dataset_ids,omitempty"` + // If specified, only annotation sets associated with the given reference set + // are returned. + ReferenceSetId string `protobuf:"bytes,2,opt,name=reference_set_id,json=referenceSetId" json:"reference_set_id,omitempty"` + // Only return annotations sets for which a substring of the name matches this + // string (case insensitive). + Name string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"` + // If specified, only annotation sets that have any of these types are + // returned. + Types []AnnotationType `protobuf:"varint,4,rep,packed,name=types,enum=google.genomics.v1.AnnotationType" json:"types,omitempty"` + // The continuation token, which is used to page through large result sets. + // To get the next page of results, set this parameter to the value of + // `nextPageToken` from the previous response. + PageToken string `protobuf:"bytes,5,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` + // The maximum number of results to return in a single page. If unspecified, + // defaults to 128. The maximum value is 1024. + PageSize int32 `protobuf:"varint,6,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` +} + +func (m *SearchAnnotationSetsRequest) Reset() { *m = SearchAnnotationSetsRequest{} } +func (m *SearchAnnotationSetsRequest) String() string { return proto.CompactTextString(m) } +func (*SearchAnnotationSetsRequest) ProtoMessage() {} +func (*SearchAnnotationSetsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *SearchAnnotationSetsRequest) GetDatasetIds() []string { + if m != nil { + return m.DatasetIds + } + return nil +} + +func (m *SearchAnnotationSetsRequest) GetReferenceSetId() string { + if m != nil { + return m.ReferenceSetId + } + return "" +} + +func (m *SearchAnnotationSetsRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *SearchAnnotationSetsRequest) GetTypes() []AnnotationType { + if m != nil { + return m.Types + } + return nil +} + +func (m *SearchAnnotationSetsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +func (m *SearchAnnotationSetsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +type SearchAnnotationSetsResponse struct { + // The matching annotation sets. + AnnotationSets []*AnnotationSet `protobuf:"bytes,1,rep,name=annotation_sets,json=annotationSets" json:"annotation_sets,omitempty"` + // The continuation token, which is used to page through large result sets. + // Provide this value in a subsequent request to return the next page of + // results. This field will be empty if there aren't any additional results. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *SearchAnnotationSetsResponse) Reset() { *m = SearchAnnotationSetsResponse{} } +func (m *SearchAnnotationSetsResponse) String() string { return proto.CompactTextString(m) } +func (*SearchAnnotationSetsResponse) ProtoMessage() {} +func (*SearchAnnotationSetsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *SearchAnnotationSetsResponse) GetAnnotationSets() []*AnnotationSet { + if m != nil { + return m.AnnotationSets + } + return nil +} + +func (m *SearchAnnotationSetsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +type CreateAnnotationRequest struct { + // The annotation to be created. + Annotation *Annotation `protobuf:"bytes,1,opt,name=annotation" json:"annotation,omitempty"` +} + +func (m *CreateAnnotationRequest) Reset() { *m = CreateAnnotationRequest{} } +func (m *CreateAnnotationRequest) String() string { return proto.CompactTextString(m) } +func (*CreateAnnotationRequest) ProtoMessage() {} +func (*CreateAnnotationRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } + +func (m *CreateAnnotationRequest) GetAnnotation() *Annotation { + if m != nil { + return m.Annotation + } + return nil +} + +type BatchCreateAnnotationsRequest struct { + // The annotations to be created. At most 4096 can be specified in a single + // request. + Annotations []*Annotation `protobuf:"bytes,1,rep,name=annotations" json:"annotations,omitempty"` + // A unique request ID which enables the server to detect duplicated requests. + // If provided, duplicated requests will result in the same response; if not + // provided, duplicated requests may result in duplicated data. For a given + // annotation set, callers should not reuse `request_id`s when writing + // different batches of annotations - behavior in this case is undefined. + // A common approach is to use a UUID. For batch jobs where worker crashes are + // a possibility, consider using some unique variant of a worker or run ID. + RequestId string `protobuf:"bytes,2,opt,name=request_id,json=requestId" json:"request_id,omitempty"` +} + +func (m *BatchCreateAnnotationsRequest) Reset() { *m = BatchCreateAnnotationsRequest{} } +func (m *BatchCreateAnnotationsRequest) String() string { return proto.CompactTextString(m) } +func (*BatchCreateAnnotationsRequest) ProtoMessage() {} +func (*BatchCreateAnnotationsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } + +func (m *BatchCreateAnnotationsRequest) GetAnnotations() []*Annotation { + if m != nil { + return m.Annotations + } + return nil +} + +func (m *BatchCreateAnnotationsRequest) GetRequestId() string { + if m != nil { + return m.RequestId + } + return "" +} + +type BatchCreateAnnotationsResponse struct { + // The resulting per-annotation entries, ordered consistently with the + // original request. + Entries []*BatchCreateAnnotationsResponse_Entry `protobuf:"bytes,1,rep,name=entries" json:"entries,omitempty"` +} + +func (m *BatchCreateAnnotationsResponse) Reset() { *m = BatchCreateAnnotationsResponse{} } +func (m *BatchCreateAnnotationsResponse) String() string { return proto.CompactTextString(m) } +func (*BatchCreateAnnotationsResponse) ProtoMessage() {} +func (*BatchCreateAnnotationsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } + +func (m *BatchCreateAnnotationsResponse) GetEntries() []*BatchCreateAnnotationsResponse_Entry { + if m != nil { + return m.Entries + } + return nil +} + +type BatchCreateAnnotationsResponse_Entry struct { + // The creation status. + Status *google_rpc.Status `protobuf:"bytes,1,opt,name=status" json:"status,omitempty"` + // The created annotation, if creation was successful. + Annotation *Annotation `protobuf:"bytes,2,opt,name=annotation" json:"annotation,omitempty"` +} + +func (m *BatchCreateAnnotationsResponse_Entry) Reset() { *m = BatchCreateAnnotationsResponse_Entry{} } +func (m *BatchCreateAnnotationsResponse_Entry) String() string { return proto.CompactTextString(m) } +func (*BatchCreateAnnotationsResponse_Entry) ProtoMessage() {} +func (*BatchCreateAnnotationsResponse_Entry) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{13, 0} +} + +func (m *BatchCreateAnnotationsResponse_Entry) GetStatus() *google_rpc.Status { + if m != nil { + return m.Status + } + return nil +} + +func (m *BatchCreateAnnotationsResponse_Entry) GetAnnotation() *Annotation { + if m != nil { + return m.Annotation + } + return nil +} + +type GetAnnotationRequest struct { + // The ID of the annotation to be retrieved. + AnnotationId string `protobuf:"bytes,1,opt,name=annotation_id,json=annotationId" json:"annotation_id,omitempty"` +} + +func (m *GetAnnotationRequest) Reset() { *m = GetAnnotationRequest{} } +func (m *GetAnnotationRequest) String() string { return proto.CompactTextString(m) } +func (*GetAnnotationRequest) ProtoMessage() {} +func (*GetAnnotationRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } + +func (m *GetAnnotationRequest) GetAnnotationId() string { + if m != nil { + return m.AnnotationId + } + return "" +} + +type UpdateAnnotationRequest struct { + // The ID of the annotation to be updated. + AnnotationId string `protobuf:"bytes,1,opt,name=annotation_id,json=annotationId" json:"annotation_id,omitempty"` + // The new annotation. + Annotation *Annotation `protobuf:"bytes,2,opt,name=annotation" json:"annotation,omitempty"` + // An optional mask specifying which fields to update. Mutable fields are + // [name][google.genomics.v1.Annotation.name], + // [variant][google.genomics.v1.Annotation.variant], + // [transcript][google.genomics.v1.Annotation.transcript], and + // [info][google.genomics.v1.Annotation.info]. If unspecified, all mutable + // fields will be updated. + UpdateMask *google_protobuf2.FieldMask `protobuf:"bytes,3,opt,name=update_mask,json=updateMask" json:"update_mask,omitempty"` +} + +func (m *UpdateAnnotationRequest) Reset() { *m = UpdateAnnotationRequest{} } +func (m *UpdateAnnotationRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateAnnotationRequest) ProtoMessage() {} +func (*UpdateAnnotationRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } + +func (m *UpdateAnnotationRequest) GetAnnotationId() string { + if m != nil { + return m.AnnotationId + } + return "" +} + +func (m *UpdateAnnotationRequest) GetAnnotation() *Annotation { + if m != nil { + return m.Annotation + } + return nil +} + +func (m *UpdateAnnotationRequest) GetUpdateMask() *google_protobuf2.FieldMask { + if m != nil { + return m.UpdateMask + } + return nil +} + +type DeleteAnnotationRequest struct { + // The ID of the annotation to be deleted. + AnnotationId string `protobuf:"bytes,1,opt,name=annotation_id,json=annotationId" json:"annotation_id,omitempty"` +} + +func (m *DeleteAnnotationRequest) Reset() { *m = DeleteAnnotationRequest{} } +func (m *DeleteAnnotationRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteAnnotationRequest) ProtoMessage() {} +func (*DeleteAnnotationRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} } + +func (m *DeleteAnnotationRequest) GetAnnotationId() string { + if m != nil { + return m.AnnotationId + } + return "" +} + +type SearchAnnotationsRequest struct { + // Required. The annotation sets to search within. The caller must have + // `READ` access to these annotation sets. + // All queried annotation sets must have the same type. + AnnotationSetIds []string `protobuf:"bytes,1,rep,name=annotation_set_ids,json=annotationSetIds" json:"annotation_set_ids,omitempty"` + // Required. `reference_id` or `reference_name` must be set. + // + // Types that are valid to be assigned to Reference: + // *SearchAnnotationsRequest_ReferenceId + // *SearchAnnotationsRequest_ReferenceName + Reference isSearchAnnotationsRequest_Reference `protobuf_oneof:"reference"` + // The start position of the range on the reference, 0-based inclusive. If + // specified, + // [referenceId][google.genomics.v1.SearchAnnotationsRequest.reference_id] or + // [referenceName][google.genomics.v1.SearchAnnotationsRequest.reference_name] + // must be specified. Defaults to 0. + Start int64 `protobuf:"varint,4,opt,name=start" json:"start,omitempty"` + // The end position of the range on the reference, 0-based exclusive. If + // [referenceId][google.genomics.v1.SearchAnnotationsRequest.reference_id] or + // [referenceName][google.genomics.v1.SearchAnnotationsRequest.reference_name] + // must be specified, Defaults to the length of the reference. + End int64 `protobuf:"varint,5,opt,name=end" json:"end,omitempty"` + // The continuation token, which is used to page through large result sets. + // To get the next page of results, set this parameter to the value of + // `nextPageToken` from the previous response. + PageToken string `protobuf:"bytes,6,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` + // The maximum number of results to return in a single page. If unspecified, + // defaults to 256. The maximum value is 2048. + PageSize int32 `protobuf:"varint,7,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` +} + +func (m *SearchAnnotationsRequest) Reset() { *m = SearchAnnotationsRequest{} } +func (m *SearchAnnotationsRequest) String() string { return proto.CompactTextString(m) } +func (*SearchAnnotationsRequest) ProtoMessage() {} +func (*SearchAnnotationsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17} } + +type isSearchAnnotationsRequest_Reference interface { + isSearchAnnotationsRequest_Reference() +} + +type SearchAnnotationsRequest_ReferenceId struct { + ReferenceId string `protobuf:"bytes,2,opt,name=reference_id,json=referenceId,oneof"` +} +type SearchAnnotationsRequest_ReferenceName struct { + ReferenceName string `protobuf:"bytes,3,opt,name=reference_name,json=referenceName,oneof"` +} + +func (*SearchAnnotationsRequest_ReferenceId) isSearchAnnotationsRequest_Reference() {} +func (*SearchAnnotationsRequest_ReferenceName) isSearchAnnotationsRequest_Reference() {} + +func (m *SearchAnnotationsRequest) GetReference() isSearchAnnotationsRequest_Reference { + if m != nil { + return m.Reference + } + return nil +} + +func (m *SearchAnnotationsRequest) GetAnnotationSetIds() []string { + if m != nil { + return m.AnnotationSetIds + } + return nil +} + +func (m *SearchAnnotationsRequest) GetReferenceId() string { + if x, ok := m.GetReference().(*SearchAnnotationsRequest_ReferenceId); ok { + return x.ReferenceId + } + return "" +} + +func (m *SearchAnnotationsRequest) GetReferenceName() string { + if x, ok := m.GetReference().(*SearchAnnotationsRequest_ReferenceName); ok { + return x.ReferenceName + } + return "" +} + +func (m *SearchAnnotationsRequest) GetStart() int64 { + if m != nil { + return m.Start + } + return 0 +} + +func (m *SearchAnnotationsRequest) GetEnd() int64 { + if m != nil { + return m.End + } + return 0 +} + +func (m *SearchAnnotationsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +func (m *SearchAnnotationsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*SearchAnnotationsRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _SearchAnnotationsRequest_OneofMarshaler, _SearchAnnotationsRequest_OneofUnmarshaler, _SearchAnnotationsRequest_OneofSizer, []interface{}{ + (*SearchAnnotationsRequest_ReferenceId)(nil), + (*SearchAnnotationsRequest_ReferenceName)(nil), + } +} + +func _SearchAnnotationsRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*SearchAnnotationsRequest) + // reference + switch x := m.Reference.(type) { + case *SearchAnnotationsRequest_ReferenceId: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeStringBytes(x.ReferenceId) + case *SearchAnnotationsRequest_ReferenceName: + b.EncodeVarint(3<<3 | proto.WireBytes) + b.EncodeStringBytes(x.ReferenceName) + case nil: + default: + return fmt.Errorf("SearchAnnotationsRequest.Reference has unexpected type %T", x) + } + return nil +} + +func _SearchAnnotationsRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*SearchAnnotationsRequest) + switch tag { + case 2: // reference.reference_id + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Reference = &SearchAnnotationsRequest_ReferenceId{x} + return true, err + case 3: // reference.reference_name + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Reference = &SearchAnnotationsRequest_ReferenceName{x} + return true, err + default: + return false, nil + } +} + +func _SearchAnnotationsRequest_OneofSizer(msg proto.Message) (n int) { + m := msg.(*SearchAnnotationsRequest) + // reference + switch x := m.Reference.(type) { + case *SearchAnnotationsRequest_ReferenceId: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.ReferenceId))) + n += len(x.ReferenceId) + case *SearchAnnotationsRequest_ReferenceName: + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.ReferenceName))) + n += len(x.ReferenceName) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +type SearchAnnotationsResponse struct { + // The matching annotations. + Annotations []*Annotation `protobuf:"bytes,1,rep,name=annotations" json:"annotations,omitempty"` + // The continuation token, which is used to page through large result sets. + // Provide this value in a subsequent request to return the next page of + // results. This field will be empty if there aren't any additional results. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *SearchAnnotationsResponse) Reset() { *m = SearchAnnotationsResponse{} } +func (m *SearchAnnotationsResponse) String() string { return proto.CompactTextString(m) } +func (*SearchAnnotationsResponse) ProtoMessage() {} +func (*SearchAnnotationsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{18} } + +func (m *SearchAnnotationsResponse) GetAnnotations() []*Annotation { + if m != nil { + return m.Annotations + } + return nil +} + +func (m *SearchAnnotationsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +func init() { + proto.RegisterType((*AnnotationSet)(nil), "google.genomics.v1.AnnotationSet") + proto.RegisterType((*Annotation)(nil), "google.genomics.v1.Annotation") + proto.RegisterType((*VariantAnnotation)(nil), "google.genomics.v1.VariantAnnotation") + proto.RegisterType((*VariantAnnotation_ClinicalCondition)(nil), "google.genomics.v1.VariantAnnotation.ClinicalCondition") + proto.RegisterType((*Transcript)(nil), "google.genomics.v1.Transcript") + proto.RegisterType((*Transcript_Exon)(nil), "google.genomics.v1.Transcript.Exon") + proto.RegisterType((*Transcript_CodingSequence)(nil), "google.genomics.v1.Transcript.CodingSequence") + proto.RegisterType((*ExternalId)(nil), "google.genomics.v1.ExternalId") + proto.RegisterType((*CreateAnnotationSetRequest)(nil), "google.genomics.v1.CreateAnnotationSetRequest") + proto.RegisterType((*GetAnnotationSetRequest)(nil), "google.genomics.v1.GetAnnotationSetRequest") + proto.RegisterType((*UpdateAnnotationSetRequest)(nil), "google.genomics.v1.UpdateAnnotationSetRequest") + proto.RegisterType((*DeleteAnnotationSetRequest)(nil), "google.genomics.v1.DeleteAnnotationSetRequest") + proto.RegisterType((*SearchAnnotationSetsRequest)(nil), "google.genomics.v1.SearchAnnotationSetsRequest") + proto.RegisterType((*SearchAnnotationSetsResponse)(nil), "google.genomics.v1.SearchAnnotationSetsResponse") + proto.RegisterType((*CreateAnnotationRequest)(nil), "google.genomics.v1.CreateAnnotationRequest") + proto.RegisterType((*BatchCreateAnnotationsRequest)(nil), "google.genomics.v1.BatchCreateAnnotationsRequest") + proto.RegisterType((*BatchCreateAnnotationsResponse)(nil), "google.genomics.v1.BatchCreateAnnotationsResponse") + proto.RegisterType((*BatchCreateAnnotationsResponse_Entry)(nil), "google.genomics.v1.BatchCreateAnnotationsResponse.Entry") + proto.RegisterType((*GetAnnotationRequest)(nil), "google.genomics.v1.GetAnnotationRequest") + proto.RegisterType((*UpdateAnnotationRequest)(nil), "google.genomics.v1.UpdateAnnotationRequest") + proto.RegisterType((*DeleteAnnotationRequest)(nil), "google.genomics.v1.DeleteAnnotationRequest") + proto.RegisterType((*SearchAnnotationsRequest)(nil), "google.genomics.v1.SearchAnnotationsRequest") + proto.RegisterType((*SearchAnnotationsResponse)(nil), "google.genomics.v1.SearchAnnotationsResponse") + proto.RegisterEnum("google.genomics.v1.AnnotationType", AnnotationType_name, AnnotationType_value) + proto.RegisterEnum("google.genomics.v1.VariantAnnotation_Type", VariantAnnotation_Type_name, VariantAnnotation_Type_value) + proto.RegisterEnum("google.genomics.v1.VariantAnnotation_Effect", VariantAnnotation_Effect_name, VariantAnnotation_Effect_value) + proto.RegisterEnum("google.genomics.v1.VariantAnnotation_ClinicalSignificance", VariantAnnotation_ClinicalSignificance_name, VariantAnnotation_ClinicalSignificance_value) +} + +// 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 + +// Client API for AnnotationServiceV1 service + +type AnnotationServiceV1Client interface { + // Creates a new annotation set. Caller must have WRITE permission for the + // associated dataset. + // + // The following fields are required: + // + // * [datasetId][google.genomics.v1.AnnotationSet.dataset_id] + // * [referenceSetId][google.genomics.v1.AnnotationSet.reference_set_id] + // + // All other fields may be optionally specified, unless documented as being + // server-generated (for example, the `id` field). + CreateAnnotationSet(ctx context.Context, in *CreateAnnotationSetRequest, opts ...grpc.CallOption) (*AnnotationSet, error) + // Gets an annotation set. Caller must have READ permission for + // the associated dataset. + GetAnnotationSet(ctx context.Context, in *GetAnnotationSetRequest, opts ...grpc.CallOption) (*AnnotationSet, error) + // Updates an annotation set. The update must respect all mutability + // restrictions and other invariants described on the annotation set resource. + // Caller must have WRITE permission for the associated dataset. + UpdateAnnotationSet(ctx context.Context, in *UpdateAnnotationSetRequest, opts ...grpc.CallOption) (*AnnotationSet, error) + // Deletes an annotation set. Caller must have WRITE permission + // for the associated annotation set. + DeleteAnnotationSet(ctx context.Context, in *DeleteAnnotationSetRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) + // Searches for annotation sets that match the given criteria. Annotation sets + // are returned in an unspecified order. This order is consistent, such that + // two queries for the same content (regardless of page size) yield annotation + // sets in the same order across their respective streams of paginated + // responses. Caller must have READ permission for the queried datasets. + SearchAnnotationSets(ctx context.Context, in *SearchAnnotationSetsRequest, opts ...grpc.CallOption) (*SearchAnnotationSetsResponse, error) + // Creates a new annotation. Caller must have WRITE permission + // for the associated annotation set. + // + // The following fields are required: + // + // * [annotationSetId][google.genomics.v1.Annotation.annotation_set_id] + // * [referenceName][google.genomics.v1.Annotation.reference_name] or + // [referenceId][google.genomics.v1.Annotation.reference_id] + // + // ### Transcripts + // + // For annotations of type TRANSCRIPT, the following fields of + // [transcript][google.genomics.v1.Annotation.transcript] must be provided: + // + // * [exons.start][google.genomics.v1.Transcript.Exon.start] + // * [exons.end][google.genomics.v1.Transcript.Exon.end] + // + // All other fields may be optionally specified, unless documented as being + // server-generated (for example, the `id` field). The annotated + // range must be no longer than 100Mbp (mega base pairs). See the + // [Annotation resource][google.genomics.v1.Annotation] + // for additional restrictions on each field. + CreateAnnotation(ctx context.Context, in *CreateAnnotationRequest, opts ...grpc.CallOption) (*Annotation, error) + // Creates one or more new annotations atomically. All annotations must + // belong to the same annotation set. Caller must have WRITE + // permission for this annotation set. For optimal performance, batch + // positionally adjacent annotations together. + // + // If the request has a systemic issue, such as an attempt to write to + // an inaccessible annotation set, the entire RPC will fail accordingly. For + // lesser data issues, when possible an error will be isolated to the + // corresponding batch entry in the response; the remaining well formed + // annotations will be created normally. + // + // For details on the requirements for each individual annotation resource, + // see + // [CreateAnnotation][google.genomics.v1.AnnotationServiceV1.CreateAnnotation]. + BatchCreateAnnotations(ctx context.Context, in *BatchCreateAnnotationsRequest, opts ...grpc.CallOption) (*BatchCreateAnnotationsResponse, error) + // Gets an annotation. Caller must have READ permission + // for the associated annotation set. + GetAnnotation(ctx context.Context, in *GetAnnotationRequest, opts ...grpc.CallOption) (*Annotation, error) + // Updates an annotation. Caller must have + // WRITE permission for the associated dataset. + UpdateAnnotation(ctx context.Context, in *UpdateAnnotationRequest, opts ...grpc.CallOption) (*Annotation, error) + // Deletes an annotation. Caller must have WRITE permission for + // the associated annotation set. + DeleteAnnotation(ctx context.Context, in *DeleteAnnotationRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) + // Searches for annotations that match the given criteria. Results are + // ordered by genomic coordinate (by reference sequence, then position). + // Annotations with equivalent genomic coordinates are returned in an + // unspecified order. This order is consistent, such that two queries for the + // same content (regardless of page size) yield annotations in the same order + // across their respective streams of paginated responses. Caller must have + // READ permission for the queried annotation sets. + SearchAnnotations(ctx context.Context, in *SearchAnnotationsRequest, opts ...grpc.CallOption) (*SearchAnnotationsResponse, error) +} + +type annotationServiceV1Client struct { + cc *grpc.ClientConn +} + +func NewAnnotationServiceV1Client(cc *grpc.ClientConn) AnnotationServiceV1Client { + return &annotationServiceV1Client{cc} +} + +func (c *annotationServiceV1Client) CreateAnnotationSet(ctx context.Context, in *CreateAnnotationSetRequest, opts ...grpc.CallOption) (*AnnotationSet, error) { + out := new(AnnotationSet) + err := grpc.Invoke(ctx, "/google.genomics.v1.AnnotationServiceV1/CreateAnnotationSet", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *annotationServiceV1Client) GetAnnotationSet(ctx context.Context, in *GetAnnotationSetRequest, opts ...grpc.CallOption) (*AnnotationSet, error) { + out := new(AnnotationSet) + err := grpc.Invoke(ctx, "/google.genomics.v1.AnnotationServiceV1/GetAnnotationSet", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *annotationServiceV1Client) UpdateAnnotationSet(ctx context.Context, in *UpdateAnnotationSetRequest, opts ...grpc.CallOption) (*AnnotationSet, error) { + out := new(AnnotationSet) + err := grpc.Invoke(ctx, "/google.genomics.v1.AnnotationServiceV1/UpdateAnnotationSet", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *annotationServiceV1Client) DeleteAnnotationSet(ctx context.Context, in *DeleteAnnotationSetRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { + out := new(google_protobuf1.Empty) + err := grpc.Invoke(ctx, "/google.genomics.v1.AnnotationServiceV1/DeleteAnnotationSet", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *annotationServiceV1Client) SearchAnnotationSets(ctx context.Context, in *SearchAnnotationSetsRequest, opts ...grpc.CallOption) (*SearchAnnotationSetsResponse, error) { + out := new(SearchAnnotationSetsResponse) + err := grpc.Invoke(ctx, "/google.genomics.v1.AnnotationServiceV1/SearchAnnotationSets", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *annotationServiceV1Client) CreateAnnotation(ctx context.Context, in *CreateAnnotationRequest, opts ...grpc.CallOption) (*Annotation, error) { + out := new(Annotation) + err := grpc.Invoke(ctx, "/google.genomics.v1.AnnotationServiceV1/CreateAnnotation", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *annotationServiceV1Client) BatchCreateAnnotations(ctx context.Context, in *BatchCreateAnnotationsRequest, opts ...grpc.CallOption) (*BatchCreateAnnotationsResponse, error) { + out := new(BatchCreateAnnotationsResponse) + err := grpc.Invoke(ctx, "/google.genomics.v1.AnnotationServiceV1/BatchCreateAnnotations", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *annotationServiceV1Client) GetAnnotation(ctx context.Context, in *GetAnnotationRequest, opts ...grpc.CallOption) (*Annotation, error) { + out := new(Annotation) + err := grpc.Invoke(ctx, "/google.genomics.v1.AnnotationServiceV1/GetAnnotation", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *annotationServiceV1Client) UpdateAnnotation(ctx context.Context, in *UpdateAnnotationRequest, opts ...grpc.CallOption) (*Annotation, error) { + out := new(Annotation) + err := grpc.Invoke(ctx, "/google.genomics.v1.AnnotationServiceV1/UpdateAnnotation", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *annotationServiceV1Client) DeleteAnnotation(ctx context.Context, in *DeleteAnnotationRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { + out := new(google_protobuf1.Empty) + err := grpc.Invoke(ctx, "/google.genomics.v1.AnnotationServiceV1/DeleteAnnotation", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *annotationServiceV1Client) SearchAnnotations(ctx context.Context, in *SearchAnnotationsRequest, opts ...grpc.CallOption) (*SearchAnnotationsResponse, error) { + out := new(SearchAnnotationsResponse) + err := grpc.Invoke(ctx, "/google.genomics.v1.AnnotationServiceV1/SearchAnnotations", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for AnnotationServiceV1 service + +type AnnotationServiceV1Server interface { + // Creates a new annotation set. Caller must have WRITE permission for the + // associated dataset. + // + // The following fields are required: + // + // * [datasetId][google.genomics.v1.AnnotationSet.dataset_id] + // * [referenceSetId][google.genomics.v1.AnnotationSet.reference_set_id] + // + // All other fields may be optionally specified, unless documented as being + // server-generated (for example, the `id` field). + CreateAnnotationSet(context.Context, *CreateAnnotationSetRequest) (*AnnotationSet, error) + // Gets an annotation set. Caller must have READ permission for + // the associated dataset. + GetAnnotationSet(context.Context, *GetAnnotationSetRequest) (*AnnotationSet, error) + // Updates an annotation set. The update must respect all mutability + // restrictions and other invariants described on the annotation set resource. + // Caller must have WRITE permission for the associated dataset. + UpdateAnnotationSet(context.Context, *UpdateAnnotationSetRequest) (*AnnotationSet, error) + // Deletes an annotation set. Caller must have WRITE permission + // for the associated annotation set. + DeleteAnnotationSet(context.Context, *DeleteAnnotationSetRequest) (*google_protobuf1.Empty, error) + // Searches for annotation sets that match the given criteria. Annotation sets + // are returned in an unspecified order. This order is consistent, such that + // two queries for the same content (regardless of page size) yield annotation + // sets in the same order across their respective streams of paginated + // responses. Caller must have READ permission for the queried datasets. + SearchAnnotationSets(context.Context, *SearchAnnotationSetsRequest) (*SearchAnnotationSetsResponse, error) + // Creates a new annotation. Caller must have WRITE permission + // for the associated annotation set. + // + // The following fields are required: + // + // * [annotationSetId][google.genomics.v1.Annotation.annotation_set_id] + // * [referenceName][google.genomics.v1.Annotation.reference_name] or + // [referenceId][google.genomics.v1.Annotation.reference_id] + // + // ### Transcripts + // + // For annotations of type TRANSCRIPT, the following fields of + // [transcript][google.genomics.v1.Annotation.transcript] must be provided: + // + // * [exons.start][google.genomics.v1.Transcript.Exon.start] + // * [exons.end][google.genomics.v1.Transcript.Exon.end] + // + // All other fields may be optionally specified, unless documented as being + // server-generated (for example, the `id` field). The annotated + // range must be no longer than 100Mbp (mega base pairs). See the + // [Annotation resource][google.genomics.v1.Annotation] + // for additional restrictions on each field. + CreateAnnotation(context.Context, *CreateAnnotationRequest) (*Annotation, error) + // Creates one or more new annotations atomically. All annotations must + // belong to the same annotation set. Caller must have WRITE + // permission for this annotation set. For optimal performance, batch + // positionally adjacent annotations together. + // + // If the request has a systemic issue, such as an attempt to write to + // an inaccessible annotation set, the entire RPC will fail accordingly. For + // lesser data issues, when possible an error will be isolated to the + // corresponding batch entry in the response; the remaining well formed + // annotations will be created normally. + // + // For details on the requirements for each individual annotation resource, + // see + // [CreateAnnotation][google.genomics.v1.AnnotationServiceV1.CreateAnnotation]. + BatchCreateAnnotations(context.Context, *BatchCreateAnnotationsRequest) (*BatchCreateAnnotationsResponse, error) + // Gets an annotation. Caller must have READ permission + // for the associated annotation set. + GetAnnotation(context.Context, *GetAnnotationRequest) (*Annotation, error) + // Updates an annotation. Caller must have + // WRITE permission for the associated dataset. + UpdateAnnotation(context.Context, *UpdateAnnotationRequest) (*Annotation, error) + // Deletes an annotation. Caller must have WRITE permission for + // the associated annotation set. + DeleteAnnotation(context.Context, *DeleteAnnotationRequest) (*google_protobuf1.Empty, error) + // Searches for annotations that match the given criteria. Results are + // ordered by genomic coordinate (by reference sequence, then position). + // Annotations with equivalent genomic coordinates are returned in an + // unspecified order. This order is consistent, such that two queries for the + // same content (regardless of page size) yield annotations in the same order + // across their respective streams of paginated responses. Caller must have + // READ permission for the queried annotation sets. + SearchAnnotations(context.Context, *SearchAnnotationsRequest) (*SearchAnnotationsResponse, error) +} + +func RegisterAnnotationServiceV1Server(s *grpc.Server, srv AnnotationServiceV1Server) { + s.RegisterService(&_AnnotationServiceV1_serviceDesc, srv) +} + +func _AnnotationServiceV1_CreateAnnotationSet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateAnnotationSetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AnnotationServiceV1Server).CreateAnnotationSet(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.AnnotationServiceV1/CreateAnnotationSet", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AnnotationServiceV1Server).CreateAnnotationSet(ctx, req.(*CreateAnnotationSetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AnnotationServiceV1_GetAnnotationSet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetAnnotationSetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AnnotationServiceV1Server).GetAnnotationSet(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.AnnotationServiceV1/GetAnnotationSet", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AnnotationServiceV1Server).GetAnnotationSet(ctx, req.(*GetAnnotationSetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AnnotationServiceV1_UpdateAnnotationSet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateAnnotationSetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AnnotationServiceV1Server).UpdateAnnotationSet(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.AnnotationServiceV1/UpdateAnnotationSet", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AnnotationServiceV1Server).UpdateAnnotationSet(ctx, req.(*UpdateAnnotationSetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AnnotationServiceV1_DeleteAnnotationSet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteAnnotationSetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AnnotationServiceV1Server).DeleteAnnotationSet(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.AnnotationServiceV1/DeleteAnnotationSet", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AnnotationServiceV1Server).DeleteAnnotationSet(ctx, req.(*DeleteAnnotationSetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AnnotationServiceV1_SearchAnnotationSets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SearchAnnotationSetsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AnnotationServiceV1Server).SearchAnnotationSets(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.AnnotationServiceV1/SearchAnnotationSets", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AnnotationServiceV1Server).SearchAnnotationSets(ctx, req.(*SearchAnnotationSetsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AnnotationServiceV1_CreateAnnotation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateAnnotationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AnnotationServiceV1Server).CreateAnnotation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.AnnotationServiceV1/CreateAnnotation", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AnnotationServiceV1Server).CreateAnnotation(ctx, req.(*CreateAnnotationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AnnotationServiceV1_BatchCreateAnnotations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BatchCreateAnnotationsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AnnotationServiceV1Server).BatchCreateAnnotations(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.AnnotationServiceV1/BatchCreateAnnotations", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AnnotationServiceV1Server).BatchCreateAnnotations(ctx, req.(*BatchCreateAnnotationsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AnnotationServiceV1_GetAnnotation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetAnnotationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AnnotationServiceV1Server).GetAnnotation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.AnnotationServiceV1/GetAnnotation", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AnnotationServiceV1Server).GetAnnotation(ctx, req.(*GetAnnotationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AnnotationServiceV1_UpdateAnnotation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateAnnotationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AnnotationServiceV1Server).UpdateAnnotation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.AnnotationServiceV1/UpdateAnnotation", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AnnotationServiceV1Server).UpdateAnnotation(ctx, req.(*UpdateAnnotationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AnnotationServiceV1_DeleteAnnotation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteAnnotationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AnnotationServiceV1Server).DeleteAnnotation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.AnnotationServiceV1/DeleteAnnotation", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AnnotationServiceV1Server).DeleteAnnotation(ctx, req.(*DeleteAnnotationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AnnotationServiceV1_SearchAnnotations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SearchAnnotationsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AnnotationServiceV1Server).SearchAnnotations(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.AnnotationServiceV1/SearchAnnotations", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AnnotationServiceV1Server).SearchAnnotations(ctx, req.(*SearchAnnotationsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _AnnotationServiceV1_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.genomics.v1.AnnotationServiceV1", + HandlerType: (*AnnotationServiceV1Server)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateAnnotationSet", + Handler: _AnnotationServiceV1_CreateAnnotationSet_Handler, + }, + { + MethodName: "GetAnnotationSet", + Handler: _AnnotationServiceV1_GetAnnotationSet_Handler, + }, + { + MethodName: "UpdateAnnotationSet", + Handler: _AnnotationServiceV1_UpdateAnnotationSet_Handler, + }, + { + MethodName: "DeleteAnnotationSet", + Handler: _AnnotationServiceV1_DeleteAnnotationSet_Handler, + }, + { + MethodName: "SearchAnnotationSets", + Handler: _AnnotationServiceV1_SearchAnnotationSets_Handler, + }, + { + MethodName: "CreateAnnotation", + Handler: _AnnotationServiceV1_CreateAnnotation_Handler, + }, + { + MethodName: "BatchCreateAnnotations", + Handler: _AnnotationServiceV1_BatchCreateAnnotations_Handler, + }, + { + MethodName: "GetAnnotation", + Handler: _AnnotationServiceV1_GetAnnotation_Handler, + }, + { + MethodName: "UpdateAnnotation", + Handler: _AnnotationServiceV1_UpdateAnnotation_Handler, + }, + { + MethodName: "DeleteAnnotation", + Handler: _AnnotationServiceV1_DeleteAnnotation_Handler, + }, + { + MethodName: "SearchAnnotations", + Handler: _AnnotationServiceV1_SearchAnnotations_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/genomics/v1/annotations.proto", +} + +func init() { proto.RegisterFile("google/genomics/v1/annotations.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 2188 bytes of a gzipped FileDescri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x66, 0x50, 0x15, 0x96, 0xf9, 0xd8, + 0x68, 0x13, 0x45, 0x53, 0xc8, 0x01, 0x56, 0xf7, 0x0c, 0xac, 0xee, 0x28, 0x4d, 0x31, 0x8b, 0x10, + 0x94, 0xb5, 0x43, 0xb5, 0xa5, 0x1e, 0xbe, 0x6e, 0x75, 0x34, 0x83, 0xa1, 0xc9, 0xa1, 0x0f, 0x60, + 0x51, 0x6d, 0xa9, 0x09, 0x71, 0x9e, 0x6d, 0x4e, 0xd3, 0x5b, 0x6d, 0x63, 0xaf, 0x81, 0x55, 0xb1, + 0x30, 0x18, 0x36, 0x5b, 0x9a, 0x26, 0x16, 0xd9, 0x22, 0x5a, 0xbb, 0x89, 0x65, 0xc5, 0xd0, 0xb0, + 0xae, 0x18, 0x3b, 0x58, 0x23, 0x9d, 0x36, 0xdf, 0xe7, 0x8c, 0xf4, 0xe7, 0x0c, 0x2c, 0xa5, 0x5d, + 0x0d, 0xf4, 0x10, 0xee, 0xc9, 0x4d, 0xac, 0x62, 0xb9, 0xd1, 0x34, 0x34, 0xbc, 0xa7, 0xe2, 0x5d, + 0x2c, 0x37, 0x54, 0x39, 0x49, 0xf3, 0x5d, 0x58, 0x4d, 0x57, 0x8b, 0xf1, 0xde, 0x51, 0x65, 0x85, + 0xe8, 0x0c, 0x5a, 0x06, 0x01, 0x14, 0xb6, 0x15, 0x15, 0xef, 0x31, 0xd6, 0x17, 0x61, 0xbe, 0x89, + 0x3f, 0x51, 0x9a, 0x87, 0x46, 0x28, 0xe2, 0xfb, 0x0b, 0x45, 0xed, 0x86, 0xbe, 0xdf, 0xda, 0x53, + 0x54, 0x2c, 0x07, 0x87, 0x10, 0x1b, 0x17, 0x98, 0xe5, 0x0e, 0xe9, 0xec, 0x19, 0x44, 0xd1, 0xda, + 0x2d, 0x55, 0x53, 0xc4, 0x22, 0x3b, 0x83, 0x7d, 0xac, 0xe9, 0x2d, 0xb9, 0xf5, 0xba, 0xdd, 0xd0, + 0xf1, 0x36, 0x6e, 0x62, 0xfd, 0x50, 0x9c, 0x41, 0x2b, 0x70, 0x53, 0x6e, 0xa9, 0xbb, 0x0a, 0xd1, + 0x0c, 0x4d, 0x51, 0x35, 0xac, 0xe3, 0x03, 0x36, 0x31, 0x8b, 0x16, 0xa0, 0x44, 0xb0, 0xf6, 0x89, + 0xb1, 0xdb, 0x90, 0xf5, 0x16, 0x11, 0x81, 0x09, 0x1a, 0x9a, 0xd6, 0x92, 0x71, 0x83, 0x73, 0x53, + 0xe2, 0xab, 0x92, 0x96, 0xae, 0xc8, 0x3a, 0x3e, 0x50, 0xc4, 0x39, 0x06, 0xee, 0x75, 0xa7, 0xa9, + 0xe3, 0x76, 0x53, 0x31, 0x88, 0xd2, 0x6e, 0x11, 0x5d, 0xd9, 0x11, 0xe7, 0xa5, 0x7f, 0x64, 0x00, + 0x86, 0x69, 0x3b, 0x9e, 0x47, 0x84, 0x91, 0x3c, 0xf2, 0x43, 0xc8, 0xd3, 0x77, 0x2c, 0x37, 0x04, + 0x31, 0x72, 0xff, 0xf2, 0xf4, 0x5f, 0x53, 0xde, 0xf5, 0x1c, 0x12, 0x58, 0xa0, 0x03, 0x58, 0xb0, + 0x7a, 0x5d, 0xdb, 0x39, 0x36, 0x3c, 0xfa, 0x8b, 0x33, 0x56, 0x1f, 0x79, 0x9c, 0x94, 0xea, 0x4f, + 0xaf, 0x70, 0x22, 0x73, 0x2b, 0x2d, 0x34, 0x22, 0x65, 0x6b, 0x64, 0x5c, 0x35, 0x21, 0xc7, 0x96, + 0x19, 0x16, 0x5a, 0x21, 0xa5, 0xd0, 0x66, 0x86, 0x85, 0xf6, 0x19, 0xe4, 0x8f, 0xdc, 0xa8, 0xde, + 0x97, 0xea, 0xab, 0x63, 0x75, 0x02, 0x3b, 0xfe, 0xf3, 0x7a, 0x58, 0x28, 0xb8, 0x66, 0xf5, 0x05, + 0x94, 0x47, 0x41, 0x4c, 0xbb, 0x98, 0xf4, 0x63, 0x80, 0x61, 0xca, 0x40, 0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00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/genomics/v1/cigar.pb.go b/vendor/google.golang.org/genproto/googleapis/genomics/v1/cigar.pb.go new file mode 100644 index 0000000000..a45daa0b5e --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/genomics/v1/cigar.pb.go @@ -0,0 +1,168 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/genomics/v1/cigar.proto + +package genomics + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Describes the different types of CIGAR alignment operations that exist. +// Used wherever CIGAR alignments are used. +type CigarUnit_Operation int32 + +const ( + CigarUnit_OPERATION_UNSPECIFIED CigarUnit_Operation = 0 + // An alignment match indicates that a sequence can be aligned to the + // reference without evidence of an INDEL. Unlike the + // `SEQUENCE_MATCH` and `SEQUENCE_MISMATCH` operators, + // the `ALIGNMENT_MATCH` operator does not indicate whether the + // reference and read sequences are an exact match. This operator is + // equivalent to SAM's `M`. + CigarUnit_ALIGNMENT_MATCH CigarUnit_Operation = 1 + // The insert operator indicates that the read contains evidence of bases + // being inserted into the reference. This operator is equivalent to SAM's + // `I`. + CigarUnit_INSERT CigarUnit_Operation = 2 + // The delete operator indicates that the read contains evidence of bases + // being deleted from the reference. This operator is equivalent to SAM's + // `D`. + CigarUnit_DELETE CigarUnit_Operation = 3 + // The skip operator indicates that this read skips a long segment of the + // reference, but the bases have not been deleted. This operator is commonly + // used when working with RNA-seq data, where reads may skip long segments + // of the reference between exons. This operator is equivalent to SAM's + // `N`. + CigarUnit_SKIP CigarUnit_Operation = 4 + // The soft clip operator indicates that bases at the start/end of a read + // have not been considered during alignment. This may occur if the majority + // of a read maps, except for low quality bases at the start/end of a read. + // This operator is equivalent to SAM's `S`. Bases that are soft + // clipped will still be stored in the read. + CigarUnit_CLIP_SOFT CigarUnit_Operation = 5 + // The hard clip operator indicates that bases at the start/end of a read + // have been omitted from this alignment. This may occur if this linear + // alignment is part of a chimeric alignment, or if the read has been + // trimmed (for example, during error correction or to trim poly-A tails for + // RNA-seq). This operator is equivalent to SAM's `H`. + CigarUnit_CLIP_HARD CigarUnit_Operation = 6 + // The pad operator indicates that there is padding in an alignment. This + // operator is equivalent to SAM's `P`. + CigarUnit_PAD CigarUnit_Operation = 7 + // This operator indicates that this portion of the aligned sequence exactly + // matches the reference. This operator is equivalent to SAM's `=`. + CigarUnit_SEQUENCE_MATCH CigarUnit_Operation = 8 + // This operator indicates that this portion of the aligned sequence is an + // alignment match to the reference, but a sequence mismatch. This can + // indicate a SNP or a read error. This operator is equivalent to SAM's + // `X`. + CigarUnit_SEQUENCE_MISMATCH CigarUnit_Operation = 9 +) + +var CigarUnit_Operation_name = map[int32]string{ + 0: "OPERATION_UNSPECIFIED", + 1: "ALIGNMENT_MATCH", + 2: "INSERT", + 3: "DELETE", + 4: "SKIP", + 5: "CLIP_SOFT", + 6: "CLIP_HARD", + 7: "PAD", + 8: "SEQUENCE_MATCH", + 9: "SEQUENCE_MISMATCH", +} +var CigarUnit_Operation_value = map[string]int32{ + "OPERATION_UNSPECIFIED": 0, + "ALIGNMENT_MATCH": 1, + "INSERT": 2, + "DELETE": 3, + "SKIP": 4, + "CLIP_SOFT": 5, + "CLIP_HARD": 6, + "PAD": 7, + "SEQUENCE_MATCH": 8, + "SEQUENCE_MISMATCH": 9, +} + +func (x CigarUnit_Operation) String() string { + return proto.EnumName(CigarUnit_Operation_name, int32(x)) +} +func (CigarUnit_Operation) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{0, 0} } + +// A single CIGAR operation. +type CigarUnit struct { + Operation CigarUnit_Operation `protobuf:"varint,1,opt,name=operation,enum=google.genomics.v1.CigarUnit_Operation" json:"operation,omitempty"` + // The number of genomic bases that the operation runs for. Required. + OperationLength int64 `protobuf:"varint,2,opt,name=operation_length,json=operationLength" json:"operation_length,omitempty"` + // `referenceSequence` is only used at mismatches + // (`SEQUENCE_MISMATCH`) and deletions (`DELETE`). + // Filling this field replaces SAM's MD tag. If the relevant information is + // not available, this field is unset. + ReferenceSequence string `protobuf:"bytes,3,opt,name=reference_sequence,json=referenceSequence" json:"reference_sequence,omitempty"` +} + +func (m *CigarUnit) Reset() { *m = CigarUnit{} } +func (m *CigarUnit) String() string { return proto.CompactTextString(m) } +func (*CigarUnit) ProtoMessage() {} +func (*CigarUnit) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +func (m *CigarUnit) GetOperation() CigarUnit_Operation { + if m != nil { + return m.Operation + } + return CigarUnit_OPERATION_UNSPECIFIED +} + +func (m *CigarUnit) GetOperationLength() int64 { + if m != nil { + return m.OperationLength + } + return 0 +} + +func (m *CigarUnit) GetReferenceSequence() string { + if m != nil { + return m.ReferenceSequence + } + return "" +} + +func init() { + proto.RegisterType((*CigarUnit)(nil), "google.genomics.v1.CigarUnit") + proto.RegisterEnum("google.genomics.v1.CigarUnit_Operation", CigarUnit_Operation_name, CigarUnit_Operation_value) +} + +func init() { proto.RegisterFile("google/genomics/v1/cigar.proto", fileDescriptor1) } + +var fileDescriptor1 = []byte{ + // 367 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x51, 0xcf, 0x0e, 0x93, 0x30, + 0x1c, 0xb6, 0x63, 0x6e, 0xe3, 0x97, 0xb8, 0x75, 0x35, 0x33, 0xd3, 0x18, 0xb3, 0xec, 0xe2, 0x3c, + 0x08, 0x99, 0xde, 0xf4, 0xc4, 0xa0, 0x73, 0x8d, 0x0c, 0x10, 0xd8, 0xc5, 0x0b, 0x41, 0x52, 0x91, + 0x64, 0x6b, 0x11, 0x70, 0xaf, 0xe5, 0x1b, 0xf9, 0x1c, 0x1e, 0x0d, 0x30, 0x98, 0x89, 0xde, 0xbe, + 0x7e, 0xff, 0x9a, 0xfc, 0x3e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, 0x90, 0x62, 0x85, 0x4c, 0x60, + 0x18, 0x7c, 0x64, 0x1e, 0x1e, 0x92, 0x47, 0xa0, 0x9a, 0x36, 0xf3, 0xa2, 0xc0, 0xdd, 0x87, 0xf8, + 0x61, 0xff, 0x3c, 0x18, 0xbe, 0x85, 0x47, 0x64, 0x0c, 0x8a, 0x67, 0x58, 0x78, 0x4c, 0x08, 0x4c, + 0x03, 0xfa, 0xe9, 0x44, 0x1d, 0x93, 0xde, 0xca, 0x27, 0x64, 0x01, 0xf3, 0x3b, 0xc7, 0x82, 0x96, + 0x56, 0x77, 0x1c, 0x9e, 0x24, 0xf2, 0xf2, 0x9f, 0x23, 0xee, 0xa0, 0xb9, 0xa2, 0x57, 0xcf, 0xe0, + 0xa1, 0xcf, 0xef, 0x3a, 0x87, 0x3c, 0xc7, 0x22, 0xd5, 0x64, 0x91, 0xd6, 0x2b, 0x37, 0x23, 0xe9, + 0xad, 0x14, 0xe7, 0x59, 0xf9, 0xf7, 0xf2, 0xef, 0x3b, 0xfc, 0x1b, 0xa1, 0x2f, 0xa3, 0xc6, 0xf9, + 0xf6, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x98, 0xcc, 0xce, 0xde, 0x22, 0x02, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/genomics/v1/datasets.pb.go b/vendor/google.golang.org/genproto/googleapis/genomics/v1/datasets.pb.go new file mode 100644 index 0000000000..a871906f46 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/genomics/v1/datasets.pb.go @@ -0,0 +1,777 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/genomics/v1/datasets.proto + +package genomics + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_iam_v11 "google.golang.org/genproto/googleapis/iam/v1" +import google_iam_v1 "google.golang.org/genproto/googleapis/iam/v1" +import google_protobuf1 "github.com/golang/protobuf/ptypes/empty" +import google_protobuf2 "google.golang.org/genproto/protobuf/field_mask" +import google_protobuf6 "github.com/golang/protobuf/ptypes/timestamp" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// A Dataset is a collection of genomic data. +// +// For more genomics resource definitions, see [Fundamentals of Google +// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +type Dataset struct { + // The server-generated dataset ID, unique across all datasets. + Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + // The Google Cloud project ID that this dataset belongs to. + ProjectId string `protobuf:"bytes,2,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The dataset name. + Name string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"` + // The time this dataset was created, in seconds from the epoch. + CreateTime *google_protobuf6.Timestamp `protobuf:"bytes,4,opt,name=create_time,json=createTime" json:"create_time,omitempty"` +} + +func (m *Dataset) Reset() { *m = Dataset{} } +func (m *Dataset) String() string { return proto.CompactTextString(m) } +func (*Dataset) ProtoMessage() {} +func (*Dataset) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} } + +func (m *Dataset) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *Dataset) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *Dataset) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Dataset) GetCreateTime() *google_protobuf6.Timestamp { + if m != nil { + return m.CreateTime + } + return nil +} + +// The dataset list request. +type ListDatasetsRequest struct { + // Required. The Google Cloud project ID to list datasets for. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The maximum number of results to return in a single page. If unspecified, + // defaults to 50. The maximum value is 1024. + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // The continuation token, which is used to page through large result sets. + // To get the next page of results, set this parameter to the value of + // `nextPageToken` from the previous response. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListDatasetsRequest) Reset() { *m = ListDatasetsRequest{} } +func (m *ListDatasetsRequest) String() string { return proto.CompactTextString(m) } +func (*ListDatasetsRequest) ProtoMessage() {} +func (*ListDatasetsRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{1} } + +func (m *ListDatasetsRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *ListDatasetsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListDatasetsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// The dataset list response. +type ListDatasetsResponse struct { + // The list of matching Datasets. + Datasets []*Dataset `protobuf:"bytes,1,rep,name=datasets" json:"datasets,omitempty"` + // The continuation token, which is used to page through large result sets. + // Provide this value in a subsequent request to return the next page of + // results. This field will be empty if there aren't any additional results. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListDatasetsResponse) Reset() { *m = ListDatasetsResponse{} } +func (m *ListDatasetsResponse) String() string { return proto.CompactTextString(m) } +func (*ListDatasetsResponse) ProtoMessage() {} +func (*ListDatasetsResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{2} } + +func (m *ListDatasetsResponse) GetDatasets() []*Dataset { + if m != nil { + return m.Datasets + } + return nil +} + +func (m *ListDatasetsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +type CreateDatasetRequest struct { + // The dataset to be created. Must contain projectId and name. + Dataset *Dataset `protobuf:"bytes,1,opt,name=dataset" json:"dataset,omitempty"` +} + +func (m *CreateDatasetRequest) Reset() { *m = CreateDatasetRequest{} } +func (m *CreateDatasetRequest) String() string { return proto.CompactTextString(m) } +func (*CreateDatasetRequest) ProtoMessage() {} +func (*CreateDatasetRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{3} } + +func (m *CreateDatasetRequest) GetDataset() *Dataset { + if m != nil { + return m.Dataset + } + return nil +} + +type UpdateDatasetRequest struct { + // The ID of the dataset to be updated. + DatasetId string `protobuf:"bytes,1,opt,name=dataset_id,json=datasetId" json:"dataset_id,omitempty"` + // The new dataset data. + Dataset *Dataset `protobuf:"bytes,2,opt,name=dataset" json:"dataset,omitempty"` + // An optional mask specifying which fields to update. At this time, the only + // mutable field is [name][google.genomics.v1.Dataset.name]. The only + // acceptable value is "name". If unspecified, all mutable fields will be + // updated. + UpdateMask *google_protobuf2.FieldMask `protobuf:"bytes,3,opt,name=update_mask,json=updateMask" json:"update_mask,omitempty"` +} + +func (m *UpdateDatasetRequest) Reset() { *m = UpdateDatasetRequest{} } +func (m *UpdateDatasetRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateDatasetRequest) ProtoMessage() {} +func (*UpdateDatasetRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{4} } + +func (m *UpdateDatasetRequest) GetDatasetId() string { + if m != nil { + return m.DatasetId + } + return "" +} + +func (m *UpdateDatasetRequest) GetDataset() *Dataset { + if m != nil { + return m.Dataset + } + return nil +} + +func (m *UpdateDatasetRequest) GetUpdateMask() *google_protobuf2.FieldMask { + if m != nil { + return m.UpdateMask + } + return nil +} + +type DeleteDatasetRequest struct { + // The ID of the dataset to be deleted. + DatasetId string `protobuf:"bytes,1,opt,name=dataset_id,json=datasetId" json:"dataset_id,omitempty"` +} + +func (m *DeleteDatasetRequest) Reset() { *m = DeleteDatasetRequest{} } +func (m *DeleteDatasetRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteDatasetRequest) ProtoMessage() {} +func (*DeleteDatasetRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{5} } + +func (m *DeleteDatasetRequest) GetDatasetId() string { + if m != nil { + return m.DatasetId + } + return "" +} + +type UndeleteDatasetRequest struct { + // The ID of the dataset to be undeleted. + DatasetId string `protobuf:"bytes,1,opt,name=dataset_id,json=datasetId" json:"dataset_id,omitempty"` +} + +func (m *UndeleteDatasetRequest) Reset() { *m = UndeleteDatasetRequest{} } +func (m *UndeleteDatasetRequest) String() string { return proto.CompactTextString(m) } +func (*UndeleteDatasetRequest) ProtoMessage() {} +func (*UndeleteDatasetRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{6} } + +func (m *UndeleteDatasetRequest) GetDatasetId() string { + if m != nil { + return m.DatasetId + } + return "" +} + +type GetDatasetRequest struct { + // The ID of the dataset. + DatasetId string `protobuf:"bytes,1,opt,name=dataset_id,json=datasetId" json:"dataset_id,omitempty"` +} + +func (m *GetDatasetRequest) Reset() { *m = GetDatasetRequest{} } +func (m *GetDatasetRequest) String() string { return proto.CompactTextString(m) } +func (*GetDatasetRequest) ProtoMessage() {} +func (*GetDatasetRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{7} } + +func (m *GetDatasetRequest) GetDatasetId() string { + if m != nil { + return m.DatasetId + } + return "" +} + +func init() { + proto.RegisterType((*Dataset)(nil), "google.genomics.v1.Dataset") + proto.RegisterType((*ListDatasetsRequest)(nil), "google.genomics.v1.ListDatasetsRequest") + proto.RegisterType((*ListDatasetsResponse)(nil), "google.genomics.v1.ListDatasetsResponse") + proto.RegisterType((*CreateDatasetRequest)(nil), "google.genomics.v1.CreateDatasetRequest") + proto.RegisterType((*UpdateDatasetRequest)(nil), "google.genomics.v1.UpdateDatasetRequest") + proto.RegisterType((*DeleteDatasetRequest)(nil), "google.genomics.v1.DeleteDatasetRequest") + proto.RegisterType((*UndeleteDatasetRequest)(nil), "google.genomics.v1.UndeleteDatasetRequest") + proto.RegisterType((*GetDatasetRequest)(nil), "google.genomics.v1.GetDatasetRequest") +} + +// 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 + +// Client API for DatasetServiceV1 service + +type DatasetServiceV1Client interface { + // Lists datasets within a project. + // + // For the definitions of datasets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + ListDatasets(ctx context.Context, in *ListDatasetsRequest, opts ...grpc.CallOption) (*ListDatasetsResponse, error) + // Creates a new dataset. + // + // For the definitions of datasets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + CreateDataset(ctx context.Context, in *CreateDatasetRequest, opts ...grpc.CallOption) (*Dataset, error) + // Gets a dataset by ID. + // + // For the definitions of datasets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + GetDataset(ctx context.Context, in *GetDatasetRequest, opts ...grpc.CallOption) (*Dataset, error) + // Updates a dataset. + // + // For the definitions of datasets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // This method supports patch semantics. + UpdateDataset(ctx context.Context, in *UpdateDatasetRequest, opts ...grpc.CallOption) (*Dataset, error) + // Deletes a dataset and all of its contents (all read group sets, + // reference sets, variant sets, call sets, annotation sets, etc.) + // This is reversible (up to one week after the deletion) via + // the + // [datasets.undelete][google.genomics.v1.DatasetServiceV1.UndeleteDataset] + // operation. + // + // For the definitions of datasets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + DeleteDataset(ctx context.Context, in *DeleteDatasetRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) + // Undeletes a dataset by restoring a dataset which was deleted via this API. + // + // For the definitions of datasets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // This operation is only possible for a week after the deletion occurred. + UndeleteDataset(ctx context.Context, in *UndeleteDatasetRequest, opts ...grpc.CallOption) (*Dataset, error) + // Sets the access control policy on the specified dataset. Replaces any + // existing policy. + // + // For the definitions of datasets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // See Setting a + // Policy for more information. + SetIamPolicy(ctx context.Context, in *google_iam_v11.SetIamPolicyRequest, opts ...grpc.CallOption) (*google_iam_v1.Policy, error) + // Gets the access control policy for the dataset. This is empty if the + // policy or resource does not exist. + // + // See Getting a + // Policy for more information. + // + // For the definitions of datasets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + GetIamPolicy(ctx context.Context, in *google_iam_v11.GetIamPolicyRequest, opts ...grpc.CallOption) (*google_iam_v1.Policy, error) + // Returns permissions that a caller has on the specified resource. + // See Testing + // Permissions for more information. + // + // For the definitions of datasets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + TestIamPermissions(ctx context.Context, in *google_iam_v11.TestIamPermissionsRequest, opts ...grpc.CallOption) (*google_iam_v11.TestIamPermissionsResponse, error) +} + +type datasetServiceV1Client struct { + cc *grpc.ClientConn +} + +func NewDatasetServiceV1Client(cc *grpc.ClientConn) DatasetServiceV1Client { + return &datasetServiceV1Client{cc} +} + +func (c *datasetServiceV1Client) ListDatasets(ctx context.Context, in *ListDatasetsRequest, opts ...grpc.CallOption) (*ListDatasetsResponse, error) { + out := new(ListDatasetsResponse) + err := grpc.Invoke(ctx, "/google.genomics.v1.DatasetServiceV1/ListDatasets", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *datasetServiceV1Client) CreateDataset(ctx context.Context, in *CreateDatasetRequest, opts ...grpc.CallOption) (*Dataset, error) { + out := new(Dataset) + err := grpc.Invoke(ctx, "/google.genomics.v1.DatasetServiceV1/CreateDataset", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *datasetServiceV1Client) GetDataset(ctx context.Context, in *GetDatasetRequest, opts ...grpc.CallOption) (*Dataset, error) { + out := new(Dataset) + err := grpc.Invoke(ctx, "/google.genomics.v1.DatasetServiceV1/GetDataset", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *datasetServiceV1Client) UpdateDataset(ctx context.Context, in *UpdateDatasetRequest, opts ...grpc.CallOption) (*Dataset, error) { + out := new(Dataset) + err := grpc.Invoke(ctx, "/google.genomics.v1.DatasetServiceV1/UpdateDataset", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *datasetServiceV1Client) DeleteDataset(ctx context.Context, in *DeleteDatasetRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { + out := new(google_protobuf1.Empty) + err := grpc.Invoke(ctx, "/google.genomics.v1.DatasetServiceV1/DeleteDataset", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *datasetServiceV1Client) UndeleteDataset(ctx context.Context, in *UndeleteDatasetRequest, opts ...grpc.CallOption) (*Dataset, error) { + out := new(Dataset) + err := grpc.Invoke(ctx, "/google.genomics.v1.DatasetServiceV1/UndeleteDataset", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *datasetServiceV1Client) SetIamPolicy(ctx context.Context, in *google_iam_v11.SetIamPolicyRequest, opts ...grpc.CallOption) (*google_iam_v1.Policy, error) { + out := new(google_iam_v1.Policy) + err := grpc.Invoke(ctx, "/google.genomics.v1.DatasetServiceV1/SetIamPolicy", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *datasetServiceV1Client) GetIamPolicy(ctx context.Context, in *google_iam_v11.GetIamPolicyRequest, opts ...grpc.CallOption) (*google_iam_v1.Policy, error) { + out := new(google_iam_v1.Policy) + err := grpc.Invoke(ctx, "/google.genomics.v1.DatasetServiceV1/GetIamPolicy", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *datasetServiceV1Client) TestIamPermissions(ctx context.Context, in *google_iam_v11.TestIamPermissionsRequest, opts ...grpc.CallOption) (*google_iam_v11.TestIamPermissionsResponse, error) { + out := new(google_iam_v11.TestIamPermissionsResponse) + err := grpc.Invoke(ctx, "/google.genomics.v1.DatasetServiceV1/TestIamPermissions", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for DatasetServiceV1 service + +type DatasetServiceV1Server interface { + // Lists datasets within a project. + // + // For the definitions of datasets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + ListDatasets(context.Context, *ListDatasetsRequest) (*ListDatasetsResponse, error) + // Creates a new dataset. + // + // For the definitions of datasets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + CreateDataset(context.Context, *CreateDatasetRequest) (*Dataset, error) + // Gets a dataset by ID. + // + // For the definitions of datasets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + GetDataset(context.Context, *GetDatasetRequest) (*Dataset, error) + // Updates a dataset. + // + // For the definitions of datasets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // This method supports patch semantics. + UpdateDataset(context.Context, *UpdateDatasetRequest) (*Dataset, error) + // Deletes a dataset and all of its contents (all read group sets, + // reference sets, variant sets, call sets, annotation sets, etc.) + // This is reversible (up to one week after the deletion) via + // the + // [datasets.undelete][google.genomics.v1.DatasetServiceV1.UndeleteDataset] + // operation. + // + // For the definitions of datasets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + DeleteDataset(context.Context, *DeleteDatasetRequest) (*google_protobuf1.Empty, error) + // Undeletes a dataset by restoring a dataset which was deleted via this API. + // + // For the definitions of datasets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // This operation is only possible for a week after the deletion occurred. + UndeleteDataset(context.Context, *UndeleteDatasetRequest) (*Dataset, error) + // Sets the access control policy on the specified dataset. Replaces any + // existing policy. + // + // For the definitions of datasets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // See Setting a + // Policy for more information. + SetIamPolicy(context.Context, *google_iam_v11.SetIamPolicyRequest) (*google_iam_v1.Policy, error) + // Gets the access control policy for the dataset. This is empty if the + // policy or resource does not exist. + // + // See Getting a + // Policy for more information. + // + // For the definitions of datasets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + GetIamPolicy(context.Context, *google_iam_v11.GetIamPolicyRequest) (*google_iam_v1.Policy, error) + // Returns permissions that a caller has on the specified resource. + // See Testing + // Permissions for more information. + // + // For the definitions of datasets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + TestIamPermissions(context.Context, *google_iam_v11.TestIamPermissionsRequest) (*google_iam_v11.TestIamPermissionsResponse, error) +} + +func RegisterDatasetServiceV1Server(s *grpc.Server, srv DatasetServiceV1Server) { + s.RegisterService(&_DatasetServiceV1_serviceDesc, srv) +} + +func _DatasetServiceV1_ListDatasets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListDatasetsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DatasetServiceV1Server).ListDatasets(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.DatasetServiceV1/ListDatasets", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DatasetServiceV1Server).ListDatasets(ctx, req.(*ListDatasetsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DatasetServiceV1_CreateDataset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateDatasetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DatasetServiceV1Server).CreateDataset(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.DatasetServiceV1/CreateDataset", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DatasetServiceV1Server).CreateDataset(ctx, req.(*CreateDatasetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DatasetServiceV1_GetDataset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetDatasetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DatasetServiceV1Server).GetDataset(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.DatasetServiceV1/GetDataset", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DatasetServiceV1Server).GetDataset(ctx, req.(*GetDatasetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DatasetServiceV1_UpdateDataset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateDatasetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DatasetServiceV1Server).UpdateDataset(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.DatasetServiceV1/UpdateDataset", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DatasetServiceV1Server).UpdateDataset(ctx, req.(*UpdateDatasetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DatasetServiceV1_DeleteDataset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteDatasetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DatasetServiceV1Server).DeleteDataset(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.DatasetServiceV1/DeleteDataset", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DatasetServiceV1Server).DeleteDataset(ctx, req.(*DeleteDatasetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DatasetServiceV1_UndeleteDataset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UndeleteDatasetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DatasetServiceV1Server).UndeleteDataset(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.DatasetServiceV1/UndeleteDataset", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DatasetServiceV1Server).UndeleteDataset(ctx, req.(*UndeleteDatasetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DatasetServiceV1_SetIamPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(google_iam_v11.SetIamPolicyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DatasetServiceV1Server).SetIamPolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.DatasetServiceV1/SetIamPolicy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DatasetServiceV1Server).SetIamPolicy(ctx, req.(*google_iam_v11.SetIamPolicyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DatasetServiceV1_GetIamPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(google_iam_v11.GetIamPolicyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DatasetServiceV1Server).GetIamPolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.DatasetServiceV1/GetIamPolicy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DatasetServiceV1Server).GetIamPolicy(ctx, req.(*google_iam_v11.GetIamPolicyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DatasetServiceV1_TestIamPermissions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(google_iam_v11.TestIamPermissionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DatasetServiceV1Server).TestIamPermissions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.DatasetServiceV1/TestIamPermissions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DatasetServiceV1Server).TestIamPermissions(ctx, req.(*google_iam_v11.TestIamPermissionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _DatasetServiceV1_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.genomics.v1.DatasetServiceV1", + HandlerType: (*DatasetServiceV1Server)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListDatasets", + Handler: _DatasetServiceV1_ListDatasets_Handler, + }, + { + MethodName: "CreateDataset", + Handler: _DatasetServiceV1_CreateDataset_Handler, + }, + { + MethodName: "GetDataset", + Handler: _DatasetServiceV1_GetDataset_Handler, + }, + { + MethodName: "UpdateDataset", + Handler: _DatasetServiceV1_UpdateDataset_Handler, + }, + { + MethodName: "DeleteDataset", + Handler: _DatasetServiceV1_DeleteDataset_Handler, + }, + { + MethodName: "UndeleteDataset", + Handler: _DatasetServiceV1_UndeleteDataset_Handler, + }, + { + MethodName: "SetIamPolicy", + Handler: _DatasetServiceV1_SetIamPolicy_Handler, + }, + { + MethodName: "GetIamPolicy", + Handler: _DatasetServiceV1_GetIamPolicy_Handler, + }, + { + MethodName: "TestIamPermissions", + Handler: _DatasetServiceV1_TestIamPermissions_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/genomics/v1/datasets.proto", +} + +func init() { proto.RegisterFile("google/genomics/v1/datasets.proto", fileDescriptor2) } + +var fileDescriptor2 = []byte{ + // 786 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xd1, 0x4e, 0x13, 0x4d, + 0x14, 0xce, 0x16, 0xfe, 0x1f, 0x7a, 0xa0, 0xa0, 0x63, 0xc5, 0xda, 0x8a, 0x96, 0x8d, 0x42, 0xad, + 0xba, 0x4d, 0x6b, 0x08, 0x49, 0x89, 0x37, 0x88, 0x12, 0x12, 0x49, 0x9a, 0x02, 0x5e, 0x78, 0xd3, + 0x0c, 0xdd, 0xa1, 0x8e, 0x74, 0x77, 0xd6, 0x9d, 0x29, 0x28, 0xc8, 0x0d, 0x77, 0x5c, 0xfb, 0x00, + 0x26, 0xde, 0xf9, 0x3c, 0xbe, 0x82, 0x0f, 0xe1, 0xa5, 0x99, 0xd9, 0xd9, 0x76, 0xdb, 0x2e, 0x05, + 0x8c, 0x77, 0xdb, 0x73, 0xbe, 0x73, 0xbe, 0xef, 0xcc, 0xf9, 0x76, 0xba, 0xb0, 0xd0, 0x62, 0xac, + 0xd5, 0x26, 0xa5, 0x16, 0x71, 0x99, 0x43, 0x9b, 0xbc, 0x74, 0x58, 0x2e, 0xd9, 0x58, 0x60, 0x4e, + 0x04, 0xb7, 0x3c, 0x9f, 0x09, 0x86, 0x50, 0x00, 0xb1, 0x42, 0x88, 0x75, 0x58, 0xce, 0xde, 0xd3, + 0x65, 0xd8, 0xa3, 0x25, 0xec, 0xba, 0x4c, 0x60, 0x41, 0x99, 0xab, 0x2b, 0xb2, 0xf7, 0x75, 0x96, + 0x62, 0x47, 0xf6, 0xa3, 0xd8, 0x69, 0x78, 0xac, 0x4d, 0x9b, 0x9f, 0x75, 0x3e, 0xdb, 0x9f, 0xef, + 0xcb, 0xe5, 0x74, 0x4e, 0xfd, 0xda, 0xeb, 0xec, 0x97, 0x88, 0xe3, 0x89, 0x30, 0x99, 0x1f, 0x4c, + 0xee, 0x53, 0xd2, 0xb6, 0x1b, 0x0e, 0xe6, 0x07, 0x1a, 0xf1, 0x60, 0x10, 0x21, 0xa8, 0x43, 0xb8, + 0xc0, 0x8e, 0x17, 0x00, 0xcc, 0x73, 0x03, 0x26, 0xd6, 0x83, 0x01, 0xd1, 0x0c, 0x24, 0xa8, 0x9d, + 0x31, 0xf2, 0x46, 0x21, 0x59, 0x4f, 0x50, 0x1b, 0xcd, 0x03, 0x78, 0x3e, 0xfb, 0x40, 0x9a, 0xa2, + 0x41, 0xed, 0x4c, 0x42, 0xc5, 0x93, 0x3a, 0xb2, 0x69, 0x23, 0x04, 0xe3, 0x2e, 0x76, 0x48, 0x66, + 0x4c, 0x25, 0xd4, 0x33, 0x5a, 0x85, 0xa9, 0xa6, 0x4f, 0xb0, 0x20, 0x0d, 0x49, 0x94, 0x19, 0xcf, + 0x1b, 0x85, 0xa9, 0x4a, 0xd6, 0xd2, 0x47, 0x16, 0xaa, 0xb0, 0x76, 0x42, 0x15, 0x75, 0x08, 0xe0, + 0x32, 0x60, 0x7a, 0x70, 0xeb, 0x0d, 0xe5, 0x42, 0xcb, 0xe1, 0x75, 0xf2, 0xb1, 0x43, 0xb8, 0x18, + 0x90, 0x61, 0x0c, 0xca, 0xc8, 0x41, 0xd2, 0xc3, 0x2d, 0xd2, 0xe0, 0xf4, 0x98, 0x28, 0x91, 0xff, + 0xd5, 0x27, 0x65, 0x60, 0x9b, 0x1e, 0x13, 0x55, 0x2b, 0x93, 0x82, 0x1d, 0x10, 0x57, 0x2b, 0x55, + 0xf0, 0x1d, 0x19, 0x30, 0x8f, 0x20, 0xdd, 0xcf, 0xc8, 0x3d, 0xe6, 0x72, 0x82, 0x56, 0x60, 0x32, + 0xdc, 0x7a, 0xc6, 0xc8, 0x8f, 0x15, 0xa6, 0x2a, 0x39, 0x6b, 0x78, 0xed, 0x96, 0xae, 0xab, 0x77, + 0xc1, 0x68, 0x11, 0x66, 0x5d, 0xf2, 0x49, 0x34, 0x22, 0xa4, 0xc1, 0xb9, 0xa5, 0x64, 0xb8, 0xd6, + 0x25, 0xde, 0x82, 0xf4, 0x4b, 0x35, 0x78, 0xd8, 0x42, 0xcf, 0xba, 0x0c, 0x13, 0xba, 0x97, 0x1a, + 0xf4, 0x12, 0xde, 0x10, 0x6b, 0xfe, 0x30, 0x20, 0xbd, 0xeb, 0xd9, 0xc3, 0xfd, 0xe6, 0x01, 0x34, + 0x26, 0x72, 0x76, 0x3a, 0xb2, 0x69, 0x47, 0xe9, 0x12, 0x57, 0xa7, 0x93, 0x5b, 0xee, 0x28, 0x36, + 0x65, 0x35, 0x75, 0xac, 0x71, 0x5b, 0x7e, 0x2d, 0xdd, 0xb8, 0x85, 0xf9, 0x41, 0x1d, 0x02, 0xb8, + 0x7c, 0x36, 0x97, 0x21, 0xbd, 0x4e, 0xda, 0xe4, 0x9a, 0x52, 0xcd, 0x15, 0x98, 0xdb, 0x75, 0xed, + 0xbf, 0x28, 0xac, 0xc0, 0xcd, 0x0d, 0x22, 0xae, 0x55, 0x53, 0xf9, 0x96, 0x84, 0x1b, 0xba, 0x62, + 0x9b, 0xf8, 0x87, 0xb4, 0x49, 0xde, 0x96, 0xd1, 0x11, 0x4c, 0x47, 0xcd, 0x82, 0x96, 0xe2, 0xce, + 0x2a, 0xc6, 0xc0, 0xd9, 0xc2, 0xe5, 0xc0, 0xc0, 0x77, 0x66, 0xfa, 0xec, 0xe7, 0xaf, 0xaf, 0x89, + 0x19, 0x34, 0x1d, 0xbd, 0x77, 0x50, 0x07, 0x52, 0x7d, 0x66, 0x41, 0xb1, 0x0d, 0xe3, 0xfc, 0x94, + 0x1d, 0xb5, 0x4f, 0x73, 0x5e, 0xb1, 0xdd, 0x31, 0xfb, 0xd8, 0xaa, 0xdd, 0x2d, 0x73, 0x80, 0xde, + 0xc1, 0xa1, 0x47, 0x71, 0x9d, 0x86, 0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0x18, 0xaa, 0xae, + 0x1a, 0xc5, 0xb5, 0xf7, 0x30, 0xd7, 0x64, 0x4e, 0xcc, 0xc6, 0xd7, 0x52, 0xe1, 0xad, 0x52, 0x93, + 0x0e, 0xac, 0x19, 0xef, 0xaa, 0x21, 0x88, 0xb5, 0xb1, 0xdb, 0xb2, 0x98, 0xdf, 0x92, 0x9f, 0x37, + 0xca, 0x9f, 0xa5, 0x20, 0x85, 0x3d, 0xca, 0xa3, 0x9f, 0x3c, 0xab, 0xe1, 0xf3, 0x6f, 0xc3, 0xd8, + 0xfb, 0x5f, 0x21, 0x9f, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0x87, 0x48, 0x07, 0xbb, 0x1b, 0x09, + 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/genomics/v1/operations.pb.go b/vendor/google.golang.org/genproto/googleapis/genomics/v1/operations.pb.go new file mode 100644 index 0000000000..194e901709 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/genomics/v1/operations.pb.go @@ -0,0 +1,189 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/genomics/v1/operations.proto + +package genomics + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf5 "github.com/golang/protobuf/ptypes/any" +import google_protobuf6 "github.com/golang/protobuf/ptypes/timestamp" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Metadata describing an [Operation][google.longrunning.Operation]. +type OperationMetadata struct { + // The Google Cloud Project in which the job is scoped. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The time at which the job was submitted to the Genomics service. + CreateTime *google_protobuf6.Timestamp `protobuf:"bytes,2,opt,name=create_time,json=createTime" json:"create_time,omitempty"` + // The time at which the job began to run. + StartTime *google_protobuf6.Timestamp `protobuf:"bytes,3,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + // The time at which the job stopped running. + EndTime *google_protobuf6.Timestamp `protobuf:"bytes,4,opt,name=end_time,json=endTime" json:"end_time,omitempty"` + // The original request that started the operation. Note that this will be in + // current version of the API. If the operation was started with v1beta2 API + // and a GetOperation is performed on v1 API, a v1 request will be returned. + Request *google_protobuf5.Any `protobuf:"bytes,5,opt,name=request" json:"request,omitempty"` + // Optional event messages that were generated during the job's execution. + // This also contains any warnings that were generated during import + // or export. + Events []*OperationEvent `protobuf:"bytes,6,rep,name=events" json:"events,omitempty"` + // This field is deprecated. Use `labels` instead. Optionally provided by the + // caller when submitting the request that creates the operation. + ClientId string `protobuf:"bytes,7,opt,name=client_id,json=clientId" json:"client_id,omitempty"` + // Runtime metadata on this Operation. + RuntimeMetadata *google_protobuf5.Any `protobuf:"bytes,8,opt,name=runtime_metadata,json=runtimeMetadata" json:"runtime_metadata,omitempty"` + // Optionally provided by the caller when submitting the request that creates + // the operation. + Labels map[string]string `protobuf:"bytes,9,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *OperationMetadata) Reset() { *m = OperationMetadata{} } +func (m *OperationMetadata) String() string { return proto.CompactTextString(m) } +func (*OperationMetadata) ProtoMessage() {} +func (*OperationMetadata) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} } + +func (m *OperationMetadata) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *OperationMetadata) GetCreateTime() *google_protobuf6.Timestamp { + if m != nil { + return m.CreateTime + } + return nil +} + +func (m *OperationMetadata) GetStartTime() *google_protobuf6.Timestamp { + if m != nil { + return m.StartTime + } + return nil +} + +func (m *OperationMetadata) GetEndTime() *google_protobuf6.Timestamp { + if m != nil { + return m.EndTime + } + return nil +} + +func (m *OperationMetadata) GetRequest() *google_protobuf5.Any { + if m != nil { + return m.Request + } + return nil +} + +func (m *OperationMetadata) GetEvents() []*OperationEvent { + if m != nil { + return m.Events + } + return nil +} + +func (m *OperationMetadata) GetClientId() string { + if m != nil { + return m.ClientId + } + return "" +} + +func (m *OperationMetadata) GetRuntimeMetadata() *google_protobuf5.Any { + if m != nil { + return m.RuntimeMetadata + } + return nil +} + +func (m *OperationMetadata) GetLabels() map[string]string { + if m != nil { + return m.Labels + } + return nil +} + +// An event that occurred during an [Operation][google.longrunning.Operation]. +type OperationEvent struct { + // Optional time of when event started. + StartTime *google_protobuf6.Timestamp `protobuf:"bytes,1,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + // Optional time of when event finished. An event can have a start time and no + // finish time. If an event has a finish time, there must be a start time. + EndTime *google_protobuf6.Timestamp `protobuf:"bytes,2,opt,name=end_time,json=endTime" json:"end_time,omitempty"` + // Required description of event. + Description string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` +} + +func (m *OperationEvent) Reset() { *m = OperationEvent{} } +func (m *OperationEvent) String() string { return proto.CompactTextString(m) } +func (*OperationEvent) ProtoMessage() {} +func (*OperationEvent) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{1} } + +func (m *OperationEvent) GetStartTime() *google_protobuf6.Timestamp { + if m != nil { + return m.StartTime + } + return nil +} + +func (m *OperationEvent) GetEndTime() *google_protobuf6.Timestamp { + if m != nil { + return m.EndTime + } + return nil +} + +func (m *OperationEvent) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func init() { + proto.RegisterType((*OperationMetadata)(nil), "google.genomics.v1.OperationMetadata") + proto.RegisterType((*OperationEvent)(nil), "google.genomics.v1.OperationEvent") +} + +func init() { proto.RegisterFile("google/genomics/v1/operations.proto", fileDescriptor3) } + +var fileDescriptor3 = []byte{ + // 456 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x93, 0x41, 0x6f, 0xd3, 0x30, + 0x14, 0xc7, 0xe5, 0x76, 0x6b, 0x9b, 0x17, 0x89, 0x0d, 0x6b,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b7, 0x74, 0x75, 0x0b, 0x4f, 0x52, 0x59, 0xfd, + 0x65, 0x42, 0x57, 0x27, 0x7b, 0xf7, 0xfa, 0xa6, 0xb9, 0xe2, 0x86, 0x7c, 0x59, 0xb4, 0x32, 0x59, + 0x72, 0x91, 0x33, 0xa9, 0xf2, 0xe6, 0x95, 0x5a, 0x03, 0xb1, 0x6b, 0xf1, 0xba, 0xd0, 0xdd, 0x97, + 0x7b, 0xd9, 0xae, 0x7f, 0x11, 0xb2, 0x1e, 0x58, 0xe5, 0xeb, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, + 0x6a, 0xf6, 0xa8, 0x9a, 0xe2, 0x03, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/genomics/v1/position.pb.go b/vendor/google.golang.org/genproto/googleapis/genomics/v1/position.pb.go new file mode 100644 index 0000000000..413c684457 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/genomics/v1/position.pb.go @@ -0,0 +1,78 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/genomics/v1/position.proto + +package genomics + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// An abstraction for referring to a genomic position, in relation to some +// already known reference. For now, represents a genomic position as a +// reference name, a base number on that reference (0-based), and a +// determination of forward or reverse strand. +type Position struct { + // The name of the reference in whatever reference set is being used. + ReferenceName string `protobuf:"bytes,1,opt,name=reference_name,json=referenceName" json:"reference_name,omitempty"` + // The 0-based offset from the start of the forward strand for that reference. + Position int64 `protobuf:"varint,2,opt,name=position" json:"position,omitempty"` + // Whether this position is on the reverse strand, as opposed to the forward + // strand. + ReverseStrand bool `protobuf:"varint,3,opt,name=reverse_strand,json=reverseStrand" json:"reverse_strand,omitempty"` +} + +func (m *Position) Reset() { *m = Position{} } +func (m *Position) String() string { return proto.CompactTextString(m) } +func (*Position) ProtoMessage() {} +func (*Position) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{0} } + +func (m *Position) GetReferenceName() string { + if m != nil { + return m.ReferenceName + } + return "" +} + +func (m *Position) GetPosition() int64 { + if m != nil { + return m.Position + } + return 0 +} + +func (m *Position) GetReverseStrand() bool { + if m != nil { + return m.ReverseStrand + } + return false +} + +func init() { + proto.RegisterType((*Position)(nil), "google.genomics.v1.Position") +} + +func init() { proto.RegisterFile("google/genomics/v1/position.proto", fileDescriptor4) } + +var fileDescriptor4 = []byte{ + // 223 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x90, 0x41, 0x4b, 0x03, 0x31, + 0x14, 0x84, 0x89, 0x05, 0x59, 0x03, 0xf5, 0xb0, 0x07, 0x59, 0x8a, 0x87, 0x55, 0x10, 0xf6, 0x94, + 0x50, 0xbc, 0xe9, 0xad, 0x3f, 0x40, 0x96, 0x7a, 0xf3, 0x52, 0x9e, 0xeb, 0x33, 0x06, 0xba, 0xef, + 0x85, 0x24, 0xec, 0x6f, 0xf7, 0x28, 0x49, 0x9a, 0x22, 0xf4, 0x96, 0x4c, 0x66, 0x26, 0x1f, 0x23, + 0x1f, 0x0c, 0xb3, 0x39, 0xa2, 0x36, 0x48, 0x3c, 0xdb, 0x29, 0xe8, 0x65, 0xab, 0x1d, 0x07, 0x1b, + 0x2d, 0x93, 0x72, 0x9e, 0x23, 0xb7, 0x6d, 0xb1, 0xa8, 0x6a, 0x51, 0xcb, 0x76, 0x73, 0x7f, 0x8a, + 0x81, 0xb3, 0x1a, 0x88, 0x38, 0x42, 0x0a, 0x84, 0x92, 0x78, 0x8c, 0xb2, 0x19, 0x4f, 0x1d, 0xed, + 0x93, 0xbc, 0xf5, 0xf8, 0x8d, 0x1e, 0x69, 0xc2, 0x03, 0xc1, 0x8c, 0x9d, 0xe8, 0xc5, 0x70, 0xb3, + 0x5f, 0x9f, 0xd5, 0x37, 0x98, 0xb1, 0xdd, 0xc8, 0xa6, 0x7e, 0xdb, 0x5d, 0xf5, 0x62, 0x58, 0xed, + 0xcf, 0xf7, 0x52, 0xb1, 0xa0, 0x0f, 0x78, 0x08, 0xd1, 0x03, 0x7d, 0x75, 0xab, 0x5e, 0x0c, 0x4d, + 0xaa, 0xc8, 0xea, 0x7b, 0x16, 0x77, 0x3f, 0xf2, 0x6e, 0xe2, 0x59, 0x5d, 0xd2, 0xee, 0xd6, 0x95, + 0x66, 0x4c, 0x78, 0xa3, 0xf8, 0x78, 0xa9, 0x26, 0x3e, 0x02, 0x19, 0xc5, 0xde, 0xa4, 0x01, 0x32, + 0xbc, 0x2e, 0x4f, 0xe0, 0x6c, 0xf8, 0x3f, 0xca, 0x6b, 0x3d, 0xff, 0x0a, 0xf1, 0x79, 0x9d, 0x9d, + 0xcf, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x5c, 0xc6, 0x22, 0xea, 0x3d, 0x01, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/genomics/v1/range.pb.go b/vendor/google.golang.org/genproto/googleapis/genomics/v1/range.pb.go new file mode 100644 index 0000000000..4062d6eaa5 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/genomics/v1/range.pb.go @@ -0,0 +1,75 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/genomics/v1/range.proto + +package genomics + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// A 0-based half-open genomic coordinate range for search requests. +type Range struct { + // The reference sequence name, for example `chr1`, + // `1`, or `chrX`. + ReferenceName string `protobuf:"bytes,1,opt,name=reference_name,json=referenceName" json:"reference_name,omitempty"` + // The start position of the range on the reference, 0-based inclusive. + Start int64 `protobuf:"varint,2,opt,name=start" json:"start,omitempty"` + // The end position of the range on the reference, 0-based exclusive. + End int64 `protobuf:"varint,3,opt,name=end" json:"end,omitempty"` +} + +func (m *Range) Reset() { *m = Range{} } +func (m *Range) String() string { return proto.CompactTextString(m) } +func (*Range) ProtoMessage() {} +func (*Range) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{0} } + +func (m *Range) GetReferenceName() string { + if m != nil { + return m.ReferenceName + } + return "" +} + +func (m *Range) GetStart() int64 { + if m != nil { + return m.Start + } + return 0 +} + +func (m *Range) GetEnd() int64 { + if m != nil { + return m.End + } + return 0 +} + +func init() { + proto.RegisterType((*Range)(nil), "google.genomics.v1.Range") +} + +func init() { proto.RegisterFile("google/genomics/v1/range.proto", fileDescriptor5) } + +var fileDescriptor5 = []byte{ + // 209 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x4f, 0x4d, 0x4b, 0xc4, 0x30, + 0x10, 0x25, 0x96, 0x15, 0x0c, 0x28, 0x12, 0x44, 0x8a, 0x88, 0x2c, 0x82, 0xb0, 0xa7, 0x84, 0xe2, + 0x4d, 0x6f, 0xfd, 0x01, 0x52, 0x7a, 0xf0, 0xe0, 0x45, 0xc6, 0x3a, 0x86, 0x40, 0x33, 0x53, 0x92, + 0xd0, 0xdf, 0xee, 0x51, 0x92, 0x58, 0x11, 0xf6, 0x36, 0x79, 0x1f, 0x79, 0xef, 0xc9, 0x3b, 0xcb, + 0x6c, 0x67, 0x34, 0x16, 0x89, 0xbd, 0x9b, 0xa2, 0x59, 0x3b, 0x13, 0x80, 0x2c, 0xea, 0x25, 0x70, + 0x62, 0xa5, 0x2a, 0xaf, 0x37, 0x5e, 0xaf, 0xdd, 0xcd, 0xed, 0xaf, 0x07, 0x16, 0x67, 0x80, 0x88, + 0x13, 0x24, 0xc7, 0x14, 0xab, 0xe3, 0xfe, 0x55, 0xee, 0xc6, 0xfc, 0x81, 0x7a, 0x90, 0x17, 0x01, + 0xbf, 0x30, 0x20, 0x4d, 0xf8, 0x4e, 0xe0, 0xb1, 0x15, 0x7b, 0x71, 0x38, 0x1b, 0xcf, 0xff, 0xd0, + 0x17, 0xf0, 0xa8, 0xae, 0xe4, 0x2e, 0x26, 0x08, 0xa9, 0x3d, 0xd9, 0x8b, 0x43, 0x33, 0xd6, 0x87, + 0xba, 0x94, 0x0d, 0xd2, 0x67, 0xdb, 0x14, 0x2c, 0x9f, 0x3d, 0xca, 0xeb, 0x89, 0xbd, 0x3e, 0xee, + 0xd3, 0xcb, 0x92, 0x37, 0xe4, 0xf4, 0x41, 0xbc, 0x3d, 0x6d, 0x0a, 0x9e, 0x81, 0xac, 0xe6, 0x60, + 0xf3, 0xb8, 0xd2, 0xcd, 0x54, 0x0a, 0x16, 0x17, 0xff, 0x0f, 0x7e, 0xde, 0xee, 0x6f, 0x21, 0x3e, + 0x4e, 0x8b, 0xf2, 0xf1, 0x27, 0x00, 0x00, 0xff, 0xff, 0xb7, 0x3e, 0xf1, 0x62, 0x19, 0x01, 0x00, + 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/genomics/v1/readalignment.pb.go b/vendor/google.golang.org/genproto/googleapis/genomics/v1/readalignment.pb.go new file mode 100644 index 0000000000..f766a30079 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/genomics/v1/readalignment.pb.go @@ -0,0 +1,393 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/genomics/v1/readalignment.proto + +package genomics + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf3 "github.com/golang/protobuf/ptypes/struct" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// A linear alignment can be represented by one CIGAR string. Describes the +// mapped position and local alignment of the read to the reference. +type LinearAlignment struct { + // The position of this alignment. + Position *Position `protobuf:"bytes,1,opt,name=position" json:"position,omitempty"` + // The mapping quality of this alignment. Represents how likely + // the read maps to this position as opposed to other locations. + // + // Specifically, this is -10 log10 Pr(mapping position is wrong), rounded to + // the nearest integer. + MappingQuality int32 `protobuf:"varint,2,opt,name=mapping_quality,json=mappingQuality" json:"mapping_quality,omitempty"` + // Represents the local alignment of this sequence (alignment matches, indels, + // etc) against the reference. + Cigar []*CigarUnit `protobuf:"bytes,3,rep,name=cigar" json:"cigar,omitempty"` +} + +func (m *LinearAlignment) Reset() { *m = LinearAlignment{} } +func (m *LinearAlignment) String() string { return proto.CompactTextString(m) } +func (*LinearAlignment) ProtoMessage() {} +func (*LinearAlignment) Descriptor() ([]byte, []int) { return fileDescriptor6, []int{0} } + +func (m *LinearAlignment) GetPosition() *Position { + if m != nil { + return m.Position + } + return nil +} + +func (m *LinearAlignment) GetMappingQuality() int32 { + if m != nil { + return m.MappingQuality + } + return 0 +} + +func (m *LinearAlignment) GetCigar() []*CigarUnit { + if m != nil { + return m.Cigar + } + return nil +} + +// A read alignment describes a linear alignment of a string of DNA to a +// [reference sequence][google.genomics.v1.Reference], in addition to metadata +// about the fragment (the molecule of DNA sequenced) and the read (the bases +// which were read by the sequencer). A read is equivalent to a line in a SAM +// file. A read belongs to exactly one read group and exactly one +// [read group set][google.genomics.v1.ReadGroupSet]. +// +// For more genomics resource definitions, see [Fundamentals of Google +// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +// +// ### Reverse-stranded reads +// +// Mapped reads (reads having a non-null `alignment`) can be aligned to either +// the forward or the reverse strand of their associated reference. Strandedness +// of a mapped read is encoded by `alignment.position.reverseStrand`. +// +// If we consider the reference to be a forward-stranded coordinate space of +// `[0, reference.length)` with `0` as the left-most position and +// `reference.length` as the right-most position, reads are always aligned left +// to right. That is, `alignment.position.position` always refers to the +// left-most reference coordinate and `alignment.cigar` describes the alignment +// of this read to the reference from left to right. All per-base fields such as +// `alignedSequence` and `alignedQuality` share this same left-to-right +// orientation; this is true of reads which are aligned to either strand. For +// reverse-stranded reads, this means that `alignedSequence` is the reverse +// complement of the bases that were originally reported by the sequencing +// machine. +// +// ### Generating a reference-aligned sequence string +// +// When interacting with mapped reads, it's often useful to produce a string +// representing the local alignment of the read to reference. The following +// pseudocode demonstrates one way of doing this: +// +// out = "" +// offset = 0 +// for c in read.alignment.cigar { +// switch c.operation { +// case "ALIGNMENT_MATCH", "SEQUENCE_MATCH", "SEQUENCE_MISMATCH": +// out += read.alignedSequence[offset:offset+c.operationLength] +// offset += c.operationLength +// break +// case "CLIP_SOFT", "INSERT": +// offset += c.operationLength +// break +// case "PAD": +// out += repeat("*", c.operationLength) +// break +// case "DELETE": +// out += repeat("-", c.operationLength) +// break +// case "SKIP": +// out += repeat(" ", c.operationLength) +// break +// case "CLIP_HARD": +// break +// } +// } +// return out +// +// ### Converting to SAM's CIGAR string +// +// The following pseudocode generates a SAM CIGAR string from the +// `cigar` field. Note that this is a lossy conversion +// (`cigar.referenceSequence` is lost). +// +// cigarMap = { +// "ALIGNMENT_MATCH": "M", +// "INSERT": "I", +// "DELETE": "D", +// "SKIP": "N", +// "CLIP_SOFT": "S", +// "CLIP_HARD": "H", +// "PAD": "P", +// "SEQUENCE_MATCH": "=", +// "SEQUENCE_MISMATCH": "X", +// } +// cigarStr = "" +// for c in read.alignment.cigar { +// cigarStr += c.operationLength + cigarMap[c.operation] +// } +// return cigarStr +type Read struct { + // The server-generated read ID, unique across all reads. This is different + // from the `fragmentName`. + Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + // The ID of the read group this read belongs to. A read belongs to exactly + // one read group. This is a server-generated ID which is distinct from SAM's + // RG tag (for that value, see + // [ReadGroup.name][google.genomics.v1.ReadGroup.name]). + ReadGroupId string `protobuf:"bytes,2,opt,name=read_group_id,json=readGroupId" json:"read_group_id,omitempty"` + // The ID of the read group set this read belongs to. A read belongs to + // exactly one read group set. + ReadGroupSetId string `protobuf:"bytes,3,opt,name=read_group_set_id,json=readGroupSetId" json:"read_group_set_id,omitempty"` + // The fragment name. Equivalent to QNAME (query template name) in SAM. + FragmentName string `protobuf:"bytes,4,opt,name=fragment_name,json=fragmentName" json:"fragment_name,omitempty"` + // The orientation and the distance between reads from the fragment are + // consistent with the sequencing protocol (SAM flag 0x2). + ProperPlacement bool `protobuf:"varint,5,opt,name=proper_placement,json=properPlacement" json:"proper_placement,omitempty"` + // The fragment is a PCR or optical duplicate (SAM flag 0x400). + DuplicateFragment bool `protobuf:"varint,6,opt,name=duplicate_fragment,json=duplicateFragment" json:"duplicate_fragment,omitempty"` + // The observed length of the fragment, equivalent to TLEN in SAM. + FragmentLength int32 `protobuf:"varint,7,opt,name=fragment_length,json=fragmentLength" json:"fragment_length,omitempty"` + // The read number in sequencing. 0-based and less than numberReads. This + // field replaces SAM flag 0x40 and 0x80. + ReadNumber int32 `protobuf:"varint,8,opt,name=read_number,json=readNumber" json:"read_number,omitempty"` + // The number of reads in the fragment (extension to SAM flag 0x1). + NumberReads int32 `protobuf:"varint,9,opt,name=number_reads,json=numberReads" json:"number_reads,omitempty"` + // Whether this read did not pass filters, such as platform or vendor quality + // controls (SAM flag 0x200). + FailedVendorQualityChecks bool `protobuf:"varint,10,opt,name=failed_vendor_quality_checks,json=failedVendorQualityChecks" json:"failed_vendor_quality_checks,omitempty"` + // The linear alignment for this alignment record. This field is null for + // unmapped reads. + Alignment *LinearAlignment `protobuf:"bytes,11,opt,name=alignment" json:"alignment,omitempty"` + // Whether this alignment is secondary. Equivalent to SAM flag 0x100. + // A secondary alignment represents an alternative to the primary alignment + // for this read. Aligners may return secondary alignments if a read can map + // ambiguously to multiple coordinates in the genome. By convention, each read + // has one and only one alignment where both `secondaryAlignment` + // and `supplementaryAlignment` are false. + SecondaryAlignment bool `protobuf:"varint,12,opt,name=secondary_alignment,json=secondaryAlignment" json:"secondary_alignment,omitempty"` + // Whether this alignment is supplementary. Equivalent to SAM flag 0x800. + // Supplementary alignments are used in the representation of a chimeric + // alignment. In a chimeric alignment, a read is split into multiple + // linear alignments that map to different reference contigs. The first + // linear alignment in the read will be designated as the representative + // alignment; the remaining linear alignments will be designated as + // supplementary alignments. These alignments may have different mapping + // quality scores. In each linear alignment in a chimeric alignment, the read + // will be hard clipped. The `alignedSequence` and + // `alignedQuality` fields in the alignment record will only + // represent the bases for its respective linear alignment. + SupplementaryAlignment bool `protobuf:"varint,13,opt,name=supplementary_alignment,json=supplementaryAlignment" json:"supplementary_alignment,omitempty"` + // The bases of the read sequence contained in this alignment record, + // **without CIGAR operations applied** (equivalent to SEQ in SAM). + // `alignedSequence` and `alignedQuality` may be + // shorter than the full read sequence and quality. This will occur if the + // alignment is part of a chimeric alignment, or if the read was trimmed. When + // this occurs, the CIGAR for this read will begin/end with a hard clip + // operator that will indicate the length of the excised sequence. + AlignedSequence string `protobuf:"bytes,14,opt,name=aligned_sequence,json=alignedSequence" json:"aligned_sequence,omitempty"` + // The quality of the read sequence contained in this alignment record + // (equivalent to QUAL in SAM). + // `alignedSequence` and `alignedQuality` may be shorter than the full read + // sequence and quality. This will occur if the alignment is part of a + // chimeric alignment, or if the read was trimmed. When this occurs, the CIGAR + // for this read will begin/end with a hard clip operator that will indicate + // the length of the excised sequence. + AlignedQuality []int32 `protobuf:"varint,15,rep,packed,name=aligned_quality,json=alignedQuality" json:"aligned_quality,omitempty"` + // The mapping of the primary alignment of the + // `(readNumber+1)%numberReads` read in the fragment. It replaces + // mate position and mate strand in SAM. + NextMatePosition *Position `protobuf:"bytes,16,opt,name=next_mate_position,json=nextMatePosition" json:"next_mate_position,omitempty"` + // A map of additional read alignment information. This must be of the form + // map (string key mapping to a list of string values). + Info map[string]*google_protobuf3.ListValue `protobuf:"bytes,17,rep,name=info" json:"info,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *Read) Reset() { *m = Read{} } +func (m *Read) String() string { return proto.CompactTextString(m) } +func (*Read) ProtoMessage() {} +func (*Read) Descriptor() ([]byte, []int) { return fileDescriptor6, []int{1} } + +func (m *Read) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *Read) GetReadGroupId() string { + if m != nil { + return m.ReadGroupId + } + return "" +} + +func (m *Read) GetReadGroupSetId() string { + if m != nil { + return m.ReadGroupSetId + } + return "" +} + +func (m *Read) GetFragmentName() string { + if m != nil { + return m.FragmentName + } + return "" +} + +func (m *Read) GetProperPlacement() bool { + if m != nil { + return m.ProperPlacement + } + return false +} + +func (m *Read) GetDuplicateFragment() bool { + if m != nil { + return m.DuplicateFragment + } + return false +} + +func (m *Read) GetFragmentLength() int32 { + if m != nil { + return m.FragmentLength + } + return 0 +} + +func (m *Read) GetReadNumber() int32 { + if m != nil { + return m.ReadNumber + } + return 0 +} + +func (m *Read) GetNumberReads() int32 { + if m != nil { + return m.NumberReads + } + return 0 +} + +func (m *Read) GetFailedVendorQualityChecks() bool { + if m != nil { + return m.FailedVendorQualityChecks + } + return false +} + +func (m *Read) GetAlignment() *LinearAlignment { + if m != nil { + return m.Alignment + } + return nil +} + +func (m *Read) GetSecondaryAlignment() bool { + if m != nil { + return m.SecondaryAlignment + } + return false +} + +func (m *Read) GetSupplementaryAlignment() bool { + if m != nil { + return m.SupplementaryAlignment + } + return false +} + +func (m *Read) GetAlignedSequence() string { + if m != nil { + return m.AlignedSequence + } + return "" +} + +func (m *Read) GetAlignedQuality() []int32 { + if m != nil { + return m.AlignedQuality + } + return nil +} + +func (m *Read) GetNextMatePosition() *Position { + if m != nil { + return m.NextMatePosition + } + return nil +} + +func (m *Read) GetInfo() map[string]*google_protobuf3.ListValue { + if m != nil { + return m.Info + } + return nil +} + +func init() { + proto.RegisterType((*LinearAlignment)(nil), "google.genomics.v1.LinearAlignment") + proto.RegisterType((*Read)(nil), "google.genomics.v1.Read") +} + +func init() { proto.RegisterFile("google/genomics/v1/readalignment.proto", fileDescriptor6) } + +var fileDescriptor6 = []byte{ + // 683 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,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, 0x2b, 0x8c, 0x4f, 0x85, 0xbd, + 0xa9, 0xaf, 0x62, 0xb4, 0xcc, 0x5b, 0x8d, 0xcd, 0x39, 0xe7, 0x53, 0xf1, 0x96, 0xcb, 0x6c, 0xee, + 0x69, 0x7e, 0x70, 0x05, 0xed, 0x5a, 0x22, 0x7d, 0x68, 0xde, 0xe1, 0xbc, 0x3a, 0x0f, 0xf5, 0x93, + 0xbc, 0x80, 0xd6, 0x8c, 0xc6, 0x05, 0xea, 0xbb, 0xe8, 0x1c, 0x0c, 0x4c, 0x5c, 0xf3, 0x24, 0x38, + 0x17, 0x2c, 0x97, 0xd7, 0x8a, 0xf0, 0x4a, 0xf0, 0xb8, 0x71, 0x64, 0x9d, 0x26, 0xb0, 0x15, 0x88, + 0x64, 0x49, 0x0d, 0xa7, 0x44, 0x15, 0x51, 0x77, 0x75, 0xa2, 0xa2, 0x4c, 0xac, 0x2f, 0xc7, 0x86, + 0x14, 0x31, 0xe5, 0x91, 0x23, 0xb2, 0x48, 0x3d, 0x4b, 0x3a, 0x87, 0x5b, 0x9a, 0x68, 0xca, 0xf2, + 0x87, 0x4f, 0xd5, 0x6b, 0xf3, 0xfb, 0x87, 0x65, 0xdd, 0xac, 0x6a, 0xf2, 0xf0, 0x67, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xd0, 0xe1, 0xf6, 0x57, 0x4d, 0x05, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/genomics/v1/readgroup.pb.go b/vendor/google.golang.org/genproto/googleapis/genomics/v1/readgroup.pb.go new file mode 100644 index 0000000000..42f4e143a0 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/genomics/v1/readgroup.pb.go @@ -0,0 +1,275 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/genomics/v1/readgroup.proto + +package genomics + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf3 "github.com/golang/protobuf/ptypes/struct" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// A read group is all the data that's processed the same way by the sequencer. +type ReadGroup struct { + // The server-generated read group ID, unique for all read groups. + // Note: This is different than the @RG ID field in the SAM spec. For that + // value, see [name][google.genomics.v1.ReadGroup.name]. + Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + // The dataset to which this read group belongs. + DatasetId string `protobuf:"bytes,2,opt,name=dataset_id,json=datasetId" json:"dataset_id,omitempty"` + // The read group name. This corresponds to the @RG ID field in the SAM spec. + Name string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"` + // A free-form text description of this read group. + Description string `protobuf:"bytes,4,opt,name=description" json:"description,omitempty"` + // A client-supplied sample identifier for the reads in this read group. + SampleId string `protobuf:"bytes,5,opt,name=sample_id,json=sampleId" json:"sample_id,omitempty"` + // The experiment used to generate this read group. + Experiment *ReadGroup_Experiment `protobuf:"bytes,6,opt,name=experiment" json:"experiment,omitempty"` + // The predicted insert size of this read group. The insert size is the length + // the sequenced DNA fragment from end-to-end, not including the adapters. + PredictedInsertSize int32 `protobuf:"varint,7,opt,name=predicted_insert_size,json=predictedInsertSize" json:"predicted_insert_size,omitempty"` + // The programs used to generate this read group. Programs are always + // identical for all read groups within a read group set. For this reason, + // only the first read group in a returned set will have this field + // populated. + Programs []*ReadGroup_Program `protobuf:"bytes,10,rep,name=programs" json:"programs,omitempty"` + // The reference set the reads in this read group are aligned to. + ReferenceSetId string `protobuf:"bytes,11,opt,name=reference_set_id,json=referenceSetId" json:"reference_set_id,omitempty"` + // A map of additional read group information. This must be of the form + // map (string key mapping to a list of string values). + Info map[string]*google_protobuf3.ListValue `protobuf:"bytes,12,rep,name=info" json:"info,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *ReadGroup) Reset() { *m = ReadGroup{} } +func (m *ReadGroup) String() string { return proto.CompactTextString(m) } +func (*ReadGroup) ProtoMessage() {} +func (*ReadGroup) Descriptor() ([]byte, []int) { return fileDescriptor7, []int{0} } + +func (m *ReadGroup) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *ReadGroup) GetDatasetId() string { + if m != nil { + return m.DatasetId + } + return "" +} + +func (m *ReadGroup) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ReadGroup) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *ReadGroup) GetSampleId() string { + if m != nil { + return m.SampleId + } + return "" +} + +func (m *ReadGroup) GetExperiment() *ReadGroup_Experiment { + if m != nil { + return m.Experiment + } + return nil +} + +func (m *ReadGroup) GetPredictedInsertSize() int32 { + if m != nil { + return m.PredictedInsertSize + } + return 0 +} + +func (m *ReadGroup) GetPrograms() []*ReadGroup_Program { + if m != nil { + return m.Programs + } + return nil +} + +func (m *ReadGroup) GetReferenceSetId() string { + if m != nil { + return m.ReferenceSetId + } + return "" +} + +func (m *ReadGroup) GetInfo() map[string]*google_protobuf3.ListValue { + if m != nil { + return m.Info + } + return nil +} + +type ReadGroup_Experiment struct { + // A client-supplied library identifier; a library is a collection of DNA + // fragments which have been prepared for sequencing from a sample. This + // field is important for quality control as error or bias can be introduced + // during sample preparation. + LibraryId string `protobuf:"bytes,1,opt,name=library_id,json=libraryId" json:"library_id,omitempty"` + // The platform unit used as part of this experiment, for example + // flowcell-barcode.lane for Illumina or slide for SOLiD. Corresponds to the + // @RG PU field in the SAM spec. + PlatformUnit string `protobuf:"bytes,2,opt,name=platform_unit,json=platformUnit" json:"platform_unit,omitempty"` + // The sequencing center used as part of this experiment. + SequencingCenter string `protobuf:"bytes,3,opt,name=sequencing_center,json=sequencingCenter" json:"sequencing_center,omitempty"` + // The instrument model used as part of this experiment. This maps to + // sequencing technology in the SAM spec. + InstrumentModel string `protobuf:"bytes,4,opt,name=instrument_model,json=instrumentModel" json:"instrument_model,omitempty"` +} + +func (m *ReadGroup_Experiment) Reset() { *m = ReadGroup_Experiment{} } +func (m *ReadGroup_Experiment) String() string { return proto.CompactTextString(m) } +func (*ReadGroup_Experiment) ProtoMessage() {} +func (*ReadGroup_Experiment) Descriptor() ([]byte, []int) { return fileDescriptor7, []int{0, 0} } + +func (m *ReadGroup_Experiment) GetLibraryId() string { + if m != nil { + return m.LibraryId + } + return "" +} + +func (m *ReadGroup_Experiment) GetPlatformUnit() string { + if m != nil { + return m.PlatformUnit + } + return "" +} + +func (m *ReadGroup_Experiment) GetSequencingCenter() string { + if m != nil { + return m.SequencingCenter + } + return "" +} + +func (m *ReadGroup_Experiment) GetInstrumentModel() string { + if m != nil { + return m.InstrumentModel + } + return "" +} + +type ReadGroup_Program struct { + // The command line used to run this program. + CommandLine string `protobuf:"bytes,1,opt,name=command_line,json=commandLine" json:"command_line,omitempty"` + // The user specified locally unique ID of the program. Used along with + // `prevProgramId` to define an ordering between programs. + Id string `protobuf:"bytes,2,opt,name=id" json:"id,omitempty"` + // The display name of the program. This is typically the colloquial name of + // the tool used, for example 'bwa' or 'picard'. + Name string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"` + // The ID of the program run before this one. + PrevProgramId string `protobuf:"bytes,4,opt,name=prev_program_id,json=prevProgramId" json:"prev_program_id,omitempty"` + // The version of the program run. + Version string `protobuf:"bytes,5,opt,name=version" json:"version,omitempty"` +} + +func (m *ReadGroup_Program) Reset() { *m = ReadGroup_Program{} } +func (m *ReadGroup_Program) String() string { return proto.CompactTextString(m) } +func (*ReadGroup_Program) ProtoMessage() {} +func (*ReadGroup_Program) Descriptor() ([]byte, []int) { return fileDescriptor7, []int{0, 1} } + +func (m *ReadGroup_Program) GetCommandLine() string { + if m != nil { + return m.CommandLine + } + return "" +} + +func (m *ReadGroup_Program) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *ReadGroup_Program) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ReadGroup_Program) GetPrevProgramId() string { + if m != nil { + return m.PrevProgramId + } + return "" +} + +func (m *ReadGroup_Program) GetVersion() string { + if m != nil { + return m.Version + } + return "" +} + +func init() { + proto.RegisterType((*ReadGroup)(nil), "google.genomics.v1.ReadGroup") + proto.RegisterType((*ReadGroup_Experiment)(nil), "google.genomics.v1.ReadGroup.Experiment") + proto.RegisterType((*ReadGroup_Program)(nil), "google.genomics.v1.ReadGroup.Program") +} + +func init() { proto.RegisterFile("google/genomics/v1/readgroup.proto", fileDescriptor7) } + +var fileDescriptor7 = []byte{ + // 585 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x54, 0xcb, 0x6e, 0xd4, 0x30, + 0x14, 0x55, 0xa6, 0xcf, 0xb9, 0xd3, 0xc7, 0x60, 0x04, 0x8a, 0x06, 0x90, 0x86, 0x22, 0x60, 0x10, + 0x52, 0x42, 0x87, 0x0d, 0x6a, 0x57, 0x14, 0x55, 0x10, 0xa9, 0x48, 0x55, 0x2a, 0x58, 0xb0, 0x89, + 0xdc, 0xf8, 0x4e, 0x64, 0x91, 0xd8, 0xc1, 0x76, 0x46, 0xb4, 0x9f, 0xc1, 0x57, 0xf0, 0x2d, 0x7c, + 0x11, 0x4b, 0x64, 0xc7, 0x49, 0x47, 0xa2, 0xea, 0xce, 0x39, 0xe7, 0x5c, 0xdf, 0xc7, 0xb9, 0x0e, + 0x1c, 0x14, 0x52, 0x16, 0x25, 0xc6, 0x05, 0x0a, 0x59, 0xf1, 0x5c, 0xc7, 0xcb, 0xc3, 0x58, 0x21, + 0x65, 0x85, 0x92, 0x4d, 0x1d, 0xd5, 0x4a, 0x1a, 0x49, 0x48, 0xab, 0x89, 0x3a, 0x4d, 0xb4, 0x3c, + 0x9c, 0x3c, 0xf6, 0x71, 0xb4, 0xe6, 0x31, 0x15, 0x42, 0x1a, 0x6a, 0xb8, 0x14, 0xba, 0x8d, 0xe8, + 0x59, 0xf7, 0x75, 0xd9, 0x2c, 0x62, 0x6d, 0x54, 0x93, 0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, 0x75, 0x8c, 0xe6, 0x93, 0xce, 0x9c, 0xee, 0x11, 0x45, 0x67, + 0x5c, 0x9b, 0xaf, 0x56, 0x91, 0xb6, 0xc2, 0xa3, 0xc1, 0xbb, 0xe0, 0x84, 0xc3, 0xc3, 0x5c, 0x56, + 0xb7, 0x18, 0x79, 0xb2, 0xd7, 0x3b, 0x79, 0x6e, 0x6f, 0x38, 0x0f, 0xbe, 0x1d, 0x75, 0x2a, 0x59, + 0x52, 0x51, 0x44, 0x52, 0x15, 0xf6, 0xdd, 0xbb, 0xfb, 0xe3, 0x96, 0xa2, 0x35, 0xd7, 0xab, 0xff, + 0x82, 0xe3, 0xee, 0xfc, 0x37, 0x08, 0x2e, 0x37, 0x9d, 0xf2, 0xed, 0xbf, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x37, 0xed, 0xaa, 0xaa, 0x34, 0x04, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/genomics/v1/readgroupset.pb.go b/vendor/google.golang.org/genproto/googleapis/genomics/v1/readgroupset.pb.go new file mode 100644 index 0000000000..9d6234649c --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/genomics/v1/readgroupset.pb.go @@ -0,0 +1,132 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/genomics/v1/readgroupset.proto + +package genomics + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf3 "github.com/golang/protobuf/ptypes/struct" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// A read group set is a logical collection of read groups, which are +// collections of reads produced by a sequencer. A read group set typically +// models reads corresponding to one sample, sequenced one way, and aligned one +// way. +// +// * A read group set belongs to one dataset. +// * A read group belongs to one read group set. +// * A read belongs to one read group. +// +// For more genomics resource definitions, see [Fundamentals of Google +// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +type ReadGroupSet struct { + // The server-generated read group set ID, unique for all read group sets. + Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + // The dataset to which this read group set belongs. + DatasetId string `protobuf:"bytes,2,opt,name=dataset_id,json=datasetId" json:"dataset_id,omitempty"` + // The reference set to which the reads in this read group set are aligned. + ReferenceSetId string `protobuf:"bytes,3,opt,name=reference_set_id,json=referenceSetId" json:"reference_set_id,omitempty"` + // The read group set name. By default this will be initialized to the sample + // name of the sequenced data contained in this set. + Name string `protobuf:"bytes,4,opt,name=name" json:"name,omitempty"` + // The filename of the original source file for this read group set, if any. + Filename string `protobuf:"bytes,5,opt,name=filename" json:"filename,omitempty"` + // The read groups in this set. There are typically 1-10 read groups in a read + // group set. + ReadGroups []*ReadGroup `protobuf:"bytes,6,rep,name=read_groups,json=readGroups" json:"read_groups,omitempty"` + // A map of additional read group set information. + Info map[string]*google_protobuf3.ListValue `protobuf:"bytes,7,rep,name=info" json:"info,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *ReadGroupSet) Reset() { *m = ReadGroupSet{} } +func (m *ReadGroupSet) String() string { return proto.CompactTextString(m) } +func (*ReadGroupSet) ProtoMessage() {} +func (*ReadGroupSet) Descriptor() ([]byte, []int) { return fileDescriptor8, []int{0} } + +func (m *ReadGroupSet) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *ReadGroupSet) GetDatasetId() string { + if m != nil { + return m.DatasetId + } + return "" +} + +func (m *ReadGroupSet) GetReferenceSetId() string { + if m != nil { + return m.ReferenceSetId + } + return "" +} + +func (m *ReadGroupSet) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ReadGroupSet) GetFilename() string { + if m != nil { + return m.Filename + } + return "" +} + +func (m *ReadGroupSet) GetReadGroups() []*ReadGroup { + if m != nil { + return m.ReadGroups + } + return nil +} + +func (m *ReadGroupSet) GetInfo() map[string]*google_protobuf3.ListValue { + if m != nil { + return m.Info + } + return nil +} + +func init() { + proto.RegisterType((*ReadGroupSet)(nil), "google.genomics.v1.ReadGroupSet") +} + +func init() { proto.RegisterFile("google/genomics/v1/readgroupset.proto", fileDescriptor8) } + +var fileDescriptor8 = []byte{ + // 367 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x91, 0x4f, 0x8b, 0xdb, 0x30, + 0x10, 0xc5, 0xb1, 0xf3, 0xa7, 0xcd, 0xa4, 0x84, 0x54, 0x87, 0x62, 0x4c, 0x03, 0x21, 0x50, 0x08, + 0x3d, 0xc8, 0x4d, 0x7a, 0x29, 0x29, 0xe4, 0x10, 0x28, 0x25, 0xb0, 0x87, 0x60, 0xc3, 0x1e, 0xf6, + 0x12, 0x14, 0x7b, 0x6c, 0xc4, 0x3a, 0x92, 0x91, 0xe4, 0x40, 0xbe, 0xf3, 0x7e, 0x80, 0x3d, 0x2e, + 0x96, 0xff, 0x10, 0xd8, 0x25, 0xb7, 0xd1, 0xd3, 0xef, 0x8d, 0x46, 0x6f, 0xe0, 0x47, 0x26, 0x65, + 0x96, 0x63, 0x90, 0xa1, 0x90, 0x67, 0x1e, 0xeb, 0xe0, 0xb2, 0x0a, 0x14, 0xb2, 0x24, 0x53, 0xb2, + 0x2c, 0x34, 0x1a, 0x5a, 0x28, 0x69, 0x24, 0x21, 0x35, 0x46, 0x5b, 0x8c, 0x5e, 0x56, 0xfe, 0xf7, + 0xc6, 0xca, 0x0a, 0x1e, 0x30, 0x21, 0xa4, 0x61, 0x86, 0x4b, 0xa1, 0x6b, 0x87, 0xbf, 0xb8, 0xd7, + 0xb8, 0x61, 0xda, 0x0e, 0xf6, 0x74, 0x2a, 0xd3, 0x40, 0x1b, 0x55, 0xc6, 0xcd, 0x9b, 0x8b, 0x17, + 0x17, 0xbe, 0x84, 0xc8, 0x92, 0xff, 0x95, 0x23, 0x42, 0x43, 0x26, 0xe0, 0xf2, 0xc4, 0x73, 0xe6, +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0x76, 0xfd, 0x7f, 0xdb, 0xfa, 0xd5, 0x71, 0x4e, 0x43, 0x4b, + 0xfe, 0x7e, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x1f, 0xa9, 0x2f, 0xa5, 0x80, 0x02, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/genomics/v1/reads.pb.go b/vendor/google.golang.org/genproto/googleapis/genomics/v1/reads.pb.go new file mode 100644 index 0000000000..4023fd2d2e --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/genomics/v1/reads.pb.go @@ -0,0 +1,1414 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/genomics/v1/reads.proto + +package genomics + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_longrunning "google.golang.org/genproto/googleapis/longrunning" +import google_protobuf1 "github.com/golang/protobuf/ptypes/empty" +import google_protobuf2 "google.golang.org/genproto/protobuf/field_mask" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +type ImportReadGroupSetsRequest_PartitionStrategy int32 + +const ( + ImportReadGroupSetsRequest_PARTITION_STRATEGY_UNSPECIFIED ImportReadGroupSetsRequest_PartitionStrategy = 0 + // In most cases, this strategy yields one read group set per file. This is + // the default behavior. + // + // Allocate one read group set per file per sample. For BAM files, read + // groups are considered to share a sample if they have identical sample + // names. Furthermore, all reads for each file which do not belong to a read + // group, if any, will be grouped into a single read group set per-file. + ImportReadGroupSetsRequest_PER_FILE_PER_SAMPLE ImportReadGroupSetsRequest_PartitionStrategy = 1 + // Includes all read groups in all imported files into a single read group + // set. Requires that the headers for all imported files are equivalent. All + // reads which do not belong to a read group, if any, will be grouped into a + // separate read group set. + ImportReadGroupSetsRequest_MERGE_ALL ImportReadGroupSetsRequest_PartitionStrategy = 2 +) + +var ImportReadGroupSetsRequest_PartitionStrategy_name = map[int32]string{ + 0: "PARTITION_STRATEGY_UNSPECIFIED", + 1: "PER_FILE_PER_SAMPLE", + 2: "MERGE_ALL", +} +var ImportReadGroupSetsRequest_PartitionStrategy_value = map[string]int32{ + "PARTITION_STRATEGY_UNSPECIFIED": 0, + "PER_FILE_PER_SAMPLE": 1, + "MERGE_ALL": 2, +} + +func (x ImportReadGroupSetsRequest_PartitionStrategy) String() string { + return proto.EnumName(ImportReadGroupSetsRequest_PartitionStrategy_name, int32(x)) +} +func (ImportReadGroupSetsRequest_PartitionStrategy) EnumDescriptor() ([]byte, []int) { + return fileDescriptor9, []int{2, 0} +} + +// The read group set search request. +type SearchReadGroupSetsRequest struct { + // Restricts this query to read group sets within the given datasets. At least + // one ID must be provided. + DatasetIds []string `protobuf:"bytes,1,rep,name=dataset_ids,json=datasetIds" json:"dataset_ids,omitempty"` + // Only return read group sets for which a substring of the name matches this + // string. + Name string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"` + // The continuation token, which is used to page through large result sets. + // To get the next page of results, set this parameter to the value of + // `nextPageToken` from the previous response. + PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` + // The maximum number of results to return in a single page. If unspecified, + // defaults to 256. The maximum value is 1024. + PageSize int32 `protobuf:"varint,4,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` +} + +func (m *SearchReadGroupSetsRequest) Reset() { *m = SearchReadGroupSetsRequest{} } +func (m *SearchReadGroupSetsRequest) String() string { return proto.CompactTextString(m) } +func (*SearchReadGroupSetsRequest) ProtoMessage() {} +func (*SearchReadGroupSetsRequest) Descriptor() ([]byte, []int) { return fileDescriptor9, []int{0} } + +func (m *SearchReadGroupSetsRequest) GetDatasetIds() []string { + if m != nil { + return m.DatasetIds + } + return nil +} + +func (m *SearchReadGroupSetsRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *SearchReadGroupSetsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +func (m *SearchReadGroupSetsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +// The read group set search response. +type SearchReadGroupSetsResponse struct { + // The list of matching read group sets. + ReadGroupSets []*ReadGroupSet `protobuf:"bytes,1,rep,name=read_group_sets,json=readGroupSets" json:"read_group_sets,omitempty"` + // The continuation token, which is used to page through large result sets. + // Provide this value in a subsequent request to return the next page of + // results. This field will be empty if there aren't any additional results. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *SearchReadGroupSetsResponse) Reset() { *m = SearchReadGroupSetsResponse{} } +func (m *SearchReadGroupSetsResponse) String() string { return proto.CompactTextString(m) } +func (*SearchReadGroupSetsResponse) ProtoMessage() {} +func (*SearchReadGroupSetsResponse) Descriptor() ([]byte, []int) { return fileDescriptor9, []int{1} } + +func (m *SearchReadGroupSetsResponse) GetReadGroupSets() []*ReadGroupSet { + if m != nil { + return m.ReadGroupSets + } + return nil +} + +func (m *SearchReadGroupSetsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// The read group set import request. +type ImportReadGroupSetsRequest struct { + // Required. The ID of the dataset these read group sets will belong to. The + // caller must have WRITE permissions to this dataset. + DatasetId string `protobuf:"bytes,1,opt,name=dataset_id,json=datasetId" json:"dataset_id,omitempty"` + // The reference set to which the imported read group sets are aligned to, if + // any. The reference names of this reference set must be a superset of those + // found in the imported file headers. If no reference set id is provided, a + // best effort is made to associate with a matching reference set. + ReferenceSetId string `protobuf:"bytes,4,opt,name=reference_set_id,json=referenceSetId" json:"reference_set_id,omitempty"` + // A list of URIs pointing at [BAM + // files](https://samtools.github.io/hts-specs/SAMv1.pdf) + // in Google Cloud Storage. + // Those URIs can include wildcards (*), but do not add or remove + // matching files before import has completed. + // + // Note that Google Cloud Storage object listing is only eventually + // consistent: files added may be not be immediately visible to + // everyone. Thus, if using a wildcard it is preferable not to start + // the import immediately after the files are created. + SourceUris []string `protobuf:"bytes,2,rep,name=source_uris,json=sourceUris" json:"source_uris,omitempty"` + // The partition strategy describes how read groups are partitioned into read + // group sets. + PartitionStrategy ImportReadGroupSetsRequest_PartitionStrategy `protobuf:"varint,5,opt,name=partition_strategy,json=partitionStrategy,enum=google.genomics.v1.ImportReadGroupSetsRequest_PartitionStrategy" json:"partition_strategy,omitempty"` +} + +func (m *ImportReadGroupSetsRequest) Reset() { *m = ImportReadGroupSetsRequest{} } +func (m *ImportReadGroupSetsRequest) String() string { return proto.CompactTextString(m) } +func (*ImportReadGroupSetsRequest) ProtoMessage() {} +func (*ImportReadGroupSetsRequest) Descriptor() ([]byte, []int) { return fileDescriptor9, []int{2} } + +func (m *ImportReadGroupSetsRequest) GetDatasetId() string { + if m != nil { + return m.DatasetId + } + return "" +} + +func (m *ImportReadGroupSetsRequest) GetReferenceSetId() string { + if m != nil { + return m.ReferenceSetId + } + return "" +} + +func (m *ImportReadGroupSetsRequest) GetSourceUris() []string { + if m != nil { + return m.SourceUris + } + return nil +} + +func (m *ImportReadGroupSetsRequest) GetPartitionStrategy() ImportReadGroupSetsRequest_PartitionStrategy { + if m != nil { + return m.PartitionStrategy + } + return ImportReadGroupSetsRequest_PARTITION_STRATEGY_UNSPECIFIED +} + +// The read group set import response. +type ImportReadGroupSetsResponse struct { + // IDs of the read group sets that were created. + ReadGroupSetIds []string `protobuf:"bytes,1,rep,name=read_group_set_ids,json=readGroupSetIds" json:"read_group_set_ids,omitempty"` +} + +func (m *ImportReadGroupSetsResponse) Reset() { *m = ImportReadGroupSetsResponse{} } +func (m *ImportReadGroupSetsResponse) String() string { return proto.CompactTextString(m) } +func (*ImportReadGroupSetsResponse) ProtoMessage() {} +func (*ImportReadGroupSetsResponse) Descriptor() ([]byte, []int) { return fileDescriptor9, []int{3} } + +func (m *ImportReadGroupSetsResponse) GetReadGroupSetIds() []string { + if m != nil { + return m.ReadGroupSetIds + } + return nil +} + +// The read group set export request. +type ExportReadGroupSetRequest struct { + // Required. The Google Cloud project ID that owns this + // export. The caller must have WRITE access to this project. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // Required. A Google Cloud Storage URI for the exported BAM file. + // The currently authenticated user must have write access to the new file. + // An error will be returned if the URI already contains data. + ExportUri string `protobuf:"bytes,2,opt,name=export_uri,json=exportUri" json:"export_uri,omitempty"` + // Required. The ID of the read group set to export. The caller must have + // READ access to this read group set. + ReadGroupSetId string `protobuf:"bytes,3,opt,name=read_group_set_id,json=readGroupSetId" json:"read_group_set_id,omitempty"` + // The reference names to export. If this is not specified, all reference + // sequences, including unmapped reads, are exported. + // Use `*` to export only unmapped reads. + ReferenceNames []string `protobuf:"bytes,4,rep,name=reference_names,json=referenceNames" json:"reference_names,omitempty"` +} + +func (m *ExportReadGroupSetRequest) Reset() { *m = ExportReadGroupSetRequest{} } +func (m *ExportReadGroupSetRequest) String() string { return proto.CompactTextString(m) } +func (*ExportReadGroupSetRequest) ProtoMessage() {} +func (*ExportReadGroupSetRequest) Descriptor() ([]byte, []int) { return fileDescriptor9, []int{4} } + +func (m *ExportReadGroupSetRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *ExportReadGroupSetRequest) GetExportUri() string { + if m != nil { + return m.ExportUri + } + return "" +} + +func (m *ExportReadGroupSetRequest) GetReadGroupSetId() string { + if m != nil { + return m.ReadGroupSetId + } + return "" +} + +func (m *ExportReadGroupSetRequest) GetReferenceNames() []string { + if m != nil { + return m.ReferenceNames + } + return nil +} + +type UpdateReadGroupSetRequest struct { + // The ID of the read group set to be updated. The caller must have WRITE + // permissions to the dataset associated with this read group set. + ReadGroupSetId string `protobuf:"bytes,1,opt,name=read_group_set_id,json=readGroupSetId" json:"read_group_set_id,omitempty"` + // The new read group set data. See `updateMask` for details on mutability of + // fields. + ReadGroupSet *ReadGroupSet `protobuf:"bytes,2,opt,name=read_group_set,json=readGroupSet" json:"read_group_set,omitempty"` + // An optional mask specifying which fields to update. Supported fields: + // + // * [name][google.genomics.v1.ReadGroupSet.name]. + // * [referenceSetId][google.genomics.v1.ReadGroupSet.reference_set_id]. + // + // Leaving `updateMask` unset is equivalent to specifying all mutable + // fields. + UpdateMask *google_protobuf2.FieldMask `protobuf:"bytes,3,opt,name=update_mask,json=updateMask" json:"update_mask,omitempty"` +} + +func (m *UpdateReadGroupSetRequest) Reset() { *m = UpdateReadGroupSetRequest{} } +func (m *UpdateReadGroupSetRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateReadGroupSetRequest) ProtoMessage() {} +func (*UpdateReadGroupSetRequest) Descriptor() ([]byte, []int) { return fileDescriptor9, []int{5} } + +func (m *UpdateReadGroupSetRequest) GetReadGroupSetId() string { + if m != nil { + return m.ReadGroupSetId + } + return "" +} + +func (m *UpdateReadGroupSetRequest) GetReadGroupSet() *ReadGroupSet { + if m != nil { + return m.ReadGroupSet + } + return nil +} + +func (m *UpdateReadGroupSetRequest) GetUpdateMask() *google_protobuf2.FieldMask { + if m != nil { + return m.UpdateMask + } + return nil +} + +type DeleteReadGroupSetRequest struct { + // The ID of the read group set to be deleted. The caller must have WRITE + // permissions to the dataset associated with this read group set. + ReadGroupSetId string `protobuf:"bytes,1,opt,name=read_group_set_id,json=readGroupSetId" json:"read_group_set_id,omitempty"` +} + +func (m *DeleteReadGroupSetRequest) Reset() { *m = DeleteReadGroupSetRequest{} } +func (m *DeleteReadGroupSetRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteReadGroupSetRequest) ProtoMessage() {} +func (*DeleteReadGroupSetRequest) Descriptor() ([]byte, []int) { return fileDescriptor9, []int{6} } + +func (m *DeleteReadGroupSetRequest) GetReadGroupSetId() string { + if m != nil { + return m.ReadGroupSetId + } + return "" +} + +type GetReadGroupSetRequest struct { + // The ID of the read group set. + ReadGroupSetId string `protobuf:"bytes,1,opt,name=read_group_set_id,json=readGroupSetId" json:"read_group_set_id,omitempty"` +} + +func (m *GetReadGroupSetRequest) Reset() { *m = GetReadGroupSetRequest{} } +func (m *GetReadGroupSetRequest) String() string { return proto.CompactTextString(m) } +func (*GetReadGroupSetRequest) ProtoMessage() {} +func (*GetReadGroupSetRequest) Descriptor() ([]byte, []int) { return fileDescriptor9, []int{7} } + +func (m *GetReadGroupSetRequest) GetReadGroupSetId() string { + if m != nil { + return m.ReadGroupSetId + } + return "" +} + +type ListCoverageBucketsRequest struct { + // Required. The ID of the read group set over which coverage is requested. + ReadGroupSetId string `protobuf:"bytes,1,opt,name=read_group_set_id,json=readGroupSetId" json:"read_group_set_id,omitempty"` + // The name of the reference to query, within the reference set associated + // with this query. Optional. + ReferenceName string `protobuf:"bytes,3,opt,name=reference_name,json=referenceName" json:"reference_name,omitempty"` + // The start position of the range on the reference, 0-based inclusive. If + // specified, `referenceName` must also be specified. Defaults to 0. + Start int64 `protobuf:"varint,4,opt,name=start" json:"start,omitempty"` + // The end position of the range on the reference, 0-based exclusive. If + // specified, `referenceName` must also be specified. If unset or 0, defaults + // to the length of the reference. + End int64 `protobuf:"varint,5,opt,name=end" json:"end,omitempty"` + // The desired width of each reported coverage bucket in base pairs. This + // will be rounded down to the nearest precomputed bucket width; the value + // of which is returned as `bucketWidth` in the response. Defaults + // to infinity (each bucket spans an entire reference sequence) or the length + // of the target range, if specified. The smallest precomputed + // `bucketWidth` is currently 2048 base pairs; this is subject to + // change. + TargetBucketWidth int64 `protobuf:"varint,6,opt,name=target_bucket_width,json=targetBucketWidth" json:"target_bucket_width,omitempty"` + // The continuation token, which is used to page through large result sets. + // To get the next page of results, set this parameter to the value of + // `nextPageToken` from the previous response. + PageToken string `protobuf:"bytes,7,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` + // The maximum number of results to return in a single page. If unspecified, + // defaults to 1024. The maximum value is 2048. + PageSize int32 `protobuf:"varint,8,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` +} + +func (m *ListCoverageBucketsRequest) Reset() { *m = ListCoverageBucketsRequest{} } +func (m *ListCoverageBucketsRequest) String() string { return proto.CompactTextString(m) } +func (*ListCoverageBucketsRequest) ProtoMessage() {} +func (*ListCoverageBucketsRequest) Descriptor() ([]byte, []int) { return fileDescriptor9, []int{8} } + +func (m *ListCoverageBucketsRequest) GetReadGroupSetId() string { + if m != nil { + return m.ReadGroupSetId + } + return "" +} + +func (m *ListCoverageBucketsRequest) GetReferenceName() string { + if m != nil { + return m.ReferenceName + } + return "" +} + +func (m *ListCoverageBucketsRequest) GetStart() int64 { + if m != nil { + return m.Start + } + return 0 +} + +func (m *ListCoverageBucketsRequest) GetEnd() int64 { + if m != nil { + return m.End + } + return 0 +} + +func (m *ListCoverageBucketsRequest) GetTargetBucketWidth() int64 { + if m != nil { + return m.TargetBucketWidth + } + return 0 +} + +func (m *ListCoverageBucketsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +func (m *ListCoverageBucketsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +// A bucket over which read coverage has been precomputed. A bucket corresponds +// to a specific range of the reference sequence. +type CoverageBucket struct { + // The genomic coordinate range spanned by this bucket. + Range *Range `protobuf:"bytes,1,opt,name=range" json:"range,omitempty"` + // The average number of reads which are aligned to each individual + // reference base in this bucket. + MeanCoverage float32 `protobuf:"fixed32,2,opt,name=mean_coverage,json=meanCoverage" json:"mean_coverage,omitempty"` +} + +func (m *CoverageBucket) Reset() { *m = CoverageBucket{} } +func (m *CoverageBucket) String() string { return proto.CompactTextString(m) } +func (*CoverageBucket) ProtoMessage() {} +func (*CoverageBucket) Descriptor() ([]byte, []int) { return fileDescriptor9, []int{9} } + +func (m *CoverageBucket) GetRange() *Range { + if m != nil { + return m.Range + } + return nil +} + +func (m *CoverageBucket) GetMeanCoverage() float32 { + if m != nil { + return m.MeanCoverage + } + return 0 +} + +type ListCoverageBucketsResponse struct { + // The length of each coverage bucket in base pairs. Note that buckets at the + // end of a reference sequence may be shorter. This value is omitted if the + // bucket width is infinity (the default behaviour, with no range or + // `targetBucketWidth`). + BucketWidth int64 `protobuf:"varint,1,opt,name=bucket_width,json=bucketWidth" json:"bucket_width,omitempty"` + // The coverage buckets. The list of buckets is sparse; a bucket with 0 + // overlapping reads is not returned. A bucket never crosses more than one + // reference sequence. Each bucket has width `bucketWidth`, unless + // its end is the end of the reference sequence. + CoverageBuckets []*CoverageBucket `protobuf:"bytes,2,rep,name=coverage_buckets,json=coverageBuckets" json:"coverage_buckets,omitempty"` + // The continuation token, which is used to page through large result sets. + // Provide this value in a subsequent request to return the next page of + // results. This field will be empty if there aren't any additional results. + NextPageToken string `protobuf:"bytes,3,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListCoverageBucketsResponse) Reset() { *m = ListCoverageBucketsResponse{} } +func (m *ListCoverageBucketsResponse) String() string { return proto.CompactTextString(m) } +func (*ListCoverageBucketsResponse) ProtoMessage() {} +func (*ListCoverageBucketsResponse) Descriptor() ([]byte, []int) { return fileDescriptor9, []int{10} } + +func (m *ListCoverageBucketsResponse) GetBucketWidth() int64 { + if m != nil { + return m.BucketWidth + } + return 0 +} + +func (m *ListCoverageBucketsResponse) GetCoverageBuckets() []*CoverageBucket { + if m != nil { + return m.CoverageBuckets + } + return nil +} + +func (m *ListCoverageBucketsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// The read search request. +type SearchReadsRequest struct { + // The IDs of the read groups sets within which to search for reads. All + // specified read group sets must be aligned against a common set of reference + // sequences; this defines the genomic coordinates for the query. Must specify + // one of `readGroupSetIds` or `readGroupIds`. + ReadGroupSetIds []string `protobuf:"bytes,1,rep,name=read_group_set_ids,json=readGroupSetIds" json:"read_group_set_ids,omitempty"` + // The IDs of the read groups within which to search for reads. All specified + // read groups must belong to the same read group sets. Must specify one of + // `readGroupSetIds` or `readGroupIds`. + ReadGroupIds []string `protobuf:"bytes,5,rep,name=read_group_ids,json=readGroupIds" json:"read_group_ids,omitempty"` + // The reference sequence name, for example `chr1`, `1`, or `chrX`. If set to + // `*`, only unmapped reads are returned. If unspecified, all reads (mapped + // and unmapped) are returned. + ReferenceName string `protobuf:"bytes,7,opt,name=reference_name,json=referenceName" json:"reference_name,omitempty"` + // The start position of the range on the reference, 0-based inclusive. If + // specified, `referenceName` must also be specified. + Start int64 `protobuf:"varint,8,opt,name=start" json:"start,omitempty"` + // The end position of the range on the reference, 0-based exclusive. If + // specified, `referenceName` must also be specified. + End int64 `protobuf:"varint,9,opt,name=end" json:"end,omitempty"` + // The continuation token, which is used to page through large result sets. + // To get the next page of results, set this parameter to the value of + // `nextPageToken` from the previous response. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` + // The maximum number of results to return in a single page. If unspecified, + // defaults to 256. The maximum value is 2048. + PageSize int32 `protobuf:"varint,4,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` +} + +func (m *SearchReadsRequest) Reset() { *m = SearchReadsRequest{} } +func (m *SearchReadsRequest) String() string { return proto.CompactTextString(m) } +func (*SearchReadsRequest) ProtoMessage() {} +func (*SearchReadsRequest) Descriptor() ([]byte, []int) { return fileDescriptor9, []int{11} } + +func (m *SearchReadsRequest) GetReadGroupSetIds() []string { + if m != nil { + return m.ReadGroupSetIds + } + return nil +} + +func (m *SearchReadsRequest) GetReadGroupIds() []string { + if m != nil { + return m.ReadGroupIds + } + return nil +} + +func (m *SearchReadsRequest) GetReferenceName() string { + if m != nil { + return m.ReferenceName + } + return "" +} + +func (m *SearchReadsRequest) GetStart() int64 { + if m != nil { + return m.Start + } + return 0 +} + +func (m *SearchReadsRequest) GetEnd() int64 { + if m != nil { + return m.End + } + return 0 +} + +func (m *SearchReadsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +func (m *SearchReadsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +// The read search response. +type SearchReadsResponse struct { + // The list of matching alignments sorted by mapped genomic coordinate, + // if any, ascending in position within the same reference. Unmapped reads, + // which have no position, are returned contiguously and are sorted in + // ascending lexicographic order by fragment name. + Alignments []*Read `protobuf:"bytes,1,rep,name=alignments" json:"alignments,omitempty"` + // The continuation token, which is used to page through large result sets. + // Provide this value in a subsequent request to return the next page of + // results. This field will be empty if there aren't any additional results. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *SearchReadsResponse) Reset() { *m = SearchReadsResponse{} } +func (m *SearchReadsResponse) String() string { return proto.CompactTextString(m) } +func (*SearchReadsResponse) ProtoMessage() {} +func (*SearchReadsResponse) Descriptor() ([]byte, []int) { return fileDescriptor9, []int{12} } + +func (m *SearchReadsResponse) GetAlignments() []*Read { + if m != nil { + return m.Alignments + } + return nil +} + +func (m *SearchReadsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// The stream reads request. +type StreamReadsRequest struct { + // The Google Cloud project ID which will be billed + // for this access. The caller must have WRITE access to this project. + // Required. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The ID of the read group set from which to stream reads. + ReadGroupSetId string `protobuf:"bytes,2,opt,name=read_group_set_id,json=readGroupSetId" json:"read_group_set_id,omitempty"` + // The reference sequence name, for example `chr1`, + // `1`, or `chrX`. If set to *, only unmapped reads are + // returned. + ReferenceName string `protobuf:"bytes,3,opt,name=reference_name,json=referenceName" json:"reference_name,omitempty"` + // The start position of the range on the reference, 0-based inclusive. If + // specified, `referenceName` must also be specified. + Start int64 `protobuf:"varint,4,opt,name=start" json:"start,omitempty"` + // The end position of the range on the reference, 0-based exclusive. If + // specified, `referenceName` must also be specified. + End int64 `protobuf:"varint,5,opt,name=end" json:"end,omitempty"` + // Restricts results to a shard containing approximately `1/totalShards` + // of the normal response payload for this query. Results from a sharded + // request are disjoint from those returned by all queries which differ only + // in their shard parameter. A shard may yield 0 results; this is especially + // likely for large values of `totalShards`. + // + // Valid values are `[0, totalShards)`. + Shard int32 `protobuf:"varint,6,opt,name=shard" json:"shard,omitempty"` + // Specifying `totalShards` causes a disjoint subset of the normal response + // payload to be returned for each query with a unique `shard` parameter + // specified. A best effort is made to yield equally sized shards. Sharding + // can be used to distribute processing amongst workers, where each worker is + // assigned a unique `shard` number and all workers specify the same + // `totalShards` number. The union of reads returned for all sharded queries + // `[0, totalShards)` is equal to those returned by a single unsharded query. + // + // Queries for different values of `totalShards` with common divisors will + // share shard boundaries. For example, streaming `shard` 2 of 5 + // `totalShards` yields the same results as streaming `shard`s 4 and 5 of 10 + // `totalShards`. This property can be leveraged for adaptive retries. + TotalShards int32 `protobuf:"varint,7,opt,name=total_shards,json=totalShards" json:"total_shards,omitempty"` +} + +func (m *StreamReadsRequest) Reset() { *m = StreamReadsRequest{} } +func (m *StreamReadsRequest) String() string { return proto.CompactTextString(m) } +func (*StreamReadsRequest) ProtoMessage() {} +func (*StreamReadsRequest) Descriptor() ([]byte, []int) { return fileDescriptor9, []int{13} } + +func (m *StreamReadsRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *StreamReadsRequest) GetReadGroupSetId() string { + if m != nil { + return m.ReadGroupSetId + } + return "" +} + +func (m *StreamReadsRequest) GetReferenceName() string { + if m != nil { + return m.ReferenceName + } + return "" +} + +func (m *StreamReadsRequest) GetStart() int64 { + if m != nil { + return m.Start + } + return 0 +} + +func (m *StreamReadsRequest) GetEnd() int64 { + if m != nil { + return m.End + } + return 0 +} + +func (m *StreamReadsRequest) GetShard() int32 { + if m != nil { + return m.Shard + } + return 0 +} + +func (m *StreamReadsRequest) GetTotalShards() int32 { + if m != nil { + return m.TotalShards + } + return 0 +} + +type StreamReadsResponse struct { + Alignments []*Read `protobuf:"bytes,1,rep,name=alignments" json:"alignments,omitempty"` +} + +func (m *StreamReadsResponse) Reset() { *m = StreamReadsResponse{} } +func (m *StreamReadsResponse) String() string { return proto.CompactTextString(m) } +func (*StreamReadsResponse) ProtoMessage() {} +func (*StreamReadsResponse) Descriptor() ([]byte, []int) { return fileDescriptor9, []int{14} } + +func (m *StreamReadsResponse) GetAlignments() []*Read { + if m != nil { + return m.Alignments + } + return nil +} + +func init() { + proto.RegisterType((*SearchReadGroupSetsRequest)(nil), "google.genomics.v1.SearchReadGroupSetsRequest") + proto.RegisterType((*SearchReadGroupSetsResponse)(nil), "google.genomics.v1.SearchReadGroupSetsResponse") + proto.RegisterType((*ImportReadGroupSetsRequest)(nil), "google.genomics.v1.ImportReadGroupSetsRequest") + proto.RegisterType((*ImportReadGroupSetsResponse)(nil), "google.genomics.v1.ImportReadGroupSetsResponse") + proto.RegisterType((*ExportReadGroupSetRequest)(nil), "google.genomics.v1.ExportReadGroupSetRequest") + proto.RegisterType((*UpdateReadGroupSetRequest)(nil), "google.genomics.v1.UpdateReadGroupSetRequest") + proto.RegisterType((*DeleteReadGroupSetRequest)(nil), "google.genomics.v1.DeleteReadGroupSetRequest") + proto.RegisterType((*GetReadGroupSetRequest)(nil), "google.genomics.v1.GetReadGroupSetRequest") + proto.RegisterType((*ListCoverageBucketsRequest)(nil), "google.genomics.v1.ListCoverageBucketsRequest") + proto.RegisterType((*CoverageBucket)(nil), "google.genomics.v1.CoverageBucket") + proto.RegisterType((*ListCoverageBucketsResponse)(nil), "google.genomics.v1.ListCoverageBucketsResponse") + proto.RegisterType((*SearchReadsRequest)(nil), "google.genomics.v1.SearchReadsRequest") + proto.RegisterType((*SearchReadsResponse)(nil), "google.genomics.v1.SearchReadsResponse") + proto.RegisterType((*StreamReadsRequest)(nil), "google.genomics.v1.StreamReadsRequest") + proto.RegisterType((*StreamReadsResponse)(nil), "google.genomics.v1.StreamReadsResponse") + proto.RegisterEnum("google.genomics.v1.ImportReadGroupSetsRequest_PartitionStrategy", ImportReadGroupSetsRequest_PartitionStrategy_name, ImportReadGroupSetsRequest_PartitionStrategy_value) +} + +// 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 + +// Client API for StreamingReadService service + +type StreamingReadServiceClient interface { + // Returns a stream of all the reads matching the search request, ordered + // by reference name, position, and ID. + StreamReads(ctx context.Context, in *StreamReadsRequest, opts ...grpc.CallOption) (StreamingReadService_StreamReadsClient, error) +} + +type streamingReadServiceClient struct { + cc *grpc.ClientConn +} + +func NewStreamingReadServiceClient(cc *grpc.ClientConn) StreamingReadServiceClient { + return &streamingReadServiceClient{cc} +} + +func (c *streamingReadServiceClient) StreamReads(ctx context.Context, in *StreamReadsRequest, opts ...grpc.CallOption) (StreamingReadService_StreamReadsClient, error) { + stream, err := grpc.NewClientStream(ctx, &_StreamingReadService_serviceDesc.Streams[0], c.cc, "/google.genomics.v1.StreamingReadService/StreamReads", opts...) + if err != nil { + return nil, err + } + x := &streamingReadServiceStreamReadsClient{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 StreamingReadService_StreamReadsClient interface { + Recv() (*StreamReadsResponse, error) + grpc.ClientStream +} + +type streamingReadServiceStreamReadsClient struct { + grpc.ClientStream +} + +func (x *streamingReadServiceStreamReadsClient) Recv() (*StreamReadsResponse, error) { + m := new(StreamReadsResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// Server API for StreamingReadService service + +type StreamingReadServiceServer interface { + // Returns a stream of all the reads matching the search request, ordered + // by reference name, position, and ID. + StreamReads(*StreamReadsRequest, StreamingReadService_StreamReadsServer) error +} + +func RegisterStreamingReadServiceServer(s *grpc.Server, srv StreamingReadServiceServer) { + s.RegisterService(&_StreamingReadService_serviceDesc, srv) +} + +func _StreamingReadService_StreamReads_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(StreamReadsRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(StreamingReadServiceServer).StreamReads(m, &streamingReadServiceStreamReadsServer{stream}) +} + +type StreamingReadService_StreamReadsServer interface { + Send(*StreamReadsResponse) error + grpc.ServerStream +} + +type streamingReadServiceStreamReadsServer struct { + grpc.ServerStream +} + +func (x *streamingReadServiceStreamReadsServer) Send(m *StreamReadsResponse) error { + return x.ServerStream.SendMsg(m) +} + +var _StreamingReadService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.genomics.v1.StreamingReadService", + HandlerType: (*StreamingReadServiceServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "StreamReads", + Handler: _StreamingReadService_StreamReads_Handler, + ServerStreams: true, + }, + }, + Metadata: "google/genomics/v1/reads.proto", +} + +// Client API for ReadServiceV1 service + +type ReadServiceV1Client interface { + // Creates read group sets by asynchronously importing the provided + // information. + // + // For the definitions of read group sets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // The caller must have WRITE permissions to the dataset. + // + // ## Notes on [BAM](https://samtools.github.io/hts-specs/SAMv1.pdf) import + // + // - Tags will be converted to strings - tag types are not preserved + // - Comments (`@CO`) in the input file header will not be preserved + // - Original header order of references (`@SQ`) will not be preserved + // - Any reverse stranded unmapped reads will be reverse complemented, and + // their qualities (also the "BQ" and "OQ" tags, if any) will be reversed + // - Unmapped reads will be stripped of positional information (reference name + // and position) + ImportReadGroupSets(ctx context.Context, in *ImportReadGroupSetsRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Exports a read group set to a BAM file in Google Cloud Storage. + // + // For the definitions of read group sets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // Note that currently there may be some differences between exported BAM + // files and the original BAM file at the time of import. See + // [ImportReadGroupSets][google.genomics.v1.ReadServiceV1.ImportReadGroupSets] + // for caveats. + ExportReadGroupSet(ctx context.Context, in *ExportReadGroupSetRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Searches for read group sets matching the criteria. + // + // For the definitions of read group sets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // Implements + // [GlobalAllianceApi.searchReadGroupSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/readmethods.avdl#L135). + SearchReadGroupSets(ctx context.Context, in *SearchReadGroupSetsRequest, opts ...grpc.CallOption) (*SearchReadGroupSetsResponse, error) + // Updates a read group set. + // + // For the definitions of read group sets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // This method supports patch semantics. + UpdateReadGroupSet(ctx context.Context, in *UpdateReadGroupSetRequest, opts ...grpc.CallOption) (*ReadGroupSet, error) + // Deletes a read group set. + // + // For the definitions of read group sets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + DeleteReadGroupSet(ctx context.Context, in *DeleteReadGroupSetRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) + // Gets a read group set by ID. + // + // For the definitions of read group sets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + GetReadGroupSet(ctx context.Context, in *GetReadGroupSetRequest, opts ...grpc.CallOption) (*ReadGroupSet, error) + // Lists fixed width coverage buckets for a read group set, each of which + // correspond to a range of a reference sequence. Each bucket summarizes + // coverage information across its corresponding genomic range. + // + // For the definitions of read group sets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // Coverage is defined as the number of reads which are aligned to a given + // base in the reference sequence. Coverage buckets are available at several + // precomputed bucket widths, enabling retrieval of various coverage 'zoom + // levels'. The caller must have READ permissions for the target read group + // set. + ListCoverageBuckets(ctx context.Context, in *ListCoverageBucketsRequest, opts ...grpc.CallOption) (*ListCoverageBucketsResponse, error) + // Gets a list of reads for one or more read group sets. + // + // For the definitions of read group sets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // Reads search operates over a genomic coordinate space of reference sequence + // & position defined over the reference sequences to which the requested + // read group sets are aligned. + // + // If a target positional range is specified, search returns all reads whose + // alignment to the reference genome overlap the range. A query which + // specifies only read group set IDs yields all reads in those read group + // sets, including unmapped reads. + // + // All reads returned (including reads on subsequent pages) are ordered by + // genomic coordinate (by reference sequence, then position). Reads with + // equivalent genomic coordinates are returned in an unspecified order. This + // order is consistent, such that two queries for the same content (regardless + // of page size) yield reads in the same order across their respective streams + // of paginated responses. + // + // Implements + // [GlobalAllianceApi.searchReads](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/readmethods.avdl#L85). + SearchReads(ctx context.Context, in *SearchReadsRequest, opts ...grpc.CallOption) (*SearchReadsResponse, error) +} + +type readServiceV1Client struct { + cc *grpc.ClientConn +} + +func NewReadServiceV1Client(cc *grpc.ClientConn) ReadServiceV1Client { + return &readServiceV1Client{cc} +} + +func (c *readServiceV1Client) ImportReadGroupSets(ctx context.Context, in *ImportReadGroupSetsRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.genomics.v1.ReadServiceV1/ImportReadGroupSets", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *readServiceV1Client) ExportReadGroupSet(ctx context.Context, in *ExportReadGroupSetRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.genomics.v1.ReadServiceV1/ExportReadGroupSet", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *readServiceV1Client) SearchReadGroupSets(ctx context.Context, in *SearchReadGroupSetsRequest, opts ...grpc.CallOption) (*SearchReadGroupSetsResponse, error) { + out := new(SearchReadGroupSetsResponse) + err := grpc.Invoke(ctx, "/google.genomics.v1.ReadServiceV1/SearchReadGroupSets", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *readServiceV1Client) UpdateReadGroupSet(ctx context.Context, in *UpdateReadGroupSetRequest, opts ...grpc.CallOption) (*ReadGroupSet, error) { + out := new(ReadGroupSet) + err := grpc.Invoke(ctx, "/google.genomics.v1.ReadServiceV1/UpdateReadGroupSet", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *readServiceV1Client) DeleteReadGroupSet(ctx context.Context, in *DeleteReadGroupSetRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { + out := new(google_protobuf1.Empty) + err := grpc.Invoke(ctx, "/google.genomics.v1.ReadServiceV1/DeleteReadGroupSet", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *readServiceV1Client) GetReadGroupSet(ctx context.Context, in *GetReadGroupSetRequest, opts ...grpc.CallOption) (*ReadGroupSet, error) { + out := new(ReadGroupSet) + err := grpc.Invoke(ctx, "/google.genomics.v1.ReadServiceV1/GetReadGroupSet", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *readServiceV1Client) ListCoverageBuckets(ctx context.Context, in *ListCoverageBucketsRequest, opts ...grpc.CallOption) (*ListCoverageBucketsResponse, error) { + out := new(ListCoverageBucketsResponse) + err := grpc.Invoke(ctx, "/google.genomics.v1.ReadServiceV1/ListCoverageBuckets", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *readServiceV1Client) SearchReads(ctx context.Context, in *SearchReadsRequest, opts ...grpc.CallOption) (*SearchReadsResponse, error) { + out := new(SearchReadsResponse) + err := grpc.Invoke(ctx, "/google.genomics.v1.ReadServiceV1/SearchReads", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for ReadServiceV1 service + +type ReadServiceV1Server interface { + // Creates read group sets by asynchronously importing the provided + // information. + // + // For the definitions of read group sets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // The caller must have WRITE permissions to the dataset. + // + // ## Notes on [BAM](https://samtools.github.io/hts-specs/SAMv1.pdf) import + // + // - Tags will be converted to strings - tag types are not preserved + // - Comments (`@CO`) in the input file header will not be preserved + // - Original header order of references (`@SQ`) will not be preserved + // - Any reverse stranded unmapped reads will be reverse complemented, and + // their qualities (also the "BQ" and "OQ" tags, if any) will be reversed + // - Unmapped reads will be stripped of positional information (reference name + // and position) + ImportReadGroupSets(context.Context, *ImportReadGroupSetsRequest) (*google_longrunning.Operation, error) + // Exports a read group set to a BAM file in Google Cloud Storage. + // + // For the definitions of read group sets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // Note that currently there may be some differences between exported BAM + // files and the original BAM file at the time of import. See + // [ImportReadGroupSets][google.genomics.v1.ReadServiceV1.ImportReadGroupSets] + // for caveats. + ExportReadGroupSet(context.Context, *ExportReadGroupSetRequest) (*google_longrunning.Operation, error) + // Searches for read group sets matching the criteria. + // + // For the definitions of read group sets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // Implements + // [GlobalAllianceApi.searchReadGroupSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/readmethods.avdl#L135). + SearchReadGroupSets(context.Context, *SearchReadGroupSetsRequest) (*SearchReadGroupSetsResponse, error) + // Updates a read group set. + // + // For the definitions of read group sets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // This method supports patch semantics. + UpdateReadGroupSet(context.Context, *UpdateReadGroupSetRequest) (*ReadGroupSet, error) + // Deletes a read group set. + // + // For the definitions of read group sets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + DeleteReadGroupSet(context.Context, *DeleteReadGroupSetRequest) (*google_protobuf1.Empty, error) + // Gets a read group set by ID. + // + // For the definitions of read group sets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + GetReadGroupSet(context.Context, *GetReadGroupSetRequest) (*ReadGroupSet, error) + // Lists fixed width coverage buckets for a read group set, each of which + // correspond to a range of a reference sequence. Each bucket summarizes + // coverage information across its corresponding genomic range. + // + // For the definitions of read group sets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // Coverage is defined as the number of reads which are aligned to a given + // base in the reference sequence. Coverage buckets are available at several + // precomputed bucket widths, enabling retrieval of various coverage 'zoom + // levels'. The caller must have READ permissions for the target read group + // set. + ListCoverageBuckets(context.Context, *ListCoverageBucketsRequest) (*ListCoverageBucketsResponse, error) + // Gets a list of reads for one or more read group sets. + // + // For the definitions of read group sets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // Reads search operates over a genomic coordinate space of reference sequence + // & position defined over the reference sequences to which the requested + // read group sets are aligned. + // + // If a target positional range is specified, search returns all reads whose + // alignment to the reference genome overlap the range. A query which + // specifies only read group set IDs yields all reads in those read group + // sets, including unmapped reads. + // + // All reads returned (including reads on subsequent pages) are ordered by + // genomic coordinate (by reference sequence, then position). Reads with + // equivalent genomic coordinates are returned in an unspecified order. This + // order is consistent, such that two queries for the same content (regardless + // of page size) yield reads in the same order across their respective streams + // of paginated responses. + // + // Implements + // [GlobalAllianceApi.searchReads](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/readmethods.avdl#L85). + SearchReads(context.Context, *SearchReadsRequest) (*SearchReadsResponse, error) +} + +func RegisterReadServiceV1Server(s *grpc.Server, srv ReadServiceV1Server) { + s.RegisterService(&_ReadServiceV1_serviceDesc, srv) +} + +func _ReadServiceV1_ImportReadGroupSets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ImportReadGroupSetsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReadServiceV1Server).ImportReadGroupSets(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.ReadServiceV1/ImportReadGroupSets", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReadServiceV1Server).ImportReadGroupSets(ctx, req.(*ImportReadGroupSetsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ReadServiceV1_ExportReadGroupSet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ExportReadGroupSetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReadServiceV1Server).ExportReadGroupSet(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.ReadServiceV1/ExportReadGroupSet", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReadServiceV1Server).ExportReadGroupSet(ctx, req.(*ExportReadGroupSetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ReadServiceV1_SearchReadGroupSets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SearchReadGroupSetsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReadServiceV1Server).SearchReadGroupSets(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.ReadServiceV1/SearchReadGroupSets", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReadServiceV1Server).SearchReadGroupSets(ctx, req.(*SearchReadGroupSetsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ReadServiceV1_UpdateReadGroupSet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateReadGroupSetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReadServiceV1Server).UpdateReadGroupSet(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.ReadServiceV1/UpdateReadGroupSet", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReadServiceV1Server).UpdateReadGroupSet(ctx, req.(*UpdateReadGroupSetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ReadServiceV1_DeleteReadGroupSet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteReadGroupSetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReadServiceV1Server).DeleteReadGroupSet(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.ReadServiceV1/DeleteReadGroupSet", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReadServiceV1Server).DeleteReadGroupSet(ctx, req.(*DeleteReadGroupSetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ReadServiceV1_GetReadGroupSet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetReadGroupSetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReadServiceV1Server).GetReadGroupSet(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.ReadServiceV1/GetReadGroupSet", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReadServiceV1Server).GetReadGroupSet(ctx, req.(*GetReadGroupSetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ReadServiceV1_ListCoverageBuckets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListCoverageBucketsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReadServiceV1Server).ListCoverageBuckets(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.ReadServiceV1/ListCoverageBuckets", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReadServiceV1Server).ListCoverageBuckets(ctx, req.(*ListCoverageBucketsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ReadServiceV1_SearchReads_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SearchReadsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReadServiceV1Server).SearchReads(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.ReadServiceV1/SearchReads", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReadServiceV1Server).SearchReads(ctx, req.(*SearchReadsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _ReadServiceV1_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.genomics.v1.ReadServiceV1", + HandlerType: (*ReadServiceV1Server)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ImportReadGroupSets", + Handler: _ReadServiceV1_ImportReadGroupSets_Handler, + }, + { + MethodName: "ExportReadGroupSet", + Handler: _ReadServiceV1_ExportReadGroupSet_Handler, + }, + { + MethodName: "SearchReadGroupSets", + Handler: _ReadServiceV1_SearchReadGroupSets_Handler, + }, + { + MethodName: "UpdateReadGroupSet", + Handler: _ReadServiceV1_UpdateReadGroupSet_Handler, + }, + { + MethodName: "DeleteReadGroupSet", + Handler: _ReadServiceV1_DeleteReadGroupSet_Handler, + }, + { + MethodName: "GetReadGroupSet", + Handler: _ReadServiceV1_GetReadGroupSet_Handler, + }, + { + MethodName: "ListCoverageBuckets", + Handler: _ReadServiceV1_ListCoverageBuckets_Handler, + }, + { + MethodName: "SearchReads", + Handler: _ReadServiceV1_SearchReads_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/genomics/v1/reads.proto", +} + +func init() { proto.RegisterFile("google/genomics/v1/reads.proto", fileDescriptor9) } + +var fileDescriptor9 = []byte{ + // 1333 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0xcf, 0x6f, 0x1b, 0xc5, + 0x17, 0xff, 0x8e, 0x1d, 0xb7, 0xcd, 0x73, 0x93, 0x38, 0xe3, 0x7e, 0x8b, 0xe3, 0x90, 0x36, 0x6c, + 0x69, 0x1b, 0x02, 0xb5, 0x89, 0x11, 0x2a, 0x4a, 0x85, 0x44, 0xda, 0x3a, 0xc1, 0x28, 0x69, 0xad, + 0x75, 0x02, 0x82, 0xcb, 0x6a, 0x62, 0x4f, 0xb6, 0x4b, 0xec, 0xdd, 0x65, 0x66, 0x9c, 0xfe, 0x52, + 0x2f, 0xbd, 0x81, 0x04, 0x1c, 0x10, 0x27, 0xae, 0x5c, 0x39, 0x22, 0xfe, 0x08, 0x4e, 0x88, 0x0b, + 0x7f, 0x00, 0xe2, 0x0f, 0xe0, 0xc4, 0x11, 0xcd, 0xec, 0x6e, 0xbc, 0xeb, 0x9d, 0x6d, 0x1c, 0x55, + 0xe2, 0xb6, 0xfb, 0xe6, 0xb3, 0x6f, 0x3e, 0xef, 0xf7, 0x5b, 0xb8, 0x64, 0x7b, 0x9e, 0xdd, 0xa7, + 0x75, 0x9b, 0xba, 0xde, 0xc0, 0xe9, 0xf2, 0xfa, 0xd1, 0x5a, 0x9d, 0x51, 0xd2, 0xe3, 0x35, 0x9f, + 0x79, 0xc2, 0xc3, 0x38, 0x38, 0xaf, 0x45, 0xe7, 0xb5, 0xa3, 0xb5, 0xea, 0xab, 0xe1, 0x37, 0xc4, + 0x77, 0xea, 0xc4, 0x75, 0x3d, 0x41, 0x84, 0xe3, 0xb9, 0xe1, 0x17, 0x55, 0xad, 0x46, 0xe2, 0xda, + 0x34, 0x3c, 0xbf, 0x96, 0x71, 0x23, 0xe9, 0x3b, 0xb6, 0x3b, 0xa0, 0xae, 0x08, 0x71, 0x57, 0x33, + 0x70, 0x36, 0xf3, 0x86, 0x3e, 0xa7, 0x11, 0xec, 0x4a, 0x08, 0xeb, 0x7b, 0xae, 0xcd, 0x86, 0xae, + 0xeb, 0xb8, 0x76, 0xdd, 0xf3, 0x29, 0x4b, 0x70, 0x5a, 0x0c, 0x41, 0xea, 0x6d, 0x7f, 0x78, 0x50, + 0xa7, 0x03, 0x5f, 0x3c, 0x0e, 0x0f, 0x97, 0xc7, 0x0f, 0x0f, 0x1c, 0xda, 0xef, 0x59, 0x03, 0xc2, + 0x0f, 0x03, 0x84, 0xf1, 0x35, 0x82, 0x6a, 0x87, 0x12, 0xd6, 0x7d, 0x60, 0x52, 0xd2, 0xdb, 0x92, + 0x04, 0x3a, 0x54, 0x70, 0x93, 0x7e, 0x31, 0xa4, 0x5c, 0xe0, 0xcb, 0x50, 0xec, 0x11, 0x41, 0x38, + 0x15, 0x96, 0xd3, 0xe3, 0x15, 0xb4, 0x9c, 0x5f, 0x99, 0x36, 0x21, 0x14, 0xb5, 0x7a, 0x1c, 0x63, + 0x98, 0x72, 0xc9, 0x80, 0x56, 0xf2, 0xcb, 0x68, 0x65, 0xda, 0x54, 0xcf, 0x78, 0x09, 0xc0, 0x27, + 0x36, 0xb5, 0x84, 0x77, 0x48, 0xdd, 0x4a, 0x4e, 0x9d, 0x4c, 0x4b, 0xc9, 0xae, 0x14, 0xe0, 0x45, + 0x50, 0x2f, 0x16, 0x77, 0x9e, 0xd0, 0xca, 0xd4, 0x32, 0x5a, 0x29, 0x98, 0xe7, 0xa4, 0xa0, 0xe3, + 0x3c, 0xa1, 0xc6, 0xb7, 0x08, 0x16, 0xb5, 0x7c, 0xb8, 0xef, 0xb9, 0x9c, 0xe2, 0x0f, 0x61, 0x4e, + 0x7a, 0xca, 0x52, 0xae, 0xb2, 0x38, 0x15, 0x01, 0xa9, 0x62, 0x63, 0xb9, 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, 0xb1, 0x9d, 0xd1, 0xd5, 0xd2, 0xa3, + 0x4e, 0xd3, 0xd5, 0x46, 0x99, 0x7f, 0x9b, 0xc2, 0xc5, 0xae, 0x37, 0xd0, 0xa8, 0xba, 0x0d, 0x4a, + 0x4b, 0x5b, 0xe6, 0x48, 0x1b, 0x7d, 0xb6, 0x1e, 0x21, 0xbc, 0x3e, 0x71, 0xed, 0x9a, 0xc7, 0x6c, + 0xf9, 0x33, 0xaf, 0x32, 0xa8, 0x1e, 0x1c, 0x11, 0xdf, 0xe1, 0xf1, 0x1f, 0xfc, 0x5b, 0xd1, 0xf3, + 0x3f, 0x08, 0xed, 0x9f, 0x51, 0xc8, 0x77, 0xfe, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x1b, 0x9b, 0xce, + 0x6e, 0xa3, 0x10, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/genomics/v1/references.pb.go b/vendor/google.golang.org/genproto/googleapis/genomics/v1/references.pb.go new file mode 100644 index 0000000000..ef5e0e38ce --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/genomics/v1/references.pb.go @@ -0,0 +1,864 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/genomics/v1/references.proto + +package genomics + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// A reference is a canonical assembled DNA sequence, intended to act as a +// reference coordinate space for other genomic annotations. A single reference +// might represent the human chromosome 1 or mitochandrial DNA, for instance. A +// reference belongs to one or more reference sets. +// +// For more genomics resource definitions, see [Fundamentals of Google +// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +type Reference struct { + // The server-generated reference ID, unique across all references. + Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + // The length of this reference's sequence. + Length int64 `protobuf:"varint,2,opt,name=length" json:"length,omitempty"` + // MD5 of the upper-case sequence excluding all whitespace characters (this + // is equivalent to SQ:M5 in SAM). This value is represented in lower case + // hexadecimal format. + Md5Checksum string `protobuf:"bytes,3,opt,name=md5checksum" json:"md5checksum,omitempty"` + // The name of this reference, for example `22`. + Name string `protobuf:"bytes,4,opt,name=name" json:"name,omitempty"` + // The URI from which the sequence was obtained. Typically specifies a FASTA + // format file. + SourceUri string `protobuf:"bytes,5,opt,name=source_uri,json=sourceUri" json:"source_uri,omitempty"` + // All known corresponding accession IDs in INSDC (GenBank/ENA/DDBJ) ideally + // with a version number, for example `GCF_000001405.26`. + SourceAccessions []string `protobuf:"bytes,6,rep,name=source_accessions,json=sourceAccessions" json:"source_accessions,omitempty"` + // ID from http://www.ncbi.nlm.nih.gov/taxonomy. For example, 9606 for human. + NcbiTaxonId int32 `protobuf:"varint,7,opt,name=ncbi_taxon_id,json=ncbiTaxonId" json:"ncbi_taxon_id,omitempty"` +} + +func (m *Reference) Reset() { *m = Reference{} } +func (m *Reference) String() string { return proto.CompactTextString(m) } +func (*Reference) ProtoMessage() {} +func (*Reference) Descriptor() ([]byte, []int) { return fileDescriptor10, []int{0} } + +func (m *Reference) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *Reference) GetLength() int64 { + if m != nil { + return m.Length + } + return 0 +} + +func (m *Reference) GetMd5Checksum() string { + if m != nil { + return m.Md5Checksum + } + return "" +} + +func (m *Reference) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Reference) GetSourceUri() string { + if m != nil { + return m.SourceUri + } + return "" +} + +func (m *Reference) GetSourceAccessions() []string { + if m != nil { + return m.SourceAccessions + } + return nil +} + +func (m *Reference) GetNcbiTaxonId() int32 { + if m != nil { + return m.NcbiTaxonId + } + return 0 +} + +// A reference set is a set of references which typically comprise a reference +// assembly for a species, such as `GRCh38` which is representative +// of the human genome. A reference set defines a common coordinate space for +// comparing reference-aligned experimental data. A reference set contains 1 or +// more references. +// +// For more genomics resource definitions, see [Fundamentals of Google +// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +type ReferenceSet struct { + // The server-generated reference set ID, unique across all reference sets. + Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + // The IDs of the reference objects that are part of this set. + // `Reference.md5checksum` must be unique within this set. + ReferenceIds []string `protobuf:"bytes,2,rep,name=reference_ids,json=referenceIds" json:"reference_ids,omitempty"` + // Order-independent MD5 checksum which identifies this reference set. The + // checksum is computed by sorting all lower case hexidecimal string + // `reference.md5checksum` (for all reference in this set) in + // ascending lexicographic order, concatenating, and taking the MD5 of that + // value. The resulting value is represented in lower case hexadecimal format. + Md5Checksum string `protobuf:"bytes,3,opt,name=md5checksum" json:"md5checksum,omitempty"` + // ID from http://www.ncbi.nlm.nih.gov/taxonomy (for example, 9606 for human) + // indicating the species which this reference set is intended to model. Note + // that contained references may specify a different `ncbiTaxonId`, as + // assemblies may contain reference sequences which do not belong to the + // modeled species, for example EBV in a human reference genome. + NcbiTaxonId int32 `protobuf:"varint,4,opt,name=ncbi_taxon_id,json=ncbiTaxonId" json:"ncbi_taxon_id,omitempty"` + // Free text description of this reference set. + Description string `protobuf:"bytes,5,opt,name=description" json:"description,omitempty"` + // Public id of this reference set, such as `GRCh37`. + AssemblyId string `protobuf:"bytes,6,opt,name=assembly_id,json=assemblyId" json:"assembly_id,omitempty"` + // The URI from which the references were obtained. + SourceUri string `protobuf:"bytes,7,opt,name=source_uri,json=sourceUri" json:"source_uri,omitempty"` + // All known corresponding accession IDs in INSDC (GenBank/ENA/DDBJ) ideally + // with a version number, for example `NC_000001.11`. + SourceAccessions []string `protobuf:"bytes,8,rep,name=source_accessions,json=sourceAccessions" json:"source_accessions,omitempty"` +} + +func (m *ReferenceSet) Reset() { *m = ReferenceSet{} } +func (m *ReferenceSet) String() string { return proto.CompactTextString(m) } +func (*ReferenceSet) ProtoMessage() {} +func (*ReferenceSet) Descriptor() ([]byte, []int) { return fileDescriptor10, []int{1} } + +func (m *ReferenceSet) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *ReferenceSet) GetReferenceIds() []string { + if m != nil { + return m.ReferenceIds + } + return nil +} + +func (m *ReferenceSet) GetMd5Checksum() string { + if m != nil { + return m.Md5Checksum + } + return "" +} + +func (m *ReferenceSet) GetNcbiTaxonId() int32 { + if m != nil { + return m.NcbiTaxonId + } + return 0 +} + +func (m *ReferenceSet) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *ReferenceSet) GetAssemblyId() string { + if m != nil { + return m.AssemblyId + } + return "" +} + +func (m *ReferenceSet) GetSourceUri() string { + if m != nil { + return m.SourceUri + } + return "" +} + +func (m *ReferenceSet) GetSourceAccessions() []string { + if m != nil { + return m.SourceAccessions + } + return nil +} + +type SearchReferenceSetsRequest struct { + // If present, return reference sets for which the + // [md5checksum][google.genomics.v1.ReferenceSet.md5checksum] matches exactly. + Md5Checksums []string `protobuf:"bytes,1,rep,name=md5checksums" json:"md5checksums,omitempty"` + // If present, return reference sets for which a prefix of any of + // [sourceAccessions][google.genomics.v1.ReferenceSet.source_accessions] + // match any of these strings. Accession numbers typically have a main number + // and a version, for example `NC_000001.11`. + Accessions []string `protobuf:"bytes,2,rep,name=accessions" json:"accessions,omitempty"` + // If present, return reference sets for which a substring of their + // `assemblyId` matches this string (case insensitive). + AssemblyId string `protobuf:"bytes,3,opt,name=assembly_id,json=assemblyId" json:"assembly_id,omitempty"` + // The continuation token, which is used to page through large result sets. + // To get the next page of results, set this parameter to the value of + // `nextPageToken` from the previous response. + PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` + // The maximum number of results to return in a single page. If unspecified, + // defaults to 1024. The maximum value is 4096. + PageSize int32 `protobuf:"varint,5,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` +} + +func (m *SearchReferenceSetsRequest) Reset() { *m = SearchReferenceSetsRequest{} } +func (m *SearchReferenceSetsRequest) String() string { return proto.CompactTextString(m) } +func (*SearchReferenceSetsRequest) ProtoMessage() {} +func (*SearchReferenceSetsRequest) Descriptor() ([]byte, []int) { return fileDescriptor10, []int{2} } + +func (m *SearchReferenceSetsRequest) GetMd5Checksums() []string { + if m != nil { + return m.Md5Checksums + } + return nil +} + +func (m *SearchReferenceSetsRequest) GetAccessions() []string { + if m != nil { + return m.Accessions + } + return nil +} + +func (m *SearchReferenceSetsRequest) GetAssemblyId() string { + if m != nil { + return m.AssemblyId + } + return "" +} + +func (m *SearchReferenceSetsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +func (m *SearchReferenceSetsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +type SearchReferenceSetsResponse struct { + // The matching references sets. + ReferenceSets []*ReferenceSet `protobuf:"bytes,1,rep,name=reference_sets,json=referenceSets" json:"reference_sets,omitempty"` + // The continuation token, which is used to page through large result sets. + // Provide this value in a subsequent request to return the next page of + // results. This field will be empty if there aren't any additional results. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *SearchReferenceSetsResponse) Reset() { *m = SearchReferenceSetsResponse{} } +func (m *SearchReferenceSetsResponse) String() string { return proto.CompactTextString(m) } +func (*SearchReferenceSetsResponse) ProtoMessage() {} +func (*SearchReferenceSetsResponse) Descriptor() ([]byte, []int) { return fileDescriptor10, []int{3} } + +func (m *SearchReferenceSetsResponse) GetReferenceSets() []*ReferenceSet { + if m != nil { + return m.ReferenceSets + } + return nil +} + +func (m *SearchReferenceSetsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +type GetReferenceSetRequest struct { + // The ID of the reference set. + ReferenceSetId string `protobuf:"bytes,1,opt,name=reference_set_id,json=referenceSetId" json:"reference_set_id,omitempty"` +} + +func (m *GetReferenceSetRequest) Reset() { *m = GetReferenceSetRequest{} } +func (m *GetReferenceSetRequest) String() string { return proto.CompactTextString(m) } +func (*GetReferenceSetRequest) ProtoMessage() {} +func (*GetReferenceSetRequest) Descriptor() ([]byte, []int) { return fileDescriptor10, []int{4} } + +func (m *GetReferenceSetRequest) GetReferenceSetId() string { + if m != nil { + return m.ReferenceSetId + } + return "" +} + +type SearchReferencesRequest struct { + // If present, return references for which the + // [md5checksum][google.genomics.v1.Reference.md5checksum] matches exactly. + Md5Checksums []string `protobuf:"bytes,1,rep,name=md5checksums" json:"md5checksums,omitempty"` + // If present, return references for which a prefix of any of + // [sourceAccessions][google.genomics.v1.Reference.source_accessions] match + // any of these strings. Accession numbers typically have a main number and a + // version, for example `GCF_000001405.26`. + Accessions []string `protobuf:"bytes,2,rep,name=accessions" json:"accessions,omitempty"` + // If present, return only references which belong to this reference set. + ReferenceSetId string `protobuf:"bytes,3,opt,name=reference_set_id,json=referenceSetId" json:"reference_set_id,omitempty"` + // The continuation token, which is used to page through large result sets. + // To get the next page of results, set this parameter to the value of + // `nextPageToken` from the previous response. + PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` + // The maximum number of results to return in a single page. If unspecified, + // defaults to 1024. The maximum value is 4096. + PageSize int32 `protobuf:"varint,5,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` +} + +func (m *SearchReferencesRequest) Reset() { *m = SearchReferencesRequest{} } +func (m *SearchReferencesRequest) String() string { return proto.CompactTextString(m) } +func (*SearchReferencesRequest) ProtoMessage() {} +func (*SearchReferencesRequest) Descriptor() ([]byte, []int) { return fileDescriptor10, []int{5} } + +func (m *SearchReferencesRequest) GetMd5Checksums() []string { + if m != nil { + return m.Md5Checksums + } + return nil +} + +func (m *SearchReferencesRequest) GetAccessions() []string { + if m != nil { + return m.Accessions + } + return nil +} + +func (m *SearchReferencesRequest) GetReferenceSetId() string { + if m != nil { + return m.ReferenceSetId + } + return "" +} + +func (m *SearchReferencesRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +func (m *SearchReferencesRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +type SearchReferencesResponse struct { + // The matching references. + References []*Reference `protobuf:"bytes,1,rep,name=references" json:"references,omitempty"` + // The continuation token, which is used to page through large result sets. + // Provide this value in a subsequent request to return the next page of + // results. This field will be empty if there aren't any additional results. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *SearchReferencesResponse) Reset() { *m = SearchReferencesResponse{} } +func (m *SearchReferencesResponse) String() string { return proto.CompactTextString(m) } +func (*SearchReferencesResponse) ProtoMessage() {} +func (*SearchReferencesResponse) Descriptor() ([]byte, []int) { return fileDescriptor10, []int{6} } + +func (m *SearchReferencesResponse) GetReferences() []*Reference { + if m != nil { + return m.References + } + return nil +} + +func (m *SearchReferencesResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +type GetReferenceRequest struct { + // The ID of the reference. + ReferenceId string `protobuf:"bytes,1,opt,name=reference_id,json=referenceId" json:"reference_id,omitempty"` +} + +func (m *GetReferenceRequest) Reset() { *m = GetReferenceRequest{} } +func (m *GetReferenceRequest) String() string { return proto.CompactTextString(m) } +func (*GetReferenceRequest) ProtoMessage() {} +func (*GetReferenceRequest) Descriptor() ([]byte, []int) { return fileDescriptor10, []int{7} } + +func (m *GetReferenceRequest) GetReferenceId() string { + if m != nil { + return m.ReferenceId + } + return "" +} + +type ListBasesRequest struct { + // The ID of the reference. + ReferenceId string `protobuf:"bytes,1,opt,name=reference_id,json=referenceId" json:"reference_id,omitempty"` + // The start position (0-based) of this query. Defaults to 0. + Start int64 `protobuf:"varint,2,opt,name=start" json:"start,omitempty"` + // The end position (0-based, exclusive) of this query. Defaults to the length + // of this reference. + End int64 `protobuf:"varint,3,opt,name=end" json:"end,omitempty"` + // The continuation token, which is used to page through large result sets. + // To get the next page of results, set this parameter to the value of + // `nextPageToken` from the previous response. + PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` + // The maximum number of bases to return in a single page. If unspecified, + // defaults to 200Kbp (kilo base pairs). The maximum value is 10Mbp (mega base + // pairs). + PageSize int32 `protobuf:"varint,5,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` +} + +func (m *ListBasesRequest) Reset() { *m = ListBasesRequest{} } +func (m *ListBasesRequest) String() string { return proto.CompactTextString(m) } +func (*ListBasesRequest) ProtoMessage() {} +func (*ListBasesRequest) Descriptor() ([]byte, []int) { return fileDescriptor10, []int{8} } + +func (m *ListBasesRequest) GetReferenceId() string { + if m != nil { + return m.ReferenceId + } + return "" +} + +func (m *ListBasesRequest) GetStart() int64 { + if m != nil { + return m.Start + } + return 0 +} + +func (m *ListBasesRequest) GetEnd() int64 { + if m != nil { + return m.End + } + return 0 +} + +func (m *ListBasesRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +func (m *ListBasesRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +type ListBasesResponse struct { + // The offset position (0-based) of the given `sequence` from the + // start of this `Reference`. This value will differ for each page + // in a paginated request. + Offset int64 `protobuf:"varint,1,opt,name=offset" json:"offset,omitempty"` + // A substring of the bases that make up this reference. + Sequence string `protobuf:"bytes,2,opt,name=sequence" json:"sequence,omitempty"` + // The continuation token, which is used to page through large result sets. + // Provide this value in a subsequent request to return the next page of + // results. This field will be empty if there aren't any additional results. + NextPageToken string `protobuf:"bytes,3,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListBasesResponse) Reset() { *m = ListBasesResponse{} } +func (m *ListBasesResponse) String() string { return proto.CompactTextString(m) } +func (*ListBasesResponse) ProtoMessage() {} +func (*ListBasesResponse) Descriptor() ([]byte, []int) { return fileDescriptor10, []int{9} } + +func (m *ListBasesResponse) GetOffset() int64 { + if m != nil { + return m.Offset + } + return 0 +} + +func (m *ListBasesResponse) GetSequence() string { + if m != nil { + return m.Sequence + } + return "" +} + +func (m *ListBasesResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +func init() { + proto.RegisterType((*Reference)(nil), "google.genomics.v1.Reference") + proto.RegisterType((*ReferenceSet)(nil), "google.genomics.v1.ReferenceSet") + proto.RegisterType((*SearchReferenceSetsRequest)(nil), "google.genomics.v1.SearchReferenceSetsRequest") + proto.RegisterType((*SearchReferenceSetsResponse)(nil), "google.genomics.v1.SearchReferenceSetsResponse") + proto.RegisterType((*GetReferenceSetRequest)(nil), "google.genomics.v1.GetReferenceSetRequest") + proto.RegisterType((*SearchReferencesRequest)(nil), "google.genomics.v1.SearchReferencesRequest") + proto.RegisterType((*SearchReferencesResponse)(nil), "google.genomics.v1.SearchReferencesResponse") + proto.RegisterType((*GetReferenceRequest)(nil), "google.genomics.v1.GetReferenceRequest") + proto.RegisterType((*ListBasesRequest)(nil), "google.genomics.v1.ListBasesRequest") + proto.RegisterType((*ListBasesResponse)(nil), "google.genomics.v1.ListBasesResponse") +} + +// 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 + +// Client API for ReferenceServiceV1 service + +type ReferenceServiceV1Client interface { + // Searches for reference sets which match the given criteria. + // + // For the definitions of references and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // Implements + // [GlobalAllianceApi.searchReferenceSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L71) + SearchReferenceSets(ctx context.Context, in *SearchReferenceSetsRequest, opts ...grpc.CallOption) (*SearchReferenceSetsResponse, error) + // Gets a reference set. + // + // For the definitions of references and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // Implements + // [GlobalAllianceApi.getReferenceSet](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L83). + GetReferenceSet(ctx context.Context, in *GetReferenceSetRequest, opts ...grpc.CallOption) (*ReferenceSet, error) + // Searches for references which match the given criteria. + // + // For the definitions of references and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // Implements + // [GlobalAllianceApi.searchReferences](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L146). + SearchReferences(ctx context.Context, in *SearchReferencesRequest, opts ...grpc.CallOption) (*SearchReferencesResponse, error) + // Gets a reference. + // + // For the definitions of references and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // Implements + // [GlobalAllianceApi.getReference](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L158). + GetReference(ctx context.Context, in *GetReferenceRequest, opts ...grpc.CallOption) (*Reference, error) + // Lists the bases in a reference, optionally restricted to a range. + // + // For the definitions of references and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // Implements + // [GlobalAllianceApi.getReferenceBases](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L221). + ListBases(ctx context.Context, in *ListBasesRequest, opts ...grpc.CallOption) (*ListBasesResponse, error) +} + +type referenceServiceV1Client struct { + cc *grpc.ClientConn +} + +func NewReferenceServiceV1Client(cc *grpc.ClientConn) ReferenceServiceV1Client { + return &referenceServiceV1Client{cc} +} + +func (c *referenceServiceV1Client) SearchReferenceSets(ctx context.Context, in *SearchReferenceSetsRequest, opts ...grpc.CallOption) (*SearchReferenceSetsResponse, error) { + out := new(SearchReferenceSetsResponse) + err := grpc.Invoke(ctx, "/google.genomics.v1.ReferenceServiceV1/SearchReferenceSets", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *referenceServiceV1Client) GetReferenceSet(ctx context.Context, in *GetReferenceSetRequest, opts ...grpc.CallOption) (*ReferenceSet, error) { + out := new(ReferenceSet) + err := grpc.Invoke(ctx, "/google.genomics.v1.ReferenceServiceV1/GetReferenceSet", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *referenceServiceV1Client) SearchReferences(ctx context.Context, in *SearchReferencesRequest, opts ...grpc.CallOption) (*SearchReferencesResponse, error) { + out := new(SearchReferencesResponse) + err := grpc.Invoke(ctx, "/google.genomics.v1.ReferenceServiceV1/SearchReferences", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *referenceServiceV1Client) GetReference(ctx context.Context, in *GetReferenceRequest, opts ...grpc.CallOption) (*Reference, error) { + out := new(Reference) + err := grpc.Invoke(ctx, "/google.genomics.v1.ReferenceServiceV1/GetReference", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *referenceServiceV1Client) ListBases(ctx context.Context, in *ListBasesRequest, opts ...grpc.CallOption) (*ListBasesResponse, error) { + out := new(ListBasesResponse) + err := grpc.Invoke(ctx, "/google.genomics.v1.ReferenceServiceV1/ListBases", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for ReferenceServiceV1 service + +type ReferenceServiceV1Server interface { + // Searches for reference sets which match the given criteria. + // + // For the definitions of references and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // Implements + // [GlobalAllianceApi.searchReferenceSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L71) + SearchReferenceSets(context.Context, *SearchReferenceSetsRequest) (*SearchReferenceSetsResponse, error) + // Gets a reference set. + // + // For the definitions of references and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // Implements + // [GlobalAllianceApi.getReferenceSet](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L83). + GetReferenceSet(context.Context, *GetReferenceSetRequest) (*ReferenceSet, error) + // Searches for references which match the given criteria. + // + // For the definitions of references and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // Implements + // [GlobalAllianceApi.searchReferences](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L146). + SearchReferences(context.Context, *SearchReferencesRequest) (*SearchReferencesResponse, error) + // Gets a reference. + // + // For the definitions of references and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // Implements + // [GlobalAllianceApi.getReference](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L158). + GetReference(context.Context, *GetReferenceRequest) (*Reference, error) + // Lists the bases in a reference, optionally restricted to a range. + // + // For the definitions of references and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // Implements + // [GlobalAllianceApi.getReferenceBases](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L221). + ListBases(context.Context, *ListBasesRequest) (*ListBasesResponse, error) +} + +func RegisterReferenceServiceV1Server(s *grpc.Server, srv ReferenceServiceV1Server) { + s.RegisterService(&_ReferenceServiceV1_serviceDesc, srv) +} + +func _ReferenceServiceV1_SearchReferenceSets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SearchReferenceSetsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReferenceServiceV1Server).SearchReferenceSets(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.ReferenceServiceV1/SearchReferenceSets", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReferenceServiceV1Server).SearchReferenceSets(ctx, req.(*SearchReferenceSetsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ReferenceServiceV1_GetReferenceSet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetReferenceSetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReferenceServiceV1Server).GetReferenceSet(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.ReferenceServiceV1/GetReferenceSet", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReferenceServiceV1Server).GetReferenceSet(ctx, req.(*GetReferenceSetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ReferenceServiceV1_SearchReferences_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SearchReferencesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReferenceServiceV1Server).SearchReferences(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.ReferenceServiceV1/SearchReferences", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReferenceServiceV1Server).SearchReferences(ctx, req.(*SearchReferencesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ReferenceServiceV1_GetReference_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetReferenceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReferenceServiceV1Server).GetReference(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.ReferenceServiceV1/GetReference", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReferenceServiceV1Server).GetReference(ctx, req.(*GetReferenceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ReferenceServiceV1_ListBases_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListBasesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReferenceServiceV1Server).ListBases(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.ReferenceServiceV1/ListBases", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReferenceServiceV1Server).ListBases(ctx, req.(*ListBasesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _ReferenceServiceV1_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.genomics.v1.ReferenceServiceV1", + HandlerType: (*ReferenceServiceV1Server)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SearchReferenceSets", + Handler: _ReferenceServiceV1_SearchReferenceSets_Handler, + }, + { + MethodName: "GetReferenceSet", + Handler: _ReferenceServiceV1_GetReferenceSet_Handler, + }, + { + MethodName: "SearchReferences", + Handler: _ReferenceServiceV1_SearchReferences_Handler, + }, + { + MethodName: "GetReference", + Handler: _ReferenceServiceV1_GetReference_Handler, + }, + { + MethodName: "ListBases", + Handler: _ReferenceServiceV1_ListBases_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/genomics/v1/references.proto", +} + +func init() { proto.RegisterFile("google/genomics/v1/references.proto", fileDescriptor10) } + +var fileDescriptor10 = []byte{ + // 851 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x41, 0x6f, 0x1b, 0x45, + 0x14, 0xd6, 0x78, 0x63, 0x37, 0x7e, 0x76, 0x12, 0xf7, 0x15, 0xc2, 0xca, 0x25, 0xd4, 0x6c, 0x9a, + 0x62, 0x35, 0x95, 0x57, 0x29, 0x42, 0x42, 0x45, 0x1c, 0xc8, 0xa5, 0x8a, 0xc4, 0x21, 0xda, 0x14, + 0x0e, 0x5c, 0x56, 0x9b, 0xdd, 0x89, 0x33, 0x34, 0xde, 0x31, 0x3b, 0x93, 0xa8, 0xb4, 0xca, 0x01, + 0x24, 0x8e, 0xc0, 0x81, 0x0b, 0x88, 0xdf, 0xc2, 0x89, 0x9f, 0xc0, 0x09, 0x71, 0xe5, 0x47, 0x70, + 0x44, 0x33, 0x3b, 0xbb, 0x1e, 0xaf, 0x97, 0xd8, 0x52, 0xb9, 0xed, 0x7c, 0xf3, 0xe6, 0xcd, 0xf7, + 0x7d, 0x6f, 0xde, 0xec, 0xc0, 0xee, 0x98, 0xf3, 0xf1, 0x05, 0xf5, 0xc7, 0x34, 0xe5, 0x13, 0x16, + 0x0b, 0xff, 0xea, 0xc0, 0xcf, 0xe8, 0x19, 0xcd, 0x68, 0x1a, 0x53, 0x31, 0x9a, 0x66, 0x5c, 0x72, + 0xc4, 0x3c, 0x68, 0x54, 0x04, 0x8d, 0xae, 0x0e, 0xfa, 0x6f, 0x9b, 0x85, 0xd1, 0x94, 0xf9, 0x51, + 0x9a, 0x72, 0x19, 0x49, 0xc6, 0x53, 0xb3, 0xc2, 0xfb, 0x93, 0x40, 0x3b, 0x28, 0xd2, 0xe0, 0x26, + 0x34, 0x58, 0xe2, 0x92, 0x01, 0x19, 0xb6, 0x83, 0x06, 0x4b, 0x70, 0x1b, 0x5a, 0x17, 0x34, 0x1d, + 0xcb, 0x73, 0xb7, 0x31, 0x20, 0x43, 0x27, 0x30, 0x23, 0x1c, 0x40, 0x67, 0x92, 0x7c, 0x10, 0x9f, + 0xd3, 0xf8, 0xb9, 0xb8, 0x9c, 0xb8, 0x8e, 0x5e, 0x60, 0x43, 0x88, 0xb0, 0x96, 0x46, 0x13, 0xea, + 0xae, 0xe9, 0x29, 0xfd, 0x8d, 0x3b, 0x00, 0x82, 0x5f, 0x66, 0x31, 0x0d, 0x2f, 0x33, 0xe6, 0x36, + 0xf5, 0x4c, 0x3b, 0x47, 0x3e, 0xcb, 0x18, 0xee, 0xc3, 0x6d, 0x33, 0x1d, 0xc5, 0x31, 0x15, 0x42, + 0xb1, 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0, 0x4b, 0xd8, 0x8e, 0xf9, 0xa4, 0x26, 0xf1, 0xe1, 0xd6, 0xcc, 0xd6, 0x63, 0xf5, 0x4a, + 0x3a, 0x26, 0x5f, 0x3c, 0x29, 0xc2, 0xf8, 0x45, 0x94, 0x8e, 0x47, 0x3c, 0x1b, 0xab, 0x97, 0x98, + 0x7e, 0x43, 0xf9, 0xf9, 0x54, 0x34, 0x65, 0xc2, 0x7e, 0x9d, 0x7d, 0x54, 0x7c, 0xff, 0x43, 0xc8, + 0x69, 0x4b, 0x47, 0xbe, 0xff, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd7, 0x9f, 0xb6, 0x11, 0xc6, + 0x09, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/genomics/v1/variants.pb.go b/vendor/google.golang.org/genproto/googleapis/genomics/v1/variants.pb.go new file mode 100644 index 0000000000..0bac56bb57 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/genomics/v1/variants.pb.go @@ -0,0 +1,2808 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/genomics/v1/variants.proto + +package genomics + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_longrunning "google.golang.org/genproto/googleapis/longrunning" +import google_protobuf1 "github.com/golang/protobuf/ptypes/empty" +import google_protobuf2 "google.golang.org/genproto/protobuf/field_mask" +import google_protobuf3 "github.com/golang/protobuf/ptypes/struct" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Operations to be performed during import on Variant info fields. +// These operations are set for each info field in the info_merge_config +// map of ImportVariantsRequest, which is plumbed down to the +// MergeVariantRequests generated by the import job. +type InfoMergeOperation int32 + +const ( + InfoMergeOperation_INFO_MERGE_OPERATION_UNSPECIFIED InfoMergeOperation = 0 + // By default, Variant info fields are persisted if the Variant doesn't + // already exist in the variantset. If the Variant is equivalent to a + // Variant already in the variantset, the incoming Variant's info field + // is ignored in favor of that of the already persisted Variant. + InfoMergeOperation_IGNORE_NEW InfoMergeOperation = 1 + // This operation removes an info field from the incoming Variant + // and persists this info field in each of the incoming Variant's Calls. + InfoMergeOperation_MOVE_TO_CALLS InfoMergeOperation = 2 +) + +var InfoMergeOperation_name = map[int32]string{ + 0: "INFO_MERGE_OPERATION_UNSPECIFIED", + 1: "IGNORE_NEW", + 2: "MOVE_TO_CALLS", +} +var InfoMergeOperation_value = map[string]int32{ + "INFO_MERGE_OPERATION_UNSPECIFIED": 0, + "IGNORE_NEW": 1, + "MOVE_TO_CALLS": 2, +} + +func (x InfoMergeOperation) String() string { + return proto.EnumName(InfoMergeOperation_name, int32(x)) +} +func (InfoMergeOperation) EnumDescriptor() ([]byte, []int) { return fileDescriptor11, []int{0} } + +type VariantSetMetadata_Type int32 + +const ( + VariantSetMetadata_TYPE_UNSPECIFIED VariantSetMetadata_Type = 0 + VariantSetMetadata_INTEGER VariantSetMetadata_Type = 1 + VariantSetMetadata_FLOAT VariantSetMetadata_Type = 2 + VariantSetMetadata_FLAG VariantSetMetadata_Type = 3 + VariantSetMetadata_CHARACTER VariantSetMetadata_Type = 4 + VariantSetMetadata_STRING VariantSetMetadata_Type = 5 +) + +var VariantSetMetadata_Type_name = map[int32]string{ + 0: "TYPE_UNSPECIFIED", + 1: "INTEGER", + 2: "FLOAT", + 3: "FLAG", + 4: "CHARACTER", + 5: "STRING", +} +var VariantSetMetadata_Type_value = map[string]int32{ + "TYPE_UNSPECIFIED": 0, + "INTEGER": 1, + "FLOAT": 2, + "FLAG": 3, + "CHARACTER": 4, + "STRING": 5, +} + +func (x VariantSetMetadata_Type) String() string { + return proto.EnumName(VariantSetMetadata_Type_name, int32(x)) +} +func (VariantSetMetadata_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptor11, []int{0, 0} } + +type ImportVariantsRequest_Format int32 + +const ( + ImportVariantsRequest_FORMAT_UNSPECIFIED ImportVariantsRequest_Format = 0 + // VCF (Variant Call Format). The VCF files may be gzip compressed. gVCF is + // also supported. + ImportVariantsRequest_FORMAT_VCF ImportVariantsRequest_Format = 1 + // Complete Genomics masterVarBeta format. The masterVarBeta files may + // be bzip2 compressed. + ImportVariantsRequest_FORMAT_COMPLETE_GENOMICS ImportVariantsRequest_Format = 2 +) + +var ImportVariantsRequest_Format_name = map[int32]string{ + 0: "FORMAT_UNSPECIFIED", + 1: "FORMAT_VCF", + 2: "FORMAT_COMPLETE_GENOMICS", +} +var ImportVariantsRequest_Format_value = map[string]int32{ + "FORMAT_UNSPECIFIED": 0, + "FORMAT_VCF": 1, + "FORMAT_COMPLETE_GENOMICS": 2, +} + +func (x ImportVariantsRequest_Format) String() string { + return proto.EnumName(ImportVariantsRequest_Format_name, int32(x)) +} +func (ImportVariantsRequest_Format) EnumDescriptor() ([]byte, []int) { + return fileDescriptor11, []int{6, 0} +} + +type ExportVariantSetRequest_Format int32 + +const ( + ExportVariantSetRequest_FORMAT_UNSPECIFIED ExportVariantSetRequest_Format = 0 + // Export the data to Google BigQuery. + ExportVariantSetRequest_FORMAT_BIGQUERY ExportVariantSetRequest_Format = 1 +) + +var ExportVariantSetRequest_Format_name = map[int32]string{ + 0: "FORMAT_UNSPECIFIED", + 1: "FORMAT_BIGQUERY", +} +var ExportVariantSetRequest_Format_value = map[string]int32{ + "FORMAT_UNSPECIFIED": 0, + "FORMAT_BIGQUERY": 1, +} + +func (x ExportVariantSetRequest_Format) String() string { + return proto.EnumName(ExportVariantSetRequest_Format_name, int32(x)) +} +func (ExportVariantSetRequest_Format) EnumDescriptor() ([]byte, []int) { + return fileDescriptor11, []int{9, 0} +} + +// Metadata describes a single piece of variant call metadata. +// These data include a top level key and either a single value string (value) +// or a list of key-value pairs (info.) +// Value and info are mutually exclusive. +type VariantSetMetadata struct { + // The top-level key. + Key string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` + // The value field for simple metadata + Value string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` + // User-provided ID field, not enforced by this API. + // Two or more pieces of structured metadata with identical + // id and key fields are considered equivalent. + Id string `protobuf:"bytes,4,opt,name=id" json:"id,omitempty"` + // The type of data. Possible types include: Integer, Float, + // Flag, Character, and String. + Type VariantSetMetadata_Type `protobuf:"varint,5,opt,name=type,enum=google.genomics.v1.VariantSetMetadata_Type" json:"type,omitempty"` + // The number of values that can be included in a field described by this + // metadata. + Number string `protobuf:"bytes,8,opt,name=number" json:"number,omitempty"` + // A textual description of this metadata. + Description string `protobuf:"bytes,7,opt,name=description" json:"description,omitempty"` + // Remaining structured metadata key-value pairs. This must be of the form + // map (string key mapping to a list of string values). + Info map[string]*google_protobuf3.ListValue `protobuf:"bytes,3,rep,name=info" json:"info,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *VariantSetMetadata) Reset() { *m = VariantSetMetadata{} } +func (m *VariantSetMetadata) String() string { return proto.CompactTextString(m) } +func (*VariantSetMetadata) ProtoMessage() {} +func (*VariantSetMetadata) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{0} } + +func (m *VariantSetMetadata) GetKey() string { + if m != nil { + return m.Key + } + return "" +} + +func (m *VariantSetMetadata) GetValue() string { + if m != nil { + return m.Value + } + return "" +} + +func (m *VariantSetMetadata) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *VariantSetMetadata) GetType() VariantSetMetadata_Type { + if m != nil { + return m.Type + } + return VariantSetMetadata_TYPE_UNSPECIFIED +} + +func (m *VariantSetMetadata) GetNumber() string { + if m != nil { + return m.Number + } + return "" +} + +func (m *VariantSetMetadata) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *VariantSetMetadata) GetInfo() map[string]*google_protobuf3.ListValue { + if m != nil { + return m.Info + } + return nil +} + +// A variant set is a collection of call sets and variants. It contains summary +// statistics of those contents. A variant set belongs to a dataset. +// +// For more genomics resource definitions, see [Fundamentals of Google +// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +type VariantSet struct { + // The dataset to which this variant set belongs. + DatasetId string `protobuf:"bytes,1,opt,name=dataset_id,json=datasetId" json:"dataset_id,omitempty"` + // The server-generated variant set ID, unique across all variant sets. + Id string `protobuf:"bytes,2,opt,name=id" json:"id,omitempty"` + // The reference set to which the variant set is mapped. The reference set + // describes the alignment provenance of the variant set, while the + // `referenceBounds` describe the shape of the actual variant data. The + // reference set's reference names are a superset of those found in the + // `referenceBounds`. + // + // For example, given a variant set that is mapped to the GRCh38 reference set + // and contains a single variant on reference 'X', `referenceBounds` would + // contain only an entry for 'X', while the associated reference set + // enumerates all possible references: '1', '2', 'X', 'Y', 'MT', etc. + ReferenceSetId string `protobuf:"bytes,6,opt,name=reference_set_id,json=referenceSetId" json:"reference_set_id,omitempty"` + // A list of all references used by the variants in a variant set + // with associated coordinate upper bounds for each one. + ReferenceBounds []*ReferenceBound `protobuf:"bytes,5,rep,name=reference_bounds,json=referenceBounds" json:"reference_bounds,omitempty"` + // The metadata associated with this variant set. + Metadata []*VariantSetMetadata `protobuf:"bytes,4,rep,name=metadata" json:"metadata,omitempty"` + // User-specified, mutable name. + Name string `protobuf:"bytes,7,opt,name=name" json:"name,omitempty"` + // A textual description of this variant set. + Description string `protobuf:"bytes,8,opt,name=description" json:"description,omitempty"` +} + +func (m *VariantSet) Reset() { *m = VariantSet{} } +func (m *VariantSet) String() string { return proto.CompactTextString(m) } +func (*VariantSet) ProtoMessage() {} +func (*VariantSet) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{1} } + +func (m *VariantSet) GetDatasetId() string { + if m != nil { + return m.DatasetId + } + return "" +} + +func (m *VariantSet) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *VariantSet) GetReferenceSetId() string { + if m != nil { + return m.ReferenceSetId + } + return "" +} + +func (m *VariantSet) GetReferenceBounds() []*ReferenceBound { + if m != nil { + return m.ReferenceBounds + } + return nil +} + +func (m *VariantSet) GetMetadata() []*VariantSetMetadata { + if m != nil { + return m.Metadata + } + return nil +} + +func (m *VariantSet) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *VariantSet) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +// A variant represents a change in DNA sequence relative to a reference +// sequence. For example, a variant could represent a SNP or an insertion. +// Variants belong to a variant set. +// +// For more genomics resource definitions, see [Fundamentals of Google +// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +// +// Each of the calls on a variant represent a determination of genotype with +// respect to that variant. For example, a call might assign probability of 0.32 +// to the occurrence of a SNP named rs1234 in a sample named NA12345. A call +// belongs to a call set, which contains related calls typically from one +// sample. +type Variant struct { + // The ID of the variant set this variant belongs to. + VariantSetId string `protobuf:"bytes,15,opt,name=variant_set_id,json=variantSetId" json:"variant_set_id,omitempty"` + // The server-generated variant ID, unique across all variants. + Id string `protobuf:"bytes,2,opt,name=id" json:"id,omitempty"` + // Names for the variant, for example a RefSNP ID. + Names []string `protobuf:"bytes,3,rep,name=names" json:"names,omitempty"` + // The date this variant was created, in milliseconds from the epoch. + Created int64 `protobuf:"varint,12,opt,name=created" json:"created,omitempty"` + // The reference on which this variant occurs. + // (such as `chr20` or `X`) + ReferenceName string `protobuf:"bytes,14,opt,name=reference_name,json=referenceName" json:"reference_name,omitempty"` + // The position at which this variant occurs (0-based). + // This corresponds to the first base of the string of reference bases. + Start int64 `protobuf:"varint,16,opt,name=start" json:"start,omitempty"` + // The end position (0-based) of this variant. This corresponds to the first + // base after the last base in the reference allele. So, the length of + // the reference allele is (end - start). This is useful for variants + // that don't explicitly give alternate bases, for example large deletions. + End int64 `protobuf:"varint,13,opt,name=end" json:"end,omitempty"` + // The reference bases for this variant. They start at the given + // position. + ReferenceBases string `protobuf:"bytes,6,opt,name=reference_bases,json=referenceBases" json:"reference_bases,omitempty"` + // The bases that appear instead of the reference bases. + AlternateBases []string `protobuf:"bytes,7,rep,name=alternate_bases,json=alternateBases" json:"alternate_bases,omitempty"` + // A measure of how likely this variant is to be real. + // A higher value is better. + Quality float64 `protobuf:"fixed64,8,opt,name=quality" json:"quality,omitempty"` + // A list of filters (normally quality filters) this variant has failed. + // `PASS` indicates this variant has passed all filters. + Filter []string `protobuf:"bytes,9,rep,name=filter" json:"filter,omitempty"` + // A map of additional variant information. This must be of the form + // map (string key mapping to a list of string values). + Info map[string]*google_protobuf3.ListValue `protobuf:"bytes,10,rep,name=info" json:"info,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // The variant calls for this particular variant. Each one represents the + // determination of genotype with respect to this variant. + Calls []*VariantCall `protobuf:"bytes,11,rep,name=calls" json:"calls,omitempty"` +} + +func (m *Variant) Reset() { *m = Variant{} } +func (m *Variant) String() string { return proto.CompactTextString(m) } +func (*Variant) ProtoMessage() {} +func (*Variant) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{2} } + +func (m *Variant) GetVariantSetId() string { + if m != nil { + return m.VariantSetId + } + return "" +} + +func (m *Variant) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *Variant) GetNames() []string { + if m != nil { + return m.Names + } + return nil +} + +func (m *Variant) GetCreated() int64 { + if m != nil { + return m.Created + } + return 0 +} + +func (m *Variant) GetReferenceName() string { + if m != nil { + return m.ReferenceName + } + return "" +} + +func (m *Variant) GetStart() int64 { + if m != nil { + return m.Start + } + return 0 +} + +func (m *Variant) GetEnd() int64 { + if m != nil { + return m.End + } + return 0 +} + +func (m *Variant) GetReferenceBases() string { + if m != nil { + return m.ReferenceBases + } + return "" +} + +func (m *Variant) GetAlternateBases() []string { + if m != nil { + return m.AlternateBases + } + return nil +} + +func (m *Variant) GetQuality() float64 { + if m != nil { + return m.Quality + } + return 0 +} + +func (m *Variant) GetFilter() []string { + if m != nil { + return m.Filter + } + return nil +} + +func (m *Variant) GetInfo() map[string]*google_protobuf3.ListValue { + if m != nil { + return m.Info + } + return nil +} + +func (m *Variant) GetCalls() []*VariantCall { + if m != nil { + return m.Calls + } + return nil +} + +// A call represents the determination of genotype with respect to a particular +// variant. It may include associated information such as quality and phasing. +// For example, a call might assign a probability of 0.32 to the occurrence of +// a SNP named rs1234 in a call set with the name NA12345. +type VariantCall struct { + // The ID of the call set this variant call belongs to. + CallSetId string `protobuf:"bytes,8,opt,name=call_set_id,json=callSetId" json:"call_set_id,omitempty"` + // The name of the call set this variant call belongs to. + CallSetName string `protobuf:"bytes,9,opt,name=call_set_name,json=callSetName" json:"call_set_name,omitempty"` + // The genotype of this variant call. Each value represents either the value + // of the `referenceBases` field or a 1-based index into + // `alternateBases`. If a variant had a `referenceBases` + // value of `T` and an `alternateBases` + // value of `["A", "C"]`, and the `genotype` was + // `[2, 1]`, that would mean the call + // represented the heterozygous value `CA` for this variant. + // If the `genotype` was instead `[0, 1]`, the + // represented value would be `TA`. Ordering of the + // genotype values is important if the `phaseset` is present. + // If a genotype is not called (that is, a `.` is present in the + // GT string) -1 is returned. + Genotype []int32 `protobuf:"varint,7,rep,packed,name=genotype" json:"genotype,omitempty"` + // If this field is present, this variant call's genotype ordering implies + // the phase of the bases and is consistent with any other variant calls in + // the same reference sequence which have the same phaseset value. + // When importing data from VCF, if the genotype data was phased but no + // phase set was specified this field will be set to `*`. + Phaseset string `protobuf:"bytes,5,opt,name=phaseset" json:"phaseset,omitempty"` + // The genotype likelihoods for this variant call. Each array entry + // represents how likely a specific genotype is for this call. The value + // ordering is defined by the GL tag in the VCF spec. + // If Phred-scaled genotype likelihood scores (PL) are available and + // log10(P) genotype likelihood scores (GL) are not, PL scores are converted + // to GL scores. If both are available, PL scores are stored in `info`. + GenotypeLikelihood []float64 `protobuf:"fixed64,6,rep,packed,name=genotype_likelihood,json=genotypeLikelihood" json:"genotype_likelihood,omitempty"` + // A map of additional variant call information. This must be of the form + // map (string key mapping to a list of string values). + Info map[string]*google_protobuf3.ListValue `protobuf:"bytes,2,rep,name=info" json:"info,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *VariantCall) Reset() { *m = VariantCall{} } +func (m *VariantCall) String() string { return proto.CompactTextString(m) } +func (*VariantCall) ProtoMessage() {} +func (*VariantCall) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{3} } + +func (m *VariantCall) GetCallSetId() string { + if m != nil { + return m.CallSetId + } + return "" +} + +func (m *VariantCall) GetCallSetName() string { + if m != nil { + return m.CallSetName + } + return "" +} + +func (m *VariantCall) GetGenotype() []int32 { + if m != nil { + return m.Genotype + } + return nil +} + +func (m *VariantCall) GetPhaseset() string { + if m != nil { + return m.Phaseset + } + return "" +} + +func (m *VariantCall) GetGenotypeLikelihood() []float64 { + if m != nil { + return m.GenotypeLikelihood + } + return nil +} + +func (m *VariantCall) GetInfo() map[string]*google_protobuf3.ListValue { + if m != nil { + return m.Info + } + return nil +} + +// A call set is a collection of variant calls, typically for one sample. It +// belongs to a variant set. +// +// For more genomics resource definitions, see [Fundamentals of Google +// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +type CallSet struct { + // The server-generated call set ID, unique across all call sets. + Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + // The call set name. + Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` + // The sample ID this call set corresponds to. + SampleId string `protobuf:"bytes,7,opt,name=sample_id,json=sampleId" json:"sample_id,omitempty"` + // The IDs of the variant sets this call set belongs to. This field must + // have exactly length one, as a call set belongs to a single variant set. + // This field is repeated for compatibility with the + // [GA4GH 0.5.1 + // API](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variants.avdl#L76). + VariantSetIds []string `protobuf:"bytes,6,rep,name=variant_set_ids,json=variantSetIds" json:"variant_set_ids,omitempty"` + // The date this call set was created in milliseconds from the epoch. + Created int64 `protobuf:"varint,5,opt,name=created" json:"created,omitempty"` + // A map of additional call set information. This must be of the form + // map (string key mapping to a list of string values). + Info map[string]*google_protobuf3.ListValue `protobuf:"bytes,4,rep,name=info" json:"info,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *CallSet) Reset() { *m = CallSet{} } +func (m *CallSet) String() string { return proto.CompactTextString(m) } +func (*CallSet) ProtoMessage() {} +func (*CallSet) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{4} } + +func (m *CallSet) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *CallSet) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *CallSet) GetSampleId() string { + if m != nil { + return m.SampleId + } + return "" +} + +func (m *CallSet) GetVariantSetIds() []string { + if m != nil { + return m.VariantSetIds + } + return nil +} + +func (m *CallSet) GetCreated() int64 { + if m != nil { + return m.Created + } + return 0 +} + +func (m *CallSet) GetInfo() map[string]*google_protobuf3.ListValue { + if m != nil { + return m.Info + } + return nil +} + +// ReferenceBound records an upper bound for the starting coordinate of +// variants in a particular reference. +type ReferenceBound struct { + // The name of the reference associated with this reference bound. + ReferenceName string `protobuf:"bytes,1,opt,name=reference_name,json=referenceName" json:"reference_name,omitempty"` + // An upper bound (inclusive) on the starting coordinate of any + // variant in the reference sequence. + UpperBound int64 `protobuf:"varint,2,opt,name=upper_bound,json=upperBound" json:"upper_bound,omitempty"` +} + +func (m *ReferenceBound) Reset() { *m = ReferenceBound{} } +func (m *ReferenceBound) String() string { return proto.CompactTextString(m) } +func (*ReferenceBound) ProtoMessage() {} +func (*ReferenceBound) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{5} } + +func (m *ReferenceBound) GetReferenceName() string { + if m != nil { + return m.ReferenceName + } + return "" +} + +func (m *ReferenceBound) GetUpperBound() int64 { + if m != nil { + return m.UpperBound + } + return 0 +} + +// The variant data import request. +type ImportVariantsRequest struct { + // Required. The variant set to which variant data should be imported. + VariantSetId string `protobuf:"bytes,1,opt,name=variant_set_id,json=variantSetId" json:"variant_set_id,omitempty"` + // A list of URIs referencing variant files in Google Cloud Storage. URIs can + // include wildcards [as described + // here](https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNames). + // Note that recursive wildcards ('**') are not supported. + SourceUris []string `protobuf:"bytes,2,rep,name=source_uris,json=sourceUris" json:"source_uris,omitempty"` + // The format of the variant data being imported. If unspecified, defaults to + // to `VCF`. + Format ImportVariantsRequest_Format `protobuf:"varint,3,opt,name=format,enum=google.genomics.v1.ImportVariantsRequest_Format" json:"format,omitempty"` + // Convert reference names to the canonical representation. + // hg19 haploytypes (those reference names containing "_hap") + // are not modified in any way. + // All other reference names are modified according to the following rules: + // The reference name is capitalized. + // The "chr" prefix is dropped for all autosomes and sex chromsomes. + // For example "chr17" becomes "17" and "chrX" becomes "X". + // All mitochondrial chromosomes ("chrM", "chrMT", etc) become "MT". + NormalizeReferenceNames bool `protobuf:"varint,5,opt,name=normalize_reference_names,json=normalizeReferenceNames" json:"normalize_reference_names,omitempty"` + // A mapping between info field keys and the InfoMergeOperations to + // be performed on them. This is plumbed down to the MergeVariantRequests + // generated by the resulting import job. + InfoMergeConfig map[string]InfoMergeOperation `protobuf:"bytes,6,rep,name=info_merge_config,json=infoMergeConfig" json:"info_merge_config,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value,enum=google.genomics.v1.InfoMergeOperation"` +} + +func (m *ImportVariantsRequest) Reset() { *m = ImportVariantsRequest{} } +func (m *ImportVariantsRequest) String() string { return proto.CompactTextString(m) } +func (*ImportVariantsRequest) ProtoMessage() {} +func (*ImportVariantsRequest) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{6} } + +func (m *ImportVariantsRequest) GetVariantSetId() string { + if m != nil { + return m.VariantSetId + } + return "" +} + +func (m *ImportVariantsRequest) GetSourceUris() []string { + if m != nil { + return m.SourceUris + } + return nil +} + +func (m *ImportVariantsRequest) GetFormat() ImportVariantsRequest_Format { + if m != nil { + return m.Format + } + return ImportVariantsRequest_FORMAT_UNSPECIFIED +} + +func (m *ImportVariantsRequest) GetNormalizeReferenceNames() bool { + if m != nil { + return m.NormalizeReferenceNames + } + return false +} + +func (m *ImportVariantsRequest) GetInfoMergeConfig() map[string]InfoMergeOperation { + if m != nil { + return m.InfoMergeConfig + } + return nil +} + +// The variant data import response. +type ImportVariantsResponse struct { + // IDs of the call sets created during the import. + CallSetIds []string `protobuf:"bytes,1,rep,name=call_set_ids,json=callSetIds" json:"call_set_ids,omitempty"` +} + +func (m *ImportVariantsResponse) Reset() { *m = ImportVariantsResponse{} } +func (m *ImportVariantsResponse) String() string { return proto.CompactTextString(m) } +func (*ImportVariantsResponse) ProtoMessage() {} +func (*ImportVariantsResponse) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{7} } + +func (m *ImportVariantsResponse) GetCallSetIds() []string { + if m != nil { + return m.CallSetIds + } + return nil +} + +// The CreateVariantSet request +type CreateVariantSetRequest struct { + // Required. The variant set to be created. Must have a valid `datasetId`. + VariantSet *VariantSet `protobuf:"bytes,1,opt,name=variant_set,json=variantSet" json:"variant_set,omitempty"` +} + +func (m *CreateVariantSetRequest) Reset() { *m = CreateVariantSetRequest{} } +func (m *CreateVariantSetRequest) String() string { return proto.CompactTextString(m) } +func (*CreateVariantSetRequest) ProtoMessage() {} +func (*CreateVariantSetRequest) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{8} } + +func (m *CreateVariantSetRequest) GetVariantSet() *VariantSet { + if m != nil { + return m.VariantSet + } + return nil +} + +// The variant data export request. +type ExportVariantSetRequest struct { + // Required. The ID of the variant set that contains variant data which + // should be exported. The caller must have READ access to this variant set. + VariantSetId string `protobuf:"bytes,1,opt,name=variant_set_id,json=variantSetId" json:"variant_set_id,omitempty"` + // If provided, only variant call information from the specified call sets + // will be exported. By default all variant calls are exported. + CallSetIds []string `protobuf:"bytes,2,rep,name=call_set_ids,json=callSetIds" json:"call_set_ids,omitempty"` + // Required. The Google Cloud project ID that owns the destination + // BigQuery dataset. The caller must have WRITE access to this project. This + // project will also own the resulting export job. + ProjectId string `protobuf:"bytes,3,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The format for the exported data. + Format ExportVariantSetRequest_Format `protobuf:"varint,4,opt,name=format,enum=google.genomics.v1.ExportVariantSetRequest_Format" json:"format,omitempty"` + // Required. The BigQuery dataset to export data to. This dataset must already + // exist. Note that this is distinct from the Genomics concept of "dataset". + BigqueryDataset string `protobuf:"bytes,5,opt,name=bigquery_dataset,json=bigqueryDataset" json:"bigquery_dataset,omitempty"` + // Required. The BigQuery table to export data to. + // If the table doesn't exist, it will be created. If it already exists, it + // will be overwritten. + BigqueryTable string `protobuf:"bytes,6,opt,name=bigquery_table,json=bigqueryTable" json:"bigquery_table,omitempty"` +} + +func (m *ExportVariantSetRequest) Reset() { *m = ExportVariantSetRequest{} } +func (m *ExportVariantSetRequest) String() string { return proto.CompactTextString(m) } +func (*ExportVariantSetRequest) ProtoMessage() {} +func (*ExportVariantSetRequest) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{9} } + +func (m *ExportVariantSetRequest) GetVariantSetId() string { + if m != nil { + return m.VariantSetId + } + return "" +} + +func (m *ExportVariantSetRequest) GetCallSetIds() []string { + if m != nil { + return m.CallSetIds + } + return nil +} + +func (m *ExportVariantSetRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *ExportVariantSetRequest) GetFormat() ExportVariantSetRequest_Format { + if m != nil { + return m.Format + } + return ExportVariantSetRequest_FORMAT_UNSPECIFIED +} + +func (m *ExportVariantSetRequest) GetBigqueryDataset() string { + if m != nil { + return m.BigqueryDataset + } + return "" +} + +func (m *ExportVariantSetRequest) GetBigqueryTable() string { + if m != nil { + return m.BigqueryTable + } + return "" +} + +// The variant set request. +type GetVariantSetRequest struct { + // Required. The ID of the variant set. + VariantSetId string `protobuf:"bytes,1,opt,name=variant_set_id,json=variantSetId" json:"variant_set_id,omitempty"` +} + +func (m *GetVariantSetRequest) Reset() { *m = GetVariantSetRequest{} } +func (m *GetVariantSetRequest) String() string { return proto.CompactTextString(m) } +func (*GetVariantSetRequest) ProtoMessage() {} +func (*GetVariantSetRequest) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{10} } + +func (m *GetVariantSetRequest) GetVariantSetId() string { + if m != nil { + return m.VariantSetId + } + return "" +} + +// The search variant sets request. +type SearchVariantSetsRequest struct { + // Exactly one dataset ID must be provided here. Only variant sets which + // belong to this dataset will be returned. + DatasetIds []string `protobuf:"bytes,1,rep,name=dataset_ids,json=datasetIds" json:"dataset_ids,omitempty"` + // The continuation token, which is used to page through large result sets. + // To get the next page of results, set this parameter to the value of + // `nextPageToken` from the previous response. + PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` + // The maximum number of results to return in a single page. If unspecified, + // defaults to 1024. + PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` +} + +func (m *SearchVariantSetsRequest) Reset() { *m = SearchVariantSetsRequest{} } +func (m *SearchVariantSetsRequest) String() string { return proto.CompactTextString(m) } +func (*SearchVariantSetsRequest) ProtoMessage() {} +func (*SearchVariantSetsRequest) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{11} } + +func (m *SearchVariantSetsRequest) GetDatasetIds() []string { + if m != nil { + return m.DatasetIds + } + return nil +} + +func (m *SearchVariantSetsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +func (m *SearchVariantSetsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +// The search variant sets response. +type SearchVariantSetsResponse struct { + // The variant sets belonging to the requested dataset. + VariantSets []*VariantSet `protobuf:"bytes,1,rep,name=variant_sets,json=variantSets" json:"variant_sets,omitempty"` + // The continuation token, which is used to page through large result sets. + // Provide this value in a subsequent request to return the next page of + // results. This field will be empty if there aren't any additional results. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *SearchVariantSetsResponse) Reset() { *m = SearchVariantSetsResponse{} } +func (m *SearchVariantSetsResponse) String() string { return proto.CompactTextString(m) } +func (*SearchVariantSetsResponse) ProtoMessage() {} +func (*SearchVariantSetsResponse) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{12} } + +func (m *SearchVariantSetsResponse) GetVariantSets() []*VariantSet { + if m != nil { + return m.VariantSets + } + return nil +} + +func (m *SearchVariantSetsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// The delete variant set request. +type DeleteVariantSetRequest struct { + // The ID of the variant set to be deleted. + VariantSetId string `protobuf:"bytes,1,opt,name=variant_set_id,json=variantSetId" json:"variant_set_id,omitempty"` +} + +func (m *DeleteVariantSetRequest) Reset() { *m = DeleteVariantSetRequest{} } +func (m *DeleteVariantSetRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteVariantSetRequest) ProtoMessage() {} +func (*DeleteVariantSetRequest) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{13} } + +func (m *DeleteVariantSetRequest) GetVariantSetId() string { + if m != nil { + return m.VariantSetId + } + return "" +} + +type UpdateVariantSetRequest struct { + // The ID of the variant to be updated (must already exist). + VariantSetId string `protobuf:"bytes,1,opt,name=variant_set_id,json=variantSetId" json:"variant_set_id,omitempty"` + // The new variant data. Only the variant_set.metadata will be considered + // for update. + VariantSet *VariantSet `protobuf:"bytes,2,opt,name=variant_set,json=variantSet" json:"variant_set,omitempty"` + // An optional mask specifying which fields to update. Supported fields: + // + // * [metadata][google.genomics.v1.VariantSet.metadata]. + // * [name][google.genomics.v1.VariantSet.name]. + // * [description][google.genomics.v1.VariantSet.description]. + // + // Leaving `updateMask` unset is equivalent to specifying all mutable + // fields. + UpdateMask *google_protobuf2.FieldMask `protobuf:"bytes,5,opt,name=update_mask,json=updateMask" json:"update_mask,omitempty"` +} + +func (m *UpdateVariantSetRequest) Reset() { *m = UpdateVariantSetRequest{} } +func (m *UpdateVariantSetRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateVariantSetRequest) ProtoMessage() {} +func (*UpdateVariantSetRequest) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{14} } + +func (m *UpdateVariantSetRequest) GetVariantSetId() string { + if m != nil { + return m.VariantSetId + } + return "" +} + +func (m *UpdateVariantSetRequest) GetVariantSet() *VariantSet { + if m != nil { + return m.VariantSet + } + return nil +} + +func (m *UpdateVariantSetRequest) GetUpdateMask() *google_protobuf2.FieldMask { + if m != nil { + return m.UpdateMask + } + return nil +} + +// The variant search request. +type SearchVariantsRequest struct { + // At most one variant set ID must be provided. Only variants from this + // variant set will be returned. If omitted, a call set id must be included in + // the request. + VariantSetIds []string `protobuf:"bytes,1,rep,name=variant_set_ids,json=variantSetIds" json:"variant_set_ids,omitempty"` + // Only return variants which have exactly this name. + VariantName string `protobuf:"bytes,2,opt,name=variant_name,json=variantName" json:"variant_name,omitempty"` + // Only return variant calls which belong to call sets with these ids. + // Leaving this blank returns all variant calls. If a variant has no + // calls belonging to any of these call sets, it won't be returned at all. + CallSetIds []string `protobuf:"bytes,3,rep,name=call_set_ids,json=callSetIds" json:"call_set_ids,omitempty"` + // Required. Only return variants in this reference sequence. + ReferenceName string `protobuf:"bytes,4,opt,name=reference_name,json=referenceName" json:"reference_name,omitempty"` + // The beginning of the window (0-based, inclusive) for which + // overlapping variants should be returned. If unspecified, defaults to 0. + Start int64 `protobuf:"varint,5,opt,name=start" json:"start,omitempty"` + // The end of the window, 0-based exclusive. If unspecified or 0, defaults to + // the length of the reference. + End int64 `protobuf:"varint,6,opt,name=end" json:"end,omitempty"` + // The continuation token, which is used to page through large result sets. + // To get the next page of results, set this parameter to the value of + // `nextPageToken` from the previous response. + PageToken string `protobuf:"bytes,7,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` + // The maximum number of variants to return in a single page. If unspecified, + // defaults to 5000. The maximum value is 10000. + PageSize int32 `protobuf:"varint,8,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // The maximum number of calls to return in a single page. Note that this + // limit may be exceeded in the event that a matching variant contains more + // calls than the requested maximum. If unspecified, defaults to 5000. The + // maximum value is 10000. + MaxCalls int32 `protobuf:"varint,9,opt,name=max_calls,json=maxCalls" json:"max_calls,omitempty"` +} + +func (m *SearchVariantsRequest) Reset() { *m = SearchVariantsRequest{} } +func (m *SearchVariantsRequest) String() string { return proto.CompactTextString(m) } +func (*SearchVariantsRequest) ProtoMessage() {} +func (*SearchVariantsRequest) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{15} } + +func (m *SearchVariantsRequest) GetVariantSetIds() []string { + if m != nil { + return m.VariantSetIds + } + return nil +} + +func (m *SearchVariantsRequest) GetVariantName() string { + if m != nil { + return m.VariantName + } + return "" +} + +func (m *SearchVariantsRequest) GetCallSetIds() []string { + if m != nil { + return m.CallSetIds + } + return nil +} + +func (m *SearchVariantsRequest) GetReferenceName() string { + if m != nil { + return m.ReferenceName + } + return "" +} + +func (m *SearchVariantsRequest) GetStart() int64 { + if m != nil { + return m.Start + } + return 0 +} + +func (m *SearchVariantsRequest) GetEnd() int64 { + if m != nil { + return m.End + } + return 0 +} + +func (m *SearchVariantsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +func (m *SearchVariantsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *SearchVariantsRequest) GetMaxCalls() int32 { + if m != nil { + return m.MaxCalls + } + return 0 +} + +// The variant search response. +type SearchVariantsResponse struct { + // The list of matching Variants. + Variants []*Variant `protobuf:"bytes,1,rep,name=variants" json:"variants,omitempty"` + // The continuation token, which is used to page through large result sets. + // Provide this value in a subsequent request to return the next page of + // results. This field will be empty if there aren't any additional results. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *SearchVariantsResponse) Reset() { *m = SearchVariantsResponse{} } +func (m *SearchVariantsResponse) String() string { return proto.CompactTextString(m) } +func (*SearchVariantsResponse) ProtoMessage() {} +func (*SearchVariantsResponse) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{16} } + +func (m *SearchVariantsResponse) GetVariants() []*Variant { + if m != nil { + return m.Variants + } + return nil +} + +func (m *SearchVariantsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +type CreateVariantRequest struct { + // The variant to be created. + Variant *Variant `protobuf:"bytes,1,opt,name=variant" json:"variant,omitempty"` +} + +func (m *CreateVariantRequest) Reset() { *m = CreateVariantRequest{} } +func (m *CreateVariantRequest) String() string { return proto.CompactTextString(m) } +func (*CreateVariantRequest) ProtoMessage() {} +func (*CreateVariantRequest) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{17} } + +func (m *CreateVariantRequest) GetVariant() *Variant { + if m != nil { + return m.Variant + } + return nil +} + +type UpdateVariantRequest struct { + // The ID of the variant to be updated. + VariantId string `protobuf:"bytes,1,opt,name=variant_id,json=variantId" json:"variant_id,omitempty"` + // The new variant data. + Variant *Variant `protobuf:"bytes,2,opt,name=variant" json:"variant,omitempty"` + // An optional mask specifying which fields to update. At this time, mutable + // fields are [names][google.genomics.v1.Variant.names] and + // [info][google.genomics.v1.Variant.info]. Acceptable values are "names" and + // "info". If unspecified, all mutable fields will be updated. + UpdateMask *google_protobuf2.FieldMask `protobuf:"bytes,3,opt,name=update_mask,json=updateMask" json:"update_mask,omitempty"` +} + +func (m *UpdateVariantRequest) Reset() { *m = UpdateVariantRequest{} } +func (m *UpdateVariantRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateVariantRequest) ProtoMessage() {} +func (*UpdateVariantRequest) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{18} } + +func (m *UpdateVariantRequest) GetVariantId() string { + if m != nil { + return m.VariantId + } + return "" +} + +func (m *UpdateVariantRequest) GetVariant() *Variant { + if m != nil { + return m.Variant + } + return nil +} + +func (m *UpdateVariantRequest) GetUpdateMask() *google_protobuf2.FieldMask { + if m != nil { + return m.UpdateMask + } + return nil +} + +type DeleteVariantRequest struct { + // The ID of the variant to be deleted. + VariantId string `protobuf:"bytes,1,opt,name=variant_id,json=variantId" json:"variant_id,omitempty"` +} + +func (m *DeleteVariantRequest) Reset() { *m = DeleteVariantRequest{} } +func (m *DeleteVariantRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteVariantRequest) ProtoMessage() {} +func (*DeleteVariantRequest) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{19} } + +func (m *DeleteVariantRequest) GetVariantId() string { + if m != nil { + return m.VariantId + } + return "" +} + +type GetVariantRequest struct { + // The ID of the variant. + VariantId string `protobuf:"bytes,1,opt,name=variant_id,json=variantId" json:"variant_id,omitempty"` +} + +func (m *GetVariantRequest) Reset() { *m = GetVariantRequest{} } +func (m *GetVariantRequest) String() string { return proto.CompactTextString(m) } +func (*GetVariantRequest) ProtoMessage() {} +func (*GetVariantRequest) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{20} } + +func (m *GetVariantRequest) GetVariantId() string { + if m != nil { + return m.VariantId + } + return "" +} + +type MergeVariantsRequest struct { + // The destination variant set. + VariantSetId string `protobuf:"bytes,1,opt,name=variant_set_id,json=variantSetId" json:"variant_set_id,omitempty"` + // The variants to be merged with existing variants. + Variants []*Variant `protobuf:"bytes,2,rep,name=variants" json:"variants,omitempty"` + // A mapping between info field keys and the InfoMergeOperations to + // be performed on them. + InfoMergeConfig map[string]InfoMergeOperation `protobuf:"bytes,3,rep,name=info_merge_config,json=infoMergeConfig" json:"info_merge_config,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value,enum=google.genomics.v1.InfoMergeOperation"` +} + +func (m *MergeVariantsRequest) Reset() { *m = MergeVariantsRequest{} } +func (m *MergeVariantsRequest) String() string { return proto.CompactTextString(m) } +func (*MergeVariantsRequest) ProtoMessage() {} +func (*MergeVariantsRequest) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{21} } + +func (m *MergeVariantsRequest) GetVariantSetId() string { + if m != nil { + return m.VariantSetId + } + return "" +} + +func (m *MergeVariantsRequest) GetVariants() []*Variant { + if m != nil { + return m.Variants + } + return nil +} + +func (m *MergeVariantsRequest) GetInfoMergeConfig() map[string]InfoMergeOperation { + if m != nil { + return m.InfoMergeConfig + } + return nil +} + +// The call set search request. +type SearchCallSetsRequest struct { + // Restrict the query to call sets within the given variant sets. At least one + // ID must be provided. + VariantSetIds []string `protobuf:"bytes,1,rep,name=variant_set_ids,json=variantSetIds" json:"variant_set_ids,omitempty"` + // Only return call sets for which a substring of the name matches this + // string. + Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` + // The continuation token, which is used to page through large result sets. + // To get the next page of results, set this parameter to the value of + // `nextPageToken` from the previous response. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` + // The maximum number of results to return in a single page. If unspecified, + // defaults to 1024. + PageSize int32 `protobuf:"varint,4,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` +} + +func (m *SearchCallSetsRequest) Reset() { *m = SearchCallSetsRequest{} } +func (m *SearchCallSetsRequest) String() string { return proto.CompactTextString(m) } +func (*SearchCallSetsRequest) ProtoMessage() {} +func (*SearchCallSetsRequest) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{22} } + +func (m *SearchCallSetsRequest) GetVariantSetIds() []string { + if m != nil { + return m.VariantSetIds + } + return nil +} + +func (m *SearchCallSetsRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *SearchCallSetsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +func (m *SearchCallSetsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +// The call set search response. +type SearchCallSetsResponse struct { + // The list of matching call sets. + CallSets []*CallSet `protobuf:"bytes,1,rep,name=call_sets,json=callSets" json:"call_sets,omitempty"` + // The continuation token, which is used to page through large result sets. + // Provide this value in a subsequent request to return the next page of + // results. This field will be empty if there aren't any additional results. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *SearchCallSetsResponse) Reset() { *m = SearchCallSetsResponse{} } +func (m *SearchCallSetsResponse) String() string { return proto.CompactTextString(m) } +func (*SearchCallSetsResponse) ProtoMessage() {} +func (*SearchCallSetsResponse) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{23} } + +func (m *SearchCallSetsResponse) GetCallSets() []*CallSet { + if m != nil { + return m.CallSets + } + return nil +} + +func (m *SearchCallSetsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +type CreateCallSetRequest struct { + // The call set to be created. + CallSet *CallSet `protobuf:"bytes,1,opt,name=call_set,json=callSet" json:"call_set,omitempty"` +} + +func (m *CreateCallSetRequest) Reset() { *m = CreateCallSetRequest{} } +func (m *CreateCallSetRequest) String() string { return proto.CompactTextString(m) } +func (*CreateCallSetRequest) ProtoMessage() {} +func (*CreateCallSetRequest) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{24} } + +func (m *CreateCallSetRequest) GetCallSet() *CallSet { + if m != nil { + return m.CallSet + } + return nil +} + +type UpdateCallSetRequest struct { + // The ID of the call set to be updated. + CallSetId string `protobuf:"bytes,1,opt,name=call_set_id,json=callSetId" json:"call_set_id,omitempty"` + // The new call set data. + CallSet *CallSet `protobuf:"bytes,2,opt,name=call_set,json=callSet" json:"call_set,omitempty"` + // An optional mask specifying which fields to update. At this time, the only + // mutable field is [name][google.genomics.v1.CallSet.name]. The only + // acceptable value is "name". If unspecified, all mutable fields will be + // updated. + UpdateMask *google_protobuf2.FieldMask `protobuf:"bytes,3,opt,name=update_mask,json=updateMask" json:"update_mask,omitempty"` +} + +func (m *UpdateCallSetRequest) Reset() { *m = UpdateCallSetRequest{} } +func (m *UpdateCallSetRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateCallSetRequest) ProtoMessage() {} +func (*UpdateCallSetRequest) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{25} } + +func (m *UpdateCallSetRequest) GetCallSetId() string { + if m != nil { + return m.CallSetId + } + return "" +} + +func (m *UpdateCallSetRequest) GetCallSet() *CallSet { + if m != nil { + return m.CallSet + } + return nil +} + +func (m *UpdateCallSetRequest) GetUpdateMask() *google_protobuf2.FieldMask { + if m != nil { + return m.UpdateMask + } + return nil +} + +type DeleteCallSetRequest struct { + // The ID of the call set to be deleted. + CallSetId string `protobuf:"bytes,1,opt,name=call_set_id,json=callSetId" json:"call_set_id,omitempty"` +} + +func (m *DeleteCallSetRequest) Reset() { *m = DeleteCallSetRequest{} } +func (m *DeleteCallSetRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteCallSetRequest) ProtoMessage() {} +func (*DeleteCallSetRequest) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{26} } + +func (m *DeleteCallSetRequest) GetCallSetId() string { + if m != nil { + return m.CallSetId + } + return "" +} + +type GetCallSetRequest struct { + // The ID of the call set. + CallSetId string `protobuf:"bytes,1,opt,name=call_set_id,json=callSetId" json:"call_set_id,omitempty"` +} + +func (m *GetCallSetRequest) Reset() { *m = GetCallSetRequest{} } +func (m *GetCallSetRequest) String() string { return proto.CompactTextString(m) } +func (*GetCallSetRequest) ProtoMessage() {} +func (*GetCallSetRequest) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{27} } + +func (m *GetCallSetRequest) GetCallSetId() string { + if m != nil { + return m.CallSetId + } + return "" +} + +// The stream variants request. +type StreamVariantsRequest struct { + // The Google Cloud project ID which will be billed + // for this access. The caller must have WRITE access to this project. + // Required. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The variant set ID from which to stream variants. + VariantSetId string `protobuf:"bytes,2,opt,name=variant_set_id,json=variantSetId" json:"variant_set_id,omitempty"` + // Only return variant calls which belong to call sets with these IDs. + // Leaving this blank returns all variant calls. + CallSetIds []string `protobuf:"bytes,3,rep,name=call_set_ids,json=callSetIds" json:"call_set_ids,omitempty"` + // Required. Only return variants in this reference sequence. + ReferenceName string `protobuf:"bytes,4,opt,name=reference_name,json=referenceName" json:"reference_name,omitempty"` + // The beginning of the window (0-based, inclusive) for which + // overlapping variants should be returned. + Start int64 `protobuf:"varint,5,opt,name=start" json:"start,omitempty"` + // The end of the window (0-based, exclusive) for which overlapping + // variants should be returned. + End int64 `protobuf:"varint,6,opt,name=end" json:"end,omitempty"` +} + +func (m *StreamVariantsRequest) Reset() { *m = StreamVariantsRequest{} } +func (m *StreamVariantsRequest) String() string { return proto.CompactTextString(m) } +func (*StreamVariantsRequest) ProtoMessage() {} +func (*StreamVariantsRequest) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{28} } + +func (m *StreamVariantsRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *StreamVariantsRequest) GetVariantSetId() string { + if m != nil { + return m.VariantSetId + } + return "" +} + +func (m *StreamVariantsRequest) GetCallSetIds() []string { + if m != nil { + return m.CallSetIds + } + return nil +} + +func (m *StreamVariantsRequest) GetReferenceName() string { + if m != nil { + return m.ReferenceName + } + return "" +} + +func (m *StreamVariantsRequest) GetStart() int64 { + if m != nil { + return m.Start + } + return 0 +} + +func (m *StreamVariantsRequest) GetEnd() int64 { + if m != nil { + return m.End + } + return 0 +} + +type StreamVariantsResponse struct { + Variants []*Variant `protobuf:"bytes,1,rep,name=variants" json:"variants,omitempty"` +} + +func (m *StreamVariantsResponse) Reset() { *m = StreamVariantsResponse{} } +func (m *StreamVariantsResponse) String() string { return proto.CompactTextString(m) } +func (*StreamVariantsResponse) ProtoMessage() {} +func (*StreamVariantsResponse) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{29} } + +func (m *StreamVariantsResponse) GetVariants() []*Variant { + if m != nil { + return m.Variants + } + return nil +} + +func init() { + proto.RegisterType((*VariantSetMetadata)(nil), "google.genomics.v1.VariantSetMetadata") + proto.RegisterType((*VariantSet)(nil), "google.genomics.v1.VariantSet") + proto.RegisterType((*Variant)(nil), "google.genomics.v1.Variant") + proto.RegisterType((*VariantCall)(nil), "google.genomics.v1.VariantCall") + proto.RegisterType((*CallSet)(nil), "google.genomics.v1.CallSet") + proto.RegisterType((*ReferenceBound)(nil), "google.genomics.v1.ReferenceBound") + proto.RegisterType((*ImportVariantsRequest)(nil), "google.genomics.v1.ImportVariantsRequest") + proto.RegisterType((*ImportVariantsResponse)(nil), "google.genomics.v1.ImportVariantsResponse") + proto.RegisterType((*CreateVariantSetRequest)(nil), "google.genomics.v1.CreateVariantSetRequest") + proto.RegisterType((*ExportVariantSetRequest)(nil), "google.genomics.v1.ExportVariantSetRequest") + proto.RegisterType((*GetVariantSetRequest)(nil), "google.genomics.v1.GetVariantSetRequest") + proto.RegisterType((*SearchVariantSetsRequest)(nil), "google.genomics.v1.SearchVariantSetsRequest") + proto.RegisterType((*SearchVariantSetsResponse)(nil), "google.genomics.v1.SearchVariantSetsResponse") + proto.RegisterType((*DeleteVariantSetRequest)(nil), "google.genomics.v1.DeleteVariantSetRequest") + proto.RegisterType((*UpdateVariantSetRequest)(nil), "google.genomics.v1.UpdateVariantSetRequest") + proto.RegisterType((*SearchVariantsRequest)(nil), "google.genomics.v1.SearchVariantsRequest") + proto.RegisterType((*SearchVariantsResponse)(nil), "google.genomics.v1.SearchVariantsResponse") + proto.RegisterType((*CreateVariantRequest)(nil), "google.genomics.v1.CreateVariantRequest") + proto.RegisterType((*UpdateVariantRequest)(nil), "google.genomics.v1.UpdateVariantRequest") + proto.RegisterType((*DeleteVariantRequest)(nil), "google.genomics.v1.DeleteVariantRequest") + proto.RegisterType((*GetVariantRequest)(nil), "google.genomics.v1.GetVariantRequest") + proto.RegisterType((*MergeVariantsRequest)(nil), "google.genomics.v1.MergeVariantsRequest") + proto.RegisterType((*SearchCallSetsRequest)(nil), "google.genomics.v1.SearchCallSetsRequest") + proto.RegisterType((*SearchCallSetsResponse)(nil), "google.genomics.v1.SearchCallSetsResponse") + proto.RegisterType((*CreateCallSetRequest)(nil), "google.genomics.v1.CreateCallSetRequest") + proto.RegisterType((*UpdateCallSetRequest)(nil), "google.genomics.v1.UpdateCallSetRequest") + proto.RegisterType((*DeleteCallSetRequest)(nil), "google.genomics.v1.DeleteCallSetRequest") + proto.RegisterType((*GetCallSetRequest)(nil), "google.genomics.v1.GetCallSetRequest") + proto.RegisterType((*StreamVariantsRequest)(nil), "google.genomics.v1.StreamVariantsRequest") + proto.RegisterType((*StreamVariantsResponse)(nil), "google.genomics.v1.StreamVariantsResponse") + proto.RegisterEnum("google.genomics.v1.InfoMergeOperation", InfoMergeOperation_name, InfoMergeOperation_value) + proto.RegisterEnum("google.genomics.v1.VariantSetMetadata_Type", VariantSetMetadata_Type_name, VariantSetMetadata_Type_value) + proto.RegisterEnum("google.genomics.v1.ImportVariantsRequest_Format", ImportVariantsRequest_Format_name, ImportVariantsRequest_Format_value) + proto.RegisterEnum("google.genomics.v1.ExportVariantSetRequest_Format", ExportVariantSetRequest_Format_name, ExportVariantSetRequest_Format_value) +} + +// 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 + +// Client API for StreamingVariantService service + +type StreamingVariantServiceClient interface { + // Returns a stream of all the variants matching the search request, ordered + // by reference name, position, and ID. + StreamVariants(ctx context.Context, in *StreamVariantsRequest, opts ...grpc.CallOption) (StreamingVariantService_StreamVariantsClient, error) +} + +type streamingVariantServiceClient struct { + cc *grpc.ClientConn +} + +func NewStreamingVariantServiceClient(cc *grpc.ClientConn) StreamingVariantServiceClient { + return &streamingVariantServiceClient{cc} +} + +func (c *streamingVariantServiceClient) StreamVariants(ctx context.Context, in *StreamVariantsRequest, opts ...grpc.CallOption) (StreamingVariantService_StreamVariantsClient, error) { + stream, err := grpc.NewClientStream(ctx, &_StreamingVariantService_serviceDesc.Streams[0], c.cc, "/google.genomics.v1.StreamingVariantService/StreamVariants", opts...) + if err != nil { + return nil, err + } + x := &streamingVariantServiceStreamVariantsClient{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 StreamingVariantService_StreamVariantsClient interface { + Recv() (*StreamVariantsResponse, error) + grpc.ClientStream +} + +type streamingVariantServiceStreamVariantsClient struct { + grpc.ClientStream +} + +func (x *streamingVariantServiceStreamVariantsClient) Recv() (*StreamVariantsResponse, error) { + m := new(StreamVariantsResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// Server API for StreamingVariantService service + +type StreamingVariantServiceServer interface { + // Returns a stream of all the variants matching the search request, ordered + // by reference name, position, and ID. + StreamVariants(*StreamVariantsRequest, StreamingVariantService_StreamVariantsServer) error +} + +func RegisterStreamingVariantServiceServer(s *grpc.Server, srv StreamingVariantServiceServer) { + s.RegisterService(&_StreamingVariantService_serviceDesc, srv) +} + +func _StreamingVariantService_StreamVariants_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(StreamVariantsRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(StreamingVariantServiceServer).StreamVariants(m, &streamingVariantServiceStreamVariantsServer{stream}) +} + +type StreamingVariantService_StreamVariantsServer interface { + Send(*StreamVariantsResponse) error + grpc.ServerStream +} + +type streamingVariantServiceStreamVariantsServer struct { + grpc.ServerStream +} + +func (x *streamingVariantServiceStreamVariantsServer) Send(m *StreamVariantsResponse) error { + return x.ServerStream.SendMsg(m) +} + +var _StreamingVariantService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.genomics.v1.StreamingVariantService", + HandlerType: (*StreamingVariantServiceServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "StreamVariants", + Handler: _StreamingVariantService_StreamVariants_Handler, + ServerStreams: true, + }, + }, + Metadata: "google/genomics/v1/variants.proto", +} + +// Client API for VariantServiceV1 service + +type VariantServiceV1Client interface { + // Creates variant data by asynchronously importing the provided information. + // + // For the definitions of variant sets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // The variants for import will be merged with any existing variant that + // matches its reference sequence, start, end, reference bases, and + // alternative bases. If no such variant exists, a new one will be created. + // + // When variants are merged, the call information from the new variant + // is added to the existing variant, and Variant info fields are merged + // as specified in + // [infoMergeConfig][google.genomics.v1.ImportVariantsRequest.info_merge_config]. + // As a special case, for single-sample VCF files, QUAL and FILTER fields will + // be moved to the call level; these are sometimes interpreted in a + // call-specific context. + // Imported VCF headers are appended to the metadata already in a variant set. + ImportVariants(ctx context.Context, in *ImportVariantsRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Creates a new variant set. + // + // For the definitions of variant sets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // The provided variant set must have a valid `datasetId` set - all other + // fields are optional. Note that the `id` field will be ignored, as this is + // assigned by the server. + CreateVariantSet(ctx context.Context, in *CreateVariantSetRequest, opts ...grpc.CallOption) (*VariantSet, error) + // Exports variant set data to an external destination. + // + // For the definitions of variant sets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + ExportVariantSet(ctx context.Context, in *ExportVariantSetRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Gets a variant set by ID. + // + // For the definitions of variant sets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + GetVariantSet(ctx context.Context, in *GetVariantSetRequest, opts ...grpc.CallOption) (*VariantSet, error) + // Returns a list of all variant sets matching search criteria. + // + // For the definitions of variant sets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // Implements + // [GlobalAllianceApi.searchVariantSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L49). + SearchVariantSets(ctx context.Context, in *SearchVariantSetsRequest, opts ...grpc.CallOption) (*SearchVariantSetsResponse, error) + // Deletes a variant set including all variants, call sets, and calls within. + // This is not reversible. + // + // For the definitions of variant sets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + DeleteVariantSet(ctx context.Context, in *DeleteVariantSetRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) + // Updates a variant set using patch semantics. + // + // For the definitions of variant sets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + UpdateVariantSet(ctx context.Context, in *UpdateVariantSetRequest, opts ...grpc.CallOption) (*VariantSet, error) + // Gets a list of variants matching the criteria. + // + // For the definitions of variants and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // Implements + // [GlobalAllianceApi.searchVariants](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L126). + SearchVariants(ctx context.Context, in *SearchVariantsRequest, opts ...grpc.CallOption) (*SearchVariantsResponse, error) + // Creates a new variant. + // + // For the definitions of variants and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + CreateVariant(ctx context.Context, in *CreateVariantRequest, opts ...grpc.CallOption) (*Variant, error) + // Updates a variant. + // + // For the definitions of variants and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // This method supports patch semantics. Returns the modified variant without + // its calls. + UpdateVariant(ctx context.Context, in *UpdateVariantRequest, opts ...grpc.CallOption) (*Variant, error) + // Deletes a variant. + // + // For the definitions of variants and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + DeleteVariant(ctx context.Context, in *DeleteVariantRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) + // Gets a variant by ID. + // + // For the definitions of variants and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + GetVariant(ctx context.Context, in *GetVariantRequest, opts ...grpc.CallOption) (*Variant, error) + // Merges the given variants with existing variants. + // + // For the definitions of variants and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // Each variant will be + // merged with an existing variant that matches its reference sequence, + // start, end, reference bases, and alternative bases. If no such variant + // exists, a new one will be created. + // + // When variants are merged, the call information from the new variant + // is added to the existing variant. Variant info fields are merged as + // specified in the + // [infoMergeConfig][google.genomics.v1.MergeVariantsRequest.info_merge_config] + // field of the MergeVariantsRequest. + // + // Please exercise caution when using this method! It is easy to introduce + // mistakes in existing variants and difficult to back out of them. For + // example, + // suppose you were trying to merge a new variant with an existing one and + // both + // variants contain calls that belong to callsets with the same callset ID. + // + // // Existing variant - irrelevant fields trimmed for clarity + // { + // "variantSetId": "10473108253681171589", + // "referenceName": "1", + // "start": "10582", + // "referenceBases": "G", + // "alternateBases": [ + // "A" + // ], + // "calls": [ + // { + // "callSetId": "10473108253681171589-0", + // "callSetName": "CALLSET0", + // "genotype": [ + // 0, + // 1 + // ], + // } + // ] + // } + // + // // New variant with conflicting call information + // { + // "variantSetId": "10473108253681171589", + // "referenceName": "1", + // "start": "10582", + // "referenceBases": "G", + // "alternateBases": [ + // "A" + // ], + // "calls": [ + // { + // "callSetId": "10473108253681171589-0", + // "callSetName": "CALLSET0", + // "genotype": [ + // 1, + // 1 + // ], + // } + // ] + // } + // + // The resulting merged variant would overwrite the existing calls with those + // from the new variant: + // + // { + // "variantSetId": "10473108253681171589", + // "referenceName": "1", + // "start": "10582", + // "referenceBases": "G", + // "alternateBases": [ + // "A" + // ], + // "calls": [ + // { + // "callSetId": "10473108253681171589-0", + // "callSetName": "CALLSET0", + // "genotype": [ + // 1, + // 1 + // ], + // } + // ] + // } + // + // This may be the desired outcome, but it is up to the user to determine if + // if that is indeed the case. + MergeVariants(ctx context.Context, in *MergeVariantsRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) + // Gets a list of call sets matching the criteria. + // + // For the definitions of call sets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // Implements + // [GlobalAllianceApi.searchCallSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L178). + SearchCallSets(ctx context.Context, in *SearchCallSetsRequest, opts ...grpc.CallOption) (*SearchCallSetsResponse, error) + // Creates a new call set. + // + // For the definitions of call sets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + CreateCallSet(ctx context.Context, in *CreateCallSetRequest, opts ...grpc.CallOption) (*CallSet, error) + // Updates a call set. + // + // For the definitions of call sets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // This method supports patch semantics. + UpdateCallSet(ctx context.Context, in *UpdateCallSetRequest, opts ...grpc.CallOption) (*CallSet, error) + // Deletes a call set. + // + // For the definitions of call sets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + DeleteCallSet(ctx context.Context, in *DeleteCallSetRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) + // Gets a call set by ID. + // + // For the definitions of call sets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + GetCallSet(ctx context.Context, in *GetCallSetRequest, opts ...grpc.CallOption) (*CallSet, error) +} + +type variantServiceV1Client struct { + cc *grpc.ClientConn +} + +func NewVariantServiceV1Client(cc *grpc.ClientConn) VariantServiceV1Client { + return &variantServiceV1Client{cc} +} + +func (c *variantServiceV1Client) ImportVariants(ctx context.Context, in *ImportVariantsRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.genomics.v1.VariantServiceV1/ImportVariants", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *variantServiceV1Client) CreateVariantSet(ctx context.Context, in *CreateVariantSetRequest, opts ...grpc.CallOption) (*VariantSet, error) { + out := new(VariantSet) + err := grpc.Invoke(ctx, "/google.genomics.v1.VariantServiceV1/CreateVariantSet", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *variantServiceV1Client) ExportVariantSet(ctx context.Context, in *ExportVariantSetRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.genomics.v1.VariantServiceV1/ExportVariantSet", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *variantServiceV1Client) GetVariantSet(ctx context.Context, in *GetVariantSetRequest, opts ...grpc.CallOption) (*VariantSet, error) { + out := new(VariantSet) + err := grpc.Invoke(ctx, "/google.genomics.v1.VariantServiceV1/GetVariantSet", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *variantServiceV1Client) SearchVariantSets(ctx context.Context, in *SearchVariantSetsRequest, opts ...grpc.CallOption) (*SearchVariantSetsResponse, error) { + out := new(SearchVariantSetsResponse) + err := grpc.Invoke(ctx, "/google.genomics.v1.VariantServiceV1/SearchVariantSets", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *variantServiceV1Client) DeleteVariantSet(ctx context.Context, in *DeleteVariantSetRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { + out := new(google_protobuf1.Empty) + err := grpc.Invoke(ctx, "/google.genomics.v1.VariantServiceV1/DeleteVariantSet", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *variantServiceV1Client) UpdateVariantSet(ctx context.Context, in *UpdateVariantSetRequest, opts ...grpc.CallOption) (*VariantSet, error) { + out := new(VariantSet) + err := grpc.Invoke(ctx, "/google.genomics.v1.VariantServiceV1/UpdateVariantSet", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *variantServiceV1Client) SearchVariants(ctx context.Context, in *SearchVariantsRequest, opts ...grpc.CallOption) (*SearchVariantsResponse, error) { + out := new(SearchVariantsResponse) + err := grpc.Invoke(ctx, "/google.genomics.v1.VariantServiceV1/SearchVariants", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *variantServiceV1Client) CreateVariant(ctx context.Context, in *CreateVariantRequest, opts ...grpc.CallOption) (*Variant, error) { + out := new(Variant) + err := grpc.Invoke(ctx, "/google.genomics.v1.VariantServiceV1/CreateVariant", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *variantServiceV1Client) UpdateVariant(ctx context.Context, in *UpdateVariantRequest, opts ...grpc.CallOption) (*Variant, error) { + out := new(Variant) + err := grpc.Invoke(ctx, "/google.genomics.v1.VariantServiceV1/UpdateVariant", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *variantServiceV1Client) DeleteVariant(ctx context.Context, in *DeleteVariantRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { + out := new(google_protobuf1.Empty) + err := grpc.Invoke(ctx, "/google.genomics.v1.VariantServiceV1/DeleteVariant", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *variantServiceV1Client) GetVariant(ctx context.Context, in *GetVariantRequest, opts ...grpc.CallOption) (*Variant, error) { + out := new(Variant) + err := grpc.Invoke(ctx, "/google.genomics.v1.VariantServiceV1/GetVariant", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *variantServiceV1Client) MergeVariants(ctx context.Context, in *MergeVariantsRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { + out := new(google_protobuf1.Empty) + err := grpc.Invoke(ctx, "/google.genomics.v1.VariantServiceV1/MergeVariants", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *variantServiceV1Client) SearchCallSets(ctx context.Context, in *SearchCallSetsRequest, opts ...grpc.CallOption) (*SearchCallSetsResponse, error) { + out := new(SearchCallSetsResponse) + err := grpc.Invoke(ctx, "/google.genomics.v1.VariantServiceV1/SearchCallSets", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *variantServiceV1Client) CreateCallSet(ctx context.Context, in *CreateCallSetRequest, opts ...grpc.CallOption) (*CallSet, error) { + out := new(CallSet) + err := grpc.Invoke(ctx, "/google.genomics.v1.VariantServiceV1/CreateCallSet", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *variantServiceV1Client) UpdateCallSet(ctx context.Context, in *UpdateCallSetRequest, opts ...grpc.CallOption) (*CallSet, error) { + out := new(CallSet) + err := grpc.Invoke(ctx, "/google.genomics.v1.VariantServiceV1/UpdateCallSet", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *variantServiceV1Client) DeleteCallSet(ctx context.Context, in *DeleteCallSetRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { + out := new(google_protobuf1.Empty) + err := grpc.Invoke(ctx, "/google.genomics.v1.VariantServiceV1/DeleteCallSet", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *variantServiceV1Client) GetCallSet(ctx context.Context, in *GetCallSetRequest, opts ...grpc.CallOption) (*CallSet, error) { + out := new(CallSet) + err := grpc.Invoke(ctx, "/google.genomics.v1.VariantServiceV1/GetCallSet", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for VariantServiceV1 service + +type VariantServiceV1Server interface { + // Creates variant data by asynchronously importing the provided information. + // + // For the definitions of variant sets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // The variants for import will be merged with any existing variant that + // matches its reference sequence, start, end, reference bases, and + // alternative bases. If no such variant exists, a new one will be created. + // + // When variants are merged, the call information from the new variant + // is added to the existing variant, and Variant info fields are merged + // as specified in + // [infoMergeConfig][google.genomics.v1.ImportVariantsRequest.info_merge_config]. + // As a special case, for single-sample VCF files, QUAL and FILTER fields will + // be moved to the call level; these are sometimes interpreted in a + // call-specific context. + // Imported VCF headers are appended to the metadata already in a variant set. + ImportVariants(context.Context, *ImportVariantsRequest) (*google_longrunning.Operation, error) + // Creates a new variant set. + // + // For the definitions of variant sets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // The provided variant set must have a valid `datasetId` set - all other + // fields are optional. Note that the `id` field will be ignored, as this is + // assigned by the server. + CreateVariantSet(context.Context, *CreateVariantSetRequest) (*VariantSet, error) + // Exports variant set data to an external destination. + // + // For the definitions of variant sets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + ExportVariantSet(context.Context, *ExportVariantSetRequest) (*google_longrunning.Operation, error) + // Gets a variant set by ID. + // + // For the definitions of variant sets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + GetVariantSet(context.Context, *GetVariantSetRequest) (*VariantSet, error) + // Returns a list of all variant sets matching search criteria. + // + // For the definitions of variant sets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // Implements + // [GlobalAllianceApi.searchVariantSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L49). + SearchVariantSets(context.Context, *SearchVariantSetsRequest) (*SearchVariantSetsResponse, error) + // Deletes a variant set including all variants, call sets, and calls within. + // This is not reversible. + // + // For the definitions of variant sets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + DeleteVariantSet(context.Context, *DeleteVariantSetRequest) (*google_protobuf1.Empty, error) + // Updates a variant set using patch semantics. + // + // For the definitions of variant sets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + UpdateVariantSet(context.Context, *UpdateVariantSetRequest) (*VariantSet, error) + // Gets a list of variants matching the criteria. + // + // For the definitions of variants and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // Implements + // [GlobalAllianceApi.searchVariants](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L126). + SearchVariants(context.Context, *SearchVariantsRequest) (*SearchVariantsResponse, error) + // Creates a new variant. + // + // For the definitions of variants and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + CreateVariant(context.Context, *CreateVariantRequest) (*Variant, error) + // Updates a variant. + // + // For the definitions of variants and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // This method supports patch semantics. Returns the modified variant without + // its calls. + UpdateVariant(context.Context, *UpdateVariantRequest) (*Variant, error) + // Deletes a variant. + // + // For the definitions of variants and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + DeleteVariant(context.Context, *DeleteVariantRequest) (*google_protobuf1.Empty, error) + // Gets a variant by ID. + // + // For the definitions of variants and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + GetVariant(context.Context, *GetVariantRequest) (*Variant, error) + // Merges the given variants with existing variants. + // + // For the definitions of variants and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // Each variant will be + // merged with an existing variant that matches its reference sequence, + // start, end, reference bases, and alternative bases. If no such variant + // exists, a new one will be created. + // + // When variants are merged, the call information from the new variant + // is added to the existing variant. Variant info fields are merged as + // specified in the + // [infoMergeConfig][google.genomics.v1.MergeVariantsRequest.info_merge_config] + // field of the MergeVariantsRequest. + // + // Please exercise caution when using this method! It is easy to introduce + // mistakes in existing variants and difficult to back out of them. For + // example, + // suppose you were trying to merge a new variant with an existing one and + // both + // variants contain calls that belong to callsets with the same callset ID. + // + // // Existing variant - irrelevant fields trimmed for clarity + // { + // "variantSetId": "10473108253681171589", + // "referenceName": "1", + // "start": "10582", + // "referenceBases": "G", + // "alternateBases": [ + // "A" + // ], + // "calls": [ + // { + // "callSetId": "10473108253681171589-0", + // "callSetName": "CALLSET0", + // "genotype": [ + // 0, + // 1 + // ], + // } + // ] + // } + // + // // New variant with conflicting call information + // { + // "variantSetId": "10473108253681171589", + // "referenceName": "1", + // "start": "10582", + // "referenceBases": "G", + // "alternateBases": [ + // "A" + // ], + // "calls": [ + // { + // "callSetId": "10473108253681171589-0", + // "callSetName": "CALLSET0", + // "genotype": [ + // 1, + // 1 + // ], + // } + // ] + // } + // + // The resulting merged variant would overwrite the existing calls with those + // from the new variant: + // + // { + // "variantSetId": "10473108253681171589", + // "referenceName": "1", + // "start": "10582", + // "referenceBases": "G", + // "alternateBases": [ + // "A" + // ], + // "calls": [ + // { + // "callSetId": "10473108253681171589-0", + // "callSetName": "CALLSET0", + // "genotype": [ + // 1, + // 1 + // ], + // } + // ] + // } + // + // This may be the desired outcome, but it is up to the user to determine if + // if that is indeed the case. + MergeVariants(context.Context, *MergeVariantsRequest) (*google_protobuf1.Empty, error) + // Gets a list of call sets matching the criteria. + // + // For the definitions of call sets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // Implements + // [GlobalAllianceApi.searchCallSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L178). + SearchCallSets(context.Context, *SearchCallSetsRequest) (*SearchCallSetsResponse, error) + // Creates a new call set. + // + // For the definitions of call sets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + CreateCallSet(context.Context, *CreateCallSetRequest) (*CallSet, error) + // Updates a call set. + // + // For the definitions of call sets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + // + // This method supports patch semantics. + UpdateCallSet(context.Context, *UpdateCallSetRequest) (*CallSet, error) + // Deletes a call set. + // + // For the definitions of call sets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + DeleteCallSet(context.Context, *DeleteCallSetRequest) (*google_protobuf1.Empty, error) + // Gets a call set by ID. + // + // For the definitions of call sets and other genomics resources, see + // [Fundamentals of Google + // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + GetCallSet(context.Context, *GetCallSetRequest) (*CallSet, error) +} + +func RegisterVariantServiceV1Server(s *grpc.Server, srv VariantServiceV1Server) { + s.RegisterService(&_VariantServiceV1_serviceDesc, srv) +} + +func _VariantServiceV1_ImportVariants_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ImportVariantsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VariantServiceV1Server).ImportVariants(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.VariantServiceV1/ImportVariants", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VariantServiceV1Server).ImportVariants(ctx, req.(*ImportVariantsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _VariantServiceV1_CreateVariantSet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateVariantSetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VariantServiceV1Server).CreateVariantSet(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.VariantServiceV1/CreateVariantSet", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VariantServiceV1Server).CreateVariantSet(ctx, req.(*CreateVariantSetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _VariantServiceV1_ExportVariantSet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ExportVariantSetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VariantServiceV1Server).ExportVariantSet(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.VariantServiceV1/ExportVariantSet", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VariantServiceV1Server).ExportVariantSet(ctx, req.(*ExportVariantSetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _VariantServiceV1_GetVariantSet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetVariantSetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VariantServiceV1Server).GetVariantSet(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.VariantServiceV1/GetVariantSet", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VariantServiceV1Server).GetVariantSet(ctx, req.(*GetVariantSetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _VariantServiceV1_SearchVariantSets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SearchVariantSetsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VariantServiceV1Server).SearchVariantSets(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.VariantServiceV1/SearchVariantSets", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VariantServiceV1Server).SearchVariantSets(ctx, req.(*SearchVariantSetsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _VariantServiceV1_DeleteVariantSet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteVariantSetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VariantServiceV1Server).DeleteVariantSet(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.VariantServiceV1/DeleteVariantSet", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VariantServiceV1Server).DeleteVariantSet(ctx, req.(*DeleteVariantSetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _VariantServiceV1_UpdateVariantSet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateVariantSetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VariantServiceV1Server).UpdateVariantSet(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.VariantServiceV1/UpdateVariantSet", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VariantServiceV1Server).UpdateVariantSet(ctx, req.(*UpdateVariantSetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _VariantServiceV1_SearchVariants_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SearchVariantsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VariantServiceV1Server).SearchVariants(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.VariantServiceV1/SearchVariants", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VariantServiceV1Server).SearchVariants(ctx, req.(*SearchVariantsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _VariantServiceV1_CreateVariant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateVariantRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VariantServiceV1Server).CreateVariant(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.VariantServiceV1/CreateVariant", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VariantServiceV1Server).CreateVariant(ctx, req.(*CreateVariantRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _VariantServiceV1_UpdateVariant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateVariantRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VariantServiceV1Server).UpdateVariant(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.VariantServiceV1/UpdateVariant", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VariantServiceV1Server).UpdateVariant(ctx, req.(*UpdateVariantRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _VariantServiceV1_DeleteVariant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteVariantRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VariantServiceV1Server).DeleteVariant(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.VariantServiceV1/DeleteVariant", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VariantServiceV1Server).DeleteVariant(ctx, req.(*DeleteVariantRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _VariantServiceV1_GetVariant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetVariantRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VariantServiceV1Server).GetVariant(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.VariantServiceV1/GetVariant", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VariantServiceV1Server).GetVariant(ctx, req.(*GetVariantRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _VariantServiceV1_MergeVariants_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MergeVariantsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VariantServiceV1Server).MergeVariants(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.VariantServiceV1/MergeVariants", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VariantServiceV1Server).MergeVariants(ctx, req.(*MergeVariantsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _VariantServiceV1_SearchCallSets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SearchCallSetsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VariantServiceV1Server).SearchCallSets(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.VariantServiceV1/SearchCallSets", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VariantServiceV1Server).SearchCallSets(ctx, req.(*SearchCallSetsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _VariantServiceV1_CreateCallSet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateCallSetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VariantServiceV1Server).CreateCallSet(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.VariantServiceV1/CreateCallSet", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VariantServiceV1Server).CreateCallSet(ctx, req.(*CreateCallSetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _VariantServiceV1_UpdateCallSet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateCallSetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VariantServiceV1Server).UpdateCallSet(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.VariantServiceV1/UpdateCallSet", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VariantServiceV1Server).UpdateCallSet(ctx, req.(*UpdateCallSetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _VariantServiceV1_DeleteCallSet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteCallSetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VariantServiceV1Server).DeleteCallSet(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.VariantServiceV1/DeleteCallSet", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VariantServiceV1Server).DeleteCallSet(ctx, req.(*DeleteCallSetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _VariantServiceV1_GetCallSet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetCallSetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VariantServiceV1Server).GetCallSet(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1.VariantServiceV1/GetCallSet", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VariantServiceV1Server).GetCallSet(ctx, req.(*GetCallSetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _VariantServiceV1_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.genomics.v1.VariantServiceV1", + HandlerType: (*VariantServiceV1Server)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ImportVariants", + Handler: _VariantServiceV1_ImportVariants_Handler, + }, + { + MethodName: "CreateVariantSet", + Handler: _VariantServiceV1_CreateVariantSet_Handler, + }, + { + MethodName: "ExportVariantSet", + Handler: _VariantServiceV1_ExportVariantSet_Handler, + }, + { + MethodName: "GetVariantSet", + Handler: _VariantServiceV1_GetVariantSet_Handler, + }, + { + MethodName: "SearchVariantSets", + Handler: _VariantServiceV1_SearchVariantSets_Handler, + }, + { + MethodName: "DeleteVariantSet", + Handler: _VariantServiceV1_DeleteVariantSet_Handler, + }, + { + MethodName: "UpdateVariantSet", + Handler: _VariantServiceV1_UpdateVariantSet_Handler, + }, + { + MethodName: "SearchVariants", + Handler: _VariantServiceV1_SearchVariants_Handler, + }, + { + MethodName: "CreateVariant", + Handler: _VariantServiceV1_CreateVariant_Handler, + }, + { + MethodName: "UpdateVariant", + Handler: _VariantServiceV1_UpdateVariant_Handler, + }, + { + MethodName: "DeleteVariant", + Handler: _VariantServiceV1_DeleteVariant_Handler, + }, + { + MethodName: "GetVariant", + Handler: _VariantServiceV1_GetVariant_Handler, + }, + { + MethodName: "MergeVariants", + Handler: _VariantServiceV1_MergeVariants_Handler, + }, + { + MethodName: "SearchCallSets", + Handler: _VariantServiceV1_SearchCallSets_Handler, + }, + { + MethodName: "CreateCallSet", + Handler: _VariantServiceV1_CreateCallSet_Handler, + }, + { + MethodName: "UpdateCallSet", + Handler: _VariantServiceV1_UpdateCallSet_Handler, + }, + { + MethodName: "DeleteCallSet", + Handler: _VariantServiceV1_DeleteCallSet_Handler, + }, + { + MethodName: "GetCallSet", + Handler: _VariantServiceV1_GetCallSet_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/genomics/v1/variants.proto", +} + +func init() { proto.RegisterFile("google/genomics/v1/variants.proto", fileDescriptor11) } + +var fileDescriptor11 = []byte{ + // 2348 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x5a, 0xdd, 0x6e, 0x1b, 0xc7, + 0xf5, 0xff, 0xef, 0x92, 0x94, 0xc8, 0x43, 0x91, 0x5a, 0x4f, 0x14, 0x69, 0x43, 0x7f, 0xc9, 0xfb, + 0xb7, 0x1d, 0x45, 0x75, 0x45, 0x9b, 0x81, 0xd3, 0x54, 0x49, 0x6a, 0x48, 0x34, 0xa5, 0xb0, 0x90, + 0x48, 0x65, 0x45, 0xbb, 0x75, 0x80, 0x82, 0x58, 0x91, 0x23, 0x7a, 0x6d, 0x72, 0x97, 0xde, 0x5d, + 0xaa, 0x96, 0x0d, 0x5f, 0x34, 0xfd, 0x42, 0x80, 0x02, 0x05, 0x1a, 0xa0, 0x57, 0xbd, 0xed, 0x45, + 0xd1, 0xa2, 0x6f, 0xe0, 0x37, 0x68, 0x7b, 0x53, 0xf4, 0x0d, 0xfa, 0x10, 0xbd, 0x2c, 0x66, 0x76, + 0x66, 0xb9, 0xbb, 0x1c, 0xae, 0x28, 0x07, 0x09, 0x7a, 0xc7, 0x39, 0x73, 0x66, 0xce, 0xd7, 0xef, + 0x9c, 0x39, 0x67, 0x25, 0xb8, 0xd6, 0xb3, 0xed, 0x5e, 0x1f, 0x97, 0x7b, 0xd8, 0xb2, 0x07, 0x66, + 0xc7, 0x2d, 0x9f, 0xdc, 0x29, 0x9f, 0x18, 0x8e, 0x69, 0x58, 0x9e, 0xbb, 0x31, 0x74, 0x6c, 0xcf, + 0x46, 0xc8, 0x67, 0xd9, 0xe0, 0x2c, 0x1b, 0x27, 0x77, 0x4a, 0x97, 0xd8, 0x31, 0x63, 0x68, 0x96, + 0x0d, 0xcb, 0xb2, 0x3d, 0xc3, 0x33, 0x6d, 0x8b, 0x9d, 0x28, 0xfd, 0x3f, 0xdb, 0xed, 0xdb, 0x56, + 0xcf, 0x19, 0x59, 0x96, 0x69, 0xf5, 0xca,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6c, + 0x01, 0xd3, 0x83, 0x73, 0x08, 0x41, 0xda, 0x32, 0x06, 0x98, 0x61, 0x81, 0xfe, 0x8e, 0xc3, 0x24, + 0x3b, 0x01, 0x13, 0xed, 0xcb, 0x34, 0xcc, 0xb3, 0x6b, 0xd1, 0x75, 0x28, 0xb2, 0x14, 0xe6, 0xc6, + 0x2f, 0xd2, 0x03, 0x0b, 0x27, 0x81, 0x5c, 0x81, 0xd3, 0x96, 0x20, 0x43, 0x64, 0xb9, 0x14, 0x69, + 0x39, 0xdd, 0x5f, 0x20, 0x15, 0xe6, 0x3b, 0x0e, 0x36, 0x3c, 0xdc, 0x55, 0x17, 0x56, 0xa5, 0xb5, + 0x94, 0xce, 0x97, 0xe8, 0x06, 0x8c, 0x9d, 0xd9, 0xa6, 0x1a, 0x17, 0xe9, 0x5d, 0x85, 0x80, 0xda, + 0x20, 0xaa, 0x2f, 0x41, 0xc6, 0xf5, 0x0c, 0xc7, 0x53, 0x15, 0x7a, 0xdc, 0x5f, 0x10, 0x08, 0x62, + 0xab, 0xab, 0x16, 0x28, 0x8d, 0xfc, 0x44, 0xef, 0xc2, 0x62, 0x28, 0x12, 0x86, 0x8b, 0xdd, 0x89, + 0x90, 0x6d, 0x13, 0x2a, 0x61, 0x34, 0xfa, 0x1e, 0x76, 0x2c, 0xc3, 0xe3, 0x8c, 0xf3, 0x54, 0xe3, + 0x62, 0x40, 0xf6, 0x19, 0x55, 0x98, 0x7f, 0x36, 0x32, 0xfa, 0xa6, 0x77, 0x4a, 0x1d, 0x26, 0xe9, + 0x7c, 0x49, 0xb2, 0xf1, 0xd8, 0x24, 0xcc, 0x6a, 0x8e, 0x9e, 0x64, 0x2b, 0xf4, 0x7d, 0x96, 0x6b, + 0x40, 0x43, 0x77, 0x23, 0x21, 0x74, 0xf1, 0x04, 0x43, 0x77, 0x21, 0xd3, 0x31, 0xfa, 0x7d, 0x57, + 0xcd, 0xd3, 0xb3, 0x57, 0x13, 0xce, 0x56, 0x8d, 0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 0xbd, 0x6d, 0x12, 0xc4, 0x63, 0x0d, 0x79, 0x12, 0xc4, 0xe3, 0xad, + 0x72, 0x14, 0xe2, 0x74, 0x52, 0x8e, 0x56, 0xa2, 0x13, 0x0e, 0x71, 0xfe, 0x37, 0x81, 0x04, 0x88, + 0x47, 0x1b, 0xbb, 0x52, 0x52, 0x23, 0x1a, 0xc8, 0x5d, 0x08, 0xcb, 0xdd, 0x0c, 0x7a, 0x59, 0xf4, + 0x8b, 0x00, 0xe3, 0x89, 0x82, 0x45, 0x3d, 0x73, 0xb2, 0xe0, 0x5b, 0x54, 0xf0, 0xcd, 0x4a, 0x29, + 0x62, 0xf0, 0xcb, 0x50, 0x0f, 0xf8, 0x2a, 0xa4, 0xc6, 0x88, 0xa3, 0x3c, 0x51, 0x0b, 0x51, 0x33, + 0x3c, 0x35, 0xf4, 0x1a, 0x55, 0xe0, 0xd2, 0x7a, 0x82, 0x02, 0xc8, 0xa3, 0x30, 0xe7, 0x32, 0xa7, + 0xc1, 0xfc, 0x3c, 0x66, 0x33, 0xa9, 0x28, 0x41, 0xea, 0xf6, 0x63, 0x58, 0xee, 0xd8, 0x03, 0xc1, + 0x2d, 0xdb, 0x05, 0x8e, 0xeb, 0x03, 0x62, 0xcb, 0x81, 0xf4, 0xf9, 0x26, 0x67, 0xb2, 0xfb, 0x86, + 0xd5, 0xdb, 0xb0, 0x9d, 0x5e, 0xb9, 0x87, 0x2d, 0x6a, 0x69, 0xd9, 0xdf, 0x32, 0x86, 0xa6, 0x1b, + 0xfe, 0x4f, 0x8b, 0x8f, 0xf8, 0xef, 0xff, 0x48, 0xd2, 0xd1, 0x1c, 0xe5, 0x7c, 0xff, 0xbf, 0x01, + 0x00, 0x00, 0xff, 0xff, 0x7e, 0x5e, 0x37, 0xc0, 0x92, 0x21, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/genomics/v1alpha2/pipelines.pb.go b/vendor/google.golang.org/genproto/googleapis/genomics/v1alpha2/pipelines.pb.go new file mode 100644 index 0000000000..5e79261b68 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/genomics/v1alpha2/pipelines.pb.go @@ -0,0 +1,1838 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/genomics/v1alpha2/pipelines.proto + +/* +Package genomics is a generated protocol buffer package. + +It is generated from these files: + google/genomics/v1alpha2/pipelines.proto + +It has these top-level messages: + ComputeEngine + RuntimeMetadata + Pipeline + CreatePipelineRequest + RunPipelineArgs + RunPipelineRequest + GetPipelineRequest + ListPipelinesRequest + ListPipelinesResponse + DeletePipelineRequest + GetControllerConfigRequest + ControllerConfig + TimestampEvent + SetOperationStatusRequest + ServiceAccount + LoggingOptions + PipelineResources + PipelineParameter + DockerExecutor +*/ +package genomics + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_longrunning "google.golang.org/genproto/googleapis/longrunning" +import google_protobuf3 "github.com/golang/protobuf/ptypes/duration" +import google_protobuf2 "github.com/golang/protobuf/ptypes/empty" +import google_protobuf4 "github.com/golang/protobuf/ptypes/timestamp" +import google_rpc1 "google.golang.org/genproto/googleapis/rpc/code" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// The types of disks that may be attached to VMs. +type PipelineResources_Disk_Type int32 + +const ( + // Default disk type. Use one of the other options below. + PipelineResources_Disk_TYPE_UNSPECIFIED PipelineResources_Disk_Type = 0 + // Specifies a Google Compute Engine persistent hard disk. See + // https://cloud.google.com/compute/docs/disks/#pdspecs for details. + PipelineResources_Disk_PERSISTENT_HDD PipelineResources_Disk_Type = 1 + // Specifies a Google Compute Engine persistent solid-state disk. See + // https://cloud.google.com/compute/docs/disks/#pdspecs for details. + PipelineResources_Disk_PERSISTENT_SSD PipelineResources_Disk_Type = 2 + // Specifies a Google Compute Engine local SSD. + // See https://cloud.google.com/compute/docs/disks/local-ssd for details. + PipelineResources_Disk_LOCAL_SSD PipelineResources_Disk_Type = 3 +) + +var PipelineResources_Disk_Type_name = map[int32]string{ + 0: "TYPE_UNSPECIFIED", + 1: "PERSISTENT_HDD", + 2: "PERSISTENT_SSD", + 3: "LOCAL_SSD", +} +var PipelineResources_Disk_Type_value = map[string]int32{ + "TYPE_UNSPECIFIED": 0, + "PERSISTENT_HDD": 1, + "PERSISTENT_SSD": 2, + "LOCAL_SSD": 3, +} + +func (x PipelineResources_Disk_Type) String() string { + return proto.EnumName(PipelineResources_Disk_Type_name, int32(x)) +} +func (PipelineResources_Disk_Type) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{16, 0, 0} +} + +// Describes a Compute Engine resource that is being managed by a running +// [pipeline][google.genomics.v1alpha2.Pipeline]. +type ComputeEngine struct { + // The instance on which the operation is running. + InstanceName string `protobuf:"bytes,1,opt,name=instance_name,json=instanceName" json:"instance_name,omitempty"` + // The availability zone in which the instance resides. + Zone string `protobuf:"bytes,2,opt,name=zone" json:"zone,omitempty"` + // The machine type of the instance. + MachineType string `protobuf:"bytes,3,opt,name=machine_type,json=machineType" json:"machine_type,omitempty"` + // The names of the disks that were created for this pipeline. + DiskNames []string `protobuf:"bytes,4,rep,name=disk_names,json=diskNames" json:"disk_names,omitempty"` +} + +func (m *ComputeEngine) Reset() { *m = ComputeEngine{} } +func (m *ComputeEngine) String() string { return proto.CompactTextString(m) } +func (*ComputeEngine) ProtoMessage() {} +func (*ComputeEngine) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *ComputeEngine) GetInstanceName() string { + if m != nil { + return m.InstanceName + } + return "" +} + +func (m *ComputeEngine) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + +func (m *ComputeEngine) GetMachineType() string { + if m != nil { + return m.MachineType + } + return "" +} + +func (m *ComputeEngine) GetDiskNames() []string { + if m != nil { + return m.DiskNames + } + return nil +} + +// Runtime metadata that will be populated in the +// [runtimeMetadata][google.genomics.v1.OperationMetadata.runtime_metadata] +// field of the Operation associated with a RunPipeline execution. +type RuntimeMetadata struct { + // Execution information specific to Google Compute Engine. + ComputeEngine *ComputeEngine `protobuf:"bytes,1,opt,name=compute_engine,json=computeEngine" json:"compute_engine,omitempty"` +} + +func (m *RuntimeMetadata) Reset() { *m = RuntimeMetadata{} } +func (m *RuntimeMetadata) String() string { return proto.CompactTextString(m) } +func (*RuntimeMetadata) ProtoMessage() {} +func (*RuntimeMetadata) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *RuntimeMetadata) GetComputeEngine() *ComputeEngine { + if m != nil { + return m.ComputeEngine + } + return nil +} + +// The pipeline object. Represents a transformation from a set of input +// parameters to a set of output parameters. The transformation is defined +// as a docker image and command to run within that image. Each pipeline +// is run on a Google Compute Engine VM. A pipeline can be created with the +// `create` method and then later run with the `run` method, or a pipeline can +// be defined and run all at once with the `run` method. +type Pipeline struct { + // Required. The project in which to create the pipeline. The caller must have + // WRITE access. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // Required. A user specified pipeline name that does not have to be unique. + // This name can be used for filtering Pipelines in ListPipelines. + Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` + // User-specified description. + Description string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` + // Input parameters of the pipeline. + InputParameters []*PipelineParameter `protobuf:"bytes,8,rep,name=input_parameters,json=inputParameters" json:"input_parameters,omitempty"` + // Output parameters of the pipeline. + OutputParameters []*PipelineParameter `protobuf:"bytes,9,rep,name=output_parameters,json=outputParameters" json:"output_parameters,omitempty"` + // Required. The executor indicates in which environment the pipeline runs. + // + // Types that are valid to be assigned to Executor: + // *Pipeline_Docker + Executor isPipeline_Executor `protobuf_oneof:"executor"` + // Required. Specifies resource requirements for the pipeline run. + // Required fields: + // + // * + // [minimumCpuCores][google.genomics.v1alpha2.PipelineResources.minimum_cpu_cores] + // + // * + // [minimumRamGb][google.genomics.v1alpha2.PipelineResources.minimum_ram_gb] + Resources *PipelineResources `protobuf:"bytes,6,opt,name=resources" json:"resources,omitempty"` + // Unique pipeline id that is generated by the service when CreatePipeline + // is called. Cannot be specified in the Pipeline used in the + // CreatePipelineRequest, and will be populated in the response to + // CreatePipeline and all subsequent Get and List calls. Indicates that the + // service has registered this pipeline. + PipelineId string `protobuf:"bytes,7,opt,name=pipeline_id,json=pipelineId" json:"pipeline_id,omitempty"` +} + +func (m *Pipeline) Reset() { *m = Pipeline{} } +func (m *Pipeline) String() string { return proto.CompactTextString(m) } +func (*Pipeline) ProtoMessage() {} +func (*Pipeline) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +type isPipeline_Executor interface { + isPipeline_Executor() +} + +type Pipeline_Docker struct { + Docker *DockerExecutor `protobuf:"bytes,5,opt,name=docker,oneof"` +} + +func (*Pipeline_Docker) isPipeline_Executor() {} + +func (m *Pipeline) GetExecutor() isPipeline_Executor { + if m != nil { + return m.Executor + } + return nil +} + +func (m *Pipeline) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *Pipeline) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Pipeline) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *Pipeline) GetInputParameters() []*PipelineParameter { + if m != nil { + return m.InputParameters + } + return nil +} + +func (m *Pipeline) GetOutputParameters() []*PipelineParameter { + if m != nil { + return m.OutputParameters + } + return nil +} + +func (m *Pipeline) GetDocker() *DockerExecutor { + if x, ok := m.GetExecutor().(*Pipeline_Docker); ok { + return x.Docker + } + return nil +} + +func (m *Pipeline) GetResources() *PipelineResources { + if m != nil { + return m.Resources + } + return nil +} + +func (m *Pipeline) GetPipelineId() string { + if m != nil { + return m.PipelineId + } + return "" +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Pipeline) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _Pipeline_OneofMarshaler, _Pipeline_OneofUnmarshaler, _Pipeline_OneofSizer, []interface{}{ + (*Pipeline_Docker)(nil), + } +} + +func _Pipeline_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Pipeline) + // executor + switch x := m.Executor.(type) { + case *Pipeline_Docker: + b.EncodeVarint(5<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Docker); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("Pipeline.Executor has unexpected type %T", x) + } + return nil +} + +func _Pipeline_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Pipeline) + switch tag { + case 5: // executor.docker + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(DockerExecutor) + err := b.DecodeMessage(msg) + m.Executor = &Pipeline_Docker{msg} + return true, err + default: + return false, nil + } +} + +func _Pipeline_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Pipeline) + // executor + switch x := m.Executor.(type) { + case *Pipeline_Docker: + s := proto.Size(x.Docker) + n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// The request to create a pipeline. The pipeline field here should not have +// `pipelineId` populated, as that will be populated by the server. +type CreatePipelineRequest struct { + // The pipeline to create. Should not have `pipelineId` populated. + Pipeline *Pipeline `protobuf:"bytes,1,opt,name=pipeline" json:"pipeline,omitempty"` +} + +func (m *CreatePipelineRequest) Reset() { *m = CreatePipelineRequest{} } +func (m *CreatePipelineRequest) String() string { return proto.CompactTextString(m) } +func (*CreatePipelineRequest) ProtoMessage() {} +func (*CreatePipelineRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *CreatePipelineRequest) GetPipeline() *Pipeline { + if m != nil { + return m.Pipeline + } + return nil +} + +// The pipeline run arguments. +type RunPipelineArgs struct { + // Required. The project in which to run the pipeline. The caller must have + // WRITER access to all Google Cloud services and resources (e.g. Google + // Compute Engine) will be used. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // Pipeline input arguments; keys are defined in the pipeline documentation. + // All input parameters that do not have default values must be specified. + // If parameters with defaults are specified here, the defaults will be + // overridden. + Inputs map[string]string `protobuf:"bytes,2,rep,name=inputs" json:"inputs,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // Pipeline output arguments; keys are defined in the pipeline + // documentation. All output parameters of without default values + // must be specified. If parameters with defaults are specified + // here, the defaults will be overridden. + Outputs map[string]string `protobuf:"bytes,3,rep,name=outputs" json:"outputs,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // The Google Cloud Service Account that will be used to access data and + // services. By default, the compute service account associated with + // `projectId` is used. + ServiceAccount *ServiceAccount `protobuf:"bytes,4,opt,name=service_account,json=serviceAccount" json:"service_account,omitempty"` + // This field is deprecated. Use `labels` instead. Client-specified pipeline + // operation identifier. + ClientId string `protobuf:"bytes,5,opt,name=client_id,json=clientId" json:"client_id,omitempty"` + // Specifies resource requirements/overrides for the pipeline run. + Resources *PipelineResources `protobuf:"bytes,6,opt,name=resources" json:"resources,omitempty"` + // Required. Logging options. Used by the service to communicate results + // to the user. + Logging *LoggingOptions `protobuf:"bytes,7,opt,name=logging" json:"logging,omitempty"` + // How long to keep the VM up after a failure (for example docker command + // failed, copying input or output files failed, etc). While the VM is up, one + // can ssh into the VM to debug. Default is 0; maximum allowed value is 1 day. + KeepVmAliveOnFailureDuration *google_protobuf3.Duration `protobuf:"bytes,8,opt,name=keep_vm_alive_on_failure_duration,json=keepVmAliveOnFailureDuration" json:"keep_vm_alive_on_failure_duration,omitempty"` + // Labels to apply to this pipeline run. Labels will also be applied to + // compute resources (VM, disks) created by this pipeline run. When listing + // operations, operations can [filtered by labels] + // [google.longrunning.ListOperationsRequest.filter]. + // Label keys may not be empty; label values may be empty. Non-empty labels + // must be 1-63 characters long, and comply with [RFC1035] + // (https://www.ietf.org/rfc/rfc1035.txt). + // Specifically, the name must be 1-63 characters long and match the regular + // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first + // character must be a lowercase letter, and all following characters must be + // a dash, lowercase letter, or digit, except the last character, which cannot + // be a dash. + Labels map[string]string `protobuf:"bytes,9,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *RunPipelineArgs) Reset() { *m = RunPipelineArgs{} } +func (m *RunPipelineArgs) String() string { return proto.CompactTextString(m) } +func (*RunPipelineArgs) ProtoMessage() {} +func (*RunPipelineArgs) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *RunPipelineArgs) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *RunPipelineArgs) GetInputs() map[string]string { + if m != nil { + return m.Inputs + } + return nil +} + +func (m *RunPipelineArgs) GetOutputs() map[string]string { + if m != nil { + return m.Outputs + } + return nil +} + +func (m *RunPipelineArgs) GetServiceAccount() *ServiceAccount { + if m != nil { + return m.ServiceAccount + } + return nil +} + +func (m *RunPipelineArgs) GetClientId() string { + if m != nil { + return m.ClientId + } + return "" +} + +func (m *RunPipelineArgs) GetResources() *PipelineResources { + if m != nil { + return m.Resources + } + return nil +} + +func (m *RunPipelineArgs) GetLogging() *LoggingOptions { + if m != nil { + return m.Logging + } + return nil +} + +func (m *RunPipelineArgs) GetKeepVmAliveOnFailureDuration() *google_protobuf3.Duration { + if m != nil { + return m.KeepVmAliveOnFailureDuration + } + return nil +} + +func (m *RunPipelineArgs) GetLabels() map[string]string { + if m != nil { + return m.Labels + } + return nil +} + +// The request to run a pipeline. If `pipelineId` is specified, it +// refers to a saved pipeline created with CreatePipeline and set as +// the `pipelineId` of the returned Pipeline object. If +// `ephemeralPipeline` is specified, that pipeline is run once +// with the given args and not saved. It is an error to specify both +// `pipelineId` and `ephemeralPipeline`. `pipelineArgs` +// must be specified. +type RunPipelineRequest struct { + // Types that are valid to be assigned to Pipeline: + // *RunPipelineRequest_PipelineId + // *RunPipelineRequest_EphemeralPipeline + Pipeline isRunPipelineRequest_Pipeline `protobuf_oneof:"pipeline"` + // The arguments to use when running this pipeline. + PipelineArgs *RunPipelineArgs `protobuf:"bytes,3,opt,name=pipeline_args,json=pipelineArgs" json:"pipeline_args,omitempty"` +} + +func (m *RunPipelineRequest) Reset() { *m = RunPipelineRequest{} } +func (m *RunPipelineRequest) String() string { return proto.CompactTextString(m) } +func (*RunPipelineRequest) ProtoMessage() {} +func (*RunPipelineRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +type isRunPipelineRequest_Pipeline interface { + isRunPipelineRequest_Pipeline() +} + +type RunPipelineRequest_PipelineId struct { + PipelineId string `protobuf:"bytes,1,opt,name=pipeline_id,json=pipelineId,oneof"` +} +type RunPipelineRequest_EphemeralPipeline struct { + EphemeralPipeline *Pipeline `protobuf:"bytes,2,opt,name=ephemeral_pipeline,json=ephemeralPipeline,oneof"` +} + +func (*RunPipelineRequest_PipelineId) isRunPipelineRequest_Pipeline() {} +func (*RunPipelineRequest_EphemeralPipeline) isRunPipelineRequest_Pipeline() {} + +func (m *RunPipelineRequest) GetPipeline() isRunPipelineRequest_Pipeline { + if m != nil { + return m.Pipeline + } + return nil +} + +func (m *RunPipelineRequest) GetPipelineId() string { + if x, ok := m.GetPipeline().(*RunPipelineRequest_PipelineId); ok { + return x.PipelineId + } + return "" +} + +func (m *RunPipelineRequest) GetEphemeralPipeline() *Pipeline { + if x, ok := m.GetPipeline().(*RunPipelineRequest_EphemeralPipeline); ok { + return x.EphemeralPipeline + } + return nil +} + +func (m *RunPipelineRequest) GetPipelineArgs() *RunPipelineArgs { + if m != nil { + return m.PipelineArgs + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*RunPipelineRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _RunPipelineRequest_OneofMarshaler, _RunPipelineRequest_OneofUnmarshaler, _RunPipelineRequest_OneofSizer, []interface{}{ + (*RunPipelineRequest_PipelineId)(nil), + (*RunPipelineRequest_EphemeralPipeline)(nil), + } +} + +func _RunPipelineRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*RunPipelineRequest) + // pipeline + switch x := m.Pipeline.(type) { + case *RunPipelineRequest_PipelineId: + b.EncodeVarint(1<<3 | proto.WireBytes) + b.EncodeStringBytes(x.PipelineId) + case *RunPipelineRequest_EphemeralPipeline: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.EphemeralPipeline); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("RunPipelineRequest.Pipeline has unexpected type %T", x) + } + return nil +} + +func _RunPipelineRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*RunPipelineRequest) + switch tag { + case 1: // pipeline.pipeline_id + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Pipeline = &RunPipelineRequest_PipelineId{x} + return true, err + case 2: // pipeline.ephemeral_pipeline + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Pipeline) + err := b.DecodeMessage(msg) + m.Pipeline = &RunPipelineRequest_EphemeralPipeline{msg} + return true, err + default: + return false, nil + } +} + +func _RunPipelineRequest_OneofSizer(msg proto.Message) (n int) { + m := msg.(*RunPipelineRequest) + // pipeline + switch x := m.Pipeline.(type) { + case *RunPipelineRequest_PipelineId: + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.PipelineId))) + n += len(x.PipelineId) + case *RunPipelineRequest_EphemeralPipeline: + s := proto.Size(x.EphemeralPipeline) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// A request to get a saved pipeline by id. +type GetPipelineRequest struct { + // Caller must have READ access to the project in which this pipeline + // is defined. + PipelineId string `protobuf:"bytes,1,opt,name=pipeline_id,json=pipelineId" json:"pipeline_id,omitempty"` +} + +func (m *GetPipelineRequest) Reset() { *m = GetPipelineRequest{} } +func (m *GetPipelineRequest) String() string { return proto.CompactTextString(m) } +func (*GetPipelineRequest) ProtoMessage() {} +func (*GetPipelineRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *GetPipelineRequest) GetPipelineId() string { + if m != nil { + return m.PipelineId + } + return "" +} + +// A request to list pipelines in a given project. Pipelines can be +// filtered by name using `namePrefix`: all pipelines with names that +// begin with `namePrefix` will be returned. Uses standard pagination: +// `pageSize` indicates how many pipelines to return, and +// `pageToken` comes from a previous ListPipelinesResponse to +// indicate offset. +type ListPipelinesRequest struct { + // Required. The name of the project to search for pipelines. Caller + // must have READ access to this project. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // Pipelines with names that match this prefix should be + // returned. If unspecified, all pipelines in the project, up to + // `pageSize`, will be returned. + NamePrefix string `protobuf:"bytes,2,opt,name=name_prefix,json=namePrefix" json:"name_prefix,omitempty"` + // Number of pipelines to return at once. Defaults to 256, and max + // is 2048. + PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // Token to use to indicate where to start getting results. + // If unspecified, returns the first page of results. + PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListPipelinesRequest) Reset() { *m = ListPipelinesRequest{} } +func (m *ListPipelinesRequest) String() string { return proto.CompactTextString(m) } +func (*ListPipelinesRequest) ProtoMessage() {} +func (*ListPipelinesRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *ListPipelinesRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *ListPipelinesRequest) GetNamePrefix() string { + if m != nil { + return m.NamePrefix + } + return "" +} + +func (m *ListPipelinesRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListPipelinesRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// The response of ListPipelines. Contains at most `pageSize` +// pipelines. If it contains `pageSize` pipelines, and more pipelines +// exist, then `nextPageToken` will be populated and should be +// used as the `pageToken` argument to a subsequent ListPipelines +// request. +type ListPipelinesResponse struct { + // The matched pipelines. + Pipelines []*Pipeline `protobuf:"bytes,1,rep,name=pipelines" json:"pipelines,omitempty"` + // The token to use to get the next page of results. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListPipelinesResponse) Reset() { *m = ListPipelinesResponse{} } +func (m *ListPipelinesResponse) String() string { return proto.CompactTextString(m) } +func (*ListPipelinesResponse) ProtoMessage() {} +func (*ListPipelinesResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *ListPipelinesResponse) GetPipelines() []*Pipeline { + if m != nil { + return m.Pipelines + } + return nil +} + +func (m *ListPipelinesResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// The request to delete a saved pipeline by ID. +type DeletePipelineRequest struct { + // Caller must have WRITE access to the project in which this pipeline + // is defined. + PipelineId string `protobuf:"bytes,1,opt,name=pipeline_id,json=pipelineId" json:"pipeline_id,omitempty"` +} + +func (m *DeletePipelineRequest) Reset() { *m = DeletePipelineRequest{} } +func (m *DeletePipelineRequest) String() string { return proto.CompactTextString(m) } +func (*DeletePipelineRequest) ProtoMessage() {} +func (*DeletePipelineRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *DeletePipelineRequest) GetPipelineId() string { + if m != nil { + return m.PipelineId + } + return "" +} + +// Request to get controller configuation. Should only be used +// by VMs created by the Pipelines Service and not by end users. +type GetControllerConfigRequest struct { + // The operation to retrieve controller configuration for. + OperationId string `protobuf:"bytes,1,opt,name=operation_id,json=operationId" json:"operation_id,omitempty"` + ValidationToken uint64 `protobuf:"varint,2,opt,name=validation_token,json=validationToken" json:"validation_token,omitempty"` +} + +func (m *GetControllerConfigRequest) Reset() { *m = GetControllerConfigRequest{} } +func (m *GetControllerConfigRequest) String() string { return proto.CompactTextString(m) } +func (*GetControllerConfigRequest) ProtoMessage() {} +func (*GetControllerConfigRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *GetControllerConfigRequest) GetOperationId() string { + if m != nil { + return m.OperationId + } + return "" +} + +func (m *GetControllerConfigRequest) GetValidationToken() uint64 { + if m != nil { + return m.ValidationToken + } + return 0 +} + +// Stores the information that the controller will fetch from the +// server in order to run. Should only be used by VMs created by the +// Pipelines Service and not by end users. +type ControllerConfig struct { + Image string `protobuf:"bytes,1,opt,name=image" json:"image,omitempty"` + Cmd string `protobuf:"bytes,2,opt,name=cmd" json:"cmd,omitempty"` + GcsLogPath string `protobuf:"bytes,3,opt,name=gcs_log_path,json=gcsLogPath" json:"gcs_log_path,omitempty"` + MachineType string `protobuf:"bytes,4,opt,name=machine_type,json=machineType" json:"machine_type,omitempty"` + Vars map[string]string `protobuf:"bytes,5,rep,name=vars" json:"vars,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + Disks map[string]string `protobuf:"bytes,6,rep,name=disks" json:"disks,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + GcsSources map[string]*ControllerConfig_RepeatedString `protobuf:"bytes,7,rep,name=gcs_sources,json=gcsSources" json:"gcs_sources,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + GcsSinks map[string]*ControllerConfig_RepeatedString `protobuf:"bytes,8,rep,name=gcs_sinks,json=gcsSinks" json:"gcs_sinks,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *ControllerConfig) Reset() { *m = ControllerConfig{} } +func (m *ControllerConfig) String() string { return proto.CompactTextString(m) } +func (*ControllerConfig) ProtoMessage() {} +func (*ControllerConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } + +func (m *ControllerConfig) GetImage() string { + if m != nil { + return m.Image + } + return "" +} + +func (m *ControllerConfig) GetCmd() string { + if m != nil { + return m.Cmd + } + return "" +} + +func (m *ControllerConfig) GetGcsLogPath() string { + if m != nil { + return m.GcsLogPath + } + return "" +} + +func (m *ControllerConfig) GetMachineType() string { + if m != nil { + return m.MachineType + } + return "" +} + +func (m *ControllerConfig) GetVars() map[string]string { + if m != nil { + return m.Vars + } + return nil +} + +func (m *ControllerConfig) GetDisks() map[string]string { + if m != nil { + return m.Disks + } + return nil +} + +func (m *ControllerConfig) GetGcsSources() map[string]*ControllerConfig_RepeatedString { + if m != nil { + return m.GcsSources + } + return nil +} + +func (m *ControllerConfig) GetGcsSinks() map[string]*ControllerConfig_RepeatedString { + if m != nil { + return m.GcsSinks + } + return nil +} + +type ControllerConfig_RepeatedString struct { + Values []string `protobuf:"bytes,1,rep,name=values" json:"values,omitempty"` +} + +func (m *ControllerConfig_RepeatedString) Reset() { *m = ControllerConfig_RepeatedString{} } +func (m *ControllerConfig_RepeatedString) String() string { return proto.CompactTextString(m) } +func (*ControllerConfig_RepeatedString) ProtoMessage() {} +func (*ControllerConfig_RepeatedString) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{11, 0} +} + +func (m *ControllerConfig_RepeatedString) GetValues() []string { + if m != nil { + return m.Values + } + return nil +} + +// Stores the list of events and times they occured for major events in job +// execution. +type TimestampEvent struct { + // String indicating the type of event + Description string `protobuf:"bytes,1,opt,name=description" json:"description,omitempty"` + // The time this event occured. + Timestamp *google_protobuf4.Timestamp `protobuf:"bytes,2,opt,name=timestamp" json:"timestamp,omitempty"` +} + +func (m *TimestampEvent) Reset() { *m = TimestampEvent{} } +func (m *TimestampEvent) String() string { return proto.CompactTextString(m) } +func (*TimestampEvent) ProtoMessage() {} +func (*TimestampEvent) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } + +func (m *TimestampEvent) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *TimestampEvent) GetTimestamp() *google_protobuf4.Timestamp { + if m != nil { + return m.Timestamp + } + return nil +} + +// Request to set operation status. Should only be used by VMs +// created by the Pipelines Service and not by end users. +type SetOperationStatusRequest struct { + OperationId string `protobuf:"bytes,1,opt,name=operation_id,json=operationId" json:"operation_id,omitempty"` + TimestampEvents []*TimestampEvent `protobuf:"bytes,2,rep,name=timestamp_events,json=timestampEvents" json:"timestamp_events,omitempty"` + ErrorCode google_rpc1.Code `protobuf:"varint,3,opt,name=error_code,json=errorCode,enum=google.rpc.Code" json:"error_code,omitempty"` + ErrorMessage string `protobuf:"bytes,4,opt,name=error_message,json=errorMessage" json:"error_message,omitempty"` + ValidationToken uint64 `protobuf:"varint,5,opt,name=validation_token,json=validationToken" json:"validation_token,omitempty"` +} + +func (m *SetOperationStatusRequest) Reset() { *m = SetOperationStatusRequest{} } +func (m *SetOperationStatusRequest) String() string { return proto.CompactTextString(m) } +func (*SetOperationStatusRequest) ProtoMessage() {} +func (*SetOperationStatusRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } + +func (m *SetOperationStatusRequest) GetOperationId() string { + if m != nil { + return m.OperationId + } + return "" +} + +func (m *SetOperationStatusRequest) GetTimestampEvents() []*TimestampEvent { + if m != nil { + return m.TimestampEvents + } + return nil +} + +func (m *SetOperationStatusRequest) GetErrorCode() google_rpc1.Code { + if m != nil { + return m.ErrorCode + } + return google_rpc1.Code_OK +} + +func (m *SetOperationStatusRequest) GetErrorMessage() string { + if m != nil { + return m.ErrorMessage + } + return "" +} + +func (m *SetOperationStatusRequest) GetValidationToken() uint64 { + if m != nil { + return m.ValidationToken + } + return 0 +} + +// A Google Cloud Service Account. +type ServiceAccount struct { + // Email address of the service account. Defaults to `default`, + // which uses the compute service account associated with the project. + Email string `protobuf:"bytes,1,opt,name=email" json:"email,omitempty"` + // List of scopes to be enabled for this service account on the VM. + // The following scopes are automatically included: + // + // * https://www.googleapis.com/auth/compute + // * https://www.googleapis.com/auth/devstorage.full_control + // * https://www.googleapis.com/auth/genomics + // * https://www.googleapis.com/auth/logging.write + // * https://www.googleapis.com/auth/monitoring.write + Scopes []string `protobuf:"bytes,2,rep,name=scopes" json:"scopes,omitempty"` +} + +func (m *ServiceAccount) Reset() { *m = ServiceAccount{} } +func (m *ServiceAccount) String() string { return proto.CompactTextString(m) } +func (*ServiceAccount) ProtoMessage() {} +func (*ServiceAccount) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } + +func (m *ServiceAccount) GetEmail() string { + if m != nil { + return m.Email + } + return "" +} + +func (m *ServiceAccount) GetScopes() []string { + if m != nil { + return m.Scopes + } + return nil +} + +// The logging options for the pipeline run. +type LoggingOptions struct { + // The location in Google Cloud Storage to which the pipeline logs + // will be copied. Can be specified as a fully qualified directory + // path, in which case logs will be output with a unique identifier + // as the filename in that directory, or as a fully specified path, + // which must end in `.log`, in which case that path will be + // used, and the user must ensure that logs are not + // overwritten. Stdout and stderr logs from the run are also + // generated and output as `-stdout.log` and `-stderr.log`. + GcsPath string `protobuf:"bytes,1,opt,name=gcs_path,json=gcsPath" json:"gcs_path,omitempty"` +} + +func (m *LoggingOptions) Reset() { *m = LoggingOptions{} } +func (m *LoggingOptions) String() string { return proto.CompactTextString(m) } +func (*LoggingOptions) ProtoMessage() {} +func (*LoggingOptions) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } + +func (m *LoggingOptions) GetGcsPath() string { + if m != nil { + return m.GcsPath + } + return "" +} + +// The system resources for the pipeline run. +type PipelineResources struct { + // The minimum number of cores to use. Defaults to 1. + MinimumCpuCores int32 `protobuf:"varint,1,opt,name=minimum_cpu_cores,json=minimumCpuCores" json:"minimum_cpu_cores,omitempty"` + // Whether to use preemptible VMs. Defaults to `false`. In order to use this, + // must be true for both create time and run time. Cannot be true at run time + // if false at create time. + Preemptible bool `protobuf:"varint,2,opt,name=preemptible" json:"preemptible,omitempty"` + // The minimum amount of RAM to use. Defaults to 3.75 (GB) + MinimumRamGb float64 `protobuf:"fixed64,3,opt,name=minimum_ram_gb,json=minimumRamGb" json:"minimum_ram_gb,omitempty"` + // Disks to attach. + Disks []*PipelineResources_Disk `protobuf:"bytes,4,rep,name=disks" json:"disks,omitempty"` + // List of Google Compute Engine availability zones to which resource + // creation will restricted. If empty, any zone may be chosen. + Zones []string `protobuf:"bytes,5,rep,name=zones" json:"zones,omitempty"` + // The size of the boot disk. Defaults to 10 (GB). + BootDiskSizeGb int32 `protobuf:"varint,6,opt,name=boot_disk_size_gb,json=bootDiskSizeGb" json:"boot_disk_size_gb,omitempty"` + // Whether to assign an external IP to the instance. This is an experimental + // feature that may go away. Defaults to false. + // Corresponds to `--no_address` flag for [gcloud compute instances create] + // (https://cloud.google.com/sdk/gcloud/reference/compute/instances/create). + // In order to use this, must be true for both create time and run time. + // Cannot be true at run time if false at create time. If you need to ssh into + // a private IP VM for debugging, you can ssh to a public VM and then ssh into + // the private VM's Internal IP. If noAddress is set, this pipeline run may + // only load docker images from Google Container Registry and not Docker Hub. + // ** Note: To use this option, your project must be in Google Access for + // Private IPs Early Access Program.** + NoAddress bool `protobuf:"varint,7,opt,name=no_address,json=noAddress" json:"no_address,omitempty"` +} + +func (m *PipelineResources) Reset() { *m = PipelineResources{} } +func (m *PipelineResources) String() string { return proto.CompactTextString(m) } +func (*PipelineResources) ProtoMessage() {} +func (*PipelineResources) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} } + +func (m *PipelineResources) GetMinimumCpuCores() int32 { + if m != nil { + return m.MinimumCpuCores + } + return 0 +} + +func (m *PipelineResources) GetPreemptible() bool { + if m != nil { + return m.Preemptible + } + return false +} + +func (m *PipelineResources) GetMinimumRamGb() float64 { + if m != nil { + return m.MinimumRamGb + } + return 0 +} + +func (m *PipelineResources) GetDisks() []*PipelineResources_Disk { + if m != nil { + return m.Disks + } + return nil +} + +func (m *PipelineResources) GetZones() []string { + if m != nil { + return m.Zones + } + return nil +} + +func (m *PipelineResources) GetBootDiskSizeGb() int32 { + if m != nil { + return m.BootDiskSizeGb + } + return 0 +} + +func (m *PipelineResources) GetNoAddress() bool { + if m != nil { + return m.NoAddress + } + return false +} + +// A Google Compute Engine disk resource specification. +type PipelineResources_Disk struct { + // Required. The name of the disk that can be used in the pipeline + // parameters. Must be 1 - 63 characters. + // The name "boot" is reserved for system use. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Required. The type of the disk to create. + Type PipelineResources_Disk_Type `protobuf:"varint,2,opt,name=type,enum=google.genomics.v1alpha2.PipelineResources_Disk_Type" json:"type,omitempty"` + // The size of the disk. Defaults to 500 (GB). + // This field is not applicable for local SSD. + SizeGb int32 `protobuf:"varint,3,opt,name=size_gb,json=sizeGb" json:"size_gb,omitempty"` + // The full or partial URL of the persistent disk to attach. See + // https://cloud.google.com/compute/docs/reference/latest/instances#resource + // and + // https://cloud.google.com/compute/docs/disks/persistent-disks#snapshots + // for more details. + Source string `protobuf:"bytes,4,opt,name=source" json:"source,omitempty"` + // Deprecated. Disks created by the Pipelines API will be deleted at the end + // of the pipeline run, regardless of what this field is set to. + AutoDelete bool `protobuf:"varint,6,opt,name=auto_delete,json=autoDelete" json:"auto_delete,omitempty"` + // Required at create time and cannot be overridden at run time. + // Specifies the path in the docker container where files on + // this disk should be located. For example, if `mountPoint` + // is `/mnt/disk`, and the parameter has `localPath` + // `inputs/file.txt`, the docker container can access the data at + // `/mnt/disk/inputs/file.txt`. + MountPoint string `protobuf:"bytes,8,opt,name=mount_point,json=mountPoint" json:"mount_point,omitempty"` +} + +func (m *PipelineResources_Disk) Reset() { *m = PipelineResources_Disk{} } +func (m *PipelineResources_Disk) String() string { return proto.CompactTextString(m) } +func (*PipelineResources_Disk) ProtoMessage() {} +func (*PipelineResources_Disk) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16, 0} } + +func (m *PipelineResources_Disk) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *PipelineResources_Disk) GetType() PipelineResources_Disk_Type { + if m != nil { + return m.Type + } + return PipelineResources_Disk_TYPE_UNSPECIFIED +} + +func (m *PipelineResources_Disk) GetSizeGb() int32 { + if m != nil { + return m.SizeGb + } + return 0 +} + +func (m *PipelineResources_Disk) GetSource() string { + if m != nil { + return m.Source + } + return "" +} + +func (m *PipelineResources_Disk) GetAutoDelete() bool { + if m != nil { + return m.AutoDelete + } + return false +} + +func (m *PipelineResources_Disk) GetMountPoint() string { + if m != nil { + return m.MountPoint + } + return "" +} + +// Parameters facilitate setting and delivering data into the +// pipeline's execution environment. They are defined at create time, +// with optional defaults, and can be overridden at run time. +// +// If `localCopy` is unset, then the parameter specifies a string that +// is passed as-is into the pipeline, as the value of the environment +// variable with the given name. A default value can be optionally +// specified at create time. The default can be overridden at run time +// using the inputs map. If no default is given, a value must be +// supplied at runtime. +// +// If `localCopy` is defined, then the parameter specifies a data +// source or sink, both in Google Cloud Storage and on the Docker container +// where the pipeline computation is run. The [service account associated with +// the Pipeline][google.genomics.v1alpha2.RunPipelineArgs.service_account] (by +// default the project's Compute Engine service account) must have access to the +// Google Cloud Storage paths. +// +// At run time, the Google Cloud Storage paths can be overridden if a default +// was provided at create time, or must be set otherwise. The pipeline runner +// should add a key/value pair to either the inputs or outputs map. The +// indicated data copies will be carried out before/after pipeline execution, +// just as if the corresponding arguments were provided to `gsutil cp`. +// +// For example: Given the following `PipelineParameter`, specified +// in the `inputParameters` list: +// +// ``` +// {name: "input_file", localCopy: {path: "file.txt", disk: "pd1"}} +// ``` +// +// where `disk` is defined in the `PipelineResources` object as: +// +// ``` +// {name: "pd1", mountPoint: "/mnt/disk/"} +// ``` +// +// We create a disk named `pd1`, mount it on the host VM, and map +// `/mnt/pd1` to `/mnt/disk` in the docker container. At +// runtime, an entry for `input_file` would be required in the inputs +// map, such as: +// +// ``` +// inputs["input_file"] = "gs://my-bucket/bar.txt" +// ``` +// +// This would generate the following gsutil call: +// +// ``` +// gsutil cp gs://my-bucket/bar.txt /mnt/pd1/file.txt +// ``` +// +// The file `/mnt/pd1/file.txt` maps to `/mnt/disk/file.txt` in the +// Docker container. Acceptable paths are: +// +//
+// +// +// +// +// +// +// +//
Google Cloud storage pathLocal path
filefile
globdirectory
+// +// For outputs, the direction of the copy is reversed: +// +// ``` +// gsutil cp /mnt/disk/file.txt gs://my-bucket/bar.txt +// ``` +// +// Acceptable paths are: +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +//
Local pathGoogle Cloud Storage path
filefile
filedirectory - directory must already exist
globdirectory - directory will be created if it doesn't exist
+// +// One restriction due to docker limitations, is that for outputs that are found +// on the boot disk, the local path cannot be a glob and must be a file. +type PipelineParameter struct { + // Required. Name of the parameter - the pipeline runner uses this string + // as the key to the input and output maps in RunPipeline. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Human-readable description. + Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` + // The default value for this parameter. Can be overridden at runtime. + // If `localCopy` is present, then this must be a Google Cloud Storage path + // beginning with `gs://`. + DefaultValue string `protobuf:"bytes,5,opt,name=default_value,json=defaultValue" json:"default_value,omitempty"` + // If present, this parameter is marked for copying to and from the VM. + // `LocalCopy` indicates where on the VM the file should be. The value + // given to this parameter (either at runtime or using `defaultValue`) + // must be the remote path where the file should be. + LocalCopy *PipelineParameter_LocalCopy `protobuf:"bytes,6,opt,name=local_copy,json=localCopy" json:"local_copy,omitempty"` +} + +func (m *PipelineParameter) Reset() { *m = PipelineParameter{} } +func (m *PipelineParameter) String() string { return proto.CompactTextString(m) } +func (*PipelineParameter) ProtoMessage() {} +func (*PipelineParameter) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17} } + +func (m *PipelineParameter) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *PipelineParameter) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *PipelineParameter) GetDefaultValue() string { + if m != nil { + return m.DefaultValue + } + return "" +} + +func (m *PipelineParameter) GetLocalCopy() *PipelineParameter_LocalCopy { + if m != nil { + return m.LocalCopy + } + return nil +} + +// LocalCopy defines how a remote file should be copied to and from the VM. +type PipelineParameter_LocalCopy struct { + // Required. The path within the user's docker container where + // this input should be localized to and from, relative to the specified + // disk's mount point. For example: file.txt, + Path string `protobuf:"bytes,1,opt,name=path" json:"path,omitempty"` + // Required. The name of the disk where this parameter is + // located. Can be the name of one of the disks specified in the + // Resources field, or "boot", which represents the Docker + // instance's boot disk and has a mount point of `/`. + Disk string `protobuf:"bytes,2,opt,name=disk" json:"disk,omitempty"` +} + +func (m *PipelineParameter_LocalCopy) Reset() { *m = PipelineParameter_LocalCopy{} } +func (m *PipelineParameter_LocalCopy) String() string { return proto.CompactTextString(m) } +func (*PipelineParameter_LocalCopy) ProtoMessage() {} +func (*PipelineParameter_LocalCopy) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17, 0} } + +func (m *PipelineParameter_LocalCopy) GetPath() string { + if m != nil { + return m.Path + } + return "" +} + +func (m *PipelineParameter_LocalCopy) GetDisk() string { + if m != nil { + return m.Disk + } + return "" +} + +// The Docker execuctor specification. +type DockerExecutor struct { + // Required. Image name from either Docker Hub or Google Container Registry. + // Users that run pipelines must have READ access to the image. + ImageName string `protobuf:"bytes,1,opt,name=image_name,json=imageName" json:"image_name,omitempty"` + // Required. The command or newline delimited script to run. The command + // string will be executed within a bash shell. + // + // If the command exits with a non-zero exit code, output parameter + // de-localization will be skipped and the pipeline operation's + // [`error`][google.longrunning.Operation.error] field will be populated. + // + // Maximum command string length is 16384. + Cmd string `protobuf:"bytes,2,opt,name=cmd" json:"cmd,omitempty"` +} + +func (m *DockerExecutor) Reset() { *m = DockerExecutor{} } +func (m *DockerExecutor) String() string { return proto.CompactTextString(m) } +func (*DockerExecutor) ProtoMessage() {} +func (*DockerExecutor) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{18} } + +func (m *DockerExecutor) GetImageName() string { + if m != nil { + return m.ImageName + } + return "" +} + +func (m *DockerExecutor) GetCmd() string { + if m != nil { + return m.Cmd + } + return "" +} + +func init() { + proto.RegisterType((*ComputeEngine)(nil), "google.genomics.v1alpha2.ComputeEngine") + proto.RegisterType((*RuntimeMetadata)(nil), "google.genomics.v1alpha2.RuntimeMetadata") + proto.RegisterType((*Pipeline)(nil), "google.genomics.v1alpha2.Pipeline") + proto.RegisterType((*CreatePipelineRequest)(nil), "google.genomics.v1alpha2.CreatePipelineRequest") + proto.RegisterType((*RunPipelineArgs)(nil), "google.genomics.v1alpha2.RunPipelineArgs") + proto.RegisterType((*RunPipelineRequest)(nil), "google.genomics.v1alpha2.RunPipelineRequest") + proto.RegisterType((*GetPipelineRequest)(nil), "google.genomics.v1alpha2.GetPipelineRequest") + proto.RegisterType((*ListPipelinesRequest)(nil), "google.genomics.v1alpha2.ListPipelinesRequest") + proto.RegisterType((*ListPipelinesResponse)(nil), "google.genomics.v1alpha2.ListPipelinesResponse") + proto.RegisterType((*DeletePipelineRequest)(nil), "google.genomics.v1alpha2.DeletePipelineRequest") + proto.RegisterType((*GetControllerConfigRequest)(nil), "google.genomics.v1alpha2.GetControllerConfigRequest") + proto.RegisterType((*ControllerConfig)(nil), "google.genomics.v1alpha2.ControllerConfig") + proto.RegisterType((*ControllerConfig_RepeatedString)(nil), "google.genomics.v1alpha2.ControllerConfig.RepeatedString") + proto.RegisterType((*TimestampEvent)(nil), "google.genomics.v1alpha2.TimestampEvent") + proto.RegisterType((*SetOperationStatusRequest)(nil), "google.genomics.v1alpha2.SetOperationStatusRequest") + proto.RegisterType((*ServiceAccount)(nil), "google.genomics.v1alpha2.ServiceAccount") + proto.RegisterType((*LoggingOptions)(nil), "google.genomics.v1alpha2.LoggingOptions") + proto.RegisterType((*PipelineResources)(nil), "google.genomics.v1alpha2.PipelineResources") + proto.RegisterType((*PipelineResources_Disk)(nil), "google.genomics.v1alpha2.PipelineResources.Disk") + proto.RegisterType((*PipelineParameter)(nil), "google.genomics.v1alpha2.PipelineParameter") + proto.RegisterType((*PipelineParameter_LocalCopy)(nil), "google.genomics.v1alpha2.PipelineParameter.LocalCopy") + proto.RegisterType((*DockerExecutor)(nil), "google.genomics.v1alpha2.DockerExecutor") + proto.RegisterEnum("google.genomics.v1alpha2.PipelineResources_Disk_Type", PipelineResources_Disk_Type_name, PipelineResources_Disk_Type_value) +} + +// 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 + +// Client API for PipelinesV1Alpha2 service + +type PipelinesV1Alpha2Client interface { + // Creates a pipeline that can be run later. Create takes a Pipeline that + // has all fields other than `pipelineId` populated, and then returns + // the same pipeline with `pipelineId` populated. This id can be used + // to run the pipeline. + // + // Caller must have WRITE permission to the project. + CreatePipeline(ctx context.Context, in *CreatePipelineRequest, opts ...grpc.CallOption) (*Pipeline, error) + // Runs a pipeline. If `pipelineId` is specified in the request, then + // run a saved pipeline. If `ephemeralPipeline` is specified, then run + // that pipeline once without saving a copy. + // + // The caller must have READ permission to the project where the pipeline + // is stored and WRITE permission to the project where the pipeline will be + // run, as VMs will be created and storage will be used. + RunPipeline(ctx context.Context, in *RunPipelineRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Retrieves a pipeline based on ID. + // + // Caller must have READ permission to the project. + GetPipeline(ctx context.Context, in *GetPipelineRequest, opts ...grpc.CallOption) (*Pipeline, error) + // Lists pipelines. + // + // Caller must have READ permission to the project. + ListPipelines(ctx context.Context, in *ListPipelinesRequest, opts ...grpc.CallOption) (*ListPipelinesResponse, error) + // Deletes a pipeline based on ID. + // + // Caller must have WRITE permission to the project. + DeletePipeline(ctx context.Context, in *DeletePipelineRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) + // Gets controller configuration information. Should only be called + // by VMs created by the Pipelines Service and not by end users. + GetControllerConfig(ctx context.Context, in *GetControllerConfigRequest, opts ...grpc.CallOption) (*ControllerConfig, error) + // Sets status of a given operation. Any new timestamps (as determined by + // description) are appended to TimestampEvents. Should only be called by VMs + // created by the Pipelines Service and not by end users. + SetOperationStatus(ctx context.Context, in *SetOperationStatusRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) +} + +type pipelinesV1Alpha2Client struct { + cc *grpc.ClientConn +} + +func NewPipelinesV1Alpha2Client(cc *grpc.ClientConn) PipelinesV1Alpha2Client { + return &pipelinesV1Alpha2Client{cc} +} + +func (c *pipelinesV1Alpha2Client) CreatePipeline(ctx context.Context, in *CreatePipelineRequest, opts ...grpc.CallOption) (*Pipeline, error) { + out := new(Pipeline) + err := grpc.Invoke(ctx, "/google.genomics.v1alpha2.PipelinesV1Alpha2/CreatePipeline", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pipelinesV1Alpha2Client) RunPipeline(ctx context.Context, in *RunPipelineRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.genomics.v1alpha2.PipelinesV1Alpha2/RunPipeline", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pipelinesV1Alpha2Client) GetPipeline(ctx context.Context, in *GetPipelineRequest, opts ...grpc.CallOption) (*Pipeline, error) { + out := new(Pipeline) + err := grpc.Invoke(ctx, "/google.genomics.v1alpha2.PipelinesV1Alpha2/GetPipeline", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pipelinesV1Alpha2Client) ListPipelines(ctx context.Context, in *ListPipelinesRequest, opts ...grpc.CallOption) (*ListPipelinesResponse, error) { + out := new(ListPipelinesResponse) + err := grpc.Invoke(ctx, "/google.genomics.v1alpha2.PipelinesV1Alpha2/ListPipelines", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pipelinesV1Alpha2Client) DeletePipeline(ctx context.Context, in *DeletePipelineRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) { + out := new(google_protobuf2.Empty) + err := grpc.Invoke(ctx, "/google.genomics.v1alpha2.PipelinesV1Alpha2/DeletePipeline", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pipelinesV1Alpha2Client) GetControllerConfig(ctx context.Context, in *GetControllerConfigRequest, opts ...grpc.CallOption) (*ControllerConfig, error) { + out := new(ControllerConfig) + err := grpc.Invoke(ctx, "/google.genomics.v1alpha2.PipelinesV1Alpha2/GetControllerConfig", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pipelinesV1Alpha2Client) SetOperationStatus(ctx context.Context, in *SetOperationStatusRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) { + out := new(google_protobuf2.Empty) + err := grpc.Invoke(ctx, "/google.genomics.v1alpha2.PipelinesV1Alpha2/SetOperationStatus", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for PipelinesV1Alpha2 service + +type PipelinesV1Alpha2Server interface { + // Creates a pipeline that can be run later. Create takes a Pipeline that + // has all fields other than `pipelineId` populated, and then returns + // the same pipeline with `pipelineId` populated. This id can be used + // to run the pipeline. + // + // Caller must have WRITE permission to the project. + CreatePipeline(context.Context, *CreatePipelineRequest) (*Pipeline, error) + // Runs a pipeline. If `pipelineId` is specified in the request, then + // run a saved pipeline. If `ephemeralPipeline` is specified, then run + // that pipeline once without saving a copy. + // + // The caller must have READ permission to the project where the pipeline + // is stored and WRITE permission to the project where the pipeline will be + // run, as VMs will be created and storage will be used. + RunPipeline(context.Context, *RunPipelineRequest) (*google_longrunning.Operation, error) + // Retrieves a pipeline based on ID. + // + // Caller must have READ permission to the project. + GetPipeline(context.Context, *GetPipelineRequest) (*Pipeline, error) + // Lists pipelines. + // + // Caller must have READ permission to the project. + ListPipelines(context.Context, *ListPipelinesRequest) (*ListPipelinesResponse, error) + // Deletes a pipeline based on ID. + // + // Caller must have WRITE permission to the project. + DeletePipeline(context.Context, *DeletePipelineRequest) (*google_protobuf2.Empty, error) + // Gets controller configuration information. Should only be called + // by VMs created by the Pipelines Service and not by end users. + GetControllerConfig(context.Context, *GetControllerConfigRequest) (*ControllerConfig, error) + // Sets status of a given operation. Any new timestamps (as determined by + // description) are appended to TimestampEvents. Should only be called by VMs + // created by the Pipelines Service and not by end users. + SetOperationStatus(context.Context, *SetOperationStatusRequest) (*google_protobuf2.Empty, error) +} + +func RegisterPipelinesV1Alpha2Server(s *grpc.Server, srv PipelinesV1Alpha2Server) { + s.RegisterService(&_PipelinesV1Alpha2_serviceDesc, srv) +} + +func _PipelinesV1Alpha2_CreatePipeline_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreatePipelineRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PipelinesV1Alpha2Server).CreatePipeline(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1alpha2.PipelinesV1Alpha2/CreatePipeline", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PipelinesV1Alpha2Server).CreatePipeline(ctx, req.(*CreatePipelineRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PipelinesV1Alpha2_RunPipeline_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RunPipelineRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PipelinesV1Alpha2Server).RunPipeline(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1alpha2.PipelinesV1Alpha2/RunPipeline", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PipelinesV1Alpha2Server).RunPipeline(ctx, req.(*RunPipelineRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PipelinesV1Alpha2_GetPipeline_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetPipelineRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PipelinesV1Alpha2Server).GetPipeline(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1alpha2.PipelinesV1Alpha2/GetPipeline", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PipelinesV1Alpha2Server).GetPipeline(ctx, req.(*GetPipelineRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PipelinesV1Alpha2_ListPipelines_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListPipelinesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PipelinesV1Alpha2Server).ListPipelines(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1alpha2.PipelinesV1Alpha2/ListPipelines", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PipelinesV1Alpha2Server).ListPipelines(ctx, req.(*ListPipelinesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PipelinesV1Alpha2_DeletePipeline_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeletePipelineRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PipelinesV1Alpha2Server).DeletePipeline(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1alpha2.PipelinesV1Alpha2/DeletePipeline", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PipelinesV1Alpha2Server).DeletePipeline(ctx, req.(*DeletePipelineRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PipelinesV1Alpha2_GetControllerConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetControllerConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PipelinesV1Alpha2Server).GetControllerConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1alpha2.PipelinesV1Alpha2/GetControllerConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PipelinesV1Alpha2Server).GetControllerConfig(ctx, req.(*GetControllerConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PipelinesV1Alpha2_SetOperationStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetOperationStatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PipelinesV1Alpha2Server).SetOperationStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.genomics.v1alpha2.PipelinesV1Alpha2/SetOperationStatus", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PipelinesV1Alpha2Server).SetOperationStatus(ctx, req.(*SetOperationStatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _PipelinesV1Alpha2_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.genomics.v1alpha2.PipelinesV1Alpha2", + HandlerType: (*PipelinesV1Alpha2Server)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreatePipeline", + Handler: _PipelinesV1Alpha2_CreatePipeline_Handler, + }, + { + MethodName: "RunPipeline", + Handler: _PipelinesV1Alpha2_RunPipeline_Handler, + }, + { + MethodName: "GetPipeline", + Handler: _PipelinesV1Alpha2_GetPipeline_Handler, + }, + { + MethodName: "ListPipelines", + Handler: _PipelinesV1Alpha2_ListPipelines_Handler, + }, + { + MethodName: "DeletePipeline", + Handler: _PipelinesV1Alpha2_DeletePipeline_Handler, + }, + { + MethodName: "GetControllerConfig", + Handler: _PipelinesV1Alpha2_GetControllerConfig_Handler, + }, + { + MethodName: "SetOperationStatus", + Handler: _PipelinesV1Alpha2_SetOperationStatus_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/genomics/v1alpha2/pipelines.proto", +} + +func init() { proto.RegisterFile("google/genomics/v1alpha2/pipelines.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 2065 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0x4d, 0x73, 0xdb, 0xc8, + 0xd1, 0x36, 0x28, 0x4a, 0x22, 0x9a, 0x12, 0x45, 0xcf, 0xda, 0x6b, 0x9a, 0xf6, 0xbe, 0xb6, 0xe1, + 0x37, 0xbb, 0xb2, 0x9c, 0x22, 0x63, 0x79, 0x9d, 0xc8, 0x4a, 0xd5, 0xd6, 0x4a, 0x14, 0x2d, 0xb1, + 0x22, 0x4b, 0x0c, 0xa8, 0x55, 0xbe, 0x0e, 0xa8, 0x11, 0x38, 0x82, 0xb0, 0x02, 0x30, 0x08, 0x06, + 0x50, 0x59, 0x4e, 0x25, 0x55, 0x49, 0xe5, 0x90, 0xda, 0x4a, 0x2e, 0xc9, 0xfe, 0x88, 0x5c, 0x72, + 0xcc, 0xcf, 0xc8, 0x29, 0xa7, 0x9c, 0x72, 0xc9, 0x21, 0x3f, 0x21, 0xb9, 0xa5, 0x66, 0x06, 0x03, + 0x82, 0x1f, 0x92, 0xc8, 0xaa, 0x54, 0x6e, 0x33, 0x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0xbe, 0x54, 0x6e, 0x59, 0x9b, + 0xc2, 0x2d, 0x7f, 0xd4, 0xe0, 0x83, 0x09, 0x4d, 0x02, 0xfa, 0xf4, 0xda, 0xb3, 0xba, 0xa2, 0xa7, + 0xa8, 0xaf, 0x4d, 0x5f, 0xef, 0x18, 0x4d, 0x41, 0xf2, 0x19, 0xfa, 0x64, 0x52, 0x04, 0x39, 0x13, + 0x28, 0x7d, 0xad, 0x01, 0x1a, 0x2f, 0x4c, 0xd0, 0xcb, 0xeb, 0xfe, 0xd2, 0x5c, 0x51, 0xc6, 0x5c, + 0xe9, 0xb9, 0x17, 0x82, 0xd4, 0xf3, 0xfa, 0xc7, 0x93, 0x48, 0xb1, 0x31, 0xb8, 0x4d, 0x6d, 0x6d, + 0x3b, 0x84, 0x7b, 0x36, 0xf5, 0x27, 0x91, 0xd8, 0xae, 0x64, 0x31, 0xd1, 0xe5, 0x9f, 0xe9, 0x6a, + 0x3f, 0xfe, 0x5c, 0xa9, 0x51, 0x0f, 0x07, 0x4e, 0x83, 0x46, 0x4e, 0xd3, 0x21, 0x81, 0x20, 0xd1, + 0x94, 0x4b, 0x38, 0x74, 0xd9, 0xf8, 0x3f, 0xf7, 0xef, 0x2a, 0xc9, 0xbf, 0x34, 0xed, 0x64, 0x41, + 0xe8, 0xbf, 0xfc, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x13, 0x10, 0x96, 0x1d, 0xa2, 0x17, 0x00, + 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/iam/admin/v1/iam.pb.go b/vendor/google.golang.org/genproto/googleapis/iam/admin/v1/iam.pb.go new file mode 100644 index 0000000000..44bb9b40f2 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/iam/admin/v1/iam.pb.go @@ -0,0 +1,2523 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/iam/admin/v1/iam.proto + +/* +Package admin is a generated protocol buffer package. + +It is generated from these files: + google/iam/admin/v1/iam.proto + +It has these top-level messages: + ServiceAccount + CreateServiceAccountRequest + ListServiceAccountsRequest + ListServiceAccountsResponse + GetServiceAccountRequest + DeleteServiceAccountRequest + ListServiceAccountKeysRequest + ListServiceAccountKeysResponse + GetServiceAccountKeyRequest + ServiceAccountKey + CreateServiceAccountKeyRequest + DeleteServiceAccountKeyRequest + SignBlobRequest + SignBlobResponse + SignJwtRequest + SignJwtResponse + Role + QueryGrantableRolesRequest + QueryGrantableRolesResponse + ListRolesRequest + ListRolesResponse + GetRoleRequest + CreateRoleRequest + UpdateRoleRequest + DeleteRoleRequest + UndeleteRoleRequest + Permission + QueryTestablePermissionsRequest + QueryTestablePermissionsResponse +*/ +package admin + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_iam_v11 "google.golang.org/genproto/googleapis/iam/v1" +import google_iam_v1 "google.golang.org/genproto/googleapis/iam/v1" +import google_protobuf1 "github.com/golang/protobuf/ptypes/empty" +import google_protobuf2 "google.golang.org/genproto/protobuf/field_mask" +import google_protobuf3 "github.com/golang/protobuf/ptypes/timestamp" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Supported key algorithms. +type ServiceAccountKeyAlgorithm int32 + +const ( + // An unspecified key algorithm. + ServiceAccountKeyAlgorithm_KEY_ALG_UNSPECIFIED ServiceAccountKeyAlgorithm = 0 + // 1k RSA Key. + ServiceAccountKeyAlgorithm_KEY_ALG_RSA_1024 ServiceAccountKeyAlgorithm = 1 + // 2k RSA Key. + ServiceAccountKeyAlgorithm_KEY_ALG_RSA_2048 ServiceAccountKeyAlgorithm = 2 +) + +var ServiceAccountKeyAlgorithm_name = map[int32]string{ + 0: "KEY_ALG_UNSPECIFIED", + 1: "KEY_ALG_RSA_1024", + 2: "KEY_ALG_RSA_2048", +} +var ServiceAccountKeyAlgorithm_value = map[string]int32{ + "KEY_ALG_UNSPECIFIED": 0, + "KEY_ALG_RSA_1024": 1, + "KEY_ALG_RSA_2048": 2, +} + +func (x ServiceAccountKeyAlgorithm) String() string { + return proto.EnumName(ServiceAccountKeyAlgorithm_name, int32(x)) +} +func (ServiceAccountKeyAlgorithm) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +// Supported private key output formats. +type ServiceAccountPrivateKeyType int32 + +const ( + // Unspecified. Equivalent to `TYPE_GOOGLE_CREDENTIALS_FILE`. + ServiceAccountPrivateKeyType_TYPE_UNSPECIFIED ServiceAccountPrivateKeyType = 0 + // PKCS12 format. + // The password for the PKCS12 file is `notasecret`. + // For more information, see https://tools.ietf.org/html/rfc7292. + ServiceAccountPrivateKeyType_TYPE_PKCS12_FILE ServiceAccountPrivateKeyType = 1 + // Google Credentials File format. + ServiceAccountPrivateKeyType_TYPE_GOOGLE_CREDENTIALS_FILE ServiceAccountPrivateKeyType = 2 +) + +var ServiceAccountPrivateKeyType_name = map[int32]string{ + 0: "TYPE_UNSPECIFIED", + 1: "TYPE_PKCS12_FILE", + 2: "TYPE_GOOGLE_CREDENTIALS_FILE", +} +var ServiceAccountPrivateKeyType_value = map[string]int32{ + "TYPE_UNSPECIFIED": 0, + "TYPE_PKCS12_FILE": 1, + "TYPE_GOOGLE_CREDENTIALS_FILE": 2, +} + +func (x ServiceAccountPrivateKeyType) String() string { + return proto.EnumName(ServiceAccountPrivateKeyType_name, int32(x)) +} +func (ServiceAccountPrivateKeyType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +// Supported public key output formats. +type ServiceAccountPublicKeyType int32 + +const ( + // Unspecified. Returns nothing here. + ServiceAccountPublicKeyType_TYPE_NONE ServiceAccountPublicKeyType = 0 + // X509 PEM format. + ServiceAccountPublicKeyType_TYPE_X509_PEM_FILE ServiceAccountPublicKeyType = 1 + // Raw public key. + ServiceAccountPublicKeyType_TYPE_RAW_PUBLIC_KEY ServiceAccountPublicKeyType = 2 +) + +var ServiceAccountPublicKeyType_name = map[int32]string{ + 0: "TYPE_NONE", + 1: "TYPE_X509_PEM_FILE", + 2: "TYPE_RAW_PUBLIC_KEY", +} +var ServiceAccountPublicKeyType_value = map[string]int32{ + "TYPE_NONE": 0, + "TYPE_X509_PEM_FILE": 1, + "TYPE_RAW_PUBLIC_KEY": 2, +} + +func (x ServiceAccountPublicKeyType) String() string { + return proto.EnumName(ServiceAccountPublicKeyType_name, int32(x)) +} +func (ServiceAccountPublicKeyType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +// A view for Role objects. +type RoleView int32 + +const ( + // Omits the `included_permissions` field. + // This is the default value. + RoleView_BASIC RoleView = 0 + // Returns all fields. + RoleView_FULL RoleView = 1 +) + +var RoleView_name = map[int32]string{ + 0: "BASIC", + 1: "FULL", +} +var RoleView_value = map[string]int32{ + "BASIC": 0, + "FULL": 1, +} + +func (x RoleView) String() string { + return proto.EnumName(RoleView_name, int32(x)) +} +func (RoleView) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +// `KeyType` filters to selectively retrieve certain varieties +// of keys. +type ListServiceAccountKeysRequest_KeyType int32 + +const ( + // Unspecified key type. The presence of this in the + // message will immediately result in an error. + ListServiceAccountKeysRequest_KEY_TYPE_UNSPECIFIED ListServiceAccountKeysRequest_KeyType = 0 + // User-managed keys (managed and rotated by the user). + ListServiceAccountKeysRequest_USER_MANAGED ListServiceAccountKeysRequest_KeyType = 1 + // System-managed keys (managed and rotated by Google). + ListServiceAccountKeysRequest_SYSTEM_MANAGED ListServiceAccountKeysRequest_KeyType = 2 +) + +var ListServiceAccountKeysRequest_KeyType_name = map[int32]string{ + 0: "KEY_TYPE_UNSPECIFIED", + 1: "USER_MANAGED", + 2: "SYSTEM_MANAGED", +} +var ListServiceAccountKeysRequest_KeyType_value = map[string]int32{ + "KEY_TYPE_UNSPECIFIED": 0, + "USER_MANAGED": 1, + "SYSTEM_MANAGED": 2, +} + +func (x ListServiceAccountKeysRequest_KeyType) String() string { + return proto.EnumName(ListServiceAccountKeysRequest_KeyType_name, int32(x)) +} +func (ListServiceAccountKeysRequest_KeyType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{6, 0} +} + +// A stage representing a role's lifecycle phase. +type Role_RoleLaunchStage int32 + +const ( + // The user has indicated this role is currently in an alpha phase. + Role_ALPHA Role_RoleLaunchStage = 0 + // The user has indicated this role is currently in a beta phase. + Role_BETA Role_RoleLaunchStage = 1 + // The user has indicated this role is generally available. + Role_GA Role_RoleLaunchStage = 2 + // The user has indicated this role is being deprecated. + Role_DEPRECATED Role_RoleLaunchStage = 4 + // This role is disabled and will not contribute permissions to any members + // it is granted to in policies. + Role_DISABLED Role_RoleLaunchStage = 5 + // The user has indicated this role is currently in an eap phase. + Role_EAP Role_RoleLaunchStage = 6 +) + +var Role_RoleLaunchStage_name = map[int32]string{ + 0: "ALPHA", + 1: "BETA", + 2: "GA", + 4: "DEPRECATED", + 5: "DISABLED", + 6: "EAP", +} +var Role_RoleLaunchStage_value = map[string]int32{ + "ALPHA": 0, + "BETA": 1, + "GA": 2, + "DEPRECATED": 4, + "DISABLED": 5, + "EAP": 6, +} + +func (x Role_RoleLaunchStage) String() string { + return proto.EnumName(Role_RoleLaunchStage_name, int32(x)) +} +func (Role_RoleLaunchStage) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{16, 0} } + +// A stage representing a permission's lifecycle phase. +type Permission_PermissionLaunchStage int32 + +const ( + // The permission is currently in an alpha phase. + Permission_ALPHA Permission_PermissionLaunchStage = 0 + // The permission is currently in a beta phase. + Permission_BETA Permission_PermissionLaunchStage = 1 + // The permission is generally available. + Permission_GA Permission_PermissionLaunchStage = 2 + // The permission is being deprecated. + Permission_DEPRECATED Permission_PermissionLaunchStage = 3 +) + +var Permission_PermissionLaunchStage_name = map[int32]string{ + 0: "ALPHA", + 1: "BETA", + 2: "GA", + 3: "DEPRECATED", +} +var Permission_PermissionLaunchStage_value = map[string]int32{ + "ALPHA": 0, + "BETA": 1, + "GA": 2, + "DEPRECATED": 3, +} + +func (x Permission_PermissionLaunchStage) String() string { + return proto.EnumName(Permission_PermissionLaunchStage_name, int32(x)) +} +func (Permission_PermissionLaunchStage) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{26, 0} +} + +// The state of the permission with regards to custom roles. +type Permission_CustomRolesSupportLevel int32 + +const ( + // Permission is fully supported for custom role use. + Permission_SUPPORTED Permission_CustomRolesSupportLevel = 0 + // Permission is being tested to check custom role compatibility. + Permission_TESTING Permission_CustomRolesSupportLevel = 1 + // Permission is not supported for custom role use. + Permission_NOT_SUPPORTED Permission_CustomRolesSupportLevel = 2 +) + +var Permission_CustomRolesSupportLevel_name = map[int32]string{ + 0: "SUPPORTED", + 1: "TESTING", + 2: "NOT_SUPPORTED", +} +var Permission_CustomRolesSupportLevel_value = map[string]int32{ + "SUPPORTED": 0, + "TESTING": 1, + "NOT_SUPPORTED": 2, +} + +func (x Permission_CustomRolesSupportLevel) String() string { + return proto.EnumName(Permission_CustomRolesSupportLevel_name, int32(x)) +} +func (Permission_CustomRolesSupportLevel) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{26, 1} +} + +// A service account in the Identity and Access Management API. +// +// To create a service account, specify the `project_id` and the `account_id` +// for the account. The `account_id` is unique within the project, and is used +// to generate the service account email address and a stable +// `unique_id`. +// +// If the account already exists, the account's resource name is returned +// in util::Status's ResourceInfo.resource_name in the format of +// projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}. The caller can +// use the name in other methods to access the account. +// +// All other methods can identify the service account using the format +// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. +// Using `-` as a wildcard for the project will infer the project from +// the account. The `account` value can be the `email` address or the +// `unique_id` of the service account. +type ServiceAccount struct { + // The resource name of the service account in the following format: + // `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. + // + // Requests using `-` as a wildcard for the project will infer the project + // from the `account` and the `account` value can be the `email` address or + // the `unique_id` of the service account. + // + // In responses the resource name will always be in the format + // `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // @OutputOnly The id of the project that owns the service account. + ProjectId string `protobuf:"bytes,2,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // @OutputOnly The unique and stable id of the service account. + UniqueId string `protobuf:"bytes,4,opt,name=unique_id,json=uniqueId" json:"unique_id,omitempty"` + // @OutputOnly The email address of the service account. + Email string `protobuf:"bytes,5,opt,name=email" json:"email,omitempty"` + // Optional. A user-specified description of the service account. Must be + // fewer than 100 UTF-8 bytes. + DisplayName string `protobuf:"bytes,6,opt,name=display_name,json=displayName" json:"display_name,omitempty"` + // Used to perform a consistent read-modify-write. + Etag []byte `protobuf:"bytes,7,opt,name=etag,proto3" json:"etag,omitempty"` + // @OutputOnly. The OAuth2 client id for the service account. + // This is used in conjunction with the OAuth2 clientconfig API to make + // three legged OAuth2 (3LO) flows to access the data of Google users. + Oauth2ClientId string `protobuf:"bytes,9,opt,name=oauth2_client_id,json=oauth2ClientId" json:"oauth2_client_id,omitempty"` +} + +func (m *ServiceAccount) Reset() { *m = ServiceAccount{} } +func (m *ServiceAccount) String() string { return proto.CompactTextString(m) } +func (*ServiceAccount) ProtoMessage() {} +func (*ServiceAccount) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *ServiceAccount) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ServiceAccount) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *ServiceAccount) GetUniqueId() string { + if m != nil { + return m.UniqueId + } + return "" +} + +func (m *ServiceAccount) GetEmail() string { + if m != nil { + return m.Email + } + return "" +} + +func (m *ServiceAccount) GetDisplayName() string { + if m != nil { + return m.DisplayName + } + return "" +} + +func (m *ServiceAccount) GetEtag() []byte { + if m != nil { + return m.Etag + } + return nil +} + +func (m *ServiceAccount) GetOauth2ClientId() string { + if m != nil { + return m.Oauth2ClientId + } + return "" +} + +// The service account create request. +type CreateServiceAccountRequest struct { + // Required. The resource name of the project associated with the service + // accounts, such as `projects/my-project-123`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Required. The account id that is used to generate the service account + // email address and a stable unique id. It is unique within a project, + // must be 6-30 characters long, and match the regular expression + // `[a-z]([-a-z0-9]*[a-z0-9])` to comply with RFC1035. + AccountId string `protobuf:"bytes,2,opt,name=account_id,json=accountId" json:"account_id,omitempty"` + // The [ServiceAccount][google.iam.admin.v1.ServiceAccount] resource to create. + // Currently, only the following values are user assignable: + // `display_name` . + ServiceAccount *ServiceAccount `protobuf:"bytes,3,opt,name=service_account,json=serviceAccount" json:"service_account,omitempty"` +} + +func (m *CreateServiceAccountRequest) Reset() { *m = CreateServiceAccountRequest{} } +func (m *CreateServiceAccountRequest) String() string { return proto.CompactTextString(m) } +func (*CreateServiceAccountRequest) ProtoMessage() {} +func (*CreateServiceAccountRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *CreateServiceAccountRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *CreateServiceAccountRequest) GetAccountId() string { + if m != nil { + return m.AccountId + } + return "" +} + +func (m *CreateServiceAccountRequest) GetServiceAccount() *ServiceAccount { + if m != nil { + return m.ServiceAccount + } + return nil +} + +// The service account list request. +type ListServiceAccountsRequest struct { + // Required. The resource name of the project associated with the service + // accounts, such as `projects/my-project-123`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Optional limit on the number of service accounts to include in the + // response. Further accounts can subsequently be obtained by including the + // [ListServiceAccountsResponse.next_page_token][google.iam.admin.v1.ListServiceAccountsResponse.next_page_token] + // in a subsequent request. + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // Optional pagination token returned in an earlier + // [ListServiceAccountsResponse.next_page_token][google.iam.admin.v1.ListServiceAccountsResponse.next_page_token]. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListServiceAccountsRequest) Reset() { *m = ListServiceAccountsRequest{} } +func (m *ListServiceAccountsRequest) String() string { return proto.CompactTextString(m) } +func (*ListServiceAccountsRequest) ProtoMessage() {} +func (*ListServiceAccountsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *ListServiceAccountsRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ListServiceAccountsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListServiceAccountsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// The service account list response. +type ListServiceAccountsResponse struct { + // The list of matching service accounts. + Accounts []*ServiceAccount `protobuf:"bytes,1,rep,name=accounts" json:"accounts,omitempty"` + // To retrieve the next page of results, set + // [ListServiceAccountsRequest.page_token][google.iam.admin.v1.ListServiceAccountsRequest.page_token] + // to this value. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListServiceAccountsResponse) Reset() { *m = ListServiceAccountsResponse{} } +func (m *ListServiceAccountsResponse) String() string { return proto.CompactTextString(m) } +func (*ListServiceAccountsResponse) ProtoMessage() {} +func (*ListServiceAccountsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *ListServiceAccountsResponse) GetAccounts() []*ServiceAccount { + if m != nil { + return m.Accounts + } + return nil +} + +func (m *ListServiceAccountsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// The service account get request. +type GetServiceAccountRequest struct { + // The resource name of the service account in the following format: + // `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. + // Using `-` as a wildcard for the project will infer the project from + // the account. The `account` value can be the `email` address or the + // `unique_id` of the service account. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetServiceAccountRequest) Reset() { *m = GetServiceAccountRequest{} } +func (m *GetServiceAccountRequest) String() string { return proto.CompactTextString(m) } +func (*GetServiceAccountRequest) ProtoMessage() {} +func (*GetServiceAccountRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *GetServiceAccountRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// The service account delete request. +type DeleteServiceAccountRequest struct { + // The resource name of the service account in the following format: + // `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. + // Using `-` as a wildcard for the project will infer the project from + // the account. The `account` value can be the `email` address or the + // `unique_id` of the service account. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *DeleteServiceAccountRequest) Reset() { *m = DeleteServiceAccountRequest{} } +func (m *DeleteServiceAccountRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteServiceAccountRequest) ProtoMessage() {} +func (*DeleteServiceAccountRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *DeleteServiceAccountRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// The service account keys list request. +type ListServiceAccountKeysRequest struct { + // The resource name of the service account in the following format: + // `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. + // + // Using `-` as a wildcard for the project, will infer the project from + // the account. The `account` value can be the `email` address or the + // `unique_id` of the service account. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Filters the types of keys the user wants to include in the list + // response. Duplicate key types are not allowed. If no key type + // is provided, all keys are returned. + KeyTypes []ListServiceAccountKeysRequest_KeyType `protobuf:"varint,2,rep,packed,name=key_types,json=keyTypes,enum=google.iam.admin.v1.ListServiceAccountKeysRequest_KeyType" json:"key_types,omitempty"` +} + +func (m *ListServiceAccountKeysRequest) Reset() { *m = ListServiceAccountKeysRequest{} } +func (m *ListServiceAccountKeysRequest) String() string { return proto.CompactTextString(m) } +func (*ListServiceAccountKeysRequest) ProtoMessage() {} +func (*ListServiceAccountKeysRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *ListServiceAccountKeysRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ListServiceAccountKeysRequest) GetKeyTypes() []ListServiceAccountKeysRequest_KeyType { + if m != nil { + return m.KeyTypes + } + return nil +} + +// The service account keys list response. +type ListServiceAccountKeysResponse struct { + // The public keys for the service account. + Keys []*ServiceAccountKey `protobuf:"bytes,1,rep,name=keys" json:"keys,omitempty"` +} + +func (m *ListServiceAccountKeysResponse) Reset() { *m = ListServiceAccountKeysResponse{} } +func (m *ListServiceAccountKeysResponse) String() string { return proto.CompactTextString(m) } +func (*ListServiceAccountKeysResponse) ProtoMessage() {} +func (*ListServiceAccountKeysResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *ListServiceAccountKeysResponse) GetKeys() []*ServiceAccountKey { + if m != nil { + return m.Keys + } + return nil +} + +// The service account key get by id request. +type GetServiceAccountKeyRequest struct { + // The resource name of the service account key in the following format: + // `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}/keys/{key}`. + // + // Using `-` as a wildcard for the project will infer the project from + // the account. The `account` value can be the `email` address or the + // `unique_id` of the service account. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The output format of the public key requested. + // X509_PEM is the default output format. + PublicKeyType ServiceAccountPublicKeyType `protobuf:"varint,2,opt,name=public_key_type,json=publicKeyType,enum=google.iam.admin.v1.ServiceAccountPublicKeyType" json:"public_key_type,omitempty"` +} + +func (m *GetServiceAccountKeyRequest) Reset() { *m = GetServiceAccountKeyRequest{} } +func (m *GetServiceAccountKeyRequest) String() string { return proto.CompactTextString(m) } +func (*GetServiceAccountKeyRequest) ProtoMessage() {} +func (*GetServiceAccountKeyRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *GetServiceAccountKeyRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *GetServiceAccountKeyRequest) GetPublicKeyType() ServiceAccountPublicKeyType { + if m != nil { + return m.PublicKeyType + } + return ServiceAccountPublicKeyType_TYPE_NONE +} + +// Represents a service account key. +// +// A service account has two sets of key-pairs: user-managed, and +// system-managed. +// +// User-managed key-pairs can be created and deleted by users. Users are +// responsible for rotating these keys periodically to ensure security of +// their service accounts. Users retain the private key of these key-pairs, +// and Google retains ONLY the public key. +// +// System-managed key-pairs are managed automatically by Google, and rotated +// daily without user intervention. The private key never leaves Google's +// servers to maximize security. +// +// Public keys for all service accounts are also published at the OAuth2 +// Service Account API. +type ServiceAccountKey struct { + // The resource name of the service account key in the following format + // `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}/keys/{key}`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The output format for the private key. + // Only provided in `CreateServiceAccountKey` responses, not + // in `GetServiceAccountKey` or `ListServiceAccountKey` responses. + // + // Google never exposes system-managed private keys, and never retains + // user-managed private keys. + PrivateKeyType ServiceAccountPrivateKeyType `protobuf:"varint,2,opt,name=private_key_type,json=privateKeyType,enum=google.iam.admin.v1.ServiceAccountPrivateKeyType" json:"private_key_type,omitempty"` + // Specifies the algorithm (and possibly key size) for the key. + KeyAlgorithm ServiceAccountKeyAlgorithm `protobuf:"varint,8,opt,name=key_algorithm,json=keyAlgorithm,enum=google.iam.admin.v1.ServiceAccountKeyAlgorithm" json:"key_algorithm,omitempty"` + // The private key data. Only provided in `CreateServiceAccountKey` + // responses. Make sure to keep the private key data secure because it + // allows for the assertion of the service account identity. + // When decoded, the private key data can be used to authenticate with + // Google API client libraries and with + // gcloud + // auth activate-service-account. + PrivateKeyData []byte `protobuf:"bytes,3,opt,name=private_key_data,json=privateKeyData,proto3" json:"private_key_data,omitempty"` + // The public key data. Only provided in `GetServiceAccountKey` responses. + PublicKeyData []byte `protobuf:"bytes,7,opt,name=public_key_data,json=publicKeyData,proto3" json:"public_key_data,omitempty"` + // The key can be used after this timestamp. + ValidAfterTime *google_protobuf3.Timestamp `protobuf:"bytes,4,opt,name=valid_after_time,json=validAfterTime" json:"valid_after_time,omitempty"` + // The key can be used before this timestamp. + ValidBeforeTime *google_protobuf3.Timestamp `protobuf:"bytes,5,opt,name=valid_before_time,json=validBeforeTime" json:"valid_before_time,omitempty"` +} + +func (m *ServiceAccountKey) Reset() { *m = ServiceAccountKey{} } +func (m *ServiceAccountKey) String() string { return proto.CompactTextString(m) } +func (*ServiceAccountKey) ProtoMessage() {} +func (*ServiceAccountKey) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *ServiceAccountKey) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ServiceAccountKey) GetPrivateKeyType() ServiceAccountPrivateKeyType { + if m != nil { + return m.PrivateKeyType + } + return ServiceAccountPrivateKeyType_TYPE_UNSPECIFIED +} + +func (m *ServiceAccountKey) GetKeyAlgorithm() ServiceAccountKeyAlgorithm { + if m != nil { + return m.KeyAlgorithm + } + return ServiceAccountKeyAlgorithm_KEY_ALG_UNSPECIFIED +} + +func (m *ServiceAccountKey) GetPrivateKeyData() []byte { + if m != nil { + return m.PrivateKeyData + } + return nil +} + +func (m *ServiceAccountKey) GetPublicKeyData() []byte { + if m != nil { + return m.PublicKeyData + } + return nil +} + +func (m *ServiceAccountKey) GetValidAfterTime() *google_protobuf3.Timestamp { + if m != nil { + return m.ValidAfterTime + } + return nil +} + +func (m *ServiceAccountKey) GetValidBeforeTime() *google_protobuf3.Timestamp { + if m != nil { + return m.ValidBeforeTime + } + return nil +} + +// The service account key create request. +type CreateServiceAccountKeyRequest struct { + // The resource name of the service account in the following format: + // `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. + // Using `-` as a wildcard for the project will infer the project from + // the account. The `account` value can be the `email` address or the + // `unique_id` of the service account. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The output format of the private key. `GOOGLE_CREDENTIALS_FILE` is the + // default output format. + PrivateKeyType ServiceAccountPrivateKeyType `protobuf:"varint,2,opt,name=private_key_type,json=privateKeyType,enum=google.iam.admin.v1.ServiceAccountPrivateKeyType" json:"private_key_type,omitempty"` + // Which type of key and algorithm to use for the key. + // The default is currently a 2K RSA key. However this may change in the + // future. + KeyAlgorithm ServiceAccountKeyAlgorithm `protobuf:"varint,3,opt,name=key_algorithm,json=keyAlgorithm,enum=google.iam.admin.v1.ServiceAccountKeyAlgorithm" json:"key_algorithm,omitempty"` +} + +func (m *CreateServiceAccountKeyRequest) Reset() { *m = CreateServiceAccountKeyRequest{} } +func (m *CreateServiceAccountKeyRequest) String() string { return proto.CompactTextString(m) } +func (*CreateServiceAccountKeyRequest) ProtoMessage() {} +func (*CreateServiceAccountKeyRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *CreateServiceAccountKeyRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *CreateServiceAccountKeyRequest) GetPrivateKeyType() ServiceAccountPrivateKeyType { + if m != nil { + return m.PrivateKeyType + } + return ServiceAccountPrivateKeyType_TYPE_UNSPECIFIED +} + +func (m *CreateServiceAccountKeyRequest) GetKeyAlgorithm() ServiceAccountKeyAlgorithm { + if m != nil { + return m.KeyAlgorithm + } + return ServiceAccountKeyAlgorithm_KEY_ALG_UNSPECIFIED +} + +// The service account key delete request. +type DeleteServiceAccountKeyRequest struct { + // The resource name of the service account key in the following format: + // `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}/keys/{key}`. + // Using `-` as a wildcard for the project will infer the project from + // the account. The `account` value can be the `email` address or the + // `unique_id` of the service account. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *DeleteServiceAccountKeyRequest) Reset() { *m = DeleteServiceAccountKeyRequest{} } +func (m *DeleteServiceAccountKeyRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteServiceAccountKeyRequest) ProtoMessage() {} +func (*DeleteServiceAccountKeyRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } + +func (m *DeleteServiceAccountKeyRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// The service account sign blob request. +type SignBlobRequest struct { + // The resource name of the service account in the following format: + // `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. + // Using `-` as a wildcard for the project will infer the project from + // the account. The `account` value can be the `email` address or the + // `unique_id` of the service account. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The bytes to sign. + BytesToSign []byte `protobuf:"bytes,2,opt,name=bytes_to_sign,json=bytesToSign,proto3" json:"bytes_to_sign,omitempty"` +} + +func (m *SignBlobRequest) Reset() { *m = SignBlobRequest{} } +func (m *SignBlobRequest) String() string { return proto.CompactTextString(m) } +func (*SignBlobRequest) ProtoMessage() {} +func (*SignBlobRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } + +func (m *SignBlobRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *SignBlobRequest) GetBytesToSign() []byte { + if m != nil { + return m.BytesToSign + } + return nil +} + +// The service account sign blob response. +type SignBlobResponse struct { + // The id of the key used to sign the blob. + KeyId string `protobuf:"bytes,1,opt,name=key_id,json=keyId" json:"key_id,omitempty"` + // The signed blob. + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (m *SignBlobResponse) Reset() { *m = SignBlobResponse{} } +func (m *SignBlobResponse) String() string { return proto.CompactTextString(m) } +func (*SignBlobResponse) ProtoMessage() {} +func (*SignBlobResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } + +func (m *SignBlobResponse) GetKeyId() string { + if m != nil { + return m.KeyId + } + return "" +} + +func (m *SignBlobResponse) GetSignature() []byte { + if m != nil { + return m.Signature + } + return nil +} + +// The service account sign JWT request. +type SignJwtRequest struct { + // The resource name of the service account in the following format: + // `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. + // Using `-` as a wildcard for the project will infer the project from + // the account. The `account` value can be the `email` address or the + // `unique_id` of the service account. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The JWT payload to sign, a JSON JWT Claim set. + Payload string `protobuf:"bytes,2,opt,name=payload" json:"payload,omitempty"` +} + +func (m *SignJwtRequest) Reset() { *m = SignJwtRequest{} } +func (m *SignJwtRequest) String() string { return proto.CompactTextString(m) } +func (*SignJwtRequest) ProtoMessage() {} +func (*SignJwtRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } + +func (m *SignJwtRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *SignJwtRequest) GetPayload() string { + if m != nil { + return m.Payload + } + return "" +} + +// The service account sign JWT response. +type SignJwtResponse struct { + // The id of the key used to sign the JWT. + KeyId string `protobuf:"bytes,1,opt,name=key_id,json=keyId" json:"key_id,omitempty"` + // The signed JWT. + SignedJwt string `protobuf:"bytes,2,opt,name=signed_jwt,json=signedJwt" json:"signed_jwt,omitempty"` +} + +func (m *SignJwtResponse) Reset() { *m = SignJwtResponse{} } +func (m *SignJwtResponse) String() string { return proto.CompactTextString(m) } +func (*SignJwtResponse) ProtoMessage() {} +func (*SignJwtResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } + +func (m *SignJwtResponse) GetKeyId() string { + if m != nil { + return m.KeyId + } + return "" +} + +func (m *SignJwtResponse) GetSignedJwt() string { + if m != nil { + return m.SignedJwt + } + return "" +} + +// A role in the Identity and Access Management API. +type Role struct { + // The name of the role. + // + // When Role is used in CreateRole, the role name must not be set. + // + // When Role is used in output and other input such as UpdateRole, the role + // name is the complete path, e.g., roles/logging.viewer for curated roles + // and organizations/{ORGANIZATION_ID}/roles/logging.viewer for custom roles. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Optional. A human-readable title for the role. Typically this + // is limited to 100 UTF-8 bytes. + Title string `protobuf:"bytes,2,opt,name=title" json:"title,omitempty"` + // Optional. A human-readable description for the role. + Description string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` + // The names of the permissions this role grants when bound in an IAM policy. + IncludedPermissions []string `protobuf:"bytes,7,rep,name=included_permissions,json=includedPermissions" json:"included_permissions,omitempty"` + // The current launch stage of the role. + Stage Role_RoleLaunchStage `protobuf:"varint,8,opt,name=stage,enum=google.iam.admin.v1.Role_RoleLaunchStage" json:"stage,omitempty"` + // Used to perform a consistent read-modify-write. + Etag []byte `protobuf:"bytes,9,opt,name=etag,proto3" json:"etag,omitempty"` + // The current deleted state of the role. This field is read only. + // It will be ignored in calls to CreateRole and UpdateRole. + Deleted bool `protobuf:"varint,11,opt,name=deleted" json:"deleted,omitempty"` +} + +func (m *Role) Reset() { *m = Role{} } +func (m *Role) String() string { return proto.CompactTextString(m) } +func (*Role) ProtoMessage() {} +func (*Role) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} } + +func (m *Role) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Role) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *Role) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *Role) GetIncludedPermissions() []string { + if m != nil { + return m.IncludedPermissions + } + return nil +} + +func (m *Role) GetStage() Role_RoleLaunchStage { + if m != nil { + return m.Stage + } + return Role_ALPHA +} + +func (m *Role) GetEtag() []byte { + if m != nil { + return m.Etag + } + return nil +} + +func (m *Role) GetDeleted() bool { + if m != nil { + return m.Deleted + } + return false +} + +// The grantable role query request. +type QueryGrantableRolesRequest struct { + // Required. The full resource name to query from the list of grantable roles. + // + // The name follows the Google Cloud Platform resource format. + // For example, a Cloud Platform project with id `my-project` will be named + // `//cloudresourcemanager.googleapis.com/projects/my-project`. + FullResourceName string `protobuf:"bytes,1,opt,name=full_resource_name,json=fullResourceName" json:"full_resource_name,omitempty"` + View RoleView `protobuf:"varint,2,opt,name=view,enum=google.iam.admin.v1.RoleView" json:"view,omitempty"` + // Optional limit on the number of roles to include in the response. + PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // Optional pagination token returned in an earlier + // QueryGrantableRolesResponse. + PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *QueryGrantableRolesRequest) Reset() { *m = QueryGrantableRolesRequest{} } +func (m *QueryGrantableRolesRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGrantableRolesRequest) ProtoMessage() {} +func (*QueryGrantableRolesRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17} } + +func (m *QueryGrantableRolesRequest) GetFullResourceName() string { + if m != nil { + return m.FullResourceName + } + return "" +} + +func (m *QueryGrantableRolesRequest) GetView() RoleView { + if m != nil { + return m.View + } + return RoleView_BASIC +} + +func (m *QueryGrantableRolesRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *QueryGrantableRolesRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// The grantable role query response. +type QueryGrantableRolesResponse struct { + // The list of matching roles. + Roles []*Role `protobuf:"bytes,1,rep,name=roles" json:"roles,omitempty"` + // To retrieve the next page of results, set + // `QueryGrantableRolesRequest.page_token` to this value. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *QueryGrantableRolesResponse) Reset() { *m = QueryGrantableRolesResponse{} } +func (m *QueryGrantableRolesResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGrantableRolesResponse) ProtoMessage() {} +func (*QueryGrantableRolesResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{18} } + +func (m *QueryGrantableRolesResponse) GetRoles() []*Role { + if m != nil { + return m.Roles + } + return nil +} + +func (m *QueryGrantableRolesResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// The request to get all roles defined under a resource. +type ListRolesRequest struct { + // The resource name of the parent resource in one of the following formats: + // `` (empty string) -- this refers to curated roles. + // `organizations/{ORGANIZATION_ID}` + // `projects/{PROJECT_ID}` + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // Optional limit on the number of roles to include in the response. + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // Optional pagination token returned in an earlier ListRolesResponse. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` + // Optional view for the returned Role objects. + View RoleView `protobuf:"varint,4,opt,name=view,enum=google.iam.admin.v1.RoleView" json:"view,omitempty"` + // Include Roles that have been deleted. + ShowDeleted bool `protobuf:"varint,6,opt,name=show_deleted,json=showDeleted" json:"show_deleted,omitempty"` +} + +func (m *ListRolesRequest) Reset() { *m = ListRolesRequest{} } +func (m *ListRolesRequest) String() string { return proto.CompactTextString(m) } +func (*ListRolesRequest) ProtoMessage() {} +func (*ListRolesRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{19} } + +func (m *ListRolesRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *ListRolesRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListRolesRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +func (m *ListRolesRequest) GetView() RoleView { + if m != nil { + return m.View + } + return RoleView_BASIC +} + +func (m *ListRolesRequest) GetShowDeleted() bool { + if m != nil { + return m.ShowDeleted + } + return false +} + +// The response containing the roles defined under a resource. +type ListRolesResponse struct { + // The Roles defined on this resource. + Roles []*Role `protobuf:"bytes,1,rep,name=roles" json:"roles,omitempty"` + // To retrieve the next page of results, set + // `ListRolesRequest.page_token` to this value. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListRolesResponse) Reset() { *m = ListRolesResponse{} } +func (m *ListRolesResponse) String() string { return proto.CompactTextString(m) } +func (*ListRolesResponse) ProtoMessage() {} +func (*ListRolesResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20} } + +func (m *ListRolesResponse) GetRoles() []*Role { + if m != nil { + return m.Roles + } + return nil +} + +func (m *ListRolesResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// The request to get the definition of an existing role. +type GetRoleRequest struct { + // The resource name of the role in one of the following formats: + // `roles/{ROLE_NAME}` + // `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` + // `projects/{PROJECT_ID}/roles/{ROLE_NAME}` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetRoleRequest) Reset() { *m = GetRoleRequest{} } +func (m *GetRoleRequest) String() string { return proto.CompactTextString(m) } +func (*GetRoleRequest) ProtoMessage() {} +func (*GetRoleRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{21} } + +func (m *GetRoleRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// The request to create a new role. +type CreateRoleRequest struct { + // The resource name of the parent resource in one of the following formats: + // `organizations/{ORGANIZATION_ID}` + // `projects/{PROJECT_ID}` + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // The role id to use for this role. + RoleId string `protobuf:"bytes,2,opt,name=role_id,json=roleId" json:"role_id,omitempty"` + // The Role resource to create. + Role *Role `protobuf:"bytes,3,opt,name=role" json:"role,omitempty"` +} + +func (m *CreateRoleRequest) Reset() { *m = CreateRoleRequest{} } +func (m *CreateRoleRequest) String() string { return proto.CompactTextString(m) } +func (*CreateRoleRequest) ProtoMessage() {} +func (*CreateRoleRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{22} } + +func (m *CreateRoleRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *CreateRoleRequest) GetRoleId() string { + if m != nil { + return m.RoleId + } + return "" +} + +func (m *CreateRoleRequest) GetRole() *Role { + if m != nil { + return m.Role + } + return nil +} + +// The request to update a role. +type UpdateRoleRequest struct { + // The resource name of the role in one of the following formats: + // `roles/{ROLE_NAME}` + // `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` + // `projects/{PROJECT_ID}/roles/{ROLE_NAME}` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The updated role. + Role *Role `protobuf:"bytes,2,opt,name=role" json:"role,omitempty"` + // A mask describing which fields in the Role have changed. + UpdateMask *google_protobuf2.FieldMask `protobuf:"bytes,3,opt,name=update_mask,json=updateMask" json:"update_mask,omitempty"` +} + +func (m *UpdateRoleRequest) Reset() { *m = UpdateRoleRequest{} } +func (m *UpdateRoleRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateRoleRequest) ProtoMessage() {} +func (*UpdateRoleRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{23} } + +func (m *UpdateRoleRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *UpdateRoleRequest) GetRole() *Role { + if m != nil { + return m.Role + } + return nil +} + +func (m *UpdateRoleRequest) GetUpdateMask() *google_protobuf2.FieldMask { + if m != nil { + return m.UpdateMask + } + return nil +} + +// The request to delete an existing role. +type DeleteRoleRequest struct { + // The resource name of the role in one of the following formats: + // `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` + // `projects/{PROJECT_ID}/roles/{ROLE_NAME}` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Used to perform a consistent read-modify-write. + Etag []byte `protobuf:"bytes,2,opt,name=etag,proto3" json:"etag,omitempty"` +} + +func (m *DeleteRoleRequest) Reset() { *m = DeleteRoleRequest{} } +func (m *DeleteRoleRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteRoleRequest) ProtoMessage() {} +func (*DeleteRoleRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{24} } + +func (m *DeleteRoleRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *DeleteRoleRequest) GetEtag() []byte { + if m != nil { + return m.Etag + } + return nil +} + +// The request to undelete an existing role. +type UndeleteRoleRequest struct { + // The resource name of the role in one of the following formats: + // `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` + // `projects/{PROJECT_ID}/roles/{ROLE_NAME}` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Used to perform a consistent read-modify-write. + Etag []byte `protobuf:"bytes,2,opt,name=etag,proto3" json:"etag,omitempty"` +} + +func (m *UndeleteRoleRequest) Reset() { *m = UndeleteRoleRequest{} } +func (m *UndeleteRoleRequest) String() string { return proto.CompactTextString(m) } +func (*UndeleteRoleRequest) ProtoMessage() {} +func (*UndeleteRoleRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{25} } + +func (m *UndeleteRoleRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *UndeleteRoleRequest) GetEtag() []byte { + if m != nil { + return m.Etag + } + return nil +} + +// A permission which can be included by a role. +type Permission struct { + // The name of this Permission. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The title of this Permission. + Title string `protobuf:"bytes,2,opt,name=title" json:"title,omitempty"` + // A brief description of what this Permission is used for. + Description string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` + // This permission can ONLY be used in predefined roles. + OnlyInPredefinedRoles bool `protobuf:"varint,4,opt,name=only_in_predefined_roles,json=onlyInPredefinedRoles" json:"only_in_predefined_roles,omitempty"` + // The current launch stage of the permission. + Stage Permission_PermissionLaunchStage `protobuf:"varint,5,opt,name=stage,enum=google.iam.admin.v1.Permission_PermissionLaunchStage" json:"stage,omitempty"` + // The current custom role support level. + CustomRolesSupportLevel Permission_CustomRolesSupportLevel `protobuf:"varint,6,opt,name=custom_roles_support_level,json=customRolesSupportLevel,enum=google.iam.admin.v1.Permission_CustomRolesSupportLevel" json:"custom_roles_support_level,omitempty"` +} + +func (m *Permission) Reset() { *m = Permission{} } +func (m *Permission) String() string { return proto.CompactTextString(m) } +func (*Permission) ProtoMessage() {} +func (*Permission) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{26} } + +func (m *Permission) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Permission) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *Permission) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *Permission) GetOnlyInPredefinedRoles() bool { + if m != nil { + return m.OnlyInPredefinedRoles + } + return false +} + +func (m *Permission) GetStage() Permission_PermissionLaunchStage { + if m != nil { + return m.Stage + } + return Permission_ALPHA +} + +func (m *Permission) GetCustomRolesSupportLevel() Permission_CustomRolesSupportLevel { + if m != nil { + return m.CustomRolesSupportLevel + } + return Permission_SUPPORTED +} + +// A request to get permissions which can be tested on a resource. +type QueryTestablePermissionsRequest struct { + // Required. The full resource name to query from the list of testable + // permissions. + // + // The name follows the Google Cloud Platform resource format. + // For example, a Cloud Platform project with id `my-project` will be named + // `//cloudresourcemanager.googleapis.com/projects/my-project`. + FullResourceName string `protobuf:"bytes,1,opt,name=full_resource_name,json=fullResourceName" json:"full_resource_name,omitempty"` + // Optional limit on the number of permissions to include in the response. + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // Optional pagination token returned in an earlier + // QueryTestablePermissionsRequest. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *QueryTestablePermissionsRequest) Reset() { *m = QueryTestablePermissionsRequest{} } +func (m *QueryTestablePermissionsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryTestablePermissionsRequest) ProtoMessage() {} +func (*QueryTestablePermissionsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{27} +} + +func (m *QueryTestablePermissionsRequest) GetFullResourceName() string { + if m != nil { + return m.FullResourceName + } + return "" +} + +func (m *QueryTestablePermissionsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *QueryTestablePermissionsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// The response containing permissions which can be tested on a resource. +type QueryTestablePermissionsResponse struct { + // The Permissions testable on the requested resource. + Permissions []*Permission `protobuf:"bytes,1,rep,name=permissions" json:"permissions,omitempty"` + // To retrieve the next page of results, set + // `QueryTestableRolesRequest.page_token` to this value. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *QueryTestablePermissionsResponse) Reset() { *m = QueryTestablePermissionsResponse{} } +func (m *QueryTestablePermissionsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryTestablePermissionsResponse) ProtoMessage() {} +func (*QueryTestablePermissionsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{28} +} + +func (m *QueryTestablePermissionsResponse) GetPermissions() []*Permission { + if m != nil { + return m.Permissions + } + return nil +} + +func (m *QueryTestablePermissionsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +func init() { + proto.RegisterType((*ServiceAccount)(nil), "google.iam.admin.v1.ServiceAccount") + proto.RegisterType((*CreateServiceAccountRequest)(nil), "google.iam.admin.v1.CreateServiceAccountRequest") + proto.RegisterType((*ListServiceAccountsRequest)(nil), "google.iam.admin.v1.ListServiceAccountsRequest") + proto.RegisterType((*ListServiceAccountsResponse)(nil), "google.iam.admin.v1.ListServiceAccountsResponse") + proto.RegisterType((*GetServiceAccountRequest)(nil), "google.iam.admin.v1.GetServiceAccountRequest") + proto.RegisterType((*DeleteServiceAccountRequest)(nil), "google.iam.admin.v1.DeleteServiceAccountRequest") + proto.RegisterType((*ListServiceAccountKeysRequest)(nil), "google.iam.admin.v1.ListServiceAccountKeysRequest") + proto.RegisterType((*ListServiceAccountKeysResponse)(nil), "google.iam.admin.v1.ListServiceAccountKeysResponse") + proto.RegisterType((*GetServiceAccountKeyRequest)(nil), "google.iam.admin.v1.GetServiceAccountKeyRequest") + proto.RegisterType((*ServiceAccountKey)(nil), "google.iam.admin.v1.ServiceAccountKey") + proto.RegisterType((*CreateServiceAccountKeyRequest)(nil), "google.iam.admin.v1.CreateServiceAccountKeyRequest") + proto.RegisterType((*DeleteServiceAccountKeyRequest)(nil), "google.iam.admin.v1.DeleteServiceAccountKeyRequest") + proto.RegisterType((*SignBlobRequest)(nil), "google.iam.admin.v1.SignBlobRequest") + proto.RegisterType((*SignBlobResponse)(nil), "google.iam.admin.v1.SignBlobResponse") + proto.RegisterType((*SignJwtRequest)(nil), "google.iam.admin.v1.SignJwtRequest") + proto.RegisterType((*SignJwtResponse)(nil), "google.iam.admin.v1.SignJwtResponse") + proto.RegisterType((*Role)(nil), "google.iam.admin.v1.Role") + proto.RegisterType((*QueryGrantableRolesRequest)(nil), "google.iam.admin.v1.QueryGrantableRolesRequest") + proto.RegisterType((*QueryGrantableRolesResponse)(nil), "google.iam.admin.v1.QueryGrantableRolesResponse") + proto.RegisterType((*ListRolesRequest)(nil), "google.iam.admin.v1.ListRolesRequest") + proto.RegisterType((*ListRolesResponse)(nil), "google.iam.admin.v1.ListRolesResponse") + proto.RegisterType((*GetRoleRequest)(nil), "google.iam.admin.v1.GetRoleRequest") + proto.RegisterType((*CreateRoleRequest)(nil), "google.iam.admin.v1.CreateRoleRequest") + proto.RegisterType((*UpdateRoleRequest)(nil), "google.iam.admin.v1.UpdateRoleRequest") + proto.RegisterType((*DeleteRoleRequest)(nil), "google.iam.admin.v1.DeleteRoleRequest") + proto.RegisterType((*UndeleteRoleRequest)(nil), "google.iam.admin.v1.UndeleteRoleRequest") + proto.RegisterType((*Permission)(nil), "google.iam.admin.v1.Permission") + proto.RegisterType((*QueryTestablePermissionsRequest)(nil), "google.iam.admin.v1.QueryTestablePermissionsRequest") + proto.RegisterType((*QueryTestablePermissionsResponse)(nil), "google.iam.admin.v1.QueryTestablePermissionsResponse") + proto.RegisterEnum("google.iam.admin.v1.ServiceAccountKeyAlgorithm", ServiceAccountKeyAlgorithm_name, ServiceAccountKeyAlgorithm_value) + proto.RegisterEnum("google.iam.admin.v1.ServiceAccountPrivateKeyType", ServiceAccountPrivateKeyType_name, ServiceAccountPrivateKeyType_value) + proto.RegisterEnum("google.iam.admin.v1.ServiceAccountPublicKeyType", ServiceAccountPublicKeyType_name, ServiceAccountPublicKeyType_value) + proto.RegisterEnum("google.iam.admin.v1.RoleView", RoleView_name, RoleView_value) + proto.RegisterEnum("google.iam.admin.v1.ListServiceAccountKeysRequest_KeyType", ListServiceAccountKeysRequest_KeyType_name, ListServiceAccountKeysRequest_KeyType_value) + proto.RegisterEnum("google.iam.admin.v1.Role_RoleLaunchStage", Role_RoleLaunchStage_name, Role_RoleLaunchStage_value) + proto.RegisterEnum("google.iam.admin.v1.Permission_PermissionLaunchStage", Permission_PermissionLaunchStage_name, Permission_PermissionLaunchStage_value) + proto.RegisterEnum("google.iam.admin.v1.Permission_CustomRolesSupportLevel", Permission_CustomRolesSupportLevel_name, Permission_CustomRolesSupportLevel_value) +} + +// 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 + +// Client API for IAM service + +type IAMClient interface { + // Lists [ServiceAccounts][google.iam.admin.v1.ServiceAccount] for a project. + ListServiceAccounts(ctx context.Context, in *ListServiceAccountsRequest, opts ...grpc.CallOption) (*ListServiceAccountsResponse, error) + // Gets a [ServiceAccount][google.iam.admin.v1.ServiceAccount]. + GetServiceAccount(ctx context.Context, in *GetServiceAccountRequest, opts ...grpc.CallOption) (*ServiceAccount, error) + // Creates a [ServiceAccount][google.iam.admin.v1.ServiceAccount] + // and returns it. + CreateServiceAccount(ctx context.Context, in *CreateServiceAccountRequest, opts ...grpc.CallOption) (*ServiceAccount, error) + // Updates a [ServiceAccount][google.iam.admin.v1.ServiceAccount]. + // + // Currently, only the following fields are updatable: + // `display_name` . + // The `etag` is mandatory. + UpdateServiceAccount(ctx context.Context, in *ServiceAccount, opts ...grpc.CallOption) (*ServiceAccount, error) + // Deletes a [ServiceAccount][google.iam.admin.v1.ServiceAccount]. + DeleteServiceAccount(ctx context.Context, in *DeleteServiceAccountRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) + // Lists [ServiceAccountKeys][google.iam.admin.v1.ServiceAccountKey]. + ListServiceAccountKeys(ctx context.Context, in *ListServiceAccountKeysRequest, opts ...grpc.CallOption) (*ListServiceAccountKeysResponse, error) + // Gets the [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey] + // by key id. + GetServiceAccountKey(ctx context.Context, in *GetServiceAccountKeyRequest, opts ...grpc.CallOption) (*ServiceAccountKey, error) + // Creates a [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey] + // and returns it. + CreateServiceAccountKey(ctx context.Context, in *CreateServiceAccountKeyRequest, opts ...grpc.CallOption) (*ServiceAccountKey, error) + // Deletes a [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey]. + DeleteServiceAccountKey(ctx context.Context, in *DeleteServiceAccountKeyRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) + // Signs a blob using a service account's system-managed private key. + SignBlob(ctx context.Context, in *SignBlobRequest, opts ...grpc.CallOption) (*SignBlobResponse, error) + // Signs a JWT using a service account's system-managed private key. + // + // If no expiry time (`exp`) is provided in the `SignJwtRequest`, IAM sets an + // an expiry time of one hour by default. If you request an expiry time of + // more than one hour, the request will fail. + SignJwt(ctx context.Context, in *SignJwtRequest, opts ...grpc.CallOption) (*SignJwtResponse, error) + // Returns the IAM access control policy for a + // [ServiceAccount][google.iam.admin.v1.ServiceAccount]. + GetIamPolicy(ctx context.Context, in *google_iam_v11.GetIamPolicyRequest, opts ...grpc.CallOption) (*google_iam_v1.Policy, error) + // Sets the IAM access control policy for a + // [ServiceAccount][google.iam.admin.v1.ServiceAccount]. + SetIamPolicy(ctx context.Context, in *google_iam_v11.SetIamPolicyRequest, opts ...grpc.CallOption) (*google_iam_v1.Policy, error) + // Tests the specified permissions against the IAM access control policy + // for a [ServiceAccount][google.iam.admin.v1.ServiceAccount]. + TestIamPermissions(ctx context.Context, in *google_iam_v11.TestIamPermissionsRequest, opts ...grpc.CallOption) (*google_iam_v11.TestIamPermissionsResponse, error) + // Queries roles that can be granted on a particular resource. + // A role is grantable if it can be used as the role in a binding for a policy + // for that resource. + QueryGrantableRoles(ctx context.Context, in *QueryGrantableRolesRequest, opts ...grpc.CallOption) (*QueryGrantableRolesResponse, error) + // Lists the Roles defined on a resource. + ListRoles(ctx context.Context, in *ListRolesRequest, opts ...grpc.CallOption) (*ListRolesResponse, error) + // Gets a Role definition. + GetRole(ctx context.Context, in *GetRoleRequest, opts ...grpc.CallOption) (*Role, error) + // Creates a new Role. + CreateRole(ctx context.Context, in *CreateRoleRequest, opts ...grpc.CallOption) (*Role, error) + // Updates a Role definition. + UpdateRole(ctx context.Context, in *UpdateRoleRequest, opts ...grpc.CallOption) (*Role, error) + // Soft deletes a role. The role is suspended and cannot be used to create new + // IAM Policy Bindings. + // The Role will not be included in `ListRoles()` unless `show_deleted` is set + // in the `ListRolesRequest`. The Role contains the deleted boolean set. + // Existing Bindings remains, but are inactive. The Role can be undeleted + // within 7 days. After 7 days the Role is deleted and all Bindings associated + // with the role are removed. + DeleteRole(ctx context.Context, in *DeleteRoleRequest, opts ...grpc.CallOption) (*Role, error) + // Undelete a Role, bringing it back in its previous state. + UndeleteRole(ctx context.Context, in *UndeleteRoleRequest, opts ...grpc.CallOption) (*Role, error) + // Lists the permissions testable on a resource. + // A permission is testable if it can be tested for an identity on a resource. + QueryTestablePermissions(ctx context.Context, in *QueryTestablePermissionsRequest, opts ...grpc.CallOption) (*QueryTestablePermissionsResponse, error) +} + +type iAMClient struct { + cc *grpc.ClientConn +} + +func NewIAMClient(cc *grpc.ClientConn) IAMClient { + return &iAMClient{cc} +} + +func (c *iAMClient) ListServiceAccounts(ctx context.Context, in *ListServiceAccountsRequest, opts ...grpc.CallOption) (*ListServiceAccountsResponse, error) { + out := new(ListServiceAccountsResponse) + err := grpc.Invoke(ctx, "/google.iam.admin.v1.IAM/ListServiceAccounts", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *iAMClient) GetServiceAccount(ctx context.Context, in *GetServiceAccountRequest, opts ...grpc.CallOption) (*ServiceAccount, error) { + out := new(ServiceAccount) + err := grpc.Invoke(ctx, "/google.iam.admin.v1.IAM/GetServiceAccount", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *iAMClient) CreateServiceAccount(ctx context.Context, in *CreateServiceAccountRequest, opts ...grpc.CallOption) (*ServiceAccount, error) { + out := new(ServiceAccount) + err := grpc.Invoke(ctx, "/google.iam.admin.v1.IAM/CreateServiceAccount", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *iAMClient) UpdateServiceAccount(ctx context.Context, in *ServiceAccount, opts ...grpc.CallOption) (*ServiceAccount, error) { + out := new(ServiceAccount) + err := grpc.Invoke(ctx, "/google.iam.admin.v1.IAM/UpdateServiceAccount", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *iAMClient) DeleteServiceAccount(ctx context.Context, in *DeleteServiceAccountRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { + out := new(google_protobuf1.Empty) + err := grpc.Invoke(ctx, "/google.iam.admin.v1.IAM/DeleteServiceAccount", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *iAMClient) ListServiceAccountKeys(ctx context.Context, in *ListServiceAccountKeysRequest, opts ...grpc.CallOption) (*ListServiceAccountKeysResponse, error) { + out := new(ListServiceAccountKeysResponse) + err := grpc.Invoke(ctx, "/google.iam.admin.v1.IAM/ListServiceAccountKeys", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *iAMClient) GetServiceAccountKey(ctx context.Context, in *GetServiceAccountKeyRequest, opts ...grpc.CallOption) (*ServiceAccountKey, error) { + out := new(ServiceAccountKey) + err := grpc.Invoke(ctx, "/google.iam.admin.v1.IAM/GetServiceAccountKey", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *iAMClient) CreateServiceAccountKey(ctx context.Context, in *CreateServiceAccountKeyRequest, opts ...grpc.CallOption) (*ServiceAccountKey, error) { + out := new(ServiceAccountKey) + err := grpc.Invoke(ctx, "/google.iam.admin.v1.IAM/CreateServiceAccountKey", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *iAMClient) DeleteServiceAccountKey(ctx context.Context, in *DeleteServiceAccountKeyRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { + out := new(google_protobuf1.Empty) + err := grpc.Invoke(ctx, "/google.iam.admin.v1.IAM/DeleteServiceAccountKey", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *iAMClient) SignBlob(ctx context.Context, in *SignBlobRequest, opts ...grpc.CallOption) (*SignBlobResponse, error) { + out := new(SignBlobResponse) + err := grpc.Invoke(ctx, "/google.iam.admin.v1.IAM/SignBlob", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *iAMClient) SignJwt(ctx context.Context, in *SignJwtRequest, opts ...grpc.CallOption) (*SignJwtResponse, error) { + out := new(SignJwtResponse) + err := grpc.Invoke(ctx, "/google.iam.admin.v1.IAM/SignJwt", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *iAMClient) GetIamPolicy(ctx context.Context, in *google_iam_v11.GetIamPolicyRequest, opts ...grpc.CallOption) (*google_iam_v1.Policy, error) { + out := new(google_iam_v1.Policy) + err := grpc.Invoke(ctx, "/google.iam.admin.v1.IAM/GetIamPolicy", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *iAMClient) SetIamPolicy(ctx context.Context, in *google_iam_v11.SetIamPolicyRequest, opts ...grpc.CallOption) (*google_iam_v1.Policy, error) { + out := new(google_iam_v1.Policy) + err := grpc.Invoke(ctx, "/google.iam.admin.v1.IAM/SetIamPolicy", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *iAMClient) TestIamPermissions(ctx context.Context, in *google_iam_v11.TestIamPermissionsRequest, opts ...grpc.CallOption) (*google_iam_v11.TestIamPermissionsResponse, error) { + out := new(google_iam_v11.TestIamPermissionsResponse) + err := grpc.Invoke(ctx, "/google.iam.admin.v1.IAM/TestIamPermissions", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *iAMClient) QueryGrantableRoles(ctx context.Context, in *QueryGrantableRolesRequest, opts ...grpc.CallOption) (*QueryGrantableRolesResponse, error) { + out := new(QueryGrantableRolesResponse) + err := grpc.Invoke(ctx, "/google.iam.admin.v1.IAM/QueryGrantableRoles", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *iAMClient) ListRoles(ctx context.Context, in *ListRolesRequest, opts ...grpc.CallOption) (*ListRolesResponse, error) { + out := new(ListRolesResponse) + err := grpc.Invoke(ctx, "/google.iam.admin.v1.IAM/ListRoles", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *iAMClient) GetRole(ctx context.Context, in *GetRoleRequest, opts ...grpc.CallOption) (*Role, error) { + out := new(Role) + err := grpc.Invoke(ctx, "/google.iam.admin.v1.IAM/GetRole", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *iAMClient) CreateRole(ctx context.Context, in *CreateRoleRequest, opts ...grpc.CallOption) (*Role, error) { + out := new(Role) + err := grpc.Invoke(ctx, "/google.iam.admin.v1.IAM/CreateRole", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *iAMClient) UpdateRole(ctx context.Context, in *UpdateRoleRequest, opts ...grpc.CallOption) (*Role, error) { + out := new(Role) + err := grpc.Invoke(ctx, "/google.iam.admin.v1.IAM/UpdateRole", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *iAMClient) DeleteRole(ctx context.Context, in *DeleteRoleRequest, opts ...grpc.CallOption) (*Role, error) { + out := new(Role) + err := grpc.Invoke(ctx, "/google.iam.admin.v1.IAM/DeleteRole", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *iAMClient) UndeleteRole(ctx context.Context, in *UndeleteRoleRequest, opts ...grpc.CallOption) (*Role, error) { + out := new(Role) + err := grpc.Invoke(ctx, "/google.iam.admin.v1.IAM/UndeleteRole", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *iAMClient) QueryTestablePermissions(ctx context.Context, in *QueryTestablePermissionsRequest, opts ...grpc.CallOption) (*QueryTestablePermissionsResponse, error) { + out := new(QueryTestablePermissionsResponse) + err := grpc.Invoke(ctx, "/google.iam.admin.v1.IAM/QueryTestablePermissions", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for IAM service + +type IAMServer interface { + // Lists [ServiceAccounts][google.iam.admin.v1.ServiceAccount] for a project. + ListServiceAccounts(context.Context, *ListServiceAccountsRequest) (*ListServiceAccountsResponse, error) + // Gets a [ServiceAccount][google.iam.admin.v1.ServiceAccount]. + GetServiceAccount(context.Context, *GetServiceAccountRequest) (*ServiceAccount, error) + // Creates a [ServiceAccount][google.iam.admin.v1.ServiceAccount] + // and returns it. + CreateServiceAccount(context.Context, *CreateServiceAccountRequest) (*ServiceAccount, error) + // Updates a [ServiceAccount][google.iam.admin.v1.ServiceAccount]. + // + // Currently, only the following fields are updatable: + // `display_name` . + // The `etag` is mandatory. + UpdateServiceAccount(context.Context, *ServiceAccount) (*ServiceAccount, error) + // Deletes a [ServiceAccount][google.iam.admin.v1.ServiceAccount]. + DeleteServiceAccount(context.Context, *DeleteServiceAccountRequest) (*google_protobuf1.Empty, error) + // Lists [ServiceAccountKeys][google.iam.admin.v1.ServiceAccountKey]. + ListServiceAccountKeys(context.Context, *ListServiceAccountKeysRequest) (*ListServiceAccountKeysResponse, error) + // Gets the [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey] + // by key id. + GetServiceAccountKey(context.Context, *GetServiceAccountKeyRequest) (*ServiceAccountKey, error) + // Creates a [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey] + // and returns it. + CreateServiceAccountKey(context.Context, *CreateServiceAccountKeyRequest) (*ServiceAccountKey, error) + // Deletes a [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey]. + DeleteServiceAccountKey(context.Context, *DeleteServiceAccountKeyRequest) (*google_protobuf1.Empty, error) + // Signs a blob using a service account's system-managed private key. + SignBlob(context.Context, *SignBlobRequest) (*SignBlobResponse, error) + // Signs a JWT using a service account's system-managed private key. + // + // If no expiry time (`exp`) is provided in the `SignJwtRequest`, IAM sets an + // an expiry time of one hour by default. If you request an expiry time of + // more than one hour, the request will fail. + SignJwt(context.Context, *SignJwtRequest) (*SignJwtResponse, error) + // Returns the IAM access control policy for a + // [ServiceAccount][google.iam.admin.v1.ServiceAccount]. + GetIamPolicy(context.Context, *google_iam_v11.GetIamPolicyRequest) (*google_iam_v1.Policy, error) + // Sets the IAM access control policy for a + // [ServiceAccount][google.iam.admin.v1.ServiceAccount]. + SetIamPolicy(context.Context, *google_iam_v11.SetIamPolicyRequest) (*google_iam_v1.Policy, error) + // Tests the specified permissions against the IAM access control policy + // for a [ServiceAccount][google.iam.admin.v1.ServiceAccount]. + TestIamPermissions(context.Context, *google_iam_v11.TestIamPermissionsRequest) (*google_iam_v11.TestIamPermissionsResponse, error) + // Queries roles that can be granted on a particular resource. + // A role is grantable if it can be used as the role in a binding for a policy + // for that resource. + QueryGrantableRoles(context.Context, *QueryGrantableRolesRequest) (*QueryGrantableRolesResponse, error) + // Lists the Roles defined on a resource. + ListRoles(context.Context, *ListRolesRequest) (*ListRolesResponse, error) + // Gets a Role definition. + GetRole(context.Context, *GetRoleRequest) (*Role, error) + // Creates a new Role. + CreateRole(context.Context, *CreateRoleRequest) (*Role, error) + // Updates a Role definition. + UpdateRole(context.Context, *UpdateRoleRequest) (*Role, error) + // Soft deletes a role. The role is suspended and cannot be used to create new + // IAM Policy Bindings. + // The Role will not be included in `ListRoles()` unless `show_deleted` is set + // in the `ListRolesRequest`. The Role contains the deleted boolean set. + // Existing Bindings remains, but are inactive. The Role can be undeleted + // within 7 days. After 7 days the Role is deleted and all Bindings associated + // with the role are removed. + DeleteRole(context.Context, *DeleteRoleRequest) (*Role, error) + // Undelete a Role, bringing it back in its previous state. + UndeleteRole(context.Context, *UndeleteRoleRequest) (*Role, error) + // Lists the permissions testable on a resource. + // A permission is testable if it can be tested for an identity on a resource. + QueryTestablePermissions(context.Context, *QueryTestablePermissionsRequest) (*QueryTestablePermissionsResponse, error) +} + +func RegisterIAMServer(s *grpc.Server, srv IAMServer) { + s.RegisterService(&_IAM_serviceDesc, srv) +} + +func _IAM_ListServiceAccounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListServiceAccountsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IAMServer).ListServiceAccounts(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.iam.admin.v1.IAM/ListServiceAccounts", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IAMServer).ListServiceAccounts(ctx, req.(*ListServiceAccountsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _IAM_GetServiceAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetServiceAccountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IAMServer).GetServiceAccount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.iam.admin.v1.IAM/GetServiceAccount", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IAMServer).GetServiceAccount(ctx, req.(*GetServiceAccountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _IAM_CreateServiceAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateServiceAccountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IAMServer).CreateServiceAccount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.iam.admin.v1.IAM/CreateServiceAccount", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IAMServer).CreateServiceAccount(ctx, req.(*CreateServiceAccountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _IAM_UpdateServiceAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ServiceAccount) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IAMServer).UpdateServiceAccount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.iam.admin.v1.IAM/UpdateServiceAccount", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IAMServer).UpdateServiceAccount(ctx, req.(*ServiceAccount)) + } + return interceptor(ctx, in, info, handler) +} + +func _IAM_DeleteServiceAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteServiceAccountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IAMServer).DeleteServiceAccount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.iam.admin.v1.IAM/DeleteServiceAccount", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IAMServer).DeleteServiceAccount(ctx, req.(*DeleteServiceAccountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _IAM_ListServiceAccountKeys_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListServiceAccountKeysRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IAMServer).ListServiceAccountKeys(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.iam.admin.v1.IAM/ListServiceAccountKeys", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IAMServer).ListServiceAccountKeys(ctx, req.(*ListServiceAccountKeysRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _IAM_GetServiceAccountKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetServiceAccountKeyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IAMServer).GetServiceAccountKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.iam.admin.v1.IAM/GetServiceAccountKey", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IAMServer).GetServiceAccountKey(ctx, req.(*GetServiceAccountKeyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _IAM_CreateServiceAccountKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateServiceAccountKeyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IAMServer).CreateServiceAccountKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.iam.admin.v1.IAM/CreateServiceAccountKey", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IAMServer).CreateServiceAccountKey(ctx, req.(*CreateServiceAccountKeyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _IAM_DeleteServiceAccountKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteServiceAccountKeyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IAMServer).DeleteServiceAccountKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.iam.admin.v1.IAM/DeleteServiceAccountKey", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IAMServer).DeleteServiceAccountKey(ctx, req.(*DeleteServiceAccountKeyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _IAM_SignBlob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SignBlobRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IAMServer).SignBlob(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.iam.admin.v1.IAM/SignBlob", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IAMServer).SignBlob(ctx, req.(*SignBlobRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _IAM_SignJwt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SignJwtRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IAMServer).SignJwt(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.iam.admin.v1.IAM/SignJwt", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IAMServer).SignJwt(ctx, req.(*SignJwtRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _IAM_GetIamPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(google_iam_v11.GetIamPolicyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IAMServer).GetIamPolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.iam.admin.v1.IAM/GetIamPolicy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IAMServer).GetIamPolicy(ctx, req.(*google_iam_v11.GetIamPolicyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _IAM_SetIamPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(google_iam_v11.SetIamPolicyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IAMServer).SetIamPolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.iam.admin.v1.IAM/SetIamPolicy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IAMServer).SetIamPolicy(ctx, req.(*google_iam_v11.SetIamPolicyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _IAM_TestIamPermissions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(google_iam_v11.TestIamPermissionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IAMServer).TestIamPermissions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.iam.admin.v1.IAM/TestIamPermissions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IAMServer).TestIamPermissions(ctx, req.(*google_iam_v11.TestIamPermissionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _IAM_QueryGrantableRoles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGrantableRolesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IAMServer).QueryGrantableRoles(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.iam.admin.v1.IAM/QueryGrantableRoles", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IAMServer).QueryGrantableRoles(ctx, req.(*QueryGrantableRolesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _IAM_ListRoles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListRolesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IAMServer).ListRoles(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.iam.admin.v1.IAM/ListRoles", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IAMServer).ListRoles(ctx, req.(*ListRolesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _IAM_GetRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetRoleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IAMServer).GetRole(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.iam.admin.v1.IAM/GetRole", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IAMServer).GetRole(ctx, req.(*GetRoleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _IAM_CreateRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateRoleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IAMServer).CreateRole(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.iam.admin.v1.IAM/CreateRole", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IAMServer).CreateRole(ctx, req.(*CreateRoleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _IAM_UpdateRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateRoleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IAMServer).UpdateRole(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.iam.admin.v1.IAM/UpdateRole", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IAMServer).UpdateRole(ctx, req.(*UpdateRoleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _IAM_DeleteRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteRoleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IAMServer).DeleteRole(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.iam.admin.v1.IAM/DeleteRole", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IAMServer).DeleteRole(ctx, req.(*DeleteRoleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _IAM_UndeleteRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UndeleteRoleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IAMServer).UndeleteRole(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.iam.admin.v1.IAM/UndeleteRole", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IAMServer).UndeleteRole(ctx, req.(*UndeleteRoleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _IAM_QueryTestablePermissions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryTestablePermissionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IAMServer).QueryTestablePermissions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.iam.admin.v1.IAM/QueryTestablePermissions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IAMServer).QueryTestablePermissions(ctx, req.(*QueryTestablePermissionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _IAM_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.iam.admin.v1.IAM", + HandlerType: (*IAMServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListServiceAccounts", + Handler: _IAM_ListServiceAccounts_Handler, + }, + { + MethodName: "GetServiceAccount", + Handler: _IAM_GetServiceAccount_Handler, + }, + { + MethodName: "CreateServiceAccount", + Handler: _IAM_CreateServiceAccount_Handler, + }, + { + MethodName: "UpdateServiceAccount", + Handler: _IAM_UpdateServiceAccount_Handler, + }, + { + MethodName: "DeleteServiceAccount", + Handler: _IAM_DeleteServiceAccount_Handler, + }, + { + MethodName: "ListServiceAccountKeys", + Handler: _IAM_ListServiceAccountKeys_Handler, + }, + { + MethodName: "GetServiceAccountKey", + Handler: _IAM_GetServiceAccountKey_Handler, + }, + { + MethodName: "CreateServiceAccountKey", + Handler: _IAM_CreateServiceAccountKey_Handler, + }, + { + MethodName: "DeleteServiceAccountKey", + Handler: _IAM_DeleteServiceAccountKey_Handler, + }, + { + MethodName: "SignBlob", + Handler: _IAM_SignBlob_Handler, + }, + { + MethodName: "SignJwt", + Handler: _IAM_SignJwt_Handler, + }, + { + MethodName: "GetIamPolicy", + Handler: _IAM_GetIamPolicy_Handler, + }, + { + MethodName: "SetIamPolicy", + Handler: _IAM_SetIamPolicy_Handler, + }, + { + MethodName: "TestIamPermissions", + Handler: _IAM_TestIamPermissions_Handler, + }, + { + MethodName: "QueryGrantableRoles", + Handler: _IAM_QueryGrantableRoles_Handler, + }, + { + MethodName: "ListRoles", + Handler: _IAM_ListRoles_Handler, + }, + { + MethodName: "GetRole", + Handler: _IAM_GetRole_Handler, + }, + { + MethodName: "CreateRole", + Handler: _IAM_CreateRole_Handler, + }, + { + MethodName: "UpdateRole", + Handler: _IAM_UpdateRole_Handler, + }, + { + MethodName: "DeleteRole", + Handler: _IAM_DeleteRole_Handler, + }, + { + MethodName: "UndeleteRole", + Handler: _IAM_UndeleteRole_Handler, + }, + { + MethodName: "QueryTestablePermissions", + Handler: _IAM_QueryTestablePermissions_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/iam/admin/v1/iam.proto", +} + +func init() { proto.RegisterFile("google/iam/admin/v1/iam.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 2430 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x5a, 0x4f, 0x73, 0xdb, 0xc6, + 0x15, 0x37, 0x28, 0xea, 0x0f, 0x9f, 0x24, 0x0a, 0x5a, 0xc9, 0x16, 0x4b, 0x59, 0xb6, 0xb2, 0xb5, + 0x1d, 0x99, 0xb5, 0x45, 0x89, 0x96, 0x6b, 0x57, 0x1e, 0x27, 0xa5, 0x44, 0x9a, 0xa1, 0x45, 0xcb, + 0x2c, 0x48, 0x35, 0x71, 0xff, 0x0c, 0x06, 0x22, 0x56, 0x34, 0x22, 0x10, 0x80, 0x01, 0x50, 0x2a, + 0x9d, 0x49, 0x67, 0xda, 0x43, 0x2f, 0x99, 0x76, 0xda, 0x49, 0x0e, 0x39, 0xa5, 0x33, 0xbd, 0xb4, + 0xb7, 0x5e, 0x3a, 0xd3, 0x69, 0x27, 0xdf, 0xa0, 0xc7, 0x1e, 0xfa, 0x05, 0x32, 0xd3, 0xaf, 0xd0, + 0x63, 0x67, 0x17, 0x80, 0x08, 0x92, 0x00, 0x04, 0x39, 0x69, 0x2f, 0x1a, 0xec, 0xfb, 0xfb, 0xdb, + 0xb7, 0xbb, 0x6f, 0xdf, 0x3e, 0x0a, 0x56, 0xda, 0xba, 0xde, 0x56, 0x49, 0x5e, 0x91, 0x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x04, 0x62, 0xf8, 0x31, 0xf0, 0x86, 0xa9, 0x9c, 0x48, 0x36, 0x19, 0x06, 0xb1, 0x19, 0x07, + 0x84, 0xa3, 0xea, 0xa1, 0x48, 0x1b, 0x03, 0x63, 0xd4, 0x84, 0x59, 0x6a, 0x54, 0x52, 0xdb, 0xba, + 0xa9, 0xd8, 0x2f, 0x3b, 0x99, 0x29, 0x66, 0x39, 0x1f, 0x2f, 0xb2, 0x45, 0x4f, 0x4d, 0x98, 0x39, + 0xf6, 0x8d, 0x68, 0x1e, 0xf3, 0x43, 0x96, 0x25, 0x5b, 0x62, 0x67, 0x76, 0xc6, 0xef, 0xbf, 0x24, + 0xd9, 0x12, 0x3d, 0x57, 0xbe, 0x00, 0x33, 0x41, 0x27, 0x21, 0xf6, 0xc3, 0xc5, 0xe4, 0x4a, 0xc0, + 0x9f, 0x48, 0xaa, 0x22, 0x8b, 0xd2, 0x91, 0x4d, 0x4c, 0x91, 0x26, 0x7a, 0x96, 0x8a, 0xa7, 0x0b, + 0x59, 0x0f, 0xaa, 0x77, 0x0b, 0xac, 0x37, 0xbd, 0x5b, 0x40, 0x48, 0x33, 0x9d, 0x22, 0x55, 0xa1, + 0x44, 0xf4, 0x04, 0xe6, 0x1d, 0x2b, 0x87, 0xe4, 0x48, 0x37, 0x89, 0x63, 0x66, 0xfc, 0x5c, 0x33, + 0x73, 0x4c, 0x69, 0x87, 0xe9, 0x50, 0x2a, 0xfe, 0x37, 0x07, 0xd7, 0x82, 0xb2, 0xef, 0x39, 0xbb, + 0xe9, 0xff, 0xbb, 0x92, 0x63, 0xdf, 0xc0, 0x4a, 0xe2, 0x2d, 0xb8, 0x16, 0x94, 0x9f, 0xa2, 0x27, + 0x8a, 0xab, 0x30, 0xd7, 0x50, 0xda, 0xda, 0x8e, 0xaa, 0x1f, 0x46, 0xc5, 0x03, 0xc3, 0xec, 0x61, + 0xcf, 0x26, 0x96, 0x68, 0xeb, 0xa2, 0xa5, 0xb4, 0x9d, 0x94, 0x3a, 0x23, 0x4c, 0x33, 0x62, 0x53, + 0xa7, 0x26, 0x70, 0x05, 0xf8, 0xbe, 0x29, 0x37, 0x0b, 0x5c, 0x86, 0x09, 0x3a, 0x55, 0x45, 0x76, + 0xad, 0x8d, 0x1f, 0x93, 0x5e, 0x55, 0x46, 0x57, 0x21, 0x45, 0xad, 0x48, 0x76, 0xd7, 0x24, 0xae, + 0xa9, 0x3e, 0x01, 0xbf, 0x03, 0x69, 0x6a, 0xe8, 0xe9, 0x69, 0xe4, 0x1d, 0x99, 0x81, 0x49, 0x43, + 0xea, 0xa9, 0xba, 0xe4, 0x5d, 0x90, 0xde, 0x10, 0x57, 0x9c, 0x39, 0x31, 0xfd, 0x68, 0x1c, 0x2b, + 0x00, 0xd4, 0x2d, 0x91, 0xc5, 0x0f, 0x4f, 0x6d, 0xef, 0x9e, 0x75, 0x28, 0x4f, 0x4f, 0x6d, 0xfc, + 0x8f, 0x04, 0x24, 0x05, 0x5d, 0x25, 0x81, 0xfe, 0x17, 0x61, 0xdc, 0x56, 0x6c, 0x95, 0xb8, 0x6a, + 0xce, 0x00, 0xad, 0xc2, 0xb4, 0x4c, 0xac, 0x96, 0xa9, 0x18, 0xb4, 0xf2, 0x72, 0xaf, 0x3f, 0x3f, + 0x09, 0x6d, 0xc2, 0xa2, 0xa2, 0xb5, 0xd4, 0xae, 0x4c, 0x64, 0xd1, 0x20, 0x66, 0x47, 0xb1, 0x2c, + 0x5a, 0xa3, 0x65, 0x26, 0x57, 0xc7, 0xd6, 0x52, 0xc2, 0x82, 0xc7, 0xab, 0xf7, 0x59, 0xe8, 0x5d, + 0x18, 0xb7, 0x6c, 0xa9, 0x4d, 0xdc, 0x23, 0x7f, 0x3b, 0x70, 0xa3, 0x50, 0xa0, 0xec, 0x4f, 0x4d, + 0xea, 0x6a, 0xad, 0x97, 0x0d, 0xaa, 0x20, 0x38, 0x7a, 0x67, 0x15, 0x4c, 0xca, 0x57, 0xc1, 0x64, + 0x60, 0x52, 0x66, 0xfb, 0x45, 0xce, 0x4c, 0xaf, 0x72, 0x6b, 0x53, 0x82, 0x37, 0xc4, 0x07, 0x30, + 0x37, 0x64, 0x07, 0xa5, 0x60, 0xbc, 0x58, 0xab, 0xbf, 0x57, 0xe4, 0x2f, 0xa1, 0x29, 0x48, 0xee, + 0x94, 0x9b, 0x45, 0x9e, 0x43, 0x13, 0x90, 0xa8, 0x14, 0xf9, 0x04, 0x4a, 0x03, 0x94, 0xca, 0x75, + 0xa1, 0xbc, 0x5b, 0x6c, 0x96, 0x4b, 0x7c, 0x12, 0xcd, 0xc0, 0x54, 0xa9, 0xda, 0x28, 0xee, 0xd4, + 0xca, 0x25, 0x7e, 0x1c, 0x4d, 0xc2, 0x58, 0xb9, 0x58, 0xe7, 0x27, 0xf0, 0xdf, 0x38, 0xc8, 0xfe, + 0xa0, 0x4b, 0xcc, 0x5e, 0xc5, 0x94, 0x34, 0x5b, 0x3a, 0x54, 0x09, 0xf5, 0x72, 0x76, 0x15, 0xde, + 0x01, 0x74, 0xd4, 0x55, 0x55, 0xd1, 0x24, 0x96, 0xde, 0x35, 0x5b, 0x44, 0xf4, 0x45, 0x9c, 0xa7, + 0x1c, 0xc1, 0x65, 0xb0, 0x9a, 0x6c, 0x13, 0x92, 0x27, 0x0a, 0x39, 0x75, 0x0f, 0xe5, 0x4a, 0x68, + 0x44, 0x7e, 0xa8, 0x90, 0x53, 0x81, 0x89, 0x0e, 0x56, 0x2d, 0x63, 0x91, 0x55, 0x4b, 0x72, 0xb8, + 0x6a, 0x39, 0x81, 0xe5, 0x40, 0xe8, 0xee, 0xf6, 0xca, 0xc3, 0xb8, 0x49, 0x09, 0xee, 0x6d, 0xf7, + 0xad, 0x50, 0x38, 0x82, 0x23, 0x17, 0xbb, 0x48, 0xf9, 0x92, 0x03, 0x9e, 0x5e, 0xb4, 0x03, 0x91, + 0xba, 0x02, 0x13, 0x86, 0x64, 0x12, 0xcd, 0x76, 0xa3, 0xe3, 0x8e, 0xbe, 0x4e, 0x59, 0x76, 0x16, + 0xcf, 0x64, 0xfc, 0x78, 0xbe, 0x05, 0x33, 0xd6, 0x4b, 0xfd, 0x54, 0xf4, 0x76, 0xd1, 0x04, 0xdb, + 0x45, 0xd3, 0x94, 0x56, 0x72, 0x77, 0x92, 0x0a, 0xf3, 0x3e, 0xf4, 0xff, 0xeb, 0x60, 0xdd, 0x80, + 0x74, 0x85, 0x30, 0x67, 0x51, 0x19, 0xcf, 0x82, 0x79, 0xe7, 0x42, 0xf0, 0x0b, 0x86, 0x85, 0x74, + 0x09, 0x26, 0x29, 0x86, 0x7e, 0x15, 0x3e, 0x41, 0x87, 0x55, 0x19, 0xdd, 0x85, 0x24, 0xfd, 0x72, + 0xeb, 0xee, 0x88, 0x39, 0x30, 0x31, 0xfc, 0x29, 0x07, 0xf3, 0x07, 0x86, 0x3c, 0xe4, 0x35, 0x28, + 0xad, 0x78, 0x86, 0x13, 0xb1, 0x0c, 0xa3, 0x47, 0x30, 0xdd, 0x65, 0x76, 0xd9, 0x6b, 0xcb, 0x85, + 0x33, 0x7a, 0x43, 0x3e, 0xa1, 0x0f, 0xb2, 0x67, 0x92, 0x75, 0x2c, 0x80, 0x23, 0x4e, 0xbf, 0xf1, + 0x23, 0x98, 0x77, 0x56, 0xea, 0x3c, 0x50, 0x5e, 0xfe, 0x48, 0xf4, 0xf3, 0x07, 0x7e, 0x0c, 0x0b, + 0x07, 0x9a, 0xfc, 0xc6, 0xea, 0x5f, 0x8d, 0x01, 0xf4, 0x73, 0xdc, 0x37, 0x9a, 0x61, 0x1f, 0x40, + 0x46, 0xd7, 0xd4, 0x9e, 0xa8, 0x68, 0xa2, 0x61, 0x12, 0x99, 0x1c, 0x29, 0x34, 0xc3, 0x3b, 0x7b, + 0x2e, 0xc9, 0x36, 0xe9, 0x65, 0xca, 0xaf, 0x6a, 0xf5, 0x33, 0x2e, 0xdb, 0xa1, 0x68, 0xcf, 0xcb, + 0xb3, 0xe3, 0xec, 0x14, 0xdc, 0x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, 0x5d, 0xd3, 0x74, 0x39, 0xbe, 0xe4, 0x20, 0x13, 0xf6, 0x78, 0x44, 0x5b, 0xe1, 0xa7, 0x2b, + 0xfc, 0xe5, 0x9b, 0xbd, 0x7f, 0x41, 0x2d, 0xf7, 0x48, 0xdc, 0x63, 0x33, 0xb8, 0x8b, 0xd7, 0xd8, + 0xcf, 0xf4, 0xbe, 0x7c, 0xf1, 0x2a, 0x44, 0x73, 0x9b, 0xcb, 0xed, 0x1c, 0xc2, 0x52, 0x4b, 0xef, + 0x04, 0x39, 0xdc, 0x99, 0xa2, 0x69, 0x87, 0x5e, 0xd7, 0x75, 0xee, 0x47, 0x0f, 0x5d, 0x81, 0xb6, + 0xae, 0x4a, 0x5a, 0x7b, 0x5d, 0x37, 0xdb, 0xf9, 0x36, 0xd1, 0xd8, 0x65, 0x9e, 0x77, 0x58, 0x92, + 0xa1, 0x58, 0x03, 0xff, 0x95, 0xf0, 0x88, 0x7d, 0xfc, 0x87, 0xe3, 0x0e, 0x27, 0x98, 0xdc, 0xbd, + 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x75, 0xcc, 0x0e, 0xa5, 0xbc, 0x20, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/iam/v1/iam_policy.pb.go b/vendor/google.golang.org/genproto/googleapis/iam/v1/iam_policy.pb.go new file mode 100644 index 0000000000..913c7160f4 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/iam/v1/iam_policy.pb.go @@ -0,0 +1,338 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/iam/v1/iam_policy.proto + +/* +Package iam is a generated protocol buffer package. + +It is generated from these files: + google/iam/v1/iam_policy.proto + google/iam/v1/policy.proto + +It has these top-level messages: + SetIamPolicyRequest + GetIamPolicyRequest + TestIamPermissionsRequest + TestIamPermissionsResponse + Policy + Binding + PolicyDelta + BindingDelta +*/ +package iam + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Request message for `SetIamPolicy` method. +type SetIamPolicyRequest struct { + // REQUIRED: The resource for which the policy is being specified. + // `resource` is usually specified as a path. For example, a Project + // resource is specified as `projects/{project}`. + Resource string `protobuf:"bytes,1,opt,name=resource" json:"resource,omitempty"` + // REQUIRED: The complete policy to be applied to the `resource`. The size of + // the policy is limited to a few 10s of KB. An empty policy is a + // valid policy but certain Cloud Platform services (such as Projects) + // might reject them. + Policy *Policy `protobuf:"bytes,2,opt,name=policy" json:"policy,omitempty"` +} + +func (m *SetIamPolicyRequest) Reset() { *m = SetIamPolicyRequest{} } +func (m *SetIamPolicyRequest) String() string { return proto.CompactTextString(m) } +func (*SetIamPolicyRequest) ProtoMessage() {} +func (*SetIamPolicyRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *SetIamPolicyRequest) GetResource() string { + if m != nil { + return m.Resource + } + return "" +} + +func (m *SetIamPolicyRequest) GetPolicy() *Policy { + if m != nil { + return m.Policy + } + return nil +} + +// Request message for `GetIamPolicy` method. +type GetIamPolicyRequest struct { + // REQUIRED: The resource for which the policy is being requested. + // `resource` is usually specified as a path. For example, a Project + // resource is specified as `projects/{project}`. + Resource string `protobuf:"bytes,1,opt,name=resource" json:"resource,omitempty"` +} + +func (m *GetIamPolicyRequest) Reset() { *m = GetIamPolicyRequest{} } +func (m *GetIamPolicyRequest) String() string { return proto.CompactTextString(m) } +func (*GetIamPolicyRequest) ProtoMessage() {} +func (*GetIamPolicyRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *GetIamPolicyRequest) GetResource() string { + if m != nil { + return m.Resource + } + return "" +} + +// Request message for `TestIamPermissions` method. +type TestIamPermissionsRequest struct { + // REQUIRED: The resource for which the policy detail is being requested. + // `resource` is usually specified as a path. For example, a Project + // resource is specified as `projects/{project}`. + Resource string `protobuf:"bytes,1,opt,name=resource" json:"resource,omitempty"` + // The set of permissions to check for the `resource`. Permissions with + // wildcards (such as '*' or 'storage.*') are not allowed. For more + // information see + // [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + Permissions []string `protobuf:"bytes,2,rep,name=permissions" json:"permissions,omitempty"` +} + +func (m *TestIamPermissionsRequest) Reset() { *m = TestIamPermissionsRequest{} } +func (m *TestIamPermissionsRequest) String() string { return proto.CompactTextString(m) } +func (*TestIamPermissionsRequest) ProtoMessage() {} +func (*TestIamPermissionsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *TestIamPermissionsRequest) GetResource() string { + if m != nil { + return m.Resource + } + return "" +} + +func (m *TestIamPermissionsRequest) GetPermissions() []string { + if m != nil { + return m.Permissions + } + return nil +} + +// Response message for `TestIamPermissions` method. +type TestIamPermissionsResponse struct { + // A subset of `TestPermissionsRequest.permissions` that the caller is + // allowed. + Permissions []string `protobuf:"bytes,1,rep,name=permissions" json:"permissions,omitempty"` +} + +func (m *TestIamPermissionsResponse) Reset() { *m = TestIamPermissionsResponse{} } +func (m *TestIamPermissionsResponse) String() string { return proto.CompactTextString(m) } +func (*TestIamPermissionsResponse) ProtoMessage() {} +func (*TestIamPermissionsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *TestIamPermissionsResponse) GetPermissions() []string { + if m != nil { + return m.Permissions + } + return nil +} + +func init() { + proto.RegisterType((*SetIamPolicyRequest)(nil), "google.iam.v1.SetIamPolicyRequest") + proto.RegisterType((*GetIamPolicyRequest)(nil), "google.iam.v1.GetIamPolicyRequest") + proto.RegisterType((*TestIamPermissionsRequest)(nil), "google.iam.v1.TestIamPermissionsRequest") + proto.RegisterType((*TestIamPermissionsResponse)(nil), "google.iam.v1.TestIamPermissionsResponse") +} + +// 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 + +// Client API for IAMPolicy service + +type IAMPolicyClient interface { + // Sets the access control policy on the specified resource. Replaces any + // existing policy. + SetIamPolicy(ctx context.Context, in *SetIamPolicyRequest, opts ...grpc.CallOption) (*Policy, error) + // Gets the access control policy for a resource. + // Returns an empty policy if the resource exists and does not have a policy + // set. + GetIamPolicy(ctx context.Context, in *GetIamPolicyRequest, opts ...grpc.CallOption) (*Policy, error) + // Returns permissions that a caller has on the specified resource. + // If the resource does not exist, this will return an empty set of + // permissions, not a NOT_FOUND error. + TestIamPermissions(ctx context.Context, in *TestIamPermissionsRequest, opts ...grpc.CallOption) (*TestIamPermissionsResponse, error) +} + +type iAMPolicyClient struct { + cc *grpc.ClientConn +} + +func NewIAMPolicyClient(cc *grpc.ClientConn) IAMPolicyClient { + return &iAMPolicyClient{cc} +} + +func (c *iAMPolicyClient) SetIamPolicy(ctx context.Context, in *SetIamPolicyRequest, opts ...grpc.CallOption) (*Policy, error) { + out := new(Policy) + err := grpc.Invoke(ctx, "/google.iam.v1.IAMPolicy/SetIamPolicy", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *iAMPolicyClient) GetIamPolicy(ctx context.Context, in *GetIamPolicyRequest, opts ...grpc.CallOption) (*Policy, error) { + out := new(Policy) + err := grpc.Invoke(ctx, "/google.iam.v1.IAMPolicy/GetIamPolicy", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *iAMPolicyClient) TestIamPermissions(ctx context.Context, in *TestIamPermissionsRequest, opts ...grpc.CallOption) (*TestIamPermissionsResponse, error) { + out := new(TestIamPermissionsResponse) + err := grpc.Invoke(ctx, "/google.iam.v1.IAMPolicy/TestIamPermissions", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for IAMPolicy service + +type IAMPolicyServer interface { + // Sets the access control policy on the specified resource. Replaces any + // existing policy. + SetIamPolicy(context.Context, *SetIamPolicyRequest) (*Policy, error) + // Gets the access control policy for a resource. + // Returns an empty policy if the resource exists and does not have a policy + // set. + GetIamPolicy(context.Context, *GetIamPolicyRequest) (*Policy, error) + // Returns permissions that a caller has on the specified resource. + // If the resource does not exist, this will return an empty set of + // permissions, not a NOT_FOUND error. + TestIamPermissions(context.Context, *TestIamPermissionsRequest) (*TestIamPermissionsResponse, error) +} + +func RegisterIAMPolicyServer(s *grpc.Server, srv IAMPolicyServer) { + s.RegisterService(&_IAMPolicy_serviceDesc, srv) +} + +func _IAMPolicy_SetIamPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetIamPolicyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IAMPolicyServer).SetIamPolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.iam.v1.IAMPolicy/SetIamPolicy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IAMPolicyServer).SetIamPolicy(ctx, req.(*SetIamPolicyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _IAMPolicy_GetIamPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetIamPolicyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IAMPolicyServer).GetIamPolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.iam.v1.IAMPolicy/GetIamPolicy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IAMPolicyServer).GetIamPolicy(ctx, req.(*GetIamPolicyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _IAMPolicy_TestIamPermissions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TestIamPermissionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IAMPolicyServer).TestIamPermissions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.iam.v1.IAMPolicy/TestIamPermissions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IAMPolicyServer).TestIamPermissions(ctx, req.(*TestIamPermissionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _IAMPolicy_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.iam.v1.IAMPolicy", + HandlerType: (*IAMPolicyServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SetIamPolicy", + Handler: _IAMPolicy_SetIamPolicy_Handler, + }, + { + MethodName: "GetIamPolicy", + Handler: _IAMPolicy_GetIamPolicy_Handler, + }, + { + MethodName: "TestIamPermissions", + Handler: _IAMPolicy_TestIamPermissions_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/iam/v1/iam_policy.proto", +} + +func init() { proto.RegisterFile("google/iam/v1/iam_policy.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 411 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4b, 0xcf, 0xcf, 0x4f, + 0xcf, 0x49, 0xd5, 0xcf, 0x4c, 0xcc, 0xd5, 0x2f, 0x33, 0x04, 0x51, 0xf1, 0x05, 0xf9, 0x39, 0x99, + 0xc9, 0x95, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0xbc, 0x10, 0x79, 0xbd, 0xcc, 0xc4, 0x5c, + 0xbd, 0x32, 0x43, 0x29, 0x19, 0xa8, 0xf2, 0xc4, 0x82,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x45, 0xd5, 0x30, 0x1f, 0xd9, 0x6a, 0x69, 0xd5, 0x5a, 0x15, 0x23, 0x99, 0x62, 0xc5, 0xa8, 0x05, + 0xb2, 0xd5, 0x1d, 0x9f, 0xad, 0xee, 0x54, 0xb1, 0x35, 0x1d, 0xcd, 0xd6, 0x59, 0x8c, 0x5c, 0x42, + 0x98, 0x41, 0x27, 0xa4, 0x81, 0x66, 0x30, 0xce, 0x88, 0x93, 0xd2, 0x24, 0x42, 0x25, 0x24, 0x1e, + 0x94, 0xf4, 0xc1, 0xce, 0xd2, 0x54, 0x52, 0xc1, 0x74, 0x56, 0x09, 0x86, 0x2e, 0x2b, 0x46, 0x2d, + 0xa7, 0x36, 0x46, 0x2e, 0xc1, 0xe4, 0xfc, 0x5c, 0x54, 0x1b, 0x9c, 0xf8, 0xe0, 0x1e, 0x08, 0x00, + 0x25, 0xf6, 0x00, 0xc6, 0x28, 0x03, 0xa8, 0x82, 0xf4, 0xfc, 0x9c, 0xc4, 0xbc, 0x74, 0xbd, 0xfc, + 0xa2, 0x74, 0xfd, 0xf4, 0xd4, 0x3c, 0x70, 0x56, 0xd0, 0x87, 0x48, 0x25, 0x16, 0x64, 0x16, 0x43, + 0x73, 0x8a, 0x75, 0x66, 0x62, 0xee, 0x0f, 0x46, 0xc6, 0x55, 0x4c, 0xc2, 0xee, 0x10, 0x5d, 0xce, + 0x39, 0xf9, 0xa5, 0x29, 0x7a, 0x9e, 0x89, 0xb9, 0x7a, 0x61, 0x86, 0xa7, 0x60, 0xa2, 0x31, 0x60, + 0xd1, 0x18, 0xcf, 0xc4, 0xdc, 0x98, 0x30, 0xc3, 0x24, 0x36, 0xb0, 0x59, 0xc6, 0x80, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xea, 0x62, 0x8f, 0x22, 0xc1, 0x03, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/iam/v1/logging/audit_data.pb.go b/vendor/google.golang.org/genproto/googleapis/iam/v1/logging/audit_data.pb.go new file mode 100644 index 0000000000..b22765a14f --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/iam/v1/logging/audit_data.pb.go @@ -0,0 +1,75 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/iam/v1/logging/audit_data.proto + +/* +Package logging is a generated protocol buffer package. + +It is generated from these files: + google/iam/v1/logging/audit_data.proto + +It has these top-level messages: + AuditData +*/ +package logging + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_iam_v1 "google.golang.org/genproto/googleapis/iam/v1" + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Audit log information specific to Cloud IAM. This message is serialized +// as an `Any` type in the `ServiceData` message of an +// `AuditLog` message. +type AuditData struct { + // Policy delta between the original policy and the newly set policy. + PolicyDelta *google_iam_v1.PolicyDelta `protobuf:"bytes,2,opt,name=policy_delta,json=policyDelta" json:"policy_delta,omitempty"` +} + +func (m *AuditData) Reset() { *m = AuditData{} } +func (m *AuditData) String() string { return proto.CompactTextString(m) } +func (*AuditData) ProtoMessage() {} +func (*AuditData) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *AuditData) GetPolicyDelta() *google_iam_v1.PolicyDelta { + if m != nil { + return m.PolicyDelta + } + return nil +} + +func init() { + proto.RegisterType((*AuditData)(nil), "google.iam.v1.logging.AuditData") +} + +func init() { proto.RegisterFile("google/iam/v1/logging/audit_data.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 236 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0xb1, 0x4a, 0x04, 0x31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, 0x97, 0xf7, 0x6b, 0x72, 0xfc, 0x90, 0xeb, 0xf7, 0x4e, + 0xb6, 0x16, 0x1e, 0xd1, 0xc3, 0x6b, 0x0d, 0xcf, 0x39, 0x7d, 0xdf, 0x19, 0xc6, 0x5c, 0x7d, 0x07, + 0x00, 0x00, 0xff, 0xff, 0x29, 0xf1, 0xcb, 0x3a, 0x59, 0x01, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/iam/v1/policy.pb.go b/vendor/google.golang.org/genproto/googleapis/iam/v1/policy.pb.go new file mode 100644 index 0000000000..dde2c4089b --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/iam/v1/policy.pb.go @@ -0,0 +1,270 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/iam/v1/policy.proto + +package iam + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// The type of action performed on a Binding in a policy. +type BindingDelta_Action int32 + +const ( + // Unspecified. + BindingDelta_ACTION_UNSPECIFIED BindingDelta_Action = 0 + // Addition of a Binding. + BindingDelta_ADD BindingDelta_Action = 1 + // Removal of a Binding. + BindingDelta_REMOVE BindingDelta_Action = 2 +) + +var BindingDelta_Action_name = map[int32]string{ + 0: "ACTION_UNSPECIFIED", + 1: "ADD", + 2: "REMOVE", +} +var BindingDelta_Action_value = map[string]int32{ + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2, +} + +func (x BindingDelta_Action) String() string { + return proto.EnumName(BindingDelta_Action_name, int32(x)) +} +func (BindingDelta_Action) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{3, 0} } + +// Defines an Identity and Access Management (IAM) policy. It is used to +// specify access control policies for Cloud Platform resources. +// +// +// A `Policy` consists of a list of `bindings`. A `Binding` binds a list of +// `members` to a `role`, where the members can be user accounts, Google groups, +// Google domains, and service accounts. A `role` is a named list of permissions +// defined by IAM. +// +// **Example** +// +// { +// "bindings": [ +// { +// "role": "roles/owner", +// "members": [ +// "user:mike@example.com", +// "group:admins@example.com", +// "domain:google.com", +// "serviceAccount:my-other-app@appspot.gserviceaccount.com", +// ] +// }, +// { +// "role": "roles/viewer", +// "members": ["user:sean@example.com"] +// } +// ] +// } +// +// For a description of IAM and its features, see the +// [IAM developer's guide](https://cloud.google.com/iam). +type Policy struct { + // Version of the `Policy`. The default version is 0. + Version int32 `protobuf:"varint,1,opt,name=version" json:"version,omitempty"` + // Associates a list of `members` to a `role`. + // Multiple `bindings` must not be specified for the same `role`. + // `bindings` with no members will result in an error. + Bindings []*Binding `protobuf:"bytes,4,rep,name=bindings" json:"bindings,omitempty"` + // `etag` is used for optimistic concurrency control as a way to help + // prevent simultaneous updates of a policy from overwriting each other. + // It is strongly suggested that systems make use of the `etag` in the + // read-modify-write cycle to perform policy updates in order to avoid race + // conditions: An `etag` is returned in the response to `getIamPolicy`, and + // systems are expected to put that etag in the request to `setIamPolicy` to + // ensure that their change will be applied to the same version of the policy. + // + // If no `etag` is provided in the call to `setIamPolicy`, then the existing + // policy is overwritten blindly. + Etag []byte `protobuf:"bytes,3,opt,name=etag,proto3" json:"etag,omitempty"` +} + +func (m *Policy) Reset() { *m = Policy{} } +func (m *Policy) String() string { return proto.CompactTextString(m) } +func (*Policy) ProtoMessage() {} +func (*Policy) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +func (m *Policy) GetVersion() int32 { + if m != nil { + return m.Version + } + return 0 +} + +func (m *Policy) GetBindings() []*Binding { + if m != nil { + return m.Bindings + } + return nil +} + +func (m *Policy) GetEtag() []byte { + if m != nil { + return m.Etag + } + return nil +} + +// Associates `members` with a `role`. +type Binding struct { + // Role that is assigned to `members`. + // For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + // Required + Role string `protobuf:"bytes,1,opt,name=role" json:"role,omitempty"` + // Specifies the identities requesting access for a Cloud Platform resource. + // `members` can have the following values: + // + // * `allUsers`: A special identifier that represents anyone who is + // on the internet; with or without a Google account. + // + // * `allAuthenticatedUsers`: A special identifier that represents anyone + // who is authenticated with a Google account or a service account. + // + // * `user:{emailid}`: An email address that represents a specific Google + // account. For example, `alice@gmail.com` or `joe@example.com`. + // + // + // * `serviceAccount:{emailid}`: An email address that represents a service + // account. For example, `my-other-app@appspot.gserviceaccount.com`. + // + // * `group:{emailid}`: An email address that represents a Google group. + // For example, `admins@example.com`. + // + // * `domain:{domain}`: A Google Apps domain name that represents all the + // users of that domain. For example, `google.com` or `example.com`. + // + // + Members []string `protobuf:"bytes,2,rep,name=members" json:"members,omitempty"` +} + +func (m *Binding) Reset() { *m = Binding{} } +func (m *Binding) String() string { return proto.CompactTextString(m) } +func (*Binding) ProtoMessage() {} +func (*Binding) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} } + +func (m *Binding) GetRole() string { + if m != nil { + return m.Role + } + return "" +} + +func (m *Binding) GetMembers() []string { + if m != nil { + return m.Members + } + return nil +} + +// The difference delta between two policies. +type PolicyDelta struct { + // The delta for Bindings between two policies. + BindingDeltas []*BindingDelta `protobuf:"bytes,1,rep,name=binding_deltas,json=bindingDeltas" json:"binding_deltas,omitempty"` +} + +func (m *PolicyDelta) Reset() { *m = PolicyDelta{} } +func (m *PolicyDelta) String() string { return proto.CompactTextString(m) } +func (*PolicyDelta) ProtoMessage() {} +func (*PolicyDelta) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} } + +func (m *PolicyDelta) GetBindingDeltas() []*BindingDelta { + if m != nil { + return m.BindingDeltas + } + return nil +} + +// One delta entry for Binding. Each individual change (only one member in each +// entry) to a binding will be a separate entry. +type BindingDelta struct { + // The action that was performed on a Binding. + // Required + Action BindingDelta_Action `protobuf:"varint,1,opt,name=action,enum=google.iam.v1.BindingDelta_Action" json:"action,omitempty"` + // Role that is assigned to `members`. + // For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + // Required + Role string `protobuf:"bytes,2,opt,name=role" json:"role,omitempty"` + // A single identity requesting access for a Cloud Platform resource. + // Follows the same format of Binding.members. + // Required + Member string `protobuf:"bytes,3,opt,name=member" json:"member,omitempty"` +} + +func (m *BindingDelta) Reset() { *m = BindingDelta{} } +func (m *BindingDelta) String() string { return proto.CompactTextString(m) } +func (*BindingDelta) ProtoMessage() {} +func (*BindingDelta) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{3} } + +func (m *BindingDelta) GetAction() BindingDelta_Action { + if m != nil { + return m.Action + } + return BindingDelta_ACTION_UNSPECIFIED +} + +func (m *BindingDelta) GetRole() string { + if m != nil { + return m.Role + } + return "" +} + +func (m *BindingDelta) GetMember() string { + if m != nil { + return m.Member + } + return "" +} + +func init() { + proto.RegisterType((*Policy)(nil), "google.iam.v1.Policy") + proto.RegisterType((*Binding)(nil), "google.iam.v1.Binding") + proto.RegisterType((*PolicyDelta)(nil), "google.iam.v1.PolicyDelta") + proto.RegisterType((*BindingDelta)(nil), "google.iam.v1.BindingDelta") + proto.RegisterEnum("google.iam.v1.BindingDelta_Action", BindingDelta_Action_name, BindingDelta_Action_value) +} + +func init() { proto.RegisterFile("google/iam/v1/policy.proto", fileDescriptor1) } + +var fileDescriptor1 = []byte{ + // 403 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x52, 0x4d, 0xab, 0x13, 0x31, + 0x14, 0x35, 0xed, 0x73, 0x6a, 0xef, 0xfb, 0xa0, 0x46, 0x28, 0xc3, 0xd3, 0x45, 0x99, 0x55, 0x57, + 0x19, 0x5b, 0x11, 0x41, 0x57, 0xfd, 0x18, 0x65, 0x16, 0xbe, 0x37, 0x46, 0xed, 0x42, 0x0a, 0x8f, + 0x4c, 0x1b, 0x42, 0x64, 0x92, 0x0c, 0x33, 0x63, 0xc1, 0xb5, 0xff, 0x46, 0xf0, 0x8f, 0xf8, 0x8b, + 0x5c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 0xd8, 0xae, 0xe9, 0xa6, 0xbf, 0x9a, 0x47, 0xff, 0xb9, 0x8c, 0x2c, + 0xac, 0x92, 0x7a, 0xc7, 0xfd, 0x34, 0xbd, 0xa3, 0x69, 0xc6, 0x10, 0xb8, 0xf8, 0xf6, 0x09, 0x86, + 0xd4, 0xa3, 0xe8, 0x25, 0x04, 0xce, 0x8d, 0xc7, 0x80, 0x17, 0xab, 0x4f, 0xe9, 0xed, 0xcd, 0xdd, + 0xe7, 0x9b, 0x8f, 0x59, 0xb2, 0x4a, 0xdf, 0xa6, 0xc9, 0x7a, 0xf4, 0x00, 0x0f, 0xa0, 0xbf, 0x58, + 0xaf, 0x47, 0x08, 0x03, 0x04, 0x34, 0x79, 0x7f, 0xbb, 0x49, 0x46, 0xbd, 0xe5, 0x0f, 0x04, 0x8f, + 0x77, 0x46, 0x9d, 0x86, 0x5a, 0xfa, 0x67, 0xc9, 0xda, 0x55, 0x66, 0xe8, 0xcb, 0x73, 0xcf, 0x0a, + 0x53, 0x30, 0x2d, 0x88, 0xa9, 0x44, 0x2c, 0xb8, 0xb6, 0x8b, 0x8e, 0x1d, 0xc5, 0x4a, 0x59, 0xfb, + 0x4f, 0xf3, 0x46, 0x32, 0xf5, 0x07, 0xa1, 0x9f, 0xbd, 0x27, 0xef, 0x9c, 0x6b, 0x55, 0x98, 0x6f, + 0x7b, 0x92, 0x32, 0x45, 0x36, 0xb3, 0xdf, 0x5d, 0x75, 0x6b, 0xab, 0xdb, 0x94, 0xa9, 0xed, 0x66, + 0x96, 0x07, 0xf6, 0xae, 0x17, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xfc, 0x18, 0xca, 0xaa, 0x7f, + 0x02, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/logging/type/http_request.pb.go b/vendor/google.golang.org/genproto/googleapis/logging/type/http_request.pb.go new file mode 100644 index 0000000000..ad4f289fea --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/logging/type/http_request.pb.go @@ -0,0 +1,233 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/logging/type/http_request.proto + +/* +Package ltype is a generated protocol buffer package. + +It is generated from these files: + google/logging/type/http_request.proto + google/logging/type/log_severity.proto + +It has these top-level messages: + HttpRequest +*/ +package ltype + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf1 "github.com/golang/protobuf/ptypes/duration" + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// A common proto for logging HTTP requests. Only contains semantics +// defined by the HTTP specification. Product-specific logging +// information MUST be defined in a separate message. +type HttpRequest struct { + // The request method. Examples: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`. + RequestMethod string `protobuf:"bytes,1,opt,name=request_method,json=requestMethod" json:"request_method,omitempty"` + // The scheme (http, https), the host name, the path and the query + // portion of the URL that was requested. + // Example: `"http://example.com/some/info?color=red"`. + RequestUrl string `protobuf:"bytes,2,opt,name=request_url,json=requestUrl" json:"request_url,omitempty"` + // The size of the HTTP request message in bytes, including the request + // headers and the request body. + RequestSize int64 `protobuf:"varint,3,opt,name=request_size,json=requestSize" json:"request_size,omitempty"` + // The response code indicating the status of response. + // Examples: 200, 404. + Status int32 `protobuf:"varint,4,opt,name=status" json:"status,omitempty"` + // The size of the HTTP response message sent back to the client, in bytes, + // including the response headers and the response body. + ResponseSize int64 `protobuf:"varint,5,opt,name=response_size,json=responseSize" json:"response_size,omitempty"` + // The user agent sent by the client. Example: + // `"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)"`. + UserAgent string `protobuf:"bytes,6,opt,name=user_agent,json=userAgent" json:"user_agent,omitempty"` + // The IP address (IPv4 or IPv6) of the client that issued the HTTP + // request. Examples: `"192.168.1.1"`, `"FE80::0202:B3FF:FE1E:8329"`. + RemoteIp string `protobuf:"bytes,7,opt,name=remote_ip,json=remoteIp" json:"remote_ip,omitempty"` + // The IP address (IPv4 or IPv6) of the origin server that the request was + // sent to. + ServerIp string `protobuf:"bytes,13,opt,name=server_ip,json=serverIp" json:"server_ip,omitempty"` + // The referer URL of the request, as defined in + // [HTTP/1.1 Header Field Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). + Referer string `protobuf:"bytes,8,opt,name=referer" json:"referer,omitempty"` + // The request processing latency on the server, from the time the request was + // received until the response was sent. + Latency *google_protobuf1.Duration `protobuf:"bytes,14,opt,name=latency" json:"latency,omitempty"` + // Whether or not a cache lookup was attempted. + CacheLookup bool `protobuf:"varint,11,opt,name=cache_lookup,json=cacheLookup" json:"cache_lookup,omitempty"` + // Whether or not an entity was served from cache + // (with or without validation). + CacheHit bool `protobuf:"varint,9,opt,name=cache_hit,json=cacheHit" json:"cache_hit,omitempty"` + // Whether or not the response was validated with the origin server before + // being served from cache. This field is only meaningful if `cache_hit` is + // True. + CacheValidatedWithOriginServer bool `protobuf:"varint,10,opt,name=cache_validated_with_origin_server,json=cacheValidatedWithOriginServer" json:"cache_validated_with_origin_server,omitempty"` + // The number of HTTP response bytes inserted into cache. Set only when a + // cache fill was attempted. + CacheFillBytes int64 `protobuf:"varint,12,opt,name=cache_fill_bytes,json=cacheFillBytes" json:"cache_fill_bytes,omitempty"` + // Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket" + Protocol string `protobuf:"bytes,15,opt,name=protocol" json:"protocol,omitempty"` +} + +func (m *HttpRequest) Reset() { *m = HttpRequest{} } +func (m *HttpRequest) String() string { return proto.CompactTextString(m) } +func (*HttpRequest) ProtoMessage() {} +func (*HttpRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *HttpRequest) GetRequestMethod() string { + if m != nil { + return m.RequestMethod + } + return "" +} + +func (m *HttpRequest) GetRequestUrl() string { + if m != nil { + return m.RequestUrl + } + return "" +} + +func (m *HttpRequest) GetRequestSize() int64 { + if m != nil { + return m.RequestSize + } + return 0 +} + +func (m *HttpRequest) GetStatus() int32 { + if m != nil { + return m.Status + } + return 0 +} + +func (m *HttpRequest) GetResponseSize() int64 { + if m != nil { + return m.ResponseSize + } + return 0 +} + +func (m *HttpRequest) GetUserAgent() string { + if m != nil { + return m.UserAgent + } + return "" +} + +func (m *HttpRequest) GetRemoteIp() string { + if m != nil { + return m.RemoteIp + } + return "" +} + +func (m *HttpRequest) GetServerIp() string { + if m != nil { + return m.ServerIp + } + return "" +} + +func (m *HttpRequest) GetReferer() string { + if m != nil { + return m.Referer + } + return "" +} + +func (m *HttpRequest) GetLatency() *google_protobuf1.Duration { + if m != nil { + return m.Latency + } + return nil +} + +func (m *HttpRequest) GetCacheLookup() bool { + if m != nil { + return m.CacheLookup + } + return false +} + +func (m *HttpRequest) GetCacheHit() bool { + if m != nil { + return m.CacheHit + } + return false +} + +func (m *HttpRequest) GetCacheValidatedWithOriginServer() bool { + if m != nil { + return m.CacheValidatedWithOriginServer + } + return false +} + +func (m *HttpRequest) GetCacheFillBytes() int64 { + if m != nil { + return m.CacheFillBytes + } + return 0 +} + +func (m *HttpRequest) GetProtocol() string { + if m != nil { + return m.Protocol + } + return "" +} + +func init() { + proto.RegisterType((*HttpRequest)(nil), "google.logging.type.HttpRequest") +} + +func init() { proto.RegisterFile("google/logging/type/http_request.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 511 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0x5b, 0x6b, 0x14, 0x31, + 0x18, 0x86, 0x99, 0x1e, 0xf6, 0x90, 0x3d, 0x58, 0x22, 0x68, 0xba, 0x6a, 0x5d, 0x2b, 0xca, 0x5c, + 0xcd, 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b, 0x0b, 0x86, 0x0d, + 0x71, 0xb6, 0x63, 0xcc, 0xdf, 0x70, 0x21, 0x66, 0x2e, 0xa5, 0x13, 0xd2, 0xc3, 0xff, 0xb4, 0x94, + 0x82, 0xdd, 0xf2, 0x03, 0x6a, 0xd7, 0xb3, 0x9f, 0x11, 0xb9, 0xbb, 0x94, 0x9b, 0xe4, 0x86, 0xb7, + 0x38, 0x3b, 0xf8, 0xe7, 0x29, 0x5d, 0xb8, 0xc2, 0x45, 0xf4, 0xf5, 0x79, 0x10, 0x4b, 0x29, 0x8a, + 0xba, 0x4c, 0xa4, 0x2e, 0xd3, 0x12, 0x6a, 0xdc, 0x2e, 0xf5, 0xa8, 0x50, 0xdc, 0xfc, 0xf7, 0xf6, + 0x5f, 0x08, 0xf7, 0xfb, 0x6b, 0xe7, 0xf0, 0xad, 0xaf, 0xbe, 0x12, 0xb2, 0x59, 0x25, 0xe7, 0xe1, + 0xa4, 0x8f, 0x5b, 0x05, 0x7f, 0x5a, 0x36, 0x47, 0x36, 0x0f, 0x6c, 0xee, 0xd8, 0xa2, 0x83, 0x9b, + 0x9f, 0xfc, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x7d, 0xa3, 0x36, 0xbb, 0x57, 0x03, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/logging/type/log_severity.pb.go b/vendor/google.golang.org/genproto/googleapis/logging/type/log_severity.pb.go new file mode 100644 index 0000000000..f489a2793f --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/logging/type/log_severity.pb.go @@ -0,0 +1,111 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/logging/type/log_severity.proto + +package ltype + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// The severity of the event described in a log entry, expressed as one of the +// standard severity levels listed below. For your reference, the levels are +// assigned the listed numeric values. The effect of using numeric values other +// than those listed is undefined. +// +// You can filter for log entries by severity. For example, the following +// filter expression will match log entries with severities `INFO`, `NOTICE`, +// and `WARNING`: +// +// severity > DEBUG AND severity <= WARNING +// +// If you are writing log entries, you should map other severity encodings to +// one of these standard levels. For example, you might map all of Java's FINE, +// FINER, and FINEST levels to `LogSeverity.DEBUG`. You can preserve the +// original severity level in the log entry payload if you wish. +type LogSeverity int32 + +const ( + // (0) The log entry has no assigned severity level. + LogSeverity_DEFAULT LogSeverity = 0 + // (100) Debug or trace information. + LogSeverity_DEBUG LogSeverity = 100 + // (200) Routine information, such as ongoing status or performance. + LogSeverity_INFO LogSeverity = 200 + // (300) Normal but significant events, such as start up, shut down, or + // a configuration change. + LogSeverity_NOTICE LogSeverity = 300 + // (400) Warning events might cause problems. + LogSeverity_WARNING LogSeverity = 400 + // (500) Error events are likely to cause problems. + LogSeverity_ERROR LogSeverity = 500 + // (600) Critical events cause more severe problems or outages. + LogSeverity_CRITICAL LogSeverity = 600 + // (700) A person must take an action immediately. + LogSeverity_ALERT LogSeverity = 700 + // (800) One or more systems are unusable. + LogSeverity_EMERGENCY LogSeverity = 800 +) + +var LogSeverity_name = map[int32]string{ + 0: "DEFAULT", + 100: "DEBUG", + 200: "INFO", + 300: "NOTICE", + 400: "WARNING", + 500: "ERROR", + 600: "CRITICAL", + 700: "ALERT", + 800: "EMERGENCY", +} +var LogSeverity_value = map[string]int32{ + "DEFAULT": 0, + "DEBUG": 100, + "INFO": 200, + "NOTICE": 300, + "WARNING": 400, + "ERROR": 500, + "CRITICAL": 600, + "ALERT": 700, + "EMERGENCY": 800, +} + +func (x LogSeverity) String() string { + return proto.EnumName(LogSeverity_name, int32(x)) +} +func (LogSeverity) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +func init() { + proto.RegisterEnum("google.logging.type.LogSeverity", LogSeverity_name, LogSeverity_value) +} + +func init() { proto.RegisterFile("google/logging/type/log_severity.proto", fileDescriptor1) } + +var fileDescriptor1 = []byte{ + // 309 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4b, 0xcf, 0xcf, 0x4f, + 0xcf, 0x49, 0xd5, 0xcf, 0xc9, 0x4f, 0x4f, 0xcf, 0xcc, 0x4b, 0xd7, 0x2f, 0xa9, 0x2c, 0x00, 0x73, + 0xe2, 0x8b, 0x53, 0xcb, 0x52, 0x8b, 0x32, 0x4b, 0x2a, 0xf5, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, + 0x84, 0x21, 0xea, 0xf4, 0xa0, 0xea, 0xf4, 0x40, 0xea, 0xa4, 0x64, 0xa0, 0x9a, 0x13, 0x0b, 0x32, + 0xf5, 0x13, 0xf3, 0xf2, 0xf2, 0x4b, 0x12, 0x4b, 0x32, 0xf3, 0xf3, 0x8a, 0x21, 0x5a, 0xb4, 0x9a, + 0x18, 0xb9, 0xb8, 0x7d, 0xf2, 0xd3, 0x83, 0xa1, 0x06, 0x09, 0x71, 0x73, 0xb1, 0xbb, 0xb8, 0xba, + 0x39, 0x86, 0xfa, 0x84, 0x08, 0x30, 0x08, 0x71, 0x72, 0xb1, 0xba, 0xb8, 0x3a, 0x85, 0xba, 0x0b, + 0xa4, 0x08, 0x71, 0x72, 0xb1, 0x78, 0xfa, 0xb9, 0xf9, 0x0b, 0x9c, 0x60, 0x14, 0xe2, 0xe6, 0x62, + 0xf3, 0xf3, 0x0f, 0xf1, 0x74, 0x76, 0x15, 0x58, 0xc3, 0x24, 0xc4, 0xc3, 0xc5, 0x1e, 0xee, 0x18, + 0xe4, 0xe7, 0xe9, 0xe7, 0x2e, 0x30, 0x81, 0x59, 0x88, 0x8b, 0x8b, 0xd5, 0x35, 0x28, 0xc8, 0x3f, + 0x48, 0xe0, 0x0b, 0xb3, 0x10, 0x2f, 0x17, 0x87, 0x73, 0x90, 0x67, 0x88, 0xa7, 0xb3, 0xa3, 0x8f, + 0xc0, 0x0d, 0x16, 0x90, 0x94, 0xa3, 0x8f, 0x6b, 0x50, 0x88, 0xc0, 0x1e, 0x56, 0x21, 0x3e, 0x2e, + 0x4e, 0x57, 0x5f, 0xd7, 0x20, 0x77, 0x57, 0x3f, 0xe7, 0x48, 0x81, 0x05, 0x6c, 0x4e, 0xf3, 0x19, + 0xb9, 0xc4, 0x93, 0xf3, 0x73, 0xf5, 0xb0, 0x38, 0xdf, 0x49, 0x00, 0xc9, 0x75, 0x01, 0x20, 0x27, + 0x07, 0x30, 0x46, 0x59, 0x40, 0x15, 0xa6, 0xe7, 0xe7, 0x24, 0xe6, 0xa5, 0xeb, 0xe5, 0x17, 0xa5, + 0xeb, 0xa7, 0xa7, 0xe6, 0x81, 0x3d, 0xa4, 0x0f, 0x91, 0x4a, 0x2c, 0xc8, 0x2c, 0x46, 0x09, 0x2e, + 0xeb, 0x1c, 0x10, 0xb9, 0x8a, 0x49, 0xd2, 0x1d, 0xa2, 0xd5, 0x39, 0x27, 0xbf, 0x34, 0x45, 0xcf, + 0x07, 0x6a, 0x53, 0x48, 0x65, 0x41, 0xea, 0x29, 0x98, 0x5c, 0x0c, 0x58, 0x2e, 0x06, 0x2a, 0x17, + 0x03, 0x92, 0x4b, 0x62, 0x03, 0x1b, 0x6e, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xea, 0x8a, 0xa7, + 0x20, 0x8a, 0x01, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/logging/v2/log_entry.pb.go b/vendor/google.golang.org/genproto/googleapis/logging/v2/log_entry.pb.go new file mode 100644 index 0000000000..002a8378b1 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/logging/v2/log_entry.pb.go @@ -0,0 +1,530 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/logging/v2/log_entry.proto + +/* +Package logging is a generated protocol buffer package. + +It is generated from these files: + google/logging/v2/log_entry.proto + google/logging/v2/logging.proto + google/logging/v2/logging_config.proto + google/logging/v2/logging_metrics.proto + +It has these top-level messages: + LogEntry + LogEntryOperation + LogEntrySourceLocation + DeleteLogRequest + WriteLogEntriesRequest + WriteLogEntriesResponse + WriteLogEntriesPartialErrors + ListLogEntriesRequest + ListLogEntriesResponse + ListMonitoredResourceDescriptorsRequest + ListMonitoredResourceDescriptorsResponse + ListLogsRequest + ListLogsResponse + LogSink + ListSinksRequest + ListSinksResponse + GetSinkRequest + CreateSinkRequest + UpdateSinkRequest + DeleteSinkRequest + LogExclusion + ListExclusionsRequest + ListExclusionsResponse + GetExclusionRequest + CreateExclusionRequest + UpdateExclusionRequest + DeleteExclusionRequest + LogMetric + ListLogMetricsRequest + ListLogMetricsResponse + GetLogMetricRequest + CreateLogMetricRequest + UpdateLogMetricRequest + DeleteLogMetricRequest +*/ +package logging + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_api3 "google.golang.org/genproto/googleapis/api/monitoredres" +import google_logging_type "google.golang.org/genproto/googleapis/logging/type" +import google_logging_type1 "google.golang.org/genproto/googleapis/logging/type" +import google_protobuf2 "github.com/golang/protobuf/ptypes/any" +import google_protobuf3 "github.com/golang/protobuf/ptypes/struct" +import google_protobuf4 "github.com/golang/protobuf/ptypes/timestamp" + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// An individual entry in a log. +type LogEntry struct { + // Required. The resource name of the log to which this log entry belongs: + // + // "projects/[PROJECT_ID]/logs/[LOG_ID]" + // "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" + // "folders/[FOLDER_ID]/logs/[LOG_ID]" + // + // A project number may optionally be used in place of PROJECT_ID. The + // project number is translated to its corresponding PROJECT_ID internally + // and the `log_name` field will contain PROJECT_ID in queries and exports. + // + // `[LOG_ID]` must be URL-encoded within `log_name`. Example: + // `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`. + // `[LOG_ID]` must be less than 512 characters long and can only include the + // following characters: upper and lower case alphanumeric characters, + // forward-slash, underscore, hyphen, and period. + // + // For backward compatibility, if `log_name` begins with a forward-slash, such + // as `/projects/...`, then the log entry is ingested as usual but the + // forward-slash is removed. Listing the log entry will not show the leading + // slash and filtering for a log name with a leading slash will never return + // any results. + LogName string `protobuf:"bytes,12,opt,name=log_name,json=logName" json:"log_name,omitempty"` + // Required. The monitored resource associated with this log entry. + // Example: a log entry that reports a database error would be + // associated with the monitored resource designating the particular + // database that reported the error. + Resource *google_api3.MonitoredResource `protobuf:"bytes,8,opt,name=resource" json:"resource,omitempty"` + // Optional. The log entry payload, which can be one of multiple types. + // + // Types that are valid to be assigned to Payload: + // *LogEntry_ProtoPayload + // *LogEntry_TextPayload + // *LogEntry_JsonPayload + Payload isLogEntry_Payload `protobuf_oneof:"payload"` + // Optional. The time the event described by the log entry occurred. + // This time is used to compute the log entry's age and to enforce + // the logs retention period. If this field is omitted in a new log + // entry, then Stackdriver Logging assigns it the current time. + // + // Incoming log entries should have timestamps that are no more than + // the [logs retention period](/logging/quota-policy) in the past, + // and no more than 24 hours in the future. + // See the `entries.write` API method for more information. + Timestamp *google_protobuf4.Timestamp `protobuf:"bytes,9,opt,name=timestamp" json:"timestamp,omitempty"` + // Output only. The time the log entry was received by Stackdriver Logging. + ReceiveTimestamp *google_protobuf4.Timestamp `protobuf:"bytes,24,opt,name=receive_timestamp,json=receiveTimestamp" json:"receive_timestamp,omitempty"` + // Optional. The severity of the log entry. The default value is + // `LogSeverity.DEFAULT`. + Severity google_logging_type1.LogSeverity `protobuf:"varint,10,opt,name=severity,enum=google.logging.type.LogSeverity" json:"severity,omitempty"` + // Optional. A unique identifier for the log entry. If you provide a value, + // then Stackdriver Logging considers other log entries in the same project, + // with the same `timestamp`, and with the same `insert_id` to be duplicates + // which can be removed. If omitted in new log entries, then Stackdriver + // Logging assigns its own unique identifier. The `insert_id` is also used + // to order log entries that have the same `timestamp` value. + InsertId string `protobuf:"bytes,4,opt,name=insert_id,json=insertId" json:"insert_id,omitempty"` + // Optional. Information about the HTTP request associated with this + // log entry, if applicable. + HttpRequest *google_logging_type.HttpRequest `protobuf:"bytes,7,opt,name=http_request,json=httpRequest" json:"http_request,omitempty"` + // Optional. A set of user-defined (key, value) data that provides additional + // information about the log entry. + Labels map[string]string `protobuf:"bytes,11,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // Optional. Information about an operation associated with the log entry, if + // applicable. + Operation *LogEntryOperation `protobuf:"bytes,15,opt,name=operation" json:"operation,omitempty"` + // Optional. Resource name of the trace associated with the log entry, if any. + // If it contains a relative resource name, the name is assumed to be relative + // to `//tracing.googleapis.com`. Example: + // `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824` + Trace string `protobuf:"bytes,22,opt,name=trace" json:"trace,omitempty"` + // Optional. Id of the span within the trace associated with the log entry. + // e.g. "0000000000000042" + // For Stackdriver trace spans, this is the same format that the Stackdriver + // trace API uses. + // The ID is a 16-character hexadecimal encoding of an 8-byte array. + SpanId string `protobuf:"bytes,27,opt,name=span_id,json=spanId" json:"span_id,omitempty"` + // Optional. Source code location information associated with the log entry, + // if any. + SourceLocation *LogEntrySourceLocation `protobuf:"bytes,23,opt,name=source_location,json=sourceLocation" json:"source_location,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 fileDescriptor0, []int{0} } + +type isLogEntry_Payload interface { + isLogEntry_Payload() +} + +type LogEntry_ProtoPayload struct { + ProtoPayload *google_protobuf2.Any `protobuf:"bytes,2,opt,name=proto_payload,json=protoPayload,oneof"` +} +type LogEntry_TextPayload struct { + TextPayload string `protobuf:"bytes,3,opt,name=text_payload,json=textPayload,oneof"` +} +type LogEntry_JsonPayload struct { + JsonPayload *google_protobuf3.Struct `protobuf:"bytes,6,opt,name=json_payload,json=jsonPayload,oneof"` +} + +func (*LogEntry_ProtoPayload) isLogEntry_Payload() {} +func (*LogEntry_TextPayload) isLogEntry_Payload() {} +func (*LogEntry_JsonPayload) isLogEntry_Payload() {} + +func (m *LogEntry) GetPayload() isLogEntry_Payload { + if m != nil { + return m.Payload + } + return nil +} + +func (m *LogEntry) GetLogName() string { + if m != nil { + return m.LogName + } + return "" +} + +func (m *LogEntry) GetResource() *google_api3.MonitoredResource { + if m != nil { + return m.Resource + } + return nil +} + +func (m *LogEntry) GetProtoPayload() *google_protobuf2.Any { + if x, ok := m.GetPayload().(*LogEntry_ProtoPayload); ok { + return x.ProtoPayload + } + return nil +} + +func (m *LogEntry) GetTextPayload() string { + if x, ok := m.GetPayload().(*LogEntry_TextPayload); ok { + return x.TextPayload + } + return "" +} + +func (m *LogEntry) GetJsonPayload() *google_protobuf3.Struct { + if x, ok := m.GetPayload().(*LogEntry_JsonPayload); ok { + return x.JsonPayload + } + return nil +} + +func (m *LogEntry) GetTimestamp() *google_protobuf4.Timestamp { + if m != nil { + return m.Timestamp + } + return nil +} + +func (m *LogEntry) GetReceiveTimestamp() *google_protobuf4.Timestamp { + if m != nil { + return m.ReceiveTimestamp + } + return nil +} + +func (m *LogEntry) GetSeverity() google_logging_type1.LogSeverity { + if m != nil { + return m.Severity + } + return google_logging_type1.LogSeverity_DEFAULT +} + +func (m *LogEntry) GetInsertId() string { + if m != nil { + return m.InsertId + } + return "" +} + +func (m *LogEntry) GetHttpRequest() *google_logging_type.HttpRequest { + if m != nil { + return m.HttpRequest + } + return nil +} + +func (m *LogEntry) GetLabels() map[string]string { + if m != nil { + return m.Labels + } + return nil +} + +func (m *LogEntry) GetOperation() *LogEntryOperation { + if m != nil { + return m.Operation + } + return nil +} + +func (m *LogEntry) GetTrace() string { + if m != nil { + return m.Trace + } + return "" +} + +func (m *LogEntry) GetSpanId() string { + if m != nil { + return m.SpanId + } + return "" +} + +func (m *LogEntry) GetSourceLocation() *LogEntrySourceLocation { + if m != nil { + return m.SourceLocation + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*LogEntry) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _LogEntry_OneofMarshaler, _LogEntry_OneofUnmarshaler, _LogEntry_OneofSizer, []interface{}{ + (*LogEntry_ProtoPayload)(nil), + (*LogEntry_TextPayload)(nil), + (*LogEntry_JsonPayload)(nil), + } +} + +func _LogEntry_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*LogEntry) + // payload + switch x := m.Payload.(type) { + case *LogEntry_ProtoPayload: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ProtoPayload); err != nil { + return err + } + case *LogEntry_TextPayload: + b.EncodeVarint(3<<3 | proto.WireBytes) + b.EncodeStringBytes(x.TextPayload) + case *LogEntry_JsonPayload: + b.EncodeVarint(6<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.JsonPayload); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("LogEntry.Payload has unexpected type %T", x) + } + return nil +} + +func _LogEntry_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*LogEntry) + switch tag { + case 2: // payload.proto_payload + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(google_protobuf2.Any) + err := b.DecodeMessage(msg) + m.Payload = &LogEntry_ProtoPayload{msg} + return true, err + case 3: // payload.text_payload + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Payload = &LogEntry_TextPayload{x} + return true, err + case 6: // payload.json_payload + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(google_protobuf3.Struct) + err := b.DecodeMessage(msg) + m.Payload = &LogEntry_JsonPayload{msg} + return true, err + default: + return false, nil + } +} + +func _LogEntry_OneofSizer(msg proto.Message) (n int) { + m := msg.(*LogEntry) + // payload + switch x := m.Payload.(type) { + case *LogEntry_ProtoPayload: + s := proto.Size(x.ProtoPayload) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *LogEntry_TextPayload: + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.TextPayload))) + n += len(x.TextPayload) + case *LogEntry_JsonPayload: + s := proto.Size(x.JsonPayload) + n += proto.SizeVarint(6<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Additional information about a potentially long-running operation with which +// a log entry is associated. +type LogEntryOperation struct { + // Optional. An arbitrary operation identifier. Log entries with the + // same identifier are assumed to be part of the same operation. + Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + // Optional. An arbitrary producer identifier. The combination of + // `id` and `producer` must be globally unique. Examples for `producer`: + // `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`. + Producer string `protobuf:"bytes,2,opt,name=producer" json:"producer,omitempty"` + // Optional. Set this to True if this is the first log entry in the operation. + First bool `protobuf:"varint,3,opt,name=first" json:"first,omitempty"` + // Optional. Set this to True if this is the last log entry in the operation. + Last bool `protobuf:"varint,4,opt,name=last" json:"last,omitempty"` +} + +func (m *LogEntryOperation) Reset() { *m = LogEntryOperation{} } +func (m *LogEntryOperation) String() string { return proto.CompactTextString(m) } +func (*LogEntryOperation) ProtoMessage() {} +func (*LogEntryOperation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *LogEntryOperation) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *LogEntryOperation) GetProducer() string { + if m != nil { + return m.Producer + } + return "" +} + +func (m *LogEntryOperation) GetFirst() bool { + if m != nil { + return m.First + } + return false +} + +func (m *LogEntryOperation) GetLast() bool { + if m != nil { + return m.Last + } + return false +} + +// Additional information about the source code location that produced the log +// entry. +type LogEntrySourceLocation struct { + // Optional. Source file name. Depending on the runtime environment, this + // might be a simple name or a fully-qualified name. + File string `protobuf:"bytes,1,opt,name=file" json:"file,omitempty"` + // Optional. Line within the source file. 1-based; 0 indicates no line number + // available. + Line int64 `protobuf:"varint,2,opt,name=line" json:"line,omitempty"` + // Optional. Human-readable name of the function or method being invoked, with + // optional context such as the class or package name. This information may be + // used in contexts such as the logs viewer, where a file and line number are + // less meaningful. The format can vary by language. For example: + // `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function` + // (Python). + Function string `protobuf:"bytes,3,opt,name=function" json:"function,omitempty"` +} + +func (m *LogEntrySourceLocation) Reset() { *m = LogEntrySourceLocation{} } +func (m *LogEntrySourceLocation) String() string { return proto.CompactTextString(m) } +func (*LogEntrySourceLocation) ProtoMessage() {} +func (*LogEntrySourceLocation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *LogEntrySourceLocation) GetFile() string { + if m != nil { + return m.File + } + return "" +} + +func (m *LogEntrySourceLocation) GetLine() int64 { + if m != nil { + return m.Line + } + return 0 +} + +func (m *LogEntrySourceLocation) GetFunction() string { + if m != nil { + return m.Function + } + return "" +} + +func init() { + proto.RegisterType((*LogEntry)(nil), "google.logging.v2.LogEntry") + proto.RegisterType((*LogEntryOperation)(nil), "google.logging.v2.LogEntryOperation") + proto.RegisterType((*LogEntrySourceLocation)(nil), "google.logging.v2.LogEntrySourceLocation") +} + +func init() { proto.RegisterFile("google/logging/v2/log_entry.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 729 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x54, 0xcd, 0x6e, 0xdb, 0x46, + 0x10, 0x36, 0x25, 0x57, 0xa2, 0x56, 0xf2, 0xdf, 0xc2, 0xb5, 0x68, 0xd9, 0x45, 0x55, 0xbb, 0x68, + 0xd5, 0x0b, 0x05, 0xa8, 0x17, 0xbb, 0x36, 0x50, 0x54, 0x46, 0x61, 0x1b, 0x50, 0x5b, 0x63, 0x5d, + 0xf8, 0x10, 0x08, 0x10, 0xd6, 0xe4, 0x8a, 0xde, 0x84, 0xda, 0x65, 0x96, 0x4b, 0x21, 0x7a, 0x94, + 0xbc, 0x42, 0x1e, 0x25, 0x6f, 0x93, 0x5b, 0x8e, 0xc1, 0x0e, 0x97, 0x92, 0x22, 0x19, 0xce, 0x6d, + 0x66, 0xe7, 0xfb, 0xe6, 0x9b, 0x19, 0xce, 0x10, 0xfd, 0x14, 0x49, 0x19, 0xc5, 0xac, 0x1b, 0xcb, + 0x28, 0xe2, 0x22, 0xea, 0x4e, 0x7b, 0xc6, 0x1c, 0x31, 0xa1, 0xd5, 0xcc, 0x4f, 0x94, 0xd4, 0x12, + 0xef, 0xe5, 0x10, 0xdf, 0x42, 0xfc, 0x69, 0xaf, 0x75, 0x6c, 0x59, 0x34, 0xe1, 0x5d, 0x2a, 0x84, + 0xd4, 0x54, 0x73, 0x29, 0xd2, 0x9c, 0xd0, 0x3a, 0x5d, 0x8a, 0x4e, 0xa4, 0xe0, 0x5a, 0x2a, 0x16, + 0x8e, 0x14, 0x4b, 0x65, 0xa6, 0x02, 0x66, 0x41, 0xbf, 0xac, 0x08, 0xeb, 0x59, 0xc2, 0xba, 0x4f, + 0x5a, 0x27, 0x23, 0xc5, 0xde, 0x66, 0x2c, 0xd5, 0x2f, 0xe1, 0x4c, 0x89, 0x29, 0x9b, 0x32, 0xc5, + 0xb5, 0xad, 0xb2, 0x75, 0x68, 0x71, 0xe0, 0x3d, 0x66, 0xe3, 0x2e,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 0x47, 0xe9, 0xcc, 0xe9, 0xd7, 0x50, 0xd5, + 0xae, 0xe7, 0x09, 0x47, 0x7b, 0x6b, 0x8d, 0xe2, 0x6d, 0x54, 0xe2, 0xa1, 0x4d, 0x55, 0xe2, 0x21, + 0x6e, 0x21, 0x37, 0x51, 0x32, 0xcc, 0x02, 0xa6, 0x6c, 0xb2, 0xb9, 0x6f, 0x54, 0xc6, 0x5c, 0xa5, + 0x1a, 0xae, 0xc1, 0x25, 0xb9, 0x83, 0x31, 0xda, 0x8c, 0x69, 0xaa, 0x61, 0x03, 0x5c, 0x02, 0xf6, + 0xc9, 0x10, 0x1d, 0x3c, 0xdf, 0x9a, 0x41, 0x8f, 0x79, 0xcc, 0xac, 0x22, 0xd8, 0x90, 0x81, 0x8b, + 0xbc, 0xf8, 0x32, 0x01, 0xdb, 0xd4, 0x31, 0xce, 0x44, 0x00, 0xf3, 0x2b, 0xe7, 0x75, 0x14, 0x7e, + 0xff, 0xbd, 0x83, 0xbe, 0x0f, 0xe4, 0x64, 0x7d, 0x9e, 0xfd, 0xad, 0x42, 0xf5, 0x0e, 0x8e, 0xd9, + 0x79, 0x75, 0x66, 0x31, 0x91, 0x8c, 0xa9, 0x88, 0x7c, 0xa9, 0xa2, 0x6e, 0xc4, 0x04, 0x1c, 0x47, + 0x37, 0x0f, 0xd1, 0x84, 0xa7, 0x4b, 0x7f, 0xea, 0x0b, 0x6b, 0x7e, 0x76, 0x9c, 0x0f, 0xa5, 0xe6, + 0x75, 0xce, 0xbe, 0x8a, 0x65, 0x16, 0x9a, 0x8f, 0x05, 0x3a, 0x0f, 0xbd, 0x8f, 0x45, 0x64, 0x08, + 0x91, 0xa1, 0x8d, 0x0c, 0x1f, 0x7a, 0x8f, 0x15, 0xc8, 0xfd, 0xfb, 0x97, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x80, 0x53, 0xd3, 0xff, 0x04, 0x06, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/logging/v2/logging.pb.go b/vendor/google.golang.org/genproto/googleapis/logging/v2/logging.pb.go new file mode 100644 index 0000000000..12e712c52f --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/logging/v2/logging.pb.go @@ -0,0 +1,782 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/logging/v2/logging.proto + +package logging + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_api3 "google.golang.org/genproto/googleapis/api/monitoredres" +import _ "github.com/golang/protobuf/ptypes/duration" +import google_protobuf5 "github.com/golang/protobuf/ptypes/empty" +import _ "github.com/golang/protobuf/ptypes/timestamp" +import google_rpc "google.golang.org/genproto/googleapis/rpc/status" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// The parameters to DeleteLog. +type DeleteLogRequest struct { + // Required. The resource name of the log to delete: + // + // "projects/[PROJECT_ID]/logs/[LOG_ID]" + // "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" + // "folders/[FOLDER_ID]/logs/[LOG_ID]" + // + // `[LOG_ID]` must be URL-encoded. For example, + // `"projects/my-project-id/logs/syslog"`, + // `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`. + // For more information about log names, see + // [LogEntry][google.logging.v2.LogEntry]. + LogName string `protobuf:"bytes,1,opt,name=log_name,json=logName" json:"log_name,omitempty"` +} + +func (m *DeleteLogRequest) Reset() { *m = DeleteLogRequest{} } +func (m *DeleteLogRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteLogRequest) ProtoMessage() {} +func (*DeleteLogRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +func (m *DeleteLogRequest) GetLogName() string { + if m != nil { + return m.LogName + } + return "" +} + +// The parameters to WriteLogEntries. +type WriteLogEntriesRequest struct { + // Optional. A default log resource name that is assigned to all log entries + // in `entries` that do not specify a value for `log_name`: + // + // "projects/[PROJECT_ID]/logs/[LOG_ID]" + // "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" + // "folders/[FOLDER_ID]/logs/[LOG_ID]" + // + // `[LOG_ID]` must be URL-encoded. For example, + // `"projects/my-project-id/logs/syslog"` or + // `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`. + // For more information about log names, see + // [LogEntry][google.logging.v2.LogEntry]. + LogName string `protobuf:"bytes,1,opt,name=log_name,json=logName" json:"log_name,omitempty"` + // Optional. A default monitored resource object that is assigned to all log + // entries in `entries` that do not specify a value for `resource`. Example: + // + // { "type": "gce_instance", + // "labels": { + // "zone": "us-central1-a", "instance_id": "00000000000000000000" }} + // + // See [LogEntry][google.logging.v2.LogEntry]. + Resource *google_api3.MonitoredResource `protobuf:"bytes,2,opt,name=resource" json:"resource,omitempty"` + // Optional. Default labels that are added to the `labels` field of all log + // entries in `entries`. If a log entry already has a label with the same key + // as a label in this parameter, then the log entry's label is not changed. + // See [LogEntry][google.logging.v2.LogEntry]. + Labels map[string]string `protobuf:"bytes,3,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // Required. The log entries to send to Stackdriver Logging. The order of log + // entries in this list does not matter. Values supplied in this method's + // `log_name`, `resource`, and `labels` fields are copied into those log + // entries in this list that do not include values for their corresponding + // fields. For more information, see the [LogEntry][google.logging.v2.LogEntry] type. + // + // If the `timestamp` or `insert_id` fields are missing in log entries, then + // this method supplies the current time or a unique identifier, respectively. + // The supplied values are chosen so that, among the log entries that did not + // supply their own values, the entries earlier in the list will sort before + // the entries later in the list. See the `entries.list` method. + // + // Log entries with timestamps that are more than the + // [logs retention period](/logging/quota-policy) in the past or more than + // 24 hours in the future might be discarded. Discarding does not return + // an error. + // + // To improve throughput and to avoid exceeding the + // [quota limit](/logging/quota-policy) for calls to `entries.write`, + // you should try to include several log entries in this list, + // rather than calling this method for each individual log entry. + Entries []*LogEntry `protobuf:"bytes,4,rep,name=entries" json:"entries,omitempty"` + // Optional. Whether valid entries should be written even if some other + // entries fail due to INVALID_ARGUMENT or PERMISSION_DENIED errors. If any + // entry is not written, then the response status is the error associated + // with one of the failed entries and the response includes error details + // keyed by the entries' zero-based index in the `entries.write` method. + PartialSuccess bool `protobuf:"varint,5,opt,name=partial_success,json=partialSuccess" json:"partial_success,omitempty"` +} + +func (m *WriteLogEntriesRequest) Reset() { *m = WriteLogEntriesRequest{} } +func (m *WriteLogEntriesRequest) String() string { return proto.CompactTextString(m) } +func (*WriteLogEntriesRequest) ProtoMessage() {} +func (*WriteLogEntriesRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} } + +func (m *WriteLogEntriesRequest) GetLogName() string { + if m != nil { + return m.LogName + } + return "" +} + +func (m *WriteLogEntriesRequest) GetResource() *google_api3.MonitoredResource { + if m != nil { + return m.Resource + } + return nil +} + +func (m *WriteLogEntriesRequest) GetLabels() map[string]string { + if m != nil { + return m.Labels + } + return nil +} + +func (m *WriteLogEntriesRequest) GetEntries() []*LogEntry { + if m != nil { + return m.Entries + } + return nil +} + +func (m *WriteLogEntriesRequest) GetPartialSuccess() bool { + if m != nil { + return m.PartialSuccess + } + return false +} + +// Result returned from WriteLogEntries. +// empty +type WriteLogEntriesResponse struct { +} + +func (m *WriteLogEntriesResponse) Reset() { *m = WriteLogEntriesResponse{} } +func (m *WriteLogEntriesResponse) String() string { return proto.CompactTextString(m) } +func (*WriteLogEntriesResponse) ProtoMessage() {} +func (*WriteLogEntriesResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} } + +// Error details for WriteLogEntries with partial success. +type WriteLogEntriesPartialErrors struct { + // When `WriteLogEntriesRequest.partial_success` is true, records the error + // status for entries that were not written due to a permanent error, keyed + // by the entry's zero-based index in `WriteLogEntriesRequest.entries`. + // + // Failed requests for which no entries are written will not include + // per-entry errors. + LogEntryErrors map[int32]*google_rpc.Status `protobuf:"bytes,1,rep,name=log_entry_errors,json=logEntryErrors" json:"log_entry_errors,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *WriteLogEntriesPartialErrors) Reset() { *m = WriteLogEntriesPartialErrors{} } +func (m *WriteLogEntriesPartialErrors) String() string { return proto.CompactTextString(m) } +func (*WriteLogEntriesPartialErrors) ProtoMessage() {} +func (*WriteLogEntriesPartialErrors) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{3} } + +func (m *WriteLogEntriesPartialErrors) GetLogEntryErrors() map[int32]*google_rpc.Status { + if m != nil { + return m.LogEntryErrors + } + return nil +} + +// The parameters to `ListLogEntries`. +type ListLogEntriesRequest struct { + // Deprecated. Use `resource_names` instead. One or more project identifiers + // or project numbers from which to retrieve log entries. Example: + // `"my-project-1A"`. If present, these project identifiers are converted to + // resource name format and added to the list of resources in + // `resource_names`. + ProjectIds []string `protobuf:"bytes,1,rep,name=project_ids,json=projectIds" json:"project_ids,omitempty"` + // Required. Names of one or more parent resources from which to + // retrieve log entries: + // + // "projects/[PROJECT_ID]" + // "organizations/[ORGANIZATION_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]" + // "folders/[FOLDER_ID]" + // + // Projects listed in the `project_ids` field are added to this list. + ResourceNames []string `protobuf:"bytes,8,rep,name=resource_names,json=resourceNames" json:"resource_names,omitempty"` + // Optional. A filter that chooses which log entries to return. See [Advanced + // Logs Filters](/logging/docs/view/advanced_filters). Only log entries that + // match the filter are returned. An empty filter matches all log entries in + // the resources listed in `resource_names`. Referencing a parent resource + // that is not listed in `resource_names` will cause the filter to return no + // results. + // The maximum length of the filter is 20000 characters. + Filter string `protobuf:"bytes,2,opt,name=filter" json:"filter,omitempty"` + // Optional. How the results should be sorted. Presently, the only permitted + // values are `"timestamp asc"` (default) and `"timestamp desc"`. The first + // option returns entries in order of increasing values of + // `LogEntry.timestamp` (oldest first), and the second option returns entries + // in order of decreasing timestamps (newest first). Entries with equal + // timestamps are returned in order of their `insert_id` values. + OrderBy string `protobuf:"bytes,3,opt,name=order_by,json=orderBy" json:"order_by,omitempty"` + // Optional. The maximum number of results to return from this request. + // Non-positive values are ignored. The presence of `next_page_token` in the + // response indicates that more results might be available. + PageSize int32 `protobuf:"varint,4,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // Optional. If present, then retrieve the next batch of results from the + // preceding call to this method. `page_token` must be the value of + // `next_page_token` from the previous response. The values of other method + // parameters should be identical to those in the previous call. + PageToken string `protobuf:"bytes,5,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListLogEntriesRequest) Reset() { *m = ListLogEntriesRequest{} } +func (m *ListLogEntriesRequest) String() string { return proto.CompactTextString(m) } +func (*ListLogEntriesRequest) ProtoMessage() {} +func (*ListLogEntriesRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{4} } + +func (m *ListLogEntriesRequest) GetProjectIds() []string { + if m != nil { + return m.ProjectIds + } + return nil +} + +func (m *ListLogEntriesRequest) GetResourceNames() []string { + if m != nil { + return m.ResourceNames + } + return nil +} + +func (m *ListLogEntriesRequest) GetFilter() string { + if m != nil { + return m.Filter + } + return "" +} + +func (m *ListLogEntriesRequest) GetOrderBy() string { + if m != nil { + return m.OrderBy + } + return "" +} + +func (m *ListLogEntriesRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListLogEntriesRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// Result returned from `ListLogEntries`. +type ListLogEntriesResponse struct { + // A list of log entries. If `entries` is empty, `nextPageToken` may still be + // returned, indicating that more entries may exist. See `nextPageToken` for + // more information. + Entries []*LogEntry `protobuf:"bytes,1,rep,name=entries" json:"entries,omitempty"` + // If there might be more results than those appearing in this response, then + // `nextPageToken` is included. To get the next set of results, call this + // method again using the value of `nextPageToken` as `pageToken`. + // + // If a value for `next_page_token` appears and the `entries` field is empty, + // it means that the search found no log entries so far but it did not have + // time to search all the possible log entries. Retry the method with this + // value for `page_token` to continue the search. Alternatively, consider + // speeding up the search by changing your filter to specify a single log name + // or resource type, or to narrow the time range of the search. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListLogEntriesResponse) Reset() { *m = ListLogEntriesResponse{} } +func (m *ListLogEntriesResponse) String() string { return proto.CompactTextString(m) } +func (*ListLogEntriesResponse) ProtoMessage() {} +func (*ListLogEntriesResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{5} } + +func (m *ListLogEntriesResponse) GetEntries() []*LogEntry { + if m != nil { + return m.Entries + } + return nil +} + +func (m *ListLogEntriesResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// The parameters to ListMonitoredResourceDescriptors +type ListMonitoredResourceDescriptorsRequest struct { + // Optional. The maximum number of results to return from this request. + // Non-positive values are ignored. The presence of `nextPageToken` in the + // response indicates that more results might be available. + PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // Optional. If present, then retrieve the next batch of results from the + // preceding call to this method. `pageToken` must be the value of + // `nextPageToken` from the previous response. The values of other method + // parameters should be identical to those in the previous call. + PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListMonitoredResourceDescriptorsRequest) Reset() { + *m = ListMonitoredResourceDescriptorsRequest{} +} +func (m *ListMonitoredResourceDescriptorsRequest) String() string { return proto.CompactTextString(m) } +func (*ListMonitoredResourceDescriptorsRequest) ProtoMessage() {} +func (*ListMonitoredResourceDescriptorsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor1, []int{6} +} + +func (m *ListMonitoredResourceDescriptorsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListMonitoredResourceDescriptorsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// Result returned from ListMonitoredResourceDescriptors. +type ListMonitoredResourceDescriptorsResponse struct { + // A list of resource descriptors. + ResourceDescriptors []*google_api3.MonitoredResourceDescriptor `protobuf:"bytes,1,rep,name=resource_descriptors,json=resourceDescriptors" json:"resource_descriptors,omitempty"` + // If there might be more results than those appearing in this response, then + // `nextPageToken` is included. To get the next set of results, call this + // method again using the value of `nextPageToken` as `pageToken`. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListMonitoredResourceDescriptorsResponse) Reset() { + *m = ListMonitoredResourceDescriptorsResponse{} +} +func (m *ListMonitoredResourceDescriptorsResponse) String() string { return proto.CompactTextString(m) } +func (*ListMonitoredResourceDescriptorsResponse) ProtoMessage() {} +func (*ListMonitoredResourceDescriptorsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor1, []int{7} +} + +func (m *ListMonitoredResourceDescriptorsResponse) GetResourceDescriptors() []*google_api3.MonitoredResourceDescriptor { + if m != nil { + return m.ResourceDescriptors + } + return nil +} + +func (m *ListMonitoredResourceDescriptorsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// The parameters to ListLogs. +type ListLogsRequest struct { + // Required. The resource name that owns the logs: + // + // "projects/[PROJECT_ID]" + // "organizations/[ORGANIZATION_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]" + // "folders/[FOLDER_ID]" + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // Optional. The maximum number of results to return from this request. + // Non-positive values are ignored. The presence of `nextPageToken` in the + // response indicates that more results might be available. + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // Optional. If present, then retrieve the next batch of results from the + // preceding call to this method. `pageToken` must be the value of + // `nextPageToken` from the previous response. The values of other method + // parameters should be identical to those in the previous call. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListLogsRequest) Reset() { *m = ListLogsRequest{} } +func (m *ListLogsRequest) String() string { return proto.CompactTextString(m) } +func (*ListLogsRequest) ProtoMessage() {} +func (*ListLogsRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{8} } + +func (m *ListLogsRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *ListLogsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListLogsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// Result returned from ListLogs. +type ListLogsResponse struct { + // A list of log names. For example, + // `"projects/my-project/syslog"` or + // `"organizations/123/cloudresourcemanager.googleapis.com%2Factivity"`. + LogNames []string `protobuf:"bytes,3,rep,name=log_names,json=logNames" json:"log_names,omitempty"` + // If there might be more results than those appearing in this response, then + // `nextPageToken` is included. To get the next set of results, call this + // method again using the value of `nextPageToken` as `pageToken`. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListLogsResponse) Reset() { *m = ListLogsResponse{} } +func (m *ListLogsResponse) String() string { return proto.CompactTextString(m) } +func (*ListLogsResponse) ProtoMessage() {} +func (*ListLogsResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{9} } + +func (m *ListLogsResponse) GetLogNames() []string { + if m != nil { + return m.LogNames + } + return nil +} + +func (m *ListLogsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +func init() { + proto.RegisterType((*DeleteLogRequest)(nil), "google.logging.v2.DeleteLogRequest") + proto.RegisterType((*WriteLogEntriesRequest)(nil), "google.logging.v2.WriteLogEntriesRequest") + proto.RegisterType((*WriteLogEntriesResponse)(nil), "google.logging.v2.WriteLogEntriesResponse") + proto.RegisterType((*WriteLogEntriesPartialErrors)(nil), "google.logging.v2.WriteLogEntriesPartialErrors") + proto.RegisterType((*ListLogEntriesRequest)(nil), "google.logging.v2.ListLogEntriesRequest") + proto.RegisterType((*ListLogEntriesResponse)(nil), "google.logging.v2.ListLogEntriesResponse") + proto.RegisterType((*ListMonitoredResourceDescriptorsRequest)(nil), "google.logging.v2.ListMonitoredResourceDescriptorsRequest") + proto.RegisterType((*ListMonitoredResourceDescriptorsResponse)(nil), "google.logging.v2.ListMonitoredResourceDescriptorsResponse") + proto.RegisterType((*ListLogsRequest)(nil), "google.logging.v2.ListLogsRequest") + proto.RegisterType((*ListLogsResponse)(nil), "google.logging.v2.ListLogsResponse") +} + +// 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 + +// Client API for LoggingServiceV2 service + +type LoggingServiceV2Client interface { + // Deletes all the log entries in a log. + // The log reappears if it receives new entries. + // Log entries written shortly before the delete operation might not be + // deleted. + DeleteLog(ctx context.Context, in *DeleteLogRequest, opts ...grpc.CallOption) (*google_protobuf5.Empty, error) + // ## Log entry resources + // + // Writes log entries to Stackdriver Logging. This API method is the + // only way to send log entries to Stackdriver Logging. This method + // is used, directly or indirectly, by the Stackdriver Logging agent + // (fluentd) and all logging libraries configured to use Stackdriver + // Logging. + WriteLogEntries(ctx context.Context, in *WriteLogEntriesRequest, opts ...grpc.CallOption) (*WriteLogEntriesResponse, error) + // Lists log entries. Use this method to retrieve log entries from + // Stackdriver Logging. For ways to export log entries, see + // [Exporting Logs](/logging/docs/export). + ListLogEntries(ctx context.Context, in *ListLogEntriesRequest, opts ...grpc.CallOption) (*ListLogEntriesResponse, error) + // Lists the descriptors for monitored resource types used by Stackdriver + // Logging. + ListMonitoredResourceDescriptors(ctx context.Context, in *ListMonitoredResourceDescriptorsRequest, opts ...grpc.CallOption) (*ListMonitoredResourceDescriptorsResponse, error) + // Lists the logs in projects, organizations, folders, or billing accounts. + // Only logs that have entries are listed. + ListLogs(ctx context.Context, in *ListLogsRequest, opts ...grpc.CallOption) (*ListLogsResponse, error) +} + +type loggingServiceV2Client struct { + cc *grpc.ClientConn +} + +func NewLoggingServiceV2Client(cc *grpc.ClientConn) LoggingServiceV2Client { + return &loggingServiceV2Client{cc} +} + +func (c *loggingServiceV2Client) DeleteLog(ctx context.Context, in *DeleteLogRequest, opts ...grpc.CallOption) (*google_protobuf5.Empty, error) { + out := new(google_protobuf5.Empty) + err := grpc.Invoke(ctx, "/google.logging.v2.LoggingServiceV2/DeleteLog", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *loggingServiceV2Client) WriteLogEntries(ctx context.Context, in *WriteLogEntriesRequest, opts ...grpc.CallOption) (*WriteLogEntriesResponse, error) { + out := new(WriteLogEntriesResponse) + err := grpc.Invoke(ctx, "/google.logging.v2.LoggingServiceV2/WriteLogEntries", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *loggingServiceV2Client) ListLogEntries(ctx context.Context, in *ListLogEntriesRequest, opts ...grpc.CallOption) (*ListLogEntriesResponse, error) { + out := new(ListLogEntriesResponse) + err := grpc.Invoke(ctx, "/google.logging.v2.LoggingServiceV2/ListLogEntries", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *loggingServiceV2Client) ListMonitoredResourceDescriptors(ctx context.Context, in *ListMonitoredResourceDescriptorsRequest, opts ...grpc.CallOption) (*ListMonitoredResourceDescriptorsResponse, error) { + out := new(ListMonitoredResourceDescriptorsResponse) + err := grpc.Invoke(ctx, "/google.logging.v2.LoggingServiceV2/ListMonitoredResourceDescriptors", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *loggingServiceV2Client) ListLogs(ctx context.Context, in *ListLogsRequest, opts ...grpc.CallOption) (*ListLogsResponse, error) { + out := new(ListLogsResponse) + err := grpc.Invoke(ctx, "/google.logging.v2.LoggingServiceV2/ListLogs", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for LoggingServiceV2 service + +type LoggingServiceV2Server interface { + // Deletes all the log entries in a log. + // The log reappears if it receives new entries. + // Log entries written shortly before the delete operation might not be + // deleted. + DeleteLog(context.Context, *DeleteLogRequest) (*google_protobuf5.Empty, error) + // ## Log entry resources + // + // Writes log entries to Stackdriver Logging. This API method is the + // only way to send log entries to Stackdriver Logging. This method + // is used, directly or indirectly, by the Stackdriver Logging agent + // (fluentd) and all logging libraries configured to use Stackdriver + // Logging. + WriteLogEntries(context.Context, *WriteLogEntriesRequest) (*WriteLogEntriesResponse, error) + // Lists log entries. Use this method to retrieve log entries from + // Stackdriver Logging. For ways to export log entries, see + // [Exporting Logs](/logging/docs/export). + ListLogEntries(context.Context, *ListLogEntriesRequest) (*ListLogEntriesResponse, error) + // Lists the descriptors for monitored resource types used by Stackdriver + // Logging. + ListMonitoredResourceDescriptors(context.Context, *ListMonitoredResourceDescriptorsRequest) (*ListMonitoredResourceDescriptorsResponse, error) + // Lists the logs in projects, organizations, folders, or billing accounts. + // Only logs that have entries are listed. + ListLogs(context.Context, *ListLogsRequest) (*ListLogsResponse, error) +} + +func RegisterLoggingServiceV2Server(s *grpc.Server, srv LoggingServiceV2Server) { + s.RegisterService(&_LoggingServiceV2_serviceDesc, srv) +} + +func _LoggingServiceV2_DeleteLog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteLogRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LoggingServiceV2Server).DeleteLog(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.logging.v2.LoggingServiceV2/DeleteLog", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LoggingServiceV2Server).DeleteLog(ctx, req.(*DeleteLogRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LoggingServiceV2_WriteLogEntries_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(WriteLogEntriesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LoggingServiceV2Server).WriteLogEntries(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.logging.v2.LoggingServiceV2/WriteLogEntries", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LoggingServiceV2Server).WriteLogEntries(ctx, req.(*WriteLogEntriesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LoggingServiceV2_ListLogEntries_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListLogEntriesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LoggingServiceV2Server).ListLogEntries(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.logging.v2.LoggingServiceV2/ListLogEntries", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LoggingServiceV2Server).ListLogEntries(ctx, req.(*ListLogEntriesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LoggingServiceV2_ListMonitoredResourceDescriptors_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListMonitoredResourceDescriptorsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LoggingServiceV2Server).ListMonitoredResourceDescriptors(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.logging.v2.LoggingServiceV2/ListMonitoredResourceDescriptors", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LoggingServiceV2Server).ListMonitoredResourceDescriptors(ctx, req.(*ListMonitoredResourceDescriptorsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LoggingServiceV2_ListLogs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListLogsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LoggingServiceV2Server).ListLogs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.logging.v2.LoggingServiceV2/ListLogs", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LoggingServiceV2Server).ListLogs(ctx, req.(*ListLogsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _LoggingServiceV2_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.logging.v2.LoggingServiceV2", + HandlerType: (*LoggingServiceV2Server)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "DeleteLog", + Handler: _LoggingServiceV2_DeleteLog_Handler, + }, + { + MethodName: "WriteLogEntries", + Handler: _LoggingServiceV2_WriteLogEntries_Handler, + }, + { + MethodName: "ListLogEntries", + Handler: _LoggingServiceV2_ListLogEntries_Handler, + }, + { + MethodName: "ListMonitoredResourceDescriptors", + Handler: _LoggingServiceV2_ListMonitoredResourceDescriptors_Handler, + }, + { + MethodName: "ListLogs", + Handler: _LoggingServiceV2_ListLogs_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/logging/v2/logging.proto", +} + +func init() { proto.RegisterFile("google/logging/v2/logging.proto", fileDescriptor1) } + +var fileDescriptor1 = []byte{ + // 991 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xcd, 0x6e, 0xdb, 0x46, + 0x10, 0xc6, 0x4a, 0xb1, 0x23, 0x8d, 0x1a, 0x5b, 0xd9, 0xc4, 0xb2, 0x22, 0xd9, 0xb5, 0x4a, 0x23, + 0xb5, 0x22, 0x20, 0x24, 0xca, 0x22, 0x40, 0xe2, 0x20, 0x17, 0x27, 0x46, 0x51, 0xc0, 0x29, 0x0c, + 0xba, 0x75, 0x80, 0xc0, 0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 0xb4, 0x7d, + 0xea, 0xfe, 0x91, 0x7a, 0xce, 0x94, 0xe7, 0xcc, 0x78, 0xce, 0x4e, 0xdd, 0xce, 0xaa, 0x8a, 0xfd, + 0xe5, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xfd, 0x96, 0xc5, 0x3e, 0x3a, 0x0a, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/logging/v2/logging_config.pb.go b/vendor/google.golang.org/genproto/googleapis/logging/v2/logging_config.pb.go new file mode 100644 index 0000000000..00fd85eab3 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/logging/v2/logging_config.pb.go @@ -0,0 +1,1213 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/logging/v2/logging_config.proto + +package logging + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf5 "github.com/golang/protobuf/ptypes/empty" +import google_protobuf6 "google.golang.org/genproto/protobuf/field_mask" +import google_protobuf4 "github.com/golang/protobuf/ptypes/timestamp" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Available log entry formats. Log entries can be written to Stackdriver +// Logging in either format and can be exported in either format. +// Version 2 is the preferred format. +type LogSink_VersionFormat int32 + +const ( + // An unspecified format version that will default to V2. + LogSink_VERSION_FORMAT_UNSPECIFIED LogSink_VersionFormat = 0 + // `LogEntry` version 2 format. + LogSink_V2 LogSink_VersionFormat = 1 + // `LogEntry` version 1 format. + LogSink_V1 LogSink_VersionFormat = 2 +) + +var LogSink_VersionFormat_name = map[int32]string{ + 0: "VERSION_FORMAT_UNSPECIFIED", + 1: "V2", + 2: "V1", +} +var LogSink_VersionFormat_value = map[string]int32{ + "VERSION_FORMAT_UNSPECIFIED": 0, + "V2": 1, + "V1": 2, +} + +func (x LogSink_VersionFormat) String() string { + return proto.EnumName(LogSink_VersionFormat_name, int32(x)) +} +func (LogSink_VersionFormat) EnumDescriptor() ([]byte, []int) { return fileDescriptor2, []int{0, 0} } + +// Describes a sink used to export log entries to one of the following +// destinations in any project: a Cloud Storage bucket, a BigQuery dataset, or a +// Cloud Pub/Sub topic. A logs filter controls which log entries are +// exported. The sink must be created within a project, organization, billing +// account, or folder. +type LogSink struct { + // Required. The client-assigned sink identifier, unique within the + // project. Example: `"my-syslog-errors-to-pubsub"`. Sink identifiers are + // limited to 100 characters and can include only the following characters: + // upper and lower-case alphanumeric characters, underscores, hyphens, and + // periods. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Required. The export destination: + // + // "storage.googleapis.com/[GCS_BUCKET]" + // "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]" + // "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]" + // + // The sink's `writer_identity`, set when the sink is created, must + // have permission to write to the destination or else the log + // entries are not exported. For more information, see + // [Exporting Logs With Sinks](/logging/docs/api/tasks/exporting-logs). + Destination string `protobuf:"bytes,3,opt,name=destination" json:"destination,omitempty"` + // Optional. + // An [advanced logs filter](/logging/docs/view/advanced_filters). The only + // exported log entries are those that are in the resource owning the sink and + // that match the filter. For example: + // + // logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR + Filter string `protobuf:"bytes,5,opt,name=filter" json:"filter,omitempty"` + // Deprecated. The log entry format to use for this sink's exported log + // entries. The v2 format is used by default and cannot be changed. + OutputVersionFormat LogSink_VersionFormat `protobuf:"varint,6,opt,name=output_version_format,json=outputVersionFormat,enum=google.logging.v2.LogSink_VersionFormat" json:"output_version_format,omitempty"` + // Output only. An IAM identity—a service account or group—under + // which Stackdriver Logging writes the exported log entries to the sink's + // destination. This field is set by + // [sinks.create](/logging/docs/api/reference/rest/v2/projects.sinks/create) + // and + // [sinks.update](/logging/docs/api/reference/rest/v2/projects.sinks/update), + // based on the setting of `unique_writer_identity` in those methods. + // + // Until you grant this identity write-access to the destination, log entry + // exports from this sink will fail. For more information, + // see [Granting access for a + // resource](/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource). + // Consult the destination service's documentation to determine the + // appropriate IAM roles to assign to the identity. + WriterIdentity string `protobuf:"bytes,8,opt,name=writer_identity,json=writerIdentity" json:"writer_identity,omitempty"` + // Optional. This field applies only to sinks owned by organizations and + // folders. If the field is false, the default, only the logs owned by the + // sink's parent resource are available for export. If the field is true, then + // logs from all the projects, folders, and billing accounts contained in the + // sink's parent resource are also available for export. Whether a particular + // log entry from the children is exported depends on the sink's filter + // expression. For example, if this field is true, then the filter + // `resource.type=gce_instance` would export all Compute Engine VM instance + // log entries from all projects in the sink's parent. To only export entries + // from certain child projects, filter on the project part of the log name: + // + // logName:("projects/test-project1/" OR "projects/test-project2/") AND + // resource.type=gce_instance + IncludeChildren bool `protobuf:"varint,9,opt,name=include_children,json=includeChildren" json:"include_children,omitempty"` + // Deprecated. This field is ignored when creating or updating sinks. + StartTime *google_protobuf4.Timestamp `protobuf:"bytes,10,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + // Deprecated. This field is ignored when creating or updating sinks. + EndTime *google_protobuf4.Timestamp `protobuf:"bytes,11,opt,name=end_time,json=endTime" json:"end_time,omitempty"` +} + +func (m *LogSink) Reset() { *m = LogSink{} } +func (m *LogSink) String() string { return proto.CompactTextString(m) } +func (*LogSink) ProtoMessage() {} +func (*LogSink) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} } + +func (m *LogSink) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *LogSink) GetDestination() string { + if m != nil { + return m.Destination + } + return "" +} + +func (m *LogSink) GetFilter() string { + if m != nil { + return m.Filter + } + return "" +} + +func (m *LogSink) GetOutputVersionFormat() LogSink_VersionFormat { + if m != nil { + return m.OutputVersionFormat + } + return LogSink_VERSION_FORMAT_UNSPECIFIED +} + +func (m *LogSink) GetWriterIdentity() string { + if m != nil { + return m.WriterIdentity + } + return "" +} + +func (m *LogSink) GetIncludeChildren() bool { + if m != nil { + return m.IncludeChildren + } + return false +} + +func (m *LogSink) GetStartTime() *google_protobuf4.Timestamp { + if m != nil { + return m.StartTime + } + return nil +} + +func (m *LogSink) GetEndTime() *google_protobuf4.Timestamp { + if m != nil { + return m.EndTime + } + return nil +} + +// The parameters to `ListSinks`. +type ListSinksRequest struct { + // Required. The parent resource whose sinks are to be listed: + // + // "projects/[PROJECT_ID]" + // "organizations/[ORGANIZATION_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]" + // "folders/[FOLDER_ID]" + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // Optional. If present, then retrieve the next batch of results from the + // preceding call to this method. `pageToken` must be the value of + // `nextPageToken` from the previous response. The values of other method + // parameters should be identical to those in the previous call. + PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` + // Optional. The maximum number of results to return from this request. + // Non-positive values are ignored. The presence of `nextPageToken` in the + // response indicates that more results might be available. + PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` +} + +func (m *ListSinksRequest) Reset() { *m = ListSinksRequest{} } +func (m *ListSinksRequest) String() string { return proto.CompactTextString(m) } +func (*ListSinksRequest) ProtoMessage() {} +func (*ListSinksRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{1} } + +func (m *ListSinksRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *ListSinksRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +func (m *ListSinksRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +// Result returned from `ListSinks`. +type ListSinksResponse struct { + // A list of sinks. + Sinks []*LogSink `protobuf:"bytes,1,rep,name=sinks" json:"sinks,omitempty"` + // If there might be more results than appear in this response, then + // `nextPageToken` is included. To get the next set of results, call the same + // method again using the value of `nextPageToken` as `pageToken`. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListSinksResponse) Reset() { *m = ListSinksResponse{} } +func (m *ListSinksResponse) String() string { return proto.CompactTextString(m) } +func (*ListSinksResponse) ProtoMessage() {} +func (*ListSinksResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{2} } + +func (m *ListSinksResponse) GetSinks() []*LogSink { + if m != nil { + return m.Sinks + } + return nil +} + +func (m *ListSinksResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// The parameters to `GetSink`. +type GetSinkRequest struct { + // Required. The resource name of the sink: + // + // "projects/[PROJECT_ID]/sinks/[SINK_ID]" + // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + // "folders/[FOLDER_ID]/sinks/[SINK_ID]" + // + // Example: `"projects/my-project-id/sinks/my-sink-id"`. + SinkName string `protobuf:"bytes,1,opt,name=sink_name,json=sinkName" json:"sink_name,omitempty"` +} + +func (m *GetSinkRequest) Reset() { *m = GetSinkRequest{} } +func (m *GetSinkRequest) String() string { return proto.CompactTextString(m) } +func (*GetSinkRequest) ProtoMessage() {} +func (*GetSinkRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{3} } + +func (m *GetSinkRequest) GetSinkName() string { + if m != nil { + return m.SinkName + } + return "" +} + +// The parameters to `CreateSink`. +type CreateSinkRequest struct { + // Required. The resource in which to create the sink: + // + // "projects/[PROJECT_ID]" + // "organizations/[ORGANIZATION_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]" + // "folders/[FOLDER_ID]" + // + // Examples: `"projects/my-logging-project"`, `"organizations/123456789"`. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // Required. The new sink, whose `name` parameter is a sink identifier that + // is not already in use. + Sink *LogSink `protobuf:"bytes,2,opt,name=sink" json:"sink,omitempty"` + // Optional. Determines the kind of IAM identity returned as `writer_identity` + // in the new sink. If this value is omitted or set to false, and if the + // sink's parent is a project, then the value returned as `writer_identity` is + // the same group or service account used by Stackdriver Logging before the + // addition of writer identities to this API. The sink's destination must be + // in the same project as the sink itself. + // + // If this field is set to true, or if the sink is owned by a non-project + // resource such as an organization, then the value of `writer_identity` will + // be a unique service account used only for exports from the new sink. For + // more information, see `writer_identity` in [LogSink][google.logging.v2.LogSink]. + UniqueWriterIdentity bool `protobuf:"varint,3,opt,name=unique_writer_identity,json=uniqueWriterIdentity" json:"unique_writer_identity,omitempty"` +} + +func (m *CreateSinkRequest) Reset() { *m = CreateSinkRequest{} } +func (m *CreateSinkRequest) String() string { return proto.CompactTextString(m) } +func (*CreateSinkRequest) ProtoMessage() {} +func (*CreateSinkRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{4} } + +func (m *CreateSinkRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *CreateSinkRequest) GetSink() *LogSink { + if m != nil { + return m.Sink + } + return nil +} + +func (m *CreateSinkRequest) GetUniqueWriterIdentity() bool { + if m != nil { + return m.UniqueWriterIdentity + } + return false +} + +// The parameters to `UpdateSink`. +type UpdateSinkRequest struct { + // Required. The full resource name of the sink to update, including the + // parent resource and the sink identifier: + // + // "projects/[PROJECT_ID]/sinks/[SINK_ID]" + // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + // "folders/[FOLDER_ID]/sinks/[SINK_ID]" + // + // Example: `"projects/my-project-id/sinks/my-sink-id"`. + SinkName string `protobuf:"bytes,1,opt,name=sink_name,json=sinkName" json:"sink_name,omitempty"` + // Required. The updated sink, whose name is the same identifier that appears + // as part of `sink_name`. + Sink *LogSink `protobuf:"bytes,2,opt,name=sink" json:"sink,omitempty"` + // Optional. See + // [sinks.create](/logging/docs/api/reference/rest/v2/projects.sinks/create) + // for a description of this field. When updating a sink, the effect of this + // field on the value of `writer_identity` in the updated sink depends on both + // the old and new values of this field: + // + // + If the old and new values of this field are both false or both true, + // then there is no change to the sink's `writer_identity`. + // + If the old value is false and the new value is true, then + // `writer_identity` is changed to a unique service account. + // + It is an error if the old value is true and the new value is + // set to false or defaulted to false. + UniqueWriterIdentity bool `protobuf:"varint,3,opt,name=unique_writer_identity,json=uniqueWriterIdentity" json:"unique_writer_identity,omitempty"` + // Optional. Field mask that specifies the fields in `sink` that need + // an update. A sink field will be overwritten if, and only if, it is + // in the update mask. `name` and output only fields cannot be updated. + // + // An empty updateMask is temporarily treated as using the following mask + // for backwards compatibility purposes: + // destination,filter,includeChildren + // At some point in the future, behavior will be removed and specifying an + // empty updateMask will be an error. + // + // For a detailed `FieldMask` definition, see + // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + // + // Example: `updateMask=filter`. + UpdateMask *google_protobuf6.FieldMask `protobuf:"bytes,4,opt,name=update_mask,json=updateMask" json:"update_mask,omitempty"` +} + +func (m *UpdateSinkRequest) Reset() { *m = UpdateSinkRequest{} } +func (m *UpdateSinkRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateSinkRequest) ProtoMessage() {} +func (*UpdateSinkRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{5} } + +func (m *UpdateSinkRequest) GetSinkName() string { + if m != nil { + return m.SinkName + } + return "" +} + +func (m *UpdateSinkRequest) GetSink() *LogSink { + if m != nil { + return m.Sink + } + return nil +} + +func (m *UpdateSinkRequest) GetUniqueWriterIdentity() bool { + if m != nil { + return m.UniqueWriterIdentity + } + return false +} + +func (m *UpdateSinkRequest) GetUpdateMask() *google_protobuf6.FieldMask { + if m != nil { + return m.UpdateMask + } + return nil +} + +// The parameters to `DeleteSink`. +type DeleteSinkRequest struct { + // Required. The full resource name of the sink to delete, including the + // parent resource and the sink identifier: + // + // "projects/[PROJECT_ID]/sinks/[SINK_ID]" + // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + // "folders/[FOLDER_ID]/sinks/[SINK_ID]" + // + // Example: `"projects/my-project-id/sinks/my-sink-id"`. + SinkName string `protobuf:"bytes,1,opt,name=sink_name,json=sinkName" json:"sink_name,omitempty"` +} + +func (m *DeleteSinkRequest) Reset() { *m = DeleteSinkRequest{} } +func (m *DeleteSinkRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteSinkRequest) ProtoMessage() {} +func (*DeleteSinkRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{6} } + +func (m *DeleteSinkRequest) GetSinkName() string { + if m != nil { + return m.SinkName + } + return "" +} + +// Specifies a set of log entries that are not to be stored in Stackdriver +// Logging. If your project receives a large volume of logs, you might be able +// to use exclusions to reduce your chargeable logs. Exclusions are processed +// after log sinks, so you can export log entries before they are excluded. +// Audit log entries and log entries from Amazon Web Services are never +// excluded. +type LogExclusion struct { + // Required. A client-assigned identifier, such as + // `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and + // can include only letters, digits, underscores, hyphens, and periods. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Optional. A description of this exclusion. + Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` + // Required. + // An [advanced logs filter](/logging/docs/view/advanced_filters) + // that matches the log entries to be excluded. By using the + // [sample function](/logging/docs/view/advanced_filters#sample), + // you can exclude less than 100% of the matching log entries. + // For example, the following filter matches 99% of low-severity log + // entries from load balancers: + // + // "resource.type=http_load_balancer severity=ERROR" + // + // The maximum length of the filter is 20000 characters. + Filter string `protobuf:"bytes,3,opt,name=filter" json:"filter,omitempty"` + // Optional. The metric descriptor associated with the logs-based metric. + // If unspecified, it uses a default metric descriptor with a DELTA metric + // kind, INT64 value type, with no labels and a unit of "1". Such a metric + // counts the number of log entries matching the `filter` expression. + // + // The `name`, `type`, and `description` fields in the `metric_descriptor` + // are output only, and is constructed using the `name` and `description` + // field in the LogMetric. + // + // To create a logs-based metric that records a distribution of log values, a + // DELTA metric kind with a DISTRIBUTION value type must be used along with + // a `value_extractor` expression in the LogMetric. + // + // Each label in the metric descriptor must have a matching label + // name as the key and an extractor expression as the value in the + // `label_extractors` map. + // + // The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot + // be updated once initially configured. New labels can be added in the + // `metric_descriptor`, but existing labels cannot be modified except for + // their description. + MetricDescriptor *google_api5.MetricDescriptor `protobuf:"bytes,5,opt,name=metric_descriptor,json=metricDescriptor" json:"metric_descriptor,omitempty"` + // Optional. A `value_extractor` is required when using a distribution + // logs-based metric to extract the values to record from a log entry. + // Two functions are supported for value extraction: `EXTRACT(field)` or + // `REGEXP_EXTRACT(field, regex)`. The argument are: + // 1. field: The name of the log entry field from which the value is to be + // extracted. + // 2. regex: A regular expression using the Google RE2 syntax + // (https://github.com/google/re2/wiki/Syntax) with a single capture + // group to extract data from the specified log entry field. The value + // of the field is converted to a string before applying the regex. + // It is an error to specify a regex that does not include exactly one + // capture group. + // + // The result of the extraction must be convertible to a double type, as the + // distribution always records double values. If either the extraction or + // the conversion to double fails, then those values are not recorded in the + // distribution. + // + // Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")` + ValueExtractor string `protobuf:"bytes,6,opt,name=value_extractor,json=valueExtractor" json:"value_extractor,omitempty"` + // Optional. A map from a label key string to an extractor expression which is + // used to extract data from a log entry field and assign as the label value. + // Each label key specified in the LabelDescriptor must have an associated + // extractor expression in this map. The syntax of the extractor expression + // is the same as for the `value_extractor` field. + // + // The extracted value is converted to the type defined in the label + // descriptor. If the either the extraction or the type conversion fails, + // the label will have a default value. The default value for a string + // label is an empty string, for an integer label its 0, and for a boolean + // label its `false`. + // + // Note that there are upper bounds on the maximum number of labels and the + // number of active time series that are allowed in a project. + LabelExtractors map[string]string `protobuf:"bytes,7,rep,name=label_extractors,json=labelExtractors" json:"label_extractors,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // Optional. The `bucket_options` are required when the logs-based metric is + // using a DISTRIBUTION value type and it describes the bucket boundaries + // used to create a histogram of the extracted values. + BucketOptions *google_api4.Distribution_BucketOptions `protobuf:"bytes,8,opt,name=bucket_options,json=bucketOptions" json:"bucket_options,omitempty"` + // Deprecated. The API version that created or updated this metric. + // The v2 format is used by default and cannot be changed. + Version LogMetric_ApiVersion `protobuf:"varint,4,opt,name=version,enum=google.logging.v2.LogMetric_ApiVersion" json:"version,omitempty"` +} + +func (m *LogMetric) Reset() { *m = LogMetric{} } +func (m *LogMetric) String() string { return proto.CompactTextString(m) } +func (*LogMetric) ProtoMessage() {} +func (*LogMetric) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} } + +func (m *LogMetric) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *LogMetric) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *LogMetric) GetFilter() string { + if m != nil { + return m.Filter + } + return "" +} + +func (m *LogMetric) GetMetricDescriptor() *google_api5.MetricDescriptor { + if m != nil { + return m.MetricDescriptor + } + return nil +} + +func (m *LogMetric) GetValueExtractor() string { + if m != nil { + return m.ValueExtractor + } + return "" +} + +func (m *LogMetric) GetLabelExtractors() map[string]string { + if m != nil { + return m.LabelExtractors + } + return nil +} + +func (m *LogMetric) GetBucketOptions() *google_api4.Distribution_BucketOptions { + if m != nil { + return m.BucketOptions + } + return nil +} + +func (m *LogMetric) GetVersion() LogMetric_ApiVersion { + if m != nil { + return m.Version + } + return LogMetric_V2 +} + +// The parameters to ListLogMetrics. +type ListLogMetricsRequest struct { + // Required. The name of the project containing the metrics: + // + // "projects/[PROJECT_ID]" + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // Optional. If present, then retrieve the next batch of results from the + // preceding call to this method. `pageToken` must be the value of + // `nextPageToken` from the previous response. The values of other method + // parameters should be identical to those in the previous call. + PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` + // Optional. The maximum number of results to return from this request. + // Non-positive values are ignored. The presence of `nextPageToken` in the + // response indicates that more results might be available. + PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` +} + +func (m *ListLogMetricsRequest) Reset() { *m = ListLogMetricsRequest{} } +func (m *ListLogMetricsRequest) String() string { return proto.CompactTextString(m) } +func (*ListLogMetricsRequest) ProtoMessage() {} +func (*ListLogMetricsRequest) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{1} } + +func (m *ListLogMetricsRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *ListLogMetricsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +func (m *ListLogMetricsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +// Result returned from ListLogMetrics. +type ListLogMetricsResponse struct { + // A list of logs-based metrics. + Metrics []*LogMetric `protobuf:"bytes,1,rep,name=metrics" json:"metrics,omitempty"` + // If there might be more results than appear in this response, then + // `nextPageToken` is included. To get the next set of results, call this + // method again using the value of `nextPageToken` as `pageToken`. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListLogMetricsResponse) Reset() { *m = ListLogMetricsResponse{} } +func (m *ListLogMetricsResponse) String() string { return proto.CompactTextString(m) } +func (*ListLogMetricsResponse) ProtoMessage() {} +func (*ListLogMetricsResponse) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{2} } + +func (m *ListLogMetricsResponse) GetMetrics() []*LogMetric { + if m != nil { + return m.Metrics + } + return nil +} + +func (m *ListLogMetricsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// The parameters to GetLogMetric. +type GetLogMetricRequest struct { + // The resource name of the desired metric: + // + // "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + MetricName string `protobuf:"bytes,1,opt,name=metric_name,json=metricName" json:"metric_name,omitempty"` +} + +func (m *GetLogMetricRequest) Reset() { *m = GetLogMetricRequest{} } +func (m *GetLogMetricRequest) String() string { return proto.CompactTextString(m) } +func (*GetLogMetricRequest) ProtoMessage() {} +func (*GetLogMetricRequest) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{3} } + +func (m *GetLogMetricRequest) GetMetricName() string { + if m != nil { + return m.MetricName + } + return "" +} + +// The parameters to CreateLogMetric. +type CreateLogMetricRequest struct { + // The resource name of the project in which to create the metric: + // + // "projects/[PROJECT_ID]" + // + // The new metric must be provided in the request. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // The new logs-based metric, which must not have an identifier that + // already exists. + Metric *LogMetric `protobuf:"bytes,2,opt,name=metric" json:"metric,omitempty"` +} + +func (m *CreateLogMetricRequest) Reset() { *m = CreateLogMetricRequest{} } +func (m *CreateLogMetricRequest) String() string { return proto.CompactTextString(m) } +func (*CreateLogMetricRequest) ProtoMessage() {} +func (*CreateLogMetricRequest) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{4} } + +func (m *CreateLogMetricRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *CreateLogMetricRequest) GetMetric() *LogMetric { + if m != nil { + return m.Metric + } + return nil +} + +// The parameters to UpdateLogMetric. +type UpdateLogMetricRequest struct { + // The resource name of the metric to update: + // + // "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + // + // The updated metric must be provided in the request and it's + // `name` field must be the same as `[METRIC_ID]` If the metric + // does not exist in `[PROJECT_ID]`, then a new metric is created. + MetricName string `protobuf:"bytes,1,opt,name=metric_name,json=metricName" json:"metric_name,omitempty"` + // The updated metric. + Metric *LogMetric `protobuf:"bytes,2,opt,name=metric" json:"metric,omitempty"` +} + +func (m *UpdateLogMetricRequest) Reset() { *m = UpdateLogMetricRequest{} } +func (m *UpdateLogMetricRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateLogMetricRequest) ProtoMessage() {} +func (*UpdateLogMetricRequest) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{5} } + +func (m *UpdateLogMetricRequest) GetMetricName() string { + if m != nil { + return m.MetricName + } + return "" +} + +func (m *UpdateLogMetricRequest) GetMetric() *LogMetric { + if m != nil { + return m.Metric + } + return nil +} + +// The parameters to DeleteLogMetric. +type DeleteLogMetricRequest struct { + // The resource name of the metric to delete: + // + // "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + MetricName string `protobuf:"bytes,1,opt,name=metric_name,json=metricName" json:"metric_name,omitempty"` +} + +func (m *DeleteLogMetricRequest) Reset() { *m = DeleteLogMetricRequest{} } +func (m *DeleteLogMetricRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteLogMetricRequest) ProtoMessage() {} +func (*DeleteLogMetricRequest) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{6} } + +func (m *DeleteLogMetricRequest) GetMetricName() string { + if m != nil { + return m.MetricName + } + return "" +} + +func init() { + proto.RegisterType((*LogMetric)(nil), "google.logging.v2.LogMetric") + proto.RegisterType((*ListLogMetricsRequest)(nil), "google.logging.v2.ListLogMetricsRequest") + proto.RegisterType((*ListLogMetricsResponse)(nil), "google.logging.v2.ListLogMetricsResponse") + proto.RegisterType((*GetLogMetricRequest)(nil), "google.logging.v2.GetLogMetricRequest") + proto.RegisterType((*CreateLogMetricRequest)(nil), "google.logging.v2.CreateLogMetricRequest") + proto.RegisterType((*UpdateLogMetricRequest)(nil), "google.logging.v2.UpdateLogMetricRequest") + proto.RegisterType((*DeleteLogMetricRequest)(nil), "google.logging.v2.DeleteLogMetricRequest") + proto.RegisterEnum("google.logging.v2.LogMetric_ApiVersion", LogMetric_ApiVersion_name, LogMetric_ApiVersion_value) +} + +// 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 + +// Client API for MetricsServiceV2 service + +type MetricsServiceV2Client interface { + // Lists logs-based metrics. + ListLogMetrics(ctx context.Context, in *ListLogMetricsRequest, opts ...grpc.CallOption) (*ListLogMetricsResponse, error) + // Gets a logs-based metric. + GetLogMetric(ctx context.Context, in *GetLogMetricRequest, opts ...grpc.CallOption) (*LogMetric, error) + // Creates a logs-based metric. + CreateLogMetric(ctx context.Context, in *CreateLogMetricRequest, opts ...grpc.CallOption) (*LogMetric, error) + // Creates or updates a logs-based metric. + UpdateLogMetric(ctx context.Context, in *UpdateLogMetricRequest, opts ...grpc.CallOption) (*LogMetric, error) + // Deletes a logs-based metric. + DeleteLogMetric(ctx context.Context, in *DeleteLogMetricRequest, opts ...grpc.CallOption) (*google_protobuf5.Empty, error) +} + +type metricsServiceV2Client struct { + cc *grpc.ClientConn +} + +func NewMetricsServiceV2Client(cc *grpc.ClientConn) MetricsServiceV2Client { + return &metricsServiceV2Client{cc} +} + +func (c *metricsServiceV2Client) ListLogMetrics(ctx context.Context, in *ListLogMetricsRequest, opts ...grpc.CallOption) (*ListLogMetricsResponse, error) { + out := new(ListLogMetricsResponse) + err := grpc.Invoke(ctx, "/google.logging.v2.MetricsServiceV2/ListLogMetrics", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *metricsServiceV2Client) GetLogMetric(ctx context.Context, in *GetLogMetricRequest, opts ...grpc.CallOption) (*LogMetric, error) { + out := new(LogMetric) + err := grpc.Invoke(ctx, "/google.logging.v2.MetricsServiceV2/GetLogMetric", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *metricsServiceV2Client) CreateLogMetric(ctx context.Context, in *CreateLogMetricRequest, opts ...grpc.CallOption) (*LogMetric, error) { + out := new(LogMetric) + err := grpc.Invoke(ctx, "/google.logging.v2.MetricsServiceV2/CreateLogMetric", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *metricsServiceV2Client) UpdateLogMetric(ctx context.Context, in *UpdateLogMetricRequest, opts ...grpc.CallOption) (*LogMetric, error) { + out := new(LogMetric) + err := grpc.Invoke(ctx, "/google.logging.v2.MetricsServiceV2/UpdateLogMetric", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *metricsServiceV2Client) DeleteLogMetric(ctx context.Context, in *DeleteLogMetricRequest, opts ...grpc.CallOption) (*google_protobuf5.Empty, error) { + out := new(google_protobuf5.Empty) + err := grpc.Invoke(ctx, "/google.logging.v2.MetricsServiceV2/DeleteLogMetric", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for MetricsServiceV2 service + +type MetricsServiceV2Server interface { + // Lists logs-based metrics. + ListLogMetrics(context.Context, *ListLogMetricsRequest) (*ListLogMetricsResponse, error) + // Gets a logs-based metric. + GetLogMetric(context.Context, *GetLogMetricRequest) (*LogMetric, error) + // Creates a logs-based metric. + CreateLogMetric(context.Context, *CreateLogMetricRequest) (*LogMetric, error) + // Creates or updates a logs-based metric. + UpdateLogMetric(context.Context, *UpdateLogMetricRequest) (*LogMetric, error) + // Deletes a logs-based metric. + DeleteLogMetric(context.Context, *DeleteLogMetricRequest) (*google_protobuf5.Empty, error) +} + +func RegisterMetricsServiceV2Server(s *grpc.Server, srv MetricsServiceV2Server) { + s.RegisterService(&_MetricsServiceV2_serviceDesc, srv) +} + +func _MetricsServiceV2_ListLogMetrics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListLogMetricsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetricsServiceV2Server).ListLogMetrics(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.logging.v2.MetricsServiceV2/ListLogMetrics", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetricsServiceV2Server).ListLogMetrics(ctx, req.(*ListLogMetricsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MetricsServiceV2_GetLogMetric_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetLogMetricRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetricsServiceV2Server).GetLogMetric(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.logging.v2.MetricsServiceV2/GetLogMetric", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetricsServiceV2Server).GetLogMetric(ctx, req.(*GetLogMetricRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MetricsServiceV2_CreateLogMetric_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateLogMetricRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetricsServiceV2Server).CreateLogMetric(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.logging.v2.MetricsServiceV2/CreateLogMetric", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetricsServiceV2Server).CreateLogMetric(ctx, req.(*CreateLogMetricRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MetricsServiceV2_UpdateLogMetric_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateLogMetricRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetricsServiceV2Server).UpdateLogMetric(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.logging.v2.MetricsServiceV2/UpdateLogMetric", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetricsServiceV2Server).UpdateLogMetric(ctx, req.(*UpdateLogMetricRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MetricsServiceV2_DeleteLogMetric_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteLogMetricRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetricsServiceV2Server).DeleteLogMetric(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.logging.v2.MetricsServiceV2/DeleteLogMetric", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetricsServiceV2Server).DeleteLogMetric(ctx, req.(*DeleteLogMetricRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _MetricsServiceV2_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.logging.v2.MetricsServiceV2", + HandlerType: (*MetricsServiceV2Server)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListLogMetrics", + Handler: _MetricsServiceV2_ListLogMetrics_Handler, + }, + { + MethodName: "GetLogMetric", + Handler: _MetricsServiceV2_GetLogMetric_Handler, + }, + { + MethodName: "CreateLogMetric", + Handler: _MetricsServiceV2_CreateLogMetric_Handler, + }, + { + MethodName: "UpdateLogMetric", + Handler: _MetricsServiceV2_UpdateLogMetric_Handler, + }, + { + MethodName: "DeleteLogMetric", + Handler: _MetricsServiceV2_DeleteLogMetric_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/logging/v2/logging_metrics.proto", +} + +func init() { proto.RegisterFile("google/logging/v2/logging_metrics.proto", fileDescriptor3) } + +var fileDescriptor3 = []byte{ + // 846 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xc1, 0x6e, 0xdb, 0x46, + 0x10, 0xed, 0xca, 0xb6, 0x1c, 0x8f, 0x1b, 0x4b, 0xd9, 0x24, 0x8a, 0xa0, 0x38, 0x88, 0xca, 0x83, + 0xa5, 0xf8, 0x40, 0x36, 0x6c, 0x61, 0xa4, 0x29, 0x7a, 0x88, 0x62, 0x23, 0x28, 0xa0, 0xb4, 0x06, + 0xd3, 0xea, 0x50, 0x08, 0x20, 0x28, 0x69, 0x44, 0x6c, 0x45, 0x71, 0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86, 0x4a, 0x85, 0x95, 0x42, 0x5e, 0xc4, 0x44, 0xee, 0xc7, 0xc4, 0x97, 0xfa, 0xf8, + 0x1f, 0x21, 0x7f, 0x96, 0xee, 0xbd, 0x48, 0xab, 0x9f, 0x07, 0x7c, 0x36, 0x32, 0x35, 0x83, 0xd9, + 0xb3, 0xff, 0xca, 0x90, 0xbe, 0x42, 0xfa, 0x1a, 0xe9, 0xf7, 0xec, 0x41, 0x59, 0xbd, 0xfd, 0xd9, + 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0xf7, 0xb9, 0xb3, 0xe4, 0xa7, 0x08, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/longrunning/operations.pb.go b/vendor/google.golang.org/genproto/googleapis/longrunning/operations.pb.go new file mode 100644 index 0000000000..913607f3ce --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/longrunning/operations.pb.go @@ -0,0 +1,597 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/longrunning/operations.proto + +/* +Package longrunning is a generated protocol buffer package. + +It is generated from these files: + google/longrunning/operations.proto + +It has these top-level messages: + Operation + GetOperationRequest + ListOperationsRequest + ListOperationsResponse + CancelOperationRequest + DeleteOperationRequest +*/ +package longrunning + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf1 "github.com/golang/protobuf/ptypes/any" +import google_protobuf2 "github.com/golang/protobuf/ptypes/empty" +import google_rpc "google.golang.org/genproto/googleapis/rpc/status" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// This resource represents a long-running operation that is the result of a +// network API call. +type Operation struct { + // The server-assigned name, which is only unique within the same service that + // originally returns it. If you use the default HTTP mapping, the + // `name` should have the format of `operations/some/unique/name`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Service-specific metadata associated with the operation. It typically + // contains progress information and common metadata such as create time. + // Some services might not provide such metadata. Any method that returns a + // long-running operation should document the metadata type, if any. + Metadata *google_protobuf1.Any `protobuf:"bytes,2,opt,name=metadata" json:"metadata,omitempty"` + // If the value is `false`, it means the operation is still in progress. + // If true, the operation is completed, and either `error` or `response` is + // available. + Done bool `protobuf:"varint,3,opt,name=done" json:"done,omitempty"` + // The operation result, which can be either an `error` or a valid `response`. + // If `done` == `false`, neither `error` nor `response` is set. + // If `done` == `true`, exactly one of `error` or `response` is set. + // + // Types that are valid to be assigned to Result: + // *Operation_Error + // *Operation_Response + Result isOperation_Result `protobuf_oneof:"result"` +} + +func (m *Operation) Reset() { *m = Operation{} } +func (m *Operation) String() string { return proto.CompactTextString(m) } +func (*Operation) ProtoMessage() {} +func (*Operation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +type isOperation_Result interface { + isOperation_Result() +} + +type Operation_Error struct { + Error *google_rpc.Status `protobuf:"bytes,4,opt,name=error,oneof"` +} +type Operation_Response struct { + Response *google_protobuf1.Any `protobuf:"bytes,5,opt,name=response,oneof"` +} + +func (*Operation_Error) isOperation_Result() {} +func (*Operation_Response) isOperation_Result() {} + +func (m *Operation) GetResult() isOperation_Result { + if m != nil { + return m.Result + } + return nil +} + +func (m *Operation) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Operation) GetMetadata() *google_protobuf1.Any { + if m != nil { + return m.Metadata + } + return nil +} + +func (m *Operation) GetDone() bool { + if m != nil { + return m.Done + } + return false +} + +func (m *Operation) GetError() *google_rpc.Status { + if x, ok := m.GetResult().(*Operation_Error); ok { + return x.Error + } + return nil +} + +func (m *Operation) GetResponse() *google_protobuf1.Any { + if x, ok := m.GetResult().(*Operation_Response); ok { + return x.Response + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Operation) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _Operation_OneofMarshaler, _Operation_OneofUnmarshaler, _Operation_OneofSizer, []interface{}{ + (*Operation_Error)(nil), + (*Operation_Response)(nil), + } +} + +func _Operation_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Operation) + // result + switch x := m.Result.(type) { + case *Operation_Error: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Error); err != nil { + return err + } + case *Operation_Response: + b.EncodeVarint(5<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Response); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("Operation.Result has unexpected type %T", x) + } + return nil +} + +func _Operation_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Operation) + switch tag { + case 4: // result.error + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(google_rpc.Status) + err := b.DecodeMessage(msg) + m.Result = &Operation_Error{msg} + return true, err + case 5: // result.response + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(google_protobuf1.Any) + err := b.DecodeMessage(msg) + m.Result = &Operation_Response{msg} + return true, err + default: + return false, nil + } +} + +func _Operation_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Operation) + // result + switch x := m.Result.(type) { + case *Operation_Error: + s := proto.Size(x.Error) + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Operation_Response: + s := proto.Size(x.Response) + n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// The request message for [Operations.GetOperation][google.longrunning.Operations.GetOperation]. +type GetOperationRequest struct { + // The name of the operation resource. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetOperationRequest) Reset() { *m = GetOperationRequest{} } +func (m *GetOperationRequest) String() string { return proto.CompactTextString(m) } +func (*GetOperationRequest) ProtoMessage() {} +func (*GetOperationRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *GetOperationRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// The request message for [Operations.ListOperations][google.longrunning.Operations.ListOperations]. +type ListOperationsRequest struct { + // The name of the operation collection. + Name string `protobuf:"bytes,4,opt,name=name" json:"name,omitempty"` + // The standard list filter. + Filter string `protobuf:"bytes,1,opt,name=filter" json:"filter,omitempty"` + // The standard list page size. + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // The standard list page token. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListOperationsRequest) Reset() { *m = ListOperationsRequest{} } +func (m *ListOperationsRequest) String() string { return proto.CompactTextString(m) } +func (*ListOperationsRequest) ProtoMessage() {} +func (*ListOperationsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *ListOperationsRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ListOperationsRequest) GetFilter() string { + if m != nil { + return m.Filter + } + return "" +} + +func (m *ListOperationsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListOperationsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// The response message for [Operations.ListOperations][google.longrunning.Operations.ListOperations]. +type ListOperationsResponse struct { + // A list of operations that matches the specified filter in the request. + Operations []*Operation `protobuf:"bytes,1,rep,name=operations" json:"operations,omitempty"` + // The standard List next-page token. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListOperationsResponse) Reset() { *m = ListOperationsResponse{} } +func (m *ListOperationsResponse) String() string { return proto.CompactTextString(m) } +func (*ListOperationsResponse) ProtoMessage() {} +func (*ListOperationsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *ListOperationsResponse) GetOperations() []*Operation { + if m != nil { + return m.Operations + } + return nil +} + +func (m *ListOperationsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// The request message for [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]. +type CancelOperationRequest struct { + // The name of the operation resource to be cancelled. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *CancelOperationRequest) Reset() { *m = CancelOperationRequest{} } +func (m *CancelOperationRequest) String() string { return proto.CompactTextString(m) } +func (*CancelOperationRequest) ProtoMessage() {} +func (*CancelOperationRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *CancelOperationRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// The request message for [Operations.DeleteOperation][google.longrunning.Operations.DeleteOperation]. +type DeleteOperationRequest struct { + // The name of the operation resource to be deleted. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *DeleteOperationRequest) Reset() { *m = DeleteOperationRequest{} } +func (m *DeleteOperationRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteOperationRequest) ProtoMessage() {} +func (*DeleteOperationRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *DeleteOperationRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func init() { + proto.RegisterType((*Operation)(nil), "google.longrunning.Operation") + proto.RegisterType((*GetOperationRequest)(nil), "google.longrunning.GetOperationRequest") + proto.RegisterType((*ListOperationsRequest)(nil), "google.longrunning.ListOperationsRequest") + proto.RegisterType((*ListOperationsResponse)(nil), "google.longrunning.ListOperationsResponse") + proto.RegisterType((*CancelOperationRequest)(nil), "google.longrunning.CancelOperationRequest") + proto.RegisterType((*DeleteOperationRequest)(nil), "google.longrunning.DeleteOperationRequest") +} + +// 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 + +// Client API for Operations service + +type OperationsClient interface { + // Lists operations that match the specified filter in the request. If the + // server doesn't support this method, it returns `UNIMPLEMENTED`. + // + // NOTE: the `name` binding below allows API services to override the binding + // to use different resource name schemes, such as `users/*/operations`. + ListOperations(ctx context.Context, in *ListOperationsRequest, opts ...grpc.CallOption) (*ListOperationsResponse, error) + // Gets the latest state of a long-running operation. Clients can use this + // method to poll the operation result at intervals as recommended by the API + // service. + GetOperation(ctx context.Context, in *GetOperationRequest, opts ...grpc.CallOption) (*Operation, error) + // Deletes a long-running operation. This method indicates that the client is + // no longer interested in the operation result. It does not cancel the + // operation. If the server doesn't support this method, it returns + // `google.rpc.Code.UNIMPLEMENTED`. + DeleteOperation(ctx context.Context, in *DeleteOperationRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) + // Starts asynchronous cancellation on a long-running operation. The server + // makes a best effort to cancel the operation, but success is not + // guaranteed. If the server doesn't support this method, it returns + // `google.rpc.Code.UNIMPLEMENTED`. Clients can use + // [Operations.GetOperation][google.longrunning.Operations.GetOperation] or + // other methods to check whether the cancellation succeeded or whether the + // operation completed despite cancellation. On successful cancellation, + // the operation is not deleted; instead, it becomes an operation with + // an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`. + CancelOperation(ctx context.Context, in *CancelOperationRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) +} + +type operationsClient struct { + cc *grpc.ClientConn +} + +func NewOperationsClient(cc *grpc.ClientConn) OperationsClient { + return &operationsClient{cc} +} + +func (c *operationsClient) ListOperations(ctx context.Context, in *ListOperationsRequest, opts ...grpc.CallOption) (*ListOperationsResponse, error) { + out := new(ListOperationsResponse) + err := grpc.Invoke(ctx, "/google.longrunning.Operations/ListOperations", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *operationsClient) GetOperation(ctx context.Context, in *GetOperationRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := grpc.Invoke(ctx, "/google.longrunning.Operations/GetOperation", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *operationsClient) DeleteOperation(ctx context.Context, in *DeleteOperationRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) { + out := new(google_protobuf2.Empty) + err := grpc.Invoke(ctx, "/google.longrunning.Operations/DeleteOperation", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *operationsClient) CancelOperation(ctx context.Context, in *CancelOperationRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) { + out := new(google_protobuf2.Empty) + err := grpc.Invoke(ctx, "/google.longrunning.Operations/CancelOperation", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for Operations service + +type OperationsServer interface { + // Lists operations that match the specified filter in the request. If the + // server doesn't support this method, it returns `UNIMPLEMENTED`. + // + // NOTE: the `name` binding below allows API services to override the binding + // to use different resource name schemes, such as `users/*/operations`. + ListOperations(context.Context, *ListOperationsRequest) (*ListOperationsResponse, error) + // Gets the latest state of a long-running operation. Clients can use this + // method to poll the operation result at intervals as recommended by the API + // service. + GetOperation(context.Context, *GetOperationRequest) (*Operation, error) + // Deletes a long-running operation. This method indicates that the client is + // no longer interested in the operation result. It does not cancel the + // operation. If the server doesn't support this method, it returns + // `google.rpc.Code.UNIMPLEMENTED`. + DeleteOperation(context.Context, *DeleteOperationRequest) (*google_protobuf2.Empty, error) + // Starts asynchronous cancellation on a long-running operation. The server + // makes a best effort to cancel the operation, but success is not + // guaranteed. If the server doesn't support this method, it returns + // `google.rpc.Code.UNIMPLEMENTED`. Clients can use + // [Operations.GetOperation][google.longrunning.Operations.GetOperation] or + // other methods to check whether the cancellation succeeded or whether the + // operation completed despite cancellation. On successful cancellation, + // the operation is not deleted; instead, it becomes an operation with + // an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`. + CancelOperation(context.Context, *CancelOperationRequest) (*google_protobuf2.Empty, error) +} + +func RegisterOperationsServer(s *grpc.Server, srv OperationsServer) { + s.RegisterService(&_Operations_serviceDesc, srv) +} + +func _Operations_ListOperations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListOperationsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OperationsServer).ListOperations(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.longrunning.Operations/ListOperations", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OperationsServer).ListOperations(ctx, req.(*ListOperationsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Operations_GetOperation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetOperationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OperationsServer).GetOperation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.longrunning.Operations/GetOperation", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OperationsServer).GetOperation(ctx, req.(*GetOperationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Operations_DeleteOperation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteOperationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OperationsServer).DeleteOperation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.longrunning.Operations/DeleteOperation", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OperationsServer).DeleteOperation(ctx, req.(*DeleteOperationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Operations_CancelOperation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CancelOperationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OperationsServer).CancelOperation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.longrunning.Operations/CancelOperation", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OperationsServer).CancelOperation(ctx, req.(*CancelOperationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Operations_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.longrunning.Operations", + HandlerType: (*OperationsServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListOperations", + Handler: _Operations_ListOperations_Handler, + }, + { + MethodName: "GetOperation", + Handler: _Operations_GetOperation_Handler, + }, + { + MethodName: "DeleteOperation", + Handler: _Operations_DeleteOperation_Handler, + }, + { + MethodName: "CancelOperation", + Handler: _Operations_CancelOperation_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/longrunning/operations.proto", +} + +func init() { proto.RegisterFile("google/longrunning/operations.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 597 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xc1, 0x6e, 0xd3, 0x4c, + 0x10, 0xae, 0xd3, 0xb4, 0x4a, 0xa6, 0xff, 0x4f, 0xa4, 0x85, 0xba, 0xc6, 0x25, 0x22, 0x32, 0x08, + 0x52, 0xab, 0xb2, 0x21, 0xdc, 0x8a, 0x72, 0x20, 0x80, 0xda, 0x43, 0x25, 0x22, 0x97, 0x13, 0x42, + 0xaa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+} diff --git a/vendor/google.golang.org/genproto/googleapis/monitoring/v3/common.pb.go b/vendor/google.golang.org/genproto/googleapis/monitoring/v3/common.pb.go new file mode 100644 index 0000000000..92254e55cb --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/monitoring/v3/common.pb.go @@ -0,0 +1,702 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/monitoring/v3/common.proto + +/* +Package monitoring is a generated protocol buffer package. + +It is generated from these files: + google/monitoring/v3/common.proto + google/monitoring/v3/group.proto + google/monitoring/v3/group_service.proto + google/monitoring/v3/metric.proto + google/monitoring/v3/metric_service.proto + +It has these top-level messages: + TypedValue + TimeInterval + Aggregation + Group + ListGroupsRequest + ListGroupsResponse + GetGroupRequest + CreateGroupRequest + UpdateGroupRequest + DeleteGroupRequest + ListGroupMembersRequest + ListGroupMembersResponse + Point + TimeSeries + ListMonitoredResourceDescriptorsRequest + ListMonitoredResourceDescriptorsResponse + GetMonitoredResourceDescriptorRequest + ListMetricDescriptorsRequest + ListMetricDescriptorsResponse + GetMetricDescriptorRequest + CreateMetricDescriptorRequest + DeleteMetricDescriptorRequest + ListTimeSeriesRequest + ListTimeSeriesResponse + CreateTimeSeriesRequest + CreateTimeSeriesError +*/ +package monitoring + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import google_api2 "google.golang.org/genproto/googleapis/api/distribution" +import google_protobuf3 "github.com/golang/protobuf/ptypes/duration" +import google_protobuf2 "github.com/golang/protobuf/ptypes/timestamp" + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// The Aligner describes how to bring the data points in a single +// time series into temporal alignment. +type Aggregation_Aligner int32 + +const ( + // No alignment. Raw data is returned. Not valid if cross-time + // series reduction is requested. The value type of the result is + // the same as the value type of the input. + Aggregation_ALIGN_NONE Aggregation_Aligner = 0 + // Align and convert to delta metric type. This alignment is valid + // for cumulative metrics and delta metrics. Aligning an existing + // delta metric to a delta metric requires that the alignment + // period be increased. The value type of the result is the same + // as the value type of the input. + Aggregation_ALIGN_DELTA Aggregation_Aligner = 1 + // Align and convert to a rate. This alignment is valid for + // cumulative metrics and delta metrics with numeric values. The output is a + // gauge metric with value type + // [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE]. + Aggregation_ALIGN_RATE Aggregation_Aligner = 2 + // Align by interpolating between adjacent points around the + // period boundary. This alignment is valid for gauge + // metrics with numeric values. The value type of the result is the same + // as the value type of the input. + Aggregation_ALIGN_INTERPOLATE Aggregation_Aligner = 3 + // Align by shifting the oldest data point before the period + // boundary to the boundary. This alignment is valid for gauge + // metrics. The value type of the result is the same as the + // value type of the input. + Aggregation_ALIGN_NEXT_OLDER Aggregation_Aligner = 4 + // Align time series via aggregation. The resulting data point in + // the alignment period is the minimum of all data points in the + // period. This alignment is valid for gauge and delta metrics with numeric + // values. The value type of the result is the same as the value + // type of the input. + Aggregation_ALIGN_MIN Aggregation_Aligner = 10 + // Align time series via aggregation. The resulting data point in + // the alignment period is the maximum of all data points in the + // period. This alignment is valid for gauge and delta metrics with numeric + // values. The value type of the result is the same as the value + // type of the input. + Aggregation_ALIGN_MAX Aggregation_Aligner = 11 + // Align time series via aggregation. The resulting data point in + // the alignment period is the average or arithmetic mean of all + // data points in the period. This alignment is valid for gauge and delta + // metrics with numeric values. The value type of the output is + // [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE]. + Aggregation_ALIGN_MEAN Aggregation_Aligner = 12 + // Align time series via aggregation. The resulting data point in + // the alignment period is the count of all data points in the + // period. This alignment is valid for gauge and delta metrics with numeric + // or Boolean values. The value type of the output is + // [INT64][google.api.MetricDescriptor.ValueType.INT64]. + Aggregation_ALIGN_COUNT Aggregation_Aligner = 13 + // Align time series via aggregation. The resulting data point in + // the alignment period is the sum of all data points in the + // period. This alignment is valid for gauge and delta metrics with numeric + // and distribution values. The value type of the output is the + // same as the value type of the input. + Aggregation_ALIGN_SUM Aggregation_Aligner = 14 + // Align time series via aggregation. The resulting data point in + // the alignment period is the standard deviation of all data + // points in the period. This alignment is valid for gauge and delta metrics + // with numeric values. The value type of the output is + // [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE]. + Aggregation_ALIGN_STDDEV Aggregation_Aligner = 15 + // Align time series via aggregation. The resulting data point in + // the alignment period is the count of True-valued data points in the + // period. This alignment is valid for gauge metrics with + // Boolean values. The value type of the output is + // [INT64][google.api.MetricDescriptor.ValueType.INT64]. + Aggregation_ALIGN_COUNT_TRUE Aggregation_Aligner = 16 + // Align time series via aggregation. The resulting data point in + // the alignment period is the fraction of True-valued data points in the + // period. This alignment is valid for gauge metrics with Boolean values. + // The output value is in the range [0, 1] and has value type + // [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE]. + Aggregation_ALIGN_FRACTION_TRUE Aggregation_Aligner = 17 + // Align time series via aggregation. The resulting data point in + // the alignment period is the 99th percentile of all data + // points in the period. This alignment is valid for gauge and delta metrics + // with distribution values. The output is a gauge metric with value type + // [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE]. + Aggregation_ALIGN_PERCENTILE_99 Aggregation_Aligner = 18 + // Align time series via aggregation. The resulting data point in + // the alignment period is the 95th percentile of all data + // points in the period. This alignment is valid for gauge and delta metrics + // with distribution values. The output is a gauge metric with value type + // [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE]. + Aggregation_ALIGN_PERCENTILE_95 Aggregation_Aligner = 19 + // Align time series via aggregation. The resulting data point in + // the alignment period is the 50th percentile of all data + // points in the period. This alignment is valid for gauge and delta metrics + // with distribution values. The output is a gauge metric with value type + // [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE]. + Aggregation_ALIGN_PERCENTILE_50 Aggregation_Aligner = 20 + // Align time series via aggregation. The resulting data point in + // the alignment period is the 5th percentile of all data + // points in the period. This alignment is valid for gauge and delta metrics + // with distribution values. The output is a gauge metric with value type + // [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE]. + Aggregation_ALIGN_PERCENTILE_05 Aggregation_Aligner = 21 +) + +var Aggregation_Aligner_name = map[int32]string{ + 0: "ALIGN_NONE", + 1: "ALIGN_DELTA", + 2: "ALIGN_RATE", + 3: "ALIGN_INTERPOLATE", + 4: "ALIGN_NEXT_OLDER", + 10: "ALIGN_MIN", + 11: "ALIGN_MAX", + 12: "ALIGN_MEAN", + 13: "ALIGN_COUNT", + 14: "ALIGN_SUM", + 15: "ALIGN_STDDEV", + 16: "ALIGN_COUNT_TRUE", + 17: "ALIGN_FRACTION_TRUE", + 18: "ALIGN_PERCENTILE_99", + 19: "ALIGN_PERCENTILE_95", + 20: "ALIGN_PERCENTILE_50", + 21: "ALIGN_PERCENTILE_05", +} +var Aggregation_Aligner_value = map[string]int32{ + "ALIGN_NONE": 0, + "ALIGN_DELTA": 1, + "ALIGN_RATE": 2, + "ALIGN_INTERPOLATE": 3, + "ALIGN_NEXT_OLDER": 4, + "ALIGN_MIN": 10, + "ALIGN_MAX": 11, + "ALIGN_MEAN": 12, + "ALIGN_COUNT": 13, + "ALIGN_SUM": 14, + "ALIGN_STDDEV": 15, + "ALIGN_COUNT_TRUE": 16, + "ALIGN_FRACTION_TRUE": 17, + "ALIGN_PERCENTILE_99": 18, + "ALIGN_PERCENTILE_95": 19, + "ALIGN_PERCENTILE_50": 20, + "ALIGN_PERCENTILE_05": 21, +} + +func (x Aggregation_Aligner) String() string { + return proto.EnumName(Aggregation_Aligner_name, int32(x)) +} +func (Aggregation_Aligner) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{2, 0} } + +// A Reducer describes how to aggregate data points from multiple +// time series into a single time series. +type Aggregation_Reducer int32 + +const ( + // No cross-time series reduction. The output of the aligner is + // returned. + Aggregation_REDUCE_NONE Aggregation_Reducer = 0 + // Reduce by computing the mean across time series for each + // alignment period. This reducer is valid for delta and + // gauge metrics with numeric or distribution values. The value type of the + // output is [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE]. + Aggregation_REDUCE_MEAN Aggregation_Reducer = 1 + // Reduce by computing the minimum across time series for each + // alignment period. This reducer is valid for delta and + // gauge metrics with numeric values. The value type of the output + // is the same as the value type of the input. + Aggregation_REDUCE_MIN Aggregation_Reducer = 2 + // Reduce by computing the maximum across time series for each + // alignment period. This reducer is valid for delta and + // gauge metrics with numeric values. The value type of the output + // is the same as the value type of the input. + Aggregation_REDUCE_MAX Aggregation_Reducer = 3 + // Reduce by computing the sum across time series for each + // alignment period. This reducer is valid for delta and + // gauge metrics with numeric and distribution values. The value type of + // the output is the same as the value type of the input. + Aggregation_REDUCE_SUM Aggregation_Reducer = 4 + // Reduce by computing the standard deviation across time series + // for each alignment period. This reducer is valid for delta + // and gauge metrics with numeric or distribution values. The value type of + // the output is [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE]. + Aggregation_REDUCE_STDDEV Aggregation_Reducer = 5 + // Reduce by computing the count of data points across time series + // for each alignment period. This reducer is valid for delta + // and gauge metrics of numeric, Boolean, distribution, and string value + // type. The value type of the output is + // [INT64][google.api.MetricDescriptor.ValueType.INT64]. + Aggregation_REDUCE_COUNT Aggregation_Reducer = 6 + // Reduce by computing the count of True-valued data points across time + // series for each alignment period. This reducer is valid for delta + // and gauge metrics of Boolean value type. The value type of + // the output is [INT64][google.api.MetricDescriptor.ValueType.INT64]. + Aggregation_REDUCE_COUNT_TRUE Aggregation_Reducer = 7 + // Reduce by computing the fraction of True-valued data points across time + // series for each alignment period. This reducer is valid for delta + // and gauge metrics of Boolean value type. The output value is in the + // range [0, 1] and has value type + // [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE]. + Aggregation_REDUCE_FRACTION_TRUE Aggregation_Reducer = 8 + // Reduce by computing 99th percentile of data points across time series + // for each alignment period. This reducer is valid for gauge and delta + // metrics of numeric and distribution type. The value of the output is + // [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE] + Aggregation_REDUCE_PERCENTILE_99 Aggregation_Reducer = 9 + // Reduce by computing 95th percentile of data points across time series + // for each alignment period. This reducer is valid for gauge and delta + // metrics of numeric and distribution type. The value of the output is + // [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE] + Aggregation_REDUCE_PERCENTILE_95 Aggregation_Reducer = 10 + // Reduce by computing 50th percentile of data points across time series + // for each alignment period. This reducer is valid for gauge and delta + // metrics of numeric and distribution type. The value of the output is + // [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE] + Aggregation_REDUCE_PERCENTILE_50 Aggregation_Reducer = 11 + // Reduce by computing 5th percentile of data points across time series + // for each alignment period. This reducer is valid for gauge and delta + // metrics of numeric and distribution type. The value of the output is + // [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE] + Aggregation_REDUCE_PERCENTILE_05 Aggregation_Reducer = 12 +) + +var Aggregation_Reducer_name = map[int32]string{ + 0: "REDUCE_NONE", + 1: "REDUCE_MEAN", + 2: "REDUCE_MIN", + 3: "REDUCE_MAX", + 4: "REDUCE_SUM", + 5: "REDUCE_STDDEV", + 6: "REDUCE_COUNT", + 7: "REDUCE_COUNT_TRUE", + 8: "REDUCE_FRACTION_TRUE", + 9: "REDUCE_PERCENTILE_99", + 10: "REDUCE_PERCENTILE_95", + 11: "REDUCE_PERCENTILE_50", + 12: "REDUCE_PERCENTILE_05", +} +var Aggregation_Reducer_value = map[string]int32{ + "REDUCE_NONE": 0, + "REDUCE_MEAN": 1, + "REDUCE_MIN": 2, + "REDUCE_MAX": 3, + "REDUCE_SUM": 4, + "REDUCE_STDDEV": 5, + "REDUCE_COUNT": 6, + "REDUCE_COUNT_TRUE": 7, + "REDUCE_FRACTION_TRUE": 8, + "REDUCE_PERCENTILE_99": 9, + "REDUCE_PERCENTILE_95": 10, + "REDUCE_PERCENTILE_50": 11, + "REDUCE_PERCENTILE_05": 12, +} + +func (x Aggregation_Reducer) String() string { + return proto.EnumName(Aggregation_Reducer_name, int32(x)) +} +func (Aggregation_Reducer) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{2, 1} } + +// A single strongly-typed value. +type TypedValue struct { + // The typed value field. + // + // Types that are valid to be assigned to Value: + // *TypedValue_BoolValue + // *TypedValue_Int64Value + // *TypedValue_DoubleValue + // *TypedValue_StringValue + // *TypedValue_DistributionValue + Value isTypedValue_Value `protobuf_oneof:"value"` +} + +func (m *TypedValue) Reset() { *m = TypedValue{} } +func (m *TypedValue) String() string { return proto.CompactTextString(m) } +func (*TypedValue) ProtoMessage() {} +func (*TypedValue) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +type isTypedValue_Value interface { + isTypedValue_Value() +} + +type TypedValue_BoolValue struct { + BoolValue bool `protobuf:"varint,1,opt,name=bool_value,json=boolValue,oneof"` +} +type TypedValue_Int64Value struct { + Int64Value int64 `protobuf:"varint,2,opt,name=int64_value,json=int64Value,oneof"` +} +type TypedValue_DoubleValue struct { + DoubleValue float64 `protobuf:"fixed64,3,opt,name=double_value,json=doubleValue,oneof"` +} +type TypedValue_StringValue struct { + StringValue string `protobuf:"bytes,4,opt,name=string_value,json=stringValue,oneof"` +} +type TypedValue_DistributionValue struct { + DistributionValue *google_api2.Distribution `protobuf:"bytes,5,opt,name=distribution_value,json=distributionValue,oneof"` +} + +func (*TypedValue_BoolValue) isTypedValue_Value() {} +func (*TypedValue_Int64Value) isTypedValue_Value() {} +func (*TypedValue_DoubleValue) isTypedValue_Value() {} +func (*TypedValue_StringValue) isTypedValue_Value() {} +func (*TypedValue_DistributionValue) isTypedValue_Value() {} + +func (m *TypedValue) GetValue() isTypedValue_Value { + if m != nil { + return m.Value + } + return nil +} + +func (m *TypedValue) GetBoolValue() bool { + if x, ok := m.GetValue().(*TypedValue_BoolValue); ok { + return x.BoolValue + } + return false +} + +func (m *TypedValue) GetInt64Value() int64 { + if x, ok := m.GetValue().(*TypedValue_Int64Value); ok { + return x.Int64Value + } + return 0 +} + +func (m *TypedValue) GetDoubleValue() float64 { + if x, ok := m.GetValue().(*TypedValue_DoubleValue); ok { + return x.DoubleValue + } + return 0 +} + +func (m *TypedValue) GetStringValue() string { + if x, ok := m.GetValue().(*TypedValue_StringValue); ok { + return x.StringValue + } + return "" +} + +func (m *TypedValue) GetDistributionValue() *google_api2.Distribution { + if x, ok := m.GetValue().(*TypedValue_DistributionValue); ok { + return x.DistributionValue + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*TypedValue) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _TypedValue_OneofMarshaler, _TypedValue_OneofUnmarshaler, _TypedValue_OneofSizer, []interface{}{ + (*TypedValue_BoolValue)(nil), + (*TypedValue_Int64Value)(nil), + (*TypedValue_DoubleValue)(nil), + (*TypedValue_StringValue)(nil), + (*TypedValue_DistributionValue)(nil), + } +} + +func _TypedValue_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*TypedValue) + // value + switch x := m.Value.(type) { + case *TypedValue_BoolValue: + t := uint64(0) + if x.BoolValue { + t = 1 + } + b.EncodeVarint(1<<3 | proto.WireVarint) + b.EncodeVarint(t) + case *TypedValue_Int64Value: + b.EncodeVarint(2<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.Int64Value)) + case *TypedValue_DoubleValue: + b.EncodeVarint(3<<3 | proto.WireFixed64) + b.EncodeFixed64(math.Float64bits(x.DoubleValue)) + case *TypedValue_StringValue: + b.EncodeVarint(4<<3 | proto.WireBytes) + b.EncodeStringBytes(x.StringValue) + case *TypedValue_DistributionValue: + b.EncodeVarint(5<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.DistributionValue); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("TypedValue.Value has unexpected type %T", x) + } + return nil +} + +func _TypedValue_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*TypedValue) + switch tag { + case 1: // value.bool_value + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Value = &TypedValue_BoolValue{x != 0} + return true, err + case 2: // value.int64_value + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Value = &TypedValue_Int64Value{int64(x)} + return true, err + case 3: // value.double_value + if wire != proto.WireFixed64 { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeFixed64() + m.Value = &TypedValue_DoubleValue{math.Float64frombits(x)} + return true, err + case 4: // value.string_value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Value = &TypedValue_StringValue{x} + return true, err + case 5: // value.distribution_value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(google_api2.Distribution) + err := b.DecodeMessage(msg) + m.Value = &TypedValue_DistributionValue{msg} + return true, err + default: + return false, nil + } +} + +func _TypedValue_OneofSizer(msg proto.Message) (n int) { + m := msg.(*TypedValue) + // value + switch x := m.Value.(type) { + case *TypedValue_BoolValue: + n += proto.SizeVarint(1<<3 | proto.WireVarint) + n += 1 + case *TypedValue_Int64Value: + n += proto.SizeVarint(2<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.Int64Value)) + case *TypedValue_DoubleValue: + n += proto.SizeVarint(3<<3 | proto.WireFixed64) + n += 8 + case *TypedValue_StringValue: + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.StringValue))) + n += len(x.StringValue) + case *TypedValue_DistributionValue: + s := proto.Size(x.DistributionValue) + n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// A time interval extending just after a start time through an end time. +// If the start time is the same as the end time, then the interval +// represents a single point in time. +type TimeInterval struct { + // Required. The end of the time interval. + EndTime *google_protobuf2.Timestamp `protobuf:"bytes,2,opt,name=end_time,json=endTime" json:"end_time,omitempty"` + // Optional. The beginning of the time interval. The default value + // for the start time is the end time. The start time must not be + // later than the end time. + StartTime *google_protobuf2.Timestamp `protobuf:"bytes,1,opt,name=start_time,json=startTime" json:"start_time,omitempty"` +} + +func (m *TimeInterval) Reset() { *m = TimeInterval{} } +func (m *TimeInterval) String() string { return proto.CompactTextString(m) } +func (*TimeInterval) ProtoMessage() {} +func (*TimeInterval) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *TimeInterval) GetEndTime() *google_protobuf2.Timestamp { + if m != nil { + return m.EndTime + } + return nil +} + +func (m *TimeInterval) GetStartTime() *google_protobuf2.Timestamp { + if m != nil { + return m.StartTime + } + return nil +} + +// Describes how to combine multiple time series to provide different views of +// the data. Aggregation consists of an alignment step on individual time +// series (`per_series_aligner`) followed by an optional reduction of the data +// across different time series (`cross_series_reducer`). For more details, see +// [Aggregation](/monitoring/api/learn_more#aggregation). +type Aggregation struct { + // The alignment period for per-[time series][google.monitoring.v3.TimeSeries] + // alignment. If present, `alignmentPeriod` must be at least 60 + // seconds. After per-time series alignment, each time series will + // contain data points only on the period boundaries. If + // `perSeriesAligner` is not specified or equals `ALIGN_NONE`, then + // this field is ignored. If `perSeriesAligner` is specified and + // does not equal `ALIGN_NONE`, then this field must be defined; + // otherwise an error is returned. + AlignmentPeriod *google_protobuf3.Duration `protobuf:"bytes,1,opt,name=alignment_period,json=alignmentPeriod" json:"alignment_period,omitempty"` + // The approach to be used to align individual time series. Not all + // alignment functions may be applied to all time series, depending + // on the metric type and value type of the original time + // series. Alignment may change the metric type or the value type of + // the time series. + // + // Time series data must be aligned in order to perform cross-time + // series reduction. If `crossSeriesReducer` is specified, then + // `perSeriesAligner` must be specified and not equal `ALIGN_NONE` + // and `alignmentPeriod` must be specified; otherwise, an error is + // returned. + PerSeriesAligner Aggregation_Aligner `protobuf:"varint,2,opt,name=per_series_aligner,json=perSeriesAligner,enum=google.monitoring.v3.Aggregation_Aligner" json:"per_series_aligner,omitempty"` + // The approach to be used to combine time series. Not all reducer + // functions may be applied to all time series, depending on the + // metric type and the value type of the original time + // series. Reduction may change the metric type of value type of the + // time series. + // + // Time series data must be aligned in order to perform cross-time + // series reduction. If `crossSeriesReducer` is specified, then + // `perSeriesAligner` must be specified and not equal `ALIGN_NONE` + // and `alignmentPeriod` must be specified; otherwise, an error is + // returned. + CrossSeriesReducer Aggregation_Reducer `protobuf:"varint,4,opt,name=cross_series_reducer,json=crossSeriesReducer,enum=google.monitoring.v3.Aggregation_Reducer" json:"cross_series_reducer,omitempty"` + // The set of fields to preserve when `crossSeriesReducer` is + // specified. The `groupByFields` determine how the time series are + // partitioned into subsets prior to applying the aggregation + // function. Each subset contains time series that have the same + // value for each of the grouping fields. Each individual time + // series is a member of exactly one subset. The + // `crossSeriesReducer` is applied to each subset of time series. + // It is not possible to reduce across different resource types, so + // this field implicitly contains `resource.type`. Fields not + // specified in `groupByFields` are aggregated away. If + // `groupByFields` is not specified and all the time series have + // the same resource type, then the time series are aggregated into + // a single output time series. If `crossSeriesReducer` is not + // defined, this field is ignored. + GroupByFields []string `protobuf:"bytes,5,rep,name=group_by_fields,json=groupByFields" json:"group_by_fields,omitempty"` +} + +func (m *Aggregation) Reset() { *m = Aggregation{} } +func (m *Aggregation) String() string { return proto.CompactTextString(m) } +func (*Aggregation) ProtoMessage() {} +func (*Aggregation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *Aggregation) GetAlignmentPeriod() *google_protobuf3.Duration { + if m != nil { + return m.AlignmentPeriod + } + return nil +} + +func (m *Aggregation) GetPerSeriesAligner() Aggregation_Aligner { + if m != nil { + return m.PerSeriesAligner + } + return Aggregation_ALIGN_NONE +} + +func (m *Aggregation) GetCrossSeriesReducer() Aggregation_Reducer { + if m != nil { + return m.CrossSeriesReducer + } + return Aggregation_REDUCE_NONE +} + +func (m *Aggregation) GetGroupByFields() []string { + if m != nil { + return m.GroupByFields + } + return nil +} + +func init() { + proto.RegisterType((*TypedValue)(nil), "google.monitoring.v3.TypedValue") + proto.RegisterType((*TimeInterval)(nil), "google.monitoring.v3.TimeInterval") + proto.RegisterType((*Aggregation)(nil), "google.monitoring.v3.Aggregation") + proto.RegisterEnum("google.monitoring.v3.Aggregation_Aligner", Aggregation_Aligner_name, Aggregation_Aligner_value) + proto.RegisterEnum("google.monitoring.v3.Aggregation_Reducer", Aggregation_Reducer_name, Aggregation_Reducer_value) +} + +func init() { proto.RegisterFile("google/monitoring/v3/common.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 792 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0xdd, 0x6a, 0xe3, 0x46, + 0x14, 0xb6, 0xec, 0x64, 0x1d, 0x1f, 0x39, 0xf1, 0x64, 0xd6, 0x4b, 0xdd, 0x40, 0xbb, 0x5e, 0x17, + 0x8a, 0x7b, 0x23, 0x87, 0xb8, 0x2e, 0x84, 0x42, 0x41, 0xb1, 0xb5, 0x1b, 0x83, 0x23, 0x9b, 0x59, + 0x25, 0x0d, 0x6d, 0x40, 0xc8, 0xd1, 0xac, 0x10, 0xc8, 0x1a, 0x31, 0x92, 0x0d, 0xb9, 0xeb, 0x6b, + 0xf4, 0xba, 0x77, 0xfb, 0x28, 0x7d, 0x84, 0x3e, 0x44, 0x9f, 0xa1, 0x68, 0x66, 0xb4, 0x52, 0x5a, + 0x97, 0xf6, 0xf2, 0xfb, 0x39, 0xdf, 0xe8, 0x7c, 0x23, 0xd9, 0xf0, 0x26, 0x60, 0x2c, 0x88, 0xe8, + 0x68, 0xc3, 0xe2, 0x30, 0x63, 0x3c, 0x8c, 0x83, 0xd1, 0x6e, 0x3c, 0x7a, 0x64, 0x9b, 0x0d, 0x8b, + 0x8d, 0x84, 0xb3, 0x8c, 0xe1, 0xae, 0xb4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 0x91, 0x5f, 0x51, 0x95, 0x91, 0xdb, + 0x37, 0x71, 0x0f, 0xba, 0x8a, 0x7e, 0xde, 0xcb, 0x51, 0x45, 0x79, 0x5e, 0x4c, 0xeb, 0x5f, 0x94, + 0x09, 0x82, 0xfd, 0xca, 0xe4, 0x1c, 0xe9, 0xfb, 0x95, 0xf3, 0x09, 0x6a, 0x5f, 0xfd, 0xa6, 0x41, + 0xef, 0x91, 0x6d, 0xf6, 0xbe, 0xe5, 0x57, 0xfa, 0x54, 0xfc, 0x82, 0xaf, 0xf2, 0xaf, 0x73, 0xa5, + 0xfd, 0xf4, 0x83, 0x32, 0x05, 0x2c, 0xf2, 0xe2, 0xc0, 0x60, 0x3c, 0x18, 0x05, 0x34, 0x16, 0xdf, + 0xee, 0x48, 0x4a, 0x5e, 0x12, 0xa6, 0xcf, 0xff, 0x04, 0xbe, 0x2f, 0xd1, 0xc7, 0xfa, 0xd9, 0x3b, + 0x19, 0x30, 0x8d, 0xd8, 0xd6, 0x37, 0x6e, 0xca, 0xb3, 0xee, 0xc6, 0xbf, 0x17, 0xe2, 0x83, 0x10, + 0x1f, 0x4a, 0xf1, 0xe1, 0x6e, 0xbc, 0x7e, 0x21, 0x0e, 0x19, 0xff, 0x15, 0x00, 0x00, 0xff, 0xff, + 0x57, 0xa4, 0xb9, 0xce, 0x68, 0x06, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/monitoring/v3/group.pb.go b/vendor/google.golang.org/genproto/googleapis/monitoring/v3/group.pb.go new file mode 100644 index 0000000000..a9c0dd811b --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/monitoring/v3/group.pb.go @@ -0,0 +1,126 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/monitoring/v3/group.proto + +package monitoring + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// The description of a dynamic collection of monitored resources. Each group +// has a filter that is matched against monitored resources and their associated +// metadata. If a group's filter matches an available monitored resource, then +// that resource is a member of that group. Groups can contain any number of +// monitored resources, and each monitored resource can be a member of any +// number of groups. +// +// Groups can be nested in parent-child hierarchies. The `parentName` field +// identifies an optional parent for each group. If a group has a parent, then +// the only monitored resources available to be matched by the group's filter +// are the resources contained in the parent group. In other words, a group +// contains the monitored resources that match its filter and the filters of all +// the group's ancestors. A group without a parent can contain any monitored +// resource. +// +// For example, consider an infrastructure running a set of instances with two +// user-defined tags: `"environment"` and `"role"`. A parent group has a filter, +// `environment="production"`. A child of that parent group has a filter, +// `role="transcoder"`. The parent group contains all instances in the +// production environment, regardless of their roles. The child group contains +// instances that have the transcoder role *and* are in the production +// environment. +// +// The monitored resources contained in a group can change at any moment, +// depending on what resources exist and what filters are associated with the +// group and its ancestors. +type Group struct { + // Output only. The name of this group. The format is + // `"projects/{project_id_or_number}/groups/{group_id}"`. + // When creating a group, this field is ignored and a new name is created + // consisting of the project specified in the call to `CreateGroup` + // and a unique `{group_id}` that is generated automatically. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // A user-assigned name for this group, used only for display purposes. + DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName" json:"display_name,omitempty"` + // The name of the group's parent, if it has one. + // The format is `"projects/{project_id_or_number}/groups/{group_id}"`. + // For groups with no parent, `parentName` is the empty string, `""`. + ParentName string `protobuf:"bytes,3,opt,name=parent_name,json=parentName" json:"parent_name,omitempty"` + // The filter used to determine which monitored resources belong to this group. + Filter string `protobuf:"bytes,5,opt,name=filter" json:"filter,omitempty"` + // If true, the members of this group are considered to be a cluster. + // The system can perform additional analysis on groups that are clusters. + IsCluster bool `protobuf:"varint,6,opt,name=is_cluster,json=isCluster" json:"is_cluster,omitempty"` +} + +func (m *Group) Reset() { *m = Group{} } +func (m *Group) String() string { return proto.CompactTextString(m) } +func (*Group) ProtoMessage() {} +func (*Group) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +func (m *Group) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Group) GetDisplayName() string { + if m != nil { + return m.DisplayName + } + return "" +} + +func (m *Group) GetParentName() string { + if m != nil { + return m.ParentName + } + return "" +} + +func (m *Group) GetFilter() string { + if m != nil { + return m.Filter + } + return "" +} + +func (m *Group) GetIsCluster() bool { + if m != nil { + return m.IsCluster + } + return false +} + +func init() { + proto.RegisterType((*Group)(nil), "google.monitoring.v3.Group") +} + +func init() { proto.RegisterFile("google/monitoring/v3/group.proto", fileDescriptor1) } + +var fileDescriptor1 = []byte{ + // 261 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0xcf, 0x4a, 0x2b, 0x31, + 0x14, 0x87, 0x49, 0xef, 0xed, 0x60, 0x4f, 0x5d, 0x0d, 0x22, 0x83, 0x20, 0x8e, 0xae, 0xba, 0xca, + 0x2c, 0xb2, 0x14, 0x5c, 0xb4, 0x8b, 0xae, 0x94, 0xd2, 0x45, 0x17, 0x32, 0x50, 0x62, 0x1b, 0x43, + 0x20, 0x93, 0x13, 0x92, 0x99, 0x82, 0x2f, 0xe2, 0x03, 0xb8, 0xf4, 0x51, 0x7c, 0x2a, 0x99, 0x93, + 0x91, 0x41, 0x70, 0x97, 0xf3, 0xfb, 0x3e, 0x72, 0xfe, 0x40, 0xa9, 0x11, 0xb5, 0x55, 0x55, 0x83, + 0xce, 0xb4, 0x18, 0x8c, 0xd3, 0xd5, 0x49, 0x54, 0x3a, 0x60, 0xe7, 0xb9, 0x0f, 0xd8, 0x62, 0x7e, + 0x91, 0x0c, 0x3e, 0x1a, 0xfc, 0x24, 0xee, 0xde, 0x19, 0x4c, 0xd7, 0xbd, 0x95, 0xe7, 0xf0, 0xdf, + 0xc9, 0x46, 0x15, 0xac, 0x64, 0x8b, 0xd9, 0x96, 0xde, 0xf9, 0x2d, 0x9c, 0x1f, 0x4d, 0xf4, 0x56, + 0xbe, 0xed, 0x89, 0x4d, 0x88, 0xcd, 0x87, 0xec, 0xa9, 0x57, 0x6e, 0x60, 0xee, 0x65, 0x50, 0xae, + 0x4d, 0xc6, 0x3f, 0x32, 0x20, 0x45, 0x24, 0x5c, 0x42, 0xf6, 0x6a, 0x6c, 0xab, 0x42, 0x31, 0x25, + 0x36, 0x54, 0xf9, 0x35, 0x80, 0x89, 0xfb, 0x83, 0xed, 0x62, 0xcf, 0xb2, 0x92, 0x2d, 0xce, 0xb6, + 0x33, 0x13, 0x57, 0x29, 0x58, 0x7e, 0x30, 0x28, 0x0e, 0xd8, 0xf0, 0xbf, 0xa6, 0x5e, 0x02, 0x8d, + 0xbc, 0xe9, 0xf7, 0xda, 0xb0, 0xe7, 0x87, 0xc1, 0xd1, 0x68, 0xa5, 0xd3, 0x1c, 0x83, 0xae, 0xb4, + 0x72, 0xb4, 0x75, 0x95, 0x90, 0xf4, 0x26, 0xfe, 0x3e, 0xcd, 0xfd, 0x58, 0x7d, 0x4e, 0xae, 0xd6, + 0xe9, 0x83, 0x95, 0xc5, 0xee, 0xc8, 0x1f, 0xc7, 0x56, 0x3b, 0xf1, 0xf5, 0x03, 0x6b, 0x82, 0xf5, + 0x08, 0xeb, 0x9d, 0x78, 0xc9, 0xa8, 0x89, 0xf8, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x95, 0xd1, 0xa1, + 0x34, 0x7e, 0x01, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/monitoring/v3/group_service.pb.go b/vendor/google.golang.org/genproto/googleapis/monitoring/v3/group_service.pb.go new file mode 100644 index 0000000000..14750fa97c --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/monitoring/v3/group_service.pb.go @@ -0,0 +1,753 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/monitoring/v3/group_service.proto + +package monitoring + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_api4 "google.golang.org/genproto/googleapis/api/monitoredres" +import google_protobuf4 "github.com/golang/protobuf/ptypes/empty" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// The `ListGroup` request. +type ListGroupsRequest struct { + // The project whose groups are to be listed. The format is + // `"projects/{project_id_or_number}"`. + Name string `protobuf:"bytes,7,opt,name=name" json:"name,omitempty"` + // An optional filter consisting of a single group name. The filters limit the + // groups returned based on their parent-child relationship with the specified + // group. If no filter is specified, all groups are returned. + // + // Types that are valid to be assigned to Filter: + // *ListGroupsRequest_ChildrenOfGroup + // *ListGroupsRequest_AncestorsOfGroup + // *ListGroupsRequest_DescendantsOfGroup + Filter isListGroupsRequest_Filter `protobuf_oneof:"filter"` + // A positive number that is the maximum number of results to return. + PageSize int32 `protobuf:"varint,5,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // If this field is not empty then it must contain the `nextPageToken` value + // returned by a previous call to this method. Using this field causes the + // method to return additional results from the previous method call. + PageToken string `protobuf:"bytes,6,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListGroupsRequest) Reset() { *m = ListGroupsRequest{} } +func (m *ListGroupsRequest) String() string { return proto.CompactTextString(m) } +func (*ListGroupsRequest) ProtoMessage() {} +func (*ListGroupsRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} } + +type isListGroupsRequest_Filter interface { + isListGroupsRequest_Filter() +} + +type ListGroupsRequest_ChildrenOfGroup struct { + ChildrenOfGroup string `protobuf:"bytes,2,opt,name=children_of_group,json=childrenOfGroup,oneof"` +} +type ListGroupsRequest_AncestorsOfGroup struct { + AncestorsOfGroup string `protobuf:"bytes,3,opt,name=ancestors_of_group,json=ancestorsOfGroup,oneof"` +} +type ListGroupsRequest_DescendantsOfGroup struct { + DescendantsOfGroup string `protobuf:"bytes,4,opt,name=descendants_of_group,json=descendantsOfGroup,oneof"` +} + +func (*ListGroupsRequest_ChildrenOfGroup) isListGroupsRequest_Filter() {} +func (*ListGroupsRequest_AncestorsOfGroup) isListGroupsRequest_Filter() {} +func (*ListGroupsRequest_DescendantsOfGroup) isListGroupsRequest_Filter() {} + +func (m *ListGroupsRequest) GetFilter() isListGroupsRequest_Filter { + if m != nil { + return m.Filter + } + return nil +} + +func (m *ListGroupsRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ListGroupsRequest) GetChildrenOfGroup() string { + if x, ok := m.GetFilter().(*ListGroupsRequest_ChildrenOfGroup); ok { + return x.ChildrenOfGroup + } + return "" +} + +func (m *ListGroupsRequest) GetAncestorsOfGroup() string { + if x, ok := m.GetFilter().(*ListGroupsRequest_AncestorsOfGroup); ok { + return x.AncestorsOfGroup + } + return "" +} + +func (m *ListGroupsRequest) GetDescendantsOfGroup() string { + if x, ok := m.GetFilter().(*ListGroupsRequest_DescendantsOfGroup); ok { + return x.DescendantsOfGroup + } + return "" +} + +func (m *ListGroupsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListGroupsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*ListGroupsRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _ListGroupsRequest_OneofMarshaler, _ListGroupsRequest_OneofUnmarshaler, _ListGroupsRequest_OneofSizer, []interface{}{ + (*ListGroupsRequest_ChildrenOfGroup)(nil), + (*ListGroupsRequest_AncestorsOfGroup)(nil), + (*ListGroupsRequest_DescendantsOfGroup)(nil), + } +} + +func _ListGroupsRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*ListGroupsRequest) + // filter + switch x := m.Filter.(type) { + case *ListGroupsRequest_ChildrenOfGroup: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeStringBytes(x.ChildrenOfGroup) + case *ListGroupsRequest_AncestorsOfGroup: + b.EncodeVarint(3<<3 | proto.WireBytes) + b.EncodeStringBytes(x.AncestorsOfGroup) + case *ListGroupsRequest_DescendantsOfGroup: + b.EncodeVarint(4<<3 | proto.WireBytes) + b.EncodeStringBytes(x.DescendantsOfGroup) + case nil: + default: + return fmt.Errorf("ListGroupsRequest.Filter has unexpected type %T", x) + } + return nil +} + +func _ListGroupsRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*ListGroupsRequest) + switch tag { + case 2: // filter.children_of_group + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Filter = &ListGroupsRequest_ChildrenOfGroup{x} + return true, err + case 3: // filter.ancestors_of_group + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Filter = &ListGroupsRequest_AncestorsOfGroup{x} + return true, err + case 4: // filter.descendants_of_group + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Filter = &ListGroupsRequest_DescendantsOfGroup{x} + return true, err + default: + return false, nil + } +} + +func _ListGroupsRequest_OneofSizer(msg proto.Message) (n int) { + m := msg.(*ListGroupsRequest) + // filter + switch x := m.Filter.(type) { + case *ListGroupsRequest_ChildrenOfGroup: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.ChildrenOfGroup))) + n += len(x.ChildrenOfGroup) + case *ListGroupsRequest_AncestorsOfGroup: + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.AncestorsOfGroup))) + n += len(x.AncestorsOfGroup) + case *ListGroupsRequest_DescendantsOfGroup: + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.DescendantsOfGroup))) + n += len(x.DescendantsOfGroup) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// The `ListGroups` response. +type ListGroupsResponse struct { + // The groups that match the specified filters. + Group []*Group `protobuf:"bytes,1,rep,name=group" json:"group,omitempty"` + // If there are more results than have been returned, then this field is set + // to a non-empty value. To see the additional results, + // use that value as `pageToken` in the next call to this method. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListGroupsResponse) Reset() { *m = ListGroupsResponse{} } +func (m *ListGroupsResponse) String() string { return proto.CompactTextString(m) } +func (*ListGroupsResponse) ProtoMessage() {} +func (*ListGroupsResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{1} } + +func (m *ListGroupsResponse) GetGroup() []*Group { + if m != nil { + return m.Group + } + return nil +} + +func (m *ListGroupsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// The `GetGroup` request. +type GetGroupRequest struct { + // The group to retrieve. The format is + // `"projects/{project_id_or_number}/groups/{group_id}"`. + Name string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"` +} + +func (m *GetGroupRequest) Reset() { *m = GetGroupRequest{} } +func (m *GetGroupRequest) String() string { return proto.CompactTextString(m) } +func (*GetGroupRequest) ProtoMessage() {} +func (*GetGroupRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{2} } + +func (m *GetGroupRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// The `CreateGroup` request. +type CreateGroupRequest struct { + // The project in which to create the group. The format is + // `"projects/{project_id_or_number}"`. + Name string `protobuf:"bytes,4,opt,name=name" json:"name,omitempty"` + // A group definition. It is an error to define the `name` field because + // the system assigns the name. + Group *Group `protobuf:"bytes,2,opt,name=group" json:"group,omitempty"` + // If true, validate this request but do not create the group. + ValidateOnly bool `protobuf:"varint,3,opt,name=validate_only,json=validateOnly" json:"validate_only,omitempty"` +} + +func (m *CreateGroupRequest) Reset() { *m = CreateGroupRequest{} } +func (m *CreateGroupRequest) String() string { return proto.CompactTextString(m) } +func (*CreateGroupRequest) ProtoMessage() {} +func (*CreateGroupRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{3} } + +func (m *CreateGroupRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *CreateGroupRequest) GetGroup() *Group { + if m != nil { + return m.Group + } + return nil +} + +func (m *CreateGroupRequest) GetValidateOnly() bool { + if m != nil { + return m.ValidateOnly + } + return false +} + +// The `UpdateGroup` request. +type UpdateGroupRequest struct { + // The new definition of the group. All fields of the existing group, + // excepting `name`, are replaced with the corresponding fields of this group. + Group *Group `protobuf:"bytes,2,opt,name=group" json:"group,omitempty"` + // If true, validate this request but do not update the existing group. + ValidateOnly bool `protobuf:"varint,3,opt,name=validate_only,json=validateOnly" json:"validate_only,omitempty"` +} + +func (m *UpdateGroupRequest) Reset() { *m = UpdateGroupRequest{} } +func (m *UpdateGroupRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateGroupRequest) ProtoMessage() {} +func (*UpdateGroupRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{4} } + +func (m *UpdateGroupRequest) GetGroup() *Group { + if m != nil { + return m.Group + } + return nil +} + +func (m *UpdateGroupRequest) GetValidateOnly() bool { + if m != nil { + return m.ValidateOnly + } + return false +} + +// The `DeleteGroup` request. You can only delete a group if it has no children. +type DeleteGroupRequest struct { + // The group to delete. The format is + // `"projects/{project_id_or_number}/groups/{group_id}"`. + Name string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"` +} + +func (m *DeleteGroupRequest) Reset() { *m = DeleteGroupRequest{} } +func (m *DeleteGroupRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteGroupRequest) ProtoMessage() {} +func (*DeleteGroupRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{5} } + +func (m *DeleteGroupRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// The `ListGroupMembers` request. +type ListGroupMembersRequest struct { + // The group whose members are listed. The format is + // `"projects/{project_id_or_number}/groups/{group_id}"`. + Name string `protobuf:"bytes,7,opt,name=name" json:"name,omitempty"` + // A positive number that is the maximum number of results to return. + PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // If this field is not empty then it must contain the `nextPageToken` value + // returned by a previous call to this method. Using this field causes the + // method to return additional results from the previous method call. + PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` + // An optional [list filter](/monitoring/api/learn_more#filtering) describing + // the members to be returned. The filter may reference the type, labels, and + // metadata of monitored resources that comprise the group. + // For example, to return only resources representing Compute Engine VM + // instances, use this filter: + // + // resource.type = "gce_instance" + Filter string `protobuf:"bytes,5,opt,name=filter" json:"filter,omitempty"` + // An optional time interval for which results should be returned. Only + // members that were part of the group during the specified interval are + // included in the response. If no interval is provided then the group + // membership over the last minute is returned. + Interval *TimeInterval `protobuf:"bytes,6,opt,name=interval" json:"interval,omitempty"` +} + +func (m *ListGroupMembersRequest) Reset() { *m = ListGroupMembersRequest{} } +func (m *ListGroupMembersRequest) String() string { return proto.CompactTextString(m) } +func (*ListGroupMembersRequest) ProtoMessage() {} +func (*ListGroupMembersRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{6} } + +func (m *ListGroupMembersRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ListGroupMembersRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListGroupMembersRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +func (m *ListGroupMembersRequest) GetFilter() string { + if m != nil { + return m.Filter + } + return "" +} + +func (m *ListGroupMembersRequest) GetInterval() *TimeInterval { + if m != nil { + return m.Interval + } + return nil +} + +// The `ListGroupMembers` response. +type ListGroupMembersResponse struct { + // A set of monitored resources in the group. + Members []*google_api4.MonitoredResource `protobuf:"bytes,1,rep,name=members" json:"members,omitempty"` + // If there are more results than have been returned, then this field is + // set to a non-empty value. To see the additional results, use that value as + // `pageToken` in the next call to this method. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` + // The total number of elements matching this request. + TotalSize int32 `protobuf:"varint,3,opt,name=total_size,json=totalSize" json:"total_size,omitempty"` +} + +func (m *ListGroupMembersResponse) Reset() { *m = ListGroupMembersResponse{} } +func (m *ListGroupMembersResponse) String() string { return proto.CompactTextString(m) } +func (*ListGroupMembersResponse) ProtoMessage() {} +func (*ListGroupMembersResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{7} } + +func (m *ListGroupMembersResponse) GetMembers() []*google_api4.MonitoredResource { + if m != nil { + return m.Members + } + return nil +} + +func (m *ListGroupMembersResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +func (m *ListGroupMembersResponse) GetTotalSize() int32 { + if m != nil { + return m.TotalSize + } + return 0 +} + +func init() { + proto.RegisterType((*ListGroupsRequest)(nil), "google.monitoring.v3.ListGroupsRequest") + proto.RegisterType((*ListGroupsResponse)(nil), "google.monitoring.v3.ListGroupsResponse") + proto.RegisterType((*GetGroupRequest)(nil), "google.monitoring.v3.GetGroupRequest") + proto.RegisterType((*CreateGroupRequest)(nil), "google.monitoring.v3.CreateGroupRequest") + proto.RegisterType((*UpdateGroupRequest)(nil), "google.monitoring.v3.UpdateGroupRequest") + proto.RegisterType((*DeleteGroupRequest)(nil), "google.monitoring.v3.DeleteGroupRequest") + proto.RegisterType((*ListGroupMembersRequest)(nil), "google.monitoring.v3.ListGroupMembersRequest") + proto.RegisterType((*ListGroupMembersResponse)(nil), "google.monitoring.v3.ListGroupMembersResponse") +} + +// 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 + +// Client API for GroupService service + +type GroupServiceClient interface { + // Lists the existing groups. + ListGroups(ctx context.Context, in *ListGroupsRequest, opts ...grpc.CallOption) (*ListGroupsResponse, error) + // Gets a single group. + GetGroup(ctx context.Context, in *GetGroupRequest, opts ...grpc.CallOption) (*Group, error) + // Creates a new group. + CreateGroup(ctx context.Context, in *CreateGroupRequest, opts ...grpc.CallOption) (*Group, error) + // Updates an existing group. + // You can change any group attributes except `name`. + UpdateGroup(ctx context.Context, in *UpdateGroupRequest, opts ...grpc.CallOption) (*Group, error) + // Deletes an existing group. + DeleteGroup(ctx context.Context, in *DeleteGroupRequest, opts ...grpc.CallOption) (*google_protobuf4.Empty, error) + // Lists the monitored resources that are members of a group. + ListGroupMembers(ctx context.Context, in *ListGroupMembersRequest, opts ...grpc.CallOption) (*ListGroupMembersResponse, error) +} + +type groupServiceClient struct { + cc *grpc.ClientConn +} + +func NewGroupServiceClient(cc *grpc.ClientConn) GroupServiceClient { + return &groupServiceClient{cc} +} + +func (c *groupServiceClient) ListGroups(ctx context.Context, in *ListGroupsRequest, opts ...grpc.CallOption) (*ListGroupsResponse, error) { + out := new(ListGroupsResponse) + err := grpc.Invoke(ctx, "/google.monitoring.v3.GroupService/ListGroups", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupServiceClient) GetGroup(ctx context.Context, in *GetGroupRequest, opts ...grpc.CallOption) (*Group, error) { + out := new(Group) + err := grpc.Invoke(ctx, "/google.monitoring.v3.GroupService/GetGroup", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupServiceClient) CreateGroup(ctx context.Context, in *CreateGroupRequest, opts ...grpc.CallOption) (*Group, error) { + out := new(Group) + err := grpc.Invoke(ctx, "/google.monitoring.v3.GroupService/CreateGroup", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupServiceClient) UpdateGroup(ctx context.Context, in *UpdateGroupRequest, opts ...grpc.CallOption) (*Group, error) { + out := new(Group) + err := grpc.Invoke(ctx, "/google.monitoring.v3.GroupService/UpdateGroup", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupServiceClient) DeleteGroup(ctx context.Context, in *DeleteGroupRequest, opts ...grpc.CallOption) (*google_protobuf4.Empty, error) { + out := new(google_protobuf4.Empty) + err := grpc.Invoke(ctx, "/google.monitoring.v3.GroupService/DeleteGroup", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupServiceClient) ListGroupMembers(ctx context.Context, in *ListGroupMembersRequest, opts ...grpc.CallOption) (*ListGroupMembersResponse, error) { + out := new(ListGroupMembersResponse) + err := grpc.Invoke(ctx, "/google.monitoring.v3.GroupService/ListGroupMembers", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for GroupService service + +type GroupServiceServer interface { + // Lists the existing groups. + ListGroups(context.Context, *ListGroupsRequest) (*ListGroupsResponse, error) + // Gets a single group. + GetGroup(context.Context, *GetGroupRequest) (*Group, error) + // Creates a new group. + CreateGroup(context.Context, *CreateGroupRequest) (*Group, error) + // Updates an existing group. + // You can change any group attributes except `name`. + UpdateGroup(context.Context, *UpdateGroupRequest) (*Group, error) + // Deletes an existing group. + DeleteGroup(context.Context, *DeleteGroupRequest) (*google_protobuf4.Empty, error) + // Lists the monitored resources that are members of a group. + ListGroupMembers(context.Context, *ListGroupMembersRequest) (*ListGroupMembersResponse, error) +} + +func RegisterGroupServiceServer(s *grpc.Server, srv GroupServiceServer) { + s.RegisterService(&_GroupService_serviceDesc, srv) +} + +func _GroupService_ListGroups_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListGroupsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServiceServer).ListGroups(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.monitoring.v3.GroupService/ListGroups", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServiceServer).ListGroups(ctx, req.(*ListGroupsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _GroupService_GetGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetGroupRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServiceServer).GetGroup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.monitoring.v3.GroupService/GetGroup", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServiceServer).GetGroup(ctx, req.(*GetGroupRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _GroupService_CreateGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateGroupRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServiceServer).CreateGroup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.monitoring.v3.GroupService/CreateGroup", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServiceServer).CreateGroup(ctx, req.(*CreateGroupRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _GroupService_UpdateGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateGroupRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServiceServer).UpdateGroup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.monitoring.v3.GroupService/UpdateGroup", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServiceServer).UpdateGroup(ctx, req.(*UpdateGroupRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _GroupService_DeleteGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteGroupRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServiceServer).DeleteGroup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.monitoring.v3.GroupService/DeleteGroup", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServiceServer).DeleteGroup(ctx, req.(*DeleteGroupRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _GroupService_ListGroupMembers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListGroupMembersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServiceServer).ListGroupMembers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.monitoring.v3.GroupService/ListGroupMembers", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServiceServer).ListGroupMembers(ctx, req.(*ListGroupMembersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _GroupService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.monitoring.v3.GroupService", + HandlerType: (*GroupServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListGroups", + Handler: _GroupService_ListGroups_Handler, + }, + { + MethodName: "GetGroup", + Handler: _GroupService_GetGroup_Handler, + }, + { + MethodName: "CreateGroup", + Handler: _GroupService_CreateGroup_Handler, + }, + { + MethodName: "UpdateGroup", + Handler: _GroupService_UpdateGroup_Handler, + }, + { + MethodName: "DeleteGroup", + Handler: _GroupService_DeleteGroup_Handler, + }, + { + MethodName: "ListGroupMembers", + Handler: _GroupService_ListGroupMembers_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/monitoring/v3/group_service.proto", +} + +func init() { proto.RegisterFile("google/monitoring/v3/group_service.proto", fileDescriptor2) } + +var fileDescriptor2 = []byte{ + // 826 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0x4d, 0x6f, 0xd3, 0x4c, + 0x10, 0x7e, 0xdd, 0xa4, 0x69, 0xb2, 0x69, 0xd5, 0x76, 0x55, 0xf5, 0x8d, 0xdc, 0x0f, 0x05, 0xf7, + 0x83, 0xa8, 0x50, 0x5b, 0x24, 0x07, 0x24, 0x10, 0x3d, 0xb4, 0xa0, 0x82, 0x44, 0xd5, 0xca, 0x2d, + 0x3d, 0xa0, 0x4a, 0x91, 0x9b, 0x4c, 0x8c, 0xc1, 0xde, 0x35, 0xf6, 0x26, 0xd0, 0xa2, 0x4a, 0x80, + 0xc4, 0x81, 0x33, 0x37, 0x6e, 0x1c, 0xe1, 0x2f, 0x70, 0xe2, 0xca, 0x95, 0xbf, 0xc0, 0xff, 0x00, + 0x79, 0xbd, 0x9b, 0x38, 0x9f, 0xed, 0x85, 0x5b, 0xb2, 0xf3, 0x8c, 0x9f, 0x67, 0x66, 0x9f, 0x99, + 0x45, 0x25, 0x9b, 0x52, 0xdb, 0x05, 0xc3, 0xa3, 0xc4, 0x61, 0x34, 0x70, 0x88, 0x6d, 0xb4, 0x2a, + 0x86, 0x1d, 0xd0, 0xa6, 0x5f, 0x0d, 0x21, 0x68, 0x39, 0x35, 0xd0, 0xfd, 0x80, 0x32, 0x8a, 0xe7, + 0x62, 0xa4, 0xde, 0x41, 0xea, 0xad, 0x8a, 0xba, 0x28, 0xf2, 0x2d, 0xdf, 0x31, 0x2c, 0x42, 0x28, + 0xb3, 0x98, 0x43, 0x49, 0x18, 0xe7, 0xa8, 0x2b, 0x89, 0xa8, 0xc8, 0x83, 0x7a, 0x35, 0x80, 0x90, + 0x36, 0x03, 0xf9, 0x61, 0xf5, 0xda, 0x40, 0x09, 0x35, 0xea, 0x79, 0x94, 0x08, 0x48, 0x71, 0xb8, + 0x4a, 0x81, 0x58, 0x10, 0x08, 0xfe, 0xef, 0xb4, 0xd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0, 0xfa, 0x68, 0x6d, 0x86, 0x18, 0xc2, + 0xed, 0xaf, 0x0a, 0x2a, 0xd4, 0xa8, 0x37, 0x90, 0x65, 0x7b, 0x36, 0x39, 0x57, 0x07, 0x51, 0x13, + 0x0e, 0x94, 0xa7, 0x5b, 0x02, 0x6a, 0x53, 0xd7, 0x22, 0xb6, 0x4e, 0x03, 0xdb, 0xb0, 0x81, 0xf0, + 0x16, 0x19, 0x71, 0xc8, 0xf2, 0x9d, 0xb0, 0xfb, 0x8d, 0xbf, 0xdb, 0xf9, 0xf7, 0x6d, 0x4c, 0xdd, + 0x8d, 0x3f, 0xb0, 0xe3, 0xd2, 0x66, 0x5d, 0x2e, 0x88, 0x88, 0xf1, 0xb8, 0xf2, 0x53, 0x06, 0x4f, + 0x78, 0xf0, 0xa4, 0x13, 0x3c, 0x39, 0xae, 0x9c, 0x66, 0x38, 0x49, 0xe5, 0x6f, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x86, 0x94, 0xf2, 0xde, 0xed, 0x08, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/monitoring/v3/metric.pb.go b/vendor/google.golang.org/genproto/googleapis/monitoring/v3/metric.pb.go new file mode 100644 index 0000000000..533b5373cd --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/monitoring/v3/metric.pb.go @@ -0,0 +1,164 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/monitoring/v3/metric.proto + +package monitoring + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import google_api5 "google.golang.org/genproto/googleapis/api/metric" +import google_api4 "google.golang.org/genproto/googleapis/api/monitoredres" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// A single data point in a time series. +type Point struct { + // The time interval to which the data point applies. For GAUGE metrics, only + // the end time of the interval is used. For DELTA metrics, the start and end + // time should specify a non-zero interval, with subsequent points specifying + // contiguous and non-overlapping intervals. For CUMULATIVE metrics, the + // start and end time should specify a non-zero interval, with subsequent + // points specifying the same start time and increasing end times, until an + // event resets the cumulative value to zero and sets a new start time for the + // following points. + Interval *TimeInterval `protobuf:"bytes,1,opt,name=interval" json:"interval,omitempty"` + // The value of the data point. + Value *TypedValue `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` +} + +func (m *Point) Reset() { *m = Point{} } +func (m *Point) String() string { return proto.CompactTextString(m) } +func (*Point) ProtoMessage() {} +func (*Point) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} } + +func (m *Point) GetInterval() *TimeInterval { + if m != nil { + return m.Interval + } + return nil +} + +func (m *Point) GetValue() *TypedValue { + if m != nil { + return m.Value + } + return nil +} + +// A collection of data points that describes the time-varying values +// of a metric. A time series is identified by a combination of a +// fully-specified monitored resource and a fully-specified metric. +// This type is used for both listing and creating time series. +type TimeSeries struct { + // The associated metric. A fully-specified metric used to identify the time + // series. + Metric *google_api5.Metric `protobuf:"bytes,1,opt,name=metric" json:"metric,omitempty"` + // The associated resource. A fully-specified monitored resource used to + // identify the time series. + Resource *google_api4.MonitoredResource `protobuf:"bytes,2,opt,name=resource" json:"resource,omitempty"` + // The metric kind of the time series. When listing time series, this metric + // kind might be different from the metric kind of the associated metric if + // this time series is an alignment or reduction of other time series. + // + // When creating a time series, this field is optional. If present, it must be + // the same as the metric kind of the associated metric. If the associated + // metric's descriptor must be auto-created, then this field specifies the + // metric kind of the new descriptor and must be either `GAUGE` (the default) + // or `CUMULATIVE`. + MetricKind google_api5.MetricDescriptor_MetricKind `protobuf:"varint,3,opt,name=metric_kind,json=metricKind,enum=google.api.MetricDescriptor_MetricKind" json:"metric_kind,omitempty"` + // The value type of the time series. When listing time series, this value + // type might be different from the value type of the associated metric if + // this time series is an alignment or reduction of other time series. + // + // When creating a time series, this field is optional. If present, it must be + // the same as the type of the data in the `points` field. + ValueType google_api5.MetricDescriptor_ValueType `protobuf:"varint,4,opt,name=value_type,json=valueType,enum=google.api.MetricDescriptor_ValueType" json:"value_type,omitempty"` + // The data points of this time series. When listing time series, the order of + // the points is specified by the list method. + // + // When creating a time series, this field must contain exactly one point and + // the point's type must be the same as the value type of the associated + // metric. If the associated metric's descriptor must be auto-created, then + // the value type of the descriptor is determined by the point's type, which + // must be `BOOL`, `INT64`, `DOUBLE`, or `DISTRIBUTION`. + Points []*Point `protobuf:"bytes,5,rep,name=points" json:"points,omitempty"` +} + +func (m *TimeSeries) Reset() { *m = TimeSeries{} } +func (m *TimeSeries) String() string { return proto.CompactTextString(m) } +func (*TimeSeries) ProtoMessage() {} +func (*TimeSeries) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{1} } + +func (m *TimeSeries) GetMetric() *google_api5.Metric { + if m != nil { + return m.Metric + } + return nil +} + +func (m *TimeSeries) GetResource() *google_api4.MonitoredResource { + if m != nil { + return m.Resource + } + return nil +} + +func (m *TimeSeries) GetMetricKind() google_api5.MetricDescriptor_MetricKind { + if m != nil { + return m.MetricKind + } + return google_api5.MetricDescriptor_METRIC_KIND_UNSPECIFIED +} + +func (m *TimeSeries) GetValueType() google_api5.MetricDescriptor_ValueType { + if m != nil { + return m.ValueType + } + return google_api5.MetricDescriptor_VALUE_TYPE_UNSPECIFIED +} + +func (m *TimeSeries) GetPoints() []*Point { + if m != nil { + return m.Points + } + return nil +} + +func init() { + proto.RegisterType((*Point)(nil), "google.monitoring.v3.Point") + proto.RegisterType((*TimeSeries)(nil), "google.monitoring.v3.TimeSeries") +} + +func init() { proto.RegisterFile("google/monitoring/v3/metric.proto", fileDescriptor3) } + +var fileDescriptor3 = []byte{ + // 396 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0xc1, 0x4a, 0xeb, 0x40, + 0x14, 0x86, 0x49, 0x7b, 0x5b, 0x7a, 0x27, 0x70, 0x17, 0xc3, 0x05, 0x43, 0x45, 0x88, 0x15, 0xb4, + 0xb8, 0x48, 0xa0, 0x01, 0x41, 0x84, 0x2e, 0xaa, 0xa2, 0x22, 0x42, 0x19, 0xa5, 0x0b, 0x29, 0x94, + 0x98, 0x0c, 0x61, 0x30, 0x99, 0x33, 0x4c, 0xd2, 0x40, 0x57, 0x3e, 0x8c, 0x3b, 0xdf, 0xc0, 0x57, + 0xf0, 0xa9, 0x24, 0x33, 0x93, 0xd6, 0x62, 0x74, 0x37, 0xc9, 0xff, 0x9d, 0xff, 0x9f, 0x73, 0xce, + 0xa0, 0xfd, 0x04, 0x20, 0x49, 0xa9, 0x9f, 0x01, 0x67, 0x05, 0x48, 0xc6, 0x13, 0xbf, 0x0c, 0xfc, + 0x8c, 0x16, 0x92, 0x45, 0x9e, 0x90, 0x50, 0x00, 0xfe, 0xaf, 0x11, 0x6f, 0x83, 0x78, 0x65, 0xd0, + 0xdf, 0x31, 0x85, 0xa1, 0x60, 0x5b, 0x78, 0xff, 0xe0, 0xab, 0xa0, 0x4b, 0x68, 0xbc, 0x90, 0x34, + 0x87, 0xa5, 0x8c, 0xa8, 0x81, 0x9a, 0x63, 0x23, 0xc8, 0x32, 0xe0, 0x1a, 0x19, 0xbc, 0xa0, 0xce, + 0x14, 0x18, 0x2f, 0xf0, 0x18, 0xf5, 0x18, 0x2f, 0xa8, 0x2c, 0xc3, 0xd4, 0xb1, 0x5c, 0x6b, 0x68, + 0x8f, 0x06, 0x5e, 0xd3, 0x95, 0xbc, 0x07, 0x96, 0xd1, 0x1b, 0x43, 0x92, 0x75, 0x0d, 0x3e, 0x41, + 0x9d, 0x32, 0x4c, 0x97, 0xd4, 0x69, 0xa9, 0x62, 0xf7, 0x87, 0xe2, 0x95, 0xa0, 0xf1, 0xac, 0xe2, + 0x88, 0xc6, 0x07, 0xef, 0x2d, 0x84, 0x2a, 0xcb, 0x7b, 0x2a, 0x19, 0xcd, 0xf1, 0x31, 0xea, 0xea, + 0x3e, 0xcd, 0x25, 0x70, 0xed, 0x13, 0x0a, 0xe6, 0xdd, 0x29, 0x85, 0x18, 0x02, 0x9f, 0xa2, 0x5e, + 0xdd, 0xb0, 0x49, 0xdd, 0xdb, 0xa2, 0xeb, 0xb1, 0x10, 0x03, 0x91, 0x35, 0x8e, 0xaf, 0x91, 0xad, + 0x4d, 0x16, 0xcf, 0x8c, 0xc7, 0x4e, 0xdb, 0xb5, 0x86, 0xff, 0x46, 0x47, 0xdf, 0xb3, 0x2e, 0x68, + 0x1e, 0x49, 0x26, 0x0a, 0x90, 0xe6, 0xc7, 0x2d, 0xe3, 0x31, 0x41, 0xd9, 0xfa, 0x8c, 0x2f, 0x11, + 0x52, 0x8d, 0x2c, 0x8a, 0x95, 0xa0, 0xce, 0x1f, 0x65, 0x74, 0xf8, 0xab, 0x91, 0x6a, 0xbf, 0x1a, + 0x04, 0xf9, 0x5b, 0xd6, 0x47, 0x1c, 0xa0, 0xae, 0xa8, 0xf6, 0x90, 0x3b, 0x1d, 0xb7, 0x3d, 0xb4, + 0x47, 0xbb, 0xcd, 0xf3, 0x53, 0xbb, 0x22, 0x06, 0x9d, 0xbc, 0x5a, 0xc8, 0x89, 0x20, 0x6b, 0x44, + 0x27, 0xb6, 0x0e, 0x9e, 0x56, 0x6b, 0x9e, 0x5a, 0x8f, 0x63, 0x03, 0x25, 0x90, 0x86, 0x3c, 0xf1, + 0x40, 0x26, 0x7e, 0x42, 0xb9, 0x7a, 0x04, 0xbe, 0x96, 0x42, 0xc1, 0xf2, 0xed, 0xa7, 0x72, 0xb6, + 0xf9, 0x7a, 0x6b, 0xf5, 0xaf, 0xb4, 0xc1, 0x79, 0x0a, 0xcb, 0xb8, 0x1e, 0x6e, 0x95, 0x35, 0x0b, + 0x3e, 0x6a, 0x71, 0xae, 0xc4, 0xf9, 0x46, 0x9c, 0xcf, 0x82, 0xa7, 0xae, 0x0a, 0x09, 0x3e, 0x03, + 0x00, 0x00, 0xff, 0xff, 0x28, 0x45, 0x7a, 0x13, 0x05, 0x03, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/monitoring/v3/metric_service.pb.go b/vendor/google.golang.org/genproto/googleapis/monitoring/v3/metric_service.pb.go new file mode 100644 index 0000000000..77840f1cfe --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/monitoring/v3/metric_service.pb.go @@ -0,0 +1,929 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/monitoring/v3/metric_service.proto + +package monitoring + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_api5 "google.golang.org/genproto/googleapis/api/metric" +import google_api4 "google.golang.org/genproto/googleapis/api/monitoredres" +import google_protobuf4 "github.com/golang/protobuf/ptypes/empty" +import google_rpc "google.golang.org/genproto/googleapis/rpc/status" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Controls which fields are returned by `ListTimeSeries`. +type ListTimeSeriesRequest_TimeSeriesView int32 + +const ( + // Returns the identity of the metric(s), the time series, + // and the time series data. + ListTimeSeriesRequest_FULL ListTimeSeriesRequest_TimeSeriesView = 0 + // Returns the identity of the metric and the time series resource, + // but not the time series data. + ListTimeSeriesRequest_HEADERS ListTimeSeriesRequest_TimeSeriesView = 1 +) + +var ListTimeSeriesRequest_TimeSeriesView_name = map[int32]string{ + 0: "FULL", + 1: "HEADERS", +} +var ListTimeSeriesRequest_TimeSeriesView_value = map[string]int32{ + "FULL": 0, + "HEADERS": 1, +} + +func (x ListTimeSeriesRequest_TimeSeriesView) String() string { + return proto.EnumName(ListTimeSeriesRequest_TimeSeriesView_name, int32(x)) +} +func (ListTimeSeriesRequest_TimeSeriesView) EnumDescriptor() ([]byte, []int) { + return fileDescriptor4, []int{8, 0} +} + +// The `ListMonitoredResourceDescriptors` request. +type ListMonitoredResourceDescriptorsRequest struct { + // The project on which to execute the request. The format is + // `"projects/{project_id_or_number}"`. + Name string `protobuf:"bytes,5,opt,name=name" json:"name,omitempty"` + // An optional [filter](/monitoring/api/v3/filters) describing + // the descriptors to be returned. The filter can reference + // the descriptor's type and labels. For example, the + // following filter returns only Google Compute Engine descriptors + // that have an `id` label: + // + // resource.type = starts_with("gce_") AND resource.label:id + Filter string `protobuf:"bytes,2,opt,name=filter" json:"filter,omitempty"` + // A positive number that is the maximum number of results to return. + PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // If this field is not empty then it must contain the `nextPageToken` value + // returned by a previous call to this method. Using this field causes the + // method to return additional results from the previous method call. + PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListMonitoredResourceDescriptorsRequest) Reset() { + *m = ListMonitoredResourceDescriptorsRequest{} +} +func (m *ListMonitoredResourceDescriptorsRequest) String() string { return proto.CompactTextString(m) } +func (*ListMonitoredResourceDescriptorsRequest) ProtoMessage() {} +func (*ListMonitoredResourceDescriptorsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor4, []int{0} +} + +func (m *ListMonitoredResourceDescriptorsRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ListMonitoredResourceDescriptorsRequest) GetFilter() string { + if m != nil { + return m.Filter + } + return "" +} + +func (m *ListMonitoredResourceDescriptorsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListMonitoredResourceDescriptorsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// The `ListMonitoredResourcDescriptors` response. +type ListMonitoredResourceDescriptorsResponse struct { + // The monitored resource descriptors that are available to this project + // and that match `filter`, if present. + ResourceDescriptors []*google_api4.MonitoredResourceDescriptor `protobuf:"bytes,1,rep,name=resource_descriptors,json=resourceDescriptors" json:"resource_descriptors,omitempty"` + // If there are more results than have been returned, then this field is set + // to a non-empty value. To see the additional results, + // use that value as `pageToken` in the next call to this method. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListMonitoredResourceDescriptorsResponse) Reset() { + *m = ListMonitoredResourceDescriptorsResponse{} +} +func (m *ListMonitoredResourceDescriptorsResponse) String() string { return proto.CompactTextString(m) } +func (*ListMonitoredResourceDescriptorsResponse) ProtoMessage() {} +func (*ListMonitoredResourceDescriptorsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor4, []int{1} +} + +func (m *ListMonitoredResourceDescriptorsResponse) GetResourceDescriptors() []*google_api4.MonitoredResourceDescriptor { + if m != nil { + return m.ResourceDescriptors + } + return nil +} + +func (m *ListMonitoredResourceDescriptorsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// The `GetMonitoredResourceDescriptor` request. +type GetMonitoredResourceDescriptorRequest struct { + // The monitored resource descriptor to get. The format is + // `"projects/{project_id_or_number}/monitoredResourceDescriptors/{resource_type}"`. + // The `{resource_type}` is a predefined type, such as + // `cloudsql_database`. + Name string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"` +} + +func (m *GetMonitoredResourceDescriptorRequest) Reset() { *m = GetMonitoredResourceDescriptorRequest{} } +func (m *GetMonitoredResourceDescriptorRequest) String() string { return proto.CompactTextString(m) } +func (*GetMonitoredResourceDescriptorRequest) ProtoMessage() {} +func (*GetMonitoredResourceDescriptorRequest) Descriptor() ([]byte, []int) { + return fileDescriptor4, []int{2} +} + +func (m *GetMonitoredResourceDescriptorRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// The `ListMetricDescriptors` request. +type ListMetricDescriptorsRequest struct { + // The project on which to execute the request. The format is + // `"projects/{project_id_or_number}"`. + Name string `protobuf:"bytes,5,opt,name=name" json:"name,omitempty"` + // If this field is empty, all custom and + // system-defined metric descriptors are returned. + // Otherwise, the [filter](/monitoring/api/v3/filters) + // specifies which metric descriptors are to be + // returned. For example, the following filter matches all + // [custom metrics](/monitoring/custom-metrics): + // + // metric.type = starts_with("custom.googleapis.com/") + Filter string `protobuf:"bytes,2,opt,name=filter" json:"filter,omitempty"` + // A positive number that is the maximum number of results to return. + PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // If this field is not empty then it must contain the `nextPageToken` value + // returned by a previous call to this method. Using this field causes the + // method to return additional results from the previous method call. + PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListMetricDescriptorsRequest) Reset() { *m = ListMetricDescriptorsRequest{} } +func (m *ListMetricDescriptorsRequest) String() string { return proto.CompactTextString(m) } +func (*ListMetricDescriptorsRequest) ProtoMessage() {} +func (*ListMetricDescriptorsRequest) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{3} } + +func (m *ListMetricDescriptorsRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ListMetricDescriptorsRequest) GetFilter() string { + if m != nil { + return m.Filter + } + return "" +} + +func (m *ListMetricDescriptorsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListMetricDescriptorsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// The `ListMetricDescriptors` response. +type ListMetricDescriptorsResponse struct { + // The metric descriptors that are available to the project + // and that match the value of `filter`, if present. + MetricDescriptors []*google_api5.MetricDescriptor `protobuf:"bytes,1,rep,name=metric_descriptors,json=metricDescriptors" json:"metric_descriptors,omitempty"` + // If there are more results than have been returned, then this field is set + // to a non-empty value. To see the additional results, + // use that value as `pageToken` in the next call to this method. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListMetricDescriptorsResponse) Reset() { *m = ListMetricDescriptorsResponse{} } +func (m *ListMetricDescriptorsResponse) String() string { return proto.CompactTextString(m) } +func (*ListMetricDescriptorsResponse) ProtoMessage() {} +func (*ListMetricDescriptorsResponse) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{4} } + +func (m *ListMetricDescriptorsResponse) GetMetricDescriptors() []*google_api5.MetricDescriptor { + if m != nil { + return m.MetricDescriptors + } + return nil +} + +func (m *ListMetricDescriptorsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// The `GetMetricDescriptor` request. +type GetMetricDescriptorRequest struct { + // The metric descriptor on which to execute the request. The format is + // `"projects/{project_id_or_number}/metricDescriptors/{metric_id}"`. + // An example value of `{metric_id}` is + // `"compute.googleapis.com/instance/disk/read_bytes_count"`. + Name string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"` +} + +func (m *GetMetricDescriptorRequest) Reset() { *m = GetMetricDescriptorRequest{} } +func (m *GetMetricDescriptorRequest) String() string { return proto.CompactTextString(m) } +func (*GetMetricDescriptorRequest) ProtoMessage() {} +func (*GetMetricDescriptorRequest) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{5} } + +func (m *GetMetricDescriptorRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// The `CreateMetricDescriptor` request. +type CreateMetricDescriptorRequest struct { + // The project on which to execute the request. The format is + // `"projects/{project_id_or_number}"`. + Name string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"` + // The new [custom metric](/monitoring/custom-metrics) + // descriptor. + MetricDescriptor *google_api5.MetricDescriptor `protobuf:"bytes,2,opt,name=metric_descriptor,json=metricDescriptor" json:"metric_descriptor,omitempty"` +} + +func (m *CreateMetricDescriptorRequest) Reset() { *m = CreateMetricDescriptorRequest{} } +func (m *CreateMetricDescriptorRequest) String() string { return proto.CompactTextString(m) } +func (*CreateMetricDescriptorRequest) ProtoMessage() {} +func (*CreateMetricDescriptorRequest) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{6} } + +func (m *CreateMetricDescriptorRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *CreateMetricDescriptorRequest) GetMetricDescriptor() *google_api5.MetricDescriptor { + if m != nil { + return m.MetricDescriptor + } + return nil +} + +// The `DeleteMetricDescriptor` request. +type DeleteMetricDescriptorRequest struct { + // The metric descriptor on which to execute the request. The format is + // `"projects/{project_id_or_number}/metricDescriptors/{metric_id}"`. + // An example of `{metric_id}` is: + // `"custom.googleapis.com/my_test_metric"`. + Name string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"` +} + +func (m *DeleteMetricDescriptorRequest) Reset() { *m = DeleteMetricDescriptorRequest{} } +func (m *DeleteMetricDescriptorRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteMetricDescriptorRequest) ProtoMessage() {} +func (*DeleteMetricDescriptorRequest) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{7} } + +func (m *DeleteMetricDescriptorRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// The `ListTimeSeries` request. +type ListTimeSeriesRequest struct { + // The project on which to execute the request. The format is + // "projects/{project_id_or_number}". + Name string `protobuf:"bytes,10,opt,name=name" json:"name,omitempty"` + // A [monitoring filter](/monitoring/api/v3/filters) that specifies which time + // series should be returned. The filter must specify a single metric type, + // and can additionally specify metric labels and other information. For + // example: + // + // metric.type = "compute.googleapis.com/instance/cpu/usage_time" AND + // metric.label.instance_name = "my-instance-name" + Filter string `protobuf:"bytes,2,opt,name=filter" json:"filter,omitempty"` + // The time interval for which results should be returned. Only time series + // that contain data points in the specified interval are included + // in the response. + Interval *TimeInterval `protobuf:"bytes,4,opt,name=interval" json:"interval,omitempty"` + // By default, the raw time series data is returned. + // Use this field to combine multiple time series for different + // views of the data. + Aggregation *Aggregation `protobuf:"bytes,5,opt,name=aggregation" json:"aggregation,omitempty"` + // Specifies the order in which the points of the time series should + // be returned. By default, results are not ordered. Currently, + // this field must be left blank. + OrderBy string `protobuf:"bytes,6,opt,name=order_by,json=orderBy" json:"order_by,omitempty"` + // Specifies which information is returned about the time series. + View ListTimeSeriesRequest_TimeSeriesView `protobuf:"varint,7,opt,name=view,enum=google.monitoring.v3.ListTimeSeriesRequest_TimeSeriesView" json:"view,omitempty"` + // A positive number that is the maximum number of results to return. + // When `view` field sets to `FULL`, it limits the number of `Points` server + // will return; if `view` field is `HEADERS`, it limits the number of + // `TimeSeries` server will return. + PageSize int32 `protobuf:"varint,8,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // If this field is not empty then it must contain the `nextPageToken` value + // returned by a previous call to this method. Using this field causes the + // method to return additional results from the previous method call. + PageToken string `protobuf:"bytes,9,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListTimeSeriesRequest) Reset() { *m = ListTimeSeriesRequest{} } +func (m *ListTimeSeriesRequest) String() string { return proto.CompactTextString(m) } +func (*ListTimeSeriesRequest) ProtoMessage() {} +func (*ListTimeSeriesRequest) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{8} } + +func (m *ListTimeSeriesRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ListTimeSeriesRequest) GetFilter() string { + if m != nil { + return m.Filter + } + return "" +} + +func (m *ListTimeSeriesRequest) GetInterval() *TimeInterval { + if m != nil { + return m.Interval + } + return nil +} + +func (m *ListTimeSeriesRequest) GetAggregation() *Aggregation { + if m != nil { + return m.Aggregation + } + return nil +} + +func (m *ListTimeSeriesRequest) GetOrderBy() string { + if m != nil { + return m.OrderBy + } + return "" +} + +func (m *ListTimeSeriesRequest) GetView() ListTimeSeriesRequest_TimeSeriesView { + if m != nil { + return m.View + } + return ListTimeSeriesRequest_FULL +} + +func (m *ListTimeSeriesRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListTimeSeriesRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// The `ListTimeSeries` response. +type ListTimeSeriesResponse struct { + // One or more time series that match the filter included in the request. + TimeSeries []*TimeSeries `protobuf:"bytes,1,rep,name=time_series,json=timeSeries" json:"time_series,omitempty"` + // If there are more results than have been returned, then this field is set + // to a non-empty value. To see the additional results, + // use that value as `pageToken` in the next call to this method. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListTimeSeriesResponse) Reset() { *m = ListTimeSeriesResponse{} } +func (m *ListTimeSeriesResponse) String() string { return proto.CompactTextString(m) } +func (*ListTimeSeriesResponse) ProtoMessage() {} +func (*ListTimeSeriesResponse) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{9} } + +func (m *ListTimeSeriesResponse) GetTimeSeries() []*TimeSeries { + if m != nil { + return m.TimeSeries + } + return nil +} + +func (m *ListTimeSeriesResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// The `CreateTimeSeries` request. +type CreateTimeSeriesRequest struct { + // The project on which to execute the request. The format is + // `"projects/{project_id_or_number}"`. + Name string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"` + // The new data to be added to a list of time series. + // Adds at most one data point to each of several time series. The new data + // point must be more recent than any other point in its time series. Each + // `TimeSeries` value must fully specify a unique time series by supplying + // all label values for the metric and the monitored resource. + TimeSeries []*TimeSeries `protobuf:"bytes,2,rep,name=time_series,json=timeSeries" json:"time_series,omitempty"` +} + +func (m *CreateTimeSeriesRequest) Reset() { *m = CreateTimeSeriesRequest{} } +func (m *CreateTimeSeriesRequest) String() string { return proto.CompactTextString(m) } +func (*CreateTimeSeriesRequest) ProtoMessage() {} +func (*CreateTimeSeriesRequest) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{10} } + +func (m *CreateTimeSeriesRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *CreateTimeSeriesRequest) GetTimeSeries() []*TimeSeries { + if m != nil { + return m.TimeSeries + } + return nil +} + +// Describes the result of a failed request to write data to a time series. +type CreateTimeSeriesError struct { + // The time series, including the `Metric`, `MonitoredResource`, + // and `Point`s (including timestamp and value) that resulted + // in the error. This field provides all of the context that + // would be needed to retry the operation. + TimeSeries *TimeSeries `protobuf:"bytes,1,opt,name=time_series,json=timeSeries" json:"time_series,omitempty"` + // The status of the requested write operation. + Status *google_rpc.Status `protobuf:"bytes,2,opt,name=status" json:"status,omitempty"` +} + +func (m *CreateTimeSeriesError) Reset() { *m = CreateTimeSeriesError{} } +func (m *CreateTimeSeriesError) String() string { return proto.CompactTextString(m) } +func (*CreateTimeSeriesError) ProtoMessage() {} +func (*CreateTimeSeriesError) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{11} } + +func (m *CreateTimeSeriesError) GetTimeSeries() *TimeSeries { + if m != nil { + return m.TimeSeries + } + return nil +} + +func (m *CreateTimeSeriesError) GetStatus() *google_rpc.Status { + if m != nil { + return m.Status + } + return nil +} + +func init() { + proto.RegisterType((*ListMonitoredResourceDescriptorsRequest)(nil), "google.monitoring.v3.ListMonitoredResourceDescriptorsRequest") + proto.RegisterType((*ListMonitoredResourceDescriptorsResponse)(nil), "google.monitoring.v3.ListMonitoredResourceDescriptorsResponse") + proto.RegisterType((*GetMonitoredResourceDescriptorRequest)(nil), "google.monitoring.v3.GetMonitoredResourceDescriptorRequest") + proto.RegisterType((*ListMetricDescriptorsRequest)(nil), "google.monitoring.v3.ListMetricDescriptorsRequest") + proto.RegisterType((*ListMetricDescriptorsResponse)(nil), "google.monitoring.v3.ListMetricDescriptorsResponse") + proto.RegisterType((*GetMetricDescriptorRequest)(nil), "google.monitoring.v3.GetMetricDescriptorRequest") + proto.RegisterType((*CreateMetricDescriptorRequest)(nil), "google.monitoring.v3.CreateMetricDescriptorRequest") + proto.RegisterType((*DeleteMetricDescriptorRequest)(nil), "google.monitoring.v3.DeleteMetricDescriptorRequest") + proto.RegisterType((*ListTimeSeriesRequest)(nil), "google.monitoring.v3.ListTimeSeriesRequest") + proto.RegisterType((*ListTimeSeriesResponse)(nil), "google.monitoring.v3.ListTimeSeriesResponse") + proto.RegisterType((*CreateTimeSeriesRequest)(nil), "google.monitoring.v3.CreateTimeSeriesRequest") + proto.RegisterType((*CreateTimeSeriesError)(nil), "google.monitoring.v3.CreateTimeSeriesError") + proto.RegisterEnum("google.monitoring.v3.ListTimeSeriesRequest_TimeSeriesView", ListTimeSeriesRequest_TimeSeriesView_name, ListTimeSeriesRequest_TimeSeriesView_value) +} + +// 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 + +// Client API for MetricService service + +type MetricServiceClient interface { + // Lists monitored resource descriptors that match a filter. This method does not require a Stackdriver account. + ListMonitoredResourceDescriptors(ctx context.Context, in *ListMonitoredResourceDescriptorsRequest, opts ...grpc.CallOption) (*ListMonitoredResourceDescriptorsResponse, error) + // Gets a single monitored resource descriptor. This method does not require a Stackdriver account. + GetMonitoredResourceDescriptor(ctx context.Context, in *GetMonitoredResourceDescriptorRequest, opts ...grpc.CallOption) (*google_api4.MonitoredResourceDescriptor, error) + // Lists metric descriptors that match a filter. This method does not require a Stackdriver account. + ListMetricDescriptors(ctx context.Context, in *ListMetricDescriptorsRequest, opts ...grpc.CallOption) (*ListMetricDescriptorsResponse, error) + // Gets a single metric descriptor. This method does not require a Stackdriver account. + GetMetricDescriptor(ctx context.Context, in *GetMetricDescriptorRequest, opts ...grpc.CallOption) (*google_api5.MetricDescriptor, error) + // Creates a new metric descriptor. + // User-created metric descriptors define + // [custom metrics](/monitoring/custom-metrics). + CreateMetricDescriptor(ctx context.Context, in *CreateMetricDescriptorRequest, opts ...grpc.CallOption) (*google_api5.MetricDescriptor, error) + // Deletes a metric descriptor. Only user-created + // [custom metrics](/monitoring/custom-metrics) can be deleted. + DeleteMetricDescriptor(ctx context.Context, in *DeleteMetricDescriptorRequest, opts ...grpc.CallOption) (*google_protobuf4.Empty, error) + // Lists time series that match a filter. This method does not require a Stackdriver account. + ListTimeSeries(ctx context.Context, in *ListTimeSeriesRequest, opts ...grpc.CallOption) (*ListTimeSeriesResponse, error) + // Creates or adds data to one or more time series. + // The response is empty if all time series in the request were written. + // If any time series could not be written, a corresponding failure message is + // included in the error response. + CreateTimeSeries(ctx context.Context, in *CreateTimeSeriesRequest, opts ...grpc.CallOption) (*google_protobuf4.Empty, error) +} + +type metricServiceClient struct { + cc *grpc.ClientConn +} + +func NewMetricServiceClient(cc *grpc.ClientConn) MetricServiceClient { + return &metricServiceClient{cc} +} + +func (c *metricServiceClient) ListMonitoredResourceDescriptors(ctx context.Context, in *ListMonitoredResourceDescriptorsRequest, opts ...grpc.CallOption) (*ListMonitoredResourceDescriptorsResponse, error) { + out := new(ListMonitoredResourceDescriptorsResponse) + err := grpc.Invoke(ctx, "/google.monitoring.v3.MetricService/ListMonitoredResourceDescriptors", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *metricServiceClient) GetMonitoredResourceDescriptor(ctx context.Context, in *GetMonitoredResourceDescriptorRequest, opts ...grpc.CallOption) (*google_api4.MonitoredResourceDescriptor, error) { + out := new(google_api4.MonitoredResourceDescriptor) + err := grpc.Invoke(ctx, "/google.monitoring.v3.MetricService/GetMonitoredResourceDescriptor", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *metricServiceClient) ListMetricDescriptors(ctx context.Context, in *ListMetricDescriptorsRequest, opts ...grpc.CallOption) (*ListMetricDescriptorsResponse, error) { + out := new(ListMetricDescriptorsResponse) + err := grpc.Invoke(ctx, "/google.monitoring.v3.MetricService/ListMetricDescriptors", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *metricServiceClient) GetMetricDescriptor(ctx context.Context, in *GetMetricDescriptorRequest, opts ...grpc.CallOption) (*google_api5.MetricDescriptor, error) { + out := new(google_api5.MetricDescriptor) + err := grpc.Invoke(ctx, "/google.monitoring.v3.MetricService/GetMetricDescriptor", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *metricServiceClient) CreateMetricDescriptor(ctx context.Context, in *CreateMetricDescriptorRequest, opts ...grpc.CallOption) (*google_api5.MetricDescriptor, error) { + out := new(google_api5.MetricDescriptor) + err := grpc.Invoke(ctx, "/google.monitoring.v3.MetricService/CreateMetricDescriptor", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *metricServiceClient) DeleteMetricDescriptor(ctx context.Context, in *DeleteMetricDescriptorRequest, opts ...grpc.CallOption) (*google_protobuf4.Empty, error) { + out := new(google_protobuf4.Empty) + err := grpc.Invoke(ctx, "/google.monitoring.v3.MetricService/DeleteMetricDescriptor", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *metricServiceClient) ListTimeSeries(ctx context.Context, in *ListTimeSeriesRequest, opts ...grpc.CallOption) (*ListTimeSeriesResponse, error) { + out := new(ListTimeSeriesResponse) + err := grpc.Invoke(ctx, "/google.monitoring.v3.MetricService/ListTimeSeries", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *metricServiceClient) CreateTimeSeries(ctx context.Context, in *CreateTimeSeriesRequest, opts ...grpc.CallOption) (*google_protobuf4.Empty, error) { + out := new(google_protobuf4.Empty) + err := grpc.Invoke(ctx, "/google.monitoring.v3.MetricService/CreateTimeSeries", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for MetricService service + +type MetricServiceServer interface { + // Lists monitored resource descriptors that match a filter. This method does not require a Stackdriver account. + ListMonitoredResourceDescriptors(context.Context, *ListMonitoredResourceDescriptorsRequest) (*ListMonitoredResourceDescriptorsResponse, error) + // Gets a single monitored resource descriptor. This method does not require a Stackdriver account. + GetMonitoredResourceDescriptor(context.Context, *GetMonitoredResourceDescriptorRequest) (*google_api4.MonitoredResourceDescriptor, error) + // Lists metric descriptors that match a filter. This method does not require a Stackdriver account. + ListMetricDescriptors(context.Context, *ListMetricDescriptorsRequest) (*ListMetricDescriptorsResponse, error) + // Gets a single metric descriptor. This method does not require a Stackdriver account. + GetMetricDescriptor(context.Context, *GetMetricDescriptorRequest) (*google_api5.MetricDescriptor, error) + // Creates a new metric descriptor. + // User-created metric descriptors define + // [custom metrics](/monitoring/custom-metrics). + CreateMetricDescriptor(context.Context, *CreateMetricDescriptorRequest) (*google_api5.MetricDescriptor, error) + // Deletes a metric descriptor. Only user-created + // [custom metrics](/monitoring/custom-metrics) can be deleted. + DeleteMetricDescriptor(context.Context, *DeleteMetricDescriptorRequest) (*google_protobuf4.Empty, error) + // Lists time series that match a filter. This method does not require a Stackdriver account. + ListTimeSeries(context.Context, *ListTimeSeriesRequest) (*ListTimeSeriesResponse, error) + // Creates or adds data to one or more time series. + // The response is empty if all time series in the request were written. + // If any time series could not be written, a corresponding failure message is + // included in the error response. + CreateTimeSeries(context.Context, *CreateTimeSeriesRequest) (*google_protobuf4.Empty, error) +} + +func RegisterMetricServiceServer(s *grpc.Server, srv MetricServiceServer) { + s.RegisterService(&_MetricService_serviceDesc, srv) +} + +func _MetricService_ListMonitoredResourceDescriptors_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListMonitoredResourceDescriptorsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetricServiceServer).ListMonitoredResourceDescriptors(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.monitoring.v3.MetricService/ListMonitoredResourceDescriptors", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetricServiceServer).ListMonitoredResourceDescriptors(ctx, req.(*ListMonitoredResourceDescriptorsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MetricService_GetMonitoredResourceDescriptor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetMonitoredResourceDescriptorRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetricServiceServer).GetMonitoredResourceDescriptor(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.monitoring.v3.MetricService/GetMonitoredResourceDescriptor", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetricServiceServer).GetMonitoredResourceDescriptor(ctx, req.(*GetMonitoredResourceDescriptorRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MetricService_ListMetricDescriptors_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListMetricDescriptorsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetricServiceServer).ListMetricDescriptors(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.monitoring.v3.MetricService/ListMetricDescriptors", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetricServiceServer).ListMetricDescriptors(ctx, req.(*ListMetricDescriptorsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MetricService_GetMetricDescriptor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetMetricDescriptorRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetricServiceServer).GetMetricDescriptor(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.monitoring.v3.MetricService/GetMetricDescriptor", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetricServiceServer).GetMetricDescriptor(ctx, req.(*GetMetricDescriptorRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MetricService_CreateMetricDescriptor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateMetricDescriptorRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetricServiceServer).CreateMetricDescriptor(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.monitoring.v3.MetricService/CreateMetricDescriptor", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetricServiceServer).CreateMetricDescriptor(ctx, req.(*CreateMetricDescriptorRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MetricService_DeleteMetricDescriptor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteMetricDescriptorRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetricServiceServer).DeleteMetricDescriptor(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.monitoring.v3.MetricService/DeleteMetricDescriptor", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetricServiceServer).DeleteMetricDescriptor(ctx, req.(*DeleteMetricDescriptorRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MetricService_ListTimeSeries_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListTimeSeriesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetricServiceServer).ListTimeSeries(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.monitoring.v3.MetricService/ListTimeSeries", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetricServiceServer).ListTimeSeries(ctx, req.(*ListTimeSeriesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MetricService_CreateTimeSeries_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateTimeSeriesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetricServiceServer).CreateTimeSeries(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.monitoring.v3.MetricService/CreateTimeSeries", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetricServiceServer).CreateTimeSeries(ctx, req.(*CreateTimeSeriesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _MetricService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.monitoring.v3.MetricService", + HandlerType: (*MetricServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListMonitoredResourceDescriptors", + Handler: _MetricService_ListMonitoredResourceDescriptors_Handler, + }, + { + MethodName: "GetMonitoredResourceDescriptor", + Handler: _MetricService_GetMonitoredResourceDescriptor_Handler, + }, + { + MethodName: "ListMetricDescriptors", + Handler: _MetricService_ListMetricDescriptors_Handler, + }, + { + MethodName: "GetMetricDescriptor", + Handler: _MetricService_GetMetricDescriptor_Handler, + }, + { + MethodName: "CreateMetricDescriptor", + Handler: _MetricService_CreateMetricDescriptor_Handler, + }, + { + MethodName: "DeleteMetricDescriptor", + Handler: _MetricService_DeleteMetricDescriptor_Handler, + }, + { + MethodName: "ListTimeSeries", + Handler: _MetricService_ListTimeSeries_Handler, + }, + { + MethodName: "CreateTimeSeries", + Handler: _MetricService_CreateTimeSeries_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/monitoring/v3/metric_service.proto", +} + +func init() { proto.RegisterFile("google/monitoring/v3/metric_service.proto", fileDescriptor4) } + +var fileDescriptor4 = []byte{ + // 1011 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0x4d, 0x6f, 0x1b, 0x45, + 0x18, 0x66, 0x92, 0x34, 0x1f, 0xaf, 0xd5, 0x90, 0x4e, 0x5b, 0xd7, 0x6c, 0x13, 0xe4, 0x2e, 0x2a, + 0x71, 0xdd, 0xb2, 0x5b, 0xd9, 0x15, 0x87, 0xa4, 0x8d, 0x94, 0x2f, 0x4a, 0x45, 0x40, 0xd1, 0xba, + 0xe4, 0x50, 0x45, 0xb2, 0x36, 0xce, 0x74, 0x35, 0xe0, 0xdd, 0x59, 0x66, 0xc7, 0x2e, 0x29, 0x0a, + 0x07, 0x90, 0x7a, 0x47, 0x80, 0x04, 0x7f, 0xa1, 0x07, 0x10, 0xff, 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xf1, 0x58, 0x1a, 0x8f, 0x07, 0xc6, 0xe3, 0xa3, + 0xe6, 0xc9, 0xbc, 0x2c, 0xd2, 0xfc, 0x37, 0x00, 0x00, 0xff, 0xff, 0x6b, 0x96, 0x3c, 0x74, 0xeb, + 0x0d, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/privacy/dlp/v2beta1/dlp.pb.go b/vendor/google.golang.org/genproto/googleapis/privacy/dlp/v2beta1/dlp.pb.go new file mode 100644 index 0000000000..7d2fc2fdbb --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/privacy/dlp/v2beta1/dlp.pb.go @@ -0,0 +1,5610 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/privacy/dlp/v2beta1/dlp.proto + +/* +Package dlp is a generated protocol buffer package. + +It is generated from these files: + google/privacy/dlp/v2beta1/dlp.proto + google/privacy/dlp/v2beta1/storage.proto + +It has these top-level messages: + InspectConfig + OperationConfig + ContentItem + Table + InspectResult + Finding + Location + TableLocation + Range + ImageLocation + RedactContentRequest + Color + RedactContentResponse + DeidentifyContentRequest + DeidentifyContentResponse + InspectContentRequest + InspectContentResponse + CreateInspectOperationRequest + OutputStorageConfig + InfoTypeStatistics + InspectOperationMetadata + InspectOperationResult + ListInspectFindingsRequest + ListInspectFindingsResponse + InfoTypeDescription + ListInfoTypesRequest + ListInfoTypesResponse + CategoryDescription + ListRootCategoriesRequest + ListRootCategoriesResponse + AnalyzeDataSourceRiskRequest + PrivacyMetric + RiskAnalysisOperationMetadata + RiskAnalysisOperationResult + ValueFrequency + Value + DeidentifyConfig + PrimitiveTransformation + TimePartConfig + CryptoHashConfig + ReplaceValueConfig + ReplaceWithInfoTypeConfig + RedactConfig + CharsToIgnore + CharacterMaskConfig + FixedSizeBucketingConfig + BucketingConfig + CryptoReplaceFfxFpeConfig + CryptoKey + TransientCryptoKey + UnwrappedCryptoKey + KmsWrappedCryptoKey + InfoTypeTransformations + FieldTransformation + RecordTransformations + RecordSuppression + RecordCondition + DeidentificationSummary + TransformationSummary + InfoType + CustomInfoType + FieldId + PartitionId + KindExpression + PropertyReference + Projection + DatastoreOptions + CloudStorageOptions + CloudStoragePath + BigQueryOptions + StorageConfig + CloudStorageKey + DatastoreKey + Key + RecordKey + BigQueryTable + EntityId +*/ +package dlp + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_longrunning "google.golang.org/genproto/googleapis/longrunning" +import _ "github.com/golang/protobuf/ptypes/empty" +import google_protobuf3 "github.com/golang/protobuf/ptypes/timestamp" +import google_type "google.golang.org/genproto/googleapis/type/date" +import google_type1 "google.golang.org/genproto/googleapis/type/timeofday" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Categorization of results based on how likely they are to represent a match, +// based on the number of elements they contain which imply a match. +type Likelihood int32 + +const ( + // Default value; information with all likelihoods is included. + Likelihood_LIKELIHOOD_UNSPECIFIED Likelihood = 0 + // Few matching elements. + Likelihood_VERY_UNLIKELY Likelihood = 1 + Likelihood_UNLIKELY Likelihood = 2 + // Some matching elements. + Likelihood_POSSIBLE Likelihood = 3 + Likelihood_LIKELY Likelihood = 4 + // Many matching elements. + Likelihood_VERY_LIKELY Likelihood = 5 +) + +var Likelihood_name = map[int32]string{ + 0: "LIKELIHOOD_UNSPECIFIED", + 1: "VERY_UNLIKELY", + 2: "UNLIKELY", + 3: "POSSIBLE", + 4: "LIKELY", + 5: "VERY_LIKELY", +} +var Likelihood_value = map[string]int32{ + "LIKELIHOOD_UNSPECIFIED": 0, + "VERY_UNLIKELY": 1, + "UNLIKELY": 2, + "POSSIBLE": 3, + "LIKELY": 4, + "VERY_LIKELY": 5, +} + +func (x Likelihood) String() string { + return proto.EnumName(Likelihood_name, int32(x)) +} +func (Likelihood) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +// Operators available for comparing the value of fields. +type RelationalOperator int32 + +const ( + RelationalOperator_RELATIONAL_OPERATOR_UNSPECIFIED RelationalOperator = 0 + // Equal. + RelationalOperator_EQUAL_TO RelationalOperator = 1 + // Not equal to. + RelationalOperator_NOT_EQUAL_TO RelationalOperator = 2 + // Greater than. + RelationalOperator_GREATER_THAN RelationalOperator = 3 + // Less than. + RelationalOperator_LESS_THAN RelationalOperator = 4 + // Greater than or equals. + RelationalOperator_GREATER_THAN_OR_EQUALS RelationalOperator = 5 + // Less than or equals. + RelationalOperator_LESS_THAN_OR_EQUALS RelationalOperator = 6 + // Exists + RelationalOperator_EXISTS RelationalOperator = 7 +) + +var RelationalOperator_name = map[int32]string{ + 0: "RELATIONAL_OPERATOR_UNSPECIFIED", + 1: "EQUAL_TO", + 2: "NOT_EQUAL_TO", + 3: "GREATER_THAN", + 4: "LESS_THAN", + 5: "GREATER_THAN_OR_EQUALS", + 6: "LESS_THAN_OR_EQUALS", + 7: "EXISTS", +} +var RelationalOperator_value = map[string]int32{ + "RELATIONAL_OPERATOR_UNSPECIFIED": 0, + "EQUAL_TO": 1, + "NOT_EQUAL_TO": 2, + "GREATER_THAN": 3, + "LESS_THAN": 4, + "GREATER_THAN_OR_EQUALS": 5, + "LESS_THAN_OR_EQUALS": 6, + "EXISTS": 7, +} + +func (x RelationalOperator) String() string { + return proto.EnumName(RelationalOperator_name, int32(x)) +} +func (RelationalOperator) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +type TimePartConfig_TimePart int32 + +const ( + TimePartConfig_TIME_PART_UNSPECIFIED TimePartConfig_TimePart = 0 + // [000-9999] + TimePartConfig_YEAR TimePartConfig_TimePart = 1 + // [1-12] + TimePartConfig_MONTH TimePartConfig_TimePart = 2 + // [1-31] + TimePartConfig_DAY_OF_MONTH TimePartConfig_TimePart = 3 + // [1-7] + TimePartConfig_DAY_OF_WEEK TimePartConfig_TimePart = 4 + // [1-52] + TimePartConfig_WEEK_OF_YEAR TimePartConfig_TimePart = 5 + // [0-24] + TimePartConfig_HOUR_OF_DAY TimePartConfig_TimePart = 6 +) + +var TimePartConfig_TimePart_name = map[int32]string{ + 0: "TIME_PART_UNSPECIFIED", + 1: "YEAR", + 2: "MONTH", + 3: "DAY_OF_MONTH", + 4: "DAY_OF_WEEK", + 5: "WEEK_OF_YEAR", + 6: "HOUR_OF_DAY", +} +var TimePartConfig_TimePart_value = map[string]int32{ + "TIME_PART_UNSPECIFIED": 0, + "YEAR": 1, + "MONTH": 2, + "DAY_OF_MONTH": 3, + "DAY_OF_WEEK": 4, + "WEEK_OF_YEAR": 5, + "HOUR_OF_DAY": 6, +} + +func (x TimePartConfig_TimePart) String() string { + return proto.EnumName(TimePartConfig_TimePart_name, int32(x)) +} +func (TimePartConfig_TimePart) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{38, 0} } + +type CharsToIgnore_CharacterGroup int32 + +const ( + CharsToIgnore_CHARACTER_GROUP_UNSPECIFIED CharsToIgnore_CharacterGroup = 0 + // 0-9 + CharsToIgnore_NUMERIC CharsToIgnore_CharacterGroup = 1 + // A-Z + CharsToIgnore_ALPHA_UPPER_CASE CharsToIgnore_CharacterGroup = 2 + // a-z + CharsToIgnore_ALPHA_LOWER_CASE CharsToIgnore_CharacterGroup = 3 + // US Punctuation, one of !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ + CharsToIgnore_PUNCTUATION CharsToIgnore_CharacterGroup = 4 + // Whitespace character, one of [ \t\n\x0B\f\r] + CharsToIgnore_WHITESPACE CharsToIgnore_CharacterGroup = 5 +) + +var CharsToIgnore_CharacterGroup_name = map[int32]string{ + 0: "CHARACTER_GROUP_UNSPECIFIED", + 1: "NUMERIC", + 2: "ALPHA_UPPER_CASE", + 3: "ALPHA_LOWER_CASE", + 4: "PUNCTUATION", + 5: "WHITESPACE", +} +var CharsToIgnore_CharacterGroup_value = map[string]int32{ + "CHARACTER_GROUP_UNSPECIFIED": 0, + "NUMERIC": 1, + "ALPHA_UPPER_CASE": 2, + "ALPHA_LOWER_CASE": 3, + "PUNCTUATION": 4, + "WHITESPACE": 5, +} + +func (x CharsToIgnore_CharacterGroup) String() string { + return proto.EnumName(CharsToIgnore_CharacterGroup_name, int32(x)) +} +func (CharsToIgnore_CharacterGroup) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{43, 0} +} + +// These are commonly used subsets of the alphabet that the FFX mode +// natively supports. In the algorithm, the alphabet is selected using +// the "radix". Therefore each corresponds to particular radix. +type CryptoReplaceFfxFpeConfig_FfxCommonNativeAlphabet int32 + +const ( + CryptoReplaceFfxFpeConfig_FFX_COMMON_NATIVE_ALPHABET_UNSPECIFIED CryptoReplaceFfxFpeConfig_FfxCommonNativeAlphabet = 0 + // [0-9] (radix of 10) + CryptoReplaceFfxFpeConfig_NUMERIC CryptoReplaceFfxFpeConfig_FfxCommonNativeAlphabet = 1 + // [0-9A-F] (radix of 16) + CryptoReplaceFfxFpeConfig_HEXADECIMAL CryptoReplaceFfxFpeConfig_FfxCommonNativeAlphabet = 2 + // [0-9A-Z] (radix of 36) + CryptoReplaceFfxFpeConfig_UPPER_CASE_ALPHA_NUMERIC CryptoReplaceFfxFpeConfig_FfxCommonNativeAlphabet = 3 + // [0-9A-Za-z] (radix of 62) + CryptoReplaceFfxFpeConfig_ALPHA_NUMERIC CryptoReplaceFfxFpeConfig_FfxCommonNativeAlphabet = 4 +) + +var CryptoReplaceFfxFpeConfig_FfxCommonNativeAlphabet_name = map[int32]string{ + 0: "FFX_COMMON_NATIVE_ALPHABET_UNSPECIFIED", + 1: "NUMERIC", + 2: "HEXADECIMAL", + 3: "UPPER_CASE_ALPHA_NUMERIC", + 4: "ALPHA_NUMERIC", +} +var CryptoReplaceFfxFpeConfig_FfxCommonNativeAlphabet_value = map[string]int32{ + "FFX_COMMON_NATIVE_ALPHABET_UNSPECIFIED": 0, + "NUMERIC": 1, + "HEXADECIMAL": 2, + "UPPER_CASE_ALPHA_NUMERIC": 3, + "ALPHA_NUMERIC": 4, +} + +func (x CryptoReplaceFfxFpeConfig_FfxCommonNativeAlphabet) String() string { + return proto.EnumName(CryptoReplaceFfxFpeConfig_FfxCommonNativeAlphabet_name, int32(x)) +} +func (CryptoReplaceFfxFpeConfig_FfxCommonNativeAlphabet) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{47, 0} +} + +type RecordCondition_Expressions_LogicalOperator int32 + +const ( + RecordCondition_Expressions_LOGICAL_OPERATOR_UNSPECIFIED RecordCondition_Expressions_LogicalOperator = 0 + RecordCondition_Expressions_AND RecordCondition_Expressions_LogicalOperator = 1 +) + +var RecordCondition_Expressions_LogicalOperator_name = map[int32]string{ + 0: "LOGICAL_OPERATOR_UNSPECIFIED", + 1: "AND", +} +var RecordCondition_Expressions_LogicalOperator_value = map[string]int32{ + "LOGICAL_OPERATOR_UNSPECIFIED": 0, + "AND": 1, +} + +func (x RecordCondition_Expressions_LogicalOperator) String() string { + return proto.EnumName(RecordCondition_Expressions_LogicalOperator_name, int32(x)) +} +func (RecordCondition_Expressions_LogicalOperator) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{56, 2, 0} +} + +// Possible outcomes of transformations. +type TransformationSummary_TransformationResultCode int32 + +const ( + TransformationSummary_TRANSFORMATION_RESULT_CODE_UNSPECIFIED TransformationSummary_TransformationResultCode = 0 + TransformationSummary_SUCCESS TransformationSummary_TransformationResultCode = 1 + TransformationSummary_ERROR TransformationSummary_TransformationResultCode = 2 +) + +var TransformationSummary_TransformationResultCode_name = map[int32]string{ + 0: "TRANSFORMATION_RESULT_CODE_UNSPECIFIED", + 1: "SUCCESS", + 2: "ERROR", +} +var TransformationSummary_TransformationResultCode_value = map[string]int32{ + "TRANSFORMATION_RESULT_CODE_UNSPECIFIED": 0, + "SUCCESS": 1, + "ERROR": 2, +} + +func (x TransformationSummary_TransformationResultCode) String() string { + return proto.EnumName(TransformationSummary_TransformationResultCode_name, int32(x)) +} +func (TransformationSummary_TransformationResultCode) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{58, 0} +} + +// Configuration description of the scanning process. +// When used with redactContent only info_types and min_likelihood are currently +// used. +type InspectConfig struct { + // Restricts what info_types to look for. The values must correspond to + // InfoType values returned by ListInfoTypes or found in documentation. + // Empty info_types runs all enabled detectors. + InfoTypes []*InfoType `protobuf:"bytes,1,rep,name=info_types,json=infoTypes" json:"info_types,omitempty"` + // Only returns findings equal or above this threshold. + MinLikelihood Likelihood `protobuf:"varint,2,opt,name=min_likelihood,json=minLikelihood,enum=google.privacy.dlp.v2beta1.Likelihood" json:"min_likelihood,omitempty"` + // Limits the number of findings per content item or long running operation. + MaxFindings int32 `protobuf:"varint,3,opt,name=max_findings,json=maxFindings" json:"max_findings,omitempty"` + // When true, a contextual quote from the data that triggered a finding is + // included in the response; see Finding.quote. + IncludeQuote bool `protobuf:"varint,4,opt,name=include_quote,json=includeQuote" json:"include_quote,omitempty"` + // When true, excludes type information of the findings. + ExcludeTypes bool `protobuf:"varint,6,opt,name=exclude_types,json=excludeTypes" json:"exclude_types,omitempty"` + // Configuration of findings limit given for specified info types. + InfoTypeLimits []*InspectConfig_InfoTypeLimit `protobuf:"bytes,7,rep,name=info_type_limits,json=infoTypeLimits" json:"info_type_limits,omitempty"` + // Custom info types provided by the user. + CustomInfoTypes []*CustomInfoType `protobuf:"bytes,8,rep,name=custom_info_types,json=customInfoTypes" json:"custom_info_types,omitempty"` +} + +func (m *InspectConfig) Reset() { *m = InspectConfig{} } +func (m *InspectConfig) String() string { return proto.CompactTextString(m) } +func (*InspectConfig) ProtoMessage() {} +func (*InspectConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *InspectConfig) GetInfoTypes() []*InfoType { + if m != nil { + return m.InfoTypes + } + return nil +} + +func (m *InspectConfig) GetMinLikelihood() Likelihood { + if m != nil { + return m.MinLikelihood + } + return Likelihood_LIKELIHOOD_UNSPECIFIED +} + +func (m *InspectConfig) GetMaxFindings() int32 { + if m != nil { + return m.MaxFindings + } + return 0 +} + +func (m *InspectConfig) GetIncludeQuote() bool { + if m != nil { + return m.IncludeQuote + } + return false +} + +func (m *InspectConfig) GetExcludeTypes() bool { + if m != nil { + return m.ExcludeTypes + } + return false +} + +func (m *InspectConfig) GetInfoTypeLimits() []*InspectConfig_InfoTypeLimit { + if m != nil { + return m.InfoTypeLimits + } + return nil +} + +func (m *InspectConfig) GetCustomInfoTypes() []*CustomInfoType { + if m != nil { + return m.CustomInfoTypes + } + return nil +} + +// Max findings configuration per info type, per content item or long running +// operation. +type InspectConfig_InfoTypeLimit struct { + // Type of information the findings limit applies to. Only one limit per + // info_type should be provided. If InfoTypeLimit does not have an + // info_type, the DLP API applies the limit against all info_types that are + // found but not specified in another InfoTypeLimit. + InfoType *InfoType `protobuf:"bytes,1,opt,name=info_type,json=infoType" json:"info_type,omitempty"` + // Max findings limit for the given infoType. + MaxFindings int32 `protobuf:"varint,2,opt,name=max_findings,json=maxFindings" json:"max_findings,omitempty"` +} + +func (m *InspectConfig_InfoTypeLimit) Reset() { *m = InspectConfig_InfoTypeLimit{} } +func (m *InspectConfig_InfoTypeLimit) String() string { return proto.CompactTextString(m) } +func (*InspectConfig_InfoTypeLimit) ProtoMessage() {} +func (*InspectConfig_InfoTypeLimit) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 0} } + +func (m *InspectConfig_InfoTypeLimit) GetInfoType() *InfoType { + if m != nil { + return m.InfoType + } + return nil +} + +func (m *InspectConfig_InfoTypeLimit) GetMaxFindings() int32 { + if m != nil { + return m.MaxFindings + } + return 0 +} + +// Additional configuration for inspect long running operations. +type OperationConfig struct { + // Max number of findings per file, Datastore entity, or database row. + MaxItemFindings int64 `protobuf:"varint,1,opt,name=max_item_findings,json=maxItemFindings" json:"max_item_findings,omitempty"` +} + +func (m *OperationConfig) Reset() { *m = OperationConfig{} } +func (m *OperationConfig) String() string { return proto.CompactTextString(m) } +func (*OperationConfig) ProtoMessage() {} +func (*OperationConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *OperationConfig) GetMaxItemFindings() int64 { + if m != nil { + return m.MaxItemFindings + } + return 0 +} + +// Container structure for the content to inspect. +type ContentItem struct { + // Type of the content, as defined in Content-Type HTTP header. + // Supported types are: all "text" types, octet streams, PNG images, + // JPEG images. + Type string `protobuf:"bytes,1,opt,name=type" json:"type,omitempty"` + // Data of the item either in the byte array or UTF-8 string form. + // + // Types that are valid to be assigned to DataItem: + // *ContentItem_Data + // *ContentItem_Value + // *ContentItem_Table + DataItem isContentItem_DataItem `protobuf_oneof:"data_item"` +} + +func (m *ContentItem) Reset() { *m = ContentItem{} } +func (m *ContentItem) String() string { return proto.CompactTextString(m) } +func (*ContentItem) ProtoMessage() {} +func (*ContentItem) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +type isContentItem_DataItem interface { + isContentItem_DataItem() +} + +type ContentItem_Data struct { + Data []byte `protobuf:"bytes,2,opt,name=data,proto3,oneof"` +} +type ContentItem_Value struct { + Value string `protobuf:"bytes,3,opt,name=value,oneof"` +} +type ContentItem_Table struct { + Table *Table `protobuf:"bytes,4,opt,name=table,oneof"` +} + +func (*ContentItem_Data) isContentItem_DataItem() {} +func (*ContentItem_Value) isContentItem_DataItem() {} +func (*ContentItem_Table) isContentItem_DataItem() {} + +func (m *ContentItem) GetDataItem() isContentItem_DataItem { + if m != nil { + return m.DataItem + } + return nil +} + +func (m *ContentItem) GetType() string { + if m != nil { + return m.Type + } + return "" +} + +func (m *ContentItem) GetData() []byte { + if x, ok := m.GetDataItem().(*ContentItem_Data); ok { + return x.Data + } + return nil +} + +func (m *ContentItem) GetValue() string { + if x, ok := m.GetDataItem().(*ContentItem_Value); ok { + return x.Value + } + return "" +} + +func (m *ContentItem) GetTable() *Table { + if x, ok := m.GetDataItem().(*ContentItem_Table); ok { + return x.Table + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*ContentItem) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _ContentItem_OneofMarshaler, _ContentItem_OneofUnmarshaler, _ContentItem_OneofSizer, []interface{}{ + (*ContentItem_Data)(nil), + (*ContentItem_Value)(nil), + (*ContentItem_Table)(nil), + } +} + +func _ContentItem_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*ContentItem) + // data_item + switch x := m.DataItem.(type) { + case *ContentItem_Data: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeRawBytes(x.Data) + case *ContentItem_Value: + b.EncodeVarint(3<<3 | proto.WireBytes) + b.EncodeStringBytes(x.Value) + case *ContentItem_Table: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Table); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("ContentItem.DataItem has unexpected type %T", x) + } + return nil +} + +func _ContentItem_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*ContentItem) + switch tag { + case 2: // data_item.data + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.DataItem = &ContentItem_Data{x} + return true, err + case 3: // data_item.value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.DataItem = &ContentItem_Value{x} + return true, err + case 4: // data_item.table + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Table) + err := b.DecodeMessage(msg) + m.DataItem = &ContentItem_Table{msg} + return true, err + default: + return false, nil + } +} + +func _ContentItem_OneofSizer(msg proto.Message) (n int) { + m := msg.(*ContentItem) + // data_item + switch x := m.DataItem.(type) { + case *ContentItem_Data: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Data))) + n += len(x.Data) + case *ContentItem_Value: + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Value))) + n += len(x.Value) + case *ContentItem_Table: + s := proto.Size(x.Table) + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Structured content to inspect. Up to 50,000 `Value`s per request allowed. +type Table struct { + Headers []*FieldId `protobuf:"bytes,1,rep,name=headers" json:"headers,omitempty"` + Rows []*Table_Row `protobuf:"bytes,2,rep,name=rows" json:"rows,omitempty"` +} + +func (m *Table) Reset() { *m = Table{} } +func (m *Table) String() string { return proto.CompactTextString(m) } +func (*Table) ProtoMessage() {} +func (*Table) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *Table) GetHeaders() []*FieldId { + if m != nil { + return m.Headers + } + return nil +} + +func (m *Table) GetRows() []*Table_Row { + if m != nil { + return m.Rows + } + return nil +} + +type Table_Row struct { + Values []*Value `protobuf:"bytes,1,rep,name=values" json:"values,omitempty"` +} + +func (m *Table_Row) Reset() { *m = Table_Row{} } +func (m *Table_Row) String() string { return proto.CompactTextString(m) } +func (*Table_Row) ProtoMessage() {} +func (*Table_Row) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3, 0} } + +func (m *Table_Row) GetValues() []*Value { + if m != nil { + return m.Values + } + return nil +} + +// All the findings for a single scanned item. +type InspectResult struct { + // List of findings for an item. + Findings []*Finding `protobuf:"bytes,1,rep,name=findings" json:"findings,omitempty"` + // If true, then this item might have more findings than were returned, + // and the findings returned are an arbitrary subset of all findings. + // The findings list might be truncated because the input items were too + // large, or because the server reached the maximum amount of resources + // allowed for a single API call. For best results, divide the input into + // smaller batches. + FindingsTruncated bool `protobuf:"varint,2,opt,name=findings_truncated,json=findingsTruncated" json:"findings_truncated,omitempty"` +} + +func (m *InspectResult) Reset() { *m = InspectResult{} } +func (m *InspectResult) String() string { return proto.CompactTextString(m) } +func (*InspectResult) ProtoMessage() {} +func (*InspectResult) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *InspectResult) GetFindings() []*Finding { + if m != nil { + return m.Findings + } + return nil +} + +func (m *InspectResult) GetFindingsTruncated() bool { + if m != nil { + return m.FindingsTruncated + } + return false +} + +// Container structure describing a single finding within a string or image. +type Finding struct { + // The specific string that may be potentially sensitive info. + Quote string `protobuf:"bytes,1,opt,name=quote" json:"quote,omitempty"` + // The specific type of info the string might be. + InfoType *InfoType `protobuf:"bytes,2,opt,name=info_type,json=infoType" json:"info_type,omitempty"` + // Estimate of how likely it is that the info_type is correct. + Likelihood Likelihood `protobuf:"varint,3,opt,name=likelihood,enum=google.privacy.dlp.v2beta1.Likelihood" json:"likelihood,omitempty"` + // Location of the info found. + Location *Location `protobuf:"bytes,4,opt,name=location" json:"location,omitempty"` + // Timestamp when finding was detected. + CreateTime *google_protobuf3.Timestamp `protobuf:"bytes,6,opt,name=create_time,json=createTime" json:"create_time,omitempty"` +} + +func (m *Finding) Reset() { *m = Finding{} } +func (m *Finding) String() string { return proto.CompactTextString(m) } +func (*Finding) ProtoMessage() {} +func (*Finding) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *Finding) GetQuote() string { + if m != nil { + return m.Quote + } + return "" +} + +func (m *Finding) GetInfoType() *InfoType { + if m != nil { + return m.InfoType + } + return nil +} + +func (m *Finding) GetLikelihood() Likelihood { + if m != nil { + return m.Likelihood + } + return Likelihood_LIKELIHOOD_UNSPECIFIED +} + +func (m *Finding) GetLocation() *Location { + if m != nil { + return m.Location + } + return nil +} + +func (m *Finding) GetCreateTime() *google_protobuf3.Timestamp { + if m != nil { + return m.CreateTime + } + return nil +} + +// Specifies the location of a finding within its source item. +type Location struct { + // Zero-based byte offsets within a content item. + ByteRange *Range `protobuf:"bytes,1,opt,name=byte_range,json=byteRange" json:"byte_range,omitempty"` + // Character offsets within a content item, included when content type + // is a text. Default charset assumed to be UTF-8. + CodepointRange *Range `protobuf:"bytes,2,opt,name=codepoint_range,json=codepointRange" json:"codepoint_range,omitempty"` + // Location within an image's pixels. + ImageBoxes []*ImageLocation `protobuf:"bytes,3,rep,name=image_boxes,json=imageBoxes" json:"image_boxes,omitempty"` + // Key of the finding. + RecordKey *RecordKey `protobuf:"bytes,4,opt,name=record_key,json=recordKey" json:"record_key,omitempty"` + // Field id of the field containing the finding. + FieldId *FieldId `protobuf:"bytes,5,opt,name=field_id,json=fieldId" json:"field_id,omitempty"` + // Location within a `ContentItem.Table`. + TableLocation *TableLocation `protobuf:"bytes,6,opt,name=table_location,json=tableLocation" json:"table_location,omitempty"` +} + +func (m *Location) Reset() { *m = Location{} } +func (m *Location) String() string { return proto.CompactTextString(m) } +func (*Location) ProtoMessage() {} +func (*Location) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *Location) GetByteRange() *Range { + if m != nil { + return m.ByteRange + } + return nil +} + +func (m *Location) GetCodepointRange() *Range { + if m != nil { + return m.CodepointRange + } + return nil +} + +func (m *Location) GetImageBoxes() []*ImageLocation { + if m != nil { + return m.ImageBoxes + } + return nil +} + +func (m *Location) GetRecordKey() *RecordKey { + if m != nil { + return m.RecordKey + } + return nil +} + +func (m *Location) GetFieldId() *FieldId { + if m != nil { + return m.FieldId + } + return nil +} + +func (m *Location) GetTableLocation() *TableLocation { + if m != nil { + return m.TableLocation + } + return nil +} + +// Location of a finding within a `ContentItem.Table`. +type TableLocation struct { + // The zero-based index of the row where the finding is located. + RowIndex int64 `protobuf:"varint,1,opt,name=row_index,json=rowIndex" json:"row_index,omitempty"` +} + +func (m *TableLocation) Reset() { *m = TableLocation{} } +func (m *TableLocation) String() string { return proto.CompactTextString(m) } +func (*TableLocation) ProtoMessage() {} +func (*TableLocation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *TableLocation) GetRowIndex() int64 { + if m != nil { + return m.RowIndex + } + return 0 +} + +// Generic half-open interval [start, end) +type Range struct { + // Index of the first character of the range (inclusive). + Start int64 `protobuf:"varint,1,opt,name=start" json:"start,omitempty"` + // Index of the last character of the range (exclusive). + End int64 `protobuf:"varint,2,opt,name=end" json:"end,omitempty"` +} + +func (m *Range) Reset() { *m = Range{} } +func (m *Range) String() string { return proto.CompactTextString(m) } +func (*Range) ProtoMessage() {} +func (*Range) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *Range) GetStart() int64 { + if m != nil { + return m.Start + } + return 0 +} + +func (m *Range) GetEnd() int64 { + if m != nil { + return m.End + } + return 0 +} + +// Bounding box encompassing detected text within an image. +type ImageLocation struct { + // Top coordinate of the bounding box. (0,0) is upper left. + Top int32 `protobuf:"varint,1,opt,name=top" json:"top,omitempty"` + // Left coordinate of the bounding box. (0,0) is upper left. + Left int32 `protobuf:"varint,2,opt,name=left" json:"left,omitempty"` + // Width of the bounding box in pixels. + Width int32 `protobuf:"varint,3,opt,name=width" json:"width,omitempty"` + // Height of the bounding box in pixels. + Height int32 `protobuf:"varint,4,opt,name=height" json:"height,omitempty"` +} + +func (m *ImageLocation) Reset() { *m = ImageLocation{} } +func (m *ImageLocation) String() string { return proto.CompactTextString(m) } +func (*ImageLocation) ProtoMessage() {} +func (*ImageLocation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *ImageLocation) GetTop() int32 { + if m != nil { + return m.Top + } + return 0 +} + +func (m *ImageLocation) GetLeft() int32 { + if m != nil { + return m.Left + } + return 0 +} + +func (m *ImageLocation) GetWidth() int32 { + if m != nil { + return m.Width + } + return 0 +} + +func (m *ImageLocation) GetHeight() int32 { + if m != nil { + return m.Height + } + return 0 +} + +// Request to search for potentially sensitive info in a list of items +// and replace it with a default or provided content. +type RedactContentRequest struct { + // Configuration for the inspector. + InspectConfig *InspectConfig `protobuf:"bytes,1,opt,name=inspect_config,json=inspectConfig" json:"inspect_config,omitempty"` + // The list of items to inspect. Up to 100 are allowed per request. + Items []*ContentItem `protobuf:"bytes,2,rep,name=items" json:"items,omitempty"` + // The strings to replace findings text findings with. Must specify at least + // one of these or one ImageRedactionConfig if redacting images. + ReplaceConfigs []*RedactContentRequest_ReplaceConfig `protobuf:"bytes,3,rep,name=replace_configs,json=replaceConfigs" json:"replace_configs,omitempty"` + // The configuration for specifying what content to redact from images. + ImageRedactionConfigs []*RedactContentRequest_ImageRedactionConfig `protobuf:"bytes,4,rep,name=image_redaction_configs,json=imageRedactionConfigs" json:"image_redaction_configs,omitempty"` +} + +func (m *RedactContentRequest) Reset() { *m = RedactContentRequest{} } +func (m *RedactContentRequest) String() string { return proto.CompactTextString(m) } +func (*RedactContentRequest) ProtoMessage() {} +func (*RedactContentRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *RedactContentRequest) GetInspectConfig() *InspectConfig { + if m != nil { + return m.InspectConfig + } + return nil +} + +func (m *RedactContentRequest) GetItems() []*ContentItem { + if m != nil { + return m.Items + } + return nil +} + +func (m *RedactContentRequest) GetReplaceConfigs() []*RedactContentRequest_ReplaceConfig { + if m != nil { + return m.ReplaceConfigs + } + return nil +} + +func (m *RedactContentRequest) GetImageRedactionConfigs() []*RedactContentRequest_ImageRedactionConfig { + if m != nil { + return m.ImageRedactionConfigs + } + return nil +} + +type RedactContentRequest_ReplaceConfig struct { + // Type of information to replace. Only one ReplaceConfig per info_type + // should be provided. If ReplaceConfig does not have an info_type, the DLP + // API matches it against all info_types that are found but not specified in + // another ReplaceConfig. + InfoType *InfoType `protobuf:"bytes,1,opt,name=info_type,json=infoType" json:"info_type,omitempty"` + // Content replacing sensitive information of given type. Max 256 chars. + ReplaceWith string `protobuf:"bytes,2,opt,name=replace_with,json=replaceWith" json:"replace_with,omitempty"` +} + +func (m *RedactContentRequest_ReplaceConfig) Reset() { *m = RedactContentRequest_ReplaceConfig{} } +func (m *RedactContentRequest_ReplaceConfig) String() string { return proto.CompactTextString(m) } +func (*RedactContentRequest_ReplaceConfig) ProtoMessage() {} +func (*RedactContentRequest_ReplaceConfig) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{10, 0} +} + +func (m *RedactContentRequest_ReplaceConfig) GetInfoType() *InfoType { + if m != nil { + return m.InfoType + } + return nil +} + +func (m *RedactContentRequest_ReplaceConfig) GetReplaceWith() string { + if m != nil { + return m.ReplaceWith + } + return "" +} + +// Configuration for determining how redaction of images should occur. +type RedactContentRequest_ImageRedactionConfig struct { + // Type of information to redact from images. + // + // Types that are valid to be assigned to Target: + // *RedactContentRequest_ImageRedactionConfig_InfoType + // *RedactContentRequest_ImageRedactionConfig_RedactAllText + Target isRedactContentRequest_ImageRedactionConfig_Target `protobuf_oneof:"target"` + // The color to use when redacting content from an image. If not specified, + // the default is black. + RedactionColor *Color `protobuf:"bytes,3,opt,name=redaction_color,json=redactionColor" json:"redaction_color,omitempty"` +} + +func (m *RedactContentRequest_ImageRedactionConfig) Reset() { + *m = RedactContentRequest_ImageRedactionConfig{} +} +func (m *RedactContentRequest_ImageRedactionConfig) String() string { return proto.CompactTextString(m) } +func (*RedactContentRequest_ImageRedactionConfig) ProtoMessage() {} +func (*RedactContentRequest_ImageRedactionConfig) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{10, 1} +} + +type isRedactContentRequest_ImageRedactionConfig_Target interface { + isRedactContentRequest_ImageRedactionConfig_Target() +} + +type RedactContentRequest_ImageRedactionConfig_InfoType struct { + InfoType *InfoType `protobuf:"bytes,1,opt,name=info_type,json=infoType,oneof"` +} +type RedactContentRequest_ImageRedactionConfig_RedactAllText struct { + RedactAllText bool `protobuf:"varint,2,opt,name=redact_all_text,json=redactAllText,oneof"` +} + +func (*RedactContentRequest_ImageRedactionConfig_InfoType) isRedactContentRequest_ImageRedactionConfig_Target() { +} +func (*RedactContentRequest_ImageRedactionConfig_RedactAllText) isRedactContentRequest_ImageRedactionConfig_Target() { +} + +func (m *RedactContentRequest_ImageRedactionConfig) GetTarget() isRedactContentRequest_ImageRedactionConfig_Target { + if m != nil { + return m.Target + } + return nil +} + +func (m *RedactContentRequest_ImageRedactionConfig) GetInfoType() *InfoType { + if x, ok := m.GetTarget().(*RedactContentRequest_ImageRedactionConfig_InfoType); ok { + return x.InfoType + } + return nil +} + +func (m *RedactContentRequest_ImageRedactionConfig) GetRedactAllText() bool { + if x, ok := m.GetTarget().(*RedactContentRequest_ImageRedactionConfig_RedactAllText); ok { + return x.RedactAllText + } + return false +} + +func (m *RedactContentRequest_ImageRedactionConfig) GetRedactionColor() *Color { + if m != nil { + return m.RedactionColor + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*RedactContentRequest_ImageRedactionConfig) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _RedactContentRequest_ImageRedactionConfig_OneofMarshaler, _RedactContentRequest_ImageRedactionConfig_OneofUnmarshaler, _RedactContentRequest_ImageRedactionConfig_OneofSizer, []interface{}{ + (*RedactContentRequest_ImageRedactionConfig_InfoType)(nil), + (*RedactContentRequest_ImageRedactionConfig_RedactAllText)(nil), + } +} + +func _RedactContentRequest_ImageRedactionConfig_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*RedactContentRequest_ImageRedactionConfig) + // target + switch x := m.Target.(type) { + case *RedactContentRequest_ImageRedactionConfig_InfoType: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.InfoType); err != nil { + return err + } + case *RedactContentRequest_ImageRedactionConfig_RedactAllText: + t := uint64(0) + if x.RedactAllText { + t = 1 + } + b.EncodeVarint(2<<3 | proto.WireVarint) + b.EncodeVarint(t) + case nil: + default: + return fmt.Errorf("RedactContentRequest_ImageRedactionConfig.Target has unexpected type %T", x) + } + return nil +} + +func _RedactContentRequest_ImageRedactionConfig_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*RedactContentRequest_ImageRedactionConfig) + switch tag { + case 1: // target.info_type + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(InfoType) + err := b.DecodeMessage(msg) + m.Target = &RedactContentRequest_ImageRedactionConfig_InfoType{msg} + return true, err + case 2: // target.redact_all_text + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Target = &RedactContentRequest_ImageRedactionConfig_RedactAllText{x != 0} + return true, err + default: + return false, nil + } +} + +func _RedactContentRequest_ImageRedactionConfig_OneofSizer(msg proto.Message) (n int) { + m := msg.(*RedactContentRequest_ImageRedactionConfig) + // target + switch x := m.Target.(type) { + case *RedactContentRequest_ImageRedactionConfig_InfoType: + s := proto.Size(x.InfoType) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *RedactContentRequest_ImageRedactionConfig_RedactAllText: + n += proto.SizeVarint(2<<3 | proto.WireVarint) + n += 1 + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Represents a color in the RGB color space. +type Color struct { + // The amount of red in the color as a value in the interval [0, 1]. + Red float32 `protobuf:"fixed32,1,opt,name=red" json:"red,omitempty"` + // The amount of green in the color as a value in the interval [0, 1]. + Green float32 `protobuf:"fixed32,2,opt,name=green" json:"green,omitempty"` + // The amount of blue in the color as a value in the interval [0, 1]. + Blue float32 `protobuf:"fixed32,3,opt,name=blue" json:"blue,omitempty"` +} + +func (m *Color) Reset() { *m = Color{} } +func (m *Color) String() string { return proto.CompactTextString(m) } +func (*Color) ProtoMessage() {} +func (*Color) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } + +func (m *Color) GetRed() float32 { + if m != nil { + return m.Red + } + return 0 +} + +func (m *Color) GetGreen() float32 { + if m != nil { + return m.Green + } + return 0 +} + +func (m *Color) GetBlue() float32 { + if m != nil { + return m.Blue + } + return 0 +} + +// Results of redacting a list of items. +type RedactContentResponse struct { + // The redacted content. + Items []*ContentItem `protobuf:"bytes,1,rep,name=items" json:"items,omitempty"` +} + +func (m *RedactContentResponse) Reset() { *m = RedactContentResponse{} } +func (m *RedactContentResponse) String() string { return proto.CompactTextString(m) } +func (*RedactContentResponse) ProtoMessage() {} +func (*RedactContentResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } + +func (m *RedactContentResponse) GetItems() []*ContentItem { + if m != nil { + return m.Items + } + return nil +} + +// Request to de-identify a list of items. +type DeidentifyContentRequest struct { + // Configuration for the de-identification of the list of content items. + DeidentifyConfig *DeidentifyConfig `protobuf:"bytes,1,opt,name=deidentify_config,json=deidentifyConfig" json:"deidentify_config,omitempty"` + // Configuration for the inspector. + InspectConfig *InspectConfig `protobuf:"bytes,2,opt,name=inspect_config,json=inspectConfig" json:"inspect_config,omitempty"` + // The list of items to inspect. Up to 100 are allowed per request. + // All items will be treated as text/*. + Items []*ContentItem `protobuf:"bytes,3,rep,name=items" json:"items,omitempty"` +} + +func (m *DeidentifyContentRequest) Reset() { *m = DeidentifyContentRequest{} } +func (m *DeidentifyContentRequest) String() string { return proto.CompactTextString(m) } +func (*DeidentifyContentRequest) ProtoMessage() {} +func (*DeidentifyContentRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } + +func (m *DeidentifyContentRequest) GetDeidentifyConfig() *DeidentifyConfig { + if m != nil { + return m.DeidentifyConfig + } + return nil +} + +func (m *DeidentifyContentRequest) GetInspectConfig() *InspectConfig { + if m != nil { + return m.InspectConfig + } + return nil +} + +func (m *DeidentifyContentRequest) GetItems() []*ContentItem { + if m != nil { + return m.Items + } + return nil +} + +// Results of de-identifying a list of items. +type DeidentifyContentResponse struct { + Items []*ContentItem `protobuf:"bytes,1,rep,name=items" json:"items,omitempty"` + // A review of the transformations that took place for each item. + Summaries []*DeidentificationSummary `protobuf:"bytes,2,rep,name=summaries" json:"summaries,omitempty"` +} + +func (m *DeidentifyContentResponse) Reset() { *m = DeidentifyContentResponse{} } +func (m *DeidentifyContentResponse) String() string { return proto.CompactTextString(m) } +func (*DeidentifyContentResponse) ProtoMessage() {} +func (*DeidentifyContentResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } + +func (m *DeidentifyContentResponse) GetItems() []*ContentItem { + if m != nil { + return m.Items + } + return nil +} + +func (m *DeidentifyContentResponse) GetSummaries() []*DeidentificationSummary { + if m != nil { + return m.Summaries + } + return nil +} + +// Request to search for potentially sensitive info in a list of items. +type InspectContentRequest struct { + // Configuration for the inspector. + InspectConfig *InspectConfig `protobuf:"bytes,1,opt,name=inspect_config,json=inspectConfig" json:"inspect_config,omitempty"` + // The list of items to inspect. Items in a single request are + // considered "related" unless inspect_config.independent_inputs is true. + // Up to 100 are allowed per request. + Items []*ContentItem `protobuf:"bytes,2,rep,name=items" json:"items,omitempty"` +} + +func (m *InspectContentRequest) Reset() { *m = InspectContentRequest{} } +func (m *InspectContentRequest) String() string { return proto.CompactTextString(m) } +func (*InspectContentRequest) ProtoMessage() {} +func (*InspectContentRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } + +func (m *InspectContentRequest) GetInspectConfig() *InspectConfig { + if m != nil { + return m.InspectConfig + } + return nil +} + +func (m *InspectContentRequest) GetItems() []*ContentItem { + if m != nil { + return m.Items + } + return nil +} + +// Results of inspecting a list of items. +type InspectContentResponse struct { + // Each content_item from the request has a result in this list, in the + // same order as the request. + Results []*InspectResult `protobuf:"bytes,1,rep,name=results" json:"results,omitempty"` +} + +func (m *InspectContentResponse) Reset() { *m = InspectContentResponse{} } +func (m *InspectContentResponse) String() string { return proto.CompactTextString(m) } +func (*InspectContentResponse) ProtoMessage() {} +func (*InspectContentResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} } + +func (m *InspectContentResponse) GetResults() []*InspectResult { + if m != nil { + return m.Results + } + return nil +} + +// Request for scheduling a scan of a data subset from a Google Platform data +// repository. +type CreateInspectOperationRequest struct { + // Configuration for the inspector. + InspectConfig *InspectConfig `protobuf:"bytes,1,opt,name=inspect_config,json=inspectConfig" json:"inspect_config,omitempty"` + // Specification of the data set to process. + StorageConfig *StorageConfig `protobuf:"bytes,2,opt,name=storage_config,json=storageConfig" json:"storage_config,omitempty"` + // Optional location to store findings. + OutputConfig *OutputStorageConfig `protobuf:"bytes,3,opt,name=output_config,json=outputConfig" json:"output_config,omitempty"` + // Additional configuration settings for long running operations. + OperationConfig *OperationConfig `protobuf:"bytes,5,opt,name=operation_config,json=operationConfig" json:"operation_config,omitempty"` +} + +func (m *CreateInspectOperationRequest) Reset() { *m = CreateInspectOperationRequest{} } +func (m *CreateInspectOperationRequest) String() string { return proto.CompactTextString(m) } +func (*CreateInspectOperationRequest) ProtoMessage() {} +func (*CreateInspectOperationRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17} } + +func (m *CreateInspectOperationRequest) GetInspectConfig() *InspectConfig { + if m != nil { + return m.InspectConfig + } + return nil +} + +func (m *CreateInspectOperationRequest) GetStorageConfig() *StorageConfig { + if m != nil { + return m.StorageConfig + } + return nil +} + +func (m *CreateInspectOperationRequest) GetOutputConfig() *OutputStorageConfig { + if m != nil { + return m.OutputConfig + } + return nil +} + +func (m *CreateInspectOperationRequest) GetOperationConfig() *OperationConfig { + if m != nil { + return m.OperationConfig + } + return nil +} + +// Cloud repository for storing output. +type OutputStorageConfig struct { + // Types that are valid to be assigned to Type: + // *OutputStorageConfig_Table + // *OutputStorageConfig_StoragePath + Type isOutputStorageConfig_Type `protobuf_oneof:"type"` +} + +func (m *OutputStorageConfig) Reset() { *m = OutputStorageConfig{} } +func (m *OutputStorageConfig) String() string { return proto.CompactTextString(m) } +func (*OutputStorageConfig) ProtoMessage() {} +func (*OutputStorageConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{18} } + +type isOutputStorageConfig_Type interface { + isOutputStorageConfig_Type() +} + +type OutputStorageConfig_Table struct { + Table *BigQueryTable `protobuf:"bytes,1,opt,name=table,oneof"` +} +type OutputStorageConfig_StoragePath struct { + StoragePath *CloudStoragePath `protobuf:"bytes,2,opt,name=storage_path,json=storagePath,oneof"` +} + +func (*OutputStorageConfig_Table) isOutputStorageConfig_Type() {} +func (*OutputStorageConfig_StoragePath) isOutputStorageConfig_Type() {} + +func (m *OutputStorageConfig) GetType() isOutputStorageConfig_Type { + if m != nil { + return m.Type + } + return nil +} + +func (m *OutputStorageConfig) GetTable() *BigQueryTable { + if x, ok := m.GetType().(*OutputStorageConfig_Table); ok { + return x.Table + } + return nil +} + +func (m *OutputStorageConfig) GetStoragePath() *CloudStoragePath { + if x, ok := m.GetType().(*OutputStorageConfig_StoragePath); ok { + return x.StoragePath + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*OutputStorageConfig) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _OutputStorageConfig_OneofMarshaler, _OutputStorageConfig_OneofUnmarshaler, _OutputStorageConfig_OneofSizer, []interface{}{ + (*OutputStorageConfig_Table)(nil), + (*OutputStorageConfig_StoragePath)(nil), + } +} + +func _OutputStorageConfig_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*OutputStorageConfig) + // type + switch x := m.Type.(type) { + case *OutputStorageConfig_Table: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Table); err != nil { + return err + } + case *OutputStorageConfig_StoragePath: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.StoragePath); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("OutputStorageConfig.Type has unexpected type %T", x) + } + return nil +} + +func _OutputStorageConfig_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*OutputStorageConfig) + switch tag { + case 1: // type.table + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(BigQueryTable) + err := b.DecodeMessage(msg) + m.Type = &OutputStorageConfig_Table{msg} + return true, err + case 2: // type.storage_path + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(CloudStoragePath) + err := b.DecodeMessage(msg) + m.Type = &OutputStorageConfig_StoragePath{msg} + return true, err + default: + return false, nil + } +} + +func _OutputStorageConfig_OneofSizer(msg proto.Message) (n int) { + m := msg.(*OutputStorageConfig) + // type + switch x := m.Type.(type) { + case *OutputStorageConfig_Table: + s := proto.Size(x.Table) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *OutputStorageConfig_StoragePath: + s := proto.Size(x.StoragePath) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Statistics regarding a specific InfoType. +type InfoTypeStatistics struct { + // The type of finding this stat is for. + InfoType *InfoType `protobuf:"bytes,1,opt,name=info_type,json=infoType" json:"info_type,omitempty"` + // Number of findings for this info type. + Count int64 `protobuf:"varint,2,opt,name=count" json:"count,omitempty"` +} + +func (m *InfoTypeStatistics) Reset() { *m = InfoTypeStatistics{} } +func (m *InfoTypeStatistics) String() string { return proto.CompactTextString(m) } +func (*InfoTypeStatistics) ProtoMessage() {} +func (*InfoTypeStatistics) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{19} } + +func (m *InfoTypeStatistics) GetInfoType() *InfoType { + if m != nil { + return m.InfoType + } + return nil +} + +func (m *InfoTypeStatistics) GetCount() int64 { + if m != nil { + return m.Count + } + return 0 +} + +// Metadata returned within GetOperation for an inspect request. +type InspectOperationMetadata struct { + // Total size in bytes that were processed. + ProcessedBytes int64 `protobuf:"varint,1,opt,name=processed_bytes,json=processedBytes" json:"processed_bytes,omitempty"` + // Estimate of the number of bytes to process. + TotalEstimatedBytes int64 `protobuf:"varint,4,opt,name=total_estimated_bytes,json=totalEstimatedBytes" json:"total_estimated_bytes,omitempty"` + InfoTypeStats []*InfoTypeStatistics `protobuf:"bytes,2,rep,name=info_type_stats,json=infoTypeStats" json:"info_type_stats,omitempty"` + // The time which this request was started. + CreateTime *google_protobuf3.Timestamp `protobuf:"bytes,3,opt,name=create_time,json=createTime" json:"create_time,omitempty"` + // The inspect config used to create the Operation. + RequestInspectConfig *InspectConfig `protobuf:"bytes,5,opt,name=request_inspect_config,json=requestInspectConfig" json:"request_inspect_config,omitempty"` + // The storage config used to create the Operation. + RequestStorageConfig *StorageConfig `protobuf:"bytes,6,opt,name=request_storage_config,json=requestStorageConfig" json:"request_storage_config,omitempty"` + // Optional location to store findings. + RequestOutputConfig *OutputStorageConfig `protobuf:"bytes,7,opt,name=request_output_config,json=requestOutputConfig" json:"request_output_config,omitempty"` +} + +func (m *InspectOperationMetadata) Reset() { *m = InspectOperationMetadata{} } +func (m *InspectOperationMetadata) String() string { return proto.CompactTextString(m) } +func (*InspectOperationMetadata) ProtoMessage() {} +func (*InspectOperationMetadata) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20} } + +func (m *InspectOperationMetadata) GetProcessedBytes() int64 { + if m != nil { + return m.ProcessedBytes + } + return 0 +} + +func (m *InspectOperationMetadata) GetTotalEstimatedBytes() int64 { + if m != nil { + return m.TotalEstimatedBytes + } + return 0 +} + +func (m *InspectOperationMetadata) GetInfoTypeStats() []*InfoTypeStatistics { + if m != nil { + return m.InfoTypeStats + } + return nil +} + +func (m *InspectOperationMetadata) GetCreateTime() *google_protobuf3.Timestamp { + if m != nil { + return m.CreateTime + } + return nil +} + +func (m *InspectOperationMetadata) GetRequestInspectConfig() *InspectConfig { + if m != nil { + return m.RequestInspectConfig + } + return nil +} + +func (m *InspectOperationMetadata) GetRequestStorageConfig() *StorageConfig { + if m != nil { + return m.RequestStorageConfig + } + return nil +} + +func (m *InspectOperationMetadata) GetRequestOutputConfig() *OutputStorageConfig { + if m != nil { + return m.RequestOutputConfig + } + return nil +} + +// The operational data. +type InspectOperationResult struct { + // The server-assigned name, which is only unique within the same service that + // originally returns it. If you use the default HTTP mapping, the + // `name` should have the format of `inspect/results/{id}`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *InspectOperationResult) Reset() { *m = InspectOperationResult{} } +func (m *InspectOperationResult) String() string { return proto.CompactTextString(m) } +func (*InspectOperationResult) ProtoMessage() {} +func (*InspectOperationResult) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{21} } + +func (m *InspectOperationResult) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Request for the list of results in a given inspect operation. +type ListInspectFindingsRequest struct { + // Identifier of the results set returned as metadata of + // the longrunning operation created by a call to InspectDataSource. + // Should be in the format of `inspect/results/{id}`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Maximum number of results to return. + // If 0, the implementation selects a reasonable value. + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // The value returned by the last `ListInspectFindingsResponse`; indicates + // that this is a continuation of a prior `ListInspectFindings` call, and that + // the system should return the next page of data. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` + // Restricts findings to items that match. Supports info_type and likelihood. + // + // Examples: + // + // - info_type=EMAIL_ADDRESS + // - info_type=PHONE_NUMBER,EMAIL_ADDRESS + // - likelihood=VERY_LIKELY + // - likelihood=VERY_LIKELY,LIKELY + // - info_type=EMAIL_ADDRESS,likelihood=VERY_LIKELY,LIKELY + Filter string `protobuf:"bytes,4,opt,name=filter" json:"filter,omitempty"` +} + +func (m *ListInspectFindingsRequest) Reset() { *m = ListInspectFindingsRequest{} } +func (m *ListInspectFindingsRequest) String() string { return proto.CompactTextString(m) } +func (*ListInspectFindingsRequest) ProtoMessage() {} +func (*ListInspectFindingsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{22} } + +func (m *ListInspectFindingsRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ListInspectFindingsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListInspectFindingsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +func (m *ListInspectFindingsRequest) GetFilter() string { + if m != nil { + return m.Filter + } + return "" +} + +// Response to the ListInspectFindings request. +type ListInspectFindingsResponse struct { + // The results. + Result *InspectResult `protobuf:"bytes,1,opt,name=result" json:"result,omitempty"` + // If not empty, indicates that there may be more results that match the + // request; this value should be passed in a new `ListInspectFindingsRequest`. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListInspectFindingsResponse) Reset() { *m = ListInspectFindingsResponse{} } +func (m *ListInspectFindingsResponse) String() string { return proto.CompactTextString(m) } +func (*ListInspectFindingsResponse) ProtoMessage() {} +func (*ListInspectFindingsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{23} } + +func (m *ListInspectFindingsResponse) GetResult() *InspectResult { + if m != nil { + return m.Result + } + return nil +} + +func (m *ListInspectFindingsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// Description of the information type (infoType). +type InfoTypeDescription struct { + // Internal name of the infoType. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Human readable form of the infoType name. + DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName" json:"display_name,omitempty"` + // List of categories this infoType belongs to. + Categories []*CategoryDescription `protobuf:"bytes,3,rep,name=categories" json:"categories,omitempty"` +} + +func (m *InfoTypeDescription) Reset() { *m = InfoTypeDescription{} } +func (m *InfoTypeDescription) String() string { return proto.CompactTextString(m) } +func (*InfoTypeDescription) ProtoMessage() {} +func (*InfoTypeDescription) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{24} } + +func (m *InfoTypeDescription) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *InfoTypeDescription) GetDisplayName() string { + if m != nil { + return m.DisplayName + } + return "" +} + +func (m *InfoTypeDescription) GetCategories() []*CategoryDescription { + if m != nil { + return m.Categories + } + return nil +} + +// Request for the list of info types belonging to a given category, +// or all supported info types if no category is specified. +type ListInfoTypesRequest struct { + // Category name as returned by ListRootCategories. + Category string `protobuf:"bytes,1,opt,name=category" json:"category,omitempty"` + // Optional BCP-47 language code for localized info type friendly + // names. If omitted, or if localized strings are not available, + // en-US strings will be returned. + LanguageCode string `protobuf:"bytes,2,opt,name=language_code,json=languageCode" json:"language_code,omitempty"` +} + +func (m *ListInfoTypesRequest) Reset() { *m = ListInfoTypesRequest{} } +func (m *ListInfoTypesRequest) String() string { return proto.CompactTextString(m) } +func (*ListInfoTypesRequest) ProtoMessage() {} +func (*ListInfoTypesRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{25} } + +func (m *ListInfoTypesRequest) GetCategory() string { + if m != nil { + return m.Category + } + return "" +} + +func (m *ListInfoTypesRequest) GetLanguageCode() string { + if m != nil { + return m.LanguageCode + } + return "" +} + +// Response to the ListInfoTypes request. +type ListInfoTypesResponse struct { + // Set of sensitive info types belonging to a category. + InfoTypes []*InfoTypeDescription `protobuf:"bytes,1,rep,name=info_types,json=infoTypes" json:"info_types,omitempty"` +} + +func (m *ListInfoTypesResponse) Reset() { *m = ListInfoTypesResponse{} } +func (m *ListInfoTypesResponse) String() string { return proto.CompactTextString(m) } +func (*ListInfoTypesResponse) ProtoMessage() {} +func (*ListInfoTypesResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{26} } + +func (m *ListInfoTypesResponse) GetInfoTypes() []*InfoTypeDescription { + if m != nil { + return m.InfoTypes + } + return nil +} + +// Info Type Category description. +type CategoryDescription struct { + // Internal name of the category. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Human readable form of the category name. + DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName" json:"display_name,omitempty"` +} + +func (m *CategoryDescription) Reset() { *m = CategoryDescription{} } +func (m *CategoryDescription) String() string { return proto.CompactTextString(m) } +func (*CategoryDescription) ProtoMessage() {} +func (*CategoryDescription) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{27} } + +func (m *CategoryDescription) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *CategoryDescription) GetDisplayName() string { + if m != nil { + return m.DisplayName + } + return "" +} + +// Request for root categories of Info Types supported by the API. +// Example values might include "FINANCE", "HEALTH", "FAST", "DEFAULT". +type ListRootCategoriesRequest struct { + // Optional language code for localized friendly category names. + // If omitted or if localized strings are not available, + // en-US strings will be returned. + LanguageCode string `protobuf:"bytes,1,opt,name=language_code,json=languageCode" json:"language_code,omitempty"` +} + +func (m *ListRootCategoriesRequest) Reset() { *m = ListRootCategoriesRequest{} } +func (m *ListRootCategoriesRequest) String() string { return proto.CompactTextString(m) } +func (*ListRootCategoriesRequest) ProtoMessage() {} +func (*ListRootCategoriesRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{28} } + +func (m *ListRootCategoriesRequest) GetLanguageCode() string { + if m != nil { + return m.LanguageCode + } + return "" +} + +// Response for ListRootCategories request. +type ListRootCategoriesResponse struct { + // List of all into type categories supported by the API. + Categories []*CategoryDescription `protobuf:"bytes,1,rep,name=categories" json:"categories,omitempty"` +} + +func (m *ListRootCategoriesResponse) Reset() { *m = ListRootCategoriesResponse{} } +func (m *ListRootCategoriesResponse) String() string { return proto.CompactTextString(m) } +func (*ListRootCategoriesResponse) ProtoMessage() {} +func (*ListRootCategoriesResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{29} } + +func (m *ListRootCategoriesResponse) GetCategories() []*CategoryDescription { + if m != nil { + return m.Categories + } + return nil +} + +// Request for creating a risk analysis operation. +type AnalyzeDataSourceRiskRequest struct { + // Privacy metric to compute. + PrivacyMetric *PrivacyMetric `protobuf:"bytes,1,opt,name=privacy_metric,json=privacyMetric" json:"privacy_metric,omitempty"` + // Input dataset to compute metrics over. + SourceTable *BigQueryTable `protobuf:"bytes,3,opt,name=source_table,json=sourceTable" json:"source_table,omitempty"` +} + +func (m *AnalyzeDataSourceRiskRequest) Reset() { *m = AnalyzeDataSourceRiskRequest{} } +func (m *AnalyzeDataSourceRiskRequest) String() string { return proto.CompactTextString(m) } +func (*AnalyzeDataSourceRiskRequest) ProtoMessage() {} +func (*AnalyzeDataSourceRiskRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{30} } + +func (m *AnalyzeDataSourceRiskRequest) GetPrivacyMetric() *PrivacyMetric { + if m != nil { + return m.PrivacyMetric + } + return nil +} + +func (m *AnalyzeDataSourceRiskRequest) GetSourceTable() *BigQueryTable { + if m != nil { + return m.SourceTable + } + return nil +} + +// Privacy metric to compute for reidentification risk analysis. +type PrivacyMetric struct { + // Types that are valid to be assigned to Type: + // *PrivacyMetric_NumericalStatsConfig_ + // *PrivacyMetric_CategoricalStatsConfig_ + // *PrivacyMetric_KAnonymityConfig_ + // *PrivacyMetric_LDiversityConfig_ + Type isPrivacyMetric_Type `protobuf_oneof:"type"` +} + +func (m *PrivacyMetric) Reset() { *m = PrivacyMetric{} } +func (m *PrivacyMetric) String() string { return proto.CompactTextString(m) } +func (*PrivacyMetric) ProtoMessage() {} +func (*PrivacyMetric) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{31} } + +type isPrivacyMetric_Type interface { + isPrivacyMetric_Type() +} + +type PrivacyMetric_NumericalStatsConfig_ struct { + NumericalStatsConfig *PrivacyMetric_NumericalStatsConfig `protobuf:"bytes,1,opt,name=numerical_stats_config,json=numericalStatsConfig,oneof"` +} +type PrivacyMetric_CategoricalStatsConfig_ struct { + CategoricalStatsConfig *PrivacyMetric_CategoricalStatsConfig `protobuf:"bytes,2,opt,name=categorical_stats_config,json=categoricalStatsConfig,oneof"` +} +type PrivacyMetric_KAnonymityConfig_ struct { + KAnonymityConfig *PrivacyMetric_KAnonymityConfig `protobuf:"bytes,3,opt,name=k_anonymity_config,json=kAnonymityConfig,oneof"` +} +type PrivacyMetric_LDiversityConfig_ struct { + LDiversityConfig *PrivacyMetric_LDiversityConfig `protobuf:"bytes,4,opt,name=l_diversity_config,json=lDiversityConfig,oneof"` +} + +func (*PrivacyMetric_NumericalStatsConfig_) isPrivacyMetric_Type() {} +func (*PrivacyMetric_CategoricalStatsConfig_) isPrivacyMetric_Type() {} +func (*PrivacyMetric_KAnonymityConfig_) isPrivacyMetric_Type() {} +func (*PrivacyMetric_LDiversityConfig_) isPrivacyMetric_Type() {} + +func (m *PrivacyMetric) GetType() isPrivacyMetric_Type { + if m != nil { + return m.Type + } + return nil +} + +func (m *PrivacyMetric) GetNumericalStatsConfig() *PrivacyMetric_NumericalStatsConfig { + if x, ok := m.GetType().(*PrivacyMetric_NumericalStatsConfig_); ok { + return x.NumericalStatsConfig + } + return nil +} + +func (m *PrivacyMetric) GetCategoricalStatsConfig() *PrivacyMetric_CategoricalStatsConfig { + if x, ok := m.GetType().(*PrivacyMetric_CategoricalStatsConfig_); ok { + return x.CategoricalStatsConfig + } + return nil +} + +func (m *PrivacyMetric) GetKAnonymityConfig() *PrivacyMetric_KAnonymityConfig { + if x, ok := m.GetType().(*PrivacyMetric_KAnonymityConfig_); ok { + return x.KAnonymityConfig + } + return nil +} + +func (m *PrivacyMetric) GetLDiversityConfig() *PrivacyMetric_LDiversityConfig { + if x, ok := m.GetType().(*PrivacyMetric_LDiversityConfig_); ok { + return x.LDiversityConfig + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*PrivacyMetric) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _PrivacyMetric_OneofMarshaler, _PrivacyMetric_OneofUnmarshaler, _PrivacyMetric_OneofSizer, []interface{}{ + (*PrivacyMetric_NumericalStatsConfig_)(nil), + (*PrivacyMetric_CategoricalStatsConfig_)(nil), + (*PrivacyMetric_KAnonymityConfig_)(nil), + (*PrivacyMetric_LDiversityConfig_)(nil), + } +} + +func _PrivacyMetric_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*PrivacyMetric) + // type + switch x := m.Type.(type) { + case *PrivacyMetric_NumericalStatsConfig_: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.NumericalStatsConfig); err != nil { + return err + } + case *PrivacyMetric_CategoricalStatsConfig_: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.CategoricalStatsConfig); err != nil { + return err + } + case *PrivacyMetric_KAnonymityConfig_: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.KAnonymityConfig); err != nil { + return err + } + case *PrivacyMetric_LDiversityConfig_: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.LDiversityConfig); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("PrivacyMetric.Type has unexpected type %T", x) + } + return nil +} + +func _PrivacyMetric_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*PrivacyMetric) + switch tag { + case 1: // type.numerical_stats_config + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(PrivacyMetric_NumericalStatsConfig) + err := b.DecodeMessage(msg) + m.Type = &PrivacyMetric_NumericalStatsConfig_{msg} + return true, err + case 2: // type.categorical_stats_config + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(PrivacyMetric_CategoricalStatsConfig) + err := b.DecodeMessage(msg) + m.Type = &PrivacyMetric_CategoricalStatsConfig_{msg} + return true, err + case 3: // type.k_anonymity_config + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(PrivacyMetric_KAnonymityConfig) + err := b.DecodeMessage(msg) + m.Type = &PrivacyMetric_KAnonymityConfig_{msg} + return true, err + case 4: // type.l_diversity_config + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(PrivacyMetric_LDiversityConfig) + err := b.DecodeMessage(msg) + m.Type = &PrivacyMetric_LDiversityConfig_{msg} + return true, err + default: + return false, nil + } +} + +func _PrivacyMetric_OneofSizer(msg proto.Message) (n int) { + m := msg.(*PrivacyMetric) + // type + switch x := m.Type.(type) { + case *PrivacyMetric_NumericalStatsConfig_: + s := proto.Size(x.NumericalStatsConfig) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *PrivacyMetric_CategoricalStatsConfig_: + s := proto.Size(x.CategoricalStatsConfig) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *PrivacyMetric_KAnonymityConfig_: + s := proto.Size(x.KAnonymityConfig) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *PrivacyMetric_LDiversityConfig_: + s := proto.Size(x.LDiversityConfig) + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Compute numerical stats over an individual column, including +// min, max, and quantiles. +type PrivacyMetric_NumericalStatsConfig struct { + // Field to compute numerical stats on. Supported types are + // integer, float, date, datetime, timestamp, time. + Field *FieldId `protobuf:"bytes,1,opt,name=field" json:"field,omitempty"` +} + +func (m *PrivacyMetric_NumericalStatsConfig) Reset() { *m = PrivacyMetric_NumericalStatsConfig{} } +func (m *PrivacyMetric_NumericalStatsConfig) String() string { return proto.CompactTextString(m) } +func (*PrivacyMetric_NumericalStatsConfig) ProtoMessage() {} +func (*PrivacyMetric_NumericalStatsConfig) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{31, 0} +} + +func (m *PrivacyMetric_NumericalStatsConfig) GetField() *FieldId { + if m != nil { + return m.Field + } + return nil +} + +// Compute numerical stats over an individual column, including +// number of distinct values and value count distribution. +type PrivacyMetric_CategoricalStatsConfig struct { + // Field to compute categorical stats on. All column types are + // supported except for arrays and structs. However, it may be more + // informative to use NumericalStats when the field type is supported, + // depending on the data. + Field *FieldId `protobuf:"bytes,1,opt,name=field" json:"field,omitempty"` +} + +func (m *PrivacyMetric_CategoricalStatsConfig) Reset() { *m = PrivacyMetric_CategoricalStatsConfig{} } +func (m *PrivacyMetric_CategoricalStatsConfig) String() string { return proto.CompactTextString(m) } +func (*PrivacyMetric_CategoricalStatsConfig) ProtoMessage() {} +func (*PrivacyMetric_CategoricalStatsConfig) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{31, 1} +} + +func (m *PrivacyMetric_CategoricalStatsConfig) GetField() *FieldId { + if m != nil { + return m.Field + } + return nil +} + +// k-anonymity metric, used for analysis of reidentification risk. +type PrivacyMetric_KAnonymityConfig struct { + // Set of fields to compute k-anonymity over. When multiple fields are + // specified, they are considered a single composite key. Structs and + // repeated data types are not supported; however, nested fields are + // supported so long as they are not structs themselves or nested within + // a repeated field. + QuasiIds []*FieldId `protobuf:"bytes,1,rep,name=quasi_ids,json=quasiIds" json:"quasi_ids,omitempty"` + // Optional message indicating that each distinct `EntityId` should not + // contribute to the k-anonymity count more than once per equivalence class. + EntityId *EntityId `protobuf:"bytes,2,opt,name=entity_id,json=entityId" json:"entity_id,omitempty"` +} + +func (m *PrivacyMetric_KAnonymityConfig) Reset() { *m = PrivacyMetric_KAnonymityConfig{} } +func (m *PrivacyMetric_KAnonymityConfig) String() string { return proto.CompactTextString(m) } +func (*PrivacyMetric_KAnonymityConfig) ProtoMessage() {} +func (*PrivacyMetric_KAnonymityConfig) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{31, 2} +} + +func (m *PrivacyMetric_KAnonymityConfig) GetQuasiIds() []*FieldId { + if m != nil { + return m.QuasiIds + } + return nil +} + +func (m *PrivacyMetric_KAnonymityConfig) GetEntityId() *EntityId { + if m != nil { + return m.EntityId + } + return nil +} + +// l-diversity metric, used for analysis of reidentification risk. +type PrivacyMetric_LDiversityConfig struct { + // Set of quasi-identifiers indicating how equivalence classes are + // defined for the l-diversity computation. When multiple fields are + // specified, they are considered a single composite key. + QuasiIds []*FieldId `protobuf:"bytes,1,rep,name=quasi_ids,json=quasiIds" json:"quasi_ids,omitempty"` + // Sensitive field for computing the l-value. + SensitiveAttribute *FieldId `protobuf:"bytes,2,opt,name=sensitive_attribute,json=sensitiveAttribute" json:"sensitive_attribute,omitempty"` +} + +func (m *PrivacyMetric_LDiversityConfig) Reset() { *m = PrivacyMetric_LDiversityConfig{} } +func (m *PrivacyMetric_LDiversityConfig) String() string { return proto.CompactTextString(m) } +func (*PrivacyMetric_LDiversityConfig) ProtoMessage() {} +func (*PrivacyMetric_LDiversityConfig) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{31, 3} +} + +func (m *PrivacyMetric_LDiversityConfig) GetQuasiIds() []*FieldId { + if m != nil { + return m.QuasiIds + } + return nil +} + +func (m *PrivacyMetric_LDiversityConfig) GetSensitiveAttribute() *FieldId { + if m != nil { + return m.SensitiveAttribute + } + return nil +} + +// Metadata returned within the +// [`riskAnalysis.operations.get`](/dlp/docs/reference/rest/v2beta1/riskAnalysis.operations/get) +// for risk analysis. +type RiskAnalysisOperationMetadata struct { + // The time which this request was started. + CreateTime *google_protobuf3.Timestamp `protobuf:"bytes,1,opt,name=create_time,json=createTime" json:"create_time,omitempty"` + // Privacy metric to compute. + RequestedPrivacyMetric *PrivacyMetric `protobuf:"bytes,2,opt,name=requested_privacy_metric,json=requestedPrivacyMetric" json:"requested_privacy_metric,omitempty"` + // Input dataset to compute metrics over. + RequestedSourceTable *BigQueryTable `protobuf:"bytes,3,opt,name=requested_source_table,json=requestedSourceTable" json:"requested_source_table,omitempty"` +} + +func (m *RiskAnalysisOperationMetadata) Reset() { *m = RiskAnalysisOperationMetadata{} } +func (m *RiskAnalysisOperationMetadata) String() string { return proto.CompactTextString(m) } +func (*RiskAnalysisOperationMetadata) ProtoMessage() {} +func (*RiskAnalysisOperationMetadata) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{32} } + +func (m *RiskAnalysisOperationMetadata) GetCreateTime() *google_protobuf3.Timestamp { + if m != nil { + return m.CreateTime + } + return nil +} + +func (m *RiskAnalysisOperationMetadata) GetRequestedPrivacyMetric() *PrivacyMetric { + if m != nil { + return m.RequestedPrivacyMetric + } + return nil +} + +func (m *RiskAnalysisOperationMetadata) GetRequestedSourceTable() *BigQueryTable { + if m != nil { + return m.RequestedSourceTable + } + return nil +} + +// Result of a risk analysis +// [`Operation`](/dlp/docs/reference/rest/v2beta1/inspect.operations) +// request. +type RiskAnalysisOperationResult struct { + // Values associated with this metric. + // + // Types that are valid to be assigned to Result: + // *RiskAnalysisOperationResult_NumericalStatsResult_ + // *RiskAnalysisOperationResult_CategoricalStatsResult_ + // *RiskAnalysisOperationResult_KAnonymityResult_ + // *RiskAnalysisOperationResult_LDiversityResult_ + Result isRiskAnalysisOperationResult_Result `protobuf_oneof:"result"` +} + +func (m *RiskAnalysisOperationResult) Reset() { *m = RiskAnalysisOperationResult{} } +func (m *RiskAnalysisOperationResult) String() string { return proto.CompactTextString(m) } +func (*RiskAnalysisOperationResult) ProtoMessage() {} +func (*RiskAnalysisOperationResult) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{33} } + +type isRiskAnalysisOperationResult_Result interface { + isRiskAnalysisOperationResult_Result() +} + +type RiskAnalysisOperationResult_NumericalStatsResult_ struct { + NumericalStatsResult *RiskAnalysisOperationResult_NumericalStatsResult `protobuf:"bytes,3,opt,name=numerical_stats_result,json=numericalStatsResult,oneof"` +} +type RiskAnalysisOperationResult_CategoricalStatsResult_ struct { + CategoricalStatsResult *RiskAnalysisOperationResult_CategoricalStatsResult `protobuf:"bytes,4,opt,name=categorical_stats_result,json=categoricalStatsResult,oneof"` +} +type RiskAnalysisOperationResult_KAnonymityResult_ struct { + KAnonymityResult *RiskAnalysisOperationResult_KAnonymityResult `protobuf:"bytes,5,opt,name=k_anonymity_result,json=kAnonymityResult,oneof"` +} +type RiskAnalysisOperationResult_LDiversityResult_ struct { + LDiversityResult *RiskAnalysisOperationResult_LDiversityResult `protobuf:"bytes,6,opt,name=l_diversity_result,json=lDiversityResult,oneof"` +} + +func (*RiskAnalysisOperationResult_NumericalStatsResult_) isRiskAnalysisOperationResult_Result() {} +func (*RiskAnalysisOperationResult_CategoricalStatsResult_) isRiskAnalysisOperationResult_Result() {} +func (*RiskAnalysisOperationResult_KAnonymityResult_) isRiskAnalysisOperationResult_Result() {} +func (*RiskAnalysisOperationResult_LDiversityResult_) isRiskAnalysisOperationResult_Result() {} + +func (m *RiskAnalysisOperationResult) GetResult() isRiskAnalysisOperationResult_Result { + if m != nil { + return m.Result + } + return nil +} + +func (m *RiskAnalysisOperationResult) GetNumericalStatsResult() *RiskAnalysisOperationResult_NumericalStatsResult { + if x, ok := m.GetResult().(*RiskAnalysisOperationResult_NumericalStatsResult_); ok { + return x.NumericalStatsResult + } + return nil +} + +func (m *RiskAnalysisOperationResult) GetCategoricalStatsResult() *RiskAnalysisOperationResult_CategoricalStatsResult { + if x, ok := m.GetResult().(*RiskAnalysisOperationResult_CategoricalStatsResult_); ok { + return x.CategoricalStatsResult + } + return nil +} + +func (m *RiskAnalysisOperationResult) GetKAnonymityResult() *RiskAnalysisOperationResult_KAnonymityResult { + if x, ok := m.GetResult().(*RiskAnalysisOperationResult_KAnonymityResult_); ok { + return x.KAnonymityResult + } + return nil +} + +func (m *RiskAnalysisOperationResult) GetLDiversityResult() *RiskAnalysisOperationResult_LDiversityResult { + if x, ok := m.GetResult().(*RiskAnalysisOperationResult_LDiversityResult_); ok { + return x.LDiversityResult + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*RiskAnalysisOperationResult) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _RiskAnalysisOperationResult_OneofMarshaler, _RiskAnalysisOperationResult_OneofUnmarshaler, _RiskAnalysisOperationResult_OneofSizer, []interface{}{ + (*RiskAnalysisOperationResult_NumericalStatsResult_)(nil), + (*RiskAnalysisOperationResult_CategoricalStatsResult_)(nil), + (*RiskAnalysisOperationResult_KAnonymityResult_)(nil), + (*RiskAnalysisOperationResult_LDiversityResult_)(nil), + } +} + +func _RiskAnalysisOperationResult_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*RiskAnalysisOperationResult) + // result + switch x := m.Result.(type) { + case *RiskAnalysisOperationResult_NumericalStatsResult_: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.NumericalStatsResult); err != nil { + return err + } + case *RiskAnalysisOperationResult_CategoricalStatsResult_: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.CategoricalStatsResult); err != nil { + return err + } + case *RiskAnalysisOperationResult_KAnonymityResult_: + b.EncodeVarint(5<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.KAnonymityResult); err != nil { + return err + } + case *RiskAnalysisOperationResult_LDiversityResult_: + b.EncodeVarint(6<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.LDiversityResult); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("RiskAnalysisOperationResult.Result has unexpected type %T", x) + } + return nil +} + +func _RiskAnalysisOperationResult_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*RiskAnalysisOperationResult) + switch tag { + case 3: // result.numerical_stats_result + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(RiskAnalysisOperationResult_NumericalStatsResult) + err := b.DecodeMessage(msg) + m.Result = &RiskAnalysisOperationResult_NumericalStatsResult_{msg} + return true, err + case 4: // result.categorical_stats_result + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(RiskAnalysisOperationResult_CategoricalStatsResult) + err := b.DecodeMessage(msg) + m.Result = &RiskAnalysisOperationResult_CategoricalStatsResult_{msg} + return true, err + case 5: // result.k_anonymity_result + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(RiskAnalysisOperationResult_KAnonymityResult) + err := b.DecodeMessage(msg) + m.Result = &RiskAnalysisOperationResult_KAnonymityResult_{msg} + return true, err + case 6: // result.l_diversity_result + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(RiskAnalysisOperationResult_LDiversityResult) + err := b.DecodeMessage(msg) + m.Result = &RiskAnalysisOperationResult_LDiversityResult_{msg} + return true, err + default: + return false, nil + } +} + +func _RiskAnalysisOperationResult_OneofSizer(msg proto.Message) (n int) { + m := msg.(*RiskAnalysisOperationResult) + // result + switch x := m.Result.(type) { + case *RiskAnalysisOperationResult_NumericalStatsResult_: + s := proto.Size(x.NumericalStatsResult) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *RiskAnalysisOperationResult_CategoricalStatsResult_: + s := proto.Size(x.CategoricalStatsResult) + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *RiskAnalysisOperationResult_KAnonymityResult_: + s := proto.Size(x.KAnonymityResult) + n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *RiskAnalysisOperationResult_LDiversityResult_: + s := proto.Size(x.LDiversityResult) + n += proto.SizeVarint(6<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Result of the numerical stats computation. +type RiskAnalysisOperationResult_NumericalStatsResult struct { + // Minimum value appearing in the column. + MinValue *Value `protobuf:"bytes,1,opt,name=min_value,json=minValue" json:"min_value,omitempty"` + // Maximum value appearing in the column. + MaxValue *Value `protobuf:"bytes,2,opt,name=max_value,json=maxValue" json:"max_value,omitempty"` + // List of 99 values that partition the set of field values into 100 equal + // sized buckets. + QuantileValues []*Value `protobuf:"bytes,4,rep,name=quantile_values,json=quantileValues" json:"quantile_values,omitempty"` +} + +func (m *RiskAnalysisOperationResult_NumericalStatsResult) Reset() { + *m = RiskAnalysisOperationResult_NumericalStatsResult{} +} +func (m *RiskAnalysisOperationResult_NumericalStatsResult) String() string { + return proto.CompactTextString(m) +} +func (*RiskAnalysisOperationResult_NumericalStatsResult) ProtoMessage() {} +func (*RiskAnalysisOperationResult_NumericalStatsResult) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{33, 0} +} + +func (m *RiskAnalysisOperationResult_NumericalStatsResult) GetMinValue() *Value { + if m != nil { + return m.MinValue + } + return nil +} + +func (m *RiskAnalysisOperationResult_NumericalStatsResult) GetMaxValue() *Value { + if m != nil { + return m.MaxValue + } + return nil +} + +func (m *RiskAnalysisOperationResult_NumericalStatsResult) GetQuantileValues() []*Value { + if m != nil { + return m.QuantileValues + } + return nil +} + +// Result of the categorical stats computation. +type RiskAnalysisOperationResult_CategoricalStatsResult struct { + // Histogram of value frequencies in the column. + ValueFrequencyHistogramBuckets []*RiskAnalysisOperationResult_CategoricalStatsResult_CategoricalStatsHistogramBucket `protobuf:"bytes,5,rep,name=value_frequency_histogram_buckets,json=valueFrequencyHistogramBuckets" json:"value_frequency_histogram_buckets,omitempty"` +} + +func (m *RiskAnalysisOperationResult_CategoricalStatsResult) Reset() { + *m = RiskAnalysisOperationResult_CategoricalStatsResult{} +} +func (m *RiskAnalysisOperationResult_CategoricalStatsResult) String() string { + return proto.CompactTextString(m) +} +func (*RiskAnalysisOperationResult_CategoricalStatsResult) ProtoMessage() {} +func (*RiskAnalysisOperationResult_CategoricalStatsResult) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{33, 1} +} + +func (m *RiskAnalysisOperationResult_CategoricalStatsResult) GetValueFrequencyHistogramBuckets() []*RiskAnalysisOperationResult_CategoricalStatsResult_CategoricalStatsHistogramBucket { + if m != nil { + return m.ValueFrequencyHistogramBuckets + } + return nil +} + +// Histogram bucket of value frequencies in the column. +type RiskAnalysisOperationResult_CategoricalStatsResult_CategoricalStatsHistogramBucket struct { + // Lower bound on the value frequency of the values in this bucket. + ValueFrequencyLowerBound int64 `protobuf:"varint,1,opt,name=value_frequency_lower_bound,json=valueFrequencyLowerBound" json:"value_frequency_lower_bound,omitempty"` + // Upper bound on the value frequency of the values in this bucket. + ValueFrequencyUpperBound int64 `protobuf:"varint,2,opt,name=value_frequency_upper_bound,json=valueFrequencyUpperBound" json:"value_frequency_upper_bound,omitempty"` + // Total number of records in this bucket. + BucketSize int64 `protobuf:"varint,3,opt,name=bucket_size,json=bucketSize" json:"bucket_size,omitempty"` + // Sample of value frequencies in this bucket. The total number of + // values returned per bucket is capped at 20. + BucketValues []*ValueFrequency `protobuf:"bytes,4,rep,name=bucket_values,json=bucketValues" json:"bucket_values,omitempty"` +} + +func (m *RiskAnalysisOperationResult_CategoricalStatsResult_CategoricalStatsHistogramBucket) Reset() { + *m = RiskAnalysisOperationResult_CategoricalStatsResult_CategoricalStatsHistogramBucket{} +} +func (m *RiskAnalysisOperationResult_CategoricalStatsResult_CategoricalStatsHistogramBucket) String() string { + return proto.CompactTextString(m) +} +func (*RiskAnalysisOperationResult_CategoricalStatsResult_CategoricalStatsHistogramBucket) ProtoMessage() { +} +func (*RiskAnalysisOperationResult_CategoricalStatsResult_CategoricalStatsHistogramBucket) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{33, 1, 0} +} + +func (m *RiskAnalysisOperationResult_CategoricalStatsResult_CategoricalStatsHistogramBucket) GetValueFrequencyLowerBound() int64 { + if m != nil { + return m.ValueFrequencyLowerBound + } + return 0 +} + +func (m *RiskAnalysisOperationResult_CategoricalStatsResult_CategoricalStatsHistogramBucket) GetValueFrequencyUpperBound() int64 { + if m != nil { + return m.ValueFrequencyUpperBound + } + return 0 +} + +func (m *RiskAnalysisOperationResult_CategoricalStatsResult_CategoricalStatsHistogramBucket) GetBucketSize() int64 { + if m != nil { + return m.BucketSize + } + return 0 +} + +func (m *RiskAnalysisOperationResult_CategoricalStatsResult_CategoricalStatsHistogramBucket) GetBucketValues() []*ValueFrequency { + if m != nil { + return m.BucketValues + } + return nil +} + +// Result of the k-anonymity computation. +type RiskAnalysisOperationResult_KAnonymityResult struct { + // Histogram of k-anonymity equivalence classes. + EquivalenceClassHistogramBuckets []*RiskAnalysisOperationResult_KAnonymityResult_KAnonymityHistogramBucket `protobuf:"bytes,5,rep,name=equivalence_class_histogram_buckets,json=equivalenceClassHistogramBuckets" json:"equivalence_class_histogram_buckets,omitempty"` +} + +func (m *RiskAnalysisOperationResult_KAnonymityResult) Reset() { + *m = RiskAnalysisOperationResult_KAnonymityResult{} +} +func (m *RiskAnalysisOperationResult_KAnonymityResult) String() string { + return proto.CompactTextString(m) +} +func (*RiskAnalysisOperationResult_KAnonymityResult) ProtoMessage() {} +func (*RiskAnalysisOperationResult_KAnonymityResult) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{33, 2} +} + +func (m *RiskAnalysisOperationResult_KAnonymityResult) GetEquivalenceClassHistogramBuckets() []*RiskAnalysisOperationResult_KAnonymityResult_KAnonymityHistogramBucket { + if m != nil { + return m.EquivalenceClassHistogramBuckets + } + return nil +} + +// The set of columns' values that share the same k-anonymity value. +type RiskAnalysisOperationResult_KAnonymityResult_KAnonymityEquivalenceClass struct { + // Set of values defining the equivalence class. One value per + // quasi-identifier column in the original KAnonymity metric message. + // The order is always the same as the original request. + QuasiIdsValues []*Value `protobuf:"bytes,1,rep,name=quasi_ids_values,json=quasiIdsValues" json:"quasi_ids_values,omitempty"` + // Size of the equivalence class, for example number of rows with the + // above set of values. + EquivalenceClassSize int64 `protobuf:"varint,2,opt,name=equivalence_class_size,json=equivalenceClassSize" json:"equivalence_class_size,omitempty"` +} + +func (m *RiskAnalysisOperationResult_KAnonymityResult_KAnonymityEquivalenceClass) Reset() { + *m = RiskAnalysisOperationResult_KAnonymityResult_KAnonymityEquivalenceClass{} +} +func (m *RiskAnalysisOperationResult_KAnonymityResult_KAnonymityEquivalenceClass) String() string { + return proto.CompactTextString(m) +} +func (*RiskAnalysisOperationResult_KAnonymityResult_KAnonymityEquivalenceClass) ProtoMessage() {} +func (*RiskAnalysisOperationResult_KAnonymityResult_KAnonymityEquivalenceClass) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{33, 2, 0} +} + +func (m *RiskAnalysisOperationResult_KAnonymityResult_KAnonymityEquivalenceClass) GetQuasiIdsValues() []*Value { + if m != nil { + return m.QuasiIdsValues + } + return nil +} + +func (m *RiskAnalysisOperationResult_KAnonymityResult_KAnonymityEquivalenceClass) GetEquivalenceClassSize() int64 { + if m != nil { + return m.EquivalenceClassSize + } + return 0 +} + +// Histogram bucket of equivalence class sizes in the table. +type RiskAnalysisOperationResult_KAnonymityResult_KAnonymityHistogramBucket struct { + // Lower bound on the size of the equivalence classes in this bucket. + EquivalenceClassSizeLowerBound int64 `protobuf:"varint,1,opt,name=equivalence_class_size_lower_bound,json=equivalenceClassSizeLowerBound" json:"equivalence_class_size_lower_bound,omitempty"` + // Upper bound on the size of the equivalence classes in this bucket. + EquivalenceClassSizeUpperBound int64 `protobuf:"varint,2,opt,name=equivalence_class_size_upper_bound,json=equivalenceClassSizeUpperBound" json:"equivalence_class_size_upper_bound,omitempty"` + // Total number of records in this bucket. + BucketSize int64 `protobuf:"varint,3,opt,name=bucket_size,json=bucketSize" json:"bucket_size,omitempty"` + // Sample of equivalence classes in this bucket. The total number of + // classes returned per bucket is capped at 20. + BucketValues []*RiskAnalysisOperationResult_KAnonymityResult_KAnonymityEquivalenceClass `protobuf:"bytes,4,rep,name=bucket_values,json=bucketValues" json:"bucket_values,omitempty"` +} + +func (m *RiskAnalysisOperationResult_KAnonymityResult_KAnonymityHistogramBucket) Reset() { + *m = RiskAnalysisOperationResult_KAnonymityResult_KAnonymityHistogramBucket{} +} +func (m *RiskAnalysisOperationResult_KAnonymityResult_KAnonymityHistogramBucket) String() string { + return proto.CompactTextString(m) +} +func (*RiskAnalysisOperationResult_KAnonymityResult_KAnonymityHistogramBucket) ProtoMessage() {} +func (*RiskAnalysisOperationResult_KAnonymityResult_KAnonymityHistogramBucket) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{33, 2, 1} +} + +func (m *RiskAnalysisOperationResult_KAnonymityResult_KAnonymityHistogramBucket) GetEquivalenceClassSizeLowerBound() int64 { + if m != nil { + return m.EquivalenceClassSizeLowerBound + } + return 0 +} + +func (m *RiskAnalysisOperationResult_KAnonymityResult_KAnonymityHistogramBucket) GetEquivalenceClassSizeUpperBound() int64 { + if m != nil { + return m.EquivalenceClassSizeUpperBound + } + return 0 +} + +func (m *RiskAnalysisOperationResult_KAnonymityResult_KAnonymityHistogramBucket) GetBucketSize() int64 { + if m != nil { + return m.BucketSize + } + return 0 +} + +func (m *RiskAnalysisOperationResult_KAnonymityResult_KAnonymityHistogramBucket) GetBucketValues() []*RiskAnalysisOperationResult_KAnonymityResult_KAnonymityEquivalenceClass { + if m != nil { + return m.BucketValues + } + return nil +} + +// Result of the l-diversity computation. +type RiskAnalysisOperationResult_LDiversityResult struct { + // Histogram of l-diversity equivalence class sensitive value frequencies. + SensitiveValueFrequencyHistogramBuckets []*RiskAnalysisOperationResult_LDiversityResult_LDiversityHistogramBucket `protobuf:"bytes,5,rep,name=sensitive_value_frequency_histogram_buckets,json=sensitiveValueFrequencyHistogramBuckets" json:"sensitive_value_frequency_histogram_buckets,omitempty"` +} + +func (m *RiskAnalysisOperationResult_LDiversityResult) Reset() { + *m = RiskAnalysisOperationResult_LDiversityResult{} +} +func (m *RiskAnalysisOperationResult_LDiversityResult) String() string { + return proto.CompactTextString(m) +} +func (*RiskAnalysisOperationResult_LDiversityResult) ProtoMessage() {} +func (*RiskAnalysisOperationResult_LDiversityResult) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{33, 3} +} + +func (m *RiskAnalysisOperationResult_LDiversityResult) GetSensitiveValueFrequencyHistogramBuckets() []*RiskAnalysisOperationResult_LDiversityResult_LDiversityHistogramBucket { + if m != nil { + return m.SensitiveValueFrequencyHistogramBuckets + } + return nil +} + +// The set of columns' values that share the same l-diversity value. +type RiskAnalysisOperationResult_LDiversityResult_LDiversityEquivalenceClass struct { + // Quasi-identifier values defining the k-anonymity equivalence + // class. The order is always the same as the original request. + QuasiIdsValues []*Value `protobuf:"bytes,1,rep,name=quasi_ids_values,json=quasiIdsValues" json:"quasi_ids_values,omitempty"` + // Size of the k-anonymity equivalence class. + EquivalenceClassSize int64 `protobuf:"varint,2,opt,name=equivalence_class_size,json=equivalenceClassSize" json:"equivalence_class_size,omitempty"` + // Number of distinct sensitive values in this equivalence class. + NumDistinctSensitiveValues int64 `protobuf:"varint,3,opt,name=num_distinct_sensitive_values,json=numDistinctSensitiveValues" json:"num_distinct_sensitive_values,omitempty"` + // Estimated frequencies of top sensitive values. + TopSensitiveValues []*ValueFrequency `protobuf:"bytes,4,rep,name=top_sensitive_values,json=topSensitiveValues" json:"top_sensitive_values,omitempty"` +} + +func (m *RiskAnalysisOperationResult_LDiversityResult_LDiversityEquivalenceClass) Reset() { + *m = RiskAnalysisOperationResult_LDiversityResult_LDiversityEquivalenceClass{} +} +func (m *RiskAnalysisOperationResult_LDiversityResult_LDiversityEquivalenceClass) String() string { + return proto.CompactTextString(m) +} +func (*RiskAnalysisOperationResult_LDiversityResult_LDiversityEquivalenceClass) ProtoMessage() {} +func (*RiskAnalysisOperationResult_LDiversityResult_LDiversityEquivalenceClass) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{33, 3, 0} +} + +func (m *RiskAnalysisOperationResult_LDiversityResult_LDiversityEquivalenceClass) GetQuasiIdsValues() []*Value { + if m != nil { + return m.QuasiIdsValues + } + return nil +} + +func (m *RiskAnalysisOperationResult_LDiversityResult_LDiversityEquivalenceClass) GetEquivalenceClassSize() int64 { + if m != nil { + return m.EquivalenceClassSize + } + return 0 +} + +func (m *RiskAnalysisOperationResult_LDiversityResult_LDiversityEquivalenceClass) GetNumDistinctSensitiveValues() int64 { + if m != nil { + return m.NumDistinctSensitiveValues + } + return 0 +} + +func (m *RiskAnalysisOperationResult_LDiversityResult_LDiversityEquivalenceClass) GetTopSensitiveValues() []*ValueFrequency { + if m != nil { + return m.TopSensitiveValues + } + return nil +} + +// Histogram bucket of sensitive value frequencies in the table. +type RiskAnalysisOperationResult_LDiversityResult_LDiversityHistogramBucket struct { + // Lower bound on the sensitive value frequencies of the equivalence + // classes in this bucket. + SensitiveValueFrequencyLowerBound int64 `protobuf:"varint,1,opt,name=sensitive_value_frequency_lower_bound,json=sensitiveValueFrequencyLowerBound" json:"sensitive_value_frequency_lower_bound,omitempty"` + // Upper bound on the sensitive value frequencies of the equivalence + // classes in this bucket. + SensitiveValueFrequencyUpperBound int64 `protobuf:"varint,2,opt,name=sensitive_value_frequency_upper_bound,json=sensitiveValueFrequencyUpperBound" json:"sensitive_value_frequency_upper_bound,omitempty"` + // Total number of records in this bucket. + BucketSize int64 `protobuf:"varint,3,opt,name=bucket_size,json=bucketSize" json:"bucket_size,omitempty"` + // Sample of equivalence classes in this bucket. The total number of + // classes returned per bucket is capped at 20. + BucketValues []*RiskAnalysisOperationResult_LDiversityResult_LDiversityEquivalenceClass `protobuf:"bytes,4,rep,name=bucket_values,json=bucketValues" json:"bucket_values,omitempty"` +} + +func (m *RiskAnalysisOperationResult_LDiversityResult_LDiversityHistogramBucket) Reset() { + *m = RiskAnalysisOperationResult_LDiversityResult_LDiversityHistogramBucket{} +} +func (m *RiskAnalysisOperationResult_LDiversityResult_LDiversityHistogramBucket) String() string { + return proto.CompactTextString(m) +} +func (*RiskAnalysisOperationResult_LDiversityResult_LDiversityHistogramBucket) ProtoMessage() {} +func (*RiskAnalysisOperationResult_LDiversityResult_LDiversityHistogramBucket) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{33, 3, 1} +} + +func (m *RiskAnalysisOperationResult_LDiversityResult_LDiversityHistogramBucket) GetSensitiveValueFrequencyLowerBound() int64 { + if m != nil { + return m.SensitiveValueFrequencyLowerBound + } + return 0 +} + +func (m *RiskAnalysisOperationResult_LDiversityResult_LDiversityHistogramBucket) GetSensitiveValueFrequencyUpperBound() int64 { + if m != nil { + return m.SensitiveValueFrequencyUpperBound + } + return 0 +} + +func (m *RiskAnalysisOperationResult_LDiversityResult_LDiversityHistogramBucket) GetBucketSize() int64 { + if m != nil { + return m.BucketSize + } + return 0 +} + +func (m *RiskAnalysisOperationResult_LDiversityResult_LDiversityHistogramBucket) GetBucketValues() []*RiskAnalysisOperationResult_LDiversityResult_LDiversityEquivalenceClass { + if m != nil { + return m.BucketValues + } + return nil +} + +// A value of a field, including its frequency. +type ValueFrequency struct { + // A value contained in the field in question. + Value *Value `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"` + // How many times the value is contained in the field. + Count int64 `protobuf:"varint,2,opt,name=count" json:"count,omitempty"` +} + +func (m *ValueFrequency) Reset() { *m = ValueFrequency{} } +func (m *ValueFrequency) String() string { return proto.CompactTextString(m) } +func (*ValueFrequency) ProtoMessage() {} +func (*ValueFrequency) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{34} } + +func (m *ValueFrequency) GetValue() *Value { + if m != nil { + return m.Value + } + return nil +} + +func (m *ValueFrequency) GetCount() int64 { + if m != nil { + return m.Count + } + return 0 +} + +// Set of primitive values supported by the system. +type Value struct { + // Types that are valid to be assigned to Type: + // *Value_IntegerValue + // *Value_FloatValue + // *Value_StringValue + // *Value_BooleanValue + // *Value_TimestampValue + // *Value_TimeValue + // *Value_DateValue + Type isValue_Type `protobuf_oneof:"type"` +} + +func (m *Value) Reset() { *m = Value{} } +func (m *Value) String() string { return proto.CompactTextString(m) } +func (*Value) ProtoMessage() {} +func (*Value) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{35} } + +type isValue_Type interface { + isValue_Type() +} + +type Value_IntegerValue struct { + IntegerValue int64 `protobuf:"varint,1,opt,name=integer_value,json=integerValue,oneof"` +} +type Value_FloatValue struct { + FloatValue float64 `protobuf:"fixed64,2,opt,name=float_value,json=floatValue,oneof"` +} +type Value_StringValue struct { + StringValue string `protobuf:"bytes,3,opt,name=string_value,json=stringValue,oneof"` +} +type Value_BooleanValue struct { + BooleanValue bool `protobuf:"varint,4,opt,name=boolean_value,json=booleanValue,oneof"` +} +type Value_TimestampValue struct { + TimestampValue *google_protobuf3.Timestamp `protobuf:"bytes,5,opt,name=timestamp_value,json=timestampValue,oneof"` +} +type Value_TimeValue struct { + TimeValue *google_type1.TimeOfDay `protobuf:"bytes,6,opt,name=time_value,json=timeValue,oneof"` +} +type Value_DateValue struct { + DateValue *google_type.Date `protobuf:"bytes,7,opt,name=date_value,json=dateValue,oneof"` +} + +func (*Value_IntegerValue) isValue_Type() {} +func (*Value_FloatValue) isValue_Type() {} +func (*Value_StringValue) isValue_Type() {} +func (*Value_BooleanValue) isValue_Type() {} +func (*Value_TimestampValue) isValue_Type() {} +func (*Value_TimeValue) isValue_Type() {} +func (*Value_DateValue) isValue_Type() {} + +func (m *Value) GetType() isValue_Type { + if m != nil { + return m.Type + } + return nil +} + +func (m *Value) GetIntegerValue() int64 { + if x, ok := m.GetType().(*Value_IntegerValue); ok { + return x.IntegerValue + } + return 0 +} + +func (m *Value) GetFloatValue() float64 { + if x, ok := m.GetType().(*Value_FloatValue); ok { + return x.FloatValue + } + return 0 +} + +func (m *Value) GetStringValue() string { + if x, ok := m.GetType().(*Value_StringValue); ok { + return x.StringValue + } + return "" +} + +func (m *Value) GetBooleanValue() bool { + if x, ok := m.GetType().(*Value_BooleanValue); ok { + return x.BooleanValue + } + return false +} + +func (m *Value) GetTimestampValue() *google_protobuf3.Timestamp { + if x, ok := m.GetType().(*Value_TimestampValue); ok { + return x.TimestampValue + } + return nil +} + +func (m *Value) GetTimeValue() *google_type1.TimeOfDay { + if x, ok := m.GetType().(*Value_TimeValue); ok { + return x.TimeValue + } + return nil +} + +func (m *Value) GetDateValue() *google_type.Date { + if x, ok := m.GetType().(*Value_DateValue); ok { + return x.DateValue + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Value) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _Value_OneofMarshaler, _Value_OneofUnmarshaler, _Value_OneofSizer, []interface{}{ + (*Value_IntegerValue)(nil), + (*Value_FloatValue)(nil), + (*Value_StringValue)(nil), + (*Value_BooleanValue)(nil), + (*Value_TimestampValue)(nil), + (*Value_TimeValue)(nil), + (*Value_DateValue)(nil), + } +} + +func _Value_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Value) + // type + switch x := m.Type.(type) { + case *Value_IntegerValue: + b.EncodeVarint(1<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.IntegerValue)) + case *Value_FloatValue: + b.EncodeVarint(2<<3 | proto.WireFixed64) + b.EncodeFixed64(math.Float64bits(x.FloatValue)) + case *Value_StringValue: + b.EncodeVarint(3<<3 | proto.WireBytes) + b.EncodeStringBytes(x.StringValue) + case *Value_BooleanValue: + t := uint64(0) + if x.BooleanValue { + t = 1 + } + b.EncodeVarint(4<<3 | proto.WireVarint) + b.EncodeVarint(t) + case *Value_TimestampValue: + b.EncodeVarint(5<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.TimestampValue); err != nil { + return err + } + case *Value_TimeValue: + b.EncodeVarint(6<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.TimeValue); err != nil { + return err + } + case *Value_DateValue: + b.EncodeVarint(7<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.DateValue); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("Value.Type has unexpected type %T", x) + } + return nil +} + +func _Value_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Value) + switch tag { + case 1: // type.integer_value + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Type = &Value_IntegerValue{int64(x)} + return true, err + case 2: // type.float_value + if wire != proto.WireFixed64 { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeFixed64() + m.Type = &Value_FloatValue{math.Float64frombits(x)} + return true, err + case 3: // type.string_value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Type = &Value_StringValue{x} + return true, err + case 4: // type.boolean_value + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Type = &Value_BooleanValue{x != 0} + return true, err + case 5: // type.timestamp_value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(google_protobuf3.Timestamp) + err := b.DecodeMessage(msg) + m.Type = &Value_TimestampValue{msg} + return true, err + case 6: // type.time_value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(google_type1.TimeOfDay) + err := b.DecodeMessage(msg) + m.Type = &Value_TimeValue{msg} + return true, err + case 7: // type.date_value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(google_type.Date) + err := b.DecodeMessage(msg) + m.Type = &Value_DateValue{msg} + return true, err + default: + return false, nil + } +} + +func _Value_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Value) + // type + switch x := m.Type.(type) { + case *Value_IntegerValue: + n += proto.SizeVarint(1<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.IntegerValue)) + case *Value_FloatValue: + n += proto.SizeVarint(2<<3 | proto.WireFixed64) + n += 8 + case *Value_StringValue: + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.StringValue))) + n += len(x.StringValue) + case *Value_BooleanValue: + n += proto.SizeVarint(4<<3 | proto.WireVarint) + n += 1 + case *Value_TimestampValue: + s := proto.Size(x.TimestampValue) + n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Value_TimeValue: + s := proto.Size(x.TimeValue) + n += proto.SizeVarint(6<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Value_DateValue: + s := proto.Size(x.DateValue) + n += proto.SizeVarint(7<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// The configuration that controls how the data will change. +type DeidentifyConfig struct { + // Types that are valid to be assigned to Transformation: + // *DeidentifyConfig_InfoTypeTransformations + // *DeidentifyConfig_RecordTransformations + Transformation isDeidentifyConfig_Transformation `protobuf_oneof:"transformation"` +} + +func (m *DeidentifyConfig) Reset() { *m = DeidentifyConfig{} } +func (m *DeidentifyConfig) String() string { return proto.CompactTextString(m) } +func (*DeidentifyConfig) ProtoMessage() {} +func (*DeidentifyConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{36} } + +type isDeidentifyConfig_Transformation interface { + isDeidentifyConfig_Transformation() +} + +type DeidentifyConfig_InfoTypeTransformations struct { + InfoTypeTransformations *InfoTypeTransformations `protobuf:"bytes,1,opt,name=info_type_transformations,json=infoTypeTransformations,oneof"` +} +type DeidentifyConfig_RecordTransformations struct { + RecordTransformations *RecordTransformations `protobuf:"bytes,2,opt,name=record_transformations,json=recordTransformations,oneof"` +} + +func (*DeidentifyConfig_InfoTypeTransformations) isDeidentifyConfig_Transformation() {} +func (*DeidentifyConfig_RecordTransformations) isDeidentifyConfig_Transformation() {} + +func (m *DeidentifyConfig) GetTransformation() isDeidentifyConfig_Transformation { + if m != nil { + return m.Transformation + } + return nil +} + +func (m *DeidentifyConfig) GetInfoTypeTransformations() *InfoTypeTransformations { + if x, ok := m.GetTransformation().(*DeidentifyConfig_InfoTypeTransformations); ok { + return x.InfoTypeTransformations + } + return nil +} + +func (m *DeidentifyConfig) GetRecordTransformations() *RecordTransformations { + if x, ok := m.GetTransformation().(*DeidentifyConfig_RecordTransformations); ok { + return x.RecordTransformations + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*DeidentifyConfig) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _DeidentifyConfig_OneofMarshaler, _DeidentifyConfig_OneofUnmarshaler, _DeidentifyConfig_OneofSizer, []interface{}{ + (*DeidentifyConfig_InfoTypeTransformations)(nil), + (*DeidentifyConfig_RecordTransformations)(nil), + } +} + +func _DeidentifyConfig_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*DeidentifyConfig) + // transformation + switch x := m.Transformation.(type) { + case *DeidentifyConfig_InfoTypeTransformations: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.InfoTypeTransformations); err != nil { + return err + } + case *DeidentifyConfig_RecordTransformations: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.RecordTransformations); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("DeidentifyConfig.Transformation has unexpected type %T", x) + } + return nil +} + +func _DeidentifyConfig_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*DeidentifyConfig) + switch tag { + case 1: // transformation.info_type_transformations + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(InfoTypeTransformations) + err := b.DecodeMessage(msg) + m.Transformation = &DeidentifyConfig_InfoTypeTransformations{msg} + return true, err + case 2: // transformation.record_transformations + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(RecordTransformations) + err := b.DecodeMessage(msg) + m.Transformation = &DeidentifyConfig_RecordTransformations{msg} + return true, err + default: + return false, nil + } +} + +func _DeidentifyConfig_OneofSizer(msg proto.Message) (n int) { + m := msg.(*DeidentifyConfig) + // transformation + switch x := m.Transformation.(type) { + case *DeidentifyConfig_InfoTypeTransformations: + s := proto.Size(x.InfoTypeTransformations) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *DeidentifyConfig_RecordTransformations: + s := proto.Size(x.RecordTransformations) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// A rule for transforming a value. +type PrimitiveTransformation struct { + // Types that are valid to be assigned to Transformation: + // *PrimitiveTransformation_ReplaceConfig + // *PrimitiveTransformation_RedactConfig + // *PrimitiveTransformation_CharacterMaskConfig + // *PrimitiveTransformation_CryptoReplaceFfxFpeConfig + // *PrimitiveTransformation_FixedSizeBucketingConfig + // *PrimitiveTransformation_BucketingConfig + // *PrimitiveTransformation_ReplaceWithInfoTypeConfig + // *PrimitiveTransformation_TimePartConfig + // *PrimitiveTransformation_CryptoHashConfig + Transformation isPrimitiveTransformation_Transformation `protobuf_oneof:"transformation"` +} + +func (m *PrimitiveTransformation) Reset() { *m = PrimitiveTransformation{} } +func (m *PrimitiveTransformation) String() string { return proto.CompactTextString(m) } +func (*PrimitiveTransformation) ProtoMessage() {} +func (*PrimitiveTransformation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{37} } + +type isPrimitiveTransformation_Transformation interface { + isPrimitiveTransformation_Transformation() +} + +type PrimitiveTransformation_ReplaceConfig struct { + ReplaceConfig *ReplaceValueConfig `protobuf:"bytes,1,opt,name=replace_config,json=replaceConfig,oneof"` +} +type PrimitiveTransformation_RedactConfig struct { + RedactConfig *RedactConfig `protobuf:"bytes,2,opt,name=redact_config,json=redactConfig,oneof"` +} +type PrimitiveTransformation_CharacterMaskConfig struct { + CharacterMaskConfig *CharacterMaskConfig `protobuf:"bytes,3,opt,name=character_mask_config,json=characterMaskConfig,oneof"` +} +type PrimitiveTransformation_CryptoReplaceFfxFpeConfig struct { + CryptoReplaceFfxFpeConfig *CryptoReplaceFfxFpeConfig `protobuf:"bytes,4,opt,name=crypto_replace_ffx_fpe_config,json=cryptoReplaceFfxFpeConfig,oneof"` +} +type PrimitiveTransformation_FixedSizeBucketingConfig struct { + FixedSizeBucketingConfig *FixedSizeBucketingConfig `protobuf:"bytes,5,opt,name=fixed_size_bucketing_config,json=fixedSizeBucketingConfig,oneof"` +} +type PrimitiveTransformation_BucketingConfig struct { + BucketingConfig *BucketingConfig `protobuf:"bytes,6,opt,name=bucketing_config,json=bucketingConfig,oneof"` +} +type PrimitiveTransformation_ReplaceWithInfoTypeConfig struct { + ReplaceWithInfoTypeConfig *ReplaceWithInfoTypeConfig `protobuf:"bytes,7,opt,name=replace_with_info_type_config,json=replaceWithInfoTypeConfig,oneof"` +} +type PrimitiveTransformation_TimePartConfig struct { + TimePartConfig *TimePartConfig `protobuf:"bytes,8,opt,name=time_part_config,json=timePartConfig,oneof"` +} +type PrimitiveTransformation_CryptoHashConfig struct { + CryptoHashConfig *CryptoHashConfig `protobuf:"bytes,9,opt,name=crypto_hash_config,json=cryptoHashConfig,oneof"` +} + +func (*PrimitiveTransformation_ReplaceConfig) isPrimitiveTransformation_Transformation() {} +func (*PrimitiveTransformation_RedactConfig) isPrimitiveTransformation_Transformation() {} +func (*PrimitiveTransformation_CharacterMaskConfig) isPrimitiveTransformation_Transformation() {} +func (*PrimitiveTransformation_CryptoReplaceFfxFpeConfig) isPrimitiveTransformation_Transformation() {} +func (*PrimitiveTransformation_FixedSizeBucketingConfig) isPrimitiveTransformation_Transformation() {} +func (*PrimitiveTransformation_BucketingConfig) isPrimitiveTransformation_Transformation() {} +func (*PrimitiveTransformation_ReplaceWithInfoTypeConfig) isPrimitiveTransformation_Transformation() {} +func (*PrimitiveTransformation_TimePartConfig) isPrimitiveTransformation_Transformation() {} +func (*PrimitiveTransformation_CryptoHashConfig) isPrimitiveTransformation_Transformation() {} + +func (m *PrimitiveTransformation) GetTransformation() isPrimitiveTransformation_Transformation { + if m != nil { + return m.Transformation + } + return nil +} + +func (m *PrimitiveTransformation) GetReplaceConfig() *ReplaceValueConfig { + if x, ok := m.GetTransformation().(*PrimitiveTransformation_ReplaceConfig); ok { + return x.ReplaceConfig + } + return nil +} + +func (m *PrimitiveTransformation) GetRedactConfig() *RedactConfig { + if x, ok := m.GetTransformation().(*PrimitiveTransformation_RedactConfig); ok { + return x.RedactConfig + } + return nil +} + +func (m *PrimitiveTransformation) GetCharacterMaskConfig() *CharacterMaskConfig { + if x, ok := m.GetTransformation().(*PrimitiveTransformation_CharacterMaskConfig); ok { + return x.CharacterMaskConfig + } + return nil +} + +func (m *PrimitiveTransformation) GetCryptoReplaceFfxFpeConfig() *CryptoReplaceFfxFpeConfig { + if x, ok := m.GetTransformation().(*PrimitiveTransformation_CryptoReplaceFfxFpeConfig); ok { + return x.CryptoReplaceFfxFpeConfig + } + return nil +} + +func (m *PrimitiveTransformation) GetFixedSizeBucketingConfig() *FixedSizeBucketingConfig { + if x, ok := m.GetTransformation().(*PrimitiveTransformation_FixedSizeBucketingConfig); ok { + return x.FixedSizeBucketingConfig + } + return nil +} + +func (m *PrimitiveTransformation) GetBucketingConfig() *BucketingConfig { + if x, ok := m.GetTransformation().(*PrimitiveTransformation_BucketingConfig); ok { + return x.BucketingConfig + } + return nil +} + +func (m *PrimitiveTransformation) GetReplaceWithInfoTypeConfig() *ReplaceWithInfoTypeConfig { + if x, ok := m.GetTransformation().(*PrimitiveTransformation_ReplaceWithInfoTypeConfig); ok { + return x.ReplaceWithInfoTypeConfig + } + return nil +} + +func (m *PrimitiveTransformation) GetTimePartConfig() *TimePartConfig { + if x, ok := m.GetTransformation().(*PrimitiveTransformation_TimePartConfig); ok { + return x.TimePartConfig + } + return nil +} + +func (m *PrimitiveTransformation) GetCryptoHashConfig() *CryptoHashConfig { + if x, ok := m.GetTransformation().(*PrimitiveTransformation_CryptoHashConfig); ok { + return x.CryptoHashConfig + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*PrimitiveTransformation) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _PrimitiveTransformation_OneofMarshaler, _PrimitiveTransformation_OneofUnmarshaler, _PrimitiveTransformation_OneofSizer, []interface{}{ + (*PrimitiveTransformation_ReplaceConfig)(nil), + (*PrimitiveTransformation_RedactConfig)(nil), + (*PrimitiveTransformation_CharacterMaskConfig)(nil), + (*PrimitiveTransformation_CryptoReplaceFfxFpeConfig)(nil), + (*PrimitiveTransformation_FixedSizeBucketingConfig)(nil), + (*PrimitiveTransformation_BucketingConfig)(nil), + (*PrimitiveTransformation_ReplaceWithInfoTypeConfig)(nil), + (*PrimitiveTransformation_TimePartConfig)(nil), + (*PrimitiveTransformation_CryptoHashConfig)(nil), + } +} + +func _PrimitiveTransformation_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*PrimitiveTransformation) + // transformation + switch x := m.Transformation.(type) { + case *PrimitiveTransformation_ReplaceConfig: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ReplaceConfig); err != nil { + return err + } + case *PrimitiveTransformation_RedactConfig: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.RedactConfig); err != nil { + return err + } + case *PrimitiveTransformation_CharacterMaskConfig: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.CharacterMaskConfig); err != nil { + return err + } + case *PrimitiveTransformation_CryptoReplaceFfxFpeConfig: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.CryptoReplaceFfxFpeConfig); err != nil { + return err + } + case *PrimitiveTransformation_FixedSizeBucketingConfig: + b.EncodeVarint(5<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.FixedSizeBucketingConfig); err != nil { + return err + } + case *PrimitiveTransformation_BucketingConfig: + b.EncodeVarint(6<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BucketingConfig); err != nil { + return err + } + case *PrimitiveTransformation_ReplaceWithInfoTypeConfig: + b.EncodeVarint(7<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ReplaceWithInfoTypeConfig); err != nil { + return err + } + case *PrimitiveTransformation_TimePartConfig: + b.EncodeVarint(8<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.TimePartConfig); err != nil { + return err + } + case *PrimitiveTransformation_CryptoHashConfig: + b.EncodeVarint(9<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.CryptoHashConfig); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("PrimitiveTransformation.Transformation has unexpected type %T", x) + } + return nil +} + +func _PrimitiveTransformation_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*PrimitiveTransformation) + switch tag { + case 1: // transformation.replace_config + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ReplaceValueConfig) + err := b.DecodeMessage(msg) + m.Transformation = &PrimitiveTransformation_ReplaceConfig{msg} + return true, err + case 2: // transformation.redact_config + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(RedactConfig) + err := b.DecodeMessage(msg) + m.Transformation = &PrimitiveTransformation_RedactConfig{msg} + return true, err + case 3: // transformation.character_mask_config + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(CharacterMaskConfig) + err := b.DecodeMessage(msg) + m.Transformation = &PrimitiveTransformation_CharacterMaskConfig{msg} + return true, err + case 4: // transformation.crypto_replace_ffx_fpe_config + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(CryptoReplaceFfxFpeConfig) + err := b.DecodeMessage(msg) + m.Transformation = &PrimitiveTransformation_CryptoReplaceFfxFpeConfig{msg} + return true, err + case 5: // transformation.fixed_size_bucketing_config + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(FixedSizeBucketingConfig) + err := b.DecodeMessage(msg) + m.Transformation = &PrimitiveTransformation_FixedSizeBucketingConfig{msg} + return true, err + case 6: // transformation.bucketing_config + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(BucketingConfig) + err := b.DecodeMessage(msg) + m.Transformation = &PrimitiveTransformation_BucketingConfig{msg} + return true, err + case 7: // transformation.replace_with_info_type_config + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ReplaceWithInfoTypeConfig) + err := b.DecodeMessage(msg) + m.Transformation = &PrimitiveTransformation_ReplaceWithInfoTypeConfig{msg} + return true, err + case 8: // transformation.time_part_config + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(TimePartConfig) + err := b.DecodeMessage(msg) + m.Transformation = &PrimitiveTransformation_TimePartConfig{msg} + return true, err + case 9: // transformation.crypto_hash_config + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(CryptoHashConfig) + err := b.DecodeMessage(msg) + m.Transformation = &PrimitiveTransformation_CryptoHashConfig{msg} + return true, err + default: + return false, nil + } +} + +func _PrimitiveTransformation_OneofSizer(msg proto.Message) (n int) { + m := msg.(*PrimitiveTransformation) + // transformation + switch x := m.Transformation.(type) { + case *PrimitiveTransformation_ReplaceConfig: + s := proto.Size(x.ReplaceConfig) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *PrimitiveTransformation_RedactConfig: + s := proto.Size(x.RedactConfig) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *PrimitiveTransformation_CharacterMaskConfig: + s := proto.Size(x.CharacterMaskConfig) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *PrimitiveTransformation_CryptoReplaceFfxFpeConfig: + s := proto.Size(x.CryptoReplaceFfxFpeConfig) + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *PrimitiveTransformation_FixedSizeBucketingConfig: + s := proto.Size(x.FixedSizeBucketingConfig) + n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *PrimitiveTransformation_BucketingConfig: + s := proto.Size(x.BucketingConfig) + n += proto.SizeVarint(6<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *PrimitiveTransformation_ReplaceWithInfoTypeConfig: + s := proto.Size(x.ReplaceWithInfoTypeConfig) + n += proto.SizeVarint(7<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *PrimitiveTransformation_TimePartConfig: + s := proto.Size(x.TimePartConfig) + n += proto.SizeVarint(8<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *PrimitiveTransformation_CryptoHashConfig: + s := proto.Size(x.CryptoHashConfig) + n += proto.SizeVarint(9<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// For use with `Date`, `Timestamp`, and `TimeOfDay`, extract or preserve a +// portion of the value. +type TimePartConfig struct { + PartToExtract TimePartConfig_TimePart `protobuf:"varint,1,opt,name=part_to_extract,json=partToExtract,enum=google.privacy.dlp.v2beta1.TimePartConfig_TimePart" json:"part_to_extract,omitempty"` +} + +func (m *TimePartConfig) Reset() { *m = TimePartConfig{} } +func (m *TimePartConfig) String() string { return proto.CompactTextString(m) } +func (*TimePartConfig) ProtoMessage() {} +func (*TimePartConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{38} } + +func (m *TimePartConfig) GetPartToExtract() TimePartConfig_TimePart { + if m != nil { + return m.PartToExtract + } + return TimePartConfig_TIME_PART_UNSPECIFIED +} + +// Pseudonymization method that generates surrogates via cryptographic hashing. +// Uses SHA-256. +// Outputs a 32 byte digest as an uppercase hex string +// (for example, 41D1567F7F99F1DC2A5FAB886DEE5BEE). +// Currently, only string and integer values can be hashed. +type CryptoHashConfig struct { + // The key used by the hash function. + CryptoKey *CryptoKey `protobuf:"bytes,1,opt,name=crypto_key,json=cryptoKey" json:"crypto_key,omitempty"` +} + +func (m *CryptoHashConfig) Reset() { *m = CryptoHashConfig{} } +func (m *CryptoHashConfig) String() string { return proto.CompactTextString(m) } +func (*CryptoHashConfig) ProtoMessage() {} +func (*CryptoHashConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{39} } + +func (m *CryptoHashConfig) GetCryptoKey() *CryptoKey { + if m != nil { + return m.CryptoKey + } + return nil +} + +// Replace each input value with a given `Value`. +type ReplaceValueConfig struct { + // Value to replace it with. + NewValue *Value `protobuf:"bytes,1,opt,name=new_value,json=newValue" json:"new_value,omitempty"` +} + +func (m *ReplaceValueConfig) Reset() { *m = ReplaceValueConfig{} } +func (m *ReplaceValueConfig) String() string { return proto.CompactTextString(m) } +func (*ReplaceValueConfig) ProtoMessage() {} +func (*ReplaceValueConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{40} } + +func (m *ReplaceValueConfig) GetNewValue() *Value { + if m != nil { + return m.NewValue + } + return nil +} + +// Replace each matching finding with the name of the info_type. +type ReplaceWithInfoTypeConfig struct { +} + +func (m *ReplaceWithInfoTypeConfig) Reset() { *m = ReplaceWithInfoTypeConfig{} } +func (m *ReplaceWithInfoTypeConfig) String() string { return proto.CompactTextString(m) } +func (*ReplaceWithInfoTypeConfig) ProtoMessage() {} +func (*ReplaceWithInfoTypeConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{41} } + +// Redact a given value. For example, if used with an `InfoTypeTransformation` +// transforming PHONE_NUMBER, and input 'My phone number is 206-555-0123', the +// output would be 'My phone number is '. +type RedactConfig struct { +} + +func (m *RedactConfig) Reset() { *m = RedactConfig{} } +func (m *RedactConfig) String() string { return proto.CompactTextString(m) } +func (*RedactConfig) ProtoMessage() {} +func (*RedactConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{42} } + +// Characters to skip when doing deidentification of a value. These will be left +// alone and skipped. +type CharsToIgnore struct { + // Types that are valid to be assigned to Characters: + // *CharsToIgnore_CharactersToSkip + // *CharsToIgnore_CommonCharactersToIgnore + Characters isCharsToIgnore_Characters `protobuf_oneof:"characters"` +} + +func (m *CharsToIgnore) Reset() { *m = CharsToIgnore{} } +func (m *CharsToIgnore) String() string { return proto.CompactTextString(m) } +func (*CharsToIgnore) ProtoMessage() {} +func (*CharsToIgnore) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{43} } + +type isCharsToIgnore_Characters interface { + isCharsToIgnore_Characters() +} + +type CharsToIgnore_CharactersToSkip struct { + CharactersToSkip string `protobuf:"bytes,1,opt,name=characters_to_skip,json=charactersToSkip,oneof"` +} +type CharsToIgnore_CommonCharactersToIgnore struct { + CommonCharactersToIgnore CharsToIgnore_CharacterGroup `protobuf:"varint,2,opt,name=common_characters_to_ignore,json=commonCharactersToIgnore,enum=google.privacy.dlp.v2beta1.CharsToIgnore_CharacterGroup,oneof"` +} + +func (*CharsToIgnore_CharactersToSkip) isCharsToIgnore_Characters() {} +func (*CharsToIgnore_CommonCharactersToIgnore) isCharsToIgnore_Characters() {} + +func (m *CharsToIgnore) GetCharacters() isCharsToIgnore_Characters { + if m != nil { + return m.Characters + } + return nil +} + +func (m *CharsToIgnore) GetCharactersToSkip() string { + if x, ok := m.GetCharacters().(*CharsToIgnore_CharactersToSkip); ok { + return x.CharactersToSkip + } + return "" +} + +func (m *CharsToIgnore) GetCommonCharactersToIgnore() CharsToIgnore_CharacterGroup { + if x, ok := m.GetCharacters().(*CharsToIgnore_CommonCharactersToIgnore); ok { + return x.CommonCharactersToIgnore + } + return CharsToIgnore_CHARACTER_GROUP_UNSPECIFIED +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*CharsToIgnore) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _CharsToIgnore_OneofMarshaler, _CharsToIgnore_OneofUnmarshaler, _CharsToIgnore_OneofSizer, []interface{}{ + (*CharsToIgnore_CharactersToSkip)(nil), + (*CharsToIgnore_CommonCharactersToIgnore)(nil), + } +} + +func _CharsToIgnore_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*CharsToIgnore) + // characters + switch x := m.Characters.(type) { + case *CharsToIgnore_CharactersToSkip: + b.EncodeVarint(1<<3 | proto.WireBytes) + b.EncodeStringBytes(x.CharactersToSkip) + case *CharsToIgnore_CommonCharactersToIgnore: + b.EncodeVarint(2<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.CommonCharactersToIgnore)) + case nil: + default: + return fmt.Errorf("CharsToIgnore.Characters has unexpected type %T", x) + } + return nil +} + +func _CharsToIgnore_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*CharsToIgnore) + switch tag { + case 1: // characters.characters_to_skip + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Characters = &CharsToIgnore_CharactersToSkip{x} + return true, err + case 2: // characters.common_characters_to_ignore + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Characters = &CharsToIgnore_CommonCharactersToIgnore{CharsToIgnore_CharacterGroup(x)} + return true, err + default: + return false, nil + } +} + +func _CharsToIgnore_OneofSizer(msg proto.Message) (n int) { + m := msg.(*CharsToIgnore) + // characters + switch x := m.Characters.(type) { + case *CharsToIgnore_CharactersToSkip: + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.CharactersToSkip))) + n += len(x.CharactersToSkip) + case *CharsToIgnore_CommonCharactersToIgnore: + n += proto.SizeVarint(2<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.CommonCharactersToIgnore)) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Partially mask a string by replacing a given number of characters with a +// fixed character. Masking can start from the beginning or end of the string. +// This can be used on data of any type (numbers, longs, and so on) and when +// de-identifying structured data we'll attempt to preserve the original data's +// type. (This allows you to take a long like 123 and modify it to a string like +// **3. +type CharacterMaskConfig struct { + // Character to mask the sensitive values—for example, "*" for an + // alphabetic string such as name, or "0" for a numeric string such as ZIP + // code or credit card number. String must have length 1. If not supplied, we + // will default to "*" for strings, 0 for digits. + MaskingCharacter string `protobuf:"bytes,1,opt,name=masking_character,json=maskingCharacter" json:"masking_character,omitempty"` + // Number of characters to mask. If not set, all matching chars will be + // masked. Skipped characters do not count towards this tally. + NumberToMask int32 `protobuf:"varint,2,opt,name=number_to_mask,json=numberToMask" json:"number_to_mask,omitempty"` + // Mask characters in reverse order. For example, if `masking_character` is + // '0', number_to_mask is 14, and `reverse_order` is false, then + // 1234-5678-9012-3456 -> 00000000000000-3456 + // If `masking_character` is '*', `number_to_mask` is 3, and `reverse_order` + // is true, then 12345 -> 12*** + ReverseOrder bool `protobuf:"varint,3,opt,name=reverse_order,json=reverseOrder" json:"reverse_order,omitempty"` + // When masking a string, items in this list will be skipped when replacing. + // For example, if your string is 555-555-5555 and you ask us to skip `-` and + // mask 5 chars with * we would produce ***-*55-5555. + CharactersToIgnore []*CharsToIgnore `protobuf:"bytes,4,rep,name=characters_to_ignore,json=charactersToIgnore" json:"characters_to_ignore,omitempty"` +} + +func (m *CharacterMaskConfig) Reset() { *m = CharacterMaskConfig{} } +func (m *CharacterMaskConfig) String() string { return proto.CompactTextString(m) } +func (*CharacterMaskConfig) ProtoMessage() {} +func (*CharacterMaskConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{44} } + +func (m *CharacterMaskConfig) GetMaskingCharacter() string { + if m != nil { + return m.MaskingCharacter + } + return "" +} + +func (m *CharacterMaskConfig) GetNumberToMask() int32 { + if m != nil { + return m.NumberToMask + } + return 0 +} + +func (m *CharacterMaskConfig) GetReverseOrder() bool { + if m != nil { + return m.ReverseOrder + } + return false +} + +func (m *CharacterMaskConfig) GetCharactersToIgnore() []*CharsToIgnore { + if m != nil { + return m.CharactersToIgnore + } + return nil +} + +// Buckets values based on fixed size ranges. The +// Bucketing transformation can provide all of this functionality, +// but requires more configuration. This message is provided as a convenience to +// the user for simple bucketing strategies. +// The resulting value will be a hyphenated string of +// lower_bound-upper_bound. +// This can be used on data of type: double, long. +// If the bound Value type differs from the type of data +// being transformed, we will first attempt converting the type of the data to +// be transformed to match the type of the bound before comparing. +type FixedSizeBucketingConfig struct { + // Lower bound value of buckets. All values less than `lower_bound` are + // grouped together into a single bucket; for example if `lower_bound` = 10, + // then all values less than 10 are replaced with the value “-10”. [Required]. + LowerBound *Value `protobuf:"bytes,1,opt,name=lower_bound,json=lowerBound" json:"lower_bound,omitempty"` + // Upper bound value of buckets. All values greater than upper_bound are + // grouped together into a single bucket; for example if `upper_bound` = 89, + // then all values greater than 89 are replaced with the value “89+”. + // [Required]. + UpperBound *Value `protobuf:"bytes,2,opt,name=upper_bound,json=upperBound" json:"upper_bound,omitempty"` + // Size of each bucket (except for minimum and maximum buckets). So if + // `lower_bound` = 10, `upper_bound` = 89, and `bucket_size` = 10, then the + // following buckets would be used: -10, 10-20, 20-30, 30-40, 40-50, 50-60, + // 60-70, 70-80, 80-89, 89+. Precision up to 2 decimals works. [Required]. + BucketSize float64 `protobuf:"fixed64,3,opt,name=bucket_size,json=bucketSize" json:"bucket_size,omitempty"` +} + +func (m *FixedSizeBucketingConfig) Reset() { *m = FixedSizeBucketingConfig{} } +func (m *FixedSizeBucketingConfig) String() string { return proto.CompactTextString(m) } +func (*FixedSizeBucketingConfig) ProtoMessage() {} +func (*FixedSizeBucketingConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{45} } + +func (m *FixedSizeBucketingConfig) GetLowerBound() *Value { + if m != nil { + return m.LowerBound + } + return nil +} + +func (m *FixedSizeBucketingConfig) GetUpperBound() *Value { + if m != nil { + return m.UpperBound + } + return nil +} + +func (m *FixedSizeBucketingConfig) GetBucketSize() float64 { + if m != nil { + return m.BucketSize + } + return 0 +} + +// Generalization function that buckets values based on ranges. The ranges and +// replacement values are dynamically provided by the user for custom behavior, +// such as 1-30 -> LOW 31-65 -> MEDIUM 66-100 -> HIGH +// This can be used on +// data of type: number, long, string, timestamp. +// If the bound `Value` type differs from the type of data being transformed, we +// will first attempt converting the type of the data to be transformed to match +// the type of the bound before comparing. +type BucketingConfig struct { + Buckets []*BucketingConfig_Bucket `protobuf:"bytes,1,rep,name=buckets" json:"buckets,omitempty"` +} + +func (m *BucketingConfig) Reset() { *m = BucketingConfig{} } +func (m *BucketingConfig) String() string { return proto.CompactTextString(m) } +func (*BucketingConfig) ProtoMessage() {} +func (*BucketingConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{46} } + +func (m *BucketingConfig) GetBuckets() []*BucketingConfig_Bucket { + if m != nil { + return m.Buckets + } + return nil +} + +// Buckets represented as ranges, along with replacement values. Ranges must +// be non-overlapping. +type BucketingConfig_Bucket struct { + // Lower bound of the range, inclusive. Type should be the same as max if + // used. + Min *Value `protobuf:"bytes,1,opt,name=min" json:"min,omitempty"` + // Upper bound of the range, exclusive; type must match min. + Max *Value `protobuf:"bytes,2,opt,name=max" json:"max,omitempty"` + // Replacement value for this bucket. If not provided + // the default behavior will be to hyphenate the min-max range. + ReplacementValue *Value `protobuf:"bytes,3,opt,name=replacement_value,json=replacementValue" json:"replacement_value,omitempty"` +} + +func (m *BucketingConfig_Bucket) Reset() { *m = BucketingConfig_Bucket{} } +func (m *BucketingConfig_Bucket) String() string { return proto.CompactTextString(m) } +func (*BucketingConfig_Bucket) ProtoMessage() {} +func (*BucketingConfig_Bucket) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{46, 0} } + +func (m *BucketingConfig_Bucket) GetMin() *Value { + if m != nil { + return m.Min + } + return nil +} + +func (m *BucketingConfig_Bucket) GetMax() *Value { + if m != nil { + return m.Max + } + return nil +} + +func (m *BucketingConfig_Bucket) GetReplacementValue() *Value { + if m != nil { + return m.ReplacementValue + } + return nil +} + +// Replaces an identifier with a surrogate using FPE with the FFX +// mode of operation. +// The identifier must be representable by the US-ASCII character set. +// For a given crypto key and context, the same identifier will be +// replaced with the same surrogate. +// Identifiers must be at least two characters long. +// In the case that the identifier is the empty string, it will be skipped. +type CryptoReplaceFfxFpeConfig struct { + // The key used by the encryption algorithm. [required] + CryptoKey *CryptoKey `protobuf:"bytes,1,opt,name=crypto_key,json=cryptoKey" json:"crypto_key,omitempty"` + // A context may be used for higher security since the same + // identifier in two different contexts likely will be given a distinct + // surrogate. The principle is that the likeliness is inversely related + // to the ratio of the number of distinct identifiers per context over the + // number of possible surrogates: As long as this ratio is small, the + // likehood is large. + // + // If the context is not set, a default tweak will be used. + // If the context is set but: + // + // 1. there is no record present when transforming a given value or + // 1. the field is not present when transforming a given value, + // + // a default tweak will be used. + // + // Note that case (1) is expected when an `InfoTypeTransformation` is + // applied to both structured and non-structured `ContentItem`s. + // Currently, the referenced field may be of value type integer or string. + // + // The tweak is constructed as a sequence of bytes in big endian byte order + // such that: + // + // - a 64 bit integer is encoded followed by a single byte of value 1 + // - a string is encoded in UTF-8 format followed by a single byte of value 2 + // + // This is also known as the 'tweak', as in tweakable encryption. + Context *FieldId `protobuf:"bytes,2,opt,name=context" json:"context,omitempty"` + // Types that are valid to be assigned to Alphabet: + // *CryptoReplaceFfxFpeConfig_CommonAlphabet + // *CryptoReplaceFfxFpeConfig_CustomAlphabet + // *CryptoReplaceFfxFpeConfig_Radix + Alphabet isCryptoReplaceFfxFpeConfig_Alphabet `protobuf_oneof:"alphabet"` +} + +func (m *CryptoReplaceFfxFpeConfig) Reset() { *m = CryptoReplaceFfxFpeConfig{} } +func (m *CryptoReplaceFfxFpeConfig) String() string { return proto.CompactTextString(m) } +func (*CryptoReplaceFfxFpeConfig) ProtoMessage() {} +func (*CryptoReplaceFfxFpeConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{47} } + +type isCryptoReplaceFfxFpeConfig_Alphabet interface { + isCryptoReplaceFfxFpeConfig_Alphabet() +} + +type CryptoReplaceFfxFpeConfig_CommonAlphabet struct { + CommonAlphabet CryptoReplaceFfxFpeConfig_FfxCommonNativeAlphabet `protobuf:"varint,4,opt,name=common_alphabet,json=commonAlphabet,enum=google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig_FfxCommonNativeAlphabet,oneof"` +} +type CryptoReplaceFfxFpeConfig_CustomAlphabet struct { + CustomAlphabet string `protobuf:"bytes,5,opt,name=custom_alphabet,json=customAlphabet,oneof"` +} +type CryptoReplaceFfxFpeConfig_Radix struct { + Radix int32 `protobuf:"varint,6,opt,name=radix,oneof"` +} + +func (*CryptoReplaceFfxFpeConfig_CommonAlphabet) isCryptoReplaceFfxFpeConfig_Alphabet() {} +func (*CryptoReplaceFfxFpeConfig_CustomAlphabet) isCryptoReplaceFfxFpeConfig_Alphabet() {} +func (*CryptoReplaceFfxFpeConfig_Radix) isCryptoReplaceFfxFpeConfig_Alphabet() {} + +func (m *CryptoReplaceFfxFpeConfig) GetAlphabet() isCryptoReplaceFfxFpeConfig_Alphabet { + if m != nil { + return m.Alphabet + } + return nil +} + +func (m *CryptoReplaceFfxFpeConfig) GetCryptoKey() *CryptoKey { + if m != nil { + return m.CryptoKey + } + return nil +} + +func (m *CryptoReplaceFfxFpeConfig) GetContext() *FieldId { + if m != nil { + return m.Context + } + return nil +} + +func (m *CryptoReplaceFfxFpeConfig) GetCommonAlphabet() CryptoReplaceFfxFpeConfig_FfxCommonNativeAlphabet { + if x, ok := m.GetAlphabet().(*CryptoReplaceFfxFpeConfig_CommonAlphabet); ok { + return x.CommonAlphabet + } + return CryptoReplaceFfxFpeConfig_FFX_COMMON_NATIVE_ALPHABET_UNSPECIFIED +} + +func (m *CryptoReplaceFfxFpeConfig) GetCustomAlphabet() string { + if x, ok := m.GetAlphabet().(*CryptoReplaceFfxFpeConfig_CustomAlphabet); ok { + return x.CustomAlphabet + } + return "" +} + +func (m *CryptoReplaceFfxFpeConfig) GetRadix() int32 { + if x, ok := m.GetAlphabet().(*CryptoReplaceFfxFpeConfig_Radix); ok { + return x.Radix + } + return 0 +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*CryptoReplaceFfxFpeConfig) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _CryptoReplaceFfxFpeConfig_OneofMarshaler, _CryptoReplaceFfxFpeConfig_OneofUnmarshaler, _CryptoReplaceFfxFpeConfig_OneofSizer, []interface{}{ + (*CryptoReplaceFfxFpeConfig_CommonAlphabet)(nil), + (*CryptoReplaceFfxFpeConfig_CustomAlphabet)(nil), + (*CryptoReplaceFfxFpeConfig_Radix)(nil), + } +} + +func _CryptoReplaceFfxFpeConfig_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*CryptoReplaceFfxFpeConfig) + // alphabet + switch x := m.Alphabet.(type) { + case *CryptoReplaceFfxFpeConfig_CommonAlphabet: + b.EncodeVarint(4<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.CommonAlphabet)) + case *CryptoReplaceFfxFpeConfig_CustomAlphabet: + b.EncodeVarint(5<<3 | proto.WireBytes) + b.EncodeStringBytes(x.CustomAlphabet) + case *CryptoReplaceFfxFpeConfig_Radix: + b.EncodeVarint(6<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.Radix)) + case nil: + default: + return fmt.Errorf("CryptoReplaceFfxFpeConfig.Alphabet has unexpected type %T", x) + } + return nil +} + +func _CryptoReplaceFfxFpeConfig_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*CryptoReplaceFfxFpeConfig) + switch tag { + case 4: // alphabet.common_alphabet + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Alphabet = &CryptoReplaceFfxFpeConfig_CommonAlphabet{CryptoReplaceFfxFpeConfig_FfxCommonNativeAlphabet(x)} + return true, err + case 5: // alphabet.custom_alphabet + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Alphabet = &CryptoReplaceFfxFpeConfig_CustomAlphabet{x} + return true, err + case 6: // alphabet.radix + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Alphabet = &CryptoReplaceFfxFpeConfig_Radix{int32(x)} + return true, err + default: + return false, nil + } +} + +func _CryptoReplaceFfxFpeConfig_OneofSizer(msg proto.Message) (n int) { + m := msg.(*CryptoReplaceFfxFpeConfig) + // alphabet + switch x := m.Alphabet.(type) { + case *CryptoReplaceFfxFpeConfig_CommonAlphabet: + n += proto.SizeVarint(4<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.CommonAlphabet)) + case *CryptoReplaceFfxFpeConfig_CustomAlphabet: + n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.CustomAlphabet))) + n += len(x.CustomAlphabet) + case *CryptoReplaceFfxFpeConfig_Radix: + n += proto.SizeVarint(6<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.Radix)) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// This is a data encryption key (DEK) (as opposed to +// a key encryption key (KEK) stored by KMS). +// When using KMS to wrap/unwrap DEKs, be sure to set an appropriate +// IAM policy on the KMS CryptoKey (KEK) to ensure an attacker cannot +// unwrap the data crypto key. +type CryptoKey struct { + // Types that are valid to be assigned to Source: + // *CryptoKey_Transient + // *CryptoKey_Unwrapped + // *CryptoKey_KmsWrapped + Source isCryptoKey_Source `protobuf_oneof:"source"` +} + +func (m *CryptoKey) Reset() { *m = CryptoKey{} } +func (m *CryptoKey) String() string { return proto.CompactTextString(m) } +func (*CryptoKey) ProtoMessage() {} +func (*CryptoKey) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{48} } + +type isCryptoKey_Source interface { + isCryptoKey_Source() +} + +type CryptoKey_Transient struct { + Transient *TransientCryptoKey `protobuf:"bytes,1,opt,name=transient,oneof"` +} +type CryptoKey_Unwrapped struct { + Unwrapped *UnwrappedCryptoKey `protobuf:"bytes,2,opt,name=unwrapped,oneof"` +} +type CryptoKey_KmsWrapped struct { + KmsWrapped *KmsWrappedCryptoKey `protobuf:"bytes,3,opt,name=kms_wrapped,json=kmsWrapped,oneof"` +} + +func (*CryptoKey_Transient) isCryptoKey_Source() {} +func (*CryptoKey_Unwrapped) isCryptoKey_Source() {} +func (*CryptoKey_KmsWrapped) isCryptoKey_Source() {} + +func (m *CryptoKey) GetSource() isCryptoKey_Source { + if m != nil { + return m.Source + } + return nil +} + +func (m *CryptoKey) GetTransient() *TransientCryptoKey { + if x, ok := m.GetSource().(*CryptoKey_Transient); ok { + return x.Transient + } + return nil +} + +func (m *CryptoKey) GetUnwrapped() *UnwrappedCryptoKey { + if x, ok := m.GetSource().(*CryptoKey_Unwrapped); ok { + return x.Unwrapped + } + return nil +} + +func (m *CryptoKey) GetKmsWrapped() *KmsWrappedCryptoKey { + if x, ok := m.GetSource().(*CryptoKey_KmsWrapped); ok { + return x.KmsWrapped + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*CryptoKey) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _CryptoKey_OneofMarshaler, _CryptoKey_OneofUnmarshaler, _CryptoKey_OneofSizer, []interface{}{ + (*CryptoKey_Transient)(nil), + (*CryptoKey_Unwrapped)(nil), + (*CryptoKey_KmsWrapped)(nil), + } +} + +func _CryptoKey_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*CryptoKey) + // source + switch x := m.Source.(type) { + case *CryptoKey_Transient: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Transient); err != nil { + return err + } + case *CryptoKey_Unwrapped: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Unwrapped); err != nil { + return err + } + case *CryptoKey_KmsWrapped: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.KmsWrapped); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("CryptoKey.Source has unexpected type %T", x) + } + return nil +} + +func _CryptoKey_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*CryptoKey) + switch tag { + case 1: // source.transient + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(TransientCryptoKey) + err := b.DecodeMessage(msg) + m.Source = &CryptoKey_Transient{msg} + return true, err + case 2: // source.unwrapped + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(UnwrappedCryptoKey) + err := b.DecodeMessage(msg) + m.Source = &CryptoKey_Unwrapped{msg} + return true, err + case 3: // source.kms_wrapped + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(KmsWrappedCryptoKey) + err := b.DecodeMessage(msg) + m.Source = &CryptoKey_KmsWrapped{msg} + return true, err + default: + return false, nil + } +} + +func _CryptoKey_OneofSizer(msg proto.Message) (n int) { + m := msg.(*CryptoKey) + // source + switch x := m.Source.(type) { + case *CryptoKey_Transient: + s := proto.Size(x.Transient) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *CryptoKey_Unwrapped: + s := proto.Size(x.Unwrapped) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *CryptoKey_KmsWrapped: + s := proto.Size(x.KmsWrapped) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Use this to have a random data crypto key generated. +// It will be discarded after the operation/request finishes. +type TransientCryptoKey struct { + // Name of the key. [required] + // This is an arbitrary string used to differentiate different keys. + // A unique key is generated per name: two separate `TransientCryptoKey` + // protos share the same generated key if their names are the same. + // When the data crypto key is generated, this name is not used in any way + // (repeating the api call will result in a different key being generated). + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *TransientCryptoKey) Reset() { *m = TransientCryptoKey{} } +func (m *TransientCryptoKey) String() string { return proto.CompactTextString(m) } +func (*TransientCryptoKey) ProtoMessage() {} +func (*TransientCryptoKey) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{49} } + +func (m *TransientCryptoKey) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Using raw keys is prone to security risks due to accidentally +// leaking the key. Choose another type of key if possible. +type UnwrappedCryptoKey struct { + // The AES 128/192/256 bit key. [required] + Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` +} + +func (m *UnwrappedCryptoKey) Reset() { *m = UnwrappedCryptoKey{} } +func (m *UnwrappedCryptoKey) String() string { return proto.CompactTextString(m) } +func (*UnwrappedCryptoKey) ProtoMessage() {} +func (*UnwrappedCryptoKey) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{50} } + +func (m *UnwrappedCryptoKey) GetKey() []byte { + if m != nil { + return m.Key + } + return nil +} + +// Include to use an existing data crypto key wrapped by KMS. +// Authorization requires the following IAM permissions when sending a request +// to perform a crypto transformation using a kms-wrapped crypto key: +// dlp.kms.encrypt +type KmsWrappedCryptoKey struct { + // The wrapped data crypto key. [required] + WrappedKey []byte `protobuf:"bytes,1,opt,name=wrapped_key,json=wrappedKey,proto3" json:"wrapped_key,omitempty"` + // The resource name of the KMS CryptoKey to use for unwrapping. [required] + CryptoKeyName string `protobuf:"bytes,2,opt,name=crypto_key_name,json=cryptoKeyName" json:"crypto_key_name,omitempty"` +} + +func (m *KmsWrappedCryptoKey) Reset() { *m = KmsWrappedCryptoKey{} } +func (m *KmsWrappedCryptoKey) String() string { return proto.CompactTextString(m) } +func (*KmsWrappedCryptoKey) ProtoMessage() {} +func (*KmsWrappedCryptoKey) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{51} } + +func (m *KmsWrappedCryptoKey) GetWrappedKey() []byte { + if m != nil { + return m.WrappedKey + } + return nil +} + +func (m *KmsWrappedCryptoKey) GetCryptoKeyName() string { + if m != nil { + return m.CryptoKeyName + } + return "" +} + +// A type of transformation that will scan unstructured text and +// apply various `PrimitiveTransformation`s to each finding, where the +// transformation is applied to only values that were identified as a specific +// info_type. +type InfoTypeTransformations struct { + // Transformation for each info type. Cannot specify more than one + // for a given info type. [required] + Transformations []*InfoTypeTransformations_InfoTypeTransformation `protobuf:"bytes,1,rep,name=transformations" json:"transformations,omitempty"` +} + +func (m *InfoTypeTransformations) Reset() { *m = InfoTypeTransformations{} } +func (m *InfoTypeTransformations) String() string { return proto.CompactTextString(m) } +func (*InfoTypeTransformations) ProtoMessage() {} +func (*InfoTypeTransformations) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{52} } + +func (m *InfoTypeTransformations) GetTransformations() []*InfoTypeTransformations_InfoTypeTransformation { + if m != nil { + return m.Transformations + } + return nil +} + +// A transformation to apply to text that is identified as a specific +// info_type. +type InfoTypeTransformations_InfoTypeTransformation struct { + // Info types to apply the transformation to. Empty list will match all + // available info types for this transformation. + InfoTypes []*InfoType `protobuf:"bytes,1,rep,name=info_types,json=infoTypes" json:"info_types,omitempty"` + // Primitive transformation to apply to the info type. [required] + PrimitiveTransformation *PrimitiveTransformation `protobuf:"bytes,2,opt,name=primitive_transformation,json=primitiveTransformation" json:"primitive_transformation,omitempty"` +} + +func (m *InfoTypeTransformations_InfoTypeTransformation) Reset() { + *m = InfoTypeTransformations_InfoTypeTransformation{} +} +func (m *InfoTypeTransformations_InfoTypeTransformation) String() string { + return proto.CompactTextString(m) +} +func (*InfoTypeTransformations_InfoTypeTransformation) ProtoMessage() {} +func (*InfoTypeTransformations_InfoTypeTransformation) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{52, 0} +} + +func (m *InfoTypeTransformations_InfoTypeTransformation) GetInfoTypes() []*InfoType { + if m != nil { + return m.InfoTypes + } + return nil +} + +func (m *InfoTypeTransformations_InfoTypeTransformation) GetPrimitiveTransformation() *PrimitiveTransformation { + if m != nil { + return m.PrimitiveTransformation + } + return nil +} + +// The transformation to apply to the field. +type FieldTransformation struct { + // Input field(s) to apply the transformation to. [required] + Fields []*FieldId `protobuf:"bytes,1,rep,name=fields" json:"fields,omitempty"` + // Only apply the transformation if the condition evaluates to true for the + // given `RecordCondition`. The conditions are allowed to reference fields + // that are not used in the actual transformation. [optional] + // + // Example Use Cases: + // + // - Apply a different bucket transformation to an age column if the zip code + // column for the same record is within a specific range. + // - Redact a field if the date of birth field is greater than 85. + Condition *RecordCondition `protobuf:"bytes,3,opt,name=condition" json:"condition,omitempty"` + // Transformation to apply. [required] + // + // Types that are valid to be assigned to Transformation: + // *FieldTransformation_PrimitiveTransformation + // *FieldTransformation_InfoTypeTransformations + Transformation isFieldTransformation_Transformation `protobuf_oneof:"transformation"` +} + +func (m *FieldTransformation) Reset() { *m = FieldTransformation{} } +func (m *FieldTransformation) String() string { return proto.CompactTextString(m) } +func (*FieldTransformation) ProtoMessage() {} +func (*FieldTransformation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{53} } + +type isFieldTransformation_Transformation interface { + isFieldTransformation_Transformation() +} + +type FieldTransformation_PrimitiveTransformation struct { + PrimitiveTransformation *PrimitiveTransformation `protobuf:"bytes,4,opt,name=primitive_transformation,json=primitiveTransformation,oneof"` +} +type FieldTransformation_InfoTypeTransformations struct { + InfoTypeTransformations *InfoTypeTransformations `protobuf:"bytes,5,opt,name=info_type_transformations,json=infoTypeTransformations,oneof"` +} + +func (*FieldTransformation_PrimitiveTransformation) isFieldTransformation_Transformation() {} +func (*FieldTransformation_InfoTypeTransformations) isFieldTransformation_Transformation() {} + +func (m *FieldTransformation) GetTransformation() isFieldTransformation_Transformation { + if m != nil { + return m.Transformation + } + return nil +} + +func (m *FieldTransformation) GetFields() []*FieldId { + if m != nil { + return m.Fields + } + return nil +} + +func (m *FieldTransformation) GetCondition() *RecordCondition { + if m != nil { + return m.Condition + } + return nil +} + +func (m *FieldTransformation) GetPrimitiveTransformation() *PrimitiveTransformation { + if x, ok := m.GetTransformation().(*FieldTransformation_PrimitiveTransformation); ok { + return x.PrimitiveTransformation + } + return nil +} + +func (m *FieldTransformation) GetInfoTypeTransformations() *InfoTypeTransformations { + if x, ok := m.GetTransformation().(*FieldTransformation_InfoTypeTransformations); ok { + return x.InfoTypeTransformations + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*FieldTransformation) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _FieldTransformation_OneofMarshaler, _FieldTransformation_OneofUnmarshaler, _FieldTransformation_OneofSizer, []interface{}{ + (*FieldTransformation_PrimitiveTransformation)(nil), + (*FieldTransformation_InfoTypeTransformations)(nil), + } +} + +func _FieldTransformation_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*FieldTransformation) + // transformation + switch x := m.Transformation.(type) { + case *FieldTransformation_PrimitiveTransformation: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.PrimitiveTransformation); err != nil { + return err + } + case *FieldTransformation_InfoTypeTransformations: + b.EncodeVarint(5<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.InfoTypeTransformations); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("FieldTransformation.Transformation has unexpected type %T", x) + } + return nil +} + +func _FieldTransformation_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*FieldTransformation) + switch tag { + case 4: // transformation.primitive_transformation + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(PrimitiveTransformation) + err := b.DecodeMessage(msg) + m.Transformation = &FieldTransformation_PrimitiveTransformation{msg} + return true, err + case 5: // transformation.info_type_transformations + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(InfoTypeTransformations) + err := b.DecodeMessage(msg) + m.Transformation = &FieldTransformation_InfoTypeTransformations{msg} + return true, err + default: + return false, nil + } +} + +func _FieldTransformation_OneofSizer(msg proto.Message) (n int) { + m := msg.(*FieldTransformation) + // transformation + switch x := m.Transformation.(type) { + case *FieldTransformation_PrimitiveTransformation: + s := proto.Size(x.PrimitiveTransformation) + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *FieldTransformation_InfoTypeTransformations: + s := proto.Size(x.InfoTypeTransformations) + n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// A type of transformation that is applied over structured data such as a +// table. +type RecordTransformations struct { + // Transform the record by applying various field transformations. + FieldTransformations []*FieldTransformation `protobuf:"bytes,1,rep,name=field_transformations,json=fieldTransformations" json:"field_transformations,omitempty"` + // Configuration defining which records get suppressed entirely. Records that + // match any suppression rule are omitted from the output [optional]. + RecordSuppressions []*RecordSuppression `protobuf:"bytes,2,rep,name=record_suppressions,json=recordSuppressions" json:"record_suppressions,omitempty"` +} + +func (m *RecordTransformations) Reset() { *m = RecordTransformations{} } +func (m *RecordTransformations) String() string { return proto.CompactTextString(m) } +func (*RecordTransformations) ProtoMessage() {} +func (*RecordTransformations) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{54} } + +func (m *RecordTransformations) GetFieldTransformations() []*FieldTransformation { + if m != nil { + return m.FieldTransformations + } + return nil +} + +func (m *RecordTransformations) GetRecordSuppressions() []*RecordSuppression { + if m != nil { + return m.RecordSuppressions + } + return nil +} + +// Configuration to suppress records whose suppression conditions evaluate to +// true. +type RecordSuppression struct { + Condition *RecordCondition `protobuf:"bytes,1,opt,name=condition" json:"condition,omitempty"` +} + +func (m *RecordSuppression) Reset() { *m = RecordSuppression{} } +func (m *RecordSuppression) String() string { return proto.CompactTextString(m) } +func (*RecordSuppression) ProtoMessage() {} +func (*RecordSuppression) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{55} } + +func (m *RecordSuppression) GetCondition() *RecordCondition { + if m != nil { + return m.Condition + } + return nil +} + +// A condition for determining whether a transformation should be applied to +// a field. +type RecordCondition struct { + Expressions *RecordCondition_Expressions `protobuf:"bytes,3,opt,name=expressions" json:"expressions,omitempty"` +} + +func (m *RecordCondition) Reset() { *m = RecordCondition{} } +func (m *RecordCondition) String() string { return proto.CompactTextString(m) } +func (*RecordCondition) ProtoMessage() {} +func (*RecordCondition) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{56} } + +func (m *RecordCondition) GetExpressions() *RecordCondition_Expressions { + if m != nil { + return m.Expressions + } + return nil +} + +// The field type of `value` and `field` do not need to match to be +// considered equal, but not all comparisons are possible. +// +// A `value` of type: +// +// - `string` can be compared against all other types +// - `boolean` can only be compared against other booleans +// - `integer` can be compared against doubles or a string if the string value +// can be parsed as an integer. +// - `double` can be compared against integers or a string if the string can +// be parsed as a double. +// - `Timestamp` can be compared against strings in RFC 3339 date string +// format. +// - `TimeOfDay` can be compared against timestamps and strings in the format +// of 'HH:mm:ss'. +// +// If we fail to compare do to type mismatch, a warning will be given and +// the condition will evaluate to false. +type RecordCondition_Condition struct { + // Field within the record this condition is evaluated against. [required] + Field *FieldId `protobuf:"bytes,1,opt,name=field" json:"field,omitempty"` + // Operator used to compare the field or info type to the value. [required] + Operator RelationalOperator `protobuf:"varint,3,opt,name=operator,enum=google.privacy.dlp.v2beta1.RelationalOperator" json:"operator,omitempty"` + // Value to compare against. [Required, except for `EXISTS` tests.] + Value *Value `protobuf:"bytes,4,opt,name=value" json:"value,omitempty"` +} + +func (m *RecordCondition_Condition) Reset() { *m = RecordCondition_Condition{} } +func (m *RecordCondition_Condition) String() string { return proto.CompactTextString(m) } +func (*RecordCondition_Condition) ProtoMessage() {} +func (*RecordCondition_Condition) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{56, 0} } + +func (m *RecordCondition_Condition) GetField() *FieldId { + if m != nil { + return m.Field + } + return nil +} + +func (m *RecordCondition_Condition) GetOperator() RelationalOperator { + if m != nil { + return m.Operator + } + return RelationalOperator_RELATIONAL_OPERATOR_UNSPECIFIED +} + +func (m *RecordCondition_Condition) GetValue() *Value { + if m != nil { + return m.Value + } + return nil +} + +type RecordCondition_Conditions struct { + Conditions []*RecordCondition_Condition `protobuf:"bytes,1,rep,name=conditions" json:"conditions,omitempty"` +} + +func (m *RecordCondition_Conditions) Reset() { *m = RecordCondition_Conditions{} } +func (m *RecordCondition_Conditions) String() string { return proto.CompactTextString(m) } +func (*RecordCondition_Conditions) ProtoMessage() {} +func (*RecordCondition_Conditions) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{56, 1} } + +func (m *RecordCondition_Conditions) GetConditions() []*RecordCondition_Condition { + if m != nil { + return m.Conditions + } + return nil +} + +// A collection of expressions +type RecordCondition_Expressions struct { + // The operator to apply to the result of conditions. Default and currently + // only supported value is `AND`. + LogicalOperator RecordCondition_Expressions_LogicalOperator `protobuf:"varint,1,opt,name=logical_operator,json=logicalOperator,enum=google.privacy.dlp.v2beta1.RecordCondition_Expressions_LogicalOperator" json:"logical_operator,omitempty"` + // Types that are valid to be assigned to Type: + // *RecordCondition_Expressions_Conditions + Type isRecordCondition_Expressions_Type `protobuf_oneof:"type"` +} + +func (m *RecordCondition_Expressions) Reset() { *m = RecordCondition_Expressions{} } +func (m *RecordCondition_Expressions) String() string { return proto.CompactTextString(m) } +func (*RecordCondition_Expressions) ProtoMessage() {} +func (*RecordCondition_Expressions) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{56, 2} } + +type isRecordCondition_Expressions_Type interface { + isRecordCondition_Expressions_Type() +} + +type RecordCondition_Expressions_Conditions struct { + Conditions *RecordCondition_Conditions `protobuf:"bytes,3,opt,name=conditions,oneof"` +} + +func (*RecordCondition_Expressions_Conditions) isRecordCondition_Expressions_Type() {} + +func (m *RecordCondition_Expressions) GetType() isRecordCondition_Expressions_Type { + if m != nil { + return m.Type + } + return nil +} + +func (m *RecordCondition_Expressions) GetLogicalOperator() RecordCondition_Expressions_LogicalOperator { + if m != nil { + return m.LogicalOperator + } + return RecordCondition_Expressions_LOGICAL_OPERATOR_UNSPECIFIED +} + +func (m *RecordCondition_Expressions) GetConditions() *RecordCondition_Conditions { + if x, ok := m.GetType().(*RecordCondition_Expressions_Conditions); ok { + return x.Conditions + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*RecordCondition_Expressions) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _RecordCondition_Expressions_OneofMarshaler, _RecordCondition_Expressions_OneofUnmarshaler, _RecordCondition_Expressions_OneofSizer, []interface{}{ + (*RecordCondition_Expressions_Conditions)(nil), + } +} + +func _RecordCondition_Expressions_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*RecordCondition_Expressions) + // type + switch x := m.Type.(type) { + case *RecordCondition_Expressions_Conditions: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Conditions); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("RecordCondition_Expressions.Type has unexpected type %T", x) + } + return nil +} + +func _RecordCondition_Expressions_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*RecordCondition_Expressions) + switch tag { + case 3: // type.conditions + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(RecordCondition_Conditions) + err := b.DecodeMessage(msg) + m.Type = &RecordCondition_Expressions_Conditions{msg} + return true, err + default: + return false, nil + } +} + +func _RecordCondition_Expressions_OneofSizer(msg proto.Message) (n int) { + m := msg.(*RecordCondition_Expressions) + // type + switch x := m.Type.(type) { + case *RecordCondition_Expressions_Conditions: + s := proto.Size(x.Conditions) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// High level summary of deidentification. +type DeidentificationSummary struct { + // Total size in bytes that were transformed in some way. + TransformedBytes int64 `protobuf:"varint,2,opt,name=transformed_bytes,json=transformedBytes" json:"transformed_bytes,omitempty"` + // Transformations applied to the dataset. + TransformationSummaries []*TransformationSummary `protobuf:"bytes,3,rep,name=transformation_summaries,json=transformationSummaries" json:"transformation_summaries,omitempty"` +} + +func (m *DeidentificationSummary) Reset() { *m = DeidentificationSummary{} } +func (m *DeidentificationSummary) String() string { return proto.CompactTextString(m) } +func (*DeidentificationSummary) ProtoMessage() {} +func (*DeidentificationSummary) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{57} } + +func (m *DeidentificationSummary) GetTransformedBytes() int64 { + if m != nil { + return m.TransformedBytes + } + return 0 +} + +func (m *DeidentificationSummary) GetTransformationSummaries() []*TransformationSummary { + if m != nil { + return m.TransformationSummaries + } + return nil +} + +// Summary of a single tranformation. +type TransformationSummary struct { + // Set if the transformation was limited to a specific info_type. + InfoType *InfoType `protobuf:"bytes,1,opt,name=info_type,json=infoType" json:"info_type,omitempty"` + // Set if the transformation was limited to a specific FieldId. + Field *FieldId `protobuf:"bytes,2,opt,name=field" json:"field,omitempty"` + // The specific transformation these stats apply to. + Transformation *PrimitiveTransformation `protobuf:"bytes,3,opt,name=transformation" json:"transformation,omitempty"` + // The field transformation that was applied. This list will contain + // multiple only in the case of errors. + FieldTransformations []*FieldTransformation `protobuf:"bytes,5,rep,name=field_transformations,json=fieldTransformations" json:"field_transformations,omitempty"` + // The specific suppression option these stats apply to. + RecordSuppress *RecordSuppression `protobuf:"bytes,6,opt,name=record_suppress,json=recordSuppress" json:"record_suppress,omitempty"` + Results []*TransformationSummary_SummaryResult `protobuf:"bytes,4,rep,name=results" json:"results,omitempty"` +} + +func (m *TransformationSummary) Reset() { *m = TransformationSummary{} } +func (m *TransformationSummary) String() string { return proto.CompactTextString(m) } +func (*TransformationSummary) ProtoMessage() {} +func (*TransformationSummary) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{58} } + +func (m *TransformationSummary) GetInfoType() *InfoType { + if m != nil { + return m.InfoType + } + return nil +} + +func (m *TransformationSummary) GetField() *FieldId { + if m != nil { + return m.Field + } + return nil +} + +func (m *TransformationSummary) GetTransformation() *PrimitiveTransformation { + if m != nil { + return m.Transformation + } + return nil +} + +func (m *TransformationSummary) GetFieldTransformations() []*FieldTransformation { + if m != nil { + return m.FieldTransformations + } + return nil +} + +func (m *TransformationSummary) GetRecordSuppress() *RecordSuppression { + if m != nil { + return m.RecordSuppress + } + return nil +} + +func (m *TransformationSummary) GetResults() []*TransformationSummary_SummaryResult { + if m != nil { + return m.Results + } + return nil +} + +// A collection that informs the user the number of times a particular +// `TransformationResultCode` and error details occurred. +type TransformationSummary_SummaryResult struct { + Count int64 `protobuf:"varint,1,opt,name=count" json:"count,omitempty"` + Code TransformationSummary_TransformationResultCode `protobuf:"varint,2,opt,name=code,enum=google.privacy.dlp.v2beta1.TransformationSummary_TransformationResultCode" json:"code,omitempty"` + // A place for warnings or errors to show up if a transformation didn't + // work as expected. + Details string `protobuf:"bytes,3,opt,name=details" json:"details,omitempty"` +} + +func (m *TransformationSummary_SummaryResult) Reset() { *m = TransformationSummary_SummaryResult{} } +func (m *TransformationSummary_SummaryResult) String() string { return proto.CompactTextString(m) } +func (*TransformationSummary_SummaryResult) ProtoMessage() {} +func (*TransformationSummary_SummaryResult) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{58, 0} +} + +func (m *TransformationSummary_SummaryResult) GetCount() int64 { + if m != nil { + return m.Count + } + return 0 +} + +func (m *TransformationSummary_SummaryResult) GetCode() TransformationSummary_TransformationResultCode { + if m != nil { + return m.Code + } + return TransformationSummary_TRANSFORMATION_RESULT_CODE_UNSPECIFIED +} + +func (m *TransformationSummary_SummaryResult) GetDetails() string { + if m != nil { + return m.Details + } + return "" +} + +func init() { + proto.RegisterType((*InspectConfig)(nil), "google.privacy.dlp.v2beta1.InspectConfig") + proto.RegisterType((*InspectConfig_InfoTypeLimit)(nil), "google.privacy.dlp.v2beta1.InspectConfig.InfoTypeLimit") + proto.RegisterType((*OperationConfig)(nil), "google.privacy.dlp.v2beta1.OperationConfig") + proto.RegisterType((*ContentItem)(nil), "google.privacy.dlp.v2beta1.ContentItem") + proto.RegisterType((*Table)(nil), "google.privacy.dlp.v2beta1.Table") + proto.RegisterType((*Table_Row)(nil), "google.privacy.dlp.v2beta1.Table.Row") + proto.RegisterType((*InspectResult)(nil), "google.privacy.dlp.v2beta1.InspectResult") + proto.RegisterType((*Finding)(nil), "google.privacy.dlp.v2beta1.Finding") + proto.RegisterType((*Location)(nil), "google.privacy.dlp.v2beta1.Location") + proto.RegisterType((*TableLocation)(nil), "google.privacy.dlp.v2beta1.TableLocation") + proto.RegisterType((*Range)(nil), "google.privacy.dlp.v2beta1.Range") + proto.RegisterType((*ImageLocation)(nil), "google.privacy.dlp.v2beta1.ImageLocation") + proto.RegisterType((*RedactContentRequest)(nil), "google.privacy.dlp.v2beta1.RedactContentRequest") + proto.RegisterType((*RedactContentRequest_ReplaceConfig)(nil), "google.privacy.dlp.v2beta1.RedactContentRequest.ReplaceConfig") + proto.RegisterType((*RedactContentRequest_ImageRedactionConfig)(nil), "google.privacy.dlp.v2beta1.RedactContentRequest.ImageRedactionConfig") + proto.RegisterType((*Color)(nil), "google.privacy.dlp.v2beta1.Color") + proto.RegisterType((*RedactContentResponse)(nil), "google.privacy.dlp.v2beta1.RedactContentResponse") + proto.RegisterType((*DeidentifyContentRequest)(nil), "google.privacy.dlp.v2beta1.DeidentifyContentRequest") + proto.RegisterType((*DeidentifyContentResponse)(nil), "google.privacy.dlp.v2beta1.DeidentifyContentResponse") + proto.RegisterType((*InspectContentRequest)(nil), "google.privacy.dlp.v2beta1.InspectContentRequest") + proto.RegisterType((*InspectContentResponse)(nil), "google.privacy.dlp.v2beta1.InspectContentResponse") + proto.RegisterType((*CreateInspectOperationRequest)(nil), "google.privacy.dlp.v2beta1.CreateInspectOperationRequest") + proto.RegisterType((*OutputStorageConfig)(nil), "google.privacy.dlp.v2beta1.OutputStorageConfig") + proto.RegisterType((*InfoTypeStatistics)(nil), "google.privacy.dlp.v2beta1.InfoTypeStatistics") + proto.RegisterType((*InspectOperationMetadata)(nil), "google.privacy.dlp.v2beta1.InspectOperationMetadata") + proto.RegisterType((*InspectOperationResult)(nil), "google.privacy.dlp.v2beta1.InspectOperationResult") + proto.RegisterType((*ListInspectFindingsRequest)(nil), "google.privacy.dlp.v2beta1.ListInspectFindingsRequest") + proto.RegisterType((*ListInspectFindingsResponse)(nil), "google.privacy.dlp.v2beta1.ListInspectFindingsResponse") + proto.RegisterType((*InfoTypeDescription)(nil), "google.privacy.dlp.v2beta1.InfoTypeDescription") + proto.RegisterType((*ListInfoTypesRequest)(nil), "google.privacy.dlp.v2beta1.ListInfoTypesRequest") + proto.RegisterType((*ListInfoTypesResponse)(nil), "google.privacy.dlp.v2beta1.ListInfoTypesResponse") + proto.RegisterType((*CategoryDescription)(nil), "google.privacy.dlp.v2beta1.CategoryDescription") + proto.RegisterType((*ListRootCategoriesRequest)(nil), "google.privacy.dlp.v2beta1.ListRootCategoriesRequest") + proto.RegisterType((*ListRootCategoriesResponse)(nil), "google.privacy.dlp.v2beta1.ListRootCategoriesResponse") + proto.RegisterType((*AnalyzeDataSourceRiskRequest)(nil), "google.privacy.dlp.v2beta1.AnalyzeDataSourceRiskRequest") + proto.RegisterType((*PrivacyMetric)(nil), "google.privacy.dlp.v2beta1.PrivacyMetric") + proto.RegisterType((*PrivacyMetric_NumericalStatsConfig)(nil), "google.privacy.dlp.v2beta1.PrivacyMetric.NumericalStatsConfig") + proto.RegisterType((*PrivacyMetric_CategoricalStatsConfig)(nil), "google.privacy.dlp.v2beta1.PrivacyMetric.CategoricalStatsConfig") + proto.RegisterType((*PrivacyMetric_KAnonymityConfig)(nil), "google.privacy.dlp.v2beta1.PrivacyMetric.KAnonymityConfig") + proto.RegisterType((*PrivacyMetric_LDiversityConfig)(nil), "google.privacy.dlp.v2beta1.PrivacyMetric.LDiversityConfig") + proto.RegisterType((*RiskAnalysisOperationMetadata)(nil), "google.privacy.dlp.v2beta1.RiskAnalysisOperationMetadata") + proto.RegisterType((*RiskAnalysisOperationResult)(nil), "google.privacy.dlp.v2beta1.RiskAnalysisOperationResult") + proto.RegisterType((*RiskAnalysisOperationResult_NumericalStatsResult)(nil), "google.privacy.dlp.v2beta1.RiskAnalysisOperationResult.NumericalStatsResult") + proto.RegisterType((*RiskAnalysisOperationResult_CategoricalStatsResult)(nil), "google.privacy.dlp.v2beta1.RiskAnalysisOperationResult.CategoricalStatsResult") + proto.RegisterType((*RiskAnalysisOperationResult_CategoricalStatsResult_CategoricalStatsHistogramBucket)(nil), "google.privacy.dlp.v2beta1.RiskAnalysisOperationResult.CategoricalStatsResult.CategoricalStatsHistogramBucket") + proto.RegisterType((*RiskAnalysisOperationResult_KAnonymityResult)(nil), "google.privacy.dlp.v2beta1.RiskAnalysisOperationResult.KAnonymityResult") + proto.RegisterType((*RiskAnalysisOperationResult_KAnonymityResult_KAnonymityEquivalenceClass)(nil), "google.privacy.dlp.v2beta1.RiskAnalysisOperationResult.KAnonymityResult.KAnonymityEquivalenceClass") + proto.RegisterType((*RiskAnalysisOperationResult_KAnonymityResult_KAnonymityHistogramBucket)(nil), "google.privacy.dlp.v2beta1.RiskAnalysisOperationResult.KAnonymityResult.KAnonymityHistogramBucket") + proto.RegisterType((*RiskAnalysisOperationResult_LDiversityResult)(nil), "google.privacy.dlp.v2beta1.RiskAnalysisOperationResult.LDiversityResult") + proto.RegisterType((*RiskAnalysisOperationResult_LDiversityResult_LDiversityEquivalenceClass)(nil), "google.privacy.dlp.v2beta1.RiskAnalysisOperationResult.LDiversityResult.LDiversityEquivalenceClass") + proto.RegisterType((*RiskAnalysisOperationResult_LDiversityResult_LDiversityHistogramBucket)(nil), "google.privacy.dlp.v2beta1.RiskAnalysisOperationResult.LDiversityResult.LDiversityHistogramBucket") + proto.RegisterType((*ValueFrequency)(nil), "google.privacy.dlp.v2beta1.ValueFrequency") + proto.RegisterType((*Value)(nil), "google.privacy.dlp.v2beta1.Value") + proto.RegisterType((*DeidentifyConfig)(nil), "google.privacy.dlp.v2beta1.DeidentifyConfig") + proto.RegisterType((*PrimitiveTransformation)(nil), "google.privacy.dlp.v2beta1.PrimitiveTransformation") + proto.RegisterType((*TimePartConfig)(nil), "google.privacy.dlp.v2beta1.TimePartConfig") + proto.RegisterType((*CryptoHashConfig)(nil), "google.privacy.dlp.v2beta1.CryptoHashConfig") + proto.RegisterType((*ReplaceValueConfig)(nil), "google.privacy.dlp.v2beta1.ReplaceValueConfig") + proto.RegisterType((*ReplaceWithInfoTypeConfig)(nil), "google.privacy.dlp.v2beta1.ReplaceWithInfoTypeConfig") + proto.RegisterType((*RedactConfig)(nil), "google.privacy.dlp.v2beta1.RedactConfig") + proto.RegisterType((*CharsToIgnore)(nil), "google.privacy.dlp.v2beta1.CharsToIgnore") + proto.RegisterType((*CharacterMaskConfig)(nil), "google.privacy.dlp.v2beta1.CharacterMaskConfig") + proto.RegisterType((*FixedSizeBucketingConfig)(nil), "google.privacy.dlp.v2beta1.FixedSizeBucketingConfig") + proto.RegisterType((*BucketingConfig)(nil), "google.privacy.dlp.v2beta1.BucketingConfig") + proto.RegisterType((*BucketingConfig_Bucket)(nil), "google.privacy.dlp.v2beta1.BucketingConfig.Bucket") + proto.RegisterType((*CryptoReplaceFfxFpeConfig)(nil), "google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig") + proto.RegisterType((*CryptoKey)(nil), "google.privacy.dlp.v2beta1.CryptoKey") + proto.RegisterType((*TransientCryptoKey)(nil), "google.privacy.dlp.v2beta1.TransientCryptoKey") + proto.RegisterType((*UnwrappedCryptoKey)(nil), "google.privacy.dlp.v2beta1.UnwrappedCryptoKey") + proto.RegisterType((*KmsWrappedCryptoKey)(nil), "google.privacy.dlp.v2beta1.KmsWrappedCryptoKey") + proto.RegisterType((*InfoTypeTransformations)(nil), "google.privacy.dlp.v2beta1.InfoTypeTransformations") + proto.RegisterType((*InfoTypeTransformations_InfoTypeTransformation)(nil), "google.privacy.dlp.v2beta1.InfoTypeTransformations.InfoTypeTransformation") + proto.RegisterType((*FieldTransformation)(nil), "google.privacy.dlp.v2beta1.FieldTransformation") + proto.RegisterType((*RecordTransformations)(nil), "google.privacy.dlp.v2beta1.RecordTransformations") + proto.RegisterType((*RecordSuppression)(nil), "google.privacy.dlp.v2beta1.RecordSuppression") + proto.RegisterType((*RecordCondition)(nil), "google.privacy.dlp.v2beta1.RecordCondition") + proto.RegisterType((*RecordCondition_Condition)(nil), "google.privacy.dlp.v2beta1.RecordCondition.Condition") + proto.RegisterType((*RecordCondition_Conditions)(nil), "google.privacy.dlp.v2beta1.RecordCondition.Conditions") + proto.RegisterType((*RecordCondition_Expressions)(nil), "google.privacy.dlp.v2beta1.RecordCondition.Expressions") + proto.RegisterType((*DeidentificationSummary)(nil), "google.privacy.dlp.v2beta1.DeidentificationSummary") + proto.RegisterType((*TransformationSummary)(nil), "google.privacy.dlp.v2beta1.TransformationSummary") + proto.RegisterType((*TransformationSummary_SummaryResult)(nil), "google.privacy.dlp.v2beta1.TransformationSummary.SummaryResult") + proto.RegisterEnum("google.privacy.dlp.v2beta1.Likelihood", Likelihood_name, Likelihood_value) + proto.RegisterEnum("google.privacy.dlp.v2beta1.RelationalOperator", RelationalOperator_name, RelationalOperator_value) + proto.RegisterEnum("google.privacy.dlp.v2beta1.TimePartConfig_TimePart", TimePartConfig_TimePart_name, TimePartConfig_TimePart_value) + proto.RegisterEnum("google.privacy.dlp.v2beta1.CharsToIgnore_CharacterGroup", CharsToIgnore_CharacterGroup_name, CharsToIgnore_CharacterGroup_value) + proto.RegisterEnum("google.privacy.dlp.v2beta1.CryptoReplaceFfxFpeConfig_FfxCommonNativeAlphabet", CryptoReplaceFfxFpeConfig_FfxCommonNativeAlphabet_name, CryptoReplaceFfxFpeConfig_FfxCommonNativeAlphabet_value) + proto.RegisterEnum("google.privacy.dlp.v2beta1.RecordCondition_Expressions_LogicalOperator", RecordCondition_Expressions_LogicalOperator_name, RecordCondition_Expressions_LogicalOperator_value) + proto.RegisterEnum("google.privacy.dlp.v2beta1.TransformationSummary_TransformationResultCode", TransformationSummary_TransformationResultCode_name, TransformationSummary_TransformationResultCode_value) +} + +// 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 + +// Client API for DlpService service + +type DlpServiceClient interface { + // Finds potentially sensitive info in a list of strings. + // This method has limits on input size, processing time, and output size. + InspectContent(ctx context.Context, in *InspectContentRequest, opts ...grpc.CallOption) (*InspectContentResponse, error) + // Redacts potentially sensitive info from a list of strings. + // This method has limits on input size, processing time, and output size. + RedactContent(ctx context.Context, in *RedactContentRequest, opts ...grpc.CallOption) (*RedactContentResponse, error) + // De-identifies potentially sensitive info from a list of strings. + // This method has limits on input size and output size. + DeidentifyContent(ctx context.Context, in *DeidentifyContentRequest, opts ...grpc.CallOption) (*DeidentifyContentResponse, error) + // Schedules a job scanning content in a Google Cloud Platform data + // repository. + CreateInspectOperation(ctx context.Context, in *CreateInspectOperationRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Schedules a job to compute risk analysis metrics over content in a Google + // Cloud Platform repository. + AnalyzeDataSourceRisk(ctx context.Context, in *AnalyzeDataSourceRiskRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Returns list of results for given inspect operation result set id. + ListInspectFindings(ctx context.Context, in *ListInspectFindingsRequest, opts ...grpc.CallOption) (*ListInspectFindingsResponse, error) + // Returns sensitive information types for given category. + ListInfoTypes(ctx context.Context, in *ListInfoTypesRequest, opts ...grpc.CallOption) (*ListInfoTypesResponse, error) + // Returns the list of root categories of sensitive information. + ListRootCategories(ctx context.Context, in *ListRootCategoriesRequest, opts ...grpc.CallOption) (*ListRootCategoriesResponse, error) +} + +type dlpServiceClient struct { + cc *grpc.ClientConn +} + +func NewDlpServiceClient(cc *grpc.ClientConn) DlpServiceClient { + return &dlpServiceClient{cc} +} + +func (c *dlpServiceClient) InspectContent(ctx context.Context, in *InspectContentRequest, opts ...grpc.CallOption) (*InspectContentResponse, error) { + out := new(InspectContentResponse) + err := grpc.Invoke(ctx, "/google.privacy.dlp.v2beta1.DlpService/InspectContent", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dlpServiceClient) RedactContent(ctx context.Context, in *RedactContentRequest, opts ...grpc.CallOption) (*RedactContentResponse, error) { + out := new(RedactContentResponse) + err := grpc.Invoke(ctx, "/google.privacy.dlp.v2beta1.DlpService/RedactContent", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dlpServiceClient) DeidentifyContent(ctx context.Context, in *DeidentifyContentRequest, opts ...grpc.CallOption) (*DeidentifyContentResponse, error) { + out := new(DeidentifyContentResponse) + err := grpc.Invoke(ctx, "/google.privacy.dlp.v2beta1.DlpService/DeidentifyContent", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dlpServiceClient) CreateInspectOperation(ctx context.Context, in *CreateInspectOperationRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.privacy.dlp.v2beta1.DlpService/CreateInspectOperation", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dlpServiceClient) AnalyzeDataSourceRisk(ctx context.Context, in *AnalyzeDataSourceRiskRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.privacy.dlp.v2beta1.DlpService/AnalyzeDataSourceRisk", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dlpServiceClient) ListInspectFindings(ctx context.Context, in *ListInspectFindingsRequest, opts ...grpc.CallOption) (*ListInspectFindingsResponse, error) { + out := new(ListInspectFindingsResponse) + err := grpc.Invoke(ctx, "/google.privacy.dlp.v2beta1.DlpService/ListInspectFindings", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dlpServiceClient) ListInfoTypes(ctx context.Context, in *ListInfoTypesRequest, opts ...grpc.CallOption) (*ListInfoTypesResponse, error) { + out := new(ListInfoTypesResponse) + err := grpc.Invoke(ctx, "/google.privacy.dlp.v2beta1.DlpService/ListInfoTypes", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dlpServiceClient) ListRootCategories(ctx context.Context, in *ListRootCategoriesRequest, opts ...grpc.CallOption) (*ListRootCategoriesResponse, error) { + out := new(ListRootCategoriesResponse) + err := grpc.Invoke(ctx, "/google.privacy.dlp.v2beta1.DlpService/ListRootCategories", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for DlpService service + +type DlpServiceServer interface { + // Finds potentially sensitive info in a list of strings. + // This method has limits on input size, processing time, and output size. + InspectContent(context.Context, *InspectContentRequest) (*InspectContentResponse, error) + // Redacts potentially sensitive info from a list of strings. + // This method has limits on input size, processing time, and output size. + RedactContent(context.Context, *RedactContentRequest) (*RedactContentResponse, error) + // De-identifies potentially sensitive info from a list of strings. + // This method has limits on input size and output size. + DeidentifyContent(context.Context, *DeidentifyContentRequest) (*DeidentifyContentResponse, error) + // Schedules a job scanning content in a Google Cloud Platform data + // repository. + CreateInspectOperation(context.Context, *CreateInspectOperationRequest) (*google_longrunning.Operation, error) + // Schedules a job to compute risk analysis metrics over content in a Google + // Cloud Platform repository. + AnalyzeDataSourceRisk(context.Context, *AnalyzeDataSourceRiskRequest) (*google_longrunning.Operation, error) + // Returns list of results for given inspect operation result set id. + ListInspectFindings(context.Context, *ListInspectFindingsRequest) (*ListInspectFindingsResponse, error) + // Returns sensitive information types for given category. + ListInfoTypes(context.Context, *ListInfoTypesRequest) (*ListInfoTypesResponse, error) + // Returns the list of root categories of sensitive information. + ListRootCategories(context.Context, *ListRootCategoriesRequest) (*ListRootCategoriesResponse, error) +} + +func RegisterDlpServiceServer(s *grpc.Server, srv DlpServiceServer) { + s.RegisterService(&_DlpService_serviceDesc, srv) +} + +func _DlpService_InspectContent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InspectContentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DlpServiceServer).InspectContent(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.privacy.dlp.v2beta1.DlpService/InspectContent", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DlpServiceServer).InspectContent(ctx, req.(*InspectContentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DlpService_RedactContent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RedactContentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DlpServiceServer).RedactContent(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.privacy.dlp.v2beta1.DlpService/RedactContent", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DlpServiceServer).RedactContent(ctx, req.(*RedactContentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DlpService_DeidentifyContent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeidentifyContentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DlpServiceServer).DeidentifyContent(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.privacy.dlp.v2beta1.DlpService/DeidentifyContent", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DlpServiceServer).DeidentifyContent(ctx, req.(*DeidentifyContentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DlpService_CreateInspectOperation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateInspectOperationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DlpServiceServer).CreateInspectOperation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.privacy.dlp.v2beta1.DlpService/CreateInspectOperation", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DlpServiceServer).CreateInspectOperation(ctx, req.(*CreateInspectOperationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DlpService_AnalyzeDataSourceRisk_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AnalyzeDataSourceRiskRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DlpServiceServer).AnalyzeDataSourceRisk(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.privacy.dlp.v2beta1.DlpService/AnalyzeDataSourceRisk", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DlpServiceServer).AnalyzeDataSourceRisk(ctx, req.(*AnalyzeDataSourceRiskRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DlpService_ListInspectFindings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListInspectFindingsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DlpServiceServer).ListInspectFindings(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.privacy.dlp.v2beta1.DlpService/ListInspectFindings", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DlpServiceServer).ListInspectFindings(ctx, req.(*ListInspectFindingsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DlpService_ListInfoTypes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListInfoTypesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DlpServiceServer).ListInfoTypes(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.privacy.dlp.v2beta1.DlpService/ListInfoTypes", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DlpServiceServer).ListInfoTypes(ctx, req.(*ListInfoTypesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DlpService_ListRootCategories_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListRootCategoriesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DlpServiceServer).ListRootCategories(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.privacy.dlp.v2beta1.DlpService/ListRootCategories", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DlpServiceServer).ListRootCategories(ctx, req.(*ListRootCategoriesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _DlpService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.privacy.dlp.v2beta1.DlpService", + HandlerType: (*DlpServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "InspectContent", + Handler: _DlpService_InspectContent_Handler, + }, + { + MethodName: "RedactContent", + Handler: _DlpService_RedactContent_Handler, + }, + { + MethodName: "DeidentifyContent", + Handler: _DlpService_DeidentifyContent_Handler, + }, + { + MethodName: "CreateInspectOperation", + Handler: _DlpService_CreateInspectOperation_Handler, + }, + { + MethodName: "AnalyzeDataSourceRisk", + Handler: _DlpService_AnalyzeDataSourceRisk_Handler, + }, + { + MethodName: "ListInspectFindings", + Handler: _DlpService_ListInspectFindings_Handler, + }, + { + MethodName: "ListInfoTypes", + Handler: _DlpService_ListInfoTypes_Handler, + }, + { + MethodName: "ListRootCategories", + Handler: _DlpService_ListRootCategories_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/privacy/dlp/v2beta1/dlp.proto", +} + +func init() { proto.RegisterFile("google/privacy/dlp/v2beta1/dlp.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 5192 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x3c, 0x5d, 0x6f, 0x1b, 0xd9, + 0x75, 0x1a, 0x7e, 0x48, 0xe4, 0x91, 0x48, 0xd1, 0x57, 0x1f, 0xa6, 0xe9, 0x75, 0x6c, 0x8f, 0x77, + 0xbd, 0x5e, 0xef, 0x46, 0xca, 0x6a, 0xbf, 0xba, 0xbb, 0xf5, 0xc6, 0x14, 0x45, 0x99, 0x5a, 0x53, + 0xa2, 0x3c, 0xa4, 0x64, 0xbb, 0xbb, 0xdd, 0xc1, 0x88, 0xbc, 0xa2, 0x26, 0x1a, 0xce, 0xd0, 0x33, + 0x43, 0x5b, 0xdc, 0x74, 0xd1, 0xa0, 0x0d, 0x82, 0xb4, 0x45, 0x1f, 0x8a, 0x06, 0x48, 0x51, 0xb4, + 0x08, 0x52, 0xe4, 0x21, 0x0d, 0xda, 0x87, 0x22, 0x7d, 0x49, 0x1b, 0x14, 0x41, 0xf6, 0x2d, 0x45, + 0x9f, 0xfa, 0x01, 0x14, 0x45, 0x11, 0xa0, 0xc8, 0x43, 0xd1, 0xbe, 0xb4, 0xff, 0xa0, 0xb8, 0x1f, + 0xf3, 0xc9, 0x21, 0x45, 0x6a, 0xb5, 0x68, 0xde, 0x78, 0xcf, 0x3d, 0x5f, 0xf7, 0xdc, 0x73, 0xce, + 0x3d, 0xf7, 0xce, 0xbd, 0x84, 0xe7, 0xdb, 0x86, 0xd1, 0xd6, 0xf0, 0x6a, 0xd7, 0x54, 0x9f, 0x2a, + 0xcd, 0xfe, 0x6a, 0x4b, 0xeb, 0xae, 0x3e, 0x5d, 0x3b, 0xc0, 0xb6, 0xf2, 0x2a, 0xf9, 0xbd, 0xd2, + 0x35, 0x0d, 0xdb, 0x40, 0x05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5e, 0xf9, 0xde, 0x68, 0x57, 0x1a, 0x1c, 0xdb, 0x8a, 0xc4, 0xf8, 0x70, 0x35, + 0xb3, 0xa6, 0xbf, 0x69, 0xa1, 0x4f, 0xe0, 0x22, 0x73, 0x7d, 0x93, 0xd2, 0xaa, 0x86, 0xee, 0x0a, + 0x4c, 0x50, 0x81, 0xe5, 0x89, 0x05, 0xd2, 0x79, 0x94, 0x1c, 0x76, 0x5c, 0xee, 0x92, 0x1a, 0x01, + 0xa5, 0xeb, 0x7a, 0x40, 0xbf, 0x73, 0x5a, 0xd7, 0x1d, 0xdb, 0x3d, 0x53, 0xed, 0x23, 0xea, 0x2f, + 0x69, 0x69, 0x96, 0xc3, 0x1e, 0xaa, 0xf6, 0x51, 0xe1, 0xdf, 0x04, 0x58, 0x8c, 0x52, 0x13, 0x95, + 0xce, 0x28, 0xbe, 0x32, 0xe5, 0x53, 0xe0, 0x16, 0x99, 0x3c, 0xc2, 0x57, 0x56, 0x34, 0x4d, 0xb6, + 0xf1, 0x09, 0xf3, 0xd9, 0x54, 0x65, 0x4a, 0xca, 0xb0, 0x8e, 0xa2, 0xa6, 0x35, 0xf0, 0x89, 0x4d, + 0x92, 0x98, 0xdf, 0xee, 0x9a, 0x61, 0x52, 0x47, 0x3e, 0x25, 0x89, 0x95, 0x08, 0x22, 0x99, 0x49, + 0x57, 0x77, 0xcd, 0x30, 0xd7, 0x53, 0x30, 0x6d, 0x2b, 0x66, 0x1b, 0xdb, 0x62, 0x09, 0x92, 0x14, + 0x44, 0x62, 0xc8, 0xc4, 0x2d, 0x3a, 0x8e, 0x98, 0x44, 0x7e, 0x92, 0x78, 0x69, 0x9b, 0x18, 0xeb, + 0x54, 0xa1, 0x98, 0xc4, 0x1a, 0x24, 0xb2, 0x0e, 0x9c, 0x62, 0x23, 0x26, 0xd1, 0xdf, 0xe2, 0x3e, + 0x2c, 0x85, 0x66, 0xd7, 0xea, 0x1a, 0xba, 0x85, 0x3d, 0xcf, 0x16, 0xce, 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55, 0xf8, 0x81, 0x00, 0xb9, 0xb0, 0xa9, + 0xcf, 0x41, 0xb3, 0x06, 0x2c, 0x58, 0x58, 0xb7, 0x54, 0x5b, 0x7d, 0x8a, 0x65, 0xc5, 0xb6, 0x4d, + 0xf5, 0xa0, 0x67, 0x3b, 0x07, 0xa5, 0x63, 0xf1, 0x42, 0x2e, 0x7d, 0xd1, 0x21, 0x77, 0xab, 0xdb, + 0x3f, 0x8b, 0xc1, 0x15, 0x92, 0x86, 0x68, 0x6e, 0xb2, 0x54, 0x6b, 0xb0, 0xe6, 0x0c, 0x95, 0x6f, + 0xc2, 0x44, 0xe5, 0x5b, 0x13, 0xf2, 0xbc, 0x5c, 0xc1, 0x2d, 0x39, 0x94, 0xdf, 0x62, 0x93, 0xe6, + 0xb7, 0x65, 0x97, 0x55, 0x30, 0x11, 0x79, 0x25, 0x1c, 0x6e, 0xc9, 0x9f, 0x2d, 0xe5, 0x2d, 0xba, + 0x8c, 0xea, 0xbe, 0xdc, 0xf7, 0xcf, 0xcb, 0x70, 0x39, 0xd2, 0x48, 0xbc, 0xc6, 0xfa, 0xba, 0x30, + 0x98, 0x0a, 0x79, 0xe5, 0xc2, 0x34, 0xa8, 0x8e, 0x3c, 0x80, 0x1b, 0xce, 0x39, 0x94, 0x18, 0x19, + 0x70, 0x30, 0x31, 0x72, 0x35, 0x7e, 0x57, 0x88, 0xca, 0x8c, 0x5c, 0x11, 0x96, 0x35, 0x76, 0xce, + 0xaa, 0x48, 0x38, 0x90, 0x5d, 0x55, 0x06, 0xf2, 0x24, 0x57, 0xe6, 0x24, 0x98, 0x27, 0xb9, 0x16, + 0xac, 0x68, 0xaf, 0x9c, 0x55, 0x0b, 0x2f, 0xf0, 0x5d, 0xf9, 0xbe, 0xac, 0xe9, 0x49, 0xf6, 0x67, + 0x4d, 0x2e, 0x79, 0xfa, 0xb3, 0x49, 0xf6, 0x02, 0xdb, 0x93, 0xac, 0x85, 0x60, 0x85, 0xff, 0x10, + 0xc2, 0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 0xba, 0x03, 0x33, 0x4d, 0x43, 0x77, 0xaf, 0x90, 0x8e, 0x7b, 0x0d, 0x9c, 0xd3, 0xa0, 0x13, 0x98, + 0xe7, 0x39, 0x49, 0xd1, 0xba, 0x47, 0xca, 0x01, 0x66, 0x67, 0xf9, 0xd9, 0xb5, 0xed, 0x33, 0x95, + 0x49, 0x2b, 0x9b, 0x87, 0x27, 0x25, 0xca, 0x6f, 0x47, 0xa1, 0x9f, 0x84, 0x38, 0x53, 0xb2, 0x1e, + 0x33, 0x39, 0x0e, 0x04, 0xbd, 0x04, 0xfc, 0x0d, 0x8f, 0x27, 0x39, 0xc9, 0x53, 0x67, 0x96, 0x75, + 0xb8, 0xa8, 0xcb, 0x90, 0x34, 0x95, 0x96, 0x7a, 0x42, 0x8b, 0x9b, 0x64, 0x65, 0x4a, 0x62, 0x4d, + 0xf1, 0x5b, 0x02, 0x5c, 0x1c, 0x22, 0x10, 0xdd, 0x86, 0x9b, 0x9b, 0x9b, 0x8f, 0xe4, 0x52, 0x6d, + 0x7b, 0xbb, 0xb6, 0x23, 0xef, 0x14, 0x1b, 0x5b, 0xfb, 0x65, 0x99, 0x26, 0xab, 0xf5, 0x72, 0x63, + 0x54, 0xa6, 0x23, 0xab, 0x5a, 0xf9, 0x51, 0x71, 0xa3, 0x5c, 0xda, 0xda, 0x2e, 0x56, 0x73, 0x31, + 0xf4, 0x1c, 0xe4, 0xbd, 0xa4, 0xc7, 0x58, 0xc8, 0x0e, 0x7a, 0x1c, 0x5d, 0x80, 0x4c, 0x10, 0x94, + 0x58, 0x07, 0x48, 0x39, 0x43, 0x12, 0x7f, 0x27, 0x06, 0x69, 0x77, 0xde, 0xd0, 0x0e, 0xa4, 0x69, + 0x95, 0xa0, 0x62, 0xdd, 0x1e, 0xa7, 0x5c, 0x6f, 0x38, 0xc8, 0x2e, 0x0b, 0xba, 0xc3, 0x72, 0xa0, + 0x84, 0x5f, 0x4f, 0x7f, 0x66, 0x2a, 0xdd, 0x2e, 0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0x21, + 0xda, 0xaf, 0x7f, 0x57, 0x80, 0x2f, 0x34, 0x8d, 0xce, 0x08, 0xf6, 0xeb, 0xa9, 0x0d, 0xad, 0xbb, + 0x6b, 0x1a, 0xb6, 0xb1, 0x2b, 0xfc, 0xda, 0x1d, 0x8e, 0xd7, 0x36, 0x34, 0x45, 0x6f, 0xaf, 0x18, + 0x66, 0x7b, 0xb5, 0x8d, 0x75, 0x7a, 0x3b, 0x61, 0x95, 0x75, 0x29, 0x5d, 0xd5, 0x8a, 0xfa, 0x1b, + 0xa9, 0x77, 0x5b, 0x5a, 0xf7, 0x07, 0xb1, 0xfc, 0x3d, 0x46, 0x4f, 0x5f, 0x5d, 0xae, 0x6c, 0x68, + 0xdd, 0x95, 0xfd, 0xb5, 0x75, 0xd2, 0xfd, 0x33, 0xa7, 0xeb, 0x43, 0xda, 0xf5, 0xe1, 0x86, 0xd6, + 0xfd, 0x70, 0x9f, 0x51, 0x1e, 0x4c, 0x53, 0xfe, 0xaf, 0xfd, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xac, 0x11, 0x04, 0x57, 0x2a, 0x4b, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/privacy/dlp/v2beta1/storage.pb.go b/vendor/google.golang.org/genproto/googleapis/privacy/dlp/v2beta1/storage.pb.go new file mode 100644 index 0000000000..7ec5a39a54 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/privacy/dlp/v2beta1/storage.pb.go @@ -0,0 +1,1143 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/privacy/dlp/v2beta1/storage.proto + +package dlp + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import _ "github.com/golang/protobuf/ptypes/timestamp" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Type of information detected by the API. +type InfoType struct { + // Name of the information type. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *InfoType) Reset() { *m = InfoType{} } +func (m *InfoType) String() string { return proto.CompactTextString(m) } +func (*InfoType) ProtoMessage() {} +func (*InfoType) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +func (m *InfoType) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Custom information type provided by the user. Used to find domain-specific +// sensitive information configurable to the data in question. +type CustomInfoType struct { + // Info type configuration. All custom info types must have configurations + // that do not conflict with built-in info types or other custom info types. + InfoType *InfoType `protobuf:"bytes,1,opt,name=info_type,json=infoType" json:"info_type,omitempty"` + // Types that are valid to be assigned to Type: + // *CustomInfoType_Dictionary_ + Type isCustomInfoType_Type `protobuf_oneof:"type"` +} + +func (m *CustomInfoType) Reset() { *m = CustomInfoType{} } +func (m *CustomInfoType) String() string { return proto.CompactTextString(m) } +func (*CustomInfoType) ProtoMessage() {} +func (*CustomInfoType) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} } + +type isCustomInfoType_Type interface { + isCustomInfoType_Type() +} + +type CustomInfoType_Dictionary_ struct { + Dictionary *CustomInfoType_Dictionary `protobuf:"bytes,2,opt,name=dictionary,oneof"` +} + +func (*CustomInfoType_Dictionary_) isCustomInfoType_Type() {} + +func (m *CustomInfoType) GetType() isCustomInfoType_Type { + if m != nil { + return m.Type + } + return nil +} + +func (m *CustomInfoType) GetInfoType() *InfoType { + if m != nil { + return m.InfoType + } + return nil +} + +func (m *CustomInfoType) GetDictionary() *CustomInfoType_Dictionary { + if x, ok := m.GetType().(*CustomInfoType_Dictionary_); ok { + return x.Dictionary + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*CustomInfoType) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _CustomInfoType_OneofMarshaler, _CustomInfoType_OneofUnmarshaler, _CustomInfoType_OneofSizer, []interface{}{ + (*CustomInfoType_Dictionary_)(nil), + } +} + +func _CustomInfoType_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*CustomInfoType) + // type + switch x := m.Type.(type) { + case *CustomInfoType_Dictionary_: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Dictionary); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("CustomInfoType.Type has unexpected type %T", x) + } + return nil +} + +func _CustomInfoType_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*CustomInfoType) + switch tag { + case 2: // type.dictionary + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(CustomInfoType_Dictionary) + err := b.DecodeMessage(msg) + m.Type = &CustomInfoType_Dictionary_{msg} + return true, err + default: + return false, nil + } +} + +func _CustomInfoType_OneofSizer(msg proto.Message) (n int) { + m := msg.(*CustomInfoType) + // type + switch x := m.Type.(type) { + case *CustomInfoType_Dictionary_: + s := proto.Size(x.Dictionary) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Custom information type based on a dictionary of words or phrases. This can +// be used to match sensitive information specific to the data, such as a list +// of employee IDs or job titles. +// +// Dictionary words are case-insensitive and all characters other than letters +// and digits in the unicode [Basic Multilingual +// Plane](https://en.wikipedia.org/wiki/Plane_%28Unicode%29#Basic_Multilingual_Plane) +// will be replaced with whitespace when scanning for matches, so the +// dictionary phrase "Sam Johnson" will match all three phrases "sam johnson", +// "Sam, Johnson", and "Sam (Johnson)". Additionally, the characters +// surrounding any match must be of a different type than the adjacent +// characters within the word, so letters must be next to non-letters and +// digits next to non-digits. For example, the dictionary word "jen" will +// match the first three letters of the text "jen123" but will return no +// matches for "jennifer". +// +// Dictionary words containing a large number of characters that are not +// letters or digits may result in unexpected findings because such characters +// are treated as whitespace. +type CustomInfoType_Dictionary struct { + // Types that are valid to be assigned to Source: + // *CustomInfoType_Dictionary_WordList_ + Source isCustomInfoType_Dictionary_Source `protobuf_oneof:"source"` +} + +func (m *CustomInfoType_Dictionary) Reset() { *m = CustomInfoType_Dictionary{} } +func (m *CustomInfoType_Dictionary) String() string { return proto.CompactTextString(m) } +func (*CustomInfoType_Dictionary) ProtoMessage() {} +func (*CustomInfoType_Dictionary) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1, 0} } + +type isCustomInfoType_Dictionary_Source interface { + isCustomInfoType_Dictionary_Source() +} + +type CustomInfoType_Dictionary_WordList_ struct { + WordList *CustomInfoType_Dictionary_WordList `protobuf:"bytes,1,opt,name=word_list,json=wordList,oneof"` +} + +func (*CustomInfoType_Dictionary_WordList_) isCustomInfoType_Dictionary_Source() {} + +func (m *CustomInfoType_Dictionary) GetSource() isCustomInfoType_Dictionary_Source { + if m != nil { + return m.Source + } + return nil +} + +func (m *CustomInfoType_Dictionary) GetWordList() *CustomInfoType_Dictionary_WordList { + if x, ok := m.GetSource().(*CustomInfoType_Dictionary_WordList_); ok { + return x.WordList + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*CustomInfoType_Dictionary) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _CustomInfoType_Dictionary_OneofMarshaler, _CustomInfoType_Dictionary_OneofUnmarshaler, _CustomInfoType_Dictionary_OneofSizer, []interface{}{ + (*CustomInfoType_Dictionary_WordList_)(nil), + } +} + +func _CustomInfoType_Dictionary_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*CustomInfoType_Dictionary) + // source + switch x := m.Source.(type) { + case *CustomInfoType_Dictionary_WordList_: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.WordList); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("CustomInfoType_Dictionary.Source has unexpected type %T", x) + } + return nil +} + +func _CustomInfoType_Dictionary_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*CustomInfoType_Dictionary) + switch tag { + case 1: // source.word_list + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(CustomInfoType_Dictionary_WordList) + err := b.DecodeMessage(msg) + m.Source = &CustomInfoType_Dictionary_WordList_{msg} + return true, err + default: + return false, nil + } +} + +func _CustomInfoType_Dictionary_OneofSizer(msg proto.Message) (n int) { + m := msg.(*CustomInfoType_Dictionary) + // source + switch x := m.Source.(type) { + case *CustomInfoType_Dictionary_WordList_: + s := proto.Size(x.WordList) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Message defining a list of words or phrases to search for in the data. +type CustomInfoType_Dictionary_WordList struct { + // Words or phrases defining the dictionary. The dictionary must contain + // at least one phrase and every phrase must contain at least 2 characters + // that are letters or digits. [required] + Words []string `protobuf:"bytes,1,rep,name=words" json:"words,omitempty"` +} + +func (m *CustomInfoType_Dictionary_WordList) Reset() { *m = CustomInfoType_Dictionary_WordList{} } +func (m *CustomInfoType_Dictionary_WordList) String() string { return proto.CompactTextString(m) } +func (*CustomInfoType_Dictionary_WordList) ProtoMessage() {} +func (*CustomInfoType_Dictionary_WordList) Descriptor() ([]byte, []int) { + return fileDescriptor1, []int{1, 0, 0} +} + +func (m *CustomInfoType_Dictionary_WordList) GetWords() []string { + if m != nil { + return m.Words + } + return nil +} + +// General identifier of a data field in a storage service. +type FieldId struct { + // Name describing the field. + ColumnName string `protobuf:"bytes,1,opt,name=column_name,json=columnName" json:"column_name,omitempty"` +} + +func (m *FieldId) Reset() { *m = FieldId{} } +func (m *FieldId) String() string { return proto.CompactTextString(m) } +func (*FieldId) ProtoMessage() {} +func (*FieldId) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} } + +func (m *FieldId) GetColumnName() string { + if m != nil { + return m.ColumnName + } + return "" +} + +// Datastore partition ID. +// A partition ID identifies a grouping of entities. The grouping is always +// by project and namespace, however the namespace ID may be empty. +// +// A partition ID contains several dimensions: +// project ID and namespace ID. +type PartitionId struct { + // The ID of the project to which the entities belong. + ProjectId string `protobuf:"bytes,2,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // If not empty, the ID of the namespace to which the entities belong. + NamespaceId string `protobuf:"bytes,4,opt,name=namespace_id,json=namespaceId" json:"namespace_id,omitempty"` +} + +func (m *PartitionId) Reset() { *m = PartitionId{} } +func (m *PartitionId) String() string { return proto.CompactTextString(m) } +func (*PartitionId) ProtoMessage() {} +func (*PartitionId) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{3} } + +func (m *PartitionId) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *PartitionId) GetNamespaceId() string { + if m != nil { + return m.NamespaceId + } + return "" +} + +// A representation of a Datastore kind. +type KindExpression struct { + // The name of the kind. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *KindExpression) Reset() { *m = KindExpression{} } +func (m *KindExpression) String() string { return proto.CompactTextString(m) } +func (*KindExpression) ProtoMessage() {} +func (*KindExpression) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{4} } + +func (m *KindExpression) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// A reference to a property relative to the Datastore kind expressions. +type PropertyReference struct { + // The name of the property. + // If name includes "."s, it may be interpreted as a property name path. + Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` +} + +func (m *PropertyReference) Reset() { *m = PropertyReference{} } +func (m *PropertyReference) String() string { return proto.CompactTextString(m) } +func (*PropertyReference) ProtoMessage() {} +func (*PropertyReference) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{5} } + +func (m *PropertyReference) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// A representation of a Datastore property in a projection. +type Projection struct { + // The property to project. + Property *PropertyReference `protobuf:"bytes,1,opt,name=property" json:"property,omitempty"` +} + +func (m *Projection) Reset() { *m = Projection{} } +func (m *Projection) String() string { return proto.CompactTextString(m) } +func (*Projection) ProtoMessage() {} +func (*Projection) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{6} } + +func (m *Projection) GetProperty() *PropertyReference { + if m != nil { + return m.Property + } + return nil +} + +// Options defining a data set within Google Cloud Datastore. +type DatastoreOptions struct { + // A partition ID identifies a grouping of entities. The grouping is always + // by project and namespace, however the namespace ID may be empty. + PartitionId *PartitionId `protobuf:"bytes,1,opt,name=partition_id,json=partitionId" json:"partition_id,omitempty"` + // The kind to process. + Kind *KindExpression `protobuf:"bytes,2,opt,name=kind" json:"kind,omitempty"` + // Properties to scan. If none are specified, all properties will be scanned + // by default. + Projection []*Projection `protobuf:"bytes,3,rep,name=projection" json:"projection,omitempty"` +} + +func (m *DatastoreOptions) Reset() { *m = DatastoreOptions{} } +func (m *DatastoreOptions) String() string { return proto.CompactTextString(m) } +func (*DatastoreOptions) ProtoMessage() {} +func (*DatastoreOptions) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{7} } + +func (m *DatastoreOptions) GetPartitionId() *PartitionId { + if m != nil { + return m.PartitionId + } + return nil +} + +func (m *DatastoreOptions) GetKind() *KindExpression { + if m != nil { + return m.Kind + } + return nil +} + +func (m *DatastoreOptions) GetProjection() []*Projection { + if m != nil { + return m.Projection + } + return nil +} + +// Options defining a file or a set of files (path ending with *) within +// a Google Cloud Storage bucket. +type CloudStorageOptions struct { + FileSet *CloudStorageOptions_FileSet `protobuf:"bytes,1,opt,name=file_set,json=fileSet" json:"file_set,omitempty"` +} + +func (m *CloudStorageOptions) Reset() { *m = CloudStorageOptions{} } +func (m *CloudStorageOptions) String() string { return proto.CompactTextString(m) } +func (*CloudStorageOptions) ProtoMessage() {} +func (*CloudStorageOptions) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{8} } + +func (m *CloudStorageOptions) GetFileSet() *CloudStorageOptions_FileSet { + if m != nil { + return m.FileSet + } + return nil +} + +// Set of files to scan. +type CloudStorageOptions_FileSet struct { + // The url, in the format `gs:///`. Trailing wildcard in the + // path is allowed. + Url string `protobuf:"bytes,1,opt,name=url" json:"url,omitempty"` +} + +func (m *CloudStorageOptions_FileSet) Reset() { *m = CloudStorageOptions_FileSet{} } +func (m *CloudStorageOptions_FileSet) String() string { return proto.CompactTextString(m) } +func (*CloudStorageOptions_FileSet) ProtoMessage() {} +func (*CloudStorageOptions_FileSet) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{8, 0} } + +func (m *CloudStorageOptions_FileSet) GetUrl() string { + if m != nil { + return m.Url + } + return "" +} + +// A location in Cloud Storage. +type CloudStoragePath struct { + // The url, in the format of `gs://bucket/`. + Path string `protobuf:"bytes,1,opt,name=path" json:"path,omitempty"` +} + +func (m *CloudStoragePath) Reset() { *m = CloudStoragePath{} } +func (m *CloudStoragePath) String() string { return proto.CompactTextString(m) } +func (*CloudStoragePath) ProtoMessage() {} +func (*CloudStoragePath) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{9} } + +func (m *CloudStoragePath) GetPath() string { + if m != nil { + return m.Path + } + return "" +} + +// Options defining BigQuery table and row identifiers. +type BigQueryOptions struct { + // Complete BigQuery table reference. + TableReference *BigQueryTable `protobuf:"bytes,1,opt,name=table_reference,json=tableReference" json:"table_reference,omitempty"` + // References to fields uniquely identifying rows within the table. + // Nested fields in the format, like `person.birthdate.year`, are allowed. + IdentifyingFields []*FieldId `protobuf:"bytes,2,rep,name=identifying_fields,json=identifyingFields" json:"identifying_fields,omitempty"` +} + +func (m *BigQueryOptions) Reset() { *m = BigQueryOptions{} } +func (m *BigQueryOptions) String() string { return proto.CompactTextString(m) } +func (*BigQueryOptions) ProtoMessage() {} +func (*BigQueryOptions) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{10} } + +func (m *BigQueryOptions) GetTableReference() *BigQueryTable { + if m != nil { + return m.TableReference + } + return nil +} + +func (m *BigQueryOptions) GetIdentifyingFields() []*FieldId { + if m != nil { + return m.IdentifyingFields + } + return nil +} + +// Shared message indicating Cloud storage type. +type StorageConfig struct { + // Types that are valid to be assigned to Type: + // *StorageConfig_DatastoreOptions + // *StorageConfig_CloudStorageOptions + // *StorageConfig_BigQueryOptions + Type isStorageConfig_Type `protobuf_oneof:"type"` +} + +func (m *StorageConfig) Reset() { *m = StorageConfig{} } +func (m *StorageConfig) String() string { return proto.CompactTextString(m) } +func (*StorageConfig) ProtoMessage() {} +func (*StorageConfig) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{11} } + +type isStorageConfig_Type interface { + isStorageConfig_Type() +} + +type StorageConfig_DatastoreOptions struct { + DatastoreOptions *DatastoreOptions `protobuf:"bytes,2,opt,name=datastore_options,json=datastoreOptions,oneof"` +} +type StorageConfig_CloudStorageOptions struct { + CloudStorageOptions *CloudStorageOptions `protobuf:"bytes,3,opt,name=cloud_storage_options,json=cloudStorageOptions,oneof"` +} +type StorageConfig_BigQueryOptions struct { + BigQueryOptions *BigQueryOptions `protobuf:"bytes,4,opt,name=big_query_options,json=bigQueryOptions,oneof"` +} + +func (*StorageConfig_DatastoreOptions) isStorageConfig_Type() {} +func (*StorageConfig_CloudStorageOptions) isStorageConfig_Type() {} +func (*StorageConfig_BigQueryOptions) isStorageConfig_Type() {} + +func (m *StorageConfig) GetType() isStorageConfig_Type { + if m != nil { + return m.Type + } + return nil +} + +func (m *StorageConfig) GetDatastoreOptions() *DatastoreOptions { + if x, ok := m.GetType().(*StorageConfig_DatastoreOptions); ok { + return x.DatastoreOptions + } + return nil +} + +func (m *StorageConfig) GetCloudStorageOptions() *CloudStorageOptions { + if x, ok := m.GetType().(*StorageConfig_CloudStorageOptions); ok { + return x.CloudStorageOptions + } + return nil +} + +func (m *StorageConfig) GetBigQueryOptions() *BigQueryOptions { + if x, ok := m.GetType().(*StorageConfig_BigQueryOptions); ok { + return x.BigQueryOptions + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*StorageConfig) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _StorageConfig_OneofMarshaler, _StorageConfig_OneofUnmarshaler, _StorageConfig_OneofSizer, []interface{}{ + (*StorageConfig_DatastoreOptions)(nil), + (*StorageConfig_CloudStorageOptions)(nil), + (*StorageConfig_BigQueryOptions)(nil), + } +} + +func _StorageConfig_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*StorageConfig) + // type + switch x := m.Type.(type) { + case *StorageConfig_DatastoreOptions: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.DatastoreOptions); err != nil { + return err + } + case *StorageConfig_CloudStorageOptions: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.CloudStorageOptions); err != nil { + return err + } + case *StorageConfig_BigQueryOptions: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BigQueryOptions); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("StorageConfig.Type has unexpected type %T", x) + } + return nil +} + +func _StorageConfig_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*StorageConfig) + switch tag { + case 2: // type.datastore_options + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(DatastoreOptions) + err := b.DecodeMessage(msg) + m.Type = &StorageConfig_DatastoreOptions{msg} + return true, err + case 3: // type.cloud_storage_options + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(CloudStorageOptions) + err := b.DecodeMessage(msg) + m.Type = &StorageConfig_CloudStorageOptions{msg} + return true, err + case 4: // type.big_query_options + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(BigQueryOptions) + err := b.DecodeMessage(msg) + m.Type = &StorageConfig_BigQueryOptions{msg} + return true, err + default: + return false, nil + } +} + +func _StorageConfig_OneofSizer(msg proto.Message) (n int) { + m := msg.(*StorageConfig) + // type + switch x := m.Type.(type) { + case *StorageConfig_DatastoreOptions: + s := proto.Size(x.DatastoreOptions) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *StorageConfig_CloudStorageOptions: + s := proto.Size(x.CloudStorageOptions) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *StorageConfig_BigQueryOptions: + s := proto.Size(x.BigQueryOptions) + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Record key for a finding in a Cloud Storage file. +type CloudStorageKey struct { + // Path to the file. + FilePath string `protobuf:"bytes,1,opt,name=file_path,json=filePath" json:"file_path,omitempty"` + // Byte offset of the referenced data in the file. + StartOffset int64 `protobuf:"varint,2,opt,name=start_offset,json=startOffset" json:"start_offset,omitempty"` +} + +func (m *CloudStorageKey) Reset() { *m = CloudStorageKey{} } +func (m *CloudStorageKey) String() string { return proto.CompactTextString(m) } +func (*CloudStorageKey) ProtoMessage() {} +func (*CloudStorageKey) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{12} } + +func (m *CloudStorageKey) GetFilePath() string { + if m != nil { + return m.FilePath + } + return "" +} + +func (m *CloudStorageKey) GetStartOffset() int64 { + if m != nil { + return m.StartOffset + } + return 0 +} + +// Record key for a finding in Cloud Datastore. +type DatastoreKey struct { + // Datastore entity key. + EntityKey *Key `protobuf:"bytes,1,opt,name=entity_key,json=entityKey" json:"entity_key,omitempty"` +} + +func (m *DatastoreKey) Reset() { *m = DatastoreKey{} } +func (m *DatastoreKey) String() string { return proto.CompactTextString(m) } +func (*DatastoreKey) ProtoMessage() {} +func (*DatastoreKey) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{13} } + +func (m *DatastoreKey) GetEntityKey() *Key { + if m != nil { + return m.EntityKey + } + return nil +} + +// A unique identifier for a Datastore entity. +// If a key's partition ID or any of its path kinds or names are +// reserved/read-only, the key is reserved/read-only. +// A reserved/read-only key is forbidden in certain documented contexts. +type Key struct { + // Entities are partitioned into subsets, currently identified by a project + // ID and namespace ID. + // Queries are scoped to a single partition. + PartitionId *PartitionId `protobuf:"bytes,1,opt,name=partition_id,json=partitionId" json:"partition_id,omitempty"` + // The entity path. + // An entity path consists of one or more elements composed of a kind and a + // string or numerical identifier, which identify entities. The first + // element identifies a _root entity_, the second element identifies + // a _child_ of the root entity, the third element identifies a child of the + // second entity, and so forth. The entities identified by all prefixes of + // the path are called the element's _ancestors_. + // + // A path can never be empty, and a path can have at most 100 elements. + Path []*Key_PathElement `protobuf:"bytes,2,rep,name=path" json:"path,omitempty"` +} + +func (m *Key) Reset() { *m = Key{} } +func (m *Key) String() string { return proto.CompactTextString(m) } +func (*Key) ProtoMessage() {} +func (*Key) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{14} } + +func (m *Key) GetPartitionId() *PartitionId { + if m != nil { + return m.PartitionId + } + return nil +} + +func (m *Key) GetPath() []*Key_PathElement { + if m != nil { + return m.Path + } + return nil +} + +// A (kind, ID/name) pair used to construct a key path. +// +// If either name or ID is set, the element is complete. +// If neither is set, the element is incomplete. +type Key_PathElement struct { + // The kind of the entity. + // A kind matching regex `__.*__` is reserved/read-only. + // A kind must not contain more than 1500 bytes when UTF-8 encoded. + // Cannot be `""`. + Kind string `protobuf:"bytes,1,opt,name=kind" json:"kind,omitempty"` + // The type of ID. + // + // Types that are valid to be assigned to IdType: + // *Key_PathElement_Id + // *Key_PathElement_Name + IdType isKey_PathElement_IdType `protobuf_oneof:"id_type"` +} + +func (m *Key_PathElement) Reset() { *m = Key_PathElement{} } +func (m *Key_PathElement) String() string { return proto.CompactTextString(m) } +func (*Key_PathElement) ProtoMessage() {} +func (*Key_PathElement) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{14, 0} } + +type isKey_PathElement_IdType interface { + isKey_PathElement_IdType() +} + +type Key_PathElement_Id struct { + Id int64 `protobuf:"varint,2,opt,name=id,oneof"` +} +type Key_PathElement_Name struct { + Name string `protobuf:"bytes,3,opt,name=name,oneof"` +} + +func (*Key_PathElement_Id) isKey_PathElement_IdType() {} +func (*Key_PathElement_Name) isKey_PathElement_IdType() {} + +func (m *Key_PathElement) GetIdType() isKey_PathElement_IdType { + if m != nil { + return m.IdType + } + return nil +} + +func (m *Key_PathElement) GetKind() string { + if m != nil { + return m.Kind + } + return "" +} + +func (m *Key_PathElement) GetId() int64 { + if x, ok := m.GetIdType().(*Key_PathElement_Id); ok { + return x.Id + } + return 0 +} + +func (m *Key_PathElement) GetName() string { + if x, ok := m.GetIdType().(*Key_PathElement_Name); ok { + return x.Name + } + return "" +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Key_PathElement) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _Key_PathElement_OneofMarshaler, _Key_PathElement_OneofUnmarshaler, _Key_PathElement_OneofSizer, []interface{}{ + (*Key_PathElement_Id)(nil), + (*Key_PathElement_Name)(nil), + } +} + +func _Key_PathElement_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Key_PathElement) + // id_type + switch x := m.IdType.(type) { + case *Key_PathElement_Id: + b.EncodeVarint(2<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.Id)) + case *Key_PathElement_Name: + b.EncodeVarint(3<<3 | proto.WireBytes) + b.EncodeStringBytes(x.Name) + case nil: + default: + return fmt.Errorf("Key_PathElement.IdType has unexpected type %T", x) + } + return nil +} + +func _Key_PathElement_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Key_PathElement) + switch tag { + case 2: // id_type.id + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.IdType = &Key_PathElement_Id{int64(x)} + return true, err + case 3: // id_type.name + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.IdType = &Key_PathElement_Name{x} + return true, err + default: + return false, nil + } +} + +func _Key_PathElement_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Key_PathElement) + // id_type + switch x := m.IdType.(type) { + case *Key_PathElement_Id: + n += proto.SizeVarint(2<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.Id)) + case *Key_PathElement_Name: + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Name))) + n += len(x.Name) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Message for a unique key indicating a record that contains a finding. +type RecordKey struct { + // Types that are valid to be assigned to Type: + // *RecordKey_CloudStorageKey + // *RecordKey_DatastoreKey + Type isRecordKey_Type `protobuf_oneof:"type"` +} + +func (m *RecordKey) Reset() { *m = RecordKey{} } +func (m *RecordKey) String() string { return proto.CompactTextString(m) } +func (*RecordKey) ProtoMessage() {} +func (*RecordKey) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{15} } + +type isRecordKey_Type interface { + isRecordKey_Type() +} + +type RecordKey_CloudStorageKey struct { + CloudStorageKey *CloudStorageKey `protobuf:"bytes,1,opt,name=cloud_storage_key,json=cloudStorageKey,oneof"` +} +type RecordKey_DatastoreKey struct { + DatastoreKey *DatastoreKey `protobuf:"bytes,2,opt,name=datastore_key,json=datastoreKey,oneof"` +} + +func (*RecordKey_CloudStorageKey) isRecordKey_Type() {} +func (*RecordKey_DatastoreKey) isRecordKey_Type() {} + +func (m *RecordKey) GetType() isRecordKey_Type { + if m != nil { + return m.Type + } + return nil +} + +func (m *RecordKey) GetCloudStorageKey() *CloudStorageKey { + if x, ok := m.GetType().(*RecordKey_CloudStorageKey); ok { + return x.CloudStorageKey + } + return nil +} + +func (m *RecordKey) GetDatastoreKey() *DatastoreKey { + if x, ok := m.GetType().(*RecordKey_DatastoreKey); ok { + return x.DatastoreKey + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*RecordKey) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _RecordKey_OneofMarshaler, _RecordKey_OneofUnmarshaler, _RecordKey_OneofSizer, []interface{}{ + (*RecordKey_CloudStorageKey)(nil), + (*RecordKey_DatastoreKey)(nil), + } +} + +func _RecordKey_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*RecordKey) + // type + switch x := m.Type.(type) { + case *RecordKey_CloudStorageKey: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.CloudStorageKey); err != nil { + return err + } + case *RecordKey_DatastoreKey: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.DatastoreKey); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("RecordKey.Type has unexpected type %T", x) + } + return nil +} + +func _RecordKey_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*RecordKey) + switch tag { + case 1: // type.cloud_storage_key + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(CloudStorageKey) + err := b.DecodeMessage(msg) + m.Type = &RecordKey_CloudStorageKey{msg} + return true, err + case 2: // type.datastore_key + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(DatastoreKey) + err := b.DecodeMessage(msg) + m.Type = &RecordKey_DatastoreKey{msg} + return true, err + default: + return false, nil + } +} + +func _RecordKey_OneofSizer(msg proto.Message) (n int) { + m := msg.(*RecordKey) + // type + switch x := m.Type.(type) { + case *RecordKey_CloudStorageKey: + s := proto.Size(x.CloudStorageKey) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *RecordKey_DatastoreKey: + s := proto.Size(x.DatastoreKey) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Message defining the location of a BigQuery table. A table is uniquely +// identified by its project_id, dataset_id, and table_name. Within a query +// a table is often referenced with a string in the format of: +// `:.` or +// `..`. +type BigQueryTable struct { + // The Google Cloud Platform project ID of the project containing the table. + // If omitted, project ID is inferred from the API call. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // Dataset ID of the table. + DatasetId string `protobuf:"bytes,2,opt,name=dataset_id,json=datasetId" json:"dataset_id,omitempty"` + // Name of the table. + TableId string `protobuf:"bytes,3,opt,name=table_id,json=tableId" json:"table_id,omitempty"` +} + +func (m *BigQueryTable) Reset() { *m = BigQueryTable{} } +func (m *BigQueryTable) String() string { return proto.CompactTextString(m) } +func (*BigQueryTable) ProtoMessage() {} +func (*BigQueryTable) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{16} } + +func (m *BigQueryTable) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *BigQueryTable) GetDatasetId() string { + if m != nil { + return m.DatasetId + } + return "" +} + +func (m *BigQueryTable) GetTableId() string { + if m != nil { + return m.TableId + } + return "" +} + +// An entity in a dataset is a field or set of fields that correspond to a +// single person. For example, in medical records the `EntityId` might be +// a patient identifier, or for financial records it might be an account +// identifier. This message is used when generalizations or analysis must be +// consistent across multiple rows pertaining to the same entity. +type EntityId struct { + // Composite key indicating which field contains the entity identifier. + Field *FieldId `protobuf:"bytes,1,opt,name=field" json:"field,omitempty"` +} + +func (m *EntityId) Reset() { *m = EntityId{} } +func (m *EntityId) String() string { return proto.CompactTextString(m) } +func (*EntityId) ProtoMessage() {} +func (*EntityId) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{17} } + +func (m *EntityId) GetField() *FieldId { + if m != nil { + return m.Field + } + return nil +} + +func init() { + proto.RegisterType((*InfoType)(nil), "google.privacy.dlp.v2beta1.InfoType") + proto.RegisterType((*CustomInfoType)(nil), "google.privacy.dlp.v2beta1.CustomInfoType") + proto.RegisterType((*CustomInfoType_Dictionary)(nil), "google.privacy.dlp.v2beta1.CustomInfoType.Dictionary") + proto.RegisterType((*CustomInfoType_Dictionary_WordList)(nil), "google.privacy.dlp.v2beta1.CustomInfoType.Dictionary.WordList") + proto.RegisterType((*FieldId)(nil), "google.privacy.dlp.v2beta1.FieldId") + proto.RegisterType((*PartitionId)(nil), "google.privacy.dlp.v2beta1.PartitionId") + proto.RegisterType((*KindExpression)(nil), "google.privacy.dlp.v2beta1.KindExpression") + proto.RegisterType((*PropertyReference)(nil), "google.privacy.dlp.v2beta1.PropertyReference") + proto.RegisterType((*Projection)(nil), "google.privacy.dlp.v2beta1.Projection") + proto.RegisterType((*DatastoreOptions)(nil), "google.privacy.dlp.v2beta1.DatastoreOptions") + proto.RegisterType((*CloudStorageOptions)(nil), "google.privacy.dlp.v2beta1.CloudStorageOptions") + proto.RegisterType((*CloudStorageOptions_FileSet)(nil), "google.privacy.dlp.v2beta1.CloudStorageOptions.FileSet") + proto.RegisterType((*CloudStoragePath)(nil), "google.privacy.dlp.v2beta1.CloudStoragePath") + proto.RegisterType((*BigQueryOptions)(nil), "google.privacy.dlp.v2beta1.BigQueryOptions") + proto.RegisterType((*StorageConfig)(nil), "google.privacy.dlp.v2beta1.StorageConfig") + proto.RegisterType((*CloudStorageKey)(nil), "google.privacy.dlp.v2beta1.CloudStorageKey") + proto.RegisterType((*DatastoreKey)(nil), "google.privacy.dlp.v2beta1.DatastoreKey") + proto.RegisterType((*Key)(nil), "google.privacy.dlp.v2beta1.Key") + proto.RegisterType((*Key_PathElement)(nil), "google.privacy.dlp.v2beta1.Key.PathElement") + proto.RegisterType((*RecordKey)(nil), "google.privacy.dlp.v2beta1.RecordKey") + proto.RegisterType((*BigQueryTable)(nil), "google.privacy.dlp.v2beta1.BigQueryTable") + proto.RegisterType((*EntityId)(nil), "google.privacy.dlp.v2beta1.EntityId") +} + +func init() { proto.RegisterFile("google/privacy/dlp/v2beta1/storage.proto", fileDescriptor1) } + +var fileDescriptor1 = []byte{ + // 1068 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xdd, 0x6e, 0xdc, 0xc4, + 0x17, 0x5f, 0xef, 0xa6, 0xcd, 0xee, 0xd9, 0x7c, 0xba, 0xfd, 0x4b, 0xfb, 0xdf, 0xd2, 0x26, 0x35, + 0x55, 0x1b, 0x1a, 0xf0, 0x8a, 0x20, 0x84, 0x10, 0x22, 0x88, 0xcd, 0x07, 0xbb, 0x04, 0x35, 0xe9, + 0x34, 0x6a, 0x54, 0x08, 0xb2, 0xbc, 0x9e, 0xb1, 0x33, 0xd4, 0xeb, 0x19, 0xec, 0xd9, 0x16, 0xbf, + 0x00, 0xaf, 0xc0, 0x03, 0x70, 0xc7, 0x03, 0x20, 0x71, 0xc5, 0x3d, 0x17, 0x3c, 0x06, 0xe2, 0x31, + 0xd0, 0x7c, 0xd8, 0xeb, 0xa4, 0x61, 0x1b, 0x10, 0x77, 0xe3, 0x33, 0xe7, 0xfc, 0xce, 0x99, 0xdf, + 0xfc, 0xce, 0x19, 0xc3, 0x46, 0xc4, 0x58, 0x14, 0x93, 0x1e, 0x4f, 0xe9, 0x0b, 0x3f, 0xc8, 0x7b, + 0x38, 0xe6, 0xbd, 0x17, 0x5b, 0x23, 0x22, 0xfc, 0x77, 0x7b, 0x99, 0x60, 0xa9, 0x1f, 0x11, 0x97, + 0xa7, 0x4c, 0x30, 0xbb, 0xab, 0x3d, 0x5d, 0xe3, 0xe9, 0xe2, 0x98, 0xbb, 0xc6, 0xb3, 0xfb, 0x86, + 0x41, 0xf1, 0x39, 0xed, 0xf9, 0x49, 0xc2, 0x84, 0x2f, 0x28, 0x4b, 0x32, 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 0xfc, 0x44, 0x37, 0x7c, 0x71, + 0x56, 0x04, 0xcd, 0x90, 0xc6, 0xc4, 0xcb, 0x48, 0xa1, 0xdb, 0x0f, 0x66, 0xea, 0xf6, 0x55, 0x08, + 0x77, 0x9f, 0xc6, 0xe4, 0x09, 0x11, 0x68, 0x3e, 0xd4, 0x8b, 0xee, 0x2d, 0xa9, 0x3c, 0xb5, 0xb4, + 0x57, 0xa0, 0x31, 0x49, 0x63, 0x73, 0xe9, 0x72, 0xe9, 0xdc, 0x87, 0x95, 0x2a, 0xc8, 0x91, 0x2f, + 0xce, 0xe4, 0x95, 0x73, 0x5f, 0x9c, 0x15, 0xda, 0x90, 0x6b, 0xe7, 0x17, 0x0b, 0x96, 0xfb, 0x34, + 0x7a, 0x3c, 0x21, 0x69, 0x3e, 0x2d, 0x76, 0x59, 0xf8, 0xa3, 0x98, 0x78, 0x69, 0x71, 0x95, 0xa6, + 0xe6, 0xb7, 0x66, 0xd5, 0x5c, 0xa0, 0x1c, 0xcb, 0x50, 0xb4, 0xa4, 0x10, 0xa6, 0x72, 0x43, 0x60, + 0x53, 0x4c, 0x12, 0x41, 0xc3, 0x9c, 0x26, 0x91, 0x17, 0xca, 0x96, 0xc9, 0x3a, 0x75, 0x45, 0xf4, + 0x9b, 0xb3, 0x60, 0x4d, 0x73, 0xa1, 0xd5, 0x4a, 0xb8, 0xb2, 0x65, 0xce, 0xcf, 0x75, 0x58, 0x34, + 0xe7, 0xdb, 0x61, 0x49, 0x48, 0x23, 0xfb, 0x2b, 0x58, 0xc5, 0x85, 0xcc, 0x3c, 0xa6, 0x8f, 0x63, + 0x34, 0xf1, 0xf6, 0xac, 0x24, 0x17, 0xb5, 0x39, 0xa8, 0xa1, 0x15, 0x7c, 0x51, 0xaf, 0x04, 0xfe, + 0x17, 0x48, 0x4a, 0x3d, 0x33, 0xcc, 0xcb, 0x04, 0x0d, 0x95, 0xa0, 0xf7, 0x0f, 0x2f, 0x74, 0x50, + 0x43, 0x37, 0x82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google.golang.org/genproto/googleapis/pubsub/v1/pubsub.pb.go b/vendor/google.golang.org/genproto/googleapis/pubsub/v1/pubsub.pb.go new file mode 100644 index 0000000000..0689b3c095 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/pubsub/v1/pubsub.pb.go @@ -0,0 +1,2524 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/pubsub/v1/pubsub.proto + +/* +Package pubsub is a generated protocol buffer package. + +It is generated from these files: + google/pubsub/v1/pubsub.proto + +It has these top-level messages: + Topic + PubsubMessage + GetTopicRequest + UpdateTopicRequest + PublishRequest + PublishResponse + ListTopicsRequest + ListTopicsResponse + ListTopicSubscriptionsRequest + ListTopicSubscriptionsResponse + DeleteTopicRequest + Subscription + PushConfig + ReceivedMessage + GetSubscriptionRequest + UpdateSubscriptionRequest + ListSubscriptionsRequest + ListSubscriptionsResponse + DeleteSubscriptionRequest + ModifyPushConfigRequest + PullRequest + PullResponse + ModifyAckDeadlineRequest + AcknowledgeRequest + StreamingPullRequest + StreamingPullResponse + CreateSnapshotRequest + UpdateSnapshotRequest + Snapshot + ListSnapshotsRequest + ListSnapshotsResponse + DeleteSnapshotRequest + SeekRequest + SeekResponse +*/ +package pubsub + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf1 "github.com/golang/protobuf/ptypes/duration" +import google_protobuf2 "github.com/golang/protobuf/ptypes/empty" +import google_protobuf3 "google.golang.org/genproto/protobuf/field_mask" +import google_protobuf4 "github.com/golang/protobuf/ptypes/timestamp" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// A topic resource. +type Topic struct { + // The name of the topic. It must have the format + // `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, + // and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), + // underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent + // signs (`%`). It must be between 3 and 255 characters in length, and it + // must not start with `"goog"`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // User labels. + Labels map[string]string `protobuf:"bytes,2,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *Topic) Reset() { *m = Topic{} } +func (m *Topic) String() string { return proto.CompactTextString(m) } +func (*Topic) ProtoMessage() {} +func (*Topic) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *Topic) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Topic) GetLabels() map[string]string { + if m != nil { + return m.Labels + } + return nil +} + +// A message data and its attributes. The message payload must not be empty; +// it must contain either a non-empty data field, or at least one attribute. +type PubsubMessage struct { + // The message payload. + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + // Optional attributes for this message. + Attributes map[string]string `protobuf:"bytes,2,rep,name=attributes" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // ID of this message, assigned by the server when the message is published. + // Guaranteed to be unique within the topic. This value may be read by a + // subscriber that receives a `PubsubMessage` via a `Pull` call or a push + // delivery. It must not be populated by the publisher in a `Publish` call. + MessageId string `protobuf:"bytes,3,opt,name=message_id,json=messageId" json:"message_id,omitempty"` + // The time at which the message was published, populated by the server when + // it receives the `Publish` call. It must not be populated by the + // publisher in a `Publish` call. + PublishTime *google_protobuf4.Timestamp `protobuf:"bytes,4,opt,name=publish_time,json=publishTime" json:"publish_time,omitempty"` +} + +func (m *PubsubMessage) Reset() { *m = PubsubMessage{} } +func (m *PubsubMessage) String() string { return proto.CompactTextString(m) } +func (*PubsubMessage) ProtoMessage() {} +func (*PubsubMessage) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *PubsubMessage) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +func (m *PubsubMessage) GetAttributes() map[string]string { + if m != nil { + return m.Attributes + } + return nil +} + +func (m *PubsubMessage) GetMessageId() string { + if m != nil { + return m.MessageId + } + return "" +} + +func (m *PubsubMessage) GetPublishTime() *google_protobuf4.Timestamp { + if m != nil { + return m.PublishTime + } + return nil +} + +// Request for the GetTopic method. +type GetTopicRequest struct { + // The name of the topic to get. + // Format is `projects/{project}/topics/{topic}`. + Topic string `protobuf:"bytes,1,opt,name=topic" json:"topic,omitempty"` +} + +func (m *GetTopicRequest) Reset() { *m = GetTopicRequest{} } +func (m *GetTopicRequest) String() string { return proto.CompactTextString(m) } +func (*GetTopicRequest) ProtoMessage() {} +func (*GetTopicRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *GetTopicRequest) GetTopic() string { + if m != nil { + return m.Topic + } + return "" +} + +// Request for the UpdateTopic method. +type UpdateTopicRequest struct { + // The topic to update. + Topic *Topic `protobuf:"bytes,1,opt,name=topic" json:"topic,omitempty"` + // Indicates which fields in the provided topic to update. + // Must be specified and non-empty. + UpdateMask *google_protobuf3.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask" json:"update_mask,omitempty"` +} + +func (m *UpdateTopicRequest) Reset() { *m = UpdateTopicRequest{} } +func (m *UpdateTopicRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateTopicRequest) ProtoMessage() {} +func (*UpdateTopicRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *UpdateTopicRequest) GetTopic() *Topic { + if m != nil { + return m.Topic + } + return nil +} + +func (m *UpdateTopicRequest) GetUpdateMask() *google_protobuf3.FieldMask { + if m != nil { + return m.UpdateMask + } + return nil +} + +// Request for the Publish method. +type PublishRequest struct { + // The messages in the request will be published on this topic. + // Format is `projects/{project}/topics/{topic}`. + Topic string `protobuf:"bytes,1,opt,name=topic" json:"topic,omitempty"` + // The messages to publish. + Messages []*PubsubMessage `protobuf:"bytes,2,rep,name=messages" json:"messages,omitempty"` +} + +func (m *PublishRequest) Reset() { *m = PublishRequest{} } +func (m *PublishRequest) String() string { return proto.CompactTextString(m) } +func (*PublishRequest) ProtoMessage() {} +func (*PublishRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *PublishRequest) GetTopic() string { + if m != nil { + return m.Topic + } + return "" +} + +func (m *PublishRequest) GetMessages() []*PubsubMessage { + if m != nil { + return m.Messages + } + return nil +} + +// Response for the `Publish` method. +type PublishResponse struct { + // The server-assigned ID of each published message, in the same order as + // the messages in the request. IDs are guaranteed to be unique within + // the topic. + MessageIds []string `protobuf:"bytes,1,rep,name=message_ids,json=messageIds" json:"message_ids,omitempty"` +} + +func (m *PublishResponse) Reset() { *m = PublishResponse{} } +func (m *PublishResponse) String() string { return proto.CompactTextString(m) } +func (*PublishResponse) ProtoMessage() {} +func (*PublishResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *PublishResponse) GetMessageIds() []string { + if m != nil { + return m.MessageIds + } + return nil +} + +// Request for the `ListTopics` method. +type ListTopicsRequest struct { + // The name of the cloud project that topics belong to. + // Format is `projects/{project}`. + Project string `protobuf:"bytes,1,opt,name=project" json:"project,omitempty"` + // Maximum number of topics to return. + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // The value returned by the last `ListTopicsResponse`; indicates that this is + // a continuation of a prior `ListTopics` call, and that the system should + // return the next page of data. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListTopicsRequest) Reset() { *m = ListTopicsRequest{} } +func (m *ListTopicsRequest) String() string { return proto.CompactTextString(m) } +func (*ListTopicsRequest) ProtoMessage() {} +func (*ListTopicsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *ListTopicsRequest) GetProject() string { + if m != nil { + return m.Project + } + return "" +} + +func (m *ListTopicsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListTopicsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// Response for the `ListTopics` method. +type ListTopicsResponse struct { + // The resulting topics. + Topics []*Topic `protobuf:"bytes,1,rep,name=topics" json:"topics,omitempty"` + // If not empty, indicates that there may be more topics that match the + // request; this value should be passed in a new `ListTopicsRequest`. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListTopicsResponse) Reset() { *m = ListTopicsResponse{} } +func (m *ListTopicsResponse) String() string { return proto.CompactTextString(m) } +func (*ListTopicsResponse) ProtoMessage() {} +func (*ListTopicsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *ListTopicsResponse) GetTopics() []*Topic { + if m != nil { + return m.Topics + } + return nil +} + +func (m *ListTopicsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// Request for the `ListTopicSubscriptions` method. +type ListTopicSubscriptionsRequest struct { + // The name of the topic that subscriptions are attached to. + // Format is `projects/{project}/topics/{topic}`. + Topic string `protobuf:"bytes,1,opt,name=topic" json:"topic,omitempty"` + // Maximum number of subscription names to return. + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // The value returned by the last `ListTopicSubscriptionsResponse`; indicates + // that this is a continuation of a prior `ListTopicSubscriptions` call, and + // that the system should return the next page of data. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListTopicSubscriptionsRequest) Reset() { *m = ListTopicSubscriptionsRequest{} } +func (m *ListTopicSubscriptionsRequest) String() string { return proto.CompactTextString(m) } +func (*ListTopicSubscriptionsRequest) ProtoMessage() {} +func (*ListTopicSubscriptionsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *ListTopicSubscriptionsRequest) GetTopic() string { + if m != nil { + return m.Topic + } + return "" +} + +func (m *ListTopicSubscriptionsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListTopicSubscriptionsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// Response for the `ListTopicSubscriptions` method. +type ListTopicSubscriptionsResponse struct { + // The names of the subscriptions that match the request. + Subscriptions []string `protobuf:"bytes,1,rep,name=subscriptions" json:"subscriptions,omitempty"` + // If not empty, indicates that there may be more subscriptions that match + // the request; this value should be passed in a new + // `ListTopicSubscriptionsRequest` to get more subscriptions. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListTopicSubscriptionsResponse) Reset() { *m = ListTopicSubscriptionsResponse{} } +func (m *ListTopicSubscriptionsResponse) String() string { return proto.CompactTextString(m) } +func (*ListTopicSubscriptionsResponse) ProtoMessage() {} +func (*ListTopicSubscriptionsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *ListTopicSubscriptionsResponse) GetSubscriptions() []string { + if m != nil { + return m.Subscriptions + } + return nil +} + +func (m *ListTopicSubscriptionsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// Request for the `DeleteTopic` method. +type DeleteTopicRequest struct { + // Name of the topic to delete. + // Format is `projects/{project}/topics/{topic}`. + Topic string `protobuf:"bytes,1,opt,name=topic" json:"topic,omitempty"` +} + +func (m *DeleteTopicRequest) Reset() { *m = DeleteTopicRequest{} } +func (m *DeleteTopicRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteTopicRequest) ProtoMessage() {} +func (*DeleteTopicRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *DeleteTopicRequest) GetTopic() string { + if m != nil { + return m.Topic + } + return "" +} + +// A subscription resource. +type Subscription struct { + // The name of the subscription. It must have the format + // `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must + // start with a letter, and contain only letters (`[A-Za-z]`), numbers + // (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), + // plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters + // in length, and it must not start with `"goog"`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The name of the topic from which this subscription is receiving messages. + // Format is `projects/{project}/topics/{topic}`. + // The value of this field will be `_deleted-topic_` if the topic has been + // deleted. + Topic string `protobuf:"bytes,2,opt,name=topic" json:"topic,omitempty"` + // If push delivery is used with this subscription, this field is + // used to configure it. An empty `pushConfig` signifies that the subscriber + // will pull and ack messages using API methods. + PushConfig *PushConfig `protobuf:"bytes,4,opt,name=push_config,json=pushConfig" json:"push_config,omitempty"` + // This value is the maximum time after a subscriber receives a message + // before the subscriber should acknowledge the message. After message + // delivery but before the ack deadline expires and before the message is + // acknowledged, it is an outstanding message and will not be delivered + // again during that time (on a best-effort basis). + // + // For pull subscriptions, this value is used as the initial value for the ack + // deadline. To override this value for a given message, call + // `ModifyAckDeadline` with the corresponding `ack_id` if using + // pull. + // The minimum custom deadline you can specify is 10 seconds. + // The maximum custom deadline you can specify is 600 seconds (10 minutes). + // If this parameter is 0, a default value of 10 seconds is used. + // + // For push delivery, this value is also used to set the request timeout for + // the call to the push endpoint. + // + // If the subscriber never acknowledges the message, the Pub/Sub + // system will eventually redeliver the message. + AckDeadlineSeconds int32 `protobuf:"varint,5,opt,name=ack_deadline_seconds,json=ackDeadlineSeconds" json:"ack_deadline_seconds,omitempty"` + // Indicates whether to retain acknowledged messages. If true, then + // messages are not expunged from the subscription's backlog, even if they are + // acknowledged, until they fall out of the `message_retention_duration` + // window. + RetainAckedMessages bool `protobuf:"varint,7,opt,name=retain_acked_messages,json=retainAckedMessages" json:"retain_acked_messages,omitempty"` + // How long to retain unacknowledged messages in the subscription's backlog, + // from the moment a message is published. + // If `retain_acked_messages` is true, then this also configures the retention + // of acknowledged messages, and thus configures how far back in time a `Seek` + // can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10 + // minutes. + MessageRetentionDuration *google_protobuf1.Duration `protobuf:"bytes,8,opt,name=message_retention_duration,json=messageRetentionDuration" json:"message_retention_duration,omitempty"` + // User labels. + Labels map[string]string `protobuf:"bytes,9,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *Subscription) Reset() { *m = Subscription{} } +func (m *Subscription) String() string { return proto.CompactTextString(m) } +func (*Subscription) ProtoMessage() {} +func (*Subscription) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } + +func (m *Subscription) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Subscription) GetTopic() string { + if m != nil { + return m.Topic + } + return "" +} + +func (m *Subscription) GetPushConfig() *PushConfig { + if m != nil { + return m.PushConfig + } + return nil +} + +func (m *Subscription) GetAckDeadlineSeconds() int32 { + if m != nil { + return m.AckDeadlineSeconds + } + return 0 +} + +func (m *Subscription) GetRetainAckedMessages() bool { + if m != nil { + return m.RetainAckedMessages + } + return false +} + +func (m *Subscription) GetMessageRetentionDuration() *google_protobuf1.Duration { + if m != nil { + return m.MessageRetentionDuration + } + return nil +} + +func (m *Subscription) GetLabels() map[string]string { + if m != nil { + return m.Labels + } + return nil +} + +// Configuration for a push delivery endpoint. +type PushConfig struct { + // A URL locating the endpoint to which messages should be pushed. + // For example, a Webhook endpoint might use "https://example.com/push". + PushEndpoint string `protobuf:"bytes,1,opt,name=push_endpoint,json=pushEndpoint" json:"push_endpoint,omitempty"` + // Endpoint configuration attributes. + // + // Every endpoint has a set of API supported attributes that can be used to + // control different aspects of the message delivery. + // + // The currently supported attribute is `x-goog-version`, which you can + // use to change the format of the pushed message. This attribute + // indicates the version of the data expected by the endpoint. This + // controls the shape of the pushed message (i.e., its fields and metadata). + // The endpoint version is based on the version of the Pub/Sub API. + // + // If not present during the `CreateSubscription` call, it will default to + // the version of the API used to make such call. If not present during a + // `ModifyPushConfig` call, its value will not be changed. `GetSubscription` + // calls will always return a valid version, even if the subscription was + // created without this attribute. + // + // The possible values for this attribute are: + // + // * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. + // * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. + Attributes map[string]string `protobuf:"bytes,2,rep,name=attributes" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *PushConfig) Reset() { *m = PushConfig{} } +func (m *PushConfig) String() string { return proto.CompactTextString(m) } +func (*PushConfig) ProtoMessage() {} +func (*PushConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } + +func (m *PushConfig) GetPushEndpoint() string { + if m != nil { + return m.PushEndpoint + } + return "" +} + +func (m *PushConfig) GetAttributes() map[string]string { + if m != nil { + return m.Attributes + } + return nil +} + +// A message and its corresponding acknowledgment ID. +type ReceivedMessage struct { + // This ID can be used to acknowledge the received message. + AckId string `protobuf:"bytes,1,opt,name=ack_id,json=ackId" json:"ack_id,omitempty"` + // The message. + Message *PubsubMessage `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"` +} + +func (m *ReceivedMessage) Reset() { *m = ReceivedMessage{} } +func (m *ReceivedMessage) String() string { return proto.CompactTextString(m) } +func (*ReceivedMessage) ProtoMessage() {} +func (*ReceivedMessage) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } + +func (m *ReceivedMessage) GetAckId() string { + if m != nil { + return m.AckId + } + return "" +} + +func (m *ReceivedMessage) GetMessage() *PubsubMessage { + if m != nil { + return m.Message + } + return nil +} + +// Request for the GetSubscription method. +type GetSubscriptionRequest struct { + // The name of the subscription to get. + // Format is `projects/{project}/subscriptions/{sub}`. + Subscription string `protobuf:"bytes,1,opt,name=subscription" json:"subscription,omitempty"` +} + +func (m *GetSubscriptionRequest) Reset() { *m = GetSubscriptionRequest{} } +func (m *GetSubscriptionRequest) String() string { return proto.CompactTextString(m) } +func (*GetSubscriptionRequest) ProtoMessage() {} +func (*GetSubscriptionRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } + +func (m *GetSubscriptionRequest) GetSubscription() string { + if m != nil { + return m.Subscription + } + return "" +} + +// Request for the UpdateSubscription method. +type UpdateSubscriptionRequest struct { + // The updated subscription object. + Subscription *Subscription `protobuf:"bytes,1,opt,name=subscription" json:"subscription,omitempty"` + // Indicates which fields in the provided subscription to update. + // Must be specified and non-empty. + UpdateMask *google_protobuf3.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask" json:"update_mask,omitempty"` +} + +func (m *UpdateSubscriptionRequest) Reset() { *m = UpdateSubscriptionRequest{} } +func (m *UpdateSubscriptionRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateSubscriptionRequest) ProtoMessage() {} +func (*UpdateSubscriptionRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } + +func (m *UpdateSubscriptionRequest) GetSubscription() *Subscription { + if m != nil { + return m.Subscription + } + return nil +} + +func (m *UpdateSubscriptionRequest) GetUpdateMask() *google_protobuf3.FieldMask { + if m != nil { + return m.UpdateMask + } + return nil +} + +// Request for the `ListSubscriptions` method. +type ListSubscriptionsRequest struct { + // The name of the cloud project that subscriptions belong to. + // Format is `projects/{project}`. + Project string `protobuf:"bytes,1,opt,name=project" json:"project,omitempty"` + // Maximum number of subscriptions to return. + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // The value returned by the last `ListSubscriptionsResponse`; indicates that + // this is a continuation of a prior `ListSubscriptions` call, and that the + // system should return the next page of data. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListSubscriptionsRequest) Reset() { *m = ListSubscriptionsRequest{} } +func (m *ListSubscriptionsRequest) String() string { return proto.CompactTextString(m) } +func (*ListSubscriptionsRequest) ProtoMessage() {} +func (*ListSubscriptionsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} } + +func (m *ListSubscriptionsRequest) GetProject() string { + if m != nil { + return m.Project + } + return "" +} + +func (m *ListSubscriptionsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListSubscriptionsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// Response for the `ListSubscriptions` method. +type ListSubscriptionsResponse struct { + // The subscriptions that match the request. + Subscriptions []*Subscription `protobuf:"bytes,1,rep,name=subscriptions" json:"subscriptions,omitempty"` + // If not empty, indicates that there may be more subscriptions that match + // the request; this value should be passed in a new + // `ListSubscriptionsRequest` to get more subscriptions. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListSubscriptionsResponse) Reset() { *m = ListSubscriptionsResponse{} } +func (m *ListSubscriptionsResponse) String() string { return proto.CompactTextString(m) } +func (*ListSubscriptionsResponse) ProtoMessage() {} +func (*ListSubscriptionsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17} } + +func (m *ListSubscriptionsResponse) GetSubscriptions() []*Subscription { + if m != nil { + return m.Subscriptions + } + return nil +} + +func (m *ListSubscriptionsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// Request for the DeleteSubscription method. +type DeleteSubscriptionRequest struct { + // The subscription to delete. + // Format is `projects/{project}/subscriptions/{sub}`. + Subscription string `protobuf:"bytes,1,opt,name=subscription" json:"subscription,omitempty"` +} + +func (m *DeleteSubscriptionRequest) Reset() { *m = DeleteSubscriptionRequest{} } +func (m *DeleteSubscriptionRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteSubscriptionRequest) ProtoMessage() {} +func (*DeleteSubscriptionRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{18} } + +func (m *DeleteSubscriptionRequest) GetSubscription() string { + if m != nil { + return m.Subscription + } + return "" +} + +// Request for the ModifyPushConfig method. +type ModifyPushConfigRequest struct { + // The name of the subscription. + // Format is `projects/{project}/subscriptions/{sub}`. + Subscription string `protobuf:"bytes,1,opt,name=subscription" json:"subscription,omitempty"` + // The push configuration for future deliveries. + // + // An empty `pushConfig` indicates that the Pub/Sub system should + // stop pushing messages from the given subscription and allow + // messages to be pulled and acknowledged - effectively pausing + // the subscription if `Pull` is not called. + PushConfig *PushConfig `protobuf:"bytes,2,opt,name=push_config,json=pushConfig" json:"push_config,omitempty"` +} + +func (m *ModifyPushConfigRequest) Reset() { *m = ModifyPushConfigRequest{} } +func (m *ModifyPushConfigRequest) String() string { return proto.CompactTextString(m) } +func (*ModifyPushConfigRequest) ProtoMessage() {} +func (*ModifyPushConfigRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{19} } + +func (m *ModifyPushConfigRequest) GetSubscription() string { + if m != nil { + return m.Subscription + } + return "" +} + +func (m *ModifyPushConfigRequest) GetPushConfig() *PushConfig { + if m != nil { + return m.PushConfig + } + return nil +} + +// Request for the `Pull` method. +type PullRequest struct { + // The subscription from which messages should be pulled. + // Format is `projects/{project}/subscriptions/{sub}`. + Subscription string `protobuf:"bytes,1,opt,name=subscription" json:"subscription,omitempty"` + // If this field set to true, the system will respond immediately even if + // it there are no messages available to return in the `Pull` response. + // Otherwise, the system may wait (for a bounded amount of time) until at + // least one message is available, rather than returning no messages. The + // client may cancel the request if it does not wish to wait any longer for + // the response. + ReturnImmediately bool `protobuf:"varint,2,opt,name=return_immediately,json=returnImmediately" json:"return_immediately,omitempty"` + // The maximum number of messages returned for this request. The Pub/Sub + // system may return fewer than the number specified. + MaxMessages int32 `protobuf:"varint,3,opt,name=max_messages,json=maxMessages" json:"max_messages,omitempty"` +} + +func (m *PullRequest) Reset() { *m = PullRequest{} } +func (m *PullRequest) String() string { return proto.CompactTextString(m) } +func (*PullRequest) ProtoMessage() {} +func (*PullRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20} } + +func (m *PullRequest) GetSubscription() string { + if m != nil { + return m.Subscription + } + return "" +} + +func (m *PullRequest) GetReturnImmediately() bool { + if m != nil { + return m.ReturnImmediately + } + return false +} + +func (m *PullRequest) GetMaxMessages() int32 { + if m != nil { + return m.MaxMessages + } + return 0 +} + +// Response for the `Pull` method. +type PullResponse struct { + // Received Pub/Sub messages. The Pub/Sub system will return zero messages if + // there are no more available in the backlog. The Pub/Sub system may return + // fewer than the `maxMessages` requested even if there are more messages + // available in the backlog. + ReceivedMessages []*ReceivedMessage `protobuf:"bytes,1,rep,name=received_messages,json=receivedMessages" json:"received_messages,omitempty"` +} + +func (m *PullResponse) Reset() { *m = PullResponse{} } +func (m *PullResponse) String() string { return proto.CompactTextString(m) } +func (*PullResponse) ProtoMessage() {} +func (*PullResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{21} } + +func (m *PullResponse) GetReceivedMessages() []*ReceivedMessage { + if m != nil { + return m.ReceivedMessages + } + return nil +} + +// Request for the ModifyAckDeadline method. +type ModifyAckDeadlineRequest struct { + // The name of the subscription. + // Format is `projects/{project}/subscriptions/{sub}`. + Subscription string `protobuf:"bytes,1,opt,name=subscription" json:"subscription,omitempty"` + // List of acknowledgment IDs. + AckIds []string `protobuf:"bytes,4,rep,name=ack_ids,json=ackIds" json:"ack_ids,omitempty"` + // The new ack deadline with respect to the time this request was sent to + // the Pub/Sub system. For example, if the value is 10, the new + // ack deadline will expire 10 seconds after the `ModifyAckDeadline` call + // was made. Specifying zero may immediately make the message available for + // another pull request. + // The minimum deadline you can specify is 0 seconds. + // The maximum deadline you can specify is 600 seconds (10 minutes). + AckDeadlineSeconds int32 `protobuf:"varint,3,opt,name=ack_deadline_seconds,json=ackDeadlineSeconds" json:"ack_deadline_seconds,omitempty"` +} + +func (m *ModifyAckDeadlineRequest) Reset() { *m = ModifyAckDeadlineRequest{} } +func (m *ModifyAckDeadlineRequest) String() string { return proto.CompactTextString(m) } +func (*ModifyAckDeadlineRequest) ProtoMessage() {} +func (*ModifyAckDeadlineRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{22} } + +func (m *ModifyAckDeadlineRequest) GetSubscription() string { + if m != nil { + return m.Subscription + } + return "" +} + +func (m *ModifyAckDeadlineRequest) GetAckIds() []string { + if m != nil { + return m.AckIds + } + return nil +} + +func (m *ModifyAckDeadlineRequest) GetAckDeadlineSeconds() int32 { + if m != nil { + return m.AckDeadlineSeconds + } + return 0 +} + +// Request for the Acknowledge method. +type AcknowledgeRequest struct { + // The subscription whose message is being acknowledged. + // Format is `projects/{project}/subscriptions/{sub}`. + Subscription string `protobuf:"bytes,1,opt,name=subscription" json:"subscription,omitempty"` + // The acknowledgment ID for the messages being acknowledged that was returned + // by the Pub/Sub system in the `Pull` response. Must not be empty. + AckIds []string `protobuf:"bytes,2,rep,name=ack_ids,json=ackIds" json:"ack_ids,omitempty"` +} + +func (m *AcknowledgeRequest) Reset() { *m = AcknowledgeRequest{} } +func (m *AcknowledgeRequest) String() string { return proto.CompactTextString(m) } +func (*AcknowledgeRequest) ProtoMessage() {} +func (*AcknowledgeRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{23} } + +func (m *AcknowledgeRequest) GetSubscription() string { + if m != nil { + return m.Subscription + } + return "" +} + +func (m *AcknowledgeRequest) GetAckIds() []string { + if m != nil { + return m.AckIds + } + return nil +} + +// Request for the `StreamingPull` streaming RPC method. This request is used to +// establish the initial stream as well as to stream acknowledgements and ack +// deadline modifications from the client to the server. +type StreamingPullRequest struct { + // The subscription for which to initialize the new stream. This must be + // provided in the first request on the stream, and must not be set in + // subsequent requests from client to server. + // Format is `projects/{project}/subscriptions/{sub}`. + Subscription string `protobuf:"bytes,1,opt,name=subscription" json:"subscription,omitempty"` + // List of acknowledgement IDs for acknowledging previously received messages + // (received on this stream or a different stream). If an ack ID has expired, + // the corresponding message may be redelivered later. Acknowledging a message + // more than once will not result in an error. If the acknowledgement ID is + // malformed, the stream will be aborted with status `INVALID_ARGUMENT`. + AckIds []string `protobuf:"bytes,2,rep,name=ack_ids,json=ackIds" json:"ack_ids,omitempty"` + // The list of new ack deadlines for the IDs listed in + // `modify_deadline_ack_ids`. The size of this list must be the same as the + // size of `modify_deadline_ack_ids`. If it differs the stream will be aborted + // with `INVALID_ARGUMENT`. Each element in this list is applied to the + // element in the same position in `modify_deadline_ack_ids`. The new ack + // deadline is with respect to the time this request was sent to the Pub/Sub + // system. Must be >= 0. For example, if the value is 10, the new ack deadline + // will expire 10 seconds after this request is received. If the value is 0, + // the message is immediately made available for another streaming or + // non-streaming pull request. If the value is < 0 (an error), the stream will + // be aborted with status `INVALID_ARGUMENT`. + ModifyDeadlineSeconds []int32 `protobuf:"varint,3,rep,packed,name=modify_deadline_seconds,json=modifyDeadlineSeconds" json:"modify_deadline_seconds,omitempty"` + // List of acknowledgement IDs whose deadline will be modified based on the + // corresponding element in `modify_deadline_seconds`. This field can be used + // to indicate that more time is needed to process a message by the + // subscriber, or to make the message available for redelivery if the + // processing was interrupted. + ModifyDeadlineAckIds []string `protobuf:"bytes,4,rep,name=modify_deadline_ack_ids,json=modifyDeadlineAckIds" json:"modify_deadline_ack_ids,omitempty"` + // The ack deadline to use for the stream. This must be provided in the + // first request on the stream, but it can also be updated on subsequent + // requests from client to server. The minimum deadline you can specify is 10 + // seconds. The maximum deadline you can specify is 600 seconds (10 minutes). + StreamAckDeadlineSeconds int32 `protobuf:"varint,5,opt,name=stream_ack_deadline_seconds,json=streamAckDeadlineSeconds" json:"stream_ack_deadline_seconds,omitempty"` +} + +func (m *StreamingPullRequest) Reset() { *m = StreamingPullRequest{} } +func (m *StreamingPullRequest) String() string { return proto.CompactTextString(m) } +func (*StreamingPullRequest) ProtoMessage() {} +func (*StreamingPullRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{24} } + +func (m *StreamingPullRequest) GetSubscription() string { + if m != nil { + return m.Subscription + } + return "" +} + +func (m *StreamingPullRequest) GetAckIds() []string { + if m != nil { + return m.AckIds + } + return nil +} + +func (m *StreamingPullRequest) GetModifyDeadlineSeconds() []int32 { + if m != nil { + return m.ModifyDeadlineSeconds + } + return nil +} + +func (m *StreamingPullRequest) GetModifyDeadlineAckIds() []string { + if m != nil { + return m.ModifyDeadlineAckIds + } + return nil +} + +func (m *StreamingPullRequest) GetStreamAckDeadlineSeconds() int32 { + if m != nil { + return m.StreamAckDeadlineSeconds + } + return 0 +} + +// Response for the `StreamingPull` method. This response is used to stream +// messages from the server to the client. +type StreamingPullResponse struct { + // Received Pub/Sub messages. This will not be empty. + ReceivedMessages []*ReceivedMessage `protobuf:"bytes,1,rep,name=received_messages,json=receivedMessages" json:"received_messages,omitempty"` +} + +func (m *StreamingPullResponse) Reset() { *m = StreamingPullResponse{} } +func (m *StreamingPullResponse) String() string { return proto.CompactTextString(m) } +func (*StreamingPullResponse) ProtoMessage() {} +func (*StreamingPullResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{25} } + +func (m *StreamingPullResponse) GetReceivedMessages() []*ReceivedMessage { + if m != nil { + return m.ReceivedMessages + } + return nil +} + +// Request for the `CreateSnapshot` method. +type CreateSnapshotRequest struct { + // Optional user-provided name for this snapshot. + // If the name is not provided in the request, the server will assign a random + // name for this snapshot on the same project as the subscription. + // Note that for REST API requests, you must specify a name. + // Format is `projects/{project}/snapshots/{snap}`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The subscription whose backlog the snapshot retains. + // Specifically, the created snapshot is guaranteed to retain: + // (a) The existing backlog on the subscription. More precisely, this is + // defined as the messages in the subscription's backlog that are + // unacknowledged upon the successful completion of the + // `CreateSnapshot` request; as well as: + // (b) Any messages published to the subscription's topic following the + // successful completion of the CreateSnapshot request. + // Format is `projects/{project}/subscriptions/{sub}`. + Subscription string `protobuf:"bytes,2,opt,name=subscription" json:"subscription,omitempty"` +} + +func (m *CreateSnapshotRequest) Reset() { *m = CreateSnapshotRequest{} } +func (m *CreateSnapshotRequest) String() string { return proto.CompactTextString(m) } +func (*CreateSnapshotRequest) ProtoMessage() {} +func (*CreateSnapshotRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{26} } + +func (m *CreateSnapshotRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *CreateSnapshotRequest) GetSubscription() string { + if m != nil { + return m.Subscription + } + return "" +} + +// Request for the UpdateSnapshot method. +type UpdateSnapshotRequest struct { + // The updated snpashot object. + Snapshot *Snapshot `protobuf:"bytes,1,opt,name=snapshot" json:"snapshot,omitempty"` + // Indicates which fields in the provided snapshot to update. + // Must be specified and non-empty. + UpdateMask *google_protobuf3.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask" json:"update_mask,omitempty"` +} + +func (m *UpdateSnapshotRequest) Reset() { *m = UpdateSnapshotRequest{} } +func (m *UpdateSnapshotRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateSnapshotRequest) ProtoMessage() {} +func (*UpdateSnapshotRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{27} } + +func (m *UpdateSnapshotRequest) GetSnapshot() *Snapshot { + if m != nil { + return m.Snapshot + } + return nil +} + +func (m *UpdateSnapshotRequest) GetUpdateMask() *google_protobuf3.FieldMask { + if m != nil { + return m.UpdateMask + } + return nil +} + +// A snapshot resource. +type Snapshot struct { + // The name of the snapshot. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The name of the topic from which this snapshot is retaining messages. + Topic string `protobuf:"bytes,2,opt,name=topic" json:"topic,omitempty"` + // The snapshot is guaranteed to exist up until this time. + // A newly-created snapshot expires no later than 7 days from the time of its + // creation. Its exact lifetime is determined at creation by the existing + // backlog in the source subscription. Specifically, the lifetime of the + // snapshot is `7 days - (age of oldest unacked message in the subscription)`. + // For example, consider a subscription whose oldest unacked message is 3 days + // old. If a snapshot is created from this subscription, the snapshot -- which + // will always capture this 3-day-old backlog as long as the snapshot + // exists -- will expire in 4 days. + ExpireTime *google_protobuf4.Timestamp `protobuf:"bytes,3,opt,name=expire_time,json=expireTime" json:"expire_time,omitempty"` + // User labels. + Labels map[string]string `protobuf:"bytes,4,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *Snapshot) Reset() { *m = Snapshot{} } +func (m *Snapshot) String() string { return proto.CompactTextString(m) } +func (*Snapshot) ProtoMessage() {} +func (*Snapshot) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{28} } + +func (m *Snapshot) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Snapshot) GetTopic() string { + if m != nil { + return m.Topic + } + return "" +} + +func (m *Snapshot) GetExpireTime() *google_protobuf4.Timestamp { + if m != nil { + return m.ExpireTime + } + return nil +} + +func (m *Snapshot) GetLabels() map[string]string { + if m != nil { + return m.Labels + } + return nil +} + +// Request for the `ListSnapshots` method. +type ListSnapshotsRequest struct { + // The name of the cloud project that snapshots belong to. + // Format is `projects/{project}`. + Project string `protobuf:"bytes,1,opt,name=project" json:"project,omitempty"` + // Maximum number of snapshots to return. + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // The value returned by the last `ListSnapshotsResponse`; indicates that this + // is a continuation of a prior `ListSnapshots` call, and that the system + // should return the next page of data. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListSnapshotsRequest) Reset() { *m = ListSnapshotsRequest{} } +func (m *ListSnapshotsRequest) String() string { return proto.CompactTextString(m) } +func (*ListSnapshotsRequest) ProtoMessage() {} +func (*ListSnapshotsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{29} } + +func (m *ListSnapshotsRequest) GetProject() string { + if m != nil { + return m.Project + } + return "" +} + +func (m *ListSnapshotsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListSnapshotsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// Response for the `ListSnapshots` method. +type ListSnapshotsResponse struct { + // The resulting snapshots. + Snapshots []*Snapshot `protobuf:"bytes,1,rep,name=snapshots" json:"snapshots,omitempty"` + // If not empty, indicates that there may be more snapshot that match the + // request; this value should be passed in a new `ListSnapshotsRequest`. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListSnapshotsResponse) Reset() { *m = ListSnapshotsResponse{} } +func (m *ListSnapshotsResponse) String() string { return proto.CompactTextString(m) } +func (*ListSnapshotsResponse) ProtoMessage() {} +func (*ListSnapshotsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{30} } + +func (m *ListSnapshotsResponse) GetSnapshots() []*Snapshot { + if m != nil { + return m.Snapshots + } + return nil +} + +func (m *ListSnapshotsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// Request for the `DeleteSnapshot` method. +type DeleteSnapshotRequest struct { + // The name of the snapshot to delete. + // Format is `projects/{project}/snapshots/{snap}`. + Snapshot string `protobuf:"bytes,1,opt,name=snapshot" json:"snapshot,omitempty"` +} + +func (m *DeleteSnapshotRequest) Reset() { *m = DeleteSnapshotRequest{} } +func (m *DeleteSnapshotRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteSnapshotRequest) ProtoMessage() {} +func (*DeleteSnapshotRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{31} } + +func (m *DeleteSnapshotRequest) GetSnapshot() string { + if m != nil { + return m.Snapshot + } + return "" +} + +// Request for the `Seek` method. +type SeekRequest struct { + // The subscription to affect. + Subscription string `protobuf:"bytes,1,opt,name=subscription" json:"subscription,omitempty"` + // Types that are valid to be assigned to Target: + // *SeekRequest_Time + // *SeekRequest_Snapshot + Target isSeekRequest_Target `protobuf_oneof:"target"` +} + +func (m *SeekRequest) Reset() { *m = SeekRequest{} } +func (m *SeekRequest) String() string { return proto.CompactTextString(m) } +func (*SeekRequest) ProtoMessage() {} +func (*SeekRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{32} } + +type isSeekRequest_Target interface { + isSeekRequest_Target() +} + +type SeekRequest_Time struct { + Time *google_protobuf4.Timestamp `protobuf:"bytes,2,opt,name=time,oneof"` +} +type SeekRequest_Snapshot struct { + Snapshot string `protobuf:"bytes,3,opt,name=snapshot,oneof"` +} + +func (*SeekRequest_Time) isSeekRequest_Target() {} +func (*SeekRequest_Snapshot) isSeekRequest_Target() {} + +func (m *SeekRequest) GetTarget() isSeekRequest_Target { + if m != nil { + return m.Target + } + return nil +} + +func (m *SeekRequest) GetSubscription() string { + if m != nil { + return m.Subscription + } + return "" +} + +func (m *SeekRequest) GetTime() *google_protobuf4.Timestamp { + if x, ok := m.GetTarget().(*SeekRequest_Time); ok { + return x.Time + } + return nil +} + +func (m *SeekRequest) GetSnapshot() string { + if x, ok := m.GetTarget().(*SeekRequest_Snapshot); ok { + return x.Snapshot + } + return "" +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*SeekRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _SeekRequest_OneofMarshaler, _SeekRequest_OneofUnmarshaler, _SeekRequest_OneofSizer, []interface{}{ + (*SeekRequest_Time)(nil), + (*SeekRequest_Snapshot)(nil), + } +} + +func _SeekRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*SeekRequest) + // target + switch x := m.Target.(type) { + case *SeekRequest_Time: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Time); err != nil { + return err + } + case *SeekRequest_Snapshot: + b.EncodeVarint(3<<3 | proto.WireBytes) + b.EncodeStringBytes(x.Snapshot) + case nil: + default: + return fmt.Errorf("SeekRequest.Target has unexpected type %T", x) + } + return nil +} + +func _SeekRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*SeekRequest) + switch tag { + case 2: // target.time + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(google_protobuf4.Timestamp) + err := b.DecodeMessage(msg) + m.Target = &SeekRequest_Time{msg} + return true, err + case 3: // target.snapshot + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Target = &SeekRequest_Snapshot{x} + return true, err + default: + return false, nil + } +} + +func _SeekRequest_OneofSizer(msg proto.Message) (n int) { + m := msg.(*SeekRequest) + // target + switch x := m.Target.(type) { + case *SeekRequest_Time: + s := proto.Size(x.Time) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *SeekRequest_Snapshot: + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Snapshot))) + n += len(x.Snapshot) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +type SeekResponse struct { +} + +func (m *SeekResponse) Reset() { *m = SeekResponse{} } +func (m *SeekResponse) String() string { return proto.CompactTextString(m) } +func (*SeekResponse) ProtoMessage() {} +func (*SeekResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{33} } + +func init() { + proto.RegisterType((*Topic)(nil), "google.pubsub.v1.Topic") + proto.RegisterType((*PubsubMessage)(nil), "google.pubsub.v1.PubsubMessage") + proto.RegisterType((*GetTopicRequest)(nil), "google.pubsub.v1.GetTopicRequest") + proto.RegisterType((*UpdateTopicRequest)(nil), "google.pubsub.v1.UpdateTopicRequest") + proto.RegisterType((*PublishRequest)(nil), "google.pubsub.v1.PublishRequest") + proto.RegisterType((*PublishResponse)(nil), "google.pubsub.v1.PublishResponse") + proto.RegisterType((*ListTopicsRequest)(nil), "google.pubsub.v1.ListTopicsRequest") + proto.RegisterType((*ListTopicsResponse)(nil), "google.pubsub.v1.ListTopicsResponse") + proto.RegisterType((*ListTopicSubscriptionsRequest)(nil), "google.pubsub.v1.ListTopicSubscriptionsRequest") + proto.RegisterType((*ListTopicSubscriptionsResponse)(nil), "google.pubsub.v1.ListTopicSubscriptionsResponse") + proto.RegisterType((*DeleteTopicRequest)(nil), "google.pubsub.v1.DeleteTopicRequest") + proto.RegisterType((*Subscription)(nil), "google.pubsub.v1.Subscription") + proto.RegisterType((*PushConfig)(nil), "google.pubsub.v1.PushConfig") + proto.RegisterType((*ReceivedMessage)(nil), "google.pubsub.v1.ReceivedMessage") + proto.RegisterType((*GetSubscriptionRequest)(nil), "google.pubsub.v1.GetSubscriptionRequest") + proto.RegisterType((*UpdateSubscriptionRequest)(nil), "google.pubsub.v1.UpdateSubscriptionRequest") + proto.RegisterType((*ListSubscriptionsRequest)(nil), "google.pubsub.v1.ListSubscriptionsRequest") + proto.RegisterType((*ListSubscriptionsResponse)(nil), "google.pubsub.v1.ListSubscriptionsResponse") + proto.RegisterType((*DeleteSubscriptionRequest)(nil), "google.pubsub.v1.DeleteSubscriptionRequest") + proto.RegisterType((*ModifyPushConfigRequest)(nil), "google.pubsub.v1.ModifyPushConfigRequest") + proto.RegisterType((*PullRequest)(nil), "google.pubsub.v1.PullRequest") + proto.RegisterType((*PullResponse)(nil), "google.pubsub.v1.PullResponse") + proto.RegisterType((*ModifyAckDeadlineRequest)(nil), "google.pubsub.v1.ModifyAckDeadlineRequest") + proto.RegisterType((*AcknowledgeRequest)(nil), "google.pubsub.v1.AcknowledgeRequest") + proto.RegisterType((*StreamingPullRequest)(nil), "google.pubsub.v1.StreamingPullRequest") + proto.RegisterType((*StreamingPullResponse)(nil), "google.pubsub.v1.StreamingPullResponse") + proto.RegisterType((*CreateSnapshotRequest)(nil), "google.pubsub.v1.CreateSnapshotRequest") + proto.RegisterType((*UpdateSnapshotRequest)(nil), "google.pubsub.v1.UpdateSnapshotRequest") + proto.RegisterType((*Snapshot)(nil), "google.pubsub.v1.Snapshot") + proto.RegisterType((*ListSnapshotsRequest)(nil), "google.pubsub.v1.ListSnapshotsRequest") + proto.RegisterType((*ListSnapshotsResponse)(nil), "google.pubsub.v1.ListSnapshotsResponse") + proto.RegisterType((*DeleteSnapshotRequest)(nil), "google.pubsub.v1.DeleteSnapshotRequest") + proto.RegisterType((*SeekRequest)(nil), "google.pubsub.v1.SeekRequest") + proto.RegisterType((*SeekResponse)(nil), "google.pubsub.v1.SeekResponse") +} + +// 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 + +// Client API for Subscriber service + +type SubscriberClient interface { + // Creates a subscription to a given topic. + // If the subscription already exists, returns `ALREADY_EXISTS`. + // If the corresponding topic doesn't exist, returns `NOT_FOUND`. + // + // If the name is not provided in the request, the server will assign a random + // name for this subscription on the same project as the topic, conforming + // to the + // [resource name format](https://cloud.google.com/pubsub/docs/overview#names). + // The generated name is populated in the returned Subscription object. + // Note that for REST API requests, you must specify a name in the request. + CreateSubscription(ctx context.Context, in *Subscription, opts ...grpc.CallOption) (*Subscription, error) + // Gets the configuration details of a subscription. + GetSubscription(ctx context.Context, in *GetSubscriptionRequest, opts ...grpc.CallOption) (*Subscription, error) + // Updates an existing subscription. Note that certain properties of a + // subscription, such as its topic, are not modifiable. + // NOTE: The style guide requires body: "subscription" instead of body: "*". + // Keeping the latter for internal consistency in V1, however it should be + // corrected in V2. See + // https://cloud.google.com/apis/design/standard_methods#update for details. + UpdateSubscription(ctx context.Context, in *UpdateSubscriptionRequest, opts ...grpc.CallOption) (*Subscription, error) + // Lists matching subscriptions. + ListSubscriptions(ctx context.Context, in *ListSubscriptionsRequest, opts ...grpc.CallOption) (*ListSubscriptionsResponse, error) + // Deletes an existing subscription. All messages retained in the subscription + // are immediately dropped. Calls to `Pull` after deletion will return + // `NOT_FOUND`. After a subscription is deleted, a new one may be created with + // the same name, but the new one has no association with the old + // subscription or its topic unless the same topic is specified. + DeleteSubscription(ctx context.Context, in *DeleteSubscriptionRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) + // Modifies the ack deadline for a specific message. This method is useful + // to indicate that more time is needed to process a message by the + // subscriber, or to make the message available for redelivery if the + // processing was interrupted. Note that this does not modify the + // subscription-level `ackDeadlineSeconds` used for subsequent messages. + ModifyAckDeadline(ctx context.Context, in *ModifyAckDeadlineRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) + // Acknowledges the messages associated with the `ack_ids` in the + // `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages + // from the subscription. + // + // Acknowledging a message whose ack deadline has expired may succeed, + // but such a message may be redelivered later. Acknowledging a message more + // than once will not result in an error. + Acknowledge(ctx context.Context, in *AcknowledgeRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) + // Pulls messages from the server. Returns an empty list if there are no + // messages available in the backlog. The server may return `UNAVAILABLE` if + // there are too many concurrent pull requests pending for the given + // subscription. + Pull(ctx context.Context, in *PullRequest, opts ...grpc.CallOption) (*PullResponse, error) + // (EXPERIMENTAL) StreamingPull is an experimental feature. This RPC will + // respond with UNIMPLEMENTED errors unless you have been invited to test + // this feature. Contact cloud-pubsub@google.com with any questions. + // + // Establishes a stream with the server, which sends messages down to the + // client. The client streams acknowledgements and ack deadline modifications + // back to the server. The server will close the stream and return the status + // on any error. The server may close the stream with status `OK` to reassign + // server-side resources, in which case, the client should re-establish the + // stream. `UNAVAILABLE` may also be returned in the case of a transient error + // (e.g., a server restart). These should also be retried by the client. Flow + // control can be achieved by configuring the underlying RPC channel. + StreamingPull(ctx context.Context, opts ...grpc.CallOption) (Subscriber_StreamingPullClient, error) + // Modifies the `PushConfig` for a specified subscription. + // + // This may be used to change a push subscription to a pull one (signified by + // an empty `PushConfig`) or vice versa, or change the endpoint URL and other + // attributes of a push subscription. Messages will accumulate for delivery + // continuously through the call regardless of changes to the `PushConfig`. + ModifyPushConfig(ctx context.Context, in *ModifyPushConfigRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) + // Lists the existing snapshots. + ListSnapshots(ctx context.Context, in *ListSnapshotsRequest, opts ...grpc.CallOption) (*ListSnapshotsResponse, error) + // Creates a snapshot from the requested subscription. + // If the snapshot already exists, returns `ALREADY_EXISTS`. + // If the requested subscription doesn't exist, returns `NOT_FOUND`. + // + // If the name is not provided in the request, the server will assign a random + // name for this snapshot on the same project as the subscription, conforming + // to the + // [resource name format](https://cloud.google.com/pubsub/docs/overview#names). + // The generated name is populated in the returned Snapshot object. + // Note that for REST API requests, you must specify a name in the request. + CreateSnapshot(ctx context.Context, in *CreateSnapshotRequest, opts ...grpc.CallOption) (*Snapshot, error) + // Updates an existing snapshot. Note that certain properties of a snapshot + // are not modifiable. + // NOTE: The style guide requires body: "snapshot" instead of body: "*". + // Keeping the latter for internal consistency in V1, however it should be + // corrected in V2. See + // https://cloud.google.com/apis/design/standard_methods#update for details. + UpdateSnapshot(ctx context.Context, in *UpdateSnapshotRequest, opts ...grpc.CallOption) (*Snapshot, error) + // Removes an existing snapshot. All messages retained in the snapshot + // are immediately dropped. After a snapshot is deleted, a new one may be + // created with the same name, but the new one has no association with the old + // snapshot or its subscription, unless the same subscription is specified. + DeleteSnapshot(ctx context.Context, in *DeleteSnapshotRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) + // Seeks an existing subscription to a point in time or to a given snapshot, + // whichever is provided in the request. + Seek(ctx context.Context, in *SeekRequest, opts ...grpc.CallOption) (*SeekResponse, error) +} + +type subscriberClient struct { + cc *grpc.ClientConn +} + +func NewSubscriberClient(cc *grpc.ClientConn) SubscriberClient { + return &subscriberClient{cc} +} + +func (c *subscriberClient) CreateSubscription(ctx context.Context, in *Subscription, opts ...grpc.CallOption) (*Subscription, error) { + out := new(Subscription) + err := grpc.Invoke(ctx, "/google.pubsub.v1.Subscriber/CreateSubscription", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *subscriberClient) GetSubscription(ctx context.Context, in *GetSubscriptionRequest, opts ...grpc.CallOption) (*Subscription, error) { + out := new(Subscription) + err := grpc.Invoke(ctx, "/google.pubsub.v1.Subscriber/GetSubscription", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *subscriberClient) UpdateSubscription(ctx context.Context, in *UpdateSubscriptionRequest, opts ...grpc.CallOption) (*Subscription, error) { + out := new(Subscription) + err := grpc.Invoke(ctx, "/google.pubsub.v1.Subscriber/UpdateSubscription", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *subscriberClient) ListSubscriptions(ctx context.Context, in *ListSubscriptionsRequest, opts ...grpc.CallOption) (*ListSubscriptionsResponse, error) { + out := new(ListSubscriptionsResponse) + err := grpc.Invoke(ctx, "/google.pubsub.v1.Subscriber/ListSubscriptions", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *subscriberClient) DeleteSubscription(ctx context.Context, in *DeleteSubscriptionRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) { + out := new(google_protobuf2.Empty) + err := grpc.Invoke(ctx, "/google.pubsub.v1.Subscriber/DeleteSubscription", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *subscriberClient) ModifyAckDeadline(ctx context.Context, in *ModifyAckDeadlineRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) { + out := new(google_protobuf2.Empty) + err := grpc.Invoke(ctx, "/google.pubsub.v1.Subscriber/ModifyAckDeadline", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *subscriberClient) Acknowledge(ctx context.Context, in *AcknowledgeRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) { + out := new(google_protobuf2.Empty) + err := grpc.Invoke(ctx, "/google.pubsub.v1.Subscriber/Acknowledge", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *subscriberClient) Pull(ctx context.Context, in *PullRequest, opts ...grpc.CallOption) (*PullResponse, error) { + out := new(PullResponse) + err := grpc.Invoke(ctx, "/google.pubsub.v1.Subscriber/Pull", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *subscriberClient) StreamingPull(ctx context.Context, opts ...grpc.CallOption) (Subscriber_StreamingPullClient, error) { + stream, err := grpc.NewClientStream(ctx, &_Subscriber_serviceDesc.Streams[0], c.cc, "/google.pubsub.v1.Subscriber/StreamingPull", opts...) + if err != nil { + return nil, err + } + x := &subscriberStreamingPullClient{stream} + return x, nil +} + +type Subscriber_StreamingPullClient interface { + Send(*StreamingPullRequest) error + Recv() (*StreamingPullResponse, error) + grpc.ClientStream +} + +type subscriberStreamingPullClient struct { + grpc.ClientStream +} + +func (x *subscriberStreamingPullClient) Send(m *StreamingPullRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *subscriberStreamingPullClient) Recv() (*StreamingPullResponse, error) { + m := new(StreamingPullResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *subscriberClient) ModifyPushConfig(ctx context.Context, in *ModifyPushConfigRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) { + out := new(google_protobuf2.Empty) + err := grpc.Invoke(ctx, "/google.pubsub.v1.Subscriber/ModifyPushConfig", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *subscriberClient) ListSnapshots(ctx context.Context, in *ListSnapshotsRequest, opts ...grpc.CallOption) (*ListSnapshotsResponse, error) { + out := new(ListSnapshotsResponse) + err := grpc.Invoke(ctx, "/google.pubsub.v1.Subscriber/ListSnapshots", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *subscriberClient) CreateSnapshot(ctx context.Context, in *CreateSnapshotRequest, opts ...grpc.CallOption) (*Snapshot, error) { + out := new(Snapshot) + err := grpc.Invoke(ctx, "/google.pubsub.v1.Subscriber/CreateSnapshot", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *subscriberClient) UpdateSnapshot(ctx context.Context, in *UpdateSnapshotRequest, opts ...grpc.CallOption) (*Snapshot, error) { + out := new(Snapshot) + err := grpc.Invoke(ctx, "/google.pubsub.v1.Subscriber/UpdateSnapshot", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *subscriberClient) DeleteSnapshot(ctx context.Context, in *DeleteSnapshotRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) { + out := new(google_protobuf2.Empty) + err := grpc.Invoke(ctx, "/google.pubsub.v1.Subscriber/DeleteSnapshot", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *subscriberClient) Seek(ctx context.Context, in *SeekRequest, opts ...grpc.CallOption) (*SeekResponse, error) { + out := new(SeekResponse) + err := grpc.Invoke(ctx, "/google.pubsub.v1.Subscriber/Seek", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for Subscriber service + +type SubscriberServer interface { + // Creates a subscription to a given topic. + // If the subscription already exists, returns `ALREADY_EXISTS`. + // If the corresponding topic doesn't exist, returns `NOT_FOUND`. + // + // If the name is not provided in the request, the server will assign a random + // name for this subscription on the same project as the topic, conforming + // to the + // [resource name format](https://cloud.google.com/pubsub/docs/overview#names). + // The generated name is populated in the returned Subscription object. + // Note that for REST API requests, you must specify a name in the request. + CreateSubscription(context.Context, *Subscription) (*Subscription, error) + // Gets the configuration details of a subscription. + GetSubscription(context.Context, *GetSubscriptionRequest) (*Subscription, error) + // Updates an existing subscription. Note that certain properties of a + // subscription, such as its topic, are not modifiable. + // NOTE: The style guide requires body: "subscription" instead of body: "*". + // Keeping the latter for internal consistency in V1, however it should be + // corrected in V2. See + // https://cloud.google.com/apis/design/standard_methods#update for details. + UpdateSubscription(context.Context, *UpdateSubscriptionRequest) (*Subscription, error) + // Lists matching subscriptions. + ListSubscriptions(context.Context, *ListSubscriptionsRequest) (*ListSubscriptionsResponse, error) + // Deletes an existing subscription. All messages retained in the subscription + // are immediately dropped. Calls to `Pull` after deletion will return + // `NOT_FOUND`. After a subscription is deleted, a new one may be created with + // the same name, but the new one has no association with the old + // subscription or its topic unless the same topic is specified. + DeleteSubscription(context.Context, *DeleteSubscriptionRequest) (*google_protobuf2.Empty, error) + // Modifies the ack deadline for a specific message. This method is useful + // to indicate that more time is needed to process a message by the + // subscriber, or to make the message available for redelivery if the + // processing was interrupted. Note that this does not modify the + // subscription-level `ackDeadlineSeconds` used for subsequent messages. + ModifyAckDeadline(context.Context, *ModifyAckDeadlineRequest) (*google_protobuf2.Empty, error) + // Acknowledges the messages associated with the `ack_ids` in the + // `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages + // from the subscription. + // + // Acknowledging a message whose ack deadline has expired may succeed, + // but such a message may be redelivered later. Acknowledging a message more + // than once will not result in an error. + Acknowledge(context.Context, *AcknowledgeRequest) (*google_protobuf2.Empty, error) + // Pulls messages from the server. Returns an empty list if there are no + // messages available in the backlog. The server may return `UNAVAILABLE` if + // there are too many concurrent pull requests pending for the given + // subscription. + Pull(context.Context, *PullRequest) (*PullResponse, error) + // (EXPERIMENTAL) StreamingPull is an experimental feature. This RPC will + // respond with UNIMPLEMENTED errors unless you have been invited to test + // this feature. Contact cloud-pubsub@google.com with any questions. + // + // Establishes a stream with the server, which sends messages down to the + // client. The client streams acknowledgements and ack deadline modifications + // back to the server. The server will close the stream and return the status + // on any error. The server may close the stream with status `OK` to reassign + // server-side resources, in which case, the client should re-establish the + // stream. `UNAVAILABLE` may also be returned in the case of a transient error + // (e.g., a server restart). These should also be retried by the client. Flow + // control can be achieved by configuring the underlying RPC channel. + StreamingPull(Subscriber_StreamingPullServer) error + // Modifies the `PushConfig` for a specified subscription. + // + // This may be used to change a push subscription to a pull one (signified by + // an empty `PushConfig`) or vice versa, or change the endpoint URL and other + // attributes of a push subscription. Messages will accumulate for delivery + // continuously through the call regardless of changes to the `PushConfig`. + ModifyPushConfig(context.Context, *ModifyPushConfigRequest) (*google_protobuf2.Empty, error) + // Lists the existing snapshots. + ListSnapshots(context.Context, *ListSnapshotsRequest) (*ListSnapshotsResponse, error) + // Creates a snapshot from the requested subscription. + // If the snapshot already exists, returns `ALREADY_EXISTS`. + // If the requested subscription doesn't exist, returns `NOT_FOUND`. + // + // If the name is not provided in the request, the server will assign a random + // name for this snapshot on the same project as the subscription, conforming + // to the + // [resource name format](https://cloud.google.com/pubsub/docs/overview#names). + // The generated name is populated in the returned Snapshot object. + // Note that for REST API requests, you must specify a name in the request. + CreateSnapshot(context.Context, *CreateSnapshotRequest) (*Snapshot, error) + // Updates an existing snapshot. Note that certain properties of a snapshot + // are not modifiable. + // NOTE: The style guide requires body: "snapshot" instead of body: "*". + // Keeping the latter for internal consistency in V1, however it should be + // corrected in V2. See + // https://cloud.google.com/apis/design/standard_methods#update for details. + UpdateSnapshot(context.Context, *UpdateSnapshotRequest) (*Snapshot, error) + // Removes an existing snapshot. All messages retained in the snapshot + // are immediately dropped. After a snapshot is deleted, a new one may be + // created with the same name, but the new one has no association with the old + // snapshot or its subscription, unless the same subscription is specified. + DeleteSnapshot(context.Context, *DeleteSnapshotRequest) (*google_protobuf2.Empty, error) + // Seeks an existing subscription to a point in time or to a given snapshot, + // whichever is provided in the request. + Seek(context.Context, *SeekRequest) (*SeekResponse, error) +} + +func RegisterSubscriberServer(s *grpc.Server, srv SubscriberServer) { + s.RegisterService(&_Subscriber_serviceDesc, srv) +} + +func _Subscriber_CreateSubscription_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Subscription) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SubscriberServer).CreateSubscription(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.pubsub.v1.Subscriber/CreateSubscription", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SubscriberServer).CreateSubscription(ctx, req.(*Subscription)) + } + return interceptor(ctx, in, info, handler) +} + +func _Subscriber_GetSubscription_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetSubscriptionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SubscriberServer).GetSubscription(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.pubsub.v1.Subscriber/GetSubscription", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SubscriberServer).GetSubscription(ctx, req.(*GetSubscriptionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Subscriber_UpdateSubscription_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateSubscriptionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SubscriberServer).UpdateSubscription(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.pubsub.v1.Subscriber/UpdateSubscription", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SubscriberServer).UpdateSubscription(ctx, req.(*UpdateSubscriptionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Subscriber_ListSubscriptions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListSubscriptionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SubscriberServer).ListSubscriptions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.pubsub.v1.Subscriber/ListSubscriptions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SubscriberServer).ListSubscriptions(ctx, req.(*ListSubscriptionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Subscriber_DeleteSubscription_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteSubscriptionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SubscriberServer).DeleteSubscription(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.pubsub.v1.Subscriber/DeleteSubscription", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SubscriberServer).DeleteSubscription(ctx, req.(*DeleteSubscriptionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Subscriber_ModifyAckDeadline_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ModifyAckDeadlineRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SubscriberServer).ModifyAckDeadline(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.pubsub.v1.Subscriber/ModifyAckDeadline", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SubscriberServer).ModifyAckDeadline(ctx, req.(*ModifyAckDeadlineRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Subscriber_Acknowledge_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AcknowledgeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SubscriberServer).Acknowledge(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.pubsub.v1.Subscriber/Acknowledge", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SubscriberServer).Acknowledge(ctx, req.(*AcknowledgeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Subscriber_Pull_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PullRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SubscriberServer).Pull(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.pubsub.v1.Subscriber/Pull", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SubscriberServer).Pull(ctx, req.(*PullRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Subscriber_StreamingPull_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(SubscriberServer).StreamingPull(&subscriberStreamingPullServer{stream}) +} + +type Subscriber_StreamingPullServer interface { + Send(*StreamingPullResponse) error + Recv() (*StreamingPullRequest, error) + grpc.ServerStream +} + +type subscriberStreamingPullServer struct { + grpc.ServerStream +} + +func (x *subscriberStreamingPullServer) Send(m *StreamingPullResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *subscriberStreamingPullServer) Recv() (*StreamingPullRequest, error) { + m := new(StreamingPullRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _Subscriber_ModifyPushConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ModifyPushConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SubscriberServer).ModifyPushConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.pubsub.v1.Subscriber/ModifyPushConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SubscriberServer).ModifyPushConfig(ctx, req.(*ModifyPushConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Subscriber_ListSnapshots_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListSnapshotsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SubscriberServer).ListSnapshots(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.pubsub.v1.Subscriber/ListSnapshots", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SubscriberServer).ListSnapshots(ctx, req.(*ListSnapshotsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Subscriber_CreateSnapshot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateSnapshotRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SubscriberServer).CreateSnapshot(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.pubsub.v1.Subscriber/CreateSnapshot", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SubscriberServer).CreateSnapshot(ctx, req.(*CreateSnapshotRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Subscriber_UpdateSnapshot_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.(SubscriberServer).UpdateSnapshot(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.pubsub.v1.Subscriber/UpdateSnapshot", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SubscriberServer).UpdateSnapshot(ctx, req.(*UpdateSnapshotRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Subscriber_DeleteSnapshot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteSnapshotRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SubscriberServer).DeleteSnapshot(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.pubsub.v1.Subscriber/DeleteSnapshot", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SubscriberServer).DeleteSnapshot(ctx, req.(*DeleteSnapshotRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Subscriber_Seek_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SeekRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SubscriberServer).Seek(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.pubsub.v1.Subscriber/Seek", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SubscriberServer).Seek(ctx, req.(*SeekRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Subscriber_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.pubsub.v1.Subscriber", + HandlerType: (*SubscriberServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateSubscription", + Handler: _Subscriber_CreateSubscription_Handler, + }, + { + MethodName: "GetSubscription", + Handler: _Subscriber_GetSubscription_Handler, + }, + { + MethodName: "UpdateSubscription", + Handler: _Subscriber_UpdateSubscription_Handler, + }, + { + MethodName: "ListSubscriptions", + Handler: _Subscriber_ListSubscriptions_Handler, + }, + { + MethodName: "DeleteSubscription", + Handler: _Subscriber_DeleteSubscription_Handler, + }, + { + MethodName: "ModifyAckDeadline", + Handler: _Subscriber_ModifyAckDeadline_Handler, + }, + { + MethodName: "Acknowledge", + Handler: _Subscriber_Acknowledge_Handler, + }, + { + MethodName: "Pull", + Handler: _Subscriber_Pull_Handler, + }, + { + MethodName: "ModifyPushConfig", + Handler: _Subscriber_ModifyPushConfig_Handler, + }, + { + MethodName: "ListSnapshots", + Handler: _Subscriber_ListSnapshots_Handler, + }, + { + MethodName: "CreateSnapshot", + Handler: _Subscriber_CreateSnapshot_Handler, + }, + { + MethodName: "UpdateSnapshot", + Handler: _Subscriber_UpdateSnapshot_Handler, + }, + { + MethodName: "DeleteSnapshot", + Handler: _Subscriber_DeleteSnapshot_Handler, + }, + { + MethodName: "Seek", + Handler: _Subscriber_Seek_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "StreamingPull", + Handler: _Subscriber_StreamingPull_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "google/pubsub/v1/pubsub.proto", +} + +// Client API for Publisher service + +type PublisherClient interface { + // Creates the given topic with the given name. + CreateTopic(ctx context.Context, in *Topic, opts ...grpc.CallOption) (*Topic, error) + // Updates an existing topic. Note that certain properties of a topic are not + // modifiable. Options settings follow the style guide: + // NOTE: The style guide requires body: "topic" instead of body: "*". + // Keeping the latter for internal consistency in V1, however it should be + // corrected in V2. See + // https://cloud.google.com/apis/design/standard_methods#update for details. + UpdateTopic(ctx context.Context, in *UpdateTopicRequest, opts ...grpc.CallOption) (*Topic, error) + // Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic + // does not exist. The message payload must not be empty; it must contain + // either a non-empty data field, or at least one attribute. + Publish(ctx context.Context, in *PublishRequest, opts ...grpc.CallOption) (*PublishResponse, error) + // Gets the configuration of a topic. + GetTopic(ctx context.Context, in *GetTopicRequest, opts ...grpc.CallOption) (*Topic, error) + // Lists matching topics. + ListTopics(ctx context.Context, in *ListTopicsRequest, opts ...grpc.CallOption) (*ListTopicsResponse, error) + // Lists the name of the subscriptions for this topic. + ListTopicSubscriptions(ctx context.Context, in *ListTopicSubscriptionsRequest, opts ...grpc.CallOption) (*ListTopicSubscriptionsResponse, error) + // Deletes the topic with the given name. Returns `NOT_FOUND` if the topic + // does not exist. After a topic is deleted, a new topic may be created with + // the same name; this is an entirely new topic with none of the old + // configuration or subscriptions. Existing subscriptions to this topic are + // not deleted, but their `topic` field is set to `_deleted-topic_`. + DeleteTopic(ctx context.Context, in *DeleteTopicRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) +} + +type publisherClient struct { + cc *grpc.ClientConn +} + +func NewPublisherClient(cc *grpc.ClientConn) PublisherClient { + return &publisherClient{cc} +} + +func (c *publisherClient) CreateTopic(ctx context.Context, in *Topic, opts ...grpc.CallOption) (*Topic, error) { + out := new(Topic) + err := grpc.Invoke(ctx, "/google.pubsub.v1.Publisher/CreateTopic", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *publisherClient) UpdateTopic(ctx context.Context, in *UpdateTopicRequest, opts ...grpc.CallOption) (*Topic, error) { + out := new(Topic) + err := grpc.Invoke(ctx, "/google.pubsub.v1.Publisher/UpdateTopic", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *publisherClient) Publish(ctx context.Context, in *PublishRequest, opts ...grpc.CallOption) (*PublishResponse, error) { + out := new(PublishResponse) + err := grpc.Invoke(ctx, "/google.pubsub.v1.Publisher/Publish", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *publisherClient) GetTopic(ctx context.Context, in *GetTopicRequest, opts ...grpc.CallOption) (*Topic, error) { + out := new(Topic) + err := grpc.Invoke(ctx, "/google.pubsub.v1.Publisher/GetTopic", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *publisherClient) ListTopics(ctx context.Context, in *ListTopicsRequest, opts ...grpc.CallOption) (*ListTopicsResponse, error) { + out := new(ListTopicsResponse) + err := grpc.Invoke(ctx, "/google.pubsub.v1.Publisher/ListTopics", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *publisherClient) ListTopicSubscriptions(ctx context.Context, in *ListTopicSubscriptionsRequest, opts ...grpc.CallOption) (*ListTopicSubscriptionsResponse, error) { + out := new(ListTopicSubscriptionsResponse) + err := grpc.Invoke(ctx, "/google.pubsub.v1.Publisher/ListTopicSubscriptions", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *publisherClient) DeleteTopic(ctx context.Context, in *DeleteTopicRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) { + out := new(google_protobuf2.Empty) + err := grpc.Invoke(ctx, "/google.pubsub.v1.Publisher/DeleteTopic", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for Publisher service + +type PublisherServer interface { + // Creates the given topic with the given name. + CreateTopic(context.Context, *Topic) (*Topic, error) + // Updates an existing topic. Note that certain properties of a topic are not + // modifiable. Options settings follow the style guide: + // NOTE: The style guide requires body: "topic" instead of body: "*". + // Keeping the latter for internal consistency in V1, however it should be + // corrected in V2. See + // https://cloud.google.com/apis/design/standard_methods#update for details. + UpdateTopic(context.Context, *UpdateTopicRequest) (*Topic, error) + // Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic + // does not exist. The message payload must not be empty; it must contain + // either a non-empty data field, or at least one attribute. + Publish(context.Context, *PublishRequest) (*PublishResponse, error) + // Gets the configuration of a topic. + GetTopic(context.Context, *GetTopicRequest) (*Topic, error) + // Lists matching topics. + ListTopics(context.Context, *ListTopicsRequest) (*ListTopicsResponse, error) + // Lists the name of the subscriptions for this topic. + ListTopicSubscriptions(context.Context, *ListTopicSubscriptionsRequest) (*ListTopicSubscriptionsResponse, error) + // Deletes the topic with the given name. Returns `NOT_FOUND` if the topic + // does not exist. After a topic is deleted, a new topic may be created with + // the same name; this is an entirely new topic with none of the old + // configuration or subscriptions. Existing subscriptions to this topic are + // not deleted, but their `topic` field is set to `_deleted-topic_`. + DeleteTopic(context.Context, *DeleteTopicRequest) (*google_protobuf2.Empty, error) +} + +func RegisterPublisherServer(s *grpc.Server, srv PublisherServer) { + s.RegisterService(&_Publisher_serviceDesc, srv) +} + +func _Publisher_CreateTopic_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Topic) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PublisherServer).CreateTopic(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.pubsub.v1.Publisher/CreateTopic", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PublisherServer).CreateTopic(ctx, req.(*Topic)) + } + return interceptor(ctx, in, info, handler) +} + +func _Publisher_UpdateTopic_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateTopicRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PublisherServer).UpdateTopic(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.pubsub.v1.Publisher/UpdateTopic", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PublisherServer).UpdateTopic(ctx, req.(*UpdateTopicRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Publisher_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.(PublisherServer).Publish(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.pubsub.v1.Publisher/Publish", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PublisherServer).Publish(ctx, req.(*PublishRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Publisher_GetTopic_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetTopicRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PublisherServer).GetTopic(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.pubsub.v1.Publisher/GetTopic", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PublisherServer).GetTopic(ctx, req.(*GetTopicRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Publisher_ListTopics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListTopicsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PublisherServer).ListTopics(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.pubsub.v1.Publisher/ListTopics", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PublisherServer).ListTopics(ctx, req.(*ListTopicsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Publisher_ListTopicSubscriptions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListTopicSubscriptionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PublisherServer).ListTopicSubscriptions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.pubsub.v1.Publisher/ListTopicSubscriptions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PublisherServer).ListTopicSubscriptions(ctx, req.(*ListTopicSubscriptionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Publisher_DeleteTopic_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteTopicRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PublisherServer).DeleteTopic(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.pubsub.v1.Publisher/DeleteTopic", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PublisherServer).DeleteTopic(ctx, req.(*DeleteTopicRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Publisher_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.pubsub.v1.Publisher", + HandlerType: (*PublisherServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateTopic", + Handler: _Publisher_CreateTopic_Handler, + }, + { + MethodName: "UpdateTopic", + Handler: _Publisher_UpdateTopic_Handler, + }, + { + MethodName: "Publish", + Handler: _Publisher_Publish_Handler, + }, + { + MethodName: "GetTopic", + Handler: _Publisher_GetTopic_Handler, + }, + { + MethodName: "ListTopics", + Handler: _Publisher_ListTopics_Handler, + }, + { + MethodName: "ListTopicSubscriptions", + Handler: _Publisher_ListTopicSubscriptions_Handler, + }, + { + MethodName: "DeleteTopic", + Handler: _Publisher_DeleteTopic_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/pubsub/v1/pubsub.proto", +} + +func init() { proto.RegisterFile("google/pubsub/v1/pubsub.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 2026 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x59, 0xdb, 0x6f, 0xdb, 0xd6, + 0x19, 0xef, 0x91, 0x6f, 0xf2, 0x47, 0xdf, 0x72, 0x66, 0x27, 0x0a, 0x73, 0xb3, 0x19, 0x37, 0x56, + 0xd4, 0x44, 0xb2, 0x55, 0x34, 0x6b, 0xe2, 0x39, 0x85, 0x1d, 0x67, 0x69, 0x86, 0x64, 0xf5, 0xe8, + 0xac, 0x03, 0x86, 0x60, 0x02, 0x25, 0x9e, 0x28, 0xac, 0x24, 0x92, 0x25, 0x29, 0x2f, 0xee, 0x16, + 0xa0, 0x6b, 0x87, 0x01, 0xc3, 0xf2, 0xb0, 0xb6, 0x6f, 0x43, 0x1f, 0x06, 0xec, 0x6d, 0x8f, 0x03, + 0xf6, 0xba, 0x3f, 0x60, 0xaf, 0xfb, 0x17, 0xf6, 0xb8, 0xf7, 0xed, 0x71, 0x38, 0x17, 0x52, 0xbc, + 0x1c, 0x4a, 0x96, 0xd3, 0xbc, 0x91, 0xe7, 0xfb, 0xce, 0xf9, 0x7e, 0xdf, 0xfd, 0x23, 0x0f, 0x5c, + 0x6a, 0x3b, 0x4e, 0xbb, 0x4b, 0x6a, 0x6e, 0xbf, 0xe9, 0xf7, 0x9b, 0xb5, 0xa3, 0x2d, 0xf1, 0x54, + 0x75, 0x3d, 0x27, 0x70, 0xf0, 0x12, 0x27, 0x57, 0xc5, 0xe2, 0xd1, 0x96, 0x7a, 0x51, 0x6c, 0x30, + 0x5c, 0xab, 0x66, 0xd8, 0xb6, 0x13, 0x18, 0x81, 0xe5, 0xd8, 0x3e, 0xe7, 0x57, 0x2f, 0x87, 0xc7, + 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 0x86, 0x78, 0x85, 0x60, 0x3e, 0xd1, 0x1a, 0x65, 0x96, 0x90, 0x75, + 0x6a, 0x99, 0x25, 0xa4, 0x3d, 0x56, 0xab, 0x30, 0xb4, 0xeb, 0x58, 0xcb, 0xcf, 0xf7, 0x48, 0xf8, + 0x97, 0x08, 0x16, 0x92, 0x63, 0x1e, 0x96, 0xc8, 0x91, 0x0e, 0x82, 0xea, 0x90, 0xc6, 0xad, 0xdd, + 0x60, 0x18, 0xae, 0xa9, 0x6b, 0xf2, 0x66, 0x12, 0xca, 0x17, 0x05, 0xf1, 0x15, 0x82, 0x85, 0xe4, + 0x68, 0x28, 0x43, 0x21, 0x1d, 0x1e, 0x87, 0xa2, 0x10, 0xd5, 0xa6, 0x5e, 0xe1, 0x7e, 0x0b, 0x47, + 0xab, 0x51, 0x70, 0x3e, 0x47, 0xb0, 0x90, 0x9c, 0x21, 0x64, 0x70, 0xa4, 0x53, 0x46, 0x6e, 0x08, + 0xdd, 0x64, 0x50, 0x36, 0x2a, 0x6f, 0x27, 0xa0, 0xe4, 0xa1, 0x60, 0x69, 0x4b, 0x67, 0x00, 0x59, + 0xda, 0xc6, 0x06, 0x15, 0x69, 0xa7, 0x8a, 0x8d, 0x0e, 0xa7, 0x4d, 0x5b, 0x9f, 0x90, 0xce, 0x1d, + 0x54, 0xa9, 0xff, 0x69, 0x06, 0x66, 0xc5, 0xcf, 0x6c, 0xe2, 0xe1, 0x4f, 0x40, 0xe1, 0x91, 0xc0, + 0x6f, 0x66, 0xf2, 0xfe, 0x11, 0xab, 0x79, 0x04, 0xed, 0x3a, 0x43, 0x73, 0x55, 0xbd, 0x2c, 0x8d, + 0x0a, 0xfe, 0x67, 0x59, 0xf8, 0xe0, 0x25, 0x28, 0xb1, 0xcb, 0x02, 0x59, 0x29, 0xcd, 0xde, 0x25, + 0xe4, 0x0b, 0xae, 0x31, 0xc1, 0xd7, 0xeb, 0xeb, 0x4c, 0x30, 0x13, 0x54, 0x1d, 0x2a, 0x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0x3e, 0xec, 0x37, 0xab, 0x1f, 0x6f, 0xfd, 0x33, 0x24, 0x3c, 0x65, + 0x84, 0xa7, 0x9c, 0xf0, 0xf4, 0xe3, 0xad, 0xe6, 0x34, 0x3b, 0xf7, 0xdd, 0xff, 0x07, 0x00, 0x00, + 0xff, 0xff, 0xcb, 0xe1, 0xb8, 0xca, 0x90, 0x1e, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/pubsub/v1beta2/pubsub.pb.go b/vendor/google.golang.org/genproto/googleapis/pubsub/v1beta2/pubsub.pb.go new file mode 100644 index 0000000000..75d044a6c9 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/pubsub/v1beta2/pubsub.pb.go @@ -0,0 +1,1459 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/pubsub/v1beta2/pubsub.proto + +/* +Package pubsub is a generated protocol buffer package. + +It is generated from these files: + google/pubsub/v1beta2/pubsub.proto + +It has these top-level messages: + Topic + PubsubMessage + GetTopicRequest + PublishRequest + PublishResponse + ListTopicsRequest + ListTopicsResponse + ListTopicSubscriptionsRequest + ListTopicSubscriptionsResponse + DeleteTopicRequest + Subscription + PushConfig + ReceivedMessage + GetSubscriptionRequest + ListSubscriptionsRequest + ListSubscriptionsResponse + DeleteSubscriptionRequest + ModifyPushConfigRequest + PullRequest + PullResponse + ModifyAckDeadlineRequest + AcknowledgeRequest +*/ +package pubsub + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import google_protobuf "github.com/golang/protobuf/ptypes/empty" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// A topic resource. +type Topic struct { + // Name of the topic. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *Topic) Reset() { *m = Topic{} } +func (m *Topic) String() string { return proto.CompactTextString(m) } +func (*Topic) ProtoMessage() {} +func (*Topic) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *Topic) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// A message data and its attributes. +type PubsubMessage struct { + // The message payload. For JSON requests, the value of this field must be + // base64-encoded. + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + // Optional attributes for this message. + Attributes map[string]string `protobuf:"bytes,2,rep,name=attributes" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // ID of this message assigned by the server at publication time. Guaranteed + // to be unique within the topic. This value may be read by a subscriber + // that receives a PubsubMessage via a Pull call or a push delivery. It must + // not be populated by a publisher in a Publish call. + MessageId string `protobuf:"bytes,3,opt,name=message_id,json=messageId" json:"message_id,omitempty"` +} + +func (m *PubsubMessage) Reset() { *m = PubsubMessage{} } +func (m *PubsubMessage) String() string { return proto.CompactTextString(m) } +func (*PubsubMessage) ProtoMessage() {} +func (*PubsubMessage) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *PubsubMessage) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +func (m *PubsubMessage) GetAttributes() map[string]string { + if m != nil { + return m.Attributes + } + return nil +} + +func (m *PubsubMessage) GetMessageId() string { + if m != nil { + return m.MessageId + } + return "" +} + +// Request for the GetTopic method. +type GetTopicRequest struct { + // The name of the topic to get. + Topic string `protobuf:"bytes,1,opt,name=topic" json:"topic,omitempty"` +} + +func (m *GetTopicRequest) Reset() { *m = GetTopicRequest{} } +func (m *GetTopicRequest) String() string { return proto.CompactTextString(m) } +func (*GetTopicRequest) ProtoMessage() {} +func (*GetTopicRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *GetTopicRequest) GetTopic() string { + if m != nil { + return m.Topic + } + return "" +} + +// Request for the Publish method. +type PublishRequest struct { + // The messages in the request will be published on this topic. + Topic string `protobuf:"bytes,1,opt,name=topic" json:"topic,omitempty"` + // The messages to publish. + Messages []*PubsubMessage `protobuf:"bytes,2,rep,name=messages" json:"messages,omitempty"` +} + +func (m *PublishRequest) Reset() { *m = PublishRequest{} } +func (m *PublishRequest) String() string { return proto.CompactTextString(m) } +func (*PublishRequest) ProtoMessage() {} +func (*PublishRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *PublishRequest) GetTopic() string { + if m != nil { + return m.Topic + } + return "" +} + +func (m *PublishRequest) GetMessages() []*PubsubMessage { + if m != nil { + return m.Messages + } + return nil +} + +// Response for the Publish method. +type PublishResponse struct { + // The server-assigned ID of each published message, in the same order as + // the messages in the request. IDs are guaranteed to be unique within + // the topic. + MessageIds []string `protobuf:"bytes,1,rep,name=message_ids,json=messageIds" json:"message_ids,omitempty"` +} + +func (m *PublishResponse) Reset() { *m = PublishResponse{} } +func (m *PublishResponse) String() string { return proto.CompactTextString(m) } +func (*PublishResponse) ProtoMessage() {} +func (*PublishResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *PublishResponse) GetMessageIds() []string { + if m != nil { + return m.MessageIds + } + return nil +} + +// Request for the ListTopics method. +type ListTopicsRequest struct { + // The name of the cloud project that topics belong to. + Project string `protobuf:"bytes,1,opt,name=project" json:"project,omitempty"` + // Maximum number of topics to return. + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // The value returned by the last ListTopicsResponse; indicates that this is + // a continuation of a prior ListTopics call, and that the system should + // return the next page of data. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListTopicsRequest) Reset() { *m = ListTopicsRequest{} } +func (m *ListTopicsRequest) String() string { return proto.CompactTextString(m) } +func (*ListTopicsRequest) ProtoMessage() {} +func (*ListTopicsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *ListTopicsRequest) GetProject() string { + if m != nil { + return m.Project + } + return "" +} + +func (m *ListTopicsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListTopicsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// Response for the ListTopics method. +type ListTopicsResponse struct { + // The resulting topics. + Topics []*Topic `protobuf:"bytes,1,rep,name=topics" json:"topics,omitempty"` + // If not empty, indicates that there may be more topics that match the + // request; this value should be passed in a new ListTopicsRequest. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListTopicsResponse) Reset() { *m = ListTopicsResponse{} } +func (m *ListTopicsResponse) String() string { return proto.CompactTextString(m) } +func (*ListTopicsResponse) ProtoMessage() {} +func (*ListTopicsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *ListTopicsResponse) GetTopics() []*Topic { + if m != nil { + return m.Topics + } + return nil +} + +func (m *ListTopicsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// Request for the ListTopicSubscriptions method. +type ListTopicSubscriptionsRequest struct { + // The name of the topic that subscriptions are attached to. + Topic string `protobuf:"bytes,1,opt,name=topic" json:"topic,omitempty"` + // Maximum number of subscription names to return. + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // The value returned by the last ListTopicSubscriptionsResponse; indicates + // that this is a continuation of a prior ListTopicSubscriptions call, and + // that the system should return the next page of data. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListTopicSubscriptionsRequest) Reset() { *m = ListTopicSubscriptionsRequest{} } +func (m *ListTopicSubscriptionsRequest) String() string { return proto.CompactTextString(m) } +func (*ListTopicSubscriptionsRequest) ProtoMessage() {} +func (*ListTopicSubscriptionsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *ListTopicSubscriptionsRequest) GetTopic() string { + if m != nil { + return m.Topic + } + return "" +} + +func (m *ListTopicSubscriptionsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListTopicSubscriptionsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// Response for the ListTopicSubscriptions method. +type ListTopicSubscriptionsResponse struct { + // The names of the subscriptions that match the request. + Subscriptions []string `protobuf:"bytes,1,rep,name=subscriptions" json:"subscriptions,omitempty"` + // If not empty, indicates that there may be more subscriptions that match + // the request; this value should be passed in a new + // ListTopicSubscriptionsRequest to get more subscriptions. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListTopicSubscriptionsResponse) Reset() { *m = ListTopicSubscriptionsResponse{} } +func (m *ListTopicSubscriptionsResponse) String() string { return proto.CompactTextString(m) } +func (*ListTopicSubscriptionsResponse) ProtoMessage() {} +func (*ListTopicSubscriptionsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *ListTopicSubscriptionsResponse) GetSubscriptions() []string { + if m != nil { + return m.Subscriptions + } + return nil +} + +func (m *ListTopicSubscriptionsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// Request for the DeleteTopic method. +type DeleteTopicRequest struct { + // Name of the topic to delete. + Topic string `protobuf:"bytes,1,opt,name=topic" json:"topic,omitempty"` +} + +func (m *DeleteTopicRequest) Reset() { *m = DeleteTopicRequest{} } +func (m *DeleteTopicRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteTopicRequest) ProtoMessage() {} +func (*DeleteTopicRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *DeleteTopicRequest) GetTopic() string { + if m != nil { + return m.Topic + } + return "" +} + +// A subscription resource. +type Subscription struct { + // Name of the subscription. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The name of the topic from which this subscription is receiving messages. + // This will be present if and only if the subscription has not been detached + // from its topic. + Topic string `protobuf:"bytes,2,opt,name=topic" json:"topic,omitempty"` + // If push delivery is used with this subscription, this field is + // used to configure it. An empty pushConfig signifies that the subscriber + // will pull and ack messages using API methods. + PushConfig *PushConfig `protobuf:"bytes,4,opt,name=push_config,json=pushConfig" json:"push_config,omitempty"` + // This value is the maximum time after a subscriber receives a message + // before the subscriber should acknowledge the message. After message + // delivery but before the ack deadline expires and before the message is + // acknowledged, it is an outstanding message and will not be delivered + // again during that time (on a best-effort basis). + // + // For pull delivery this value + // is used as the initial value for the ack deadline. It may be overridden + // for a specific message by calling ModifyAckDeadline. + // + // For push delivery, this value is also used to set the request timeout for + // the call to the push endpoint. + // + // If the subscriber never acknowledges the message, the Pub/Sub + // system will eventually redeliver the message. + AckDeadlineSeconds int32 `protobuf:"varint,5,opt,name=ack_deadline_seconds,json=ackDeadlineSeconds" json:"ack_deadline_seconds,omitempty"` +} + +func (m *Subscription) Reset() { *m = Subscription{} } +func (m *Subscription) String() string { return proto.CompactTextString(m) } +func (*Subscription) ProtoMessage() {} +func (*Subscription) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *Subscription) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Subscription) GetTopic() string { + if m != nil { + return m.Topic + } + return "" +} + +func (m *Subscription) GetPushConfig() *PushConfig { + if m != nil { + return m.PushConfig + } + return nil +} + +func (m *Subscription) GetAckDeadlineSeconds() int32 { + if m != nil { + return m.AckDeadlineSeconds + } + return 0 +} + +// Configuration for a push delivery endpoint. +type PushConfig struct { + // A URL locating the endpoint to which messages should be pushed. + // For example, a Webhook endpoint might use "https://example.com/push". + PushEndpoint string `protobuf:"bytes,1,opt,name=push_endpoint,json=pushEndpoint" json:"push_endpoint,omitempty"` + // Endpoint configuration attributes. + // + // Every endpoint has a set of API supported attributes that can be used to + // control different aspects of the message delivery. + // + // The currently supported attribute is `x-goog-version`, which you can + // use to change the format of the push message. This attribute + // indicates the version of the data expected by the endpoint. This + // controls the shape of the envelope (i.e. its fields and metadata). + // The endpoint version is based on the version of the Pub/Sub + // API. + // + // If not present during the CreateSubscription call, it will default to + // the version of the API used to make such call. If not present during a + // ModifyPushConfig call, its value will not be changed. GetSubscription + // calls will always return a valid version, even if the subscription was + // created without this attribute. + // + // The possible values for this attribute are: + // + // * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. + // * `v1beta2`: uses the push format defined in the v1beta2 Pub/Sub API. + // + Attributes map[string]string `protobuf:"bytes,2,rep,name=attributes" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *PushConfig) Reset() { *m = PushConfig{} } +func (m *PushConfig) String() string { return proto.CompactTextString(m) } +func (*PushConfig) ProtoMessage() {} +func (*PushConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } + +func (m *PushConfig) GetPushEndpoint() string { + if m != nil { + return m.PushEndpoint + } + return "" +} + +func (m *PushConfig) GetAttributes() map[string]string { + if m != nil { + return m.Attributes + } + return nil +} + +// A message and its corresponding acknowledgment ID. +type ReceivedMessage struct { + // This ID can be used to acknowledge the received message. + AckId string `protobuf:"bytes,1,opt,name=ack_id,json=ackId" json:"ack_id,omitempty"` + // The message. + Message *PubsubMessage `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"` +} + +func (m *ReceivedMessage) Reset() { *m = ReceivedMessage{} } +func (m *ReceivedMessage) String() string { return proto.CompactTextString(m) } +func (*ReceivedMessage) ProtoMessage() {} +func (*ReceivedMessage) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } + +func (m *ReceivedMessage) GetAckId() string { + if m != nil { + return m.AckId + } + return "" +} + +func (m *ReceivedMessage) GetMessage() *PubsubMessage { + if m != nil { + return m.Message + } + return nil +} + +// Request for the GetSubscription method. +type GetSubscriptionRequest struct { + // The name of the subscription to get. + Subscription string `protobuf:"bytes,1,opt,name=subscription" json:"subscription,omitempty"` +} + +func (m *GetSubscriptionRequest) Reset() { *m = GetSubscriptionRequest{} } +func (m *GetSubscriptionRequest) String() string { return proto.CompactTextString(m) } +func (*GetSubscriptionRequest) ProtoMessage() {} +func (*GetSubscriptionRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } + +func (m *GetSubscriptionRequest) GetSubscription() string { + if m != nil { + return m.Subscription + } + return "" +} + +// Request for the ListSubscriptions method. +type ListSubscriptionsRequest struct { + // The name of the cloud project that subscriptions belong to. + Project string `protobuf:"bytes,1,opt,name=project" json:"project,omitempty"` + // Maximum number of subscriptions to return. + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // The value returned by the last ListSubscriptionsResponse; indicates that + // this is a continuation of a prior ListSubscriptions call, and that the + // system should return the next page of data. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListSubscriptionsRequest) Reset() { *m = ListSubscriptionsRequest{} } +func (m *ListSubscriptionsRequest) String() string { return proto.CompactTextString(m) } +func (*ListSubscriptionsRequest) ProtoMessage() {} +func (*ListSubscriptionsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } + +func (m *ListSubscriptionsRequest) GetProject() string { + if m != nil { + return m.Project + } + return "" +} + +func (m *ListSubscriptionsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListSubscriptionsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// Response for the ListSubscriptions method. +type ListSubscriptionsResponse struct { + // The subscriptions that match the request. + Subscriptions []*Subscription `protobuf:"bytes,1,rep,name=subscriptions" json:"subscriptions,omitempty"` + // If not empty, indicates that there may be more subscriptions that match + // the request; this value should be passed in a new ListSubscriptionsRequest + // to get more subscriptions. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListSubscriptionsResponse) Reset() { *m = ListSubscriptionsResponse{} } +func (m *ListSubscriptionsResponse) String() string { return proto.CompactTextString(m) } +func (*ListSubscriptionsResponse) ProtoMessage() {} +func (*ListSubscriptionsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } + +func (m *ListSubscriptionsResponse) GetSubscriptions() []*Subscription { + if m != nil { + return m.Subscriptions + } + return nil +} + +func (m *ListSubscriptionsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// Request for the DeleteSubscription method. +type DeleteSubscriptionRequest struct { + // The subscription to delete. + Subscription string `protobuf:"bytes,1,opt,name=subscription" json:"subscription,omitempty"` +} + +func (m *DeleteSubscriptionRequest) Reset() { *m = DeleteSubscriptionRequest{} } +func (m *DeleteSubscriptionRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteSubscriptionRequest) ProtoMessage() {} +func (*DeleteSubscriptionRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} } + +func (m *DeleteSubscriptionRequest) GetSubscription() string { + if m != nil { + return m.Subscription + } + return "" +} + +// Request for the ModifyPushConfig method. +type ModifyPushConfigRequest struct { + // The name of the subscription. + Subscription string `protobuf:"bytes,1,opt,name=subscription" json:"subscription,omitempty"` + // The push configuration for future deliveries. + // + // An empty pushConfig indicates that the Pub/Sub system should + // stop pushing messages from the given subscription and allow + // messages to be pulled and acknowledged - effectively pausing + // the subscription if Pull is not called. + PushConfig *PushConfig `protobuf:"bytes,2,opt,name=push_config,json=pushConfig" json:"push_config,omitempty"` +} + +func (m *ModifyPushConfigRequest) Reset() { *m = ModifyPushConfigRequest{} } +func (m *ModifyPushConfigRequest) String() string { return proto.CompactTextString(m) } +func (*ModifyPushConfigRequest) ProtoMessage() {} +func (*ModifyPushConfigRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17} } + +func (m *ModifyPushConfigRequest) GetSubscription() string { + if m != nil { + return m.Subscription + } + return "" +} + +func (m *ModifyPushConfigRequest) GetPushConfig() *PushConfig { + if m != nil { + return m.PushConfig + } + return nil +} + +// Request for the Pull method. +type PullRequest struct { + // The subscription from which messages should be pulled. + Subscription string `protobuf:"bytes,1,opt,name=subscription" json:"subscription,omitempty"` + // If this is specified as true the system will respond immediately even if + // it is not able to return a message in the Pull response. Otherwise the + // system is allowed to wait until at least one message is available rather + // than returning no messages. The client may cancel the request if it does + // not wish to wait any longer for the response. + ReturnImmediately bool `protobuf:"varint,2,opt,name=return_immediately,json=returnImmediately" json:"return_immediately,omitempty"` + // The maximum number of messages returned for this request. The Pub/Sub + // system may return fewer than the number specified. + MaxMessages int32 `protobuf:"varint,3,opt,name=max_messages,json=maxMessages" json:"max_messages,omitempty"` +} + +func (m *PullRequest) Reset() { *m = PullRequest{} } +func (m *PullRequest) String() string { return proto.CompactTextString(m) } +func (*PullRequest) ProtoMessage() {} +func (*PullRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{18} } + +func (m *PullRequest) GetSubscription() string { + if m != nil { + return m.Subscription + } + return "" +} + +func (m *PullRequest) GetReturnImmediately() bool { + if m != nil { + return m.ReturnImmediately + } + return false +} + +func (m *PullRequest) GetMaxMessages() int32 { + if m != nil { + return m.MaxMessages + } + return 0 +} + +// Response for the Pull method. +type PullResponse struct { + // Received Pub/Sub messages. The Pub/Sub system will return zero messages if + // there are no more available in the backlog. The Pub/Sub system may return + // fewer than the maxMessages requested even if there are more messages + // available in the backlog. + ReceivedMessages []*ReceivedMessage `protobuf:"bytes,1,rep,name=received_messages,json=receivedMessages" json:"received_messages,omitempty"` +} + +func (m *PullResponse) Reset() { *m = PullResponse{} } +func (m *PullResponse) String() string { return proto.CompactTextString(m) } +func (*PullResponse) ProtoMessage() {} +func (*PullResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{19} } + +func (m *PullResponse) GetReceivedMessages() []*ReceivedMessage { + if m != nil { + return m.ReceivedMessages + } + return nil +} + +// Request for the ModifyAckDeadline method. +type ModifyAckDeadlineRequest struct { + // The name of the subscription. + Subscription string `protobuf:"bytes,1,opt,name=subscription" json:"subscription,omitempty"` + // The acknowledgment ID. + AckId string `protobuf:"bytes,2,opt,name=ack_id,json=ackId" json:"ack_id,omitempty"` + // The new ack deadline with respect to the time this request was sent to the + // Pub/Sub system. Must be >= 0. For example, if the value is 10, the new ack + // deadline will expire 10 seconds after the ModifyAckDeadline call was made. + // Specifying zero may immediately make the message available for another pull + // request. + AckDeadlineSeconds int32 `protobuf:"varint,3,opt,name=ack_deadline_seconds,json=ackDeadlineSeconds" json:"ack_deadline_seconds,omitempty"` +} + +func (m *ModifyAckDeadlineRequest) Reset() { *m = ModifyAckDeadlineRequest{} } +func (m *ModifyAckDeadlineRequest) String() string { return proto.CompactTextString(m) } +func (*ModifyAckDeadlineRequest) ProtoMessage() {} +func (*ModifyAckDeadlineRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20} } + +func (m *ModifyAckDeadlineRequest) GetSubscription() string { + if m != nil { + return m.Subscription + } + return "" +} + +func (m *ModifyAckDeadlineRequest) GetAckId() string { + if m != nil { + return m.AckId + } + return "" +} + +func (m *ModifyAckDeadlineRequest) GetAckDeadlineSeconds() int32 { + if m != nil { + return m.AckDeadlineSeconds + } + return 0 +} + +// Request for the Acknowledge method. +type AcknowledgeRequest struct { + // The subscription whose message is being acknowledged. + Subscription string `protobuf:"bytes,1,opt,name=subscription" json:"subscription,omitempty"` + // The acknowledgment ID for the messages being acknowledged that was returned + // by the Pub/Sub system in the Pull response. Must not be empty. + AckIds []string `protobuf:"bytes,2,rep,name=ack_ids,json=ackIds" json:"ack_ids,omitempty"` +} + +func (m *AcknowledgeRequest) Reset() { *m = AcknowledgeRequest{} } +func (m *AcknowledgeRequest) String() string { return proto.CompactTextString(m) } +func (*AcknowledgeRequest) ProtoMessage() {} +func (*AcknowledgeRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{21} } + +func (m *AcknowledgeRequest) GetSubscription() string { + if m != nil { + return m.Subscription + } + return "" +} + +func (m *AcknowledgeRequest) GetAckIds() []string { + if m != nil { + return m.AckIds + } + return nil +} + +func init() { + proto.RegisterType((*Topic)(nil), "google.pubsub.v1beta2.Topic") + proto.RegisterType((*PubsubMessage)(nil), "google.pubsub.v1beta2.PubsubMessage") + proto.RegisterType((*GetTopicRequest)(nil), "google.pubsub.v1beta2.GetTopicRequest") + proto.RegisterType((*PublishRequest)(nil), "google.pubsub.v1beta2.PublishRequest") + proto.RegisterType((*PublishResponse)(nil), "google.pubsub.v1beta2.PublishResponse") + proto.RegisterType((*ListTopicsRequest)(nil), "google.pubsub.v1beta2.ListTopicsRequest") + proto.RegisterType((*ListTopicsResponse)(nil), "google.pubsub.v1beta2.ListTopicsResponse") + proto.RegisterType((*ListTopicSubscriptionsRequest)(nil), "google.pubsub.v1beta2.ListTopicSubscriptionsRequest") + proto.RegisterType((*ListTopicSubscriptionsResponse)(nil), "google.pubsub.v1beta2.ListTopicSubscriptionsResponse") + proto.RegisterType((*DeleteTopicRequest)(nil), "google.pubsub.v1beta2.DeleteTopicRequest") + proto.RegisterType((*Subscription)(nil), "google.pubsub.v1beta2.Subscription") + proto.RegisterType((*PushConfig)(nil), "google.pubsub.v1beta2.PushConfig") + proto.RegisterType((*ReceivedMessage)(nil), "google.pubsub.v1beta2.ReceivedMessage") + proto.RegisterType((*GetSubscriptionRequest)(nil), "google.pubsub.v1beta2.GetSubscriptionRequest") + proto.RegisterType((*ListSubscriptionsRequest)(nil), "google.pubsub.v1beta2.ListSubscriptionsRequest") + proto.RegisterType((*ListSubscriptionsResponse)(nil), "google.pubsub.v1beta2.ListSubscriptionsResponse") + proto.RegisterType((*DeleteSubscriptionRequest)(nil), "google.pubsub.v1beta2.DeleteSubscriptionRequest") + proto.RegisterType((*ModifyPushConfigRequest)(nil), "google.pubsub.v1beta2.ModifyPushConfigRequest") + proto.RegisterType((*PullRequest)(nil), "google.pubsub.v1beta2.PullRequest") + proto.RegisterType((*PullResponse)(nil), "google.pubsub.v1beta2.PullResponse") + proto.RegisterType((*ModifyAckDeadlineRequest)(nil), "google.pubsub.v1beta2.ModifyAckDeadlineRequest") + proto.RegisterType((*AcknowledgeRequest)(nil), "google.pubsub.v1beta2.AcknowledgeRequest") +} + +// 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 + +// Client API for Subscriber service + +type SubscriberClient interface { + // Creates a subscription to a given topic for a given subscriber. + // If the subscription already exists, returns ALREADY_EXISTS. + // If the corresponding topic doesn't exist, returns NOT_FOUND. + // + // If the name is not provided in the request, the server will assign a random + // name for this subscription on the same project as the topic. + CreateSubscription(ctx context.Context, in *Subscription, opts ...grpc.CallOption) (*Subscription, error) + // Gets the configuration details of a subscription. + GetSubscription(ctx context.Context, in *GetSubscriptionRequest, opts ...grpc.CallOption) (*Subscription, error) + // Lists matching subscriptions. + ListSubscriptions(ctx context.Context, in *ListSubscriptionsRequest, opts ...grpc.CallOption) (*ListSubscriptionsResponse, error) + // Deletes an existing subscription. All pending messages in the subscription + // are immediately dropped. Calls to Pull after deletion will return + // NOT_FOUND. After a subscription is deleted, a new one may be created with + // the same name, but the new one has no association with the old + // subscription, or its topic unless the same topic is specified. + DeleteSubscription(ctx context.Context, in *DeleteSubscriptionRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) + // Modifies the ack deadline for a specific message. This method is useful to + // indicate that more time is needed to process a message by the subscriber, + // or to make the message available for redelivery if the processing was + // interrupted. + ModifyAckDeadline(ctx context.Context, in *ModifyAckDeadlineRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) + // Acknowledges the messages associated with the ack tokens in the + // AcknowledgeRequest. The Pub/Sub system can remove the relevant messages + // from the subscription. + // + // Acknowledging a message whose ack deadline has expired may succeed, + // but such a message may be redelivered later. Acknowledging a message more + // than once will not result in an error. + Acknowledge(ctx context.Context, in *AcknowledgeRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) + // Pulls messages from the server. Returns an empty list if there are no + // messages available in the backlog. The server may return UNAVAILABLE if + // there are too many concurrent pull requests pending for the given + // subscription. + Pull(ctx context.Context, in *PullRequest, opts ...grpc.CallOption) (*PullResponse, error) + // Modifies the PushConfig for a specified subscription. + // + // This may be used to change a push subscription to a pull one (signified + // by an empty PushConfig) or vice versa, or change the endpoint URL and other + // attributes of a push subscription. Messages will accumulate for + // delivery continuously through the call regardless of changes to the + // PushConfig. + ModifyPushConfig(ctx context.Context, in *ModifyPushConfigRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) +} + +type subscriberClient struct { + cc *grpc.ClientConn +} + +func NewSubscriberClient(cc *grpc.ClientConn) SubscriberClient { + return &subscriberClient{cc} +} + +func (c *subscriberClient) CreateSubscription(ctx context.Context, in *Subscription, opts ...grpc.CallOption) (*Subscription, error) { + out := new(Subscription) + err := grpc.Invoke(ctx, "/google.pubsub.v1beta2.Subscriber/CreateSubscription", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *subscriberClient) GetSubscription(ctx context.Context, in *GetSubscriptionRequest, opts ...grpc.CallOption) (*Subscription, error) { + out := new(Subscription) + err := grpc.Invoke(ctx, "/google.pubsub.v1beta2.Subscriber/GetSubscription", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *subscriberClient) ListSubscriptions(ctx context.Context, in *ListSubscriptionsRequest, opts ...grpc.CallOption) (*ListSubscriptionsResponse, error) { + out := new(ListSubscriptionsResponse) + err := grpc.Invoke(ctx, "/google.pubsub.v1beta2.Subscriber/ListSubscriptions", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *subscriberClient) DeleteSubscription(ctx context.Context, in *DeleteSubscriptionRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) { + out := new(google_protobuf.Empty) + err := grpc.Invoke(ctx, "/google.pubsub.v1beta2.Subscriber/DeleteSubscription", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *subscriberClient) ModifyAckDeadline(ctx context.Context, in *ModifyAckDeadlineRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) { + out := new(google_protobuf.Empty) + err := grpc.Invoke(ctx, "/google.pubsub.v1beta2.Subscriber/ModifyAckDeadline", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *subscriberClient) Acknowledge(ctx context.Context, in *AcknowledgeRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) { + out := new(google_protobuf.Empty) + err := grpc.Invoke(ctx, "/google.pubsub.v1beta2.Subscriber/Acknowledge", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *subscriberClient) Pull(ctx context.Context, in *PullRequest, opts ...grpc.CallOption) (*PullResponse, error) { + out := new(PullResponse) + err := grpc.Invoke(ctx, "/google.pubsub.v1beta2.Subscriber/Pull", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *subscriberClient) ModifyPushConfig(ctx context.Context, in *ModifyPushConfigRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) { + out := new(google_protobuf.Empty) + err := grpc.Invoke(ctx, "/google.pubsub.v1beta2.Subscriber/ModifyPushConfig", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for Subscriber service + +type SubscriberServer interface { + // Creates a subscription to a given topic for a given subscriber. + // If the subscription already exists, returns ALREADY_EXISTS. + // If the corresponding topic doesn't exist, returns NOT_FOUND. + // + // If the name is not provided in the request, the server will assign a random + // name for this subscription on the same project as the topic. + CreateSubscription(context.Context, *Subscription) (*Subscription, error) + // Gets the configuration details of a subscription. + GetSubscription(context.Context, *GetSubscriptionRequest) (*Subscription, error) + // Lists matching subscriptions. + ListSubscriptions(context.Context, *ListSubscriptionsRequest) (*ListSubscriptionsResponse, error) + // Deletes an existing subscription. All pending messages in the subscription + // are immediately dropped. Calls to Pull after deletion will return + // NOT_FOUND. After a subscription is deleted, a new one may be created with + // the same name, but the new one has no association with the old + // subscription, or its topic unless the same topic is specified. + DeleteSubscription(context.Context, *DeleteSubscriptionRequest) (*google_protobuf.Empty, error) + // Modifies the ack deadline for a specific message. This method is useful to + // indicate that more time is needed to process a message by the subscriber, + // or to make the message available for redelivery if the processing was + // interrupted. + ModifyAckDeadline(context.Context, *ModifyAckDeadlineRequest) (*google_protobuf.Empty, error) + // Acknowledges the messages associated with the ack tokens in the + // AcknowledgeRequest. The Pub/Sub system can remove the relevant messages + // from the subscription. + // + // Acknowledging a message whose ack deadline has expired may succeed, + // but such a message may be redelivered later. Acknowledging a message more + // than once will not result in an error. + Acknowledge(context.Context, *AcknowledgeRequest) (*google_protobuf.Empty, error) + // Pulls messages from the server. Returns an empty list if there are no + // messages available in the backlog. The server may return UNAVAILABLE if + // there are too many concurrent pull requests pending for the given + // subscription. + Pull(context.Context, *PullRequest) (*PullResponse, error) + // Modifies the PushConfig for a specified subscription. + // + // This may be used to change a push subscription to a pull one (signified + // by an empty PushConfig) or vice versa, or change the endpoint URL and other + // attributes of a push subscription. Messages will accumulate for + // delivery continuously through the call regardless of changes to the + // PushConfig. + ModifyPushConfig(context.Context, *ModifyPushConfigRequest) (*google_protobuf.Empty, error) +} + +func RegisterSubscriberServer(s *grpc.Server, srv SubscriberServer) { + s.RegisterService(&_Subscriber_serviceDesc, srv) +} + +func _Subscriber_CreateSubscription_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Subscription) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SubscriberServer).CreateSubscription(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.pubsub.v1beta2.Subscriber/CreateSubscription", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SubscriberServer).CreateSubscription(ctx, req.(*Subscription)) + } + return interceptor(ctx, in, info, handler) +} + +func _Subscriber_GetSubscription_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetSubscriptionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SubscriberServer).GetSubscription(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.pubsub.v1beta2.Subscriber/GetSubscription", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SubscriberServer).GetSubscription(ctx, req.(*GetSubscriptionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Subscriber_ListSubscriptions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListSubscriptionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SubscriberServer).ListSubscriptions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.pubsub.v1beta2.Subscriber/ListSubscriptions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SubscriberServer).ListSubscriptions(ctx, req.(*ListSubscriptionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Subscriber_DeleteSubscription_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteSubscriptionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SubscriberServer).DeleteSubscription(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.pubsub.v1beta2.Subscriber/DeleteSubscription", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SubscriberServer).DeleteSubscription(ctx, req.(*DeleteSubscriptionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Subscriber_ModifyAckDeadline_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ModifyAckDeadlineRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SubscriberServer).ModifyAckDeadline(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.pubsub.v1beta2.Subscriber/ModifyAckDeadline", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SubscriberServer).ModifyAckDeadline(ctx, req.(*ModifyAckDeadlineRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Subscriber_Acknowledge_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AcknowledgeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SubscriberServer).Acknowledge(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.pubsub.v1beta2.Subscriber/Acknowledge", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SubscriberServer).Acknowledge(ctx, req.(*AcknowledgeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Subscriber_Pull_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PullRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SubscriberServer).Pull(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.pubsub.v1beta2.Subscriber/Pull", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SubscriberServer).Pull(ctx, req.(*PullRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Subscriber_ModifyPushConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ModifyPushConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SubscriberServer).ModifyPushConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.pubsub.v1beta2.Subscriber/ModifyPushConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SubscriberServer).ModifyPushConfig(ctx, req.(*ModifyPushConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Subscriber_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.pubsub.v1beta2.Subscriber", + HandlerType: (*SubscriberServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateSubscription", + Handler: _Subscriber_CreateSubscription_Handler, + }, + { + MethodName: "GetSubscription", + Handler: _Subscriber_GetSubscription_Handler, + }, + { + MethodName: "ListSubscriptions", + Handler: _Subscriber_ListSubscriptions_Handler, + }, + { + MethodName: "DeleteSubscription", + Handler: _Subscriber_DeleteSubscription_Handler, + }, + { + MethodName: "ModifyAckDeadline", + Handler: _Subscriber_ModifyAckDeadline_Handler, + }, + { + MethodName: "Acknowledge", + Handler: _Subscriber_Acknowledge_Handler, + }, + { + MethodName: "Pull", + Handler: _Subscriber_Pull_Handler, + }, + { + MethodName: "ModifyPushConfig", + Handler: _Subscriber_ModifyPushConfig_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/pubsub/v1beta2/pubsub.proto", +} + +// Client API for Publisher service + +type PublisherClient interface { + // Creates the given topic with the given name. + CreateTopic(ctx context.Context, in *Topic, opts ...grpc.CallOption) (*Topic, error) + // Adds one or more messages to the topic. Returns NOT_FOUND if the topic does + // not exist. + Publish(ctx context.Context, in *PublishRequest, opts ...grpc.CallOption) (*PublishResponse, error) + // Gets the configuration of a topic. + GetTopic(ctx context.Context, in *GetTopicRequest, opts ...grpc.CallOption) (*Topic, error) + // Lists matching topics. + ListTopics(ctx context.Context, in *ListTopicsRequest, opts ...grpc.CallOption) (*ListTopicsResponse, error) + // Lists the name of the subscriptions for this topic. + ListTopicSubscriptions(ctx context.Context, in *ListTopicSubscriptionsRequest, opts ...grpc.CallOption) (*ListTopicSubscriptionsResponse, error) + // Deletes the topic with the given name. Returns NOT_FOUND if the topic does + // not exist. After a topic is deleted, a new topic may be created with the + // same name; this is an entirely new topic with none of the old + // configuration or subscriptions. Existing subscriptions to this topic are + // not deleted. + DeleteTopic(ctx context.Context, in *DeleteTopicRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) +} + +type publisherClient struct { + cc *grpc.ClientConn +} + +func NewPublisherClient(cc *grpc.ClientConn) PublisherClient { + return &publisherClient{cc} +} + +func (c *publisherClient) CreateTopic(ctx context.Context, in *Topic, opts ...grpc.CallOption) (*Topic, error) { + out := new(Topic) + err := grpc.Invoke(ctx, "/google.pubsub.v1beta2.Publisher/CreateTopic", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *publisherClient) Publish(ctx context.Context, in *PublishRequest, opts ...grpc.CallOption) (*PublishResponse, error) { + out := new(PublishResponse) + err := grpc.Invoke(ctx, "/google.pubsub.v1beta2.Publisher/Publish", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *publisherClient) GetTopic(ctx context.Context, in *GetTopicRequest, opts ...grpc.CallOption) (*Topic, error) { + out := new(Topic) + err := grpc.Invoke(ctx, "/google.pubsub.v1beta2.Publisher/GetTopic", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *publisherClient) ListTopics(ctx context.Context, in *ListTopicsRequest, opts ...grpc.CallOption) (*ListTopicsResponse, error) { + out := new(ListTopicsResponse) + err := grpc.Invoke(ctx, "/google.pubsub.v1beta2.Publisher/ListTopics", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *publisherClient) ListTopicSubscriptions(ctx context.Context, in *ListTopicSubscriptionsRequest, opts ...grpc.CallOption) (*ListTopicSubscriptionsResponse, error) { + out := new(ListTopicSubscriptionsResponse) + err := grpc.Invoke(ctx, "/google.pubsub.v1beta2.Publisher/ListTopicSubscriptions", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *publisherClient) DeleteTopic(ctx context.Context, in *DeleteTopicRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) { + out := new(google_protobuf.Empty) + err := grpc.Invoke(ctx, "/google.pubsub.v1beta2.Publisher/DeleteTopic", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for Publisher service + +type PublisherServer interface { + // Creates the given topic with the given name. + CreateTopic(context.Context, *Topic) (*Topic, error) + // Adds one or more messages to the topic. Returns NOT_FOUND if the topic does + // not exist. + Publish(context.Context, *PublishRequest) (*PublishResponse, error) + // Gets the configuration of a topic. + GetTopic(context.Context, *GetTopicRequest) (*Topic, error) + // Lists matching topics. + ListTopics(context.Context, *ListTopicsRequest) (*ListTopicsResponse, error) + // Lists the name of the subscriptions for this topic. + ListTopicSubscriptions(context.Context, *ListTopicSubscriptionsRequest) (*ListTopicSubscriptionsResponse, error) + // Deletes the topic with the given name. Returns NOT_FOUND if the topic does + // not exist. After a topic is deleted, a new topic may be created with the + // same name; this is an entirely new topic with none of the old + // configuration or subscriptions. Existing subscriptions to this topic are + // not deleted. + DeleteTopic(context.Context, *DeleteTopicRequest) (*google_protobuf.Empty, error) +} + +func RegisterPublisherServer(s *grpc.Server, srv PublisherServer) { + s.RegisterService(&_Publisher_serviceDesc, srv) +} + +func _Publisher_CreateTopic_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Topic) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PublisherServer).CreateTopic(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.pubsub.v1beta2.Publisher/CreateTopic", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PublisherServer).CreateTopic(ctx, req.(*Topic)) + } + return interceptor(ctx, in, info, handler) +} + +func _Publisher_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.(PublisherServer).Publish(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.pubsub.v1beta2.Publisher/Publish", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PublisherServer).Publish(ctx, req.(*PublishRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Publisher_GetTopic_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetTopicRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PublisherServer).GetTopic(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.pubsub.v1beta2.Publisher/GetTopic", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PublisherServer).GetTopic(ctx, req.(*GetTopicRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Publisher_ListTopics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListTopicsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PublisherServer).ListTopics(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.pubsub.v1beta2.Publisher/ListTopics", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PublisherServer).ListTopics(ctx, req.(*ListTopicsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Publisher_ListTopicSubscriptions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListTopicSubscriptionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PublisherServer).ListTopicSubscriptions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.pubsub.v1beta2.Publisher/ListTopicSubscriptions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PublisherServer).ListTopicSubscriptions(ctx, req.(*ListTopicSubscriptionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Publisher_DeleteTopic_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteTopicRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PublisherServer).DeleteTopic(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.pubsub.v1beta2.Publisher/DeleteTopic", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PublisherServer).DeleteTopic(ctx, req.(*DeleteTopicRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Publisher_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.pubsub.v1beta2.Publisher", + HandlerType: (*PublisherServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateTopic", + Handler: _Publisher_CreateTopic_Handler, + }, + { + MethodName: "Publish", + Handler: _Publisher_Publish_Handler, + }, + { + MethodName: "GetTopic", + Handler: _Publisher_GetTopic_Handler, + }, + { + MethodName: "ListTopics", + Handler: _Publisher_ListTopics_Handler, + }, + { + MethodName: "ListTopicSubscriptions", + Handler: _Publisher_ListTopicSubscriptions_Handler, + }, + { + MethodName: "DeleteTopic", + Handler: _Publisher_DeleteTopic_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/pubsub/v1beta2/pubsub.proto", +} + +func init() { proto.RegisterFile("google/pubsub/v1beta2/pubsub.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 1107 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0x5f, 0x6f, 0xdb, 0x54, + 0x14, 0x97, 0x93, 0xfe, 0xcb, 0x71, 0x4a, 0xda,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54, 0xec, + 0xc8, 0x0d, 0x83, 0xa9, 0x96, 0xd1, 0x83, 0xee, 0x02, 0x4c, 0x18, 0xdb, 0xc0, 0x36, 0x95, 0x2a, + 0xf5, 0xaa, 0xc6, 0x29, 0x3d, 0xb3, 0xf9, 0x15, 0x34, 0xe6, 0xa4, 0xd1, 0x06, 0x54, 0xc7, 0x78, + 0xca, 0x03, 0x88, 0x3f, 0xd1, 0x2d, 0x58, 0x3e, 0xd7, 0x9d, 0x08, 0x2b, 0x15, 0x4a, 0x63, 0x87, + 0x2f, 0x2a, 0x9f, 0x4b, 0xea, 0xc7, 0xd0, 0x78, 0x81, 0x43, 0x1a, 0xb9, 0x86, 0xdf, 0x44, 0x98, + 0x84, 0x31, 0x73, 0x18, 0x9f, 0xb9, 0x02, 0x76, 0x50, 0x47, 0xf0, 0x5e, 0x3f, 0x1a, 0x3a, 0x36, + 0x19, 0x2d, 0xe4, 0x43, 0xdf, 0xc2, 0x1a, 0x77, 0x2e, 0x49, 0xc1, 0x83, 0x32, 0x29, 0xd0, 0x52, + 0x29, 0xb5, 0x0b, 0x8d, 0xd4, 0x12, 0xf1, 0x3d, 0x97, 0x60, 0xf4, 0x21, 0xc8, 0xb3, 0x1c, 0x10, + 0x45, 0xda, 0xad, 0xb6, 0x6a, 0x1a, 0xa4, 0x49, 0x20, 0xaa, 0x0d, 0x9b, 0xdf, 0xd9, 0x84, 0xc5, + 0x41, 0x12, 0x07, 0x15, 0x58, 0xf5, 0x03, 0xef, 0x27, 0x6c, 0x84, 0xdc, 0xc5, 0xe4, 0x88, 0x76, + 0xa0, 0xe6, 0xc7, 0xca, 0x88, 0xfd, 0x96, 0xe5, 0x64, 0x59, 0x5b, 0x8b, 0x09, 0x27, 0xf6, 0x5b, + 0x1c, 0x27, 0x9c, 0x5e, 0x86, 0xde, 0x18, 0xbb, 0x49, 0xc2, 0x63, 0xca, 0x69, 0x4c, 0x50, 0x03, + 0x40, 0x59, 0x53, 0xdc, 0xc3, 0x7d, 0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0xf8, 0x2f, 0x8d, 0x48, 0x91, 0xb3, + 0xdd, 0xbf, 0x97, 0xa0, 0xc6, 0x97, 0x5b, 0x1c, 0xa0, 0x1e, 0xc8, 0x0c, 0x09, 0xec, 0xcf, 0x63, + 0xe1, 0xce, 0xd8, 0x5c, 0x78, 0x8b, 0x7e, 0x80, 0x55, 0xae, 0x17, 0x7d, 0x24, 0x7e, 0x6b, 0x33, + 0xeb, 0x7b, 0x73, 0xef, 0x2a, 0x36, 0x9e, 0x8e, 0x3e, 0xac, 0x25, 0x7f, 0x08, 0x68, 0x4f, 0x8c, + 0xa3, 0xec, 0xda, 0x76, 0x85, 0xaf, 0x3a, 0xc0, 0x6c, 0x83, 0x46, 0xad, 0x05, 0x08, 0xc8, 0xed, + 0xf3, 0xcd, 0x87, 0x25, 0x38, 0xb9, 0xd3, 0xbf, 0x49, 0xb0, 0x55, 0xbc, 0xbe, 0xa2, 0xfd, 0xab, + 0xb4, 0x14, 0xe2, 0xf4, 0xb3, 0x6b, 0x4a, 0xa5, 0xc9, 0x93, 0x33, 0x5b, 0xad, 0xb0, 0xdd, 0x2f, + 0x6f, 0xbe, 0xa2, 0x0e, 0x3a, 0xb4, 0x60, 0xdb, 0xf0, 0x26, 0xc5, 0x7a, 0x0e, 0x65, 0xb6, 0x4f, + 0xf5, 0x63, 0x91, 0xbe, 0xf4, 0xea, 0x29, 0xe7, 0xb2, 0x3c, 0x47, 0x77, 0xad, 0xb6, 0x17, 0x58, + 0x1d, 0x0b, 0xbb, 0x54, 0x61, 0x87, 0x5d, 0xe9, 0xbe, 0x4d, 0xe6, 0x7e, 0xa5, 0x9f, 0xb2, 0xe3, + 0x70, 0x85, 0xf2, 0x7d, 0xfa, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe2, 0x2d, 0xb0, 0x67, 0x71, + 0x0f, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/rpc/code/code.pb.go b/vendor/google.golang.org/genproto/googleapis/rpc/code/code.pb.go new file mode 100644 index 0000000000..dbd73b37cd --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/rpc/code/code.pb.go @@ -0,0 +1,252 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/rpc/code.proto + +/* +Package code is a generated protocol buffer package. + +It is generated from these files: + google/rpc/code.proto + +It has these top-level messages: +*/ +package code + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// The canonical error codes for Google APIs. +// +// +// Sometimes multiple error codes may apply. Services should return +// the most specific error code that applies. For example, prefer +// `OUT_OF_RANGE` over `FAILED_PRECONDITION` if both codes apply. +// Similarly prefer `NOT_FOUND` or `ALREADY_EXISTS` over `FAILED_PRECONDITION`. +type Code int32 + +const ( + // Not an error; returned on success + // + // HTTP Mapping: 200 OK + Code_OK Code = 0 + // The operation was cancelled, typically by the caller. + // + // HTTP Mapping: 499 Client Closed Request + Code_CANCELLED Code = 1 + // Unknown error. For example, this error may be returned when + // a `Status` value received from another address space belongs to + // an error space that is not known in this address space. Also + // errors raised by APIs that do not return enough error information + // may be converted to this error. + // + // HTTP Mapping: 500 Internal Server Error + Code_UNKNOWN Code = 2 + // The client specified an invalid argument. Note that this differs + // from `FAILED_PRECONDITION`. `INVALID_ARGUMENT` indicates arguments + // that are problematic regardless of the state of the system + // (e.g., a malformed file name). + // + // HTTP Mapping: 400 Bad Request + Code_INVALID_ARGUMENT Code = 3 + // The deadline expired before the operation could complete. For operations + // that change the state of the system, this error may be returned + // even if the operation has completed successfully. For example, a + // successful response from a server could have been delayed long + // enough for the deadline to expire. + // + // HTTP Mapping: 504 Gateway Timeout + Code_DEADLINE_EXCEEDED Code = 4 + // Some requested entity (e.g., file or directory) was not found. + // + // Note to server developers: if a request is denied for an entire class + // of users, such as gradual feature rollout or undocumented whitelist, + // `NOT_FOUND` may be used. If a request is denied for some users within + // a class of users, such as user-based access control, `PERMISSION_DENIED` + // must be used. + // + // HTTP Mapping: 404 Not Found + Code_NOT_FOUND Code = 5 + // The entity that a client attempted to create (e.g., file or directory) + // already exists. + // + // HTTP Mapping: 409 Conflict + Code_ALREADY_EXISTS Code = 6 + // The caller does not have permission to execute the specified + // operation. `PERMISSION_DENIED` must not be used for rejections + // caused by exhausting some resource (use `RESOURCE_EXHAUSTED` + // instead for those errors). `PERMISSION_DENIED` must not be + // used if the caller can not be identified (use `UNAUTHENTICATED` + // instead for those errors). This error code does not imply the + // request is valid or the requested entity exists or satisfies + // other pre-conditions. + // + // HTTP Mapping: 403 Forbidden + Code_PERMISSION_DENIED Code = 7 + // The request does not have valid authentication credentials for the + // operation. + // + // HTTP Mapping: 401 Unauthorized + Code_UNAUTHENTICATED Code = 16 + // Some resource has been exhausted, perhaps a per-user quota, or + // perhaps the entire file system is out of space. + // + // HTTP Mapping: 429 Too Many Requests + Code_RESOURCE_EXHAUSTED Code = 8 + // The operation was rejected because the system is not in a state + // required for the operation's execution. For example, the directory + // to be deleted is non-empty, an rmdir operation is applied to + // a non-directory, etc. + // + // Service implementors can use the following guidelines to decide + // between `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`: + // (a) Use `UNAVAILABLE` if the client can retry just the failing call. + // (b) Use `ABORTED` if the client should retry at a higher level + // (e.g., when a client-specified test-and-set fails, indicating the + // client should restart a read-modify-write sequence). + // (c) Use `FAILED_PRECONDITION` if the client should not retry until + // the system state has been explicitly fixed. E.g., if an "rmdir" + // fails because the directory is non-empty, `FAILED_PRECONDITION` + // should be returned since the client should not retry unless + // the files are deleted from the directory. + // + // HTTP Mapping: 400 Bad Request + Code_FAILED_PRECONDITION Code = 9 + // The operation was aborted, typically due to a concurrency issue such as + // a sequencer check failure or transaction abort. + // + // See the guidelines above for deciding between `FAILED_PRECONDITION`, + // `ABORTED`, and `UNAVAILABLE`. + // + // HTTP Mapping: 409 Conflict + Code_ABORTED Code = 10 + // The operation was attempted past the valid range. E.g., seeking or + // reading past end-of-file. + // + // Unlike `INVALID_ARGUMENT`, this error indicates a problem that may + // be fixed if the system state changes. For example, a 32-bit file + // system will generate `INVALID_ARGUMENT` if asked to read at an + // offset that is not in the range [0,2^32-1], but it will generate + // `OUT_OF_RANGE` if asked to read from an offset past the current + // file size. + // + // There is a fair bit of overlap between `FAILED_PRECONDITION` and + // `OUT_OF_RANGE`. We recommend using `OUT_OF_RANGE` (the more specific + // error) when it applies so that callers who are iterating through + // a space can easily look for an `OUT_OF_RANGE` error to detect when + // they are done. + // + // HTTP Mapping: 400 Bad Request + Code_OUT_OF_RANGE Code = 11 + // The operation is not implemented or is not supported/enabled in this + // service. + // + // HTTP Mapping: 501 Not Implemented + Code_UNIMPLEMENTED Code = 12 + // Internal errors. This means that some invariants expected by the + // underlying system have been broken. This error code is reserved + // for serious errors. + // + // HTTP Mapping: 500 Internal Server Error + Code_INTERNAL Code = 13 + // The service is currently unavailable. This is most likely a + // transient condition, which can be corrected by retrying with + // a backoff. + // + // See the guidelines above for deciding between `FAILED_PRECONDITION`, + // `ABORTED`, and `UNAVAILABLE`. + // + // HTTP Mapping: 503 Service Unavailable + Code_UNAVAILABLE Code = 14 + // Unrecoverable data loss or corruption. + // + // HTTP Mapping: 500 Internal Server Error + Code_DATA_LOSS Code = 15 +) + +var Code_name = map[int32]string{ + 0: "OK", + 1: "CANCELLED", + 2: "UNKNOWN", + 3: "INVALID_ARGUMENT", + 4: "DEADLINE_EXCEEDED", + 5: "NOT_FOUND", + 6: "ALREADY_EXISTS", + 7: "PERMISSION_DENIED", + 16: "UNAUTHENTICATED", + 8: "RESOURCE_EXHAUSTED", + 9: "FAILED_PRECONDITION", + 10: "ABORTED", + 11: "OUT_OF_RANGE", + 12: "UNIMPLEMENTED", + 13: "INTERNAL", + 14: "UNAVAILABLE", + 15: "DATA_LOSS", +} +var Code_value = map[string]int32{ + "OK": 0, + "CANCELLED": 1, + "UNKNOWN": 2, + "INVALID_ARGUMENT": 3, + "DEADLINE_EXCEEDED": 4, + "NOT_FOUND": 5, + "ALREADY_EXISTS": 6, + "PERMISSION_DENIED": 7, + "UNAUTHENTICATED": 16, + "RESOURCE_EXHAUSTED": 8, + "FAILED_PRECONDITION": 9, + "ABORTED": 10, + "OUT_OF_RANGE": 11, + "UNIMPLEMENTED": 12, + "INTERNAL": 13, + "UNAVAILABLE": 14, + "DATA_LOSS": 15, +} + +func (x Code) String() string { + return proto.EnumName(Code_name, int32(x)) +} +func (Code) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func init() { + proto.RegisterEnum("google.rpc.Code", Code_name, Code_value) +} + +func init() { proto.RegisterFile("google/rpc/code.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 362 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x44, 0x51, 0xcd, 0x6e, 0x93, 0x31, + 0x10, 0xa4, 0x69, 0x49, 0x9b, 0xcd, 0xdf, 0xd6, 0xa5, 0xf0, 0x0e, 0x1c, 0x92, 0x43, 0x8f, 0x9c, + 0x36, 0x9f, 0x37, 0xad, 0x55, 0x67, 0xfd, 0xc9, 0x3f, 0x25, 0x70, 0xb1, 0x4a, 0x1a, 0x7d, 0x42, + 0x2a, 0x75, 0xf4, 0xc1, 0x13, 0xf1, 0x12, 0xbc, 0x1e, 0x72, 0x8b, 0xe8, 0xc5, 0x87, 0x99, 0xf1, + 0xee, 0xce, 0x0c, 0x5c, 0x76, 0xa5, 0x74, 0x8f, 0xfb, 0x65, 0x7f, 0xd8, 0x2d, 0x77, 0xe5, 0x61, + 0xbf, 0x38, 0xf4, 0xe5, 0x57, 0x51, 0xf0, 0x02, 0x2f, 0xfa, 0xc3, 0xee, 0xe3, 0x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0x23, 0x63, 0x69, 0x65, 0x19, 0x67, 0xd5, 0x90, 0xa6, 0x48, 0xd9, + 0xba, 0x10, 0x70, 0xbe, 0xda, 0xc2, 0x6c, 0x57, 0x7e, 0x2c, 0x5e, 0xb3, 0x5c, 0x8d, 0x6a, 0x90, + 0x6d, 0x8d, 0xb8, 0x3d, 0xfa, 0x7a, 0xf5, 0x8f, 0xe8, 0xca, 0xe3, 0xfd, 0x53, 0xb7, 0x28, 0x7d, + 0xb7, 0xec, 0xf6, 0x4f, 0xcf, 0x05, 0x2c, 0x5f, 0xa8, 0xfb, 0xc3, 0xf7, 0x9f, 0xff, 0xab, 0xf9, + 0x54, 0x9f, 0xdf, 0x83, 0x63, 0xdf, 0x36, 0xdf, 0x86, 0xcf, 0xaa, 0xab, 0xbf, 0x01, 0x00, 0x00, + 0xff, 0xff, 0x8e, 0x97, 0x77, 0xc2, 0xbf, 0x01, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/rpc/errdetails/error_details.pb.go b/vendor/google.golang.org/genproto/googleapis/rpc/errdetails/error_details.pb.go new file mode 100644 index 0000000000..068bfb2ed9 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/rpc/errdetails/error_details.pb.go @@ -0,0 +1,495 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/rpc/error_details.proto + +/* +Package errdetails is a generated protocol buffer package. + +It is generated from these files: + google/rpc/error_details.proto + +It has these top-level messages: + RetryInfo + DebugInfo + QuotaFailure + PreconditionFailure + BadRequest + RequestInfo + ResourceInfo + Help + LocalizedMessage +*/ +package errdetails + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import google_protobuf "github.com/golang/protobuf/ptypes/duration" + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Describes when the clients can retry a failed request. Clients could ignore +// the recommendation here or retry when this information is missing from error +// responses. +// +// It's always recommended that clients should use exponential backoff when +// retrying. +// +// Clients should wait until `retry_delay` amount of time has passed since +// receiving the error response before retrying. If retrying requests also +// fail, clients should use an exponential backoff scheme to gradually increase +// the delay between retries based on `retry_delay`, until either a maximum +// number of retires have been reached or a maximum retry delay cap has been +// reached. +type RetryInfo struct { + // Clients should wait at least this long between retrying the same request. + RetryDelay *google_protobuf.Duration `protobuf:"bytes,1,opt,name=retry_delay,json=retryDelay" json:"retry_delay,omitempty"` +} + +func (m *RetryInfo) Reset() { *m = RetryInfo{} } +func (m *RetryInfo) String() string { return proto.CompactTextString(m) } +func (*RetryInfo) ProtoMessage() {} +func (*RetryInfo) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *RetryInfo) GetRetryDelay() *google_protobuf.Duration { + if m != nil { + return m.RetryDelay + } + return nil +} + +// Describes additional debugging info. +type DebugInfo struct { + // The stack trace entries indicating where the error occurred. + StackEntries []string `protobuf:"bytes,1,rep,name=stack_entries,json=stackEntries" json:"stack_entries,omitempty"` + // Additional debugging information provided by the server. + Detail string `protobuf:"bytes,2,opt,name=detail" json:"detail,omitempty"` +} + +func (m *DebugInfo) Reset() { *m = DebugInfo{} } +func (m *DebugInfo) String() string { return proto.CompactTextString(m) } +func (*DebugInfo) ProtoMessage() {} +func (*DebugInfo) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *DebugInfo) GetStackEntries() []string { + if m != nil { + return m.StackEntries + } + return nil +} + +func (m *DebugInfo) GetDetail() string { + if m != nil { + return m.Detail + } + return "" +} + +// Describes how a quota check failed. +// +// For example if a daily limit was exceeded for the calling project, +// a service could respond with a QuotaFailure detail containing the project +// id and the description of the quota limit that was exceeded. If the +// calling project hasn't enabled the service in the developer console, then +// a service could respond with the project id and set `service_disabled` +// to true. +// +// Also see RetryDetail and Help types for other details about handling a +// quota failure. +type QuotaFailure struct { + // Describes all quota violations. + Violations []*QuotaFailure_Violation `protobuf:"bytes,1,rep,name=violations" json:"violations,omitempty"` +} + +func (m *QuotaFailure) Reset() { *m = QuotaFailure{} } +func (m *QuotaFailure) String() string { return proto.CompactTextString(m) } +func (*QuotaFailure) ProtoMessage() {} +func (*QuotaFailure) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *QuotaFailure) GetViolations() []*QuotaFailure_Violation { + if m != nil { + return m.Violations + } + return nil +} + +// A message type used to describe a single quota violation. For example, a +// daily quota or a custom quota that was exceeded. +type QuotaFailure_Violation struct { + // The subject on which the quota check failed. + // For example, "clientip:" or "project:". + Subject string `protobuf:"bytes,1,opt,name=subject" json:"subject,omitempty"` + // A description of how the quota check failed. Clients can use this + // description to find more about the quota configuration in the service's + // public documentation, or find the relevant quota limit to adjust through + // developer console. + // + // For example: "Service disabled" or "Daily Limit for read operations + // exceeded". + Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` +} + +func (m *QuotaFailure_Violation) Reset() { *m = QuotaFailure_Violation{} } +func (m *QuotaFailure_Violation) String() string { return proto.CompactTextString(m) } +func (*QuotaFailure_Violation) ProtoMessage() {} +func (*QuotaFailure_Violation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2, 0} } + +func (m *QuotaFailure_Violation) GetSubject() string { + if m != nil { + return m.Subject + } + return "" +} + +func (m *QuotaFailure_Violation) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +// Describes what preconditions have failed. +// +// For example, if an RPC failed because it required the Terms of Service to be +// acknowledged, it could list the terms of service violation in the +// PreconditionFailure message. +type PreconditionFailure struct { + // Describes all precondition violations. + Violations []*PreconditionFailure_Violation `protobuf:"bytes,1,rep,name=violations" json:"violations,omitempty"` +} + +func (m *PreconditionFailure) Reset() { *m = PreconditionFailure{} } +func (m *PreconditionFailure) String() string { return proto.CompactTextString(m) } +func (*PreconditionFailure) ProtoMessage() {} +func (*PreconditionFailure) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *PreconditionFailure) GetViolations() []*PreconditionFailure_Violation { + if m != nil { + return m.Violations + } + return nil +} + +// A message type used to describe a single precondition failure. +type PreconditionFailure_Violation struct { + // The type of PreconditionFailure. We recommend using a service-specific + // enum type to define the supported precondition violation types. For + // example, "TOS" for "Terms of Service violation". + Type string `protobuf:"bytes,1,opt,name=type" json:"type,omitempty"` + // The subject, relative to the type, that failed. + // For example, "google.com/cloud" relative to the "TOS" type would + // indicate which terms of service is being referenced. + Subject string `protobuf:"bytes,2,opt,name=subject" json:"subject,omitempty"` + // A description of how the precondition failed. Developers can use this + // description to understand how to fix the failure. + // + // For example: "Terms of service not accepted". + Description string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` +} + +func (m *PreconditionFailure_Violation) Reset() { *m = PreconditionFailure_Violation{} } +func (m *PreconditionFailure_Violation) String() string { return proto.CompactTextString(m) } +func (*PreconditionFailure_Violation) ProtoMessage() {} +func (*PreconditionFailure_Violation) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{3, 0} +} + +func (m *PreconditionFailure_Violation) GetType() string { + if m != nil { + return m.Type + } + return "" +} + +func (m *PreconditionFailure_Violation) GetSubject() string { + if m != nil { + return m.Subject + } + return "" +} + +func (m *PreconditionFailure_Violation) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +// Describes violations in a client request. This error type focuses on the +// syntactic aspects of the request. +type BadRequest struct { + // Describes all violations in a client request. + FieldViolations []*BadRequest_FieldViolation `protobuf:"bytes,1,rep,name=field_violations,json=fieldViolations" json:"field_violations,omitempty"` +} + +func (m *BadRequest) Reset() { *m = BadRequest{} } +func (m *BadRequest) String() string { return proto.CompactTextString(m) } +func (*BadRequest) ProtoMessage() {} +func (*BadRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *BadRequest) GetFieldViolations() []*BadRequest_FieldViolation { + if m != nil { + return m.FieldViolations + } + return nil +} + +// A message type used to describe a single bad request field. +type BadRequest_FieldViolation struct { + // A path leading to a field in the request body. The value will be a + // sequence of dot-separated identifiers that identify a protocol buffer + // field. E.g., "field_violations.field" would identify this field. + Field string `protobuf:"bytes,1,opt,name=field" json:"field,omitempty"` + // A description of why the request element is bad. + Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` +} + +func (m *BadRequest_FieldViolation) Reset() { *m = BadRequest_FieldViolation{} } +func (m *BadRequest_FieldViolation) String() string { return proto.CompactTextString(m) } +func (*BadRequest_FieldViolation) ProtoMessage() {} +func (*BadRequest_FieldViolation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4, 0} } + +func (m *BadRequest_FieldViolation) GetField() string { + if m != nil { + return m.Field + } + return "" +} + +func (m *BadRequest_FieldViolation) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +// Contains metadata about the request that clients can attach when filing a bug +// or providing other forms of feedback. +type RequestInfo struct { + // An opaque string that should only be interpreted by the service generating + // it. For example, it can be used to identify requests in the service's logs. + RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId" json:"request_id,omitempty"` + // Any data that was used to serve this request. For example, an encrypted + // stack trace that can be sent back to the service provider for debugging. + ServingData string `protobuf:"bytes,2,opt,name=serving_data,json=servingData" json:"serving_data,omitempty"` +} + +func (m *RequestInfo) Reset() { *m = RequestInfo{} } +func (m *RequestInfo) String() string { return proto.CompactTextString(m) } +func (*RequestInfo) ProtoMessage() {} +func (*RequestInfo) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *RequestInfo) GetRequestId() string { + if m != nil { + return m.RequestId + } + return "" +} + +func (m *RequestInfo) GetServingData() string { + if m != nil { + return m.ServingData + } + return "" +} + +// Describes the resource that is being accessed. +type ResourceInfo struct { + // A name for the type of resource being accessed, e.g. "sql table", + // "cloud storage bucket", "file", "Google calendar"; or the type URL + // of the resource: e.g. "type.googleapis.com/google.pubsub.v1.Topic". + ResourceType string `protobuf:"bytes,1,opt,name=resource_type,json=resourceType" json:"resource_type,omitempty"` + // The name of the resource being accessed. For example, a shared calendar + // name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current + // error is [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED]. + ResourceName string `protobuf:"bytes,2,opt,name=resource_name,json=resourceName" json:"resource_name,omitempty"` + // The owner of the resource (optional). + // For example, "user:" or "project:". + Owner string `protobuf:"bytes,3,opt,name=owner" json:"owner,omitempty"` + // Describes what error is encountered when accessing this resource. + // For example, updating a cloud project may require the `writer` permission + // on the developer console project. + Description string `protobuf:"bytes,4,opt,name=description" json:"description,omitempty"` +} + +func (m *ResourceInfo) Reset() { *m = ResourceInfo{} } +func (m *ResourceInfo) String() string { return proto.CompactTextString(m) } +func (*ResourceInfo) ProtoMessage() {} +func (*ResourceInfo) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *ResourceInfo) GetResourceType() string { + if m != nil { + return m.ResourceType + } + return "" +} + +func (m *ResourceInfo) GetResourceName() string { + if m != nil { + return m.ResourceName + } + return "" +} + +func (m *ResourceInfo) GetOwner() string { + if m != nil { + return m.Owner + } + return "" +} + +func (m *ResourceInfo) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +// Provides links to documentation or for performing an out of band action. +// +// For example, if a quota check failed with an error indicating the calling +// project hasn't enabled the accessed service, this can contain a URL pointing +// directly to the right place in the developer console to flip the bit. +type Help struct { + // URL(s) pointing to additional information on handling the current error. + Links []*Help_Link `protobuf:"bytes,1,rep,name=links" json:"links,omitempty"` +} + +func (m *Help) Reset() { *m = Help{} } +func (m *Help) String() string { return proto.CompactTextString(m) } +func (*Help) ProtoMessage() {} +func (*Help) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *Help) GetLinks() []*Help_Link { + if m != nil { + return m.Links + } + return nil +} + +// Describes a URL link. +type Help_Link struct { + // Describes what the link offers. + Description string `protobuf:"bytes,1,opt,name=description" json:"description,omitempty"` + // The URL of the link. + Url string `protobuf:"bytes,2,opt,name=url" json:"url,omitempty"` +} + +func (m *Help_Link) Reset() { *m = Help_Link{} } +func (m *Help_Link) String() string { return proto.CompactTextString(m) } +func (*Help_Link) ProtoMessage() {} +func (*Help_Link) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7, 0} } + +func (m *Help_Link) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *Help_Link) GetUrl() string { + if m != nil { + return m.Url + } + return "" +} + +// Provides a localized error message that is safe to return to the user +// which can be attached to an RPC error. +type LocalizedMessage struct { + // The locale used following the specification defined at + // http://www.rfc-editor.org/rfc/bcp/bcp47.txt. + // Examples are: "en-US", "fr-CH", "es-MX" + Locale string `protobuf:"bytes,1,opt,name=locale" json:"locale,omitempty"` + // The localized error message in the above locale. + Message string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"` +} + +func (m *LocalizedMessage) Reset() { *m = LocalizedMessage{} } +func (m *LocalizedMessage) String() string { return proto.CompactTextString(m) } +func (*LocalizedMessage) ProtoMessage() {} +func (*LocalizedMessage) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *LocalizedMessage) GetLocale() string { + if m != nil { + return m.Locale + } + return "" +} + +func (m *LocalizedMessage) GetMessage() string { + if m != nil { + return m.Message + } + return "" +} + +func init() { + proto.RegisterType((*RetryInfo)(nil), "google.rpc.RetryInfo") + proto.RegisterType((*DebugInfo)(nil), "google.rpc.DebugInfo") + proto.RegisterType((*QuotaFailure)(nil), "google.rpc.QuotaFailure") + proto.RegisterType((*QuotaFailure_Violation)(nil), "google.rpc.QuotaFailure.Violation") + proto.RegisterType((*PreconditionFailure)(nil), "google.rpc.PreconditionFailure") + proto.RegisterType((*PreconditionFailure_Violation)(nil), "google.rpc.PreconditionFailure.Violation") + proto.RegisterType((*BadRequest)(nil), "google.rpc.BadRequest") + proto.RegisterType((*BadRequest_FieldViolation)(nil), "google.rpc.BadRequest.FieldViolation") + proto.RegisterType((*RequestInfo)(nil), "google.rpc.RequestInfo") + proto.RegisterType((*ResourceInfo)(nil), "google.rpc.ResourceInfo") + proto.RegisterType((*Help)(nil), "google.rpc.Help") + proto.RegisterType((*Help_Link)(nil), "google.rpc.Help.Link") + proto.RegisterType((*LocalizedMessage)(nil), "google.rpc.LocalizedMessage") +} + +func init() { proto.RegisterFile("google/rpc/error_details.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 595 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xcd, 0x6e, 0xd3, 0x4c, + 0x14, 0x95, 0x9b, 0xb4, 0x9f, 0x7c, 0x93, 0xaf, 0x14, 0xf3, 0xa3, 0x10, 0x09, 0x14, 0x8c, 0x90, + 0x8a, 0x90, 0x1c, 0xa9, 0xec, 0xca, 0x02, 0x29, 0xb8, 0x7f, 0x52, 0x81, 0x60, 0x21, 0x16, 0xb0, + 0xb0, 0x26, 0xf6, 0x8d, 0x35, 0x74, 0xe2, 0x31, 0x33, 0xe3, 0xa2, 0xf0, 0x14, 0xec, 0xd9, 0xb1, + 0xe2, 0x25, 0x78, 0x37, 0x34, 0x9e, 0x99, 0xc6, 0x6d, 0x0a, 0x62, 0x37, 0xe7, 0xcc, 0x99, 0xe3, + 0x73, 0xaf, 0xae, 0x2f, 0x3c, 0x28, 0x38, 0x2f, 0x18, 0x8e, 0x45, 0x95, 0x8d, 0x51, 0x08, 0x2e, + 0xd2, 0x1c, 0x15, 0xa1, 0x4c, 0x46, 0x95, 0xe0, 0x8a, 0x07, 0x60, 0xee, 0x23, 0x51, 0x65, 0x43, + 0xa7, 0x6d, 0x6e, 0x66, 0xf5, 0x7c, 0x9c, 0xd7, 0x82, 0x28, 0xca, 0x4b, 0xa3, 0x0d, 0x8f, 0xc0, + 0x4f, 0x50, 0x89, 0xe5, 0x49, 0x39, 0xe7, 0xc1, 0x3e, 0xf4, 0x84, 0x06, 0x69, 0x8e, 0x8c, 0x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0x91, 0x69, 0xce, 0xd5, + 0x6f, 0x91, 0x9e, 0xb3, 0x85, 0x91, 0xb8, 0x39, 0xb3, 0x70, 0xc2, 0x60, 0x3b, 0xe3, 0x8b, 0x56, + 0xc8, 0xc9, 0xcd, 0x03, 0xbd, 0x89, 0x62, 0xb3, 0x88, 0xa6, 0x7a, 0x55, 0x4c, 0xbd, 0x0f, 0x2f, + 0xac, 0xa0, 0xe0, 0x8c, 0x94, 0x45, 0xc4, 0x45, 0x31, 0x2e, 0xb0, 0x6c, 0x16, 0xc9, 0xd8, 0x5c, + 0x91, 0x8a, 0x4a, 0xb7, 0xc8, 0xec, 0x16, 0x7b, 0xbe, 0x3a, 0xfe, 0xd8, 0xe8, 0x24, 0xd3, 0x97, + 0xb3, 0xad, 0xe6, 0xc5, 0xb3, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x90, 0x15, 0x46, 0x2d, 0xf9, + 0x04, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/rpc/status/status.pb.go b/vendor/google.golang.org/genproto/googleapis/rpc/status/status.pb.go new file mode 100644 index 0000000000..8867ae7812 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/rpc/status/status.pb.go @@ -0,0 +1,143 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/rpc/status.proto + +/* +Package status is a generated protocol buffer package. + +It is generated from these files: + google/rpc/status.proto + +It has these top-level messages: + Status +*/ +package status + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import google_protobuf "github.com/golang/protobuf/ptypes/any" + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// The `Status` type defines a logical error model that is suitable for different +// programming environments, including REST APIs and RPC APIs. It is used by +// [gRPC](https://github.com/grpc). The error model is designed to be: +// +// - Simple to use and understand for most users +// - Flexible enough to meet unexpected needs +// +// # Overview +// +// The `Status` message contains three pieces of data: error code, error message, +// and error details. The error code should be an enum value of +// [google.rpc.Code][google.rpc.Code], but it may accept additional error codes if needed. The +// error message should be a developer-facing English message that helps +// developers *understand* and *resolve* the error. If a localized user-facing +// error message is needed, put the localized message in the error details or +// localize it in the client. The optional error details may contain arbitrary +// information about the error. There is a predefined set of error detail types +// in the package `google.rpc` that can be used for common error conditions. +// +// # Language mapping +// +// The `Status` message is the logical representation of the error model, but it +// is not necessarily the actual wire format. When the `Status` message is +// exposed in different client libraries and different wire protocols, it can be +// mapped differently. For example, it will likely be mapped to some exceptions +// in Java, but more likely mapped to some error codes in C. +// +// # Other uses +// +// The error model and the `Status` message can be used in a variety of +// environments, either with or without APIs, to provide a +// consistent developer experience across different environments. +// +// Example uses of this error model include: +// +// - Partial errors. If a service needs to return partial errors to the client, +// it may embed the `Status` in the normal response to indicate the partial +// errors. +// +// - Workflow errors. A typical workflow has multiple steps. Each step may +// have a `Status` message for error reporting. +// +// - Batch operations. If a client uses batch request and batch response, the +// `Status` message should be used directly inside batch response, one for +// each error sub-response. +// +// - Asynchronous operations. If an API call embeds asynchronous operation +// results in its response, the status of those operations should be +// represented directly using the `Status` message. +// +// - Logging. If some API errors are stored in logs, the message `Status` could +// be used directly after any stripping needed for security/privacy reasons. +type Status struct { + // The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + Code int32 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"` + // A developer-facing error message, which should be in English. Any + // user-facing error message should be localized and sent in the + // [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + Message string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"` + // A list of messages that carry the error details. There is a common set of + // message types for APIs to use. + Details []*google_protobuf.Any `protobuf:"bytes,3,rep,name=details" json:"details,omitempty"` +} + +func (m *Status) Reset() { *m = Status{} } +func (m *Status) String() string { return proto.CompactTextString(m) } +func (*Status) ProtoMessage() {} +func (*Status) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *Status) GetCode() int32 { + if m != nil { + return m.Code + } + return 0 +} + +func (m *Status) GetMessage() string { + if m != nil { + return m.Message + } + return "" +} + +func (m *Status) GetDetails() []*google_protobuf.Any { + if m != nil { + return m.Details + } + return nil +} + +func init() { + proto.RegisterType((*Status)(nil), "google.rpc.Status") +} + +func init() { proto.RegisterFile("google/rpc/status.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 209 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4f, 0xcf, 0xcf, 0x4f, + 0xcf, 0x49, 0xd5, 0x2f, 0x2a, 0x48, 0xd6, 0x2f, 0x2e, 0x49, 0x2c, 0x29, 0x2d, 0xd6, 0x2b, 0x28, + 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x82, 0x48, 0xe8, 0x15, 0x15, 0x24, 0x4b, 0x49, 0x42, 0x15, 0x81, + 0x65, 0x92, 0x4a, 0xd3, 0xf4, 0x13, 0xf3, 0x2a, 0x21, 0xca, 0x94, 0xd2, 0xb8, 0xd8, 0x82, 0xc1, + 0xda, 0x84, 0x84, 0xb8, 0x58, 0x92, 0xf3, 0x53, 0x52, 0x25, 0x18, 0x15, 0x18, 0x35, 0x58, 0x83, + 0xc0, 0x6c, 0x21, 0x09, 0x2e, 0xf6, 0xdc, 0xd4, 0xe2, 0xe2, 0xc4, 0xf4, 0x54, 0x09, 0x26, 0x05, + 0x46, 0x0d, 0xce, 0x20, 0x18, 0x57, 0x48, 0x8f, 0x8b, 0x3d, 0x25, 0xb5, 0x24, 0x31, 0x33, 0xa7, + 0x58, 0x82, 0x59, 0x81, 0x59, 0x83, 0xdb, 0x48, 0x44, 0x0f, 0x6a, 0x21, 0xcc, 0x12, 0x3d, 0xc7, + 0xbc, 0xca, 0x20, 0x98, 0x22, 0xa7, 0x38, 0x2e, 0xbe, 0xe4, 0xfc, 0x5c, 0x3d, 0x84, 0xa3, 0x9c, + 0xb8, 0x21, 0xf6, 0x06, 0x80, 0x94, 0x07, 0x30, 0x46, 0x99, 0x43, 0xa5, 0xd2, 0xf3, 0x73, 0x12, + 0xf3, 0xd2, 0xf5, 0xf2, 0x8b, 0xd2, 0xf5, 0xd3, 0x53, 0xf3, 0xc0, 0x86, 0xe9, 0x43, 0xa4, 0x12, + 0x0b, 0x32, 0x8b, 0x91, 0xfc, 0x69, 0x0d, 0xa1, 0x16, 0x31, 0x31, 0x07, 0x05, 0x38, 0x27, 0xb1, + 0x81, 0x55, 0x1a, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xa4, 0x53, 0xf0, 0x7c, 0x10, 0x01, 0x00, + 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/spanner/admin/database/v1/spanner_database_admin.pb.go b/vendor/google.golang.org/genproto/googleapis/spanner/admin/database/v1/spanner_database_admin.pb.go new file mode 100644 index 0000000000..93f12e105e --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/spanner/admin/database/v1/spanner_database_admin.pb.go @@ -0,0 +1,922 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/spanner/admin/database/v1/spanner_database_admin.proto + +/* +Package database is a generated protocol buffer package. + +It is generated from these files: + google/spanner/admin/database/v1/spanner_database_admin.proto + +It has these top-level messages: + Database + ListDatabasesRequest + ListDatabasesResponse + CreateDatabaseRequest + CreateDatabaseMetadata + GetDatabaseRequest + UpdateDatabaseDdlRequest + UpdateDatabaseDdlMetadata + DropDatabaseRequest + GetDatabaseDdlRequest + GetDatabaseDdlResponse +*/ +package database + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_iam_v11 "google.golang.org/genproto/googleapis/iam/v1" +import google_iam_v1 "google.golang.org/genproto/googleapis/iam/v1" +import google_longrunning "google.golang.org/genproto/googleapis/longrunning" +import google_protobuf2 "github.com/golang/protobuf/ptypes/empty" +import google_protobuf3 "github.com/golang/protobuf/ptypes/timestamp" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Indicates the current state of the database. +type Database_State int32 + +const ( + // Not specified. + Database_STATE_UNSPECIFIED Database_State = 0 + // The database is still being created. Operations on the database may fail + // with `FAILED_PRECONDITION` in this state. + Database_CREATING Database_State = 1 + // The database is fully created and ready for use. + Database_READY Database_State = 2 +) + +var Database_State_name = map[int32]string{ + 0: "STATE_UNSPECIFIED", + 1: "CREATING", + 2: "READY", +} +var Database_State_value = map[string]int32{ + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "READY": 2, +} + +func (x Database_State) String() string { + return proto.EnumName(Database_State_name, int32(x)) +} +func (Database_State) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 0} } + +// A Cloud Spanner database. +type Database struct { + // Required. The name of the database. Values are of the form + // `projects//instances//databases/`, + // where `` is as specified in the `CREATE DATABASE` + // statement. This name can be passed to other API methods to + // identify the database. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Output only. The current database state. + State Database_State `protobuf:"varint,2,opt,name=state,enum=google.spanner.admin.database.v1.Database_State" json:"state,omitempty"` +} + +func (m *Database) Reset() { *m = Database{} } +func (m *Database) String() string { return proto.CompactTextString(m) } +func (*Database) ProtoMessage() {} +func (*Database) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *Database) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Database) GetState() Database_State { + if m != nil { + return m.State + } + return Database_STATE_UNSPECIFIED +} + +// The request for [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases]. +type ListDatabasesRequest struct { + // Required. The instance whose databases should be listed. + // Values are of the form `projects//instances/`. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // Number of databases to be returned in the response. If 0 or less, + // defaults to the server's maximum allowed page size. + PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // If non-empty, `page_token` should contain a + // [next_page_token][google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token] from a + // previous [ListDatabasesResponse][google.spanner.admin.database.v1.ListDatabasesResponse]. + PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListDatabasesRequest) Reset() { *m = ListDatabasesRequest{} } +func (m *ListDatabasesRequest) String() string { return proto.CompactTextString(m) } +func (*ListDatabasesRequest) ProtoMessage() {} +func (*ListDatabasesRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *ListDatabasesRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *ListDatabasesRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListDatabasesRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// The response for [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases]. +type ListDatabasesResponse struct { + // Databases that matched the request. + Databases []*Database `protobuf:"bytes,1,rep,name=databases" json:"databases,omitempty"` + // `next_page_token` can be sent in a subsequent + // [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases] call to fetch more + // of the matching databases. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListDatabasesResponse) Reset() { *m = ListDatabasesResponse{} } +func (m *ListDatabasesResponse) String() string { return proto.CompactTextString(m) } +func (*ListDatabasesResponse) ProtoMessage() {} +func (*ListDatabasesResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *ListDatabasesResponse) GetDatabases() []*Database { + if m != nil { + return m.Databases + } + return nil +} + +func (m *ListDatabasesResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// The request for [CreateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.CreateDatabase]. +type CreateDatabaseRequest struct { + // Required. The name of the instance that will serve the new database. + // Values are of the form `projects//instances/`. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // Required. A `CREATE DATABASE` statement, which specifies the ID of the + // new database. The database ID must conform to the regular expression + // `[a-z][a-z0-9_\-]*[a-z0-9]` and be between 2 and 30 characters in length. + // If the database ID is a reserved word or if it contains a hyphen, the + // database ID must be enclosed in backticks (`` ` ``). + CreateStatement string `protobuf:"bytes,2,opt,name=create_statement,json=createStatement" json:"create_statement,omitempty"` + // An optional list of DDL statements to run inside the newly created + // database. Statements can create tables, indexes, etc. These + // statements execute atomically with the creation of the database: + // if there is an error in any statement, the database is not created. + ExtraStatements []string `protobuf:"bytes,3,rep,name=extra_statements,json=extraStatements" json:"extra_statements,omitempty"` +} + +func (m *CreateDatabaseRequest) Reset() { *m = CreateDatabaseRequest{} } +func (m *CreateDatabaseRequest) String() string { return proto.CompactTextString(m) } +func (*CreateDatabaseRequest) ProtoMessage() {} +func (*CreateDatabaseRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *CreateDatabaseRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *CreateDatabaseRequest) GetCreateStatement() string { + if m != nil { + return m.CreateStatement + } + return "" +} + +func (m *CreateDatabaseRequest) GetExtraStatements() []string { + if m != nil { + return m.ExtraStatements + } + return nil +} + +// Metadata type for the operation returned by +// [CreateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.CreateDatabase]. +type CreateDatabaseMetadata struct { + // The database being created. + Database string `protobuf:"bytes,1,opt,name=database" json:"database,omitempty"` +} + +func (m *CreateDatabaseMetadata) Reset() { *m = CreateDatabaseMetadata{} } +func (m *CreateDatabaseMetadata) String() string { return proto.CompactTextString(m) } +func (*CreateDatabaseMetadata) ProtoMessage() {} +func (*CreateDatabaseMetadata) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *CreateDatabaseMetadata) GetDatabase() string { + if m != nil { + return m.Database + } + return "" +} + +// The request for [GetDatabase][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabase]. +type GetDatabaseRequest struct { + // Required. The name of the requested database. Values are of the form + // `projects//instances//databases/`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetDatabaseRequest) Reset() { *m = GetDatabaseRequest{} } +func (m *GetDatabaseRequest) String() string { return proto.CompactTextString(m) } +func (*GetDatabaseRequest) ProtoMessage() {} +func (*GetDatabaseRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *GetDatabaseRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Enqueues the given DDL statements to be applied, in order but not +// necessarily all at once, to the database schema at some point (or +// points) in the future. The server checks that the statements +// are executable (syntactically valid, name tables that exist, etc.) +// before enqueueing them, but they may still fail upon +// later execution (e.g., if a statement from another batch of +// statements is applied first and it conflicts in some way, or if +// there is some data-related problem like a `NULL` value in a column to +// which `NOT NULL` would be added). If a statement fails, all +// subsequent statements in the batch are automatically cancelled. +// +// Each batch of statements is assigned a name which can be used with +// the [Operations][google.longrunning.Operations] API to monitor +// progress. See the +// [operation_id][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.operation_id] field for more +// details. +type UpdateDatabaseDdlRequest struct { + // Required. The database to update. + Database string `protobuf:"bytes,1,opt,name=database" json:"database,omitempty"` + // DDL statements to be applied to the database. + Statements []string `protobuf:"bytes,2,rep,name=statements" json:"statements,omitempty"` + // If empty, the new update request is assigned an + // automatically-generated operation ID. Otherwise, `operation_id` + // is used to construct the name of the resulting + // [Operation][google.longrunning.Operation]. + // + // Specifying an explicit operation ID simplifies determining + // whether the statements were executed in the event that the + // [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] call is replayed, + // or the return value is otherwise lost: the [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] and + // `operation_id` fields can be combined to form the + // [name][google.longrunning.Operation.name] of the resulting + // [longrunning.Operation][google.longrunning.Operation]: `/operations/`. + // + // `operation_id` should be unique within the database, and must be + // a valid identifier: `[a-z][a-z0-9_]*`. Note that + // automatically-generated operation IDs always begin with an + // underscore. If the named operation already exists, + // [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] returns + // `ALREADY_EXISTS`. + OperationId string `protobuf:"bytes,3,opt,name=operation_id,json=operationId" json:"operation_id,omitempty"` +} + +func (m *UpdateDatabaseDdlRequest) Reset() { *m = UpdateDatabaseDdlRequest{} } +func (m *UpdateDatabaseDdlRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateDatabaseDdlRequest) ProtoMessage() {} +func (*UpdateDatabaseDdlRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *UpdateDatabaseDdlRequest) GetDatabase() string { + if m != nil { + return m.Database + } + return "" +} + +func (m *UpdateDatabaseDdlRequest) GetStatements() []string { + if m != nil { + return m.Statements + } + return nil +} + +func (m *UpdateDatabaseDdlRequest) GetOperationId() string { + if m != nil { + return m.OperationId + } + return "" +} + +// Metadata type for the operation returned by +// [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]. +type UpdateDatabaseDdlMetadata struct { + // The database being modified. + Database string `protobuf:"bytes,1,opt,name=database" json:"database,omitempty"` + // For an update this list contains all the statements. For an + // individual statement, this list contains only that statement. + Statements []string `protobuf:"bytes,2,rep,name=statements" json:"statements,omitempty"` + // Reports the commit timestamps of all statements that have + // succeeded so far, where `commit_timestamps[i]` is the commit + // timestamp for the statement `statements[i]`. + CommitTimestamps []*google_protobuf3.Timestamp `protobuf:"bytes,3,rep,name=commit_timestamps,json=commitTimestamps" json:"commit_timestamps,omitempty"` +} + +func (m *UpdateDatabaseDdlMetadata) Reset() { *m = UpdateDatabaseDdlMetadata{} } +func (m *UpdateDatabaseDdlMetadata) String() string { return proto.CompactTextString(m) } +func (*UpdateDatabaseDdlMetadata) ProtoMessage() {} +func (*UpdateDatabaseDdlMetadata) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *UpdateDatabaseDdlMetadata) GetDatabase() string { + if m != nil { + return m.Database + } + return "" +} + +func (m *UpdateDatabaseDdlMetadata) GetStatements() []string { + if m != nil { + return m.Statements + } + return nil +} + +func (m *UpdateDatabaseDdlMetadata) GetCommitTimestamps() []*google_protobuf3.Timestamp { + if m != nil { + return m.CommitTimestamps + } + return nil +} + +// The request for [DropDatabase][google.spanner.admin.database.v1.DatabaseAdmin.DropDatabase]. +type DropDatabaseRequest struct { + // Required. The database to be dropped. + Database string `protobuf:"bytes,1,opt,name=database" json:"database,omitempty"` +} + +func (m *DropDatabaseRequest) Reset() { *m = DropDatabaseRequest{} } +func (m *DropDatabaseRequest) String() string { return proto.CompactTextString(m) } +func (*DropDatabaseRequest) ProtoMessage() {} +func (*DropDatabaseRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *DropDatabaseRequest) GetDatabase() string { + if m != nil { + return m.Database + } + return "" +} + +// The request for [GetDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdl]. +type GetDatabaseDdlRequest struct { + // Required. The database whose schema we wish to get. + Database string `protobuf:"bytes,1,opt,name=database" json:"database,omitempty"` +} + +func (m *GetDatabaseDdlRequest) Reset() { *m = GetDatabaseDdlRequest{} } +func (m *GetDatabaseDdlRequest) String() string { return proto.CompactTextString(m) } +func (*GetDatabaseDdlRequest) ProtoMessage() {} +func (*GetDatabaseDdlRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *GetDatabaseDdlRequest) GetDatabase() string { + if m != nil { + return m.Database + } + return "" +} + +// The response for [GetDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdl]. +type GetDatabaseDdlResponse struct { + // A list of formatted DDL statements defining the schema of the database + // specified in the request. + Statements []string `protobuf:"bytes,1,rep,name=statements" json:"statements,omitempty"` +} + +func (m *GetDatabaseDdlResponse) Reset() { *m = GetDatabaseDdlResponse{} } +func (m *GetDatabaseDdlResponse) String() string { return proto.CompactTextString(m) } +func (*GetDatabaseDdlResponse) ProtoMessage() {} +func (*GetDatabaseDdlResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *GetDatabaseDdlResponse) GetStatements() []string { + if m != nil { + return m.Statements + } + return nil +} + +func init() { + proto.RegisterType((*Database)(nil), "google.spanner.admin.database.v1.Database") + proto.RegisterType((*ListDatabasesRequest)(nil), "google.spanner.admin.database.v1.ListDatabasesRequest") + proto.RegisterType((*ListDatabasesResponse)(nil), "google.spanner.admin.database.v1.ListDatabasesResponse") + proto.RegisterType((*CreateDatabaseRequest)(nil), "google.spanner.admin.database.v1.CreateDatabaseRequest") + proto.RegisterType((*CreateDatabaseMetadata)(nil), "google.spanner.admin.database.v1.CreateDatabaseMetadata") + proto.RegisterType((*GetDatabaseRequest)(nil), "google.spanner.admin.database.v1.GetDatabaseRequest") + proto.RegisterType((*UpdateDatabaseDdlRequest)(nil), "google.spanner.admin.database.v1.UpdateDatabaseDdlRequest") + proto.RegisterType((*UpdateDatabaseDdlMetadata)(nil), "google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata") + proto.RegisterType((*DropDatabaseRequest)(nil), "google.spanner.admin.database.v1.DropDatabaseRequest") + proto.RegisterType((*GetDatabaseDdlRequest)(nil), "google.spanner.admin.database.v1.GetDatabaseDdlRequest") + proto.RegisterType((*GetDatabaseDdlResponse)(nil), "google.spanner.admin.database.v1.GetDatabaseDdlResponse") + proto.RegisterEnum("google.spanner.admin.database.v1.Database_State", Database_State_name, Database_State_value) +} + +// 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 + +// Client API for DatabaseAdmin service + +type DatabaseAdminClient interface { + // Lists Cloud Spanner databases. + ListDatabases(ctx context.Context, in *ListDatabasesRequest, opts ...grpc.CallOption) (*ListDatabasesResponse, error) + // Creates a new Cloud Spanner database and starts to prepare it for serving. + // The returned [long-running operation][google.longrunning.Operation] will + // have a name of the format `/operations/` and + // can be used to track preparation of the database. The + // [metadata][google.longrunning.Operation.metadata] field type is + // [CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata]. The + // [response][google.longrunning.Operation.response] field type is + // [Database][google.spanner.admin.database.v1.Database], if successful. + CreateDatabase(ctx context.Context, in *CreateDatabaseRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Gets the state of a Cloud Spanner database. + GetDatabase(ctx context.Context, in *GetDatabaseRequest, opts ...grpc.CallOption) (*Database, error) + // Updates the schema of a Cloud Spanner database by + // creating/altering/dropping tables, columns, indexes, etc. The returned + // [long-running operation][google.longrunning.Operation] will have a name of + // the format `/operations/` and can be used to + // track execution of the schema change(s). The + // [metadata][google.longrunning.Operation.metadata] field type is + // [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata]. The operation has no response. + UpdateDatabaseDdl(ctx context.Context, in *UpdateDatabaseDdlRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Drops (aka deletes) a Cloud Spanner database. + DropDatabase(ctx context.Context, in *DropDatabaseRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) + // Returns the schema of a Cloud Spanner database as a list of formatted + // DDL statements. This method does not show pending schema updates, those may + // be queried using the [Operations][google.longrunning.Operations] API. + GetDatabaseDdl(ctx context.Context, in *GetDatabaseDdlRequest, opts ...grpc.CallOption) (*GetDatabaseDdlResponse, error) + // Sets the access control policy on a database resource. Replaces any + // existing policy. + // + // Authorization requires `spanner.databases.setIamPolicy` permission on + // [resource][google.iam.v1.SetIamPolicyRequest.resource]. + SetIamPolicy(ctx context.Context, in *google_iam_v11.SetIamPolicyRequest, opts ...grpc.CallOption) (*google_iam_v1.Policy, error) + // Gets the access control policy for a database resource. Returns an empty + // policy if a database exists but does not have a policy set. + // + // Authorization requires `spanner.databases.getIamPolicy` permission on + // [resource][google.iam.v1.GetIamPolicyRequest.resource]. + GetIamPolicy(ctx context.Context, in *google_iam_v11.GetIamPolicyRequest, opts ...grpc.CallOption) (*google_iam_v1.Policy, error) + // Returns permissions that the caller has on the specified database resource. + // + // Attempting this RPC on a non-existent Cloud Spanner database will result in + // a NOT_FOUND error if the user has `spanner.databases.list` permission on + // the containing Cloud Spanner instance. Otherwise returns an empty set of + // permissions. + TestIamPermissions(ctx context.Context, in *google_iam_v11.TestIamPermissionsRequest, opts ...grpc.CallOption) (*google_iam_v11.TestIamPermissionsResponse, error) +} + +type databaseAdminClient struct { + cc *grpc.ClientConn +} + +func NewDatabaseAdminClient(cc *grpc.ClientConn) DatabaseAdminClient { + return &databaseAdminClient{cc} +} + +func (c *databaseAdminClient) ListDatabases(ctx context.Context, in *ListDatabasesRequest, opts ...grpc.CallOption) (*ListDatabasesResponse, error) { + out := new(ListDatabasesResponse) + err := grpc.Invoke(ctx, "/google.spanner.admin.database.v1.DatabaseAdmin/ListDatabases", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *databaseAdminClient) CreateDatabase(ctx context.Context, in *CreateDatabaseRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.spanner.admin.database.v1.DatabaseAdmin/CreateDatabase", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *databaseAdminClient) GetDatabase(ctx context.Context, in *GetDatabaseRequest, opts ...grpc.CallOption) (*Database, error) { + out := new(Database) + err := grpc.Invoke(ctx, "/google.spanner.admin.database.v1.DatabaseAdmin/GetDatabase", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *databaseAdminClient) UpdateDatabaseDdl(ctx context.Context, in *UpdateDatabaseDdlRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.spanner.admin.database.v1.DatabaseAdmin/UpdateDatabaseDdl", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *databaseAdminClient) DropDatabase(ctx context.Context, in *DropDatabaseRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) { + out := new(google_protobuf2.Empty) + err := grpc.Invoke(ctx, "/google.spanner.admin.database.v1.DatabaseAdmin/DropDatabase", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *databaseAdminClient) GetDatabaseDdl(ctx context.Context, in *GetDatabaseDdlRequest, opts ...grpc.CallOption) (*GetDatabaseDdlResponse, error) { + out := new(GetDatabaseDdlResponse) + err := grpc.Invoke(ctx, "/google.spanner.admin.database.v1.DatabaseAdmin/GetDatabaseDdl", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *databaseAdminClient) SetIamPolicy(ctx context.Context, in *google_iam_v11.SetIamPolicyRequest, opts ...grpc.CallOption) (*google_iam_v1.Policy, error) { + out := new(google_iam_v1.Policy) + err := grpc.Invoke(ctx, "/google.spanner.admin.database.v1.DatabaseAdmin/SetIamPolicy", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *databaseAdminClient) GetIamPolicy(ctx context.Context, in *google_iam_v11.GetIamPolicyRequest, opts ...grpc.CallOption) (*google_iam_v1.Policy, error) { + out := new(google_iam_v1.Policy) + err := grpc.Invoke(ctx, "/google.spanner.admin.database.v1.DatabaseAdmin/GetIamPolicy", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *databaseAdminClient) TestIamPermissions(ctx context.Context, in *google_iam_v11.TestIamPermissionsRequest, opts ...grpc.CallOption) (*google_iam_v11.TestIamPermissionsResponse, error) { + out := new(google_iam_v11.TestIamPermissionsResponse) + err := grpc.Invoke(ctx, "/google.spanner.admin.database.v1.DatabaseAdmin/TestIamPermissions", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for DatabaseAdmin service + +type DatabaseAdminServer interface { + // Lists Cloud Spanner databases. + ListDatabases(context.Context, *ListDatabasesRequest) (*ListDatabasesResponse, error) + // Creates a new Cloud Spanner database and starts to prepare it for serving. + // The returned [long-running operation][google.longrunning.Operation] will + // have a name of the format `/operations/` and + // can be used to track preparation of the database. The + // [metadata][google.longrunning.Operation.metadata] field type is + // [CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata]. The + // [response][google.longrunning.Operation.response] field type is + // [Database][google.spanner.admin.database.v1.Database], if successful. + CreateDatabase(context.Context, *CreateDatabaseRequest) (*google_longrunning.Operation, error) + // Gets the state of a Cloud Spanner database. + GetDatabase(context.Context, *GetDatabaseRequest) (*Database, error) + // Updates the schema of a Cloud Spanner database by + // creating/altering/dropping tables, columns, indexes, etc. The returned + // [long-running operation][google.longrunning.Operation] will have a name of + // the format `/operations/` and can be used to + // track execution of the schema change(s). The + // [metadata][google.longrunning.Operation.metadata] field type is + // [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata]. The operation has no response. + UpdateDatabaseDdl(context.Context, *UpdateDatabaseDdlRequest) (*google_longrunning.Operation, error) + // Drops (aka deletes) a Cloud Spanner database. + DropDatabase(context.Context, *DropDatabaseRequest) (*google_protobuf2.Empty, error) + // Returns the schema of a Cloud Spanner database as a list of formatted + // DDL statements. This method does not show pending schema updates, those may + // be queried using the [Operations][google.longrunning.Operations] API. + GetDatabaseDdl(context.Context, *GetDatabaseDdlRequest) (*GetDatabaseDdlResponse, error) + // Sets the access control policy on a database resource. Replaces any + // existing policy. + // + // Authorization requires `spanner.databases.setIamPolicy` permission on + // [resource][google.iam.v1.SetIamPolicyRequest.resource]. + SetIamPolicy(context.Context, *google_iam_v11.SetIamPolicyRequest) (*google_iam_v1.Policy, error) + // Gets the access control policy for a database resource. Returns an empty + // policy if a database exists but does not have a policy set. + // + // Authorization requires `spanner.databases.getIamPolicy` permission on + // [resource][google.iam.v1.GetIamPolicyRequest.resource]. + GetIamPolicy(context.Context, *google_iam_v11.GetIamPolicyRequest) (*google_iam_v1.Policy, error) + // Returns permissions that the caller has on the specified database resource. + // + // Attempting this RPC on a non-existent Cloud Spanner database will result in + // a NOT_FOUND error if the user has `spanner.databases.list` permission on + // the containing Cloud Spanner instance. Otherwise returns an empty set of + // permissions. + TestIamPermissions(context.Context, *google_iam_v11.TestIamPermissionsRequest) (*google_iam_v11.TestIamPermissionsResponse, error) +} + +func RegisterDatabaseAdminServer(s *grpc.Server, srv DatabaseAdminServer) { + s.RegisterService(&_DatabaseAdmin_serviceDesc, srv) +} + +func _DatabaseAdmin_ListDatabases_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListDatabasesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DatabaseAdminServer).ListDatabases(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.spanner.admin.database.v1.DatabaseAdmin/ListDatabases", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DatabaseAdminServer).ListDatabases(ctx, req.(*ListDatabasesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DatabaseAdmin_CreateDatabase_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateDatabaseRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DatabaseAdminServer).CreateDatabase(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.spanner.admin.database.v1.DatabaseAdmin/CreateDatabase", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DatabaseAdminServer).CreateDatabase(ctx, req.(*CreateDatabaseRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DatabaseAdmin_GetDatabase_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetDatabaseRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DatabaseAdminServer).GetDatabase(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.spanner.admin.database.v1.DatabaseAdmin/GetDatabase", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DatabaseAdminServer).GetDatabase(ctx, req.(*GetDatabaseRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DatabaseAdmin_UpdateDatabaseDdl_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateDatabaseDdlRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DatabaseAdminServer).UpdateDatabaseDdl(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.spanner.admin.database.v1.DatabaseAdmin/UpdateDatabaseDdl", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DatabaseAdminServer).UpdateDatabaseDdl(ctx, req.(*UpdateDatabaseDdlRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DatabaseAdmin_DropDatabase_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DropDatabaseRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DatabaseAdminServer).DropDatabase(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.spanner.admin.database.v1.DatabaseAdmin/DropDatabase", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DatabaseAdminServer).DropDatabase(ctx, req.(*DropDatabaseRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DatabaseAdmin_GetDatabaseDdl_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetDatabaseDdlRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DatabaseAdminServer).GetDatabaseDdl(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.spanner.admin.database.v1.DatabaseAdmin/GetDatabaseDdl", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DatabaseAdminServer).GetDatabaseDdl(ctx, req.(*GetDatabaseDdlRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DatabaseAdmin_SetIamPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(google_iam_v11.SetIamPolicyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DatabaseAdminServer).SetIamPolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.spanner.admin.database.v1.DatabaseAdmin/SetIamPolicy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DatabaseAdminServer).SetIamPolicy(ctx, req.(*google_iam_v11.SetIamPolicyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DatabaseAdmin_GetIamPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(google_iam_v11.GetIamPolicyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DatabaseAdminServer).GetIamPolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.spanner.admin.database.v1.DatabaseAdmin/GetIamPolicy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DatabaseAdminServer).GetIamPolicy(ctx, req.(*google_iam_v11.GetIamPolicyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DatabaseAdmin_TestIamPermissions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(google_iam_v11.TestIamPermissionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DatabaseAdminServer).TestIamPermissions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.spanner.admin.database.v1.DatabaseAdmin/TestIamPermissions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DatabaseAdminServer).TestIamPermissions(ctx, req.(*google_iam_v11.TestIamPermissionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _DatabaseAdmin_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.spanner.admin.database.v1.DatabaseAdmin", + HandlerType: (*DatabaseAdminServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListDatabases", + Handler: _DatabaseAdmin_ListDatabases_Handler, + }, + { + MethodName: "CreateDatabase", + Handler: _DatabaseAdmin_CreateDatabase_Handler, + }, + { + MethodName: "GetDatabase", + Handler: _DatabaseAdmin_GetDatabase_Handler, + }, + { + MethodName: "UpdateDatabaseDdl", + Handler: _DatabaseAdmin_UpdateDatabaseDdl_Handler, + }, + { + MethodName: "DropDatabase", + Handler: _DatabaseAdmin_DropDatabase_Handler, + }, + { + MethodName: "GetDatabaseDdl", + Handler: _DatabaseAdmin_GetDatabaseDdl_Handler, + }, + { + MethodName: "SetIamPolicy", + Handler: _DatabaseAdmin_SetIamPolicy_Handler, + }, + { + MethodName: "GetIamPolicy", + Handler: _DatabaseAdmin_GetIamPolicy_Handler, + }, + { + MethodName: "TestIamPermissions", + Handler: _DatabaseAdmin_TestIamPermissions_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/spanner/admin/database/v1/spanner_database_admin.proto", +} + +func init() { + proto.RegisterFile("google/spanner/admin/database/v1/spanner_database_admin.proto", fileDescriptor0) +} + +var fileDescriptor0 = []byte{ + // 1033 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x96, 0xcf, 0x6f, 0x1b, 0x45, + 0x14, 0xc7, 0x19, 0xa7, 0xa9, 0x92, 0x17, 0x27, 0x75, 0x06, 0x1c, 0xb9, 0x5b, 0x5a, 0xcc, 0x82, + 0x2a, 0xd7, 0x12, 0xbb, 0xd8, 0x69, 0x48, 0x30, 0x0a, 0x22, 0xb5, 0x5d, 0xd7, 0x12, 0xb4, 0x96, + 0xed, 0x56, 0x02, 0x59, 0xb2, 0x26, 0xf6, 0xb0, 0xda, 0xe2, 0xfd, 0xc1, 0xce, 0xb8, 0x6a, 0x8b, + 0x7a, 0x41, 0xe2, 0xc0, 0x19, 0x90, 0xb8, 0x81, 0x38, 0x70, 0xe0, 0xc4, 0x0d, 0x89, 0x23, 0x47, + 0xae, 0xfc, 0x01, 0x5c, 0xf8, 0x43, 0xd0, 0xcc, 0xee, 0xd8, 0xeb, 0x75, 0x12, 0xdb, 0x1c, 0xb8, + 0x79, 0xdf, 0xfb, 0xbe, 0x79, 0x9f, 0x79, 0x3b, 0xdf, 0xf1, 0xc2, 0xb1, 0xe5, 0x79, 0xd6, 0x88, + 0x9a, 0xcc, 0x27, 0xae, 0x4b, 0x03, 0x93, 0x0c, 0x1d, 0xdb, 0x35, 0x87, 0x84, 0x93, 0x53, 0xc2, + 0xa8, 0xf9, 0xa4, 0xa4, 0x32, 0x7d, 0x15, 0xeb, 0x4b, 0x89, 0xe1, 0x07, 0x1e, 0xf7, 0x70, 0x3e, + 0x2c, 0x37, 0x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0xd6, 0x45, 0xbc, 0x76, 0x81, + 0xd5, 0xb8, 0x08, 0xab, 0xf1, 0xbf, 0x60, 0x59, 0x09, 0xac, 0xdf, 0x11, 0xe0, 0x2e, 0x65, 0x32, + 0x48, 0x03, 0xc7, 0x66, 0x4c, 0x7c, 0xf7, 0xe1, 0x42, 0xa2, 0xf1, 0xbc, 0x44, 0x21, 0xde, 0x5a, + 0x42, 0x19, 0xbd, 0xd8, 0x07, 0x12, 0xbb, 0xa9, 0xd7, 0x56, 0xc7, 0xe6, 0x73, 0xab, 0x56, 0x50, + 0xf1, 0xce, 0xdf, 0x08, 0xde, 0x1c, 0x78, 0xce, 0xc2, 0x93, 0x76, 0xe7, 0x6a, 0x27, 0x4c, 0xcd, + 0xfc, 0x89, 0xb4, 0x84, 0x6f, 0x5a, 0xe8, 0x93, 0x7b, 0x51, 0xb9, 0xe5, 0x8d, 0x88, 0x6b, 0x19, + 0x5e, 0x60, 0x99, 0x16, 0x75, 0xa5, 0xab, 0xcc, 0x30, 0x45, 0x7c, 0x9b, 0x9d, 0xff, 0x71, 0xff, + 0x9e, 0xfa, 0xfd, 0x4b, 0xea, 0x66, 0x23, 0x5c, 0xaa, 0x3a, 0xf2, 0xc6, 0x43, 0x23, 0x6a, 0x6a, + 0xc8, 0x6e, 0xd3, 0x6f, 0xd6, 0x47, 0xa5, 0x3f, 0x95, 0xb0, 0x27, 0x85, 0xbd, 0x48, 0xd8, 0x93, + 0xc2, 0x9e, 0x12, 0xf6, 0x1e, 0x95, 0x4e, 0x2f, 0x4b, 0x8c, 0xfd, 0x7f, 0x03, 0x00, 0x00, 0xff, + 0xff, 0x1d, 0xbc, 0x89, 0x54, 0x62, 0x0c, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/spanner/admin/instance/v1/spanner_instance_admin.pb.go b/vendor/google.golang.org/genproto/googleapis/spanner/admin/instance/v1/spanner_instance_admin.pb.go new file mode 100644 index 0000000000..aeff94a26b --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/spanner/admin/instance/v1/spanner_instance_admin.pb.go @@ -0,0 +1,1285 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/spanner/admin/instance/v1/spanner_instance_admin.proto + +/* +Package instance is a generated protocol buffer package. + +It is generated from these files: + google/spanner/admin/instance/v1/spanner_instance_admin.proto + +It has these top-level messages: + InstanceConfig + Instance + ListInstanceConfigsRequest + ListInstanceConfigsResponse + GetInstanceConfigRequest + GetInstanceRequest + CreateInstanceRequest + ListInstancesRequest + ListInstancesResponse + UpdateInstanceRequest + DeleteInstanceRequest + CreateInstanceMetadata + UpdateInstanceMetadata +*/ +package instance + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_iam_v11 "google.golang.org/genproto/googleapis/iam/v1" +import google_iam_v1 "google.golang.org/genproto/googleapis/iam/v1" +import google_longrunning "google.golang.org/genproto/googleapis/longrunning" +import google_protobuf2 "github.com/golang/protobuf/ptypes/empty" +import google_protobuf3 "google.golang.org/genproto/protobuf/field_mask" +import google_protobuf4 "github.com/golang/protobuf/ptypes/timestamp" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Indicates the current state of the instance. +type Instance_State int32 + +const ( + // Not specified. + Instance_STATE_UNSPECIFIED Instance_State = 0 + // The instance is still being created. Resources may not be + // available yet, and operations such as database creation may not + // work. + Instance_CREATING Instance_State = 1 + // The instance is fully created and ready to do work such as + // creating databases. + Instance_READY Instance_State = 2 +) + +var Instance_State_name = map[int32]string{ + 0: "STATE_UNSPECIFIED", + 1: "CREATING", + 2: "READY", +} +var Instance_State_value = map[string]int32{ + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "READY": 2, +} + +func (x Instance_State) String() string { + return proto.EnumName(Instance_State_name, int32(x)) +} +func (Instance_State) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{1, 0} } + +// A possible configuration for a Cloud Spanner instance. Configurations +// define the geographic placement of nodes and their replication. +type InstanceConfig struct { + // A unique identifier for the instance configuration. Values + // are of the form + // `projects//instanceConfigs/[a-z][-a-z0-9]*` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The name of this instance configuration as it appears in UIs. + DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName" json:"display_name,omitempty"` +} + +func (m *InstanceConfig) Reset() { *m = InstanceConfig{} } +func (m *InstanceConfig) String() string { return proto.CompactTextString(m) } +func (*InstanceConfig) ProtoMessage() {} +func (*InstanceConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *InstanceConfig) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *InstanceConfig) GetDisplayName() string { + if m != nil { + return m.DisplayName + } + return "" +} + +// An isolated set of Cloud Spanner resources on which databases can be hosted. +type Instance struct { + // Required. A unique identifier for the instance, which cannot be changed + // after the instance is created. Values are of the form + // `projects//instances/[a-z][-a-z0-9]*[a-z0-9]`. The final + // segment of the name must be between 6 and 30 characters in length. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Required. The name of the instance's configuration. Values are of the form + // `projects//instanceConfigs/`. See + // also [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig] and + // [ListInstanceConfigs][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigs]. + Config string `protobuf:"bytes,2,opt,name=config" json:"config,omitempty"` + // Required. The descriptive name for this instance as it appears in UIs. + // Must be unique per project and between 4 and 30 characters in length. + DisplayName string `protobuf:"bytes,3,opt,name=display_name,json=displayName" json:"display_name,omitempty"` + // Required. The number of nodes allocated to this instance. This may be zero + // in API responses for instances that are not yet in state `READY`. + // + // See [the documentation](https://cloud.google.com/spanner/docs/instances#node_count) + // for more information about nodes. + NodeCount int32 `protobuf:"varint,5,opt,name=node_count,json=nodeCount" json:"node_count,omitempty"` + // Output only. The current instance state. For + // [CreateInstance][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstance], the state must be + // either omitted or set to `CREATING`. For + // [UpdateInstance][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstance], the state must be + // either omitted or set to `READY`. + State Instance_State `protobuf:"varint,6,opt,name=state,enum=google.spanner.admin.instance.v1.Instance_State" json:"state,omitempty"` + // Cloud Labels are a flexible and lightweight mechanism for organizing cloud + // resources into groups that reflect a customer's organizational needs and + // deployment strategies. Cloud Labels can be used to filter collections of + // resources. They can be used to control how resource metrics are aggregated. + // And they can be used as arguments to policy management rules (e.g. route, + // firewall, load balancing, etc.). + // + // * Label keys must be between 1 and 63 characters long and must conform to + // the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`. + // * Label values must be between 0 and 63 characters long and must conform + // to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`. + // * No more than 64 labels can be associated with a given resource. + // + // See https://goo.gl/xmQnxf for more information on and examples of labels. + // + // If you plan to use labels in your own code, please note that additional + // characters may be allowed in the future. And so you are advised to use an + // internal label representation, such as JSON, which doesn't rely upon + // specific characters being disallowed. For example, representing labels + // as the string: name + "_" + value would prove problematic if we were to + // allow "_" in a future release. + Labels map[string]string `protobuf:"bytes,7,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *Instance) Reset() { *m = Instance{} } +func (m *Instance) String() string { return proto.CompactTextString(m) } +func (*Instance) ProtoMessage() {} +func (*Instance) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *Instance) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Instance) GetConfig() string { + if m != nil { + return m.Config + } + return "" +} + +func (m *Instance) GetDisplayName() string { + if m != nil { + return m.DisplayName + } + return "" +} + +func (m *Instance) GetNodeCount() int32 { + if m != nil { + return m.NodeCount + } + return 0 +} + +func (m *Instance) GetState() Instance_State { + if m != nil { + return m.State + } + return Instance_STATE_UNSPECIFIED +} + +func (m *Instance) GetLabels() map[string]string { + if m != nil { + return m.Labels + } + return nil +} + +// The request for [ListInstanceConfigs][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigs]. +type ListInstanceConfigsRequest struct { + // Required. The name of the project for which a list of supported instance + // configurations is requested. Values are of the form + // `projects/`. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // Number of instance configurations to be returned in the response. If 0 or + // less, defaults to the server's maximum allowed page size. + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // If non-empty, `page_token` should contain a + // [next_page_token][google.spanner.admin.instance.v1.ListInstanceConfigsResponse.next_page_token] + // from a previous [ListInstanceConfigsResponse][google.spanner.admin.instance.v1.ListInstanceConfigsResponse]. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListInstanceConfigsRequest) Reset() { *m = ListInstanceConfigsRequest{} } +func (m *ListInstanceConfigsRequest) String() string { return proto.CompactTextString(m) } +func (*ListInstanceConfigsRequest) ProtoMessage() {} +func (*ListInstanceConfigsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *ListInstanceConfigsRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *ListInstanceConfigsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListInstanceConfigsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// The response for [ListInstanceConfigs][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigs]. +type ListInstanceConfigsResponse struct { + // The list of requested instance configurations. + InstanceConfigs []*InstanceConfig `protobuf:"bytes,1,rep,name=instance_configs,json=instanceConfigs" json:"instance_configs,omitempty"` + // `next_page_token` can be sent in a subsequent + // [ListInstanceConfigs][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigs] call to + // fetch more of the matching instance configurations. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListInstanceConfigsResponse) Reset() { *m = ListInstanceConfigsResponse{} } +func (m *ListInstanceConfigsResponse) String() string { return proto.CompactTextString(m) } +func (*ListInstanceConfigsResponse) ProtoMessage() {} +func (*ListInstanceConfigsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *ListInstanceConfigsResponse) GetInstanceConfigs() []*InstanceConfig { + if m != nil { + return m.InstanceConfigs + } + return nil +} + +func (m *ListInstanceConfigsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// The request for +// [GetInstanceConfigRequest][google.spanner.admin.instance.v1.InstanceAdmin.GetInstanceConfig]. +type GetInstanceConfigRequest struct { + // Required. The name of the requested instance configuration. Values are of + // the form `projects//instanceConfigs/`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetInstanceConfigRequest) Reset() { *m = GetInstanceConfigRequest{} } +func (m *GetInstanceConfigRequest) String() string { return proto.CompactTextString(m) } +func (*GetInstanceConfigRequest) ProtoMessage() {} +func (*GetInstanceConfigRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *GetInstanceConfigRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// The request for [GetInstance][google.spanner.admin.instance.v1.InstanceAdmin.GetInstance]. +type GetInstanceRequest struct { + // Required. The name of the requested instance. Values are of the form + // `projects//instances/`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetInstanceRequest) Reset() { *m = GetInstanceRequest{} } +func (m *GetInstanceRequest) String() string { return proto.CompactTextString(m) } +func (*GetInstanceRequest) ProtoMessage() {} +func (*GetInstanceRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *GetInstanceRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// The request for [CreateInstance][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstance]. +type CreateInstanceRequest struct { + // Required. The name of the project in which to create the instance. Values + // are of the form `projects/`. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // Required. The ID of the instance to create. Valid identifiers are of the + // form `[a-z][-a-z0-9]*[a-z0-9]` and must be between 6 and 30 characters in + // length. + InstanceId string `protobuf:"bytes,2,opt,name=instance_id,json=instanceId" json:"instance_id,omitempty"` + // Required. The instance to create. The name may be omitted, but if + // specified must be `/instances/`. + Instance *Instance `protobuf:"bytes,3,opt,name=instance" json:"instance,omitempty"` +} + +func (m *CreateInstanceRequest) Reset() { *m = CreateInstanceRequest{} } +func (m *CreateInstanceRequest) String() string { return proto.CompactTextString(m) } +func (*CreateInstanceRequest) ProtoMessage() {} +func (*CreateInstanceRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *CreateInstanceRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *CreateInstanceRequest) GetInstanceId() string { + if m != nil { + return m.InstanceId + } + return "" +} + +func (m *CreateInstanceRequest) GetInstance() *Instance { + if m != nil { + return m.Instance + } + return nil +} + +// The request for [ListInstances][google.spanner.admin.instance.v1.InstanceAdmin.ListInstances]. +type ListInstancesRequest struct { + // Required. The name of the project for which a list of instances is + // requested. Values are of the form `projects/`. + Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` + // Number of instances to be returned in the response. If 0 or less, defaults + // to the server's maximum allowed page size. + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // If non-empty, `page_token` should contain a + // [next_page_token][google.spanner.admin.instance.v1.ListInstancesResponse.next_page_token] from a + // previous [ListInstancesResponse][google.spanner.admin.instance.v1.ListInstancesResponse]. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` + // An expression for filtering the results of the request. Filter rules are + // case insensitive. The fields eligible for filtering are: + // + // * `name` + // * `display_name` + // * `labels.key` where key is the name of a label + // + // Some examples of using filters are: + // + // * `name:*` --> The instance has a name. + // * `name:Howl` --> The instance's name contains the string "howl". + // * `name:HOWL` --> Equivalent to above. + // * `NAME:howl` --> Equivalent to above. + // * `labels.env:*` --> The instance has the label "env". + // * `labels.env:dev` --> The instance has the label "env" and the value of + // the label contains the string "dev". + // * `name:howl labels.env:dev` --> The instance's name contains "howl" and + // it has the label "env" with its value + // containing "dev". + Filter string `protobuf:"bytes,4,opt,name=filter" json:"filter,omitempty"` +} + +func (m *ListInstancesRequest) Reset() { *m = ListInstancesRequest{} } +func (m *ListInstancesRequest) String() string { return proto.CompactTextString(m) } +func (*ListInstancesRequest) ProtoMessage() {} +func (*ListInstancesRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *ListInstancesRequest) GetParent() string { + if m != nil { + return m.Parent + } + return "" +} + +func (m *ListInstancesRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListInstancesRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +func (m *ListInstancesRequest) GetFilter() string { + if m != nil { + return m.Filter + } + return "" +} + +// The response for [ListInstances][google.spanner.admin.instance.v1.InstanceAdmin.ListInstances]. +type ListInstancesResponse struct { + // The list of requested instances. + Instances []*Instance `protobuf:"bytes,1,rep,name=instances" json:"instances,omitempty"` + // `next_page_token` can be sent in a subsequent + // [ListInstances][google.spanner.admin.instance.v1.InstanceAdmin.ListInstances] call to fetch more + // of the matching instances. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListInstancesResponse) Reset() { *m = ListInstancesResponse{} } +func (m *ListInstancesResponse) String() string { return proto.CompactTextString(m) } +func (*ListInstancesResponse) ProtoMessage() {} +func (*ListInstancesResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *ListInstancesResponse) GetInstances() []*Instance { + if m != nil { + return m.Instances + } + return nil +} + +func (m *ListInstancesResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// The request for [UpdateInstance][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstance]. +type UpdateInstanceRequest struct { + // Required. The instance to update, which must always include the instance + // name. Otherwise, only fields mentioned in [][google.spanner.admin.instance.v1.UpdateInstanceRequest.field_mask] need be included. + Instance *Instance `protobuf:"bytes,1,opt,name=instance" json:"instance,omitempty"` + // Required. A mask specifying which fields in [][google.spanner.admin.instance.v1.UpdateInstanceRequest.instance] should be updated. + // The field mask must always be specified; this prevents any future fields in + // [][google.spanner.admin.instance.v1.Instance] from being erased accidentally by clients that do not know + // about them. + FieldMask *google_protobuf3.FieldMask `protobuf:"bytes,2,opt,name=field_mask,json=fieldMask" json:"field_mask,omitempty"` +} + +func (m *UpdateInstanceRequest) Reset() { *m = UpdateInstanceRequest{} } +func (m *UpdateInstanceRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateInstanceRequest) ProtoMessage() {} +func (*UpdateInstanceRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *UpdateInstanceRequest) GetInstance() *Instance { + if m != nil { + return m.Instance + } + return nil +} + +func (m *UpdateInstanceRequest) GetFieldMask() *google_protobuf3.FieldMask { + if m != nil { + return m.FieldMask + } + return nil +} + +// The request for [DeleteInstance][google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstance]. +type DeleteInstanceRequest struct { + // Required. The name of the instance to be deleted. Values are of the form + // `projects//instances/` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *DeleteInstanceRequest) Reset() { *m = DeleteInstanceRequest{} } +func (m *DeleteInstanceRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteInstanceRequest) ProtoMessage() {} +func (*DeleteInstanceRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *DeleteInstanceRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Metadata type for the operation returned by +// [CreateInstance][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstance]. +type CreateInstanceMetadata struct { + // The instance being created. + Instance *Instance `protobuf:"bytes,1,opt,name=instance" json:"instance,omitempty"` + // The time at which the + // [CreateInstance][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstance] request was + // received. + StartTime *google_protobuf4.Timestamp `protobuf:"bytes,2,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + // The time at which this operation was cancelled. If set, this operation is + // in the process of undoing itself (which is guaranteed to succeed) and + // cannot be cancelled again. + CancelTime *google_protobuf4.Timestamp `protobuf:"bytes,3,opt,name=cancel_time,json=cancelTime" json:"cancel_time,omitempty"` + // The time at which this operation failed or was completed successfully. + EndTime *google_protobuf4.Timestamp `protobuf:"bytes,4,opt,name=end_time,json=endTime" json:"end_time,omitempty"` +} + +func (m *CreateInstanceMetadata) Reset() { *m = CreateInstanceMetadata{} } +func (m *CreateInstanceMetadata) String() string { return proto.CompactTextString(m) } +func (*CreateInstanceMetadata) ProtoMessage() {} +func (*CreateInstanceMetadata) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } + +func (m *CreateInstanceMetadata) GetInstance() *Instance { + if m != nil { + return m.Instance + } + return nil +} + +func (m *CreateInstanceMetadata) GetStartTime() *google_protobuf4.Timestamp { + if m != nil { + return m.StartTime + } + return nil +} + +func (m *CreateInstanceMetadata) GetCancelTime() *google_protobuf4.Timestamp { + if m != nil { + return m.CancelTime + } + return nil +} + +func (m *CreateInstanceMetadata) GetEndTime() *google_protobuf4.Timestamp { + if m != nil { + return m.EndTime + } + return nil +} + +// Metadata type for the operation returned by +// [UpdateInstance][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstance]. +type UpdateInstanceMetadata struct { + // The desired end state of the update. + Instance *Instance `protobuf:"bytes,1,opt,name=instance" json:"instance,omitempty"` + // The time at which [UpdateInstance][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstance] + // request was received. + StartTime *google_protobuf4.Timestamp `protobuf:"bytes,2,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + // The time at which this operation was cancelled. If set, this operation is + // in the process of undoing itself (which is guaranteed to succeed) and + // cannot be cancelled again. + CancelTime *google_protobuf4.Timestamp `protobuf:"bytes,3,opt,name=cancel_time,json=cancelTime" json:"cancel_time,omitempty"` + // The time at which this operation failed or was completed successfully. + EndTime *google_protobuf4.Timestamp `protobuf:"bytes,4,opt,name=end_time,json=endTime" json:"end_time,omitempty"` +} + +func (m *UpdateInstanceMetadata) Reset() { *m = UpdateInstanceMetadata{} } +func (m *UpdateInstanceMetadata) String() string { return proto.CompactTextString(m) } +func (*UpdateInstanceMetadata) ProtoMessage() {} +func (*UpdateInstanceMetadata) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } + +func (m *UpdateInstanceMetadata) GetInstance() *Instance { + if m != nil { + return m.Instance + } + return nil +} + +func (m *UpdateInstanceMetadata) GetStartTime() *google_protobuf4.Timestamp { + if m != nil { + return m.StartTime + } + return nil +} + +func (m *UpdateInstanceMetadata) GetCancelTime() *google_protobuf4.Timestamp { + if m != nil { + return m.CancelTime + } + return nil +} + +func (m *UpdateInstanceMetadata) GetEndTime() *google_protobuf4.Timestamp { + if m != nil { + return m.EndTime + } + return nil +} + +func init() { + proto.RegisterType((*InstanceConfig)(nil), "google.spanner.admin.instance.v1.InstanceConfig") + proto.RegisterType((*Instance)(nil), "google.spanner.admin.instance.v1.Instance") + proto.RegisterType((*ListInstanceConfigsRequest)(nil), "google.spanner.admin.instance.v1.ListInstanceConfigsRequest") + proto.RegisterType((*ListInstanceConfigsResponse)(nil), "google.spanner.admin.instance.v1.ListInstanceConfigsResponse") + proto.RegisterType((*GetInstanceConfigRequest)(nil), "google.spanner.admin.instance.v1.GetInstanceConfigRequest") + proto.RegisterType((*GetInstanceRequest)(nil), "google.spanner.admin.instance.v1.GetInstanceRequest") + proto.RegisterType((*CreateInstanceRequest)(nil), "google.spanner.admin.instance.v1.CreateInstanceRequest") + proto.RegisterType((*ListInstancesRequest)(nil), "google.spanner.admin.instance.v1.ListInstancesRequest") + proto.RegisterType((*ListInstancesResponse)(nil), "google.spanner.admin.instance.v1.ListInstancesResponse") + proto.RegisterType((*UpdateInstanceRequest)(nil), "google.spanner.admin.instance.v1.UpdateInstanceRequest") + proto.RegisterType((*DeleteInstanceRequest)(nil), "google.spanner.admin.instance.v1.DeleteInstanceRequest") + proto.RegisterType((*CreateInstanceMetadata)(nil), "google.spanner.admin.instance.v1.CreateInstanceMetadata") + proto.RegisterType((*UpdateInstanceMetadata)(nil), "google.spanner.admin.instance.v1.UpdateInstanceMetadata") + proto.RegisterEnum("google.spanner.admin.instance.v1.Instance_State", Instance_State_name, Instance_State_value) +} + +// 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 + +// Client API for InstanceAdmin service + +type InstanceAdminClient interface { + // Lists the supported instance configurations for a given project. + ListInstanceConfigs(ctx context.Context, in *ListInstanceConfigsRequest, opts ...grpc.CallOption) (*ListInstanceConfigsResponse, error) + // Gets information about a particular instance configuration. + GetInstanceConfig(ctx context.Context, in *GetInstanceConfigRequest, opts ...grpc.CallOption) (*InstanceConfig, error) + // Lists all instances in the given project. + ListInstances(ctx context.Context, in *ListInstancesRequest, opts ...grpc.CallOption) (*ListInstancesResponse, error) + // Gets information about a particular instance. + GetInstance(ctx context.Context, in *GetInstanceRequest, opts ...grpc.CallOption) (*Instance, error) + // Creates an instance and begins preparing it to begin serving. The + // returned [long-running operation][google.longrunning.Operation] + // can be used to track the progress of preparing the new + // instance. The instance name is assigned by the caller. If the + // named instance already exists, `CreateInstance` returns + // `ALREADY_EXISTS`. + // + // Immediately upon completion of this request: + // + // * The instance is readable via the API, with all requested attributes + // but no allocated resources. Its state is `CREATING`. + // + // Until completion of the returned operation: + // + // * Cancelling the operation renders the instance immediately unreadable + // via the API. + // * The instance can be deleted. + // * All other attempts to modify the instance are rejected. + // + // Upon completion of the returned operation: + // + // * Billing for all successfully-allocated resources begins (some types + // may have lower than the requested levels). + // * Databases can be created in the instance. + // * The instance's allocated resource levels are readable via the API. + // * The instance's state becomes `READY`. + // + // The returned [long-running operation][google.longrunning.Operation] will + // have a name of the format `/operations/` and + // can be used to track creation of the instance. The + // [metadata][google.longrunning.Operation.metadata] field type is + // [CreateInstanceMetadata][google.spanner.admin.instance.v1.CreateInstanceMetadata]. + // The [response][google.longrunning.Operation.response] field type is + // [Instance][google.spanner.admin.instance.v1.Instance], if successful. + CreateInstance(ctx context.Context, in *CreateInstanceRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Updates an instance, and begins allocating or releasing resources + // as requested. The returned [long-running + // operation][google.longrunning.Operation] can be used to track the + // progress of updating the instance. If the named instance does not + // exist, returns `NOT_FOUND`. + // + // Immediately upon completion of this request: + // + // * For resource types for which a decrease in the instance's allocation + // has been requested, billing is based on the newly-requested level. + // + // Until completion of the returned operation: + // + // * Cancelling the operation sets its metadata's + // [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancel_time], and begins + // restoring resources to their pre-request values. The operation + // is guaranteed to succeed at undoing all resource changes, + // after which point it terminates with a `CANCELLED` status. + // * All other attempts to modify the instance are rejected. + // * Reading the instance via the API continues to give the pre-request + // resource levels. + // + // Upon completion of the returned operation: + // + // * Billing begins for all successfully-allocated resources (some types + // may have lower than the requested levels). + // * All newly-reserved resources are available for serving the instance's + // tables. + // * The instance's new resource levels are readable via the API. + // + // The returned [long-running operation][google.longrunning.Operation] will + // have a name of the format `/operations/` and + // can be used to track the instance modification. The + // [metadata][google.longrunning.Operation.metadata] field type is + // [UpdateInstanceMetadata][google.spanner.admin.instance.v1.UpdateInstanceMetadata]. + // The [response][google.longrunning.Operation.response] field type is + // [Instance][google.spanner.admin.instance.v1.Instance], if successful. + // + // Authorization requires `spanner.instances.update` permission on + // resource [name][google.spanner.admin.instance.v1.Instance.name]. + UpdateInstance(ctx context.Context, in *UpdateInstanceRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) + // Deletes an instance. + // + // Immediately upon completion of the request: + // + // * Billing ceases for all of the instance's reserved resources. + // + // Soon afterward: + // + // * The instance and *all of its databases* immediately and + // irrevocably disappear from the API. All data in the databases + // is permanently deleted. + DeleteInstance(ctx context.Context, in *DeleteInstanceRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) + // Sets the access control policy on an instance resource. Replaces any + // existing policy. + // + // Authorization requires `spanner.instances.setIamPolicy` on + // [resource][google.iam.v1.SetIamPolicyRequest.resource]. + SetIamPolicy(ctx context.Context, in *google_iam_v11.SetIamPolicyRequest, opts ...grpc.CallOption) (*google_iam_v1.Policy, error) + // Gets the access control policy for an instance resource. Returns an empty + // policy if an instance exists but does not have a policy set. + // + // Authorization requires `spanner.instances.getIamPolicy` on + // [resource][google.iam.v1.GetIamPolicyRequest.resource]. + GetIamPolicy(ctx context.Context, in *google_iam_v11.GetIamPolicyRequest, opts ...grpc.CallOption) (*google_iam_v1.Policy, error) + // Returns permissions that the caller has on the specified instance resource. + // + // Attempting this RPC on a non-existent Cloud Spanner instance resource will + // result in a NOT_FOUND error if the user has `spanner.instances.list` + // permission on the containing Google Cloud Project. Otherwise returns an + // empty set of permissions. + TestIamPermissions(ctx context.Context, in *google_iam_v11.TestIamPermissionsRequest, opts ...grpc.CallOption) (*google_iam_v11.TestIamPermissionsResponse, error) +} + +type instanceAdminClient struct { + cc *grpc.ClientConn +} + +func NewInstanceAdminClient(cc *grpc.ClientConn) InstanceAdminClient { + return &instanceAdminClient{cc} +} + +func (c *instanceAdminClient) ListInstanceConfigs(ctx context.Context, in *ListInstanceConfigsRequest, opts ...grpc.CallOption) (*ListInstanceConfigsResponse, error) { + out := new(ListInstanceConfigsResponse) + err := grpc.Invoke(ctx, "/google.spanner.admin.instance.v1.InstanceAdmin/ListInstanceConfigs", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *instanceAdminClient) GetInstanceConfig(ctx context.Context, in *GetInstanceConfigRequest, opts ...grpc.CallOption) (*InstanceConfig, error) { + out := new(InstanceConfig) + err := grpc.Invoke(ctx, "/google.spanner.admin.instance.v1.InstanceAdmin/GetInstanceConfig", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *instanceAdminClient) ListInstances(ctx context.Context, in *ListInstancesRequest, opts ...grpc.CallOption) (*ListInstancesResponse, error) { + out := new(ListInstancesResponse) + err := grpc.Invoke(ctx, "/google.spanner.admin.instance.v1.InstanceAdmin/ListInstances", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *instanceAdminClient) GetInstance(ctx context.Context, in *GetInstanceRequest, opts ...grpc.CallOption) (*Instance, error) { + out := new(Instance) + err := grpc.Invoke(ctx, "/google.spanner.admin.instance.v1.InstanceAdmin/GetInstance", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *instanceAdminClient) CreateInstance(ctx context.Context, in *CreateInstanceRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.spanner.admin.instance.v1.InstanceAdmin/CreateInstance", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *instanceAdminClient) UpdateInstance(ctx context.Context, in *UpdateInstanceRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { + out := new(google_longrunning.Operation) + err := grpc.Invoke(ctx, "/google.spanner.admin.instance.v1.InstanceAdmin/UpdateInstance", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *instanceAdminClient) DeleteInstance(ctx context.Context, in *DeleteInstanceRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) { + out := new(google_protobuf2.Empty) + err := grpc.Invoke(ctx, "/google.spanner.admin.instance.v1.InstanceAdmin/DeleteInstance", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *instanceAdminClient) SetIamPolicy(ctx context.Context, in *google_iam_v11.SetIamPolicyRequest, opts ...grpc.CallOption) (*google_iam_v1.Policy, error) { + out := new(google_iam_v1.Policy) + err := grpc.Invoke(ctx, "/google.spanner.admin.instance.v1.InstanceAdmin/SetIamPolicy", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *instanceAdminClient) GetIamPolicy(ctx context.Context, in *google_iam_v11.GetIamPolicyRequest, opts ...grpc.CallOption) (*google_iam_v1.Policy, error) { + out := new(google_iam_v1.Policy) + err := grpc.Invoke(ctx, "/google.spanner.admin.instance.v1.InstanceAdmin/GetIamPolicy", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *instanceAdminClient) TestIamPermissions(ctx context.Context, in *google_iam_v11.TestIamPermissionsRequest, opts ...grpc.CallOption) (*google_iam_v11.TestIamPermissionsResponse, error) { + out := new(google_iam_v11.TestIamPermissionsResponse) + err := grpc.Invoke(ctx, "/google.spanner.admin.instance.v1.InstanceAdmin/TestIamPermissions", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for InstanceAdmin service + +type InstanceAdminServer interface { + // Lists the supported instance configurations for a given project. + ListInstanceConfigs(context.Context, *ListInstanceConfigsRequest) (*ListInstanceConfigsResponse, error) + // Gets information about a particular instance configuration. + GetInstanceConfig(context.Context, *GetInstanceConfigRequest) (*InstanceConfig, error) + // Lists all instances in the given project. + ListInstances(context.Context, *ListInstancesRequest) (*ListInstancesResponse, error) + // Gets information about a particular instance. + GetInstance(context.Context, *GetInstanceRequest) (*Instance, error) + // Creates an instance and begins preparing it to begin serving. The + // returned [long-running operation][google.longrunning.Operation] + // can be used to track the progress of preparing the new + // instance. The instance name is assigned by the caller. If the + // named instance already exists, `CreateInstance` returns + // `ALREADY_EXISTS`. + // + // Immediately upon completion of this request: + // + // * The instance is readable via the API, with all requested attributes + // but no allocated resources. Its state is `CREATING`. + // + // Until completion of the returned operation: + // + // * Cancelling the operation renders the instance immediately unreadable + // via the API. + // * The instance can be deleted. + // * All other attempts to modify the instance are rejected. + // + // Upon completion of the returned operation: + // + // * Billing for all successfully-allocated resources begins (some types + // may have lower than the requested levels). + // * Databases can be created in the instance. + // * The instance's allocated resource levels are readable via the API. + // * The instance's state becomes `READY`. + // + // The returned [long-running operation][google.longrunning.Operation] will + // have a name of the format `/operations/` and + // can be used to track creation of the instance. The + // [metadata][google.longrunning.Operation.metadata] field type is + // [CreateInstanceMetadata][google.spanner.admin.instance.v1.CreateInstanceMetadata]. + // The [response][google.longrunning.Operation.response] field type is + // [Instance][google.spanner.admin.instance.v1.Instance], if successful. + CreateInstance(context.Context, *CreateInstanceRequest) (*google_longrunning.Operation, error) + // Updates an instance, and begins allocating or releasing resources + // as requested. The returned [long-running + // operation][google.longrunning.Operation] can be used to track the + // progress of updating the instance. If the named instance does not + // exist, returns `NOT_FOUND`. + // + // Immediately upon completion of this request: + // + // * For resource types for which a decrease in the instance's allocation + // has been requested, billing is based on the newly-requested level. + // + // Until completion of the returned operation: + // + // * Cancelling the operation sets its metadata's + // [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancel_time], and begins + // restoring resources to their pre-request values. The operation + // is guaranteed to succeed at undoing all resource changes, + // after which point it terminates with a `CANCELLED` status. + // * All other attempts to modify the instance are rejected. + // * Reading the instance via the API continues to give the pre-request + // resource levels. + // + // Upon completion of the returned operation: + // + // * Billing begins for all successfully-allocated resources (some types + // may have lower than the requested levels). + // * All newly-reserved resources are available for serving the instance's + // tables. + // * The instance's new resource levels are readable via the API. + // + // The returned [long-running operation][google.longrunning.Operation] will + // have a name of the format `/operations/` and + // can be used to track the instance modification. The + // [metadata][google.longrunning.Operation.metadata] field type is + // [UpdateInstanceMetadata][google.spanner.admin.instance.v1.UpdateInstanceMetadata]. + // The [response][google.longrunning.Operation.response] field type is + // [Instance][google.spanner.admin.instance.v1.Instance], if successful. + // + // Authorization requires `spanner.instances.update` permission on + // resource [name][google.spanner.admin.instance.v1.Instance.name]. + UpdateInstance(context.Context, *UpdateInstanceRequest) (*google_longrunning.Operation, error) + // Deletes an instance. + // + // Immediately upon completion of the request: + // + // * Billing ceases for all of the instance's reserved resources. + // + // Soon afterward: + // + // * The instance and *all of its databases* immediately and + // irrevocably disappear from the API. All data in the databases + // is permanently deleted. + DeleteInstance(context.Context, *DeleteInstanceRequest) (*google_protobuf2.Empty, error) + // Sets the access control policy on an instance resource. Replaces any + // existing policy. + // + // Authorization requires `spanner.instances.setIamPolicy` on + // [resource][google.iam.v1.SetIamPolicyRequest.resource]. + SetIamPolicy(context.Context, *google_iam_v11.SetIamPolicyRequest) (*google_iam_v1.Policy, error) + // Gets the access control policy for an instance resource. Returns an empty + // policy if an instance exists but does not have a policy set. + // + // Authorization requires `spanner.instances.getIamPolicy` on + // [resource][google.iam.v1.GetIamPolicyRequest.resource]. + GetIamPolicy(context.Context, *google_iam_v11.GetIamPolicyRequest) (*google_iam_v1.Policy, error) + // Returns permissions that the caller has on the specified instance resource. + // + // Attempting this RPC on a non-existent Cloud Spanner instance resource will + // result in a NOT_FOUND error if the user has `spanner.instances.list` + // permission on the containing Google Cloud Project. Otherwise returns an + // empty set of permissions. + TestIamPermissions(context.Context, *google_iam_v11.TestIamPermissionsRequest) (*google_iam_v11.TestIamPermissionsResponse, error) +} + +func RegisterInstanceAdminServer(s *grpc.Server, srv InstanceAdminServer) { + s.RegisterService(&_InstanceAdmin_serviceDesc, srv) +} + +func _InstanceAdmin_ListInstanceConfigs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListInstanceConfigsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InstanceAdminServer).ListInstanceConfigs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.spanner.admin.instance.v1.InstanceAdmin/ListInstanceConfigs", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InstanceAdminServer).ListInstanceConfigs(ctx, req.(*ListInstanceConfigsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _InstanceAdmin_GetInstanceConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetInstanceConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InstanceAdminServer).GetInstanceConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.spanner.admin.instance.v1.InstanceAdmin/GetInstanceConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InstanceAdminServer).GetInstanceConfig(ctx, req.(*GetInstanceConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _InstanceAdmin_ListInstances_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListInstancesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InstanceAdminServer).ListInstances(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.spanner.admin.instance.v1.InstanceAdmin/ListInstances", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InstanceAdminServer).ListInstances(ctx, req.(*ListInstancesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _InstanceAdmin_GetInstance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetInstanceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InstanceAdminServer).GetInstance(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.spanner.admin.instance.v1.InstanceAdmin/GetInstance", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InstanceAdminServer).GetInstance(ctx, req.(*GetInstanceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _InstanceAdmin_CreateInstance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateInstanceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InstanceAdminServer).CreateInstance(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.spanner.admin.instance.v1.InstanceAdmin/CreateInstance", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InstanceAdminServer).CreateInstance(ctx, req.(*CreateInstanceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _InstanceAdmin_UpdateInstance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateInstanceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InstanceAdminServer).UpdateInstance(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.spanner.admin.instance.v1.InstanceAdmin/UpdateInstance", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InstanceAdminServer).UpdateInstance(ctx, req.(*UpdateInstanceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _InstanceAdmin_DeleteInstance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteInstanceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InstanceAdminServer).DeleteInstance(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.spanner.admin.instance.v1.InstanceAdmin/DeleteInstance", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InstanceAdminServer).DeleteInstance(ctx, req.(*DeleteInstanceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _InstanceAdmin_SetIamPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(google_iam_v11.SetIamPolicyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InstanceAdminServer).SetIamPolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.spanner.admin.instance.v1.InstanceAdmin/SetIamPolicy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InstanceAdminServer).SetIamPolicy(ctx, req.(*google_iam_v11.SetIamPolicyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _InstanceAdmin_GetIamPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(google_iam_v11.GetIamPolicyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InstanceAdminServer).GetIamPolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.spanner.admin.instance.v1.InstanceAdmin/GetIamPolicy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InstanceAdminServer).GetIamPolicy(ctx, req.(*google_iam_v11.GetIamPolicyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _InstanceAdmin_TestIamPermissions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(google_iam_v11.TestIamPermissionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InstanceAdminServer).TestIamPermissions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.spanner.admin.instance.v1.InstanceAdmin/TestIamPermissions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InstanceAdminServer).TestIamPermissions(ctx, req.(*google_iam_v11.TestIamPermissionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _InstanceAdmin_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.spanner.admin.instance.v1.InstanceAdmin", + HandlerType: (*InstanceAdminServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListInstanceConfigs", + Handler: _InstanceAdmin_ListInstanceConfigs_Handler, + }, + { + MethodName: "GetInstanceConfig", + Handler: _InstanceAdmin_GetInstanceConfig_Handler, + }, + { + MethodName: "ListInstances", + Handler: _InstanceAdmin_ListInstances_Handler, + }, + { + MethodName: "GetInstance", + Handler: _InstanceAdmin_GetInstance_Handler, + }, + { + MethodName: "CreateInstance", + Handler: _InstanceAdmin_CreateInstance_Handler, + }, + { + MethodName: "UpdateInstance", + Handler: _InstanceAdmin_UpdateInstance_Handler, + }, + { + MethodName: "DeleteInstance", + Handler: _InstanceAdmin_DeleteInstance_Handler, + }, + { + MethodName: "SetIamPolicy", + Handler: _InstanceAdmin_SetIamPolicy_Handler, + }, + { + MethodName: "GetIamPolicy", + Handler: _InstanceAdmin_GetIamPolicy_Handler, + }, + { + MethodName: "TestIamPermissions", + Handler: _InstanceAdmin_TestIamPermissions_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/spanner/admin/instance/v1/spanner_instance_admin.proto", +} + +func init() { + proto.RegisterFile("google/spanner/admin/instance/v1/spanner_instance_admin.proto", fileDescriptor0) +} + +var fileDescriptor0 = []byte{ + // 1210 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x57, 0x4f, 0x6f, 0x1b, 0x45, + 0x14, 0x67, 0x92, 0x3a, 0x8d, 0x9f, 0xd3, 0x34, 0x1d, 0x9a, 0xca, 0xb8, 0x94, 0xa6, 0x5b, 0x54, + 0x5c, 0x83, 0x76, 0x89,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 0x4b, 0xc6, 0x64, 0xc9, 0x36, 0x50, 0x09, 0xff, 0x88, 0x60, 0x39, 0xd9, + 0x82, 0xa6, 0x21, 0x36, 0x72, 0x20, 0x4d, 0x22, 0x76, 0x45, 0x11, 0xb3, 0xca, 0x25, 0x45, 0xac, + 0x1f, 0xee, 0x28, 0xdd, 0x24, 0xc3, 0x6f, 0x10, 0x2c, 0x27, 0x87, 0xcc, 0x34, 0x0c, 0x47, 0x8e, + 0xa5, 0xc2, 0x99, 0xa1, 0x1e, 0x54, 0x95, 0xbf, 0x26, 0xba, 0x92, 0xa5, 0x29, 0x2a, 0xf9, 0x15, + 0x82, 0xa5, 0x06, 0x15, 0x75, 0xe2, 0xed, 0xaa, 0x1f, 0x23, 0x6c, 0xe8, 0x98, 0x0e, 0xf1, 0x64, + 0xe6, 0x41, 0xa3, 0xce, 0xbb, 0x9a, 0xc2, 0x44, 0x56, 0x63, 0x53, 0xa5, 0xbd, 0x66, 0x94, 0x55, + 0xda, 0x90, 0x72, 0xbf, 0x17, 0xb6, 0xc7, 0x8b, 0xc1, 0x07, 0x22, 0x4b, 0x65, 0x24, 0x95, 0xda, + 0x51, 0x54, 0x6a, 0x2f, 0x8d, 0x4a, 0x37, 0x45, 0xe5, 0x57, 0x04, 0xb8, 0x49, 0xb9, 0xda, 0xa4, + 0xa1, 0xe7, 0x70, 0x2e, 0xff, 0x07, 0x71, 0x31, 0x95, 0x6c, 0x18, 0xa2, 0x69, 0x5d, 0x9e, 0x02, + 0x19, 0xf7, 0x84, 0x8a, 0xa2, 0xba, 0x69, 0x5c, 0x9f, 0x8e, 0xaa, 0x18, 0x8a, 0xb4, 0x81, 0x4a, + 0xb7, 0xfe, 0x42, 0xf0, 0x66, 0xdb, 0xf7, 0x26, 0x5e, 0xa4, 0x5b, 0xaf, 0x35, 0x22, 0x53, 0x62, + 0x2a, 0xed, 0xca, 0xeb, 0xb3, 0x8b, 0x3e, 0xbe, 0x13, 0xbb, 0x77, 0x7d, 0x97, 0xb0, 0xae, 0xe9, + 0x87, 0x5d, 0xab, 0x4b, 0x99, 0xba, 0x5c, 0x56, 0x64, 0x22, 0x81, 0xc3, 0xc7, 0xff, 0xe8, 0xdf, + 0xd4, 0xcf, 0x3f, 0xcf, 0x5d, 0xaa, 0x45, 0xa1, 0x2a, 0xae, 0xdf, 0xeb, 0x98, 0x71, 0x52, 0x53, + 0x65, 0x7b, 0xfe, 0xc7, 0xf6, 0x60, 0xfd, 0x0f, 0x0d, 0xdc, 0x53, 0xc0, 0xbd, 0x18, 0xb8, 0xa7, + 0x80, 0x7b, 0x1a, 0xb8, 0xf7, 0x60, 0xfd, 0xe1, 0x82, 0xa2, 0xf1, 0xde, 0xbf, 0x01, 0x00, 0x00, + 0xff, 0xff, 0x23, 0xcc, 0x85, 0xa9, 0x6e, 0x10, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/spanner/v1/keys.pb.go b/vendor/google.golang.org/genproto/googleapis/spanner/v1/keys.pb.go new file mode 100644 index 0000000000..b865854690 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/spanner/v1/keys.pb.go @@ -0,0 +1,441 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/spanner/v1/keys.proto + +/* +Package spanner is a generated protocol buffer package. + +It is generated from these files: + google/spanner/v1/keys.proto + google/spanner/v1/mutation.proto + google/spanner/v1/query_plan.proto + google/spanner/v1/result_set.proto + google/spanner/v1/spanner.proto + google/spanner/v1/transaction.proto + google/spanner/v1/type.proto + +It has these top-level messages: + KeyRange + KeySet + Mutation + PlanNode + QueryPlan + ResultSet + PartialResultSet + ResultSetMetadata + ResultSetStats + CreateSessionRequest + Session + GetSessionRequest + ListSessionsRequest + ListSessionsResponse + DeleteSessionRequest + ExecuteSqlRequest + ReadRequest + BeginTransactionRequest + CommitRequest + CommitResponse + RollbackRequest + TransactionOptions + Transaction + TransactionSelector + Type + StructType +*/ +package spanner + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf1 "github.com/golang/protobuf/ptypes/struct" + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// KeyRange represents a range of rows in a table or index. +// +// A range has a start key and an end key. These keys can be open or +// closed, indicating if the range includes rows with that key. +// +// Keys are represented by lists, where the ith value in the list +// corresponds to the ith component of the table or index primary key. +// Individual values are encoded as described [here][google.spanner.v1.TypeCode]. +// +// For example, consider the following table definition: +// +// CREATE TABLE UserEvents ( +// UserName STRING(MAX), +// EventDate STRING(10) +// ) PRIMARY KEY(UserName, EventDate); +// +// The following keys name rows in this table: +// +// ["Bob", "2014-09-23"] +// ["Alfred", "2015-06-12"] +// +// Since the `UserEvents` table's `PRIMARY KEY` clause names two +// columns, each `UserEvents` key has two elements; the first is the +// `UserName`, and the second is the `EventDate`. +// +// Key ranges with multiple components are interpreted +// lexicographically by component using the table or index key's declared +// sort order. For example, the following range returns all events for +// user `"Bob"` that occurred in the year 2015: +// +// "start_closed": ["Bob", "2015-01-01"] +// "end_closed": ["Bob", "2015-12-31"] +// +// Start and end keys can omit trailing key components. This affects the +// inclusion and exclusion of rows that exactly match the provided key +// components: if the key is closed, then rows that exactly match the +// provided components are included; if the key is open, then rows +// that exactly match are not included. +// +// For example, the following range includes all events for `"Bob"` that +// occurred during and after the year 2000: +// +// "start_closed": ["Bob", "2000-01-01"] +// "end_closed": ["Bob"] +// +// The next example retrieves all events for `"Bob"`: +// +// "start_closed": ["Bob"] +// "end_closed": ["Bob"] +// +// To retrieve events before the year 2000: +// +// "start_closed": ["Bob"] +// "end_open": ["Bob", "2000-01-01"] +// +// The following range includes all rows in the table: +// +// "start_closed": [] +// "end_closed": [] +// +// This range returns all users whose `UserName` begins with any +// character from A to C: +// +// "start_closed": ["A"] +// "end_open": ["D"] +// +// This range returns all users whose `UserName` begins with B: +// +// "start_closed": ["B"] +// "end_open": ["C"] +// +// Key ranges honor column sort order. For example, suppose a table is +// defined as follows: +// +// CREATE TABLE DescendingSortedTable { +// Key INT64, +// ... +// ) PRIMARY KEY(Key DESC); +// +// The following range retrieves all rows with key values between 1 +// and 100 inclusive: +// +// "start_closed": ["100"] +// "end_closed": ["1"] +// +// Note that 100 is passed as the start, and 1 is passed as the end, +// because `Key` is a descending column in the schema. +type KeyRange struct { + // The start key must be provided. It can be either closed or open. + // + // Types that are valid to be assigned to StartKeyType: + // *KeyRange_StartClosed + // *KeyRange_StartOpen + StartKeyType isKeyRange_StartKeyType `protobuf_oneof:"start_key_type"` + // The end key must be provided. It can be either closed or open. + // + // Types that are valid to be assigned to EndKeyType: + // *KeyRange_EndClosed + // *KeyRange_EndOpen + EndKeyType isKeyRange_EndKeyType `protobuf_oneof:"end_key_type"` +} + +func (m *KeyRange) Reset() { *m = KeyRange{} } +func (m *KeyRange) String() string { return proto.CompactTextString(m) } +func (*KeyRange) ProtoMessage() {} +func (*KeyRange) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +type isKeyRange_StartKeyType interface { + isKeyRange_StartKeyType() +} +type isKeyRange_EndKeyType interface { + isKeyRange_EndKeyType() +} + +type KeyRange_StartClosed struct { + StartClosed *google_protobuf1.ListValue `protobuf:"bytes,1,opt,name=start_closed,json=startClosed,oneof"` +} +type KeyRange_StartOpen struct { + StartOpen *google_protobuf1.ListValue `protobuf:"bytes,2,opt,name=start_open,json=startOpen,oneof"` +} +type KeyRange_EndClosed struct { + EndClosed *google_protobuf1.ListValue `protobuf:"bytes,3,opt,name=end_closed,json=endClosed,oneof"` +} +type KeyRange_EndOpen struct { + EndOpen *google_protobuf1.ListValue `protobuf:"bytes,4,opt,name=end_open,json=endOpen,oneof"` +} + +func (*KeyRange_StartClosed) isKeyRange_StartKeyType() {} +func (*KeyRange_StartOpen) isKeyRange_StartKeyType() {} +func (*KeyRange_EndClosed) isKeyRange_EndKeyType() {} +func (*KeyRange_EndOpen) isKeyRange_EndKeyType() {} + +func (m *KeyRange) GetStartKeyType() isKeyRange_StartKeyType { + if m != nil { + return m.StartKeyType + } + return nil +} +func (m *KeyRange) GetEndKeyType() isKeyRange_EndKeyType { + if m != nil { + return m.EndKeyType + } + return nil +} + +func (m *KeyRange) GetStartClosed() *google_protobuf1.ListValue { + if x, ok := m.GetStartKeyType().(*KeyRange_StartClosed); ok { + return x.StartClosed + } + return nil +} + +func (m *KeyRange) GetStartOpen() *google_protobuf1.ListValue { + if x, ok := m.GetStartKeyType().(*KeyRange_StartOpen); ok { + return x.StartOpen + } + return nil +} + +func (m *KeyRange) GetEndClosed() *google_protobuf1.ListValue { + if x, ok := m.GetEndKeyType().(*KeyRange_EndClosed); ok { + return x.EndClosed + } + return nil +} + +func (m *KeyRange) GetEndOpen() *google_protobuf1.ListValue { + if x, ok := m.GetEndKeyType().(*KeyRange_EndOpen); ok { + return x.EndOpen + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*KeyRange) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _KeyRange_OneofMarshaler, _KeyRange_OneofUnmarshaler, _KeyRange_OneofSizer, []interface{}{ + (*KeyRange_StartClosed)(nil), + (*KeyRange_StartOpen)(nil), + (*KeyRange_EndClosed)(nil), + (*KeyRange_EndOpen)(nil), + } +} + +func _KeyRange_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*KeyRange) + // start_key_type + switch x := m.StartKeyType.(type) { + case *KeyRange_StartClosed: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.StartClosed); err != nil { + return err + } + case *KeyRange_StartOpen: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.StartOpen); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("KeyRange.StartKeyType has unexpected type %T", x) + } + // end_key_type + switch x := m.EndKeyType.(type) { + case *KeyRange_EndClosed: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.EndClosed); err != nil { + return err + } + case *KeyRange_EndOpen: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.EndOpen); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("KeyRange.EndKeyType has unexpected type %T", x) + } + return nil +} + +func _KeyRange_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*KeyRange) + switch tag { + case 1: // start_key_type.start_closed + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(google_protobuf1.ListValue) + err := b.DecodeMessage(msg) + m.StartKeyType = &KeyRange_StartClosed{msg} + return true, err + case 2: // start_key_type.start_open + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(google_protobuf1.ListValue) + err := b.DecodeMessage(msg) + m.StartKeyType = &KeyRange_StartOpen{msg} + return true, err + case 3: // end_key_type.end_closed + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(google_protobuf1.ListValue) + err := b.DecodeMessage(msg) + m.EndKeyType = &KeyRange_EndClosed{msg} + return true, err + case 4: // end_key_type.end_open + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(google_protobuf1.ListValue) + err := b.DecodeMessage(msg) + m.EndKeyType = &KeyRange_EndOpen{msg} + return true, err + default: + return false, nil + } +} + +func _KeyRange_OneofSizer(msg proto.Message) (n int) { + m := msg.(*KeyRange) + // start_key_type + switch x := m.StartKeyType.(type) { + case *KeyRange_StartClosed: + s := proto.Size(x.StartClosed) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *KeyRange_StartOpen: + s := proto.Size(x.StartOpen) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + // end_key_type + switch x := m.EndKeyType.(type) { + case *KeyRange_EndClosed: + s := proto.Size(x.EndClosed) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *KeyRange_EndOpen: + s := proto.Size(x.EndOpen) + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// `KeySet` defines a collection of Cloud Spanner keys and/or key ranges. All +// the keys are expected to be in the same table or index. The keys need +// not be sorted in any particular way. +// +// If the same key is specified multiple times in the set (for example +// if two ranges, two keys, or a key and a range overlap), Cloud Spanner +// behaves as if the key were only specified once. +type KeySet struct { + // A list of specific keys. Entries in `keys` should have exactly as + // many elements as there are columns in the primary or index key + // with which this `KeySet` is used. Individual key values are + // encoded as described [here][google.spanner.v1.TypeCode]. + Keys []*google_protobuf1.ListValue `protobuf:"bytes,1,rep,name=keys" json:"keys,omitempty"` + // A list of key ranges. See [KeyRange][google.spanner.v1.KeyRange] for more information about + // key range specifications. + Ranges []*KeyRange `protobuf:"bytes,2,rep,name=ranges" json:"ranges,omitempty"` + // For convenience `all` can be set to `true` to indicate that this + // `KeySet` matches all keys in the table or index. Note that any keys + // specified in `keys` or `ranges` are only yielded once. + All bool `protobuf:"varint,3,opt,name=all" json:"all,omitempty"` +} + +func (m *KeySet) Reset() { *m = KeySet{} } +func (m *KeySet) String() string { return proto.CompactTextString(m) } +func (*KeySet) ProtoMessage() {} +func (*KeySet) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *KeySet) GetKeys() []*google_protobuf1.ListValue { + if m != nil { + return m.Keys + } + return nil +} + +func (m *KeySet) GetRanges() []*KeyRange { + if m != nil { + return m.Ranges + } + return nil +} + +func (m *KeySet) GetAll() bool { + if m != nil { + return m.All + } + return false +} + +func init() { + proto.RegisterType((*KeyRange)(nil), "google.spanner.v1.KeyRange") + proto.RegisterType((*KeySet)(nil), "google.spanner.v1.KeySet") +} + +func init() { proto.RegisterFile("google/spanner/v1/keys.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 371 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xc1, 0x6b, 0xea, 0x30, + 0x1c, 0xc7, 0x5f, 0xab, 0xf8, 0x34, 0x8a, 0xf8, 0x0a, 0x8f, 0x57, 0x7c, 0x3b, 0x88, 0xa7, 0x9d, + 0x52, 0x3a, 0x0f, 0x1b, 0x78, 0x18, 0xd4, 0xc3, 0x06, 0x0e, 0x26, 0x15, 0x3c, 0x0c, 0x41, 0xa2, + 0xfd, 0xad, 0x14, 0xb3, 0x24, 0x34, 0xa9, 0xd0, 0xd3, 0xfe, 0x87, 0xfd, 0x05, 0x3b, 0xef, 0x4f, + 0xd9, 0x5f, 0x35, 0x92, 0xa6, 0x63, 0x20, 0x6c, 0xde, 0x12, 0x3e, 0xbf, 0xcf, 0xf7, 0x9b, 0x26, + 0x45, 0x67, 0x29, 0xe7, 0x29, 0x85, 0x40, 0x0a, 0xc2, 0x18, 0xe4, 0xc1, 0x21, 0x0c, 0xf6, 0x50, + 0x4a, 0x2c, 0x72, 0xae, 0xb8, 0xf7, 0xa7, 0xa2, 0xd8, 0x52, 0x7c, 0x08, 0x87, 0xb5, 0x40, 0x44, + 0x16, 0x10, 0xc6, 0xb8, 0x22, 0x2a, 0xe3, 0xcc, 0x0a, 0x9f, 0xd4, 0xec, 0xb6, 0xc5, 0x63, 0x20, + 0x55, 0x5e, 0xec, 0x54, 0x45, 0xc7, 0xaf, 0x2e, 0x6a, 0xcf, 0xa1, 0x8c, 0x09, 0x4b, 0xc1, 0xbb, + 0x46, 0x3d, 0xa9, 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2e, 0xdf, 0xdc, 0x7f, 0x37, 0x95, 0x3a, + 0xa3, 0xbc, 0x48, 0xf0, 0xd2, 0x16, 0xac, 0xc2, 0xf7, 0x9a, 0xac, 0x0d, 0x59, 0x5b, 0xb2, 0x5e, + 0x85, 0xdb, 0x96, 0x09, 0x9e, 0x7c, 0x04, 0x00, 0x00, 0xff, 0xff, 0x27, 0x88, 0xea, 0x11, 0xae, + 0x02, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/spanner/v1/mutation.pb.go b/vendor/google.golang.org/genproto/googleapis/spanner/v1/mutation.pb.go new file mode 100644 index 0000000000..8abef20cd6 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/spanner/v1/mutation.pb.go @@ -0,0 +1,347 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/spanner/v1/mutation.proto + +package spanner + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf1 "github.com/golang/protobuf/ptypes/struct" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// A modification to one or more Cloud Spanner rows. Mutations can be +// applied to a Cloud Spanner database by sending them in a +// [Commit][google.spanner.v1.Spanner.Commit] call. +type Mutation struct { + // Required. The operation to perform. + // + // Types that are valid to be assigned to Operation: + // *Mutation_Insert + // *Mutation_Update + // *Mutation_InsertOrUpdate + // *Mutation_Replace + // *Mutation_Delete_ + Operation isMutation_Operation `protobuf_oneof:"operation"` +} + +func (m *Mutation) Reset() { *m = Mutation{} } +func (m *Mutation) String() string { return proto.CompactTextString(m) } +func (*Mutation) ProtoMessage() {} +func (*Mutation) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +type isMutation_Operation interface { + isMutation_Operation() +} + +type Mutation_Insert struct { + Insert *Mutation_Write `protobuf:"bytes,1,opt,name=insert,oneof"` +} +type Mutation_Update struct { + Update *Mutation_Write `protobuf:"bytes,2,opt,name=update,oneof"` +} +type Mutation_InsertOrUpdate struct { + InsertOrUpdate *Mutation_Write `protobuf:"bytes,3,opt,name=insert_or_update,json=insertOrUpdate,oneof"` +} +type Mutation_Replace struct { + Replace *Mutation_Write `protobuf:"bytes,4,opt,name=replace,oneof"` +} +type Mutation_Delete_ struct { + Delete *Mutation_Delete `protobuf:"bytes,5,opt,name=delete,oneof"` +} + +func (*Mutation_Insert) isMutation_Operation() {} +func (*Mutation_Update) isMutation_Operation() {} +func (*Mutation_InsertOrUpdate) isMutation_Operation() {} +func (*Mutation_Replace) isMutation_Operation() {} +func (*Mutation_Delete_) isMutation_Operation() {} + +func (m *Mutation) GetOperation() isMutation_Operation { + if m != nil { + return m.Operation + } + return nil +} + +func (m *Mutation) GetInsert() *Mutation_Write { + if x, ok := m.GetOperation().(*Mutation_Insert); ok { + return x.Insert + } + return nil +} + +func (m *Mutation) GetUpdate() *Mutation_Write { + if x, ok := m.GetOperation().(*Mutation_Update); ok { + return x.Update + } + return nil +} + +func (m *Mutation) GetInsertOrUpdate() *Mutation_Write { + if x, ok := m.GetOperation().(*Mutation_InsertOrUpdate); ok { + return x.InsertOrUpdate + } + return nil +} + +func (m *Mutation) GetReplace() *Mutation_Write { + if x, ok := m.GetOperation().(*Mutation_Replace); ok { + return x.Replace + } + return nil +} + +func (m *Mutation) GetDelete() *Mutation_Delete { + if x, ok := m.GetOperation().(*Mutation_Delete_); ok { + return x.Delete + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Mutation) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _Mutation_OneofMarshaler, _Mutation_OneofUnmarshaler, _Mutation_OneofSizer, []interface{}{ + (*Mutation_Insert)(nil), + (*Mutation_Update)(nil), + (*Mutation_InsertOrUpdate)(nil), + (*Mutation_Replace)(nil), + (*Mutation_Delete_)(nil), + } +} + +func _Mutation_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Mutation) + // operation + switch x := m.Operation.(type) { + case *Mutation_Insert: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Insert); err != nil { + return err + } + case *Mutation_Update: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Update); err != nil { + return err + } + case *Mutation_InsertOrUpdate: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.InsertOrUpdate); err != nil { + return err + } + case *Mutation_Replace: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Replace); err != nil { + return err + } + case *Mutation_Delete_: + b.EncodeVarint(5<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Delete); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("Mutation.Operation has unexpected type %T", x) + } + return nil +} + +func _Mutation_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Mutation) + switch tag { + case 1: // operation.insert + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Mutation_Write) + err := b.DecodeMessage(msg) + m.Operation = &Mutation_Insert{msg} + return true, err + case 2: // operation.update + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Mutation_Write) + err := b.DecodeMessage(msg) + m.Operation = &Mutation_Update{msg} + return true, err + case 3: // operation.insert_or_update + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Mutation_Write) + err := b.DecodeMessage(msg) + m.Operation = &Mutation_InsertOrUpdate{msg} + return true, err + case 4: // operation.replace + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Mutation_Write) + err := b.DecodeMessage(msg) + m.Operation = &Mutation_Replace{msg} + return true, err + case 5: // operation.delete + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Mutation_Delete) + err := b.DecodeMessage(msg) + m.Operation = &Mutation_Delete_{msg} + return true, err + default: + return false, nil + } +} + +func _Mutation_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Mutation) + // operation + switch x := m.Operation.(type) { + case *Mutation_Insert: + s := proto.Size(x.Insert) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Mutation_Update: + s := proto.Size(x.Update) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Mutation_InsertOrUpdate: + s := proto.Size(x.InsertOrUpdate) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Mutation_Replace: + s := proto.Size(x.Replace) + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Mutation_Delete_: + s := proto.Size(x.Delete) + n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Arguments to [insert][google.spanner.v1.Mutation.insert], [update][google.spanner.v1.Mutation.update], [insert_or_update][google.spanner.v1.Mutation.insert_or_update], and +// [replace][google.spanner.v1.Mutation.replace] operations. +type Mutation_Write struct { + // Required. The table whose rows will be written. + Table string `protobuf:"bytes,1,opt,name=table" json:"table,omitempty"` + // The names of the columns in [table][google.spanner.v1.Mutation.Write.table] to be written. + // + // The list of columns must contain enough columns to allow + // Cloud Spanner to derive values for all primary key columns in the + // row(s) to be modified. + Columns []string `protobuf:"bytes,2,rep,name=columns" json:"columns,omitempty"` + // The values to be written. `values` can contain more than one + // list of values. If it does, then multiple rows are written, one + // for each entry in `values`. Each list in `values` must have + // exactly as many entries as there are entries in [columns][google.spanner.v1.Mutation.Write.columns] + // above. Sending multiple lists is equivalent to sending multiple + // `Mutation`s, each containing one `values` entry and repeating + // [table][google.spanner.v1.Mutation.Write.table] and [columns][google.spanner.v1.Mutation.Write.columns]. Individual values in each list are + // encoded as described [here][google.spanner.v1.TypeCode]. + Values []*google_protobuf1.ListValue `protobuf:"bytes,3,rep,name=values" json:"values,omitempty"` +} + +func (m *Mutation_Write) Reset() { *m = Mutation_Write{} } +func (m *Mutation_Write) String() string { return proto.CompactTextString(m) } +func (*Mutation_Write) ProtoMessage() {} +func (*Mutation_Write) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0, 0} } + +func (m *Mutation_Write) GetTable() string { + if m != nil { + return m.Table + } + return "" +} + +func (m *Mutation_Write) GetColumns() []string { + if m != nil { + return m.Columns + } + return nil +} + +func (m *Mutation_Write) GetValues() []*google_protobuf1.ListValue { + if m != nil { + return m.Values + } + return nil +} + +// Arguments to [delete][google.spanner.v1.Mutation.delete] operations. +type Mutation_Delete struct { + // Required. The table whose rows will be deleted. + Table string `protobuf:"bytes,1,opt,name=table" json:"table,omitempty"` + // Required. The primary keys of the rows within [table][google.spanner.v1.Mutation.Delete.table] to delete. + KeySet *KeySet `protobuf:"bytes,2,opt,name=key_set,json=keySet" json:"key_set,omitempty"` +} + +func (m *Mutation_Delete) Reset() { *m = Mutation_Delete{} } +func (m *Mutation_Delete) String() string { return proto.CompactTextString(m) } +func (*Mutation_Delete) ProtoMessage() {} +func (*Mutation_Delete) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0, 1} } + +func (m *Mutation_Delete) GetTable() string { + if m != nil { + return m.Table + } + return "" +} + +func (m *Mutation_Delete) GetKeySet() *KeySet { + if m != nil { + return m.KeySet + } + return nil +} + +func init() { + proto.RegisterType((*Mutation)(nil), "google.spanner.v1.Mutation") + proto.RegisterType((*Mutation_Write)(nil), "google.spanner.v1.Mutation.Write") + proto.RegisterType((*Mutation_Delete)(nil), "google.spanner.v1.Mutation.Delete") +} + +func init() { proto.RegisterFile("google/spanner/v1/mutation.proto", fileDescriptor1) } + +var fileDescriptor1 = []byte{ + // 413 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08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0, 0x07, 0x26, 0x66, 0xcb, 0xc5, + 0xd6, 0xc6, 0xb8, 0xd7, 0xc7, 0xdc, 0x37, 0xf0, 0x27, 0xf1, 0xd9, 0xc4, 0xbd, 0x46, 0x43, 0x01, + 0x35, 0x25, 0x39, 0x04, 0xfd, 0xeb, 0x53, 0x3a, 0xc6, 0x7f, 0x85, 0xbc, 0x3d, 0x50, 0x50, 0x10, + 0x0c, 0x34, 0x3d, 0xb9, 0x89, 0x7e, 0xab, 0x9d, 0xed, 0x2e, 0x86, 0x09, 0x2b, 0x34, 0xd0, 0x89, + 0xfe, 0x23, 0x34, 0x50, 0x64, 0x47, 0x41, 0x9f, 0xe6, 0x28, 0x33, 0x85, 0x1f, 0xa0, 0x61, 0xce, + 0x69, 0x73, 0x60, 0x32, 0xe8, 0x45, 0xee, 0x74, 0x94, 0x75, 0xa5, 0x9f, 0x22, 0xef, 0x48, 0x68, + 0x03, 0x32, 0x70, 0x23, 0x77, 0x3a, 0x4e, 0xc3, 0xae, 0x6d, 0x77, 0xb1, 0xf8, 0x63, 0x29, 0xd5, + 0xba, 0xb5, 0x64, 0xd6, 0x19, 0x66, 0xc8, 0x33, 0x03, 0xfc, 0xa7, 0x5b, 0x8a, 0x86, 0x15, 0x9c, + 0xb6, 0x12, 0x94, 0xbd, 0x96, 0xa7, 0xff, 0xd8, 0xe5, 0x03, 0x9c, 0x56, 0xa0, 0x32, 0xaf, 0xd2, + 0xdf, 0xf9, 0x18, 0x8d, 0x78, 0x0d, 0x42, 0xaf, 0x37, 0xff, 0xee, 0xa0, 0xc7, 0x39, 0x3f, 0x5c, + 0x52, 0xf3, 0x7b, 0xdd, 0x11, 0x2c, 0xdb, 0xf1, 0x96, 0xce, 0xd7, 0x97, 0xd6, 0x53, 0x70, 0x4a, + 0x58, 0x81, 0xb9, 0x28, 0xe2, 0x02, 0x98, 0x1e, 0x3e, 0x36, 0x12, 0xa9, 0x4b, 0x79, 0xf6, 0x10, + 0x67, 0xf6, 0xf7, 0x67, 0xef, 0xc9, 0x3b, 0x83, 0xbe, 0xa1, 0xbc, 0xd9, 0xe3, 0x95, 0x6d, 0xb2, + 0x4e, 0x7e, 0x75, 0xca, 0x46, 0x2b, 0x1b, 0xab, 0x6c, 0xd6, 0xc9, 0xce, 0xd3, 0xc1, 0x2f, 0x7e, + 0x07, 0x00, 0x00, 0xff, 0xff, 0x6b, 0x69, 0x1c, 0xbc, 0x51, 0x03, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/spanner/v1/query_plan.pb.go b/vendor/google.golang.org/genproto/googleapis/spanner/v1/query_plan.pb.go new file mode 100644 index 0000000000..b42db0fea2 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/spanner/v1/query_plan.pb.go @@ -0,0 +1,286 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/spanner/v1/query_plan.proto + +package spanner + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf1 "github.com/golang/protobuf/ptypes/struct" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// The kind of [PlanNode][google.spanner.v1.PlanNode]. Distinguishes between the two different kinds of +// nodes that can appear in a query plan. +type PlanNode_Kind int32 + +const ( + // Not specified. + PlanNode_KIND_UNSPECIFIED PlanNode_Kind = 0 + // Denotes a Relational operator node in the expression tree. Relational + // operators represent iterative processing of rows during query execution. + // For example, a `TableScan` operation that reads rows from a table. + PlanNode_RELATIONAL PlanNode_Kind = 1 + // Denotes a Scalar node in the expression tree. Scalar nodes represent + // non-iterable entities in the query plan. For example, constants or + // arithmetic operators appearing inside predicate expressions or references + // to column names. + PlanNode_SCALAR PlanNode_Kind = 2 +) + +var PlanNode_Kind_name = map[int32]string{ + 0: "KIND_UNSPECIFIED", + 1: "RELATIONAL", + 2: "SCALAR", +} +var PlanNode_Kind_value = map[string]int32{ + "KIND_UNSPECIFIED": 0, + "RELATIONAL": 1, + "SCALAR": 2, +} + +func (x PlanNode_Kind) String() string { + return proto.EnumName(PlanNode_Kind_name, int32(x)) +} +func (PlanNode_Kind) EnumDescriptor() ([]byte, []int) { return fileDescriptor2, []int{0, 0} } + +// Node information for nodes appearing in a [QueryPlan.plan_nodes][google.spanner.v1.QueryPlan.plan_nodes]. +type PlanNode struct { + // The `PlanNode`'s index in [node list][google.spanner.v1.QueryPlan.plan_nodes]. + Index int32 `protobuf:"varint,1,opt,name=index" json:"index,omitempty"` + // Used to determine the type of node. May be needed for visualizing + // different kinds of nodes differently. For example, If the node is a + // [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] node, it will have a condensed representation + // which can be used to directly embed a description of the node in its + // parent. + Kind PlanNode_Kind `protobuf:"varint,2,opt,name=kind,enum=google.spanner.v1.PlanNode_Kind" json:"kind,omitempty"` + // The display name for the node. + DisplayName string `protobuf:"bytes,3,opt,name=display_name,json=displayName" json:"display_name,omitempty"` + // List of child node `index`es and their relationship to this parent. + ChildLinks []*PlanNode_ChildLink `protobuf:"bytes,4,rep,name=child_links,json=childLinks" json:"child_links,omitempty"` + // Condensed representation for [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] nodes. + ShortRepresentation *PlanNode_ShortRepresentation `protobuf:"bytes,5,opt,name=short_representation,json=shortRepresentation" json:"short_representation,omitempty"` + // Attributes relevant to the node contained in a group of key-value pairs. + // For example, a Parameter Reference node could have the following + // information in its metadata: + // + // { + // "parameter_reference": "param1", + // "parameter_type": "array" + // } + Metadata *google_protobuf1.Struct `protobuf:"bytes,6,opt,name=metadata" json:"metadata,omitempty"` + // The execution statistics associated with the node, contained in a group of + // key-value pairs. Only present if the plan was returned as a result of a + // profile query. For example, number of executions, number of rows/time per + // execution etc. + ExecutionStats *google_protobuf1.Struct `protobuf:"bytes,7,opt,name=execution_stats,json=executionStats" json:"execution_stats,omitempty"` +} + +func (m *PlanNode) Reset() { *m = PlanNode{} } +func (m *PlanNode) String() string { return proto.CompactTextString(m) } +func (*PlanNode) ProtoMessage() {} +func (*PlanNode) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} } + +func (m *PlanNode) GetIndex() int32 { + if m != nil { + return m.Index + } + return 0 +} + +func (m *PlanNode) GetKind() PlanNode_Kind { + if m != nil { + return m.Kind + } + return PlanNode_KIND_UNSPECIFIED +} + +func (m *PlanNode) GetDisplayName() string { + if m != nil { + return m.DisplayName + } + return "" +} + +func (m *PlanNode) GetChildLinks() []*PlanNode_ChildLink { + if m != nil { + return m.ChildLinks + } + return nil +} + +func (m *PlanNode) GetShortRepresentation() *PlanNode_ShortRepresentation { + if m != nil { + return m.ShortRepresentation + } + return nil +} + +func (m *PlanNode) GetMetadata() *google_protobuf1.Struct { + if m != nil { + return m.Metadata + } + return nil +} + +func (m *PlanNode) GetExecutionStats() *google_protobuf1.Struct { + if m != nil { + return m.ExecutionStats + } + return nil +} + +// Metadata associated with a parent-child relationship appearing in a +// [PlanNode][google.spanner.v1.PlanNode]. +type PlanNode_ChildLink struct { + // The node to which the link points. + ChildIndex int32 `protobuf:"varint,1,opt,name=child_index,json=childIndex" json:"child_index,omitempty"` + // The type of the link. For example, in Hash Joins this could be used to + // distinguish between the build child and the probe child, or in the case + // of the child being an output variable, to represent the tag associated + // with the output variable. + Type string `protobuf:"bytes,2,opt,name=type" json:"type,omitempty"` + // Only present if the child node is [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] and corresponds + // to an output variable of the parent node. The field carries the name of + // the output variable. + // For example, a `TableScan` operator that reads rows from a table will + // have child links to the `SCALAR` nodes representing the output variables + // created for each column that is read by the operator. The corresponding + // `variable` fields will be set to the variable names assigned to the + // columns. + Variable string `protobuf:"bytes,3,opt,name=variable" json:"variable,omitempty"` +} + +func (m *PlanNode_ChildLink) Reset() { *m = PlanNode_ChildLink{} } +func (m *PlanNode_ChildLink) String() string { return proto.CompactTextString(m) } +func (*PlanNode_ChildLink) ProtoMessage() {} +func (*PlanNode_ChildLink) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0, 0} } + +func (m *PlanNode_ChildLink) GetChildIndex() int32 { + if m != nil { + return m.ChildIndex + } + return 0 +} + +func (m *PlanNode_ChildLink) GetType() string { + if m != nil { + return m.Type + } + return "" +} + +func (m *PlanNode_ChildLink) GetVariable() string { + if m != nil { + return m.Variable + } + return "" +} + +// Condensed representation of a node and its subtree. Only present for +// `SCALAR` [PlanNode(s)][google.spanner.v1.PlanNode]. +type PlanNode_ShortRepresentation struct { + // A string representation of the expression subtree rooted at this node. + Description string `protobuf:"bytes,1,opt,name=description" json:"description,omitempty"` + // A mapping of (subquery variable name) -> (subquery node id) for cases + // where the `description` string of this node references a `SCALAR` + // subquery contained in the expression subtree rooted at this node. The + // referenced `SCALAR` subquery may not necessarily be a direct child of + // this node. + Subqueries map[string]int32 `protobuf:"bytes,2,rep,name=subqueries" json:"subqueries,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` +} + +func (m *PlanNode_ShortRepresentation) Reset() { *m = PlanNode_ShortRepresentation{} } +func (m *PlanNode_ShortRepresentation) String() string { return proto.CompactTextString(m) } +func (*PlanNode_ShortRepresentation) ProtoMessage() {} +func (*PlanNode_ShortRepresentation) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0, 1} } + +func (m *PlanNode_ShortRepresentation) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *PlanNode_ShortRepresentation) GetSubqueries() map[string]int32 { + if m != nil { + return m.Subqueries + } + return nil +} + +// Contains an ordered list of nodes appearing in the query plan. +type QueryPlan struct { + // The nodes in the query plan. Plan nodes are returned in pre-order starting + // with the plan root. Each [PlanNode][google.spanner.v1.PlanNode]'s `id` corresponds to its index in + // `plan_nodes`. + PlanNodes []*PlanNode `protobuf:"bytes,1,rep,name=plan_nodes,json=planNodes" json:"plan_nodes,omitempty"` +} + +func (m *QueryPlan) Reset() { *m = QueryPlan{} } +func (m *QueryPlan) String() string { return proto.CompactTextString(m) } +func (*QueryPlan) ProtoMessage() {} +func (*QueryPlan) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{1} } + +func (m *QueryPlan) GetPlanNodes() []*PlanNode { + if m != nil { + return m.PlanNodes + } + return nil +} + +func init() { + proto.RegisterType((*PlanNode)(nil), "google.spanner.v1.PlanNode") + proto.RegisterType((*PlanNode_ChildLink)(nil), "google.spanner.v1.PlanNode.ChildLink") + proto.RegisterType((*PlanNode_ShortRepresentation)(nil), "google.spanner.v1.PlanNode.ShortRepresentation") + proto.RegisterType((*QueryPlan)(nil), "google.spanner.v1.QueryPlan") + proto.RegisterEnum("google.spanner.v1.PlanNode_Kind", PlanNode_Kind_name, PlanNode_Kind_value) +} + +func init() { proto.RegisterFile("google/spanner/v1/query_plan.proto", fileDescriptor2) } + +var fileDescriptor2 = []byte{ + // 604 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xdd, 0x6e, 0xd3, 0x4c, + 0x10, 0xfd, 0x9c, 0x26, 0xf9, 0x9a, 0x09, 0x4a, 0xc3, 0xb6, 0xa8, 0x56, 0x40, 0xc2, 0x44, 0x42, + 0xca, 0x95, 0xad, 0xb4, 0x5c, 0x54, 0x45, 0x08, 0xd2, 0x34, 0xad, 0xa2, 0x46, 0x21, 0xac, 0xa1, + 0x17, 0x28, 0x92, 0xb5, 0x89, 0x97, 0x74, 0x15, 0x67, 0xd7, 0x78, 0xed, 0xa8, 0x79, 0x09, 0x6e, + 0x79, 0x07, 0x1e, 0x85, 0x17, 0xe0, 0x75, 0xd0, 0xae, 0x7f, 0x28, 0x14, 0x45, 0xe2, 0x6e, 0x66, + 0xe7, 0xcc, 0xf1, 0xce, 0x39, 0xb3, 0x86, 0xf6, 0x42, 0x88, 0x45, 0x40, 0x1d, 0x19, 0x12, 0xce, + 0x69, 0xe4, 0xac, 0xbb, 0xce, 0xe7, 0x84, 0x46, 0x1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 0x00, 0x1e, 0x8c, 0x7a, 0xef, 0x87, 0x6f, 0xc7, 0xbd, 0x51, 0xd3, 0x40, 0x00, + 0x55, 0xb7, 0xdf, 0x1b, 0xf5, 0x70, 0xb3, 0xd4, 0xbe, 0x84, 0xda, 0x3b, 0xf5, 0xe6, 0xd4, 0xcd, + 0xd1, 0x29, 0x80, 0x7a, 0x7a, 0x1e, 0x17, 0x3e, 0x95, 0xa6, 0xa1, 0xc7, 0x7c, 0xbc, 0x65, 0x4c, + 0x5c, 0x0b, 0xb3, 0x48, 0x9e, 0x7d, 0x35, 0xe0, 0xd1, 0x5c, 0xac, 0xee, 0xa3, 0xcf, 0x1a, 0xc5, + 0x07, 0x26, 0xca, 0xfe, 0x89, 0xf1, 0xf1, 0x24, 0x03, 0x2d, 0x44, 0x40, 0xf8, 0xc2, 0x16, 0xd1, + 0xc2, 0x59, 0x50, 0xae, 0x97, 0xc3, 0x49, 0x4b, 0x24, 0x64, 0xf2, 0xce, 0x7f, 0xe1, 0x65, 0x16, + 0x7e, 0x2b, 0x1d, 0x5e, 0xa6, 0xad, 0xfd, 0x40, 0x24, 0xbe, 0xed, 0x66, 0x5f, 0xb9, 0xee, 0x7e, + 0xcf, 0x2b, 0x53, 0x5d, 0x99, 0x66, 0x95, 0xe9, 0x75, 0x77, 0x56, 0xd5, 0xc4, 0xc7, 0x3f, 0x03, + 0x00, 0x00, 0xff, 0xff, 0x53, 0xdb, 0x51, 0xa6, 0x6f, 0x04, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/spanner/v1/result_set.pb.go b/vendor/google.golang.org/genproto/googleapis/spanner/v1/result_set.pb.go new file mode 100644 index 0000000000..18b53a03e3 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/spanner/v1/result_set.pb.go @@ -0,0 +1,312 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/spanner/v1/result_set.proto + +package spanner + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf1 "github.com/golang/protobuf/ptypes/struct" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Results from [Read][google.spanner.v1.Spanner.Read] or +// [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql]. +type ResultSet struct { + // Metadata about the result set, such as row type information. + Metadata *ResultSetMetadata `protobuf:"bytes,1,opt,name=metadata" json:"metadata,omitempty"` + // Each element in `rows` is a row whose format is defined by + // [metadata.row_type][google.spanner.v1.ResultSetMetadata.row_type]. The ith element + // in each row matches the ith field in + // [metadata.row_type][google.spanner.v1.ResultSetMetadata.row_type]. Elements are + // encoded based on type as described + // [here][google.spanner.v1.TypeCode]. + Rows []*google_protobuf1.ListValue `protobuf:"bytes,2,rep,name=rows" json:"rows,omitempty"` + // Query plan and execution statistics for the query that produced this + // result set. These can be requested by setting + // [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. + Stats *ResultSetStats `protobuf:"bytes,3,opt,name=stats" json:"stats,omitempty"` +} + +func (m *ResultSet) Reset() { *m = ResultSet{} } +func (m *ResultSet) String() string { return proto.CompactTextString(m) } +func (*ResultSet) ProtoMessage() {} +func (*ResultSet) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} } + +func (m *ResultSet) GetMetadata() *ResultSetMetadata { + if m != nil { + return m.Metadata + } + return nil +} + +func (m *ResultSet) GetRows() []*google_protobuf1.ListValue { + if m != nil { + return m.Rows + } + return nil +} + +func (m *ResultSet) GetStats() *ResultSetStats { + if m != nil { + return m.Stats + } + return nil +} + +// Partial results from a streaming read or SQL query. Streaming reads and +// SQL queries better tolerate large result sets, large rows, and large +// values, but are a little trickier to consume. +type PartialResultSet struct { + // Metadata about the result set, such as row type information. + // Only present in the first response. + Metadata *ResultSetMetadata `protobuf:"bytes,1,opt,name=metadata" json:"metadata,omitempty"` + // A streamed result set consists of a stream of values, which might + // be split into many `PartialResultSet` messages to accommodate + // large rows and/or large values. Every N complete values defines a + // row, where N is equal to the number of entries in + // [metadata.row_type.fields][google.spanner.v1.StructType.fields]. + // + // Most values are encoded based on type as described + // [here][google.spanner.v1.TypeCode]. + // + // It is possible that the last value in values is "chunked", + // meaning that the rest of the value is sent in subsequent + // `PartialResultSet`(s). This is denoted by the [chunked_value][google.spanner.v1.PartialResultSet.chunked_value] + // field. Two or more chunked values can be merged to form a + // complete value as follows: + // + // * `bool/number/null`: cannot be chunked + // * `string`: concatenate the strings + // * `list`: concatenate the lists. If the last element in a list is a + // `string`, `list`, or `object`, merge it with the first element in + // the next list by applying these rules recursively. + // * `object`: concatenate the (field name, field value) pairs. If a + // field name is duplicated, then apply these rules recursively + // to merge the field values. + // + // Some examples of merging: + // + // # Strings are concatenated. + // "foo", "bar" => "foobar" + // + // # Lists of non-strings are concatenated. + // [2, 3], [4] => [2, 3, 4] + // + // # Lists are concatenated, but the last and first elements are merged + // # because they are strings. + // ["a", "b"], ["c", "d"] => ["a", "bc", "d"] + // + // # Lists are concatenated, but the last and first elements are merged + // # because they are lists. Recursively, the last and first elements + // # of the inner lists are merged because they are strings. + // ["a", ["b", "c"]], [["d"], "e"] => ["a", ["b", "cd"], "e"] + // + // # Non-overlapping object fields are combined. + // {"a": "1"}, {"b": "2"} => {"a": "1", "b": 2"} + // + // # Overlapping object fields are merged. + // {"a": "1"}, {"a": "2"} => {"a": "12"} + // + // # Examples of merging objects containing lists of strings. + // {"a": ["1"]}, {"a": ["2"]} => {"a": ["12"]} + // + // For a more complete example, suppose a streaming SQL query is + // yielding a result set whose rows contain a single string + // field. The following `PartialResultSet`s might be yielded: + // + // { + // "metadata": { ... } + // "values": ["Hello", "W"] + // "chunked_value": true + // "resume_token": "Af65..." + // } + // { + // "values": ["orl"] + // "chunked_value": true + // "resume_token": "Bqp2..." + // } + // { + // "values": ["d"] + // "resume_token": "Zx1B..." + // } + // + // This sequence of `PartialResultSet`s encodes two rows, one + // containing the field value `"Hello"`, and a second containing the + // field value `"World" = "W" + "orl" + "d"`. + Values []*google_protobuf1.Value `protobuf:"bytes,2,rep,name=values" json:"values,omitempty"` + // If true, then the final value in [values][google.spanner.v1.PartialResultSet.values] is chunked, and must + // be combined with more values from subsequent `PartialResultSet`s + // to obtain a complete field value. + ChunkedValue bool `protobuf:"varint,3,opt,name=chunked_value,json=chunkedValue" json:"chunked_value,omitempty"` + // Streaming calls might be interrupted for a variety of reasons, such + // as TCP connection loss. If this occurs, the stream of results can + // be resumed by re-sending the original request and including + // `resume_token`. Note that executing any other transaction in the + // same session invalidates the token. + ResumeToken []byte `protobuf:"bytes,4,opt,name=resume_token,json=resumeToken,proto3" json:"resume_token,omitempty"` + // Query plan and execution statistics for the query that produced this + // streaming result set. These can be requested by setting + // [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] and are sent + // only once with the last response in the stream. + Stats *ResultSetStats `protobuf:"bytes,5,opt,name=stats" json:"stats,omitempty"` +} + +func (m *PartialResultSet) Reset() { *m = PartialResultSet{} } +func (m *PartialResultSet) String() string { return proto.CompactTextString(m) } +func (*PartialResultSet) ProtoMessage() {} +func (*PartialResultSet) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{1} } + +func (m *PartialResultSet) GetMetadata() *ResultSetMetadata { + if m != nil { + return m.Metadata + } + return nil +} + +func (m *PartialResultSet) GetValues() []*google_protobuf1.Value { + if m != nil { + return m.Values + } + return nil +} + +func (m *PartialResultSet) GetChunkedValue() bool { + if m != nil { + return m.ChunkedValue + } + return false +} + +func (m *PartialResultSet) GetResumeToken() []byte { + if m != nil { + return m.ResumeToken + } + return nil +} + +func (m *PartialResultSet) GetStats() *ResultSetStats { + if m != nil { + return m.Stats + } + return nil +} + +// Metadata about a [ResultSet][google.spanner.v1.ResultSet] or [PartialResultSet][google.spanner.v1.PartialResultSet]. +type ResultSetMetadata struct { + // Indicates the field names and types for the rows in the result + // set. For example, a SQL query like `"SELECT UserId, UserName FROM + // Users"` could return a `row_type` value like: + // + // "fields": [ + // { "name": "UserId", "type": { "code": "INT64" } }, + // { "name": "UserName", "type": { "code": "STRING" } }, + // ] + RowType *StructType `protobuf:"bytes,1,opt,name=row_type,json=rowType" json:"row_type,omitempty"` + // If the read or SQL query began a transaction as a side-effect, the + // information about the new transaction is yielded here. + Transaction *Transaction `protobuf:"bytes,2,opt,name=transaction" json:"transaction,omitempty"` +} + +func (m *ResultSetMetadata) Reset() { *m = ResultSetMetadata{} } +func (m *ResultSetMetadata) String() string { return proto.CompactTextString(m) } +func (*ResultSetMetadata) ProtoMessage() {} +func (*ResultSetMetadata) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{2} } + +func (m *ResultSetMetadata) GetRowType() *StructType { + if m != nil { + return m.RowType + } + return nil +} + +func (m *ResultSetMetadata) GetTransaction() *Transaction { + if m != nil { + return m.Transaction + } + return nil +} + +// Additional statistics about a [ResultSet][google.spanner.v1.ResultSet] or [PartialResultSet][google.spanner.v1.PartialResultSet]. +type ResultSetStats struct { + // [QueryPlan][google.spanner.v1.QueryPlan] for the query associated with this result. + QueryPlan *QueryPlan `protobuf:"bytes,1,opt,name=query_plan,json=queryPlan" json:"query_plan,omitempty"` + // Aggregated statistics from the execution of the query. Only present when + // the query is profiled. For example, a query could return the statistics as + // follows: + // + // { + // "rows_returned": "3", + // "elapsed_time": "1.22 secs", + // "cpu_time": "1.19 secs" + // } + QueryStats *google_protobuf1.Struct `protobuf:"bytes,2,opt,name=query_stats,json=queryStats" json:"query_stats,omitempty"` +} + +func (m *ResultSetStats) Reset() { *m = ResultSetStats{} } +func (m *ResultSetStats) String() string { return proto.CompactTextString(m) } +func (*ResultSetStats) ProtoMessage() {} +func (*ResultSetStats) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{3} } + +func (m *ResultSetStats) GetQueryPlan() *QueryPlan { + if m != nil { + return m.QueryPlan + } + return nil +} + +func (m *ResultSetStats) GetQueryStats() *google_protobuf1.Struct { + if m != nil { + return m.QueryStats + } + return nil +} + +func init() { + proto.RegisterType((*ResultSet)(nil), "google.spanner.v1.ResultSet") + proto.RegisterType((*PartialResultSet)(nil), "google.spanner.v1.PartialResultSet") + proto.RegisterType((*ResultSetMetadata)(nil), "google.spanner.v1.ResultSetMetadata") + proto.RegisterType((*ResultSetStats)(nil), "google.spanner.v1.ResultSetStats") +} + +func init() { proto.RegisterFile("google/spanner/v1/result_set.proto", fileDescriptor3) } + +var fileDescriptor3 = []byte{ + // 501 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x93, 0xcd, 0x6e, 0x13, 0x31, + 0x14, 0x85, 0xe5, 0xf4, 0x87, 0xd4, 0x13, 0x10, 0xb5, 0x04, 0x1d, 0x45, 0x05, 0xa5, 0x29, 0x8b, + 0xac, 0x3c, 0x4a, 0x59, 0x10, 0xa9, 0x9b, 0xaa, 0x2c, 0xd8, 0x80, 0x14, 0x9c, 0x28, 0x0b, 0x14, + 0x69, 0xe4, 0x26, 0x66, 0x18, 0x75, 0x62, 0x4f, 0x6d, 0x4f, 0xa2, 0x3c, 0x00, 0x62, 0xc9, 0x9e, + 0x47, 0xe0, 0x01, 0x78, 0x08, 0x9e, 0x88, 0x25, 0xf2, 0xcf, 0x24, 0x81, 0x19, 0x21, 0x21, 0x75, + 0xe7, 0xf8, 0x7e, 0xe7, 0x9e, 0x7b, 0x3c, 0x37, 0xb0, 0x9b, 0x08, 0x91, 0x64, 0x2c, 0x52, 0x39, + 0xe5, 0x9c, 0xc9, 0x68, 0xd9, 0x8f, 0x24, 0x53, 0x45, 0xa6, 0x63, 0xc5, 0x34, 0xce, 0xa5, 0xd0, + 0x02, 0x1d, 0x3b, 0x06, 0x7b, 0x06, 0x2f, 0xfb, 0xed, 0x53, 0x2f, 0xa3, 0x79, 0x1a, 0x51, 0xce, + 0x85, 0xa6, 0x3a, 0x15, 0x5c, 0x39, 0xc1, 0xa6, 0x6a, 0x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 0x07, + 0xff, 0xf9, 0x0e, 0x5f, 0x01, 0x3c, 0xae, 0x04, 0x42, 0x03, 0xd8, 0x94, 0x62, 0x15, 0x9b, 0x0f, + 0xed, 0x1f, 0xe2, 0x59, 0x4d, 0xc7, 0x91, 0x5d, 0xb8, 0xf1, 0x3a, 0x67, 0xe4, 0x81, 0x14, 0x2b, + 0x73, 0x40, 0x57, 0x30, 0xd8, 0xd9, 0xa1, 0xb0, 0x61, 0xc5, 0xcf, 0x6b, 0xc4, 0xe3, 0x2d, 0x45, + 0x76, 0x25, 0xdd, 0x2f, 0x00, 0x3e, 0xfa, 0x73, 0x56, 0x74, 0x09, 0xe1, 0x76, 0x79, 0xfd, 0x40, + 0xa7, 0x35, 0x3d, 0xdf, 0x1b, 0x68, 0x98, 0x51, 0x4e, 0x8e, 0xee, 0xca, 0x23, 0x1a, 0xc0, 0xc0, + 0x89, 0xdd, 0x03, 0xb9, 0x89, 0x4e, 0x2a, 0xdf, 0xc5, 0x85, 0x21, 0xce, 0xc8, 0xda, 0x5e, 0x7f, + 0x03, 0xf0, 0xc9, 0x4c, 0x2c, 0xaa, 0x46, 0xd7, 0xdb, 0x01, 0x87, 0x46, 0x3f, 0x04, 0x1f, 0x06, + 0x1e, 0x4a, 0x44, 0x46, 0x79, 0x82, 0x85, 0x4c, 0xa2, 0x84, 0x71, 0xdb, 0x3d, 0x72, 0x25, 0x9a, + 0xa7, 0x6a, 0xe7, 0x5f, 0x74, 0xe9, 0x8f, 0xbf, 0x00, 0xf8, 0xde, 0x38, 0x79, 0xe3, 0xd4, 0xaf, + 0x33, 0x51, 0xcc, 0xf1, 0xc8, 0x1b, 0x4d, 0xfa, 0x3f, 0xcb, 0xca, 0xd4, 0x56, 0xa6, 0xbe, 0x32, + 0x9d, 0xf4, 0x6f, 0x0e, 0x6d, 0xef, 0x97, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x06, 0x67, 0x6c, + 0xee, 0x5c, 0x04, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/spanner/v1/spanner.pb.go b/vendor/google.golang.org/genproto/googleapis/spanner/v1/spanner.pb.go new file mode 100644 index 0000000000..2db4585197 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/spanner/v1/spanner.pb.go @@ -0,0 +1,1396 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/spanner/v1/spanner.proto + +package spanner + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf4 "github.com/golang/protobuf/ptypes/empty" +import google_protobuf1 "github.com/golang/protobuf/ptypes/struct" +import google_protobuf3 "github.com/golang/protobuf/ptypes/timestamp" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Mode in which the query must be processed. +type ExecuteSqlRequest_QueryMode int32 + +const ( + // The default mode where only the query result, without any information + // about the query plan is returned. + ExecuteSqlRequest_NORMAL ExecuteSqlRequest_QueryMode = 0 + // This mode returns only the query plan, without any result rows or + // execution statistics information. + ExecuteSqlRequest_PLAN ExecuteSqlRequest_QueryMode = 1 + // This mode returns both the query plan and the execution statistics along + // with the result rows. + ExecuteSqlRequest_PROFILE ExecuteSqlRequest_QueryMode = 2 +) + +var ExecuteSqlRequest_QueryMode_name = map[int32]string{ + 0: "NORMAL", + 1: "PLAN", + 2: "PROFILE", +} +var ExecuteSqlRequest_QueryMode_value = map[string]int32{ + "NORMAL": 0, + "PLAN": 1, + "PROFILE": 2, +} + +func (x ExecuteSqlRequest_QueryMode) String() string { + return proto.EnumName(ExecuteSqlRequest_QueryMode_name, int32(x)) +} +func (ExecuteSqlRequest_QueryMode) EnumDescriptor() ([]byte, []int) { + return fileDescriptor4, []int{6, 0} +} + +// The request for [CreateSession][google.spanner.v1.Spanner.CreateSession]. +type CreateSessionRequest struct { + // Required. The database in which the new session is created. + Database string `protobuf:"bytes,1,opt,name=database" json:"database,omitempty"` + // The session to create. + Session *Session `protobuf:"bytes,2,opt,name=session" json:"session,omitempty"` +} + +func (m *CreateSessionRequest) Reset() { *m = CreateSessionRequest{} } +func (m *CreateSessionRequest) String() string { return proto.CompactTextString(m) } +func (*CreateSessionRequest) ProtoMessage() {} +func (*CreateSessionRequest) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{0} } + +func (m *CreateSessionRequest) GetDatabase() string { + if m != nil { + return m.Database + } + return "" +} + +func (m *CreateSessionRequest) GetSession() *Session { + if m != nil { + return m.Session + } + return nil +} + +// A session in the Cloud Spanner API. +type Session struct { + // The name of the session. This is always system-assigned; values provided + // when creating a session are ignored. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The labels for the session. + // + // * Label keys must be between 1 and 63 characters long and must conform to + // the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`. + // * Label values must be between 0 and 63 characters long and must conform + // to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`. + // * No more than 64 labels can be associated with a given session. + // + // See https://goo.gl/xmQnxf for more information on and examples of labels. + Labels map[string]string `protobuf:"bytes,2,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // Output only. The timestamp when the session is created. + CreateTime *google_protobuf3.Timestamp `protobuf:"bytes,3,opt,name=create_time,json=createTime" json:"create_time,omitempty"` + // Output only. The approximate timestamp when the session is last used. It is + // typically earlier than the actual last use time. + ApproximateLastUseTime *google_protobuf3.Timestamp `protobuf:"bytes,4,opt,name=approximate_last_use_time,json=approximateLastUseTime" json:"approximate_last_use_time,omitempty"` +} + +func (m *Session) Reset() { *m = Session{} } +func (m *Session) String() string { return proto.CompactTextString(m) } +func (*Session) ProtoMessage() {} +func (*Session) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{1} } + +func (m *Session) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Session) GetLabels() map[string]string { + if m != nil { + return m.Labels + } + return nil +} + +func (m *Session) GetCreateTime() *google_protobuf3.Timestamp { + if m != nil { + return m.CreateTime + } + return nil +} + +func (m *Session) GetApproximateLastUseTime() *google_protobuf3.Timestamp { + if m != nil { + return m.ApproximateLastUseTime + } + return nil +} + +// The request for [GetSession][google.spanner.v1.Spanner.GetSession]. +type GetSessionRequest struct { + // Required. The name of the session to retrieve. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GetSessionRequest) Reset() { *m = GetSessionRequest{} } +func (m *GetSessionRequest) String() string { return proto.CompactTextString(m) } +func (*GetSessionRequest) ProtoMessage() {} +func (*GetSessionRequest) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{2} } + +func (m *GetSessionRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// The request for [ListSessions][google.spanner.v1.Spanner.ListSessions]. +type ListSessionsRequest struct { + // Required. The database in which to list sessions. + Database string `protobuf:"bytes,1,opt,name=database" json:"database,omitempty"` + // Number of sessions to be returned in the response. If 0 or less, defaults + // to the server's maximum allowed page size. + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // If non-empty, `page_token` should contain a + // [next_page_token][google.spanner.v1.ListSessionsResponse.next_page_token] from a previous + // [ListSessionsResponse][google.spanner.v1.ListSessionsResponse]. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` + // An expression for filtering the results of the request. Filter rules are + // case insensitive. The fields eligible for filtering are: + // + // * `labels.key` where key is the name of a label + // + // Some examples of using filters are: + // + // * `labels.env:*` --> The session has the label "env". + // * `labels.env:dev` --> The session has the label "env" and the value of + // the label contains the string "dev". + Filter string `protobuf:"bytes,4,opt,name=filter" json:"filter,omitempty"` +} + +func (m *ListSessionsRequest) Reset() { *m = ListSessionsRequest{} } +func (m *ListSessionsRequest) String() string { return proto.CompactTextString(m) } +func (*ListSessionsRequest) ProtoMessage() {} +func (*ListSessionsRequest) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{3} } + +func (m *ListSessionsRequest) GetDatabase() string { + if m != nil { + return m.Database + } + return "" +} + +func (m *ListSessionsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListSessionsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +func (m *ListSessionsRequest) GetFilter() string { + if m != nil { + return m.Filter + } + return "" +} + +// The response for [ListSessions][google.spanner.v1.Spanner.ListSessions]. +type ListSessionsResponse struct { + // The list of requested sessions. + Sessions []*Session `protobuf:"bytes,1,rep,name=sessions" json:"sessions,omitempty"` + // `next_page_token` can be sent in a subsequent + // [ListSessions][google.spanner.v1.Spanner.ListSessions] call to fetch more of the matching + // sessions. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListSessionsResponse) Reset() { *m = ListSessionsResponse{} } +func (m *ListSessionsResponse) String() string { return proto.CompactTextString(m) } +func (*ListSessionsResponse) ProtoMessage() {} +func (*ListSessionsResponse) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{4} } + +func (m *ListSessionsResponse) GetSessions() []*Session { + if m != nil { + return m.Sessions + } + return nil +} + +func (m *ListSessionsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// The request for [DeleteSession][google.spanner.v1.Spanner.DeleteSession]. +type DeleteSessionRequest struct { + // Required. The name of the session to delete. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *DeleteSessionRequest) Reset() { *m = DeleteSessionRequest{} } +func (m *DeleteSessionRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteSessionRequest) ProtoMessage() {} +func (*DeleteSessionRequest) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{5} } + +func (m *DeleteSessionRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// The request for [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and +// [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql]. +type ExecuteSqlRequest struct { + // Required. The session in which the SQL query should be performed. + Session string `protobuf:"bytes,1,opt,name=session" json:"session,omitempty"` + // The transaction to use. If none is provided, the default is a + // temporary read-only transaction with strong concurrency. + Transaction *TransactionSelector `protobuf:"bytes,2,opt,name=transaction" json:"transaction,omitempty"` + // Required. The SQL query string. + Sql string `protobuf:"bytes,3,opt,name=sql" json:"sql,omitempty"` + // The SQL query string can contain parameter placeholders. A parameter + // placeholder consists of `'@'` followed by the parameter + // name. Parameter names consist of any combination of letters, + // numbers, and underscores. + // + // Parameters can appear anywhere that a literal value is expected. The same + // parameter name can be used more than once, for example: + // `"WHERE id > @msg_id AND id < @msg_id + 100"` + // + // It is an error to execute an SQL query with unbound parameters. + // + // Parameter values are specified using `params`, which is a JSON + // object whose keys are parameter names, and whose values are the + // corresponding parameter values. + Params *google_protobuf1.Struct `protobuf:"bytes,4,opt,name=params" json:"params,omitempty"` + // It is not always possible for Cloud Spanner to infer the right SQL type + // from a JSON value. For example, values of type `BYTES` and values + // of type `STRING` both appear in [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings. + // + // In these cases, `param_types` can be used to specify the exact + // SQL type for some or all of the SQL query parameters. See the + // definition of [Type][google.spanner.v1.Type] for more information + // about SQL types. + ParamTypes map[string]*Type `protobuf:"bytes,5,rep,name=param_types,json=paramTypes" json:"param_types,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // If this request is resuming a previously interrupted SQL query + // execution, `resume_token` should be copied from the last + // [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the interruption. Doing this + // enables the new SQL query execution to resume where the last one left + // off. The rest of the request parameters must exactly match the + // request that yielded this token. + ResumeToken []byte `protobuf:"bytes,6,opt,name=resume_token,json=resumeToken,proto3" json:"resume_token,omitempty"` + // Used to control the amount of debugging information returned in + // [ResultSetStats][google.spanner.v1.ResultSetStats]. + QueryMode ExecuteSqlRequest_QueryMode `protobuf:"varint,7,opt,name=query_mode,json=queryMode,enum=google.spanner.v1.ExecuteSqlRequest_QueryMode" json:"query_mode,omitempty"` +} + +func (m *ExecuteSqlRequest) Reset() { *m = ExecuteSqlRequest{} } +func (m *ExecuteSqlRequest) String() string { return proto.CompactTextString(m) } +func (*ExecuteSqlRequest) ProtoMessage() {} +func (*ExecuteSqlRequest) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{6} } + +func (m *ExecuteSqlRequest) GetSession() string { + if m != nil { + return m.Session + } + return "" +} + +func (m *ExecuteSqlRequest) GetTransaction() *TransactionSelector { + if m != nil { + return m.Transaction + } + return nil +} + +func (m *ExecuteSqlRequest) GetSql() string { + if m != nil { + return m.Sql + } + return "" +} + +func (m *ExecuteSqlRequest) GetParams() *google_protobuf1.Struct { + if m != nil { + return m.Params + } + return nil +} + +func (m *ExecuteSqlRequest) GetParamTypes() map[string]*Type { + if m != nil { + return m.ParamTypes + } + return nil +} + +func (m *ExecuteSqlRequest) GetResumeToken() []byte { + if m != nil { + return m.ResumeToken + } + return nil +} + +func (m *ExecuteSqlRequest) GetQueryMode() ExecuteSqlRequest_QueryMode { + if m != nil { + return m.QueryMode + } + return ExecuteSqlRequest_NORMAL +} + +// The request for [Read][google.spanner.v1.Spanner.Read] and +// [StreamingRead][google.spanner.v1.Spanner.StreamingRead]. +type ReadRequest struct { + // Required. The session in which the read should be performed. + Session string `protobuf:"bytes,1,opt,name=session" json:"session,omitempty"` + // The transaction to use. If none is provided, the default is a + // temporary read-only transaction with strong concurrency. + Transaction *TransactionSelector `protobuf:"bytes,2,opt,name=transaction" json:"transaction,omitempty"` + // Required. The name of the table in the database to be read. + Table string `protobuf:"bytes,3,opt,name=table" json:"table,omitempty"` + // If non-empty, the name of an index on [table][google.spanner.v1.ReadRequest.table]. This index is + // used instead of the table primary key when interpreting [key_set][google.spanner.v1.ReadRequest.key_set] + // and sorting result rows. See [key_set][google.spanner.v1.ReadRequest.key_set] for further information. + Index string `protobuf:"bytes,4,opt,name=index" json:"index,omitempty"` + // The columns of [table][google.spanner.v1.ReadRequest.table] to be returned for each row matching + // this request. + Columns []string `protobuf:"bytes,5,rep,name=columns" json:"columns,omitempty"` + // Required. `key_set` identifies the rows to be yielded. `key_set` names the + // primary keys of the rows in [table][google.spanner.v1.ReadRequest.table] to be yielded, unless [index][google.spanner.v1.ReadRequest.index] + // is present. If [index][google.spanner.v1.ReadRequest.index] is present, then [key_set][google.spanner.v1.ReadRequest.key_set] instead names + // index keys in [index][google.spanner.v1.ReadRequest.index]. + // + // Rows are yielded in table primary key order (if [index][google.spanner.v1.ReadRequest.index] is empty) + // or index key order (if [index][google.spanner.v1.ReadRequest.index] is non-empty). + // + // It is not an error for the `key_set` to name rows that do not + // exist in the database. Read yields nothing for nonexistent rows. + KeySet *KeySet `protobuf:"bytes,6,opt,name=key_set,json=keySet" json:"key_set,omitempty"` + // If greater than zero, only the first `limit` rows are yielded. If `limit` + // is zero, the default is no limit. + Limit int64 `protobuf:"varint,8,opt,name=limit" json:"limit,omitempty"` + // If this request is resuming a previously interrupted read, + // `resume_token` should be copied from the last + // [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the interruption. Doing this + // enables the new read to resume where the last read left off. The + // rest of the request parameters must exactly match the request + // that yielded this token. + ResumeToken []byte `protobuf:"bytes,9,opt,name=resume_token,json=resumeToken,proto3" json:"resume_token,omitempty"` +} + +func (m *ReadRequest) Reset() { *m = ReadRequest{} } +func (m *ReadRequest) String() string { return proto.CompactTextString(m) } +func (*ReadRequest) ProtoMessage() {} +func (*ReadRequest) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{7} } + +func (m *ReadRequest) GetSession() string { + if m != nil { + return m.Session + } + return "" +} + +func (m *ReadRequest) GetTransaction() *TransactionSelector { + if m != nil { + return m.Transaction + } + return nil +} + +func (m *ReadRequest) GetTable() string { + if m != nil { + return m.Table + } + return "" +} + +func (m *ReadRequest) GetIndex() string { + if m != nil { + return m.Index + } + return "" +} + +func (m *ReadRequest) GetColumns() []string { + if m != nil { + return m.Columns + } + return nil +} + +func (m *ReadRequest) GetKeySet() *KeySet { + if m != nil { + return m.KeySet + } + return nil +} + +func (m *ReadRequest) GetLimit() int64 { + if m != nil { + return m.Limit + } + return 0 +} + +func (m *ReadRequest) GetResumeToken() []byte { + if m != nil { + return m.ResumeToken + } + return nil +} + +// The request for [BeginTransaction][google.spanner.v1.Spanner.BeginTransaction]. +type BeginTransactionRequest struct { + // Required. The session in which the transaction runs. + Session string `protobuf:"bytes,1,opt,name=session" json:"session,omitempty"` + // Required. Options for the new transaction. + Options *TransactionOptions `protobuf:"bytes,2,opt,name=options" json:"options,omitempty"` +} + +func (m *BeginTransactionRequest) Reset() { *m = BeginTransactionRequest{} } +func (m *BeginTransactionRequest) String() string { return proto.CompactTextString(m) } +func (*BeginTransactionRequest) ProtoMessage() {} +func (*BeginTransactionRequest) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{8} } + +func (m *BeginTransactionRequest) GetSession() string { + if m != nil { + return m.Session + } + return "" +} + +func (m *BeginTransactionRequest) GetOptions() *TransactionOptions { + if m != nil { + return m.Options + } + return nil +} + +// The request for [Commit][google.spanner.v1.Spanner.Commit]. +type CommitRequest struct { + // Required. The session in which the transaction to be committed is running. + Session string `protobuf:"bytes,1,opt,name=session" json:"session,omitempty"` + // Required. The transaction in which to commit. + // + // Types that are valid to be assigned to Transaction: + // *CommitRequest_TransactionId + // *CommitRequest_SingleUseTransaction + Transaction isCommitRequest_Transaction `protobuf_oneof:"transaction"` + // The mutations to be executed when this transaction commits. All + // mutations are applied atomically, in the order they appear in + // this list. + Mutations []*Mutation `protobuf:"bytes,4,rep,name=mutations" json:"mutations,omitempty"` +} + +func (m *CommitRequest) Reset() { *m = CommitRequest{} } +func (m *CommitRequest) String() string { return proto.CompactTextString(m) } +func (*CommitRequest) ProtoMessage() {} +func (*CommitRequest) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{9} } + +type isCommitRequest_Transaction interface { + isCommitRequest_Transaction() +} + +type CommitRequest_TransactionId struct { + TransactionId []byte `protobuf:"bytes,2,opt,name=transaction_id,json=transactionId,proto3,oneof"` +} +type CommitRequest_SingleUseTransaction struct { + SingleUseTransaction *TransactionOptions `protobuf:"bytes,3,opt,name=single_use_transaction,json=singleUseTransaction,oneof"` +} + +func (*CommitRequest_TransactionId) isCommitRequest_Transaction() {} +func (*CommitRequest_SingleUseTransaction) isCommitRequest_Transaction() {} + +func (m *CommitRequest) GetTransaction() isCommitRequest_Transaction { + if m != nil { + return m.Transaction + } + return nil +} + +func (m *CommitRequest) GetSession() string { + if m != nil { + return m.Session + } + return "" +} + +func (m *CommitRequest) GetTransactionId() []byte { + if x, ok := m.GetTransaction().(*CommitRequest_TransactionId); ok { + return x.TransactionId + } + return nil +} + +func (m *CommitRequest) GetSingleUseTransaction() *TransactionOptions { + if x, ok := m.GetTransaction().(*CommitRequest_SingleUseTransaction); ok { + return x.SingleUseTransaction + } + return nil +} + +func (m *CommitRequest) GetMutations() []*Mutation { + if m != nil { + return m.Mutations + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*CommitRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _CommitRequest_OneofMarshaler, _CommitRequest_OneofUnmarshaler, _CommitRequest_OneofSizer, []interface{}{ + (*CommitRequest_TransactionId)(nil), + (*CommitRequest_SingleUseTransaction)(nil), + } +} + +func _CommitRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*CommitRequest) + // transaction + switch x := m.Transaction.(type) { + case *CommitRequest_TransactionId: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeRawBytes(x.TransactionId) + case *CommitRequest_SingleUseTransaction: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.SingleUseTransaction); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("CommitRequest.Transaction has unexpected type %T", x) + } + return nil +} + +func _CommitRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*CommitRequest) + switch tag { + case 2: // transaction.transaction_id + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.Transaction = &CommitRequest_TransactionId{x} + return true, err + case 3: // transaction.single_use_transaction + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(TransactionOptions) + err := b.DecodeMessage(msg) + m.Transaction = &CommitRequest_SingleUseTransaction{msg} + return true, err + default: + return false, nil + } +} + +func _CommitRequest_OneofSizer(msg proto.Message) (n int) { + m := msg.(*CommitRequest) + // transaction + switch x := m.Transaction.(type) { + case *CommitRequest_TransactionId: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.TransactionId))) + n += len(x.TransactionId) + case *CommitRequest_SingleUseTransaction: + s := proto.Size(x.SingleUseTransaction) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// The response for [Commit][google.spanner.v1.Spanner.Commit]. +type CommitResponse struct { + // The Cloud Spanner timestamp at which the transaction committed. + CommitTimestamp *google_protobuf3.Timestamp `protobuf:"bytes,1,opt,name=commit_timestamp,json=commitTimestamp" json:"commit_timestamp,omitempty"` +} + +func (m *CommitResponse) Reset() { *m = CommitResponse{} } +func (m *CommitResponse) String() string { return proto.CompactTextString(m) } +func (*CommitResponse) ProtoMessage() {} +func (*CommitResponse) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{10} } + +func (m *CommitResponse) GetCommitTimestamp() *google_protobuf3.Timestamp { + if m != nil { + return m.CommitTimestamp + } + return nil +} + +// The request for [Rollback][google.spanner.v1.Spanner.Rollback]. +type RollbackRequest struct { + // Required. The session in which the transaction to roll back is running. + Session string `protobuf:"bytes,1,opt,name=session" json:"session,omitempty"` + // Required. The transaction to roll back. + TransactionId []byte `protobuf:"bytes,2,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"` +} + +func (m *RollbackRequest) Reset() { *m = RollbackRequest{} } +func (m *RollbackRequest) String() string { return proto.CompactTextString(m) } +func (*RollbackRequest) ProtoMessage() {} +func (*RollbackRequest) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{11} } + +func (m *RollbackRequest) GetSession() string { + if m != nil { + return m.Session + } + return "" +} + +func (m *RollbackRequest) GetTransactionId() []byte { + if m != nil { + return m.TransactionId + } + return nil +} + +func init() { + proto.RegisterType((*CreateSessionRequest)(nil), "google.spanner.v1.CreateSessionRequest") + proto.RegisterType((*Session)(nil), "google.spanner.v1.Session") + proto.RegisterType((*GetSessionRequest)(nil), "google.spanner.v1.GetSessionRequest") + proto.RegisterType((*ListSessionsRequest)(nil), "google.spanner.v1.ListSessionsRequest") + proto.RegisterType((*ListSessionsResponse)(nil), "google.spanner.v1.ListSessionsResponse") + proto.RegisterType((*DeleteSessionRequest)(nil), "google.spanner.v1.DeleteSessionRequest") + proto.RegisterType((*ExecuteSqlRequest)(nil), "google.spanner.v1.ExecuteSqlRequest") + proto.RegisterType((*ReadRequest)(nil), "google.spanner.v1.ReadRequest") + proto.RegisterType((*BeginTransactionRequest)(nil), "google.spanner.v1.BeginTransactionRequest") + proto.RegisterType((*CommitRequest)(nil), "google.spanner.v1.CommitRequest") + proto.RegisterType((*CommitResponse)(nil), "google.spanner.v1.CommitResponse") + proto.RegisterType((*RollbackRequest)(nil), "google.spanner.v1.RollbackRequest") + proto.RegisterEnum("google.spanner.v1.ExecuteSqlRequest_QueryMode", ExecuteSqlRequest_QueryMode_name, ExecuteSqlRequest_QueryMode_value) +} + +// 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 + +// Client API for Spanner service + +type SpannerClient interface { + // Creates a new session. A session can be used to perform + // transactions that read and/or modify data in a Cloud Spanner database. + // Sessions are meant to be reused for many consecutive + // transactions. + // + // Sessions can only execute one transaction at a time. To execute + // multiple concurrent read-write/write-only transactions, create + // multiple sessions. Note that standalone reads and queries use a + // transaction internally, and count toward the one transaction + // limit. + // + // Cloud Spanner limits the number of sessions that can exist at any given + // time; thus, it is a good idea to delete idle and/or unneeded sessions. + // Aside from explicit deletes, Cloud Spanner can delete sessions for which no + // operations are sent for more than an hour. If a session is deleted, + // requests to it return `NOT_FOUND`. + // + // Idle sessions can be kept alive by sending a trivial SQL query + // periodically, e.g., `"SELECT 1"`. + CreateSession(ctx context.Context, in *CreateSessionRequest, opts ...grpc.CallOption) (*Session, error) + // Gets a session. Returns `NOT_FOUND` if the session does not exist. + // This is mainly useful for determining whether a session is still + // alive. + GetSession(ctx context.Context, in *GetSessionRequest, opts ...grpc.CallOption) (*Session, error) + // Lists all sessions in a given database. + ListSessions(ctx context.Context, in *ListSessionsRequest, opts ...grpc.CallOption) (*ListSessionsResponse, error) + // Ends a session, releasing server resources associated with it. + DeleteSession(ctx context.Context, in *DeleteSessionRequest, opts ...grpc.CallOption) (*google_protobuf4.Empty, error) + // Executes an SQL query, returning all rows in a single reply. This + // method cannot be used to return a result set larger than 10 MiB; + // if the query yields more data than that, the query fails with + // a `FAILED_PRECONDITION` error. + // + // Queries inside read-write transactions might return `ABORTED`. If + // this occurs, the application should restart the transaction from + // the beginning. See [Transaction][google.spanner.v1.Transaction] for more details. + // + // Larger result sets can be fetched in streaming fashion by calling + // [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] instead. + ExecuteSql(ctx context.Context, in *ExecuteSqlRequest, opts ...grpc.CallOption) (*ResultSet, error) + // Like [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], except returns the result + // set as a stream. Unlike [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], there + // is no limit on the size of the returned result set. However, no + // individual row in the result set can exceed 100 MiB, and no + // column value can exceed 10 MiB. + ExecuteStreamingSql(ctx context.Context, in *ExecuteSqlRequest, opts ...grpc.CallOption) (Spanner_ExecuteStreamingSqlClient, error) + // Reads rows from the database using key lookups and scans, as a + // simple key/value style alternative to + // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql]. This method cannot be used to + // return a result set larger than 10 MiB; if the read matches more + // data than that, the read fails with a `FAILED_PRECONDITION` + // error. + // + // Reads inside read-write transactions might return `ABORTED`. If + // this occurs, the application should restart the transaction from + // the beginning. See [Transaction][google.spanner.v1.Transaction] for more details. + // + // Larger result sets can be yielded in streaming fashion by calling + // [StreamingRead][google.spanner.v1.Spanner.StreamingRead] instead. + Read(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (*ResultSet, error) + // Like [Read][google.spanner.v1.Spanner.Read], except returns the result set as a + // stream. Unlike [Read][google.spanner.v1.Spanner.Read], there is no limit on the + // size of the returned result set. However, no individual row in + // the result set can exceed 100 MiB, and no column value can exceed + // 10 MiB. + StreamingRead(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (Spanner_StreamingReadClient, error) + // Begins a new transaction. This step can often be skipped: + // [Read][google.spanner.v1.Spanner.Read], [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and + // [Commit][google.spanner.v1.Spanner.Commit] can begin a new transaction as a + // side-effect. + BeginTransaction(ctx context.Context, in *BeginTransactionRequest, opts ...grpc.CallOption) (*Transaction, error) + // Commits a transaction. The request includes the mutations to be + // applied to rows in the database. + // + // `Commit` might return an `ABORTED` error. This can occur at any time; + // commonly, the cause is conflicts with concurrent + // transactions. However, it can also happen for a variety of other + // reasons. If `Commit` returns `ABORTED`, the caller should re-attempt + // the transaction from the beginning, re-using the same session. + Commit(ctx context.Context, in *CommitRequest, opts ...grpc.CallOption) (*CommitResponse, error) + // Rolls back a transaction, releasing any locks it holds. It is a good + // idea to call this for any transaction that includes one or more + // [Read][google.spanner.v1.Spanner.Read] or [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] requests and + // ultimately decides not to commit. + // + // `Rollback` returns `OK` if it successfully aborts the transaction, the + // transaction was already aborted, or the transaction is not + // found. `Rollback` never returns `ABORTED`. + Rollback(ctx context.Context, in *RollbackRequest, opts ...grpc.CallOption) (*google_protobuf4.Empty, error) +} + +type spannerClient struct { + cc *grpc.ClientConn +} + +func NewSpannerClient(cc *grpc.ClientConn) SpannerClient { + return &spannerClient{cc} +} + +func (c *spannerClient) CreateSession(ctx context.Context, in *CreateSessionRequest, opts ...grpc.CallOption) (*Session, error) { + out := new(Session) + err := grpc.Invoke(ctx, "/google.spanner.v1.Spanner/CreateSession", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *spannerClient) GetSession(ctx context.Context, in *GetSessionRequest, opts ...grpc.CallOption) (*Session, error) { + out := new(Session) + err := grpc.Invoke(ctx, "/google.spanner.v1.Spanner/GetSession", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *spannerClient) ListSessions(ctx context.Context, in *ListSessionsRequest, opts ...grpc.CallOption) (*ListSessionsResponse, error) { + out := new(ListSessionsResponse) + err := grpc.Invoke(ctx, "/google.spanner.v1.Spanner/ListSessions", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *spannerClient) DeleteSession(ctx context.Context, in *DeleteSessionRequest, opts ...grpc.CallOption) (*google_protobuf4.Empty, error) { + out := new(google_protobuf4.Empty) + err := grpc.Invoke(ctx, "/google.spanner.v1.Spanner/DeleteSession", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *spannerClient) ExecuteSql(ctx context.Context, in *ExecuteSqlRequest, opts ...grpc.CallOption) (*ResultSet, error) { + out := new(ResultSet) + err := grpc.Invoke(ctx, "/google.spanner.v1.Spanner/ExecuteSql", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *spannerClient) ExecuteStreamingSql(ctx context.Context, in *ExecuteSqlRequest, opts ...grpc.CallOption) (Spanner_ExecuteStreamingSqlClient, error) { + stream, err := grpc.NewClientStream(ctx, &_Spanner_serviceDesc.Streams[0], c.cc, "/google.spanner.v1.Spanner/ExecuteStreamingSql", opts...) + if err != nil { + return nil, err + } + x := &spannerExecuteStreamingSqlClient{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 Spanner_ExecuteStreamingSqlClient interface { + Recv() (*PartialResultSet, error) + grpc.ClientStream +} + +type spannerExecuteStreamingSqlClient struct { + grpc.ClientStream +} + +func (x *spannerExecuteStreamingSqlClient) Recv() (*PartialResultSet, error) { + m := new(PartialResultSet) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *spannerClient) Read(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (*ResultSet, error) { + out := new(ResultSet) + err := grpc.Invoke(ctx, "/google.spanner.v1.Spanner/Read", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *spannerClient) StreamingRead(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (Spanner_StreamingReadClient, error) { + stream, err := grpc.NewClientStream(ctx, &_Spanner_serviceDesc.Streams[1], c.cc, "/google.spanner.v1.Spanner/StreamingRead", opts...) + if err != nil { + return nil, err + } + x := &spannerStreamingReadClient{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 Spanner_StreamingReadClient interface { + Recv() (*PartialResultSet, error) + grpc.ClientStream +} + +type spannerStreamingReadClient struct { + grpc.ClientStream +} + +func (x *spannerStreamingReadClient) Recv() (*PartialResultSet, error) { + m := new(PartialResultSet) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *spannerClient) BeginTransaction(ctx context.Context, in *BeginTransactionRequest, opts ...grpc.CallOption) (*Transaction, error) { + out := new(Transaction) + err := grpc.Invoke(ctx, "/google.spanner.v1.Spanner/BeginTransaction", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *spannerClient) Commit(ctx context.Context, in *CommitRequest, opts ...grpc.CallOption) (*CommitResponse, error) { + out := new(CommitResponse) + err := grpc.Invoke(ctx, "/google.spanner.v1.Spanner/Commit", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *spannerClient) Rollback(ctx context.Context, in *RollbackRequest, opts ...grpc.CallOption) (*google_protobuf4.Empty, error) { + out := new(google_protobuf4.Empty) + err := grpc.Invoke(ctx, "/google.spanner.v1.Spanner/Rollback", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for Spanner service + +type SpannerServer interface { + // Creates a new session. A session can be used to perform + // transactions that read and/or modify data in a Cloud Spanner database. + // Sessions are meant to be reused for many consecutive + // transactions. + // + // Sessions can only execute one transaction at a time. To execute + // multiple concurrent read-write/write-only transactions, create + // multiple sessions. Note that standalone reads and queries use a + // transaction internally, and count toward the one transaction + // limit. + // + // Cloud Spanner limits the number of sessions that can exist at any given + // time; thus, it is a good idea to delete idle and/or unneeded sessions. + // Aside from explicit deletes, Cloud Spanner can delete sessions for which no + // operations are sent for more than an hour. If a session is deleted, + // requests to it return `NOT_FOUND`. + // + // Idle sessions can be kept alive by sending a trivial SQL query + // periodically, e.g., `"SELECT 1"`. + CreateSession(context.Context, *CreateSessionRequest) (*Session, error) + // Gets a session. Returns `NOT_FOUND` if the session does not exist. + // This is mainly useful for determining whether a session is still + // alive. + GetSession(context.Context, *GetSessionRequest) (*Session, error) + // Lists all sessions in a given database. + ListSessions(context.Context, *ListSessionsRequest) (*ListSessionsResponse, error) + // Ends a session, releasing server resources associated with it. + DeleteSession(context.Context, *DeleteSessionRequest) (*google_protobuf4.Empty, error) + // Executes an SQL query, returning all rows in a single reply. This + // method cannot be used to return a result set larger than 10 MiB; + // if the query yields more data than that, the query fails with + // a `FAILED_PRECONDITION` error. + // + // Queries inside read-write transactions might return `ABORTED`. If + // this occurs, the application should restart the transaction from + // the beginning. See [Transaction][google.spanner.v1.Transaction] for more details. + // + // Larger result sets can be fetched in streaming fashion by calling + // [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] instead. + ExecuteSql(context.Context, *ExecuteSqlRequest) (*ResultSet, error) + // Like [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], except returns the result + // set as a stream. Unlike [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], there + // is no limit on the size of the returned result set. However, no + // individual row in the result set can exceed 100 MiB, and no + // column value can exceed 10 MiB. + ExecuteStreamingSql(*ExecuteSqlRequest, Spanner_ExecuteStreamingSqlServer) error + // Reads rows from the database using key lookups and scans, as a + // simple key/value style alternative to + // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql]. This method cannot be used to + // return a result set larger than 10 MiB; if the read matches more + // data than that, the read fails with a `FAILED_PRECONDITION` + // error. + // + // Reads inside read-write transactions might return `ABORTED`. If + // this occurs, the application should restart the transaction from + // the beginning. See [Transaction][google.spanner.v1.Transaction] for more details. + // + // Larger result sets can be yielded in streaming fashion by calling + // [StreamingRead][google.spanner.v1.Spanner.StreamingRead] instead. + Read(context.Context, *ReadRequest) (*ResultSet, error) + // Like [Read][google.spanner.v1.Spanner.Read], except returns the result set as a + // stream. Unlike [Read][google.spanner.v1.Spanner.Read], there is no limit on the + // size of the returned result set. However, no individual row in + // the result set can exceed 100 MiB, and no column value can exceed + // 10 MiB. + StreamingRead(*ReadRequest, Spanner_StreamingReadServer) error + // Begins a new transaction. This step can often be skipped: + // [Read][google.spanner.v1.Spanner.Read], [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and + // [Commit][google.spanner.v1.Spanner.Commit] can begin a new transaction as a + // side-effect. + BeginTransaction(context.Context, *BeginTransactionRequest) (*Transaction, error) + // Commits a transaction. The request includes the mutations to be + // applied to rows in the database. + // + // `Commit` might return an `ABORTED` error. This can occur at any time; + // commonly, the cause is conflicts with concurrent + // transactions. However, it can also happen for a variety of other + // reasons. If `Commit` returns `ABORTED`, the caller should re-attempt + // the transaction from the beginning, re-using the same session. + Commit(context.Context, *CommitRequest) (*CommitResponse, error) + // Rolls back a transaction, releasing any locks it holds. It is a good + // idea to call this for any transaction that includes one or more + // [Read][google.spanner.v1.Spanner.Read] or [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] requests and + // ultimately decides not to commit. + // + // `Rollback` returns `OK` if it successfully aborts the transaction, the + // transaction was already aborted, or the transaction is not + // found. `Rollback` never returns `ABORTED`. + Rollback(context.Context, *RollbackRequest) (*google_protobuf4.Empty, error) +} + +func RegisterSpannerServer(s *grpc.Server, srv SpannerServer) { + s.RegisterService(&_Spanner_serviceDesc, srv) +} + +func _Spanner_CreateSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateSessionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SpannerServer).CreateSession(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.spanner.v1.Spanner/CreateSession", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SpannerServer).CreateSession(ctx, req.(*CreateSessionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Spanner_GetSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetSessionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SpannerServer).GetSession(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.spanner.v1.Spanner/GetSession", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SpannerServer).GetSession(ctx, req.(*GetSessionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Spanner_ListSessions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListSessionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SpannerServer).ListSessions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.spanner.v1.Spanner/ListSessions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SpannerServer).ListSessions(ctx, req.(*ListSessionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Spanner_DeleteSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteSessionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SpannerServer).DeleteSession(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.spanner.v1.Spanner/DeleteSession", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SpannerServer).DeleteSession(ctx, req.(*DeleteSessionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Spanner_ExecuteSql_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ExecuteSqlRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SpannerServer).ExecuteSql(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.spanner.v1.Spanner/ExecuteSql", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SpannerServer).ExecuteSql(ctx, req.(*ExecuteSqlRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Spanner_ExecuteStreamingSql_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(ExecuteSqlRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(SpannerServer).ExecuteStreamingSql(m, &spannerExecuteStreamingSqlServer{stream}) +} + +type Spanner_ExecuteStreamingSqlServer interface { + Send(*PartialResultSet) error + grpc.ServerStream +} + +type spannerExecuteStreamingSqlServer struct { + grpc.ServerStream +} + +func (x *spannerExecuteStreamingSqlServer) Send(m *PartialResultSet) error { + return x.ServerStream.SendMsg(m) +} + +func _Spanner_Read_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ReadRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SpannerServer).Read(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.spanner.v1.Spanner/Read", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SpannerServer).Read(ctx, req.(*ReadRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Spanner_StreamingRead_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(ReadRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(SpannerServer).StreamingRead(m, &spannerStreamingReadServer{stream}) +} + +type Spanner_StreamingReadServer interface { + Send(*PartialResultSet) error + grpc.ServerStream +} + +type spannerStreamingReadServer struct { + grpc.ServerStream +} + +func (x *spannerStreamingReadServer) Send(m *PartialResultSet) error { + return x.ServerStream.SendMsg(m) +} + +func _Spanner_BeginTransaction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BeginTransactionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SpannerServer).BeginTransaction(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.spanner.v1.Spanner/BeginTransaction", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SpannerServer).BeginTransaction(ctx, req.(*BeginTransactionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Spanner_Commit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CommitRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SpannerServer).Commit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.spanner.v1.Spanner/Commit", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SpannerServer).Commit(ctx, req.(*CommitRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Spanner_Rollback_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RollbackRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SpannerServer).Rollback(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.spanner.v1.Spanner/Rollback", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SpannerServer).Rollback(ctx, req.(*RollbackRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Spanner_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.spanner.v1.Spanner", + HandlerType: (*SpannerServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateSession", + Handler: _Spanner_CreateSession_Handler, + }, + { + MethodName: "GetSession", + Handler: _Spanner_GetSession_Handler, + }, + { + MethodName: "ListSessions", + Handler: _Spanner_ListSessions_Handler, + }, + { + MethodName: "DeleteSession", + Handler: _Spanner_DeleteSession_Handler, + }, + { + MethodName: "ExecuteSql", + Handler: _Spanner_ExecuteSql_Handler, + }, + { + MethodName: "Read", + Handler: _Spanner_Read_Handler, + }, + { + MethodName: "BeginTransaction", + Handler: _Spanner_BeginTransaction_Handler, + }, + { + MethodName: "Commit", + Handler: _Spanner_Commit_Handler, + }, + { + MethodName: "Rollback", + Handler: _Spanner_Rollback_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "ExecuteStreamingSql", + Handler: _Spanner_ExecuteStreamingSql_Handler, + ServerStreams: true, + }, + { + StreamName: "StreamingRead", + Handler: _Spanner_StreamingRead_Handler, + ServerStreams: true, + }, + }, + Metadata: "google/spanner/v1/spanner.proto", +} + +func init() { proto.RegisterFile("google/spanner/v1/spanner.proto", fileDescriptor4) } + +var fileDescriptor4 = []byte{ + // 1416 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0x4f, 0x6f, 0x13, 0x47, + 0x14, 0x67, 0x9d, 0xc4, 0x89, 0x9f, 0xf3, 0x8f, 0x21, 0x0d, 0xc6, 0x50, 0x30, 0x4b, 0x21, 0x91, + 0xa5, 0xda, 0x4d, 0x8a, 0x2a, 0x30, 0x6d, 0x81, 0x80, 0x81, 0x08, 0x87, 0x98, 0x75, 0x00, 0x09, + 0x51, 0x59, 0x63, 0x7b, 0x70, 0xb7, 0xd9, 0x7f, 0xd9, 0x19, 0x47, 0x31, 0x15, 0x97, 0x4a, 0x3d, + 0xf5, 0xd2, 0x52, 0x55, 0x3d, 0xb4, 0xb7, 0xf6, 0x54, 0x71, 0xef, 0xad, 0x1f, 0xa0, 0xd7, 0x7e, + 0x85, 0x7e, 0x8b, 0x5e, 0xaa, 0xf9, 0xe7, 0x6c, 0xec, 0xc5, 0x09, 0x72, 0xd5, 0x93, 0x67, 0xe6, + 0xbd, 0x79, 0xef, 0xb7, 0xbf, 0xf7, 0x66, 0x7e, 0x63, 0x38, 0xd7, 0xf6, 0xfd, 0xb6, 0x43, 0x8a, + 0x34, 0xc0, 0x9e, 0x47, 0xc2, 0xe2, 0xee, 0x8a, 0x1e, 0x16, 0x82, 0xd0, 0x67, 0x3e, 0x3a, 0x2e, + 0x1d, 0x0a, 0x7a, 0x75, 0x77, 0x25, 0x7b, 0x46, 0xed, 0xc1, 0x81, 0x5d, 0xc4, 0x9e, 0xe7, 0x33, + 0xcc, 0x6c, 0xdf, 0xa3, 0x72, 0x43, 0xf6, 0xb4, 0xb2, 0x8a, 0x59, 0xa3, 0xf3, 0xbc, 0x48, 0xdc, + 0x80, 0x75, 0x95, 0xf1, 0x4c, 0xbf, 0x91, 0xb2, 0xb0, 0xd3, 0x64, 0xca, 0x7a, 0xae, 0xdf, 0xca, + 0x6c, 0x97, 0x50, 0x86, 0xdd, 0xa0, 0x6f, 0x7b, 0x04, 0xed, 0x36, 0xe9, 0xea, 0xcc, 0xb9, 0x41, + 0xab, 0xdb, 0x91, 0xe0, 0x94, 0x87, 0x39, 0xe8, 0x11, 0x12, 0xda, 0x71, 0x58, 0x9d, 0x12, 0x0d, + 0xe2, 0xc2, 0xa0, 0x0f, 0x0b, 0xb1, 0x47, 0x71, 0x33, 0x12, 0x28, 0x06, 0x08, 0xeb, 0x06, 0x44, + 0x5a, 0xcd, 0xcf, 0x61, 0xe1, 0x56, 0x48, 0x30, 0x23, 0x35, 0x42, 0xa9, 0xed, 0x7b, 0x16, 0xd9, + 0xe9, 0x10, 0xca, 0x50, 0x16, 0xa6, 0x5a, 0x98, 0xe1, 0x06, 0xa6, 0x24, 0x63, 0xe4, 0x8c, 0xe5, + 0x94, 0xd5, 0x9b, 0xa3, 0xcb, 0x30, 0x49, 0xa5, 0x77, 0x26, 0x91, 0x33, 0x96, 0xd3, 0xab, 0xd9, + 0xc2, 0x00, 0xf3, 0x05, 0x1d, 0x4f, 0xbb, 0x9a, 0xaf, 0x13, 0x30, 0xa9, 0x16, 0x11, 0x82, 0x71, + 0x0f, 0xbb, 0x3a, 0xb2, 0x18, 0xa3, 0x4f, 0x21, 0xe9, 0xe0, 0x06, 0x71, 0x68, 0x26, 0x91, 0x1b, + 0x5b, 0x4e, 0xaf, 0x5e, 0x7a, 0x73, 0xd0, 0x42, 0x45, 0x38, 0x96, 0x3d, 0x16, 0x76, 0x2d, 0xb5, + 0x0b, 0x5d, 0x83, 0x74, 0x53, 0x7c, 0x49, 0x9d, 0x97, 0x22, 0x33, 0x76, 0x10, 0x99, 0x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e8, 0x0d, 0x42, + 0x9b, 0x3d, 0x3b, 0x5c, 0x98, 0xcc, 0x27, 0x02, 0xf8, 0x43, 0xb3, 0x32, 0x0a, 0xf0, 0x46, 0x5f, + 0x72, 0x4e, 0xf4, 0xcf, 0x06, 0x24, 0xa5, 0x12, 0xa1, 0x5c, 0xdc, 0x45, 0x1e, 0x55, 0xe8, 0xec, + 0xf9, 0x21, 0x1e, 0xea, 0x32, 0xda, 0x10, 0x40, 0xef, 0x9a, 0x6b, 0xa3, 0x00, 0x95, 0xa2, 0xc6, + 0xe1, 0xfd, 0x68, 0xc0, 0x94, 0xd6, 0x33, 0x64, 0xc6, 0xb5, 0xc0, 0x41, 0xb1, 0x7b, 0xe3, 0x6d, + 0xb4, 0x29, 0x70, 0xad, 0x9b, 0xb7, 0x47, 0xea, 0x4e, 0x95, 0xac, 0x64, 0xe4, 0xd7, 0x7e, 0x30, + 0xe0, 0x9d, 0xa6, 0xef, 0x0e, 0x42, 0x5a, 0x9b, 0x56, 0x5a, 0x59, 0xe5, 0x08, 0xaa, 0xc6, 0xd3, + 0x2b, 0xca, 0xa5, 0xed, 0x3b, 0xd8, 0x6b, 0x17, 0xfc, 0xb0, 0x5d, 0x6c, 0x13, 0x4f, 0xe0, 0x2b, + 0x4a, 0x13, 0x0e, 0x6c, 0x1a, 0xf9, 0xff, 0x7e, 0x4d, 0x0d, 0x7f, 0x4b, 0x9c, 0xbc, 0x2b, 0xb7, + 0xde, 0x72, 0xfc, 0x4e, 0xab, 0xa0, 0xe2, 0x16, 0x1e, 0xaf, 0xfc, 0xa9, 0x2d, 0xcf, 0x84, 0xe5, + 0x99, 0xb2, 0x3c, 0x7b, 0xbc, 0xd2, 0x48, 0x8a, 0xc0, 0x1f, 0xfe, 0x1b, 0x00, 0x00, 0xff, 0xff, + 0x57, 0x35, 0x15, 0x7f, 0x4e, 0x11, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/spanner/v1/transaction.pb.go b/vendor/google.golang.org/genproto/googleapis/spanner/v1/transaction.pb.go new file mode 100644 index 0000000000..f63797d369 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/spanner/v1/transaction.pb.go @@ -0,0 +1,835 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/spanner/v1/transaction.proto + +package spanner + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf2 "github.com/golang/protobuf/ptypes/duration" +import google_protobuf3 "github.com/golang/protobuf/ptypes/timestamp" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// # Transactions +// +// +// Each session can have at most one active transaction at a time. After the +// active transaction is completed, the session can immediately be +// re-used for the next transaction. It is not necessary to create a +// new session for each transaction. +// +// # Transaction Modes +// +// Cloud Spanner supports two transaction modes: +// +// 1. Locking read-write. This type of transaction is the only way +// to write data into Cloud Spanner. These transactions rely on +// pessimistic locking and, if necessary, two-phase commit. +// Locking read-write transactions may abort, requiring the +// application to retry. +// +// 2. Snapshot read-only. This transaction type provides guaranteed +// consistency across several reads, but does not allow +// writes. Snapshot read-only transactions can be configured to +// read at timestamps in the past. Snapshot read-only +// transactions do not need to be committed. +// +// For transactions that only read, snapshot read-only transactions +// provide simpler semantics and are almost always faster. In +// particular, read-only transactions do not take locks, so they do +// not conflict with read-write transactions. As a consequence of not +// taking locks, they also do not abort, so retry loops are not needed. +// +// Transactions may only read/write data in a single database. They +// may, however, read/write data in different tables within that +// database. +// +// ## Locking Read-Write Transactions +// +// Locking transactions may be used to atomically read-modify-write +// data anywhere in a database. This type of transaction is externally +// consistent. +// +// Clients should attempt to minimize the amount of time a transaction +// is active. Faster transactions commit with higher probability +// and cause less contention. Cloud Spanner attempts to keep read locks +// active as long as the transaction continues to do reads, and the +// transaction has not been terminated by +// [Commit][google.spanner.v1.Spanner.Commit] or +// [Rollback][google.spanner.v1.Spanner.Rollback]. Long periods of +// inactivity at the client may cause Cloud Spanner to release a +// transaction's locks and abort it. +// +// Reads performed within a transaction acquire locks on the data +// being read. Writes can only be done at commit time, after all reads +// have been completed. +// Conceptually, a read-write transaction consists of zero or more +// reads or SQL queries followed by +// [Commit][google.spanner.v1.Spanner.Commit]. At any time before +// [Commit][google.spanner.v1.Spanner.Commit], the client can send a +// [Rollback][google.spanner.v1.Spanner.Rollback] request to abort the +// transaction. +// +// ### Semantics +// +// Cloud Spanner can commit the transaction if all read locks it acquired +// are still valid at commit time, and it is able to acquire write +// locks for all writes. Cloud Spanner can abort the transaction for any +// reason. If a commit attempt returns `ABORTED`, Cloud Spanner guarantees +// that the transaction has not modified any user data in Cloud Spanner. +// +// Unless the transaction commits, Cloud Spanner makes no guarantees about +// how long the transaction's locks were held for. It is an error to +// use Cloud Spanner locks for any sort of mutual exclusion other than +// between Cloud Spanner transactions themselves. +// +// ### Retrying Aborted Transactions +// +// When a transaction aborts, the application can choose to retry the +// whole transaction again. To maximize the chances of successfully +// committing the retry, the client should execute the retry in the +// same session as the original attempt. The original session's lock +// priority increases with each consecutive abort, meaning that each +// attempt has a slightly better chance of success than the previous. +// +// Under some circumstances (e.g., many transactions attempting to +// modify the same row(s)), a transaction can abort many times in a +// short period before successfully committing. Thus, it is not a good +// idea to cap the number of retries a transaction can attempt; +// instead, it is better to limit the total amount of wall time spent +// retrying. +// +// ### Idle Transactions +// +// A transaction is considered idle if it has no outstanding reads or +// SQL queries and has not started a read or SQL query within the last 10 +// seconds. Idle transactions can be aborted by Cloud Spanner so that they +// don't hold on to locks indefinitely. In that case, the commit will +// fail with error `ABORTED`. +// +// If this behavior is undesirable, periodically executing a simple +// SQL query in the transaction (e.g., `SELECT 1`) prevents the +// transaction from becoming idle. +// +// ## Snapshot Read-Only Transactions +// +// Snapshot read-only transactions provides a simpler method than +// locking read-write transactions for doing several consistent +// reads. However, this type of transaction does not support writes. +// +// Snapshot transactions do not take locks. Instead, they work by +// choosing a Cloud Spanner timestamp, then executing all reads at that +// timestamp. Since they do not acquire locks, they do not block +// concurrent read-write transactions. +// +// Unlike locking read-write transactions, snapshot read-only +// transactions never abort. They can fail if the chosen read +// timestamp is garbage collected; however, the default garbage +// collection policy is generous enough that most applications do not +// need to worry about this in practice. +// +// Snapshot read-only transactions do not need to call +// [Commit][google.spanner.v1.Spanner.Commit] or +// [Rollback][google.spanner.v1.Spanner.Rollback] (and in fact are not +// permitted to do so). +// +// To execute a snapshot transaction, the client specifies a timestamp +// bound, which tells Cloud Spanner how to choose a read timestamp. +// +// The types of timestamp bound are: +// +// - Strong (the default). +// - Bounded staleness. +// - Exact staleness. +// +// If the Cloud Spanner database to be read is geographically distributed, +// stale read-only transactions can execute more quickly than strong +// or read-write transaction, because they are able to execute far +// from the leader replica. +// +// Each type of timestamp bound is discussed in detail below. +// +// ### Strong +// +// Strong reads are guaranteed to see the effects of all transactions +// that have committed before the start of the read. Furthermore, all +// rows yielded by a single read are consistent with each other -- if +// any part of the read observes a transaction, all parts of the read +// see the transaction. +// +// Strong reads are not repeatable: two consecutive strong read-only +// transactions might return inconsistent results if there are +// concurrent writes. If consistency across reads is required, the +// reads should be executed within a transaction or at an exact read +// timestamp. +// +// See [TransactionOptions.ReadOnly.strong][google.spanner.v1.TransactionOptions.ReadOnly.strong]. +// +// ### Exact Staleness +// +// These timestamp bounds execute reads at a user-specified +// timestamp. Reads at a timestamp are guaranteed to see a consistent +// prefix of the global transaction history: they observe +// modifications done by all transactions with a commit timestamp <= +// the read timestamp, and observe none of the modifications done by +// transactions with a larger commit timestamp. They will block until +// all conflicting transactions that may be assigned commit timestamps +// <= the read timestamp have finished. +// +// The timestamp can either be expressed as an absolute Cloud Spanner commit +// timestamp or a staleness relative to the current time. +// +// These modes do not require a "negotiation phase" to pick a +// timestamp. As a result, they execute slightly faster than the +// equivalent boundedly stale concurrency modes. On the other hand, +// boundedly stale reads usually return fresher results. +// +// See [TransactionOptions.ReadOnly.read_timestamp][google.spanner.v1.TransactionOptions.ReadOnly.read_timestamp] and +// [TransactionOptions.ReadOnly.exact_staleness][google.spanner.v1.TransactionOptions.ReadOnly.exact_staleness]. +// +// ### Bounded Staleness +// +// Bounded staleness modes allow Cloud Spanner to pick the read timestamp, +// subject to a user-provided staleness bound. Cloud Spanner chooses the +// newest timestamp within the staleness bound that allows execution +// of the reads at the closest available replica without blocking. +// +// All rows yielded are consistent with each other -- if any part of +// the read observes a transaction, all parts of the read see the +// transaction. Boundedly stale reads are not repeatable: two stale +// reads, even if they use the same staleness bound, can execute at +// different timestamps and thus return inconsistent results. +// +// Boundedly stale reads execute in two phases: the first phase +// negotiates a timestamp among all replicas needed to serve the +// read. In the second phase, reads are executed at the negotiated +// timestamp. +// +// As a result of the two phase execution, bounded staleness reads are +// usually a little slower than comparable exact staleness +// reads. However, they are typically able to return fresher +// results, and are more likely to execute at the closest replica. +// +// Because the timestamp negotiation requires up-front knowledge of +// which rows will be read, it can only be used with single-use +// read-only transactions. +// +// See [TransactionOptions.ReadOnly.max_staleness][google.spanner.v1.TransactionOptions.ReadOnly.max_staleness] and +// [TransactionOptions.ReadOnly.min_read_timestamp][google.spanner.v1.TransactionOptions.ReadOnly.min_read_timestamp]. +// +// ### Old Read Timestamps and Garbage Collection +// +// Cloud Spanner continuously garbage collects deleted and overwritten data +// in the background to reclaim storage space. This process is known +// as "version GC". By default, version GC reclaims versions after they +// are one hour old. Because of this, Cloud Spanner cannot perform reads +// at read timestamps more than one hour in the past. This +// restriction also applies to in-progress reads and/or SQL queries whose +// timestamp become too old while executing. Reads and SQL queries with +// too-old read timestamps fail with the error `FAILED_PRECONDITION`. +type TransactionOptions struct { + // Required. The type of transaction. + // + // Types that are valid to be assigned to Mode: + // *TransactionOptions_ReadWrite_ + // *TransactionOptions_ReadOnly_ + Mode isTransactionOptions_Mode `protobuf_oneof:"mode"` +} + +func (m *TransactionOptions) Reset() { *m = TransactionOptions{} } +func (m *TransactionOptions) String() string { return proto.CompactTextString(m) } +func (*TransactionOptions) ProtoMessage() {} +func (*TransactionOptions) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{0} } + +type isTransactionOptions_Mode interface { + isTransactionOptions_Mode() +} + +type TransactionOptions_ReadWrite_ struct { + ReadWrite *TransactionOptions_ReadWrite `protobuf:"bytes,1,opt,name=read_write,json=readWrite,oneof"` +} +type TransactionOptions_ReadOnly_ struct { + ReadOnly *TransactionOptions_ReadOnly `protobuf:"bytes,2,opt,name=read_only,json=readOnly,oneof"` +} + +func (*TransactionOptions_ReadWrite_) isTransactionOptions_Mode() {} +func (*TransactionOptions_ReadOnly_) isTransactionOptions_Mode() {} + +func (m *TransactionOptions) GetMode() isTransactionOptions_Mode { + if m != nil { + return m.Mode + } + return nil +} + +func (m *TransactionOptions) GetReadWrite() *TransactionOptions_ReadWrite { + if x, ok := m.GetMode().(*TransactionOptions_ReadWrite_); ok { + return x.ReadWrite + } + return nil +} + +func (m *TransactionOptions) GetReadOnly() *TransactionOptions_ReadOnly { + if x, ok := m.GetMode().(*TransactionOptions_ReadOnly_); ok { + return x.ReadOnly + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*TransactionOptions) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _TransactionOptions_OneofMarshaler, _TransactionOptions_OneofUnmarshaler, _TransactionOptions_OneofSizer, []interface{}{ + (*TransactionOptions_ReadWrite_)(nil), + (*TransactionOptions_ReadOnly_)(nil), + } +} + +func _TransactionOptions_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*TransactionOptions) + // mode + switch x := m.Mode.(type) { + case *TransactionOptions_ReadWrite_: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ReadWrite); err != nil { + return err + } + case *TransactionOptions_ReadOnly_: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ReadOnly); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("TransactionOptions.Mode has unexpected type %T", x) + } + return nil +} + +func _TransactionOptions_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*TransactionOptions) + switch tag { + case 1: // mode.read_write + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(TransactionOptions_ReadWrite) + err := b.DecodeMessage(msg) + m.Mode = &TransactionOptions_ReadWrite_{msg} + return true, err + case 2: // mode.read_only + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(TransactionOptions_ReadOnly) + err := b.DecodeMessage(msg) + m.Mode = &TransactionOptions_ReadOnly_{msg} + return true, err + default: + return false, nil + } +} + +func _TransactionOptions_OneofSizer(msg proto.Message) (n int) { + m := msg.(*TransactionOptions) + // mode + switch x := m.Mode.(type) { + case *TransactionOptions_ReadWrite_: + s := proto.Size(x.ReadWrite) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *TransactionOptions_ReadOnly_: + s := proto.Size(x.ReadOnly) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Message type to initiate a read-write transaction. Currently this +// transaction type has no options. +type TransactionOptions_ReadWrite struct { +} + +func (m *TransactionOptions_ReadWrite) Reset() { *m = TransactionOptions_ReadWrite{} } +func (m *TransactionOptions_ReadWrite) String() string { return proto.CompactTextString(m) } +func (*TransactionOptions_ReadWrite) ProtoMessage() {} +func (*TransactionOptions_ReadWrite) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{0, 0} } + +// Message type to initiate a read-only transaction. +type TransactionOptions_ReadOnly struct { + // How to choose the timestamp for the read-only transaction. + // + // Types that are valid to be assigned to TimestampBound: + // *TransactionOptions_ReadOnly_Strong + // *TransactionOptions_ReadOnly_MinReadTimestamp + // *TransactionOptions_ReadOnly_MaxStaleness + // *TransactionOptions_ReadOnly_ReadTimestamp + // *TransactionOptions_ReadOnly_ExactStaleness + TimestampBound isTransactionOptions_ReadOnly_TimestampBound `protobuf_oneof:"timestamp_bound"` + // If true, the Cloud Spanner-selected read timestamp is included in + // the [Transaction][google.spanner.v1.Transaction] message that describes the transaction. + ReturnReadTimestamp bool `protobuf:"varint,6,opt,name=return_read_timestamp,json=returnReadTimestamp" json:"return_read_timestamp,omitempty"` +} + +func (m *TransactionOptions_ReadOnly) Reset() { *m = TransactionOptions_ReadOnly{} } +func (m *TransactionOptions_ReadOnly) String() string { return proto.CompactTextString(m) } +func (*TransactionOptions_ReadOnly) ProtoMessage() {} +func (*TransactionOptions_ReadOnly) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{0, 1} } + +type isTransactionOptions_ReadOnly_TimestampBound interface { + isTransactionOptions_ReadOnly_TimestampBound() +} + +type TransactionOptions_ReadOnly_Strong struct { + Strong bool `protobuf:"varint,1,opt,name=strong,oneof"` +} +type TransactionOptions_ReadOnly_MinReadTimestamp struct { + MinReadTimestamp *google_protobuf3.Timestamp `protobuf:"bytes,2,opt,name=min_read_timestamp,json=minReadTimestamp,oneof"` +} +type TransactionOptions_ReadOnly_MaxStaleness struct { + MaxStaleness *google_protobuf2.Duration `protobuf:"bytes,3,opt,name=max_staleness,json=maxStaleness,oneof"` +} +type TransactionOptions_ReadOnly_ReadTimestamp struct { + ReadTimestamp *google_protobuf3.Timestamp `protobuf:"bytes,4,opt,name=read_timestamp,json=readTimestamp,oneof"` +} +type TransactionOptions_ReadOnly_ExactStaleness struct { + ExactStaleness *google_protobuf2.Duration `protobuf:"bytes,5,opt,name=exact_staleness,json=exactStaleness,oneof"` +} + +func (*TransactionOptions_ReadOnly_Strong) isTransactionOptions_ReadOnly_TimestampBound() {} +func (*TransactionOptions_ReadOnly_MinReadTimestamp) isTransactionOptions_ReadOnly_TimestampBound() {} +func (*TransactionOptions_ReadOnly_MaxStaleness) isTransactionOptions_ReadOnly_TimestampBound() {} +func (*TransactionOptions_ReadOnly_ReadTimestamp) isTransactionOptions_ReadOnly_TimestampBound() {} +func (*TransactionOptions_ReadOnly_ExactStaleness) isTransactionOptions_ReadOnly_TimestampBound() {} + +func (m *TransactionOptions_ReadOnly) GetTimestampBound() isTransactionOptions_ReadOnly_TimestampBound { + if m != nil { + return m.TimestampBound + } + return nil +} + +func (m *TransactionOptions_ReadOnly) GetStrong() bool { + if x, ok := m.GetTimestampBound().(*TransactionOptions_ReadOnly_Strong); ok { + return x.Strong + } + return false +} + +func (m *TransactionOptions_ReadOnly) GetMinReadTimestamp() *google_protobuf3.Timestamp { + if x, ok := m.GetTimestampBound().(*TransactionOptions_ReadOnly_MinReadTimestamp); ok { + return x.MinReadTimestamp + } + return nil +} + +func (m *TransactionOptions_ReadOnly) GetMaxStaleness() *google_protobuf2.Duration { + if x, ok := m.GetTimestampBound().(*TransactionOptions_ReadOnly_MaxStaleness); ok { + return x.MaxStaleness + } + return nil +} + +func (m *TransactionOptions_ReadOnly) GetReadTimestamp() *google_protobuf3.Timestamp { + if x, ok := m.GetTimestampBound().(*TransactionOptions_ReadOnly_ReadTimestamp); ok { + return x.ReadTimestamp + } + return nil +} + +func (m *TransactionOptions_ReadOnly) GetExactStaleness() *google_protobuf2.Duration { + if x, ok := m.GetTimestampBound().(*TransactionOptions_ReadOnly_ExactStaleness); ok { + return x.ExactStaleness + } + return nil +} + +func (m *TransactionOptions_ReadOnly) GetReturnReadTimestamp() bool { + if m != nil { + return m.ReturnReadTimestamp + } + return false +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*TransactionOptions_ReadOnly) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _TransactionOptions_ReadOnly_OneofMarshaler, _TransactionOptions_ReadOnly_OneofUnmarshaler, _TransactionOptions_ReadOnly_OneofSizer, []interface{}{ + (*TransactionOptions_ReadOnly_Strong)(nil), + (*TransactionOptions_ReadOnly_MinReadTimestamp)(nil), + (*TransactionOptions_ReadOnly_MaxStaleness)(nil), + (*TransactionOptions_ReadOnly_ReadTimestamp)(nil), + (*TransactionOptions_ReadOnly_ExactStaleness)(nil), + } +} + +func _TransactionOptions_ReadOnly_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*TransactionOptions_ReadOnly) + // timestamp_bound + switch x := m.TimestampBound.(type) { + case *TransactionOptions_ReadOnly_Strong: + t := uint64(0) + if x.Strong { + t = 1 + } + b.EncodeVarint(1<<3 | proto.WireVarint) + b.EncodeVarint(t) + case *TransactionOptions_ReadOnly_MinReadTimestamp: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.MinReadTimestamp); err != nil { + return err + } + case *TransactionOptions_ReadOnly_MaxStaleness: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.MaxStaleness); err != nil { + return err + } + case *TransactionOptions_ReadOnly_ReadTimestamp: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ReadTimestamp); err != nil { + return err + } + case *TransactionOptions_ReadOnly_ExactStaleness: + b.EncodeVarint(5<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ExactStaleness); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("TransactionOptions_ReadOnly.TimestampBound has unexpected type %T", x) + } + return nil +} + +func _TransactionOptions_ReadOnly_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*TransactionOptions_ReadOnly) + switch tag { + case 1: // timestamp_bound.strong + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.TimestampBound = &TransactionOptions_ReadOnly_Strong{x != 0} + return true, err + case 2: // timestamp_bound.min_read_timestamp + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(google_protobuf3.Timestamp) + err := b.DecodeMessage(msg) + m.TimestampBound = &TransactionOptions_ReadOnly_MinReadTimestamp{msg} + return true, err + case 3: // timestamp_bound.max_staleness + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(google_protobuf2.Duration) + err := b.DecodeMessage(msg) + m.TimestampBound = &TransactionOptions_ReadOnly_MaxStaleness{msg} + return true, err + case 4: // timestamp_bound.read_timestamp + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(google_protobuf3.Timestamp) + err := b.DecodeMessage(msg) + m.TimestampBound = &TransactionOptions_ReadOnly_ReadTimestamp{msg} + return true, err + case 5: // timestamp_bound.exact_staleness + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(google_protobuf2.Duration) + err := b.DecodeMessage(msg) + m.TimestampBound = &TransactionOptions_ReadOnly_ExactStaleness{msg} + return true, err + default: + return false, nil + } +} + +func _TransactionOptions_ReadOnly_OneofSizer(msg proto.Message) (n int) { + m := msg.(*TransactionOptions_ReadOnly) + // timestamp_bound + switch x := m.TimestampBound.(type) { + case *TransactionOptions_ReadOnly_Strong: + n += proto.SizeVarint(1<<3 | proto.WireVarint) + n += 1 + case *TransactionOptions_ReadOnly_MinReadTimestamp: + s := proto.Size(x.MinReadTimestamp) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *TransactionOptions_ReadOnly_MaxStaleness: + s := proto.Size(x.MaxStaleness) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *TransactionOptions_ReadOnly_ReadTimestamp: + s := proto.Size(x.ReadTimestamp) + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *TransactionOptions_ReadOnly_ExactStaleness: + s := proto.Size(x.ExactStaleness) + n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// A transaction. +type Transaction struct { + // `id` may be used to identify the transaction in subsequent + // [Read][google.spanner.v1.Spanner.Read], + // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], + // [Commit][google.spanner.v1.Spanner.Commit], or + // [Rollback][google.spanner.v1.Spanner.Rollback] calls. + // + // Single-use read-only transactions do not have IDs, because + // single-use transactions do not support multiple requests. + Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // For snapshot read-only transactions, the read timestamp chosen + // for the transaction. Not returned by default: see + // [TransactionOptions.ReadOnly.return_read_timestamp][google.spanner.v1.TransactionOptions.ReadOnly.return_read_timestamp]. + // + // A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. + // Example: `"2014-10-02T15:01:23.045123456Z"`. + ReadTimestamp *google_protobuf3.Timestamp `protobuf:"bytes,2,opt,name=read_timestamp,json=readTimestamp" json:"read_timestamp,omitempty"` +} + +func (m *Transaction) Reset() { *m = Transaction{} } +func (m *Transaction) String() string { return proto.CompactTextString(m) } +func (*Transaction) ProtoMessage() {} +func (*Transaction) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{1} } + +func (m *Transaction) GetId() []byte { + if m != nil { + return m.Id + } + return nil +} + +func (m *Transaction) GetReadTimestamp() *google_protobuf3.Timestamp { + if m != nil { + return m.ReadTimestamp + } + return nil +} + +// This message is used to select the transaction in which a +// [Read][google.spanner.v1.Spanner.Read] or +// [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] call runs. +// +// See [TransactionOptions][google.spanner.v1.TransactionOptions] for more information about transactions. +type TransactionSelector struct { + // If no fields are set, the default is a single use transaction + // with strong concurrency. + // + // Types that are valid to be assigned to Selector: + // *TransactionSelector_SingleUse + // *TransactionSelector_Id + // *TransactionSelector_Begin + Selector isTransactionSelector_Selector `protobuf_oneof:"selector"` +} + +func (m *TransactionSelector) Reset() { *m = TransactionSelector{} } +func (m *TransactionSelector) String() string { return proto.CompactTextString(m) } +func (*TransactionSelector) ProtoMessage() {} +func (*TransactionSelector) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{2} } + +type isTransactionSelector_Selector interface { + isTransactionSelector_Selector() +} + +type TransactionSelector_SingleUse struct { + SingleUse *TransactionOptions `protobuf:"bytes,1,opt,name=single_use,json=singleUse,oneof"` +} +type TransactionSelector_Id struct { + Id []byte `protobuf:"bytes,2,opt,name=id,proto3,oneof"` +} +type TransactionSelector_Begin struct { + Begin *TransactionOptions `protobuf:"bytes,3,opt,name=begin,oneof"` +} + +func (*TransactionSelector_SingleUse) isTransactionSelector_Selector() {} +func (*TransactionSelector_Id) isTransactionSelector_Selector() {} +func (*TransactionSelector_Begin) isTransactionSelector_Selector() {} + +func (m *TransactionSelector) GetSelector() isTransactionSelector_Selector { + if m != nil { + return m.Selector + } + return nil +} + +func (m *TransactionSelector) GetSingleUse() *TransactionOptions { + if x, ok := m.GetSelector().(*TransactionSelector_SingleUse); ok { + return x.SingleUse + } + return nil +} + +func (m *TransactionSelector) GetId() []byte { + if x, ok := m.GetSelector().(*TransactionSelector_Id); ok { + return x.Id + } + return nil +} + +func (m *TransactionSelector) GetBegin() *TransactionOptions { + if x, ok := m.GetSelector().(*TransactionSelector_Begin); ok { + return x.Begin + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*TransactionSelector) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _TransactionSelector_OneofMarshaler, _TransactionSelector_OneofUnmarshaler, _TransactionSelector_OneofSizer, []interface{}{ + (*TransactionSelector_SingleUse)(nil), + (*TransactionSelector_Id)(nil), + (*TransactionSelector_Begin)(nil), + } +} + +func _TransactionSelector_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*TransactionSelector) + // selector + switch x := m.Selector.(type) { + case *TransactionSelector_SingleUse: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.SingleUse); err != nil { + return err + } + case *TransactionSelector_Id: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeRawBytes(x.Id) + case *TransactionSelector_Begin: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Begin); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("TransactionSelector.Selector has unexpected type %T", x) + } + return nil +} + +func _TransactionSelector_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*TransactionSelector) + switch tag { + case 1: // selector.single_use + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(TransactionOptions) + err := b.DecodeMessage(msg) + m.Selector = &TransactionSelector_SingleUse{msg} + return true, err + case 2: // selector.id + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.Selector = &TransactionSelector_Id{x} + return true, err + case 3: // selector.begin + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(TransactionOptions) + err := b.DecodeMessage(msg) + m.Selector = &TransactionSelector_Begin{msg} + return true, err + default: + return false, nil + } +} + +func _TransactionSelector_OneofSizer(msg proto.Message) (n int) { + m := msg.(*TransactionSelector) + // selector + switch x := m.Selector.(type) { + case *TransactionSelector_SingleUse: + s := proto.Size(x.SingleUse) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *TransactionSelector_Id: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.Id))) + n += len(x.Id) + case *TransactionSelector_Begin: + s := proto.Size(x.Begin) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +func init() { + proto.RegisterType((*TransactionOptions)(nil), "google.spanner.v1.TransactionOptions") + proto.RegisterType((*TransactionOptions_ReadWrite)(nil), "google.spanner.v1.TransactionOptions.ReadWrite") + proto.RegisterType((*TransactionOptions_ReadOnly)(nil), "google.spanner.v1.TransactionOptions.ReadOnly") + proto.RegisterType((*Transaction)(nil), "google.spanner.v1.Transaction") + proto.RegisterType((*TransactionSelector)(nil), "google.spanner.v1.TransactionSelector") +} + +func init() { proto.RegisterFile("google/spanner/v1/transaction.proto", fileDescriptor5) } + +var fileDescriptor5 = []byte{ + // 537 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0xd1, 0x8a, 0xd3, 0x40, + 0x14, 0x86, 0xd3, 0x6e, 0xb7, 0x74, 0x4f, 0xbb, 0xdd, 0xee, 0x2c, 0x8b, 0x35, 0x88, 0x4a, 0x45, + 0xf0, 0x2a, 0xa1, 0xeb, 0x8d, 0x20, 0x82, 0x76, 0x17, 0x0d, 0x82, 0x6c, 0x49, 0xd7, 0x15, 0xa4, + 0x10, 0xa7, 0xcd, 0x18, 0x06, 0x92, 0x99, 0x30, 0x33, 0x59, 0xbb, 0xf7, 0xbe, 0x84, 0xaf, 0xe0, + 0x23, 0xf8, 0x08, 0xde, 0xf9, 0x46, 0x92, 0xc9, 0xa4, 0xcd, 0x36, 0x17, 0xdb, 0xbb, 0x4c, 0xcf, + 0xff, 0xff, 0xe7, 0x9b, 0x73, 0x86, 0xc2, 0xb3, 0x88, 0xf3, 0x28, 0x26, 0xae, 0x4c, 0x31, 0x63, + 0x44, 0xb8, 0x37, 0x63, 0x57, 0x09, 0xcc, 0x24, 0x5e, 0x2a, 0xca, 0x99, 0x93, 0x0a, 0xae, 0x38, + 0x3a, 0x2e, 0x44, 0x8e, 0x11, 0x39, 0x37, 0x63, 0xfb, 0x91, 0xf1, 0xe1, 0x94, 0xba, 0x98, 0x31, + 0xae, 0x70, 0xae, 0x97, 0x85, 0xc1, 0x7e, 0x6c, 0xaa, 0xfa, 0xb4, 0xc8, 0xbe, 0xbb, 0x61, 0x26, +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x96, 0x95, 0xb9, + 0xae, 0xcc, 0x4d, 0x65, 0x7e, 0x3d, 0x5e, 0xb4, 0x75, 0xf0, 0xcb, 0xff, 0x01, 0x00, 0x00, 0xff, + 0xff, 0xa6, 0x28, 0x2f, 0x4a, 0xae, 0x04, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/spanner/v1/type.pb.go b/vendor/google.golang.org/genproto/googleapis/spanner/v1/type.pb.go new file mode 100644 index 0000000000..499cad60f2 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/spanner/v1/type.pb.go @@ -0,0 +1,217 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/spanner/v1/type.proto + +package spanner + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// `TypeCode` is used as part of [Type][google.spanner.v1.Type] to +// indicate the type of a Cloud Spanner value. +// +// Each legal value of a type can be encoded to or decoded from a JSON +// value, using the encodings described below. All Cloud Spanner values can +// be `null`, regardless of type; `null`s are always encoded as a JSON +// `null`. +type TypeCode int32 + +const ( + // Not specified. + TypeCode_TYPE_CODE_UNSPECIFIED TypeCode = 0 + // Encoded as JSON `true` or `false`. + TypeCode_BOOL TypeCode = 1 + // Encoded as `string`, in decimal format. + TypeCode_INT64 TypeCode = 2 + // Encoded as `number`, or the strings `"NaN"`, `"Infinity"`, or + // `"-Infinity"`. + TypeCode_FLOAT64 TypeCode = 3 + // Encoded as `string` in RFC 3339 timestamp format. The time zone + // must be present, and must be `"Z"`. + TypeCode_TIMESTAMP TypeCode = 4 + // Encoded as `string` in RFC 3339 date format. + TypeCode_DATE TypeCode = 5 + // Encoded as `string`. + TypeCode_STRING TypeCode = 6 + // Encoded as a base64-encoded `string`, as described in RFC 4648, + // section 4. + TypeCode_BYTES TypeCode = 7 + // Encoded as `list`, where the list elements are represented + // according to [array_element_type][google.spanner.v1.Type.array_element_type]. + TypeCode_ARRAY TypeCode = 8 + // Encoded as `list`, where list element `i` is represented according + // to [struct_type.fields[i]][google.spanner.v1.StructType.fields]. + TypeCode_STRUCT TypeCode = 9 +) + +var TypeCode_name = map[int32]string{ + 0: "TYPE_CODE_UNSPECIFIED", + 1: "BOOL", + 2: "INT64", + 3: "FLOAT64", + 4: "TIMESTAMP", + 5: "DATE", + 6: "STRING", + 7: "BYTES", + 8: "ARRAY", + 9: "STRUCT", +} +var TypeCode_value = map[string]int32{ + "TYPE_CODE_UNSPECIFIED": 0, + "BOOL": 1, + "INT64": 2, + "FLOAT64": 3, + "TIMESTAMP": 4, + "DATE": 5, + "STRING": 6, + "BYTES": 7, + "ARRAY": 8, + "STRUCT": 9, +} + +func (x TypeCode) String() string { + return proto.EnumName(TypeCode_name, int32(x)) +} +func (TypeCode) EnumDescriptor() ([]byte, []int) { return fileDescriptor6, []int{0} } + +// `Type` indicates the type of a Cloud Spanner value, as might be stored in a +// table cell or returned from an SQL query. +type Type struct { + // Required. The [TypeCode][google.spanner.v1.TypeCode] for this type. + Code TypeCode `protobuf:"varint,1,opt,name=code,enum=google.spanner.v1.TypeCode" json:"code,omitempty"` + // If [code][google.spanner.v1.Type.code] == [ARRAY][google.spanner.v1.TypeCode.ARRAY], then `array_element_type` + // is the type of the array elements. + ArrayElementType *Type `protobuf:"bytes,2,opt,name=array_element_type,json=arrayElementType" json:"array_element_type,omitempty"` + // If [code][google.spanner.v1.Type.code] == [STRUCT][google.spanner.v1.TypeCode.STRUCT], then `struct_type` + // provides type information for the struct's fields. + StructType *StructType `protobuf:"bytes,3,opt,name=struct_type,json=structType" json:"struct_type,omitempty"` +} + +func (m *Type) Reset() { *m = Type{} } +func (m *Type) String() string { return proto.CompactTextString(m) } +func (*Type) ProtoMessage() {} +func (*Type) Descriptor() ([]byte, []int) { return fileDescriptor6, []int{0} } + +func (m *Type) GetCode() TypeCode { + if m != nil { + return m.Code + } + return TypeCode_TYPE_CODE_UNSPECIFIED +} + +func (m *Type) GetArrayElementType() *Type { + if m != nil { + return m.ArrayElementType + } + return nil +} + +func (m *Type) GetStructType() *StructType { + if m != nil { + return m.StructType + } + return nil +} + +// `StructType` defines the fields of a [STRUCT][google.spanner.v1.TypeCode.STRUCT] type. +type StructType struct { + // The list of fields that make up this struct. Order is + // significant, because values of this struct type are represented as + // lists, where the order of field values matches the order of + // fields in the [StructType][google.spanner.v1.StructType]. In turn, the order of fields + // matches the order of columns in a read request, or the order of + // fields in the `SELECT` clause of a query. + Fields []*StructType_Field `protobuf:"bytes,1,rep,name=fields" json:"fields,omitempty"` +} + +func (m *StructType) Reset() { *m = StructType{} } +func (m *StructType) String() string { return proto.CompactTextString(m) } +func (*StructType) ProtoMessage() {} +func (*StructType) Descriptor() ([]byte, []int) { return fileDescriptor6, []int{1} } + +func (m *StructType) GetFields() []*StructType_Field { + if m != nil { + return m.Fields + } + return nil +} + +// Message representing a single field of a struct. +type StructType_Field struct { + // The name of the field. For reads, this is the column name. For + // SQL queries, it is the column alias (e.g., `"Word"` in the + // query `"SELECT 'hello' AS Word"`), or the column name (e.g., + // `"ColName"` in the query `"SELECT ColName FROM Table"`). Some + // columns might have an empty name (e.g., !"SELECT + // UPPER(ColName)"`). Note that a query result can contain + // multiple fields with the same name. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The type of the field. + Type *Type `protobuf:"bytes,2,opt,name=type" json:"type,omitempty"` +} + +func (m *StructType_Field) Reset() { *m = StructType_Field{} } +func (m *StructType_Field) String() string { return proto.CompactTextString(m) } +func (*StructType_Field) ProtoMessage() {} +func (*StructType_Field) Descriptor() ([]byte, []int) { return fileDescriptor6, []int{1, 0} } + +func (m *StructType_Field) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *StructType_Field) GetType() *Type { + if m != nil { + return m.Type + } + return nil +} + +func init() { + proto.RegisterType((*Type)(nil), "google.spanner.v1.Type") + proto.RegisterType((*StructType)(nil), "google.spanner.v1.StructType") + proto.RegisterType((*StructType_Field)(nil), "google.spanner.v1.StructType.Field") + proto.RegisterEnum("google.spanner.v1.TypeCode", TypeCode_name, TypeCode_value) +} + +func init() { proto.RegisterFile("google/spanner/v1/type.proto", fileDescriptor6) } + +var fileDescriptor6 = []byte{ + // 444 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xd1, 0x8a, 0xd3, 0x40, + 0x14, 0x86, 0x9d, 0x6d, 0xda, 0x6d, 0x4e, 0x51, 0xc6, 0x81, 0x65, 0xeb, 0xaa, 0x50, 0xd6, 0x9b, + 0xa2, 0x90, 0xd0, 0x2a, 0x22, 0x2c, 0x08, 0x69, 0x3a, 0x5d, 0x03, 0xbb, 0x6d, 0x48, 0x66, 0x17, + 0x2a, 0x85, 0x32, 0xb6, 0x63, 0x28, 0xa4, 0x33, 0x21, 0xc9, 0x2e, 0xf4, 0x25, 0xbc, 0xd0, 0xb7, + 0xf0, 0x21, 0x7c, 0x00, 0x9f, 0x4a, 0x66, 0x92, 0xaa, 0xb0, 0x2a, 0xde, 0x9d, 0xe4, 0xfb, 0xbf, + 0x33, 0x67, 0x86, 0x03, 0x4f, 0x12, 0xa5, 0x92, 0x54, 0xb8, 0x45, 0xc6, 0xa5, 0x14, 0xb9, 0x7b, + 0x3b, 0x70, 0xcb, 0x5d, 0x26, 0x9c, 0x2c, 0x57, 0xa5, 0x22, 0x0f, 0x2b, 0xea, 0xd4, 0xd4, 0xb9, + 0x1d, 0x9c, 0xec, 0x05, 0x9e, 0x6d, 0x5c, 0x2e, 0xa5, 0x2a, 0x79, 0xb9, 0x51, 0xb2, 0xa8, 0x84, + 0xd3, 0x6f, 0x08, 0x2c, 0xb6, 0xcb, 0x04, 0x71, 0xc1, 0x5a, 0xa9, 0xb5, 0xe8, 0xa2, 0x1e, 0xea, + 0x3f, 0x18, 0x3e, 0x76, 0xee, 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x2b, 0x66, 0x51, 0x30, + 0x3d, 0xc7, 0x2d, 0x2d, 0x8f, 0xe6, 0x8c, 0xc6, 0xf8, 0x50, 0x97, 0x5e, 0x14, 0x79, 0x73, 0xdc, + 0xae, 0x13, 0x57, 0x3e, 0xc3, 0xf6, 0xe8, 0x33, 0x82, 0xa3, 0x95, 0xda, 0xde, 0x9d, 0x7a, 0x64, + 0xeb, 0x39, 0x43, 0xbd, 0x0c, 0x21, 0x7a, 0xff, 0xa6, 0xe6, 0x89, 0x4a, 0xb9, 0x4c, 0x1c, 0x95, + 0x27, 0x6e, 0x22, 0xa4, 0x59, 0x15, 0xb7, 0x42, 0x3c, 0xdb, 0x14, 0xbf, 0x2d, 0xdf, 0x59, 0x5d, + 0x7e, 0x3d, 0x38, 0x3e, 0xaf, 0x54, 0x3f, 0x55, 0x37, 0x6b, 0x27, 0xae, 0x0f, 0xb8, 0x1e, 0x7c, + 0xdf, 0x93, 0x85, 0x21, 0x8b, 0x9a, 0x2c, 0xae, 0x07, 0x1f, 0x5a, 0xa6, 0xf1, 0xcb, 0x1f, 0x01, + 0x00, 0x00, 0xff, 0xff, 0x55, 0xc4, 0x6e, 0xd4, 0xd4, 0x02, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/storagetransfer/v1/transfer.pb.go b/vendor/google.golang.org/genproto/googleapis/storagetransfer/v1/transfer.pb.go new file mode 100644 index 0000000000..8b6625b5c8 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/storagetransfer/v1/transfer.pb.go @@ -0,0 +1,660 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/storagetransfer/v1/transfer.proto + +/* +Package storagetransfer is a generated protocol buffer package. + +It is generated from these files: + google/storagetransfer/v1/transfer.proto + google/storagetransfer/v1/transfer_types.proto + +It has these top-level messages: + GetGoogleServiceAccountRequest + CreateTransferJobRequest + UpdateTransferJobRequest + GetTransferJobRequest + ListTransferJobsRequest + ListTransferJobsResponse + PauseTransferOperationRequest + ResumeTransferOperationRequest + GoogleServiceAccount + AwsAccessKey + ObjectConditions + GcsData + AwsS3Data + HttpData + TransferOptions + TransferSpec + Schedule + TransferJob + ErrorLogEntry + ErrorSummary + TransferCounters + TransferOperation +*/ +package storagetransfer + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf1 "github.com/golang/protobuf/ptypes/empty" +import google_protobuf2 "google.golang.org/genproto/protobuf/field_mask" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Request passed to GetGoogleServiceAccount. +type GetGoogleServiceAccountRequest struct { + // The ID of the Google Cloud Platform Console project that the Google service + // account is associated with. + // Required. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId" json:"project_id,omitempty"` +} + +func (m *GetGoogleServiceAccountRequest) Reset() { *m = GetGoogleServiceAccountRequest{} } +func (m *GetGoogleServiceAccountRequest) String() string { return proto.CompactTextString(m) } +func (*GetGoogleServiceAccountRequest) ProtoMessage() {} +func (*GetGoogleServiceAccountRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *GetGoogleServiceAccountRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +// Request passed to CreateTransferJob. +type CreateTransferJobRequest struct { + // The job to create. + // Required. + TransferJob *TransferJob `protobuf:"bytes,1,opt,name=transfer_job,json=transferJob" json:"transfer_job,omitempty"` +} + +func (m *CreateTransferJobRequest) Reset() { *m = CreateTransferJobRequest{} } +func (m *CreateTransferJobRequest) String() string { return proto.CompactTextString(m) } +func (*CreateTransferJobRequest) ProtoMessage() {} +func (*CreateTransferJobRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *CreateTransferJobRequest) GetTransferJob() *TransferJob { + if m != nil { + return m.TransferJob + } + return nil +} + +// Request passed to UpdateTransferJob. +type UpdateTransferJobRequest struct { + // The name of job to update. + // Required. + JobName string `protobuf:"bytes,1,opt,name=job_name,json=jobName" json:"job_name,omitempty"` + // The ID of the Google Cloud Platform Console project that owns the job. + // Required. + ProjectId string `protobuf:"bytes,2,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // The job to update. `transferJob` is expected to specify only three fields: + // `description`, `transferSpec`, and `status`. An UpdateTransferJobRequest + // that specifies other fields will be rejected with an error + // `INVALID_ARGUMENT`. + // Required. + TransferJob *TransferJob `protobuf:"bytes,3,opt,name=transfer_job,json=transferJob" json:"transfer_job,omitempty"` + // The field mask of the fields in `transferJob` that are to be updated in + // this request. Fields in `transferJob` that can be updated are: + // `description`, `transferSpec`, and `status`. To update the `transferSpec` + // of the job, a complete transfer specification has to be provided. An + // incomplete specification which misses any required fields will be rejected + // with the error `INVALID_ARGUMENT`. + UpdateTransferJobFieldMask *google_protobuf2.FieldMask `protobuf:"bytes,4,opt,name=update_transfer_job_field_mask,json=updateTransferJobFieldMask" json:"update_transfer_job_field_mask,omitempty"` +} + +func (m *UpdateTransferJobRequest) Reset() { *m = UpdateTransferJobRequest{} } +func (m *UpdateTransferJobRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateTransferJobRequest) ProtoMessage() {} +func (*UpdateTransferJobRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *UpdateTransferJobRequest) GetJobName() string { + if m != nil { + return m.JobName + } + return "" +} + +func (m *UpdateTransferJobRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *UpdateTransferJobRequest) GetTransferJob() *TransferJob { + if m != nil { + return m.TransferJob + } + return nil +} + +func (m *UpdateTransferJobRequest) GetUpdateTransferJobFieldMask() *google_protobuf2.FieldMask { + if m != nil { + return m.UpdateTransferJobFieldMask + } + return nil +} + +// Request passed to GetTransferJob. +type GetTransferJobRequest struct { + // The job to get. + // Required. + JobName string `protobuf:"bytes,1,opt,name=job_name,json=jobName" json:"job_name,omitempty"` + // The ID of the Google Cloud Platform Console project that owns the job. + // Required. + ProjectId string `protobuf:"bytes,2,opt,name=project_id,json=projectId" json:"project_id,omitempty"` +} + +func (m *GetTransferJobRequest) Reset() { *m = GetTransferJobRequest{} } +func (m *GetTransferJobRequest) String() string { return proto.CompactTextString(m) } +func (*GetTransferJobRequest) ProtoMessage() {} +func (*GetTransferJobRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *GetTransferJobRequest) GetJobName() string { + if m != nil { + return m.JobName + } + return "" +} + +func (m *GetTransferJobRequest) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +// `project_id`, `job_names`, and `job_statuses` are query parameters that can +// be specified when listing transfer jobs. +type ListTransferJobsRequest struct { + // A list of query parameters specified as JSON text in the form of + // {"project_id":"my_project_id", + // "job_names":["jobid1","jobid2",...], + // "job_statuses":["status1","status2",...]}. + // Since `job_names` and `job_statuses` support multiple values, their values + // must be specified with array notation. `project_id` is required. `job_names` + // and `job_statuses` are optional. The valid values for `job_statuses` are + // case-insensitive: `ENABLED`, `DISABLED`, and `DELETED`. + Filter string `protobuf:"bytes,1,opt,name=filter" json:"filter,omitempty"` + // The list page size. The max allowed value is 256. + PageSize int32 `protobuf:"varint,4,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // The list page token. + PageToken string `protobuf:"bytes,5,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` +} + +func (m *ListTransferJobsRequest) Reset() { *m = ListTransferJobsRequest{} } +func (m *ListTransferJobsRequest) String() string { return proto.CompactTextString(m) } +func (*ListTransferJobsRequest) ProtoMessage() {} +func (*ListTransferJobsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *ListTransferJobsRequest) GetFilter() string { + if m != nil { + return m.Filter + } + return "" +} + +func (m *ListTransferJobsRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListTransferJobsRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +// Response from ListTransferJobs. +type ListTransferJobsResponse struct { + // A list of transfer jobs. + TransferJobs []*TransferJob `protobuf:"bytes,1,rep,name=transfer_jobs,json=transferJobs" json:"transfer_jobs,omitempty"` + // The list next page token. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListTransferJobsResponse) Reset() { *m = ListTransferJobsResponse{} } +func (m *ListTransferJobsResponse) String() string { return proto.CompactTextString(m) } +func (*ListTransferJobsResponse) ProtoMessage() {} +func (*ListTransferJobsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *ListTransferJobsResponse) GetTransferJobs() []*TransferJob { + if m != nil { + return m.TransferJobs + } + return nil +} + +func (m *ListTransferJobsResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// Request passed to PauseTransferOperation. +type PauseTransferOperationRequest struct { + // The name of the transfer operation. + // Required. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *PauseTransferOperationRequest) Reset() { *m = PauseTransferOperationRequest{} } +func (m *PauseTransferOperationRequest) String() string { return proto.CompactTextString(m) } +func (*PauseTransferOperationRequest) ProtoMessage() {} +func (*PauseTransferOperationRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *PauseTransferOperationRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Request passed to ResumeTransferOperation. +type ResumeTransferOperationRequest struct { + // The name of the transfer operation. + // Required. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *ResumeTransferOperationRequest) Reset() { *m = ResumeTransferOperationRequest{} } +func (m *ResumeTransferOperationRequest) String() string { return proto.CompactTextString(m) } +func (*ResumeTransferOperationRequest) ProtoMessage() {} +func (*ResumeTransferOperationRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *ResumeTransferOperationRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func init() { + proto.RegisterType((*GetGoogleServiceAccountRequest)(nil), "google.storagetransfer.v1.GetGoogleServiceAccountRequest") + proto.RegisterType((*CreateTransferJobRequest)(nil), "google.storagetransfer.v1.CreateTransferJobRequest") + proto.RegisterType((*UpdateTransferJobRequest)(nil), "google.storagetransfer.v1.UpdateTransferJobRequest") + proto.RegisterType((*GetTransferJobRequest)(nil), "google.storagetransfer.v1.GetTransferJobRequest") + proto.RegisterType((*ListTransferJobsRequest)(nil), "google.storagetransfer.v1.ListTransferJobsRequest") + proto.RegisterType((*ListTransferJobsResponse)(nil), "google.storagetransfer.v1.ListTransferJobsResponse") + proto.RegisterType((*PauseTransferOperationRequest)(nil), "google.storagetransfer.v1.PauseTransferOperationRequest") + proto.RegisterType((*ResumeTransferOperationRequest)(nil), "google.storagetransfer.v1.ResumeTransferOperationRequest") +} + +// 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 + +// Client API for StorageTransferService service + +type StorageTransferServiceClient interface { + // Returns the Google service account that is used by Storage Transfer + // Service to access buckets in the project where transfers + // run or in other projects. Each Google service account is associated + // with one Google Cloud Platform Console project. Users + // should add this service account to the Google Cloud Storage bucket + // ACLs to grant access to Storage Transfer Service. This service + // account is created and owned by Storage Transfer Service and can + // only be used by Storage Transfer Service. + GetGoogleServiceAccount(ctx context.Context, in *GetGoogleServiceAccountRequest, opts ...grpc.CallOption) (*GoogleServiceAccount, error) + // Creates a transfer job that runs periodically. + CreateTransferJob(ctx context.Context, in *CreateTransferJobRequest, opts ...grpc.CallOption) (*TransferJob, error) + // Updates a transfer job. Updating a job's transfer spec does not affect + // transfer operations that are running already. Updating the scheduling + // of a job is not allowed. + UpdateTransferJob(ctx context.Context, in *UpdateTransferJobRequest, opts ...grpc.CallOption) (*TransferJob, error) + // Gets a transfer job. + GetTransferJob(ctx context.Context, in *GetTransferJobRequest, opts ...grpc.CallOption) (*TransferJob, error) + // Lists transfer jobs. + ListTransferJobs(ctx context.Context, in *ListTransferJobsRequest, opts ...grpc.CallOption) (*ListTransferJobsResponse, error) + // Pauses a transfer operation. + PauseTransferOperation(ctx context.Context, in *PauseTransferOperationRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) + // Resumes a transfer operation that is paused. + ResumeTransferOperation(ctx context.Context, in *ResumeTransferOperationRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) +} + +type storageTransferServiceClient struct { + cc *grpc.ClientConn +} + +func NewStorageTransferServiceClient(cc *grpc.ClientConn) StorageTransferServiceClient { + return &storageTransferServiceClient{cc} +} + +func (c *storageTransferServiceClient) GetGoogleServiceAccount(ctx context.Context, in *GetGoogleServiceAccountRequest, opts ...grpc.CallOption) (*GoogleServiceAccount, error) { + out := new(GoogleServiceAccount) + err := grpc.Invoke(ctx, "/google.storagetransfer.v1.StorageTransferService/GetGoogleServiceAccount", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *storageTransferServiceClient) CreateTransferJob(ctx context.Context, in *CreateTransferJobRequest, opts ...grpc.CallOption) (*TransferJob, error) { + out := new(TransferJob) + err := grpc.Invoke(ctx, "/google.storagetransfer.v1.StorageTransferService/CreateTransferJob", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *storageTransferServiceClient) UpdateTransferJob(ctx context.Context, in *UpdateTransferJobRequest, opts ...grpc.CallOption) (*TransferJob, error) { + out := new(TransferJob) + err := grpc.Invoke(ctx, "/google.storagetransfer.v1.StorageTransferService/UpdateTransferJob", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *storageTransferServiceClient) GetTransferJob(ctx context.Context, in *GetTransferJobRequest, opts ...grpc.CallOption) (*TransferJob, error) { + out := new(TransferJob) + err := grpc.Invoke(ctx, "/google.storagetransfer.v1.StorageTransferService/GetTransferJob", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *storageTransferServiceClient) ListTransferJobs(ctx context.Context, in *ListTransferJobsRequest, opts ...grpc.CallOption) (*ListTransferJobsResponse, error) { + out := new(ListTransferJobsResponse) + err := grpc.Invoke(ctx, "/google.storagetransfer.v1.StorageTransferService/ListTransferJobs", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *storageTransferServiceClient) PauseTransferOperation(ctx context.Context, in *PauseTransferOperationRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { + out := new(google_protobuf1.Empty) + err := grpc.Invoke(ctx, "/google.storagetransfer.v1.StorageTransferService/PauseTransferOperation", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *storageTransferServiceClient) ResumeTransferOperation(ctx context.Context, in *ResumeTransferOperationRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { + out := new(google_protobuf1.Empty) + err := grpc.Invoke(ctx, "/google.storagetransfer.v1.StorageTransferService/ResumeTransferOperation", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for StorageTransferService service + +type StorageTransferServiceServer interface { + // Returns the Google service account that is used by Storage Transfer + // Service to access buckets in the project where transfers + // run or in other projects. Each Google service account is associated + // with one Google Cloud Platform Console project. Users + // should add this service account to the Google Cloud Storage bucket + // ACLs to grant access to Storage Transfer Service. This service + // account is created and owned by Storage Transfer Service and can + // only be used by Storage Transfer Service. + GetGoogleServiceAccount(context.Context, *GetGoogleServiceAccountRequest) (*GoogleServiceAccount, error) + // Creates a transfer job that runs periodically. + CreateTransferJob(context.Context, *CreateTransferJobRequest) (*TransferJob, error) + // Updates a transfer job. Updating a job's transfer spec does not affect + // transfer operations that are running already. Updating the scheduling + // of a job is not allowed. + UpdateTransferJob(context.Context, *UpdateTransferJobRequest) (*TransferJob, error) + // Gets a transfer job. + GetTransferJob(context.Context, *GetTransferJobRequest) (*TransferJob, error) + // Lists transfer jobs. + ListTransferJobs(context.Context, *ListTransferJobsRequest) (*ListTransferJobsResponse, error) + // Pauses a transfer operation. + PauseTransferOperation(context.Context, *PauseTransferOperationRequest) (*google_protobuf1.Empty, error) + // Resumes a transfer operation that is paused. + ResumeTransferOperation(context.Context, *ResumeTransferOperationRequest) (*google_protobuf1.Empty, error) +} + +func RegisterStorageTransferServiceServer(s *grpc.Server, srv StorageTransferServiceServer) { + s.RegisterService(&_StorageTransferService_serviceDesc, srv) +} + +func _StorageTransferService_GetGoogleServiceAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetGoogleServiceAccountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StorageTransferServiceServer).GetGoogleServiceAccount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.storagetransfer.v1.StorageTransferService/GetGoogleServiceAccount", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StorageTransferServiceServer).GetGoogleServiceAccount(ctx, req.(*GetGoogleServiceAccountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StorageTransferService_CreateTransferJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateTransferJobRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StorageTransferServiceServer).CreateTransferJob(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.storagetransfer.v1.StorageTransferService/CreateTransferJob", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StorageTransferServiceServer).CreateTransferJob(ctx, req.(*CreateTransferJobRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StorageTransferService_UpdateTransferJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateTransferJobRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StorageTransferServiceServer).UpdateTransferJob(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.storagetransfer.v1.StorageTransferService/UpdateTransferJob", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StorageTransferServiceServer).UpdateTransferJob(ctx, req.(*UpdateTransferJobRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StorageTransferService_GetTransferJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetTransferJobRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StorageTransferServiceServer).GetTransferJob(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.storagetransfer.v1.StorageTransferService/GetTransferJob", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StorageTransferServiceServer).GetTransferJob(ctx, req.(*GetTransferJobRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StorageTransferService_ListTransferJobs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListTransferJobsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StorageTransferServiceServer).ListTransferJobs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.storagetransfer.v1.StorageTransferService/ListTransferJobs", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StorageTransferServiceServer).ListTransferJobs(ctx, req.(*ListTransferJobsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StorageTransferService_PauseTransferOperation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PauseTransferOperationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StorageTransferServiceServer).PauseTransferOperation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.storagetransfer.v1.StorageTransferService/PauseTransferOperation", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StorageTransferServiceServer).PauseTransferOperation(ctx, req.(*PauseTransferOperationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StorageTransferService_ResumeTransferOperation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ResumeTransferOperationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StorageTransferServiceServer).ResumeTransferOperation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.storagetransfer.v1.StorageTransferService/ResumeTransferOperation", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StorageTransferServiceServer).ResumeTransferOperation(ctx, req.(*ResumeTransferOperationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _StorageTransferService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.storagetransfer.v1.StorageTransferService", + HandlerType: (*StorageTransferServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetGoogleServiceAccount", + Handler: _StorageTransferService_GetGoogleServiceAccount_Handler, + }, + { + MethodName: "CreateTransferJob", + Handler: _StorageTransferService_CreateTransferJob_Handler, + }, + { + MethodName: "UpdateTransferJob", + Handler: _StorageTransferService_UpdateTransferJob_Handler, + }, + { + MethodName: "GetTransferJob", + Handler: _StorageTransferService_GetTransferJob_Handler, + }, + { + MethodName: "ListTransferJobs", + Handler: _StorageTransferService_ListTransferJobs_Handler, + }, + { + MethodName: "PauseTransferOperation", + Handler: _StorageTransferService_PauseTransferOperation_Handler, + }, + { + MethodName: "ResumeTransferOperation", + Handler: _StorageTransferService_ResumeTransferOperation_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/storagetransfer/v1/transfer.proto", +} + +func init() { proto.RegisterFile("google/storagetransfer/v1/transfer.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 786 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xdf, 0x4e, 0x13, 0x4f, + 0x14, 0xce, 0xf0, 0xef, 0x07, 0x03, 0xfc, 0x84, 0x49, 0x2c, 0x4b, 0x91, 0xda, 0x2c, 0x49, 0xc5, + 0x6a, 0x76, 0x6d, 0xeb, 0x85, 0x62, 0x8c, 0x11, 0xa2, 0x88, 0x7f, 0xb1, 0x20, 0x17, 0x86, 0xb8, + 0x99, 0xb6, 0xd3, 0xcd, 0x96, 0x76, 0x67, 0xdd, 0x99, 0x25, 0x02, 0xe1, 0xc6, 0x17, 0x30, 0xd1, + 0x98, 0x98, 0x18, 0x13, 0xaf, 0xbd, 0xf7, 0x11, 0xbc, 0xf1, 0xd6, 0x57, 0xf0, 0x21, 0xf4, 0x4a, + 0xb3, 0xb3, 0xb3, 0x65, 0xd9, 0xb6, 0x0b, 0xa8, 0x77, 0x3b, 0x33, 0xe7, 0x9c, 0xef, 0x3b, 0xe7, + 0xf0, 0x7d, 0x14, 0xce, 0x9b, 0x94, 0x9a, 0x4d, 0xa2, 0x33, 0x4e, 0x5d, 0x6c, 0x12, 0xee, 0x62, + 0x9b, 0xd5, 0x89, 0xab, 0x6f, 0x17, 0xf4, 0xf0, 0x5b, 0x73, 0x5c, 0xca, 0x29, 0x9a, 0x0e, 0x22, + 0xb5, 0x58, 0xa4, 0xb6, 0x5d, 0x48, 0x9f, 0x91, 0x45, 0xb0, 0x63, 0xe9, 0xd8, 0xb6, 0x29, 0xc7, + 0xdc, 0xa2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 0x20, 0xbf, 0xf8, 0x05, 0xc0, 0xb9, 0x2a, 0x6d, 0x25, 0x90, 0x11, + 0x20, 0x8b, 0xe3, 0x21, 0x9b, 0x55, 0xff, 0xf8, 0xf4, 0x8e, 0x8c, 0x37, 0x69, 0x13, 0xdb, 0xa6, + 0x46, 0x5d, 0x53, 0x37, 0x89, 0x2d, 0x42, 0xa5, 0x3d, 0x60, 0xc7, 0x62, 0x5d, 0x7e, 0x6a, 0x5c, + 0x8b, 0x5d, 0xfd, 0x00, 0xe0, 0x53, 0xdf, 0xd9, 0xc0, 0x73, 0xb4, 0xa5, 0x26, 0xf5, 0x6a, 0x5a, + 0xcc, 0x0a, 0xb5, 0x8d, 0xc2, 0xd7, 0x30, 0x62, 0x53, 0x44, 0x6c, 0xc6, 0x22, 0x36, 0x37, 0x0a, + 0x95, 0x21, 0x81, 0x5d, 0xfa, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x9e, 0x71, 0x04, 0x73, 0x87, 0x09, + 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/storagetransfer/v1/transfer_types.pb.go b/vendor/google.golang.org/genproto/googleapis/storagetransfer/v1/transfer_types.pb.go new file mode 100644 index 0000000000..0d94273cc0 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/storagetransfer/v1/transfer_types.pb.go @@ -0,0 +1,1220 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/storagetransfer/v1/transfer_types.proto + +package storagetransfer + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf3 "github.com/golang/protobuf/ptypes/duration" +import google_protobuf4 "github.com/golang/protobuf/ptypes/timestamp" +import google_rpc "google.golang.org/genproto/googleapis/rpc/code" +import google_type "google.golang.org/genproto/googleapis/type/date" +import google_type1 "google.golang.org/genproto/googleapis/type/timeofday" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// The status of the transfer job. +type TransferJob_Status int32 + +const ( + // Zero is an illegal value. + TransferJob_STATUS_UNSPECIFIED TransferJob_Status = 0 + // New transfers will be performed based on the schedule. + TransferJob_ENABLED TransferJob_Status = 1 + // New transfers will not be scheduled. + TransferJob_DISABLED TransferJob_Status = 2 + // This is a soft delete state. After a transfer job is set to this + // state, the job and all the transfer executions are subject to + // garbage collection. + TransferJob_DELETED TransferJob_Status = 3 +) + +var TransferJob_Status_name = map[int32]string{ + 0: "STATUS_UNSPECIFIED", + 1: "ENABLED", + 2: "DISABLED", + 3: "DELETED", +} +var TransferJob_Status_value = map[string]int32{ + "STATUS_UNSPECIFIED": 0, + "ENABLED": 1, + "DISABLED": 2, + "DELETED": 3, +} + +func (x TransferJob_Status) String() string { + return proto.EnumName(TransferJob_Status_name, int32(x)) +} +func (TransferJob_Status) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{9, 0} } + +// The status of a TransferOperation. +type TransferOperation_Status int32 + +const ( + // Zero is an illegal value. + TransferOperation_STATUS_UNSPECIFIED TransferOperation_Status = 0 + // In progress. + TransferOperation_IN_PROGRESS TransferOperation_Status = 1 + // Paused. + TransferOperation_PAUSED TransferOperation_Status = 2 + // Completed successfully. + TransferOperation_SUCCESS TransferOperation_Status = 3 + // Terminated due to an unrecoverable failure. + TransferOperation_FAILED TransferOperation_Status = 4 + // Aborted by the user. + TransferOperation_ABORTED TransferOperation_Status = 5 +) + +var TransferOperation_Status_name = map[int32]string{ + 0: "STATUS_UNSPECIFIED", + 1: "IN_PROGRESS", + 2: "PAUSED", + 3: "SUCCESS", + 4: "FAILED", + 5: "ABORTED", +} +var TransferOperation_Status_value = map[string]int32{ + "STATUS_UNSPECIFIED": 0, + "IN_PROGRESS": 1, + "PAUSED": 2, + "SUCCESS": 3, + "FAILED": 4, + "ABORTED": 5, +} + +func (x TransferOperation_Status) String() string { + return proto.EnumName(TransferOperation_Status_name, int32(x)) +} +func (TransferOperation_Status) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{13, 0} } + +// Google service account +type GoogleServiceAccount struct { + // Required. + AccountEmail string `protobuf:"bytes,1,opt,name=account_email,json=accountEmail" json:"account_email,omitempty"` +} + +func (m *GoogleServiceAccount) Reset() { *m = GoogleServiceAccount{} } +func (m *GoogleServiceAccount) String() string { return proto.CompactTextString(m) } +func (*GoogleServiceAccount) ProtoMessage() {} +func (*GoogleServiceAccount) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +func (m *GoogleServiceAccount) GetAccountEmail() string { + if m != nil { + return m.AccountEmail + } + return "" +} + +// AWS access key (see +// [AWS Security Credentials](http://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html)). +type AwsAccessKey struct { + // AWS access key ID. + // Required. + AccessKeyId string `protobuf:"bytes,1,opt,name=access_key_id,json=accessKeyId" json:"access_key_id,omitempty"` + // AWS secret access key. This field is not returned in RPC responses. + // Required. + SecretAccessKey string `protobuf:"bytes,2,opt,name=secret_access_key,json=secretAccessKey" json:"secret_access_key,omitempty"` +} + +func (m *AwsAccessKey) Reset() { *m = AwsAccessKey{} } +func (m *AwsAccessKey) String() string { return proto.CompactTextString(m) } +func (*AwsAccessKey) ProtoMessage() {} +func (*AwsAccessKey) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} } + +func (m *AwsAccessKey) GetAccessKeyId() string { + if m != nil { + return m.AccessKeyId + } + return "" +} + +func (m *AwsAccessKey) GetSecretAccessKey() string { + if m != nil { + return m.SecretAccessKey + } + return "" +} + +// Conditions that determine which objects will be transferred. +type ObjectConditions struct { + // If unspecified, `minTimeElapsedSinceLastModification` takes a zero value + // and `maxTimeElapsedSinceLastModification` takes the maximum possible + // value of Duration. Objects that satisfy the object conditions + // must either have a `lastModificationTime` greater or equal to + // `NOW` - `maxTimeElapsedSinceLastModification` and less than + // `NOW` - `minTimeElapsedSinceLastModification`, or not have a + // `lastModificationTime`. + MinTimeElapsedSinceLastModification *google_protobuf3.Duration `protobuf:"bytes,1,opt,name=min_time_elapsed_since_last_modification,json=minTimeElapsedSinceLastModification" json:"min_time_elapsed_since_last_modification,omitempty"` + // `maxTimeElapsedSinceLastModification` is the complement to + // `minTimeElapsedSinceLastModification`. + MaxTimeElapsedSinceLastModification *google_protobuf3.Duration `protobuf:"bytes,2,opt,name=max_time_elapsed_since_last_modification,json=maxTimeElapsedSinceLastModification" json:"max_time_elapsed_since_last_modification,omitempty"` + // If `includePrefixes` is specified, objects that satisfy the object + // conditions must have names that start with one of the `includePrefixes` + // and that do not start with any of the `excludePrefixes`. If `includePrefixes` + // is not specified, all objects except those that have names starting with + // one of the `excludePrefixes` must satisfy the object conditions. + // + // Requirements: + // + // * Each include-prefix and exclude-prefix can contain any sequence of + // Unicode characters, of max length 1024 bytes when UTF8-encoded, and + // must not contain Carriage Return or Line Feed characters. Wildcard + // matching and regular expression matching are not supported. + // + // * Each include-prefix and exclude-prefix must omit the leading slash. + // For example, to include the `requests.gz` object in a transfer from + // `s3://my-aws-bucket/logs/y=2015/requests.gz`, specify the include + // prefix as `logs/y=2015/requests.gz`. + // + // * None of the include-prefix or the exclude-prefix values can be empty, + // if specified. + // + // * Each include-prefix must include a distinct portion of the object + // namespace, i.e., no include-prefix may be a prefix of another + // include-prefix. + // + // * Each exclude-prefix must exclude a distinct portion of the object + // namespace, i.e., no exclude-prefix may be a prefix of another + // exclude-prefix. + // + // * If `includePrefixes` is specified, then each exclude-prefix must start + // with the value of a path explicitly included by `includePrefixes`. + // + // The max size of `includePrefixes` is 1000. + IncludePrefixes []string `protobuf:"bytes,3,rep,name=include_prefixes,json=includePrefixes" json:"include_prefixes,omitempty"` + // `excludePrefixes` must follow the requirements described for + // `includePrefixes`. + // + // The max size of `excludePrefixes` is 1000. + ExcludePrefixes []string `protobuf:"bytes,4,rep,name=exclude_prefixes,json=excludePrefixes" json:"exclude_prefixes,omitempty"` +} + +func (m *ObjectConditions) Reset() { *m = ObjectConditions{} } +func (m *ObjectConditions) String() string { return proto.CompactTextString(m) } +func (*ObjectConditions) ProtoMessage() {} +func (*ObjectConditions) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} } + +func (m *ObjectConditions) GetMinTimeElapsedSinceLastModification() *google_protobuf3.Duration { + if m != nil { + return m.MinTimeElapsedSinceLastModification + } + return nil +} + +func (m *ObjectConditions) GetMaxTimeElapsedSinceLastModification() *google_protobuf3.Duration { + if m != nil { + return m.MaxTimeElapsedSinceLastModification + } + return nil +} + +func (m *ObjectConditions) GetIncludePrefixes() []string { + if m != nil { + return m.IncludePrefixes + } + return nil +} + +func (m *ObjectConditions) GetExcludePrefixes() []string { + if m != nil { + return m.ExcludePrefixes + } + return nil +} + +// In a GcsData, an object's name is the Google Cloud Storage object's name and +// its `lastModificationTime` refers to the object's updated time, which changes +// when the content or the metadata of the object is updated. +type GcsData struct { + // Google Cloud Storage bucket name (see + // [Bucket Name Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). + // Required. + BucketName string `protobuf:"bytes,1,opt,name=bucket_name,json=bucketName" json:"bucket_name,omitempty"` +} + +func (m *GcsData) Reset() { *m = GcsData{} } +func (m *GcsData) String() string { return proto.CompactTextString(m) } +func (*GcsData) ProtoMessage() {} +func (*GcsData) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{3} } + +func (m *GcsData) GetBucketName() string { + if m != nil { + return m.BucketName + } + return "" +} + +// An AwsS3Data can be a data source, but not a data sink. +// In an AwsS3Data, an object's name is the S3 object's key name. +type AwsS3Data struct { + // S3 Bucket name (see + // [Creating a bucket](http://docs.aws.amazon.com/AmazonS3/latest/dev/create-bucket-get-location-example.html)). + // Required. + BucketName string `protobuf:"bytes,1,opt,name=bucket_name,json=bucketName" json:"bucket_name,omitempty"` + // AWS access key used to sign the API requests to the AWS S3 bucket. + // Permissions on the bucket must be granted to the access ID of the + // AWS access key. + // Required. + AwsAccessKey *AwsAccessKey `protobuf:"bytes,2,opt,name=aws_access_key,json=awsAccessKey" json:"aws_access_key,omitempty"` +} + +func (m *AwsS3Data) Reset() { *m = AwsS3Data{} } +func (m *AwsS3Data) String() string { return proto.CompactTextString(m) } +func (*AwsS3Data) ProtoMessage() {} +func (*AwsS3Data) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{4} } + +func (m *AwsS3Data) GetBucketName() string { + if m != nil { + return m.BucketName + } + return "" +} + +func (m *AwsS3Data) GetAwsAccessKey() *AwsAccessKey { + if m != nil { + return m.AwsAccessKey + } + return nil +} + +// An HttpData specifies a list of objects on the web to be transferred over +// HTTP. The information of the objects to be transferred is contained in a +// file referenced by a URL. The first line in the file must be +// "TsvHttpData-1.0", which specifies the format of the file. Subsequent lines +// specify the information of the list of objects, one object per list entry. +// Each entry has the following tab-delimited fields: +// +// * HTTP URL - The location of the object. +// +// * Length - The size of the object in bytes. +// +// * MD5 - The base64-encoded MD5 hash of the object. +// +// For an example of a valid TSV file, see +// [Transferring data from URLs](https://cloud.google.com/storage/transfer/create-url-list). +// +// When transferring data based on a URL list, keep the following in mind: +// +// * When an object located at `http(s)://hostname:port/` is transferred +// to a data sink, the name of the object at the data sink is +// `/`. +// +// * If the specified size of an object does not match the actual size of the +// object fetched, the object will not be transferred. +// +// * If the specified MD5 does not match the MD5 computed from the transferred +// bytes, the object transfer will fail. For more information, see +// [Generating MD5 hashes](https://cloud.google.com/storage/transfer/#md5) +// +// * Ensure that each URL you specify is publicly accessible. For +// example, in Google Cloud Storage you can +// [share an object publicly] +// (https://cloud.google.com/storage/docs/cloud-console#_sharingdata) and get +// a link to it. +// +// * Storage Transfer Service obeys `robots.txt` rules and requires the source +// HTTP server to support `Range` requests and to return a `Content-Length` +// header in each response. +// +// * [ObjectConditions](#ObjectConditions) have no effect when filtering objects +// to transfer. +type HttpData struct { + // The URL that points to the file that stores the object list entries. + // This file must allow public access. Currently, only URLs with HTTP and + // HTTPS schemes are supported. + // Required. + ListUrl string `protobuf:"bytes,1,opt,name=list_url,json=listUrl" json:"list_url,omitempty"` +} + +func (m *HttpData) Reset() { *m = HttpData{} } +func (m *HttpData) String() string { return proto.CompactTextString(m) } +func (*HttpData) ProtoMessage() {} +func (*HttpData) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{5} } + +func (m *HttpData) GetListUrl() string { + if m != nil { + return m.ListUrl + } + return "" +} + +// TransferOptions uses three boolean parameters to define the actions +// to be performed on objects in a transfer. +type TransferOptions struct { + // Whether overwriting objects that already exist in the sink is allowed. + OverwriteObjectsAlreadyExistingInSink bool `protobuf:"varint,1,opt,name=overwrite_objects_already_existing_in_sink,json=overwriteObjectsAlreadyExistingInSink" json:"overwrite_objects_already_existing_in_sink,omitempty"` + // Whether objects that exist only in the sink should be deleted. Note that + // this option and `deleteObjectsFromSourceAfterTransfer` are mutually + // exclusive. + DeleteObjectsUniqueInSink bool `protobuf:"varint,2,opt,name=delete_objects_unique_in_sink,json=deleteObjectsUniqueInSink" json:"delete_objects_unique_in_sink,omitempty"` + // Whether objects should be deleted from the source after they are + // transferred to the sink. Note that this option and + // `deleteObjectsUniqueInSink` are mutually exclusive. + DeleteObjectsFromSourceAfterTransfer bool `protobuf:"varint,3,opt,name=delete_objects_from_source_after_transfer,json=deleteObjectsFromSourceAfterTransfer" json:"delete_objects_from_source_after_transfer,omitempty"` +} + +func (m *TransferOptions) Reset() { *m = TransferOptions{} } +func (m *TransferOptions) String() string { return proto.CompactTextString(m) } +func (*TransferOptions) ProtoMessage() {} +func (*TransferOptions) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{6} } + +func (m *TransferOptions) GetOverwriteObjectsAlreadyExistingInSink() bool { + if m != nil { + return m.OverwriteObjectsAlreadyExistingInSink + } + return false +} + +func (m *TransferOptions) GetDeleteObjectsUniqueInSink() bool { + if m != nil { + return m.DeleteObjectsUniqueInSink + } + return false +} + +func (m *TransferOptions) GetDeleteObjectsFromSourceAfterTransfer() bool { + if m != nil { + return m.DeleteObjectsFromSourceAfterTransfer + } + return false +} + +// Configuration for running a transfer. +type TransferSpec struct { + // The read source of the data. + // + // Types that are valid to be assigned to DataSource: + // *TransferSpec_GcsDataSource + // *TransferSpec_AwsS3DataSource + // *TransferSpec_HttpDataSource + DataSource isTransferSpec_DataSource `protobuf_oneof:"data_source"` + // The write sink for the data. + // + // Types that are valid to be assigned to DataSink: + // *TransferSpec_GcsDataSink + DataSink isTransferSpec_DataSink `protobuf_oneof:"data_sink"` + // Only objects that satisfy these object conditions are included in the set + // of data source and data sink objects. Object conditions based on + // objects' `lastModificationTime` do not exclude objects in a data sink. + ObjectConditions *ObjectConditions `protobuf:"bytes,5,opt,name=object_conditions,json=objectConditions" json:"object_conditions,omitempty"` + // If the option `deleteObjectsUniqueInSink` is `true`, object conditions + // based on objects' `lastModificationTime` are ignored and do not exclude + // objects in a data source or a data sink. + TransferOptions *TransferOptions `protobuf:"bytes,6,opt,name=transfer_options,json=transferOptions" json:"transfer_options,omitempty"` +} + +func (m *TransferSpec) Reset() { *m = TransferSpec{} } +func (m *TransferSpec) String() string { return proto.CompactTextString(m) } +func (*TransferSpec) ProtoMessage() {} +func (*TransferSpec) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{7} } + +type isTransferSpec_DataSource interface { + isTransferSpec_DataSource() +} +type isTransferSpec_DataSink interface { + isTransferSpec_DataSink() +} + +type TransferSpec_GcsDataSource struct { + GcsDataSource *GcsData `protobuf:"bytes,1,opt,name=gcs_data_source,json=gcsDataSource,oneof"` +} +type TransferSpec_AwsS3DataSource struct { + AwsS3DataSource *AwsS3Data `protobuf:"bytes,2,opt,name=aws_s3_data_source,json=awsS3DataSource,oneof"` +} +type TransferSpec_HttpDataSource struct { + HttpDataSource *HttpData `protobuf:"bytes,3,opt,name=http_data_source,json=httpDataSource,oneof"` +} +type TransferSpec_GcsDataSink struct { + GcsDataSink *GcsData `protobuf:"bytes,4,opt,name=gcs_data_sink,json=gcsDataSink,oneof"` +} + +func (*TransferSpec_GcsDataSource) isTransferSpec_DataSource() {} +func (*TransferSpec_AwsS3DataSource) isTransferSpec_DataSource() {} +func (*TransferSpec_HttpDataSource) isTransferSpec_DataSource() {} +func (*TransferSpec_GcsDataSink) isTransferSpec_DataSink() {} + +func (m *TransferSpec) GetDataSource() isTransferSpec_DataSource { + if m != nil { + return m.DataSource + } + return nil +} +func (m *TransferSpec) GetDataSink() isTransferSpec_DataSink { + if m != nil { + return m.DataSink + } + return nil +} + +func (m *TransferSpec) GetGcsDataSource() *GcsData { + if x, ok := m.GetDataSource().(*TransferSpec_GcsDataSource); ok { + return x.GcsDataSource + } + return nil +} + +func (m *TransferSpec) GetAwsS3DataSource() *AwsS3Data { + if x, ok := m.GetDataSource().(*TransferSpec_AwsS3DataSource); ok { + return x.AwsS3DataSource + } + return nil +} + +func (m *TransferSpec) GetHttpDataSource() *HttpData { + if x, ok := m.GetDataSource().(*TransferSpec_HttpDataSource); ok { + return x.HttpDataSource + } + return nil +} + +func (m *TransferSpec) GetGcsDataSink() *GcsData { + if x, ok := m.GetDataSink().(*TransferSpec_GcsDataSink); ok { + return x.GcsDataSink + } + return nil +} + +func (m *TransferSpec) GetObjectConditions() *ObjectConditions { + if m != nil { + return m.ObjectConditions + } + return nil +} + +func (m *TransferSpec) GetTransferOptions() *TransferOptions { + if m != nil { + return m.TransferOptions + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*TransferSpec) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _TransferSpec_OneofMarshaler, _TransferSpec_OneofUnmarshaler, _TransferSpec_OneofSizer, []interface{}{ + (*TransferSpec_GcsDataSource)(nil), + (*TransferSpec_AwsS3DataSource)(nil), + (*TransferSpec_HttpDataSource)(nil), + (*TransferSpec_GcsDataSink)(nil), + } +} + +func _TransferSpec_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*TransferSpec) + // data_source + switch x := m.DataSource.(type) { + case *TransferSpec_GcsDataSource: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.GcsDataSource); err != nil { + return err + } + case *TransferSpec_AwsS3DataSource: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.AwsS3DataSource); err != nil { + return err + } + case *TransferSpec_HttpDataSource: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.HttpDataSource); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("TransferSpec.DataSource has unexpected type %T", x) + } + // data_sink + switch x := m.DataSink.(type) { + case *TransferSpec_GcsDataSink: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.GcsDataSink); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("TransferSpec.DataSink has unexpected type %T", x) + } + return nil +} + +func _TransferSpec_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*TransferSpec) + switch tag { + case 1: // data_source.gcs_data_source + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(GcsData) + err := b.DecodeMessage(msg) + m.DataSource = &TransferSpec_GcsDataSource{msg} + return true, err + case 2: // data_source.aws_s3_data_source + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(AwsS3Data) + err := b.DecodeMessage(msg) + m.DataSource = &TransferSpec_AwsS3DataSource{msg} + return true, err + case 3: // data_source.http_data_source + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(HttpData) + err := b.DecodeMessage(msg) + m.DataSource = &TransferSpec_HttpDataSource{msg} + return true, err + case 4: // data_sink.gcs_data_sink + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(GcsData) + err := b.DecodeMessage(msg) + m.DataSink = &TransferSpec_GcsDataSink{msg} + return true, err + default: + return false, nil + } +} + +func _TransferSpec_OneofSizer(msg proto.Message) (n int) { + m := msg.(*TransferSpec) + // data_source + switch x := m.DataSource.(type) { + case *TransferSpec_GcsDataSource: + s := proto.Size(x.GcsDataSource) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *TransferSpec_AwsS3DataSource: + s := proto.Size(x.AwsS3DataSource) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *TransferSpec_HttpDataSource: + s := proto.Size(x.HttpDataSource) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + // data_sink + switch x := m.DataSink.(type) { + case *TransferSpec_GcsDataSink: + s := proto.Size(x.GcsDataSink) + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Transfers can be scheduled to recur or to run just once. +type Schedule struct { + // The first day the recurring transfer is scheduled to run. If + // `scheduleStartDate` is in the past, the transfer will run for the first + // time on the following day. + // Required. + ScheduleStartDate *google_type.Date `protobuf:"bytes,1,opt,name=schedule_start_date,json=scheduleStartDate" json:"schedule_start_date,omitempty"` + // The last day the recurring transfer will be run. If `scheduleEndDate` + // is the same as `scheduleStartDate`, the transfer will be executed only + // once. + ScheduleEndDate *google_type.Date `protobuf:"bytes,2,opt,name=schedule_end_date,json=scheduleEndDate" json:"schedule_end_date,omitempty"` + // The time in UTC at which the transfer will be scheduled to start in a day. + // Transfers may start later than this time. If not specified, recurring and + // one-time transfers that are scheduled to run today will run immediately; + // recurring transfers that are scheduled to run on a future date will start + // at approximately midnight UTC on that date. Note that when configuring a + // transfer with the Cloud Platform Console, the transfer's start time in a + // day is specified in your local timezone. + StartTimeOfDay *google_type1.TimeOfDay `protobuf:"bytes,3,opt,name=start_time_of_day,json=startTimeOfDay" json:"start_time_of_day,omitempty"` +} + +func (m *Schedule) Reset() { *m = Schedule{} } +func (m *Schedule) String() string { return proto.CompactTextString(m) } +func (*Schedule) ProtoMessage() {} +func (*Schedule) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{8} } + +func (m *Schedule) GetScheduleStartDate() *google_type.Date { + if m != nil { + return m.ScheduleStartDate + } + return nil +} + +func (m *Schedule) GetScheduleEndDate() *google_type.Date { + if m != nil { + return m.ScheduleEndDate + } + return nil +} + +func (m *Schedule) GetStartTimeOfDay() *google_type1.TimeOfDay { + if m != nil { + return m.StartTimeOfDay + } + return nil +} + +// This resource represents the configuration of a transfer job that runs +// periodically. +type TransferJob struct { + // A globally unique name assigned by Storage Transfer Service when the + // job is created. This field should be left empty in requests to create a new + // transfer job; otherwise, the requests result in an `INVALID_ARGUMENT` + // error. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // A description provided by the user for the job. Its max length is 1024 + // bytes when Unicode-encoded. + Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` + // The ID of the Google Cloud Platform Console project that owns the job. + ProjectId string `protobuf:"bytes,3,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // Transfer specification. + TransferSpec *TransferSpec `protobuf:"bytes,4,opt,name=transfer_spec,json=transferSpec" json:"transfer_spec,omitempty"` + // Schedule specification. + Schedule *Schedule `protobuf:"bytes,5,opt,name=schedule" json:"schedule,omitempty"` + // Status of the job. This value MUST be specified for + // `CreateTransferJobRequests`. + // + // NOTE: The effect of the new job status takes place during a subsequent job + // run. For example, if you change the job status from `ENABLED` to + // `DISABLED`, and an operation spawned by the transfer is running, the status + // change would not affect the current operation. + Status TransferJob_Status `protobuf:"varint,6,opt,name=status,enum=google.storagetransfer.v1.TransferJob_Status" json:"status,omitempty"` + // This field cannot be changed by user requests. + CreationTime *google_protobuf4.Timestamp `protobuf:"bytes,7,opt,name=creation_time,json=creationTime" json:"creation_time,omitempty"` + // This field cannot be changed by user requests. + LastModificationTime *google_protobuf4.Timestamp `protobuf:"bytes,8,opt,name=last_modification_time,json=lastModificationTime" json:"last_modification_time,omitempty"` + // This field cannot be changed by user requests. + DeletionTime *google_protobuf4.Timestamp `protobuf:"bytes,9,opt,name=deletion_time,json=deletionTime" json:"deletion_time,omitempty"` +} + +func (m *TransferJob) Reset() { *m = TransferJob{} } +func (m *TransferJob) String() string { return proto.CompactTextString(m) } +func (*TransferJob) ProtoMessage() {} +func (*TransferJob) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{9} } + +func (m *TransferJob) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *TransferJob) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *TransferJob) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *TransferJob) GetTransferSpec() *TransferSpec { + if m != nil { + return m.TransferSpec + } + return nil +} + +func (m *TransferJob) GetSchedule() *Schedule { + if m != nil { + return m.Schedule + } + return nil +} + +func (m *TransferJob) GetStatus() TransferJob_Status { + if m != nil { + return m.Status + } + return TransferJob_STATUS_UNSPECIFIED +} + +func (m *TransferJob) GetCreationTime() *google_protobuf4.Timestamp { + if m != nil { + return m.CreationTime + } + return nil +} + +func (m *TransferJob) GetLastModificationTime() *google_protobuf4.Timestamp { + if m != nil { + return m.LastModificationTime + } + return nil +} + +func (m *TransferJob) GetDeletionTime() *google_protobuf4.Timestamp { + if m != nil { + return m.DeletionTime + } + return nil +} + +// An entry describing an error that has occurred. +type ErrorLogEntry struct { + // A URL that refers to the target (a data source, a data sink, + // or an object) with which the error is associated. + // Required. + Url string `protobuf:"bytes,1,opt,name=url" json:"url,omitempty"` + // A list of messages that carry the error details. + ErrorDetails []string `protobuf:"bytes,3,rep,name=error_details,json=errorDetails" json:"error_details,omitempty"` +} + +func (m *ErrorLogEntry) Reset() { *m = ErrorLogEntry{} } +func (m *ErrorLogEntry) String() string { return proto.CompactTextString(m) } +func (*ErrorLogEntry) ProtoMessage() {} +func (*ErrorLogEntry) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{10} } + +func (m *ErrorLogEntry) GetUrl() string { + if m != nil { + return m.Url + } + return "" +} + +func (m *ErrorLogEntry) GetErrorDetails() []string { + if m != nil { + return m.ErrorDetails + } + return nil +} + +// A summary of errors by error code, plus a count and sample error log +// entries. +type ErrorSummary struct { + // Required. + ErrorCode google_rpc.Code `protobuf:"varint,1,opt,name=error_code,json=errorCode,enum=google.rpc.Code" json:"error_code,omitempty"` + // Count of this type of error. + // Required. + ErrorCount int64 `protobuf:"varint,2,opt,name=error_count,json=errorCount" json:"error_count,omitempty"` + // Error samples. + ErrorLogEntries []*ErrorLogEntry `protobuf:"bytes,3,rep,name=error_log_entries,json=errorLogEntries" json:"error_log_entries,omitempty"` +} + +func (m *ErrorSummary) Reset() { *m = ErrorSummary{} } +func (m *ErrorSummary) String() string { return proto.CompactTextString(m) } +func (*ErrorSummary) ProtoMessage() {} +func (*ErrorSummary) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{11} } + +func (m *ErrorSummary) GetErrorCode() google_rpc.Code { + if m != nil { + return m.ErrorCode + } + return google_rpc.Code_OK +} + +func (m *ErrorSummary) GetErrorCount() int64 { + if m != nil { + return m.ErrorCount + } + return 0 +} + +func (m *ErrorSummary) GetErrorLogEntries() []*ErrorLogEntry { + if m != nil { + return m.ErrorLogEntries + } + return nil +} + +// A collection of counters that report the progress of a transfer operation. +type TransferCounters struct { + // Objects found in the data source that are scheduled to be transferred, + // excluding any that are filtered based on object conditions or skipped due + // to sync. + ObjectsFoundFromSource int64 `protobuf:"varint,1,opt,name=objects_found_from_source,json=objectsFoundFromSource" json:"objects_found_from_source,omitempty"` + // Bytes found in the data source that are scheduled to be transferred, + // excluding any that are filtered based on object conditions or skipped due + // to sync. + BytesFoundFromSource int64 `protobuf:"varint,2,opt,name=bytes_found_from_source,json=bytesFoundFromSource" json:"bytes_found_from_source,omitempty"` + // Objects found only in the data sink that are scheduled to be deleted. + ObjectsFoundOnlyFromSink int64 `protobuf:"varint,3,opt,name=objects_found_only_from_sink,json=objectsFoundOnlyFromSink" json:"objects_found_only_from_sink,omitempty"` + // Bytes found only in the data sink that are scheduled to be deleted. + BytesFoundOnlyFromSink int64 `protobuf:"varint,4,opt,name=bytes_found_only_from_sink,json=bytesFoundOnlyFromSink" json:"bytes_found_only_from_sink,omitempty"` + // Objects in the data source that are not transferred because they already + // exist in the data sink. + ObjectsFromSourceSkippedBySync int64 `protobuf:"varint,5,opt,name=objects_from_source_skipped_by_sync,json=objectsFromSourceSkippedBySync" json:"objects_from_source_skipped_by_sync,omitempty"` + // Bytes in the data source that are not transferred because they already + // exist in the data sink. + BytesFromSourceSkippedBySync int64 `protobuf:"varint,6,opt,name=bytes_from_source_skipped_by_sync,json=bytesFromSourceSkippedBySync" json:"bytes_from_source_skipped_by_sync,omitempty"` + // Objects that are copied to the data sink. + ObjectsCopiedToSink int64 `protobuf:"varint,7,opt,name=objects_copied_to_sink,json=objectsCopiedToSink" json:"objects_copied_to_sink,omitempty"` + // Bytes that are copied to the data sink. + BytesCopiedToSink int64 `protobuf:"varint,8,opt,name=bytes_copied_to_sink,json=bytesCopiedToSink" json:"bytes_copied_to_sink,omitempty"` + // Objects that are deleted from the data source. + ObjectsDeletedFromSource int64 `protobuf:"varint,9,opt,name=objects_deleted_from_source,json=objectsDeletedFromSource" json:"objects_deleted_from_source,omitempty"` + // Bytes that are deleted from the data source. + BytesDeletedFromSource int64 `protobuf:"varint,10,opt,name=bytes_deleted_from_source,json=bytesDeletedFromSource" json:"bytes_deleted_from_source,omitempty"` + // Objects that are deleted from the data sink. + ObjectsDeletedFromSink int64 `protobuf:"varint,11,opt,name=objects_deleted_from_sink,json=objectsDeletedFromSink" json:"objects_deleted_from_sink,omitempty"` + // Bytes that are deleted from the data sink. + BytesDeletedFromSink int64 `protobuf:"varint,12,opt,name=bytes_deleted_from_sink,json=bytesDeletedFromSink" json:"bytes_deleted_from_sink,omitempty"` + // Objects in the data source that failed during the transfer. + ObjectsFromSourceFailed int64 `protobuf:"varint,13,opt,name=objects_from_source_failed,json=objectsFromSourceFailed" json:"objects_from_source_failed,omitempty"` + // Bytes in the data source that failed during the transfer. + BytesFromSourceFailed int64 `protobuf:"varint,14,opt,name=bytes_from_source_failed,json=bytesFromSourceFailed" json:"bytes_from_source_failed,omitempty"` + // Objects that failed to be deleted from the data sink. + ObjectsFailedToDeleteFromSink int64 `protobuf:"varint,15,opt,name=objects_failed_to_delete_from_sink,json=objectsFailedToDeleteFromSink" json:"objects_failed_to_delete_from_sink,omitempty"` + // Bytes that failed to be deleted from the data sink. + BytesFailedToDeleteFromSink int64 `protobuf:"varint,16,opt,name=bytes_failed_to_delete_from_sink,json=bytesFailedToDeleteFromSink" json:"bytes_failed_to_delete_from_sink,omitempty"` +} + +func (m *TransferCounters) Reset() { *m = TransferCounters{} } +func (m *TransferCounters) String() string { return proto.CompactTextString(m) } +func (*TransferCounters) ProtoMessage() {} +func (*TransferCounters) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{12} } + +func (m *TransferCounters) GetObjectsFoundFromSource() int64 { + if m != nil { + return m.ObjectsFoundFromSource + } + return 0 +} + +func (m *TransferCounters) GetBytesFoundFromSource() int64 { + if m != nil { + return m.BytesFoundFromSource + } + return 0 +} + +func (m *TransferCounters) GetObjectsFoundOnlyFromSink() int64 { + if m != nil { + return m.ObjectsFoundOnlyFromSink + } + return 0 +} + +func (m *TransferCounters) GetBytesFoundOnlyFromSink() int64 { + if m != nil { + return m.BytesFoundOnlyFromSink + } + return 0 +} + +func (m *TransferCounters) GetObjectsFromSourceSkippedBySync() int64 { + if m != nil { + return m.ObjectsFromSourceSkippedBySync + } + return 0 +} + +func (m *TransferCounters) GetBytesFromSourceSkippedBySync() int64 { + if m != nil { + return m.BytesFromSourceSkippedBySync + } + return 0 +} + +func (m *TransferCounters) GetObjectsCopiedToSink() int64 { + if m != nil { + return m.ObjectsCopiedToSink + } + return 0 +} + +func (m *TransferCounters) GetBytesCopiedToSink() int64 { + if m != nil { + return m.BytesCopiedToSink + } + return 0 +} + +func (m *TransferCounters) GetObjectsDeletedFromSource() int64 { + if m != nil { + return m.ObjectsDeletedFromSource + } + return 0 +} + +func (m *TransferCounters) GetBytesDeletedFromSource() int64 { + if m != nil { + return m.BytesDeletedFromSource + } + return 0 +} + +func (m *TransferCounters) GetObjectsDeletedFromSink() int64 { + if m != nil { + return m.ObjectsDeletedFromSink + } + return 0 +} + +func (m *TransferCounters) GetBytesDeletedFromSink() int64 { + if m != nil { + return m.BytesDeletedFromSink + } + return 0 +} + +func (m *TransferCounters) GetObjectsFromSourceFailed() int64 { + if m != nil { + return m.ObjectsFromSourceFailed + } + return 0 +} + +func (m *TransferCounters) GetBytesFromSourceFailed() int64 { + if m != nil { + return m.BytesFromSourceFailed + } + return 0 +} + +func (m *TransferCounters) GetObjectsFailedToDeleteFromSink() int64 { + if m != nil { + return m.ObjectsFailedToDeleteFromSink + } + return 0 +} + +func (m *TransferCounters) GetBytesFailedToDeleteFromSink() int64 { + if m != nil { + return m.BytesFailedToDeleteFromSink + } + return 0 +} + +// A description of the execution of a transfer. +type TransferOperation struct { + // A globally unique ID assigned by the system. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The ID of the Google Cloud Platform Console project that owns the operation. + // Required. + ProjectId string `protobuf:"bytes,2,opt,name=project_id,json=projectId" json:"project_id,omitempty"` + // Transfer specification. + // Required. + TransferSpec *TransferSpec `protobuf:"bytes,3,opt,name=transfer_spec,json=transferSpec" json:"transfer_spec,omitempty"` + // Start time of this transfer execution. + StartTime *google_protobuf4.Timestamp `protobuf:"bytes,4,opt,name=start_time,json=startTime" json:"start_time,omitempty"` + // End time of this transfer execution. + EndTime *google_protobuf4.Timestamp `protobuf:"bytes,5,opt,name=end_time,json=endTime" json:"end_time,omitempty"` + // Status of the transfer operation. + Status TransferOperation_Status `protobuf:"varint,6,opt,name=status,enum=google.storagetransfer.v1.TransferOperation_Status" json:"status,omitempty"` + // Information about the progress of the transfer operation. + Counters *TransferCounters `protobuf:"bytes,7,opt,name=counters" json:"counters,omitempty"` + // Summarizes errors encountered with sample error log entries. + ErrorBreakdowns []*ErrorSummary `protobuf:"bytes,8,rep,name=error_breakdowns,json=errorBreakdowns" json:"error_breakdowns,omitempty"` + // The name of the transfer job that triggers this transfer operation. + TransferJobName string `protobuf:"bytes,9,opt,name=transfer_job_name,json=transferJobName" json:"transfer_job_name,omitempty"` +} + +func (m *TransferOperation) Reset() { *m = TransferOperation{} } +func (m *TransferOperation) String() string { return proto.CompactTextString(m) } +func (*TransferOperation) ProtoMessage() {} +func (*TransferOperation) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{13} } + +func (m *TransferOperation) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *TransferOperation) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *TransferOperation) GetTransferSpec() *TransferSpec { + if m != nil { + return m.TransferSpec + } + return nil +} + +func (m *TransferOperation) GetStartTime() *google_protobuf4.Timestamp { + if m != nil { + return m.StartTime + } + return nil +} + +func (m *TransferOperation) GetEndTime() *google_protobuf4.Timestamp { + if m != nil { + return m.EndTime + } + return nil +} + +func (m *TransferOperation) GetStatus() TransferOperation_Status { + if m != nil { + return m.Status + } + return TransferOperation_STATUS_UNSPECIFIED +} + +func (m *TransferOperation) GetCounters() *TransferCounters { + if m != nil { + return m.Counters + } + return nil +} + +func (m *TransferOperation) GetErrorBreakdowns() []*ErrorSummary { + if m != nil { + return m.ErrorBreakdowns + } + return nil +} + +func (m *TransferOperation) GetTransferJobName() string { + if m != nil { + return m.TransferJobName + } + return "" +} + +func init() { + proto.RegisterType((*GoogleServiceAccount)(nil), "google.storagetransfer.v1.GoogleServiceAccount") + proto.RegisterType((*AwsAccessKey)(nil), "google.storagetransfer.v1.AwsAccessKey") + proto.RegisterType((*ObjectConditions)(nil), "google.storagetransfer.v1.ObjectConditions") + proto.RegisterType((*GcsData)(nil), "google.storagetransfer.v1.GcsData") + proto.RegisterType((*AwsS3Data)(nil), "google.storagetransfer.v1.AwsS3Data") + proto.RegisterType((*HttpData)(nil), "google.storagetransfer.v1.HttpData") + proto.RegisterType((*TransferOptions)(nil), "google.storagetransfer.v1.TransferOptions") + proto.RegisterType((*TransferSpec)(nil), "google.storagetransfer.v1.TransferSpec") + proto.RegisterType((*Schedule)(nil), "google.storagetransfer.v1.Schedule") + proto.RegisterType((*TransferJob)(nil), "google.storagetransfer.v1.TransferJob") + proto.RegisterType((*ErrorLogEntry)(nil), "google.storagetransfer.v1.ErrorLogEntry") + proto.RegisterType((*ErrorSummary)(nil), "google.storagetransfer.v1.ErrorSummary") + proto.RegisterType((*TransferCounters)(nil), "google.storagetransfer.v1.TransferCounters") + proto.RegisterType((*TransferOperation)(nil), "google.storagetransfer.v1.TransferOperation") + proto.RegisterEnum("google.storagetransfer.v1.TransferJob_Status", TransferJob_Status_name, TransferJob_Status_value) + proto.RegisterEnum("google.storagetransfer.v1.TransferOperation_Status", TransferOperation_Status_name, TransferOperation_Status_value) +} + +func init() { proto.RegisterFile("google/storagetransfer/v1/transfer_types.proto", fileDescriptor1) } + +var fileDescriptor1 = []byte{ + // 1767 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x58, 0xdd, 0x6e, 0xdb, 0xc8, + 0x15, 0x8e, 0x24, 0xc7, 0x96, 0x8e, 0x24, 0x4b, 0x9e, 0xcd, 0x7a, 0x65, 0x27, 0xd9, 0xa4, 0xf4, + 0x2e, 0x92, 0xcd, 0xa2, 0x12, 0x62, 0x63, 0x51, 0xa4, 0xc1, 0x36, 0x95, 0x2d, 0xd9, 0xd6, 0xc6, + 0x1b, 0x1b, 0xa4, 0xbc, 0xfd, 0x41, 0x50, 0x62, 0x44, 0x8e, 0x14, 0xae, 0x29, 0x0e, 0xcb, 0x19, + 0xc5, 0x16, 0x7a, 0xd5, 0xab, 0x3e, 0x43, 0x5f, 0xa1, 0x0f, 0xd0, 0x37, 0xe8, 0x4d, 0x51, 0xa0, + 0x77, 0x7d, 0x8e, 0x5e, 0xf6, 0xb2, 0x98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x3a, 0x71, + 0x9b, 0x96, 0x42, 0xc4, 0x01, 0x9b, 0x3f, 0xbc, 0xfc, 0x67, 0x8c, 0x78, 0x2f, 0x11, 0xef, 0x33, + 0x88, 0xf7, 0x3f, 0xbc, 0x1c, 0xac, 0xca, 0xd8, 0x7b, 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff, 0x0c, + 0xec, 0x5b, 0x90, 0x4b, 0x12, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/streetview/publish/v1/resources.pb.go b/vendor/google.golang.org/genproto/googleapis/streetview/publish/v1/resources.pb.go new file mode 100644 index 0000000000..a92e9eacf5 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/streetview/publish/v1/resources.pb.go @@ -0,0 +1,398 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/streetview/publish/v1/resources.proto + +/* +Package publish is a generated protocol buffer package. + +It is generated from these files: + google/streetview/publish/v1/resources.proto + google/streetview/publish/v1/rpcmessages.proto + google/streetview/publish/v1/streetview_publish.proto + +It has these top-level messages: + UploadRef + PhotoId + Level + Pose + Place + Connection + Photo + CreatePhotoRequest + GetPhotoRequest + BatchGetPhotosRequest + BatchGetPhotosResponse + PhotoResponse + ListPhotosRequest + ListPhotosResponse + UpdatePhotoRequest + BatchUpdatePhotosRequest + BatchUpdatePhotosResponse + DeletePhotoRequest + BatchDeletePhotosRequest + BatchDeletePhotosResponse +*/ +package publish + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf1 "github.com/golang/protobuf/ptypes/timestamp" +import google_type "google.golang.org/genproto/googleapis/type/latlng" + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Upload reference for media files. +type UploadRef struct { + // Required. An upload reference should be unique for each user. It follows + // the form: + // "https://streetviewpublish.googleapis.com/media/user//photo/" + UploadUrl string `protobuf:"bytes,1,opt,name=upload_url,json=uploadUrl" json:"upload_url,omitempty"` +} + +func (m *UploadRef) Reset() { *m = UploadRef{} } +func (m *UploadRef) String() string { return proto.CompactTextString(m) } +func (*UploadRef) ProtoMessage() {} +func (*UploadRef) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *UploadRef) GetUploadUrl() string { + if m != nil { + return m.UploadUrl + } + return "" +} + +// Identifier for a photo. +type PhotoId struct { + // Required. A base64 encoded identifier. + Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` +} + +func (m *PhotoId) Reset() { *m = PhotoId{} } +func (m *PhotoId) String() string { return proto.CompactTextString(m) } +func (*PhotoId) ProtoMessage() {} +func (*PhotoId) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *PhotoId) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +// Level information containing level number and its corresponding name. +type Level struct { + // Floor number, used for ordering. 0 indicates the ground level, 1 indicates + // the first level above ground level, -1 indicates the first level under + // ground level. Non-integer values are OK. + Number float64 `protobuf:"fixed64,1,opt,name=number" json:"number,omitempty"` + // Required. A name assigned to this Level, restricted to 3 characters. + // Consider how the elevator buttons would be labeled for this level if there + // was an elevator. + Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` +} + +func (m *Level) Reset() { *m = Level{} } +func (m *Level) String() string { return proto.CompactTextString(m) } +func (*Level) ProtoMessage() {} +func (*Level) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *Level) GetNumber() float64 { + if m != nil { + return m.Number + } + return 0 +} + +func (m *Level) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Raw pose measurement for an entity. +type Pose struct { + // Latitude and longitude pair of the pose, as explained here: + // https://cloud.google.com/datastore/docs/reference/rest/Shared.Types/LatLng + // When creating a photo, if the latitude and longitude pair are not provided + // here, the geolocation from the exif header will be used. + // If the latitude and longitude pair is not provided and cannot be found in + // the exif header, the create photo process will fail. + LatLngPair *google_type.LatLng `protobuf:"bytes,1,opt,name=lat_lng_pair,json=latLngPair" json:"lat_lng_pair,omitempty"` + // Altitude of the pose in meters above ground level (as defined by WGS84). + // NaN indicates an unmeasured quantity. + Altitude float64 `protobuf:"fixed64,2,opt,name=altitude" json:"altitude,omitempty"` + // Compass heading, measured at the center of the photo in degrees clockwise + // from North. Value must be >=0 and <360. + // NaN indicates an unmeasured quantity. + Heading float64 `protobuf:"fixed64,3,opt,name=heading" json:"heading,omitempty"` + // Pitch, measured at the center of the photo in degrees. Value must be >=-90 + // and <= 90. A value of -90 means looking directly down, and a value of 90 + // means looking directly up. + // NaN indicates an unmeasured quantity. + Pitch float64 `protobuf:"fixed64,4,opt,name=pitch" json:"pitch,omitempty"` + // Roll, measured in degrees. Value must be >= 0 and <360. A value of 0 + // means level with the horizon. + // NaN indicates an unmeasured quantity. + Roll float64 `protobuf:"fixed64,5,opt,name=roll" json:"roll,omitempty"` + // Level (the floor in a building) used to configure vertical navigation. + Level *Level `protobuf:"bytes,7,opt,name=level" json:"level,omitempty"` +} + +func (m *Pose) Reset() { *m = Pose{} } +func (m *Pose) String() string { return proto.CompactTextString(m) } +func (*Pose) ProtoMessage() {} +func (*Pose) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *Pose) GetLatLngPair() *google_type.LatLng { + if m != nil { + return m.LatLngPair + } + return nil +} + +func (m *Pose) GetAltitude() float64 { + if m != nil { + return m.Altitude + } + return 0 +} + +func (m *Pose) GetHeading() float64 { + if m != nil { + return m.Heading + } + return 0 +} + +func (m *Pose) GetPitch() float64 { + if m != nil { + return m.Pitch + } + return 0 +} + +func (m *Pose) GetRoll() float64 { + if m != nil { + return m.Roll + } + return 0 +} + +func (m *Pose) GetLevel() *Level { + if m != nil { + return m.Level + } + return nil +} + +// Place metadata for an entity. +type Place struct { + // Required. Place identifier, as described in + // https://developers.google.com/places/place-id. + PlaceId string `protobuf:"bytes,1,opt,name=place_id,json=placeId" json:"place_id,omitempty"` +} + +func (m *Place) Reset() { *m = Place{} } +func (m *Place) String() string { return proto.CompactTextString(m) } +func (*Place) ProtoMessage() {} +func (*Place) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *Place) GetPlaceId() string { + if m != nil { + return m.PlaceId + } + return "" +} + +// A connection is the link from a source photo to a destination photo. +type Connection struct { + // Required. The destination of the connection from the containing photo to + // another photo. + Target *PhotoId `protobuf:"bytes,1,opt,name=target" json:"target,omitempty"` +} + +func (m *Connection) Reset() { *m = Connection{} } +func (m *Connection) String() string { return proto.CompactTextString(m) } +func (*Connection) ProtoMessage() {} +func (*Connection) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *Connection) GetTarget() *PhotoId { + if m != nil { + return m.Target + } + return nil +} + +// Photo is used to store 360 photos along with photo metadata. +type Photo struct { + // Output only. Identifier for the photo, which is unique among all photos in + // Google. + PhotoId *PhotoId `protobuf:"bytes,1,opt,name=photo_id,json=photoId" json:"photo_id,omitempty"` + // Required (when creating photo). Input only. The resource URL where the + // photo bytes are uploaded to. + UploadReference *UploadRef `protobuf:"bytes,2,opt,name=upload_reference,json=uploadReference" json:"upload_reference,omitempty"` + // Output only. The download URL for the photo bytes. This field is set only + // when the `view` parameter in a `GetPhotoRequest` is set to + // `INCLUDE_DOWNLOAD_URL`. + DownloadUrl string `protobuf:"bytes,3,opt,name=download_url,json=downloadUrl" json:"download_url,omitempty"` + // Output only. The thumbnail URL for showing a preview of the given photo. + ThumbnailUrl string `protobuf:"bytes,9,opt,name=thumbnail_url,json=thumbnailUrl" json:"thumbnail_url,omitempty"` + // Output only. The share link for the photo. + ShareLink string `protobuf:"bytes,11,opt,name=share_link,json=shareLink" json:"share_link,omitempty"` + // Pose of the photo. + Pose *Pose `protobuf:"bytes,4,opt,name=pose" json:"pose,omitempty"` + // Connections to other photos. A connection represents the link from this + // photo to another photo. + Connections []*Connection `protobuf:"bytes,5,rep,name=connections" json:"connections,omitempty"` + // Absolute time when the photo was captured. + // When the photo has no exif timestamp, this is used to set a timestamp in + // the photo metadata. + CaptureTime *google_protobuf1.Timestamp `protobuf:"bytes,6,opt,name=capture_time,json=captureTime" json:"capture_time,omitempty"` + // Places where this photo belongs. + Places []*Place `protobuf:"bytes,7,rep,name=places" json:"places,omitempty"` + // Output only. View count of the photo. + ViewCount int64 `protobuf:"varint,10,opt,name=view_count,json=viewCount" json:"view_count,omitempty"` +} + +func (m *Photo) Reset() { *m = Photo{} } +func (m *Photo) String() string { return proto.CompactTextString(m) } +func (*Photo) ProtoMessage() {} +func (*Photo) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *Photo) GetPhotoId() *PhotoId { + if m != nil { + return m.PhotoId + } + return nil +} + +func (m *Photo) GetUploadReference() *UploadRef { + if m != nil { + return m.UploadReference + } + return nil +} + +func (m *Photo) GetDownloadUrl() string { + if m != nil { + return m.DownloadUrl + } + return "" +} + +func (m *Photo) GetThumbnailUrl() string { + if m != nil { + return m.ThumbnailUrl + } + return "" +} + +func (m *Photo) GetShareLink() string { + if m != nil { + return m.ShareLink + } + return "" +} + +func (m *Photo) GetPose() *Pose { + if m != nil { + return m.Pose + } + return nil +} + +func (m *Photo) GetConnections() []*Connection { + if m != nil { + return m.Connections + } + return nil +} + +func (m *Photo) GetCaptureTime() *google_protobuf1.Timestamp { + if m != nil { + return m.CaptureTime + } + return nil +} + +func (m *Photo) GetPlaces() []*Place { + if m != nil { + return m.Places + } + return nil +} + +func (m *Photo) GetViewCount() int64 { + if m != nil { + return m.ViewCount + } + return 0 +} + +func init() { + proto.RegisterType((*UploadRef)(nil), "google.streetview.publish.v1.UploadRef") + proto.RegisterType((*PhotoId)(nil), "google.streetview.publish.v1.PhotoId") + proto.RegisterType((*Level)(nil), "google.streetview.publish.v1.Level") + proto.RegisterType((*Pose)(nil), "google.streetview.publish.v1.Pose") + proto.RegisterType((*Place)(nil), "google.streetview.publish.v1.Place") + proto.RegisterType((*Connection)(nil), "google.streetview.publish.v1.Connection") + proto.RegisterType((*Photo)(nil), "google.streetview.publish.v1.Photo") +} + +func init() { proto.RegisterFile("google/streetview/publish/v1/resources.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 651 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xdb, 0x6a, 0xdb, 0x4c, + 0x10, 0xc6, 0xf1, 0x29, 0x1e, 0xf9, 0x3f, 0xb0, 0xff, 0x4f, 0x51, 0x4c, 0x43, 0x53, 0x85, 0x52, + 0x53, 0x8a, 0x44, 0x1c, 0x5a, 0x28, 0x21, 0x50, 0x92, 0xab, 0xb4, 0xbe, 0x30, 0xdb, 0xa6, 0x17, + 0xbd, 0x11, 0x6b, 0x69, 0x22, 0x2f, 0x59, 0xef, 0x2e, 0xab, 0x95, 0x43, 0x9f, 0xa1, 0x8f, 0xd1, + 0x97, 0xea, 0xe3, 0x14, 0xad, 0x56, 0x4e, 0x2f, 0x82, 0xd3, 0x2b, 0xcf, 0x7c, 0xf3, 0x7d, 0xe3, + 0x39, 0xad, 0xe0, 0x75, 0xa1, 0x54, 0x21, 0x30, 0x29, 0xad, 0x41, 0xb4, 0x1b, 0x8e, 0x77, 0x89, + 0xae, 0x96, 0x82, 0x97, 0xab, 0x64, 0x73, 0x92, 0x18, 0x2c, 0x55, 0x65, 0x32, 0x2c, 0x63, 0x6d, + 0x94, 0x55, 0xe4, 0x69, 0xc3, 0x8e, 0xef, 0xd9, 0xb1, 0x67, 0xc7, 0x9b, 0x93, 0x89, 0x8f, 0x26, + 0x4c, 0xf3, 0x84, 0x49, 0xa9, 0x2c, 0xb3, 0x5c, 0x49, 0xaf, 0x9d, 0x3c, 0xf3, 0x51, 0xe7, 0x2d, + 0xab, 0x9b, 0xc4, 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0xd1, 0xdf, 0xc5, 0xe4, 0x1c, 0xc6, 0x19, 0xd3, 0xb6, 0x32, 0x98, 0xd6, 0xef, 0x30, 0x1c, + 0xb8, 0x5a, 0x26, 0x6d, 0xb2, 0xf6, 0x91, 0xc6, 0x9f, 0xdb, 0x47, 0x4a, 0x03, 0xcf, 0xaf, 0x11, + 0x72, 0x06, 0x03, 0x77, 0x21, 0x65, 0x38, 0x74, 0x55, 0x3c, 0x72, 0x76, 0xee, 0xcc, 0xa8, 0x97, + 0xd4, 0xe3, 0xa9, 0x09, 0x69, 0xa6, 0x2a, 0x69, 0x43, 0x38, 0xea, 0x4c, 0xbb, 0x74, 0x54, 0x23, + 0x97, 0x35, 0x70, 0xf1, 0xbd, 0x03, 0xd3, 0x4c, 0xad, 0xdb, 0x8c, 0x05, 0xaa, 0xb8, 0x2a, 0xb2, + 0x87, 0x33, 0x5f, 0x4c, 0x3e, 0x39, 0xf8, 0x0b, 0xc7, 0xbb, 0x45, 0x83, 0xd2, 0xf6, 0x9b, 0xf5, + 0xf5, 0xb2, 0xcd, 0xa0, 0x04, 0x93, 0x45, 0xac, 0x4c, 0x91, 0x14, 0x28, 0x5d, 0x6b, 0x49, 0x13, + 0x62, 0x9a, 0x97, 0x0f, 0x7f, 0xfa, 0xce, 0xbc, 0xb9, 0x1c, 0x38, 0xfe, 0xe9, 0xaf, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xad, 0x4e, 0x7a, 0x51, 0x29, 0x05, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/streetview/publish/v1/rpcmessages.pb.go b/vendor/google.golang.org/genproto/googleapis/streetview/publish/v1/rpcmessages.pb.go new file mode 100644 index 0000000000..4a96824f5c --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/streetview/publish/v1/rpcmessages.pb.go @@ -0,0 +1,470 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/streetview/publish/v1/rpcmessages.proto + +package publish + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import google_protobuf2 "google.golang.org/genproto/protobuf/field_mask" +import google_rpc "google.golang.org/genproto/googleapis/rpc/status" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Specifies which view of the `Photo` should be included in the response. +type PhotoView int32 + +const ( + // Server reponses do not include the download URL for the photo bytes. + // The default value. + PhotoView_BASIC PhotoView = 0 + // Server responses include the download URL for the photo bytes. + PhotoView_INCLUDE_DOWNLOAD_URL PhotoView = 1 +) + +var PhotoView_name = map[int32]string{ + 0: "BASIC", + 1: "INCLUDE_DOWNLOAD_URL", +} +var PhotoView_value = map[string]int32{ + "BASIC": 0, + "INCLUDE_DOWNLOAD_URL": 1, +} + +func (x PhotoView) String() string { + return proto.EnumName(PhotoView_name, int32(x)) +} +func (PhotoView) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +// Request to create a photo. +type CreatePhotoRequest struct { + // Required. Photo to create. + Photo *Photo `protobuf:"bytes,1,opt,name=photo" json:"photo,omitempty"` +} + +func (m *CreatePhotoRequest) Reset() { *m = CreatePhotoRequest{} } +func (m *CreatePhotoRequest) String() string { return proto.CompactTextString(m) } +func (*CreatePhotoRequest) ProtoMessage() {} +func (*CreatePhotoRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +func (m *CreatePhotoRequest) GetPhoto() *Photo { + if m != nil { + return m.Photo + } + return nil +} + +// Request to get a photo. +// +// By default +// - does not return the download URL for the photo bytes. +// +// Parameters: +// - 'view' controls if the download URL for the photo bytes will be returned. +type GetPhotoRequest struct { + // Required. ID of the photo. + PhotoId string `protobuf:"bytes,1,opt,name=photo_id,json=photoId" json:"photo_id,omitempty"` + // Specifies if a download URL for the photo bytes should be returned in the + // Photo response. + View PhotoView `protobuf:"varint,2,opt,name=view,enum=google.streetview.publish.v1.PhotoView" json:"view,omitempty"` +} + +func (m *GetPhotoRequest) Reset() { *m = GetPhotoRequest{} } +func (m *GetPhotoRequest) String() string { return proto.CompactTextString(m) } +func (*GetPhotoRequest) ProtoMessage() {} +func (*GetPhotoRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} } + +func (m *GetPhotoRequest) GetPhotoId() string { + if m != nil { + return m.PhotoId + } + return "" +} + +func (m *GetPhotoRequest) GetView() PhotoView { + if m != nil { + return m.View + } + return PhotoView_BASIC +} + +// Request to get one or more photos. +// By default +// - does not return the download URL for the photo bytes. +// +// Parameters: +// - 'view' controls if the download URL for the photo bytes will be returned. +type BatchGetPhotosRequest struct { + // Required. IDs of the photos. + PhotoIds []string `protobuf:"bytes,1,rep,name=photo_ids,json=photoIds" json:"photo_ids,omitempty"` + // Specifies if a download URL for the photo bytes should be returned in the + // Photo response. + View PhotoView `protobuf:"varint,2,opt,name=view,enum=google.streetview.publish.v1.PhotoView" json:"view,omitempty"` +} + +func (m *BatchGetPhotosRequest) Reset() { *m = BatchGetPhotosRequest{} } +func (m *BatchGetPhotosRequest) String() string { return proto.CompactTextString(m) } +func (*BatchGetPhotosRequest) ProtoMessage() {} +func (*BatchGetPhotosRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} } + +func (m *BatchGetPhotosRequest) GetPhotoIds() []string { + if m != nil { + return m.PhotoIds + } + return nil +} + +func (m *BatchGetPhotosRequest) GetView() PhotoView { + if m != nil { + return m.View + } + return PhotoView_BASIC +} + +// Response to batch get of photos. +type BatchGetPhotosResponse struct { + // List of results for each individual photo requested, in the same order as + // the request. + Results []*PhotoResponse `protobuf:"bytes,1,rep,name=results" json:"results,omitempty"` +} + +func (m *BatchGetPhotosResponse) Reset() { *m = BatchGetPhotosResponse{} } +func (m *BatchGetPhotosResponse) String() string { return proto.CompactTextString(m) } +func (*BatchGetPhotosResponse) ProtoMessage() {} +func (*BatchGetPhotosResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{3} } + +func (m *BatchGetPhotosResponse) GetResults() []*PhotoResponse { + if m != nil { + return m.Results + } + return nil +} + +// Response payload for a single `Photo` in batch operations including +// `BatchGetPhotosRequest` and `BatchUpdatePhotosRequest`. +type PhotoResponse struct { + // The status for the operation to get or update a single photo in the batch + // request. + Status *google_rpc.Status `protobuf:"bytes,1,opt,name=status" json:"status,omitempty"` + // The photo resource, if the request was successful. + Photo *Photo `protobuf:"bytes,2,opt,name=photo" json:"photo,omitempty"` +} + +func (m *PhotoResponse) Reset() { *m = PhotoResponse{} } +func (m *PhotoResponse) String() string { return proto.CompactTextString(m) } +func (*PhotoResponse) ProtoMessage() {} +func (*PhotoResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{4} } + +func (m *PhotoResponse) GetStatus() *google_rpc.Status { + if m != nil { + return m.Status + } + return nil +} + +func (m *PhotoResponse) GetPhoto() *Photo { + if m != nil { + return m.Photo + } + return nil +} + +// Request to list all photos that belong to the user sending the request. +// +// By default +// - does not return the download URL for the photo bytes. +// +// Parameters: +// - 'view' controls if the download URL for the photo bytes will be returned. +// - 'page_size' determines the maximum number of photos to return. +// - 'page_token' is the next page token value returned from a previous List +// request, if any. +type ListPhotosRequest struct { + // Specifies if a download URL for the photos bytes should be returned in the + // Photos response. + View PhotoView `protobuf:"varint,1,opt,name=view,enum=google.streetview.publish.v1.PhotoView" json:"view,omitempty"` + // The maximum number of photos to return. + // `page_size` must be non-negative. If `page_size` is zero or is not + // provided, the default page size of 100 will be used. + // The number of photos returned in the response may be less than `page_size` + // if the number of photos that belong to the user is less than `page_size`. + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` + // The next_page_token value returned from a previous List request, if any. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` + // The filter expression. + // Example: `placeId=ChIJj61dQgK6j4AR4GeTYWZsKWw` + Filter string `protobuf:"bytes,4,opt,name=filter" json:"filter,omitempty"` +} + +func (m *ListPhotosRequest) Reset() { *m = ListPhotosRequest{} } +func (m *ListPhotosRequest) String() string { return proto.CompactTextString(m) } +func (*ListPhotosRequest) ProtoMessage() {} +func (*ListPhotosRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{5} } + +func (m *ListPhotosRequest) GetView() PhotoView { + if m != nil { + return m.View + } + return PhotoView_BASIC +} + +func (m *ListPhotosRequest) GetPageSize() int32 { + if m != nil { + return m.PageSize + } + return 0 +} + +func (m *ListPhotosRequest) GetPageToken() string { + if m != nil { + return m.PageToken + } + return "" +} + +func (m *ListPhotosRequest) GetFilter() string { + if m != nil { + return m.Filter + } + return "" +} + +// Response to list all photos that belong to a user. +type ListPhotosResponse struct { + // List of photos. There will be a maximum number of items returned based on + // the page_size field in the request. + Photos []*Photo `protobuf:"bytes,1,rep,name=photos" json:"photos,omitempty"` + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` +} + +func (m *ListPhotosResponse) Reset() { *m = ListPhotosResponse{} } +func (m *ListPhotosResponse) String() string { return proto.CompactTextString(m) } +func (*ListPhotosResponse) ProtoMessage() {} +func (*ListPhotosResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{6} } + +func (m *ListPhotosResponse) GetPhotos() []*Photo { + if m != nil { + return m.Photos + } + return nil +} + +func (m *ListPhotosResponse) GetNextPageToken() string { + if m != nil { + return m.NextPageToken + } + return "" +} + +// Request to update the metadata of a photo. +// Updating the pixels of a photo is not supported. +type UpdatePhotoRequest struct { + // Required. Photo object containing the new metadata. Only the fields + // specified in `update_mask` are used. If `update_mask` is not present, the + // update applies to all fields. + // **Note:** To update `pose.altitude`, `pose.latlngpair` has to be filled as + // well. Otherwise, the request will fail. + Photo *Photo `protobuf:"bytes,1,opt,name=photo" json:"photo,omitempty"` + // Mask that identifies fields on the photo metadata to update. + // If not present, the old Photo metadata will be entirely replaced with the + // new Photo metadata in this request. The update fails if invalid fields are + // specified. Multiple fields can be specified in a comma-delimited list. + // + // The following fields are valid: + // + // * `pose.heading` + // * `pose.latlngpair` + // * `pose.pitch` + // * `pose.roll` + // * `pose.level` + // * `pose.altitude` + // * `connections` + // * `places` + // + // + // **Note:** Repeated fields in `update_mask` mean the entire set of repeated + // values will be replaced with the new contents. For example, if + // `UpdatePhotoRequest.photo.update_mask` contains `connections` and + // `UpdatePhotoRequest.photo.connections` is empty, all connections will be + // removed. + UpdateMask *google_protobuf2.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask" json:"update_mask,omitempty"` +} + +func (m *UpdatePhotoRequest) Reset() { *m = UpdatePhotoRequest{} } +func (m *UpdatePhotoRequest) String() string { return proto.CompactTextString(m) } +func (*UpdatePhotoRequest) ProtoMessage() {} +func (*UpdatePhotoRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{7} } + +func (m *UpdatePhotoRequest) GetPhoto() *Photo { + if m != nil { + return m.Photo + } + return nil +} + +func (m *UpdatePhotoRequest) GetUpdateMask() *google_protobuf2.FieldMask { + if m != nil { + return m.UpdateMask + } + return nil +} + +// Request to update the metadata of photos. +// Updating the pixels of photos is not supported. +type BatchUpdatePhotosRequest struct { + // Required. List of update photo requests. + UpdatePhotoRequests []*UpdatePhotoRequest `protobuf:"bytes,1,rep,name=update_photo_requests,json=updatePhotoRequests" json:"update_photo_requests,omitempty"` +} + +func (m *BatchUpdatePhotosRequest) Reset() { *m = BatchUpdatePhotosRequest{} } +func (m *BatchUpdatePhotosRequest) String() string { return proto.CompactTextString(m) } +func (*BatchUpdatePhotosRequest) ProtoMessage() {} +func (*BatchUpdatePhotosRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{8} } + +func (m *BatchUpdatePhotosRequest) GetUpdatePhotoRequests() []*UpdatePhotoRequest { + if m != nil { + return m.UpdatePhotoRequests + } + return nil +} + +// Response to batch update of metadata of one or more photos. +type BatchUpdatePhotosResponse struct { + // List of results for each individual photo updated, in the same order as + // the request. + Results []*PhotoResponse `protobuf:"bytes,1,rep,name=results" json:"results,omitempty"` +} + +func (m *BatchUpdatePhotosResponse) Reset() { *m = BatchUpdatePhotosResponse{} } +func (m *BatchUpdatePhotosResponse) String() string { return proto.CompactTextString(m) } +func (*BatchUpdatePhotosResponse) ProtoMessage() {} +func (*BatchUpdatePhotosResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{9} } + +func (m *BatchUpdatePhotosResponse) GetResults() []*PhotoResponse { + if m != nil { + return m.Results + } + return nil +} + +// Request to delete a photo. +type DeletePhotoRequest struct { + // Required. ID of the photo. + PhotoId string `protobuf:"bytes,1,opt,name=photo_id,json=photoId" json:"photo_id,omitempty"` +} + +func (m *DeletePhotoRequest) Reset() { *m = DeletePhotoRequest{} } +func (m *DeletePhotoRequest) String() string { return proto.CompactTextString(m) } +func (*DeletePhotoRequest) ProtoMessage() {} +func (*DeletePhotoRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{10} } + +func (m *DeletePhotoRequest) GetPhotoId() string { + if m != nil { + return m.PhotoId + } + return "" +} + +// Request to delete multiple photos. +type BatchDeletePhotosRequest struct { + // Required. List of delete photo requests. + PhotoIds []string `protobuf:"bytes,1,rep,name=photo_ids,json=photoIds" json:"photo_ids,omitempty"` +} + +func (m *BatchDeletePhotosRequest) Reset() { *m = BatchDeletePhotosRequest{} } +func (m *BatchDeletePhotosRequest) String() string { return proto.CompactTextString(m) } +func (*BatchDeletePhotosRequest) ProtoMessage() {} +func (*BatchDeletePhotosRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{11} } + +func (m *BatchDeletePhotosRequest) GetPhotoIds() []string { + if m != nil { + return m.PhotoIds + } + return nil +} + +// Response to batch delete of one or more photos. +type BatchDeletePhotosResponse struct { + // The status for the operation to delete a single photo in the batch request. + Status []*google_rpc.Status `protobuf:"bytes,1,rep,name=status" json:"status,omitempty"` +} + +func (m *BatchDeletePhotosResponse) Reset() { *m = BatchDeletePhotosResponse{} } +func (m *BatchDeletePhotosResponse) String() string { return proto.CompactTextString(m) } +func (*BatchDeletePhotosResponse) ProtoMessage() {} +func (*BatchDeletePhotosResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{12} } + +func (m *BatchDeletePhotosResponse) GetStatus() []*google_rpc.Status { + if m != nil { + return m.Status + } + return nil +} + +func init() { + proto.RegisterType((*CreatePhotoRequest)(nil), "google.streetview.publish.v1.CreatePhotoRequest") + proto.RegisterType((*GetPhotoRequest)(nil), "google.streetview.publish.v1.GetPhotoRequest") + proto.RegisterType((*BatchGetPhotosRequest)(nil), "google.streetview.publish.v1.BatchGetPhotosRequest") + proto.RegisterType((*BatchGetPhotosResponse)(nil), "google.streetview.publish.v1.BatchGetPhotosResponse") + proto.RegisterType((*PhotoResponse)(nil), "google.streetview.publish.v1.PhotoResponse") + proto.RegisterType((*ListPhotosRequest)(nil), "google.streetview.publish.v1.ListPhotosRequest") + proto.RegisterType((*ListPhotosResponse)(nil), "google.streetview.publish.v1.ListPhotosResponse") + proto.RegisterType((*UpdatePhotoRequest)(nil), "google.streetview.publish.v1.UpdatePhotoRequest") + proto.RegisterType((*BatchUpdatePhotosRequest)(nil), "google.streetview.publish.v1.BatchUpdatePhotosRequest") + proto.RegisterType((*BatchUpdatePhotosResponse)(nil), "google.streetview.publish.v1.BatchUpdatePhotosResponse") + proto.RegisterType((*DeletePhotoRequest)(nil), "google.streetview.publish.v1.DeletePhotoRequest") + proto.RegisterType((*BatchDeletePhotosRequest)(nil), "google.streetview.publish.v1.BatchDeletePhotosRequest") + proto.RegisterType((*BatchDeletePhotosResponse)(nil), "google.streetview.publish.v1.BatchDeletePhotosResponse") + proto.RegisterEnum("google.streetview.publish.v1.PhotoView", PhotoView_name, PhotoView_value) +} + +func init() { proto.RegisterFile("google/streetview/publish/v1/rpcmessages.proto", fileDescriptor1) } + +var fileDescriptor1 = []byte{ + // 639 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xcb, 0x6e, 0xd3, 0x40, + 0x14, 0xc5, 0x7d, 0xa4, 0xcd, 0xad, 0x4a, 0xcb, 0x40, 0x8b, 0x1b, 0x8a, 0x14, 0x19, 0x09, 0xa2, + 0x82, 0xec, 0xb6, 0x2c, 0x10, 0xca, 0xaa, 0x49, 0x4a, 0x55, 0x29, 0x7d, 0xc8, 0xa1, 0x20, 0xb1, + 0xb1, 0x1c, 0xe7, 0xc6, 0xb1, 0xe2, 0x64, 0x5c, 0xcf, 0x38, 0x85, 0xae, 0xf8, 0x00, 0xf8, 0x0b, + 0x3e, 0x14, 0x79, 0x3c, 0xd3, 0x26, 0x69, 0x88, 0x02, 0x74, 0x67, 0xdf, 0xc7, 0xb9, 0x67, 0xce, + 0x9d, 0x63, 0x83, 0xe9, 0x53, 0xea, 0x87, 0x68, 0x31, 0x1e, 0x23, 0xf2, 0x41, 0x80, 0x57, 0x56, + 0x94, 0x34, 0xc3, 0x80, 0x75, 0xac, 0xc1, 0x9e, 0x15, 0x47, 0x5e, 0x0f, 0x19, 0x73, 0x7d, 0x64, + 0x66, 0x14, 0x53, 0x4e, 0xc9, 0x76, 0x56, 0x6f, 0xde, 0xd6, 0x9b, 0xb2, 0xde, 0x1c, 0xec, 0x15, + 0x8a, 0x12, 0x4d, 0xd4, 0x36, 0x93, 0xb6, 0xd5, 0x0e, 0x30, 0x6c, 0x39, 0x3d, 0x97, 0x75, 0xb3, + 0xfe, 0xc2, 0x53, 0x59, 0x11, 0x47, 0x9e, 0xc5, 0xb8, 0xcb, 0x13, 0x09, 0x5c, 0x78, 0x33, 0x9d, + 0x08, 0x32, 0x9a, 0xc4, 0x9e, 0xa2, 0x61, 0x9c, 0x01, 0xa9, 0xc6, 0xe8, 0x72, 0x3c, 0xef, 0x50, + 0x4e, 0x6d, 0xbc, 0x4c, 0x90, 0x71, 0xf2, 0x1e, 0x16, 0xa3, 0xf4, 0x5d, 0xd7, 0x8a, 0x5a, 0x69, + 0x65, 0xff, 0x85, 0x39, 0x8d, 0xac, 0x99, 0xb5, 0x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0x9f, 0x1a, 0x94, 0x3c, 0xda, 0x53, 0x98, 0x3e, 0x52, 0x33, + 0xf1, 0xbd, 0xc9, 0x42, 0x55, 0xb6, 0x1b, 0x22, 0x9c, 0xa2, 0x9f, 0x67, 0x51, 0x3b, 0xf2, 0x4e, + 0xe4, 0xcf, 0xe5, 0x4b, 0x55, 0x61, 0xd0, 0xd0, 0xed, 0xfb, 0x26, 0x8d, 0x7d, 0xcb, 0xc7, 0xbe, + 0xb8, 0x4b, 0x56, 0x96, 0x72, 0xa3, 0x80, 0x4d, 0xfe, 0x39, 0x94, 0xe5, 0x63, 0x33, 0x27, 0xea, + 0xdf, 0xfe, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x5c, 0x7c, 0xa0, 0x45, 0xd4, 0x06, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/streetview/publish/v1/streetview_publish.pb.go b/vendor/google.golang.org/genproto/googleapis/streetview/publish/v1/streetview_publish.pb.go new file mode 100644 index 0000000000..63849b6870 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/streetview/publish/v1/streetview_publish.pb.go @@ -0,0 +1,524 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/streetview/publish/v1/streetview_publish.proto + +package publish + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf4 "github.com/golang/protobuf/ptypes/empty" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// 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 + +// Client API for StreetViewPublishService service + +type StreetViewPublishServiceClient interface { + // Creates an upload session to start uploading photo data. The upload URL of + // the returned `UploadRef` is used to upload the data for the photo. + // + // After the upload is complete, the `UploadRef` is used with + // `StreetViewPublishService:CreatePhoto()` to create the `Photo` object + // entry. + StartUpload(ctx context.Context, in *google_protobuf4.Empty, opts ...grpc.CallOption) (*UploadRef, error) + // After the client finishes uploading the photo with the returned + // `UploadRef`, `photo.create` publishes the uploaded photo to Street View on + // Google Maps. + // + // This method returns the following error codes: + // + // * `INVALID_ARGUMENT` if the request is malformed. + // * `NOT_FOUND` if the upload reference does not exist. + CreatePhoto(ctx context.Context, in *CreatePhotoRequest, opts ...grpc.CallOption) (*Photo, error) + // Gets the metadata of the specified `Photo`. + // + // This method returns the following error codes: + // + // * `PERMISSION_DENIED` if the requesting user did not create the requested + // photo. + // * `NOT_FOUND` if the requested photo does not exist. + GetPhoto(ctx context.Context, in *GetPhotoRequest, opts ...grpc.CallOption) (*Photo, error) + // Gets the metadata of the specified `Photo` batch. + // + // Note that if `photos.batchGet` fails, either critical fields are + // missing or there was an authentication error. + // Even if `photos.batchGet` succeeds, there may have been failures + // for single photos in the batch. These failures will be specified in + // `BatchGetPhotosResponse.results.status`. + // See `photo.get` for specific failures that will occur per photo. + BatchGetPhotos(ctx context.Context, in *BatchGetPhotosRequest, opts ...grpc.CallOption) (*BatchGetPhotosResponse, error) + // Lists all the photos that belong to the user. + ListPhotos(ctx context.Context, in *ListPhotosRequest, opts ...grpc.CallOption) (*ListPhotosResponse, error) + // Updates the metadata of a photo, such as pose, place association, etc. + // Changing the pixels of a photo is not supported. + // + // This method returns the following error codes: + // + // * `PERMISSION_DENIED` if the requesting user did not create the requested + // photo. + // * `INVALID_ARGUMENT` if the request is malformed. + // * `NOT_FOUND` if the photo ID does not exist. + UpdatePhoto(ctx context.Context, in *UpdatePhotoRequest, opts ...grpc.CallOption) (*Photo, error) + // Updates the metadata of photos, such as pose, place association, etc. + // Changing the pixels of a photo is not supported. + // + // Note that if `photos.batchUpdate` fails, either critical fields + // are missing or there was an authentication error. + // Even if `photos.batchUpdate` succeeds, there may have been + // failures for single photos in the batch. These failures will be specified + // in `BatchUpdatePhotosResponse.results.status`. + // See `UpdatePhoto` for specific failures that will occur per photo. + BatchUpdatePhotos(ctx context.Context, in *BatchUpdatePhotosRequest, opts ...grpc.CallOption) (*BatchUpdatePhotosResponse, error) + // Deletes a photo and its metadata. + // + // This method returns the following error codes: + // + // * `PERMISSION_DENIED` if the requesting user did not create the requested + // photo. + // * `NOT_FOUND` if the photo ID does not exist. + DeletePhoto(ctx context.Context, in *DeletePhotoRequest, opts ...grpc.CallOption) (*google_protobuf4.Empty, error) + // Deletes a list of photos and their metadata. + // + // Note that if `photos.batchDelete` fails, either critical fields + // are missing or there was an authentication error. + // Even if `photos.batchDelete` succeeds, there may have been + // failures for single photos in the batch. These failures will be specified + // in `BatchDeletePhotosResponse.status`. + // See `photo.update` for specific failures that will occur per photo. + BatchDeletePhotos(ctx context.Context, in *BatchDeletePhotosRequest, opts ...grpc.CallOption) (*BatchDeletePhotosResponse, error) +} + +type streetViewPublishServiceClient struct { + cc *grpc.ClientConn +} + +func NewStreetViewPublishServiceClient(cc *grpc.ClientConn) StreetViewPublishServiceClient { + return &streetViewPublishServiceClient{cc} +} + +func (c *streetViewPublishServiceClient) StartUpload(ctx context.Context, in *google_protobuf4.Empty, opts ...grpc.CallOption) (*UploadRef, error) { + out := new(UploadRef) + err := grpc.Invoke(ctx, "/google.streetview.publish.v1.StreetViewPublishService/StartUpload", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *streetViewPublishServiceClient) CreatePhoto(ctx context.Context, in *CreatePhotoRequest, opts ...grpc.CallOption) (*Photo, error) { + out := new(Photo) + err := grpc.Invoke(ctx, "/google.streetview.publish.v1.StreetViewPublishService/CreatePhoto", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *streetViewPublishServiceClient) GetPhoto(ctx context.Context, in *GetPhotoRequest, opts ...grpc.CallOption) (*Photo, error) { + out := new(Photo) + err := grpc.Invoke(ctx, "/google.streetview.publish.v1.StreetViewPublishService/GetPhoto", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *streetViewPublishServiceClient) BatchGetPhotos(ctx context.Context, in *BatchGetPhotosRequest, opts ...grpc.CallOption) (*BatchGetPhotosResponse, error) { + out := new(BatchGetPhotosResponse) + err := grpc.Invoke(ctx, "/google.streetview.publish.v1.StreetViewPublishService/BatchGetPhotos", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *streetViewPublishServiceClient) ListPhotos(ctx context.Context, in *ListPhotosRequest, opts ...grpc.CallOption) (*ListPhotosResponse, error) { + out := new(ListPhotosResponse) + err := grpc.Invoke(ctx, "/google.streetview.publish.v1.StreetViewPublishService/ListPhotos", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *streetViewPublishServiceClient) UpdatePhoto(ctx context.Context, in *UpdatePhotoRequest, opts ...grpc.CallOption) (*Photo, error) { + out := new(Photo) + err := grpc.Invoke(ctx, "/google.streetview.publish.v1.StreetViewPublishService/UpdatePhoto", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *streetViewPublishServiceClient) BatchUpdatePhotos(ctx context.Context, in *BatchUpdatePhotosRequest, opts ...grpc.CallOption) (*BatchUpdatePhotosResponse, error) { + out := new(BatchUpdatePhotosResponse) + err := grpc.Invoke(ctx, "/google.streetview.publish.v1.StreetViewPublishService/BatchUpdatePhotos", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *streetViewPublishServiceClient) DeletePhoto(ctx context.Context, in *DeletePhotoRequest, opts ...grpc.CallOption) (*google_protobuf4.Empty, error) { + out := new(google_protobuf4.Empty) + err := grpc.Invoke(ctx, "/google.streetview.publish.v1.StreetViewPublishService/DeletePhoto", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *streetViewPublishServiceClient) BatchDeletePhotos(ctx context.Context, in *BatchDeletePhotosRequest, opts ...grpc.CallOption) (*BatchDeletePhotosResponse, error) { + out := new(BatchDeletePhotosResponse) + err := grpc.Invoke(ctx, "/google.streetview.publish.v1.StreetViewPublishService/BatchDeletePhotos", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for StreetViewPublishService service + +type StreetViewPublishServiceServer interface { + // Creates an upload session to start uploading photo data. The upload URL of + // the returned `UploadRef` is used to upload the data for the photo. + // + // After the upload is complete, the `UploadRef` is used with + // `StreetViewPublishService:CreatePhoto()` to create the `Photo` object + // entry. + StartUpload(context.Context, *google_protobuf4.Empty) (*UploadRef, error) + // After the client finishes uploading the photo with the returned + // `UploadRef`, `photo.create` publishes the uploaded photo to Street View on + // Google Maps. + // + // This method returns the following error codes: + // + // * `INVALID_ARGUMENT` if the request is malformed. + // * `NOT_FOUND` if the upload reference does not exist. + CreatePhoto(context.Context, *CreatePhotoRequest) (*Photo, error) + // Gets the metadata of the specified `Photo`. + // + // This method returns the following error codes: + // + // * `PERMISSION_DENIED` if the requesting user did not create the requested + // photo. + // * `NOT_FOUND` if the requested photo does not exist. + GetPhoto(context.Context, *GetPhotoRequest) (*Photo, error) + // Gets the metadata of the specified `Photo` batch. + // + // Note that if `photos.batchGet` fails, either critical fields are + // missing or there was an authentication error. + // Even if `photos.batchGet` succeeds, there may have been failures + // for single photos in the batch. These failures will be specified in + // `BatchGetPhotosResponse.results.status`. + // See `photo.get` for specific failures that will occur per photo. + BatchGetPhotos(context.Context, *BatchGetPhotosRequest) (*BatchGetPhotosResponse, error) + // Lists all the photos that belong to the user. + ListPhotos(context.Context, *ListPhotosRequest) (*ListPhotosResponse, error) + // Updates the metadata of a photo, such as pose, place association, etc. + // Changing the pixels of a photo is not supported. + // + // This method returns the following error codes: + // + // * `PERMISSION_DENIED` if the requesting user did not create the requested + // photo. + // * `INVALID_ARGUMENT` if the request is malformed. + // * `NOT_FOUND` if the photo ID does not exist. + UpdatePhoto(context.Context, *UpdatePhotoRequest) (*Photo, error) + // Updates the metadata of photos, such as pose, place association, etc. + // Changing the pixels of a photo is not supported. + // + // Note that if `photos.batchUpdate` fails, either critical fields + // are missing or there was an authentication error. + // Even if `photos.batchUpdate` succeeds, there may have been + // failures for single photos in the batch. These failures will be specified + // in `BatchUpdatePhotosResponse.results.status`. + // See `UpdatePhoto` for specific failures that will occur per photo. + BatchUpdatePhotos(context.Context, *BatchUpdatePhotosRequest) (*BatchUpdatePhotosResponse, error) + // Deletes a photo and its metadata. + // + // This method returns the following error codes: + // + // * `PERMISSION_DENIED` if the requesting user did not create the requested + // photo. + // * `NOT_FOUND` if the photo ID does not exist. + DeletePhoto(context.Context, *DeletePhotoRequest) (*google_protobuf4.Empty, error) + // Deletes a list of photos and their metadata. + // + // Note that if `photos.batchDelete` fails, either critical fields + // are missing or there was an authentication error. + // Even if `photos.batchDelete` succeeds, there may have been + // failures for single photos in the batch. These failures will be specified + // in `BatchDeletePhotosResponse.status`. + // See `photo.update` for specific failures that will occur per photo. + BatchDeletePhotos(context.Context, *BatchDeletePhotosRequest) (*BatchDeletePhotosResponse, error) +} + +func RegisterStreetViewPublishServiceServer(s *grpc.Server, srv StreetViewPublishServiceServer) { + s.RegisterService(&_StreetViewPublishService_serviceDesc, srv) +} + +func _StreetViewPublishService_StartUpload_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(google_protobuf4.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StreetViewPublishServiceServer).StartUpload(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.streetview.publish.v1.StreetViewPublishService/StartUpload", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StreetViewPublishServiceServer).StartUpload(ctx, req.(*google_protobuf4.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _StreetViewPublishService_CreatePhoto_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreatePhotoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StreetViewPublishServiceServer).CreatePhoto(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.streetview.publish.v1.StreetViewPublishService/CreatePhoto", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StreetViewPublishServiceServer).CreatePhoto(ctx, req.(*CreatePhotoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StreetViewPublishService_GetPhoto_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetPhotoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StreetViewPublishServiceServer).GetPhoto(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.streetview.publish.v1.StreetViewPublishService/GetPhoto", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StreetViewPublishServiceServer).GetPhoto(ctx, req.(*GetPhotoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StreetViewPublishService_BatchGetPhotos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BatchGetPhotosRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StreetViewPublishServiceServer).BatchGetPhotos(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.streetview.publish.v1.StreetViewPublishService/BatchGetPhotos", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StreetViewPublishServiceServer).BatchGetPhotos(ctx, req.(*BatchGetPhotosRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StreetViewPublishService_ListPhotos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListPhotosRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StreetViewPublishServiceServer).ListPhotos(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.streetview.publish.v1.StreetViewPublishService/ListPhotos", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StreetViewPublishServiceServer).ListPhotos(ctx, req.(*ListPhotosRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StreetViewPublishService_UpdatePhoto_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdatePhotoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StreetViewPublishServiceServer).UpdatePhoto(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.streetview.publish.v1.StreetViewPublishService/UpdatePhoto", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StreetViewPublishServiceServer).UpdatePhoto(ctx, req.(*UpdatePhotoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StreetViewPublishService_BatchUpdatePhotos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BatchUpdatePhotosRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StreetViewPublishServiceServer).BatchUpdatePhotos(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.streetview.publish.v1.StreetViewPublishService/BatchUpdatePhotos", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StreetViewPublishServiceServer).BatchUpdatePhotos(ctx, req.(*BatchUpdatePhotosRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StreetViewPublishService_DeletePhoto_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeletePhotoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StreetViewPublishServiceServer).DeletePhoto(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.streetview.publish.v1.StreetViewPublishService/DeletePhoto", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StreetViewPublishServiceServer).DeletePhoto(ctx, req.(*DeletePhotoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StreetViewPublishService_BatchDeletePhotos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BatchDeletePhotosRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StreetViewPublishServiceServer).BatchDeletePhotos(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.streetview.publish.v1.StreetViewPublishService/BatchDeletePhotos", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StreetViewPublishServiceServer).BatchDeletePhotos(ctx, req.(*BatchDeletePhotosRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _StreetViewPublishService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.streetview.publish.v1.StreetViewPublishService", + HandlerType: (*StreetViewPublishServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "StartUpload", + Handler: _StreetViewPublishService_StartUpload_Handler, + }, + { + MethodName: "CreatePhoto", + Handler: _StreetViewPublishService_CreatePhoto_Handler, + }, + { + MethodName: "GetPhoto", + Handler: _StreetViewPublishService_GetPhoto_Handler, + }, + { + MethodName: "BatchGetPhotos", + Handler: _StreetViewPublishService_BatchGetPhotos_Handler, + }, + { + MethodName: "ListPhotos", + Handler: _StreetViewPublishService_ListPhotos_Handler, + }, + { + MethodName: "UpdatePhoto", + Handler: _StreetViewPublishService_UpdatePhoto_Handler, + }, + { + MethodName: "BatchUpdatePhotos", + Handler: _StreetViewPublishService_BatchUpdatePhotos_Handler, + }, + { + MethodName: "DeletePhoto", + Handler: _StreetViewPublishService_DeletePhoto_Handler, + }, + { + MethodName: "BatchDeletePhotos", + Handler: _StreetViewPublishService_BatchDeletePhotos_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/streetview/publish/v1/streetview_publish.proto", +} + +func init() { + proto.RegisterFile("google/streetview/publish/v1/streetview_publish.proto", fileDescriptor2) +} + +var fileDescriptor2 = []byte{ + // 533 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0x4f, 0x6f, 0xd3, 0x30, + 0x18, 0xc6, 0x15, 0x24, 0x10, 0xb8, 0x08, 0x69, 0x86, 0x55, 0x53, 0x3a, 0x24, 0x08, 0x12, 0xa0, + 0x6a, 0xd8, 0x1b, 0xe3, 0x8f, 0x54, 0x6e, 0x1d, 0x88, 0x0b, 0x87, 0x69, 0xd5, 0x38, 0x70, 0x99, + 0xdc, 0xf4, 0x5d, 0x6a, 0x29, 0x8d, 0x4d, 0xec, 0x74, 0x42, 0x30, 0x0e, 0xe3, 0xc8, 0x0d, 0x2e, + 0x7c, 0x03,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 0x57, 0x81, 0x3a, + 0x2f, 0x21, 0x85, 0x86, 0xd3, 0xab, 0x49, 0x1d, 0xdc, 0x3f, 0x6e, 0x00, 0x77, 0xac, 0xfb, 0xab, + 0x8f, 0xf5, 0x72, 0x40, 0xb5, 0x8e, 0xcd, 0x06, 0x54, 0x37, 0xb4, 0x19, 0xd0, 0x79, 0xdf, 0xff, + 0x06, 0x54, 0xaa, 0x07, 0x41, 0x7f, 0x78, 0x16, 0xa0, 0x87, 0xb1, 0x98, 0xb9, 0x84, 0x04, 0x04, + 0x29, 0x92, 0x78, 0x75, 0xd2, 0x70, 0xed, 0xaf, 0x7b, 0xf3, 0xdd, 0x9e, 0x33, 0x8a, 0x94, 0x65, + 0x09, 0x11, 0x79, 0x42, 0x13, 0xc8, 0xcc, 0xb0, 0x68, 0x59, 0x62, 0x92, 0xab, 0xd5, 0x97, 0xf3, + 0x0b, 0xfb, 0x71, 0x7c, 0xc5, 0xe8, 0x77, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x7d, 0x9d, 0xfe, + 0x1c, 0x89, 0x06, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/tracing/v1/trace.pb.go b/vendor/google.golang.org/genproto/googleapis/tracing/v1/trace.pb.go new file mode 100644 index 0000000000..b254936680 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/tracing/v1/trace.pb.go @@ -0,0 +1,888 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/tracing/trace.proto + +/* +Package tracing is a generated protocol buffer package. + +It is generated from these files: + google/tracing/trace.proto + +It has these top-level messages: + TraceId + Module + StackTrace + LabelValue + Span + Trace +*/ +package tracing + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf1 "github.com/golang/protobuf/ptypes/timestamp" +import google_rpc "google.golang.org/genproto/googleapis/rpc/status" + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// The type of the network event. SENT or RECV event. +type Span_TimeEvent_NetworkEvent_Type int32 + +const ( + Span_TimeEvent_NetworkEvent_UNSPECIFIED Span_TimeEvent_NetworkEvent_Type = 0 + Span_TimeEvent_NetworkEvent_SENT Span_TimeEvent_NetworkEvent_Type = 1 + Span_TimeEvent_NetworkEvent_RECV Span_TimeEvent_NetworkEvent_Type = 2 +) + +var Span_TimeEvent_NetworkEvent_Type_name = map[int32]string{ + 0: "UNSPECIFIED", + 1: "SENT", + 2: "RECV", +} +var Span_TimeEvent_NetworkEvent_Type_value = map[string]int32{ + "UNSPECIFIED": 0, + "SENT": 1, + "RECV": 2, +} + +func (x Span_TimeEvent_NetworkEvent_Type) String() string { + return proto.EnumName(Span_TimeEvent_NetworkEvent_Type_name, int32(x)) +} +func (Span_TimeEvent_NetworkEvent_Type) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{4, 0, 1, 0} +} + +// The type of the link. +type Span_Link_Type int32 + +const ( + Span_Link_UNSPECIFIED Span_Link_Type = 0 + Span_Link_CHILD Span_Link_Type = 1 + Span_Link_PARENT Span_Link_Type = 2 +) + +var Span_Link_Type_name = map[int32]string{ + 0: "UNSPECIFIED", + 1: "CHILD", + 2: "PARENT", +} +var Span_Link_Type_value = map[string]int32{ + "UNSPECIFIED": 0, + "CHILD": 1, + "PARENT": 2, +} + +func (x Span_Link_Type) String() string { + return proto.EnumName(Span_Link_Type_name, int32(x)) +} +func (Span_Link_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{4, 1, 0} } + +// A TraceId uniquely identifies a Trace. It is conceptually a 128-bit value, +// represented as a string, containing the hex-encoded value. +type TraceId struct { + // Trace ID specified as a hex-encoded string. *Must* be 32 bytes long. + HexEncoded string `protobuf:"bytes,1,opt,name=hex_encoded,json=hexEncoded" json:"hex_encoded,omitempty"` +} + +func (m *TraceId) Reset() { *m = TraceId{} } +func (m *TraceId) String() string { return proto.CompactTextString(m) } +func (*TraceId) ProtoMessage() {} +func (*TraceId) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *TraceId) GetHexEncoded() string { + if m != nil { + return m.HexEncoded + } + return "" +} + +type Module struct { + // Binary module. + // E.g. main binary, kernel modules, and dynamic libraries + // such as libc.so, sharedlib.so + Module string `protobuf:"bytes,1,opt,name=module" json:"module,omitempty"` + // Build_id is a unique identifier for the module, + // probably a hash of its contents + BuildId string `protobuf:"bytes,2,opt,name=build_id,json=buildId" json:"build_id,omitempty"` +} + +func (m *Module) Reset() { *m = Module{} } +func (m *Module) String() string { return proto.CompactTextString(m) } +func (*Module) ProtoMessage() {} +func (*Module) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *Module) GetModule() string { + if m != nil { + return m.Module + } + return "" +} + +func (m *Module) GetBuildId() string { + if m != nil { + return m.BuildId + } + return "" +} + +type StackTrace struct { + // Stack frames of this stack trace. + StackFrame []*StackTrace_StackFrame `protobuf:"bytes,1,rep,name=stack_frame,json=stackFrame" json:"stack_frame,omitempty"` + // User can choose to use his own hash function to hash large labels to save + // network bandwidth and storage. + // Typical usage is to pass both initially to inform the storage of the + // mapping. And in subsequent calls, pass in stack_trace_hash_id only. + // User shall verify the hash value is successfully stored. + StackTraceHashId uint64 `protobuf:"varint,2,opt,name=stack_trace_hash_id,json=stackTraceHashId" json:"stack_trace_hash_id,omitempty"` +} + +func (m *StackTrace) Reset() { *m = StackTrace{} } +func (m *StackTrace) String() string { return proto.CompactTextString(m) } +func (*StackTrace) ProtoMessage() {} +func (*StackTrace) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *StackTrace) GetStackFrame() []*StackTrace_StackFrame { + if m != nil { + return m.StackFrame + } + return nil +} + +func (m *StackTrace) GetStackTraceHashId() uint64 { + if m != nil { + return m.StackTraceHashId + } + return 0 +} + +// Presents a single stack frame in a stack trace. +type StackTrace_StackFrame struct { + // Fully qualified names which uniquely identify function/method/etc. + FunctionName string `protobuf:"bytes,1,opt,name=function_name,json=functionName" json:"function_name,omitempty"` + // Used when function name is ‘mangled’. Not guaranteed to be fully + // qualified but usually it is. + OrigFunctionName string `protobuf:"bytes,2,opt,name=orig_function_name,json=origFunctionName" json:"orig_function_name,omitempty"` + // File name of the frame. + FileName string `protobuf:"bytes,3,opt,name=file_name,json=fileName" json:"file_name,omitempty"` + // Line number of the frame. + LineNumber int64 `protobuf:"varint,4,opt,name=line_number,json=lineNumber" json:"line_number,omitempty"` + // Column number is important in JavaScript(anonymous functions), + // Might not be available in some languages. + ColumnNumber int64 `protobuf:"varint,5,opt,name=column_number,json=columnNumber" json:"column_number,omitempty"` + // Binary module the code is loaded from. + LoadModule *Module `protobuf:"bytes,6,opt,name=load_module,json=loadModule" json:"load_module,omitempty"` + // source_version is deployment specific. It might be + // better to be stored in deployment metadata. + // However, in distributed tracing, it’s hard to keep track of + // source/binary versions at one place for all spans. + SourceVersion string `protobuf:"bytes,7,opt,name=source_version,json=sourceVersion" json:"source_version,omitempty"` +} + +func (m *StackTrace_StackFrame) Reset() { *m = StackTrace_StackFrame{} } +func (m *StackTrace_StackFrame) String() string { return proto.CompactTextString(m) } +func (*StackTrace_StackFrame) ProtoMessage() {} +func (*StackTrace_StackFrame) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2, 0} } + +func (m *StackTrace_StackFrame) GetFunctionName() string { + if m != nil { + return m.FunctionName + } + return "" +} + +func (m *StackTrace_StackFrame) GetOrigFunctionName() string { + if m != nil { + return m.OrigFunctionName + } + return "" +} + +func (m *StackTrace_StackFrame) GetFileName() string { + if m != nil { + return m.FileName + } + return "" +} + +func (m *StackTrace_StackFrame) GetLineNumber() int64 { + if m != nil { + return m.LineNumber + } + return 0 +} + +func (m *StackTrace_StackFrame) GetColumnNumber() int64 { + if m != nil { + return m.ColumnNumber + } + return 0 +} + +func (m *StackTrace_StackFrame) GetLoadModule() *Module { + if m != nil { + return m.LoadModule + } + return nil +} + +func (m *StackTrace_StackFrame) GetSourceVersion() string { + if m != nil { + return m.SourceVersion + } + return "" +} + +// Allowed label values. +type LabelValue struct { + // The value of the label. + // + // Types that are valid to be assigned to Value: + // *LabelValue_StringValue + // *LabelValue_IntValue + // *LabelValue_BoolValue + Value isLabelValue_Value `protobuf_oneof:"value"` +} + +func (m *LabelValue) Reset() { *m = LabelValue{} } +func (m *LabelValue) String() string { return proto.CompactTextString(m) } +func (*LabelValue) ProtoMessage() {} +func (*LabelValue) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +type isLabelValue_Value interface { + isLabelValue_Value() +} + +type LabelValue_StringValue struct { + StringValue string `protobuf:"bytes,1,opt,name=string_value,json=stringValue,oneof"` +} +type LabelValue_IntValue struct { + IntValue int64 `protobuf:"varint,2,opt,name=int_value,json=intValue,oneof"` +} +type LabelValue_BoolValue struct { + BoolValue bool `protobuf:"varint,3,opt,name=bool_value,json=boolValue,oneof"` +} + +func (*LabelValue_StringValue) isLabelValue_Value() {} +func (*LabelValue_IntValue) isLabelValue_Value() {} +func (*LabelValue_BoolValue) isLabelValue_Value() {} + +func (m *LabelValue) GetValue() isLabelValue_Value { + if m != nil { + return m.Value + } + return nil +} + +func (m *LabelValue) GetStringValue() string { + if x, ok := m.GetValue().(*LabelValue_StringValue); ok { + return x.StringValue + } + return "" +} + +func (m *LabelValue) GetIntValue() int64 { + if x, ok := m.GetValue().(*LabelValue_IntValue); ok { + return x.IntValue + } + return 0 +} + +func (m *LabelValue) GetBoolValue() bool { + if x, ok := m.GetValue().(*LabelValue_BoolValue); ok { + return x.BoolValue + } + return false +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*LabelValue) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _LabelValue_OneofMarshaler, _LabelValue_OneofUnmarshaler, _LabelValue_OneofSizer, []interface{}{ + (*LabelValue_StringValue)(nil), + (*LabelValue_IntValue)(nil), + (*LabelValue_BoolValue)(nil), + } +} + +func _LabelValue_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*LabelValue) + // value + switch x := m.Value.(type) { + case *LabelValue_StringValue: + b.EncodeVarint(1<<3 | proto.WireBytes) + b.EncodeStringBytes(x.StringValue) + case *LabelValue_IntValue: + b.EncodeVarint(2<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.IntValue)) + case *LabelValue_BoolValue: + t := uint64(0) + if x.BoolValue { + t = 1 + } + b.EncodeVarint(3<<3 | proto.WireVarint) + b.EncodeVarint(t) + case nil: + default: + return fmt.Errorf("LabelValue.Value has unexpected type %T", x) + } + return nil +} + +func _LabelValue_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*LabelValue) + switch tag { + case 1: // value.string_value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Value = &LabelValue_StringValue{x} + return true, err + case 2: // value.int_value + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Value = &LabelValue_IntValue{int64(x)} + return true, err + case 3: // value.bool_value + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Value = &LabelValue_BoolValue{x != 0} + return true, err + default: + return false, nil + } +} + +func _LabelValue_OneofSizer(msg proto.Message) (n int) { + m := msg.(*LabelValue) + // value + switch x := m.Value.(type) { + case *LabelValue_StringValue: + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.StringValue))) + n += len(x.StringValue) + case *LabelValue_IntValue: + n += proto.SizeVarint(2<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.IntValue)) + case *LabelValue_BoolValue: + n += proto.SizeVarint(3<<3 | proto.WireVarint) + n += 1 + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// A span represents a single operation within a trace. Spans can be nested +// and form a trace tree. Often, a trace contains a root span that describes the +// end-to-end latency and, optionally, one or more subspans for +// its sub-operations. Spans do not need to be contiguous. There may be gaps +// between spans in a trace. +type Span struct { + // Identifier for the span. Must be a 64-bit integer other than 0 and + // unique within a trace. + Id uint64 `protobuf:"fixed64,1,opt,name=id" json:"id,omitempty"` + // Name of the span. The span name is sanitized and displayed in the + // Stackdriver Trace tool in the {% dynamic print site_values.console_name %}. + // The name may be a method name or some other per-call site name. + // For the same executable and the same call point, a best practice is + // to use a consistent name, which makes it easier to correlate + // cross-trace spans. + Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` + // ID of parent span. 0 or missing if this is a root span. + ParentId uint64 `protobuf:"fixed64,3,opt,name=parent_id,json=parentId" json:"parent_id,omitempty"` + // Local machine clock in nanoseconds from the UNIX epoch, + // at which span execution started. + // On the server side these are the times when the server application + // handler starts running. + LocalStartTime *google_protobuf1.Timestamp `protobuf:"bytes,4,opt,name=local_start_time,json=localStartTime" json:"local_start_time,omitempty"` + // Local machine clock in nanoseconds from the UNIX epoch, + // at which span execution ended. + // On the server side these are the times when the server application + // handler finishes running. + LocalEndTime *google_protobuf1.Timestamp `protobuf:"bytes,5,opt,name=local_end_time,json=localEndTime" json:"local_end_time,omitempty"` + // Properties of a span. Labels at the span level. + // E.g. + // "/instance_id": "my-instance" + // "/zone": "us-central1-a" + // "/grpc/peer_address": "ip:port" (dns, etc.) + // "/grpc/deadline": "Duration" + // "/http/user_agent" + // "/http/request_bytes": 300 + // "/http/response_bytes": 1200 + // "/http/url": google.com/apis + // "/pid" + // "abc.com/mylabel": "my label value" + Labels map[string]*LabelValue `protobuf:"bytes,6,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // Stack trace captured at the start of the span. This is optional. + StackTrace *StackTrace `protobuf:"bytes,7,opt,name=stack_trace,json=stackTrace" json:"stack_trace,omitempty"` + // A collection of time-stamped events. + TimeEvents []*Span_TimeEvent `protobuf:"bytes,8,rep,name=time_events,json=timeEvents" json:"time_events,omitempty"` + // A collection of links. + Links []*Span_Link `protobuf:"bytes,9,rep,name=links" json:"links,omitempty"` + // The final status of the Span. This is optional. + Status *google_rpc.Status `protobuf:"bytes,10,opt,name=status" json:"status,omitempty"` + // True if this Span has a remote parent (is an RPC server Span). + HasRemoteParent bool `protobuf:"varint,11,opt,name=has_remote_parent,json=hasRemoteParent" json:"has_remote_parent,omitempty"` +} + +func (m *Span) Reset() { *m = Span{} } +func (m *Span) String() string { return proto.CompactTextString(m) } +func (*Span) ProtoMessage() {} +func (*Span) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *Span) GetId() uint64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *Span) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Span) GetParentId() uint64 { + if m != nil { + return m.ParentId + } + return 0 +} + +func (m *Span) GetLocalStartTime() *google_protobuf1.Timestamp { + if m != nil { + return m.LocalStartTime + } + return nil +} + +func (m *Span) GetLocalEndTime() *google_protobuf1.Timestamp { + if m != nil { + return m.LocalEndTime + } + return nil +} + +func (m *Span) GetLabels() map[string]*LabelValue { + if m != nil { + return m.Labels + } + return nil +} + +func (m *Span) GetStackTrace() *StackTrace { + if m != nil { + return m.StackTrace + } + return nil +} + +func (m *Span) GetTimeEvents() []*Span_TimeEvent { + if m != nil { + return m.TimeEvents + } + return nil +} + +func (m *Span) GetLinks() []*Span_Link { + if m != nil { + return m.Links + } + return nil +} + +func (m *Span) GetStatus() *google_rpc.Status { + if m != nil { + return m.Status + } + return nil +} + +func (m *Span) GetHasRemoteParent() bool { + if m != nil { + return m.HasRemoteParent + } + return false +} + +// A time-stamped annotation in the Span. +type Span_TimeEvent struct { + // The local machine absolute timestamp when this event happened. + LocalTime *google_protobuf1.Timestamp `protobuf:"bytes,1,opt,name=local_time,json=localTime" json:"local_time,omitempty"` + // Types that are valid to be assigned to Value: + // *Span_TimeEvent_Annotation_ + // *Span_TimeEvent_NetworkEvent_ + Value isSpan_TimeEvent_Value `protobuf_oneof:"value"` +} + +func (m *Span_TimeEvent) Reset() { *m = Span_TimeEvent{} } +func (m *Span_TimeEvent) String() string { return proto.CompactTextString(m) } +func (*Span_TimeEvent) ProtoMessage() {} +func (*Span_TimeEvent) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4, 0} } + +type isSpan_TimeEvent_Value interface { + isSpan_TimeEvent_Value() +} + +type Span_TimeEvent_Annotation_ struct { + Annotation *Span_TimeEvent_Annotation `protobuf:"bytes,2,opt,name=annotation,oneof"` +} +type Span_TimeEvent_NetworkEvent_ struct { + NetworkEvent *Span_TimeEvent_NetworkEvent `protobuf:"bytes,3,opt,name=network_event,json=networkEvent,oneof"` +} + +func (*Span_TimeEvent_Annotation_) isSpan_TimeEvent_Value() {} +func (*Span_TimeEvent_NetworkEvent_) isSpan_TimeEvent_Value() {} + +func (m *Span_TimeEvent) GetValue() isSpan_TimeEvent_Value { + if m != nil { + return m.Value + } + return nil +} + +func (m *Span_TimeEvent) GetLocalTime() *google_protobuf1.Timestamp { + if m != nil { + return m.LocalTime + } + return nil +} + +func (m *Span_TimeEvent) GetAnnotation() *Span_TimeEvent_Annotation { + if x, ok := m.GetValue().(*Span_TimeEvent_Annotation_); ok { + return x.Annotation + } + return nil +} + +func (m *Span_TimeEvent) GetNetworkEvent() *Span_TimeEvent_NetworkEvent { + if x, ok := m.GetValue().(*Span_TimeEvent_NetworkEvent_); ok { + return x.NetworkEvent + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Span_TimeEvent) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _Span_TimeEvent_OneofMarshaler, _Span_TimeEvent_OneofUnmarshaler, _Span_TimeEvent_OneofSizer, []interface{}{ + (*Span_TimeEvent_Annotation_)(nil), + (*Span_TimeEvent_NetworkEvent_)(nil), + } +} + +func _Span_TimeEvent_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Span_TimeEvent) + // value + switch x := m.Value.(type) { + case *Span_TimeEvent_Annotation_: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Annotation); err != nil { + return err + } + case *Span_TimeEvent_NetworkEvent_: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.NetworkEvent); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("Span_TimeEvent.Value has unexpected type %T", x) + } + return nil +} + +func _Span_TimeEvent_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Span_TimeEvent) + switch tag { + case 2: // value.annotation + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Span_TimeEvent_Annotation) + err := b.DecodeMessage(msg) + m.Value = &Span_TimeEvent_Annotation_{msg} + return true, err + case 3: // value.network_event + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Span_TimeEvent_NetworkEvent) + err := b.DecodeMessage(msg) + m.Value = &Span_TimeEvent_NetworkEvent_{msg} + return true, err + default: + return false, nil + } +} + +func _Span_TimeEvent_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Span_TimeEvent) + // value + switch x := m.Value.(type) { + case *Span_TimeEvent_Annotation_: + s := proto.Size(x.Annotation) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Span_TimeEvent_NetworkEvent_: + s := proto.Size(x.NetworkEvent) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Text annotation with a set of labels. +type Span_TimeEvent_Annotation struct { + // A user-supplied message describing the event. + Description string `protobuf:"bytes,1,opt,name=description" json:"description,omitempty"` + // A set of labels on the annotation. + Labels map[string]*LabelValue `protobuf:"bytes,2,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *Span_TimeEvent_Annotation) Reset() { *m = Span_TimeEvent_Annotation{} } +func (m *Span_TimeEvent_Annotation) String() string { return proto.CompactTextString(m) } +func (*Span_TimeEvent_Annotation) ProtoMessage() {} +func (*Span_TimeEvent_Annotation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4, 0, 0} } + +func (m *Span_TimeEvent_Annotation) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *Span_TimeEvent_Annotation) GetLabels() map[string]*LabelValue { + if m != nil { + return m.Labels + } + return nil +} + +// An event describing an RPC message sent/received on the network. +type Span_TimeEvent_NetworkEvent struct { + // If available, this is the kernel time: + // For sent messages, this is the time at which the first bit was sent. + // For received messages, this is the time at which the last bit was + // received. + KernelTime *google_protobuf1.Timestamp `protobuf:"bytes,1,opt,name=kernel_time,json=kernelTime" json:"kernel_time,omitempty"` + Type Span_TimeEvent_NetworkEvent_Type `protobuf:"varint,2,opt,name=type,enum=google.tracing.v1.Span_TimeEvent_NetworkEvent_Type" json:"type,omitempty"` + // Every message has an identifier, that must be different from all the + // network messages in this span. + // This is very important when the request/response are streamed. + MessageId uint64 `protobuf:"varint,3,opt,name=message_id,json=messageId" json:"message_id,omitempty"` + // Number of bytes send/receive. + MessageSize uint64 `protobuf:"varint,4,opt,name=message_size,json=messageSize" json:"message_size,omitempty"` +} + +func (m *Span_TimeEvent_NetworkEvent) Reset() { *m = Span_TimeEvent_NetworkEvent{} } +func (m *Span_TimeEvent_NetworkEvent) String() string { return proto.CompactTextString(m) } +func (*Span_TimeEvent_NetworkEvent) ProtoMessage() {} +func (*Span_TimeEvent_NetworkEvent) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{4, 0, 1} +} + +func (m *Span_TimeEvent_NetworkEvent) GetKernelTime() *google_protobuf1.Timestamp { + if m != nil { + return m.KernelTime + } + return nil +} + +func (m *Span_TimeEvent_NetworkEvent) GetType() Span_TimeEvent_NetworkEvent_Type { + if m != nil { + return m.Type + } + return Span_TimeEvent_NetworkEvent_UNSPECIFIED +} + +func (m *Span_TimeEvent_NetworkEvent) GetMessageId() uint64 { + if m != nil { + return m.MessageId + } + return 0 +} + +func (m *Span_TimeEvent_NetworkEvent) GetMessageSize() uint64 { + if m != nil { + return m.MessageSize + } + return 0 +} + +// Link one span with another which may be in a different Trace. Used (for +// example) in batching operations, where a single batch handler processes +// multiple requests from different traces. +type Span_Link struct { + // The trace and span identifier of the linked span. + TraceId *TraceId `protobuf:"bytes,1,opt,name=trace_id,json=traceId" json:"trace_id,omitempty"` + SpanId uint64 `protobuf:"fixed64,2,opt,name=span_id,json=spanId" json:"span_id,omitempty"` + Type Span_Link_Type `protobuf:"varint,3,opt,name=type,enum=google.tracing.v1.Span_Link_Type" json:"type,omitempty"` +} + +func (m *Span_Link) Reset() { *m = Span_Link{} } +func (m *Span_Link) String() string { return proto.CompactTextString(m) } +func (*Span_Link) ProtoMessage() {} +func (*Span_Link) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4, 1} } + +func (m *Span_Link) GetTraceId() *TraceId { + if m != nil { + return m.TraceId + } + return nil +} + +func (m *Span_Link) GetSpanId() uint64 { + if m != nil { + return m.SpanId + } + return 0 +} + +func (m *Span_Link) GetType() Span_Link_Type { + if m != nil { + return m.Type + } + return Span_Link_UNSPECIFIED +} + +// A trace describes how long it takes for an application to perform some +// operations. It consists of a tree of spans, each of which contains details +// about an operation with time information and operation details. +type Trace struct { + // Globally unique identifier for the trace. Common to all the spans. + TraceId *TraceId `protobuf:"bytes,1,opt,name=trace_id,json=traceId" json:"trace_id,omitempty"` + // Collection of spans in the trace. The root span has parent_id == 0. + Spans []*Span `protobuf:"bytes,2,rep,name=spans" json:"spans,omitempty"` +} + +func (m *Trace) Reset() { *m = Trace{} } +func (m *Trace) String() string { return proto.CompactTextString(m) } +func (*Trace) ProtoMessage() {} +func (*Trace) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *Trace) GetTraceId() *TraceId { + if m != nil { + return m.TraceId + } + return nil +} + +func (m *Trace) GetSpans() []*Span { + if m != nil { + return m.Spans + } + return nil +} + +func init() { + proto.RegisterType((*TraceId)(nil), "google.tracing.v1.TraceId") + proto.RegisterType((*Module)(nil), "google.tracing.v1.Module") + proto.RegisterType((*StackTrace)(nil), "google.tracing.v1.StackTrace") + proto.RegisterType((*StackTrace_StackFrame)(nil), "google.tracing.v1.StackTrace.StackFrame") + proto.RegisterType((*LabelValue)(nil), "google.tracing.v1.LabelValue") + proto.RegisterType((*Span)(nil), "google.tracing.v1.Span") + proto.RegisterType((*Span_TimeEvent)(nil), "google.tracing.v1.Span.TimeEvent") + proto.RegisterType((*Span_TimeEvent_Annotation)(nil), "google.tracing.v1.Span.TimeEvent.Annotation") + proto.RegisterType((*Span_TimeEvent_NetworkEvent)(nil), "google.tracing.v1.Span.TimeEvent.NetworkEvent") + proto.RegisterType((*Span_Link)(nil), "google.tracing.v1.Span.Link") + proto.RegisterType((*Trace)(nil), "google.tracing.v1.Trace") + proto.RegisterEnum("google.tracing.v1.Span_TimeEvent_NetworkEvent_Type", Span_TimeEvent_NetworkEvent_Type_name, Span_TimeEvent_NetworkEvent_Type_value) + proto.RegisterEnum("google.tracing.v1.Span_Link_Type", Span_Link_Type_name, Span_Link_Type_value) +} + +func init() { proto.RegisterFile("google/tracing/trace.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 1102 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xdd, 0x6e, 0x1a, 0x47, + 0x14, 0x66, 0xf9, 0x59, 0x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e, 0x00, 0x7b, 0xae, 0x56, 0x86, + 0x65, 0x76, 0xe8, 0x09, 0x54, 0xc6, 0x8b, 0x30, 0x0a, 0xbc, 0x30, 0x68, 0xe4, 0x95, 0xa5, 0xac, + 0xf6, 0xfd, 0xa0, 0xf5, 0x7b, 0x01, 0x60, 0x24, 0x88, 0x3f, 0x53, 0xc7, 0xa1, 0x3e, 0x38, 0x5c, + 0xee, 0xbc, 0xab, 0x94, 0xcc, 0x65, 0x98, 0xc2, 0xbe, 0xd3, 0xd9, 0x77, 0x3f, 0xb8, 0xb8, 0x7b, + 0xeb, 0xa3, 0x97, 0xe7, 0x92, 0x8f, 0x81, 0xaf, 0xd6, 0xe8, 0x05, 0x7c, 0xa6, 0x43, 0x29, 0x09, + 0xbd, 0x29, 0xe1, 0xd3, 0xec, 0xfc, 0x22, 0xae, 0xf3, 0x95, 0x7f, 0x8f, 0xf0, 0x69, 0x3f, 0x68, + 0xfe, 0x96, 0x37, 0x89, 0x68, 0xef, 0x67, 0xb0, 0x71, 0xb5, 0x60, 0xbe, 0x54, 0xd3, 0x63, 0x3a, + 0x15, 0x99, 0x77, 0x2d, 0x03, 0x07, 0x92, 0xf4, 0x1c, 0x50, 0x9c, 0x86, 0x13, 0xef, 0x9f, 0x4c, + 0x7d, 0xc3, 0xba, 0xb4, 0x9c, 0xaf, 0xb3, 0xbf, 0x84, 0xea, 0x55, 0x18, 0x51, 0x4d, 0x2a, 0x28, + 0x52, 0x45, 0x02, 0xca, 0xb8, 0x03, 0x4e, 0x14, 0x32, 0xea, 0xb1, 0xc5, 0x7c, 0x4c, 0xd3, 0x46, + 0x71, 0xd7, 0xda, 0x2f, 0x60, 0x90, 0xd0, 0x40, 0x21, 0x32, 0x21, 0x3f, 0x8e, 0x16, 0x73, 0x96, + 0x51, 0x4a, 0x8a, 0x52, 0xd3, 0xa0, 0x21, 0xbd, 0x06, 0x27, 0x8a, 0x49, 0xe0, 0x99, 0x2a, 0xd8, + 0xbb, 0xd6, 0xbe, 0xd3, 0x79, 0x72, 0x87, 0x7c, 0xba, 0x60, 0x18, 0x24, 0xdb, 0x14, 0xef, 0x2b, + 0xd8, 0xe4, 0xf1, 0x22, 0xf5, 0xa9, 0xb7, 0xa4, 0x29, 0x0f, 0x63, 0xd6, 0x28, 0xab, 0x1c, 0x37, + 0x34, 0x7a, 0xa9, 0xc1, 0xd6, 0x0d, 0xc0, 0x5b, 0x32, 0xa6, 0xd1, 0x25, 0x89, 0x16, 0x52, 0xa6, + 0x1a, 0x17, 0x69, 0xc8, 0x26, 0xde, 0x52, 0xee, 0xb5, 0x4a, 0xbd, 0x1c, 0x76, 0x34, 0xaa, 0x49, + 0xdb, 0x50, 0x0d, 0x99, 0x30, 0x0c, 0xa9, 0x4e, 0xa1, 0x97, 0xc3, 0x95, 0x90, 0x09, 0x6d, 0xde, + 0x01, 0x18, 0xc7, 0x71, 0x64, 0xec, 0x52, 0x98, 0x4a, 0x2f, 0x87, 0xab, 0x12, 0x53, 0x84, 0x93, + 0x32, 0x94, 0x94, 0xad, 0xf5, 0x6b, 0x0d, 0x8a, 0xa3, 0x84, 0x30, 0xb4, 0x09, 0xf9, 0x50, 0xb7, + 0xa2, 0x8d, 0xf3, 0x61, 0x80, 0x10, 0x14, 0xd7, 0xa4, 0x57, 0x6b, 0x29, 0x77, 0x42, 0x52, 0xca, + 0x84, 0xac, 0x7a, 0x41, 0x51, 0x2b, 0x1a, 0xe8, 0x07, 0xe8, 0x0c, 0xea, 0x51, 0xec, 0x93, 0xc8, + 0xe3, 0x82, 0xa4, 0xc2, 0x93, 0x73, 0xa1, 0x34, 0x77, 0x3a, 0xcd, 0x4c, 0xad, 0x6c, 0x68, 0xdc, + 0x8b, 0x6c, 0x68, 0xf0, 0xa6, 0xf2, 0x19, 0x49, 0x17, 0x09, 0xa2, 0xef, 0x40, 0x23, 0x1e, 0x65, + 0x81, 0x8e, 0x51, 0x7a, 0x30, 0x46, 0x4d, 0x79, 0x74, 0x59, 0xa0, 0x22, 0x1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0xeb, 0xf9, 0xd5, 0xd3, 0xd7, 0xfc, + 0xc3, 0x82, 0xa2, 0x9c, 0x21, 0xf4, 0x0a, 0x2a, 0xfa, 0x83, 0x66, 0x1e, 0xc0, 0x35, 0x0d, 0xd6, + 0x6e, 0x63, 0x3e, 0xde, 0xb8, 0x2c, 0xcc, 0x57, 0x7c, 0x0b, 0xca, 0x3c, 0x21, 0x2c, 0xfb, 0x02, + 0xda, 0xd8, 0x96, 0xdb, 0x7e, 0x80, 0x5e, 0x19, 0x65, 0x0a, 0x4a, 0x99, 0xbd, 0x8f, 0xcd, 0xef, + 0x9a, 0x0e, 0x2d, 0xf7, 0xbe, 0x5b, 0x54, 0xa1, 0x74, 0xda, 0xeb, 0xbf, 0x3d, 0xab, 0x5b, 0x08, + 0xc0, 0x1e, 0xbe, 0xc1, 0xf2, 0x4a, 0xf9, 0xff, 0xaf, 0x51, 0x5a, 0x73, 0x28, 0xe9, 0xe7, 0xec, + 0x3f, 0x2a, 0xf3, 0x02, 0x4a, 0x52, 0x8a, 0x6c, 0x26, 0xb6, 0xee, 0x51, 0x00, 0x6b, 0xd6, 0x89, + 0x07, 0x9f, 0xfb, 0xf1, 0xfc, 0x43, 0xd2, 0x09, 0xa8, 0xc8, 0x43, 0xd9, 0x87, 0x43, 0xeb, 0xa7, + 0x23, 0x43, 0x98, 0xc4, 0x11, 0x61, 0x13, 0x37, 0x4e, 0x27, 0xed, 0x09, 0x65, 0xaa, 0x4b, 0xdb, + 0xda, 0x44, 0x92, 0x90, 0xaf, 0xfe, 0xe6, 0x2d, 0x5f, 0x1e, 0x9b, 0xe5, 0xd8, 0x56, 0xa4, 0xc3, + 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0xdc, 0x30, 0x5b, 0x04, 0x0a, 0x0a, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/type/color/color.pb.go b/vendor/google.golang.org/genproto/googleapis/type/color/color.pb.go new file mode 100644 index 0000000000..4f201b88a8 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/type/color/color.pb.go @@ -0,0 +1,221 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/type/color.proto + +/* +Package color is a generated protocol buffer package. + +It is generated from these files: + google/type/color.proto + +It has these top-level messages: + Color +*/ +package color + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import google_protobuf "github.com/golang/protobuf/ptypes/wrappers" + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Represents a color in the RGBA color space. This representation is designed +// for simplicity of conversion to/from color representations in various +// languages over compactness; for example, the fields of this representation +// can be trivially provided to the constructor of "java.awt.Color" in Java; it +// can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha" +// method in iOS; and, with just a little work, it can be easily formatted into +// a CSS "rgba()" string in JavaScript, as well. Here are some examples: +// +// Example (Java): +// +// import com.google.type.Color; +// +// // ... +// public static java.awt.Color fromProto(Color protocolor) { +// float alpha = protocolor.hasAlpha() +// ? protocolor.getAlpha().getValue() +// : 1.0; +// +// return new java.awt.Color( +// protocolor.getRed(), +// protocolor.getGreen(), +// protocolor.getBlue(), +// alpha); +// } +// +// public static Color toProto(java.awt.Color color) { +// float red = (float) color.getRed(); +// float green = (float) color.getGreen(); +// float blue = (float) color.getBlue(); +// float denominator = 255.0; +// Color.Builder resultBuilder = +// Color +// .newBuilder() +// .setRed(red / denominator) +// .setGreen(green / denominator) +// .setBlue(blue / denominator); +// int alpha = color.getAlpha(); +// if (alpha != 255) { +// result.setAlpha( +// FloatValue +// .newBuilder() +// .setValue(((float) alpha) / denominator) +// .build()); +// } +// return resultBuilder.build(); +// } +// // ... +// +// Example (iOS / Obj-C): +// +// // ... +// static UIColor* fromProto(Color* protocolor) { +// float red = [protocolor red]; +// float green = [protocolor green]; +// float blue = [protocolor blue]; +// FloatValue* alpha_wrapper = [protocolor alpha]; +// float alpha = 1.0; +// if (alpha_wrapper != nil) { +// alpha = [alpha_wrapper value]; +// } +// return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; +// } +// +// static Color* toProto(UIColor* color) { +// CGFloat red, green, blue, alpha; +// if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) { +// return nil; +// } +// Color* result = [Color alloc] init]; +// [result setRed:red]; +// [result setGreen:green]; +// [result setBlue:blue]; +// if (alpha <= 0.9999) { +// [result setAlpha:floatWrapperWithValue(alpha)]; +// } +// [result autorelease]; +// return result; +// } +// // ... +// +// Example (JavaScript): +// +// // ... +// +// var protoToCssColor = function(rgb_color) { +// var redFrac = rgb_color.red || 0.0; +// var greenFrac = rgb_color.green || 0.0; +// var blueFrac = rgb_color.blue || 0.0; +// var red = Math.floor(redFrac * 255); +// var green = Math.floor(greenFrac * 255); +// var blue = Math.floor(blueFrac * 255); +// +// if (!('alpha' in rgb_color)) { +// return rgbToCssColor_(red, green, blue); +// } +// +// var alphaFrac = rgb_color.alpha.value || 0.0; +// var rgbParams = [red, green, blue].join(','); +// return ['rgba(', rgbParams, ',', alphaFrac, ')'].join(''); +// }; +// +// var rgbToCssColor_ = function(red, green, blue) { +// var rgbNumber = new Number((red << 16) | (green << 8) | blue); +// var hexString = rgbNumber.toString(16); +// var missingZeros = 6 - hexString.length; +// var resultBuilder = ['#']; +// for (var i = 0; i < missingZeros; i++) { +// resultBuilder.push('0'); +// } +// resultBuilder.push(hexString); +// return resultBuilder.join(''); +// }; +// +// // ... +type Color struct { + // The amount of red in the color as a value in the interval [0, 1]. + Red float32 `protobuf:"fixed32,1,opt,name=red" json:"red,omitempty"` + // The amount of green in the color as a value in the interval [0, 1]. + Green float32 `protobuf:"fixed32,2,opt,name=green" json:"green,omitempty"` + // The amount of blue in the color as a value in the interval [0, 1]. + Blue float32 `protobuf:"fixed32,3,opt,name=blue" json:"blue,omitempty"` + // The fraction of this color that should be applied to the pixel. That is, + // the final pixel color is defined by the equation: + // + // pixel color = alpha * (this color) + (1.0 - alpha) * (background color) + // + // This means that a value of 1.0 corresponds to a solid color, whereas + // a value of 0.0 corresponds to a completely transparent color. This + // uses a wrapper message rather than a simple float scalar so that it is + // possible to distinguish between a default value and the value being unset. + // If omitted, this color object is to be rendered as a solid color + // (as if the alpha value had been explicitly given with a value of 1.0). + Alpha *google_protobuf.FloatValue `protobuf:"bytes,4,opt,name=alpha" json:"alpha,omitempty"` +} + +func (m *Color) Reset() { *m = Color{} } +func (m *Color) String() string { return proto.CompactTextString(m) } +func (*Color) ProtoMessage() {} +func (*Color) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *Color) GetRed() float32 { + if m != nil { + return m.Red + } + return 0 +} + +func (m *Color) GetGreen() float32 { + if m != nil { + return m.Green + } + return 0 +} + +func (m *Color) GetBlue() float32 { + if m != nil { + return m.Blue + } + return 0 +} + +func (m *Color) GetAlpha() *google_protobuf.FloatValue { + if m != nil { + return m.Alpha + } + return nil +} + +func init() { + proto.RegisterType((*Color)(nil), "google.type.Color") +} + +func init() { proto.RegisterFile("google/type/color.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 224 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x8f, 0x31, 0x4b, 0xc5, 0x30, + 0x10, 0xc7, 0x49, 0xfb, 0xea, 0x70, 0x6f, 0x50, 0x82, 0x60, 0x50, 0x90, 0x87, 0xd3, 0x9b, 0x12, + 0x54, 0x70, 0x71, 0xab, 0xa0, 0x6b, 0x29, 0xe2, 0x20, 0x38, 0xa4, 0xf5, 0x8c, 0x42, 0xec, 0x85, + 0xb4, 0x55, 0xfc, 0x3a, 0x7e, 0x52, 0xc9, 0xa5, 0x42, 0x97, 0x70, 0xb9, 0xdf, 0xef, 0x92, 0xff, + 0xc1, 0x89, 0x23, 0x72, 0x1e, 0xcd, 0xf4, 0x13, 0xd0, 0xf4, 0xe4, 0x29, 0xea, 0x10, 0x69, 0x22, + 0xb9, 0xcd, 0x40, 0x27, 0x70, 0x7a, 0xbe, 0x58, 0x8c, 0xba, 0xf9, 0xcd, 0x7c, 0x47, 0x1b, 0x02, + 0xc6, 0x31, 0xcb, 0x17, 0x5f, 0x50, 0xdd, 0xa5, 0x59, 0x79, 0x04, 0x65, 0xc4, 0x57, 0x25, 0x76, + 0x62, 0x5f, 0xb4, 0xa9, 0x94, 0xc7, 0x50, 0xb9, 0x88, 0x38, 0xa8, 0x82, 0x7b, 0xf9, 0x22, 0x25, + 0x6c, 0x3a, 0x3f, 0xa3, 0x2a, 0xb9, 0xc9, 0xb5, 0xbc, 0x84, 0xca, 0xfa, 0xf0, 0x6e, 0xd5, 0x66, + 0x27, 0xf6, 0xdb, 0xab, 0x33, 0xbd, 0x24, 0xf8, 0xff, 0x54, 0xdf, 0x7b, 0xb2, 0xd3, 0x93, 0xf5, + 0x33, 0xb6, 0xd9, 0xac, 0x5f, 0xe0, 0xb0, 0xa7, 0x4f, 0xbd, 0x8a, 0x5a, 0x03, 0x07, 0x69, 0xd2, + 0x4c, 0x23, 0x9e, 0x6f, 0x16, 0xe4, 0xc8, 0xdb, 0xc1, 0x69, 0x8a, 0xce, 0x38, 0x1c, 0xf8, 0x45, + 0x93, 0x91, 0x0d, 0x1f, 0xe3, 0x6a, 0xfb, 0x5b, 0x3e, 0x7f, 0x8b, 0xf2, 0xe1, 0xb1, 0xe9, 0x0e, + 0x58, 0xbc, 0xfe, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x42, 0x23, 0x2a, 0xd0, 0x25, 0x01, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/type/date/date.pb.go b/vendor/google.golang.org/genproto/googleapis/type/date/date.pb.go new file mode 100644 index 0000000000..40beaab091 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/type/date/date.pb.go @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/type/date.proto + +/* +Package date is a generated protocol buffer package. + +It is generated from these files: + google/type/date.proto + +It has these top-level messages: + Date +*/ +package date + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Represents a whole calendar date, e.g. date of birth. The time of day and +// time zone are either specified elsewhere or are not significant. The date +// is relative to the Proleptic Gregorian Calendar. The day may be 0 to +// represent a year and month where the day is not significant, e.g. credit card +// expiration date. The year may be 0 to represent a month and day independent +// of year, e.g. anniversary date. Related types are [google.type.TimeOfDay][google.type.TimeOfDay] +// and `google.protobuf.Timestamp`. +type Date struct { + // Year of date. Must be from 1 to 9999, or 0 if specifying a date without + // a year. + Year int32 `protobuf:"varint,1,opt,name=year" json:"year,omitempty"` + // Month of year. Must be from 1 to 12. + Month int32 `protobuf:"varint,2,opt,name=month" json:"month,omitempty"` + // Day of month. Must be from 1 to 31 and valid for the year and month, or 0 + // if specifying a year/month where the day is not significant. + Day int32 `protobuf:"varint,3,opt,name=day" json:"day,omitempty"` +} + +func (m *Date) Reset() { *m = Date{} } +func (m *Date) String() string { return proto.CompactTextString(m) } +func (*Date) ProtoMessage() {} +func (*Date) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *Date) GetYear() int32 { + if m != nil { + return m.Year + } + return 0 +} + +func (m *Date) GetMonth() int32 { + if m != nil { + return m.Month + } + return 0 +} + +func (m *Date) GetDay() int32 { + if m != nil { + return m.Day + } + return 0 +} + +func init() { + proto.RegisterType((*Date)(nil), "google.type.Date") +} + +func init() { proto.RegisterFile("google/type/date.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 172 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4b, 0xcf, 0xcf, 0x4f, + 0xcf, 0x49, 0xd5, 0x2f, 0xa9, 0x2c, 0x48, 0xd5, 0x4f, 0x49, 0x2c, 0x49, 0xd5, 0x2b, 0x28, 0xca, + 0x2f, 0xc9, 0x17, 0xe2, 0x86, 0x88, 0xeb, 0x81, 0xc4, 0x95, 0x9c, 0xb8, 0x58, 0x5c, 0x12, 0x4b, + 0x52, 0x85, 0x84, 0xb8, 0x58, 0x2a, 0x53, 0x13, 0x8b, 0x24, 0x18, 0x15, 0x18, 0x35, 0x58, 0x83, + 0xc0, 0x6c, 0x21, 0x11, 0x2e, 0xd6, 0xdc, 0xfc, 0xbc, 0x92, 0x0c, 0x09, 0x26, 0xb0, 0x20, 0x84, + 0x23, 0x24, 0xc0, 0xc5, 0x9c, 0x92, 0x58, 0x29, 0xc1, 0x0c, 0x16, 0x03, 0x31, 0x9d, 0x62, 0xb9, + 0xf8, 0x93, 0xf3, 0x73, 0xf5, 0x90, 0x8c, 0x75, 0xe2, 0x04, 0x19, 0x1a, 0x00, 0xb2, 0x2e, 0x80, + 0x31, 0xca, 0x04, 0x2a, 0x93, 0x9e, 0x9f, 0x93, 0x98, 0x97, 0xae, 0x97, 0x5f, 0x94, 0xae, 0x9f, + 0x9e, 0x9a, 0x07, 0x76, 0x8c, 0x3e, 0x44, 0x2a, 0xb1, 0x20, 0xb3, 0x18, 0xe1, 0x4e, 0x6b, 0x10, + 0xf1, 0x83, 0x91, 0x71, 0x11, 0x13, 0xb3, 0x7b, 0x48, 0x40, 0x12, 0x1b, 0x58, 0xa5, 0x31, 0x20, + 0x00, 0x00, 0xff, 0xff, 0x84, 0x95, 0xf3, 0x4c, 0xd0, 0x00, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/type/dayofweek/dayofweek.pb.go b/vendor/google.golang.org/genproto/googleapis/type/dayofweek/dayofweek.pb.go new file mode 100644 index 0000000000..eecd403fac --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/type/dayofweek/dayofweek.pb.go @@ -0,0 +1,100 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/type/dayofweek.proto + +/* +Package dayofweek is a generated protocol buffer package. + +It is generated from these files: + google/type/dayofweek.proto + +It has these top-level messages: +*/ +package dayofweek + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Represents a day of week. +type DayOfWeek int32 + +const ( + // The unspecified day-of-week. + DayOfWeek_DAY_OF_WEEK_UNSPECIFIED DayOfWeek = 0 + // The day-of-week of Monday. + DayOfWeek_MONDAY DayOfWeek = 1 + // The day-of-week of Tuesday. + DayOfWeek_TUESDAY DayOfWeek = 2 + // The day-of-week of Wednesday. + DayOfWeek_WEDNESDAY DayOfWeek = 3 + // The day-of-week of Thursday. + DayOfWeek_THURSDAY DayOfWeek = 4 + // The day-of-week of Friday. + DayOfWeek_FRIDAY DayOfWeek = 5 + // The day-of-week of Saturday. + DayOfWeek_SATURDAY DayOfWeek = 6 + // The day-of-week of Sunday. + DayOfWeek_SUNDAY DayOfWeek = 7 +) + +var DayOfWeek_name = map[int32]string{ + 0: "DAY_OF_WEEK_UNSPECIFIED", + 1: "MONDAY", + 2: "TUESDAY", + 3: "WEDNESDAY", + 4: "THURSDAY", + 5: "FRIDAY", + 6: "SATURDAY", + 7: "SUNDAY", +} +var DayOfWeek_value = map[string]int32{ + "DAY_OF_WEEK_UNSPECIFIED": 0, + "MONDAY": 1, + "TUESDAY": 2, + "WEDNESDAY": 3, + "THURSDAY": 4, + "FRIDAY": 5, + "SATURDAY": 6, + "SUNDAY": 7, +} + +func (x DayOfWeek) String() string { + return proto.EnumName(DayOfWeek_name, int32(x)) +} +func (DayOfWeek) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func init() { + proto.RegisterEnum("google.type.DayOfWeek", DayOfWeek_name, DayOfWeek_value) +} + +func init() { proto.RegisterFile("google/type/dayofweek.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 235 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, 0xa9, 0x2c, 0x48, 0xd5, 0x4f, 0x49, 0xac, 0xcc, 0x4f, 0x2b, 0x4f, 0x4d, + 0xcd, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x86, 0x48, 0xea, 0x81, 0x24, 0xb5, 0x5a, + 0x18, 0xb9, 0x38, 0x5d, 0x12, 0x2b, 0xfd, 0xd3, 0xc2, 0x53, 0x53, 0xb3, 0x85, 0xa4, 0xb9, 0xc4, + 0x5d, 0x1c, 0x23, 0xe3, 0xfd, 0xdd, 0xe2, 0xc3, 0x5d, 0x5d, 0xbd, 0xe3, 0x43, 0xfd, 0x82, 0x03, + 0x5c, 0x9d, 0x3d, 0xdd, 0x3c, 0x5d, 0x5d, 0x04, 0x18, 0x84, 0xb8, 0xb8, 0xd8, 0x7c, 0xfd, 0xfd, + 0x5c, 0x1c, 0x23, 0x05, 0x18, 0x85, 0xb8, 0xb9, 0xd8, 0x43, 0x42, 0x5d, 0x83, 0x41, 0x1c, 0x26, + 0x21, 0x5e, 0x2e, 0xce, 0x70, 0x57, 0x17, 0x3f, 0x08, 0x97, 0x59, 0x88, 0x87, 0x8b, 0x23, 0xc4, + 0x23, 0x34, 0x08, 0xcc, 0x63, 0x01, 0xe9, 0x72, 0x0b, 0xf2, 0x04, 0xb1, 0x59, 0x41, 0x32, 0xc1, + 0x8e, 0x21, 0xa1, 0x41, 0x20, 0x1e, 0x1b, 0x48, 0x26, 0x38, 0x14, 0x6c, 0x1e, 0xbb, 0x53, 0x26, + 0x17, 0x7f, 0x72, 0x7e, 0xae, 0x1e, 0x92, 0xcb, 0x9c, 0xf8, 0xe0, 0xce, 0x0a, 0x00, 0x39, 0x3b, + 0x80, 0x31, 0xca, 0x0e, 0x2a, 0x9d, 0x9e, 0x9f, 0x93, 0x98, 0x97, 0xae, 0x97, 0x5f, 0x94, 0xae, + 0x9f, 0x9e, 0x9a, 0x07, 0xf6, 0x94, 0x3e, 0x44, 0x2a, 0xb1, 0x20, 0xb3, 0x18, 0xcd, 0xd3, 0xd6, + 0x70, 0xd6, 0x22, 0x26, 0x66, 0xf7, 0x90, 0x80, 0x24, 0x36, 0xb0, 0x06, 0x63, 0x40, 0x00, 0x00, + 0x00, 0xff, 0xff, 0x6e, 0x23, 0xb2, 0xb3, 0x24, 0x01, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/type/latlng/latlng.pb.go b/vendor/google.golang.org/genproto/googleapis/type/latlng/latlng.pb.go new file mode 100644 index 0000000000..9a845f9c67 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/type/latlng/latlng.pb.go @@ -0,0 +1,114 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/type/latlng.proto + +/* +Package latlng is a generated protocol buffer package. + +It is generated from these files: + google/type/latlng.proto + +It has these top-level messages: + LatLng +*/ +package latlng + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// An object representing a latitude/longitude pair. This is expressed as a pair +// of doubles representing degrees latitude and degrees longitude. Unless +// specified otherwise, this must conform to the +// WGS84 +// standard. Values must be within normalized ranges. +// +// Example of normalization code in Python: +// +// def NormalizeLongitude(longitude): +// """Wraps decimal degrees longitude to [-180.0, 180.0].""" +// q, r = divmod(longitude, 360.0) +// if r > 180.0 or (r == 180.0 and q <= -1.0): +// return r - 360.0 +// return r +// +// def NormalizeLatLng(latitude, longitude): +// """Wraps decimal degrees latitude and longitude to +// [-90.0, 90.0] and [-180.0, 180.0], respectively.""" +// r = latitude % 360.0 +// if r <= 90.0: +// return r, NormalizeLongitude(longitude) +// elif r >= 270.0: +// return r - 360, NormalizeLongitude(longitude) +// else: +// return 180 - r, NormalizeLongitude(longitude + 180.0) +// +// assert 180.0 == NormalizeLongitude(180.0) +// assert -180.0 == NormalizeLongitude(-180.0) +// assert -179.0 == NormalizeLongitude(181.0) +// assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0) +// assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0) +// assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0) +// assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0) +// assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0) +// assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0) +// assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0) +// assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0) +// assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0) +// assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0) +type LatLng struct { + // The latitude in degrees. It must be in the range [-90.0, +90.0]. + Latitude float64 `protobuf:"fixed64,1,opt,name=latitude" json:"latitude,omitempty"` + // The longitude in degrees. It must be in the range [-180.0, +180.0]. + Longitude float64 `protobuf:"fixed64,2,opt,name=longitude" json:"longitude,omitempty"` +} + +func (m *LatLng) Reset() { *m = LatLng{} } +func (m *LatLng) String() string { return proto.CompactTextString(m) } +func (*LatLng) ProtoMessage() {} +func (*LatLng) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *LatLng) GetLatitude() float64 { + if m != nil { + return m.Latitude + } + return 0 +} + +func (m *LatLng) GetLongitude() float64 { + if m != nil { + return m.Longitude + } + return 0 +} + +func init() { + proto.RegisterType((*LatLng)(nil), "google.type.LatLng") +} + +func init() { proto.RegisterFile("google/type/latlng.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 165 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x48, 0xcf, 0xcf, 0x4f, + 0xcf, 0x49, 0xd5, 0x2f, 0xa9, 0x2c, 0x48, 0xd5, 0xcf, 0x49, 0x2c, 0xc9, 0xc9, 0x4b, 0xd7, 0x2b, + 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x86, 0xc8, 0xe8, 0x81, 0x64, 0x94, 0x9c, 0xb8, 0xd8, 0x7c, + 0x12, 0x4b, 0x7c, 0xf2, 0xd2, 0x85, 0xa4, 0xb8, 0x38, 0x72, 0x12, 0x4b, 0x32, 0x4b, 0x4a, 0x53, + 0x52, 0x25, 0x18, 0x15, 0x18, 0x35, 0x18, 0x83, 0xe0, 0x7c, 0x21, 0x19, 0x2e, 0xce, 0x9c, 0xfc, + 0xbc, 0x74, 0x88, 0x24, 0x13, 0x58, 0x12, 0x21, 0xe0, 0x94, 0xc0, 0xc5, 0x9f, 0x9c, 0x9f, 0xab, + 0x87, 0x64, 0xac, 0x13, 0x37, 0xc4, 0xd0, 0x00, 0x90, 0x85, 0x01, 0x8c, 0x51, 0x16, 0x50, 0xb9, + 0xf4, 0xfc, 0x9c, 0xc4, 0xbc, 0x74, 0xbd, 0xfc, 0xa2, 0x74, 0xfd, 0xf4, 0xd4, 0x3c, 0xb0, 0x73, + 0xf4, 0x21, 0x52, 0x89, 0x05, 0x99, 0xc5, 0xc8, 0x6e, 0xb5, 0x86, 0x50, 0x8b, 0x98, 0x98, 0xdd, + 0x43, 0x02, 0x92, 0xd8, 0xc0, 0x4a, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x69, 0x12, 0x54, + 0x1c, 0xd5, 0x00, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/type/money/money.pb.go b/vendor/google.golang.org/genproto/googleapis/type/money/money.pb.go new file mode 100644 index 0000000000..34bf8ab66e --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/type/money/money.pb.go @@ -0,0 +1,92 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/type/money.proto + +/* +Package money is a generated protocol buffer package. + +It is generated from these files: + google/type/money.proto + +It has these top-level messages: + Money +*/ +package money + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Represents an amount of money with its currency type. +type Money struct { + // The 3-letter currency code defined in ISO 4217. + CurrencyCode string `protobuf:"bytes,1,opt,name=currency_code,json=currencyCode" json:"currency_code,omitempty"` + // The whole units of the amount. + // For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. + Units int64 `protobuf:"varint,2,opt,name=units" json:"units,omitempty"` + // Number of nano (10^-9) units of the amount. + // The value must be between -999,999,999 and +999,999,999 inclusive. + // If `units` is positive, `nanos` must be positive or zero. + // If `units` is zero, `nanos` can be positive, zero, or negative. + // If `units` is negative, `nanos` must be negative or zero. + // For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. + Nanos int32 `protobuf:"varint,3,opt,name=nanos" json:"nanos,omitempty"` +} + +func (m *Money) Reset() { *m = Money{} } +func (m *Money) String() string { return proto.CompactTextString(m) } +func (*Money) ProtoMessage() {} +func (*Money) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *Money) GetCurrencyCode() string { + if m != nil { + return m.CurrencyCode + } + return "" +} + +func (m *Money) GetUnits() int64 { + if m != nil { + return m.Units + } + return 0 +} + +func (m *Money) GetNanos() int32 { + if m != nil { + return m.Nanos + } + return 0 +} + +func init() { + proto.RegisterType((*Money)(nil), "google.type.Money") +} + +func init() { proto.RegisterFile("google/type/money.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 190 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4f, 0xcf, 0xcf, 0x4f, + 0xcf, 0x49, 0xd5, 0x2f, 0xa9, 0x2c, 0x48, 0xd5, 0xcf, 0xcd, 0xcf, 0x4b, 0xad, 0xd4, 0x2b, 0x28, + 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x86, 0x48, 0xe8, 0x81, 0x24, 0x94, 0x22, 0xb8, 0x58, 0x7d, 0x41, + 0x72, 0x42, 0xca, 0x5c, 0xbc, 0xc9, 0xa5, 0x45, 0x45, 0xa9, 0x79, 0xc9, 0x95, 0xf1, 0xc9, 0xf9, + 0x29, 0xa9, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, 0x41, 0x3c, 0x30, 0x41, 0xe7, 0xfc, 0x94, 0x54, + 0x21, 0x11, 0x2e, 0xd6, 0xd2, 0xbc, 0xcc, 0x92, 0x62, 0x09, 0x26, 0x05, 0x46, 0x0d, 0xe6, 0x20, + 0x08, 0x07, 0x24, 0x9a, 0x97, 0x98, 0x97, 0x5f, 0x2c, 0xc1, 0xac, 0xc0, 0xa8, 0xc1, 0x1a, 0x04, + 0xe1, 0x38, 0xc5, 0x72, 0xf1, 0x27, 0xe7, 0xe7, 0xea, 0x21, 0x59, 0xe6, 0xc4, 0x05, 0xb6, 0x2a, + 0x00, 0xe4, 0x8a, 0x00, 0xc6, 0x28, 0x33, 0xa8, 0x54, 0x7a, 0x7e, 0x4e, 0x62, 0x5e, 0xba, 0x5e, + 0x7e, 0x51, 0xba, 0x7e, 0x7a, 0x6a, 0x1e, 0xd8, 0x8d, 0xfa, 0x10, 0xa9, 0xc4, 0x82, 0xcc, 0x62, + 0x24, 0xf7, 0x5b, 0x83, 0xc9, 0x45, 0x4c, 0xcc, 0xee, 0x21, 0x01, 0x49, 0x6c, 0x60, 0x85, 0xc6, + 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0xbf, 0xc2, 0x5b, 0xa5, 0xe7, 0x00, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/type/postaladdress/postal_address.pb.go b/vendor/google.golang.org/genproto/googleapis/type/postaladdress/postal_address.pb.go new file mode 100644 index 0000000000..430f3b4502 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/type/postaladdress/postal_address.pb.go @@ -0,0 +1,240 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/type/postal_address.proto + +/* +Package postaladdress is a generated protocol buffer package. + +It is generated from these files: + google/type/postal_address.proto + +It has these top-level messages: + PostalAddress +*/ +package postaladdress + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Represents a postal address, e.g. for postal delivery or payments addresses. +// Given a postal address, a postal service can deliver items to a premise, P.O. +// Box or similar. +// It is not intended to model geographical locations (roads, towns, +// mountains). +// +// In typical usage an address would be created via user input or from importing +// existing data, depending on the type of process. +// +// Advice on address input / editing: +// - Use an i18n-ready address widget such as +// https://github.com/googlei18n/libaddressinput) +// - Users should not be presented with UI elements for input or editing of +// fields outside countries where that field is used. +// +// For more guidance on how to use this schema, please see: +// https://support.google.com/business/answer/6397478 +type PostalAddress struct { + // The schema revision of the `PostalAddress`. + // All new revisions **must** be backward compatible with old revisions. + Revision int32 `protobuf:"varint,1,opt,name=revision" json:"revision,omitempty"` + // Required. CLDR region code of the country/region of the address. This + // is never inferred and it is up to the user to ensure the value is + // correct. See http://cldr.unicode.org/ and + // http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html + // for details. Example: "CH" for Switzerland. + RegionCode string `protobuf:"bytes,2,opt,name=region_code,json=regionCode" json:"region_code,omitempty"` + // Optional. BCP-47 language code of the contents of this address (if + // known). This is often the UI language of the input form or is expected + // to match one of the languages used in the address' country/region, or their + // transliterated equivalents. + // This can affect formatting in certain countries, but is not critical + // to the correctness of the data and will never affect any validation or + // other non-formatting related operations. + // + // If this value is not known, it should be omitted (rather than specifying a + // possibly incorrect default). + // + // Examples: "zh-Hant", "ja", "ja-Latn", "en". + LanguageCode string `protobuf:"bytes,3,opt,name=language_code,json=languageCode" json:"language_code,omitempty"` + // Optional. Postal code of the address. Not all countries use or require + // postal codes to be present, but where they are used, they may trigger + // additional validation with other parts of the address (e.g. state/zip + // validation in the U.S.A.). + PostalCode string `protobuf:"bytes,4,opt,name=postal_code,json=postalCode" json:"postal_code,omitempty"` + // Optional. Additional, country-specific, sorting code. This is not used + // in most regions. Where it is used, the value is either a string like + // "CEDEX", optionally followed by a number (e.g. "CEDEX 7"), or just a number + // alone, representing the "sector code" (Jamaica), "delivery area indicator" + // (Malawi) or "post office indicator" (e.g. Côte d'Ivoire). + SortingCode string `protobuf:"bytes,5,opt,name=sorting_code,json=sortingCode" json:"sorting_code,omitempty"` + // Optional. Highest administrative subdivision which is used for postal + // addresses of a country or region. + // For example, this can be a state, a province, an oblast, or a prefecture. + // Specifically, for Spain this is the province and not the autonomous + // community (e.g. "Barcelona" and not "Catalonia"). + // Many countries don't use an administrative area in postal addresses. E.g. + // in Switzerland this should be left unpopulated. + AdministrativeArea string `protobuf:"bytes,6,opt,name=administrative_area,json=administrativeArea" json:"administrative_area,omitempty"` + // Optional. Generally refers to the city/town portion of the address. + // Examples: US city, IT comune, UK post town. + // In regions of the world where localities are not well defined or do not fit + // into this structure well, leave locality empty and use address_lines. + Locality string `protobuf:"bytes,7,opt,name=locality" json:"locality,omitempty"` + // Optional. Sublocality of the address. + // For example, this can be neighborhoods, boroughs, districts. + Sublocality string `protobuf:"bytes,8,opt,name=sublocality" json:"sublocality,omitempty"` + // Unstructured address lines describing the lower levels of an address. + // + // Because values in address_lines do not have type information and may + // sometimes contain multiple values in a single field (e.g. + // "Austin, TX"), it is important that the line order is clear. The order of + // address lines should be "envelope order" for the country/region of the + // address. In places where this can vary (e.g. Japan), address_language is + // used to make it explicit (e.g. "ja" for large-to-small ordering and + // "ja-Latn" or "en" for small-to-large). This way, the most specific line of + // an address can be selected based on the language. + // + // The minimum permitted structural representation of an address consists + // of a region_code with all remaining information placed in the + // address_lines. It would be possible to format such an address very + // approximately without geocoding, but no semantic reasoning could be + // made about any of the address components until it was at least + // partially resolved. + // + // Creating an address only containing a region_code and address_lines, and + // then geocoding is the recommended way to handle completely unstructured + // addresses (as opposed to guessing which parts of the address should be + // localities or administrative areas). + AddressLines []string `protobuf:"bytes,9,rep,name=address_lines,json=addressLines" json:"address_lines,omitempty"` + // Optional. The recipient at the address. + // This field may, under certain circumstances, contain multiline information. + // For example, it might contain "care of" information. + Recipients []string `protobuf:"bytes,10,rep,name=recipients" json:"recipients,omitempty"` + // Optional. The name of the organization at the address. + Organization string `protobuf:"bytes,11,opt,name=organization" json:"organization,omitempty"` +} + +func (m *PostalAddress) Reset() { *m = PostalAddress{} } +func (m *PostalAddress) String() string { return proto.CompactTextString(m) } +func (*PostalAddress) ProtoMessage() {} +func (*PostalAddress) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *PostalAddress) GetRevision() int32 { + if m != nil { + return m.Revision + } + return 0 +} + +func (m *PostalAddress) GetRegionCode() string { + if m != nil { + return m.RegionCode + } + return "" +} + +func (m *PostalAddress) GetLanguageCode() string { + if m != nil { + return m.LanguageCode + } + return "" +} + +func (m *PostalAddress) GetPostalCode() string { + if m != nil { + return m.PostalCode + } + return "" +} + +func (m *PostalAddress) GetSortingCode() string { + if m != nil { + return m.SortingCode + } + return "" +} + +func (m *PostalAddress) GetAdministrativeArea() string { + if m != nil { + return m.AdministrativeArea + } + return "" +} + +func (m *PostalAddress) GetLocality() string { + if m != nil { + return m.Locality + } + return "" +} + +func (m *PostalAddress) GetSublocality() string { + if m != nil { + return m.Sublocality + } + return "" +} + +func (m *PostalAddress) GetAddressLines() []string { + if m != nil { + return m.AddressLines + } + return nil +} + +func (m *PostalAddress) GetRecipients() []string { + if m != nil { + return m.Recipients + } + return nil +} + +func (m *PostalAddress) GetOrganization() string { + if m != nil { + return m.Organization + } + return "" +} + +func init() { + proto.RegisterType((*PostalAddress)(nil), "google.type.PostalAddress") +} + +func init() { proto.RegisterFile("google/type/postal_address.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 338 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x92, 0x31, 0x6f, 0xea, 0x30, + 0x10, 0xc7, 0x15, 0xf2, 0xe0, 0xc1, 0x05, 0xf4, 0x24, 0xbf, 0x25, 0xea, 0x50, 0x52, 0xba, 0x30, + 0x25, 0x43, 0xc7, 0x4e, 0x50, 0xa9, 0x5d, 0x3a, 0x44, 0xa8, 0x53, 0x97, 0xc8, 0x24, 0x27, 0xcb, + 0x52, 0xf0, 0x45, 0xb6, 0x41, 0xa2, 0xdf, 0xa1, 0x5f, 0xa2, 0x9f, 0xb4, 0xb2, 0x9d, 0xd2, 0x30, + 0xde, 0xef, 0x7e, 0x49, 0xee, 0xee, 0x1f, 0xc8, 0x04, 0x91, 0x68, 0xb1, 0xb0, 0xe7, 0x0e, 0x8b, + 0x8e, 0x8c, 0xe5, 0x6d, 0xc5, 0x9b, 0x46, 0xa3, 0x31, 0x79, 0xa7, 0xc9, 0x12, 0x4b, 0x82, 0x91, + 0x3b, 0x63, 0xf5, 0x19, 0xc3, 0xa2, 0xf4, 0xd6, 0x26, 0x48, 0xec, 0x06, 0xa6, 0x1a, 0x4f, 0xd2, + 0x48, 0x52, 0x69, 0x94, 0x45, 0xeb, 0xf1, 0xee, 0x52, 0xb3, 0x25, 0x24, 0x1a, 0x85, 0x24, 0x55, + 0xd5, 0xd4, 0x60, 0x3a, 0xca, 0xa2, 0xf5, 0x6c, 0x07, 0x01, 0x3d, 0x51, 0x83, 0xec, 0x1e, 0x16, + 0x2d, 0x57, 0xe2, 0xc8, 0x05, 0x06, 0x25, 0xf6, 0xca, 0xfc, 0x07, 0x7a, 0x69, 0x09, 0x49, 0x3f, + 0x98, 0x57, 0xfe, 0x84, 0xb7, 0x04, 0xe4, 0x85, 0x3b, 0x98, 0x1b, 0xd2, 0x56, 0x2a, 0x11, 0x8c, + 0xb1, 0x37, 0x92, 0x9e, 0x79, 0xa5, 0x80, 0xff, 0xbc, 0x39, 0x48, 0x25, 0x8d, 0xd5, 0xdc, 0xca, + 0x13, 0x56, 0x5c, 0x23, 0x4f, 0x27, 0xde, 0x64, 0xd7, 0xad, 0x8d, 0x46, 0xee, 0xd6, 0x6a, 0xa9, + 0xe6, 0xad, 0xb4, 0xe7, 0xf4, 0xaf, 0xb7, 0x2e, 0x35, 0xcb, 0x20, 0x31, 0xc7, 0xfd, 0xa5, 0x3d, + 0xed, 0x3f, 0xf7, 0x8b, 0xdc, 0x5e, 0xfd, 0x11, 0xab, 0x56, 0x2a, 0x34, 0xe9, 0x2c, 0x8b, 0xdd, + 0x5e, 0x3d, 0x7c, 0x75, 0x8c, 0xdd, 0x02, 0x68, 0xac, 0x65, 0x27, 0x51, 0x59, 0x93, 0x82, 0x37, + 0x06, 0x84, 0xad, 0x60, 0x4e, 0x5a, 0x70, 0x25, 0x3f, 0xb8, 0x75, 0xd7, 0x4d, 0xc2, 0x6d, 0x86, + 0x6c, 0x7b, 0x84, 0x7f, 0x35, 0x1d, 0xf2, 0x41, 0x44, 0x5b, 0x76, 0x95, 0x4f, 0xe9, 0x32, 0x2c, + 0xa3, 0xf7, 0xe7, 0x5e, 0x11, 0xe4, 0x6e, 0x9b, 0x93, 0x16, 0x85, 0x40, 0xe5, 0x13, 0x2e, 0x42, + 0x8b, 0x77, 0xd2, 0x0c, 0x7f, 0x83, 0x7e, 0xd6, 0xc7, 0xab, 0xea, 0x6b, 0x14, 0xbf, 0xbc, 0x95, + 0xfb, 0x89, 0x7f, 0xf0, 0xe1, 0x3b, 0x00, 0x00, 0xff, 0xff, 0xda, 0x86, 0xd3, 0x22, 0x3e, 0x02, + 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/type/timeofday/timeofday.pb.go b/vendor/google.golang.org/genproto/googleapis/type/timeofday/timeofday.pb.go new file mode 100644 index 0000000000..703c74c213 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/type/timeofday/timeofday.pb.go @@ -0,0 +1,100 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/type/timeofday.proto + +/* +Package timeofday is a generated protocol buffer package. + +It is generated from these files: + google/type/timeofday.proto + +It has these top-level messages: + TimeOfDay +*/ +package timeofday + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Represents a time of day. The date and time zone are either not significant +// or are specified elsewhere. An API may chose to allow leap seconds. Related +// types are [google.type.Date][google.type.Date] and `google.protobuf.Timestamp`. +type TimeOfDay struct { + // Hours of day in 24 hour format. Should be from 0 to 23. An API may choose + // to allow the value "24:00:00" for scenarios like business closing time. + Hours int32 `protobuf:"varint,1,opt,name=hours" json:"hours,omitempty"` + // Minutes of hour of day. Must be from 0 to 59. + Minutes int32 `protobuf:"varint,2,opt,name=minutes" json:"minutes,omitempty"` + // Seconds of minutes of the time. Must normally be from 0 to 59. An API may + // allow the value 60 if it allows leap-seconds. + Seconds int32 `protobuf:"varint,3,opt,name=seconds" json:"seconds,omitempty"` + // Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. + Nanos int32 `protobuf:"varint,4,opt,name=nanos" json:"nanos,omitempty"` +} + +func (m *TimeOfDay) Reset() { *m = TimeOfDay{} } +func (m *TimeOfDay) String() string { return proto.CompactTextString(m) } +func (*TimeOfDay) ProtoMessage() {} +func (*TimeOfDay) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *TimeOfDay) GetHours() int32 { + if m != nil { + return m.Hours + } + return 0 +} + +func (m *TimeOfDay) GetMinutes() int32 { + if m != nil { + return m.Minutes + } + return 0 +} + +func (m *TimeOfDay) GetSeconds() int32 { + if m != nil { + return m.Seconds + } + return 0 +} + +func (m *TimeOfDay) GetNanos() int32 { + if m != nil { + return m.Nanos + } + return 0 +} + +func init() { + proto.RegisterType((*TimeOfDay)(nil), "google.type.TimeOfDay") +} + +func init() { proto.RegisterFile("google/type/timeofday.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 198 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, 0xa9, 0x2c, 0x48, 0xd5, 0x2f, 0xc9, 0xcc, 0x4d, 0xcd, 0x4f, 0x4b, 0x49, + 0xac, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x86, 0x48, 0xea, 0x81, 0x24, 0x95, 0xb2, + 0xb9, 0x38, 0x43, 0x32, 0x73, 0x53, 0xfd, 0xd3, 0x5c, 0x12, 0x2b, 0x85, 0x44, 0xb8, 0x58, 0x33, + 0xf2, 0x4b, 0x8b, 0x8a, 0x25, 0x18, 0x15, 0x18, 0x35, 0x58, 0x83, 0x20, 0x1c, 0x21, 0x09, 0x2e, + 0xf6, 0xdc, 0xcc, 0xbc, 0xd2, 0x92, 0xd4, 0x62, 0x09, 0x26, 0xb0, 0x38, 0x8c, 0x0b, 0x92, 0x29, + 0x4e, 0x4d, 0xce, 0xcf, 0x4b, 0x29, 0x96, 0x60, 0x86, 0xc8, 0x40, 0xb9, 0x20, 0x93, 0xf2, 0x12, + 0xf3, 0xf2, 0x8b, 0x25, 0x58, 0x20, 0x26, 0x81, 0x39, 0x4e, 0x99, 0x5c, 0xfc, 0xc9, 0xf9, 0xb9, + 0x7a, 0x48, 0xf6, 0x3b, 0xf1, 0xc1, 0x6d, 0x0f, 0x00, 0x39, 0x2e, 0x80, 0x31, 0xca, 0x0e, 0x2a, + 0x9d, 0x9e, 0x9f, 0x93, 0x98, 0x97, 0xae, 0x97, 0x5f, 0x94, 0xae, 0x9f, 0x9e, 0x9a, 0x07, 0x76, + 0xba, 0x3e, 0x44, 0x2a, 0xb1, 0x20, 0xb3, 0x18, 0xcd, 0x6b, 0xd6, 0x70, 0xd6, 0x22, 0x26, 0x66, + 0xf7, 0x90, 0x80, 0x24, 0x36, 0xb0, 0x06, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x47, 0x79, + 0x6a, 0x06, 0x0a, 0x01, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/googleapis/watcher/v1/watch.pb.go b/vendor/google.golang.org/genproto/googleapis/watcher/v1/watch.pb.go new file mode 100644 index 0000000000..c3128144ea --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/watcher/v1/watch.pb.go @@ -0,0 +1,376 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/watcher/v1/watch.proto + +/* +Package watcher is a generated protocol buffer package. + +It is generated from these files: + google/watcher/v1/watch.proto + +It has these top-level messages: + Request + ChangeBatch + Change +*/ +package watcher + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import google_protobuf1 "github.com/golang/protobuf/ptypes/any" +import _ "github.com/golang/protobuf/ptypes/empty" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// A reported value can be in one of the following states: +type Change_State int32 + +const ( + // The element exists and its full value is included in data. + Change_EXISTS Change_State = 0 + // The element does not exist. + Change_DOES_NOT_EXIST Change_State = 1 + // Element may or may not exist. Used only for initial state delivery when + // the client is not interested in fetching the initial state. See the + // "Initial State" section above. + Change_INITIAL_STATE_SKIPPED Change_State = 2 + // The element may exist, but some error has occurred. More information is + // available in the data field - the value is a serialized Status + // proto (from [google.rpc.Status][]) + Change_ERROR Change_State = 3 +) + +var Change_State_name = map[int32]string{ + 0: "EXISTS", + 1: "DOES_NOT_EXIST", + 2: "INITIAL_STATE_SKIPPED", + 3: "ERROR", +} +var Change_State_value = map[string]int32{ + "EXISTS": 0, + "DOES_NOT_EXIST": 1, + "INITIAL_STATE_SKIPPED": 2, + "ERROR": 3, +} + +func (x Change_State) String() string { + return proto.EnumName(Change_State_name, int32(x)) +} +func (Change_State) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{2, 0} } + +// The message used by the client to register interest in an entity. +type Request struct { + // The `target` value **must** be a valid URL path pointing to an entity + // to watch. Note that the service name **must** be + // removed from the target field (e.g., the target field must say + // "/foo/bar", not "myservice.googleapis.com/foo/bar"). A client is + // also allowed to pass system-specific parameters in the URL that + // are only obeyed by some implementations. Some parameters will be + // implementation-specific. However, some have predefined meaning + // and are listed here: + // + // * recursive = true|false [default=false] + // If set to true, indicates that the client wants to watch all elements + // of entities in the subtree rooted at the entity's name in `target`. For + // descendants that are not the immediate children of the target, the + // `Change.element` will contain slashes. + // + // Note that some namespaces and entities will not support recursive + // watching. When watching such an entity, a client must not set recursive + // to true. Otherwise, it will receive an `UNIMPLEMENTED` error. + // + // Normal URL encoding must be used inside `target`. For example, if a query + // parameter name or value, or the non-query parameter portion of `target` + // contains a special character, it must be %-encoded. We recommend that + // clients and servers use their runtime's URL library to produce and consume + // target values. + Target string `protobuf:"bytes,1,opt,name=target" json:"target,omitempty"` + // The `resume_marker` specifies how much of the existing underlying state is + // delivered to the client when the watch request is received by the + // system. The client can set this marker in one of the following ways to get + // different semantics: + // + // * Parameter is not specified or has the value "". + // Semantics: Fetch initial state. + // The client wants the entity's initial state to be delivered. See the + // description in "Initial State". + // + // * Parameter is set to the string "now" (UTF-8 encoding). + // Semantics: Fetch new changes only. + // The client just wants to get the changes received by the system after + // the watch point. The system may deliver changes from before the watch + // point as well. + // + // * Parameter is set to a value received in an earlier + // `Change.resume_marker` field while watching the same entity. + // Semantics: Resume from a specific point. + // The client wants to receive the changes from a specific point; this + // value must correspond to a value received in the `Change.resume_marker` + // field. The system may deliver changes from before the `resume_marker` + // as well. If the system cannot resume the stream from this point (e.g., + // if it is too far behind in the stream), it can raise the + // `FAILED_PRECONDITION` error. + // + // An implementation MUST support an unspecified parameter and the + // empty string "" marker (initial state fetching) and the "now" marker. + // It need not support resuming from a specific point. + ResumeMarker []byte `protobuf:"bytes,2,opt,name=resume_marker,json=resumeMarker,proto3" json:"resume_marker,omitempty"` +} + +func (m *Request) Reset() { *m = Request{} } +func (m *Request) String() string { return proto.CompactTextString(m) } +func (*Request) ProtoMessage() {} +func (*Request) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *Request) GetTarget() string { + if m != nil { + return m.Target + } + return "" +} + +func (m *Request) GetResumeMarker() []byte { + if m != nil { + return m.ResumeMarker + } + return nil +} + +// A batch of Change messages. +type ChangeBatch struct { + // A list of Change messages. + Changes []*Change `protobuf:"bytes,1,rep,name=changes" json:"changes,omitempty"` +} + +func (m *ChangeBatch) Reset() { *m = ChangeBatch{} } +func (m *ChangeBatch) String() string { return proto.CompactTextString(m) } +func (*ChangeBatch) ProtoMessage() {} +func (*ChangeBatch) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *ChangeBatch) GetChanges() []*Change { + if m != nil { + return m.Changes + } + return nil +} + +// A Change indicates the most recent state of an element. +type Change struct { + // Name of the element, interpreted relative to the entity's actual + // name. "" refers to the entity itself. The element name is a valid + // UTF-8 string. + Element string `protobuf:"bytes,1,opt,name=element" json:"element,omitempty"` + // The state of the `element`. + State Change_State `protobuf:"varint,2,opt,name=state,enum=google.watcher.v1.Change_State" json:"state,omitempty"` + // The actual change data. This field is present only when `state() == EXISTS` + // or `state() == ERROR`. Please see [google.protobuf.Any][google.protobuf.Any] about how to use + // the Any type. + Data *google_protobuf1.Any `protobuf:"bytes,6,opt,name=data" json:"data,omitempty"` + // If present, provides a compact representation of all the messages that have + // been received by the caller for the given entity, e.g., it could be a + // sequence number or a multi-part timestamp/version vector. This marker can + // be provided in the Request message, allowing the caller to resume the stream + // watching at a specific point without fetching the initial state. + ResumeMarker []byte `protobuf:"bytes,4,opt,name=resume_marker,json=resumeMarker,proto3" json:"resume_marker,omitempty"` + // If true, this Change is followed by more Changes that are in the same group + // as this Change. + Continued bool `protobuf:"varint,5,opt,name=continued" json:"continued,omitempty"` +} + +func (m *Change) Reset() { *m = Change{} } +func (m *Change) String() string { return proto.CompactTextString(m) } +func (*Change) ProtoMessage() {} +func (*Change) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *Change) GetElement() string { + if m != nil { + return m.Element + } + return "" +} + +func (m *Change) GetState() Change_State { + if m != nil { + return m.State + } + return Change_EXISTS +} + +func (m *Change) GetData() *google_protobuf1.Any { + if m != nil { + return m.Data + } + return nil +} + +func (m *Change) GetResumeMarker() []byte { + if m != nil { + return m.ResumeMarker + } + return nil +} + +func (m *Change) GetContinued() bool { + if m != nil { + return m.Continued + } + return false +} + +func init() { + proto.RegisterType((*Request)(nil), "google.watcher.v1.Request") + proto.RegisterType((*ChangeBatch)(nil), "google.watcher.v1.ChangeBatch") + proto.RegisterType((*Change)(nil), "google.watcher.v1.Change") + proto.RegisterEnum("google.watcher.v1.Change_State", Change_State_name, Change_State_value) +} + +// 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 + +// Client API for Watcher service + +type WatcherClient interface { + // Start a streaming RPC to get watch information from the server. + Watch(ctx context.Context, in *Request, opts ...grpc.CallOption) (Watcher_WatchClient, error) +} + +type watcherClient struct { + cc *grpc.ClientConn +} + +func NewWatcherClient(cc *grpc.ClientConn) WatcherClient { + return &watcherClient{cc} +} + +func (c *watcherClient) Watch(ctx context.Context, in *Request, opts ...grpc.CallOption) (Watcher_WatchClient, error) { + stream, err := grpc.NewClientStream(ctx, &_Watcher_serviceDesc.Streams[0], c.cc, "/google.watcher.v1.Watcher/Watch", opts...) + if err != nil { + return nil, err + } + x := &watcherWatchClient{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 Watcher_WatchClient interface { + Recv() (*ChangeBatch, error) + grpc.ClientStream +} + +type watcherWatchClient struct { + grpc.ClientStream +} + +func (x *watcherWatchClient) Recv() (*ChangeBatch, error) { + m := new(ChangeBatch) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// Server API for Watcher service + +type WatcherServer interface { + // Start a streaming RPC to get watch information from the server. + Watch(*Request, Watcher_WatchServer) error +} + +func RegisterWatcherServer(s *grpc.Server, srv WatcherServer) { + s.RegisterService(&_Watcher_serviceDesc, srv) +} + +func _Watcher_Watch_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(Request) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(WatcherServer).Watch(m, &watcherWatchServer{stream}) +} + +type Watcher_WatchServer interface { + Send(*ChangeBatch) error + grpc.ServerStream +} + +type watcherWatchServer struct { + grpc.ServerStream +} + +func (x *watcherWatchServer) Send(m *ChangeBatch) error { + return x.ServerStream.SendMsg(m) +} + +var _Watcher_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.watcher.v1.Watcher", + HandlerType: (*WatcherServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "Watch", + Handler: _Watcher_Watch_Handler, + ServerStreams: true, + }, + }, + Metadata: "google/watcher/v1/watch.proto", +} + +func init() { proto.RegisterFile("google/watcher/v1/watch.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 449 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0xdd, 0x6e, 0xd3, 0x30, + 0x14, 0xc6, 0xdd, 0x92, 0xd2, 0xd3, 0x31, 0x75, 0x16, 0x43, 0x69, 0x19, 0x10, 0x85, 0x9b, 0x5c, + 0x25, 0xac, 0x13, 0x12, 0x12, 0x57, 0x2d, 0x0b, 0x52, 0x04, 0x5b, 0x2b, 0x27, 0x12, 0x13, 0x37, + 0x91, 0x97, 0x99, 0xac, 0xa2, 0xb1, 0x4b, 0xe2, 0x0e, 0xed, 0x96, 0x57, 0x40, 0x3c, 0x19, 0xaf, + 0xc0, 0x83, 0xa0, 0xda, 0x0e, 0x20, 0xb2, 0xde, 0x9d, 0xf3, 0xfd, 0xd8, 0xe7, 0x3b, 0x36, 0x3c, + 0x29, 0x84, 0x28, 0x96, 0x2c, 0xfc, 0x4a, 0x65,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x30, 0xe1, 0xb7, 0x44, + 0x29, 0xda, 0x71, 0x77, 0xdb, 0x71, 0xf1, 0x11, 0xf4, 0x72, 0xc1, 0xe5, 0x82, 0xaf, 0xd9, 0x95, + 0x63, 0xb9, 0xc8, 0xbf, 0x4f, 0xfe, 0x02, 0xde, 0x19, 0x58, 0xea, 0x72, 0x0c, 0x60, 0x47, 0x17, + 0x71, 0x92, 0x26, 0x83, 0x7b, 0x18, 0xc3, 0xfe, 0xe9, 0x2c, 0x4a, 0xb2, 0xf3, 0x59, 0x9a, 0x29, + 0x70, 0x80, 0xf0, 0x10, 0x0e, 0xe3, 0xf3, 0x38, 0x8d, 0x27, 0xef, 0xb3, 0x24, 0x9d, 0xa4, 0x51, + 0x96, 0xbc, 0x8b, 0xe7, 0xf3, 0xe8, 0x74, 0xd0, 0xc1, 0x3d, 0xb0, 0x22, 0x42, 0x66, 0x64, 0xb0, + 0x33, 0xce, 0xa1, 0xfb, 0x41, 0xa7, 0xc3, 0x17, 0x60, 0xa9, 0x12, 0x8f, 0xee, 0xc8, 0x6d, 0x1e, + 0x72, 0xf4, 0x74, 0xeb, 0x4e, 0xd4, 0xe3, 0x78, 0x07, 0xdf, 0x7e, 0xfe, 0xfa, 0xde, 0xe9, 0xe3, + 0xde, 0x9f, 0x5f, 0xf7, 0x02, 0x4d, 0x33, 0x38, 0xcc, 0x45, 0xd9, 0x76, 0x4e, 0x41, 0x5d, 0x38, + 0xdf, 0x2c, 0x6a, 0x8e, 0x3e, 0xbe, 0x32, 0x82, 0x42, 0x2c, 0x29, 0x2f, 0x02, 0x51, 0x15, 0x61, + 0xc1, 0xb8, 0x5a, 0x63, 0xa8, 0x29, 0xba, 0x5a, 0xd4, 0xff, 0x7c, 0xeb, 0xd7, 0xa6, 0xbc, 0xb4, + 0x95, 0xe8, 0xe4, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x48, 0x0a, 0xba, 0x6c, 0xfa, 0x02, 0x00, + 0x00, +} diff --git a/vendor/google.golang.org/genproto/protobuf/api/api.pb.go b/vendor/google.golang.org/genproto/protobuf/api/api.pb.go new file mode 100644 index 0000000000..d41ce3c668 --- /dev/null +++ b/vendor/google.golang.org/genproto/protobuf/api/api.pb.go @@ -0,0 +1,350 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/protobuf/api.proto + +/* +Package api is a generated protocol buffer package. + +It is generated from these files: + google/protobuf/api.proto + +It has these top-level messages: + Api + Method + Mixin +*/ +package api + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import google_protobuf "google.golang.org/genproto/protobuf/source_context" +import google_protobuf2 "google.golang.org/genproto/protobuf/ptype" + +// 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.ProtoPackageIsVersion2 // 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" json:"name,omitempty"` + // The methods of this interface, in unspecified order. + Methods []*Method `protobuf:"bytes,2,rep,name=methods" json:"methods,omitempty"` + // Any metadata attached to the interface. + Options []*google_protobuf2.Option `protobuf:"bytes,3,rep,name=options" 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" json:"version,omitempty"` + // Source context for the protocol buffer service represented by this + // message. + SourceContext *google_protobuf.SourceContext `protobuf:"bytes,5,opt,name=source_context,json=sourceContext" json:"source_context,omitempty"` + // Included interfaces. See [Mixin][]. + Mixins []*Mixin `protobuf:"bytes,6,rep,name=mixins" json:"mixins,omitempty"` + // The source syntax of the service. + Syntax google_protobuf2.Syntax `protobuf:"varint,7,opt,name=syntax,enum=google.protobuf.Syntax" json:"syntax,omitempty"` +} + +func (m *Api) Reset() { *m = Api{} } +func (m *Api) String() string { return proto.CompactTextString(m) } +func (*Api) ProtoMessage() {} +func (*Api) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +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() []*google_protobuf2.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() *google_protobuf.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() google_protobuf2.Syntax { + if m != nil { + return m.Syntax + } + return google_protobuf2.Syntax_SYNTAX_PROTO2 +} + +// 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" json:"name,omitempty"` + // A URL of the input message type. + RequestTypeUrl string `protobuf:"bytes,2,opt,name=request_type_url,json=requestTypeUrl" json:"request_type_url,omitempty"` + // If true, the request is streamed. + RequestStreaming bool `protobuf:"varint,3,opt,name=request_streaming,json=requestStreaming" json:"request_streaming,omitempty"` + // The URL of the output message type. + ResponseTypeUrl string `protobuf:"bytes,4,opt,name=response_type_url,json=responseTypeUrl" json:"response_type_url,omitempty"` + // If true, the response is streamed. + ResponseStreaming bool `protobuf:"varint,5,opt,name=response_streaming,json=responseStreaming" json:"response_streaming,omitempty"` + // Any metadata attached to the method. + Options []*google_protobuf2.Option `protobuf:"bytes,6,rep,name=options" json:"options,omitempty"` + // The source syntax of this method. + Syntax google_protobuf2.Syntax `protobuf:"varint,7,opt,name=syntax,enum=google.protobuf.Syntax" json:"syntax,omitempty"` +} + +func (m *Method) Reset() { *m = Method{} } +func (m *Method) String() string { return proto.CompactTextString(m) } +func (*Method) ProtoMessage() {} +func (*Method) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +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() []*google_protobuf2.Option { + if m != nil { + return m.Options + } + return nil +} + +func (m *Method) GetSyntax() google_protobuf2.Syntax { + if m != nil { + return m.Syntax + } + return google_protobuf2.Syntax_SYNTAX_PROTO2 +} + +// 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" json:"name,omitempty"` + // If non-empty specifies a path under which inherited HTTP paths + // are rooted. + Root string `protobuf:"bytes,2,opt,name=root" json:"root,omitempty"` +} + +func (m *Mixin) Reset() { *m = Mixin{} } +func (m *Mixin) String() string { return proto.CompactTextString(m) } +func (*Mixin) ProtoMessage() {} +func (*Mixin) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +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 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", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 432 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x93, 0xcf, 0x8e, 0xd3, 0x30, + 0x10, 0xc6, 0x95, 0xa4, 0x4d, 0x17, 0xaf, 0xe8, 0x82, 0x91, 0xc0, 0xf4, 0xb0, 0x8a, 0x56, 0x1c, + 0x22, 0x2a, 0x12, 0x51, 0x8e, 0x9c, 0x5a, 0x84, 0x7a, 0x40, 0x88, 0x28, 0x05, 0x21, 0x71, 0xa9, + 0xd2, 0x62, 0x82, 0xa5, 0xc4, 0x63, 0x6c, 0x07, 0xda, 0xd7, 0xe1, 0xc8, 0x91, 0x37, 0xe0, 0xcd, + 0x50, 0x9c, 0xb8, 0x7f, 0xd2, 0x22, 0xb1, 0x37, 0x8f, 0xbf, 0xdf, 0x7c, 0x99, 0xf9, 0xac, 0xa0, + 0xc7, 0x39, 0x40, 0x5e, 0xd0, 0x58, 0x48, 0xd0, 0xb0, 0xaa, 0xbe, 0xc4, 0x99, 0x60, 0x91, 0x29, + 0xf0, 0x55, 0x23, 0x45, 0x56, 0x1a, 0x3d, 0xe9, 0xb2, 0x0a, 0x2a, 0xb9, 0xa6, 0xcb, 0x35, 0x70, + 0x4d, 0x37, 0xba, 0x01, 0x47, 0xa3, 0x2e, 0xa5, 0xb7, 0xa2, 0x35, 0xb9, 0xf9, 0xe3, 0x22, 0x6f, + 0x2a, 0x18, 0xc6, 0xa8, 0xc7, 0xb3, 0x92, 0x12, 0x27, 0x70, 0xc2, 0x3b, 0xa9, 0x39, 0xe3, 0xe7, + 0x68, 0x50, 0x52, 0xfd, 0x15, 0x3e,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fa, 0xe0, 0x15, 0xfd, 0xff, + 0x7c, 0xc5, 0x5b, 0x87, 0x16, 0xa3, 0xbe, 0x89, 0xfd, 0x6c, 0x64, 0x18, 0xf5, 0x24, 0x80, 0x6e, + 0x63, 0x32, 0xe7, 0x59, 0x85, 0x1e, 0xac, 0xa1, 0xec, 0xda, 0xce, 0x2e, 0xa6, 0x82, 0x25, 0x75, + 0x91, 0x38, 0x9f, 0xc6, 0xad, 0x98, 0x43, 0x91, 0xf1, 0x3c, 0x02, 0x99, 0xc7, 0x39, 0xe5, 0x06, + 0x3d, 0xfa, 0x9d, 0x5e, 0x66, 0x82, 0xfd, 0x74, 0xbd, 0x79, 0x32, 0xfb, 0xe5, 0x5e, 0xcf, 0x9b, + 0x9e, 0xc4, 0xce, 0xf9, 0x91, 0x16, 0xc5, 0x1b, 0x0e, 0x3f, 0x78, 0x1d, 0x9e, 0x5a, 0xf9, 0xa6, + 0xf1, 0xc5, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xfe, 0x07, 0x73, 0x11, 0x97, 0x03, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/protobuf/field_mask/field_mask.pb.go b/vendor/google.golang.org/genproto/protobuf/field_mask/field_mask.pb.go new file mode 100644 index 0000000000..485bf0066f --- /dev/null +++ b/vendor/google.golang.org/genproto/protobuf/field_mask/field_mask.pb.go @@ -0,0 +1,267 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/protobuf/field_mask.proto + +/* +Package field_mask is a generated protocol buffer package. + +It is generated from these files: + google/protobuf/field_mask.proto + +It has these top-level messages: + FieldMask +*/ +package field_mask + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import 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.ProtoPackageIsVersion2 // 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, the existing +// repeated values in the target resource will be overwritten by the new values. +// 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 the existing sub-message in the target resource is +// overwritten. Given the target message: +// +// f { +// b { +// d : 1 +// x : 2 +// } +// c : 1 +// } +// +// And an update message: +// +// f { +// b { +// d : 10 +// } +// } +// +// then if the field mask is: +// +// paths: "f.b" +// +// then the result will be: +// +// f { +// b { +// d : 10 +// } +// c : 1 +// } +// +// However, if the update mask was: +// +// paths: "f.b.d" +// +// then the result would be: +// +// f { +// b { +// d : 10 +// x : 2 +// } +// c : 1 +// } +// +// 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. +type FieldMask struct { + // The set of field mask paths. + Paths []string `protobuf:"bytes,1,rep,name=paths" json:"paths,omitempty"` +} + +func (m *FieldMask) Reset() { *m = FieldMask{} } +func (m *FieldMask) String() string { return proto.CompactTextString(m) } +func (*FieldMask) ProtoMessage() {} +func (*FieldMask) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *FieldMask) GetPaths() []string { + if m != nil { + return m.Paths + } + return nil +} + +func init() { + proto.RegisterType((*FieldMask)(nil), "google.protobuf.FieldMask") +} + +func init() { proto.RegisterFile("google/protobuf/field_mask.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 171 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, 0x9d, 0x8c, + 0x5c, 0xc2, 0xc9, 0xf9, 0xb9, 0x7a, 0x68, 0x5a, 0x9d, 0xf8, 0xe0, 0x1a, 0x03, 0x40, 0x42, 0x01, + 0x8c, 0x51, 0x96, 0x50, 0x25, 0xe9, 0xf9, 0x39, 0x89, 0x79, 0xe9, 0x7a, 0xf9, 0x45, 0xe9, 0xfa, + 0xe9, 0xa9, 0x79, 0x60, 0x0d, 0xd8, 0xdc, 0x64, 0x8d, 0x60, 0x2e, 0x62, 0x62, 0x76, 0x0f, 0x70, + 0x5a, 0xc5, 0x24, 0xe7, 0x0e, 0x31, 0x21, 0x00, 0xaa, 0x5a, 0x2f, 0x3c, 0x35, 0x27, 0xc7, 0x3b, + 0x2f, 0xbf, 0x3c, 0x2f, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0x6c, 0x8c, 0x31, 0x20, 0x00, + 0x00, 0xff, 0xff, 0x5a, 0xdb, 0x3a, 0xc0, 0xea, 0x00, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/protobuf/ptype/type.pb.go b/vendor/google.golang.org/genproto/protobuf/ptype/type.pb.go new file mode 100644 index 0000000000..b9ad3f104f --- /dev/null +++ b/vendor/google.golang.org/genproto/protobuf/ptype/type.pb.go @@ -0,0 +1,538 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/protobuf/type.proto + +/* +Package ptype is a generated protocol buffer package. + +It is generated from these files: + google/protobuf/type.proto + +It has these top-level messages: + Type + Field + Enum + EnumValue + Option +*/ +package ptype + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import google_protobuf "github.com/golang/protobuf/ptypes/any" +import google_protobuf1 "google.golang.org/genproto/protobuf/source_context" + +// 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.ProtoPackageIsVersion2 // 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 (x Syntax) String() string { + return proto.EnumName(Syntax_name, int32(x)) +} +func (Syntax) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []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 (x Field_Kind) String() string { + return proto.EnumName(Field_Kind_name, int32(x)) +} +func (Field_Kind) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []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 (x Field_Cardinality) String() string { + return proto.EnumName(Field_Cardinality_name, int32(x)) +} +func (Field_Cardinality) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{1, 1} } + +// A protocol buffer message type. +type Type struct { + // The fully qualified message name. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The list of fields. + Fields []*Field `protobuf:"bytes,2,rep,name=fields" json:"fields,omitempty"` + // The list of types appearing in `oneof` definitions in this type. + Oneofs []string `protobuf:"bytes,3,rep,name=oneofs" json:"oneofs,omitempty"` + // The protocol buffer options. + Options []*Option `protobuf:"bytes,4,rep,name=options" json:"options,omitempty"` + // The source context. + SourceContext *google_protobuf1.SourceContext `protobuf:"bytes,5,opt,name=source_context,json=sourceContext" json:"source_context,omitempty"` + // The source syntax. + Syntax Syntax `protobuf:"varint,6,opt,name=syntax,enum=google.protobuf.Syntax" json:"syntax,omitempty"` +} + +func (m *Type) Reset() { *m = Type{} } +func (m *Type) String() string { return proto.CompactTextString(m) } +func (*Type) ProtoMessage() {} +func (*Type) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +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() *google_protobuf1.SourceContext { + if m != nil { + return m.SourceContext + } + return nil +} + +func (m *Type) GetSyntax() Syntax { + if m != nil { + return m.Syntax + } + return Syntax_SYNTAX_PROTO2 +} + +// A single field of a message type. +type Field struct { + // The field type. + Kind Field_Kind `protobuf:"varint,1,opt,name=kind,enum=google.protobuf.Field_Kind" json:"kind,omitempty"` + // The field cardinality. + Cardinality Field_Cardinality `protobuf:"varint,2,opt,name=cardinality,enum=google.protobuf.Field_Cardinality" json:"cardinality,omitempty"` + // The field number. + Number int32 `protobuf:"varint,3,opt,name=number" json:"number,omitempty"` + // The field name. + Name string `protobuf:"bytes,4,opt,name=name" 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" 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" json:"oneof_index,omitempty"` + // Whether to use alternative packed wire representation. + Packed bool `protobuf:"varint,8,opt,name=packed" json:"packed,omitempty"` + // The protocol buffer options. + Options []*Option `protobuf:"bytes,9,rep,name=options" json:"options,omitempty"` + // The field JSON name. + JsonName string `protobuf:"bytes,10,opt,name=json_name,json=jsonName" 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" json:"default_value,omitempty"` +} + +func (m *Field) Reset() { *m = Field{} } +func (m *Field) String() string { return proto.CompactTextString(m) } +func (*Field) ProtoMessage() {} +func (*Field) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +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 "" +} + +// Enum type definition. +type Enum struct { + // Enum type name. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Enum value definitions. + Enumvalue []*EnumValue `protobuf:"bytes,2,rep,name=enumvalue" json:"enumvalue,omitempty"` + // Protocol buffer options. + Options []*Option `protobuf:"bytes,3,rep,name=options" json:"options,omitempty"` + // The source context. + SourceContext *google_protobuf1.SourceContext `protobuf:"bytes,4,opt,name=source_context,json=sourceContext" json:"source_context,omitempty"` + // The source syntax. + Syntax Syntax `protobuf:"varint,5,opt,name=syntax,enum=google.protobuf.Syntax" json:"syntax,omitempty"` +} + +func (m *Enum) Reset() { *m = Enum{} } +func (m *Enum) String() string { return proto.CompactTextString(m) } +func (*Enum) ProtoMessage() {} +func (*Enum) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +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() *google_protobuf1.SourceContext { + if m != nil { + return m.SourceContext + } + return nil +} + +func (m *Enum) GetSyntax() Syntax { + if m != nil { + return m.Syntax + } + return Syntax_SYNTAX_PROTO2 +} + +// Enum value definition. +type EnumValue struct { + // Enum value name. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Enum value number. + Number int32 `protobuf:"varint,2,opt,name=number" json:"number,omitempty"` + // Protocol buffer options. + Options []*Option `protobuf:"bytes,3,rep,name=options" json:"options,omitempty"` +} + +func (m *EnumValue) Reset() { *m = EnumValue{} } +func (m *EnumValue) String() string { return proto.CompactTextString(m) } +func (*EnumValue) ProtoMessage() {} +func (*EnumValue) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +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 +} + +// 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" 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 *google_protobuf.Any `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` +} + +func (m *Option) Reset() { *m = Option{} } +func (m *Option) String() string { return proto.CompactTextString(m) } +func (*Option) ProtoMessage() {} +func (*Option) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *Option) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Option) GetValue() *google_protobuf.Any { + if m != nil { + return m.Value + } + return nil +} + +func init() { + 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") + 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) +} + +func init() { proto.RegisterFile("google/protobuf/type.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 810 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcd, 0x8e, 0xda, 0x56, + 0x14, 0x8e, 0x8d, 0xf1, 0xe0, 0xc3, 0xc0, 0xdc, 0xdc, 0x44, 0x89, 0x33, 0x91, 0x52, 0x44, 0xbb, + 0x40, 0x59, 0x80, 0x0a, 0xa3, 0x51, 0xa5, 0xae, 0x60, 0xf0, 0x50, 0x6b, 0x88, 0xed, 0x5e, 0x4c, + 0x93, 0xe9, 0x06, 0x79, 0xe0, 0x0e, 0x22, 0x31, 0xd7, 0x08, 0xdb, 0xed, 0xb0, 0xe8, 0x23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x66, 0x3c, 0x41, 0x78, 0xa7, 0x0a, 0xff, 0xd6, 0x3f, 0x01, 0x00, 0x00, + 0xff, 0xff, 0x6d, 0x2b, 0xc0, 0xd8, 0x24, 0x07, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/protobuf/source_context/source_context.pb.go b/vendor/google.golang.org/genproto/protobuf/source_context/source_context.pb.go new file mode 100644 index 0000000000..0cedee098c --- /dev/null +++ b/vendor/google.golang.org/genproto/protobuf/source_context/source_context.pb.go @@ -0,0 +1,70 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/protobuf/source_context.proto + +/* +Package source_context is a generated protocol buffer package. + +It is generated from these files: + google/protobuf/source_context.proto + +It has these top-level messages: + SourceContext +*/ +package source_context + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import 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.ProtoPackageIsVersion2 // 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" json:"file_name,omitempty"` +} + +func (m *SourceContext) Reset() { *m = SourceContext{} } +func (m *SourceContext) String() string { return proto.CompactTextString(m) } +func (*SourceContext) ProtoMessage() {} +func (*SourceContext) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *SourceContext) GetFileName() string { + if m != nil { + return m.FileName + } + return "" +} + +func init() { + proto.RegisterType((*SourceContext)(nil), "google.protobuf.SourceContext") +} + +func init() { proto.RegisterFile("google/protobuf/source_context.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 184 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, 0xa6, 0x32, 0x72, 0x09, 0x27, 0xe7, + 0xe7, 0xea, 0xa1, 0x99, 0xe2, 0x24, 0x84, 0x62, 0x46, 0x00, 0x48, 0x38, 0x80, 0x31, 0xca, 0x11, + 0xaa, 0x2c, 0x3d, 0x3f, 0x27, 0x31, 0x2f, 0x5d, 0x2f, 0xbf, 0x28, 0x5d, 0x3f, 0x3d, 0x35, 0x0f, + 0xac, 0x09, 0x97, 0x33, 0xad, 0x51, 0xb9, 0x8b, 0x98, 0x98, 0xdd, 0x03, 0x9c, 0x56, 0x31, 0xc9, + 0xb9, 0x43, 0x4c, 0x0a, 0x80, 0xea, 0xd2, 0x0b, 0x4f, 0xcd, 0xc9, 0xf1, 0xce, 0xcb, 0x2f, 0xcf, + 0x0b, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, 0x1b, 0x67, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, + 0x5c, 0xbd, 0xa4, 0x22, 0x05, 0x01, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/genproto/regen.go b/vendor/google.golang.org/genproto/regen.go new file mode 100644 index 0000000000..9c906f2095 --- /dev/null +++ b/vendor/google.golang.org/genproto/regen.go @@ -0,0 +1,123 @@ +// Copyright 2016 Google 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. + +// +build ignore + +// Regen.go regenerates the genproto repository. +// +// Regen.go recursively walks through each directory named by given arguments, +// looking for all .proto files. (Symlinks are not followed.) +// If the pkg_prefix flag is not an empty string, +// any proto file without `go_package` option +// or whose option does not begin with the prefix is ignored. +// Protoc is executed on remaining files, +// one invocation per set of files declaring the same Go package. +package main + +import ( + "flag" + "fmt" + "io/ioutil" + "log" + "os" + "os/exec" + "path/filepath" + "regexp" + "strconv" + "strings" +) + +var goPkgOptRe = regexp.MustCompile(`(?m)^option go_package = (.*);`) + +func usage() { + fmt.Fprintln(os.Stderr, `usage: go run regen.go -go_out=path/to/output [-pkg_prefix=pkg/prefix] roots... + +Most users will not need to run this file directly. +To regenerate this repository, run regen.sh instead.`) + flag.PrintDefaults() +} + +func main() { + goOutDir := flag.String("go_out", "", "go_out argument to pass to protoc-gen-go") + pkgPrefix := flag.String("pkg_prefix", "", "only include proto files with go_package starting with this prefix") + flag.Usage = usage + flag.Parse() + + if *goOutDir == "" { + log.Fatal("need go_out flag") + } + + pkgFiles := make(map[string][]string) + walkFn := func(path string, info os.FileInfo, err error) error { + if err != nil { + return err + } + if !info.Mode().IsRegular() || !strings.HasSuffix(path, ".proto") { + return nil + } + pkg, err := goPkg(path) + if err != nil { + return err + } + pkgFiles[pkg] = append(pkgFiles[pkg], path) + return nil + } + for _, root := range flag.Args() { + if err := filepath.Walk(root, walkFn); err != nil { + log.Fatal(err) + } + } + for pkg, fnames := range pkgFiles { + if !strings.HasPrefix(pkg, *pkgPrefix) { + continue + } + if out, err := protoc(*goOutDir, flag.Args(), fnames); err != nil { + log.Fatalf("error executing protoc: %s\n%s", err, out) + } + } +} + +// goPkg reports the import path declared in the given file's +// `go_package` option. If the option is missing, goPkg returns empty string. +func goPkg(fname string) (string, error) { + content, err := ioutil.ReadFile(fname) + if err != nil { + return "", err + } + + var pkgName string + if match := goPkgOptRe.FindSubmatch(content); len(match) > 0 { + pn, err := strconv.Unquote(string(match[1])) + if err != nil { + return "", err + } + pkgName = pn + } + if p := strings.IndexRune(pkgName, ';'); p > 0 { + pkgName = pkgName[:p] + } + return pkgName, nil +} + +// protoc executes the "protoc" command on files named in fnames, +// passing go_out and include flags specified in goOut and includes respectively. +// protoc returns combined output from stdout and stderr. +func protoc(goOut string, includes, fnames []string) ([]byte, error) { + args := []string{"--go_out=plugins=grpc:" + goOut} + for _, inc := range includes { + args = append(args, "-I", inc) + } + args = append(args, fnames...) + return exec.Command("protoc", args...).CombinedOutput() +} diff --git a/vendor/google.golang.org/genproto/regen.sh b/vendor/google.golang.org/genproto/regen.sh new file mode 100755 index 0000000000..8d9c73197d --- /dev/null +++ b/vendor/google.golang.org/genproto/regen.sh @@ -0,0 +1,77 @@ +#!/bin/bash +# +# Copyright 2016 Google 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. + +# This script rebuilds the generated code for the protocol buffers. +# To run this you will need protoc and goprotobuf installed; +# see https://github.com/golang/protobuf for instructions. +# You also need Go and Git installed. + +set -e + +PKG=google.golang.org/genproto +PROTO_REPO=https://github.com/google/protobuf +PROTO_SUBDIR=src/google/protobuf +API_REPO=https://github.com/googleapis/googleapis + +function die() { + echo 1>&2 $* + exit 1 +} + +# Sanity check that the right tools are accessible. +for tool in go git protoc protoc-gen-go; do + q=$(which $tool) || die "didn't find $tool" + echo 1>&2 "$tool: $q" +done + +root=$(go list -f '{{.Root}}' $PKG/... | head -n1) +if [ -z "$root" ]; then + die "cannot find root of $PKG" +fi + +remove_dirs= +trap 'rm -rf $remove_dirs' EXIT + +if [ -z "$PROTOBUF" ]; then + proto_repo_dir=$(mktemp -d -t regen-cds-proto.XXXXXX) + git clone -q $PROTO_REPO $proto_repo_dir & + remove_dirs="$proto_repo_dir" + # The protoc include directory is actually the "src" directory of the repo. + protodir="$proto_repo_dir/src" +else + protodir="$PROTOBUF/src" +fi + +if [ -z "$GOOGLEAPIS" ]; then + apidir=$(mktemp -d -t regen-cds-api.XXXXXX) + git clone -q $API_REPO $apidir & + remove_dirs="$remove_dirs $apidir" +else + apidir="$GOOGLEAPIS" +fi + +wait + +# Nuke everything, we'll generate them back +rm -r googleapis/ protobuf/ + +go run regen.go -go_out "$root/src" -pkg_prefix "$PKG" "$apidir" "$protodir" + +# Sanity check the build. +echo 1>&2 "Checking that the libraries build..." +go build -v ./... + +echo 1>&2 "All done!" diff --git a/vendor/google.golang.org/grpc/AUTHORS b/vendor/google.golang.org/grpc/AUTHORS new file mode 100644 index 0000000000..e491a9e7f7 --- /dev/null +++ b/vendor/google.golang.org/grpc/AUTHORS @@ -0,0 +1 @@ +Google Inc. diff --git a/vendor/google.golang.org/grpc/CONTRIBUTING.md b/vendor/google.golang.org/grpc/CONTRIBUTING.md new file mode 100644 index 0000000000..a5c6e06e25 --- /dev/null +++ b/vendor/google.golang.org/grpc/CONTRIBUTING.md @@ -0,0 +1,32 @@ +# How to contribute + +We definitely welcome your patches and contributions to gRPC! + +If you are new to github, please start by reading [Pull Request howto](https://help.github.com/articles/about-pull-requests/) + +## Legal requirements + +In order to protect both you and ourselves, you will need to sign the +[Contributor License Agreement](https://cla.developers.google.com/clas). + +## Guidelines for Pull Requests +How to get your contributions merged smoothly and quickly. + +- Create **small PRs** that are narrowly focused on **addressing a single concern**. We often times receive PRs that are trying to fix several things at a time, but only one fix is considered acceptable, nothing gets merged and both author's & review's time is wasted. Create more PRs to address different concerns and everyone will be happy. + +- For speculative changes, consider opening an issue and discussing it first. If you are suggesting a behavioral or API change, consider starting with a [gRFC proposal](https://github.com/grpc/proposal). + +- Provide a good **PR description** as a record of **what** change is being made and **why** it was made. Link to a github issue if it exists. + +- Don't fix code style and formatting unless you are already changing that line to address an issue. PRs with irrelevant changes won't be merged. If you do want to fix formatting or style, do that in a separate PR. + +- Unless your PR is trivial, you should expect there will be reviewer comments that you'll need to address before merging. We expect you to be reasonably responsive to those comments, otherwise the PR will be closed after 2-3 weeks of inactivity. + +- Maintain **clean commit history** and use **meaningful commit messages**. PRs with messy commit history are difficult to review and won't be merged. Use `rebase -i upstream/master` to curate your commit history and/or to bring in latest changes from master (but avoid rebasing in the middle of a code review). + +- Keep your PR up to date with upstream/master (if there are merge conflicts, we can't really merge your change). + +- **All tests need to be passing** before your change can be merged. We recommend you **run tests locally** before creating your PR to catch breakages early on. + +- Exceptions to the rules can be made if there's a compelling reason for doing so. + diff --git a/vendor/google.golang.org/grpc/Documentation/compression.md b/vendor/google.golang.org/grpc/Documentation/compression.md new file mode 100644 index 0000000000..204f880a16 --- /dev/null +++ b/vendor/google.golang.org/grpc/Documentation/compression.md @@ -0,0 +1,80 @@ +# Compression + +The preferred method for configuring message compression on both clients and +servers is to use +[`encoding.RegisterCompressor`](https://godoc.org/google.golang.org/grpc/encoding#RegisterCompressor) +to register an implementation of a compression algorithm. See +`grpc/encoding/gzip/gzip.go` for an example of how to implement one. + +Once a compressor has been registered on the client-side, RPCs may be sent using +it via the +[`UseCompressor`](https://godoc.org/google.golang.org/grpc#UseCompressor) +`CallOption`. Remember that `CallOption`s may be turned into defaults for all +calls from a `ClientConn` by using the +[`WithDefaultCallOptions`](https://godoc.org/google.golang.org/grpc#WithDefaultCallOptions) +`DialOption`. If `UseCompressor` is used and the corresponding compressor has +not been installed, an `Internal` error will be returned to the application +before the RPC is sent. + +Server-side, registered compressors will be used automatically to decode request +messages and encode the responses. Servers currently always respond using the +same compression method specified by the client. If the corresponding +compressor has not been registered, an `Unimplemented` status will be returned +to the client. + +## Deprecated API + +There is a deprecated API for setting compression as well. It is not +recommended for use. However, if you were previously using it, the following +section may be helpful in understanding how it works in combination with the new +API. + +### Client-Side + +There are two legacy functions and one new function to configure compression: + +```go +func WithCompressor(grpc.Compressor) DialOption {} +func WithDecompressor(grpc.Decompressor) DialOption {} +func UseCompressor(name) CallOption {} +``` + +For outgoing requests, the following rules are applied in order: +1. If `UseCompressor` is used, messages will be compressed using the compressor + named. + * If the compressor named is not registered, an Internal error is returned + back to the client before sending the RPC. + * If UseCompressor("identity"), no compressor will be used, but "identity" + will be sent in the header to the server. +1. If `WithCompressor` is used, messages will be compressed using that + compressor implementation. +1. Otherwise, outbound messages will be uncompressed. + +For incoming responses, the following rules are applied in order: +1. If `WithDecompressor` is used and it matches the message's encoding, it will + be used. +1. If a registered compressor matches the response's encoding, it will be used. +1. Otherwise, the stream will be closed and an `Unimplemented` status error will + be returned to the application. + +### Server-Side + +There are two legacy functions to configure compression: +```go +func RPCCompressor(grpc.Compressor) ServerOption {} +func RPCDecompressor(grpc.Decompressor) ServerOption {} +``` + +For incoming requests, the following rules are applied in order: +1. If `RPCDecompressor` is used and that decompressor matches the request's + encoding: it will be used. +1. If a registered compressor matches the request's encoding, it will be used. +1. Otherwise, an `Unimplemented` status will be returned to the client. + +For outgoing responses, the following rules are applied in order: +1. If `RPCCompressor` is used, that compressor will be used to compress all + response messages. +1. If compression was used for the incoming request and a registered compressor + supports it, that same compression method will be used for the outgoing + response. +1. Otherwise, no compression will be used for the outgoing response. diff --git a/vendor/google.golang.org/grpc/Documentation/gomock-example.md b/vendor/google.golang.org/grpc/Documentation/gomock-example.md new file mode 100644 index 0000000000..54743e897a --- /dev/null +++ b/vendor/google.golang.org/grpc/Documentation/gomock-example.md @@ -0,0 +1,182 @@ +# Mocking Service for gRPC + +[Example code unary RPC](https://github.com/grpc/grpc-go/tree/master/examples/helloworld/mock_helloworld) + +[Example code streaming RPC](https://github.com/grpc/grpc-go/tree/master/examples/route_guide/mock_routeguide) + +## Why? + +To test client-side logic without the overhead of connecting to a real server. Mocking enables users to write light-weight unit tests to check functionalities on client-side without invoking RPC calls to a server. + +## Idea: Mock the client stub that connects to the server. + +We use Gomock to mock the client interface (in the generated code) and programmatically set its methods to expect and return pre-determined values. This enables users to write tests around the client logic and use this mocked stub while making RPC calls. + +## How to use Gomock? + +Documentation on Gomock can be found [here](https://github.com/golang/mock). +A quick reading of the documentation should enable users to follow the code below. + +Consider a gRPC service based on following proto file: + +```proto +//helloworld.proto + +package helloworld; + +message HelloRequest { + string name = 1; +} + +message HelloReply { + string name = 1; +} + +service Greeter { + rpc SayHello (HelloRequest) returns (HelloReply) {} +} +``` + +The generated file helloworld.pb.go will have a client interface for each service defined in the proto file. This interface will have methods corresponding to each rpc inside that service. + +```Go +type GreeterClient interface { + SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) +} +``` + +The generated code also contains a struct that implements this interface. + +```Go +type greeterClient struct { + cc *grpc.ClientConn +} +func (c *greeterClient) SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error){ + // ... + // gRPC specific code here + // ... +} +``` + +Along with this the generated code has a method to create an instance of this struct. +```Go +func NewGreeterClient(cc *grpc.ClientConn) GreeterClient +``` + +The user code uses this function to create an instance of the struct greeterClient which then can be used to make rpc calls to the server. +We will mock this interface GreeterClient and use an instance of that mock to make rpc calls. These calls instead of going to server will return pre-determined values. + +To create a mock we’ll use [mockgen](https://github.com/golang/mock#running-mockgen). +From the directory ``` examples/helloworld/ ``` run ``` mockgen google.golang.org/grpc/examples/helloworld/helloworld GreeterClient > mock_helloworld/hw_mock.go ``` + +Notice that in the above command we specify GreeterClient as the interface to be mocked. + +The user test code can import the package generated by mockgen along with library package gomock to write unit tests around client-side logic. +```Go +import "github.com/golang/mock/gomock" +import hwmock "google.golang.org/grpc/examples/helloworld/mock_helloworld" +``` + +An instance of the mocked interface can be created as: +```Go +mockGreeterClient := hwmock.NewMockGreeterClient(ctrl) +``` +This mocked object can be programmed to expect calls to its methods and return pre-determined values. For instance, we can program mockGreeterClient to expect a call to its method SayHello and return a HelloReply with message “Mocked RPC”. + +```Go +mockGreeterClient.EXPECT().SayHello( + gomock.Any(), // expect any value for first parameter + gomock.Any(), // expect any value for second parameter +).Return(&helloworld.HelloReply{Message: “Mocked RPC”}, nil) +``` + +gomock.Any() indicates that the parameter can have any value or type. We can indicate specific values for built-in types with gomock.Eq(). +However, if the test code needs to specify the parameter to have a proto message type, we can replace gomock.Any() with an instance of a struct that implements gomock.Matcher interface. + +```Go +type rpcMsg struct { + msg proto.Message +} + +func (r *rpcMsg) Matches(msg interface{}) bool { + m, ok := msg.(proto.Message) + if !ok { + return false + } + return proto.Equal(m, r.msg) +} + +func (r *rpcMsg) String() string { + return fmt.Sprintf("is %s", r.msg) +} + +... + +req := &helloworld.HelloRequest{Name: "unit_test"} +mockGreeterClient.EXPECT().SayHello( + gomock.Any(), + &rpcMsg{msg: req}, +).Return(&helloworld.HelloReply{Message: "Mocked Interface"}, nil) +``` + +## Mock streaming RPCs: + +For our example we consider the case of bi-directional streaming RPCs. Concretely, we'll write a test for RouteChat function from the route guide example to demonstrate how to write mocks for streams. + +RouteChat is a bi-directional streaming RPC, which means calling RouteChat returns a stream that can __Send__ and __Recv__ messages to and from the server, respectively. We'll start by creating a mock of this stream interface returned by RouteChat and then we'll mock the client interface and set expectation on the method RouteChat to return our mocked stream. + +### Generating mocking code: +Like before we'll use [mockgen](https://github.com/golang/mock#running-mockgen). From the `examples/route_guide` directory run: `mockgen google.golang.org/grpc/examples/route_guide/routeguide RouteGuideClient,RouteGuide_RouteChatClient > mock_route_guide/rg_mock.go` + +Notice that we are mocking both client(`RouteGuideClient`) and stream(`RouteGuide_RouteChatClient`) interfaces here. + +This will create a file `rg_mock.go` under directory `mock_route_guide`. This file contins all the mocking code we need to write our test. + +In our test code, like before, we import the this mocking code along with the generated code + +```go +import ( + rgmock "google.golang.org/grpc/examples/route_guide/mock_routeguide" + rgpb "google.golang.org/grpc/examples/route_guide/routeguide" +) +``` + +Now conside a test that takes the RouteGuide client object as a parameter, makes a RouteChat rpc call and sends a message on the resulting stream. Furthermore, this test expects to see the same message to be received on the stream. + +```go +var msg = ... + +// Creates a RouteChat call and sends msg on it. +// Checks if the received message was equal to msg. +func testRouteChat(client rgb.RouteChatClient) error{ + ... +} +``` + +We can inject our mock in here by simply passing it as an argument to the method. + +Creating mock for stream interface: + +```go + stream := rgmock.NewMockRouteGuide_RouteChatClient(ctrl) +} +``` + +Setting Expectations: + +```go + stream.EXPECT().Send(gomock.Any()).Return(nil) + stream.EXPECT().Recv().Return(msg, nil) +``` + +Creating mock for client interface: + +```go + rgclient := rgmock.NewMockRouteGuideClient(ctrl) +``` + +Setting Expectations: + +```go + rgclient.EXPECT().RouteChat(gomock.Any()).Return(stream, nil) +``` diff --git a/vendor/google.golang.org/grpc/Documentation/grpc-auth-support.md b/vendor/google.golang.org/grpc/Documentation/grpc-auth-support.md new file mode 100644 index 0000000000..1b6b14e9de --- /dev/null +++ b/vendor/google.golang.org/grpc/Documentation/grpc-auth-support.md @@ -0,0 +1,41 @@ +# Authentication + +As outlined in the [gRPC authentication guide](https://grpc.io/docs/guides/auth.html) there are a number of different mechanisms for asserting identity between an client and server. We'll present some code-samples here demonstrating how to provide TLS support encryption and identity assertions as well as passing OAuth2 tokens to services that support it. + +# Enabling TLS on a gRPC client + +```Go +conn, err := grpc.Dial(serverAddr, grpc.WithTransportCredentials(credentials.NewClientTLSFromCert(nil, ""))) +``` + +# Enabling TLS on a gRPC server + +```Go +creds, err := credentials.NewServerTLSFromFile(certFile, keyFile) +if err != nil { + log.Fatalf("Failed to generate credentials %v", err) +} +lis, err := net.Listen("tcp", ":0") +server := grpc.NewServer(grpc.Creds(creds)) +... +server.Serve(lis) +``` + +# Authenticating with Google + +## Google Compute Engine (GCE) + +```Go +conn, err := grpc.Dial(serverAddr, grpc.WithTransportCredentials(credentials.NewClientTLSFromCert(nil, "")), grpc.WithPerRPCCredentials(oauth.NewComputeEngine())) +``` + +## JWT + +```Go +jwtCreds, err := oauth.NewServiceAccountFromFile(*serviceAccountKeyFile, *oauthScope) +if err != nil { + log.Fatalf("Failed to create JWT credentials: %v", err) +} +conn, err := grpc.Dial(serverAddr, grpc.WithTransportCredentials(credentials.NewClientTLSFromCert(nil, "")), grpc.WithPerRPCCredentials(jwtCreds)) +``` + diff --git a/vendor/google.golang.org/grpc/Documentation/grpc-metadata.md b/vendor/google.golang.org/grpc/Documentation/grpc-metadata.md new file mode 100644 index 0000000000..c9a88c6893 --- /dev/null +++ b/vendor/google.golang.org/grpc/Documentation/grpc-metadata.md @@ -0,0 +1,204 @@ +# Metadata + +gRPC supports sending metadata between client and server. +This doc shows how to send and receive metadata in gRPC-go. + +## Background + +Four kinds of service method: + +- [Unary RPC](https://grpc.io/docs/guides/concepts.html#unary-rpc) +- [Server streaming RPC](https://grpc.io/docs/guides/concepts.html#server-streaming-rpc) +- [Client streaming RPC](https://grpc.io/docs/guides/concepts.html#client-streaming-rpc) +- [Bidirectional streaming RPC](https://grpc.io/docs/guides/concepts.html#bidirectional-streaming-rpc) + +And concept of [metadata](https://grpc.io/docs/guides/concepts.html#metadata). + +## Constructing metadata + +A metadata can be created using package [metadata](https://godoc.org/google.golang.org/grpc/metadata). +The type MD is actually a map from string to a list of strings: + +```go +type MD map[string][]string +``` + +Metadata can be read like a normal map. +Note that the value type of this map is `[]string`, +so that users can attach multiple values using a single key. + +### Creating a new metadata + +A metadata can be created from a `map[string]string` using function `New`: + +```go +md := metadata.New(map[string]string{"key1": "val1", "key2": "val2"}) +``` + +Another way is to use `Pairs`. +Values with the same key will be merged into a list: + +```go +md := metadata.Pairs( + "key1", "val1", + "key1", "val1-2", // "key1" will have map value []string{"val1", "val1-2"} + "key2", "val2", +) +``` + +__Note:__ all the keys will be automatically converted to lowercase, +so "key1" and "kEy1" will be the same key and their values will be merged into the same list. +This happens for both `New` and `Pairs`. + +### Storing binary data in metadata + +In metadata, keys are always strings. But values can be strings or binary data. +To store binary data value in metadata, simply add "-bin" suffix to the key. +The values with "-bin" suffixed keys will be encoded when creating the metadata: + +```go +md := metadata.Pairs( + "key", "string value", + "key-bin", string([]byte{96, 102}), // this binary data will be encoded (base64) before sending + // and will be decoded after being transferred. +) +``` + +## Retrieving metadata from context + +Metadata can be retrieved from context using `FromIncomingContext`: + +```go +func (s *server) SomeRPC(ctx context.Context, in *pb.SomeRequest) (*pb.SomeResponse, err) { + md, ok := metadata.FromIncomingContext(ctx) + // do something with metadata +} +``` + +## Sending and receiving metadata - client side + +[//]: # "TODO: uncomment next line after example source added" +[//]: # "Real metadata sending and receiving examples are available [here](TODO:example_dir)." + +### Sending metadata + +To send metadata to server, the client can wrap the metadata into a context using `NewOutgoingContext`, and make the RPC with this context: + +```go +md := metadata.Pairs("key", "val") + +// create a new context with this metadata +ctx := metadata.NewOutgoingContext(context.Background(), md) + +// make unary RPC +response, err := client.SomeRPC(ctx, someRequest) + +// or make streaming RPC +stream, err := client.SomeStreamingRPC(ctx) +``` + +To read this back from the context on the client (e.g. in an interceptor) before the RPC is sent, use `FromOutgoingContext`. + +### Receiving metadata + +Metadata that a client can receive includes header and trailer. + +#### Unary call + +Header and trailer sent along with a unary call can be retrieved using function [Header](https://godoc.org/google.golang.org/grpc#Header) and [Trailer](https://godoc.org/google.golang.org/grpc#Trailer) in [CallOption](https://godoc.org/google.golang.org/grpc#CallOption): + +```go +var header, trailer metadata.MD // variable to store header and trailer +r, err := client.SomeRPC( + ctx, + someRequest, + grpc.Header(&header), // will retrieve header + grpc.Trailer(&trailer), // will retrieve trailer +) + +// do something with header and trailer +``` + +#### Streaming call + +For streaming calls including: + +- Server streaming RPC +- Client streaming RPC +- Bidirectional streaming RPC + +Header and trailer can be retrieved from the returned stream using function `Header` and `Trailer` in interface [ClientStream](https://godoc.org/google.golang.org/grpc#ClientStream): + +```go +stream, err := client.SomeStreamingRPC(ctx) + +// retrieve header +header, err := stream.Header() + +// retrieve trailer +trailer := stream.Trailer() + +``` + +## Sending and receiving metadata - server side + +[//]: # "TODO: uncomment next line after example source added" +[//]: # "Real metadata sending and receiving examples are available [here](TODO:example_dir)." + +### Receiving metadata + +To read metadata sent by the client, the server needs to retrieve it from RPC context. +If it is a unary call, the RPC handler's context can be used. +For streaming calls, the server needs to get context from the stream. + +#### Unary call + +```go +func (s *server) SomeRPC(ctx context.Context, in *pb.someRequest) (*pb.someResponse, error) { + md, ok := metadata.FromIncomingContext(ctx) + // do something with metadata +} +``` + +#### Streaming call + +```go +func (s *server) SomeStreamingRPC(stream pb.Service_SomeStreamingRPCServer) error { + md, ok := metadata.FromIncomingContext(stream.Context()) // get context from stream + // do something with metadata +} +``` + +### Sending metadata + +#### Unary call + +To send header and trailer to client in unary call, the server can call [SendHeader](https://godoc.org/google.golang.org/grpc#SendHeader) and [SetTrailer](https://godoc.org/google.golang.org/grpc#SetTrailer) functions in module [grpc](https://godoc.org/google.golang.org/grpc). +These two functions take a context as the first parameter. +It should be the RPC handler's context or one derived from it: + +```go +func (s *server) SomeRPC(ctx context.Context, in *pb.someRequest) (*pb.someResponse, error) { + // create and send header + header := metadata.Pairs("header-key", "val") + grpc.SendHeader(ctx, header) + // create and set trailer + trailer := metadata.Pairs("trailer-key", "val") + grpc.SetTrailer(ctx, trailer) +} +``` + +#### Streaming call + +For streaming calls, header and trailer can be sent using function `SendHeader` and `SetTrailer` in interface [ServerStream](https://godoc.org/google.golang.org/grpc#ServerStream): + +```go +func (s *server) SomeStreamingRPC(stream pb.Service_SomeStreamingRPCServer) error { + // create and send header + header := metadata.Pairs("header-key", "val") + stream.SendHeader(header) + // create and set trailer + trailer := metadata.Pairs("trailer-key", "val") + stream.SetTrailer(trailer) +} +``` diff --git a/vendor/google.golang.org/grpc/Documentation/server-reflection-tutorial.md b/vendor/google.golang.org/grpc/Documentation/server-reflection-tutorial.md new file mode 100644 index 0000000000..ca8e30cb41 --- /dev/null +++ b/vendor/google.golang.org/grpc/Documentation/server-reflection-tutorial.md @@ -0,0 +1,152 @@ +# gRPC Server Reflection Tutorial + +gRPC Server Reflection provides information about publicly-accessible gRPC +services on a server, and assists clients at runtime to construct RPC +requests and responses without precompiled service information. It is used by +gRPC CLI, which can be used to introspect server protos and send/receive test +RPCs. + +## Enable Server Reflection + +gRPC-go Server Reflection is implemented in package [reflection](https://github.com/grpc/grpc-go/tree/master/reflection). To enable server reflection, you need to import this package and register reflection service on your gRPC server. + +For example, to enable server reflection in `example/helloworld`, we need to make the following changes: + +```diff +--- a/examples/helloworld/greeter_server/main.go ++++ b/examples/helloworld/greeter_server/main.go +@@ -40,6 +40,7 @@ import ( + "golang.org/x/net/context" + "google.golang.org/grpc" + pb "google.golang.org/grpc/examples/helloworld/helloworld" ++ "google.golang.org/grpc/reflection" + ) + + const ( +@@ -61,6 +62,8 @@ func main() { + } + s := grpc.NewServer() + pb.RegisterGreeterServer(s, &server{}) ++ // Register reflection service on gRPC server. ++ reflection.Register(s) + if err := s.Serve(lis); err != nil { + log.Fatalf("failed to serve: %v", err) + } +``` + +We have made this change in `example/helloworld`, and we will use it as an example to show the use of gRPC server reflection and gRPC CLI in this tutorial. + +## gRPC CLI + +After enabling Server Reflection in a server application, you can use gRPC CLI to check its services. +gRPC CLI is only available in c++. Instructions on how to use gRPC CLI can be found at [command_line_tool.md](https://github.com/grpc/grpc/blob/master/doc/command_line_tool.md). + +To build gRPC CLI: + +```sh +git clone https://github.com/grpc/grpc +cd grpc +make grpc_cli +cd bins/opt # grpc_cli is in directory bins/opt/ +``` + +## Use gRPC CLI to check services + +First, start the helloworld server in grpc-go directory: + +```sh +$ cd +$ go run examples/helloworld/greeter_server/main.go +``` + +Open a new terminal and make sure you are in the directory where grpc_cli lives: + +```sh +$ cd /bins/opt +``` + +### List services + +`grpc_cli ls` command lists services and methods exposed at a given port: + +- List all the services exposed at a given port + + ```sh + $ ./grpc_cli ls localhost:50051 + ``` + + output: + ```sh + helloworld.Greeter + grpc.reflection.v1alpha.ServerReflection + ``` + +- List one service with details + + `grpc_cli ls` command inspects a service given its full name (in the format of + \.\). It can print information with a long listing format + when `-l` flag is set. This flag can be used to get more details about a + service. + + ```sh + $ ./grpc_cli ls localhost:50051 helloworld.Greeter -l + ``` + + output: + ```sh + filename: helloworld.proto + package: helloworld; + service Greeter { + rpc SayHello(helloworld.HelloRequest) returns (helloworld.HelloReply) {} + } + + ``` + +### List methods + +- List one method with details + + `grpc_cli ls` command also inspects a method given its full name (in the + format of \.\.\). + + ```sh + $ ./grpc_cli ls localhost:50051 helloworld.Greeter.SayHello -l + ``` + + output: + ```sh + rpc SayHello(helloworld.HelloRequest) returns (helloworld.HelloReply) {} + ``` + +### Inspect message types + +We can use`grpc_cli type` command to inspect request/response types given the +full name of the type (in the format of \.\). + +- Get information about the request type + + ```sh + $ ./grpc_cli type localhost:50051 helloworld.HelloRequest + ``` + + output: + ```sh + message HelloRequest { + optional string name = 1[json_name = "name"]; + } + ``` + +### Call a remote method + +We can send RPCs to a server and get responses using `grpc_cli call` command. + +- Call a unary method + + ```sh + $ ./grpc_cli call localhost:50051 SayHello "name: 'gRPC CLI'" + ``` + + output: + ```sh + message: "Hello gRPC CLI" + ``` diff --git a/vendor/google.golang.org/grpc/Documentation/versioning.md b/vendor/google.golang.org/grpc/Documentation/versioning.md new file mode 100644 index 0000000000..03e868c0d5 --- /dev/null +++ b/vendor/google.golang.org/grpc/Documentation/versioning.md @@ -0,0 +1,34 @@ +# Versioning and Releases + +Note: This document references terminology defined at http://semver.org. + +## Release Frequency + +Regular MINOR releases of gRPC-Go are performed every six weeks. Patch releases +to the previous two MINOR releases may be performed on demand or if serious +security problems are discovered. + +## Versioning Policy + +The gRPC-Go versioning policy follows the Semantic Versioning 2.0.0 +specification, with the following exceptions: + +- A MINOR version will not _necessarily_ add new functionality. + +- MINOR releases will not break backward compatibility, except in the following +circumstances: + + - An API was marked as EXPERIMENTAL upon its introduction. + - An API was marked as DEPRECATED in the initial MAJOR release. + - An API is inherently flawed and cannot provide correct or secure behavior. + + In these cases, APIs MAY be changed or removed without a MAJOR release. +Otherwise, backward compatibility will be preserved by MINOR releases. + + For an API marked as DEPRECATED, an alternative will be available (if +appropriate) for at least three months prior to its removal. + +## Release History + +Please see our release history on GitHub: +https://github.com/grpc/grpc-go/releases diff --git a/vendor/google.golang.org/grpc/LICENSE b/vendor/google.golang.org/grpc/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/vendor/google.golang.org/grpc/LICENSE @@ -0,0 +1,202 @@ + + 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/google.golang.org/grpc/Makefile b/vendor/google.golang.org/grpc/Makefile new file mode 100644 index 0000000000..c44534376a --- /dev/null +++ b/vendor/google.golang.org/grpc/Makefile @@ -0,0 +1,45 @@ +all: test testrace + +deps: + go get -d -v google.golang.org/grpc/... + +updatedeps: + go get -d -v -u -f google.golang.org/grpc/... + +testdeps: + go get -d -v -t google.golang.org/grpc/... + +updatetestdeps: + go get -d -v -t -u -f google.golang.org/grpc/... + +build: deps + go build google.golang.org/grpc/... + +proto: + @ if ! which protoc > /dev/null; then \ + echo "error: protoc not installed" >&2; \ + exit 1; \ + fi + go generate google.golang.org/grpc/... + +test: testdeps + go test -cpu 1,4 -timeout 5m google.golang.org/grpc/... + +testrace: testdeps + go test -race -cpu 1,4 -timeout 7m google.golang.org/grpc/... + +clean: + go clean -i google.golang.org/grpc/... + +.PHONY: \ + all \ + deps \ + updatedeps \ + testdeps \ + updatetestdeps \ + build \ + proto \ + test \ + testrace \ + clean \ + coverage diff --git a/vendor/google.golang.org/grpc/README.md b/vendor/google.golang.org/grpc/README.md new file mode 100644 index 0000000000..118327bb17 --- /dev/null +++ b/vendor/google.golang.org/grpc/README.md @@ -0,0 +1,46 @@ +# gRPC-Go + +[![Build Status](https://travis-ci.org/grpc/grpc-go.svg)](https://travis-ci.org/grpc/grpc-go) [![GoDoc](https://godoc.org/google.golang.org/grpc?status.svg)](https://godoc.org/google.golang.org/grpc) [![GoReportCard](https://goreportcard.com/badge/grpc/grpc-go)](https://goreportcard.com/report/github.com/grpc/grpc-go) + +The Go implementation of [gRPC](https://grpc.io/): A high performance, open source, general RPC framework that puts mobile and HTTP/2 first. For more information see the [gRPC Quick Start: Go](https://grpc.io/docs/quickstart/go.html) guide. + +Installation +------------ + +To install this package, you need to install Go and setup your Go workspace on your computer. The simplest way to install the library is to run: + +``` +$ go get -u google.golang.org/grpc +``` + +Prerequisites +------------- + +This requires Go 1.6 or later. Go 1.7 will be required as of the next gRPC-Go +release (1.8). + +Constraints +----------- +The grpc package should only depend on standard Go packages and a small number of exceptions. If your contribution introduces new dependencies which are NOT in the [list](http://godoc.org/google.golang.org/grpc?imports), you need a discussion with gRPC-Go authors and consultants. + +Documentation +------------- +See [API documentation](https://godoc.org/google.golang.org/grpc) for package and API descriptions and find examples in the [examples directory](examples/). + +Performance +----------- +See the current benchmarks for some of the languages supported in [this dashboard](https://performance-dot-grpc-testing.appspot.com/explore?dashboard=5652536396611584&widget=490377658&container=1286539696). + +Status +------ +General Availability [Google Cloud Platform Launch Stages](https://cloud.google.com/terms/launch-stages). + +FAQ +--- + +#### Compiling error, undefined: grpc.SupportPackageIsVersion + +Please update proto package, gRPC package and rebuild the proto files: + - `go get -u github.com/golang/protobuf/{proto,protoc-gen-go}` + - `go get -u google.golang.org/grpc` + - `protoc --go_out=plugins=grpc:. *.proto` diff --git a/vendor/google.golang.org/grpc/backoff.go b/vendor/google.golang.org/grpc/backoff.go new file mode 100644 index 0000000000..c40facce51 --- /dev/null +++ b/vendor/google.golang.org/grpc/backoff.go @@ -0,0 +1,96 @@ +/* + * + * Copyright 2017 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. + * + */ + +package grpc + +import ( + "math/rand" + "time" +) + +// DefaultBackoffConfig uses values specified for backoff in +// https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md. +var DefaultBackoffConfig = BackoffConfig{ + MaxDelay: 120 * time.Second, + baseDelay: 1.0 * time.Second, + factor: 1.6, + jitter: 0.2, +} + +// backoffStrategy defines the methodology for backing off after a grpc +// connection failure. +// +// This is unexported until the gRPC project decides whether or not to allow +// alternative backoff strategies. Once a decision is made, this type and its +// method may be exported. +type backoffStrategy interface { + // backoff returns the amount of time to wait before the next retry given + // the number of consecutive failures. + backoff(retries int) time.Duration +} + +// BackoffConfig defines the parameters for the default gRPC backoff strategy. +type BackoffConfig struct { + // MaxDelay is the upper bound of backoff delay. + MaxDelay time.Duration + + // TODO(stevvooe): The following fields are not exported, as allowing + // changes would violate the current gRPC specification for backoff. If + // gRPC decides to allow more interesting backoff strategies, these fields + // may be opened up in the future. + + // baseDelay is the amount of time to wait before retrying after the first + // failure. + baseDelay time.Duration + + // factor is applied to the backoff after each retry. + factor float64 + + // jitter provides a range to randomize backoff delays. + jitter float64 +} + +func setDefaults(bc *BackoffConfig) { + md := bc.MaxDelay + *bc = DefaultBackoffConfig + + if md > 0 { + bc.MaxDelay = md + } +} + +func (bc BackoffConfig) backoff(retries int) time.Duration { + if retries == 0 { + return bc.baseDelay + } + backoff, max := float64(bc.baseDelay), float64(bc.MaxDelay) + for backoff < max && retries > 0 { + backoff *= bc.factor + retries-- + } + if backoff > max { + backoff = max + } + // Randomize backoff delays so that if a cluster of requests start at + // the same time, they won't operate in lockstep. + backoff *= 1 + bc.jitter*(rand.Float64()*2-1) + if backoff < 0 { + return 0 + } + return time.Duration(backoff) +} diff --git a/vendor/google.golang.org/grpc/backoff_test.go b/vendor/google.golang.org/grpc/backoff_test.go new file mode 100644 index 0000000000..37e8e3f62b --- /dev/null +++ b/vendor/google.golang.org/grpc/backoff_test.go @@ -0,0 +1,29 @@ +/* + * + * Copyright 2017 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. + * + */ + +package grpc + +import "testing" + +func TestBackoffConfigDefaults(t *testing.T) { + b := BackoffConfig{} + setDefaults(&b) + if b != DefaultBackoffConfig { + t.Fatalf("expected BackoffConfig to pickup default parameters: %v != %v", b, DefaultBackoffConfig) + } +} diff --git a/vendor/google.golang.org/grpc/balancer.go b/vendor/google.golang.org/grpc/balancer.go new file mode 100644 index 0000000000..ab65049ddc --- /dev/null +++ b/vendor/google.golang.org/grpc/balancer.go @@ -0,0 +1,408 @@ +/* + * + * Copyright 2016 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. + * + */ + +package grpc + +import ( + "fmt" + "net" + "sync" + + "golang.org/x/net/context" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/naming" +) + +// Address represents a server the client connects to. +// This is the EXPERIMENTAL API and may be changed or extended in the future. +type Address struct { + // Addr is the server address on which a connection will be established. + Addr string + // Metadata is the information associated with Addr, which may be used + // to make load balancing decision. + Metadata interface{} +} + +// BalancerConfig specifies the configurations for Balancer. +type BalancerConfig struct { + // DialCreds is the transport credential the Balancer implementation can + // use to dial to a remote load balancer server. The Balancer implementations + // can ignore this if it does not need to talk to another party securely. + DialCreds credentials.TransportCredentials + // Dialer is the custom dialer the Balancer implementation can use to dial + // to a remote load balancer server. The Balancer implementations + // can ignore this if it doesn't need to talk to remote balancer. + Dialer func(context.Context, string) (net.Conn, error) +} + +// BalancerGetOptions configures a Get call. +// This is the EXPERIMENTAL API and may be changed or extended in the future. +type BalancerGetOptions struct { + // BlockingWait specifies whether Get should block when there is no + // connected address. + BlockingWait bool +} + +// Balancer chooses network addresses for RPCs. +// This is the EXPERIMENTAL API and may be changed or extended in the future. +type Balancer interface { + // Start does the initialization work to bootstrap a Balancer. For example, + // this function may start the name resolution and watch the updates. It will + // be called when dialing. + Start(target string, config BalancerConfig) error + // Up informs the Balancer that gRPC has a connection to the server at + // addr. It returns down which is called once the connection to addr gets + // lost or closed. + // TODO: It is not clear how to construct and take advantage of the meaningful error + // parameter for down. Need realistic demands to guide. + Up(addr Address) (down func(error)) + // Get gets the address of a server for the RPC corresponding to ctx. + // i) If it returns a connected address, gRPC internals issues the RPC on the + // connection to this address; + // ii) If it returns an address on which the connection is under construction + // (initiated by Notify(...)) but not connected, gRPC internals + // * fails RPC if the RPC is fail-fast and connection is in the TransientFailure or + // Shutdown state; + // or + // * issues RPC on the connection otherwise. + // iii) If it returns an address on which the connection does not exist, gRPC + // internals treats it as an error and will fail the corresponding RPC. + // + // Therefore, the following is the recommended rule when writing a custom Balancer. + // If opts.BlockingWait is true, it should return a connected address or + // block if there is no connected address. It should respect the timeout or + // cancellation of ctx when blocking. If opts.BlockingWait is false (for fail-fast + // RPCs), it should return an address it has notified via Notify(...) immediately + // instead of blocking. + // + // The function returns put which is called once the rpc has completed or failed. + // put can collect and report RPC stats to a remote load balancer. + // + // This function should only return the errors Balancer cannot recover by itself. + // gRPC internals will fail the RPC if an error is returned. + Get(ctx context.Context, opts BalancerGetOptions) (addr Address, put func(), err error) + // Notify returns a channel that is used by gRPC internals to watch the addresses + // gRPC needs to connect. The addresses might be from a name resolver or remote + // load balancer. gRPC internals will compare it with the existing connected + // addresses. If the address Balancer notified is not in the existing connected + // addresses, gRPC starts to connect the address. If an address in the existing + // connected addresses is not in the notification list, the corresponding connection + // is shutdown gracefully. Otherwise, there are no operations to take. Note that + // the Address slice must be the full list of the Addresses which should be connected. + // It is NOT delta. + Notify() <-chan []Address + // Close shuts down the balancer. + Close() error +} + +// downErr implements net.Error. It is constructed by gRPC internals and passed to the down +// call of Balancer. +type downErr struct { + timeout bool + temporary bool + desc string +} + +func (e downErr) Error() string { return e.desc } +func (e downErr) Timeout() bool { return e.timeout } +func (e downErr) Temporary() bool { return e.temporary } + +func downErrorf(timeout, temporary bool, format string, a ...interface{}) downErr { + return downErr{ + timeout: timeout, + temporary: temporary, + desc: fmt.Sprintf(format, a...), + } +} + +// RoundRobin returns a Balancer that selects addresses round-robin. It uses r to watch +// the name resolution updates and updates the addresses available correspondingly. +func RoundRobin(r naming.Resolver) Balancer { + return &roundRobin{r: r} +} + +type addrInfo struct { + addr Address + connected bool +} + +type roundRobin struct { + r naming.Resolver + w naming.Watcher + addrs []*addrInfo // all the addresses the client should potentially connect + mu sync.Mutex + addrCh chan []Address // the channel to notify gRPC internals the list of addresses the client should connect to. + next int // index of the next address to return for Get() + waitCh chan struct{} // the channel to block when there is no connected address available + done bool // The Balancer is closed. +} + +func (rr *roundRobin) watchAddrUpdates() error { + updates, err := rr.w.Next() + if err != nil { + grpclog.Warningf("grpc: the naming watcher stops working due to %v.", err) + return err + } + rr.mu.Lock() + defer rr.mu.Unlock() + for _, update := range updates { + addr := Address{ + Addr: update.Addr, + Metadata: update.Metadata, + } + switch update.Op { + case naming.Add: + var exist bool + for _, v := range rr.addrs { + if addr == v.addr { + exist = true + grpclog.Infoln("grpc: The name resolver wanted to add an existing address: ", addr) + break + } + } + if exist { + continue + } + rr.addrs = append(rr.addrs, &addrInfo{addr: addr}) + case naming.Delete: + for i, v := range rr.addrs { + if addr == v.addr { + copy(rr.addrs[i:], rr.addrs[i+1:]) + rr.addrs = rr.addrs[:len(rr.addrs)-1] + break + } + } + default: + grpclog.Errorln("Unknown update.Op ", update.Op) + } + } + // Make a copy of rr.addrs and write it onto rr.addrCh so that gRPC internals gets notified. + open := make([]Address, len(rr.addrs)) + for i, v := range rr.addrs { + open[i] = v.addr + } + if rr.done { + return ErrClientConnClosing + } + select { + case <-rr.addrCh: + default: + } + rr.addrCh <- open + return nil +} + +func (rr *roundRobin) Start(target string, config BalancerConfig) error { + rr.mu.Lock() + defer rr.mu.Unlock() + if rr.done { + return ErrClientConnClosing + } + if rr.r == nil { + // If there is no name resolver installed, it is not needed to + // do name resolution. In this case, target is added into rr.addrs + // as the only address available and rr.addrCh stays nil. + rr.addrs = append(rr.addrs, &addrInfo{addr: Address{Addr: target}}) + return nil + } + w, err := rr.r.Resolve(target) + if err != nil { + return err + } + rr.w = w + rr.addrCh = make(chan []Address, 1) + go func() { + for { + if err := rr.watchAddrUpdates(); err != nil { + return + } + } + }() + return nil +} + +// Up sets the connected state of addr and sends notification if there are pending +// Get() calls. +func (rr *roundRobin) Up(addr Address) func(error) { + rr.mu.Lock() + defer rr.mu.Unlock() + var cnt int + for _, a := range rr.addrs { + if a.addr == addr { + if a.connected { + return nil + } + a.connected = true + } + if a.connected { + cnt++ + } + } + // addr is only one which is connected. Notify the Get() callers who are blocking. + if cnt == 1 && rr.waitCh != nil { + close(rr.waitCh) + rr.waitCh = nil + } + return func(err error) { + rr.down(addr, err) + } +} + +// down unsets the connected state of addr. +func (rr *roundRobin) down(addr Address, err error) { + rr.mu.Lock() + defer rr.mu.Unlock() + for _, a := range rr.addrs { + if addr == a.addr { + a.connected = false + break + } + } +} + +// Get returns the next addr in the rotation. +func (rr *roundRobin) Get(ctx context.Context, opts BalancerGetOptions) (addr Address, put func(), err error) { + var ch chan struct{} + rr.mu.Lock() + if rr.done { + rr.mu.Unlock() + err = ErrClientConnClosing + return + } + + if len(rr.addrs) > 0 { + if rr.next >= len(rr.addrs) { + rr.next = 0 + } + next := rr.next + for { + a := rr.addrs[next] + next = (next + 1) % len(rr.addrs) + if a.connected { + addr = a.addr + rr.next = next + rr.mu.Unlock() + return + } + if next == rr.next { + // Has iterated all the possible address but none is connected. + break + } + } + } + if !opts.BlockingWait { + if len(rr.addrs) == 0 { + rr.mu.Unlock() + err = Errorf(codes.Unavailable, "there is no address available") + return + } + // Returns the next addr on rr.addrs for failfast RPCs. + addr = rr.addrs[rr.next].addr + rr.next++ + rr.mu.Unlock() + return + } + // Wait on rr.waitCh for non-failfast RPCs. + if rr.waitCh == nil { + ch = make(chan struct{}) + rr.waitCh = ch + } else { + ch = rr.waitCh + } + rr.mu.Unlock() + for { + select { + case <-ctx.Done(): + err = ctx.Err() + return + case <-ch: + rr.mu.Lock() + if rr.done { + rr.mu.Unlock() + err = ErrClientConnClosing + return + } + + if len(rr.addrs) > 0 { + if rr.next >= len(rr.addrs) { + rr.next = 0 + } + next := rr.next + for { + a := rr.addrs[next] + next = (next + 1) % len(rr.addrs) + if a.connected { + addr = a.addr + rr.next = next + rr.mu.Unlock() + return + } + if next == rr.next { + // Has iterated all the possible address but none is connected. + break + } + } + } + // The newly added addr got removed by Down() again. + if rr.waitCh == nil { + ch = make(chan struct{}) + rr.waitCh = ch + } else { + ch = rr.waitCh + } + rr.mu.Unlock() + } + } +} + +func (rr *roundRobin) Notify() <-chan []Address { + return rr.addrCh +} + +func (rr *roundRobin) Close() error { + rr.mu.Lock() + defer rr.mu.Unlock() + if rr.done { + return errBalancerClosed + } + rr.done = true + if rr.w != nil { + rr.w.Close() + } + if rr.waitCh != nil { + close(rr.waitCh) + rr.waitCh = nil + } + if rr.addrCh != nil { + close(rr.addrCh) + } + return nil +} + +// pickFirst is used to test multi-addresses in one addrConn in which all addresses share the same addrConn. +// It is a wrapper around roundRobin balancer. The logic of all methods works fine because balancer.Get() +// returns the only address Up by resetTransport(). +type pickFirst struct { + *roundRobin +} + +func pickFirstBalancerV1(r naming.Resolver) Balancer { + return &pickFirst{&roundRobin{r: r}} +} diff --git a/vendor/google.golang.org/grpc/balancer/balancer.go b/vendor/google.golang.org/grpc/balancer/balancer.go new file mode 100644 index 0000000000..cd2682f5f2 --- /dev/null +++ b/vendor/google.golang.org/grpc/balancer/balancer.go @@ -0,0 +1,203 @@ +/* + * + * Copyright 2017 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. + * + */ + +// Package balancer defines APIs for load balancing in gRPC. +// All APIs in this package are experimental. +package balancer + +import ( + "errors" + "net" + + "golang.org/x/net/context" + "google.golang.org/grpc/connectivity" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/resolver" +) + +var ( + // m is a map from name to balancer builder. + m = make(map[string]Builder) +) + +// Register registers the balancer builder to the balancer map. +// b.Name will be used as the name registered with this builder. +func Register(b Builder) { + m[b.Name()] = b +} + +// Get returns the resolver builder registered with the given name. +// If no builder is register with the name, nil will be returned. +func Get(name string) Builder { + if b, ok := m[name]; ok { + return b + } + return nil +} + +// SubConn represents a gRPC sub connection. +// Each sub connection contains a list of addresses. gRPC will +// try to connect to them (in sequence), and stop trying the +// remainder once one connection is successful. +// +// The reconnect backoff will be applied on the list, not a single address. +// For example, try_on_all_addresses -> backoff -> try_on_all_addresses. +// +// All SubConns start in IDLE, and will not try to connect. To trigger +// the connecting, Balancers must call Connect. +// When the connection encounters an error, it will reconnect immediately. +// When the connection becomes IDLE, it will not reconnect unless Connect is +// called. +type SubConn interface { + // UpdateAddresses updates the addresses used in this SubConn. + // gRPC checks if currently-connected address is still in the new list. + // If it's in the list, the connection will be kept. + // If it's not in the list, the connection will gracefully closed, and + // a new connection will be created. + // + // This will trigger a state transition for the SubConn. + UpdateAddresses([]resolver.Address) + // Connect starts the connecting for this SubConn. + Connect() +} + +// NewSubConnOptions contains options to create new SubConn. +type NewSubConnOptions struct{} + +// ClientConn represents a gRPC ClientConn. +type ClientConn interface { + // NewSubConn is called by balancer to create a new SubConn. + // It doesn't block and wait for the connections to be established. + // Behaviors of the SubConn can be controlled by options. + NewSubConn([]resolver.Address, NewSubConnOptions) (SubConn, error) + // RemoveSubConn removes the SubConn from ClientConn. + // The SubConn will be shutdown. + RemoveSubConn(SubConn) + + // UpdateBalancerState is called by balancer to nofity gRPC that some internal + // state in balancer has changed. + // + // gRPC will update the connectivity state of the ClientConn, and will call pick + // on the new picker to pick new SubConn. + UpdateBalancerState(s connectivity.State, p Picker) + + // Target returns the dial target for this ClientConn. + Target() string +} + +// BuildOptions contains additional information for Build. +type BuildOptions struct { + // DialCreds is the transport credential the Balancer implementation can + // use to dial to a remote load balancer server. The Balancer implementations + // can ignore this if it does not need to talk to another party securely. + DialCreds credentials.TransportCredentials + // Dialer is the custom dialer the Balancer implementation can use to dial + // to a remote load balancer server. The Balancer implementations + // can ignore this if it doesn't need to talk to remote balancer. + Dialer func(context.Context, string) (net.Conn, error) +} + +// Builder creates a balancer. +type Builder interface { + // Build creates a new balancer with the ClientConn. + Build(cc ClientConn, opts BuildOptions) Balancer + // Name returns the name of balancers built by this builder. + // It will be used to pick balancers (for example in service config). + Name() string +} + +// PickOptions contains addition information for the Pick operation. +type PickOptions struct{} + +// DoneInfo contains additional information for done. +type DoneInfo struct { + // Err is the rpc error the RPC finished with. It could be nil. + Err error +} + +var ( + // ErrNoSubConnAvailable indicates no SubConn is available for pick(). + // gRPC will block the RPC until a new picker is available via UpdateBalancerState(). + ErrNoSubConnAvailable = errors.New("no SubConn is available") + // ErrTransientFailure indicates all SubConns are in TransientFailure. + // WaitForReady RPCs will block, non-WaitForReady RPCs will fail. + ErrTransientFailure = errors.New("all SubConns are in TransientFailure") +) + +// Picker is used by gRPC to pick a SubConn to send an RPC. +// Balancer is expected to generate a new picker from its snapshot everytime its +// internal state has changed. +// +// The pickers used by gRPC can be updated by ClientConn.UpdateBalancerState(). +type Picker interface { + // Pick returns the SubConn to be used to send the RPC. + // The returned SubConn must be one returned by NewSubConn(). + // + // This functions is expected to return: + // - a SubConn that is known to be READY; + // - ErrNoSubConnAvailable if no SubConn is available, but progress is being + // made (for example, some SubConn is in CONNECTING mode); + // - other errors if no active connecting is happening (for example, all SubConn + // are in TRANSIENT_FAILURE mode). + // + // If a SubConn is returned: + // - If it is READY, gRPC will send the RPC on it; + // - If it is not ready, or becomes not ready after it's returned, gRPC will block + // until UpdateBalancerState() is called and will call pick on the new picker. + // + // If the returned error is not nil: + // - If the error is ErrNoSubConnAvailable, gRPC will block until UpdateBalancerState() + // - If the error is ErrTransientFailure: + // - If the RPC is wait-for-ready, gRPC will block until UpdateBalancerState() + // is called to pick again; + // - Otherwise, RPC will fail with unavailable error. + // - Else (error is other non-nil error): + // - The RPC will fail with unavailable error. + // + // The returned done() function will be called once the rpc has finished, with the + // final status of that RPC. + // done may be nil if balancer doesn't care about the RPC status. + Pick(ctx context.Context, opts PickOptions) (conn SubConn, done func(DoneInfo), err error) +} + +// Balancer takes input from gRPC, manages SubConns, and collects and aggregates +// the connectivity states. +// +// It also generates and updates the Picker used by gRPC to pick SubConns for RPCs. +// +// HandleSubConnectionStateChange, HandleResolvedAddrs and Close are guaranteed +// to be called synchronously from the same goroutine. +// There's no guarantee on picker.Pick, it may be called anytime. +type Balancer interface { + // HandleSubConnStateChange is called by gRPC when the connectivity state + // of sc has changed. + // Balancer is expected to aggregate all the state of SubConn and report + // that back to gRPC. + // Balancer should also generate and update Pickers when its internal state has + // been changed by the new state. + HandleSubConnStateChange(sc SubConn, state connectivity.State) + // HandleResolvedAddrs is called by gRPC to send updated resolved addresses to + // balancers. + // Balancer can create new SubConn or remove SubConn with the addresses. + // An empty address slice and a non-nil error will be passed if the resolver returns + // non-nil error to gRPC. + HandleResolvedAddrs([]resolver.Address, error) + // Close closes the balancer. The balancer is not required to call + // ClientConn.RemoveSubConn for its existing SubConns. + Close() +} diff --git a/vendor/google.golang.org/grpc/balancer/roundrobin/roundrobin.go b/vendor/google.golang.org/grpc/balancer/roundrobin/roundrobin.go new file mode 100644 index 0000000000..9d2fbcd842 --- /dev/null +++ b/vendor/google.golang.org/grpc/balancer/roundrobin/roundrobin.go @@ -0,0 +1,241 @@ +/* + * + * Copyright 2017 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. + * + */ + +// Package roundrobin defines a roundrobin balancer. Roundrobin balancer is +// installed as one of the default balancers in gRPC, users don't need to +// explicitly install this balancer. +package roundrobin + +import ( + "sync" + + "golang.org/x/net/context" + "google.golang.org/grpc/balancer" + "google.golang.org/grpc/connectivity" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/resolver" +) + +// newBuilder creates a new roundrobin balancer builder. +func newBuilder() balancer.Builder { + return &rrBuilder{} +} + +func init() { + balancer.Register(newBuilder()) +} + +type rrBuilder struct{} + +func (*rrBuilder) Build(cc balancer.ClientConn, opt balancer.BuildOptions) balancer.Balancer { + return &rrBalancer{ + cc: cc, + subConns: make(map[resolver.Address]balancer.SubConn), + scStates: make(map[balancer.SubConn]connectivity.State), + csEvltr: &connectivityStateEvaluator{}, + // Initialize picker to a picker that always return + // ErrNoSubConnAvailable, because when state of a SubConn changes, we + // may call UpdateBalancerState with this picker. + picker: newPicker([]balancer.SubConn{}, nil), + } +} + +func (*rrBuilder) Name() string { + return "round_robin" +} + +type rrBalancer struct { + cc balancer.ClientConn + + csEvltr *connectivityStateEvaluator + state connectivity.State + + subConns map[resolver.Address]balancer.SubConn + scStates map[balancer.SubConn]connectivity.State + picker *picker +} + +func (b *rrBalancer) HandleResolvedAddrs(addrs []resolver.Address, err error) { + if err != nil { + grpclog.Infof("roundrobin.rrBalancer: HandleResolvedAddrs called with error %v", err) + return + } + grpclog.Infoln("roundrobin.rrBalancer: got new resolved addresses: ", addrs) + // addrsSet is the set converted from addrs, it's used for quick lookup of an address. + addrsSet := make(map[resolver.Address]struct{}) + for _, a := range addrs { + addrsSet[a] = struct{}{} + if _, ok := b.subConns[a]; !ok { + // a is a new address (not existing in b.subConns). + sc, err := b.cc.NewSubConn([]resolver.Address{a}, balancer.NewSubConnOptions{}) + if err != nil { + grpclog.Warningf("roundrobin.rrBalancer: failed to create new SubConn: %v", err) + continue + } + b.subConns[a] = sc + b.scStates[sc] = connectivity.Idle + sc.Connect() + } + } + for a, sc := range b.subConns { + // a was removed by resolver. + if _, ok := addrsSet[a]; !ok { + b.cc.RemoveSubConn(sc) + delete(b.subConns, a) + // Keep the state of this sc in b.scStates until sc's state becomes Shutdown. + // The entry will be deleted in HandleSubConnStateChange. + } + } +} + +// regeneratePicker takes a snapshot of the balancer, and generates a picker +// from it. The picker +// - always returns ErrTransientFailure if the balancer is in TransientFailure, +// - or does round robin selection of all READY SubConns otherwise. +func (b *rrBalancer) regeneratePicker() { + if b.state == connectivity.TransientFailure { + b.picker = newPicker(nil, balancer.ErrTransientFailure) + return + } + var readySCs []balancer.SubConn + for sc, st := range b.scStates { + if st == connectivity.Ready { + readySCs = append(readySCs, sc) + } + } + b.picker = newPicker(readySCs, nil) +} + +func (b *rrBalancer) HandleSubConnStateChange(sc balancer.SubConn, s connectivity.State) { + grpclog.Infof("roundrobin.rrBalancer: handle SubConn state change: %p, %v", sc, s) + oldS, ok := b.scStates[sc] + if !ok { + grpclog.Infof("roundrobin.rrBalancer: got state changes for an unknown SubConn: %p, %v", sc, s) + return + } + b.scStates[sc] = s + switch s { + case connectivity.Idle: + sc.Connect() + case connectivity.Shutdown: + // When an address was removed by resolver, b called RemoveSubConn but + // kept the sc's state in scStates. Remove state for this sc here. + delete(b.scStates, sc) + } + + oldAggrState := b.state + b.state = b.csEvltr.recordTransition(oldS, s) + + // Regenerate picker when one of the following happens: + // - this sc became ready from not-ready + // - this sc became not-ready from ready + // - the aggregated state of balancer became TransientFailure from non-TransientFailure + // - the aggregated state of balancer became non-TransientFailure from TransientFailure + if (s == connectivity.Ready) != (oldS == connectivity.Ready) || + (b.state == connectivity.TransientFailure) != (oldAggrState == connectivity.TransientFailure) { + b.regeneratePicker() + } + + b.cc.UpdateBalancerState(b.state, b.picker) + return +} + +// Close is a nop because roundrobin balancer doesn't internal state to clean +// up, and it doesn't need to call RemoveSubConn for the SubConns. +func (b *rrBalancer) Close() { +} + +type picker struct { + // If err is not nil, Pick always returns this err. It's immutable after + // picker is created. + err error + + // subConns is the snapshot of the roundrobin balancer when this picker was + // created. The slice is immutable. Each Get() will do a round robin + // selection from it and return the selected SubConn. + subConns []balancer.SubConn + + mu sync.Mutex + next int +} + +func newPicker(scs []balancer.SubConn, err error) *picker { + grpclog.Infof("roundrobinPicker: newPicker called with scs: %v, %v", scs, err) + if err != nil { + return &picker{err: err} + } + return &picker{ + subConns: scs, + } +} + +func (p *picker) Pick(ctx context.Context, opts balancer.PickOptions) (balancer.SubConn, func(balancer.DoneInfo), error) { + if p.err != nil { + return nil, nil, p.err + } + if len(p.subConns) <= 0 { + return nil, nil, balancer.ErrNoSubConnAvailable + } + + p.mu.Lock() + sc := p.subConns[p.next] + p.next = (p.next + 1) % len(p.subConns) + p.mu.Unlock() + return sc, nil, nil +} + +// connectivityStateEvaluator gets updated by addrConns when their +// states transition, based on which it evaluates the state of +// ClientConn. +type connectivityStateEvaluator struct { + numReady uint64 // Number of addrConns in ready state. + numConnecting uint64 // Number of addrConns in connecting state. + numTransientFailure uint64 // Number of addrConns in transientFailure. +} + +// recordTransition records state change happening in every subConn and based on +// that it evaluates what aggregated state should be. +// It can only transition between Ready, Connecting and TransientFailure. Other states, +// Idle and Shutdown are transitioned into by ClientConn; in the beginning of the connection +// before any subConn is created ClientConn is in idle state. In the end when ClientConn +// closes it is in Shutdown state. +// +// recordTransition should only be called synchronously from the same goroutine. +func (cse *connectivityStateEvaluator) recordTransition(oldState, newState connectivity.State) connectivity.State { + // Update counters. + for idx, state := range []connectivity.State{oldState, newState} { + updateVal := 2*uint64(idx) - 1 // -1 for oldState and +1 for new. + switch state { + case connectivity.Ready: + cse.numReady += updateVal + case connectivity.Connecting: + cse.numConnecting += updateVal + case connectivity.TransientFailure: + cse.numTransientFailure += updateVal + } + } + + // Evaluate. + if cse.numReady > 0 { + return connectivity.Ready + } + if cse.numConnecting > 0 { + return connectivity.Connecting + } + return connectivity.TransientFailure +} diff --git a/vendor/google.golang.org/grpc/balancer/roundrobin/roundrobin_test.go b/vendor/google.golang.org/grpc/balancer/roundrobin/roundrobin_test.go new file mode 100644 index 0000000000..7f953ff002 --- /dev/null +++ b/vendor/google.golang.org/grpc/balancer/roundrobin/roundrobin_test.go @@ -0,0 +1,477 @@ +/* + * + * Copyright 2017 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. + * + */ + +package roundrobin_test + +import ( + "fmt" + "net" + "sync" + "testing" + "time" + + "golang.org/x/net/context" + "google.golang.org/grpc" + "google.golang.org/grpc/balancer" + "google.golang.org/grpc/codes" + _ "google.golang.org/grpc/grpclog/glogger" + "google.golang.org/grpc/peer" + "google.golang.org/grpc/resolver" + "google.golang.org/grpc/resolver/manual" + testpb "google.golang.org/grpc/test/grpc_testing" + "google.golang.org/grpc/test/leakcheck" +) + +var rr = balancer.Get("round_robin") + +type testServer struct { + testpb.TestServiceServer +} + +func (s *testServer) EmptyCall(ctx context.Context, in *testpb.Empty) (*testpb.Empty, error) { + return &testpb.Empty{}, nil +} + +func (s *testServer) FullDuplexCall(stream testpb.TestService_FullDuplexCallServer) error { + return nil +} + +type test struct { + servers []*grpc.Server + addresses []string +} + +func (t *test) cleanup() { + for _, s := range t.servers { + s.Stop() + } +} + +func startTestServers(count int) (_ *test, err error) { + t := &test{} + + defer func() { + if err != nil { + for _, s := range t.servers { + s.Stop() + } + } + }() + for i := 0; i < count; i++ { + lis, err := net.Listen("tcp", "localhost:0") + if err != nil { + return nil, fmt.Errorf("Failed to listen %v", err) + } + + s := grpc.NewServer() + testpb.RegisterTestServiceServer(s, &testServer{}) + t.servers = append(t.servers, s) + t.addresses = append(t.addresses, lis.Addr().String()) + + go func(s *grpc.Server, l net.Listener) { + s.Serve(l) + }(s, lis) + } + + return t, nil +} + +func TestOneBackend(t *testing.T) { + defer leakcheck.Check(t) + r, cleanup := manual.GenerateAndRegisterManualResolver() + defer cleanup() + + test, err := startTestServers(1) + if err != nil { + t.Fatalf("failed to start servers: %v", err) + } + defer test.cleanup() + + cc, err := grpc.Dial(r.Scheme()+":///test.server", grpc.WithInsecure(), grpc.WithBalancerBuilder(rr)) + if err != nil { + t.Fatalf("failed to dial: %v", err) + } + defer cc.Close() + testc := testpb.NewTestServiceClient(cc) + // The first RPC should fail because there's no address. + ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond) + defer cancel() + if _, err := testc.EmptyCall(ctx, &testpb.Empty{}); err == nil || grpc.Code(err) != codes.DeadlineExceeded { + t.Fatalf("EmptyCall() = _, %v, want _, DeadlineExceeded", err) + } + + r.NewAddress([]resolver.Address{{Addr: test.addresses[0]}}) + // The second RPC should succeed. + if _, err := testc.EmptyCall(context.Background(), &testpb.Empty{}); err != nil { + t.Fatalf("EmptyCall() = _, %v, want _, ", err) + } +} + +func TestBackendsRoundRobin(t *testing.T) { + defer leakcheck.Check(t) + r, cleanup := manual.GenerateAndRegisterManualResolver() + defer cleanup() + + backendCount := 5 + test, err := startTestServers(backendCount) + if err != nil { + t.Fatalf("failed to start servers: %v", err) + } + defer test.cleanup() + + cc, err := grpc.Dial(r.Scheme()+":///test.server", grpc.WithInsecure(), grpc.WithBalancerBuilder(rr)) + if err != nil { + t.Fatalf("failed to dial: %v", err) + } + defer cc.Close() + testc := testpb.NewTestServiceClient(cc) + // The first RPC should fail because there's no address. + ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond) + defer cancel() + if _, err := testc.EmptyCall(ctx, &testpb.Empty{}); err == nil || grpc.Code(err) != codes.DeadlineExceeded { + t.Fatalf("EmptyCall() = _, %v, want _, DeadlineExceeded", err) + } + + var resolvedAddrs []resolver.Address + for i := 0; i < backendCount; i++ { + resolvedAddrs = append(resolvedAddrs, resolver.Address{Addr: test.addresses[i]}) + } + + r.NewAddress(resolvedAddrs) + var p peer.Peer + // Make sure connections to all servers are up. + for si := 0; si < backendCount; si++ { + var connected bool + for i := 0; i < 1000; i++ { + if _, err := testc.EmptyCall(context.Background(), &testpb.Empty{}, grpc.Peer(&p)); err != nil { + t.Fatalf("EmptyCall() = _, %v, want _, ", err) + } + if p.Addr.String() == test.addresses[si] { + connected = true + break + } + time.Sleep(time.Millisecond) + } + if !connected { + t.Fatalf("Connection to %v was not up after more than 1 second", test.addresses[si]) + } + } + + for i := 0; i < 3*backendCount; i++ { + if _, err := testc.EmptyCall(context.Background(), &testpb.Empty{}, grpc.Peer(&p)); err != nil { + t.Fatalf("EmptyCall() = _, %v, want _, ", err) + } + if p.Addr.String() != test.addresses[i%backendCount] { + t.Fatalf("Index %d: want peer %v, got peer %v", i, test.addresses[i%backendCount], p.Addr.String()) + } + } +} + +func TestAddressesRemoved(t *testing.T) { + defer leakcheck.Check(t) + r, cleanup := manual.GenerateAndRegisterManualResolver() + defer cleanup() + + test, err := startTestServers(1) + if err != nil { + t.Fatalf("failed to start servers: %v", err) + } + defer test.cleanup() + + cc, err := grpc.Dial(r.Scheme()+":///test.server", grpc.WithInsecure(), grpc.WithBalancerBuilder(rr)) + if err != nil { + t.Fatalf("failed to dial: %v", err) + } + defer cc.Close() + testc := testpb.NewTestServiceClient(cc) + // The first RPC should fail because there's no address. + ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond) + defer cancel() + if _, err := testc.EmptyCall(ctx, &testpb.Empty{}); err == nil || grpc.Code(err) != codes.DeadlineExceeded { + t.Fatalf("EmptyCall() = _, %v, want _, DeadlineExceeded", err) + } + + r.NewAddress([]resolver.Address{{Addr: test.addresses[0]}}) + // The second RPC should succeed. + if _, err := testc.EmptyCall(context.Background(), &testpb.Empty{}); err != nil { + t.Fatalf("EmptyCall() = _, %v, want _, ", err) + } + + r.NewAddress([]resolver.Address{}) + for i := 0; i < 1000; i++ { + ctx, cancel := context.WithTimeout(context.Background(), 50*time.Millisecond) + defer cancel() + if _, err := testc.EmptyCall(ctx, &testpb.Empty{}, grpc.FailFast(false)); grpc.Code(err) == codes.DeadlineExceeded { + return + } + time.Sleep(time.Millisecond) + } + t.Fatalf("No RPC failed after removing all addresses, want RPC to fail with DeadlineExceeded") +} + +func TestCloseWithPendingRPC(t *testing.T) { + defer leakcheck.Check(t) + r, cleanup := manual.GenerateAndRegisterManualResolver() + defer cleanup() + + test, err := startTestServers(1) + if err != nil { + t.Fatalf("failed to start servers: %v", err) + } + defer test.cleanup() + + cc, err := grpc.Dial(r.Scheme()+":///test.server", grpc.WithInsecure(), grpc.WithBalancerBuilder(rr)) + if err != nil { + t.Fatalf("failed to dial: %v", err) + } + testc := testpb.NewTestServiceClient(cc) + + var wg sync.WaitGroup + for i := 0; i < 3; i++ { + wg.Add(1) + go func() { + defer wg.Done() + // This RPC blocks until cc is closed. + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + if _, err := testc.EmptyCall(ctx, &testpb.Empty{}); grpc.Code(err) == codes.DeadlineExceeded { + t.Errorf("RPC failed because of deadline after cc is closed; want error the client connection is closing") + } + cancel() + }() + } + cc.Close() + wg.Wait() +} + +func TestNewAddressWhileBlocking(t *testing.T) { + defer leakcheck.Check(t) + r, cleanup := manual.GenerateAndRegisterManualResolver() + defer cleanup() + + test, err := startTestServers(1) + if err != nil { + t.Fatalf("failed to start servers: %v", err) + } + defer test.cleanup() + + cc, err := grpc.Dial(r.Scheme()+":///test.server", grpc.WithInsecure(), grpc.WithBalancerBuilder(rr)) + if err != nil { + t.Fatalf("failed to dial: %v", err) + } + defer cc.Close() + testc := testpb.NewTestServiceClient(cc) + // The first RPC should fail because there's no address. + ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond) + defer cancel() + if _, err := testc.EmptyCall(ctx, &testpb.Empty{}); err == nil || grpc.Code(err) != codes.DeadlineExceeded { + t.Fatalf("EmptyCall() = _, %v, want _, DeadlineExceeded", err) + } + + r.NewAddress([]resolver.Address{{Addr: test.addresses[0]}}) + // The second RPC should succeed. + ctx, cancel = context.WithTimeout(context.Background(), 2*time.Second) + defer cancel() + if _, err := testc.EmptyCall(ctx, &testpb.Empty{}); err != nil { + t.Fatalf("EmptyCall() = _, %v, want _, nil", err) + } + + r.NewAddress([]resolver.Address{}) + + var wg sync.WaitGroup + for i := 0; i < 3; i++ { + wg.Add(1) + go func() { + defer wg.Done() + // This RPC blocks until NewAddress is called. + testc.EmptyCall(context.Background(), &testpb.Empty{}) + }() + } + time.Sleep(50 * time.Millisecond) + r.NewAddress([]resolver.Address{{Addr: test.addresses[0]}}) + wg.Wait() +} + +func TestOneServerDown(t *testing.T) { + defer leakcheck.Check(t) + r, cleanup := manual.GenerateAndRegisterManualResolver() + defer cleanup() + + backendCount := 3 + test, err := startTestServers(backendCount) + if err != nil { + t.Fatalf("failed to start servers: %v", err) + } + defer test.cleanup() + + cc, err := grpc.Dial(r.Scheme()+":///test.server", grpc.WithInsecure(), grpc.WithBalancerBuilder(rr)) + if err != nil { + t.Fatalf("failed to dial: %v", err) + } + defer cc.Close() + testc := testpb.NewTestServiceClient(cc) + // The first RPC should fail because there's no address. + ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond) + defer cancel() + if _, err := testc.EmptyCall(ctx, &testpb.Empty{}); err == nil || grpc.Code(err) != codes.DeadlineExceeded { + t.Fatalf("EmptyCall() = _, %v, want _, DeadlineExceeded", err) + } + + var resolvedAddrs []resolver.Address + for i := 0; i < backendCount; i++ { + resolvedAddrs = append(resolvedAddrs, resolver.Address{Addr: test.addresses[i]}) + } + + r.NewAddress(resolvedAddrs) + var p peer.Peer + // Make sure connections to all servers are up. + for si := 0; si < backendCount; si++ { + var connected bool + for i := 0; i < 1000; i++ { + if _, err := testc.EmptyCall(context.Background(), &testpb.Empty{}, grpc.Peer(&p)); err != nil { + t.Fatalf("EmptyCall() = _, %v, want _, ", err) + } + if p.Addr.String() == test.addresses[si] { + connected = true + break + } + time.Sleep(time.Millisecond) + } + if !connected { + t.Fatalf("Connection to %v was not up after more than 1 second", test.addresses[si]) + } + } + + for i := 0; i < 3*backendCount; i++ { + if _, err := testc.EmptyCall(context.Background(), &testpb.Empty{}, grpc.Peer(&p)); err != nil { + t.Fatalf("EmptyCall() = _, %v, want _, ", err) + } + if p.Addr.String() != test.addresses[i%backendCount] { + t.Fatalf("Index %d: want peer %v, got peer %v", i, test.addresses[i%backendCount], p.Addr.String()) + } + } + + // Stop one server, RPCs should roundrobin among the remaining servers. + backendCount-- + test.servers[backendCount].Stop() + // Loop until see server[backendCount-1] twice without seeing server[backendCount]. + var targetSeen int + for i := 0; i < 1000; i++ { + if _, err := testc.EmptyCall(context.Background(), &testpb.Empty{}, grpc.Peer(&p)); err != nil { + t.Logf("EmptyCall() = _, %v, want _, ", err) + // Due to a race, this RPC could possibly get the connection that + // was closing, and this RPC may fail. Keep trying when this + // happens. + continue + } + switch p.Addr.String() { + case test.addresses[backendCount-1]: + targetSeen++ + case test.addresses[backendCount]: + // Reset targetSeen if peer is server[backendCount]. + targetSeen = 0 + } + // Break to make sure the last picked address is server[-1], so the following for loop won't be flaky. + if targetSeen >= 2 { + break + } + } + if targetSeen != 2 { + t.Fatal("Failed to see server[backendCount-1] twice without seeing server[backendCount]") + } + for i := 0; i < 3*backendCount; i++ { + if _, err := testc.EmptyCall(context.Background(), &testpb.Empty{}, grpc.Peer(&p)); err != nil { + t.Fatalf("EmptyCall() = _, %v, want _, ", err) + } + if p.Addr.String() != test.addresses[i%backendCount] { + t.Errorf("Index %d: want peer %v, got peer %v", i, test.addresses[i%backendCount], p.Addr.String()) + } + } +} + +func TestAllServersDown(t *testing.T) { + defer leakcheck.Check(t) + r, cleanup := manual.GenerateAndRegisterManualResolver() + defer cleanup() + + backendCount := 3 + test, err := startTestServers(backendCount) + if err != nil { + t.Fatalf("failed to start servers: %v", err) + } + defer test.cleanup() + + cc, err := grpc.Dial(r.Scheme()+":///test.server", grpc.WithInsecure(), grpc.WithBalancerBuilder(rr)) + if err != nil { + t.Fatalf("failed to dial: %v", err) + } + defer cc.Close() + testc := testpb.NewTestServiceClient(cc) + // The first RPC should fail because there's no address. + ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond) + defer cancel() + if _, err := testc.EmptyCall(ctx, &testpb.Empty{}); err == nil || grpc.Code(err) != codes.DeadlineExceeded { + t.Fatalf("EmptyCall() = _, %v, want _, DeadlineExceeded", err) + } + + var resolvedAddrs []resolver.Address + for i := 0; i < backendCount; i++ { + resolvedAddrs = append(resolvedAddrs, resolver.Address{Addr: test.addresses[i]}) + } + + r.NewAddress(resolvedAddrs) + var p peer.Peer + // Make sure connections to all servers are up. + for si := 0; si < backendCount; si++ { + var connected bool + for i := 0; i < 1000; i++ { + if _, err := testc.EmptyCall(context.Background(), &testpb.Empty{}, grpc.Peer(&p)); err != nil { + t.Fatalf("EmptyCall() = _, %v, want _, ", err) + } + if p.Addr.String() == test.addresses[si] { + connected = true + break + } + time.Sleep(time.Millisecond) + } + if !connected { + t.Fatalf("Connection to %v was not up after more than 1 second", test.addresses[si]) + } + } + + for i := 0; i < 3*backendCount; i++ { + if _, err := testc.EmptyCall(context.Background(), &testpb.Empty{}, grpc.Peer(&p)); err != nil { + t.Fatalf("EmptyCall() = _, %v, want _, ", err) + } + if p.Addr.String() != test.addresses[i%backendCount] { + t.Fatalf("Index %d: want peer %v, got peer %v", i, test.addresses[i%backendCount], p.Addr.String()) + } + } + + // All servers are stopped, failfast RPC should fail with unavailable. + for i := 0; i < backendCount; i++ { + test.servers[i].Stop() + } + time.Sleep(100 * time.Millisecond) + for i := 0; i < 1000; i++ { + if _, err := testc.EmptyCall(context.Background(), &testpb.Empty{}); grpc.Code(err) == codes.Unavailable { + return + } + time.Sleep(time.Millisecond) + } + t.Fatalf("Failfast RPCs didn't fail with Unavailable after all servers are stopped") +} diff --git a/vendor/google.golang.org/grpc/balancer_conn_wrappers.go b/vendor/google.golang.org/grpc/balancer_conn_wrappers.go new file mode 100644 index 0000000000..ebfee4a889 --- /dev/null +++ b/vendor/google.golang.org/grpc/balancer_conn_wrappers.go @@ -0,0 +1,268 @@ +/* + * + * Copyright 2017 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. + * + */ + +package grpc + +import ( + "sync" + + "google.golang.org/grpc/balancer" + "google.golang.org/grpc/connectivity" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/resolver" +) + +// scStateUpdate contains the subConn and the new state it changed to. +type scStateUpdate struct { + sc balancer.SubConn + state connectivity.State +} + +// scStateUpdateBuffer is an unbounded channel for scStateChangeTuple. +// TODO make a general purpose buffer that uses interface{}. +type scStateUpdateBuffer struct { + c chan *scStateUpdate + mu sync.Mutex + backlog []*scStateUpdate +} + +func newSCStateUpdateBuffer() *scStateUpdateBuffer { + return &scStateUpdateBuffer{ + c: make(chan *scStateUpdate, 1), + } +} + +func (b *scStateUpdateBuffer) put(t *scStateUpdate) { + b.mu.Lock() + defer b.mu.Unlock() + if len(b.backlog) == 0 { + select { + case b.c <- t: + return + default: + } + } + b.backlog = append(b.backlog, t) +} + +func (b *scStateUpdateBuffer) load() { + b.mu.Lock() + defer b.mu.Unlock() + if len(b.backlog) > 0 { + select { + case b.c <- b.backlog[0]: + b.backlog[0] = nil + b.backlog = b.backlog[1:] + default: + } + } +} + +// get returns the channel that the scStateUpdate will be sent to. +// +// Upon receiving, the caller should call load to send another +// scStateChangeTuple onto the channel if there is any. +func (b *scStateUpdateBuffer) get() <-chan *scStateUpdate { + return b.c +} + +// resolverUpdate contains the new resolved addresses or error if there's +// any. +type resolverUpdate struct { + addrs []resolver.Address + err error +} + +// ccBalancerWrapper is a wrapper on top of cc for balancers. +// It implements balancer.ClientConn interface. +type ccBalancerWrapper struct { + cc *ClientConn + balancer balancer.Balancer + stateChangeQueue *scStateUpdateBuffer + resolverUpdateCh chan *resolverUpdate + done chan struct{} + + subConns map[*acBalancerWrapper]struct{} +} + +func newCCBalancerWrapper(cc *ClientConn, b balancer.Builder, bopts balancer.BuildOptions) *ccBalancerWrapper { + ccb := &ccBalancerWrapper{ + cc: cc, + stateChangeQueue: newSCStateUpdateBuffer(), + resolverUpdateCh: make(chan *resolverUpdate, 1), + done: make(chan struct{}), + subConns: make(map[*acBalancerWrapper]struct{}), + } + go ccb.watcher() + ccb.balancer = b.Build(ccb, bopts) + return ccb +} + +// watcher balancer functions sequencially, so the balancer can be implemeneted +// lock-free. +func (ccb *ccBalancerWrapper) watcher() { + for { + select { + case t := <-ccb.stateChangeQueue.get(): + ccb.stateChangeQueue.load() + select { + case <-ccb.done: + ccb.balancer.Close() + return + default: + } + ccb.balancer.HandleSubConnStateChange(t.sc, t.state) + case t := <-ccb.resolverUpdateCh: + select { + case <-ccb.done: + ccb.balancer.Close() + return + default: + } + ccb.balancer.HandleResolvedAddrs(t.addrs, t.err) + case <-ccb.done: + } + + select { + case <-ccb.done: + ccb.balancer.Close() + for acbw := range ccb.subConns { + ccb.cc.removeAddrConn(acbw.getAddrConn(), errConnDrain) + } + return + default: + } + } +} + +func (ccb *ccBalancerWrapper) close() { + close(ccb.done) +} + +func (ccb *ccBalancerWrapper) handleSubConnStateChange(sc balancer.SubConn, s connectivity.State) { + // When updating addresses for a SubConn, if the address in use is not in + // the new addresses, the old ac will be tearDown() and a new ac will be + // created. tearDown() generates a state change with Shutdown state, we + // don't want the balancer to receive this state change. So before + // tearDown() on the old ac, ac.acbw (acWrapper) will be set to nil, and + // this function will be called with (nil, Shutdown). We don't need to call + // balancer method in this case. + if sc == nil { + return + } + ccb.stateChangeQueue.put(&scStateUpdate{ + sc: sc, + state: s, + }) +} + +func (ccb *ccBalancerWrapper) handleResolvedAddrs(addrs []resolver.Address, err error) { + select { + case <-ccb.resolverUpdateCh: + default: + } + ccb.resolverUpdateCh <- &resolverUpdate{ + addrs: addrs, + err: err, + } +} + +func (ccb *ccBalancerWrapper) NewSubConn(addrs []resolver.Address, opts balancer.NewSubConnOptions) (balancer.SubConn, error) { + ac, err := ccb.cc.newAddrConn(addrs) + if err != nil { + return nil, err + } + acbw := &acBalancerWrapper{ac: ac} + acbw.ac.mu.Lock() + ac.acbw = acbw + acbw.ac.mu.Unlock() + ccb.subConns[acbw] = struct{}{} + return acbw, nil +} + +func (ccb *ccBalancerWrapper) RemoveSubConn(sc balancer.SubConn) { + acbw, ok := sc.(*acBalancerWrapper) + if !ok { + return + } + delete(ccb.subConns, acbw) + ccb.cc.removeAddrConn(acbw.getAddrConn(), errConnDrain) +} + +func (ccb *ccBalancerWrapper) UpdateBalancerState(s connectivity.State, p balancer.Picker) { + ccb.cc.csMgr.updateState(s) + ccb.cc.blockingpicker.updatePicker(p) +} + +func (ccb *ccBalancerWrapper) Target() string { + return ccb.cc.target +} + +// acBalancerWrapper is a wrapper on top of ac for balancers. +// It implements balancer.SubConn interface. +type acBalancerWrapper struct { + mu sync.Mutex + ac *addrConn +} + +func (acbw *acBalancerWrapper) UpdateAddresses(addrs []resolver.Address) { + acbw.mu.Lock() + defer acbw.mu.Unlock() + if !acbw.ac.tryUpdateAddrs(addrs) { + cc := acbw.ac.cc + acbw.ac.mu.Lock() + // Set old ac.acbw to nil so the Shutdown state update will be ignored + // by balancer. + // + // TODO(bar) the state transition could be wrong when tearDown() old ac + // and creating new ac, fix the transition. + acbw.ac.acbw = nil + acbw.ac.mu.Unlock() + acState := acbw.ac.getState() + acbw.ac.tearDown(errConnDrain) + + if acState == connectivity.Shutdown { + return + } + + ac, err := cc.newAddrConn(addrs) + if err != nil { + grpclog.Warningf("acBalancerWrapper: UpdateAddresses: failed to newAddrConn: %v", err) + return + } + acbw.ac = ac + ac.mu.Lock() + ac.acbw = acbw + ac.mu.Unlock() + if acState != connectivity.Idle { + ac.connect() + } + } +} + +func (acbw *acBalancerWrapper) Connect() { + acbw.mu.Lock() + defer acbw.mu.Unlock() + acbw.ac.connect() +} + +func (acbw *acBalancerWrapper) getAddrConn() *addrConn { + acbw.mu.Lock() + defer acbw.mu.Unlock() + return acbw.ac +} diff --git a/vendor/google.golang.org/grpc/balancer_switching_test.go b/vendor/google.golang.org/grpc/balancer_switching_test.go new file mode 100644 index 0000000000..92c196d388 --- /dev/null +++ b/vendor/google.golang.org/grpc/balancer_switching_test.go @@ -0,0 +1,133 @@ +/* + * + * Copyright 2017 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. + * + */ + +package grpc + +import ( + "fmt" + "math" + "testing" + "time" + + "golang.org/x/net/context" + _ "google.golang.org/grpc/grpclog/glogger" + "google.golang.org/grpc/resolver" + "google.golang.org/grpc/resolver/manual" + "google.golang.org/grpc/test/leakcheck" +) + +func checkPickFirst(cc *ClientConn, servers []*server) error { + var ( + req = "port" + reply string + err error + ) + connected := false + for i := 0; i < 1000; i++ { + if err = Invoke(context.Background(), "/foo/bar", &req, &reply, cc); ErrorDesc(err) == servers[0].port { + if connected { + // connected is set to false if peer is not server[0]. So if + // connected is true here, this is the second time we saw + // server[0] in a row. Break because pickfirst is in effect. + break + } + connected = true + } else { + connected = false + } + time.Sleep(time.Millisecond) + } + if !connected { + return fmt.Errorf("pickfirst is not in effect after 1 second, EmptyCall() = _, %v, want _, %v", err, servers[0].port) + } + // The following RPCs should all succeed with the first server. + for i := 0; i < 3; i++ { + err = Invoke(context.Background(), "/foo/bar", &req, &reply, cc) + if ErrorDesc(err) != servers[0].port { + return fmt.Errorf("Index %d: want peer %v, got peer %v", i, servers[0].port, err) + } + } + return nil +} + +func checkRoundRobin(cc *ClientConn, servers []*server) error { + var ( + req = "port" + reply string + err error + ) + + // Make sure connections to all servers are up. + for i := 0; i < 2; i++ { + // Do this check twice, otherwise the first RPC's transport may still be + // picked by the closing pickfirst balancer, and the test becomes flaky. + for _, s := range servers { + var up bool + for i := 0; i < 1000; i++ { + if err = Invoke(context.Background(), "/foo/bar", &req, &reply, cc); ErrorDesc(err) == s.port { + up = true + break + } + time.Sleep(time.Millisecond) + } + if !up { + return fmt.Errorf("server %v is not up within 1 second", s.port) + } + } + } + + serverCount := len(servers) + for i := 0; i < 3*serverCount; i++ { + err = Invoke(context.Background(), "/foo/bar", &req, &reply, cc) + if ErrorDesc(err) != servers[i%serverCount].port { + return fmt.Errorf("Index %d: want peer %v, got peer %v", i, servers[i%serverCount].port, err) + } + } + return nil +} + +func TestSwitchBalancer(t *testing.T) { + defer leakcheck.Check(t) + r, rcleanup := manual.GenerateAndRegisterManualResolver() + defer rcleanup() + + numServers := 2 + servers, _, scleanup := startServers(t, numServers, math.MaxInt32) + defer scleanup() + + cc, err := Dial(r.Scheme()+":///test.server", WithInsecure(), WithCodec(testCodec{})) + if err != nil { + t.Fatalf("failed to dial: %v", err) + } + defer cc.Close() + r.NewAddress([]resolver.Address{{Addr: servers[0].addr}, {Addr: servers[1].addr}}) + // The default balancer is pickfirst. + if err := checkPickFirst(cc, servers); err != nil { + t.Fatalf("check pickfirst returned non-nil error: %v", err) + } + // Switch to roundrobin. + cc.handleServiceConfig(`{"loadBalancingPolicy": "round_robin"}`) + if err := checkRoundRobin(cc, servers); err != nil { + t.Fatalf("check roundrobin returned non-nil error: %v", err) + } + // Switch to pickfirst. + cc.handleServiceConfig(`{"loadBalancingPolicy": "pick_first"}`) + if err := checkPickFirst(cc, servers); err != nil { + t.Fatalf("check pickfirst returned non-nil error: %v", err) + } +} diff --git a/vendor/google.golang.org/grpc/balancer_test.go b/vendor/google.golang.org/grpc/balancer_test.go new file mode 100644 index 0000000000..a1558f027a --- /dev/null +++ b/vendor/google.golang.org/grpc/balancer_test.go @@ -0,0 +1,802 @@ +/* + * + * Copyright 2016 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. + * + */ + +package grpc + +import ( + "fmt" + "math" + "strconv" + "sync" + "testing" + "time" + + "golang.org/x/net/context" + "google.golang.org/grpc/codes" + _ "google.golang.org/grpc/grpclog/glogger" + "google.golang.org/grpc/naming" + "google.golang.org/grpc/test/leakcheck" + + // V1 balancer tests use passthrough resolver instead of dns. + // TODO(bar) remove this when removing v1 balaner entirely. + _ "google.golang.org/grpc/resolver/passthrough" +) + +type testWatcher struct { + // the channel to receives name resolution updates + update chan *naming.Update + // the side channel to get to know how many updates in a batch + side chan int + // the channel to notifiy update injector that the update reading is done + readDone chan int +} + +func (w *testWatcher) Next() (updates []*naming.Update, err error) { + n := <-w.side + if n == 0 { + return nil, fmt.Errorf("w.side is closed") + } + for i := 0; i < n; i++ { + u := <-w.update + if u != nil { + updates = append(updates, u) + } + } + w.readDone <- 0 + return +} + +func (w *testWatcher) Close() { + close(w.side) +} + +// Inject naming resolution updates to the testWatcher. +func (w *testWatcher) inject(updates []*naming.Update) { + w.side <- len(updates) + for _, u := range updates { + w.update <- u + } + <-w.readDone +} + +type testNameResolver struct { + w *testWatcher + addr string +} + +func (r *testNameResolver) Resolve(target string) (naming.Watcher, error) { + r.w = &testWatcher{ + update: make(chan *naming.Update, 1), + side: make(chan int, 1), + readDone: make(chan int), + } + r.w.side <- 1 + r.w.update <- &naming.Update{ + Op: naming.Add, + Addr: r.addr, + } + go func() { + <-r.w.readDone + }() + return r.w, nil +} + +func startServers(t *testing.T, numServers int, maxStreams uint32) ([]*server, *testNameResolver, func()) { + var servers []*server + for i := 0; i < numServers; i++ { + s := newTestServer() + servers = append(servers, s) + go s.start(t, 0, maxStreams) + s.wait(t, 2*time.Second) + } + // Point to server[0] + addr := "localhost:" + servers[0].port + return servers, &testNameResolver{ + addr: addr, + }, func() { + for i := 0; i < numServers; i++ { + servers[i].stop() + } + } +} + +func TestNameDiscovery(t *testing.T) { + defer leakcheck.Check(t) + // Start 2 servers on 2 ports. + numServers := 2 + servers, r, cleanup := startServers(t, numServers, math.MaxUint32) + defer cleanup() + cc, err := Dial("passthrough:///foo.bar.com", WithBalancer(RoundRobin(r)), WithBlock(), WithInsecure(), WithCodec(testCodec{})) + if err != nil { + t.Fatalf("Failed to create ClientConn: %v", err) + } + defer cc.Close() + req := "port" + var reply string + if err := Invoke(context.Background(), "/foo/bar", &req, &reply, cc); err == nil || ErrorDesc(err) != servers[0].port { + t.Fatalf("grpc.Invoke(_, _, _, _, _) = %v, want %s", err, servers[0].port) + } + // Inject the name resolution change to remove servers[0] and add servers[1]. + var updates []*naming.Update + updates = append(updates, &naming.Update{ + Op: naming.Delete, + Addr: "localhost:" + servers[0].port, + }) + updates = append(updates, &naming.Update{ + Op: naming.Add, + Addr: "localhost:" + servers[1].port, + }) + r.w.inject(updates) + // Loop until the rpcs in flight talks to servers[1]. + for { + if err := Invoke(context.Background(), "/foo/bar", &req, &reply, cc); err != nil && ErrorDesc(err) == servers[1].port { + break + } + time.Sleep(10 * time.Millisecond) + } +} + +func TestEmptyAddrs(t *testing.T) { + defer leakcheck.Check(t) + servers, r, cleanup := startServers(t, 1, math.MaxUint32) + defer cleanup() + cc, err := Dial("passthrough:///foo.bar.com", WithBalancer(RoundRobin(r)), WithBlock(), WithInsecure(), WithCodec(testCodec{})) + if err != nil { + t.Fatalf("Failed to create ClientConn: %v", err) + } + defer cc.Close() + var reply string + if err := Invoke(context.Background(), "/foo/bar", &expectedRequest, &reply, cc); err != nil || reply != expectedResponse { + t.Fatalf("grpc.Invoke(_, _, _, _, _) = %v, reply = %q, want %q, ", err, reply, expectedResponse) + } + // Inject name resolution change to remove the server so that there is no address + // available after that. + u := &naming.Update{ + Op: naming.Delete, + Addr: "localhost:" + servers[0].port, + } + r.w.inject([]*naming.Update{u}) + // Loop until the above updates apply. + for { + time.Sleep(10 * time.Millisecond) + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Millisecond) + if err := Invoke(ctx, "/foo/bar", &expectedRequest, &reply, cc); err != nil { + cancel() + break + } + cancel() + } +} + +func TestRoundRobin(t *testing.T) { + defer leakcheck.Check(t) + // Start 3 servers on 3 ports. + numServers := 3 + servers, r, cleanup := startServers(t, numServers, math.MaxUint32) + defer cleanup() + cc, err := Dial("passthrough:///foo.bar.com", WithBalancer(RoundRobin(r)), WithBlock(), WithInsecure(), WithCodec(testCodec{})) + if err != nil { + t.Fatalf("Failed to create ClientConn: %v", err) + } + defer cc.Close() + // Add servers[1] to the service discovery. + u := &naming.Update{ + Op: naming.Add, + Addr: "localhost:" + servers[1].port, + } + r.w.inject([]*naming.Update{u}) + req := "port" + var reply string + // Loop until servers[1] is up + for { + if err := Invoke(context.Background(), "/foo/bar", &req, &reply, cc); err != nil && ErrorDesc(err) == servers[1].port { + break + } + time.Sleep(10 * time.Millisecond) + } + // Add server2[2] to the service discovery. + u = &naming.Update{ + Op: naming.Add, + Addr: "localhost:" + servers[2].port, + } + r.w.inject([]*naming.Update{u}) + // Loop until both servers[2] are up. + for { + if err := Invoke(context.Background(), "/foo/bar", &req, &reply, cc); err != nil && ErrorDesc(err) == servers[2].port { + break + } + time.Sleep(10 * time.Millisecond) + } + // Check the incoming RPCs served in a round-robin manner. + for i := 0; i < 10; i++ { + if err := Invoke(context.Background(), "/foo/bar", &req, &reply, cc); err == nil || ErrorDesc(err) != servers[i%numServers].port { + t.Fatalf("Index %d: Invoke(_, _, _, _, _) = %v, want %s", i, err, servers[i%numServers].port) + } + } +} + +func TestCloseWithPendingRPC(t *testing.T) { + defer leakcheck.Check(t) + servers, r, cleanup := startServers(t, 1, math.MaxUint32) + defer cleanup() + cc, err := Dial("passthrough:///foo.bar.com", WithBalancer(RoundRobin(r)), WithBlock(), WithInsecure(), WithCodec(testCodec{})) + if err != nil { + t.Fatalf("Failed to create ClientConn: %v", err) + } + defer cc.Close() + var reply string + if err := Invoke(context.Background(), "/foo/bar", &expectedRequest, &reply, cc, FailFast(false)); err != nil { + t.Fatalf("grpc.Invoke(_, _, _, _, _) = %v, want %s", err, servers[0].port) + } + // Remove the server. + updates := []*naming.Update{{ + Op: naming.Delete, + Addr: "localhost:" + servers[0].port, + }} + r.w.inject(updates) + // Loop until the above update applies. + for { + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Millisecond) + if err := Invoke(ctx, "/foo/bar", &expectedRequest, &reply, cc, FailFast(false)); Code(err) == codes.DeadlineExceeded { + cancel() + break + } + time.Sleep(10 * time.Millisecond) + cancel() + } + // Issue 2 RPCs which should be completed with error status once cc is closed. + var wg sync.WaitGroup + wg.Add(2) + go func() { + defer wg.Done() + var reply string + if err := Invoke(context.Background(), "/foo/bar", &expectedRequest, &reply, cc, FailFast(false)); err == nil { + t.Errorf("grpc.Invoke(_, _, _, _, _) = %v, want not nil", err) + } + }() + go func() { + defer wg.Done() + var reply string + time.Sleep(5 * time.Millisecond) + if err := Invoke(context.Background(), "/foo/bar", &expectedRequest, &reply, cc, FailFast(false)); err == nil { + t.Errorf("grpc.Invoke(_, _, _, _, _) = %v, want not nil", err) + } + }() + time.Sleep(5 * time.Millisecond) + cc.Close() + wg.Wait() +} + +func TestGetOnWaitChannel(t *testing.T) { + defer leakcheck.Check(t) + servers, r, cleanup := startServers(t, 1, math.MaxUint32) + defer cleanup() + cc, err := Dial("passthrough:///foo.bar.com", WithBalancer(RoundRobin(r)), WithBlock(), WithInsecure(), WithCodec(testCodec{})) + if err != nil { + t.Fatalf("Failed to create ClientConn: %v", err) + } + defer cc.Close() + // Remove all servers so that all upcoming RPCs will block on waitCh. + updates := []*naming.Update{{ + Op: naming.Delete, + Addr: "localhost:" + servers[0].port, + }} + r.w.inject(updates) + for { + var reply string + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Millisecond) + if err := Invoke(ctx, "/foo/bar", &expectedRequest, &reply, cc, FailFast(false)); Code(err) == codes.DeadlineExceeded { + cancel() + break + } + cancel() + time.Sleep(10 * time.Millisecond) + } + var wg sync.WaitGroup + wg.Add(1) + go func() { + defer wg.Done() + var reply string + if err := Invoke(context.Background(), "/foo/bar", &expectedRequest, &reply, cc, FailFast(false)); err != nil { + t.Errorf("grpc.Invoke(_, _, _, _, _) = %v, want ", err) + } + }() + // Add a connected server to get the above RPC through. + updates = []*naming.Update{{ + Op: naming.Add, + Addr: "localhost:" + servers[0].port, + }} + r.w.inject(updates) + // Wait until the above RPC succeeds. + wg.Wait() +} + +func TestOneServerDown(t *testing.T) { + defer leakcheck.Check(t) + // Start 2 servers. + numServers := 2 + servers, r, cleanup := startServers(t, numServers, math.MaxUint32) + defer cleanup() + cc, err := Dial("passthrough:///foo.bar.com", WithBalancer(RoundRobin(r)), WithBlock(), WithInsecure(), WithCodec(testCodec{})) + if err != nil { + t.Fatalf("Failed to create ClientConn: %v", err) + } + defer cc.Close() + // Add servers[1] to the service discovery. + var updates []*naming.Update + updates = append(updates, &naming.Update{ + Op: naming.Add, + Addr: "localhost:" + servers[1].port, + }) + r.w.inject(updates) + req := "port" + var reply string + // Loop until servers[1] is up + for { + if err := Invoke(context.Background(), "/foo/bar", &req, &reply, cc); err != nil && ErrorDesc(err) == servers[1].port { + break + } + time.Sleep(10 * time.Millisecond) + } + + var wg sync.WaitGroup + numRPC := 100 + sleepDuration := 10 * time.Millisecond + wg.Add(1) + go func() { + time.Sleep(sleepDuration) + // After sleepDuration, kill server[0]. + servers[0].stop() + wg.Done() + }() + + // All non-failfast RPCs should not block because there's at least one connection available. + for i := 0; i < numRPC; i++ { + wg.Add(1) + go func() { + time.Sleep(sleepDuration) + // After sleepDuration, invoke RPC. + // server[0] is killed around the same time to make it racy between balancer and gRPC internals. + Invoke(context.Background(), "/foo/bar", &req, &reply, cc, FailFast(false)) + wg.Done() + }() + } + wg.Wait() +} + +func TestOneAddressRemoval(t *testing.T) { + defer leakcheck.Check(t) + // Start 2 servers. + numServers := 2 + servers, r, cleanup := startServers(t, numServers, math.MaxUint32) + defer cleanup() + cc, err := Dial("passthrough:///foo.bar.com", WithBalancer(RoundRobin(r)), WithBlock(), WithInsecure(), WithCodec(testCodec{})) + if err != nil { + t.Fatalf("Failed to create ClientConn: %v", err) + } + defer cc.Close() + // Add servers[1] to the service discovery. + var updates []*naming.Update + updates = append(updates, &naming.Update{ + Op: naming.Add, + Addr: "localhost:" + servers[1].port, + }) + r.w.inject(updates) + req := "port" + var reply string + // Loop until servers[1] is up + for { + if err := Invoke(context.Background(), "/foo/bar", &req, &reply, cc); err != nil && ErrorDesc(err) == servers[1].port { + break + } + time.Sleep(10 * time.Millisecond) + } + + var wg sync.WaitGroup + numRPC := 100 + sleepDuration := 10 * time.Millisecond + wg.Add(1) + go func() { + time.Sleep(sleepDuration) + // After sleepDuration, delete server[0]. + var updates []*naming.Update + updates = append(updates, &naming.Update{ + Op: naming.Delete, + Addr: "localhost:" + servers[0].port, + }) + r.w.inject(updates) + wg.Done() + }() + + // All non-failfast RPCs should not fail because there's at least one connection available. + for i := 0; i < numRPC; i++ { + wg.Add(1) + go func() { + var reply string + time.Sleep(sleepDuration) + // After sleepDuration, invoke RPC. + // server[0] is removed around the same time to make it racy between balancer and gRPC internals. + if err := Invoke(context.Background(), "/foo/bar", &expectedRequest, &reply, cc, FailFast(false)); err != nil { + t.Errorf("grpc.Invoke(_, _, _, _, _) = %v, want not nil", err) + } + wg.Done() + }() + } + wg.Wait() +} + +func checkServerUp(t *testing.T, currentServer *server) { + req := "port" + port := currentServer.port + cc, err := Dial("passthrough:///localhost:"+port, WithBlock(), WithInsecure(), WithCodec(testCodec{})) + if err != nil { + t.Fatalf("Failed to create ClientConn: %v", err) + } + defer cc.Close() + var reply string + for { + if err := Invoke(context.Background(), "/foo/bar", &req, &reply, cc); err != nil && ErrorDesc(err) == port { + break + } + time.Sleep(10 * time.Millisecond) + } +} + +func TestPickFirstEmptyAddrs(t *testing.T) { + defer leakcheck.Check(t) + servers, r, cleanup := startServers(t, 1, math.MaxUint32) + defer cleanup() + cc, err := Dial("passthrough:///foo.bar.com", WithBalancer(pickFirstBalancerV1(r)), WithBlock(), WithInsecure(), WithCodec(testCodec{})) + if err != nil { + t.Fatalf("Failed to create ClientConn: %v", err) + } + defer cc.Close() + var reply string + if err := Invoke(context.Background(), "/foo/bar", &expectedRequest, &reply, cc); err != nil || reply != expectedResponse { + t.Fatalf("grpc.Invoke(_, _, _, _, _) = %v, reply = %q, want %q, ", err, reply, expectedResponse) + } + // Inject name resolution change to remove the server so that there is no address + // available after that. + u := &naming.Update{ + Op: naming.Delete, + Addr: "localhost:" + servers[0].port, + } + r.w.inject([]*naming.Update{u}) + // Loop until the above updates apply. + for { + time.Sleep(10 * time.Millisecond) + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Millisecond) + if err := Invoke(ctx, "/foo/bar", &expectedRequest, &reply, cc); err != nil { + cancel() + break + } + cancel() + } +} + +func TestPickFirstCloseWithPendingRPC(t *testing.T) { + defer leakcheck.Check(t) + servers, r, cleanup := startServers(t, 1, math.MaxUint32) + defer cleanup() + cc, err := Dial("passthrough:///foo.bar.com", WithBalancer(pickFirstBalancerV1(r)), WithBlock(), WithInsecure(), WithCodec(testCodec{})) + if err != nil { + t.Fatalf("Failed to create ClientConn: %v", err) + } + defer cc.Close() + var reply string + if err := Invoke(context.Background(), "/foo/bar", &expectedRequest, &reply, cc, FailFast(false)); err != nil { + t.Fatalf("grpc.Invoke(_, _, _, _, _) = %v, want %s", err, servers[0].port) + } + // Remove the server. + updates := []*naming.Update{{ + Op: naming.Delete, + Addr: "localhost:" + servers[0].port, + }} + r.w.inject(updates) + // Loop until the above update applies. + for { + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Millisecond) + if err := Invoke(ctx, "/foo/bar", &expectedRequest, &reply, cc, FailFast(false)); Code(err) == codes.DeadlineExceeded { + cancel() + break + } + time.Sleep(10 * time.Millisecond) + cancel() + } + // Issue 2 RPCs which should be completed with error status once cc is closed. + var wg sync.WaitGroup + wg.Add(2) + go func() { + defer wg.Done() + var reply string + if err := Invoke(context.Background(), "/foo/bar", &expectedRequest, &reply, cc, FailFast(false)); err == nil { + t.Errorf("grpc.Invoke(_, _, _, _, _) = %v, want not nil", err) + } + }() + go func() { + defer wg.Done() + var reply string + time.Sleep(5 * time.Millisecond) + if err := Invoke(context.Background(), "/foo/bar", &expectedRequest, &reply, cc, FailFast(false)); err == nil { + t.Errorf("grpc.Invoke(_, _, _, _, _) = %v, want not nil", err) + } + }() + time.Sleep(5 * time.Millisecond) + cc.Close() + wg.Wait() +} + +func TestPickFirstOrderAllServerUp(t *testing.T) { + defer leakcheck.Check(t) + // Start 3 servers on 3 ports. + numServers := 3 + servers, r, cleanup := startServers(t, numServers, math.MaxUint32) + defer cleanup() + cc, err := Dial("passthrough:///foo.bar.com", WithBalancer(pickFirstBalancerV1(r)), WithBlock(), WithInsecure(), WithCodec(testCodec{})) + if err != nil { + t.Fatalf("Failed to create ClientConn: %v", err) + } + defer cc.Close() + // Add servers[1] and [2] to the service discovery. + u := &naming.Update{ + Op: naming.Add, + Addr: "localhost:" + servers[1].port, + } + r.w.inject([]*naming.Update{u}) + + u = &naming.Update{ + Op: naming.Add, + Addr: "localhost:" + servers[2].port, + } + r.w.inject([]*naming.Update{u}) + + // Loop until all 3 servers are up + checkServerUp(t, servers[0]) + checkServerUp(t, servers[1]) + checkServerUp(t, servers[2]) + + // Check the incoming RPCs served in server[0] + req := "port" + var reply string + for i := 0; i < 20; i++ { + if err := Invoke(context.Background(), "/foo/bar", &req, &reply, cc); err == nil || ErrorDesc(err) != servers[0].port { + t.Fatalf("Index %d: Invoke(_, _, _, _, _) = %v, want %s", 0, err, servers[0].port) + } + time.Sleep(10 * time.Millisecond) + } + + // Delete server[0] in the balancer, the incoming RPCs served in server[1] + // For test addrconn, close server[0] instead + u = &naming.Update{ + Op: naming.Delete, + Addr: "localhost:" + servers[0].port, + } + r.w.inject([]*naming.Update{u}) + // Loop until it changes to server[1] + for { + if err := Invoke(context.Background(), "/foo/bar", &req, &reply, cc); err != nil && ErrorDesc(err) == servers[1].port { + break + } + time.Sleep(10 * time.Millisecond) + } + for i := 0; i < 20; i++ { + if err := Invoke(context.Background(), "/foo/bar", &req, &reply, cc); err == nil || ErrorDesc(err) != servers[1].port { + t.Fatalf("Index %d: Invoke(_, _, _, _, _) = %v, want %s", 1, err, servers[1].port) + } + time.Sleep(10 * time.Millisecond) + } + + // Add server[0] back to the balancer, the incoming RPCs served in server[1] + // Add is append operation, the order of Notify now is {server[1].port server[2].port server[0].port} + u = &naming.Update{ + Op: naming.Add, + Addr: "localhost:" + servers[0].port, + } + r.w.inject([]*naming.Update{u}) + for i := 0; i < 20; i++ { + if err := Invoke(context.Background(), "/foo/bar", &req, &reply, cc); err == nil || ErrorDesc(err) != servers[1].port { + t.Fatalf("Index %d: Invoke(_, _, _, _, _) = %v, want %s", 1, err, servers[1].port) + } + time.Sleep(10 * time.Millisecond) + } + + // Delete server[1] in the balancer, the incoming RPCs served in server[2] + u = &naming.Update{ + Op: naming.Delete, + Addr: "localhost:" + servers[1].port, + } + r.w.inject([]*naming.Update{u}) + for { + if err := Invoke(context.Background(), "/foo/bar", &req, &reply, cc); err != nil && ErrorDesc(err) == servers[2].port { + break + } + time.Sleep(1 * time.Second) + } + for i := 0; i < 20; i++ { + if err := Invoke(context.Background(), "/foo/bar", &req, &reply, cc); err == nil || ErrorDesc(err) != servers[2].port { + t.Fatalf("Index %d: Invoke(_, _, _, _, _) = %v, want %s", 2, err, servers[2].port) + } + time.Sleep(10 * time.Millisecond) + } + + // Delete server[2] in the balancer, the incoming RPCs served in server[0] + u = &naming.Update{ + Op: naming.Delete, + Addr: "localhost:" + servers[2].port, + } + r.w.inject([]*naming.Update{u}) + for { + if err := Invoke(context.Background(), "/foo/bar", &req, &reply, cc); err != nil && ErrorDesc(err) == servers[0].port { + break + } + time.Sleep(1 * time.Second) + } + for i := 0; i < 20; i++ { + if err := Invoke(context.Background(), "/foo/bar", &req, &reply, cc); err == nil || ErrorDesc(err) != servers[0].port { + t.Fatalf("Index %d: Invoke(_, _, _, _, _) = %v, want %s", 0, err, servers[0].port) + } + time.Sleep(10 * time.Millisecond) + } +} + +func TestPickFirstOrderOneServerDown(t *testing.T) { + defer leakcheck.Check(t) + // Start 3 servers on 3 ports. + numServers := 3 + servers, r, cleanup := startServers(t, numServers, math.MaxUint32) + defer cleanup() + cc, err := Dial("passthrough:///foo.bar.com", WithBalancer(pickFirstBalancerV1(r)), WithBlock(), WithInsecure(), WithCodec(testCodec{})) + if err != nil { + t.Fatalf("Failed to create ClientConn: %v", err) + } + defer cc.Close() + // Add servers[1] and [2] to the service discovery. + u := &naming.Update{ + Op: naming.Add, + Addr: "localhost:" + servers[1].port, + } + r.w.inject([]*naming.Update{u}) + + u = &naming.Update{ + Op: naming.Add, + Addr: "localhost:" + servers[2].port, + } + r.w.inject([]*naming.Update{u}) + + // Loop until all 3 servers are up + checkServerUp(t, servers[0]) + checkServerUp(t, servers[1]) + checkServerUp(t, servers[2]) + + // Check the incoming RPCs served in server[0] + req := "port" + var reply string + for i := 0; i < 20; i++ { + if err := Invoke(context.Background(), "/foo/bar", &req, &reply, cc); err == nil || ErrorDesc(err) != servers[0].port { + t.Fatalf("Index %d: Invoke(_, _, _, _, _) = %v, want %s", 0, err, servers[0].port) + } + time.Sleep(10 * time.Millisecond) + } + + // server[0] down, incoming RPCs served in server[1], but the order of Notify still remains + // {server[0] server[1] server[2]} + servers[0].stop() + // Loop until it changes to server[1] + for { + if err := Invoke(context.Background(), "/foo/bar", &req, &reply, cc); err != nil && ErrorDesc(err) == servers[1].port { + break + } + time.Sleep(10 * time.Millisecond) + } + for i := 0; i < 20; i++ { + if err := Invoke(context.Background(), "/foo/bar", &req, &reply, cc); err == nil || ErrorDesc(err) != servers[1].port { + t.Fatalf("Index %d: Invoke(_, _, _, _, _) = %v, want %s", 1, err, servers[1].port) + } + time.Sleep(10 * time.Millisecond) + } + + // up the server[0] back, the incoming RPCs served in server[1] + p, _ := strconv.Atoi(servers[0].port) + servers[0] = newTestServer() + go servers[0].start(t, p, math.MaxUint32) + defer servers[0].stop() + servers[0].wait(t, 2*time.Second) + checkServerUp(t, servers[0]) + + for i := 0; i < 20; i++ { + if err := Invoke(context.Background(), "/foo/bar", &req, &reply, cc); err == nil || ErrorDesc(err) != servers[1].port { + t.Fatalf("Index %d: Invoke(_, _, _, _, _) = %v, want %s", 1, err, servers[1].port) + } + time.Sleep(10 * time.Millisecond) + } + + // Delete server[1] in the balancer, the incoming RPCs served in server[0] + u = &naming.Update{ + Op: naming.Delete, + Addr: "localhost:" + servers[1].port, + } + r.w.inject([]*naming.Update{u}) + for { + if err := Invoke(context.Background(), "/foo/bar", &req, &reply, cc); err != nil && ErrorDesc(err) == servers[0].port { + break + } + time.Sleep(1 * time.Second) + } + for i := 0; i < 20; i++ { + if err := Invoke(context.Background(), "/foo/bar", &req, &reply, cc); err == nil || ErrorDesc(err) != servers[0].port { + t.Fatalf("Index %d: Invoke(_, _, _, _, _) = %v, want %s", 0, err, servers[0].port) + } + time.Sleep(10 * time.Millisecond) + } +} + +func TestPickFirstOneAddressRemoval(t *testing.T) { + defer leakcheck.Check(t) + // Start 2 servers. + numServers := 2 + servers, r, cleanup := startServers(t, numServers, math.MaxUint32) + defer cleanup() + cc, err := Dial("passthrough:///localhost:"+servers[0].port, WithBalancer(pickFirstBalancerV1(r)), WithBlock(), WithInsecure(), WithCodec(testCodec{})) + if err != nil { + t.Fatalf("Failed to create ClientConn: %v", err) + } + defer cc.Close() + // Add servers[1] to the service discovery. + var updates []*naming.Update + updates = append(updates, &naming.Update{ + Op: naming.Add, + Addr: "localhost:" + servers[1].port, + }) + r.w.inject(updates) + + // Create a new cc to Loop until servers[1] is up + checkServerUp(t, servers[0]) + checkServerUp(t, servers[1]) + + var wg sync.WaitGroup + numRPC := 100 + sleepDuration := 10 * time.Millisecond + wg.Add(1) + go func() { + time.Sleep(sleepDuration) + // After sleepDuration, delete server[0]. + var updates []*naming.Update + updates = append(updates, &naming.Update{ + Op: naming.Delete, + Addr: "localhost:" + servers[0].port, + }) + r.w.inject(updates) + wg.Done() + }() + + // All non-failfast RPCs should not fail because there's at least one connection available. + for i := 0; i < numRPC; i++ { + wg.Add(1) + go func() { + var reply string + time.Sleep(sleepDuration) + // After sleepDuration, invoke RPC. + // server[0] is removed around the same time to make it racy between balancer and gRPC internals. + if err := Invoke(context.Background(), "/foo/bar", &expectedRequest, &reply, cc, FailFast(false)); err != nil { + t.Errorf("grpc.Invoke(_, _, _, _, _) = %v, want not nil", err) + } + wg.Done() + }() + } + wg.Wait() +} diff --git a/vendor/google.golang.org/grpc/balancer_v1_wrapper.go b/vendor/google.golang.org/grpc/balancer_v1_wrapper.go new file mode 100644 index 0000000000..6cb39071c1 --- /dev/null +++ b/vendor/google.golang.org/grpc/balancer_v1_wrapper.go @@ -0,0 +1,374 @@ +/* + * + * Copyright 2017 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. + * + */ + +package grpc + +import ( + "strings" + "sync" + + "golang.org/x/net/context" + "google.golang.org/grpc/balancer" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/connectivity" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/resolver" +) + +type balancerWrapperBuilder struct { + b Balancer // The v1 balancer. +} + +func (bwb *balancerWrapperBuilder) Build(cc balancer.ClientConn, opts balancer.BuildOptions) balancer.Balancer { + targetAddr := cc.Target() + targetSplitted := strings.Split(targetAddr, ":///") + if len(targetSplitted) >= 2 { + targetAddr = targetSplitted[1] + } + + bwb.b.Start(targetAddr, BalancerConfig{ + DialCreds: opts.DialCreds, + Dialer: opts.Dialer, + }) + _, pickfirst := bwb.b.(*pickFirst) + bw := &balancerWrapper{ + balancer: bwb.b, + pickfirst: pickfirst, + cc: cc, + targetAddr: targetAddr, + startCh: make(chan struct{}), + conns: make(map[resolver.Address]balancer.SubConn), + connSt: make(map[balancer.SubConn]*scState), + csEvltr: &connectivityStateEvaluator{}, + state: connectivity.Idle, + } + cc.UpdateBalancerState(connectivity.Idle, bw) + go bw.lbWatcher() + return bw +} + +func (bwb *balancerWrapperBuilder) Name() string { + return "wrapper" +} + +type scState struct { + addr Address // The v1 address type. + s connectivity.State + down func(error) +} + +type balancerWrapper struct { + balancer Balancer // The v1 balancer. + pickfirst bool + + cc balancer.ClientConn + targetAddr string // Target without the scheme. + + // To aggregate the connectivity state. + csEvltr *connectivityStateEvaluator + state connectivity.State + + mu sync.Mutex + conns map[resolver.Address]balancer.SubConn + connSt map[balancer.SubConn]*scState + // This channel is closed when handling the first resolver result. + // lbWatcher blocks until this is closed, to avoid race between + // - NewSubConn is created, cc wants to notify balancer of state changes; + // - Build hasn't return, cc doesn't have access to balancer. + startCh chan struct{} +} + +// lbWatcher watches the Notify channel of the balancer and manages +// connections accordingly. +func (bw *balancerWrapper) lbWatcher() { + <-bw.startCh + notifyCh := bw.balancer.Notify() + if notifyCh == nil { + // There's no resolver in the balancer. Connect directly. + a := resolver.Address{ + Addr: bw.targetAddr, + Type: resolver.Backend, + } + sc, err := bw.cc.NewSubConn([]resolver.Address{a}, balancer.NewSubConnOptions{}) + if err != nil { + grpclog.Warningf("Error creating connection to %v. Err: %v", a, err) + } else { + bw.mu.Lock() + bw.conns[a] = sc + bw.connSt[sc] = &scState{ + addr: Address{Addr: bw.targetAddr}, + s: connectivity.Idle, + } + bw.mu.Unlock() + sc.Connect() + } + return + } + + for addrs := range notifyCh { + grpclog.Infof("balancerWrapper: got update addr from Notify: %v\n", addrs) + if bw.pickfirst { + var ( + oldA resolver.Address + oldSC balancer.SubConn + ) + bw.mu.Lock() + for oldA, oldSC = range bw.conns { + break + } + bw.mu.Unlock() + if len(addrs) <= 0 { + if oldSC != nil { + // Teardown old sc. + bw.mu.Lock() + delete(bw.conns, oldA) + delete(bw.connSt, oldSC) + bw.mu.Unlock() + bw.cc.RemoveSubConn(oldSC) + } + continue + } + + var newAddrs []resolver.Address + for _, a := range addrs { + newAddr := resolver.Address{ + Addr: a.Addr, + Type: resolver.Backend, // All addresses from balancer are all backends. + ServerName: "", + Metadata: a.Metadata, + } + newAddrs = append(newAddrs, newAddr) + } + if oldSC == nil { + // Create new sc. + sc, err := bw.cc.NewSubConn(newAddrs, balancer.NewSubConnOptions{}) + if err != nil { + grpclog.Warningf("Error creating connection to %v. Err: %v", newAddrs, err) + } else { + bw.mu.Lock() + // For pickfirst, there should be only one SubConn, so the + // address doesn't matter. All states updating (up and down) + // and picking should all happen on that only SubConn. + bw.conns[resolver.Address{}] = sc + bw.connSt[sc] = &scState{ + addr: addrs[0], // Use the first address. + s: connectivity.Idle, + } + bw.mu.Unlock() + sc.Connect() + } + } else { + oldSC.UpdateAddresses(newAddrs) + bw.mu.Lock() + bw.connSt[oldSC].addr = addrs[0] + bw.mu.Unlock() + } + } else { + var ( + add []resolver.Address // Addresses need to setup connections. + del []balancer.SubConn // Connections need to tear down. + ) + resAddrs := make(map[resolver.Address]Address) + for _, a := range addrs { + resAddrs[resolver.Address{ + Addr: a.Addr, + Type: resolver.Backend, // All addresses from balancer are all backends. + ServerName: "", + Metadata: a.Metadata, + }] = a + } + bw.mu.Lock() + for a := range resAddrs { + if _, ok := bw.conns[a]; !ok { + add = append(add, a) + } + } + for a, c := range bw.conns { + if _, ok := resAddrs[a]; !ok { + del = append(del, c) + delete(bw.conns, a) + // Keep the state of this sc in bw.connSt until its state becomes Shutdown. + } + } + bw.mu.Unlock() + for _, a := range add { + sc, err := bw.cc.NewSubConn([]resolver.Address{a}, balancer.NewSubConnOptions{}) + if err != nil { + grpclog.Warningf("Error creating connection to %v. Err: %v", a, err) + } else { + bw.mu.Lock() + bw.conns[a] = sc + bw.connSt[sc] = &scState{ + addr: resAddrs[a], + s: connectivity.Idle, + } + bw.mu.Unlock() + sc.Connect() + } + } + for _, c := range del { + bw.cc.RemoveSubConn(c) + } + } + } +} + +func (bw *balancerWrapper) HandleSubConnStateChange(sc balancer.SubConn, s connectivity.State) { + bw.mu.Lock() + defer bw.mu.Unlock() + scSt, ok := bw.connSt[sc] + if !ok { + return + } + if s == connectivity.Idle { + sc.Connect() + } + oldS := scSt.s + scSt.s = s + if oldS != connectivity.Ready && s == connectivity.Ready { + scSt.down = bw.balancer.Up(scSt.addr) + } else if oldS == connectivity.Ready && s != connectivity.Ready { + if scSt.down != nil { + scSt.down(errConnClosing) + } + } + sa := bw.csEvltr.recordTransition(oldS, s) + if bw.state != sa { + bw.state = sa + } + bw.cc.UpdateBalancerState(bw.state, bw) + if s == connectivity.Shutdown { + // Remove state for this sc. + delete(bw.connSt, sc) + } + return +} + +func (bw *balancerWrapper) HandleResolvedAddrs([]resolver.Address, error) { + bw.mu.Lock() + defer bw.mu.Unlock() + select { + case <-bw.startCh: + default: + close(bw.startCh) + } + // There should be a resolver inside the balancer. + // All updates here, if any, are ignored. + return +} + +func (bw *balancerWrapper) Close() { + bw.mu.Lock() + defer bw.mu.Unlock() + select { + case <-bw.startCh: + default: + close(bw.startCh) + } + bw.balancer.Close() + return +} + +// The picker is the balancerWrapper itself. +// Pick should never return ErrNoSubConnAvailable. +// It either blocks or returns error, consistent with v1 balancer Get(). +func (bw *balancerWrapper) Pick(ctx context.Context, opts balancer.PickOptions) (balancer.SubConn, func(balancer.DoneInfo), error) { + failfast := true // Default failfast is true. + if ss, ok := rpcInfoFromContext(ctx); ok { + failfast = ss.failfast + } + a, p, err := bw.balancer.Get(ctx, BalancerGetOptions{BlockingWait: !failfast}) + if err != nil { + return nil, nil, err + } + var done func(balancer.DoneInfo) + if p != nil { + done = func(i balancer.DoneInfo) { p() } + } + var sc balancer.SubConn + bw.mu.Lock() + defer bw.mu.Unlock() + if bw.pickfirst { + // Get the first sc in conns. + for _, sc = range bw.conns { + break + } + } else { + var ok bool + sc, ok = bw.conns[resolver.Address{ + Addr: a.Addr, + Type: resolver.Backend, + ServerName: "", + Metadata: a.Metadata, + }] + if !ok && failfast { + return nil, nil, Errorf(codes.Unavailable, "there is no connection available") + } + if s, ok := bw.connSt[sc]; failfast && (!ok || s.s != connectivity.Ready) { + // If the returned sc is not ready and RPC is failfast, + // return error, and this RPC will fail. + return nil, nil, Errorf(codes.Unavailable, "there is no connection available") + } + } + + return sc, done, nil +} + +// connectivityStateEvaluator gets updated by addrConns when their +// states transition, based on which it evaluates the state of +// ClientConn. +type connectivityStateEvaluator struct { + mu sync.Mutex + numReady uint64 // Number of addrConns in ready state. + numConnecting uint64 // Number of addrConns in connecting state. + numTransientFailure uint64 // Number of addrConns in transientFailure. +} + +// recordTransition records state change happening in every subConn and based on +// that it evaluates what aggregated state should be. +// It can only transition between Ready, Connecting and TransientFailure. Other states, +// Idle and Shutdown are transitioned into by ClientConn; in the beginning of the connection +// before any subConn is created ClientConn is in idle state. In the end when ClientConn +// closes it is in Shutdown state. +// TODO Note that in later releases, a ClientConn with no activity will be put into an Idle state. +func (cse *connectivityStateEvaluator) recordTransition(oldState, newState connectivity.State) connectivity.State { + cse.mu.Lock() + defer cse.mu.Unlock() + + // Update counters. + for idx, state := range []connectivity.State{oldState, newState} { + updateVal := 2*uint64(idx) - 1 // -1 for oldState and +1 for new. + switch state { + case connectivity.Ready: + cse.numReady += updateVal + case connectivity.Connecting: + cse.numConnecting += updateVal + case connectivity.TransientFailure: + cse.numTransientFailure += updateVal + } + } + + // Evaluate. + if cse.numReady > 0 { + return connectivity.Ready + } + if cse.numConnecting > 0 { + return connectivity.Connecting + } + return connectivity.TransientFailure +} diff --git a/vendor/google.golang.org/grpc/benchmark/benchmain/main.go b/vendor/google.golang.org/grpc/benchmark/benchmain/main.go new file mode 100644 index 0000000000..0cc1f25e63 --- /dev/null +++ b/vendor/google.golang.org/grpc/benchmark/benchmain/main.go @@ -0,0 +1,499 @@ +/* + * + * Copyright 2017 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. + * + */ + +/* +Package main provides benchmark with setting flags. + +An example to run some benchmarks with profiling enabled: + +go run benchmark/benchmain/main.go -benchtime=10s -workloads=all \ + -compression=on -maxConcurrentCalls=1 -trace=off \ + -reqSizeBytes=1,1048576 -respSizeBytes=1,1048576 -networkMode=Local \ + -cpuProfile=cpuProf -memProfile=memProf -memProfileRate=10000 -resultFile=result + +As a suggestion, when creating a branch, you can run this benchmark and save the result +file "-resultFile=basePerf", and later when you at the middle of the work or finish the +work, you can get the benchmark result and compare it with the base anytime. + +Assume there are two result files names as "basePerf" and "curPerf" created by adding +-resultFile=basePerf and -resultFile=curPerf. + To format the curPerf, run: + go run benchmark/benchresult/main.go curPerf + To observe how the performance changes based on a base result, run: + go run benchmark/benchresult/main.go basePerf curPerf +*/ +package main + +import ( + "encoding/gob" + "errors" + "flag" + "fmt" + "io" + "io/ioutil" + "log" + "net" + "os" + "reflect" + "runtime" + "runtime/pprof" + "strconv" + "strings" + "sync" + "sync/atomic" + "testing" + "time" + + "golang.org/x/net/context" + "google.golang.org/grpc" + bm "google.golang.org/grpc/benchmark" + testpb "google.golang.org/grpc/benchmark/grpc_testing" + "google.golang.org/grpc/benchmark/latency" + "google.golang.org/grpc/benchmark/stats" + "google.golang.org/grpc/grpclog" +) + +const ( + modeOn = "on" + modeOff = "off" + modeBoth = "both" +) + +var allCompressionModes = []string{modeOn, modeOff, modeBoth} +var allTraceModes = []string{modeOn, modeOff, modeBoth} + +const ( + workloadsUnary = "unary" + workloadsStreaming = "streaming" + workloadsAll = "all" +) + +var allWorkloads = []string{workloadsUnary, workloadsStreaming, workloadsAll} + +var ( + runMode = []bool{true, true} // {runUnary, runStream} + // When set the latency to 0 (no delay), the result is slower than the real result with no delay + // because latency simulation section has extra operations + ltc = []time.Duration{0, 40 * time.Millisecond} // if non-positive, no delay. + kbps = []int{0, 10240} // if non-positive, infinite + mtu = []int{0} // if non-positive, infinite + maxConcurrentCalls = []int{1, 8, 64, 512} + reqSizeBytes = []int{1, 1024, 1024 * 1024} + respSizeBytes = []int{1, 1024, 1024 * 1024} + enableTrace []bool + benchtime time.Duration + memProfile, cpuProfile string + memProfileRate int + enableCompressor []bool + networkMode string + benchmarkResultFile string + networks = map[string]latency.Network{ + "Local": latency.Local, + "LAN": latency.LAN, + "WAN": latency.WAN, + "Longhaul": latency.Longhaul, + } +) + +func unaryBenchmark(startTimer func(), stopTimer func(int32), benchFeatures stats.Features, benchtime time.Duration, s *stats.Stats) { + caller, close := makeFuncUnary(benchFeatures) + defer close() + runBenchmark(caller, startTimer, stopTimer, benchFeatures, benchtime, s) +} + +func streamBenchmark(startTimer func(), stopTimer func(int32), benchFeatures stats.Features, benchtime time.Duration, s *stats.Stats) { + caller, close := makeFuncStream(benchFeatures) + defer close() + runBenchmark(caller, startTimer, stopTimer, benchFeatures, benchtime, s) +} + +func makeFuncUnary(benchFeatures stats.Features) (func(int), func()) { + nw := &latency.Network{Kbps: benchFeatures.Kbps, Latency: benchFeatures.Latency, MTU: benchFeatures.Mtu} + opts := []grpc.DialOption{} + sopts := []grpc.ServerOption{} + if benchFeatures.EnableCompressor { + sopts = append(sopts, + grpc.RPCCompressor(nopCompressor{}), + grpc.RPCDecompressor(nopDecompressor{}), + ) + opts = append(opts, + grpc.WithCompressor(nopCompressor{}), + grpc.WithDecompressor(nopDecompressor{}), + ) + } + sopts = append(sopts, grpc.MaxConcurrentStreams(uint32(benchFeatures.MaxConcurrentCalls+1))) + opts = append(opts, grpc.WithDialer(func(address string, timeout time.Duration) (net.Conn, error) { + return nw.TimeoutDialer(net.DialTimeout)("tcp", address, timeout) + })) + opts = append(opts, grpc.WithInsecure()) + + target, stopper := bm.StartServer(bm.ServerInfo{Addr: "localhost:0", Type: "protobuf", Network: nw}, sopts...) + conn := bm.NewClientConn(target, opts...) + tc := testpb.NewBenchmarkServiceClient(conn) + return func(int) { + unaryCaller(tc, benchFeatures.ReqSizeBytes, benchFeatures.RespSizeBytes) + }, func() { + conn.Close() + stopper() + } +} + +func makeFuncStream(benchFeatures stats.Features) (func(int), func()) { + nw := &latency.Network{Kbps: benchFeatures.Kbps, Latency: benchFeatures.Latency, MTU: benchFeatures.Mtu} + opts := []grpc.DialOption{} + sopts := []grpc.ServerOption{} + if benchFeatures.EnableCompressor { + sopts = append(sopts, + grpc.RPCCompressor(grpc.NewGZIPCompressor()), + grpc.RPCDecompressor(grpc.NewGZIPDecompressor()), + ) + opts = append(opts, + grpc.WithCompressor(grpc.NewGZIPCompressor()), + grpc.WithDecompressor(grpc.NewGZIPDecompressor()), + ) + } + sopts = append(sopts, grpc.MaxConcurrentStreams(uint32(benchFeatures.MaxConcurrentCalls+1))) + opts = append(opts, grpc.WithDialer(func(address string, timeout time.Duration) (net.Conn, error) { + return nw.TimeoutDialer(net.DialTimeout)("tcp", address, timeout) + })) + opts = append(opts, grpc.WithInsecure()) + + target, stopper := bm.StartServer(bm.ServerInfo{Addr: "localhost:0", Type: "protobuf", Network: nw}, sopts...) + conn := bm.NewClientConn(target, opts...) + tc := testpb.NewBenchmarkServiceClient(conn) + streams := make([]testpb.BenchmarkService_StreamingCallClient, benchFeatures.MaxConcurrentCalls) + for i := 0; i < benchFeatures.MaxConcurrentCalls; i++ { + stream, err := tc.StreamingCall(context.Background()) + if err != nil { + grpclog.Fatalf("%v.StreamingCall(_) = _, %v", tc, err) + } + streams[i] = stream + } + return func(pos int) { + streamCaller(streams[pos], benchFeatures.ReqSizeBytes, benchFeatures.RespSizeBytes) + }, func() { + conn.Close() + stopper() + } +} + +func unaryCaller(client testpb.BenchmarkServiceClient, reqSize, respSize int) { + if err := bm.DoUnaryCall(client, reqSize, respSize); err != nil { + grpclog.Fatalf("DoUnaryCall failed: %v", err) + } +} + +func streamCaller(stream testpb.BenchmarkService_StreamingCallClient, reqSize, respSize int) { + if err := bm.DoStreamingRoundTrip(stream, reqSize, respSize); err != nil { + grpclog.Fatalf("DoStreamingRoundTrip failed: %v", err) + } +} + +func runBenchmark(caller func(int), startTimer func(), stopTimer func(int32), benchFeatures stats.Features, benchtime time.Duration, s *stats.Stats) { + // Warm up connection. + for i := 0; i < 10; i++ { + caller(0) + } + // Run benchmark. + startTimer() + var ( + mu sync.Mutex + wg sync.WaitGroup + ) + wg.Add(benchFeatures.MaxConcurrentCalls) + bmEnd := time.Now().Add(benchtime) + var count int32 + for i := 0; i < benchFeatures.MaxConcurrentCalls; i++ { + go func(pos int) { + for { + t := time.Now() + if t.After(bmEnd) { + break + } + start := time.Now() + caller(pos) + elapse := time.Since(start) + atomic.AddInt32(&count, 1) + mu.Lock() + s.Add(elapse) + mu.Unlock() + } + wg.Done() + }(i) + } + wg.Wait() + stopTimer(count) +} + +// Initiate main function to get settings of features. +func init() { + var ( + workloads, traceMode, compressorMode, readLatency string + readKbps, readMtu, readMaxConcurrentCalls intSliceType + readReqSizeBytes, readRespSizeBytes intSliceType + ) + flag.StringVar(&workloads, "workloads", workloadsAll, + fmt.Sprintf("Workloads to execute - One of: %v", strings.Join(allWorkloads, ", "))) + flag.StringVar(&traceMode, "trace", modeOff, + fmt.Sprintf("Trace mode - One of: %v", strings.Join(allTraceModes, ", "))) + flag.StringVar(&readLatency, "latency", "", "Simulated one-way network latency - may be a comma-separated list") + flag.DurationVar(&benchtime, "benchtime", time.Second, "Configures the amount of time to run each benchmark") + flag.Var(&readKbps, "kbps", "Simulated network throughput (in kbps) - may be a comma-separated list") + flag.Var(&readMtu, "mtu", "Simulated network MTU (Maximum Transmission Unit) - may be a comma-separated list") + flag.Var(&readMaxConcurrentCalls, "maxConcurrentCalls", "Number of concurrent RPCs during benchmarks") + flag.Var(&readReqSizeBytes, "reqSizeBytes", "Request size in bytes - may be a comma-separated list") + flag.Var(&readRespSizeBytes, "respSizeBytes", "Response size in bytes - may be a comma-separated list") + flag.StringVar(&memProfile, "memProfile", "", "Enables memory profiling output to the filename provided.") + flag.IntVar(&memProfileRate, "memProfileRate", 512*1024, "Configures the memory profiling rate. \n"+ + "memProfile should be set before setting profile rate. To include every allocated block in the profile, "+ + "set MemProfileRate to 1. To turn off profiling entirely, set MemProfileRate to 0. 512 * 1024 by default.") + flag.StringVar(&cpuProfile, "cpuProfile", "", "Enables CPU profiling output to the filename provided") + flag.StringVar(&compressorMode, "compression", modeOff, + fmt.Sprintf("Compression mode - One of: %v", strings.Join(allCompressionModes, ", "))) + flag.StringVar(&benchmarkResultFile, "resultFile", "", "Save the benchmark result into a binary file") + flag.StringVar(&networkMode, "networkMode", "", "Network mode includes LAN, WAN, Local and Longhaul") + flag.Parse() + if flag.NArg() != 0 { + log.Fatal("Error: unparsed arguments: ", flag.Args()) + } + switch workloads { + case workloadsUnary: + runMode[0] = true + runMode[1] = false + case workloadsStreaming: + runMode[0] = false + runMode[1] = true + case workloadsAll: + runMode[0] = true + runMode[1] = true + default: + log.Fatalf("Unknown workloads setting: %v (want one of: %v)", + workloads, strings.Join(allWorkloads, ", ")) + } + enableCompressor = setMode(compressorMode) + enableTrace = setMode(traceMode) + // Time input formats as (time + unit). + readTimeFromInput(<c, readLatency) + readIntFromIntSlice(&kbps, readKbps) + readIntFromIntSlice(&mtu, readMtu) + readIntFromIntSlice(&maxConcurrentCalls, readMaxConcurrentCalls) + readIntFromIntSlice(&reqSizeBytes, readReqSizeBytes) + readIntFromIntSlice(&respSizeBytes, readRespSizeBytes) + // Re-write latency, kpbs and mtu if network mode is set. + if network, ok := networks[networkMode]; ok { + ltc = []time.Duration{network.Latency} + kbps = []int{network.Kbps} + mtu = []int{network.MTU} + } +} + +func setMode(name string) []bool { + switch name { + case modeOn: + return []bool{true} + case modeOff: + return []bool{false} + case modeBoth: + return []bool{false, true} + default: + log.Fatalf("Unknown %s setting: %v (want one of: %v)", + name, name, strings.Join(allCompressionModes, ", ")) + return []bool{} + } +} + +type intSliceType []int + +func (intSlice *intSliceType) String() string { + return fmt.Sprintf("%v", *intSlice) +} + +func (intSlice *intSliceType) Set(value string) error { + if len(*intSlice) > 0 { + return errors.New("interval flag already set") + } + for _, num := range strings.Split(value, ",") { + next, err := strconv.Atoi(num) + if err != nil { + return err + } + *intSlice = append(*intSlice, next) + } + return nil +} + +func readIntFromIntSlice(values *[]int, replace intSliceType) { + // If not set replace in the flag, just return to run the default settings. + if len(replace) == 0 { + return + } + *values = replace +} + +func readTimeFromInput(values *[]time.Duration, replace string) { + if strings.Compare(replace, "") != 0 { + *values = []time.Duration{} + for _, ltc := range strings.Split(replace, ",") { + duration, err := time.ParseDuration(ltc) + if err != nil { + log.Fatal(err.Error()) + } + *values = append(*values, duration) + } + } +} + +func main() { + before() + featuresPos := make([]int, 8) + // 0:enableTracing 1:ltc 2:kbps 3:mtu 4:maxC 5:reqSize 6:respSize + featuresNum := []int{len(enableTrace), len(ltc), len(kbps), len(mtu), + len(maxConcurrentCalls), len(reqSizeBytes), len(respSizeBytes), len(enableCompressor)} + initalPos := make([]int, len(featuresPos)) + s := stats.NewStats(10) + s.SortLatency() + var memStats runtime.MemStats + var results testing.BenchmarkResult + var startAllocs, startBytes uint64 + var startTime time.Time + start := true + var startTimer = func() { + runtime.ReadMemStats(&memStats) + startAllocs = memStats.Mallocs + startBytes = memStats.TotalAlloc + startTime = time.Now() + } + var stopTimer = func(count int32) { + runtime.ReadMemStats(&memStats) + results = testing.BenchmarkResult{N: int(count), T: time.Now().Sub(startTime), + Bytes: 0, MemAllocs: memStats.Mallocs - startAllocs, MemBytes: memStats.TotalAlloc - startBytes} + } + sharedPos := make([]bool, len(featuresPos)) + for i := 0; i < len(featuresPos); i++ { + if featuresNum[i] <= 1 { + sharedPos[i] = true + } + } + + // Run benchmarks + resultSlice := []stats.BenchResults{} + for !reflect.DeepEqual(featuresPos, initalPos) || start { + start = false + benchFeature := stats.Features{ + NetworkMode: networkMode, + EnableTrace: enableTrace[featuresPos[0]], + Latency: ltc[featuresPos[1]], + Kbps: kbps[featuresPos[2]], + Mtu: mtu[featuresPos[3]], + MaxConcurrentCalls: maxConcurrentCalls[featuresPos[4]], + ReqSizeBytes: reqSizeBytes[featuresPos[5]], + RespSizeBytes: respSizeBytes[featuresPos[6]], + EnableCompressor: enableCompressor[featuresPos[7]], + } + + grpc.EnableTracing = enableTrace[featuresPos[0]] + if runMode[0] { + unaryBenchmark(startTimer, stopTimer, benchFeature, benchtime, s) + s.SetBenchmarkResult("Unary", benchFeature, results.N, + results.AllocedBytesPerOp(), results.AllocsPerOp(), sharedPos) + fmt.Println(s.BenchString()) + fmt.Println(s.String()) + resultSlice = append(resultSlice, s.GetBenchmarkResults()) + s.Clear() + } + if runMode[1] { + streamBenchmark(startTimer, stopTimer, benchFeature, benchtime, s) + s.SetBenchmarkResult("Stream", benchFeature, results.N, + results.AllocedBytesPerOp(), results.AllocsPerOp(), sharedPos) + fmt.Println(s.BenchString()) + fmt.Println(s.String()) + resultSlice = append(resultSlice, s.GetBenchmarkResults()) + s.Clear() + } + bm.AddOne(featuresPos, featuresNum) + } + after(resultSlice) +} + +func before() { + if memProfile != "" { + runtime.MemProfileRate = memProfileRate + } + if cpuProfile != "" { + f, err := os.Create(cpuProfile) + if err != nil { + fmt.Fprintf(os.Stderr, "testing: %s\n", err) + return + } + if err := pprof.StartCPUProfile(f); err != nil { + fmt.Fprintf(os.Stderr, "testing: can't start cpu profile: %s\n", err) + f.Close() + return + } + } +} + +func after(data []stats.BenchResults) { + if cpuProfile != "" { + pprof.StopCPUProfile() // flushes profile to disk + } + if memProfile != "" { + f, err := os.Create(memProfile) + if err != nil { + fmt.Fprintf(os.Stderr, "testing: %s\n", err) + os.Exit(2) + } + runtime.GC() // materialize all statistics + if err = pprof.WriteHeapProfile(f); err != nil { + fmt.Fprintf(os.Stderr, "testing: can't write heap profile %s: %s\n", memProfile, err) + os.Exit(2) + } + f.Close() + } + if benchmarkResultFile != "" { + f, err := os.Create(benchmarkResultFile) + if err != nil { + log.Fatalf("testing: can't write benchmark result %s: %s\n", benchmarkResultFile, err) + } + dataEncoder := gob.NewEncoder(f) + dataEncoder.Encode(data) + f.Close() + } +} + +// nopCompressor is a compressor that just copies data. +type nopCompressor struct{} + +func (nopCompressor) Do(w io.Writer, p []byte) error { + n, err := w.Write(p) + if err != nil { + return err + } + if n != len(p) { + return fmt.Errorf("nopCompressor.Write: wrote %v bytes; want %v", n, len(p)) + } + return nil +} + +func (nopCompressor) Type() string { return "nop" } + +// nopDecompressor is a decompressor that just copies data. +type nopDecompressor struct{} + +func (nopDecompressor) Do(r io.Reader) ([]byte, error) { return ioutil.ReadAll(r) } +func (nopDecompressor) Type() string { return "nop" } diff --git a/vendor/google.golang.org/grpc/benchmark/benchmark.go b/vendor/google.golang.org/grpc/benchmark/benchmark.go new file mode 100644 index 0000000000..f09fa4543f --- /dev/null +++ b/vendor/google.golang.org/grpc/benchmark/benchmark.go @@ -0,0 +1,364 @@ +/* + * + * Copyright 2014 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. + * + */ + +//go:generate protoc -I grpc_testing --go_out=plugins=grpc:grpc_testing grpc_testing/control.proto grpc_testing/messages.proto grpc_testing/payloads.proto grpc_testing/services.proto grpc_testing/stats.proto + +/* +Package benchmark implements the building blocks to setup end-to-end gRPC benchmarks. +*/ +package benchmark + +import ( + "fmt" + "io" + "net" + "sync" + "testing" + "time" + + "golang.org/x/net/context" + "google.golang.org/grpc" + testpb "google.golang.org/grpc/benchmark/grpc_testing" + "google.golang.org/grpc/benchmark/latency" + "google.golang.org/grpc/benchmark/stats" + "google.golang.org/grpc/grpclog" +) + +// AddOne add 1 to the features slice +func AddOne(features []int, featuresMaxPosition []int) { + for i := len(features) - 1; i >= 0; i-- { + features[i] = (features[i] + 1) + if features[i]/featuresMaxPosition[i] == 0 { + break + } + features[i] = features[i] % featuresMaxPosition[i] + } +} + +// Allows reuse of the same testpb.Payload object. +func setPayload(p *testpb.Payload, t testpb.PayloadType, size int) { + if size < 0 { + grpclog.Fatalf("Requested a response with invalid length %d", size) + } + body := make([]byte, size) + switch t { + case testpb.PayloadType_COMPRESSABLE: + case testpb.PayloadType_UNCOMPRESSABLE: + grpclog.Fatalf("PayloadType UNCOMPRESSABLE is not supported") + default: + grpclog.Fatalf("Unsupported payload type: %d", t) + } + p.Type = t + p.Body = body + return +} + +func newPayload(t testpb.PayloadType, size int) *testpb.Payload { + p := new(testpb.Payload) + setPayload(p, t, size) + return p +} + +type testServer struct { +} + +func (s *testServer) UnaryCall(ctx context.Context, in *testpb.SimpleRequest) (*testpb.SimpleResponse, error) { + return &testpb.SimpleResponse{ + Payload: newPayload(in.ResponseType, int(in.ResponseSize)), + }, nil +} + +func (s *testServer) StreamingCall(stream testpb.BenchmarkService_StreamingCallServer) error { + response := &testpb.SimpleResponse{ + Payload: new(testpb.Payload), + } + in := new(testpb.SimpleRequest) + for { + // use ServerStream directly to reuse the same testpb.SimpleRequest object + err := stream.(grpc.ServerStream).RecvMsg(in) + if err == io.EOF { + // read done. + return nil + } + if err != nil { + return err + } + setPayload(response.Payload, in.ResponseType, int(in.ResponseSize)) + if err := stream.Send(response); err != nil { + return err + } + } +} + +// byteBufServer is a gRPC server that sends and receives byte buffer. +// The purpose is to benchmark the gRPC performance without protobuf serialization/deserialization overhead. +type byteBufServer struct { + respSize int32 +} + +// UnaryCall is an empty function and is not used for benchmark. +// If bytebuf UnaryCall benchmark is needed later, the function body needs to be updated. +func (s *byteBufServer) UnaryCall(ctx context.Context, in *testpb.SimpleRequest) (*testpb.SimpleResponse, error) { + return &testpb.SimpleResponse{}, nil +} + +func (s *byteBufServer) StreamingCall(stream testpb.BenchmarkService_StreamingCallServer) error { + for { + var in []byte + err := stream.(grpc.ServerStream).RecvMsg(&in) + if err == io.EOF { + return nil + } + if err != nil { + return err + } + out := make([]byte, s.respSize) + if err := stream.(grpc.ServerStream).SendMsg(&out); err != nil { + return err + } + } +} + +// ServerInfo contains the information to create a gRPC benchmark server. +type ServerInfo struct { + // Addr is the address of the server. + Addr string + + // Type is the type of the server. + // It should be "protobuf" or "bytebuf". + Type string + + // Metadata is an optional configuration. + // For "protobuf", it's ignored. + // For "bytebuf", it should be an int representing response size. + Metadata interface{} + + // Network can simulate latency + Network *latency.Network +} + +// StartServer starts a gRPC server serving a benchmark service according to info. +// It returns its listen address and a function to stop the server. +func StartServer(info ServerInfo, opts ...grpc.ServerOption) (string, func()) { + lis, err := net.Listen("tcp", info.Addr) + if err != nil { + grpclog.Fatalf("Failed to listen: %v", err) + } + nw := info.Network + if nw != nil { + lis = nw.Listener(lis) + } + opts = append(opts, grpc.WriteBufferSize(128*1024)) + opts = append(opts, grpc.ReadBufferSize(128*1024)) + s := grpc.NewServer(opts...) + switch info.Type { + case "protobuf": + testpb.RegisterBenchmarkServiceServer(s, &testServer{}) + case "bytebuf": + respSize, ok := info.Metadata.(int32) + if !ok { + grpclog.Fatalf("failed to StartServer, invalid metadata: %v, for Type: %v", info.Metadata, info.Type) + } + testpb.RegisterBenchmarkServiceServer(s, &byteBufServer{respSize: respSize}) + default: + grpclog.Fatalf("failed to StartServer, unknown Type: %v", info.Type) + } + go s.Serve(lis) + return lis.Addr().String(), func() { + s.Stop() + } +} + +// DoUnaryCall performs an unary RPC with given stub and request and response sizes. +func DoUnaryCall(tc testpb.BenchmarkServiceClient, reqSize, respSize int) error { + pl := newPayload(testpb.PayloadType_COMPRESSABLE, reqSize) + req := &testpb.SimpleRequest{ + ResponseType: pl.Type, + ResponseSize: int32(respSize), + Payload: pl, + } + if _, err := tc.UnaryCall(context.Background(), req); err != nil { + return fmt.Errorf("/BenchmarkService/UnaryCall(_, _) = _, %v, want _, ", err) + } + return nil +} + +// DoStreamingRoundTrip performs a round trip for a single streaming rpc. +func DoStreamingRoundTrip(stream testpb.BenchmarkService_StreamingCallClient, reqSize, respSize int) error { + pl := newPayload(testpb.PayloadType_COMPRESSABLE, reqSize) + req := &testpb.SimpleRequest{ + ResponseType: pl.Type, + ResponseSize: int32(respSize), + Payload: pl, + } + if err := stream.Send(req); err != nil { + return fmt.Errorf("/BenchmarkService/StreamingCall.Send(_) = %v, want ", err) + } + if _, err := stream.Recv(); err != nil { + // EOF is a valid error here. + if err == io.EOF { + return nil + } + return fmt.Errorf("/BenchmarkService/StreamingCall.Recv(_) = %v, want ", err) + } + return nil +} + +// DoByteBufStreamingRoundTrip performs a round trip for a single streaming rpc, using a custom codec for byte buffer. +func DoByteBufStreamingRoundTrip(stream testpb.BenchmarkService_StreamingCallClient, reqSize, respSize int) error { + out := make([]byte, reqSize) + if err := stream.(grpc.ClientStream).SendMsg(&out); err != nil { + return fmt.Errorf("/BenchmarkService/StreamingCall.(ClientStream).SendMsg(_) = %v, want ", err) + } + var in []byte + if err := stream.(grpc.ClientStream).RecvMsg(&in); err != nil { + // EOF is a valid error here. + if err == io.EOF { + return nil + } + return fmt.Errorf("/BenchmarkService/StreamingCall.(ClientStream).RecvMsg(_) = %v, want ", err) + } + return nil +} + +// NewClientConn creates a gRPC client connection to addr. +func NewClientConn(addr string, opts ...grpc.DialOption) *grpc.ClientConn { + opts = append(opts, grpc.WithWriteBufferSize(128*1024)) + opts = append(opts, grpc.WithReadBufferSize(128*1024)) + conn, err := grpc.Dial(addr, opts...) + if err != nil { + grpclog.Fatalf("NewClientConn(%q) failed to create a ClientConn %v", addr, err) + } + return conn +} + +func runUnary(b *testing.B, benchFeatures stats.Features) { + s := stats.AddStats(b, 38) + nw := &latency.Network{Kbps: benchFeatures.Kbps, Latency: benchFeatures.Latency, MTU: benchFeatures.Mtu} + target, stopper := StartServer(ServerInfo{Addr: "localhost:0", Type: "protobuf", Network: nw}, grpc.MaxConcurrentStreams(uint32(benchFeatures.MaxConcurrentCalls+1))) + defer stopper() + conn := NewClientConn( + target, grpc.WithInsecure(), + grpc.WithDialer(func(address string, timeout time.Duration) (net.Conn, error) { + return nw.TimeoutDialer(net.DialTimeout)("tcp", address, timeout) + }), + ) + tc := testpb.NewBenchmarkServiceClient(conn) + + // Warm up connection. + for i := 0; i < 10; i++ { + unaryCaller(tc, benchFeatures.ReqSizeBytes, benchFeatures.RespSizeBytes) + } + ch := make(chan int, benchFeatures.MaxConcurrentCalls*4) + var ( + mu sync.Mutex + wg sync.WaitGroup + ) + wg.Add(benchFeatures.MaxConcurrentCalls) + + // Distribute the b.N calls over maxConcurrentCalls workers. + for i := 0; i < benchFeatures.MaxConcurrentCalls; i++ { + go func() { + for range ch { + start := time.Now() + unaryCaller(tc, benchFeatures.ReqSizeBytes, benchFeatures.RespSizeBytes) + elapse := time.Since(start) + mu.Lock() + s.Add(elapse) + mu.Unlock() + } + wg.Done() + }() + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + ch <- i + } + close(ch) + wg.Wait() + b.StopTimer() + conn.Close() +} + +func runStream(b *testing.B, benchFeatures stats.Features) { + s := stats.AddStats(b, 38) + nw := &latency.Network{Kbps: benchFeatures.Kbps, Latency: benchFeatures.Latency, MTU: benchFeatures.Mtu} + target, stopper := StartServer(ServerInfo{Addr: "localhost:0", Type: "protobuf", Network: nw}, grpc.MaxConcurrentStreams(uint32(benchFeatures.MaxConcurrentCalls+1))) + defer stopper() + conn := NewClientConn( + target, grpc.WithInsecure(), + grpc.WithDialer(func(address string, timeout time.Duration) (net.Conn, error) { + return nw.TimeoutDialer(net.DialTimeout)("tcp", address, timeout) + }), + ) + tc := testpb.NewBenchmarkServiceClient(conn) + + // Warm up connection. + stream, err := tc.StreamingCall(context.Background()) + if err != nil { + b.Fatalf("%v.StreamingCall(_) = _, %v", tc, err) + } + for i := 0; i < 10; i++ { + streamCaller(stream, benchFeatures.ReqSizeBytes, benchFeatures.RespSizeBytes) + } + + ch := make(chan struct{}, benchFeatures.MaxConcurrentCalls*4) + var ( + mu sync.Mutex + wg sync.WaitGroup + ) + wg.Add(benchFeatures.MaxConcurrentCalls) + + // Distribute the b.N calls over maxConcurrentCalls workers. + for i := 0; i < benchFeatures.MaxConcurrentCalls; i++ { + stream, err := tc.StreamingCall(context.Background()) + if err != nil { + b.Fatalf("%v.StreamingCall(_) = _, %v", tc, err) + } + go func() { + for range ch { + start := time.Now() + streamCaller(stream, benchFeatures.ReqSizeBytes, benchFeatures.RespSizeBytes) + elapse := time.Since(start) + mu.Lock() + s.Add(elapse) + mu.Unlock() + } + wg.Done() + }() + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + ch <- struct{}{} + } + close(ch) + wg.Wait() + b.StopTimer() + conn.Close() +} +func unaryCaller(client testpb.BenchmarkServiceClient, reqSize, respSize int) { + if err := DoUnaryCall(client, reqSize, respSize); err != nil { + grpclog.Fatalf("DoUnaryCall failed: %v", err) + } +} + +func streamCaller(stream testpb.BenchmarkService_StreamingCallClient, reqSize, respSize int) { + if err := DoStreamingRoundTrip(stream, reqSize, respSize); err != nil { + grpclog.Fatalf("DoStreamingRoundTrip failed: %v", err) + } +} diff --git a/vendor/google.golang.org/grpc/benchmark/benchmark16_test.go b/vendor/google.golang.org/grpc/benchmark/benchmark16_test.go new file mode 100644 index 0000000000..fc33e80d0c --- /dev/null +++ b/vendor/google.golang.org/grpc/benchmark/benchmark16_test.go @@ -0,0 +1,112 @@ +// +build go1.6,!go1.7 + +/* + * + * Copyright 2017 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. + * + */ + +package benchmark + +import ( + "os" + "testing" + + "google.golang.org/grpc" + "google.golang.org/grpc/benchmark/stats" +) + +func BenchmarkClientStreamc1(b *testing.B) { + grpc.EnableTracing = true + runStream(b, stats.Features{"", true, 0, 0, 0, 1, 1, 1, false}) +} + +func BenchmarkClientStreamc8(b *testing.B) { + grpc.EnableTracing = true + runStream(b, stats.Features{"", true, 0, 0, 0, 8, 1, 1, false}) +} + +func BenchmarkClientStreamc64(b *testing.B) { + grpc.EnableTracing = true + runStream(b, stats.Features{"", true, 0, 0, 0, 64, 1, 1, false}) +} + +func BenchmarkClientStreamc512(b *testing.B) { + grpc.EnableTracing = true + runStream(b, stats.Features{"", true, 0, 0, 0, 512, 1, 1, false}) +} +func BenchmarkClientUnaryc1(b *testing.B) { + grpc.EnableTracing = true + runStream(b, stats.Features{"", true, 0, 0, 0, 1, 1, 1, false}) +} + +func BenchmarkClientUnaryc8(b *testing.B) { + grpc.EnableTracing = true + runStream(b, stats.Features{"", true, 0, 0, 0, 8, 1, 1, false}) +} + +func BenchmarkClientUnaryc64(b *testing.B) { + grpc.EnableTracing = true + runStream(b, stats.Features{"", true, 0, 0, 0, 64, 1, 1, false}) +} + +func BenchmarkClientUnaryc512(b *testing.B) { + grpc.EnableTracing = true + runStream(b, stats.Features{"", true, 0, 0, 0, 512, 1, 1, false}) +} + +func BenchmarkClientStreamNoTracec1(b *testing.B) { + grpc.EnableTracing = false + runStream(b, stats.Features{"", false, 0, 0, 0, 1, 1, 1, false}) +} + +func BenchmarkClientStreamNoTracec8(b *testing.B) { + grpc.EnableTracing = false + runStream(b, stats.Features{"", false, 0, 0, 0, 8, 1, 1, false}) +} + +func BenchmarkClientStreamNoTracec64(b *testing.B) { + grpc.EnableTracing = false + runStream(b, stats.Features{"", false, 0, 0, 0, 64, 1, 1, false}) +} + +func BenchmarkClientStreamNoTracec512(b *testing.B) { + grpc.EnableTracing = false + runStream(b, stats.Features{"", false, 0, 0, 0, 512, 1, 1, false}) +} +func BenchmarkClientUnaryNoTracec1(b *testing.B) { + grpc.EnableTracing = false + runStream(b, stats.Features{"", false, 0, 0, 0, 1, 1, 1, false}) +} + +func BenchmarkClientUnaryNoTracec8(b *testing.B) { + grpc.EnableTracing = false + runStream(b, stats.Features{"", false, 0, 0, 0, 8, 1, 1, false}) +} + +func BenchmarkClientUnaryNoTracec64(b *testing.B) { + grpc.EnableTracing = false + runStream(b, stats.Features{"", false, 0, 0, 0, 64, 1, 1, false}) +} + +func BenchmarkClientUnaryNoTracec512(b *testing.B) { + grpc.EnableTracing = false + runStream(b, stats.Features{"", false, 0, 0, 0, 512, 1, 1, false}) + runStream(b, stats.Features{"", false, 0, 0, 0, 512, 1, 1, false}) +} + +func TestMain(m *testing.M) { + os.Exit(stats.RunTestMain(m)) +} diff --git a/vendor/google.golang.org/grpc/benchmark/benchmark17_test.go b/vendor/google.golang.org/grpc/benchmark/benchmark17_test.go new file mode 100644 index 0000000000..8dc7d3c558 --- /dev/null +++ b/vendor/google.golang.org/grpc/benchmark/benchmark17_test.go @@ -0,0 +1,85 @@ +// +build go1.7 + +/* + * + * Copyright 2017 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. + * + */ + +package benchmark + +import ( + "fmt" + "os" + "reflect" + "testing" + "time" + + "google.golang.org/grpc" + "google.golang.org/grpc/benchmark/stats" +) + +func BenchmarkClient(b *testing.B) { + enableTrace := []bool{true, false} // run both enable and disable by default + // When set the latency to 0 (no delay), the result is slower than the real result with no delay + // because latency simulation section has extra operations + latency := []time.Duration{0, 40 * time.Millisecond} // if non-positive, no delay. + kbps := []int{0, 10240} // if non-positive, infinite + mtu := []int{0} // if non-positive, infinite + maxConcurrentCalls := []int{1, 8, 64, 512} + reqSizeBytes := []int{1, 1024 * 1024} + respSizeBytes := []int{1, 1024 * 1024} + featuresCurPos := make([]int, 7) + + // 0:enableTracing 1:md 2:ltc 3:kbps 4:mtu 5:maxC 6:connCount 7:reqSize 8:respSize + featuresMaxPosition := []int{len(enableTrace), len(latency), len(kbps), len(mtu), len(maxConcurrentCalls), len(reqSizeBytes), len(respSizeBytes)} + initalPos := make([]int, len(featuresCurPos)) + + // run benchmarks + start := true + for !reflect.DeepEqual(featuresCurPos, initalPos) || start { + start = false + tracing := "Trace" + if !enableTrace[featuresCurPos[0]] { + tracing = "noTrace" + } + + benchFeature := stats.Features{ + EnableTrace: enableTrace[featuresCurPos[0]], + Latency: latency[featuresCurPos[1]], + Kbps: kbps[featuresCurPos[2]], + Mtu: mtu[featuresCurPos[3]], + MaxConcurrentCalls: maxConcurrentCalls[featuresCurPos[4]], + ReqSizeBytes: reqSizeBytes[featuresCurPos[5]], + RespSizeBytes: respSizeBytes[featuresCurPos[6]], + } + + grpc.EnableTracing = enableTrace[featuresCurPos[0]] + b.Run(fmt.Sprintf("Unary-%s-%s", + tracing, benchFeature.String()), func(b *testing.B) { + runUnary(b, benchFeature) + }) + + b.Run(fmt.Sprintf("Stream-%s-%s", + tracing, benchFeature.String()), func(b *testing.B) { + runStream(b, benchFeature) + }) + AddOne(featuresCurPos, featuresMaxPosition) + } +} + +func TestMain(m *testing.M) { + os.Exit(stats.RunTestMain(m)) +} diff --git a/vendor/google.golang.org/grpc/benchmark/benchresult/main.go b/vendor/google.golang.org/grpc/benchmark/benchresult/main.go new file mode 100644 index 0000000000..40226cff15 --- /dev/null +++ b/vendor/google.golang.org/grpc/benchmark/benchresult/main.go @@ -0,0 +1,133 @@ +/* + * + * Copyright 2017 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. + * + */ + +/* +To format the benchmark result: + go run benchmark/benchresult/main.go resultfile + +To see the performance change based on a old result: + go run benchmark/benchresult/main.go resultfile_old resultfile +It will print the comparison result of intersection benchmarks between two files. + +*/ +package main + +import ( + "encoding/gob" + "fmt" + "log" + "os" + "strconv" + "strings" + "time" + + "google.golang.org/grpc/benchmark/stats" +) + +func createMap(fileName string, m map[string]stats.BenchResults) { + f, err := os.Open(fileName) + if err != nil { + log.Fatalf("Read file %s error: %s\n", fileName, err) + } + defer f.Close() + var data []stats.BenchResults + decoder := gob.NewDecoder(f) + if err = decoder.Decode(&data); err != nil { + log.Fatalf("Decode file %s error: %s\n", fileName, err) + } + for _, d := range data { + m[d.RunMode+"-"+d.Features.String()] = d + } +} + +func intChange(title string, val1, val2 int64) string { + return fmt.Sprintf("%10s %12s %12s %8.2f%%\n", title, strconv.FormatInt(val1, 10), + strconv.FormatInt(val2, 10), float64(val2-val1)*100/float64(val1)) +} + +func timeChange(title int, val1, val2 time.Duration) string { + return fmt.Sprintf("%10s %12s %12s %8.2f%%\n", strconv.Itoa(title)+" latency", val1.String(), + val2.String(), float64(val2-val1)*100/float64(val1)) +} + +func compareTwoMap(m1, m2 map[string]stats.BenchResults) { + for k2, v2 := range m2 { + if v1, ok := m1[k2]; ok { + changes := k2 + "\n" + changes += fmt.Sprintf("%10s %12s %12s %8s\n", "Title", "Before", "After", "Percentage") + changes += intChange("Bytes/op", v1.AllocedBytesPerOp, v2.AllocedBytesPerOp) + changes += intChange("Allocs/op", v1.AllocsPerOp, v2.AllocsPerOp) + changes += timeChange(v1.Latency[1].Percent, v1.Latency[1].Value, v2.Latency[1].Value) + changes += timeChange(v1.Latency[2].Percent, v1.Latency[2].Value, v2.Latency[2].Value) + fmt.Printf("%s\n", changes) + } + } +} + +func compareBenchmark(file1, file2 string) { + var BenchValueFile1 map[string]stats.BenchResults + var BenchValueFile2 map[string]stats.BenchResults + BenchValueFile1 = make(map[string]stats.BenchResults) + BenchValueFile2 = make(map[string]stats.BenchResults) + + createMap(file1, BenchValueFile1) + createMap(file2, BenchValueFile2) + + compareTwoMap(BenchValueFile1, BenchValueFile2) +} + +func printline(benchName, ltc50, ltc90, allocByte, allocsOp interface{}) { + fmt.Printf("%-80v%12v%12v%12v%12v\n", benchName, ltc50, ltc90, allocByte, allocsOp) +} + +func formatBenchmark(fileName string) { + f, err := os.Open(fileName) + if err != nil { + log.Fatalf("Read file %s error: %s\n", fileName, err) + } + defer f.Close() + var data []stats.BenchResults + decoder := gob.NewDecoder(f) + if err = decoder.Decode(&data); err != nil { + log.Fatalf("Decode file %s error: %s\n", fileName, err) + } + if len(data) == 0 { + log.Fatalf("No data in file %s\n", fileName) + } + printPos := data[0].SharedPosion + fmt.Println("\nShared features:\n" + strings.Repeat("-", 20)) + fmt.Print(stats.PartialPrintString(printPos, data[0].Features, true)) + fmt.Println(strings.Repeat("-", 35)) + for i := 0; i < len(data[0].SharedPosion); i++ { + printPos[i] = !printPos[i] + } + printline("Name", "latency-50", "latency-90", "Alloc (B)", "Alloc (#)") + for _, d := range data { + name := d.RunMode + stats.PartialPrintString(printPos, d.Features, false) + printline(name, d.Latency[1].Value.String(), d.Latency[2].Value.String(), + d.AllocedBytesPerOp, d.AllocsPerOp) + } +} + +func main() { + if len(os.Args) == 2 { + formatBenchmark(os.Args[1]) + } else { + compareBenchmark(os.Args[1], os.Args[2]) + } +} diff --git a/vendor/google.golang.org/grpc/benchmark/client/main.go b/vendor/google.golang.org/grpc/benchmark/client/main.go new file mode 100644 index 0000000000..9aa587e3a2 --- /dev/null +++ b/vendor/google.golang.org/grpc/benchmark/client/main.go @@ -0,0 +1,180 @@ +/* + * + * Copyright 2017 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. + * + */ + +package main + +import ( + "flag" + "math" + "net" + "net/http" + _ "net/http/pprof" + "sync" + "time" + + "golang.org/x/net/context" + "google.golang.org/grpc" + "google.golang.org/grpc/benchmark" + testpb "google.golang.org/grpc/benchmark/grpc_testing" + "google.golang.org/grpc/benchmark/stats" + "google.golang.org/grpc/grpclog" +) + +var ( + server = flag.String("server", "", "The server address") + maxConcurrentRPCs = flag.Int("max_concurrent_rpcs", 1, "The max number of concurrent RPCs") + duration = flag.Int("duration", math.MaxInt32, "The duration in seconds to run the benchmark client") + trace = flag.Bool("trace", true, "Whether tracing is on") + rpcType = flag.Int("rpc_type", 0, + `Configure different client rpc type. Valid options are: + 0 : unary call; + 1 : streaming call.`) +) + +func unaryCaller(client testpb.BenchmarkServiceClient) { + benchmark.DoUnaryCall(client, 1, 1) +} + +func streamCaller(stream testpb.BenchmarkService_StreamingCallClient) { + benchmark.DoStreamingRoundTrip(stream, 1, 1) +} + +func buildConnection() (s *stats.Stats, conn *grpc.ClientConn, tc testpb.BenchmarkServiceClient) { + s = stats.NewStats(256) + conn = benchmark.NewClientConn(*server) + tc = testpb.NewBenchmarkServiceClient(conn) + return s, conn, tc +} + +func closeLoopUnary() { + s, conn, tc := buildConnection() + + for i := 0; i < 100; i++ { + unaryCaller(tc) + } + ch := make(chan int, *maxConcurrentRPCs*4) + var ( + mu sync.Mutex + wg sync.WaitGroup + ) + wg.Add(*maxConcurrentRPCs) + + for i := 0; i < *maxConcurrentRPCs; i++ { + go func() { + for range ch { + start := time.Now() + unaryCaller(tc) + elapse := time.Since(start) + mu.Lock() + s.Add(elapse) + mu.Unlock() + } + wg.Done() + }() + } + // Stop the client when time is up. + done := make(chan struct{}) + go func() { + <-time.After(time.Duration(*duration) * time.Second) + close(done) + }() + ok := true + for ok { + select { + case ch <- 0: + case <-done: + ok = false + } + } + close(ch) + wg.Wait() + conn.Close() + grpclog.Println(s.String()) + +} + +func closeLoopStream() { + s, conn, tc := buildConnection() + ch := make(chan int, *maxConcurrentRPCs*4) + var ( + mu sync.Mutex + wg sync.WaitGroup + ) + wg.Add(*maxConcurrentRPCs) + // Distribute RPCs over maxConcurrentCalls workers. + for i := 0; i < *maxConcurrentRPCs; i++ { + go func() { + stream, err := tc.StreamingCall(context.Background()) + if err != nil { + grpclog.Fatalf("%v.StreamingCall(_) = _, %v", tc, err) + } + // Do some warm up. + for i := 0; i < 100; i++ { + streamCaller(stream) + } + for range ch { + start := time.Now() + streamCaller(stream) + elapse := time.Since(start) + mu.Lock() + s.Add(elapse) + mu.Unlock() + } + wg.Done() + }() + } + // Stop the client when time is up. + done := make(chan struct{}) + go func() { + <-time.After(time.Duration(*duration) * time.Second) + close(done) + }() + ok := true + for ok { + select { + case ch <- 0: + case <-done: + ok = false + } + } + close(ch) + wg.Wait() + conn.Close() + grpclog.Println(s.String()) +} + +func main() { + flag.Parse() + grpc.EnableTracing = *trace + go func() { + lis, err := net.Listen("tcp", ":0") + if err != nil { + grpclog.Fatalf("Failed to listen: %v", err) + } + grpclog.Println("Client profiling address: ", lis.Addr().String()) + if err := http.Serve(lis, nil); err != nil { + grpclog.Fatalf("Failed to serve: %v", err) + } + }() + switch *rpcType { + case 0: + closeLoopUnary() + case 1: + closeLoopStream() + } +} diff --git a/vendor/google.golang.org/grpc/benchmark/grpc_testing/control.pb.go b/vendor/google.golang.org/grpc/benchmark/grpc_testing/control.pb.go new file mode 100644 index 0000000000..b88832f75a --- /dev/null +++ b/vendor/google.golang.org/grpc/benchmark/grpc_testing/control.pb.go @@ -0,0 +1,1194 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: control.proto + +/* +Package grpc_testing is a generated protocol buffer package. + +It is generated from these files: + control.proto + messages.proto + payloads.proto + services.proto + stats.proto + +It has these top-level messages: + PoissonParams + UniformParams + DeterministicParams + ParetoParams + ClosedLoopParams + LoadParams + SecurityParams + ClientConfig + ClientStatus + Mark + ClientArgs + ServerConfig + ServerArgs + ServerStatus + CoreRequest + CoreResponse + Void + Scenario + Scenarios + Payload + EchoStatus + SimpleRequest + SimpleResponse + StreamingInputCallRequest + StreamingInputCallResponse + ResponseParameters + StreamingOutputCallRequest + StreamingOutputCallResponse + ReconnectParams + ReconnectInfo + ByteBufferParams + SimpleProtoParams + ComplexProtoParams + PayloadConfig + ServerStats + HistogramParams + HistogramData + ClientStats +*/ +package grpc_testing + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import 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.ProtoPackageIsVersion2 // please upgrade the proto package + +type ClientType int32 + +const ( + ClientType_SYNC_CLIENT ClientType = 0 + ClientType_ASYNC_CLIENT ClientType = 1 +) + +var ClientType_name = map[int32]string{ + 0: "SYNC_CLIENT", + 1: "ASYNC_CLIENT", +} +var ClientType_value = map[string]int32{ + "SYNC_CLIENT": 0, + "ASYNC_CLIENT": 1, +} + +func (x ClientType) String() string { + return proto.EnumName(ClientType_name, int32(x)) +} +func (ClientType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +type ServerType int32 + +const ( + ServerType_SYNC_SERVER ServerType = 0 + ServerType_ASYNC_SERVER ServerType = 1 + ServerType_ASYNC_GENERIC_SERVER ServerType = 2 +) + +var ServerType_name = map[int32]string{ + 0: "SYNC_SERVER", + 1: "ASYNC_SERVER", + 2: "ASYNC_GENERIC_SERVER", +} +var ServerType_value = map[string]int32{ + "SYNC_SERVER": 0, + "ASYNC_SERVER": 1, + "ASYNC_GENERIC_SERVER": 2, +} + +func (x ServerType) String() string { + return proto.EnumName(ServerType_name, int32(x)) +} +func (ServerType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +type RpcType int32 + +const ( + RpcType_UNARY RpcType = 0 + RpcType_STREAMING RpcType = 1 +) + +var RpcType_name = map[int32]string{ + 0: "UNARY", + 1: "STREAMING", +} +var RpcType_value = map[string]int32{ + "UNARY": 0, + "STREAMING": 1, +} + +func (x RpcType) String() string { + return proto.EnumName(RpcType_name, int32(x)) +} +func (RpcType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +// Parameters of poisson process distribution, which is a good representation +// of activity coming in from independent identical stationary sources. +type PoissonParams struct { + // The rate of arrivals (a.k.a. lambda parameter of the exp distribution). + OfferedLoad float64 `protobuf:"fixed64,1,opt,name=offered_load,json=offeredLoad" json:"offered_load,omitempty"` +} + +func (m *PoissonParams) Reset() { *m = PoissonParams{} } +func (m *PoissonParams) String() string { return proto.CompactTextString(m) } +func (*PoissonParams) ProtoMessage() {} +func (*PoissonParams) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *PoissonParams) GetOfferedLoad() float64 { + if m != nil { + return m.OfferedLoad + } + return 0 +} + +type UniformParams struct { + InterarrivalLo float64 `protobuf:"fixed64,1,opt,name=interarrival_lo,json=interarrivalLo" json:"interarrival_lo,omitempty"` + InterarrivalHi float64 `protobuf:"fixed64,2,opt,name=interarrival_hi,json=interarrivalHi" json:"interarrival_hi,omitempty"` +} + +func (m *UniformParams) Reset() { *m = UniformParams{} } +func (m *UniformParams) String() string { return proto.CompactTextString(m) } +func (*UniformParams) ProtoMessage() {} +func (*UniformParams) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *UniformParams) GetInterarrivalLo() float64 { + if m != nil { + return m.InterarrivalLo + } + return 0 +} + +func (m *UniformParams) GetInterarrivalHi() float64 { + if m != nil { + return m.InterarrivalHi + } + return 0 +} + +type DeterministicParams struct { + OfferedLoad float64 `protobuf:"fixed64,1,opt,name=offered_load,json=offeredLoad" json:"offered_load,omitempty"` +} + +func (m *DeterministicParams) Reset() { *m = DeterministicParams{} } +func (m *DeterministicParams) String() string { return proto.CompactTextString(m) } +func (*DeterministicParams) ProtoMessage() {} +func (*DeterministicParams) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *DeterministicParams) GetOfferedLoad() float64 { + if m != nil { + return m.OfferedLoad + } + return 0 +} + +type ParetoParams struct { + InterarrivalBase float64 `protobuf:"fixed64,1,opt,name=interarrival_base,json=interarrivalBase" json:"interarrival_base,omitempty"` + Alpha float64 `protobuf:"fixed64,2,opt,name=alpha" json:"alpha,omitempty"` +} + +func (m *ParetoParams) Reset() { *m = ParetoParams{} } +func (m *ParetoParams) String() string { return proto.CompactTextString(m) } +func (*ParetoParams) ProtoMessage() {} +func (*ParetoParams) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *ParetoParams) GetInterarrivalBase() float64 { + if m != nil { + return m.InterarrivalBase + } + return 0 +} + +func (m *ParetoParams) GetAlpha() float64 { + if m != nil { + return m.Alpha + } + return 0 +} + +// Once an RPC finishes, immediately start a new one. +// No configuration parameters needed. +type ClosedLoopParams struct { +} + +func (m *ClosedLoopParams) Reset() { *m = ClosedLoopParams{} } +func (m *ClosedLoopParams) String() string { return proto.CompactTextString(m) } +func (*ClosedLoopParams) ProtoMessage() {} +func (*ClosedLoopParams) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +type LoadParams struct { + // Types that are valid to be assigned to Load: + // *LoadParams_ClosedLoop + // *LoadParams_Poisson + // *LoadParams_Uniform + // *LoadParams_Determ + // *LoadParams_Pareto + Load isLoadParams_Load `protobuf_oneof:"load"` +} + +func (m *LoadParams) Reset() { *m = LoadParams{} } +func (m *LoadParams) String() string { return proto.CompactTextString(m) } +func (*LoadParams) ProtoMessage() {} +func (*LoadParams) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +type isLoadParams_Load interface { + isLoadParams_Load() +} + +type LoadParams_ClosedLoop struct { + ClosedLoop *ClosedLoopParams `protobuf:"bytes,1,opt,name=closed_loop,json=closedLoop,oneof"` +} +type LoadParams_Poisson struct { + Poisson *PoissonParams `protobuf:"bytes,2,opt,name=poisson,oneof"` +} +type LoadParams_Uniform struct { + Uniform *UniformParams `protobuf:"bytes,3,opt,name=uniform,oneof"` +} +type LoadParams_Determ struct { + Determ *DeterministicParams `protobuf:"bytes,4,opt,name=determ,oneof"` +} +type LoadParams_Pareto struct { + Pareto *ParetoParams `protobuf:"bytes,5,opt,name=pareto,oneof"` +} + +func (*LoadParams_ClosedLoop) isLoadParams_Load() {} +func (*LoadParams_Poisson) isLoadParams_Load() {} +func (*LoadParams_Uniform) isLoadParams_Load() {} +func (*LoadParams_Determ) isLoadParams_Load() {} +func (*LoadParams_Pareto) isLoadParams_Load() {} + +func (m *LoadParams) GetLoad() isLoadParams_Load { + if m != nil { + return m.Load + } + return nil +} + +func (m *LoadParams) GetClosedLoop() *ClosedLoopParams { + if x, ok := m.GetLoad().(*LoadParams_ClosedLoop); ok { + return x.ClosedLoop + } + return nil +} + +func (m *LoadParams) GetPoisson() *PoissonParams { + if x, ok := m.GetLoad().(*LoadParams_Poisson); ok { + return x.Poisson + } + return nil +} + +func (m *LoadParams) GetUniform() *UniformParams { + if x, ok := m.GetLoad().(*LoadParams_Uniform); ok { + return x.Uniform + } + return nil +} + +func (m *LoadParams) GetDeterm() *DeterministicParams { + if x, ok := m.GetLoad().(*LoadParams_Determ); ok { + return x.Determ + } + return nil +} + +func (m *LoadParams) GetPareto() *ParetoParams { + if x, ok := m.GetLoad().(*LoadParams_Pareto); ok { + return x.Pareto + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*LoadParams) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _LoadParams_OneofMarshaler, _LoadParams_OneofUnmarshaler, _LoadParams_OneofSizer, []interface{}{ + (*LoadParams_ClosedLoop)(nil), + (*LoadParams_Poisson)(nil), + (*LoadParams_Uniform)(nil), + (*LoadParams_Determ)(nil), + (*LoadParams_Pareto)(nil), + } +} + +func _LoadParams_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*LoadParams) + // load + switch x := m.Load.(type) { + case *LoadParams_ClosedLoop: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ClosedLoop); err != nil { + return err + } + case *LoadParams_Poisson: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Poisson); err != nil { + return err + } + case *LoadParams_Uniform: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Uniform); err != nil { + return err + } + case *LoadParams_Determ: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Determ); err != nil { + return err + } + case *LoadParams_Pareto: + b.EncodeVarint(5<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Pareto); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("LoadParams.Load has unexpected type %T", x) + } + return nil +} + +func _LoadParams_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*LoadParams) + switch tag { + case 1: // load.closed_loop + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ClosedLoopParams) + err := b.DecodeMessage(msg) + m.Load = &LoadParams_ClosedLoop{msg} + return true, err + case 2: // load.poisson + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(PoissonParams) + err := b.DecodeMessage(msg) + m.Load = &LoadParams_Poisson{msg} + return true, err + case 3: // load.uniform + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(UniformParams) + err := b.DecodeMessage(msg) + m.Load = &LoadParams_Uniform{msg} + return true, err + case 4: // load.determ + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(DeterministicParams) + err := b.DecodeMessage(msg) + m.Load = &LoadParams_Determ{msg} + return true, err + case 5: // load.pareto + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ParetoParams) + err := b.DecodeMessage(msg) + m.Load = &LoadParams_Pareto{msg} + return true, err + default: + return false, nil + } +} + +func _LoadParams_OneofSizer(msg proto.Message) (n int) { + m := msg.(*LoadParams) + // load + switch x := m.Load.(type) { + case *LoadParams_ClosedLoop: + s := proto.Size(x.ClosedLoop) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *LoadParams_Poisson: + s := proto.Size(x.Poisson) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *LoadParams_Uniform: + s := proto.Size(x.Uniform) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *LoadParams_Determ: + s := proto.Size(x.Determ) + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *LoadParams_Pareto: + s := proto.Size(x.Pareto) + n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// presence of SecurityParams implies use of TLS +type SecurityParams struct { + UseTestCa bool `protobuf:"varint,1,opt,name=use_test_ca,json=useTestCa" json:"use_test_ca,omitempty"` + ServerHostOverride string `protobuf:"bytes,2,opt,name=server_host_override,json=serverHostOverride" json:"server_host_override,omitempty"` +} + +func (m *SecurityParams) Reset() { *m = SecurityParams{} } +func (m *SecurityParams) String() string { return proto.CompactTextString(m) } +func (*SecurityParams) ProtoMessage() {} +func (*SecurityParams) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *SecurityParams) GetUseTestCa() bool { + if m != nil { + return m.UseTestCa + } + return false +} + +func (m *SecurityParams) GetServerHostOverride() string { + if m != nil { + return m.ServerHostOverride + } + return "" +} + +type ClientConfig struct { + // List of targets to connect to. At least one target needs to be specified. + ServerTargets []string `protobuf:"bytes,1,rep,name=server_targets,json=serverTargets" json:"server_targets,omitempty"` + ClientType ClientType `protobuf:"varint,2,opt,name=client_type,json=clientType,enum=grpc.testing.ClientType" json:"client_type,omitempty"` + SecurityParams *SecurityParams `protobuf:"bytes,3,opt,name=security_params,json=securityParams" json:"security_params,omitempty"` + // How many concurrent RPCs to start for each channel. + // For synchronous client, use a separate thread for each outstanding RPC. + OutstandingRpcsPerChannel int32 `protobuf:"varint,4,opt,name=outstanding_rpcs_per_channel,json=outstandingRpcsPerChannel" json:"outstanding_rpcs_per_channel,omitempty"` + // Number of independent client channels to create. + // i-th channel will connect to server_target[i % server_targets.size()] + ClientChannels int32 `protobuf:"varint,5,opt,name=client_channels,json=clientChannels" json:"client_channels,omitempty"` + // Only for async client. Number of threads to use to start/manage RPCs. + AsyncClientThreads int32 `protobuf:"varint,7,opt,name=async_client_threads,json=asyncClientThreads" json:"async_client_threads,omitempty"` + RpcType RpcType `protobuf:"varint,8,opt,name=rpc_type,json=rpcType,enum=grpc.testing.RpcType" json:"rpc_type,omitempty"` + // The requested load for the entire client (aggregated over all the threads). + LoadParams *LoadParams `protobuf:"bytes,10,opt,name=load_params,json=loadParams" json:"load_params,omitempty"` + PayloadConfig *PayloadConfig `protobuf:"bytes,11,opt,name=payload_config,json=payloadConfig" json:"payload_config,omitempty"` + HistogramParams *HistogramParams `protobuf:"bytes,12,opt,name=histogram_params,json=histogramParams" json:"histogram_params,omitempty"` + // Specify the cores we should run the client on, if desired + CoreList []int32 `protobuf:"varint,13,rep,packed,name=core_list,json=coreList" json:"core_list,omitempty"` + CoreLimit int32 `protobuf:"varint,14,opt,name=core_limit,json=coreLimit" json:"core_limit,omitempty"` +} + +func (m *ClientConfig) Reset() { *m = ClientConfig{} } +func (m *ClientConfig) String() string { return proto.CompactTextString(m) } +func (*ClientConfig) ProtoMessage() {} +func (*ClientConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *ClientConfig) GetServerTargets() []string { + if m != nil { + return m.ServerTargets + } + return nil +} + +func (m *ClientConfig) GetClientType() ClientType { + if m != nil { + return m.ClientType + } + return ClientType_SYNC_CLIENT +} + +func (m *ClientConfig) GetSecurityParams() *SecurityParams { + if m != nil { + return m.SecurityParams + } + return nil +} + +func (m *ClientConfig) GetOutstandingRpcsPerChannel() int32 { + if m != nil { + return m.OutstandingRpcsPerChannel + } + return 0 +} + +func (m *ClientConfig) GetClientChannels() int32 { + if m != nil { + return m.ClientChannels + } + return 0 +} + +func (m *ClientConfig) GetAsyncClientThreads() int32 { + if m != nil { + return m.AsyncClientThreads + } + return 0 +} + +func (m *ClientConfig) GetRpcType() RpcType { + if m != nil { + return m.RpcType + } + return RpcType_UNARY +} + +func (m *ClientConfig) GetLoadParams() *LoadParams { + if m != nil { + return m.LoadParams + } + return nil +} + +func (m *ClientConfig) GetPayloadConfig() *PayloadConfig { + if m != nil { + return m.PayloadConfig + } + return nil +} + +func (m *ClientConfig) GetHistogramParams() *HistogramParams { + if m != nil { + return m.HistogramParams + } + return nil +} + +func (m *ClientConfig) GetCoreList() []int32 { + if m != nil { + return m.CoreList + } + return nil +} + +func (m *ClientConfig) GetCoreLimit() int32 { + if m != nil { + return m.CoreLimit + } + return 0 +} + +type ClientStatus struct { + Stats *ClientStats `protobuf:"bytes,1,opt,name=stats" json:"stats,omitempty"` +} + +func (m *ClientStatus) Reset() { *m = ClientStatus{} } +func (m *ClientStatus) String() string { return proto.CompactTextString(m) } +func (*ClientStatus) ProtoMessage() {} +func (*ClientStatus) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *ClientStatus) GetStats() *ClientStats { + if m != nil { + return m.Stats + } + return nil +} + +// Request current stats +type Mark struct { + // if true, the stats will be reset after taking their snapshot. + Reset_ bool `protobuf:"varint,1,opt,name=reset" json:"reset,omitempty"` +} + +func (m *Mark) Reset() { *m = Mark{} } +func (m *Mark) String() string { return proto.CompactTextString(m) } +func (*Mark) ProtoMessage() {} +func (*Mark) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *Mark) GetReset_() bool { + if m != nil { + return m.Reset_ + } + return false +} + +type ClientArgs struct { + // Types that are valid to be assigned to Argtype: + // *ClientArgs_Setup + // *ClientArgs_Mark + Argtype isClientArgs_Argtype `protobuf_oneof:"argtype"` +} + +func (m *ClientArgs) Reset() { *m = ClientArgs{} } +func (m *ClientArgs) String() string { return proto.CompactTextString(m) } +func (*ClientArgs) ProtoMessage() {} +func (*ClientArgs) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +type isClientArgs_Argtype interface { + isClientArgs_Argtype() +} + +type ClientArgs_Setup struct { + Setup *ClientConfig `protobuf:"bytes,1,opt,name=setup,oneof"` +} +type ClientArgs_Mark struct { + Mark *Mark `protobuf:"bytes,2,opt,name=mark,oneof"` +} + +func (*ClientArgs_Setup) isClientArgs_Argtype() {} +func (*ClientArgs_Mark) isClientArgs_Argtype() {} + +func (m *ClientArgs) GetArgtype() isClientArgs_Argtype { + if m != nil { + return m.Argtype + } + return nil +} + +func (m *ClientArgs) GetSetup() *ClientConfig { + if x, ok := m.GetArgtype().(*ClientArgs_Setup); ok { + return x.Setup + } + return nil +} + +func (m *ClientArgs) GetMark() *Mark { + if x, ok := m.GetArgtype().(*ClientArgs_Mark); ok { + return x.Mark + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*ClientArgs) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _ClientArgs_OneofMarshaler, _ClientArgs_OneofUnmarshaler, _ClientArgs_OneofSizer, []interface{}{ + (*ClientArgs_Setup)(nil), + (*ClientArgs_Mark)(nil), + } +} + +func _ClientArgs_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*ClientArgs) + // argtype + switch x := m.Argtype.(type) { + case *ClientArgs_Setup: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Setup); err != nil { + return err + } + case *ClientArgs_Mark: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Mark); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("ClientArgs.Argtype has unexpected type %T", x) + } + return nil +} + +func _ClientArgs_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*ClientArgs) + switch tag { + case 1: // argtype.setup + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ClientConfig) + err := b.DecodeMessage(msg) + m.Argtype = &ClientArgs_Setup{msg} + return true, err + case 2: // argtype.mark + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Mark) + err := b.DecodeMessage(msg) + m.Argtype = &ClientArgs_Mark{msg} + return true, err + default: + return false, nil + } +} + +func _ClientArgs_OneofSizer(msg proto.Message) (n int) { + m := msg.(*ClientArgs) + // argtype + switch x := m.Argtype.(type) { + case *ClientArgs_Setup: + s := proto.Size(x.Setup) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *ClientArgs_Mark: + s := proto.Size(x.Mark) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +type ServerConfig struct { + ServerType ServerType `protobuf:"varint,1,opt,name=server_type,json=serverType,enum=grpc.testing.ServerType" json:"server_type,omitempty"` + SecurityParams *SecurityParams `protobuf:"bytes,2,opt,name=security_params,json=securityParams" json:"security_params,omitempty"` + // Port on which to listen. Zero means pick unused port. + Port int32 `protobuf:"varint,4,opt,name=port" json:"port,omitempty"` + // Only for async server. Number of threads used to serve the requests. + AsyncServerThreads int32 `protobuf:"varint,7,opt,name=async_server_threads,json=asyncServerThreads" json:"async_server_threads,omitempty"` + // Specify the number of cores to limit server to, if desired + CoreLimit int32 `protobuf:"varint,8,opt,name=core_limit,json=coreLimit" json:"core_limit,omitempty"` + // payload config, used in generic server + PayloadConfig *PayloadConfig `protobuf:"bytes,9,opt,name=payload_config,json=payloadConfig" json:"payload_config,omitempty"` + // Specify the cores we should run the server on, if desired + CoreList []int32 `protobuf:"varint,10,rep,packed,name=core_list,json=coreList" json:"core_list,omitempty"` +} + +func (m *ServerConfig) Reset() { *m = ServerConfig{} } +func (m *ServerConfig) String() string { return proto.CompactTextString(m) } +func (*ServerConfig) ProtoMessage() {} +func (*ServerConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } + +func (m *ServerConfig) GetServerType() ServerType { + if m != nil { + return m.ServerType + } + return ServerType_SYNC_SERVER +} + +func (m *ServerConfig) GetSecurityParams() *SecurityParams { + if m != nil { + return m.SecurityParams + } + return nil +} + +func (m *ServerConfig) GetPort() int32 { + if m != nil { + return m.Port + } + return 0 +} + +func (m *ServerConfig) GetAsyncServerThreads() int32 { + if m != nil { + return m.AsyncServerThreads + } + return 0 +} + +func (m *ServerConfig) GetCoreLimit() int32 { + if m != nil { + return m.CoreLimit + } + return 0 +} + +func (m *ServerConfig) GetPayloadConfig() *PayloadConfig { + if m != nil { + return m.PayloadConfig + } + return nil +} + +func (m *ServerConfig) GetCoreList() []int32 { + if m != nil { + return m.CoreList + } + return nil +} + +type ServerArgs struct { + // Types that are valid to be assigned to Argtype: + // *ServerArgs_Setup + // *ServerArgs_Mark + Argtype isServerArgs_Argtype `protobuf_oneof:"argtype"` +} + +func (m *ServerArgs) Reset() { *m = ServerArgs{} } +func (m *ServerArgs) String() string { return proto.CompactTextString(m) } +func (*ServerArgs) ProtoMessage() {} +func (*ServerArgs) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } + +type isServerArgs_Argtype interface { + isServerArgs_Argtype() +} + +type ServerArgs_Setup struct { + Setup *ServerConfig `protobuf:"bytes,1,opt,name=setup,oneof"` +} +type ServerArgs_Mark struct { + Mark *Mark `protobuf:"bytes,2,opt,name=mark,oneof"` +} + +func (*ServerArgs_Setup) isServerArgs_Argtype() {} +func (*ServerArgs_Mark) isServerArgs_Argtype() {} + +func (m *ServerArgs) GetArgtype() isServerArgs_Argtype { + if m != nil { + return m.Argtype + } + return nil +} + +func (m *ServerArgs) GetSetup() *ServerConfig { + if x, ok := m.GetArgtype().(*ServerArgs_Setup); ok { + return x.Setup + } + return nil +} + +func (m *ServerArgs) GetMark() *Mark { + if x, ok := m.GetArgtype().(*ServerArgs_Mark); ok { + return x.Mark + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*ServerArgs) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _ServerArgs_OneofMarshaler, _ServerArgs_OneofUnmarshaler, _ServerArgs_OneofSizer, []interface{}{ + (*ServerArgs_Setup)(nil), + (*ServerArgs_Mark)(nil), + } +} + +func _ServerArgs_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*ServerArgs) + // argtype + switch x := m.Argtype.(type) { + case *ServerArgs_Setup: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Setup); err != nil { + return err + } + case *ServerArgs_Mark: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Mark); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("ServerArgs.Argtype has unexpected type %T", x) + } + return nil +} + +func _ServerArgs_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*ServerArgs) + switch tag { + case 1: // argtype.setup + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ServerConfig) + err := b.DecodeMessage(msg) + m.Argtype = &ServerArgs_Setup{msg} + return true, err + case 2: // argtype.mark + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Mark) + err := b.DecodeMessage(msg) + m.Argtype = &ServerArgs_Mark{msg} + return true, err + default: + return false, nil + } +} + +func _ServerArgs_OneofSizer(msg proto.Message) (n int) { + m := msg.(*ServerArgs) + // argtype + switch x := m.Argtype.(type) { + case *ServerArgs_Setup: + s := proto.Size(x.Setup) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *ServerArgs_Mark: + s := proto.Size(x.Mark) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +type ServerStatus struct { + Stats *ServerStats `protobuf:"bytes,1,opt,name=stats" json:"stats,omitempty"` + // the port bound by the server + Port int32 `protobuf:"varint,2,opt,name=port" json:"port,omitempty"` + // Number of cores available to the server + Cores int32 `protobuf:"varint,3,opt,name=cores" json:"cores,omitempty"` +} + +func (m *ServerStatus) Reset() { *m = ServerStatus{} } +func (m *ServerStatus) String() string { return proto.CompactTextString(m) } +func (*ServerStatus) ProtoMessage() {} +func (*ServerStatus) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } + +func (m *ServerStatus) GetStats() *ServerStats { + if m != nil { + return m.Stats + } + return nil +} + +func (m *ServerStatus) GetPort() int32 { + if m != nil { + return m.Port + } + return 0 +} + +func (m *ServerStatus) GetCores() int32 { + if m != nil { + return m.Cores + } + return 0 +} + +type CoreRequest struct { +} + +func (m *CoreRequest) Reset() { *m = CoreRequest{} } +func (m *CoreRequest) String() string { return proto.CompactTextString(m) } +func (*CoreRequest) ProtoMessage() {} +func (*CoreRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } + +type CoreResponse struct { + // Number of cores available on the server + Cores int32 `protobuf:"varint,1,opt,name=cores" json:"cores,omitempty"` +} + +func (m *CoreResponse) Reset() { *m = CoreResponse{} } +func (m *CoreResponse) String() string { return proto.CompactTextString(m) } +func (*CoreResponse) ProtoMessage() {} +func (*CoreResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } + +func (m *CoreResponse) GetCores() int32 { + if m != nil { + return m.Cores + } + return 0 +} + +type Void struct { +} + +func (m *Void) Reset() { *m = Void{} } +func (m *Void) String() string { return proto.CompactTextString(m) } +func (*Void) ProtoMessage() {} +func (*Void) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} } + +// A single performance scenario: input to qps_json_driver +type Scenario struct { + // Human readable name for this scenario + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Client configuration + ClientConfig *ClientConfig `protobuf:"bytes,2,opt,name=client_config,json=clientConfig" json:"client_config,omitempty"` + // Number of clients to start for the test + NumClients int32 `protobuf:"varint,3,opt,name=num_clients,json=numClients" json:"num_clients,omitempty"` + // Server configuration + ServerConfig *ServerConfig `protobuf:"bytes,4,opt,name=server_config,json=serverConfig" json:"server_config,omitempty"` + // Number of servers to start for the test + NumServers int32 `protobuf:"varint,5,opt,name=num_servers,json=numServers" json:"num_servers,omitempty"` + // Warmup period, in seconds + WarmupSeconds int32 `protobuf:"varint,6,opt,name=warmup_seconds,json=warmupSeconds" json:"warmup_seconds,omitempty"` + // Benchmark time, in seconds + BenchmarkSeconds int32 `protobuf:"varint,7,opt,name=benchmark_seconds,json=benchmarkSeconds" json:"benchmark_seconds,omitempty"` + // Number of workers to spawn locally (usually zero) + SpawnLocalWorkerCount int32 `protobuf:"varint,8,opt,name=spawn_local_worker_count,json=spawnLocalWorkerCount" json:"spawn_local_worker_count,omitempty"` +} + +func (m *Scenario) Reset() { *m = Scenario{} } +func (m *Scenario) String() string { return proto.CompactTextString(m) } +func (*Scenario) ProtoMessage() {} +func (*Scenario) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17} } + +func (m *Scenario) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Scenario) GetClientConfig() *ClientConfig { + if m != nil { + return m.ClientConfig + } + return nil +} + +func (m *Scenario) GetNumClients() int32 { + if m != nil { + return m.NumClients + } + return 0 +} + +func (m *Scenario) GetServerConfig() *ServerConfig { + if m != nil { + return m.ServerConfig + } + return nil +} + +func (m *Scenario) GetNumServers() int32 { + if m != nil { + return m.NumServers + } + return 0 +} + +func (m *Scenario) GetWarmupSeconds() int32 { + if m != nil { + return m.WarmupSeconds + } + return 0 +} + +func (m *Scenario) GetBenchmarkSeconds() int32 { + if m != nil { + return m.BenchmarkSeconds + } + return 0 +} + +func (m *Scenario) GetSpawnLocalWorkerCount() int32 { + if m != nil { + return m.SpawnLocalWorkerCount + } + return 0 +} + +// A set of scenarios to be run with qps_json_driver +type Scenarios struct { + Scenarios []*Scenario `protobuf:"bytes,1,rep,name=scenarios" json:"scenarios,omitempty"` +} + +func (m *Scenarios) Reset() { *m = Scenarios{} } +func (m *Scenarios) String() string { return proto.CompactTextString(m) } +func (*Scenarios) ProtoMessage() {} +func (*Scenarios) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{18} } + +func (m *Scenarios) GetScenarios() []*Scenario { + if m != nil { + return m.Scenarios + } + return nil +} + +func init() { + proto.RegisterType((*PoissonParams)(nil), "grpc.testing.PoissonParams") + proto.RegisterType((*UniformParams)(nil), "grpc.testing.UniformParams") + proto.RegisterType((*DeterministicParams)(nil), "grpc.testing.DeterministicParams") + proto.RegisterType((*ParetoParams)(nil), "grpc.testing.ParetoParams") + proto.RegisterType((*ClosedLoopParams)(nil), "grpc.testing.ClosedLoopParams") + proto.RegisterType((*LoadParams)(nil), "grpc.testing.LoadParams") + proto.RegisterType((*SecurityParams)(nil), "grpc.testing.SecurityParams") + proto.RegisterType((*ClientConfig)(nil), "grpc.testing.ClientConfig") + proto.RegisterType((*ClientStatus)(nil), "grpc.testing.ClientStatus") + proto.RegisterType((*Mark)(nil), "grpc.testing.Mark") + proto.RegisterType((*ClientArgs)(nil), "grpc.testing.ClientArgs") + proto.RegisterType((*ServerConfig)(nil), "grpc.testing.ServerConfig") + proto.RegisterType((*ServerArgs)(nil), "grpc.testing.ServerArgs") + proto.RegisterType((*ServerStatus)(nil), "grpc.testing.ServerStatus") + proto.RegisterType((*CoreRequest)(nil), "grpc.testing.CoreRequest") + proto.RegisterType((*CoreResponse)(nil), "grpc.testing.CoreResponse") + proto.RegisterType((*Void)(nil), "grpc.testing.Void") + proto.RegisterType((*Scenario)(nil), "grpc.testing.Scenario") + proto.RegisterType((*Scenarios)(nil), "grpc.testing.Scenarios") + proto.RegisterEnum("grpc.testing.ClientType", ClientType_name, ClientType_value) + proto.RegisterEnum("grpc.testing.ServerType", ServerType_name, ServerType_value) + proto.RegisterEnum("grpc.testing.RpcType", RpcType_name, RpcType_value) +} + +func init() { proto.RegisterFile("control.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 1179 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0x6f, 0x6f, 0xdb, 0xb6, + 0x13, 0xb6, 0x1d, 0xdb, 0xb1, 0x4e, 0xb6, 0xe3, 0x1f, 0x7f, 0xe9, 0xa0, 0xa6, 0x69, 0x97, 0x6a, + 0x1b, 0x16, 0x64, 0x40, 0x5a, 0x78, 0x05, 0xba, 0x62, 0x2f, 0x02, 0xc7, 0x33, 0xea, 0x00, 0x69, + 0x96, 0xd1, 0x69, 0x87, 0xbe, 0x12, 0x18, 0x99, 0xb1, 0x85, 0xc8, 0xa2, 0x46, 0x52, 0x09, 0xf2, + 0x15, 0xf6, 0x99, 0xf6, 0x39, 0xf6, 0x35, 0xf6, 0x15, 0x06, 0xfe, 0x91, 0x23, 0xb9, 0x06, 0x9a, + 0x6d, 0xef, 0xc4, 0xbb, 0xe7, 0xe1, 0x91, 0xf7, 0xdc, 0x1d, 0x05, 0x9d, 0x90, 0x25, 0x92, 0xb3, + 0xf8, 0x30, 0xe5, 0x4c, 0x32, 0xd4, 0x9e, 0xf1, 0x34, 0x3c, 0x94, 0x54, 0xc8, 0x28, 0x99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a9, 0x51, 0x42, 0x47, 0x77, 0xfb, 0x4f, 0xca, 0xf4, 0x92, + 0x4c, 0xe3, 0x0a, 0xce, 0xd1, 0x8a, 0x98, 0x19, 0x39, 0xbc, 0x8d, 0x75, 0xc4, 0x92, 0x56, 0x8a, + 0x68, 0xd1, 0xe8, 0x47, 0x68, 0x4e, 0x75, 0x92, 0xbd, 0xba, 0xe6, 0x3d, 0x2f, 0xf3, 0xd6, 0x08, + 0x30, 0xae, 0x60, 0x4b, 0x41, 0xaf, 0xa0, 0x99, 0xea, 0x3c, 0x7b, 0x0d, 0x4d, 0xde, 0x59, 0x39, + 0x6d, 0x41, 0x03, 0xc5, 0x32, 0xd8, 0xe3, 0x26, 0xd4, 0x95, 0x70, 0xfe, 0x25, 0x74, 0x27, 0x34, + 0xcc, 0x78, 0x24, 0xef, 0x6c, 0x06, 0x9f, 0x81, 0x9b, 0x09, 0x1a, 0x28, 0x7e, 0x10, 0x12, 0x9d, + 0xc1, 0x16, 0x76, 0x32, 0x41, 0x2f, 0xa8, 0x90, 0x43, 0x82, 0x5e, 0xc2, 0xb6, 0xa0, 0xfc, 0x86, + 0xf2, 0x60, 0xce, 0x84, 0x0c, 0xd8, 0x0d, 0xe5, 0x3c, 0x9a, 0x52, 0x9d, 0x2b, 0x07, 0x23, 0xe3, + 0x1b, 0x33, 0x21, 0x7f, 0xb6, 0x1e, 0xff, 0xf7, 0x06, 0xb4, 0x87, 0x71, 0x44, 0x13, 0x39, 0x64, + 0xc9, 0x55, 0x34, 0x43, 0xdf, 0x40, 0xd7, 0x6e, 0x21, 0x09, 0x9f, 0x51, 0x29, 0xbc, 0xea, 0xde, + 0xc6, 0xbe, 0x83, 0x3b, 0xc6, 0x7a, 0x61, 0x8c, 0xe8, 0x8d, 0xd2, 0x52, 0xd1, 0x02, 0x79, 0x97, + 0x9a, 0x00, 0xdd, 0xbe, 0xb7, 0xaa, 0xa5, 0x02, 0x5c, 0xdc, 0xa5, 0x54, 0x69, 0x98, 0x7f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0x91, 0x92, 0xdb, 0x24, 0x88, 0x59, 0x48, 0xe2, 0xe0, 0x96, 0xf1, 0x6b, 0x7d, 0x83, 0x2c, + 0xc9, 0xab, 0xfc, 0x91, 0xf6, 0x9f, 0x2a, 0xf7, 0xaf, 0xda, 0x3b, 0x54, 0x4e, 0x7f, 0x00, 0x4e, + 0x9e, 0x70, 0x81, 0x5e, 0x81, 0x23, 0xf2, 0x85, 0x7e, 0x43, 0xdd, 0xfe, 0x17, 0x2b, 0xf7, 0xb6, + 0x6e, 0x7c, 0x0f, 0x3c, 0x78, 0x91, 0xcf, 0x28, 0xdd, 0xee, 0x5b, 0xe0, 0x4e, 0x3e, 0x9e, 0x0d, + 0x83, 0xe1, 0xe9, 0xc9, 0xe8, 0xec, 0xa2, 0x57, 0x41, 0x3d, 0x68, 0x0f, 0x8a, 0x96, 0xea, 0xc1, + 0x49, 0xde, 0x04, 0x25, 0xc2, 0x64, 0x84, 0x3f, 0x8c, 0x70, 0x91, 0x60, 0x2d, 0x55, 0xe4, 0xc1, + 0xb6, 0xb1, 0xbc, 0x1d, 0x9d, 0x8d, 0xf0, 0xc9, 0xd2, 0x53, 0x3b, 0xf8, 0x0a, 0x36, 0xed, 0xbb, + 0x84, 0x1c, 0x68, 0xbc, 0x3f, 0x1b, 0xe0, 0x8f, 0xbd, 0x0a, 0xea, 0x80, 0x33, 0xb9, 0xc0, 0xa3, + 0xc1, 0xbb, 0x93, 0xb3, 0xb7, 0xbd, 0xea, 0x65, 0x53, 0xff, 0x12, 0x7f, 0xff, 0x77, 0x00, 0x00, + 0x00, 0xff, 0xff, 0x75, 0x59, 0xf4, 0x03, 0x4e, 0x0b, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/grpc/benchmark/grpc_testing/control.proto b/vendor/google.golang.org/grpc/benchmark/grpc_testing/control.proto new file mode 100644 index 0000000000..9379ef49a2 --- /dev/null +++ b/vendor/google.golang.org/grpc/benchmark/grpc_testing/control.proto @@ -0,0 +1,186 @@ +// Copyright 2016 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. + +syntax = "proto3"; + +import "payloads.proto"; +import "stats.proto"; + +package grpc.testing; + +enum ClientType { + SYNC_CLIENT = 0; + ASYNC_CLIENT = 1; +} + +enum ServerType { + SYNC_SERVER = 0; + ASYNC_SERVER = 1; + ASYNC_GENERIC_SERVER = 2; +} + +enum RpcType { + UNARY = 0; + STREAMING = 1; +} + +// Parameters of poisson process distribution, which is a good representation +// of activity coming in from independent identical stationary sources. +message PoissonParams { + // The rate of arrivals (a.k.a. lambda parameter of the exp distribution). + double offered_load = 1; +} + +message UniformParams { + double interarrival_lo = 1; + double interarrival_hi = 2; +} + +message DeterministicParams { + double offered_load = 1; +} + +message ParetoParams { + double interarrival_base = 1; + double alpha = 2; +} + +// Once an RPC finishes, immediately start a new one. +// No configuration parameters needed. +message ClosedLoopParams { +} + +message LoadParams { + oneof load { + ClosedLoopParams closed_loop = 1; + PoissonParams poisson = 2; + UniformParams uniform = 3; + DeterministicParams determ = 4; + ParetoParams pareto = 5; + }; +} + +// presence of SecurityParams implies use of TLS +message SecurityParams { + bool use_test_ca = 1; + string server_host_override = 2; +} + +message ClientConfig { + // List of targets to connect to. At least one target needs to be specified. + repeated string server_targets = 1; + ClientType client_type = 2; + SecurityParams security_params = 3; + // How many concurrent RPCs to start for each channel. + // For synchronous client, use a separate thread for each outstanding RPC. + int32 outstanding_rpcs_per_channel = 4; + // Number of independent client channels to create. + // i-th channel will connect to server_target[i % server_targets.size()] + int32 client_channels = 5; + // Only for async client. Number of threads to use to start/manage RPCs. + int32 async_client_threads = 7; + RpcType rpc_type = 8; + // The requested load for the entire client (aggregated over all the threads). + LoadParams load_params = 10; + PayloadConfig payload_config = 11; + HistogramParams histogram_params = 12; + + // Specify the cores we should run the client on, if desired + repeated int32 core_list = 13; + int32 core_limit = 14; +} + +message ClientStatus { + ClientStats stats = 1; +} + +// Request current stats +message Mark { + // if true, the stats will be reset after taking their snapshot. + bool reset = 1; +} + +message ClientArgs { + oneof argtype { + ClientConfig setup = 1; + Mark mark = 2; + } +} + +message ServerConfig { + ServerType server_type = 1; + SecurityParams security_params = 2; + // Port on which to listen. Zero means pick unused port. + int32 port = 4; + // Only for async server. Number of threads used to serve the requests. + int32 async_server_threads = 7; + // Specify the number of cores to limit server to, if desired + int32 core_limit = 8; + // payload config, used in generic server + PayloadConfig payload_config = 9; + + // Specify the cores we should run the server on, if desired + repeated int32 core_list = 10; +} + +message ServerArgs { + oneof argtype { + ServerConfig setup = 1; + Mark mark = 2; + } +} + +message ServerStatus { + ServerStats stats = 1; + // the port bound by the server + int32 port = 2; + // Number of cores available to the server + int32 cores = 3; +} + +message CoreRequest { +} + +message CoreResponse { + // Number of cores available on the server + int32 cores = 1; +} + +message Void { +} + +// A single performance scenario: input to qps_json_driver +message Scenario { + // Human readable name for this scenario + string name = 1; + // Client configuration + ClientConfig client_config = 2; + // Number of clients to start for the test + int32 num_clients = 3; + // Server configuration + ServerConfig server_config = 4; + // Number of servers to start for the test + int32 num_servers = 5; + // Warmup period, in seconds + int32 warmup_seconds = 6; + // Benchmark time, in seconds + int32 benchmark_seconds = 7; + // Number of workers to spawn locally (usually zero) + int32 spawn_local_worker_count = 8; +} + +// A set of scenarios to be run with qps_json_driver +message Scenarios { + repeated Scenario scenarios = 1; +} diff --git a/vendor/google.golang.org/grpc/benchmark/grpc_testing/messages.pb.go b/vendor/google.golang.org/grpc/benchmark/grpc_testing/messages.pb.go new file mode 100644 index 0000000000..b34c5d59a3 --- /dev/null +++ b/vendor/google.golang.org/grpc/benchmark/grpc_testing/messages.pb.go @@ -0,0 +1,479 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: messages.proto + +package grpc_testing + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// The type of payload that should be returned. +type PayloadType int32 + +const ( + // Compressable text format. + PayloadType_COMPRESSABLE PayloadType = 0 + // Uncompressable binary format. + PayloadType_UNCOMPRESSABLE PayloadType = 1 + // Randomly chosen from all other formats defined in this enum. + PayloadType_RANDOM PayloadType = 2 +) + +var PayloadType_name = map[int32]string{ + 0: "COMPRESSABLE", + 1: "UNCOMPRESSABLE", + 2: "RANDOM", +} +var PayloadType_value = map[string]int32{ + "COMPRESSABLE": 0, + "UNCOMPRESSABLE": 1, + "RANDOM": 2, +} + +func (x PayloadType) String() string { + return proto.EnumName(PayloadType_name, int32(x)) +} +func (PayloadType) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +// Compression algorithms +type CompressionType int32 + +const ( + // No compression + CompressionType_NONE CompressionType = 0 + CompressionType_GZIP CompressionType = 1 + CompressionType_DEFLATE CompressionType = 2 +) + +var CompressionType_name = map[int32]string{ + 0: "NONE", + 1: "GZIP", + 2: "DEFLATE", +} +var CompressionType_value = map[string]int32{ + "NONE": 0, + "GZIP": 1, + "DEFLATE": 2, +} + +func (x CompressionType) String() string { + return proto.EnumName(CompressionType_name, int32(x)) +} +func (CompressionType) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{1} } + +// A block of data, to simply increase gRPC message size. +type Payload struct { + // The type of data in body. + Type PayloadType `protobuf:"varint,1,opt,name=type,enum=grpc.testing.PayloadType" json:"type,omitempty"` + // Primary contents of payload. + Body []byte `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"` +} + +func (m *Payload) Reset() { *m = Payload{} } +func (m *Payload) String() string { return proto.CompactTextString(m) } +func (*Payload) ProtoMessage() {} +func (*Payload) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +func (m *Payload) GetType() PayloadType { + if m != nil { + return m.Type + } + return PayloadType_COMPRESSABLE +} + +func (m *Payload) GetBody() []byte { + if m != nil { + return m.Body + } + return nil +} + +// A protobuf representation for grpc status. This is used by test +// clients to specify a status that the server should attempt to return. +type EchoStatus struct { + Code int32 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"` +} + +func (m *EchoStatus) Reset() { *m = EchoStatus{} } +func (m *EchoStatus) String() string { return proto.CompactTextString(m) } +func (*EchoStatus) ProtoMessage() {} +func (*EchoStatus) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} } + +func (m *EchoStatus) GetCode() int32 { + if m != nil { + return m.Code + } + return 0 +} + +func (m *EchoStatus) GetMessage() string { + if m != nil { + return m.Message + } + return "" +} + +// Unary request. +type SimpleRequest struct { + // Desired payload type in the response from the server. + // If response_type is RANDOM, server randomly chooses one from other formats. + ResponseType PayloadType `protobuf:"varint,1,opt,name=response_type,json=responseType,enum=grpc.testing.PayloadType" json:"response_type,omitempty"` + // Desired payload size in the response from the server. + // If response_type is COMPRESSABLE, this denotes the size before compression. + ResponseSize int32 `protobuf:"varint,2,opt,name=response_size,json=responseSize" json:"response_size,omitempty"` + // Optional input payload sent along with the request. + Payload *Payload `protobuf:"bytes,3,opt,name=payload" json:"payload,omitempty"` + // Whether SimpleResponse should include username. + FillUsername bool `protobuf:"varint,4,opt,name=fill_username,json=fillUsername" json:"fill_username,omitempty"` + // Whether SimpleResponse should include OAuth scope. + FillOauthScope bool `protobuf:"varint,5,opt,name=fill_oauth_scope,json=fillOauthScope" json:"fill_oauth_scope,omitempty"` + // Compression algorithm to be used by the server for the response (stream) + ResponseCompression CompressionType `protobuf:"varint,6,opt,name=response_compression,json=responseCompression,enum=grpc.testing.CompressionType" json:"response_compression,omitempty"` + // Whether server should return a given status + ResponseStatus *EchoStatus `protobuf:"bytes,7,opt,name=response_status,json=responseStatus" json:"response_status,omitempty"` +} + +func (m *SimpleRequest) Reset() { *m = SimpleRequest{} } +func (m *SimpleRequest) String() string { return proto.CompactTextString(m) } +func (*SimpleRequest) ProtoMessage() {} +func (*SimpleRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} } + +func (m *SimpleRequest) GetResponseType() PayloadType { + if m != nil { + return m.ResponseType + } + return PayloadType_COMPRESSABLE +} + +func (m *SimpleRequest) GetResponseSize() int32 { + if m != nil { + return m.ResponseSize + } + return 0 +} + +func (m *SimpleRequest) GetPayload() *Payload { + if m != nil { + return m.Payload + } + return nil +} + +func (m *SimpleRequest) GetFillUsername() bool { + if m != nil { + return m.FillUsername + } + return false +} + +func (m *SimpleRequest) GetFillOauthScope() bool { + if m != nil { + return m.FillOauthScope + } + return false +} + +func (m *SimpleRequest) GetResponseCompression() CompressionType { + if m != nil { + return m.ResponseCompression + } + return CompressionType_NONE +} + +func (m *SimpleRequest) GetResponseStatus() *EchoStatus { + if m != nil { + return m.ResponseStatus + } + return nil +} + +// Unary response, as configured by the request. +type SimpleResponse struct { + // Payload to increase message size. + Payload *Payload `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"` + // The user the request came from, for verifying authentication was + // successful when the client expected it. + Username string `protobuf:"bytes,2,opt,name=username" json:"username,omitempty"` + // OAuth scope. + OauthScope string `protobuf:"bytes,3,opt,name=oauth_scope,json=oauthScope" json:"oauth_scope,omitempty"` +} + +func (m *SimpleResponse) Reset() { *m = SimpleResponse{} } +func (m *SimpleResponse) String() string { return proto.CompactTextString(m) } +func (*SimpleResponse) ProtoMessage() {} +func (*SimpleResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{3} } + +func (m *SimpleResponse) GetPayload() *Payload { + if m != nil { + return m.Payload + } + return nil +} + +func (m *SimpleResponse) GetUsername() string { + if m != nil { + return m.Username + } + return "" +} + +func (m *SimpleResponse) GetOauthScope() string { + if m != nil { + return m.OauthScope + } + return "" +} + +// Client-streaming request. +type StreamingInputCallRequest struct { + // Optional input payload sent along with the request. + Payload *Payload `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"` +} + +func (m *StreamingInputCallRequest) Reset() { *m = StreamingInputCallRequest{} } +func (m *StreamingInputCallRequest) String() string { return proto.CompactTextString(m) } +func (*StreamingInputCallRequest) ProtoMessage() {} +func (*StreamingInputCallRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{4} } + +func (m *StreamingInputCallRequest) GetPayload() *Payload { + if m != nil { + return m.Payload + } + return nil +} + +// Client-streaming response. +type StreamingInputCallResponse struct { + // Aggregated size of payloads received from the client. + AggregatedPayloadSize int32 `protobuf:"varint,1,opt,name=aggregated_payload_size,json=aggregatedPayloadSize" json:"aggregated_payload_size,omitempty"` +} + +func (m *StreamingInputCallResponse) Reset() { *m = StreamingInputCallResponse{} } +func (m *StreamingInputCallResponse) String() string { return proto.CompactTextString(m) } +func (*StreamingInputCallResponse) ProtoMessage() {} +func (*StreamingInputCallResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{5} } + +func (m *StreamingInputCallResponse) GetAggregatedPayloadSize() int32 { + if m != nil { + return m.AggregatedPayloadSize + } + return 0 +} + +// Configuration for a particular response. +type ResponseParameters struct { + // Desired payload sizes in responses from the server. + // If response_type is COMPRESSABLE, this denotes the size before compression. + Size int32 `protobuf:"varint,1,opt,name=size" json:"size,omitempty"` + // Desired interval between consecutive responses in the response stream in + // microseconds. + IntervalUs int32 `protobuf:"varint,2,opt,name=interval_us,json=intervalUs" json:"interval_us,omitempty"` +} + +func (m *ResponseParameters) Reset() { *m = ResponseParameters{} } +func (m *ResponseParameters) String() string { return proto.CompactTextString(m) } +func (*ResponseParameters) ProtoMessage() {} +func (*ResponseParameters) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{6} } + +func (m *ResponseParameters) GetSize() int32 { + if m != nil { + return m.Size + } + return 0 +} + +func (m *ResponseParameters) GetIntervalUs() int32 { + if m != nil { + return m.IntervalUs + } + return 0 +} + +// Server-streaming request. +type StreamingOutputCallRequest struct { + // Desired payload type in the response from the server. + // If response_type is RANDOM, the payload from each response in the stream + // might be of different types. This is to simulate a mixed type of payload + // stream. + ResponseType PayloadType `protobuf:"varint,1,opt,name=response_type,json=responseType,enum=grpc.testing.PayloadType" json:"response_type,omitempty"` + // Configuration for each expected response message. + ResponseParameters []*ResponseParameters `protobuf:"bytes,2,rep,name=response_parameters,json=responseParameters" json:"response_parameters,omitempty"` + // Optional input payload sent along with the request. + Payload *Payload `protobuf:"bytes,3,opt,name=payload" json:"payload,omitempty"` + // Compression algorithm to be used by the server for the response (stream) + ResponseCompression CompressionType `protobuf:"varint,6,opt,name=response_compression,json=responseCompression,enum=grpc.testing.CompressionType" json:"response_compression,omitempty"` + // Whether server should return a given status + ResponseStatus *EchoStatus `protobuf:"bytes,7,opt,name=response_status,json=responseStatus" json:"response_status,omitempty"` +} + +func (m *StreamingOutputCallRequest) Reset() { *m = StreamingOutputCallRequest{} } +func (m *StreamingOutputCallRequest) String() string { return proto.CompactTextString(m) } +func (*StreamingOutputCallRequest) ProtoMessage() {} +func (*StreamingOutputCallRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{7} } + +func (m *StreamingOutputCallRequest) GetResponseType() PayloadType { + if m != nil { + return m.ResponseType + } + return PayloadType_COMPRESSABLE +} + +func (m *StreamingOutputCallRequest) GetResponseParameters() []*ResponseParameters { + if m != nil { + return m.ResponseParameters + } + return nil +} + +func (m *StreamingOutputCallRequest) GetPayload() *Payload { + if m != nil { + return m.Payload + } + return nil +} + +func (m *StreamingOutputCallRequest) GetResponseCompression() CompressionType { + if m != nil { + return m.ResponseCompression + } + return CompressionType_NONE +} + +func (m *StreamingOutputCallRequest) GetResponseStatus() *EchoStatus { + if m != nil { + return m.ResponseStatus + } + return nil +} + +// Server-streaming response, as configured by the request and parameters. +type StreamingOutputCallResponse struct { + // Payload to increase response size. + Payload *Payload `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"` +} + +func (m *StreamingOutputCallResponse) Reset() { *m = StreamingOutputCallResponse{} } +func (m *StreamingOutputCallResponse) String() string { return proto.CompactTextString(m) } +func (*StreamingOutputCallResponse) ProtoMessage() {} +func (*StreamingOutputCallResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{8} } + +func (m *StreamingOutputCallResponse) GetPayload() *Payload { + if m != nil { + return m.Payload + } + return nil +} + +// For reconnect interop test only. +// Client tells server what reconnection parameters it used. +type ReconnectParams struct { + MaxReconnectBackoffMs int32 `protobuf:"varint,1,opt,name=max_reconnect_backoff_ms,json=maxReconnectBackoffMs" json:"max_reconnect_backoff_ms,omitempty"` +} + +func (m *ReconnectParams) Reset() { *m = ReconnectParams{} } +func (m *ReconnectParams) String() string { return proto.CompactTextString(m) } +func (*ReconnectParams) ProtoMessage() {} +func (*ReconnectParams) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{9} } + +func (m *ReconnectParams) GetMaxReconnectBackoffMs() int32 { + if m != nil { + return m.MaxReconnectBackoffMs + } + return 0 +} + +// For reconnect interop test only. +// Server tells client whether its reconnects are following the spec and the +// reconnect backoffs it saw. +type ReconnectInfo struct { + Passed bool `protobuf:"varint,1,opt,name=passed" json:"passed,omitempty"` + BackoffMs []int32 `protobuf:"varint,2,rep,packed,name=backoff_ms,json=backoffMs" json:"backoff_ms,omitempty"` +} + +func (m *ReconnectInfo) Reset() { *m = ReconnectInfo{} } +func (m *ReconnectInfo) String() string { return proto.CompactTextString(m) } +func (*ReconnectInfo) ProtoMessage() {} +func (*ReconnectInfo) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{10} } + +func (m *ReconnectInfo) GetPassed() bool { + if m != nil { + return m.Passed + } + return false +} + +func (m *ReconnectInfo) GetBackoffMs() []int32 { + if m != nil { + return m.BackoffMs + } + return nil +} + +func init() { + proto.RegisterType((*Payload)(nil), "grpc.testing.Payload") + proto.RegisterType((*EchoStatus)(nil), "grpc.testing.EchoStatus") + proto.RegisterType((*SimpleRequest)(nil), "grpc.testing.SimpleRequest") + proto.RegisterType((*SimpleResponse)(nil), "grpc.testing.SimpleResponse") + proto.RegisterType((*StreamingInputCallRequest)(nil), "grpc.testing.StreamingInputCallRequest") + proto.RegisterType((*StreamingInputCallResponse)(nil), "grpc.testing.StreamingInputCallResponse") + proto.RegisterType((*ResponseParameters)(nil), "grpc.testing.ResponseParameters") + proto.RegisterType((*StreamingOutputCallRequest)(nil), "grpc.testing.StreamingOutputCallRequest") + proto.RegisterType((*StreamingOutputCallResponse)(nil), "grpc.testing.StreamingOutputCallResponse") + proto.RegisterType((*ReconnectParams)(nil), "grpc.testing.ReconnectParams") + proto.RegisterType((*ReconnectInfo)(nil), "grpc.testing.ReconnectInfo") + proto.RegisterEnum("grpc.testing.PayloadType", PayloadType_name, PayloadType_value) + proto.RegisterEnum("grpc.testing.CompressionType", CompressionType_name, CompressionType_value) +} + +func init() { proto.RegisterFile("messages.proto", fileDescriptor1) } + +var fileDescriptor1 = []byte{ + // 652 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x55, 0x4d, 0x6f, 0xd3, 0x40, + 0x10, 0xc5, 0xf9, 0xee, 0x24, 0x4d, 0xa3, 0x85, 0x82, 0x5b, 0x54, 0x11, 0x99, 0x4b, 0x54, 0x89, + 0x20, 0x05, 0x09, 0x24, 0x0e, 0xa0, 0xb4, 0x4d, 0x51, 0x50, 0x9a, 0x84, 0x75, 0x7b, 0xe1, 0x62, + 0x6d, 0x9c, 0x8d, 0x6b, 0x11, 0x7b, 0x8d, 0x77, 0x8d, 0x9a, 0x1e, 0xb8, 0xf3, 0x83, 0xb9, 0xa3, + 0x5d, 0x7f, 0xc4, 0x69, 0x7b, 0x68, 0xe1, 0xc2, 0x6d, 0xf7, 0xed, 0x9b, 0x97, 0x79, 0x33, 0xcf, + 0x0a, 0x34, 0x3d, 0xca, 0x39, 0x71, 0x28, 0xef, 0x06, 0x21, 0x13, 0x0c, 0x35, 0x9c, 0x30, 0x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0x34, 0x85, 0x27, 0x59, 0x93, 0x36, 0xf3, 0x82, 0x90, + 0x72, 0xee, 0x32, 0x5f, 0xaf, 0x28, 0xaf, 0x07, 0x9b, 0xcd, 0x1c, 0xaf, 0x09, 0xca, 0xef, 0xe3, + 0xb4, 0x34, 0xf7, 0x80, 0xfa, 0xb0, 0xb3, 0xb6, 0xad, 0x36, 0xa1, 0x57, 0x95, 0x33, 0x7d, 0x53, + 0x6c, 0xbd, 0x29, 0xdc, 0xcc, 0x46, 0xa2, 0xee, 0xc6, 0x4f, 0x68, 0xa6, 0xab, 0x88, 0xf1, 0xfc, + 0x98, 0xb4, 0x7b, 0x8d, 0x69, 0x1f, 0x6a, 0xd9, 0x84, 0xe2, 0x4d, 0x67, 0x77, 0xf4, 0x02, 0xea, + 0xf9, 0xc1, 0x14, 0xd5, 0x33, 0xb0, 0x6c, 0x28, 0xc6, 0x08, 0xf6, 0x4c, 0x11, 0x52, 0xe2, 0xb9, + 0xbe, 0x33, 0xf4, 0x83, 0x48, 0x1c, 0x93, 0xe5, 0x32, 0x8d, 0xc5, 0x43, 0x5b, 0x31, 0xce, 0x61, + 0xff, 0x2e, 0xb5, 0xc4, 0xd9, 0x5b, 0x78, 0x46, 0x1c, 0x27, 0xa4, 0x0e, 0x11, 0x74, 0x6e, 0x25, + 0x35, 0x71, 0x5e, 0xe2, 0xe0, 0xee, 0xae, 0x9f, 0x13, 0x69, 0x19, 0x1c, 0x63, 0x08, 0x28, 0xd5, + 0x98, 0x92, 0x90, 0x78, 0x54, 0xd0, 0x50, 0x65, 0x3e, 0x57, 0xaa, 0xce, 0xd2, 0xae, 0xeb, 0x0b, + 0x1a, 0xfe, 0x20, 0x32, 0x35, 0x49, 0x0a, 0x21, 0x85, 0x2e, 0xb8, 0xf1, 0xbb, 0x90, 0xeb, 0x70, + 0x12, 0x89, 0x1b, 0x86, 0xff, 0xf5, 0x3b, 0xf8, 0x02, 0x59, 0x4e, 0xac, 0x20, 0x6b, 0x55, 0x2f,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ce, 0x1e, 0x7c, 0x06, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/grpc/benchmark/grpc_testing/messages.proto b/vendor/google.golang.org/grpc/benchmark/grpc_testing/messages.proto new file mode 100644 index 0000000000..bd83f095fb --- /dev/null +++ b/vendor/google.golang.org/grpc/benchmark/grpc_testing/messages.proto @@ -0,0 +1,157 @@ +// Copyright 2016 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. + +// Message definitions to be used by integration test service definitions. + +syntax = "proto3"; + +package grpc.testing; + +// The type of payload that should be returned. +enum PayloadType { + // Compressable text format. + COMPRESSABLE = 0; + + // Uncompressable binary format. + UNCOMPRESSABLE = 1; + + // Randomly chosen from all other formats defined in this enum. + RANDOM = 2; +} + +// Compression algorithms +enum CompressionType { + // No compression + NONE = 0; + GZIP = 1; + DEFLATE = 2; +} + +// A block of data, to simply increase gRPC message size. +message Payload { + // The type of data in body. + PayloadType type = 1; + // Primary contents of payload. + bytes body = 2; +} + +// A protobuf representation for grpc status. This is used by test +// clients to specify a status that the server should attempt to return. +message EchoStatus { + int32 code = 1; + string message = 2; +} + +// Unary request. +message SimpleRequest { + // Desired payload type in the response from the server. + // If response_type is RANDOM, server randomly chooses one from other formats. + PayloadType response_type = 1; + + // Desired payload size in the response from the server. + // If response_type is COMPRESSABLE, this denotes the size before compression. + int32 response_size = 2; + + // Optional input payload sent along with the request. + Payload payload = 3; + + // Whether SimpleResponse should include username. + bool fill_username = 4; + + // Whether SimpleResponse should include OAuth scope. + bool fill_oauth_scope = 5; + + // Compression algorithm to be used by the server for the response (stream) + CompressionType response_compression = 6; + + // Whether server should return a given status + EchoStatus response_status = 7; +} + +// Unary response, as configured by the request. +message SimpleResponse { + // Payload to increase message size. + Payload payload = 1; + // The user the request came from, for verifying authentication was + // successful when the client expected it. + string username = 2; + // OAuth scope. + string oauth_scope = 3; +} + +// Client-streaming request. +message StreamingInputCallRequest { + // Optional input payload sent along with the request. + Payload payload = 1; + + // Not expecting any payload from the response. +} + +// Client-streaming response. +message StreamingInputCallResponse { + // Aggregated size of payloads received from the client. + int32 aggregated_payload_size = 1; +} + +// Configuration for a particular response. +message ResponseParameters { + // Desired payload sizes in responses from the server. + // If response_type is COMPRESSABLE, this denotes the size before compression. + int32 size = 1; + + // Desired interval between consecutive responses in the response stream in + // microseconds. + int32 interval_us = 2; +} + +// Server-streaming request. +message StreamingOutputCallRequest { + // Desired payload type in the response from the server. + // If response_type is RANDOM, the payload from each response in the stream + // might be of different types. This is to simulate a mixed type of payload + // stream. + PayloadType response_type = 1; + + // Configuration for each expected response message. + repeated ResponseParameters response_parameters = 2; + + // Optional input payload sent along with the request. + Payload payload = 3; + + // Compression algorithm to be used by the server for the response (stream) + CompressionType response_compression = 6; + + // Whether server should return a given status + EchoStatus response_status = 7; +} + +// Server-streaming response, as configured by the request and parameters. +message StreamingOutputCallResponse { + // Payload to increase response size. + Payload payload = 1; +} + +// For reconnect interop test only. +// Client tells server what reconnection parameters it used. +message ReconnectParams { + int32 max_reconnect_backoff_ms = 1; +} + +// For reconnect interop test only. +// Server tells client whether its reconnects are following the spec and the +// reconnect backoffs it saw. +message ReconnectInfo { + bool passed = 1; + repeated int32 backoff_ms = 2; +} diff --git a/vendor/google.golang.org/grpc/benchmark/grpc_testing/payloads.pb.go b/vendor/google.golang.org/grpc/benchmark/grpc_testing/payloads.pb.go new file mode 100644 index 0000000000..d70d1f7452 --- /dev/null +++ b/vendor/google.golang.org/grpc/benchmark/grpc_testing/payloads.pb.go @@ -0,0 +1,250 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: payloads.proto + +package grpc_testing + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +type ByteBufferParams struct { + ReqSize int32 `protobuf:"varint,1,opt,name=req_size,json=reqSize" json:"req_size,omitempty"` + RespSize int32 `protobuf:"varint,2,opt,name=resp_size,json=respSize" json:"resp_size,omitempty"` +} + +func (m *ByteBufferParams) Reset() { *m = ByteBufferParams{} } +func (m *ByteBufferParams) String() string { return proto.CompactTextString(m) } +func (*ByteBufferParams) ProtoMessage() {} +func (*ByteBufferParams) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} } + +func (m *ByteBufferParams) GetReqSize() int32 { + if m != nil { + return m.ReqSize + } + return 0 +} + +func (m *ByteBufferParams) GetRespSize() int32 { + if m != nil { + return m.RespSize + } + return 0 +} + +type SimpleProtoParams struct { + ReqSize int32 `protobuf:"varint,1,opt,name=req_size,json=reqSize" json:"req_size,omitempty"` + RespSize int32 `protobuf:"varint,2,opt,name=resp_size,json=respSize" json:"resp_size,omitempty"` +} + +func (m *SimpleProtoParams) Reset() { *m = SimpleProtoParams{} } +func (m *SimpleProtoParams) String() string { return proto.CompactTextString(m) } +func (*SimpleProtoParams) ProtoMessage() {} +func (*SimpleProtoParams) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{1} } + +func (m *SimpleProtoParams) GetReqSize() int32 { + if m != nil { + return m.ReqSize + } + return 0 +} + +func (m *SimpleProtoParams) GetRespSize() int32 { + if m != nil { + return m.RespSize + } + return 0 +} + +type ComplexProtoParams struct { +} + +func (m *ComplexProtoParams) Reset() { *m = ComplexProtoParams{} } +func (m *ComplexProtoParams) String() string { return proto.CompactTextString(m) } +func (*ComplexProtoParams) ProtoMessage() {} +func (*ComplexProtoParams) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{2} } + +type PayloadConfig struct { + // Types that are valid to be assigned to Payload: + // *PayloadConfig_BytebufParams + // *PayloadConfig_SimpleParams + // *PayloadConfig_ComplexParams + Payload isPayloadConfig_Payload `protobuf_oneof:"payload"` +} + +func (m *PayloadConfig) Reset() { *m = PayloadConfig{} } +func (m *PayloadConfig) String() string { return proto.CompactTextString(m) } +func (*PayloadConfig) ProtoMessage() {} +func (*PayloadConfig) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{3} } + +type isPayloadConfig_Payload interface { + isPayloadConfig_Payload() +} + +type PayloadConfig_BytebufParams struct { + BytebufParams *ByteBufferParams `protobuf:"bytes,1,opt,name=bytebuf_params,json=bytebufParams,oneof"` +} +type PayloadConfig_SimpleParams struct { + SimpleParams *SimpleProtoParams `protobuf:"bytes,2,opt,name=simple_params,json=simpleParams,oneof"` +} +type PayloadConfig_ComplexParams struct { + ComplexParams *ComplexProtoParams `protobuf:"bytes,3,opt,name=complex_params,json=complexParams,oneof"` +} + +func (*PayloadConfig_BytebufParams) isPayloadConfig_Payload() {} +func (*PayloadConfig_SimpleParams) isPayloadConfig_Payload() {} +func (*PayloadConfig_ComplexParams) isPayloadConfig_Payload() {} + +func (m *PayloadConfig) GetPayload() isPayloadConfig_Payload { + if m != nil { + return m.Payload + } + return nil +} + +func (m *PayloadConfig) GetBytebufParams() *ByteBufferParams { + if x, ok := m.GetPayload().(*PayloadConfig_BytebufParams); ok { + return x.BytebufParams + } + return nil +} + +func (m *PayloadConfig) GetSimpleParams() *SimpleProtoParams { + if x, ok := m.GetPayload().(*PayloadConfig_SimpleParams); ok { + return x.SimpleParams + } + return nil +} + +func (m *PayloadConfig) GetComplexParams() *ComplexProtoParams { + if x, ok := m.GetPayload().(*PayloadConfig_ComplexParams); ok { + return x.ComplexParams + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*PayloadConfig) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _PayloadConfig_OneofMarshaler, _PayloadConfig_OneofUnmarshaler, _PayloadConfig_OneofSizer, []interface{}{ + (*PayloadConfig_BytebufParams)(nil), + (*PayloadConfig_SimpleParams)(nil), + (*PayloadConfig_ComplexParams)(nil), + } +} + +func _PayloadConfig_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*PayloadConfig) + // payload + switch x := m.Payload.(type) { + case *PayloadConfig_BytebufParams: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BytebufParams); err != nil { + return err + } + case *PayloadConfig_SimpleParams: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.SimpleParams); err != nil { + return err + } + case *PayloadConfig_ComplexParams: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ComplexParams); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("PayloadConfig.Payload has unexpected type %T", x) + } + return nil +} + +func _PayloadConfig_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*PayloadConfig) + switch tag { + case 1: // payload.bytebuf_params + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ByteBufferParams) + err := b.DecodeMessage(msg) + m.Payload = &PayloadConfig_BytebufParams{msg} + return true, err + case 2: // payload.simple_params + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SimpleProtoParams) + err := b.DecodeMessage(msg) + m.Payload = &PayloadConfig_SimpleParams{msg} + return true, err + case 3: // payload.complex_params + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ComplexProtoParams) + err := b.DecodeMessage(msg) + m.Payload = &PayloadConfig_ComplexParams{msg} + return true, err + default: + return false, nil + } +} + +func _PayloadConfig_OneofSizer(msg proto.Message) (n int) { + m := msg.(*PayloadConfig) + // payload + switch x := m.Payload.(type) { + case *PayloadConfig_BytebufParams: + s := proto.Size(x.BytebufParams) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *PayloadConfig_SimpleParams: + s := proto.Size(x.SimpleParams) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *PayloadConfig_ComplexParams: + s := proto.Size(x.ComplexParams) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +func init() { + proto.RegisterType((*ByteBufferParams)(nil), "grpc.testing.ByteBufferParams") + proto.RegisterType((*SimpleProtoParams)(nil), "grpc.testing.SimpleProtoParams") + proto.RegisterType((*ComplexProtoParams)(nil), "grpc.testing.ComplexProtoParams") + proto.RegisterType((*PayloadConfig)(nil), "grpc.testing.PayloadConfig") +} + +func init() { proto.RegisterFile("payloads.proto", fileDescriptor2) } + +var fileDescriptor2 = []byte{ + // 254 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2b, 0x48, 0xac, 0xcc, + 0xc9, 0x4f, 0x4c, 0x29, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x49, 0x2f, 0x2a, 0x48, + 0xd6, 0x2b, 0x49, 0x2d, 0x2e, 0xc9, 0xcc, 0x4b, 0x57, 0xf2, 0xe2, 0x12, 0x70, 0xaa, 0x2c, 0x49, + 0x75, 0x2a, 0x4d, 0x4b, 0x4b, 0x2d, 0x0a, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0x16, 0x92, 0xe4, 0xe2, + 0x28, 0x4a, 0x2d, 0x8c, 0x2f, 0xce, 0xac, 0x4a, 0x95, 0x60, 0x54, 0x60, 0xd4, 0x60, 0x0d, 0x62, + 0x2f, 0x4a, 0x2d, 0x0c, 0xce, 0xac, 0x4a, 0x15, 0x92, 0xe6, 0xe2, 0x2c, 0x4a, 0x2d, 0x2e, 0x80, + 0xc8, 0x31, 0x81, 0xe5, 0x38, 0x40, 0x02, 0x20, 0x49, 0x25, 0x6f, 0x2e, 0xc1, 0xe0, 0xcc, 0xdc, + 0x82, 0x9c, 0xd4, 0x00, 0x90, 0x45, 0x14, 0x1a, 0x26, 0xc2, 0x25, 0xe4, 0x9c, 0x0f, 0x32, 0xac, + 0x02, 0xc9, 0x34, 0xa5, 0x6f, 0x8c, 0x5c, 0xbc, 0x01, 0x10, 0xff, 0x38, 0xe7, 0xe7, 0xa5, 0x65, + 0xa6, 0x0b, 0xb9, 0x73, 0xf1, 0x25, 0x55, 0x96, 0xa4, 0x26, 0x95, 0xa6, 0xc5, 0x17, 0x80, 0xd5, + 0x80, 0x6d, 0xe1, 0x36, 0x92, 0xd3, 0x43, 0xf6, 0xa7, 0x1e, 0xba, 0x27, 0x3d, 0x18, 0x82, 0x78, + 0xa1, 0xfa, 0xa0, 0x0e, 0x75, 0xe3, 0xe2, 0x2d, 0x06, 0xbb, 0x1e, 0x66, 0x0e, 0x13, 0xd8, 0x1c, + 0x79, 0x54, 0x73, 0x30, 0x3c, 0xe8, 0xc1, 0x10, 0xc4, 0x03, 0xd1, 0x07, 0x35, 0xc7, 0x93, 0x8b, + 0x2f, 0x19, 0xe2, 0x70, 0x98, 0x41, 0xcc, 0x60, 0x83, 0x14, 0x50, 0x0d, 0xc2, 0xf4, 0x1c, 0xc8, + 0x49, 0x50, 0x9d, 0x10, 0x01, 0x27, 0x4e, 0x2e, 0x76, 0x68, 0xe4, 0x25, 0xb1, 0x81, 0x23, 0xcf, + 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0xb0, 0x8c, 0x18, 0x4e, 0xce, 0x01, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/grpc/benchmark/grpc_testing/payloads.proto b/vendor/google.golang.org/grpc/benchmark/grpc_testing/payloads.proto new file mode 100644 index 0000000000..5d4871f5f9 --- /dev/null +++ b/vendor/google.golang.org/grpc/benchmark/grpc_testing/payloads.proto @@ -0,0 +1,40 @@ +// Copyright 2016 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. + +syntax = "proto3"; + +package grpc.testing; + +message ByteBufferParams { + int32 req_size = 1; + int32 resp_size = 2; +} + +message SimpleProtoParams { + int32 req_size = 1; + int32 resp_size = 2; +} + +message ComplexProtoParams { + // TODO (vpai): Fill this in once the details of complex, representative + // protos are decided +} + +message PayloadConfig { + oneof payload { + ByteBufferParams bytebuf_params = 1; + SimpleProtoParams simple_params = 2; + ComplexProtoParams complex_params = 3; + } +} diff --git a/vendor/google.golang.org/grpc/benchmark/grpc_testing/services.pb.go b/vendor/google.golang.org/grpc/benchmark/grpc_testing/services.pb.go new file mode 100644 index 0000000000..50e3505957 --- /dev/null +++ b/vendor/google.golang.org/grpc/benchmark/grpc_testing/services.pb.go @@ -0,0 +1,442 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: services.proto + +package grpc_testing + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// 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 + +// Client API for BenchmarkService service + +type BenchmarkServiceClient interface { + // One request followed by one response. + // The server returns the client payload as-is. + UnaryCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (*SimpleResponse, error) + // One request followed by one response. + // The server returns the client payload as-is. + StreamingCall(ctx context.Context, opts ...grpc.CallOption) (BenchmarkService_StreamingCallClient, error) +} + +type benchmarkServiceClient struct { + cc *grpc.ClientConn +} + +func NewBenchmarkServiceClient(cc *grpc.ClientConn) BenchmarkServiceClient { + return &benchmarkServiceClient{cc} +} + +func (c *benchmarkServiceClient) UnaryCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (*SimpleResponse, error) { + out := new(SimpleResponse) + err := grpc.Invoke(ctx, "/grpc.testing.BenchmarkService/UnaryCall", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *benchmarkServiceClient) StreamingCall(ctx context.Context, opts ...grpc.CallOption) (BenchmarkService_StreamingCallClient, error) { + stream, err := grpc.NewClientStream(ctx, &_BenchmarkService_serviceDesc.Streams[0], c.cc, "/grpc.testing.BenchmarkService/StreamingCall", opts...) + if err != nil { + return nil, err + } + x := &benchmarkServiceStreamingCallClient{stream} + return x, nil +} + +type BenchmarkService_StreamingCallClient interface { + Send(*SimpleRequest) error + Recv() (*SimpleResponse, error) + grpc.ClientStream +} + +type benchmarkServiceStreamingCallClient struct { + grpc.ClientStream +} + +func (x *benchmarkServiceStreamingCallClient) Send(m *SimpleRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *benchmarkServiceStreamingCallClient) Recv() (*SimpleResponse, error) { + m := new(SimpleResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// Server API for BenchmarkService service + +type BenchmarkServiceServer interface { + // One request followed by one response. + // The server returns the client payload as-is. + UnaryCall(context.Context, *SimpleRequest) (*SimpleResponse, error) + // One request followed by one response. + // The server returns the client payload as-is. + StreamingCall(BenchmarkService_StreamingCallServer) error +} + +func RegisterBenchmarkServiceServer(s *grpc.Server, srv BenchmarkServiceServer) { + s.RegisterService(&_BenchmarkService_serviceDesc, srv) +} + +func _BenchmarkService_UnaryCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SimpleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BenchmarkServiceServer).UnaryCall(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.testing.BenchmarkService/UnaryCall", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BenchmarkServiceServer).UnaryCall(ctx, req.(*SimpleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BenchmarkService_StreamingCall_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(BenchmarkServiceServer).StreamingCall(&benchmarkServiceStreamingCallServer{stream}) +} + +type BenchmarkService_StreamingCallServer interface { + Send(*SimpleResponse) error + Recv() (*SimpleRequest, error) + grpc.ServerStream +} + +type benchmarkServiceStreamingCallServer struct { + grpc.ServerStream +} + +func (x *benchmarkServiceStreamingCallServer) Send(m *SimpleResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *benchmarkServiceStreamingCallServer) Recv() (*SimpleRequest, error) { + m := new(SimpleRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +var _BenchmarkService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "grpc.testing.BenchmarkService", + HandlerType: (*BenchmarkServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UnaryCall", + Handler: _BenchmarkService_UnaryCall_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "StreamingCall", + Handler: _BenchmarkService_StreamingCall_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "services.proto", +} + +// Client API for WorkerService service + +type WorkerServiceClient interface { + // Start server with specified workload. + // First request sent specifies the ServerConfig followed by ServerStatus + // response. After that, a "Mark" can be sent anytime to request the latest + // stats. Closing the stream will initiate shutdown of the test server + // and once the shutdown has finished, the OK status is sent to terminate + // this RPC. + RunServer(ctx context.Context, opts ...grpc.CallOption) (WorkerService_RunServerClient, error) + // Start client with specified workload. + // First request sent specifies the ClientConfig followed by ClientStatus + // response. After that, a "Mark" can be sent anytime to request the latest + // stats. Closing the stream will initiate shutdown of the test client + // and once the shutdown has finished, the OK status is sent to terminate + // this RPC. + RunClient(ctx context.Context, opts ...grpc.CallOption) (WorkerService_RunClientClient, error) + // Just return the core count - unary call + CoreCount(ctx context.Context, in *CoreRequest, opts ...grpc.CallOption) (*CoreResponse, error) + // Quit this worker + QuitWorker(ctx context.Context, in *Void, opts ...grpc.CallOption) (*Void, error) +} + +type workerServiceClient struct { + cc *grpc.ClientConn +} + +func NewWorkerServiceClient(cc *grpc.ClientConn) WorkerServiceClient { + return &workerServiceClient{cc} +} + +func (c *workerServiceClient) RunServer(ctx context.Context, opts ...grpc.CallOption) (WorkerService_RunServerClient, error) { + stream, err := grpc.NewClientStream(ctx, &_WorkerService_serviceDesc.Streams[0], c.cc, "/grpc.testing.WorkerService/RunServer", opts...) + if err != nil { + return nil, err + } + x := &workerServiceRunServerClient{stream} + return x, nil +} + +type WorkerService_RunServerClient interface { + Send(*ServerArgs) error + Recv() (*ServerStatus, error) + grpc.ClientStream +} + +type workerServiceRunServerClient struct { + grpc.ClientStream +} + +func (x *workerServiceRunServerClient) Send(m *ServerArgs) error { + return x.ClientStream.SendMsg(m) +} + +func (x *workerServiceRunServerClient) Recv() (*ServerStatus, error) { + m := new(ServerStatus) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *workerServiceClient) RunClient(ctx context.Context, opts ...grpc.CallOption) (WorkerService_RunClientClient, error) { + stream, err := grpc.NewClientStream(ctx, &_WorkerService_serviceDesc.Streams[1], c.cc, "/grpc.testing.WorkerService/RunClient", opts...) + if err != nil { + return nil, err + } + x := &workerServiceRunClientClient{stream} + return x, nil +} + +type WorkerService_RunClientClient interface { + Send(*ClientArgs) error + Recv() (*ClientStatus, error) + grpc.ClientStream +} + +type workerServiceRunClientClient struct { + grpc.ClientStream +} + +func (x *workerServiceRunClientClient) Send(m *ClientArgs) error { + return x.ClientStream.SendMsg(m) +} + +func (x *workerServiceRunClientClient) Recv() (*ClientStatus, error) { + m := new(ClientStatus) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *workerServiceClient) CoreCount(ctx context.Context, in *CoreRequest, opts ...grpc.CallOption) (*CoreResponse, error) { + out := new(CoreResponse) + err := grpc.Invoke(ctx, "/grpc.testing.WorkerService/CoreCount", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *workerServiceClient) QuitWorker(ctx context.Context, in *Void, opts ...grpc.CallOption) (*Void, error) { + out := new(Void) + err := grpc.Invoke(ctx, "/grpc.testing.WorkerService/QuitWorker", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for WorkerService service + +type WorkerServiceServer interface { + // Start server with specified workload. + // First request sent specifies the ServerConfig followed by ServerStatus + // response. After that, a "Mark" can be sent anytime to request the latest + // stats. Closing the stream will initiate shutdown of the test server + // and once the shutdown has finished, the OK status is sent to terminate + // this RPC. + RunServer(WorkerService_RunServerServer) error + // Start client with specified workload. + // First request sent specifies the ClientConfig followed by ClientStatus + // response. After that, a "Mark" can be sent anytime to request the latest + // stats. Closing the stream will initiate shutdown of the test client + // and once the shutdown has finished, the OK status is sent to terminate + // this RPC. + RunClient(WorkerService_RunClientServer) error + // Just return the core count - unary call + CoreCount(context.Context, *CoreRequest) (*CoreResponse, error) + // Quit this worker + QuitWorker(context.Context, *Void) (*Void, error) +} + +func RegisterWorkerServiceServer(s *grpc.Server, srv WorkerServiceServer) { + s.RegisterService(&_WorkerService_serviceDesc, srv) +} + +func _WorkerService_RunServer_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(WorkerServiceServer).RunServer(&workerServiceRunServerServer{stream}) +} + +type WorkerService_RunServerServer interface { + Send(*ServerStatus) error + Recv() (*ServerArgs, error) + grpc.ServerStream +} + +type workerServiceRunServerServer struct { + grpc.ServerStream +} + +func (x *workerServiceRunServerServer) Send(m *ServerStatus) error { + return x.ServerStream.SendMsg(m) +} + +func (x *workerServiceRunServerServer) Recv() (*ServerArgs, error) { + m := new(ServerArgs) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _WorkerService_RunClient_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(WorkerServiceServer).RunClient(&workerServiceRunClientServer{stream}) +} + +type WorkerService_RunClientServer interface { + Send(*ClientStatus) error + Recv() (*ClientArgs, error) + grpc.ServerStream +} + +type workerServiceRunClientServer struct { + grpc.ServerStream +} + +func (x *workerServiceRunClientServer) Send(m *ClientStatus) error { + return x.ServerStream.SendMsg(m) +} + +func (x *workerServiceRunClientServer) Recv() (*ClientArgs, error) { + m := new(ClientArgs) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _WorkerService_CoreCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CoreRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WorkerServiceServer).CoreCount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.testing.WorkerService/CoreCount", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WorkerServiceServer).CoreCount(ctx, req.(*CoreRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WorkerService_QuitWorker_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Void) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WorkerServiceServer).QuitWorker(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.testing.WorkerService/QuitWorker", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WorkerServiceServer).QuitWorker(ctx, req.(*Void)) + } + return interceptor(ctx, in, info, handler) +} + +var _WorkerService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "grpc.testing.WorkerService", + HandlerType: (*WorkerServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CoreCount", + Handler: _WorkerService_CoreCount_Handler, + }, + { + MethodName: "QuitWorker", + Handler: _WorkerService_QuitWorker_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "RunServer", + Handler: _WorkerService_RunServer_Handler, + ServerStreams: true, + ClientStreams: true, + }, + { + StreamName: "RunClient", + Handler: _WorkerService_RunClient_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "services.proto", +} + +func init() { proto.RegisterFile("services.proto", fileDescriptor3) } + +var fileDescriptor3 = []byte{ + // 255 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x91, 0xc1, 0x4a, 0xc4, 0x30, + 0x10, 0x86, 0xa9, 0x07, 0xa1, 0xc1, 0x2e, 0x92, 0x93, 0x46, 0x1f, 0xc0, 0x53, 0x91, 0xd5, 0x17, + 0x70, 0x8b, 0x1e, 0x05, 0xb7, 0xa8, 0xe7, 0x58, 0x87, 0x1a, 0x36, 0xcd, 0xd4, 0x99, 0x89, 0xe0, + 0x93, 0xf8, 0x0e, 0x3e, 0xa5, 0xec, 0x66, 0x57, 0xd6, 0x92, 0x9b, 0xc7, 0xf9, 0xbf, 0xe1, 0x23, + 0x7f, 0x46, 0xcd, 0x18, 0xe8, 0xc3, 0x75, 0xc0, 0xf5, 0x48, 0x28, 0xa8, 0x8f, 0x7a, 0x1a, 0xbb, + 0x5a, 0x80, 0xc5, 0x85, 0xde, 0xcc, 0x06, 0x60, 0xb6, 0xfd, 0x8e, 0x9a, 0xaa, 0xc3, 0x20, 0x84, + 0x3e, 0x8d, 0xf3, 0xef, 0x42, 0x1d, 0x2f, 0x20, 0x74, 0x6f, 0x83, 0xa5, 0x55, 0x9b, 0x44, 0xfa, + 0x4e, 0x95, 0x8f, 0xc1, 0xd2, 0x67, 0x63, 0xbd, 0xd7, 0x67, 0xf5, 0xbe, 0xaf, 0x6e, 0xdd, 0x30, + 0x7a, 0x58, 0xc2, 0x7b, 0x04, 0x16, 0x73, 0x9e, 0x87, 0x3c, 0x62, 0x60, 0xd0, 0xf7, 0xaa, 0x6a, + 0x85, 0xc0, 0x0e, 0x2e, 0xf4, 0xff, 0x74, 0x5d, 0x14, 0x97, 0xc5, 0xfc, 0xeb, 0x40, 0x55, 0xcf, + 0x48, 0x2b, 0xa0, 0xdd, 0x4b, 0x6f, 0x55, 0xb9, 0x8c, 0x61, 0x3d, 0x01, 0xe9, 0x93, 0x89, 0x60, + 0x93, 0xde, 0x50, 0xcf, 0xc6, 0xe4, 0x48, 0x2b, 0x56, 0x22, 0xaf, 0xc5, 0x5b, 0x4d, 0xe3, 0x1d, + 0x04, 0x99, 0x6a, 0x52, 0x9a, 0xd3, 0x24, 0xb2, 0xa7, 0x59, 0xa8, 0xb2, 0x41, 0x82, 0x06, 0x63, + 0x10, 0x7d, 0x3a, 0x59, 0x46, 0xfa, 0x6d, 0x6a, 0x72, 0x68, 0xfb, 0x67, 0xd7, 0x4a, 0x3d, 0x44, + 0x27, 0xa9, 0xa6, 0xd6, 0x7f, 0x37, 0x9f, 0xd0, 0xbd, 0x9a, 0x4c, 0xf6, 0x72, 0xb8, 0xb9, 0xe6, + 0xd5, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3b, 0x84, 0x02, 0xe3, 0x0c, 0x02, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/grpc/benchmark/grpc_testing/services.proto b/vendor/google.golang.org/grpc/benchmark/grpc_testing/services.proto new file mode 100644 index 0000000000..f4e7907824 --- /dev/null +++ b/vendor/google.golang.org/grpc/benchmark/grpc_testing/services.proto @@ -0,0 +1,56 @@ +// Copyright 2016 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. + +// An integration test service that covers all the method signature permutations +// of unary/streaming requests/responses. +syntax = "proto3"; + +import "messages.proto"; +import "control.proto"; + +package grpc.testing; + +service BenchmarkService { + // One request followed by one response. + // The server returns the client payload as-is. + rpc UnaryCall(SimpleRequest) returns (SimpleResponse); + + // One request followed by one response. + // The server returns the client payload as-is. + rpc StreamingCall(stream SimpleRequest) returns (stream SimpleResponse); +} + +service WorkerService { + // Start server with specified workload. + // First request sent specifies the ServerConfig followed by ServerStatus + // response. After that, a "Mark" can be sent anytime to request the latest + // stats. Closing the stream will initiate shutdown of the test server + // and once the shutdown has finished, the OK status is sent to terminate + // this RPC. + rpc RunServer(stream ServerArgs) returns (stream ServerStatus); + + // Start client with specified workload. + // First request sent specifies the ClientConfig followed by ClientStatus + // response. After that, a "Mark" can be sent anytime to request the latest + // stats. Closing the stream will initiate shutdown of the test client + // and once the shutdown has finished, the OK status is sent to terminate + // this RPC. + rpc RunClient(stream ClientArgs) returns (stream ClientStatus); + + // Just return the core count - unary call + rpc CoreCount(CoreRequest) returns (CoreResponse); + + // Quit this worker + rpc QuitWorker(Void) returns (Void); +} diff --git a/vendor/google.golang.org/grpc/benchmark/grpc_testing/stats.pb.go b/vendor/google.golang.org/grpc/benchmark/grpc_testing/stats.pb.go new file mode 100644 index 0000000000..d69cb7410e --- /dev/null +++ b/vendor/google.golang.org/grpc/benchmark/grpc_testing/stats.pb.go @@ -0,0 +1,208 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: stats.proto + +package grpc_testing + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +type ServerStats struct { + // wall clock time change in seconds since last reset + TimeElapsed float64 `protobuf:"fixed64,1,opt,name=time_elapsed,json=timeElapsed" json:"time_elapsed,omitempty"` + // change in user time (in seconds) used by the server since last reset + TimeUser float64 `protobuf:"fixed64,2,opt,name=time_user,json=timeUser" json:"time_user,omitempty"` + // change in server time (in seconds) used by the server process and all + // threads since last reset + TimeSystem float64 `protobuf:"fixed64,3,opt,name=time_system,json=timeSystem" json:"time_system,omitempty"` +} + +func (m *ServerStats) Reset() { *m = ServerStats{} } +func (m *ServerStats) String() string { return proto.CompactTextString(m) } +func (*ServerStats) ProtoMessage() {} +func (*ServerStats) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{0} } + +func (m *ServerStats) GetTimeElapsed() float64 { + if m != nil { + return m.TimeElapsed + } + return 0 +} + +func (m *ServerStats) GetTimeUser() float64 { + if m != nil { + return m.TimeUser + } + return 0 +} + +func (m *ServerStats) GetTimeSystem() float64 { + if m != nil { + return m.TimeSystem + } + return 0 +} + +// Histogram params based on grpc/support/histogram.c +type HistogramParams struct { + Resolution float64 `protobuf:"fixed64,1,opt,name=resolution" json:"resolution,omitempty"` + MaxPossible float64 `protobuf:"fixed64,2,opt,name=max_possible,json=maxPossible" json:"max_possible,omitempty"` +} + +func (m *HistogramParams) Reset() { *m = HistogramParams{} } +func (m *HistogramParams) String() string { return proto.CompactTextString(m) } +func (*HistogramParams) ProtoMessage() {} +func (*HistogramParams) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{1} } + +func (m *HistogramParams) GetResolution() float64 { + if m != nil { + return m.Resolution + } + return 0 +} + +func (m *HistogramParams) GetMaxPossible() float64 { + if m != nil { + return m.MaxPossible + } + return 0 +} + +// Histogram data based on grpc/support/histogram.c +type HistogramData struct { + Bucket []uint32 `protobuf:"varint,1,rep,packed,name=bucket" json:"bucket,omitempty"` + MinSeen float64 `protobuf:"fixed64,2,opt,name=min_seen,json=minSeen" json:"min_seen,omitempty"` + MaxSeen float64 `protobuf:"fixed64,3,opt,name=max_seen,json=maxSeen" json:"max_seen,omitempty"` + Sum float64 `protobuf:"fixed64,4,opt,name=sum" json:"sum,omitempty"` + SumOfSquares float64 `protobuf:"fixed64,5,opt,name=sum_of_squares,json=sumOfSquares" json:"sum_of_squares,omitempty"` + Count float64 `protobuf:"fixed64,6,opt,name=count" json:"count,omitempty"` +} + +func (m *HistogramData) Reset() { *m = HistogramData{} } +func (m *HistogramData) String() string { return proto.CompactTextString(m) } +func (*HistogramData) ProtoMessage() {} +func (*HistogramData) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{2} } + +func (m *HistogramData) GetBucket() []uint32 { + if m != nil { + return m.Bucket + } + return nil +} + +func (m *HistogramData) GetMinSeen() float64 { + if m != nil { + return m.MinSeen + } + return 0 +} + +func (m *HistogramData) GetMaxSeen() float64 { + if m != nil { + return m.MaxSeen + } + return 0 +} + +func (m *HistogramData) GetSum() float64 { + if m != nil { + return m.Sum + } + return 0 +} + +func (m *HistogramData) GetSumOfSquares() float64 { + if m != nil { + return m.SumOfSquares + } + return 0 +} + +func (m *HistogramData) GetCount() float64 { + if m != nil { + return m.Count + } + return 0 +} + +type ClientStats struct { + // Latency histogram. Data points are in nanoseconds. + Latencies *HistogramData `protobuf:"bytes,1,opt,name=latencies" json:"latencies,omitempty"` + // See ServerStats for details. + TimeElapsed float64 `protobuf:"fixed64,2,opt,name=time_elapsed,json=timeElapsed" json:"time_elapsed,omitempty"` + TimeUser float64 `protobuf:"fixed64,3,opt,name=time_user,json=timeUser" json:"time_user,omitempty"` + TimeSystem float64 `protobuf:"fixed64,4,opt,name=time_system,json=timeSystem" json:"time_system,omitempty"` +} + +func (m *ClientStats) Reset() { *m = ClientStats{} } +func (m *ClientStats) String() string { return proto.CompactTextString(m) } +func (*ClientStats) ProtoMessage() {} +func (*ClientStats) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{3} } + +func (m *ClientStats) GetLatencies() *HistogramData { + if m != nil { + return m.Latencies + } + return nil +} + +func (m *ClientStats) GetTimeElapsed() float64 { + if m != nil { + return m.TimeElapsed + } + return 0 +} + +func (m *ClientStats) GetTimeUser() float64 { + if m != nil { + return m.TimeUser + } + return 0 +} + +func (m *ClientStats) GetTimeSystem() float64 { + if m != nil { + return m.TimeSystem + } + return 0 +} + +func init() { + proto.RegisterType((*ServerStats)(nil), "grpc.testing.ServerStats") + proto.RegisterType((*HistogramParams)(nil), "grpc.testing.HistogramParams") + proto.RegisterType((*HistogramData)(nil), "grpc.testing.HistogramData") + proto.RegisterType((*ClientStats)(nil), "grpc.testing.ClientStats") +} + +func init() { proto.RegisterFile("stats.proto", fileDescriptor4) } + +var fileDescriptor4 = []byte{ + // 341 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0xc1, 0x4a, 0xeb, 0x40, + 0x14, 0x86, 0x49, 0xd3, 0xf6, 0xb6, 0x27, 0xed, 0xbd, 0x97, 0x41, 0x24, 0x52, 0xd0, 0x1a, 0x5c, + 0x74, 0x95, 0x85, 0xae, 0x5c, 0xab, 0xe0, 0xce, 0xd2, 0xe8, 0x3a, 0x4c, 0xe3, 0x69, 0x19, 0xcc, + 0xcc, 0xc4, 0x39, 0x33, 0x12, 0x1f, 0x49, 0x7c, 0x49, 0xc9, 0x24, 0x68, 0x55, 0xd0, 0x5d, 0xe6, + 0xfb, 0x7e, 0xe6, 0xe4, 0xe4, 0x0f, 0x44, 0x64, 0xb9, 0xa5, 0xb4, 0x32, 0xda, 0x6a, 0x36, 0xd9, + 0x9a, 0xaa, 0x48, 0x2d, 0x92, 0x15, 0x6a, 0x9b, 0x28, 0x88, 0x32, 0x34, 0x4f, 0x68, 0xb2, 0x26, + 0xc2, 0x8e, 0x61, 0x62, 0x85, 0xc4, 0x1c, 0x4b, 0x5e, 0x11, 0xde, 0xc7, 0xc1, 0x3c, 0x58, 0x04, + 0xab, 0xa8, 0x61, 0x57, 0x2d, 0x62, 0x33, 0x18, 0xfb, 0x88, 0x23, 0x34, 0x71, 0xc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47, 0xfa, 0x5b, 0x5f, 0xbd, 0x5f, 0xfa, 0x0a, 0x7f, 0xee, 0xab, 0xff, + 0xb5, 0xaf, 0xf5, 0xd0, 0xff, 0x34, 0x67, 0x6f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xea, 0x75, 0x34, + 0x90, 0x43, 0x02, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/grpc/benchmark/grpc_testing/stats.proto b/vendor/google.golang.org/grpc/benchmark/grpc_testing/stats.proto new file mode 100644 index 0000000000..baf3610f33 --- /dev/null +++ b/vendor/google.golang.org/grpc/benchmark/grpc_testing/stats.proto @@ -0,0 +1,55 @@ +// Copyright 2016 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. + +syntax = "proto3"; + +package grpc.testing; + +message ServerStats { + // wall clock time change in seconds since last reset + double time_elapsed = 1; + + // change in user time (in seconds) used by the server since last reset + double time_user = 2; + + // change in server time (in seconds) used by the server process and all + // threads since last reset + double time_system = 3; +} + +// Histogram params based on grpc/support/histogram.c +message HistogramParams { + double resolution = 1; // first bucket is [0, 1 + resolution) + double max_possible = 2; // use enough buckets to allow this value +} + +// Histogram data based on grpc/support/histogram.c +message HistogramData { + repeated uint32 bucket = 1; + double min_seen = 2; + double max_seen = 3; + double sum = 4; + double sum_of_squares = 5; + double count = 6; +} + +message ClientStats { + // Latency histogram. Data points are in nanoseconds. + HistogramData latencies = 1; + + // See ServerStats for details. + double time_elapsed = 2; + double time_user = 3; + double time_system = 4; +} diff --git a/vendor/google.golang.org/grpc/benchmark/latency/latency.go b/vendor/google.golang.org/grpc/benchmark/latency/latency.go new file mode 100644 index 0000000000..5839a5c442 --- /dev/null +++ b/vendor/google.golang.org/grpc/benchmark/latency/latency.go @@ -0,0 +1,316 @@ +/* + * + * Copyright 2017 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. + * + */ + +// Package latency provides wrappers for net.Conn, net.Listener, and +// net.Dialers, designed to interoperate to inject real-world latency into +// network connections. +package latency + +import ( + "bytes" + "encoding/binary" + "fmt" + "io" + "net" + "time" + + "golang.org/x/net/context" +) + +// Dialer is a function matching the signature of net.Dial. +type Dialer func(network, address string) (net.Conn, error) + +// TimeoutDialer is a function matching the signature of net.DialTimeout. +type TimeoutDialer func(network, address string, timeout time.Duration) (net.Conn, error) + +// ContextDialer is a function matching the signature of +// net.Dialer.DialContext. +type ContextDialer func(ctx context.Context, network, address string) (net.Conn, error) + +// Network represents a network with the given bandwidth, latency, and MTU +// (Maximum Transmission Unit) configuration, and can produce wrappers of +// net.Listeners, net.Conn, and various forms of dialing functions. The +// Listeners and Dialers/Conns on both sides of connections must come from this +// package, but need not be created from the same Network. Latency is computed +// when sending (in Write), and is injected when receiving (in Read). This +// allows senders' Write calls to be non-blocking, as in real-world +// applications. +// +// Note: Latency is injected by the sender specifying the absolute time data +// should be available, and the reader delaying until that time arrives to +// provide the data. This package attempts to counter-act the effects of clock +// drift and existing network latency by measuring the delay between the +// sender's transmission time and the receiver's reception time during startup. +// No attempt is made to measure the existing bandwidth of the connection. +type Network struct { + Kbps int // Kilobits per second; if non-positive, infinite + Latency time.Duration // One-way latency (sending); if non-positive, no delay + MTU int // Bytes per packet; if non-positive, infinite +} + +var ( + //Local simulates local network. + Local = Network{0, 0, 0} + //LAN simulates local area network network. + LAN = Network{100 * 1024, 2 * time.Millisecond, 1500} + //WAN simulates wide area network. + WAN = Network{20 * 1024, 30 * time.Millisecond, 1500} + //Longhaul simulates bad network. + Longhaul = Network{1000 * 1024, 200 * time.Millisecond, 9000} +) + +// Conn returns a net.Conn that wraps c and injects n's latency into that +// connection. This function also imposes latency for connection creation. +// If n's Latency is lower than the measured latency in c, an error is +// returned. +func (n *Network) Conn(c net.Conn) (net.Conn, error) { + start := now() + nc := &conn{Conn: c, network: n, readBuf: new(bytes.Buffer)} + if err := nc.sync(); err != nil { + return nil, err + } + sleep(start.Add(nc.delay).Sub(now())) + return nc, nil +} + +type conn struct { + net.Conn + network *Network + + readBuf *bytes.Buffer // one packet worth of data received + lastSendEnd time.Time // time the previous Write should be fully on the wire + delay time.Duration // desired latency - measured latency +} + +// header is sent before all data transmitted by the application. +type header struct { + ReadTime int64 // Time the reader is allowed to read this packet (UnixNano) + Sz int32 // Size of the data in the packet +} + +func (c *conn) Write(p []byte) (n int, err error) { + tNow := now() + if c.lastSendEnd.Before(tNow) { + c.lastSendEnd = tNow + } + for len(p) > 0 { + pkt := p + if c.network.MTU > 0 && len(pkt) > c.network.MTU { + pkt = pkt[:c.network.MTU] + p = p[c.network.MTU:] + } else { + p = nil + } + if c.network.Kbps > 0 { + if congestion := c.lastSendEnd.Sub(tNow) - c.delay; congestion > 0 { + // The network is full; sleep until this packet can be sent. + sleep(congestion) + tNow = tNow.Add(congestion) + } + } + c.lastSendEnd = c.lastSendEnd.Add(c.network.pktTime(len(pkt))) + hdr := header{ReadTime: c.lastSendEnd.Add(c.delay).UnixNano(), Sz: int32(len(pkt))} + if err := binary.Write(c.Conn, binary.BigEndian, hdr); err != nil { + return n, err + } + x, err := c.Conn.Write(pkt) + n += x + if err != nil { + return n, err + } + } + return n, nil +} + +func (c *conn) Read(p []byte) (n int, err error) { + if c.readBuf.Len() == 0 { + var hdr header + if err := binary.Read(c.Conn, binary.BigEndian, &hdr); err != nil { + return 0, err + } + defer func() { sleep(time.Unix(0, hdr.ReadTime).Sub(now())) }() + + if _, err := io.CopyN(c.readBuf, c.Conn, int64(hdr.Sz)); err != nil { + return 0, err + } + } + // Read from readBuf. + return c.readBuf.Read(p) +} + +// sync does a handshake and then measures the latency on the network in +// coordination with the other side. +func (c *conn) sync() error { + const ( + pingMsg = "syncPing" + warmup = 10 // minimum number of iterations to measure latency + giveUp = 50 // maximum number of iterations to measure latency + accuracy = time.Millisecond // req'd accuracy to stop early + goodRun = 3 // stop early if latency within accuracy this many times + ) + + type syncMsg struct { + SendT int64 // Time sent. If zero, stop. + RecvT int64 // Time received. If zero, fill in and respond. + } + + // A trivial handshake + if err := binary.Write(c.Conn, binary.BigEndian, []byte(pingMsg)); err != nil { + return err + } + var ping [8]byte + if err := binary.Read(c.Conn, binary.BigEndian, &ping); err != nil { + return err + } else if string(ping[:]) != pingMsg { + return fmt.Errorf("malformed handshake message: %v (want %q)", ping, pingMsg) + } + + // Both sides are alive and syncing. Calculate network delay / clock skew. + att := 0 + good := 0 + var latency time.Duration + localDone, remoteDone := false, false + send := true + for !localDone || !remoteDone { + if send { + if err := binary.Write(c.Conn, binary.BigEndian, syncMsg{SendT: now().UnixNano()}); err != nil { + return err + } + att++ + send = false + } + + // Block until we get a syncMsg + m := syncMsg{} + if err := binary.Read(c.Conn, binary.BigEndian, &m); err != nil { + return err + } + + if m.RecvT == 0 { + // Message initiated from other side. + if m.SendT == 0 { + remoteDone = true + continue + } + // Send response. + m.RecvT = now().UnixNano() + if err := binary.Write(c.Conn, binary.BigEndian, m); err != nil { + return err + } + continue + } + + lag := time.Duration(m.RecvT - m.SendT) + latency += lag + avgLatency := latency / time.Duration(att) + if e := lag - avgLatency; e > -accuracy && e < accuracy { + good++ + } else { + good = 0 + } + if att < giveUp && (att < warmup || good < goodRun) { + send = true + continue + } + localDone = true + latency = avgLatency + // Tell the other side we're done. + if err := binary.Write(c.Conn, binary.BigEndian, syncMsg{}); err != nil { + return err + } + } + if c.network.Latency <= 0 { + return nil + } + c.delay = c.network.Latency - latency + if c.delay < 0 { + return fmt.Errorf("measured network latency (%v) higher than desired latency (%v)", latency, c.network.Latency) + } + return nil +} + +// Listener returns a net.Listener that wraps l and injects n's latency in its +// connections. +func (n *Network) Listener(l net.Listener) net.Listener { + return &listener{Listener: l, network: n} +} + +type listener struct { + net.Listener + network *Network +} + +func (l *listener) Accept() (net.Conn, error) { + c, err := l.Listener.Accept() + if err != nil { + return nil, err + } + return l.network.Conn(c) +} + +// Dialer returns a Dialer that wraps d and injects n's latency in its +// connections. n's Latency is also injected to the connection's creation. +func (n *Network) Dialer(d Dialer) Dialer { + return func(network, address string) (net.Conn, error) { + conn, err := d(network, address) + if err != nil { + return nil, err + } + return n.Conn(conn) + } +} + +// TimeoutDialer returns a TimeoutDialer that wraps d and injects n's latency +// in its connections. n's Latency is also injected to the connection's +// creation. +func (n *Network) TimeoutDialer(d TimeoutDialer) TimeoutDialer { + return func(network, address string, timeout time.Duration) (net.Conn, error) { + conn, err := d(network, address, timeout) + if err != nil { + return nil, err + } + return n.Conn(conn) + } +} + +// ContextDialer returns a ContextDialer that wraps d and injects n's latency +// in its connections. n's Latency is also injected to the connection's +// creation. +func (n *Network) ContextDialer(d ContextDialer) ContextDialer { + return func(ctx context.Context, network, address string) (net.Conn, error) { + conn, err := d(ctx, network, address) + if err != nil { + return nil, err + } + return n.Conn(conn) + } +} + +// pktTime returns the time it takes to transmit one packet of data of size b +// in bytes. +func (n *Network) pktTime(b int) time.Duration { + if n.Kbps <= 0 { + return time.Duration(0) + } + return time.Duration(b) * time.Second / time.Duration(n.Kbps*(1024/8)) +} + +// Wrappers for testing + +var now = time.Now +var sleep = time.Sleep diff --git a/vendor/google.golang.org/grpc/benchmark/latency/latency_test.go b/vendor/google.golang.org/grpc/benchmark/latency/latency_test.go new file mode 100644 index 0000000000..ab2625bf1a --- /dev/null +++ b/vendor/google.golang.org/grpc/benchmark/latency/latency_test.go @@ -0,0 +1,353 @@ +/* + * + * Copyright 2017 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. + * + */ + +package latency + +import ( + "bytes" + "fmt" + "net" + "reflect" + "sync" + "testing" + "time" +) + +// bufConn is a net.Conn implemented by a bytes.Buffer (which is a ReadWriter). +type bufConn struct { + *bytes.Buffer +} + +func (bufConn) Close() error { panic("unimplemented") } +func (bufConn) LocalAddr() net.Addr { panic("unimplemented") } +func (bufConn) RemoteAddr() net.Addr { panic("unimplemented") } +func (bufConn) SetDeadline(t time.Time) error { panic("unimplemneted") } +func (bufConn) SetReadDeadline(t time.Time) error { panic("unimplemneted") } +func (bufConn) SetWriteDeadline(t time.Time) error { panic("unimplemneted") } + +func restoreHooks() func() { + s := sleep + n := now + return func() { + sleep = s + now = n + } +} + +func TestConn(t *testing.T) { + defer restoreHooks()() + + // Constant time. + now = func() time.Time { return time.Unix(123, 456) } + + // Capture sleep times for checking later. + var sleepTimes []time.Duration + sleep = func(t time.Duration) { sleepTimes = append(sleepTimes, t) } + + wantSleeps := func(want ...time.Duration) { + if !reflect.DeepEqual(want, sleepTimes) { + t.Fatalf("sleepTimes = %v; want %v", sleepTimes, want) + } + sleepTimes = nil + } + + // Use a fairly high latency to cause a large BDP and avoid sleeps while + // writing due to simulation of full buffers. + latency := 1 * time.Second + c, err := (&Network{Kbps: 1, Latency: latency, MTU: 5}).Conn(bufConn{&bytes.Buffer{}}) + if err != nil { + t.Fatalf("Unexpected error creating connection: %v", err) + } + wantSleeps(latency) // Connection creation delay. + + // 1 kbps = 128 Bps. Divides evenly by 1 second using nanos. + byteLatency := time.Duration(time.Second / 128) + + write := func(b []byte) { + n, err := c.Write(b) + if n != len(b) || err != nil { + t.Fatalf("c.Write(%v) = %v, %v; want %v, nil", b, n, err, len(b)) + } + } + + write([]byte{1, 2, 3, 4, 5}) // One full packet + pkt1Time := latency + byteLatency*5 + write([]byte{6}) // One partial packet + pkt2Time := pkt1Time + byteLatency + write([]byte{7, 8, 9, 10, 11, 12, 13}) // Two packets + pkt3Time := pkt2Time + byteLatency*5 + pkt4Time := pkt3Time + byteLatency*2 + + // No reads, so no sleeps yet. + wantSleeps() + + read := func(n int, want []byte) { + b := make([]byte, n) + if rd, err := c.Read(b); err != nil || rd != len(want) { + t.Fatalf("c.Read(<%v bytes>) = %v, %v; want %v, nil", n, rd, err, len(want)) + } + if !reflect.DeepEqual(b[:len(want)], want) { + t.Fatalf("read %v; want %v", b, want) + } + } + + read(1, []byte{1}) + wantSleeps(pkt1Time) + read(1, []byte{2}) + wantSleeps() + read(3, []byte{3, 4, 5}) + wantSleeps() + read(2, []byte{6}) + wantSleeps(pkt2Time) + read(2, []byte{7, 8}) + wantSleeps(pkt3Time) + read(10, []byte{9, 10, 11}) + wantSleeps() + read(10, []byte{12, 13}) + wantSleeps(pkt4Time) +} + +func TestSync(t *testing.T) { + defer restoreHooks()() + + // Infinitely fast CPU: time doesn't pass unless sleep is called. + tn := time.Unix(123, 0) + now = func() time.Time { return tn } + sleep = func(d time.Duration) { tn = tn.Add(d) } + + // Simulate a 20ms latency network, then run sync across that and expect to + // measure 20ms latency, or 10ms additional delay for a 30ms network. + slowConn, err := (&Network{Kbps: 0, Latency: 20 * time.Millisecond, MTU: 5}).Conn(bufConn{&bytes.Buffer{}}) + if err != nil { + t.Fatalf("Unexpected error creating connection: %v", err) + } + c, err := (&Network{Latency: 30 * time.Millisecond}).Conn(slowConn) + if err != nil { + t.Fatalf("Unexpected error creating connection: %v", err) + } + if c.(*conn).delay != 10*time.Millisecond { + t.Fatalf("c.delay = %v; want 10ms", c.(*conn).delay) + } +} + +func TestSyncTooSlow(t *testing.T) { + defer restoreHooks()() + + // Infinitely fast CPU: time doesn't pass unless sleep is called. + tn := time.Unix(123, 0) + now = func() time.Time { return tn } + sleep = func(d time.Duration) { tn = tn.Add(d) } + + // Simulate a 10ms latency network, then attempt to simulate a 5ms latency + // network and expect an error. + slowConn, err := (&Network{Kbps: 0, Latency: 10 * time.Millisecond, MTU: 5}).Conn(bufConn{&bytes.Buffer{}}) + if err != nil { + t.Fatalf("Unexpected error creating connection: %v", err) + } + + errWant := "measured network latency (10ms) higher than desired latency (5ms)" + if _, err := (&Network{Latency: 5 * time.Millisecond}).Conn(slowConn); err == nil || err.Error() != errWant { + t.Fatalf("Conn() = _, %q; want _, %q", err, errWant) + } +} + +func TestListenerAndDialer(t *testing.T) { + defer restoreHooks()() + + tn := time.Unix(123, 0) + startTime := tn + mu := &sync.Mutex{} + now = func() time.Time { + mu.Lock() + defer mu.Unlock() + return tn + } + + // Use a fairly high latency to cause a large BDP and avoid sleeps while + // writing due to simulation of full buffers. + n := &Network{Kbps: 2, Latency: 1 * time.Second, MTU: 10} + // 2 kbps = .25 kBps = 256 Bps + byteLatency := func(n int) time.Duration { + return time.Duration(n) * time.Second / 256 + } + + // Create a real listener and wrap it. + l, err := net.Listen("tcp", "localhost:0") + if err != nil { + t.Fatalf("Unexpected error creating listener: %v", err) + } + defer l.Close() + l = n.Listener(l) + + var serverConn net.Conn + var scErr error + scDone := make(chan struct{}) + go func() { + serverConn, scErr = l.Accept() + close(scDone) + }() + + // Create a dialer and use it. + clientConn, err := n.TimeoutDialer(net.DialTimeout)("tcp", l.Addr().String(), 2*time.Second) + if err != nil { + t.Fatalf("Unexpected error dialing: %v", err) + } + defer clientConn.Close() + + // Block until server's Conn is available. + <-scDone + if scErr != nil { + t.Fatalf("Unexpected error listening: %v", scErr) + } + defer serverConn.Close() + + // sleep (only) advances tn. Done after connections established so sync detects zero delay. + sleep = func(d time.Duration) { + mu.Lock() + defer mu.Unlock() + if d > 0 { + tn = tn.Add(d) + } + } + + seq := func(a, b int) []byte { + buf := make([]byte, b-a) + for i := 0; i < b-a; i++ { + buf[i] = byte(i + a) + } + return buf + } + + pkt1 := seq(0, 10) + pkt2 := seq(10, 30) + pkt3 := seq(30, 35) + + write := func(c net.Conn, b []byte) { + n, err := c.Write(b) + if n != len(b) || err != nil { + t.Fatalf("c.Write(%v) = %v, %v; want %v, nil", b, n, err, len(b)) + } + } + + write(serverConn, pkt1) + write(serverConn, pkt2) + write(serverConn, pkt3) + write(clientConn, pkt3) + write(clientConn, pkt1) + write(clientConn, pkt2) + + if tn != startTime { + t.Fatalf("unexpected sleep in write; tn = %v; want %v", tn, startTime) + } + + read := func(c net.Conn, n int, want []byte, timeWant time.Time) { + b := make([]byte, n) + if rd, err := c.Read(b); err != nil || rd != len(want) { + t.Fatalf("c.Read(<%v bytes>) = %v, %v; want %v, nil (read: %v)", n, rd, err, len(want), b[:rd]) + } + if !reflect.DeepEqual(b[:len(want)], want) { + t.Fatalf("read %v; want %v", b, want) + } + if !tn.Equal(timeWant) { + t.Errorf("tn after read(%v) = %v; want %v", want, tn, timeWant) + } + } + + read(clientConn, len(pkt1)+1, pkt1, startTime.Add(n.Latency+byteLatency(len(pkt1)))) + read(serverConn, len(pkt3)+1, pkt3, tn) // tn was advanced by the above read; pkt3 is shorter than pkt1 + + read(clientConn, len(pkt2), pkt2[:10], startTime.Add(n.Latency+byteLatency(len(pkt1)+10))) + read(clientConn, len(pkt2), pkt2[10:], startTime.Add(n.Latency+byteLatency(len(pkt1)+len(pkt2)))) + read(clientConn, len(pkt3), pkt3, startTime.Add(n.Latency+byteLatency(len(pkt1)+len(pkt2)+len(pkt3)))) + + read(serverConn, len(pkt1), pkt1, tn) // tn already past the arrival time due to prior reads + read(serverConn, len(pkt2), pkt2[:10], tn) + read(serverConn, len(pkt2), pkt2[10:], tn) + + // Sleep awhile and make sure the read happens disregarding previous writes + // (lastSendEnd handling). + sleep(10 * time.Second) + write(clientConn, pkt1) + read(serverConn, len(pkt1), pkt1, tn.Add(n.Latency+byteLatency(len(pkt1)))) + + // Send, sleep longer than the network delay, then make sure the read happens + // instantly. + write(serverConn, pkt1) + sleep(10 * time.Second) + read(clientConn, len(pkt1), pkt1, tn) +} + +func TestBufferBloat(t *testing.T) { + defer restoreHooks()() + + // Infinitely fast CPU: time doesn't pass unless sleep is called. + tn := time.Unix(123, 0) + now = func() time.Time { return tn } + // Capture sleep times for checking later. + var sleepTimes []time.Duration + sleep = func(d time.Duration) { + sleepTimes = append(sleepTimes, d) + tn = tn.Add(d) + } + + wantSleeps := func(want ...time.Duration) error { + if !reflect.DeepEqual(want, sleepTimes) { + return fmt.Errorf("sleepTimes = %v; want %v", sleepTimes, want) + } + sleepTimes = nil + return nil + } + + n := &Network{Kbps: 8 /* 1KBps */, Latency: time.Second, MTU: 8} + bdpBytes := (n.Kbps * 1024 / 8) * int(n.Latency/time.Second) // 1024 + c, err := n.Conn(bufConn{&bytes.Buffer{}}) + if err != nil { + t.Fatalf("Unexpected error creating connection: %v", err) + } + wantSleeps(n.Latency) // Connection creation delay. + + write := func(n int, sleeps ...time.Duration) { + if wt, err := c.Write(make([]byte, n)); err != nil || wt != n { + t.Fatalf("c.Write(<%v bytes>) = %v, %v; want %v, nil", n, wt, err, n) + } + if err := wantSleeps(sleeps...); err != nil { + t.Fatalf("After writing %v bytes: %v", n, err) + } + } + + read := func(n int, sleeps ...time.Duration) { + if rd, err := c.Read(make([]byte, n)); err != nil || rd != n { + t.Fatalf("c.Read(_) = %v, %v; want %v, nil", rd, err, n) + } + if err := wantSleeps(sleeps...); err != nil { + t.Fatalf("After reading %v bytes: %v", n, err) + } + } + + write(8) // No reads and buffer not full, so no sleeps yet. + read(8, time.Second+n.pktTime(8)) + + write(bdpBytes) // Fill the buffer. + write(1) // We can send one extra packet even when the buffer is full. + write(n.MTU, n.pktTime(1)) // Make sure we sleep to clear the previous write. + write(1, n.pktTime(n.MTU)) + write(n.MTU+1, n.pktTime(1), n.pktTime(n.MTU)) + + tn = tn.Add(10 * time.Second) // Wait long enough for the buffer to clear. + write(bdpBytes) // No sleeps required. +} diff --git a/vendor/google.golang.org/grpc/benchmark/primitives/context_test.go b/vendor/google.golang.org/grpc/benchmark/primitives/context_test.go new file mode 100644 index 0000000000..e1d6c043f3 --- /dev/null +++ b/vendor/google.golang.org/grpc/benchmark/primitives/context_test.go @@ -0,0 +1,120 @@ +/* + * + * Copyright 2017 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. + * + */ + +package primitives_test + +import ( + "testing" + "time" + + "golang.org/x/net/context" +) + +func BenchmarkCancelContextErrNoErr(b *testing.B) { + ctx, cancel := context.WithCancel(context.Background()) + for i := 0; i < b.N; i++ { + if err := ctx.Err(); err != nil { + b.Fatal("error") + } + } + cancel() +} + +func BenchmarkCancelContextErrGotErr(b *testing.B) { + ctx, cancel := context.WithCancel(context.Background()) + cancel() + for i := 0; i < b.N; i++ { + if err := ctx.Err(); err == nil { + b.Fatal("error") + } + } +} + +func BenchmarkCancelContextChannelNoErr(b *testing.B) { + ctx, cancel := context.WithCancel(context.Background()) + for i := 0; i < b.N; i++ { + select { + case <-ctx.Done(): + b.Fatal("error: ctx.Done():", ctx.Err()) + default: + } + } + cancel() +} + +func BenchmarkCancelContextChannelGotErr(b *testing.B) { + ctx, cancel := context.WithCancel(context.Background()) + cancel() + for i := 0; i < b.N; i++ { + select { + case <-ctx.Done(): + if err := ctx.Err(); err == nil { + b.Fatal("error") + } + default: + b.Fatal("error: !ctx.Done()") + } + } +} + +func BenchmarkTimerContextErrNoErr(b *testing.B) { + ctx, cancel := context.WithTimeout(context.Background(), 24*time.Hour) + for i := 0; i < b.N; i++ { + if err := ctx.Err(); err != nil { + b.Fatal("error") + } + } + cancel() +} + +func BenchmarkTimerContextErrGotErr(b *testing.B) { + ctx, cancel := context.WithTimeout(context.Background(), time.Microsecond) + cancel() + for i := 0; i < b.N; i++ { + if err := ctx.Err(); err == nil { + b.Fatal("error") + } + } +} + +func BenchmarkTimerContextChannelNoErr(b *testing.B) { + ctx, cancel := context.WithTimeout(context.Background(), 24*time.Hour) + for i := 0; i < b.N; i++ { + select { + case <-ctx.Done(): + b.Fatal("error: ctx.Done():", ctx.Err()) + default: + } + } + cancel() +} + +func BenchmarkTimerContextChannelGotErr(b *testing.B) { + ctx, cancel := context.WithTimeout(context.Background(), time.Microsecond) + cancel() + for i := 0; i < b.N; i++ { + select { + case <-ctx.Done(): + if err := ctx.Err(); err == nil { + b.Fatal("error") + } + default: + b.Fatal("error: !ctx.Done()") + } + } +} diff --git a/vendor/google.golang.org/grpc/benchmark/primitives/primitives_test.go b/vendor/google.golang.org/grpc/benchmark/primitives/primitives_test.go new file mode 100644 index 0000000000..59355590d5 --- /dev/null +++ b/vendor/google.golang.org/grpc/benchmark/primitives/primitives_test.go @@ -0,0 +1,235 @@ +/* + * + * Copyright 2017 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. + * + */ + +// Package primitives_test contains benchmarks for various synchronization primitives +// available in Go. +package primitives_test + +import ( + "sync" + "sync/atomic" + "testing" +) + +func BenchmarkSelectClosed(b *testing.B) { + c := make(chan struct{}) + close(c) + x := 0 + b.ResetTimer() + for i := 0; i < b.N; i++ { + select { + case <-c: + x++ + default: + } + } + b.StopTimer() + if x != b.N { + b.Fatal("error") + } +} + +func BenchmarkSelectOpen(b *testing.B) { + c := make(chan struct{}) + x := 0 + b.ResetTimer() + for i := 0; i < b.N; i++ { + select { + case <-c: + default: + x++ + } + } + b.StopTimer() + if x != b.N { + b.Fatal("error") + } +} + +func BenchmarkAtomicBool(b *testing.B) { + c := int32(0) + x := 0 + b.ResetTimer() + for i := 0; i < b.N; i++ { + if atomic.LoadInt32(&c) == 0 { + x++ + } + } + b.StopTimer() + if x != b.N { + b.Fatal("error") + } +} + +func BenchmarkAtomicValue(b *testing.B) { + c := atomic.Value{} + c.Store(0) + x := 0 + b.ResetTimer() + for i := 0; i < b.N; i++ { + if c.Load().(int) == 0 { + x++ + } + } + b.StopTimer() + if x != b.N { + b.Fatal("error") + } +} + +func BenchmarkMutex(b *testing.B) { + c := sync.Mutex{} + x := 0 + b.ResetTimer() + for i := 0; i < b.N; i++ { + c.Lock() + x++ + c.Unlock() + } + b.StopTimer() + if x != b.N { + b.Fatal("error") + } +} + +func BenchmarkRWMutex(b *testing.B) { + c := sync.RWMutex{} + x := 0 + b.ResetTimer() + for i := 0; i < b.N; i++ { + c.RLock() + x++ + c.RUnlock() + } + b.StopTimer() + if x != b.N { + b.Fatal("error") + } +} + +func BenchmarkRWMutexW(b *testing.B) { + c := sync.RWMutex{} + x := 0 + b.ResetTimer() + for i := 0; i < b.N; i++ { + c.Lock() + x++ + c.Unlock() + } + b.StopTimer() + if x != b.N { + b.Fatal("error") + } +} + +func BenchmarkMutexWithDefer(b *testing.B) { + c := sync.Mutex{} + x := 0 + b.ResetTimer() + for i := 0; i < b.N; i++ { + func() { + c.Lock() + defer c.Unlock() + x++ + }() + } + b.StopTimer() + if x != b.N { + b.Fatal("error") + } +} + +func BenchmarkMutexWithClosureDefer(b *testing.B) { + c := sync.Mutex{} + x := 0 + b.ResetTimer() + for i := 0; i < b.N; i++ { + func() { + c.Lock() + defer func() { c.Unlock() }() + x++ + }() + } + b.StopTimer() + if x != b.N { + b.Fatal("error") + } +} + +func BenchmarkMutexWithoutDefer(b *testing.B) { + c := sync.Mutex{} + x := 0 + b.ResetTimer() + for i := 0; i < b.N; i++ { + func() { + c.Lock() + x++ + c.Unlock() + }() + } + b.StopTimer() + if x != b.N { + b.Fatal("error") + } +} + +type myFooer struct{} + +func (myFooer) Foo() {} + +type fooer interface { + Foo() +} + +func BenchmarkInterfaceTypeAssertion(b *testing.B) { + // Call a separate function to avoid compiler optimizations. + runInterfaceTypeAssertion(b, myFooer{}) +} + +func runInterfaceTypeAssertion(b *testing.B, fer interface{}) { + x := 0 + b.ResetTimer() + for i := 0; i < b.N; i++ { + if _, ok := fer.(fooer); ok { + x++ + } + } + b.StopTimer() + if x != b.N { + b.Fatal("error") + } +} + +func BenchmarkStructTypeAssertion(b *testing.B) { + // Call a separate function to avoid compiler optimizations. + runStructTypeAssertion(b, myFooer{}) +} + +func runStructTypeAssertion(b *testing.B, fer interface{}) { + x := 0 + b.ResetTimer() + for i := 0; i < b.N; i++ { + if _, ok := fer.(myFooer); ok { + x++ + } + } + b.StopTimer() + if x != b.N { + b.Fatal("error") + } +} diff --git a/vendor/google.golang.org/grpc/benchmark/server/main.go b/vendor/google.golang.org/grpc/benchmark/server/main.go new file mode 100644 index 0000000000..ac59ff771d --- /dev/null +++ b/vendor/google.golang.org/grpc/benchmark/server/main.go @@ -0,0 +1,51 @@ +/* + * + * Copyright 2017 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. + * + */ + +package main + +import ( + "flag" + "math" + "net" + "net/http" + _ "net/http/pprof" + "time" + + "google.golang.org/grpc/benchmark" + "google.golang.org/grpc/grpclog" +) + +var duration = flag.Int("duration", math.MaxInt32, "The duration in seconds to run the benchmark server") + +func main() { + flag.Parse() + go func() { + lis, err := net.Listen("tcp", ":0") + if err != nil { + grpclog.Fatalf("Failed to listen: %v", err) + } + grpclog.Println("Server profiling address: ", lis.Addr().String()) + if err := http.Serve(lis, nil); err != nil { + grpclog.Fatalf("Failed to serve: %v", err) + } + }() + addr, stopper := benchmark.StartServer(benchmark.ServerInfo{Addr: ":0", Type: "protobuf"}) // listen on all interfaces + grpclog.Println("Server Address: ", addr) + <-time.After(time.Duration(*duration) * time.Second) + stopper() +} diff --git a/vendor/google.golang.org/grpc/benchmark/stats/histogram.go b/vendor/google.golang.org/grpc/benchmark/stats/histogram.go new file mode 100644 index 0000000000..f038d26ed0 --- /dev/null +++ b/vendor/google.golang.org/grpc/benchmark/stats/histogram.go @@ -0,0 +1,222 @@ +/* + * + * Copyright 2017 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. + * + */ + +package stats + +import ( + "bytes" + "fmt" + "io" + "log" + "math" + "strconv" + "strings" +) + +// Histogram accumulates values in the form of a histogram with +// exponentially increased bucket sizes. +type Histogram struct { + // Count is the total number of values added to the histogram. + Count int64 + // Sum is the sum of all the values added to the histogram. + Sum int64 + // SumOfSquares is the sum of squares of all values. + SumOfSquares int64 + // Min is the minimum of all the values added to the histogram. + Min int64 + // Max is the maximum of all the values added to the histogram. + Max int64 + // Buckets contains all the buckets of the histogram. + Buckets []HistogramBucket + + opts HistogramOptions + logBaseBucketSize float64 + oneOverLogOnePlusGrowthFactor float64 +} + +// HistogramOptions contains the parameters that define the histogram's buckets. +// The first bucket of the created histogram (with index 0) contains [min, min+n) +// where n = BaseBucketSize, min = MinValue. +// Bucket i (i>=1) contains [min + n * m^(i-1), min + n * m^i), where m = 1+GrowthFactor. +// The type of the values is int64. +type HistogramOptions struct { + // NumBuckets is the number of buckets. + NumBuckets int + // GrowthFactor is the growth factor of the buckets. A value of 0.1 + // indicates that bucket N+1 will be 10% larger than bucket N. + GrowthFactor float64 + // BaseBucketSize is the size of the first bucket. + BaseBucketSize float64 + // MinValue is the lower bound of the first bucket. + MinValue int64 +} + +// HistogramBucket represents one histogram bucket. +type HistogramBucket struct { + // LowBound is the lower bound of the bucket. + LowBound float64 + // Count is the number of values in the bucket. + Count int64 +} + +// NewHistogram returns a pointer to a new Histogram object that was created +// with the provided options. +func NewHistogram(opts HistogramOptions) *Histogram { + if opts.NumBuckets == 0 { + opts.NumBuckets = 32 + } + if opts.BaseBucketSize == 0.0 { + opts.BaseBucketSize = 1.0 + } + h := Histogram{ + Buckets: make([]HistogramBucket, opts.NumBuckets), + Min: math.MaxInt64, + Max: math.MinInt64, + + opts: opts, + logBaseBucketSize: math.Log(opts.BaseBucketSize), + oneOverLogOnePlusGrowthFactor: 1 / math.Log(1+opts.GrowthFactor), + } + m := 1.0 + opts.GrowthFactor + delta := opts.BaseBucketSize + h.Buckets[0].LowBound = float64(opts.MinValue) + for i := 1; i < opts.NumBuckets; i++ { + h.Buckets[i].LowBound = float64(opts.MinValue) + delta + delta = delta * m + } + return &h +} + +// Print writes textual output of the histogram values. +func (h *Histogram) Print(w io.Writer) { + h.PrintWithUnit(w, 1) +} + +// PrintWithUnit writes textual output of the histogram values . +// Data in histogram is divided by a Unit before print. +func (h *Histogram) PrintWithUnit(w io.Writer, unit float64) { + avg := float64(h.Sum) / float64(h.Count) + fmt.Fprintf(w, "Count: %d Min: %5.1f Max: %5.1f Avg: %.2f\n", h.Count, float64(h.Min)/unit, float64(h.Max)/unit, avg/unit) + fmt.Fprintf(w, "%s\n", strings.Repeat("-", 60)) + if h.Count <= 0 { + return + } + + maxBucketDigitLen := len(strconv.FormatFloat(h.Buckets[len(h.Buckets)-1].LowBound, 'f', 6, 64)) + if maxBucketDigitLen < 3 { + // For "inf". + maxBucketDigitLen = 3 + } + maxCountDigitLen := len(strconv.FormatInt(h.Count, 10)) + percentMulti := 100 / float64(h.Count) + + accCount := int64(0) + for i, b := range h.Buckets { + fmt.Fprintf(w, "[%*f, ", maxBucketDigitLen, b.LowBound/unit) + if i+1 < len(h.Buckets) { + fmt.Fprintf(w, "%*f)", maxBucketDigitLen, h.Buckets[i+1].LowBound/unit) + } else { + fmt.Fprintf(w, "%*s)", maxBucketDigitLen, "inf") + } + + accCount += b.Count + fmt.Fprintf(w, " %*d %5.1f%% %5.1f%%", maxCountDigitLen, b.Count, float64(b.Count)*percentMulti, float64(accCount)*percentMulti) + + const barScale = 0.1 + barLength := int(float64(b.Count)*percentMulti*barScale + 0.5) + fmt.Fprintf(w, " %s\n", strings.Repeat("#", barLength)) + } +} + +// String returns the textual output of the histogram values as string. +func (h *Histogram) String() string { + var b bytes.Buffer + h.Print(&b) + return b.String() +} + +// Clear resets all the content of histogram. +func (h *Histogram) Clear() { + h.Count = 0 + h.Sum = 0 + h.SumOfSquares = 0 + h.Min = math.MaxInt64 + h.Max = math.MinInt64 + for i := range h.Buckets { + h.Buckets[i].Count = 0 + } +} + +// Opts returns a copy of the options used to create the Histogram. +func (h *Histogram) Opts() HistogramOptions { + return h.opts +} + +// Add adds a value to the histogram. +func (h *Histogram) Add(value int64) error { + bucket, err := h.findBucket(value) + if err != nil { + return err + } + h.Buckets[bucket].Count++ + h.Count++ + h.Sum += value + h.SumOfSquares += value * value + if value < h.Min { + h.Min = value + } + if value > h.Max { + h.Max = value + } + return nil +} + +func (h *Histogram) findBucket(value int64) (int, error) { + delta := float64(value - h.opts.MinValue) + var b int + if delta >= h.opts.BaseBucketSize { + // b = log_{1+growthFactor} (delta / baseBucketSize) + 1 + // = log(delta / baseBucketSize) / log(1+growthFactor) + 1 + // = (log(delta) - log(baseBucketSize)) * (1 / log(1+growthFactor)) + 1 + b = int((math.Log(delta)-h.logBaseBucketSize)*h.oneOverLogOnePlusGrowthFactor + 1) + } + if b >= len(h.Buckets) { + return 0, fmt.Errorf("no bucket for value: %d", value) + } + return b, nil +} + +// Merge takes another histogram h2, and merges its content into h. +// The two histograms must be created by equivalent HistogramOptions. +func (h *Histogram) Merge(h2 *Histogram) { + if h.opts != h2.opts { + log.Fatalf("failed to merge histograms, created by inequivalent options") + } + h.Count += h2.Count + h.Sum += h2.Sum + h.SumOfSquares += h2.SumOfSquares + if h2.Min < h.Min { + h.Min = h2.Min + } + if h2.Max > h.Max { + h.Max = h2.Max + } + for i, b := range h2.Buckets { + h.Buckets[i].Count += b.Count + } +} diff --git a/vendor/google.golang.org/grpc/benchmark/stats/stats.go b/vendor/google.golang.org/grpc/benchmark/stats/stats.go new file mode 100644 index 0000000000..2f98861c93 --- /dev/null +++ b/vendor/google.golang.org/grpc/benchmark/stats/stats.go @@ -0,0 +1,291 @@ +/* + * + * Copyright 2017 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. + * + */ + +package stats + +import ( + "bytes" + "fmt" + "io" + "math" + "sort" + "strconv" + "time" +) + +// Features contains most fields for a benchmark +type Features struct { + NetworkMode string + EnableTrace bool + Latency time.Duration + Kbps int + Mtu int + MaxConcurrentCalls int + ReqSizeBytes int + RespSizeBytes int + EnableCompressor bool +} + +// String returns the textual output of the Features as string. +func (f Features) String() string { + return fmt.Sprintf("traceMode_%t-latency_%s-kbps_%#v-MTU_%#v-maxConcurrentCalls_"+ + "%#v-reqSize_%#vB-respSize_%#vB-Compressor_%t", f.EnableTrace, + f.Latency.String(), f.Kbps, f.Mtu, f.MaxConcurrentCalls, f.ReqSizeBytes, f.RespSizeBytes, f.EnableCompressor) +} + +// PartialPrintString can print certain features with different format. +func PartialPrintString(noneEmptyPos []bool, f Features, shared bool) string { + s := "" + var ( + prefix, suffix, linker string + isNetwork bool + ) + if shared { + suffix = "\n" + linker = ": " + } else { + prefix = "-" + linker = "_" + } + if noneEmptyPos[0] { + s += fmt.Sprintf("%sTrace%s%t%s", prefix, linker, f.EnableCompressor, suffix) + } + if shared && f.NetworkMode != "" { + s += fmt.Sprintf("Network: %s \n", f.NetworkMode) + isNetwork = true + } + if !isNetwork { + if noneEmptyPos[1] { + s += fmt.Sprintf("%slatency%s%s%s", prefix, linker, f.Latency.String(), suffix) + } + if noneEmptyPos[2] { + s += fmt.Sprintf("%skbps%s%#v%s", prefix, linker, f.Kbps, suffix) + } + if noneEmptyPos[3] { + s += fmt.Sprintf("%sMTU%s%#v%s", prefix, linker, f.Mtu, suffix) + } + } + if noneEmptyPos[4] { + s += fmt.Sprintf("%sCallers%s%#v%s", prefix, linker, f.MaxConcurrentCalls, suffix) + } + if noneEmptyPos[5] { + s += fmt.Sprintf("%sreqSize%s%#vB%s", prefix, linker, f.ReqSizeBytes, suffix) + } + if noneEmptyPos[6] { + s += fmt.Sprintf("%srespSize%s%#vB%s", prefix, linker, f.RespSizeBytes, suffix) + } + if noneEmptyPos[7] { + s += fmt.Sprintf("%sCompressor%s%t%s", prefix, linker, f.EnableCompressor, suffix) + } + return s +} + +type percentLatency struct { + Percent int + Value time.Duration +} + +// BenchResults records features and result of a benchmark. +type BenchResults struct { + RunMode string + Features Features + Latency []percentLatency + Operations int + NsPerOp int64 + AllocedBytesPerOp int64 + AllocsPerOp int64 + SharedPosion []bool +} + +// SetBenchmarkResult sets features of benchmark and basic results. +func (stats *Stats) SetBenchmarkResult(mode string, features Features, o int, allocdBytes, allocs int64, sharedPos []bool) { + stats.result.RunMode = mode + stats.result.Features = features + stats.result.Operations = o + stats.result.AllocedBytesPerOp = allocdBytes + stats.result.AllocsPerOp = allocs + stats.result.SharedPosion = sharedPos +} + +// GetBenchmarkResults returns the result of the benchmark including features and result. +func (stats *Stats) GetBenchmarkResults() BenchResults { + return stats.result +} + +// BenchString output latency stats as the format as time + unit. +func (stats *Stats) BenchString() string { + stats.maybeUpdate() + s := stats.result + res := s.RunMode + "-" + s.Features.String() + ": \n" + if len(s.Latency) != 0 { + var statsUnit = s.Latency[0].Value + var timeUnit = fmt.Sprintf("%v", statsUnit)[1:] + for i := 1; i < len(s.Latency)-1; i++ { + res += fmt.Sprintf("%d_Latency: %s %s \t", s.Latency[i].Percent, + strconv.FormatFloat(float64(s.Latency[i].Value)/float64(statsUnit), 'f', 4, 64), timeUnit) + } + res += fmt.Sprintf("Avg latency: %s %s \t", + strconv.FormatFloat(float64(s.Latency[len(s.Latency)-1].Value)/float64(statsUnit), 'f', 4, 64), timeUnit) + } + res += fmt.Sprintf("Count: %v \t", s.Operations) + res += fmt.Sprintf("%v Bytes/op\t", s.AllocedBytesPerOp) + res += fmt.Sprintf("%v Allocs/op\t", s.AllocsPerOp) + + return res +} + +// Stats is a simple helper for gathering additional statistics like histogram +// during benchmarks. This is not thread safe. +type Stats struct { + numBuckets int + unit time.Duration + min, max int64 + histogram *Histogram + + durations durationSlice + dirty bool + + sortLatency bool + result BenchResults +} + +type durationSlice []time.Duration + +// NewStats creates a new Stats instance. If numBuckets is not positive, +// the default value (16) will be used. +func NewStats(numBuckets int) *Stats { + if numBuckets <= 0 { + numBuckets = 16 + } + return &Stats{ + // Use one more bucket for the last unbounded bucket. + numBuckets: numBuckets + 1, + durations: make(durationSlice, 0, 100000), + } +} + +// Add adds an elapsed time per operation to the stats. +func (stats *Stats) Add(d time.Duration) { + stats.durations = append(stats.durations, d) + stats.dirty = true +} + +// Clear resets the stats, removing all values. +func (stats *Stats) Clear() { + stats.durations = stats.durations[:0] + stats.histogram = nil + stats.dirty = false + stats.result = BenchResults{} +} + +//Sort method for durations +func (a durationSlice) Len() int { return len(a) } +func (a durationSlice) Swap(i, j int) { a[i], a[j] = a[j], a[i] } +func (a durationSlice) Less(i, j int) bool { return a[i] < a[j] } +func max(a, b int64) int64 { + if a > b { + return a + } + return b +} + +// maybeUpdate updates internal stat data if there was any newly added +// stats since this was updated. +func (stats *Stats) maybeUpdate() { + if !stats.dirty { + return + } + + if stats.sortLatency { + sort.Sort(stats.durations) + stats.min = int64(stats.durations[0]) + stats.max = int64(stats.durations[len(stats.durations)-1]) + } + + stats.min = math.MaxInt64 + stats.max = 0 + for _, d := range stats.durations { + if stats.min > int64(d) { + stats.min = int64(d) + } + if stats.max < int64(d) { + stats.max = int64(d) + } + } + + // Use the largest unit that can represent the minimum time duration. + stats.unit = time.Nanosecond + for _, u := range []time.Duration{time.Microsecond, time.Millisecond, time.Second} { + if stats.min <= int64(u) { + break + } + stats.unit = u + } + + numBuckets := stats.numBuckets + if n := int(stats.max - stats.min + 1); n < numBuckets { + numBuckets = n + } + stats.histogram = NewHistogram(HistogramOptions{ + NumBuckets: numBuckets, + // max-min(lower bound of last bucket) = (1 + growthFactor)^(numBuckets-2) * baseBucketSize. + GrowthFactor: math.Pow(float64(stats.max-stats.min), 1/float64(numBuckets-2)) - 1, + BaseBucketSize: 1.0, + MinValue: stats.min}) + + for _, d := range stats.durations { + stats.histogram.Add(int64(d)) + } + + stats.dirty = false + + if stats.durations.Len() != 0 { + var percentToObserve = []int{50, 90, 99} + // First data record min unit from the latency result. + stats.result.Latency = append(stats.result.Latency, percentLatency{Percent: -1, Value: stats.unit}) + for _, position := range percentToObserve { + stats.result.Latency = append(stats.result.Latency, percentLatency{Percent: position, Value: stats.durations[max(stats.histogram.Count*int64(position)/100-1, 0)]}) + } + // Last data record the average latency. + avg := float64(stats.histogram.Sum) / float64(stats.histogram.Count) + stats.result.Latency = append(stats.result.Latency, percentLatency{Percent: -1, Value: time.Duration(avg)}) + } +} + +// SortLatency blocks the output +func (stats *Stats) SortLatency() { + stats.sortLatency = true +} + +// Print writes textual output of the Stats. +func (stats *Stats) Print(w io.Writer) { + stats.maybeUpdate() + if stats.histogram == nil { + fmt.Fprint(w, "Histogram (empty)\n") + } else { + fmt.Fprintf(w, "Histogram (unit: %s)\n", fmt.Sprintf("%v", stats.unit)[1:]) + stats.histogram.PrintWithUnit(w, float64(stats.unit)) + } +} + +// String returns the textual output of the Stats as string. +func (stats *Stats) String() string { + var b bytes.Buffer + stats.Print(&b) + return b.String() +} diff --git a/vendor/google.golang.org/grpc/benchmark/stats/util.go b/vendor/google.golang.org/grpc/benchmark/stats/util.go new file mode 100644 index 0000000000..f3bb3a3647 --- /dev/null +++ b/vendor/google.golang.org/grpc/benchmark/stats/util.go @@ -0,0 +1,208 @@ +/* + * + * Copyright 2017 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. + * + */ + +package stats + +import ( + "bufio" + "bytes" + "fmt" + "os" + "runtime" + "sort" + "strings" + "sync" + "testing" +) + +var ( + curB *testing.B + curBenchName string + curStats map[string]*Stats + + orgStdout *os.File + nextOutPos int + + injectCond *sync.Cond + injectDone chan struct{} +) + +// AddStats adds a new unnamed Stats instance to the current benchmark. You need +// to run benchmarks by calling RunTestMain() to inject the stats to the +// benchmark results. If numBuckets is not positive, the default value (16) will +// be used. Please note that this calls b.ResetTimer() since it may be blocked +// until the previous benchmark stats is printed out. So AddStats() should +// typically be called at the very beginning of each benchmark function. +func AddStats(b *testing.B, numBuckets int) *Stats { + return AddStatsWithName(b, "", numBuckets) +} + +// AddStatsWithName adds a new named Stats instance to the current benchmark. +// With this, you can add multiple stats in a single benchmark. You need +// to run benchmarks by calling RunTestMain() to inject the stats to the +// benchmark results. If numBuckets is not positive, the default value (16) will +// be used. Please note that this calls b.ResetTimer() since it may be blocked +// until the previous benchmark stats is printed out. So AddStatsWithName() +// should typically be called at the very beginning of each benchmark function. +func AddStatsWithName(b *testing.B, name string, numBuckets int) *Stats { + var benchName string + for i := 1; ; i++ { + pc, _, _, ok := runtime.Caller(i) + if !ok { + panic("benchmark function not found") + } + p := strings.Split(runtime.FuncForPC(pc).Name(), ".") + benchName = p[len(p)-1] + if strings.HasPrefix(benchName, "run") { + break + } + } + procs := runtime.GOMAXPROCS(-1) + if procs != 1 { + benchName = fmt.Sprintf("%s-%d", benchName, procs) + } + + stats := NewStats(numBuckets) + + if injectCond != nil { + // We need to wait until the previous benchmark stats is printed out. + injectCond.L.Lock() + for curB != nil && curBenchName != benchName { + injectCond.Wait() + } + + curB = b + curBenchName = benchName + curStats[name] = stats + + injectCond.L.Unlock() + } + + b.ResetTimer() + return stats +} + +// RunTestMain runs the tests with enabling injection of benchmark stats. It +// returns an exit code to pass to os.Exit. +func RunTestMain(m *testing.M) int { + startStatsInjector() + defer stopStatsInjector() + return m.Run() +} + +// startStatsInjector starts stats injection to benchmark results. +func startStatsInjector() { + orgStdout = os.Stdout + r, w, _ := os.Pipe() + os.Stdout = w + nextOutPos = 0 + + resetCurBenchStats() + + injectCond = sync.NewCond(&sync.Mutex{}) + injectDone = make(chan struct{}) + go func() { + defer close(injectDone) + + scanner := bufio.NewScanner(r) + scanner.Split(splitLines) + for scanner.Scan() { + injectStatsIfFinished(scanner.Text()) + } + if err := scanner.Err(); err != nil { + panic(err) + } + }() +} + +// stopStatsInjector stops stats injection and restores os.Stdout. +func stopStatsInjector() { + os.Stdout.Close() + <-injectDone + injectCond = nil + os.Stdout = orgStdout +} + +// splitLines is a split function for a bufio.Scanner that returns each line +// of text, teeing texts to the original stdout even before each line ends. +func splitLines(data []byte, eof bool) (advance int, token []byte, err error) { + if eof && len(data) == 0 { + return 0, nil, nil + } + + if i := bytes.IndexByte(data, '\n'); i >= 0 { + orgStdout.Write(data[nextOutPos : i+1]) + nextOutPos = 0 + return i + 1, data[0:i], nil + } + + orgStdout.Write(data[nextOutPos:]) + nextOutPos = len(data) + + if eof { + // This is a final, non-terminated line. Return it. + return len(data), data, nil + } + + return 0, nil, nil +} + +// injectStatsIfFinished prints out the stats if the current benchmark finishes. +func injectStatsIfFinished(line string) { + injectCond.L.Lock() + defer injectCond.L.Unlock() + // We assume that the benchmark results start with "Benchmark". + if curB == nil || !strings.HasPrefix(line, "Benchmark") { + return + } + + if !curB.Failed() { + // Output all stats in alphabetical order. + names := make([]string, 0, len(curStats)) + for name := range curStats { + names = append(names, name) + } + sort.Strings(names) + for _, name := range names { + stats := curStats[name] + // The output of stats starts with a header like "Histogram (unit: ms)" + // followed by statistical properties and the buckets. Add the stats name + // if it is a named stats and indent them as Go testing outputs. + lines := strings.Split(stats.String(), "\n") + if n := len(lines); n > 0 { + if name != "" { + name = ": " + name + } + fmt.Fprintf(orgStdout, "--- %s%s\n", lines[0], name) + for _, line := range lines[1 : n-1] { + fmt.Fprintf(orgStdout, "\t%s\n", line) + } + } + } + } + + resetCurBenchStats() + injectCond.Signal() +} + +// resetCurBenchStats resets the current benchmark stats. +func resetCurBenchStats() { + curB = nil + curBenchName = "" + curStats = make(map[string]*Stats) +} diff --git a/vendor/google.golang.org/grpc/benchmark/worker/benchmark_client.go b/vendor/google.golang.org/grpc/benchmark/worker/benchmark_client.go new file mode 100644 index 0000000000..10d82aeebf --- /dev/null +++ b/vendor/google.golang.org/grpc/benchmark/worker/benchmark_client.go @@ -0,0 +1,391 @@ +/* + * + * Copyright 2016 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. + * + */ + +package main + +import ( + "flag" + "math" + "runtime" + "sync" + "syscall" + "time" + + "golang.org/x/net/context" + "google.golang.org/grpc" + "google.golang.org/grpc/benchmark" + testpb "google.golang.org/grpc/benchmark/grpc_testing" + "google.golang.org/grpc/benchmark/stats" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/status" + "google.golang.org/grpc/testdata" +) + +var caFile = flag.String("ca_file", "", "The file containing the CA root cert file") + +type lockingHistogram struct { + mu sync.Mutex + histogram *stats.Histogram +} + +func (h *lockingHistogram) add(value int64) { + h.mu.Lock() + defer h.mu.Unlock() + h.histogram.Add(value) +} + +// swap sets h.histogram to new, and returns its old value. +func (h *lockingHistogram) swap(new *stats.Histogram) *stats.Histogram { + h.mu.Lock() + defer h.mu.Unlock() + old := h.histogram + h.histogram = new + return old +} + +func (h *lockingHistogram) mergeInto(merged *stats.Histogram) { + h.mu.Lock() + defer h.mu.Unlock() + merged.Merge(h.histogram) +} + +type benchmarkClient struct { + closeConns func() + stop chan bool + lastResetTime time.Time + histogramOptions stats.HistogramOptions + lockingHistograms []lockingHistogram + rusageLastReset *syscall.Rusage +} + +func printClientConfig(config *testpb.ClientConfig) { + // Some config options are ignored: + // - client type: + // will always create sync client + // - async client threads. + // - core list + grpclog.Printf(" * client type: %v (ignored, always creates sync client)", config.ClientType) + grpclog.Printf(" * async client threads: %v (ignored)", config.AsyncClientThreads) + // TODO: use cores specified by CoreList when setting list of cores is supported in go. + grpclog.Printf(" * core list: %v (ignored)", config.CoreList) + + grpclog.Printf(" - security params: %v", config.SecurityParams) + grpclog.Printf(" - core limit: %v", config.CoreLimit) + grpclog.Printf(" - payload config: %v", config.PayloadConfig) + grpclog.Printf(" - rpcs per chann: %v", config.OutstandingRpcsPerChannel) + grpclog.Printf(" - channel number: %v", config.ClientChannels) + grpclog.Printf(" - load params: %v", config.LoadParams) + grpclog.Printf(" - rpc type: %v", config.RpcType) + grpclog.Printf(" - histogram params: %v", config.HistogramParams) + grpclog.Printf(" - server targets: %v", config.ServerTargets) +} + +func setupClientEnv(config *testpb.ClientConfig) { + // Use all cpu cores available on machine by default. + // TODO: Revisit this for the optimal default setup. + if config.CoreLimit > 0 { + runtime.GOMAXPROCS(int(config.CoreLimit)) + } else { + runtime.GOMAXPROCS(runtime.NumCPU()) + } +} + +// createConns creates connections according to given config. +// It returns the connections and corresponding function to close them. +// It returns non-nil error if there is anything wrong. +func createConns(config *testpb.ClientConfig) ([]*grpc.ClientConn, func(), error) { + var opts []grpc.DialOption + + // Sanity check for client type. + switch config.ClientType { + case testpb.ClientType_SYNC_CLIENT: + case testpb.ClientType_ASYNC_CLIENT: + default: + return nil, nil, status.Errorf(codes.InvalidArgument, "unknow client type: %v", config.ClientType) + } + + // Check and set security options. + if config.SecurityParams != nil { + if *caFile == "" { + *caFile = testdata.Path("ca.pem") + } + creds, err := credentials.NewClientTLSFromFile(*caFile, config.SecurityParams.ServerHostOverride) + if err != nil { + return nil, nil, status.Errorf(codes.InvalidArgument, "failed to create TLS credentials %v", err) + } + opts = append(opts, grpc.WithTransportCredentials(creds)) + } else { + opts = append(opts, grpc.WithInsecure()) + } + + // Use byteBufCodec if it is required. + if config.PayloadConfig != nil { + switch config.PayloadConfig.Payload.(type) { + case *testpb.PayloadConfig_BytebufParams: + opts = append(opts, grpc.WithCodec(byteBufCodec{})) + case *testpb.PayloadConfig_SimpleParams: + default: + return nil, nil, status.Errorf(codes.InvalidArgument, "unknow payload config: %v", config.PayloadConfig) + } + } + + // Create connections. + connCount := int(config.ClientChannels) + conns := make([]*grpc.ClientConn, connCount, connCount) + for connIndex := 0; connIndex < connCount; connIndex++ { + conns[connIndex] = benchmark.NewClientConn(config.ServerTargets[connIndex%len(config.ServerTargets)], opts...) + } + + return conns, func() { + for _, conn := range conns { + conn.Close() + } + }, nil +} + +func performRPCs(config *testpb.ClientConfig, conns []*grpc.ClientConn, bc *benchmarkClient) error { + // Read payload size and type from config. + var ( + payloadReqSize, payloadRespSize int + payloadType string + ) + if config.PayloadConfig != nil { + switch c := config.PayloadConfig.Payload.(type) { + case *testpb.PayloadConfig_BytebufParams: + payloadReqSize = int(c.BytebufParams.ReqSize) + payloadRespSize = int(c.BytebufParams.RespSize) + payloadType = "bytebuf" + case *testpb.PayloadConfig_SimpleParams: + payloadReqSize = int(c.SimpleParams.ReqSize) + payloadRespSize = int(c.SimpleParams.RespSize) + payloadType = "protobuf" + default: + return status.Errorf(codes.InvalidArgument, "unknow payload config: %v", config.PayloadConfig) + } + } + + // TODO add open loop distribution. + switch config.LoadParams.Load.(type) { + case *testpb.LoadParams_ClosedLoop: + case *testpb.LoadParams_Poisson: + return status.Errorf(codes.Unimplemented, "unsupported load params: %v", config.LoadParams) + default: + return status.Errorf(codes.InvalidArgument, "unknown load params: %v", config.LoadParams) + } + + rpcCountPerConn := int(config.OutstandingRpcsPerChannel) + + switch config.RpcType { + case testpb.RpcType_UNARY: + bc.doCloseLoopUnary(conns, rpcCountPerConn, payloadReqSize, payloadRespSize) + // TODO open loop. + case testpb.RpcType_STREAMING: + bc.doCloseLoopStreaming(conns, rpcCountPerConn, payloadReqSize, payloadRespSize, payloadType) + // TODO open loop. + default: + return status.Errorf(codes.InvalidArgument, "unknown rpc type: %v", config.RpcType) + } + + return nil +} + +func startBenchmarkClient(config *testpb.ClientConfig) (*benchmarkClient, error) { + printClientConfig(config) + + // Set running environment like how many cores to use. + setupClientEnv(config) + + conns, closeConns, err := createConns(config) + if err != nil { + return nil, err + } + + rusage := new(syscall.Rusage) + syscall.Getrusage(syscall.RUSAGE_SELF, rusage) + + rpcCountPerConn := int(config.OutstandingRpcsPerChannel) + bc := &benchmarkClient{ + histogramOptions: stats.HistogramOptions{ + NumBuckets: int(math.Log(config.HistogramParams.MaxPossible)/math.Log(1+config.HistogramParams.Resolution)) + 1, + GrowthFactor: config.HistogramParams.Resolution, + BaseBucketSize: (1 + config.HistogramParams.Resolution), + MinValue: 0, + }, + lockingHistograms: make([]lockingHistogram, rpcCountPerConn*len(conns), rpcCountPerConn*len(conns)), + + stop: make(chan bool), + lastResetTime: time.Now(), + closeConns: closeConns, + rusageLastReset: rusage, + } + + if err = performRPCs(config, conns, bc); err != nil { + // Close all connections if performRPCs failed. + closeConns() + return nil, err + } + + return bc, nil +} + +func (bc *benchmarkClient) doCloseLoopUnary(conns []*grpc.ClientConn, rpcCountPerConn int, reqSize int, respSize int) { + for ic, conn := range conns { + client := testpb.NewBenchmarkServiceClient(conn) + // For each connection, create rpcCountPerConn goroutines to do rpc. + for j := 0; j < rpcCountPerConn; j++ { + // Create histogram for each goroutine. + idx := ic*rpcCountPerConn + j + bc.lockingHistograms[idx].histogram = stats.NewHistogram(bc.histogramOptions) + // Start goroutine on the created mutex and histogram. + go func(idx int) { + // TODO: do warm up if necessary. + // Now relying on worker client to reserve time to do warm up. + // The worker client needs to wait for some time after client is created, + // before starting benchmark. + done := make(chan bool) + for { + go func() { + start := time.Now() + if err := benchmark.DoUnaryCall(client, reqSize, respSize); err != nil { + select { + case <-bc.stop: + case done <- false: + } + return + } + elapse := time.Since(start) + bc.lockingHistograms[idx].add(int64(elapse)) + select { + case <-bc.stop: + case done <- true: + } + }() + select { + case <-bc.stop: + return + case <-done: + } + } + }(idx) + } + } +} + +func (bc *benchmarkClient) doCloseLoopStreaming(conns []*grpc.ClientConn, rpcCountPerConn int, reqSize int, respSize int, payloadType string) { + var doRPC func(testpb.BenchmarkService_StreamingCallClient, int, int) error + if payloadType == "bytebuf" { + doRPC = benchmark.DoByteBufStreamingRoundTrip + } else { + doRPC = benchmark.DoStreamingRoundTrip + } + for ic, conn := range conns { + // For each connection, create rpcCountPerConn goroutines to do rpc. + for j := 0; j < rpcCountPerConn; j++ { + c := testpb.NewBenchmarkServiceClient(conn) + stream, err := c.StreamingCall(context.Background()) + if err != nil { + grpclog.Fatalf("%v.StreamingCall(_) = _, %v", c, err) + } + // Create histogram for each goroutine. + idx := ic*rpcCountPerConn + j + bc.lockingHistograms[idx].histogram = stats.NewHistogram(bc.histogramOptions) + // Start goroutine on the created mutex and histogram. + go func(idx int) { + // TODO: do warm up if necessary. + // Now relying on worker client to reserve time to do warm up. + // The worker client needs to wait for some time after client is created, + // before starting benchmark. + for { + start := time.Now() + if err := doRPC(stream, reqSize, respSize); err != nil { + return + } + elapse := time.Since(start) + bc.lockingHistograms[idx].add(int64(elapse)) + select { + case <-bc.stop: + return + default: + } + } + }(idx) + } + } +} + +// getStats returns the stats for benchmark client. +// It resets lastResetTime and all histograms if argument reset is true. +func (bc *benchmarkClient) getStats(reset bool) *testpb.ClientStats { + var wallTimeElapsed, uTimeElapsed, sTimeElapsed float64 + mergedHistogram := stats.NewHistogram(bc.histogramOptions) + latestRusage := new(syscall.Rusage) + + if reset { + // Merging histogram may take some time. + // Put all histograms aside and merge later. + toMerge := make([]*stats.Histogram, len(bc.lockingHistograms), len(bc.lockingHistograms)) + for i := range bc.lockingHistograms { + toMerge[i] = bc.lockingHistograms[i].swap(stats.NewHistogram(bc.histogramOptions)) + } + + for i := 0; i < len(toMerge); i++ { + mergedHistogram.Merge(toMerge[i]) + } + + wallTimeElapsed = time.Since(bc.lastResetTime).Seconds() + syscall.Getrusage(syscall.RUSAGE_SELF, latestRusage) + uTimeElapsed, sTimeElapsed = cpuTimeDiff(bc.rusageLastReset, latestRusage) + + bc.rusageLastReset = latestRusage + bc.lastResetTime = time.Now() + } else { + // Merge only, not reset. + for i := range bc.lockingHistograms { + bc.lockingHistograms[i].mergeInto(mergedHistogram) + } + + wallTimeElapsed = time.Since(bc.lastResetTime).Seconds() + syscall.Getrusage(syscall.RUSAGE_SELF, latestRusage) + uTimeElapsed, sTimeElapsed = cpuTimeDiff(bc.rusageLastReset, latestRusage) + } + + b := make([]uint32, len(mergedHistogram.Buckets), len(mergedHistogram.Buckets)) + for i, v := range mergedHistogram.Buckets { + b[i] = uint32(v.Count) + } + return &testpb.ClientStats{ + Latencies: &testpb.HistogramData{ + Bucket: b, + MinSeen: float64(mergedHistogram.Min), + MaxSeen: float64(mergedHistogram.Max), + Sum: float64(mergedHistogram.Sum), + SumOfSquares: float64(mergedHistogram.SumOfSquares), + Count: float64(mergedHistogram.Count), + }, + TimeElapsed: wallTimeElapsed, + TimeUser: uTimeElapsed, + TimeSystem: sTimeElapsed, + } +} + +func (bc *benchmarkClient) shutdown() { + close(bc.stop) + bc.closeConns() +} diff --git a/vendor/google.golang.org/grpc/benchmark/worker/benchmark_server.go b/vendor/google.golang.org/grpc/benchmark/worker/benchmark_server.go new file mode 100644 index 0000000000..f130efdec8 --- /dev/null +++ b/vendor/google.golang.org/grpc/benchmark/worker/benchmark_server.go @@ -0,0 +1,185 @@ +/* + * + * Copyright 2016 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. + * + */ + +package main + +import ( + "flag" + "runtime" + "strconv" + "strings" + "sync" + "syscall" + "time" + + "google.golang.org/grpc" + "google.golang.org/grpc/benchmark" + testpb "google.golang.org/grpc/benchmark/grpc_testing" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/status" + "google.golang.org/grpc/testdata" +) + +var ( + certFile = flag.String("tls_cert_file", "", "The TLS cert file") + keyFile = flag.String("tls_key_file", "", "The TLS key file") +) + +type benchmarkServer struct { + port int + cores int + closeFunc func() + mu sync.RWMutex + lastResetTime time.Time + rusageLastReset *syscall.Rusage +} + +func printServerConfig(config *testpb.ServerConfig) { + // Some config options are ignored: + // - server type: + // will always start sync server + // - async server threads + // - core list + grpclog.Printf(" * server type: %v (ignored, always starts sync server)", config.ServerType) + grpclog.Printf(" * async server threads: %v (ignored)", config.AsyncServerThreads) + // TODO: use cores specified by CoreList when setting list of cores is supported in go. + grpclog.Printf(" * core list: %v (ignored)", config.CoreList) + + grpclog.Printf(" - security params: %v", config.SecurityParams) + grpclog.Printf(" - core limit: %v", config.CoreLimit) + grpclog.Printf(" - port: %v", config.Port) + grpclog.Printf(" - payload config: %v", config.PayloadConfig) +} + +func startBenchmarkServer(config *testpb.ServerConfig, serverPort int) (*benchmarkServer, error) { + printServerConfig(config) + + // Use all cpu cores available on machine by default. + // TODO: Revisit this for the optimal default setup. + numOfCores := runtime.NumCPU() + if config.CoreLimit > 0 { + numOfCores = int(config.CoreLimit) + } + runtime.GOMAXPROCS(numOfCores) + + var opts []grpc.ServerOption + + // Sanity check for server type. + switch config.ServerType { + case testpb.ServerType_SYNC_SERVER: + case testpb.ServerType_ASYNC_SERVER: + case testpb.ServerType_ASYNC_GENERIC_SERVER: + default: + return nil, status.Errorf(codes.InvalidArgument, "unknow server type: %v", config.ServerType) + } + + // Set security options. + if config.SecurityParams != nil { + if *certFile == "" { + *certFile = testdata.Path("server1.pem") + } + if *keyFile == "" { + *keyFile = testdata.Path("server1.key") + } + creds, err := credentials.NewServerTLSFromFile(*certFile, *keyFile) + if err != nil { + grpclog.Fatalf("failed to generate credentials %v", err) + } + opts = append(opts, grpc.Creds(creds)) + } + + // Priority: config.Port > serverPort > default (0). + port := int(config.Port) + if port == 0 { + port = serverPort + } + + // Create different benchmark server according to config. + var ( + addr string + closeFunc func() + err error + ) + if config.PayloadConfig != nil { + switch payload := config.PayloadConfig.Payload.(type) { + case *testpb.PayloadConfig_BytebufParams: + opts = append(opts, grpc.CustomCodec(byteBufCodec{})) + addr, closeFunc = benchmark.StartServer(benchmark.ServerInfo{ + Addr: ":" + strconv.Itoa(port), + Type: "bytebuf", + Metadata: payload.BytebufParams.RespSize, + }, opts...) + case *testpb.PayloadConfig_SimpleParams: + addr, closeFunc = benchmark.StartServer(benchmark.ServerInfo{ + Addr: ":" + strconv.Itoa(port), + Type: "protobuf", + }, opts...) + case *testpb.PayloadConfig_ComplexParams: + return nil, status.Errorf(codes.Unimplemented, "unsupported payload config: %v", config.PayloadConfig) + default: + return nil, status.Errorf(codes.InvalidArgument, "unknow payload config: %v", config.PayloadConfig) + } + } else { + // Start protobuf server if payload config is nil. + addr, closeFunc = benchmark.StartServer(benchmark.ServerInfo{ + Addr: ":" + strconv.Itoa(port), + Type: "protobuf", + }, opts...) + } + + grpclog.Printf("benchmark server listening at %v", addr) + addrSplitted := strings.Split(addr, ":") + p, err := strconv.Atoi(addrSplitted[len(addrSplitted)-1]) + if err != nil { + grpclog.Fatalf("failed to get port number from server address: %v", err) + } + + rusage := new(syscall.Rusage) + syscall.Getrusage(syscall.RUSAGE_SELF, rusage) + + return &benchmarkServer{ + port: p, + cores: numOfCores, + closeFunc: closeFunc, + lastResetTime: time.Now(), + rusageLastReset: rusage, + }, nil +} + +// getStats returns the stats for benchmark server. +// It resets lastResetTime if argument reset is true. +func (bs *benchmarkServer) getStats(reset bool) *testpb.ServerStats { + bs.mu.RLock() + defer bs.mu.RUnlock() + wallTimeElapsed := time.Since(bs.lastResetTime).Seconds() + rusageLatest := new(syscall.Rusage) + syscall.Getrusage(syscall.RUSAGE_SELF, rusageLatest) + uTimeElapsed, sTimeElapsed := cpuTimeDiff(bs.rusageLastReset, rusageLatest) + + if reset { + bs.lastResetTime = time.Now() + bs.rusageLastReset = rusageLatest + } + return &testpb.ServerStats{ + TimeElapsed: wallTimeElapsed, + TimeUser: uTimeElapsed, + TimeSystem: sTimeElapsed, + } +} diff --git a/vendor/google.golang.org/grpc/benchmark/worker/main.go b/vendor/google.golang.org/grpc/benchmark/worker/main.go new file mode 100644 index 0000000000..246d452abf --- /dev/null +++ b/vendor/google.golang.org/grpc/benchmark/worker/main.go @@ -0,0 +1,230 @@ +/* + * + * Copyright 2016 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. + * + */ + +package main + +import ( + "flag" + "fmt" + "io" + "net" + "net/http" + _ "net/http/pprof" + "runtime" + "strconv" + "time" + + "golang.org/x/net/context" + "google.golang.org/grpc" + testpb "google.golang.org/grpc/benchmark/grpc_testing" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/status" +) + +var ( + driverPort = flag.Int("driver_port", 10000, "port for communication with driver") + serverPort = flag.Int("server_port", 0, "port for benchmark server if not specified by server config message") + pprofPort = flag.Int("pprof_port", -1, "Port for pprof debug server to listen on. Pprof server doesn't start if unset") + blockProfRate = flag.Int("block_prof_rate", 0, "fraction of goroutine blocking events to report in blocking profile") +) + +type byteBufCodec struct { +} + +func (byteBufCodec) Marshal(v interface{}) ([]byte, error) { + b, ok := v.(*[]byte) + if !ok { + return nil, fmt.Errorf("failed to marshal: %v is not type of *[]byte", v) + } + return *b, nil +} + +func (byteBufCodec) Unmarshal(data []byte, v interface{}) error { + b, ok := v.(*[]byte) + if !ok { + return fmt.Errorf("failed to marshal: %v is not type of *[]byte", v) + } + *b = data + return nil +} + +func (byteBufCodec) String() string { + return "bytebuffer" +} + +// workerServer implements WorkerService rpc handlers. +// It can create benchmarkServer or benchmarkClient on demand. +type workerServer struct { + stop chan<- bool + serverPort int +} + +func (s *workerServer) RunServer(stream testpb.WorkerService_RunServerServer) error { + var bs *benchmarkServer + defer func() { + // Close benchmark server when stream ends. + grpclog.Printf("closing benchmark server") + if bs != nil { + bs.closeFunc() + } + }() + for { + in, err := stream.Recv() + if err == io.EOF { + return nil + } + if err != nil { + return err + } + + var out *testpb.ServerStatus + switch argtype := in.Argtype.(type) { + case *testpb.ServerArgs_Setup: + grpclog.Printf("server setup received:") + if bs != nil { + grpclog.Printf("server setup received when server already exists, closing the existing server") + bs.closeFunc() + } + bs, err = startBenchmarkServer(argtype.Setup, s.serverPort) + if err != nil { + return err + } + out = &testpb.ServerStatus{ + Stats: bs.getStats(false), + Port: int32(bs.port), + Cores: int32(bs.cores), + } + + case *testpb.ServerArgs_Mark: + grpclog.Printf("server mark received:") + grpclog.Printf(" - %v", argtype) + if bs == nil { + return status.Error(codes.InvalidArgument, "server does not exist when mark received") + } + out = &testpb.ServerStatus{ + Stats: bs.getStats(argtype.Mark.Reset_), + Port: int32(bs.port), + Cores: int32(bs.cores), + } + } + + if err := stream.Send(out); err != nil { + return err + } + } +} + +func (s *workerServer) RunClient(stream testpb.WorkerService_RunClientServer) error { + var bc *benchmarkClient + defer func() { + // Shut down benchmark client when stream ends. + grpclog.Printf("shuting down benchmark client") + if bc != nil { + bc.shutdown() + } + }() + for { + in, err := stream.Recv() + if err == io.EOF { + return nil + } + if err != nil { + return err + } + + var out *testpb.ClientStatus + switch t := in.Argtype.(type) { + case *testpb.ClientArgs_Setup: + grpclog.Printf("client setup received:") + if bc != nil { + grpclog.Printf("client setup received when client already exists, shuting down the existing client") + bc.shutdown() + } + bc, err = startBenchmarkClient(t.Setup) + if err != nil { + return err + } + out = &testpb.ClientStatus{ + Stats: bc.getStats(false), + } + + case *testpb.ClientArgs_Mark: + grpclog.Printf("client mark received:") + grpclog.Printf(" - %v", t) + if bc == nil { + return status.Error(codes.InvalidArgument, "client does not exist when mark received") + } + out = &testpb.ClientStatus{ + Stats: bc.getStats(t.Mark.Reset_), + } + } + + if err := stream.Send(out); err != nil { + return err + } + } +} + +func (s *workerServer) CoreCount(ctx context.Context, in *testpb.CoreRequest) (*testpb.CoreResponse, error) { + grpclog.Printf("core count: %v", runtime.NumCPU()) + return &testpb.CoreResponse{Cores: int32(runtime.NumCPU())}, nil +} + +func (s *workerServer) QuitWorker(ctx context.Context, in *testpb.Void) (*testpb.Void, error) { + grpclog.Printf("quiting worker") + s.stop <- true + return &testpb.Void{}, nil +} + +func main() { + grpc.EnableTracing = false + + flag.Parse() + lis, err := net.Listen("tcp", ":"+strconv.Itoa(*driverPort)) + if err != nil { + grpclog.Fatalf("failed to listen: %v", err) + } + grpclog.Printf("worker listening at port %v", *driverPort) + + s := grpc.NewServer() + stop := make(chan bool) + testpb.RegisterWorkerServiceServer(s, &workerServer{ + stop: stop, + serverPort: *serverPort, + }) + + go func() { + <-stop + // Wait for 1 second before stopping the server to make sure the return value of QuitWorker is sent to client. + // TODO revise this once server graceful stop is supported in gRPC. + time.Sleep(time.Second) + s.Stop() + }() + + runtime.SetBlockProfileRate(*blockProfRate) + + if *pprofPort >= 0 { + go func() { + grpclog.Println("Starting pprof server on port " + strconv.Itoa(*pprofPort)) + grpclog.Println(http.ListenAndServe("localhost:"+strconv.Itoa(*pprofPort), nil)) + }() + } + + s.Serve(lis) +} diff --git a/vendor/google.golang.org/grpc/benchmark/worker/util.go b/vendor/google.golang.org/grpc/benchmark/worker/util.go new file mode 100644 index 0000000000..f26993e654 --- /dev/null +++ b/vendor/google.golang.org/grpc/benchmark/worker/util.go @@ -0,0 +1,35 @@ +/* + * + * Copyright 2016 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. + * + */ + +package main + +import "syscall" + +func cpuTimeDiff(first *syscall.Rusage, latest *syscall.Rusage) (float64, float64) { + var ( + utimeDiffs = latest.Utime.Sec - first.Utime.Sec + utimeDiffus = latest.Utime.Usec - first.Utime.Usec + stimeDiffs = latest.Stime.Sec - first.Stime.Sec + stimeDiffus = latest.Stime.Usec - first.Stime.Usec + ) + + uTimeElapsed := float64(utimeDiffs) + float64(utimeDiffus)*1.0e-6 + sTimeElapsed := float64(stimeDiffs) + float64(stimeDiffus)*1.0e-6 + + return uTimeElapsed, sTimeElapsed +} diff --git a/vendor/google.golang.org/grpc/call.go b/vendor/google.golang.org/grpc/call.go new file mode 100644 index 0000000000..0854f84b94 --- /dev/null +++ b/vendor/google.golang.org/grpc/call.go @@ -0,0 +1,344 @@ +/* + * + * Copyright 2014 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. + * + */ + +package grpc + +import ( + "io" + "time" + + "golang.org/x/net/context" + "golang.org/x/net/trace" + "google.golang.org/grpc/balancer" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/encoding" + "google.golang.org/grpc/peer" + "google.golang.org/grpc/stats" + "google.golang.org/grpc/transport" +) + +// recvResponse receives and parses an RPC response. +// On error, it returns the error and indicates whether the call should be retried. +// +// TODO(zhaoq): Check whether the received message sequence is valid. +// TODO ctx is used for stats collection and processing. It is the context passed from the application. +func recvResponse(ctx context.Context, dopts dialOptions, t transport.ClientTransport, c *callInfo, stream *transport.Stream, reply interface{}) (err error) { + // Try to acquire header metadata from the server if there is any. + defer func() { + if err != nil { + if _, ok := err.(transport.ConnectionError); !ok { + t.CloseStream(stream, err) + } + } + }() + c.headerMD, err = stream.Header() + if err != nil { + return + } + p := &parser{r: stream} + var inPayload *stats.InPayload + if dopts.copts.StatsHandler != nil { + inPayload = &stats.InPayload{ + Client: true, + } + } + for { + if c.maxReceiveMessageSize == nil { + return Errorf(codes.Internal, "callInfo maxReceiveMessageSize field uninitialized(nil)") + } + + // Set dc if it exists and matches the message compression type used, + // otherwise set comp if a registered compressor exists for it. + var comp encoding.Compressor + var dc Decompressor + if rc := stream.RecvCompress(); dopts.dc != nil && dopts.dc.Type() == rc { + dc = dopts.dc + } else if rc != "" && rc != encoding.Identity { + comp = encoding.GetCompressor(rc) + } + if err = recv(p, dopts.codec, stream, dc, reply, *c.maxReceiveMessageSize, inPayload, comp); err != nil { + if err == io.EOF { + break + } + return + } + } + if inPayload != nil && err == io.EOF && stream.Status().Code() == codes.OK { + // TODO in the current implementation, inTrailer may be handled before inPayload in some cases. + // Fix the order if necessary. + dopts.copts.StatsHandler.HandleRPC(ctx, inPayload) + } + c.trailerMD = stream.Trailer() + return nil +} + +// sendRequest writes out various information of an RPC such as Context and Message. +func sendRequest(ctx context.Context, dopts dialOptions, compressor Compressor, c *callInfo, callHdr *transport.CallHdr, stream *transport.Stream, t transport.ClientTransport, args interface{}, opts *transport.Options) (err error) { + defer func() { + if err != nil { + // If err is connection error, t will be closed, no need to close stream here. + if _, ok := err.(transport.ConnectionError); !ok { + t.CloseStream(stream, err) + } + } + }() + var ( + outPayload *stats.OutPayload + ) + if dopts.copts.StatsHandler != nil { + outPayload = &stats.OutPayload{ + Client: true, + } + } + // Set comp and clear compressor if a registered compressor matches the type + // specified via UseCompressor. (And error if a matching compressor is not + // registered.) + var comp encoding.Compressor + if ct := c.compressorType; ct != "" && ct != encoding.Identity { + compressor = nil // Disable the legacy compressor. + comp = encoding.GetCompressor(ct) + if comp == nil { + return Errorf(codes.Internal, "grpc: Compressor is not installed for grpc-encoding %q", ct) + } + } + hdr, data, err := encode(dopts.codec, args, compressor, outPayload, comp) + if err != nil { + return err + } + if c.maxSendMessageSize == nil { + return Errorf(codes.Internal, "callInfo maxSendMessageSize field uninitialized(nil)") + } + if len(data) > *c.maxSendMessageSize { + return Errorf(codes.ResourceExhausted, "grpc: trying to send message larger than max (%d vs. %d)", len(data), *c.maxSendMessageSize) + } + err = t.Write(stream, hdr, data, opts) + if err == nil && outPayload != nil { + outPayload.SentTime = time.Now() + dopts.copts.StatsHandler.HandleRPC(ctx, outPayload) + } + // t.NewStream(...) could lead to an early rejection of the RPC (e.g., the service/method + // does not exist.) so that t.Write could get io.EOF from wait(...). Leave the following + // recvResponse to get the final status. + if err != nil && err != io.EOF { + return err + } + // Sent successfully. + return nil +} + +// Invoke sends the RPC request on the wire and returns after response is +// received. This is typically called by generated code. +func (cc *ClientConn) Invoke(ctx context.Context, method string, args, reply interface{}, opts ...CallOption) error { + if cc.dopts.unaryInt != nil { + return cc.dopts.unaryInt(ctx, method, args, reply, cc, invoke, opts...) + } + return invoke(ctx, method, args, reply, cc, opts...) +} + +// Invoke sends the RPC request on the wire and returns after response is +// received. This is typically called by generated code. +// +// DEPRECATED: Use ClientConn.Invoke instead. +func Invoke(ctx context.Context, method string, args, reply interface{}, cc *ClientConn, opts ...CallOption) error { + return cc.Invoke(ctx, method, args, reply, opts...) +} + +func invoke(ctx context.Context, method string, args, reply interface{}, cc *ClientConn, opts ...CallOption) (e error) { + c := defaultCallInfo() + mc := cc.GetMethodConfig(method) + if mc.WaitForReady != nil { + c.failFast = !*mc.WaitForReady + } + + if mc.Timeout != nil && *mc.Timeout >= 0 { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *mc.Timeout) + defer cancel() + } + + opts = append(cc.dopts.callOptions, opts...) + for _, o := range opts { + if err := o.before(c); err != nil { + return toRPCErr(err) + } + } + defer func() { + for _, o := range opts { + o.after(c) + } + }() + + c.maxSendMessageSize = getMaxSize(mc.MaxReqSize, c.maxSendMessageSize, defaultClientMaxSendMessageSize) + c.maxReceiveMessageSize = getMaxSize(mc.MaxRespSize, c.maxReceiveMessageSize, defaultClientMaxReceiveMessageSize) + + if EnableTracing { + c.traceInfo.tr = trace.New("grpc.Sent."+methodFamily(method), method) + defer c.traceInfo.tr.Finish() + c.traceInfo.firstLine.client = true + if deadline, ok := ctx.Deadline(); ok { + c.traceInfo.firstLine.deadline = deadline.Sub(time.Now()) + } + c.traceInfo.tr.LazyLog(&c.traceInfo.firstLine, false) + // TODO(dsymonds): Arrange for c.traceInfo.firstLine.remoteAddr to be set. + defer func() { + if e != nil { + c.traceInfo.tr.LazyLog(&fmtStringer{"%v", []interface{}{e}}, true) + c.traceInfo.tr.SetError() + } + }() + } + ctx = newContextWithRPCInfo(ctx, c.failFast) + sh := cc.dopts.copts.StatsHandler + if sh != nil { + ctx = sh.TagRPC(ctx, &stats.RPCTagInfo{FullMethodName: method, FailFast: c.failFast}) + begin := &stats.Begin{ + Client: true, + BeginTime: time.Now(), + FailFast: c.failFast, + } + sh.HandleRPC(ctx, begin) + defer func() { + end := &stats.End{ + Client: true, + EndTime: time.Now(), + Error: e, + } + sh.HandleRPC(ctx, end) + }() + } + topts := &transport.Options{ + Last: true, + Delay: false, + } + callHdr := &transport.CallHdr{ + Host: cc.authority, + Method: method, + } + if c.creds != nil { + callHdr.Creds = c.creds + } + if c.compressorType != "" { + callHdr.SendCompress = c.compressorType + } else if cc.dopts.cp != nil { + callHdr.SendCompress = cc.dopts.cp.Type() + } + firstAttempt := true + + for { + // Check to make sure the context has expired. This will prevent us from + // looping forever if an error occurs for wait-for-ready RPCs where no data + // is sent on the wire. + select { + case <-ctx.Done(): + return toRPCErr(ctx.Err()) + default: + } + + // Record the done handler from Balancer.Get(...). It is called once the + // RPC has completed or failed. + t, done, err := cc.getTransport(ctx, c.failFast) + if err != nil { + return err + } + stream, err := t.NewStream(ctx, callHdr) + if err != nil { + if done != nil { + done(balancer.DoneInfo{Err: err}) + } + // In the event of any error from NewStream, we never attempted to write + // anything to the wire, so we can retry indefinitely for non-fail-fast + // RPCs. + if !c.failFast { + continue + } + return toRPCErr(err) + } + if peer, ok := peer.FromContext(stream.Context()); ok { + c.peer = peer + } + if c.traceInfo.tr != nil { + c.traceInfo.tr.LazyLog(&payload{sent: true, msg: args}, true) + } + err = sendRequest(ctx, cc.dopts, cc.dopts.cp, c, callHdr, stream, t, args, topts) + if err != nil { + if done != nil { + updateRPCInfoInContext(ctx, rpcInfo{ + bytesSent: true, + bytesReceived: stream.BytesReceived(), + }) + done(balancer.DoneInfo{Err: err}) + } + // Retry a non-failfast RPC when + // i) the server started to drain before this RPC was initiated. + // ii) the server refused the stream. + if !c.failFast && stream.Unprocessed() { + // In this case, the server did not receive the data, but we still + // created wire traffic, so we should not retry indefinitely. + if firstAttempt { + // TODO: Add a field to header for grpc-transparent-retry-attempts + firstAttempt = false + continue + } + // Otherwise, give up and return an error anyway. + } + return toRPCErr(err) + } + err = recvResponse(ctx, cc.dopts, t, c, stream, reply) + if err != nil { + if done != nil { + updateRPCInfoInContext(ctx, rpcInfo{ + bytesSent: true, + bytesReceived: stream.BytesReceived(), + }) + done(balancer.DoneInfo{Err: err}) + } + if !c.failFast && stream.Unprocessed() { + // In these cases, the server did not receive the data, but we still + // created wire traffic, so we should not retry indefinitely. + if firstAttempt { + // TODO: Add a field to header for grpc-transparent-retry-attempts + firstAttempt = false + continue + } + // Otherwise, give up and return an error anyway. + } + return toRPCErr(err) + } + if c.traceInfo.tr != nil { + c.traceInfo.tr.LazyLog(&payload{sent: false, msg: reply}, true) + } + t.CloseStream(stream, nil) + if done != nil { + updateRPCInfoInContext(ctx, rpcInfo{ + bytesSent: true, + bytesReceived: stream.BytesReceived(), + }) + done(balancer.DoneInfo{Err: err}) + } + if !c.failFast && stream.Unprocessed() { + // In these cases, the server did not receive the data, but we still + // created wire traffic, so we should not retry indefinitely. + if firstAttempt { + // TODO: Add a field to header for grpc-transparent-retry-attempts + firstAttempt = false + continue + } + } + return stream.Status().Err() + } +} diff --git a/vendor/google.golang.org/grpc/call_test.go b/vendor/google.golang.org/grpc/call_test.go new file mode 100644 index 0000000000..f48d30e879 --- /dev/null +++ b/vendor/google.golang.org/grpc/call_test.go @@ -0,0 +1,292 @@ +/* + * + * Copyright 2014 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. + * + */ + +package grpc + +import ( + "fmt" + "io" + "math" + "net" + "strconv" + "strings" + "sync" + "testing" + "time" + + "golang.org/x/net/context" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/grpc/test/leakcheck" + "google.golang.org/grpc/transport" +) + +var ( + expectedRequest = "ping" + expectedResponse = "pong" + weirdError = "format verbs: %v%s" + sizeLargeErr = 1024 * 1024 + canceled = 0 +) + +type testCodec struct { +} + +func (testCodec) Marshal(v interface{}) ([]byte, error) { + return []byte(*(v.(*string))), nil +} + +func (testCodec) Unmarshal(data []byte, v interface{}) error { + *(v.(*string)) = string(data) + return nil +} + +func (testCodec) String() string { + return "test" +} + +type testStreamHandler struct { + port string + t transport.ServerTransport +} + +func (h *testStreamHandler) handleStream(t *testing.T, s *transport.Stream) { + p := &parser{r: s} + for { + pf, req, err := p.recvMsg(math.MaxInt32) + if err == io.EOF { + break + } + if err != nil { + return + } + if pf != compressionNone { + t.Errorf("Received the mistaken message format %d, want %d", pf, compressionNone) + return + } + var v string + codec := testCodec{} + if err := codec.Unmarshal(req, &v); err != nil { + t.Errorf("Failed to unmarshal the received message: %v", err) + return + } + if v == "weird error" { + h.t.WriteStatus(s, status.New(codes.Internal, weirdError)) + return + } + if v == "canceled" { + canceled++ + h.t.WriteStatus(s, status.New(codes.Internal, "")) + return + } + if v == "port" { + h.t.WriteStatus(s, status.New(codes.Internal, h.port)) + return + } + + if v != expectedRequest { + h.t.WriteStatus(s, status.New(codes.Internal, strings.Repeat("A", sizeLargeErr))) + return + } + } + // send a response back to end the stream. + hdr, data, err := encode(testCodec{}, &expectedResponse, nil, nil, nil) + if err != nil { + t.Errorf("Failed to encode the response: %v", err) + return + } + h.t.Write(s, hdr, data, &transport.Options{}) + h.t.WriteStatus(s, status.New(codes.OK, "")) +} + +type server struct { + lis net.Listener + port string + addr string + startedErr chan error // sent nil or an error after server starts + mu sync.Mutex + conns map[transport.ServerTransport]bool +} + +func newTestServer() *server { + return &server{startedErr: make(chan error, 1)} +} + +// start starts server. Other goroutines should block on s.startedErr for further operations. +func (s *server) start(t *testing.T, port int, maxStreams uint32) { + var err error + if port == 0 { + s.lis, err = net.Listen("tcp", "localhost:0") + } else { + s.lis, err = net.Listen("tcp", "localhost:"+strconv.Itoa(port)) + } + if err != nil { + s.startedErr <- fmt.Errorf("failed to listen: %v", err) + return + } + s.addr = s.lis.Addr().String() + _, p, err := net.SplitHostPort(s.addr) + if err != nil { + s.startedErr <- fmt.Errorf("failed to parse listener address: %v", err) + return + } + s.port = p + s.conns = make(map[transport.ServerTransport]bool) + s.startedErr <- nil + for { + conn, err := s.lis.Accept() + if err != nil { + return + } + config := &transport.ServerConfig{ + MaxStreams: maxStreams, + } + st, err := transport.NewServerTransport("http2", conn, config) + if err != nil { + continue + } + s.mu.Lock() + if s.conns == nil { + s.mu.Unlock() + st.Close() + return + } + s.conns[st] = true + s.mu.Unlock() + h := &testStreamHandler{ + port: s.port, + t: st, + } + go st.HandleStreams(func(s *transport.Stream) { + go h.handleStream(t, s) + }, func(ctx context.Context, method string) context.Context { + return ctx + }) + } +} + +func (s *server) wait(t *testing.T, timeout time.Duration) { + select { + case err := <-s.startedErr: + if err != nil { + t.Fatal(err) + } + case <-time.After(timeout): + t.Fatalf("Timed out after %v waiting for server to be ready", timeout) + } +} + +func (s *server) stop() { + s.lis.Close() + s.mu.Lock() + for c := range s.conns { + c.Close() + } + s.conns = nil + s.mu.Unlock() +} + +func setUp(t *testing.T, port int, maxStreams uint32) (*server, *ClientConn) { + server := newTestServer() + go server.start(t, port, maxStreams) + server.wait(t, 2*time.Second) + addr := "localhost:" + server.port + cc, err := Dial(addr, WithBlock(), WithInsecure(), WithCodec(testCodec{})) + if err != nil { + t.Fatalf("Failed to create ClientConn: %v", err) + } + return server, cc +} + +func TestInvoke(t *testing.T) { + defer leakcheck.Check(t) + server, cc := setUp(t, 0, math.MaxUint32) + var reply string + if err := Invoke(context.Background(), "/foo/bar", &expectedRequest, &reply, cc); err != nil || reply != expectedResponse { + t.Fatalf("grpc.Invoke(_, _, _, _, _) = %v, want ", err) + } + cc.Close() + server.stop() +} + +func TestInvokeLargeErr(t *testing.T) { + defer leakcheck.Check(t) + server, cc := setUp(t, 0, math.MaxUint32) + var reply string + req := "hello" + err := Invoke(context.Background(), "/foo/bar", &req, &reply, cc) + if _, ok := status.FromError(err); !ok { + t.Fatalf("grpc.Invoke(_, _, _, _, _) receives non rpc error.") + } + if Code(err) != codes.Internal || len(ErrorDesc(err)) != sizeLargeErr { + t.Fatalf("grpc.Invoke(_, _, _, _, _) = %v, want an error of code %d and desc size %d", err, codes.Internal, sizeLargeErr) + } + cc.Close() + server.stop() +} + +// TestInvokeErrorSpecialChars checks that error messages don't get mangled. +func TestInvokeErrorSpecialChars(t *testing.T) { + defer leakcheck.Check(t) + server, cc := setUp(t, 0, math.MaxUint32) + var reply string + req := "weird error" + err := Invoke(context.Background(), "/foo/bar", &req, &reply, cc) + if _, ok := status.FromError(err); !ok { + t.Fatalf("grpc.Invoke(_, _, _, _, _) receives non rpc error.") + } + if got, want := ErrorDesc(err), weirdError; got != want { + t.Fatalf("grpc.Invoke(_, _, _, _, _) error = %q, want %q", got, want) + } + cc.Close() + server.stop() +} + +// TestInvokeCancel checks that an Invoke with a canceled context is not sent. +func TestInvokeCancel(t *testing.T) { + defer leakcheck.Check(t) + server, cc := setUp(t, 0, math.MaxUint32) + var reply string + req := "canceled" + for i := 0; i < 100; i++ { + ctx, cancel := context.WithCancel(context.Background()) + cancel() + Invoke(ctx, "/foo/bar", &req, &reply, cc) + } + if canceled != 0 { + t.Fatalf("received %d of 100 canceled requests", canceled) + } + cc.Close() + server.stop() +} + +// TestInvokeCancelClosedNonFail checks that a canceled non-failfast RPC +// on a closed client will terminate. +func TestInvokeCancelClosedNonFailFast(t *testing.T) { + defer leakcheck.Check(t) + server, cc := setUp(t, 0, math.MaxUint32) + var reply string + cc.Close() + req := "hello" + ctx, cancel := context.WithCancel(context.Background()) + cancel() + if err := Invoke(ctx, "/foo/bar", &req, &reply, cc, FailFast(false)); err == nil { + t.Fatalf("canceled invoke on closed connection should fail") + } + server.stop() +} diff --git a/vendor/google.golang.org/grpc/clientconn.go b/vendor/google.golang.org/grpc/clientconn.go new file mode 100644 index 0000000000..ae605bc324 --- /dev/null +++ b/vendor/google.golang.org/grpc/clientconn.go @@ -0,0 +1,1172 @@ +/* + * + * Copyright 2014 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. + * + */ + +package grpc + +import ( + "errors" + "fmt" + "math" + "net" + "reflect" + "strings" + "sync" + "time" + + "golang.org/x/net/context" + "golang.org/x/net/trace" + "google.golang.org/grpc/balancer" + _ "google.golang.org/grpc/balancer/roundrobin" // To register roundrobin. + "google.golang.org/grpc/connectivity" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/keepalive" + "google.golang.org/grpc/resolver" + _ "google.golang.org/grpc/resolver/dns" // To register dns resolver. + _ "google.golang.org/grpc/resolver/passthrough" // To register passthrough resolver. + "google.golang.org/grpc/stats" + "google.golang.org/grpc/transport" +) + +var ( + // ErrClientConnClosing indicates that the operation is illegal because + // the ClientConn is closing. + ErrClientConnClosing = errors.New("grpc: the client connection is closing") + // ErrClientConnTimeout indicates that the ClientConn cannot establish the + // underlying connections within the specified timeout. + // DEPRECATED: Please use context.DeadlineExceeded instead. + ErrClientConnTimeout = errors.New("grpc: timed out when dialing") + // errConnDrain indicates that the connection starts to be drained and does not accept any new RPCs. + errConnDrain = errors.New("grpc: the connection is drained") + // errConnClosing indicates that the connection is closing. + errConnClosing = errors.New("grpc: the connection is closing") + // errConnUnavailable indicates that the connection is unavailable. + errConnUnavailable = errors.New("grpc: the connection is unavailable") + // errBalancerClosed indicates that the balancer is closed. + errBalancerClosed = errors.New("grpc: balancer is closed") + // minimum time to give a connection to complete + minConnectTimeout = 20 * time.Second +) + +// The following errors are returned from Dial and DialContext +var ( + // errNoTransportSecurity indicates that there is no transport security + // being set for ClientConn. Users should either set one or explicitly + // call WithInsecure DialOption to disable security. + errNoTransportSecurity = errors.New("grpc: no transport security set (use grpc.WithInsecure() explicitly or set credentials)") + // errTransportCredentialsMissing indicates that users want to transmit security + // information (e.g., oauth2 token) which requires secure connection on an insecure + // connection. + errTransportCredentialsMissing = errors.New("grpc: the credentials require transport level security (use grpc.WithTransportCredentials() to set)") + // errCredentialsConflict indicates that grpc.WithTransportCredentials() + // and grpc.WithInsecure() are both called for a connection. + errCredentialsConflict = errors.New("grpc: transport credentials are set for an insecure connection (grpc.WithTransportCredentials() and grpc.WithInsecure() are both called)") + // errNetworkIO indicates that the connection is down due to some network I/O error. + errNetworkIO = errors.New("grpc: failed with network I/O error") +) + +// dialOptions configure a Dial call. dialOptions are set by the DialOption +// values passed to Dial. +type dialOptions struct { + unaryInt UnaryClientInterceptor + streamInt StreamClientInterceptor + codec Codec + cp Compressor + dc Decompressor + bs backoffStrategy + block bool + insecure bool + timeout time.Duration + scChan <-chan ServiceConfig + copts transport.ConnectOptions + callOptions []CallOption + // This is to support v1 balancer. + balancerBuilder balancer.Builder +} + +const ( + defaultClientMaxReceiveMessageSize = 1024 * 1024 * 4 + defaultClientMaxSendMessageSize = math.MaxInt32 +) + +// DialOption configures how we set up the connection. +type DialOption func(*dialOptions) + +// WithWriteBufferSize lets you set the size of write buffer, this determines how much data can be batched +// before doing a write on the wire. +func WithWriteBufferSize(s int) DialOption { + return func(o *dialOptions) { + o.copts.WriteBufferSize = s + } +} + +// WithReadBufferSize lets you set the size of read buffer, this determines how much data can be read at most +// for each read syscall. +func WithReadBufferSize(s int) DialOption { + return func(o *dialOptions) { + o.copts.ReadBufferSize = s + } +} + +// WithInitialWindowSize returns a DialOption which sets the value for initial window size on a stream. +// The lower bound for window size is 64K and any value smaller than that will be ignored. +func WithInitialWindowSize(s int32) DialOption { + return func(o *dialOptions) { + o.copts.InitialWindowSize = s + } +} + +// WithInitialConnWindowSize returns a DialOption which sets the value for initial window size on a connection. +// The lower bound for window size is 64K and any value smaller than that will be ignored. +func WithInitialConnWindowSize(s int32) DialOption { + return func(o *dialOptions) { + o.copts.InitialConnWindowSize = s + } +} + +// WithMaxMsgSize returns a DialOption which sets the maximum message size the client can receive. Deprecated: use WithDefaultCallOptions(MaxCallRecvMsgSize(s)) instead. +func WithMaxMsgSize(s int) DialOption { + return WithDefaultCallOptions(MaxCallRecvMsgSize(s)) +} + +// WithDefaultCallOptions returns a DialOption which sets the default CallOptions for calls over the connection. +func WithDefaultCallOptions(cos ...CallOption) DialOption { + return func(o *dialOptions) { + o.callOptions = append(o.callOptions, cos...) + } +} + +// WithCodec returns a DialOption which sets a codec for message marshaling and unmarshaling. +func WithCodec(c Codec) DialOption { + return func(o *dialOptions) { + o.codec = c + } +} + +// WithCompressor returns a DialOption which sets a Compressor to use for +// message compression. It has lower priority than the compressor set by +// the UseCompressor CallOption. +// +// Deprecated: use UseCompressor instead. +func WithCompressor(cp Compressor) DialOption { + return func(o *dialOptions) { + o.cp = cp + } +} + +// WithDecompressor returns a DialOption which sets a Decompressor to use for +// incoming message decompression. If incoming response messages are encoded +// using the decompressor's Type(), it will be used. Otherwise, the message +// encoding will be used to look up the compressor registered via +// encoding.RegisterCompressor, which will then be used to decompress the +// message. If no compressor is registered for the encoding, an Unimplemented +// status error will be returned. +// +// Deprecated: use encoding.RegisterCompressor instead. +func WithDecompressor(dc Decompressor) DialOption { + return func(o *dialOptions) { + o.dc = dc + } +} + +// WithBalancer returns a DialOption which sets a load balancer with the v1 API. +// Name resolver will be ignored if this DialOption is specified. +// Deprecated: use the new balancer APIs in balancer package instead. +func WithBalancer(b Balancer) DialOption { + return func(o *dialOptions) { + o.balancerBuilder = &balancerWrapperBuilder{ + b: b, + } + } +} + +// WithBalancerBuilder is for testing only. Users using custom balancers should +// register their balancer and use service config to choose the balancer to use. +func WithBalancerBuilder(b balancer.Builder) DialOption { + // TODO(bar) remove this when switching balancer is done. + return func(o *dialOptions) { + o.balancerBuilder = b + } +} + +// WithServiceConfig returns a DialOption which has a channel to read the service configuration. +// DEPRECATED: service config should be received through name resolver, as specified here. +// https://github.com/grpc/grpc/blob/master/doc/service_config.md +func WithServiceConfig(c <-chan ServiceConfig) DialOption { + return func(o *dialOptions) { + o.scChan = c + } +} + +// WithBackoffMaxDelay configures the dialer to use the provided maximum delay +// when backing off after failed connection attempts. +func WithBackoffMaxDelay(md time.Duration) DialOption { + return WithBackoffConfig(BackoffConfig{MaxDelay: md}) +} + +// WithBackoffConfig configures the dialer to use the provided backoff +// parameters after connection failures. +// +// Use WithBackoffMaxDelay until more parameters on BackoffConfig are opened up +// for use. +func WithBackoffConfig(b BackoffConfig) DialOption { + // Set defaults to ensure that provided BackoffConfig is valid and + // unexported fields get default values. + setDefaults(&b) + return withBackoff(b) +} + +// withBackoff sets the backoff strategy used for retries after a +// failed connection attempt. +// +// This can be exported if arbitrary backoff strategies are allowed by gRPC. +func withBackoff(bs backoffStrategy) DialOption { + return func(o *dialOptions) { + o.bs = bs + } +} + +// WithBlock returns a DialOption which makes caller of Dial blocks until the underlying +// connection is up. Without this, Dial returns immediately and connecting the server +// happens in background. +func WithBlock() DialOption { + return func(o *dialOptions) { + o.block = true + } +} + +// WithInsecure returns a DialOption which disables transport security for this ClientConn. +// Note that transport security is required unless WithInsecure is set. +func WithInsecure() DialOption { + return func(o *dialOptions) { + o.insecure = true + } +} + +// WithTransportCredentials returns a DialOption which configures a +// connection level security credentials (e.g., TLS/SSL). +func WithTransportCredentials(creds credentials.TransportCredentials) DialOption { + return func(o *dialOptions) { + o.copts.TransportCredentials = creds + } +} + +// WithPerRPCCredentials returns a DialOption which sets +// credentials and places auth state on each outbound RPC. +func WithPerRPCCredentials(creds credentials.PerRPCCredentials) DialOption { + return func(o *dialOptions) { + o.copts.PerRPCCredentials = append(o.copts.PerRPCCredentials, creds) + } +} + +// WithTimeout returns a DialOption that configures a timeout for dialing a ClientConn +// initially. This is valid if and only if WithBlock() is present. +// Deprecated: use DialContext and context.WithTimeout instead. +func WithTimeout(d time.Duration) DialOption { + return func(o *dialOptions) { + o.timeout = d + } +} + +// WithDialer returns a DialOption that specifies a function to use for dialing network addresses. +// If FailOnNonTempDialError() is set to true, and an error is returned by f, gRPC checks the error's +// Temporary() method to decide if it should try to reconnect to the network address. +func WithDialer(f func(string, time.Duration) (net.Conn, error)) DialOption { + return func(o *dialOptions) { + o.copts.Dialer = func(ctx context.Context, addr string) (net.Conn, error) { + if deadline, ok := ctx.Deadline(); ok { + return f(addr, deadline.Sub(time.Now())) + } + return f(addr, 0) + } + } +} + +// WithStatsHandler returns a DialOption that specifies the stats handler +// for all the RPCs and underlying network connections in this ClientConn. +func WithStatsHandler(h stats.Handler) DialOption { + return func(o *dialOptions) { + o.copts.StatsHandler = h + } +} + +// FailOnNonTempDialError returns a DialOption that specifies if gRPC fails on non-temporary dial errors. +// If f is true, and dialer returns a non-temporary error, gRPC will fail the connection to the network +// address and won't try to reconnect. +// The default value of FailOnNonTempDialError is false. +// This is an EXPERIMENTAL API. +func FailOnNonTempDialError(f bool) DialOption { + return func(o *dialOptions) { + o.copts.FailOnNonTempDialError = f + } +} + +// WithUserAgent returns a DialOption that specifies a user agent string for all the RPCs. +func WithUserAgent(s string) DialOption { + return func(o *dialOptions) { + o.copts.UserAgent = s + } +} + +// WithKeepaliveParams returns a DialOption that specifies keepalive parameters for the client transport. +func WithKeepaliveParams(kp keepalive.ClientParameters) DialOption { + return func(o *dialOptions) { + o.copts.KeepaliveParams = kp + } +} + +// WithUnaryInterceptor returns a DialOption that specifies the interceptor for unary RPCs. +func WithUnaryInterceptor(f UnaryClientInterceptor) DialOption { + return func(o *dialOptions) { + o.unaryInt = f + } +} + +// WithStreamInterceptor returns a DialOption that specifies the interceptor for streaming RPCs. +func WithStreamInterceptor(f StreamClientInterceptor) DialOption { + return func(o *dialOptions) { + o.streamInt = f + } +} + +// WithAuthority returns a DialOption that specifies the value to be used as +// the :authority pseudo-header. This value only works with WithInsecure and +// has no effect if TransportCredentials are present. +func WithAuthority(a string) DialOption { + return func(o *dialOptions) { + o.copts.Authority = a + } +} + +// Dial creates a client connection to the given target. +func Dial(target string, opts ...DialOption) (*ClientConn, error) { + return DialContext(context.Background(), target, opts...) +} + +// DialContext creates a client connection to the given target. ctx can be used to +// cancel or expire the pending connection. Once this function returns, the +// cancellation and expiration of ctx will be noop. Users should call ClientConn.Close +// to terminate all the pending operations after this function returns. +func DialContext(ctx context.Context, target string, opts ...DialOption) (conn *ClientConn, err error) { + cc := &ClientConn{ + target: target, + csMgr: &connectivityStateManager{}, + conns: make(map[*addrConn]struct{}), + + blockingpicker: newPickerWrapper(), + } + cc.ctx, cc.cancel = context.WithCancel(context.Background()) + + for _, opt := range opts { + opt(&cc.dopts) + } + + if !cc.dopts.insecure { + if cc.dopts.copts.TransportCredentials == nil { + return nil, errNoTransportSecurity + } + } else { + if cc.dopts.copts.TransportCredentials != nil { + return nil, errCredentialsConflict + } + for _, cd := range cc.dopts.copts.PerRPCCredentials { + if cd.RequireTransportSecurity() { + return nil, errTransportCredentialsMissing + } + } + } + + cc.mkp = cc.dopts.copts.KeepaliveParams + + if cc.dopts.copts.Dialer == nil { + cc.dopts.copts.Dialer = newProxyDialer( + func(ctx context.Context, addr string) (net.Conn, error) { + return dialContext(ctx, "tcp", addr) + }, + ) + } + + if cc.dopts.copts.UserAgent != "" { + cc.dopts.copts.UserAgent += " " + grpcUA + } else { + cc.dopts.copts.UserAgent = grpcUA + } + + if cc.dopts.timeout > 0 { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, cc.dopts.timeout) + defer cancel() + } + + defer func() { + select { + case <-ctx.Done(): + conn, err = nil, ctx.Err() + default: + } + + if err != nil { + cc.Close() + } + }() + + scSet := false + if cc.dopts.scChan != nil { + // Try to get an initial service config. + select { + case sc, ok := <-cc.dopts.scChan: + if ok { + cc.sc = sc + scSet = true + } + default: + } + } + // Set defaults. + if cc.dopts.codec == nil { + cc.dopts.codec = protoCodec{} + } + if cc.dopts.bs == nil { + cc.dopts.bs = DefaultBackoffConfig + } + cc.parsedTarget = parseTarget(cc.target) + creds := cc.dopts.copts.TransportCredentials + if creds != nil && creds.Info().ServerName != "" { + cc.authority = creds.Info().ServerName + } else if cc.dopts.insecure && cc.dopts.copts.Authority != "" { + cc.authority = cc.dopts.copts.Authority + } else { + // Use endpoint from "scheme://authority/endpoint" as the default + // authority for ClientConn. + cc.authority = cc.parsedTarget.Endpoint + } + + if cc.dopts.scChan != nil && !scSet { + // Blocking wait for the initial service config. + select { + case sc, ok := <-cc.dopts.scChan: + if ok { + cc.sc = sc + } + case <-ctx.Done(): + return nil, ctx.Err() + } + } + if cc.dopts.scChan != nil { + go cc.scWatcher() + } + + var credsClone credentials.TransportCredentials + if creds := cc.dopts.copts.TransportCredentials; creds != nil { + credsClone = creds.Clone() + } + cc.balancerBuildOpts = balancer.BuildOptions{ + DialCreds: credsClone, + Dialer: cc.dopts.copts.Dialer, + } + + if cc.dopts.balancerBuilder != nil { + cc.customBalancer = true + // Build should not take long time. So it's ok to not have a goroutine for it. + cc.balancerWrapper = newCCBalancerWrapper(cc, cc.dopts.balancerBuilder, cc.balancerBuildOpts) + } + + // Build the resolver. + cc.resolverWrapper, err = newCCResolverWrapper(cc) + if err != nil { + return nil, fmt.Errorf("failed to build resolver: %v", err) + } + + // A blocking dial blocks until the clientConn is ready. + if cc.dopts.block { + for { + s := cc.GetState() + if s == connectivity.Ready { + break + } + if !cc.WaitForStateChange(ctx, s) { + // ctx got timeout or canceled. + return nil, ctx.Err() + } + } + } + + return cc, nil +} + +// connectivityStateManager keeps the connectivity.State of ClientConn. +// This struct will eventually be exported so the balancers can access it. +type connectivityStateManager struct { + mu sync.Mutex + state connectivity.State + notifyChan chan struct{} +} + +// updateState updates the connectivity.State of ClientConn. +// If there's a change it notifies goroutines waiting on state change to +// happen. +func (csm *connectivityStateManager) updateState(state connectivity.State) { + csm.mu.Lock() + defer csm.mu.Unlock() + if csm.state == connectivity.Shutdown { + return + } + if csm.state == state { + return + } + csm.state = state + if csm.notifyChan != nil { + // There are other goroutines waiting on this channel. + close(csm.notifyChan) + csm.notifyChan = nil + } +} + +func (csm *connectivityStateManager) getState() connectivity.State { + csm.mu.Lock() + defer csm.mu.Unlock() + return csm.state +} + +func (csm *connectivityStateManager) getNotifyChan() <-chan struct{} { + csm.mu.Lock() + defer csm.mu.Unlock() + if csm.notifyChan == nil { + csm.notifyChan = make(chan struct{}) + } + return csm.notifyChan +} + +// ClientConn represents a client connection to an RPC server. +type ClientConn struct { + ctx context.Context + cancel context.CancelFunc + + target string + parsedTarget resolver.Target + authority string + dopts dialOptions + csMgr *connectivityStateManager + + customBalancer bool // If this is true, switching balancer will be disabled. + balancerBuildOpts balancer.BuildOptions + resolverWrapper *ccResolverWrapper + blockingpicker *pickerWrapper + + mu sync.RWMutex + sc ServiceConfig + scRaw string + conns map[*addrConn]struct{} + // Keepalive parameter can be updated if a GoAway is received. + mkp keepalive.ClientParameters + curBalancerName string + curAddresses []resolver.Address + balancerWrapper *ccBalancerWrapper +} + +// WaitForStateChange waits until the connectivity.State of ClientConn changes from sourceState or +// ctx expires. A true value is returned in former case and false in latter. +// This is an EXPERIMENTAL API. +func (cc *ClientConn) WaitForStateChange(ctx context.Context, sourceState connectivity.State) bool { + ch := cc.csMgr.getNotifyChan() + if cc.csMgr.getState() != sourceState { + return true + } + select { + case <-ctx.Done(): + return false + case <-ch: + return true + } +} + +// GetState returns the connectivity.State of ClientConn. +// This is an EXPERIMENTAL API. +func (cc *ClientConn) GetState() connectivity.State { + return cc.csMgr.getState() +} + +func (cc *ClientConn) scWatcher() { + for { + select { + case sc, ok := <-cc.dopts.scChan: + if !ok { + return + } + cc.mu.Lock() + // TODO: load balance policy runtime change is ignored. + // We may revist this decision in the future. + cc.sc = sc + cc.scRaw = "" + cc.mu.Unlock() + case <-cc.ctx.Done(): + return + } + } +} + +func (cc *ClientConn) handleResolvedAddrs(addrs []resolver.Address, err error) { + cc.mu.Lock() + defer cc.mu.Unlock() + if cc.conns == nil { + return + } + + // TODO(bar switching) when grpclb is submitted, check address type and start grpclb. + if !cc.customBalancer && cc.balancerWrapper == nil { + // No customBalancer was specified by DialOption, and this is the first + // time handling resolved addresses, create a pickfirst balancer. + builder := newPickfirstBuilder() + cc.curBalancerName = builder.Name() + cc.balancerWrapper = newCCBalancerWrapper(cc, builder, cc.balancerBuildOpts) + } + + // TODO(bar switching) compare addresses, if there's no update, don't notify balancer. + cc.curAddresses = addrs + cc.balancerWrapper.handleResolvedAddrs(addrs, nil) +} + +// switchBalancer starts the switching from current balancer to the balancer with name. +func (cc *ClientConn) switchBalancer(name string) { + if cc.conns == nil { + return + } + grpclog.Infof("ClientConn switching balancer to %q", name) + + if cc.customBalancer { + grpclog.Infoln("ignoring service config balancer configuration: WithBalancer DialOption used instead") + return + } + + if cc.curBalancerName == name { + return + } + + // TODO(bar switching) change this to two steps: drain and close. + // Keep track of sc in wrapper. + cc.balancerWrapper.close() + + builder := balancer.Get(name) + if builder == nil { + grpclog.Infof("failed to get balancer builder for: %v (this should never happen...)", name) + builder = newPickfirstBuilder() + } + cc.curBalancerName = builder.Name() + cc.balancerWrapper = newCCBalancerWrapper(cc, builder, cc.balancerBuildOpts) + cc.balancerWrapper.handleResolvedAddrs(cc.curAddresses, nil) +} + +func (cc *ClientConn) handleSubConnStateChange(sc balancer.SubConn, s connectivity.State) { + cc.mu.Lock() + if cc.conns == nil { + cc.mu.Unlock() + return + } + // TODO(bar switching) send updates to all balancer wrappers when balancer + // gracefully switching is supported. + cc.balancerWrapper.handleSubConnStateChange(sc, s) + cc.mu.Unlock() +} + +// newAddrConn creates an addrConn for addrs and adds it to cc.conns. +func (cc *ClientConn) newAddrConn(addrs []resolver.Address) (*addrConn, error) { + ac := &addrConn{ + cc: cc, + addrs: addrs, + dopts: cc.dopts, + } + ac.ctx, ac.cancel = context.WithCancel(cc.ctx) + // Track ac in cc. This needs to be done before any getTransport(...) is called. + cc.mu.Lock() + if cc.conns == nil { + cc.mu.Unlock() + return nil, ErrClientConnClosing + } + cc.conns[ac] = struct{}{} + cc.mu.Unlock() + return ac, nil +} + +// removeAddrConn removes the addrConn in the subConn from clientConn. +// It also tears down the ac with the given error. +func (cc *ClientConn) removeAddrConn(ac *addrConn, err error) { + cc.mu.Lock() + if cc.conns == nil { + cc.mu.Unlock() + return + } + delete(cc.conns, ac) + cc.mu.Unlock() + ac.tearDown(err) +} + +// connect starts to creating transport and also starts the transport monitor +// goroutine for this ac. +// It does nothing if the ac is not IDLE. +// TODO(bar) Move this to the addrConn section. +// This was part of resetAddrConn, keep it here to make the diff look clean. +func (ac *addrConn) connect() error { + ac.mu.Lock() + if ac.state == connectivity.Shutdown { + ac.mu.Unlock() + return errConnClosing + } + if ac.state != connectivity.Idle { + ac.mu.Unlock() + return nil + } + ac.state = connectivity.Connecting + ac.cc.handleSubConnStateChange(ac.acbw, ac.state) + ac.mu.Unlock() + + // Start a goroutine connecting to the server asynchronously. + go func() { + if err := ac.resetTransport(); err != nil { + grpclog.Warningf("Failed to dial %s: %v; please retry.", ac.addrs[0].Addr, err) + if err != errConnClosing { + // Keep this ac in cc.conns, to get the reason it's torn down. + ac.tearDown(err) + } + return + } + ac.transportMonitor() + }() + return nil +} + +// tryUpdateAddrs tries to update ac.addrs with the new addresses list. +// +// It checks whether current connected address of ac is in the new addrs list. +// - If true, it updates ac.addrs and returns true. The ac will keep using +// the existing connection. +// - If false, it does nothing and returns false. +func (ac *addrConn) tryUpdateAddrs(addrs []resolver.Address) bool { + ac.mu.Lock() + defer ac.mu.Unlock() + grpclog.Infof("addrConn: tryUpdateAddrs curAddr: %v, addrs: %v", ac.curAddr, addrs) + if ac.state == connectivity.Shutdown { + ac.addrs = addrs + return true + } + + var curAddrFound bool + for _, a := range addrs { + if reflect.DeepEqual(ac.curAddr, a) { + curAddrFound = true + break + } + } + grpclog.Infof("addrConn: tryUpdateAddrs curAddrFound: %v", curAddrFound) + if curAddrFound { + ac.addrs = addrs + } + + return curAddrFound +} + +// GetMethodConfig gets the method config of the input method. +// If there's an exact match for input method (i.e. /service/method), we return +// the corresponding MethodConfig. +// If there isn't an exact match for the input method, we look for the default config +// under the service (i.e /service/). If there is a default MethodConfig for +// the serivce, we return it. +// Otherwise, we return an empty MethodConfig. +func (cc *ClientConn) GetMethodConfig(method string) MethodConfig { + // TODO: Avoid the locking here. + cc.mu.RLock() + defer cc.mu.RUnlock() + m, ok := cc.sc.Methods[method] + if !ok { + i := strings.LastIndex(method, "/") + m, _ = cc.sc.Methods[method[:i+1]] + } + return m +} + +func (cc *ClientConn) getTransport(ctx context.Context, failfast bool) (transport.ClientTransport, func(balancer.DoneInfo), error) { + t, done, err := cc.blockingpicker.pick(ctx, failfast, balancer.PickOptions{}) + if err != nil { + return nil, nil, toRPCErr(err) + } + return t, done, nil +} + +// handleServiceConfig parses the service config string in JSON format to Go native +// struct ServiceConfig, and store both the struct and the JSON string in ClientConn. +func (cc *ClientConn) handleServiceConfig(js string) error { + sc, err := parseServiceConfig(js) + if err != nil { + return err + } + cc.mu.Lock() + cc.scRaw = js + cc.sc = sc + if sc.LB != nil { + cc.switchBalancer(*sc.LB) + } + cc.mu.Unlock() + return nil +} + +// Close tears down the ClientConn and all underlying connections. +func (cc *ClientConn) Close() error { + cc.cancel() + + cc.mu.Lock() + if cc.conns == nil { + cc.mu.Unlock() + return ErrClientConnClosing + } + conns := cc.conns + cc.conns = nil + cc.csMgr.updateState(connectivity.Shutdown) + + rWrapper := cc.resolverWrapper + cc.resolverWrapper = nil + bWrapper := cc.balancerWrapper + cc.balancerWrapper = nil + cc.mu.Unlock() + cc.blockingpicker.close() + if rWrapper != nil { + rWrapper.close() + } + if bWrapper != nil { + bWrapper.close() + } + for ac := range conns { + ac.tearDown(ErrClientConnClosing) + } + return nil +} + +// addrConn is a network connection to a given address. +type addrConn struct { + ctx context.Context + cancel context.CancelFunc + + cc *ClientConn + curAddr resolver.Address + addrs []resolver.Address + dopts dialOptions + events trace.EventLog + acbw balancer.SubConn + + mu sync.Mutex + state connectivity.State + // ready is closed and becomes nil when a new transport is up or failed + // due to timeout. + ready chan struct{} + transport transport.ClientTransport + + // The reason this addrConn is torn down. + tearDownErr error +} + +// adjustParams updates parameters used to create transports upon +// receiving a GoAway. +func (ac *addrConn) adjustParams(r transport.GoAwayReason) { + switch r { + case transport.GoAwayTooManyPings: + v := 2 * ac.dopts.copts.KeepaliveParams.Time + ac.cc.mu.Lock() + if v > ac.cc.mkp.Time { + ac.cc.mkp.Time = v + } + ac.cc.mu.Unlock() + } +} + +// printf records an event in ac's event log, unless ac has been closed. +// REQUIRES ac.mu is held. +func (ac *addrConn) printf(format string, a ...interface{}) { + if ac.events != nil { + ac.events.Printf(format, a...) + } +} + +// errorf records an error in ac's event log, unless ac has been closed. +// REQUIRES ac.mu is held. +func (ac *addrConn) errorf(format string, a ...interface{}) { + if ac.events != nil { + ac.events.Errorf(format, a...) + } +} + +// resetTransport recreates a transport to the address for ac. The old +// transport will close itself on error or when the clientconn is closed. +// +// TODO(bar) make sure all state transitions are valid. +func (ac *addrConn) resetTransport() error { + ac.mu.Lock() + if ac.state == connectivity.Shutdown { + ac.mu.Unlock() + return errConnClosing + } + if ac.ready != nil { + close(ac.ready) + ac.ready = nil + } + ac.transport = nil + ac.curAddr = resolver.Address{} + ac.mu.Unlock() + ac.cc.mu.RLock() + ac.dopts.copts.KeepaliveParams = ac.cc.mkp + ac.cc.mu.RUnlock() + for retries := 0; ; retries++ { + sleepTime := ac.dopts.bs.backoff(retries) + timeout := minConnectTimeout + ac.mu.Lock() + if timeout < time.Duration(int(sleepTime)/len(ac.addrs)) { + timeout = time.Duration(int(sleepTime) / len(ac.addrs)) + } + connectTime := time.Now() + if ac.state == connectivity.Shutdown { + ac.mu.Unlock() + return errConnClosing + } + ac.printf("connecting") + if ac.state != connectivity.Connecting { + ac.state = connectivity.Connecting + ac.cc.handleSubConnStateChange(ac.acbw, ac.state) + } + // copy ac.addrs in case of race + addrsIter := make([]resolver.Address, len(ac.addrs)) + copy(addrsIter, ac.addrs) + copts := ac.dopts.copts + ac.mu.Unlock() + for _, addr := range addrsIter { + ac.mu.Lock() + if ac.state == connectivity.Shutdown { + // ac.tearDown(...) has been invoked. + ac.mu.Unlock() + return errConnClosing + } + ac.mu.Unlock() + sinfo := transport.TargetInfo{ + Addr: addr.Addr, + Metadata: addr.Metadata, + Authority: ac.cc.authority, + } + newTransport, err := transport.NewClientTransport(ac.cc.ctx, sinfo, copts, timeout) + if err != nil { + if e, ok := err.(transport.ConnectionError); ok && !e.Temporary() { + ac.mu.Lock() + if ac.state != connectivity.Shutdown { + ac.state = connectivity.TransientFailure + ac.cc.handleSubConnStateChange(ac.acbw, ac.state) + } + ac.mu.Unlock() + return err + } + grpclog.Warningf("grpc: addrConn.resetTransport failed to create client transport: %v; Reconnecting to %v", err, addr) + ac.mu.Lock() + if ac.state == connectivity.Shutdown { + // ac.tearDown(...) has been invoked. + ac.mu.Unlock() + return errConnClosing + } + ac.mu.Unlock() + continue + } + ac.mu.Lock() + ac.printf("ready") + if ac.state == connectivity.Shutdown { + // ac.tearDown(...) has been invoked. + ac.mu.Unlock() + newTransport.Close() + return errConnClosing + } + ac.state = connectivity.Ready + ac.cc.handleSubConnStateChange(ac.acbw, ac.state) + t := ac.transport + ac.transport = newTransport + if t != nil { + t.Close() + } + ac.curAddr = addr + if ac.ready != nil { + close(ac.ready) + ac.ready = nil + } + ac.mu.Unlock() + return nil + } + ac.mu.Lock() + ac.state = connectivity.TransientFailure + ac.cc.handleSubConnStateChange(ac.acbw, ac.state) + if ac.ready != nil { + close(ac.ready) + ac.ready = nil + } + ac.mu.Unlock() + timer := time.NewTimer(sleepTime - time.Since(connectTime)) + select { + case <-timer.C: + case <-ac.ctx.Done(): + timer.Stop() + return ac.ctx.Err() + } + timer.Stop() + } +} + +// Run in a goroutine to track the error in transport and create the +// new transport if an error happens. It returns when the channel is closing. +func (ac *addrConn) transportMonitor() { + for { + ac.mu.Lock() + t := ac.transport + ac.mu.Unlock() + // Block until we receive a goaway or an error occurs. + select { + case <-t.GoAway(): + case <-t.Error(): + } + // If a GoAway happened, regardless of error, adjust our keepalive + // parameters as appropriate. + select { + case <-t.GoAway(): + ac.adjustParams(t.GetGoAwayReason()) + default: + } + ac.mu.Lock() + if ac.state == connectivity.Shutdown { + ac.mu.Unlock() + return + } + // Set connectivity state to TransientFailure before calling + // resetTransport. Transition READY->CONNECTING is not valid. + ac.state = connectivity.TransientFailure + ac.cc.handleSubConnStateChange(ac.acbw, ac.state) + ac.curAddr = resolver.Address{} + ac.mu.Unlock() + if err := ac.resetTransport(); err != nil { + ac.mu.Lock() + ac.printf("transport exiting: %v", err) + ac.mu.Unlock() + grpclog.Warningf("grpc: addrConn.transportMonitor exits due to: %v", err) + if err != errConnClosing { + // Keep this ac in cc.conns, to get the reason it's torn down. + ac.tearDown(err) + } + return + } + } +} + +// wait blocks until i) the new transport is up or ii) ctx is done or iii) ac is closed or +// iv) transport is in connectivity.TransientFailure and there is a balancer/failfast is true. +func (ac *addrConn) wait(ctx context.Context, hasBalancer, failfast bool) (transport.ClientTransport, error) { + for { + ac.mu.Lock() + switch { + case ac.state == connectivity.Shutdown: + if failfast || !hasBalancer { + // RPC is failfast or balancer is nil. This RPC should fail with ac.tearDownErr. + err := ac.tearDownErr + ac.mu.Unlock() + return nil, err + } + ac.mu.Unlock() + return nil, errConnClosing + case ac.state == connectivity.Ready: + ct := ac.transport + ac.mu.Unlock() + return ct, nil + case ac.state == connectivity.TransientFailure: + if failfast || hasBalancer { + ac.mu.Unlock() + return nil, errConnUnavailable + } + } + ready := ac.ready + if ready == nil { + ready = make(chan struct{}) + ac.ready = ready + } + ac.mu.Unlock() + select { + case <-ctx.Done(): + return nil, toRPCErr(ctx.Err()) + // Wait until the new transport is ready or failed. + case <-ready: + } + } +} + +// getReadyTransport returns the transport if ac's state is READY. +// Otherwise it returns nil, false. +// If ac's state is IDLE, it will trigger ac to connect. +func (ac *addrConn) getReadyTransport() (transport.ClientTransport, bool) { + ac.mu.Lock() + if ac.state == connectivity.Ready { + t := ac.transport + ac.mu.Unlock() + return t, true + } + var idle bool + if ac.state == connectivity.Idle { + idle = true + } + ac.mu.Unlock() + // Trigger idle ac to connect. + if idle { + ac.connect() + } + return nil, false +} + +// tearDown starts to tear down the addrConn. +// TODO(zhaoq): Make this synchronous to avoid unbounded memory consumption in +// some edge cases (e.g., the caller opens and closes many addrConn's in a +// tight loop. +// tearDown doesn't remove ac from ac.cc.conns. +func (ac *addrConn) tearDown(err error) { + ac.cancel() + ac.mu.Lock() + defer ac.mu.Unlock() + ac.curAddr = resolver.Address{} + if err == errConnDrain && ac.transport != nil { + // GracefulClose(...) may be executed multiple times when + // i) receiving multiple GoAway frames from the server; or + // ii) there are concurrent name resolver/Balancer triggered + // address removal and GoAway. + ac.transport.GracefulClose() + } + if ac.state == connectivity.Shutdown { + return + } + ac.state = connectivity.Shutdown + ac.tearDownErr = err + ac.cc.handleSubConnStateChange(ac.acbw, ac.state) + if ac.events != nil { + ac.events.Finish() + ac.events = nil + } + if ac.ready != nil { + close(ac.ready) + ac.ready = nil + } + return +} + +func (ac *addrConn) getState() connectivity.State { + ac.mu.Lock() + defer ac.mu.Unlock() + return ac.state +} diff --git a/vendor/google.golang.org/grpc/clientconn_test.go b/vendor/google.golang.org/grpc/clientconn_test.go new file mode 100644 index 0000000000..c0b0ba4366 --- /dev/null +++ b/vendor/google.golang.org/grpc/clientconn_test.go @@ -0,0 +1,359 @@ +/* + * + * Copyright 2014 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. + * + */ + +package grpc + +import ( + "math" + "net" + "testing" + "time" + + "golang.org/x/net/context" + + "google.golang.org/grpc/connectivity" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/keepalive" + "google.golang.org/grpc/naming" + _ "google.golang.org/grpc/resolver/passthrough" + "google.golang.org/grpc/test/leakcheck" + "google.golang.org/grpc/testdata" +) + +func assertState(wantState connectivity.State, cc *ClientConn) (connectivity.State, bool) { + ctx, cancel := context.WithTimeout(context.Background(), time.Second) + defer cancel() + var state connectivity.State + for state = cc.GetState(); state != wantState && cc.WaitForStateChange(ctx, state); state = cc.GetState() { + } + return state, state == wantState +} + +func TestConnectivityStates(t *testing.T) { + defer leakcheck.Check(t) + servers, resolver, cleanup := startServers(t, 2, math.MaxUint32) + defer cleanup() + cc, err := Dial("passthrough:///foo.bar.com", WithBalancer(RoundRobin(resolver)), WithInsecure()) + if err != nil { + t.Fatalf("Dial(\"foo.bar.com\", WithBalancer(_)) = _, %v, want _ ", err) + } + defer cc.Close() + wantState := connectivity.Ready + if state, ok := assertState(wantState, cc); !ok { + t.Fatalf("asserState(%s) = %s, false, want %s, true", wantState, state, wantState) + } + // Send an update to delete the server connection (tearDown addrConn). + update := []*naming.Update{ + { + Op: naming.Delete, + Addr: "localhost:" + servers[0].port, + }, + } + resolver.w.inject(update) + wantState = connectivity.TransientFailure + if state, ok := assertState(wantState, cc); !ok { + t.Fatalf("asserState(%s) = %s, false, want %s, true", wantState, state, wantState) + } + update[0] = &naming.Update{ + Op: naming.Add, + Addr: "localhost:" + servers[1].port, + } + resolver.w.inject(update) + wantState = connectivity.Ready + if state, ok := assertState(wantState, cc); !ok { + t.Fatalf("asserState(%s) = %s, false, want %s, true", wantState, state, wantState) + } + +} + +func TestDialTimeout(t *testing.T) { + defer leakcheck.Check(t) + conn, err := Dial("passthrough:///Non-Existent.Server:80", WithTimeout(time.Millisecond), WithBlock(), WithInsecure()) + if err == nil { + conn.Close() + } + if err != context.DeadlineExceeded { + t.Fatalf("Dial(_, _) = %v, %v, want %v", conn, err, context.DeadlineExceeded) + } +} + +func TestTLSDialTimeout(t *testing.T) { + defer leakcheck.Check(t) + creds, err := credentials.NewClientTLSFromFile(testdata.Path("ca.pem"), "x.test.youtube.com") + if err != nil { + t.Fatalf("Failed to create credentials %v", err) + } + conn, err := Dial("passthrough:///Non-Existent.Server:80", WithTransportCredentials(creds), WithTimeout(time.Millisecond), WithBlock()) + if err == nil { + conn.Close() + } + if err != context.DeadlineExceeded { + t.Fatalf("Dial(_, _) = %v, %v, want %v", conn, err, context.DeadlineExceeded) + } +} + +func TestDefaultAuthority(t *testing.T) { + defer leakcheck.Check(t) + target := "Non-Existent.Server:8080" + conn, err := Dial(target, WithInsecure()) + if err != nil { + t.Fatalf("Dial(_, _) = _, %v, want _, ", err) + } + defer conn.Close() + if conn.authority != target { + t.Fatalf("%v.authority = %v, want %v", conn, conn.authority, target) + } +} + +func TestTLSServerNameOverwrite(t *testing.T) { + defer leakcheck.Check(t) + overwriteServerName := "over.write.server.name" + creds, err := credentials.NewClientTLSFromFile(testdata.Path("ca.pem"), overwriteServerName) + if err != nil { + t.Fatalf("Failed to create credentials %v", err) + } + conn, err := Dial("passthrough:///Non-Existent.Server:80", WithTransportCredentials(creds)) + if err != nil { + t.Fatalf("Dial(_, _) = _, %v, want _, ", err) + } + defer conn.Close() + if conn.authority != overwriteServerName { + t.Fatalf("%v.authority = %v, want %v", conn, conn.authority, overwriteServerName) + } +} + +func TestWithAuthority(t *testing.T) { + defer leakcheck.Check(t) + overwriteServerName := "over.write.server.name" + conn, err := Dial("passthrough:///Non-Existent.Server:80", WithInsecure(), WithAuthority(overwriteServerName)) + if err != nil { + t.Fatalf("Dial(_, _) = _, %v, want _, ", err) + } + defer conn.Close() + if conn.authority != overwriteServerName { + t.Fatalf("%v.authority = %v, want %v", conn, conn.authority, overwriteServerName) + } +} + +func TestWithAuthorityAndTLS(t *testing.T) { + defer leakcheck.Check(t) + overwriteServerName := "over.write.server.name" + creds, err := credentials.NewClientTLSFromFile(testdata.Path("ca.pem"), overwriteServerName) + if err != nil { + t.Fatalf("Failed to create credentials %v", err) + } + conn, err := Dial("passthrough:///Non-Existent.Server:80", WithTransportCredentials(creds), WithAuthority("no.effect.authority")) + if err != nil { + t.Fatalf("Dial(_, _) = _, %v, want _, ", err) + } + defer conn.Close() + if conn.authority != overwriteServerName { + t.Fatalf("%v.authority = %v, want %v", conn, conn.authority, overwriteServerName) + } +} + +func TestDialContextCancel(t *testing.T) { + defer leakcheck.Check(t) + ctx, cancel := context.WithCancel(context.Background()) + cancel() + if _, err := DialContext(ctx, "Non-Existent.Server:80", WithBlock(), WithInsecure()); err != context.Canceled { + t.Fatalf("DialContext(%v, _) = _, %v, want _, %v", ctx, err, context.Canceled) + } +} + +// blockingBalancer mimics the behavior of balancers whose initialization takes a long time. +// In this test, reading from blockingBalancer.Notify() blocks forever. +type blockingBalancer struct { + ch chan []Address +} + +func newBlockingBalancer() Balancer { + return &blockingBalancer{ch: make(chan []Address)} +} +func (b *blockingBalancer) Start(target string, config BalancerConfig) error { + return nil +} +func (b *blockingBalancer) Up(addr Address) func(error) { + return nil +} +func (b *blockingBalancer) Get(ctx context.Context, opts BalancerGetOptions) (addr Address, put func(), err error) { + return Address{}, nil, nil +} +func (b *blockingBalancer) Notify() <-chan []Address { + return b.ch +} +func (b *blockingBalancer) Close() error { + close(b.ch) + return nil +} + +func TestDialWithBlockingBalancer(t *testing.T) { + defer leakcheck.Check(t) + ctx, cancel := context.WithCancel(context.Background()) + dialDone := make(chan struct{}) + go func() { + DialContext(ctx, "Non-Existent.Server:80", WithBlock(), WithInsecure(), WithBalancer(newBlockingBalancer())) + close(dialDone) + }() + cancel() + <-dialDone +} + +// securePerRPCCredentials always requires transport security. +type securePerRPCCredentials struct{} + +func (c securePerRPCCredentials) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) { + return nil, nil +} + +func (c securePerRPCCredentials) RequireTransportSecurity() bool { + return true +} + +func TestCredentialsMisuse(t *testing.T) { + defer leakcheck.Check(t) + tlsCreds, err := credentials.NewClientTLSFromFile(testdata.Path("ca.pem"), "x.test.youtube.com") + if err != nil { + t.Fatalf("Failed to create authenticator %v", err) + } + // Two conflicting credential configurations + if _, err := Dial("passthrough:///Non-Existent.Server:80", WithTransportCredentials(tlsCreds), WithBlock(), WithInsecure()); err != errCredentialsConflict { + t.Fatalf("Dial(_, _) = _, %v, want _, %v", err, errCredentialsConflict) + } + // security info on insecure connection + if _, err := Dial("passthrough:///Non-Existent.Server:80", WithPerRPCCredentials(securePerRPCCredentials{}), WithBlock(), WithInsecure()); err != errTransportCredentialsMissing { + t.Fatalf("Dial(_, _) = _, %v, want _, %v", err, errTransportCredentialsMissing) + } +} + +func TestWithBackoffConfigDefault(t *testing.T) { + defer leakcheck.Check(t) + testBackoffConfigSet(t, &DefaultBackoffConfig) +} + +func TestWithBackoffConfig(t *testing.T) { + defer leakcheck.Check(t) + b := BackoffConfig{MaxDelay: DefaultBackoffConfig.MaxDelay / 2} + expected := b + setDefaults(&expected) // defaults should be set + testBackoffConfigSet(t, &expected, WithBackoffConfig(b)) +} + +func TestWithBackoffMaxDelay(t *testing.T) { + defer leakcheck.Check(t) + md := DefaultBackoffConfig.MaxDelay / 2 + expected := BackoffConfig{MaxDelay: md} + setDefaults(&expected) + testBackoffConfigSet(t, &expected, WithBackoffMaxDelay(md)) +} + +func testBackoffConfigSet(t *testing.T, expected *BackoffConfig, opts ...DialOption) { + opts = append(opts, WithInsecure()) + conn, err := Dial("passthrough:///foo:80", opts...) + if err != nil { + t.Fatalf("unexpected error dialing connection: %v", err) + } + defer conn.Close() + + if conn.dopts.bs == nil { + t.Fatalf("backoff config not set") + } + + actual, ok := conn.dopts.bs.(BackoffConfig) + if !ok { + t.Fatalf("unexpected type of backoff config: %#v", conn.dopts.bs) + } + + if actual != *expected { + t.Fatalf("unexpected backoff config on connection: %v, want %v", actual, expected) + } +} + +// emptyBalancer returns an empty set of servers. +type emptyBalancer struct { + ch chan []Address +} + +func newEmptyBalancer() Balancer { + return &emptyBalancer{ch: make(chan []Address, 1)} +} +func (b *emptyBalancer) Start(_ string, _ BalancerConfig) error { + b.ch <- nil + return nil +} +func (b *emptyBalancer) Up(_ Address) func(error) { + return nil +} +func (b *emptyBalancer) Get(_ context.Context, _ BalancerGetOptions) (Address, func(), error) { + return Address{}, nil, nil +} +func (b *emptyBalancer) Notify() <-chan []Address { + return b.ch +} +func (b *emptyBalancer) Close() error { + close(b.ch) + return nil +} + +func TestNonblockingDialWithEmptyBalancer(t *testing.T) { + defer leakcheck.Check(t) + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + dialDone := make(chan error) + go func() { + dialDone <- func() error { + conn, err := DialContext(ctx, "Non-Existent.Server:80", WithInsecure(), WithBalancer(newEmptyBalancer())) + if err != nil { + return err + } + return conn.Close() + }() + }() + if err := <-dialDone; err != nil { + t.Fatalf("unexpected error dialing connection: %s", err) + } +} + +func TestClientUpdatesParamsAfterGoAway(t *testing.T) { + defer leakcheck.Check(t) + lis, err := net.Listen("tcp", "localhost:0") + if err != nil { + t.Fatalf("Failed to listen. Err: %v", err) + } + defer lis.Close() + addr := lis.Addr().String() + s := NewServer() + go s.Serve(lis) + defer s.Stop() + cc, err := Dial(addr, WithBlock(), WithInsecure(), WithKeepaliveParams(keepalive.ClientParameters{ + Time: 50 * time.Millisecond, + Timeout: 1 * time.Millisecond, + PermitWithoutStream: true, + })) + if err != nil { + t.Fatalf("Dial(%s, _) = _, %v, want _, ", addr, err) + } + defer cc.Close() + time.Sleep(1 * time.Second) + cc.mu.RLock() + defer cc.mu.RUnlock() + v := cc.mkp.Time + if v < 100*time.Millisecond { + t.Fatalf("cc.dopts.copts.Keepalive.Time = %v , want 100ms", v) + } +} diff --git a/vendor/google.golang.org/grpc/codec.go b/vendor/google.golang.org/grpc/codec.go new file mode 100644 index 0000000000..b452a4ae8d --- /dev/null +++ b/vendor/google.golang.org/grpc/codec.go @@ -0,0 +1,102 @@ +/* + * + * Copyright 2014 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. + * + */ + +package grpc + +import ( + "math" + "sync" + + "github.com/golang/protobuf/proto" +) + +// Codec defines the interface gRPC uses to encode and decode messages. +// Note that implementations of this interface must be thread safe; +// a Codec's methods can be called from concurrent goroutines. +type Codec interface { + // Marshal returns the wire format of v. + Marshal(v interface{}) ([]byte, error) + // Unmarshal parses the wire format into v. + Unmarshal(data []byte, v interface{}) error + // String returns the name of the Codec implementation. The returned + // string will be used as part of content type in transmission. + String() string +} + +// protoCodec is a Codec implementation with protobuf. It is the default codec for gRPC. +type protoCodec struct { +} + +type cachedProtoBuffer struct { + lastMarshaledSize uint32 + proto.Buffer +} + +func capToMaxInt32(val int) uint32 { + if val > math.MaxInt32 { + return uint32(math.MaxInt32) + } + return uint32(val) +} + +func (p protoCodec) marshal(v interface{}, cb *cachedProtoBuffer) ([]byte, error) { + protoMsg := v.(proto.Message) + newSlice := make([]byte, 0, cb.lastMarshaledSize) + + cb.SetBuf(newSlice) + cb.Reset() + if err := cb.Marshal(protoMsg); err != nil { + return nil, err + } + out := cb.Bytes() + cb.lastMarshaledSize = capToMaxInt32(len(out)) + return out, nil +} + +func (p protoCodec) Marshal(v interface{}) ([]byte, error) { + cb := protoBufferPool.Get().(*cachedProtoBuffer) + out, err := p.marshal(v, cb) + + // put back buffer and lose the ref to the slice + cb.SetBuf(nil) + protoBufferPool.Put(cb) + return out, err +} + +func (p protoCodec) Unmarshal(data []byte, v interface{}) error { + cb := protoBufferPool.Get().(*cachedProtoBuffer) + cb.SetBuf(data) + v.(proto.Message).Reset() + err := cb.Unmarshal(v.(proto.Message)) + cb.SetBuf(nil) + protoBufferPool.Put(cb) + return err +} + +func (protoCodec) String() string { + return "proto" +} + +var protoBufferPool = &sync.Pool{ + New: func() interface{} { + return &cachedProtoBuffer{ + Buffer: proto.Buffer{}, + lastMarshaledSize: 16, + } + }, +} diff --git a/vendor/google.golang.org/grpc/codec_benchmark_test.go b/vendor/google.golang.org/grpc/codec_benchmark_test.go new file mode 100644 index 0000000000..2286fd813c --- /dev/null +++ b/vendor/google.golang.org/grpc/codec_benchmark_test.go @@ -0,0 +1,99 @@ +// +build go1.7 + +/* + * + * Copyright 2014 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. + * + */ + +package grpc + +import ( + "fmt" + "testing" + + "github.com/golang/protobuf/proto" + "google.golang.org/grpc/test/codec_perf" +) + +func setupBenchmarkProtoCodecInputs(payloadBaseSize uint32) []proto.Message { + payloadBase := make([]byte, payloadBaseSize) + // arbitrary byte slices + payloadSuffixes := [][]byte{ + []byte("one"), + []byte("two"), + []byte("three"), + []byte("four"), + []byte("five"), + } + protoStructs := make([]proto.Message, 0) + + for _, p := range payloadSuffixes { + ps := &codec_perf.Buffer{} + ps.Body = append(payloadBase, p...) + protoStructs = append(protoStructs, ps) + } + + return protoStructs +} + +// The possible use of certain protobuf APIs like the proto.Buffer API potentially involves caching +// on our side. This can add checks around memory allocations and possible contention. +// Example run: go test -v -run=^$ -bench=BenchmarkProtoCodec -benchmem +func BenchmarkProtoCodec(b *testing.B) { + // range of message sizes + payloadBaseSizes := make([]uint32, 0) + for i := uint32(0); i <= 12; i += 4 { + payloadBaseSizes = append(payloadBaseSizes, 1<= Code(len(_Code_index)-1) { + return "Code(" + strconv.FormatInt(int64(i), 10) + ")" + } + return _Code_name[_Code_index[i]:_Code_index[i+1]] +} diff --git a/vendor/google.golang.org/grpc/codes/codes.go b/vendor/google.golang.org/grpc/codes/codes.go new file mode 100644 index 0000000000..21e7733a5f --- /dev/null +++ b/vendor/google.golang.org/grpc/codes/codes.go @@ -0,0 +1,144 @@ +/* + * + * Copyright 2014 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. + * + */ + +// Package codes defines the canonical error codes used by gRPC. It is +// consistent across various languages. +package codes // import "google.golang.org/grpc/codes" + +// A Code is an unsigned 32-bit error code as defined in the gRPC spec. +type Code uint32 + +//go:generate stringer -type=Code + +const ( + // OK is returned on success. + OK Code = 0 + + // Canceled indicates the operation was canceled (typically by the caller). + Canceled Code = 1 + + // Unknown error. An example of where this error may be returned is + // if a Status value received from another address space belongs to + // an error-space that is not known in this address space. Also + // errors raised by APIs that do not return enough error information + // may be converted to this error. + Unknown Code = 2 + + // InvalidArgument indicates client specified an invalid argument. + // Note that this differs from FailedPrecondition. It indicates arguments + // that are problematic regardless of the state of the system + // (e.g., a malformed file name). + InvalidArgument Code = 3 + + // DeadlineExceeded means operation expired before completion. + // For operations that change the state of the system, this error may be + // returned even if the operation has completed successfully. For + // example, a successful response from a server could have been delayed + // long enough for the deadline to expire. + DeadlineExceeded Code = 4 + + // NotFound means some requested entity (e.g., file or directory) was + // not found. + NotFound Code = 5 + + // AlreadyExists means an attempt to create an entity failed because one + // already exists. + AlreadyExists Code = 6 + + // PermissionDenied indicates the caller does not have permission to + // execute the specified operation. It must not be used for rejections + // caused by exhausting some resource (use ResourceExhausted + // instead for those errors). It must not be + // used if the caller cannot be identified (use Unauthenticated + // instead for those errors). + PermissionDenied Code = 7 + + // Unauthenticated indicates the request does not have valid + // authentication credentials for the operation. + Unauthenticated Code = 16 + + // ResourceExhausted indicates some resource has been exhausted, perhaps + // a per-user quota, or perhaps the entire file system is out of space. + ResourceExhausted Code = 8 + + // FailedPrecondition indicates operation was rejected because the + // system is not in a state required for the operation's execution. + // For example, directory to be deleted may be non-empty, an rmdir + // operation is applied to a non-directory, etc. + // + // A litmus test that may help a service implementor in deciding + // between FailedPrecondition, Aborted, and Unavailable: + // (a) Use Unavailable if the client can retry just the failing call. + // (b) Use Aborted if the client should retry at a higher-level + // (e.g., restarting a read-modify-write sequence). + // (c) Use FailedPrecondition if the client should not retry until + // the system state has been explicitly fixed. E.g., if an "rmdir" + // fails because the directory is non-empty, FailedPrecondition + // should be returned since the client should not retry unless + // they have first fixed up the directory by deleting files from it. + // (d) Use FailedPrecondition if the client performs conditional + // REST Get/Update/Delete on a resource and the resource on the + // server does not match the condition. E.g., conflicting + // read-modify-write on the same resource. + FailedPrecondition Code = 9 + + // Aborted indicates the operation was aborted, typically due to a + // concurrency issue like sequencer check failures, transaction aborts, + // etc. + // + // See litmus test above for deciding between FailedPrecondition, + // Aborted, and Unavailable. + Aborted Code = 10 + + // OutOfRange means operation was attempted past the valid range. + // E.g., seeking or reading past end of file. + // + // Unlike InvalidArgument, this error indicates a problem that may + // be fixed if the system state changes. For example, a 32-bit file + // system will generate InvalidArgument if asked to read at an + // offset that is not in the range [0,2^32-1], but it will generate + // OutOfRange if asked to read from an offset past the current + // file size. + // + // There is a fair bit of overlap between FailedPrecondition and + // OutOfRange. We recommend using OutOfRange (the more specific + // error) when it applies so that callers who are iterating through + // a space can easily look for an OutOfRange error to detect when + // they are done. + OutOfRange Code = 11 + + // Unimplemented indicates operation is not implemented or not + // supported/enabled in this service. + Unimplemented Code = 12 + + // Internal errors. Means some invariants expected by underlying + // system has been broken. If you see one of these errors, + // something is very broken. + Internal Code = 13 + + // Unavailable indicates the service is currently unavailable. + // This is a most likely a transient condition and may be corrected + // by retrying with a backoff. + // + // See litmus test above for deciding between FailedPrecondition, + // Aborted, and Unavailable. + Unavailable Code = 14 + + // DataLoss indicates unrecoverable data loss or corruption. + DataLoss Code = 15 +) diff --git a/vendor/google.golang.org/grpc/connectivity/connectivity.go b/vendor/google.golang.org/grpc/connectivity/connectivity.go new file mode 100644 index 0000000000..568ef5dc68 --- /dev/null +++ b/vendor/google.golang.org/grpc/connectivity/connectivity.go @@ -0,0 +1,72 @@ +/* + * + * Copyright 2017 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. + * + */ + +// Package connectivity defines connectivity semantics. +// For details, see https://github.com/grpc/grpc/blob/master/doc/connectivity-semantics-and-api.md. +// All APIs in this package are experimental. +package connectivity + +import ( + "golang.org/x/net/context" + "google.golang.org/grpc/grpclog" +) + +// State indicates the state of connectivity. +// It can be the state of a ClientConn or SubConn. +type State int + +func (s State) String() string { + switch s { + case Idle: + return "IDLE" + case Connecting: + return "CONNECTING" + case Ready: + return "READY" + case TransientFailure: + return "TRANSIENT_FAILURE" + case Shutdown: + return "SHUTDOWN" + default: + grpclog.Errorf("unknown connectivity state: %d", s) + return "Invalid-State" + } +} + +const ( + // Idle indicates the ClientConn is idle. + Idle State = iota + // Connecting indicates the ClienConn is connecting. + Connecting + // Ready indicates the ClientConn is ready for work. + Ready + // TransientFailure indicates the ClientConn has seen a failure but expects to recover. + TransientFailure + // Shutdown indicates the ClientConn has started shutting down. + Shutdown +) + +// Reporter reports the connectivity states. +type Reporter interface { + // CurrentState returns the current state of the reporter. + CurrentState() State + // WaitForStateChange blocks until the reporter's state is different from the given state, + // and returns true. + // It returns false if <-ctx.Done() can proceed (ctx got timeout or got canceled). + WaitForStateChange(context.Context, State) bool +} diff --git a/vendor/google.golang.org/grpc/credentials/credentials.go b/vendor/google.golang.org/grpc/credentials/credentials.go new file mode 100644 index 0000000000..1d2e864f8f --- /dev/null +++ b/vendor/google.golang.org/grpc/credentials/credentials.go @@ -0,0 +1,219 @@ +/* + * + * Copyright 2014 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. + * + */ + +// Package credentials implements various credentials supported by gRPC library, +// which encapsulate all the state needed by a client to authenticate with a +// server and make various assertions, e.g., about the client's identity, role, +// or whether it is authorized to make a particular call. +package credentials // import "google.golang.org/grpc/credentials" + +import ( + "crypto/tls" + "crypto/x509" + "errors" + "fmt" + "io/ioutil" + "net" + "strings" + + "golang.org/x/net/context" +) + +// alpnProtoStr are the specified application level protocols for gRPC. +var alpnProtoStr = []string{"h2"} + +// PerRPCCredentials defines the common interface for the credentials which need to +// attach security information to every RPC (e.g., oauth2). +type PerRPCCredentials interface { + // GetRequestMetadata gets the current request metadata, refreshing + // tokens if required. This should be called by the transport layer on + // each request, and the data should be populated in headers or other + // context. uri is the URI of the entry point for the request. When + // supported by the underlying implementation, ctx can be used for + // timeout and cancellation. + // TODO(zhaoq): Define the set of the qualified keys instead of leaving + // it as an arbitrary string. + GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) + // RequireTransportSecurity indicates whether the credentials requires + // transport security. + RequireTransportSecurity() bool +} + +// ProtocolInfo provides information regarding the gRPC wire protocol version, +// security protocol, security protocol version in use, server name, etc. +type ProtocolInfo struct { + // ProtocolVersion is the gRPC wire protocol version. + ProtocolVersion string + // SecurityProtocol is the security protocol in use. + SecurityProtocol string + // SecurityVersion is the security protocol version. + SecurityVersion string + // ServerName is the user-configured server name. + ServerName string +} + +// AuthInfo defines the common interface for the auth information the users are interested in. +type AuthInfo interface { + AuthType() string +} + +// ErrConnDispatched indicates that rawConn has been dispatched out of gRPC +// and the caller should not close rawConn. +var ErrConnDispatched = errors.New("credentials: rawConn is dispatched out of gRPC") + +// TransportCredentials defines the common interface for all the live gRPC wire +// protocols and supported transport security protocols (e.g., TLS, SSL). +type TransportCredentials interface { + // ClientHandshake does the authentication handshake specified by the corresponding + // authentication protocol on rawConn for clients. It returns the authenticated + // connection and the corresponding auth information about the connection. + // Implementations must use the provided context to implement timely cancellation. + // gRPC will try to reconnect if the error returned is a temporary error + // (io.EOF, context.DeadlineExceeded or err.Temporary() == true). + // If the returned error is a wrapper error, implementations should make sure that + // the error implements Temporary() to have the correct retry behaviors. + // + // If the returned net.Conn is closed, it MUST close the net.Conn provided. + ClientHandshake(context.Context, string, net.Conn) (net.Conn, AuthInfo, error) + // ServerHandshake does the authentication handshake for servers. It returns + // the authenticated connection and the corresponding auth information about + // the connection. + // + // If the returned net.Conn is closed, it MUST close the net.Conn provided. + ServerHandshake(net.Conn) (net.Conn, AuthInfo, error) + // Info provides the ProtocolInfo of this TransportCredentials. + Info() ProtocolInfo + // Clone makes a copy of this TransportCredentials. + Clone() TransportCredentials + // OverrideServerName overrides the server name used to verify the hostname on the returned certificates from the server. + // gRPC internals also use it to override the virtual hosting name if it is set. + // It must be called before dialing. Currently, this is only used by grpclb. + OverrideServerName(string) error +} + +// TLSInfo contains the auth information for a TLS authenticated connection. +// It implements the AuthInfo interface. +type TLSInfo struct { + State tls.ConnectionState +} + +// AuthType returns the type of TLSInfo as a string. +func (t TLSInfo) AuthType() string { + return "tls" +} + +// tlsCreds is the credentials required for authenticating a connection using TLS. +type tlsCreds struct { + // TLS configuration + config *tls.Config +} + +func (c tlsCreds) Info() ProtocolInfo { + return ProtocolInfo{ + SecurityProtocol: "tls", + SecurityVersion: "1.2", + ServerName: c.config.ServerName, + } +} + +func (c *tlsCreds) ClientHandshake(ctx context.Context, authority string, rawConn net.Conn) (_ net.Conn, _ AuthInfo, err error) { + // use local cfg to avoid clobbering ServerName if using multiple endpoints + cfg := cloneTLSConfig(c.config) + if cfg.ServerName == "" { + colonPos := strings.LastIndex(authority, ":") + if colonPos == -1 { + colonPos = len(authority) + } + cfg.ServerName = authority[:colonPos] + } + conn := tls.Client(rawConn, cfg) + errChannel := make(chan error, 1) + go func() { + errChannel <- conn.Handshake() + }() + select { + case err := <-errChannel: + if err != nil { + return nil, nil, err + } + case <-ctx.Done(): + return nil, nil, ctx.Err() + } + return conn, TLSInfo{conn.ConnectionState()}, nil +} + +func (c *tlsCreds) ServerHandshake(rawConn net.Conn) (net.Conn, AuthInfo, error) { + conn := tls.Server(rawConn, c.config) + if err := conn.Handshake(); err != nil { + return nil, nil, err + } + return conn, TLSInfo{conn.ConnectionState()}, nil +} + +func (c *tlsCreds) Clone() TransportCredentials { + return NewTLS(c.config) +} + +func (c *tlsCreds) OverrideServerName(serverNameOverride string) error { + c.config.ServerName = serverNameOverride + return nil +} + +// NewTLS uses c to construct a TransportCredentials based on TLS. +func NewTLS(c *tls.Config) TransportCredentials { + tc := &tlsCreds{cloneTLSConfig(c)} + tc.config.NextProtos = alpnProtoStr + return tc +} + +// NewClientTLSFromCert constructs TLS credentials from the input certificate for client. +// serverNameOverride is for testing only. If set to a non empty string, +// it will override the virtual host name of authority (e.g. :authority header field) in requests. +func NewClientTLSFromCert(cp *x509.CertPool, serverNameOverride string) TransportCredentials { + return NewTLS(&tls.Config{ServerName: serverNameOverride, RootCAs: cp}) +} + +// NewClientTLSFromFile constructs TLS credentials from the input certificate file for client. +// serverNameOverride is for testing only. If set to a non empty string, +// it will override the virtual host name of authority (e.g. :authority header field) in requests. +func NewClientTLSFromFile(certFile, serverNameOverride string) (TransportCredentials, error) { + b, err := ioutil.ReadFile(certFile) + if err != nil { + return nil, err + } + cp := x509.NewCertPool() + if !cp.AppendCertsFromPEM(b) { + return nil, fmt.Errorf("credentials: failed to append certificates") + } + return NewTLS(&tls.Config{ServerName: serverNameOverride, RootCAs: cp}), nil +} + +// NewServerTLSFromCert constructs TLS credentials from the input certificate for server. +func NewServerTLSFromCert(cert *tls.Certificate) TransportCredentials { + return NewTLS(&tls.Config{Certificates: []tls.Certificate{*cert}}) +} + +// NewServerTLSFromFile constructs TLS credentials from the input certificate file and key +// file for server. +func NewServerTLSFromFile(certFile, keyFile string) (TransportCredentials, error) { + cert, err := tls.LoadX509KeyPair(certFile, keyFile) + if err != nil { + return nil, err + } + return NewTLS(&tls.Config{Certificates: []tls.Certificate{cert}}), nil +} diff --git a/vendor/google.golang.org/grpc/credentials/credentials_test.go b/vendor/google.golang.org/grpc/credentials/credentials_test.go new file mode 100644 index 0000000000..9b13db51d4 --- /dev/null +++ b/vendor/google.golang.org/grpc/credentials/credentials_test.go @@ -0,0 +1,206 @@ +/* + * + * Copyright 2016 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. + * + */ + +package credentials + +import ( + "crypto/tls" + "net" + "testing" + + "golang.org/x/net/context" + "google.golang.org/grpc/testdata" +) + +func TestTLSOverrideServerName(t *testing.T) { + expectedServerName := "server.name" + c := NewTLS(nil) + c.OverrideServerName(expectedServerName) + if c.Info().ServerName != expectedServerName { + t.Fatalf("c.Info().ServerName = %v, want %v", c.Info().ServerName, expectedServerName) + } +} + +func TestTLSClone(t *testing.T) { + expectedServerName := "server.name" + c := NewTLS(nil) + c.OverrideServerName(expectedServerName) + cc := c.Clone() + if cc.Info().ServerName != expectedServerName { + t.Fatalf("cc.Info().ServerName = %v, want %v", cc.Info().ServerName, expectedServerName) + } + cc.OverrideServerName("") + if c.Info().ServerName != expectedServerName { + t.Fatalf("Change in clone should not affect the original, c.Info().ServerName = %v, want %v", c.Info().ServerName, expectedServerName) + } + +} + +type serverHandshake func(net.Conn) (AuthInfo, error) + +func TestClientHandshakeReturnsAuthInfo(t *testing.T) { + done := make(chan AuthInfo, 1) + lis := launchServer(t, tlsServerHandshake, done) + defer lis.Close() + lisAddr := lis.Addr().String() + clientAuthInfo := clientHandle(t, gRPCClientHandshake, lisAddr) + // wait until server sends serverAuthInfo or fails. + serverAuthInfo, ok := <-done + if !ok { + t.Fatalf("Error at server-side") + } + if !compare(clientAuthInfo, serverAuthInfo) { + t.Fatalf("c.ClientHandshake(_, %v, _) = %v, want %v.", lisAddr, clientAuthInfo, serverAuthInfo) + } +} + +func TestServerHandshakeReturnsAuthInfo(t *testing.T) { + done := make(chan AuthInfo, 1) + lis := launchServer(t, gRPCServerHandshake, done) + defer lis.Close() + clientAuthInfo := clientHandle(t, tlsClientHandshake, lis.Addr().String()) + // wait until server sends serverAuthInfo or fails. + serverAuthInfo, ok := <-done + if !ok { + t.Fatalf("Error at server-side") + } + if !compare(clientAuthInfo, serverAuthInfo) { + t.Fatalf("ServerHandshake(_) = %v, want %v.", serverAuthInfo, clientAuthInfo) + } +} + +func TestServerAndClientHandshake(t *testing.T) { + done := make(chan AuthInfo, 1) + lis := launchServer(t, gRPCServerHandshake, done) + defer lis.Close() + clientAuthInfo := clientHandle(t, gRPCClientHandshake, lis.Addr().String()) + // wait until server sends serverAuthInfo or fails. + serverAuthInfo, ok := <-done + if !ok { + t.Fatalf("Error at server-side") + } + if !compare(clientAuthInfo, serverAuthInfo) { + t.Fatalf("AuthInfo returned by server: %v and client: %v aren't same", serverAuthInfo, clientAuthInfo) + } +} + +func compare(a1, a2 AuthInfo) bool { + if a1.AuthType() != a2.AuthType() { + return false + } + switch a1.AuthType() { + case "tls": + state1 := a1.(TLSInfo).State + state2 := a2.(TLSInfo).State + if state1.Version == state2.Version && + state1.HandshakeComplete == state2.HandshakeComplete && + state1.CipherSuite == state2.CipherSuite && + state1.NegotiatedProtocol == state2.NegotiatedProtocol { + return true + } + return false + default: + return false + } +} + +func launchServer(t *testing.T, hs serverHandshake, done chan AuthInfo) net.Listener { + lis, err := net.Listen("tcp", "localhost:0") + if err != nil { + t.Fatalf("Failed to listen: %v", err) + } + go serverHandle(t, hs, done, lis) + return lis +} + +// Is run in a separate goroutine. +func serverHandle(t *testing.T, hs serverHandshake, done chan AuthInfo, lis net.Listener) { + serverRawConn, err := lis.Accept() + if err != nil { + t.Errorf("Server failed to accept connection: %v", err) + close(done) + return + } + serverAuthInfo, err := hs(serverRawConn) + if err != nil { + t.Errorf("Server failed while handshake. Error: %v", err) + serverRawConn.Close() + close(done) + return + } + done <- serverAuthInfo +} + +func clientHandle(t *testing.T, hs func(net.Conn, string) (AuthInfo, error), lisAddr string) AuthInfo { + conn, err := net.Dial("tcp", lisAddr) + if err != nil { + t.Fatalf("Client failed to connect to %s. Error: %v", lisAddr, err) + } + defer conn.Close() + clientAuthInfo, err := hs(conn, lisAddr) + if err != nil { + t.Fatalf("Error on client while handshake. Error: %v", err) + } + return clientAuthInfo +} + +// Server handshake implementation in gRPC. +func gRPCServerHandshake(conn net.Conn) (AuthInfo, error) { + serverTLS, err := NewServerTLSFromFile(testdata.Path("server1.pem"), testdata.Path("server1.key")) + if err != nil { + return nil, err + } + _, serverAuthInfo, err := serverTLS.ServerHandshake(conn) + if err != nil { + return nil, err + } + return serverAuthInfo, nil +} + +// Client handshake implementation in gRPC. +func gRPCClientHandshake(conn net.Conn, lisAddr string) (AuthInfo, error) { + clientTLS := NewTLS(&tls.Config{InsecureSkipVerify: true}) + _, authInfo, err := clientTLS.ClientHandshake(context.Background(), lisAddr, conn) + if err != nil { + return nil, err + } + return authInfo, nil +} + +func tlsServerHandshake(conn net.Conn) (AuthInfo, error) { + cert, err := tls.LoadX509KeyPair(testdata.Path("server1.pem"), testdata.Path("server1.key")) + if err != nil { + return nil, err + } + serverTLSConfig := &tls.Config{Certificates: []tls.Certificate{cert}} + serverConn := tls.Server(conn, serverTLSConfig) + err = serverConn.Handshake() + if err != nil { + return nil, err + } + return TLSInfo{State: serverConn.ConnectionState()}, nil +} + +func tlsClientHandshake(conn net.Conn, _ string) (AuthInfo, error) { + clientTLSConfig := &tls.Config{InsecureSkipVerify: true} + clientConn := tls.Client(conn, clientTLSConfig) + if err := clientConn.Handshake(); err != nil { + return nil, err + } + return TLSInfo{State: clientConn.ConnectionState()}, nil +} diff --git a/vendor/google.golang.org/grpc/credentials/credentials_util_go17.go b/vendor/google.golang.org/grpc/credentials/credentials_util_go17.go new file mode 100644 index 0000000000..60409aac0f --- /dev/null +++ b/vendor/google.golang.org/grpc/credentials/credentials_util_go17.go @@ -0,0 +1,60 @@ +// +build go1.7 +// +build !go1.8 + +/* + * + * Copyright 2016 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. + * + */ + +package credentials + +import ( + "crypto/tls" +) + +// cloneTLSConfig returns a shallow clone of the exported +// fields of cfg, ignoring the unexported sync.Once, which +// contains a mutex and must not be copied. +// +// If cfg is nil, a new zero tls.Config is returned. +func cloneTLSConfig(cfg *tls.Config) *tls.Config { + if cfg == nil { + return &tls.Config{} + } + return &tls.Config{ + Rand: cfg.Rand, + Time: cfg.Time, + Certificates: cfg.Certificates, + NameToCertificate: cfg.NameToCertificate, + GetCertificate: cfg.GetCertificate, + RootCAs: cfg.RootCAs, + NextProtos: cfg.NextProtos, + ServerName: cfg.ServerName, + ClientAuth: cfg.ClientAuth, + ClientCAs: cfg.ClientCAs, + InsecureSkipVerify: cfg.InsecureSkipVerify, + CipherSuites: cfg.CipherSuites, + PreferServerCipherSuites: cfg.PreferServerCipherSuites, + SessionTicketsDisabled: cfg.SessionTicketsDisabled, + SessionTicketKey: cfg.SessionTicketKey, + ClientSessionCache: cfg.ClientSessionCache, + MinVersion: cfg.MinVersion, + MaxVersion: cfg.MaxVersion, + CurvePreferences: cfg.CurvePreferences, + DynamicRecordSizingDisabled: cfg.DynamicRecordSizingDisabled, + Renegotiation: cfg.Renegotiation, + } +} diff --git a/vendor/google.golang.org/grpc/credentials/credentials_util_go18.go b/vendor/google.golang.org/grpc/credentials/credentials_util_go18.go new file mode 100644 index 0000000000..93f0e1d8de --- /dev/null +++ b/vendor/google.golang.org/grpc/credentials/credentials_util_go18.go @@ -0,0 +1,38 @@ +// +build go1.8 + +/* + * + * Copyright 2017 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. + * + */ + +package credentials + +import ( + "crypto/tls" +) + +// cloneTLSConfig returns a shallow clone of the exported +// fields of cfg, ignoring the unexported sync.Once, which +// contains a mutex and must not be copied. +// +// If cfg is nil, a new zero tls.Config is returned. +func cloneTLSConfig(cfg *tls.Config) *tls.Config { + if cfg == nil { + return &tls.Config{} + } + + return cfg.Clone() +} diff --git a/vendor/google.golang.org/grpc/credentials/credentials_util_pre_go17.go b/vendor/google.golang.org/grpc/credentials/credentials_util_pre_go17.go new file mode 100644 index 0000000000..d6bbcc9fdd --- /dev/null +++ b/vendor/google.golang.org/grpc/credentials/credentials_util_pre_go17.go @@ -0,0 +1,57 @@ +// +build !go1.7 + +/* + * + * Copyright 2016 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. + * + */ + +package credentials + +import ( + "crypto/tls" +) + +// cloneTLSConfig returns a shallow clone of the exported +// fields of cfg, ignoring the unexported sync.Once, which +// contains a mutex and must not be copied. +// +// If cfg is nil, a new zero tls.Config is returned. +func cloneTLSConfig(cfg *tls.Config) *tls.Config { + if cfg == nil { + return &tls.Config{} + } + return &tls.Config{ + Rand: cfg.Rand, + Time: cfg.Time, + Certificates: cfg.Certificates, + NameToCertificate: cfg.NameToCertificate, + GetCertificate: cfg.GetCertificate, + RootCAs: cfg.RootCAs, + NextProtos: cfg.NextProtos, + ServerName: cfg.ServerName, + ClientAuth: cfg.ClientAuth, + ClientCAs: cfg.ClientCAs, + InsecureSkipVerify: cfg.InsecureSkipVerify, + CipherSuites: cfg.CipherSuites, + PreferServerCipherSuites: cfg.PreferServerCipherSuites, + SessionTicketsDisabled: cfg.SessionTicketsDisabled, + SessionTicketKey: cfg.SessionTicketKey, + ClientSessionCache: cfg.ClientSessionCache, + MinVersion: cfg.MinVersion, + MaxVersion: cfg.MaxVersion, + CurvePreferences: cfg.CurvePreferences, + } +} diff --git a/vendor/google.golang.org/grpc/credentials/oauth/oauth.go b/vendor/google.golang.org/grpc/credentials/oauth/oauth.go new file mode 100644 index 0000000000..f6d597a14f --- /dev/null +++ b/vendor/google.golang.org/grpc/credentials/oauth/oauth.go @@ -0,0 +1,173 @@ +/* + * + * Copyright 2015 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. + * + */ + +// Package oauth implements gRPC credentials using OAuth. +package oauth + +import ( + "fmt" + "io/ioutil" + "sync" + + "golang.org/x/net/context" + "golang.org/x/oauth2" + "golang.org/x/oauth2/google" + "golang.org/x/oauth2/jwt" + "google.golang.org/grpc/credentials" +) + +// TokenSource supplies PerRPCCredentials from an oauth2.TokenSource. +type TokenSource struct { + oauth2.TokenSource +} + +// GetRequestMetadata gets the request metadata as a map from a TokenSource. +func (ts TokenSource) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) { + token, err := ts.Token() + if err != nil { + return nil, err + } + return map[string]string{ + "authorization": token.Type() + " " + token.AccessToken, + }, nil +} + +// RequireTransportSecurity indicates whether the credentials requires transport security. +func (ts TokenSource) RequireTransportSecurity() bool { + return true +} + +type jwtAccess struct { + jsonKey []byte +} + +// NewJWTAccessFromFile creates PerRPCCredentials from the given keyFile. +func NewJWTAccessFromFile(keyFile string) (credentials.PerRPCCredentials, error) { + jsonKey, err := ioutil.ReadFile(keyFile) + if err != nil { + return nil, fmt.Errorf("credentials: failed to read the service account key file: %v", err) + } + return NewJWTAccessFromKey(jsonKey) +} + +// NewJWTAccessFromKey creates PerRPCCredentials from the given jsonKey. +func NewJWTAccessFromKey(jsonKey []byte) (credentials.PerRPCCredentials, error) { + return jwtAccess{jsonKey}, nil +} + +func (j jwtAccess) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) { + ts, err := google.JWTAccessTokenSourceFromJSON(j.jsonKey, uri[0]) + if err != nil { + return nil, err + } + token, err := ts.Token() + if err != nil { + return nil, err + } + return map[string]string{ + "authorization": token.Type() + " " + token.AccessToken, + }, nil +} + +func (j jwtAccess) RequireTransportSecurity() bool { + return true +} + +// oauthAccess supplies PerRPCCredentials from a given token. +type oauthAccess struct { + token oauth2.Token +} + +// NewOauthAccess constructs the PerRPCCredentials using a given token. +func NewOauthAccess(token *oauth2.Token) credentials.PerRPCCredentials { + return oauthAccess{token: *token} +} + +func (oa oauthAccess) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) { + return map[string]string{ + "authorization": oa.token.Type() + " " + oa.token.AccessToken, + }, nil +} + +func (oa oauthAccess) RequireTransportSecurity() bool { + return true +} + +// NewComputeEngine constructs the PerRPCCredentials that fetches access tokens from +// Google Compute Engine (GCE)'s metadata server. It is only valid to use this +// if your program is running on a GCE instance. +// TODO(dsymonds): Deprecate and remove this. +func NewComputeEngine() credentials.PerRPCCredentials { + return TokenSource{google.ComputeTokenSource("")} +} + +// serviceAccount represents PerRPCCredentials via JWT signing key. +type serviceAccount struct { + mu sync.Mutex + config *jwt.Config + t *oauth2.Token +} + +func (s *serviceAccount) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) { + s.mu.Lock() + defer s.mu.Unlock() + if !s.t.Valid() { + var err error + s.t, err = s.config.TokenSource(ctx).Token() + if err != nil { + return nil, err + } + } + return map[string]string{ + "authorization": s.t.Type() + " " + s.t.AccessToken, + }, nil +} + +func (s *serviceAccount) RequireTransportSecurity() bool { + return true +} + +// NewServiceAccountFromKey constructs the PerRPCCredentials using the JSON key slice +// from a Google Developers service account. +func NewServiceAccountFromKey(jsonKey []byte, scope ...string) (credentials.PerRPCCredentials, error) { + config, err := google.JWTConfigFromJSON(jsonKey, scope...) + if err != nil { + return nil, err + } + return &serviceAccount{config: config}, nil +} + +// NewServiceAccountFromFile constructs the PerRPCCredentials using the JSON key file +// of a Google Developers service account. +func NewServiceAccountFromFile(keyFile string, scope ...string) (credentials.PerRPCCredentials, error) { + jsonKey, err := ioutil.ReadFile(keyFile) + if err != nil { + return nil, fmt.Errorf("credentials: failed to read the service account key file: %v", err) + } + return NewServiceAccountFromKey(jsonKey, scope...) +} + +// NewApplicationDefault returns "Application Default Credentials". For more +// detail, see https://developers.google.com/accounts/docs/application-default-credentials. +func NewApplicationDefault(ctx context.Context, scope ...string) (credentials.PerRPCCredentials, error) { + t, err := google.DefaultTokenSource(ctx, scope...) + if err != nil { + return nil, err + } + return TokenSource{t}, nil +} diff --git a/vendor/google.golang.org/grpc/doc.go b/vendor/google.golang.org/grpc/doc.go new file mode 100644 index 0000000000..187adbb117 --- /dev/null +++ b/vendor/google.golang.org/grpc/doc.go @@ -0,0 +1,24 @@ +/* + * + * Copyright 2015 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. + * + */ + +/* +Package grpc implements an RPC system called gRPC. + +See grpc.io for more information about gRPC. +*/ +package grpc // import "google.golang.org/grpc" diff --git a/vendor/google.golang.org/grpc/encoding/encoding.go b/vendor/google.golang.org/grpc/encoding/encoding.go new file mode 100644 index 0000000000..47d10b0766 --- /dev/null +++ b/vendor/google.golang.org/grpc/encoding/encoding.go @@ -0,0 +1,61 @@ +/* + * + * Copyright 2017 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. + * + */ + +// Package encoding defines the interface for the compressor and the functions +// to register and get the compossor. +// This package is EXPERIMENTAL. +package encoding + +import ( + "io" +) + +var registerCompressor = make(map[string]Compressor) + +// Compressor is used for compressing and decompressing when sending or receiving messages. +type Compressor interface { + // Compress writes the data written to wc to w after compressing it. If an error + // occurs while initializing the compressor, that error is returned instead. + Compress(w io.Writer) (io.WriteCloser, error) + // Decompress reads data from r, decompresses it, and provides the uncompressed data + // via the returned io.Reader. If an error occurs while initializing the decompressor, that error + // is returned instead. + Decompress(r io.Reader) (io.Reader, error) + // Name is the name of the compression codec and is used to set the content coding header. + Name() string +} + +// RegisterCompressor registers the compressor with gRPC by its name. It can be activated when +// sending an RPC via grpc.UseCompressor(). It will be automatically accessed when receiving a +// message based on the content coding header. Servers also use it to send a response with the +// same encoding as the request. +// +// NOTE: this function must only be called during initialization time (i.e. in an init() function). If +// multiple Compressors are registered with the same name, the one registered last will take effect. +func RegisterCompressor(c Compressor) { + registerCompressor[c.Name()] = c +} + +// GetCompressor returns Compressor for the given compressor name. +func GetCompressor(name string) Compressor { + return registerCompressor[name] +} + +// Identity specifies the optional encoding for uncompressed streams. +// It is intended for grpc internal use only. +const Identity = "identity" diff --git a/vendor/google.golang.org/grpc/encoding/gzip/gzip.go b/vendor/google.golang.org/grpc/encoding/gzip/gzip.go new file mode 100644 index 0000000000..fb4385eb1f --- /dev/null +++ b/vendor/google.golang.org/grpc/encoding/gzip/gzip.go @@ -0,0 +1,93 @@ +/* + * + * Copyright 2017 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. + * + */ + +// Package gzip implements and registers the gzip compressor +// during the initialization. +// This package is EXPERIMENTAL. +package gzip + +import ( + "compress/gzip" + "io" + "io/ioutil" + "sync" + + "google.golang.org/grpc/encoding" +) + +func init() { + c := &compressor{} + c.poolCompressor.New = func() interface{} { + return &writer{Writer: gzip.NewWriter(ioutil.Discard), pool: &c.poolCompressor} + } + encoding.RegisterCompressor(c) +} + +type writer struct { + *gzip.Writer + pool *sync.Pool +} + +func (c *compressor) Compress(w io.Writer) (io.WriteCloser, error) { + z := c.poolCompressor.Get().(*writer) + z.Writer.Reset(w) + return z, nil +} + +func (z *writer) Close() error { + defer z.pool.Put(z) + return z.Writer.Close() +} + +type reader struct { + *gzip.Reader + pool *sync.Pool +} + +func (c *compressor) Decompress(r io.Reader) (io.Reader, error) { + z, inPool := c.poolDecompressor.Get().(*reader) + if !inPool { + newZ, err := gzip.NewReader(r) + if err != nil { + return nil, err + } + return &reader{Reader: newZ, pool: &c.poolDecompressor}, nil + } + if err := z.Reset(r); err != nil { + c.poolDecompressor.Put(z) + return nil, err + } + return z, nil +} + +func (z *reader) Read(p []byte) (n int, err error) { + n, err = z.Reader.Read(p) + if err == io.EOF { + z.pool.Put(z) + } + return n, err +} + +func (c *compressor) Name() string { + return "gzip" +} + +type compressor struct { + poolCompressor sync.Pool + poolDecompressor sync.Pool +} diff --git a/vendor/google.golang.org/grpc/examples/README.md b/vendor/google.golang.org/grpc/examples/README.md new file mode 100644 index 0000000000..792da24356 --- /dev/null +++ b/vendor/google.golang.org/grpc/examples/README.md @@ -0,0 +1,64 @@ +gRPC in 3 minutes (Go) +====================== + +BACKGROUND +------------- +For this sample, we've already generated the server and client stubs from [helloworld.proto](helloworld/helloworld/helloworld.proto). + +PREREQUISITES +------------- + +- This requires Go 1.6 or later +- Requires that [GOPATH is set](https://golang.org/doc/code.html#GOPATH) + +``` +$ go help gopath +$ # ensure the PATH contains $GOPATH/bin +$ export PATH=$PATH:$GOPATH/bin +``` + +INSTALL +------- + +``` +$ go get -u google.golang.org/grpc/examples/helloworld/greeter_client +$ go get -u google.golang.org/grpc/examples/helloworld/greeter_server +``` + +TRY IT! +------- + +- Run the server + + ``` + $ greeter_server & + ``` + +- Run the client + + ``` + $ greeter_client + ``` + +OPTIONAL - Rebuilding the generated code +---------------------------------------- + +1. Install [protobuf compiler](https://github.com/google/protobuf/blob/master/README.md#protocol-compiler-installation) + +1. Install the protoc Go plugin + + ``` + $ go get -u github.com/golang/protobuf/protoc-gen-go + ``` + +1. Rebuild the generated Go code + + ``` + $ go generate google.golang.org/grpc/examples/helloworld/... + ``` + + Or run `protoc` command (with the grpc plugin) + + ``` + $ protoc -I helloworld/ helloworld/helloworld.proto --go_out=plugins=grpc:helloworld + ``` diff --git a/vendor/google.golang.org/grpc/examples/gotutorial.md b/vendor/google.golang.org/grpc/examples/gotutorial.md new file mode 100644 index 0000000000..a520a5a155 --- /dev/null +++ b/vendor/google.golang.org/grpc/examples/gotutorial.md @@ -0,0 +1,431 @@ +# gRPC Basics: Go + +This tutorial provides a basic Go programmer's introduction to working with gRPC. By walking through this example you'll learn how to: + +- Define a service in a `.proto` file. +- Generate server and client code using the protocol buffer compiler. +- Use the Go gRPC API to write a simple client and server for your service. + +It assumes that you have read the [Getting started](https://github.com/grpc/grpc/tree/master/examples) guide and are familiar with [protocol buffers](https://developers.google.com/protocol-buffers/docs/overview). Note that the example in this tutorial uses the proto3 version of the protocol buffers language, you can find out more in the [proto3 language guide](https://developers.google.com/protocol-buffers/docs/proto3) and see the [release notes](https://github.com/google/protobuf/releases) for the new version in the protocol buffers Github repository. + +This isn't a comprehensive guide to using gRPC in Go: more reference documentation is coming soon. + +## Why use gRPC? + +Our example is a simple route mapping application that lets clients get information about features on their route, create a summary of their route, and exchange route information such as traffic updates with the server and other clients. + +With gRPC we can define our service once in a `.proto` file and implement clients and servers in any of gRPC's supported languages, which in turn can be run in environments ranging from servers inside Google to your own tablet - all the complexity of communication between different languages and environments is handled for you by gRPC. We also get all the advantages of working with protocol buffers, including efficient serialization, a simple IDL, and easy interface updating. + +## Example code and setup + +The example code for our tutorial is in [grpc/grpc-go/examples/route_guide](https://github.com/grpc/grpc-go/tree/master/examples/route_guide). To download the example, clone the `grpc-go` repository by running the following command: +```shell +$ go get google.golang.org/grpc +``` + +Then change your current directory to `grpc-go/examples/route_guide`: +```shell +$ cd $GOPATH/src/google.golang.org/grpc/examples/route_guide +``` + +You also should have the relevant tools installed to generate the server and client interface code - if you don't already, follow the setup instructions in [the Go quick start guide](https://github.com/grpc/grpc-go/tree/master/examples/). + + +## Defining the service + +Our first step (as you'll know from the [quick start](https://grpc.io/docs/#quick-start)) is to define the gRPC *service* and the method *request* and *response* types using [protocol buffers](https://developers.google.com/protocol-buffers/docs/overview). You can see the complete `.proto` file in [examples/route_guide/routeguide/route_guide.proto](https://github.com/grpc/grpc-go/tree/master/examples/route_guide/routeguide/route_guide.proto). + +To define a service, you specify a named `service` in your `.proto` file: + +```proto +service RouteGuide { + ... +} +``` + +Then you define `rpc` methods inside your service definition, specifying their request and response types. gRPC lets you define four kinds of service method, all of which are used in the `RouteGuide` service: + +- A *simple RPC* where the client sends a request to the server using the stub and waits for a response to come back, just like a normal function call. +```proto + // Obtains the feature at a given position. + rpc GetFeature(Point) returns (Feature) {} +``` + +- A *server-side streaming RPC* where the client sends a request to the server and gets a stream to read a sequence of messages back. The client reads from the returned stream until there are no more messages. As you can see in our example, you specify a server-side streaming method by placing the `stream` keyword before the *response* type. +```proto + // Obtains the Features available within the given Rectangle. Results are + // streamed rather than returned at once (e.g. in a response message with a + // repeated field), as the rectangle may cover a large area and contain a + // huge number of features. + rpc ListFeatures(Rectangle) returns (stream Feature) {} +``` + +- A *client-side streaming RPC* where the client writes a sequence of messages and sends them to the server, again using a provided stream. Once the client has finished writing the messages, it waits for the server to read them all and return its response. You specify a client-side streaming method by placing the `stream` keyword before the *request* type. +```proto + // Accepts a stream of Points on a route being traversed, returning a + // RouteSummary when traversal is completed. + rpc RecordRoute(stream Point) returns (RouteSummary) {} +``` + +- A *bidirectional streaming RPC* where both sides send a sequence of messages using a read-write stream. The two streams operate independently, so clients and servers can read and write in whatever order they like: for example, the server could wait to receive all the client messages before writing its responses, or it could alternately read a message then write a message, or some other combination of reads and writes. The order of messages in each stream is preserved. You specify this type of method by placing the `stream` keyword before both the request and the response. +```proto + // Accepts a stream of RouteNotes sent while a route is being traversed, + // while receiving other RouteNotes (e.g. from other users). + rpc RouteChat(stream RouteNote) returns (stream RouteNote) {} +``` + +Our `.proto` file also contains protocol buffer message type definitions for all the request and response types used in our service methods - for example, here's the `Point` message type: +```proto +// Points are represented as latitude-longitude pairs in the E7 representation +// (degrees multiplied by 10**7 and rounded to the nearest integer). +// Latitudes should be in the range +/- 90 degrees and longitude should be in +// the range +/- 180 degrees (inclusive). +message Point { + int32 latitude = 1; + int32 longitude = 2; +} +``` + + +## Generating client and server code + +Next we need to generate the gRPC client and server interfaces from our `.proto` service definition. We do this using the protocol buffer compiler `protoc` with a special gRPC Go plugin. + +For simplicity, we've provided a [bash script](https://github.com/grpc/grpc-go/blob/master/codegen.sh) that runs `protoc` for you with the appropriate plugin, input, and output (if you want to run this by yourself, make sure you've installed protoc and followed the gRPC-Go [installation instructions](https://github.com/grpc/grpc-go/blob/master/README.md) first): + +```shell +$ codegen.sh route_guide.proto +``` + +which actually runs: + +```shell +$ protoc --go_out=plugins=grpc:. route_guide.proto +``` + +Running this command generates the following file in your current directory: +- `route_guide.pb.go` + +This contains: +- All the protocol buffer code to populate, serialize, and retrieve our request and response message types +- An interface type (or *stub*) for clients to call with the methods defined in the `RouteGuide` service. +- An interface type for servers to implement, also with the methods defined in the `RouteGuide` service. + + + +## Creating the server + +First let's look at how we create a `RouteGuide` server. If you're only interested in creating gRPC clients, you can skip this section and go straight to [Creating the client](#client) (though you might find it interesting anyway!). + +There are two parts to making our `RouteGuide` service do its job: +- Implementing the service interface generated from our service definition: doing the actual "work" of our service. +- Running a gRPC server to listen for requests from clients and dispatch them to the right service implementation. + +You can find our example `RouteGuide` server in [grpc-go/examples/route_guide/server/server.go](https://github.com/grpc/grpc-go/tree/master/examples/route_guide/server/server.go). Let's take a closer look at how it works. + +### Implementing RouteGuide + +As you can see, our server has a `routeGuideServer` struct type that implements the generated `RouteGuideServer` interface: + +```go +type routeGuideServer struct { + ... +} +... + +func (s *routeGuideServer) GetFeature(ctx context.Context, point *pb.Point) (*pb.Feature, error) { + ... +} +... + +func (s *routeGuideServer) ListFeatures(rect *pb.Rectangle, stream pb.RouteGuide_ListFeaturesServer) error { + ... +} +... + +func (s *routeGuideServer) RecordRoute(stream pb.RouteGuide_RecordRouteServer) error { + ... +} +... + +func (s *routeGuideServer) RouteChat(stream pb.RouteGuide_RouteChatServer) error { + ... +} +... +``` + +#### Simple RPC +`routeGuideServer` implements all our service methods. Let's look at the simplest type first, `GetFeature`, which just gets a `Point` from the client and returns the corresponding feature information from its database in a `Feature`. + +```go +func (s *routeGuideServer) GetFeature(ctx context.Context, point *pb.Point) (*pb.Feature, error) { + for _, feature := range s.savedFeatures { + if proto.Equal(feature.Location, point) { + return feature, nil + } + } + // No feature was found, return an unnamed feature + return &pb.Feature{"", point}, nil +} +``` + +The method is passed a context object for the RPC and the client's `Point` protocol buffer request. It returns a `Feature` protocol buffer object with the response information and an `error`. In the method we populate the `Feature` with the appropriate information, and then `return` it along with an `nil` error to tell gRPC that we've finished dealing with the RPC and that the `Feature` can be returned to the client. + +#### Server-side streaming RPC +Now let's look at one of our streaming RPCs. `ListFeatures` is a server-side streaming RPC, so we need to send back multiple `Feature`s to our client. + +```go +func (s *routeGuideServer) ListFeatures(rect *pb.Rectangle, stream pb.RouteGuide_ListFeaturesServer) error { + for _, feature := range s.savedFeatures { + if inRange(feature.Location, rect) { + if err := stream.Send(feature); err != nil { + return err + } + } + } + return nil +} +``` + +As you can see, instead of getting simple request and response objects in our method parameters, this time we get a request object (the `Rectangle` in which our client wants to find `Feature`s) and a special `RouteGuide_ListFeaturesServer` object to write our responses. + +In the method, we populate as many `Feature` objects as we need to return, writing them to the `RouteGuide_ListFeaturesServer` using its `Send()` method. Finally, as in our simple RPC, we return a `nil` error to tell gRPC that we've finished writing responses. Should any error happen in this call, we return a non-`nil` error; the gRPC layer will translate it into an appropriate RPC status to be sent on the wire. + +#### Client-side streaming RPC +Now let's look at something a little more complicated: the client-side streaming method `RecordRoute`, where we get a stream of `Point`s from the client and return a single `RouteSummary` with information about their trip. As you can see, this time the method doesn't have a request parameter at all. Instead, it gets a `RouteGuide_RecordRouteServer` stream, which the server can use to both read *and* write messages - it can receive client messages using its `Recv()` method and return its single response using its `SendAndClose()` method. + +```go +func (s *routeGuideServer) RecordRoute(stream pb.RouteGuide_RecordRouteServer) error { + var pointCount, featureCount, distance int32 + var lastPoint *pb.Point + startTime := time.Now() + for { + point, err := stream.Recv() + if err == io.EOF { + endTime := time.Now() + return stream.SendAndClose(&pb.RouteSummary{ + PointCount: pointCount, + FeatureCount: featureCount, + Distance: distance, + ElapsedTime: int32(endTime.Sub(startTime).Seconds()), + }) + } + if err != nil { + return err + } + pointCount++ + for _, feature := range s.savedFeatures { + if proto.Equal(feature.Location, point) { + featureCount++ + } + } + if lastPoint != nil { + distance += calcDistance(lastPoint, point) + } + lastPoint = point + } +} +``` + +In the method body we use the `RouteGuide_RecordRouteServer`s `Recv()` method to repeatedly read in our client's requests to a request object (in this case a `Point`) until there are no more messages: the server needs to check the the error returned from `Recv()` after each call. If this is `nil`, the stream is still good and it can continue reading; if it's `io.EOF` the message stream has ended and the server can return its `RouteSummary`. If it has any other value, we return the error "as is" so that it'll be translated to an RPC status by the gRPC layer. + +#### Bidirectional streaming RPC +Finally, let's look at our bidirectional streaming RPC `RouteChat()`. + +```go +func (s *routeGuideServer) RouteChat(stream pb.RouteGuide_RouteChatServer) error { + for { + in, err := stream.Recv() + if err == io.EOF { + return nil + } + if err != nil { + return err + } + key := serialize(in.Location) + ... // look for notes to be sent to client + for _, note := range s.routeNotes[key] { + if err := stream.Send(note); err != nil { + return err + } + } + } +} +``` + +This time we get a `RouteGuide_RouteChatServer` stream that, as in our client-side streaming example, can be used to read and write messages. However, this time we return values via our method's stream while the client is still writing messages to *their* message stream. + +The syntax for reading and writing here is very similar to our client-streaming method, except the server uses the stream's `Send()` method rather than `SendAndClose()` because it's writing multiple responses. Although each side will always get the other's messages in the order they were written, both the client and server can read and write in any order — the streams operate completely independently. + +### Starting the server + +Once we've implemented all our methods, we also need to start up a gRPC server so that clients can actually use our service. The following snippet shows how we do this for our `RouteGuide` service: + +```go +flag.Parse() +lis, err := net.Listen("tcp", fmt.Sprintf("localhost:%d", *port)) +if err != nil { + log.Fatalf("failed to listen: %v", err) +} +grpcServer := grpc.NewServer() +pb.RegisterRouteGuideServer(grpcServer, &routeGuideServer{}) +... // determine whether to use TLS +grpcServer.Serve(lis) +``` +To build and start a server, we: + +1. Specify the port we want to use to listen for client requests using `lis, err := net.Listen("tcp", fmt.Sprintf("localhost:%d", *port))`. +2. Create an instance of the gRPC server using `grpc.NewServer()`. +3. Register our service implementation with the gRPC server. +4. Call `Serve()` on the server with our port details to do a blocking wait until the process is killed or `Stop()` is called. + + +## Creating the client + +In this section, we'll look at creating a Go client for our `RouteGuide` service. You can see our complete example client code in [grpc-go/examples/route_guide/client/client.go](https://github.com/grpc/grpc-go/tree/master/examples/route_guide/client/client.go). + +### Creating a stub + +To call service methods, we first need to create a gRPC *channel* to communicate with the server. We create this by passing the server address and port number to `grpc.Dial()` as follows: + +```go +conn, err := grpc.Dial(*serverAddr) +if err != nil { + ... +} +defer conn.Close() +``` + +You can use `DialOptions` to set the auth credentials (e.g., TLS, GCE credentials, JWT credentials) in `grpc.Dial` if the service you request requires that - however, we don't need to do this for our `RouteGuide` service. + +Once the gRPC *channel* is setup, we need a client *stub* to perform RPCs. We get this using the `NewRouteGuideClient` method provided in the `pb` package we generated from our `.proto` file. + +```go +client := pb.NewRouteGuideClient(conn) +``` + +### Calling service methods + +Now let's look at how we call our service methods. Note that in gRPC-Go, RPCs operate in a blocking/synchronous mode, which means that the RPC call waits for the server to respond, and will either return a response or an error. + +#### Simple RPC + +Calling the simple RPC `GetFeature` is nearly as straightforward as calling a local method. + +```go +feature, err := client.GetFeature(context.Background(), &pb.Point{409146138, -746188906}) +if err != nil { + ... +} +``` + +As you can see, we call the method on the stub we got earlier. In our method parameters we create and populate a request protocol buffer object (in our case `Point`). We also pass a `context.Context` object which lets us change our RPC's behaviour if necessary, such as time-out/cancel an RPC in flight. If the call doesn't return an error, then we can read the response information from the server from the first return value. + +```go +log.Println(feature) +``` + +#### Server-side streaming RPC + +Here's where we call the server-side streaming method `ListFeatures`, which returns a stream of geographical `Feature`s. If you've already read [Creating the server](#server) some of this may look very familiar - streaming RPCs are implemented in a similar way on both sides. + +```go +rect := &pb.Rectangle{ ... } // initialize a pb.Rectangle +stream, err := client.ListFeatures(context.Background(), rect) +if err != nil { + ... +} +for { + feature, err := stream.Recv() + if err == io.EOF { + break + } + if err != nil { + log.Fatalf("%v.ListFeatures(_) = _, %v", client, err) + } + log.Println(feature) +} +``` + +As in the simple RPC, we pass the method a context and a request. However, instead of getting a response object back, we get back an instance of `RouteGuide_ListFeaturesClient`. The client can use the `RouteGuide_ListFeaturesClient` stream to read the server's responses. + +We use the `RouteGuide_ListFeaturesClient`'s `Recv()` method to repeatedly read in the server's responses to a response protocol buffer object (in this case a `Feature`) until there are no more messages: the client needs to check the error `err` returned from `Recv()` after each call. If `nil`, the stream is still good and it can continue reading; if it's `io.EOF` then the message stream has ended; otherwise there must be an RPC error, which is passed over through `err`. + +#### Client-side streaming RPC + +The client-side streaming method `RecordRoute` is similar to the server-side method, except that we only pass the method a context and get a `RouteGuide_RecordRouteClient` stream back, which we can use to both write *and* read messages. + +```go +// Create a random number of random points +r := rand.New(rand.NewSource(time.Now().UnixNano())) +pointCount := int(r.Int31n(100)) + 2 // Traverse at least two points +var points []*pb.Point +for i := 0; i < pointCount; i++ { + points = append(points, randomPoint(r)) +} +log.Printf("Traversing %d points.", len(points)) +stream, err := client.RecordRoute(context.Background()) +if err != nil { + log.Fatalf("%v.RecordRoute(_) = _, %v", client, err) +} +for _, point := range points { + if err := stream.Send(point); err != nil { + log.Fatalf("%v.Send(%v) = %v", stream, point, err) + } +} +reply, err := stream.CloseAndRecv() +if err != nil { + log.Fatalf("%v.CloseAndRecv() got error %v, want %v", stream, err, nil) +} +log.Printf("Route summary: %v", reply) +``` + +The `RouteGuide_RecordRouteClient` has a `Send()` method that we can use to send requests to the server. Once we've finished writing our client's requests to the stream using `Send()`, we need to call `CloseAndRecv()` on the stream to let gRPC know that we've finished writing and are expecting to receive a response. We get our RPC status from the `err` returned from `CloseAndRecv()`. If the status is `nil`, then the first return value from `CloseAndRecv()` will be a valid server response. + +#### Bidirectional streaming RPC + +Finally, let's look at our bidirectional streaming RPC `RouteChat()`. As in the case of `RecordRoute`, we only pass the method a context object and get back a stream that we can use to both write and read messages. However, this time we return values via our method's stream while the server is still writing messages to *their* message stream. + +```go +stream, err := client.RouteChat(context.Background()) +waitc := make(chan struct{}) +go func() { + for { + in, err := stream.Recv() + if err == io.EOF { + // read done. + close(waitc) + return + } + if err != nil { + log.Fatalf("Failed to receive a note : %v", err) + } + log.Printf("Got message %s at point(%d, %d)", in.Message, in.Location.Latitude, in.Location.Longitude) + } +}() +for _, note := range notes { + if err := stream.Send(note); err != nil { + log.Fatalf("Failed to send a note: %v", err) + } +} +stream.CloseSend() +<-waitc +``` + +The syntax for reading and writing here is very similar to our client-side streaming method, except we use the stream's `CloseSend()` method once we've finished our call. Although each side will always get the other's messages in the order they were written, both the client and server can read and write in any order — the streams operate completely independently. + +## Try it out! + +To compile and run the server, assuming you are in the folder +`$GOPATH/src/google.golang.org/grpc/examples/route_guide`, simply: + +```sh +$ go run server/server.go +``` + +Likewise, to run the client: + +```sh +$ go run client/client.go +``` + diff --git a/vendor/google.golang.org/grpc/examples/helloworld/greeter_client/main.go b/vendor/google.golang.org/grpc/examples/helloworld/greeter_client/main.go new file mode 100644 index 0000000000..3dc426e24b --- /dev/null +++ b/vendor/google.golang.org/grpc/examples/helloworld/greeter_client/main.go @@ -0,0 +1,54 @@ +/* + * + * Copyright 2015 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. + * + */ + +package main + +import ( + "log" + "os" + + "golang.org/x/net/context" + "google.golang.org/grpc" + pb "google.golang.org/grpc/examples/helloworld/helloworld" +) + +const ( + address = "localhost:50051" + defaultName = "world" +) + +func main() { + // Set up a connection to the server. + conn, err := grpc.Dial(address, grpc.WithInsecure()) + if err != nil { + log.Fatalf("did not connect: %v", err) + } + defer conn.Close() + c := pb.NewGreeterClient(conn) + + // Contact the server and print out its response. + name := defaultName + if len(os.Args) > 1 { + name = os.Args[1] + } + r, err := c.SayHello(context.Background(), &pb.HelloRequest{Name: name}) + if err != nil { + log.Fatalf("could not greet: %v", err) + } + log.Printf("Greeting: %s", r.Message) +} diff --git a/vendor/google.golang.org/grpc/examples/helloworld/greeter_server/main.go b/vendor/google.golang.org/grpc/examples/helloworld/greeter_server/main.go new file mode 100644 index 0000000000..702a3b6170 --- /dev/null +++ b/vendor/google.golang.org/grpc/examples/helloworld/greeter_server/main.go @@ -0,0 +1,57 @@ +/* + * + * Copyright 2015 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. + * + */ + +//go:generate protoc -I ../helloworld --go_out=plugins=grpc:../helloworld ../helloworld/helloworld.proto + +package main + +import ( + "log" + "net" + + "golang.org/x/net/context" + "google.golang.org/grpc" + pb "google.golang.org/grpc/examples/helloworld/helloworld" + "google.golang.org/grpc/reflection" +) + +const ( + port = ":50051" +) + +// server is used to implement helloworld.GreeterServer. +type server struct{} + +// SayHello implements helloworld.GreeterServer +func (s *server) SayHello(ctx context.Context, in *pb.HelloRequest) (*pb.HelloReply, error) { + return &pb.HelloReply{Message: "Hello " + in.Name}, nil +} + +func main() { + lis, err := net.Listen("tcp", port) + if err != nil { + log.Fatalf("failed to listen: %v", err) + } + s := grpc.NewServer() + pb.RegisterGreeterServer(s, &server{}) + // Register reflection service on gRPC server. + reflection.Register(s) + if err := s.Serve(lis); err != nil { + log.Fatalf("failed to serve: %v", err) + } +} diff --git a/vendor/google.golang.org/grpc/examples/helloworld/helloworld/helloworld.pb.go b/vendor/google.golang.org/grpc/examples/helloworld/helloworld/helloworld.pb.go new file mode 100644 index 0000000000..64bd1ef3c6 --- /dev/null +++ b/vendor/google.golang.org/grpc/examples/helloworld/helloworld/helloworld.pb.go @@ -0,0 +1,164 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: helloworld.proto + +/* +Package helloworld is a generated protocol buffer package. + +It is generated from these files: + helloworld.proto + +It has these top-level messages: + HelloRequest + HelloReply +*/ +package helloworld + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// The request message containing the user's name. +type HelloRequest struct { + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *HelloRequest) Reset() { *m = HelloRequest{} } +func (m *HelloRequest) String() string { return proto.CompactTextString(m) } +func (*HelloRequest) ProtoMessage() {} +func (*HelloRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *HelloRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// The response message containing the greetings +type HelloReply struct { + Message string `protobuf:"bytes,1,opt,name=message" json:"message,omitempty"` +} + +func (m *HelloReply) Reset() { *m = HelloReply{} } +func (m *HelloReply) String() string { return proto.CompactTextString(m) } +func (*HelloReply) ProtoMessage() {} +func (*HelloReply) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *HelloReply) GetMessage() string { + if m != nil { + return m.Message + } + return "" +} + +func init() { + proto.RegisterType((*HelloRequest)(nil), "helloworld.HelloRequest") + proto.RegisterType((*HelloReply)(nil), "helloworld.HelloReply") +} + +// 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 + +// Client API for Greeter service + +type GreeterClient interface { + // Sends a greeting + SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) +} + +type greeterClient struct { + cc *grpc.ClientConn +} + +func NewGreeterClient(cc *grpc.ClientConn) GreeterClient { + return &greeterClient{cc} +} + +func (c *greeterClient) SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) { + out := new(HelloReply) + err := grpc.Invoke(ctx, "/helloworld.Greeter/SayHello", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for Greeter service + +type GreeterServer interface { + // Sends a greeting + SayHello(context.Context, *HelloRequest) (*HelloReply, error) +} + +func RegisterGreeterServer(s *grpc.Server, srv GreeterServer) { + s.RegisterService(&_Greeter_serviceDesc, srv) +} + +func _Greeter_SayHello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(HelloRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GreeterServer).SayHello(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/helloworld.Greeter/SayHello", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GreeterServer).SayHello(ctx, req.(*HelloRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Greeter_serviceDesc = grpc.ServiceDesc{ + ServiceName: "helloworld.Greeter", + HandlerType: (*GreeterServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SayHello", + Handler: _Greeter_SayHello_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "helloworld.proto", +} + +func init() { proto.RegisterFile("helloworld.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 175 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xc8, 0x48, 0xcd, 0xc9, + 0xc9, 0x2f, 0xcf, 0x2f, 0xca, 0x49, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x42, 0x88, + 0x28, 0x29, 0x71, 0xf1, 0x78, 0x80, 0x78, 0x41, 0xa9, 0x85, 0xa5, 0xa9, 0xc5, 0x25, 0x42, 0x42, + 0x5c, 0x2c, 0x79, 0x89, 0xb9, 0xa9, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, 0x41, 0x60, 0xb6, 0x92, + 0x1a, 0x17, 0x17, 0x54, 0x4d, 0x41, 0x4e, 0xa5, 0x90, 0x04, 0x17, 0x7b, 0x6e, 0x6a, 0x71, 0x71, + 0x62, 0x3a, 0x4c, 0x11, 0x8c, 0x6b, 0xe4, 0xc9, 0xc5, 0xee, 0x5e, 0x94, 0x9a, 0x5a, 0x92, 0x5a, + 0x24, 0x64, 0xc7, 0xc5, 0x11, 0x9c, 0x58, 0x09, 0xd6, 0x25, 0x24, 0xa1, 0x87, 0xe4, 0x02, 0x64, + 0xcb, 0xa4, 0xc4, 0xb0, 0xc8, 0x14, 0xe4, 0x54, 0x2a, 0x31, 0x38, 0x19, 0x70, 0x49, 0x67, 0xe6, + 0xeb, 0xa5, 0x17, 0x15, 0x24, 0xeb, 0xa5, 0x56, 0x24, 0xe6, 0x16, 0xe4, 0xa4, 0x16, 0x23, 0xa9, + 0x75, 0xe2, 0x07, 0x2b, 0x0e, 0x07, 0xb1, 0x03, 0x40, 0x5e, 0x0a, 0x60, 0x4c, 0x62, 0x03, 0xfb, + 0xcd, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x0f, 0xb7, 0xcd, 0xf2, 0xef, 0x00, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/grpc/examples/helloworld/helloworld/helloworld.proto b/vendor/google.golang.org/grpc/examples/helloworld/helloworld/helloworld.proto new file mode 100644 index 0000000000..d79a6a0d1f --- /dev/null +++ b/vendor/google.golang.org/grpc/examples/helloworld/helloworld/helloworld.proto @@ -0,0 +1,37 @@ +// Copyright 2015 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. + +syntax = "proto3"; + +option java_multiple_files = true; +option java_package = "io.grpc.examples.helloworld"; +option java_outer_classname = "HelloWorldProto"; + +package helloworld; + +// The greeting service definition. +service Greeter { + // Sends a greeting + rpc SayHello (HelloRequest) returns (HelloReply) {} +} + +// The request message containing the user's name. +message HelloRequest { + string name = 1; +} + +// The response message containing the greetings +message HelloReply { + string message = 1; +} diff --git a/vendor/google.golang.org/grpc/examples/helloworld/mock_helloworld/hw_mock.go b/vendor/google.golang.org/grpc/examples/helloworld/mock_helloworld/hw_mock.go new file mode 100644 index 0000000000..14957ed5fc --- /dev/null +++ b/vendor/google.golang.org/grpc/examples/helloworld/mock_helloworld/hw_mock.go @@ -0,0 +1,48 @@ +// Automatically generated by MockGen. DO NOT EDIT! +// Source: google.golang.org/grpc/examples/helloworld/helloworld (interfaces: GreeterClient) + +package mock_helloworld + +import ( + gomock "github.com/golang/mock/gomock" + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" + helloworld "google.golang.org/grpc/examples/helloworld/helloworld" +) + +// Mock of GreeterClient interface +type MockGreeterClient struct { + ctrl *gomock.Controller + recorder *_MockGreeterClientRecorder +} + +// Recorder for MockGreeterClient (not exported) +type _MockGreeterClientRecorder struct { + mock *MockGreeterClient +} + +func NewMockGreeterClient(ctrl *gomock.Controller) *MockGreeterClient { + mock := &MockGreeterClient{ctrl: ctrl} + mock.recorder = &_MockGreeterClientRecorder{mock} + return mock +} + +func (_m *MockGreeterClient) EXPECT() *_MockGreeterClientRecorder { + return _m.recorder +} + +func (_m *MockGreeterClient) SayHello(_param0 context.Context, _param1 *helloworld.HelloRequest, _param2 ...grpc.CallOption) (*helloworld.HelloReply, error) { + _s := []interface{}{_param0, _param1} + for _, _x := range _param2 { + _s = append(_s, _x) + } + ret := _m.ctrl.Call(_m, "SayHello", _s...) + ret0, _ := ret[0].(*helloworld.HelloReply) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +func (_mr *_MockGreeterClientRecorder) SayHello(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + _s := append([]interface{}{arg0, arg1}, arg2...) + return _mr.mock.ctrl.RecordCall(_mr.mock, "SayHello", _s...) +} diff --git a/vendor/google.golang.org/grpc/examples/helloworld/mock_helloworld/hw_mock_test.go b/vendor/google.golang.org/grpc/examples/helloworld/mock_helloworld/hw_mock_test.go new file mode 100644 index 0000000000..5ad9b8b0dd --- /dev/null +++ b/vendor/google.golang.org/grpc/examples/helloworld/mock_helloworld/hw_mock_test.go @@ -0,0 +1,67 @@ +/* + * + * Copyright 2017 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. + * + */ + +package mock_helloworld_test + +import ( + "fmt" + "testing" + + "github.com/golang/mock/gomock" + "github.com/golang/protobuf/proto" + "golang.org/x/net/context" + helloworld "google.golang.org/grpc/examples/helloworld/helloworld" + hwmock "google.golang.org/grpc/examples/helloworld/mock_helloworld" +) + +// rpcMsg implements the gomock.Matcher interface +type rpcMsg struct { + msg proto.Message +} + +func (r *rpcMsg) Matches(msg interface{}) bool { + m, ok := msg.(proto.Message) + if !ok { + return false + } + return proto.Equal(m, r.msg) +} + +func (r *rpcMsg) String() string { + return fmt.Sprintf("is %s", r.msg) +} + +func TestSayHello(t *testing.T) { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + mockGreeterClient := hwmock.NewMockGreeterClient(ctrl) + req := &helloworld.HelloRequest{Name: "unit_test"} + mockGreeterClient.EXPECT().SayHello( + gomock.Any(), + &rpcMsg{msg: req}, + ).Return(&helloworld.HelloReply{Message: "Mocked Interface"}, nil) + testSayHello(t, mockGreeterClient) +} + +func testSayHello(t *testing.T, client helloworld.GreeterClient) { + r, err := client.SayHello(context.Background(), &helloworld.HelloRequest{Name: "unit_test"}) + if err != nil || r.Message != "Mocked Interface" { + t.Errorf("mocking failed") + } + t.Log("Reply : ", r.Message) +} diff --git a/vendor/google.golang.org/grpc/examples/route_guide/README.md b/vendor/google.golang.org/grpc/examples/route_guide/README.md new file mode 100644 index 0000000000..7f009d5caf --- /dev/null +++ b/vendor/google.golang.org/grpc/examples/route_guide/README.md @@ -0,0 +1,35 @@ +# Description +The route guide server and client demonstrate how to use grpc go libraries to +perform unary, client streaming, server streaming and full duplex RPCs. + +Please refer to [gRPC Basics: Go] (https://grpc.io/docs/tutorials/basic/go.html) for more information. + +See the definition of the route guide service in routeguide/route_guide.proto. + +# Run the sample code +To compile and run the server, assuming you are in the root of the route_guide +folder, i.e., .../examples/route_guide/, simply: + +```sh +$ go run server/server.go +``` + +Likewise, to run the client: + +```sh +$ go run client/client.go +``` + +# Optional command line flags +The server and client both take optional command line flags. For example, the +client and server run without TLS by default. To enable TLS: + +```sh +$ go run server/server.go -tls=true +``` + +and + +```sh +$ go run client/client.go -tls=true +``` diff --git a/vendor/google.golang.org/grpc/examples/route_guide/client/client.go b/vendor/google.golang.org/grpc/examples/route_guide/client/client.go new file mode 100644 index 0000000000..6fc7a079c5 --- /dev/null +++ b/vendor/google.golang.org/grpc/examples/route_guide/client/client.go @@ -0,0 +1,184 @@ +/* + * + * Copyright 2015 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. + * + */ + +// Package main implements a simple gRPC client that demonstrates how to use gRPC-Go libraries +// to perform unary, client streaming, server streaming and full duplex RPCs. +// +// It interacts with the route guide service whose definition can be found in routeguide/route_guide.proto. +package main + +import ( + "flag" + "io" + "log" + "math/rand" + "time" + + "golang.org/x/net/context" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" + pb "google.golang.org/grpc/examples/route_guide/routeguide" + "google.golang.org/grpc/testdata" +) + +var ( + tls = flag.Bool("tls", false, "Connection uses TLS if true, else plain TCP") + caFile = flag.String("ca_file", "", "The file containning the CA root cert file") + serverAddr = flag.String("server_addr", "127.0.0.1:10000", "The server address in the format of host:port") + serverHostOverride = flag.String("server_host_override", "x.test.youtube.com", "The server name use to verify the hostname returned by TLS handshake") +) + +// printFeature gets the feature for the given point. +func printFeature(client pb.RouteGuideClient, point *pb.Point) { + log.Printf("Getting feature for point (%d, %d)", point.Latitude, point.Longitude) + feature, err := client.GetFeature(context.Background(), point) + if err != nil { + log.Fatalf("%v.GetFeatures(_) = _, %v: ", client, err) + } + log.Println(feature) +} + +// printFeatures lists all the features within the given bounding Rectangle. +func printFeatures(client pb.RouteGuideClient, rect *pb.Rectangle) { + log.Printf("Looking for features within %v", rect) + stream, err := client.ListFeatures(context.Background(), rect) + if err != nil { + log.Fatalf("%v.ListFeatures(_) = _, %v", client, err) + } + for { + feature, err := stream.Recv() + if err == io.EOF { + break + } + if err != nil { + log.Fatalf("%v.ListFeatures(_) = _, %v", client, err) + } + log.Println(feature) + } +} + +// runRecordRoute sends a sequence of points to server and expects to get a RouteSummary from server. +func runRecordRoute(client pb.RouteGuideClient) { + // Create a random number of random points + r := rand.New(rand.NewSource(time.Now().UnixNano())) + pointCount := int(r.Int31n(100)) + 2 // Traverse at least two points + var points []*pb.Point + for i := 0; i < pointCount; i++ { + points = append(points, randomPoint(r)) + } + log.Printf("Traversing %d points.", len(points)) + stream, err := client.RecordRoute(context.Background()) + if err != nil { + log.Fatalf("%v.RecordRoute(_) = _, %v", client, err) + } + for _, point := range points { + if err := stream.Send(point); err != nil { + log.Fatalf("%v.Send(%v) = %v", stream, point, err) + } + } + reply, err := stream.CloseAndRecv() + if err != nil { + log.Fatalf("%v.CloseAndRecv() got error %v, want %v", stream, err, nil) + } + log.Printf("Route summary: %v", reply) +} + +// runRouteChat receives a sequence of route notes, while sending notes for various locations. +func runRouteChat(client pb.RouteGuideClient) { + notes := []*pb.RouteNote{ + {&pb.Point{Latitude: 0, Longitude: 1}, "First message"}, + {&pb.Point{Latitude: 0, Longitude: 2}, "Second message"}, + {&pb.Point{Latitude: 0, Longitude: 3}, "Third message"}, + {&pb.Point{Latitude: 0, Longitude: 1}, "Fourth message"}, + {&pb.Point{Latitude: 0, Longitude: 2}, "Fifth message"}, + {&pb.Point{Latitude: 0, Longitude: 3}, "Sixth message"}, + } + stream, err := client.RouteChat(context.Background()) + if err != nil { + log.Fatalf("%v.RouteChat(_) = _, %v", client, err) + } + waitc := make(chan struct{}) + go func() { + for { + in, err := stream.Recv() + if err == io.EOF { + // read done. + close(waitc) + return + } + if err != nil { + log.Fatalf("Failed to receive a note : %v", err) + } + log.Printf("Got message %s at point(%d, %d)", in.Message, in.Location.Latitude, in.Location.Longitude) + } + }() + for _, note := range notes { + if err := stream.Send(note); err != nil { + log.Fatalf("Failed to send a note: %v", err) + } + } + stream.CloseSend() + <-waitc +} + +func randomPoint(r *rand.Rand) *pb.Point { + lat := (r.Int31n(180) - 90) * 1e7 + long := (r.Int31n(360) - 180) * 1e7 + return &pb.Point{Latitude: lat, Longitude: long} +} + +func main() { + flag.Parse() + var opts []grpc.DialOption + if *tls { + if *caFile == "" { + *caFile = testdata.Path("ca.pem") + } + creds, err := credentials.NewClientTLSFromFile(*caFile, *serverHostOverride) + if err != nil { + log.Fatalf("Failed to create TLS credentials %v", err) + } + opts = append(opts, grpc.WithTransportCredentials(creds)) + } else { + opts = append(opts, grpc.WithInsecure()) + } + conn, err := grpc.Dial(*serverAddr, opts...) + if err != nil { + log.Fatalf("fail to dial: %v", err) + } + defer conn.Close() + client := pb.NewRouteGuideClient(conn) + + // Looking for a valid feature + printFeature(client, &pb.Point{Latitude: 409146138, Longitude: -746188906}) + + // Feature missing. + printFeature(client, &pb.Point{Latitude: 0, Longitude: 0}) + + // Looking for features between 40, -75 and 42, -73. + printFeatures(client, &pb.Rectangle{ + Lo: &pb.Point{Latitude: 400000000, Longitude: -750000000}, + Hi: &pb.Point{Latitude: 420000000, Longitude: -730000000}, + }) + + // RecordRoute + runRecordRoute(client) + + // RouteChat + runRouteChat(client) +} diff --git a/vendor/google.golang.org/grpc/examples/route_guide/mock_routeguide/rg_mock.go b/vendor/google.golang.org/grpc/examples/route_guide/mock_routeguide/rg_mock.go new file mode 100644 index 0000000000..328c929fa8 --- /dev/null +++ b/vendor/google.golang.org/grpc/examples/route_guide/mock_routeguide/rg_mock.go @@ -0,0 +1,200 @@ +// Automatically generated by MockGen. DO NOT EDIT! +// Source: google.golang.org/grpc/examples/route_guide/routeguide (interfaces: RouteGuideClient,RouteGuide_RouteChatClient) + +package mock_routeguide + +import ( + gomock "github.com/golang/mock/gomock" + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" + routeguide "google.golang.org/grpc/examples/route_guide/routeguide" + metadata "google.golang.org/grpc/metadata" +) + +// Mock of RouteGuideClient interface +type MockRouteGuideClient struct { + ctrl *gomock.Controller + recorder *_MockRouteGuideClientRecorder +} + +// Recorder for MockRouteGuideClient (not exported) +type _MockRouteGuideClientRecorder struct { + mock *MockRouteGuideClient +} + +func NewMockRouteGuideClient(ctrl *gomock.Controller) *MockRouteGuideClient { + mock := &MockRouteGuideClient{ctrl: ctrl} + mock.recorder = &_MockRouteGuideClientRecorder{mock} + return mock +} + +func (_m *MockRouteGuideClient) EXPECT() *_MockRouteGuideClientRecorder { + return _m.recorder +} + +func (_m *MockRouteGuideClient) GetFeature(_param0 context.Context, _param1 *routeguide.Point, _param2 ...grpc.CallOption) (*routeguide.Feature, error) { + _s := []interface{}{_param0, _param1} + for _, _x := range _param2 { + _s = append(_s, _x) + } + ret := _m.ctrl.Call(_m, "GetFeature", _s...) + ret0, _ := ret[0].(*routeguide.Feature) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +func (_mr *_MockRouteGuideClientRecorder) GetFeature(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + _s := append([]interface{}{arg0, arg1}, arg2...) + return _mr.mock.ctrl.RecordCall(_mr.mock, "GetFeature", _s...) +} + +func (_m *MockRouteGuideClient) ListFeatures(_param0 context.Context, _param1 *routeguide.Rectangle, _param2 ...grpc.CallOption) (routeguide.RouteGuide_ListFeaturesClient, error) { + _s := []interface{}{_param0, _param1} + for _, _x := range _param2 { + _s = append(_s, _x) + } + ret := _m.ctrl.Call(_m, "ListFeatures", _s...) + ret0, _ := ret[0].(routeguide.RouteGuide_ListFeaturesClient) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +func (_mr *_MockRouteGuideClientRecorder) ListFeatures(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + _s := append([]interface{}{arg0, arg1}, arg2...) + return _mr.mock.ctrl.RecordCall(_mr.mock, "ListFeatures", _s...) +} + +func (_m *MockRouteGuideClient) RecordRoute(_param0 context.Context, _param1 ...grpc.CallOption) (routeguide.RouteGuide_RecordRouteClient, error) { + _s := []interface{}{_param0} + for _, _x := range _param1 { + _s = append(_s, _x) + } + ret := _m.ctrl.Call(_m, "RecordRoute", _s...) + ret0, _ := ret[0].(routeguide.RouteGuide_RecordRouteClient) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +func (_mr *_MockRouteGuideClientRecorder) RecordRoute(arg0 interface{}, arg1 ...interface{}) *gomock.Call { + _s := append([]interface{}{arg0}, arg1...) + return _mr.mock.ctrl.RecordCall(_mr.mock, "RecordRoute", _s...) +} + +func (_m *MockRouteGuideClient) RouteChat(_param0 context.Context, _param1 ...grpc.CallOption) (routeguide.RouteGuide_RouteChatClient, error) { + _s := []interface{}{_param0} + for _, _x := range _param1 { + _s = append(_s, _x) + } + ret := _m.ctrl.Call(_m, "RouteChat", _s...) + ret0, _ := ret[0].(routeguide.RouteGuide_RouteChatClient) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +func (_mr *_MockRouteGuideClientRecorder) RouteChat(arg0 interface{}, arg1 ...interface{}) *gomock.Call { + _s := append([]interface{}{arg0}, arg1...) + return _mr.mock.ctrl.RecordCall(_mr.mock, "RouteChat", _s...) +} + +// Mock of RouteGuide_RouteChatClient interface +type MockRouteGuide_RouteChatClient struct { + ctrl *gomock.Controller + recorder *_MockRouteGuide_RouteChatClientRecorder +} + +// Recorder for MockRouteGuide_RouteChatClient (not exported) +type _MockRouteGuide_RouteChatClientRecorder struct { + mock *MockRouteGuide_RouteChatClient +} + +func NewMockRouteGuide_RouteChatClient(ctrl *gomock.Controller) *MockRouteGuide_RouteChatClient { + mock := &MockRouteGuide_RouteChatClient{ctrl: ctrl} + mock.recorder = &_MockRouteGuide_RouteChatClientRecorder{mock} + return mock +} + +func (_m *MockRouteGuide_RouteChatClient) EXPECT() *_MockRouteGuide_RouteChatClientRecorder { + return _m.recorder +} + +func (_m *MockRouteGuide_RouteChatClient) CloseSend() error { + ret := _m.ctrl.Call(_m, "CloseSend") + ret0, _ := ret[0].(error) + return ret0 +} + +func (_mr *_MockRouteGuide_RouteChatClientRecorder) CloseSend() *gomock.Call { + return _mr.mock.ctrl.RecordCall(_mr.mock, "CloseSend") +} + +func (_m *MockRouteGuide_RouteChatClient) Context() context.Context { + ret := _m.ctrl.Call(_m, "Context") + ret0, _ := ret[0].(context.Context) + return ret0 +} + +func (_mr *_MockRouteGuide_RouteChatClientRecorder) Context() *gomock.Call { + return _mr.mock.ctrl.RecordCall(_mr.mock, "Context") +} + +func (_m *MockRouteGuide_RouteChatClient) Header() (metadata.MD, error) { + ret := _m.ctrl.Call(_m, "Header") + ret0, _ := ret[0].(metadata.MD) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +func (_mr *_MockRouteGuide_RouteChatClientRecorder) Header() *gomock.Call { + return _mr.mock.ctrl.RecordCall(_mr.mock, "Header") +} + +func (_m *MockRouteGuide_RouteChatClient) Recv() (*routeguide.RouteNote, error) { + ret := _m.ctrl.Call(_m, "Recv") + ret0, _ := ret[0].(*routeguide.RouteNote) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +func (_mr *_MockRouteGuide_RouteChatClientRecorder) Recv() *gomock.Call { + return _mr.mock.ctrl.RecordCall(_mr.mock, "Recv") +} + +func (_m *MockRouteGuide_RouteChatClient) RecvMsg(_param0 interface{}) error { + ret := _m.ctrl.Call(_m, "RecvMsg", _param0) + ret0, _ := ret[0].(error) + return ret0 +} + +func (_mr *_MockRouteGuide_RouteChatClientRecorder) RecvMsg(arg0 interface{}) *gomock.Call { + return _mr.mock.ctrl.RecordCall(_mr.mock, "RecvMsg", arg0) +} + +func (_m *MockRouteGuide_RouteChatClient) Send(_param0 *routeguide.RouteNote) error { + ret := _m.ctrl.Call(_m, "Send", _param0) + ret0, _ := ret[0].(error) + return ret0 +} + +func (_mr *_MockRouteGuide_RouteChatClientRecorder) Send(arg0 interface{}) *gomock.Call { + return _mr.mock.ctrl.RecordCall(_mr.mock, "Send", arg0) +} + +func (_m *MockRouteGuide_RouteChatClient) SendMsg(_param0 interface{}) error { + ret := _m.ctrl.Call(_m, "SendMsg", _param0) + ret0, _ := ret[0].(error) + return ret0 +} + +func (_mr *_MockRouteGuide_RouteChatClientRecorder) SendMsg(arg0 interface{}) *gomock.Call { + return _mr.mock.ctrl.RecordCall(_mr.mock, "SendMsg", arg0) +} + +func (_m *MockRouteGuide_RouteChatClient) Trailer() metadata.MD { + ret := _m.ctrl.Call(_m, "Trailer") + ret0, _ := ret[0].(metadata.MD) + return ret0 +} + +func (_mr *_MockRouteGuide_RouteChatClientRecorder) Trailer() *gomock.Call { + return _mr.mock.ctrl.RecordCall(_mr.mock, "Trailer") +} diff --git a/vendor/google.golang.org/grpc/examples/route_guide/mock_routeguide/rg_mock_test.go b/vendor/google.golang.org/grpc/examples/route_guide/mock_routeguide/rg_mock_test.go new file mode 100644 index 0000000000..d084bd6ae1 --- /dev/null +++ b/vendor/google.golang.org/grpc/examples/route_guide/mock_routeguide/rg_mock_test.go @@ -0,0 +1,80 @@ +/* + * + * Copyright 2017 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. + * + */ + +package mock_routeguide_test + +import ( + "fmt" + "testing" + + "github.com/golang/mock/gomock" + "github.com/golang/protobuf/proto" + "golang.org/x/net/context" + rgmock "google.golang.org/grpc/examples/route_guide/mock_routeguide" + rgpb "google.golang.org/grpc/examples/route_guide/routeguide" +) + +var msg = &rgpb.RouteNote{ + Location: &rgpb.Point{Latitude: 17, Longitude: 29}, + Message: "Taxi-cab", +} + +func TestRouteChat(t *testing.T) { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + // Create mock for the stream returned by RouteChat + stream := rgmock.NewMockRouteGuide_RouteChatClient(ctrl) + // set expectation on sending. + stream.EXPECT().Send( + gomock.Any(), + ).Return(nil) + // Set expectation on receiving. + stream.EXPECT().Recv().Return(msg, nil) + stream.EXPECT().CloseSend().Return(nil) + // Create mock for the client interface. + rgclient := rgmock.NewMockRouteGuideClient(ctrl) + // Set expectation on RouteChat + rgclient.EXPECT().RouteChat( + gomock.Any(), + ).Return(stream, nil) + if err := testRouteChat(rgclient); err != nil { + t.Fatalf("Test failed: %v", err) + } +} + +func testRouteChat(client rgpb.RouteGuideClient) error { + stream, err := client.RouteChat(context.Background()) + if err != nil { + return err + } + if err := stream.Send(msg); err != nil { + return err + } + if err := stream.CloseSend(); err != nil { + return err + } + got, err := stream.Recv() + if err != nil { + return err + } + if !proto.Equal(got, msg) { + return fmt.Errorf("stream.Recv() = %v, want %v", got, msg) + } + return nil +} diff --git a/vendor/google.golang.org/grpc/examples/route_guide/routeguide/route_guide.pb.go b/vendor/google.golang.org/grpc/examples/route_guide/routeguide/route_guide.pb.go new file mode 100644 index 0000000000..cf7f3937e1 --- /dev/null +++ b/vendor/google.golang.org/grpc/examples/route_guide/routeguide/route_guide.pb.go @@ -0,0 +1,543 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: route_guide.proto + +/* +Package routeguide is a generated protocol buffer package. + +It is generated from these files: + route_guide.proto + +It has these top-level messages: + Point + Rectangle + Feature + RouteNote + RouteSummary +*/ +package routeguide + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Points are represented as latitude-longitude pairs in the E7 representation +// (degrees multiplied by 10**7 and rounded to the nearest integer). +// Latitudes should be in the range +/- 90 degrees and longitude should be in +// the range +/- 180 degrees (inclusive). +type Point struct { + Latitude int32 `protobuf:"varint,1,opt,name=latitude" json:"latitude,omitempty"` + Longitude int32 `protobuf:"varint,2,opt,name=longitude" json:"longitude,omitempty"` +} + +func (m *Point) Reset() { *m = Point{} } +func (m *Point) String() string { return proto.CompactTextString(m) } +func (*Point) ProtoMessage() {} +func (*Point) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *Point) GetLatitude() int32 { + if m != nil { + return m.Latitude + } + return 0 +} + +func (m *Point) GetLongitude() int32 { + if m != nil { + return m.Longitude + } + return 0 +} + +// A latitude-longitude rectangle, represented as two diagonally opposite +// points "lo" and "hi". +type Rectangle struct { + // One corner of the rectangle. + Lo *Point `protobuf:"bytes,1,opt,name=lo" json:"lo,omitempty"` + // The other corner of the rectangle. + Hi *Point `protobuf:"bytes,2,opt,name=hi" json:"hi,omitempty"` +} + +func (m *Rectangle) Reset() { *m = Rectangle{} } +func (m *Rectangle) String() string { return proto.CompactTextString(m) } +func (*Rectangle) ProtoMessage() {} +func (*Rectangle) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *Rectangle) GetLo() *Point { + if m != nil { + return m.Lo + } + return nil +} + +func (m *Rectangle) GetHi() *Point { + if m != nil { + return m.Hi + } + return nil +} + +// A feature names something at a given point. +// +// If a feature could not be named, the name is empty. +type Feature struct { + // The name of the feature. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The point where the feature is detected. + Location *Point `protobuf:"bytes,2,opt,name=location" json:"location,omitempty"` +} + +func (m *Feature) Reset() { *m = Feature{} } +func (m *Feature) String() string { return proto.CompactTextString(m) } +func (*Feature) ProtoMessage() {} +func (*Feature) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *Feature) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Feature) GetLocation() *Point { + if m != nil { + return m.Location + } + return nil +} + +// A RouteNote is a message sent while at a given point. +type RouteNote struct { + // The location from which the message is sent. + Location *Point `protobuf:"bytes,1,opt,name=location" json:"location,omitempty"` + // The message to be sent. + Message string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"` +} + +func (m *RouteNote) Reset() { *m = RouteNote{} } +func (m *RouteNote) String() string { return proto.CompactTextString(m) } +func (*RouteNote) ProtoMessage() {} +func (*RouteNote) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *RouteNote) GetLocation() *Point { + if m != nil { + return m.Location + } + return nil +} + +func (m *RouteNote) GetMessage() string { + if m != nil { + return m.Message + } + return "" +} + +// A RouteSummary is received in response to a RecordRoute rpc. +// +// It contains the number of individual points received, the number of +// detected features, and the total distance covered as the cumulative sum of +// the distance between each point. +type RouteSummary struct { + // The number of points received. + PointCount int32 `protobuf:"varint,1,opt,name=point_count,json=pointCount" json:"point_count,omitempty"` + // The number of known features passed while traversing the route. + FeatureCount int32 `protobuf:"varint,2,opt,name=feature_count,json=featureCount" json:"feature_count,omitempty"` + // The distance covered in metres. + Distance int32 `protobuf:"varint,3,opt,name=distance" json:"distance,omitempty"` + // The duration of the traversal in seconds. + ElapsedTime int32 `protobuf:"varint,4,opt,name=elapsed_time,json=elapsedTime" json:"elapsed_time,omitempty"` +} + +func (m *RouteSummary) Reset() { *m = RouteSummary{} } +func (m *RouteSummary) String() string { return proto.CompactTextString(m) } +func (*RouteSummary) ProtoMessage() {} +func (*RouteSummary) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *RouteSummary) GetPointCount() int32 { + if m != nil { + return m.PointCount + } + return 0 +} + +func (m *RouteSummary) GetFeatureCount() int32 { + if m != nil { + return m.FeatureCount + } + return 0 +} + +func (m *RouteSummary) GetDistance() int32 { + if m != nil { + return m.Distance + } + return 0 +} + +func (m *RouteSummary) GetElapsedTime() int32 { + if m != nil { + return m.ElapsedTime + } + return 0 +} + +func init() { + proto.RegisterType((*Point)(nil), "routeguide.Point") + proto.RegisterType((*Rectangle)(nil), "routeguide.Rectangle") + proto.RegisterType((*Feature)(nil), "routeguide.Feature") + proto.RegisterType((*RouteNote)(nil), "routeguide.RouteNote") + proto.RegisterType((*RouteSummary)(nil), "routeguide.RouteSummary") +} + +// 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 + +// Client API for RouteGuide service + +type RouteGuideClient interface { + // A simple RPC. + // + // Obtains the feature at a given position. + // + // A feature with an empty name is returned if there's no feature at the given + // position. + GetFeature(ctx context.Context, in *Point, opts ...grpc.CallOption) (*Feature, error) + // A server-to-client streaming RPC. + // + // Obtains the Features available within the given Rectangle. Results are + // streamed rather than returned at once (e.g. in a response message with a + // repeated field), as the rectangle may cover a large area and contain a + // huge number of features. + ListFeatures(ctx context.Context, in *Rectangle, opts ...grpc.CallOption) (RouteGuide_ListFeaturesClient, error) + // A client-to-server streaming RPC. + // + // Accepts a stream of Points on a route being traversed, returning a + // RouteSummary when traversal is completed. + RecordRoute(ctx context.Context, opts ...grpc.CallOption) (RouteGuide_RecordRouteClient, error) + // A Bidirectional streaming RPC. + // + // Accepts a stream of RouteNotes sent while a route is being traversed, + // while receiving other RouteNotes (e.g. from other users). + RouteChat(ctx context.Context, opts ...grpc.CallOption) (RouteGuide_RouteChatClient, error) +} + +type routeGuideClient struct { + cc *grpc.ClientConn +} + +func NewRouteGuideClient(cc *grpc.ClientConn) RouteGuideClient { + return &routeGuideClient{cc} +} + +func (c *routeGuideClient) GetFeature(ctx context.Context, in *Point, opts ...grpc.CallOption) (*Feature, error) { + out := new(Feature) + err := grpc.Invoke(ctx, "/routeguide.RouteGuide/GetFeature", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *routeGuideClient) ListFeatures(ctx context.Context, in *Rectangle, opts ...grpc.CallOption) (RouteGuide_ListFeaturesClient, error) { + stream, err := grpc.NewClientStream(ctx, &_RouteGuide_serviceDesc.Streams[0], c.cc, "/routeguide.RouteGuide/ListFeatures", opts...) + if err != nil { + return nil, err + } + x := &routeGuideListFeaturesClient{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 RouteGuide_ListFeaturesClient interface { + Recv() (*Feature, error) + grpc.ClientStream +} + +type routeGuideListFeaturesClient struct { + grpc.ClientStream +} + +func (x *routeGuideListFeaturesClient) Recv() (*Feature, error) { + m := new(Feature) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *routeGuideClient) RecordRoute(ctx context.Context, opts ...grpc.CallOption) (RouteGuide_RecordRouteClient, error) { + stream, err := grpc.NewClientStream(ctx, &_RouteGuide_serviceDesc.Streams[1], c.cc, "/routeguide.RouteGuide/RecordRoute", opts...) + if err != nil { + return nil, err + } + x := &routeGuideRecordRouteClient{stream} + return x, nil +} + +type RouteGuide_RecordRouteClient interface { + Send(*Point) error + CloseAndRecv() (*RouteSummary, error) + grpc.ClientStream +} + +type routeGuideRecordRouteClient struct { + grpc.ClientStream +} + +func (x *routeGuideRecordRouteClient) Send(m *Point) error { + return x.ClientStream.SendMsg(m) +} + +func (x *routeGuideRecordRouteClient) CloseAndRecv() (*RouteSummary, error) { + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + m := new(RouteSummary) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *routeGuideClient) RouteChat(ctx context.Context, opts ...grpc.CallOption) (RouteGuide_RouteChatClient, error) { + stream, err := grpc.NewClientStream(ctx, &_RouteGuide_serviceDesc.Streams[2], c.cc, "/routeguide.RouteGuide/RouteChat", opts...) + if err != nil { + return nil, err + } + x := &routeGuideRouteChatClient{stream} + return x, nil +} + +type RouteGuide_RouteChatClient interface { + Send(*RouteNote) error + Recv() (*RouteNote, error) + grpc.ClientStream +} + +type routeGuideRouteChatClient struct { + grpc.ClientStream +} + +func (x *routeGuideRouteChatClient) Send(m *RouteNote) error { + return x.ClientStream.SendMsg(m) +} + +func (x *routeGuideRouteChatClient) Recv() (*RouteNote, error) { + m := new(RouteNote) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// Server API for RouteGuide service + +type RouteGuideServer interface { + // A simple RPC. + // + // Obtains the feature at a given position. + // + // A feature with an empty name is returned if there's no feature at the given + // position. + GetFeature(context.Context, *Point) (*Feature, error) + // A server-to-client streaming RPC. + // + // Obtains the Features available within the given Rectangle. Results are + // streamed rather than returned at once (e.g. in a response message with a + // repeated field), as the rectangle may cover a large area and contain a + // huge number of features. + ListFeatures(*Rectangle, RouteGuide_ListFeaturesServer) error + // A client-to-server streaming RPC. + // + // Accepts a stream of Points on a route being traversed, returning a + // RouteSummary when traversal is completed. + RecordRoute(RouteGuide_RecordRouteServer) error + // A Bidirectional streaming RPC. + // + // Accepts a stream of RouteNotes sent while a route is being traversed, + // while receiving other RouteNotes (e.g. from other users). + RouteChat(RouteGuide_RouteChatServer) error +} + +func RegisterRouteGuideServer(s *grpc.Server, srv RouteGuideServer) { + s.RegisterService(&_RouteGuide_serviceDesc, srv) +} + +func _RouteGuide_GetFeature_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Point) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RouteGuideServer).GetFeature(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/routeguide.RouteGuide/GetFeature", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RouteGuideServer).GetFeature(ctx, req.(*Point)) + } + return interceptor(ctx, in, info, handler) +} + +func _RouteGuide_ListFeatures_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(Rectangle) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(RouteGuideServer).ListFeatures(m, &routeGuideListFeaturesServer{stream}) +} + +type RouteGuide_ListFeaturesServer interface { + Send(*Feature) error + grpc.ServerStream +} + +type routeGuideListFeaturesServer struct { + grpc.ServerStream +} + +func (x *routeGuideListFeaturesServer) Send(m *Feature) error { + return x.ServerStream.SendMsg(m) +} + +func _RouteGuide_RecordRoute_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(RouteGuideServer).RecordRoute(&routeGuideRecordRouteServer{stream}) +} + +type RouteGuide_RecordRouteServer interface { + SendAndClose(*RouteSummary) error + Recv() (*Point, error) + grpc.ServerStream +} + +type routeGuideRecordRouteServer struct { + grpc.ServerStream +} + +func (x *routeGuideRecordRouteServer) SendAndClose(m *RouteSummary) error { + return x.ServerStream.SendMsg(m) +} + +func (x *routeGuideRecordRouteServer) Recv() (*Point, error) { + m := new(Point) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _RouteGuide_RouteChat_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(RouteGuideServer).RouteChat(&routeGuideRouteChatServer{stream}) +} + +type RouteGuide_RouteChatServer interface { + Send(*RouteNote) error + Recv() (*RouteNote, error) + grpc.ServerStream +} + +type routeGuideRouteChatServer struct { + grpc.ServerStream +} + +func (x *routeGuideRouteChatServer) Send(m *RouteNote) error { + return x.ServerStream.SendMsg(m) +} + +func (x *routeGuideRouteChatServer) Recv() (*RouteNote, error) { + m := new(RouteNote) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +var _RouteGuide_serviceDesc = grpc.ServiceDesc{ + ServiceName: "routeguide.RouteGuide", + HandlerType: (*RouteGuideServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetFeature", + Handler: _RouteGuide_GetFeature_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "ListFeatures", + Handler: _RouteGuide_ListFeatures_Handler, + ServerStreams: true, + }, + { + StreamName: "RecordRoute", + Handler: _RouteGuide_RecordRoute_Handler, + ClientStreams: true, + }, + { + StreamName: "RouteChat", + Handler: _RouteGuide_RouteChat_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "route_guide.proto", +} + +func init() { proto.RegisterFile("route_guide.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 404 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0xdd, 0xca, 0xd3, 0x40, + 0x10, 0xfd, 0x36, 0x7e, 0x9f, 0x6d, 0x26, 0x11, 0xe9, 0x88, 0x10, 0xa2, 0xa0, 0x8d, 0x37, 0xbd, + 0x31, 0x94, 0x0a, 0x5e, 0x56, 0x6c, 0xc1, 0xde, 0x14, 0xa9, 0xb1, 0xf7, 0x65, 0x4d, 0xc6, 0x74, + 0x61, 0x93, 0x0d, 0xc9, 0x06, 0xf4, 0x01, 0x7c, 0x02, 0x5f, 0x58, 0xb2, 0x49, 0xda, 0x54, 0x5b, + 0xbc, 0xdb, 0x39, 0x73, 0xce, 0xfc, 0x9c, 0x61, 0x61, 0x52, 0xaa, 0x5a, 0xd3, 0x21, 0xad, 0x45, + 0x42, 0x61, 0x51, 0x2a, 0xad, 0x10, 0x0c, 0x64, 0x90, 0xe0, 0x23, 0x3c, 0xec, 0x94, 0xc8, 0x35, + 0xfa, 0x30, 0x96, 0x5c, 0x0b, 0x5d, 0x27, 0xe4, 0xb1, 0xd7, 0x6c, 0xf6, 0x10, 0x9d, 0x62, 0x7c, + 0x09, 0xb6, 0x54, 0x79, 0xda, 0x26, 0x2d, 0x93, 0x3c, 0x03, 0xc1, 0x17, 0xb0, 0x23, 0x8a, 0x35, + 0xcf, 0x53, 0x49, 0x38, 0x05, 0x4b, 0x2a, 0x53, 0xc0, 0x59, 0x4c, 0xc2, 0x73, 0xa3, 0xd0, 0x74, + 0x89, 0x2c, 0xa9, 0x1a, 0xca, 0x51, 0x98, 0x32, 0xd7, 0x29, 0x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 0x81, 0x8f, 0xc1, 0xdd, 0x8c, 0xe1, 0x87, 0xee, 0x64, 0xeb, 0x23, 0xd7, 0x7f, 0x35, 0xef, + 0x2f, 0xe9, 0x5f, 0x87, 0x1b, 0xf9, 0x9c, 0xad, 0xe6, 0xf0, 0x42, 0xa8, 0x30, 0x2d, 0x8b, 0x38, + 0xa4, 0x1f, 0x3c, 0x2b, 0x24, 0x55, 0x03, 0xfa, 0xea, 0xe9, 0xd9, 0xa3, 0x5d, 0xf3, 0x27, 0x76, + 0xec, 0xdb, 0x63, 0xf3, 0x39, 0xde, 0xfd, 0x09, 0x00, 0x00, 0xff, 0xff, 0xc8, 0xe4, 0xef, 0xe6, + 0x31, 0x03, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/grpc/examples/route_guide/routeguide/route_guide.proto b/vendor/google.golang.org/grpc/examples/route_guide/routeguide/route_guide.proto new file mode 100644 index 0000000000..fe21e437ad --- /dev/null +++ b/vendor/google.golang.org/grpc/examples/route_guide/routeguide/route_guide.proto @@ -0,0 +1,110 @@ +// Copyright 2015 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. + +syntax = "proto3"; + +option java_multiple_files = true; +option java_package = "io.grpc.examples.routeguide"; +option java_outer_classname = "RouteGuideProto"; + +package routeguide; + +// Interface exported by the server. +service RouteGuide { + // A simple RPC. + // + // Obtains the feature at a given position. + // + // A feature with an empty name is returned if there's no feature at the given + // position. + rpc GetFeature(Point) returns (Feature) {} + + // A server-to-client streaming RPC. + // + // Obtains the Features available within the given Rectangle. Results are + // streamed rather than returned at once (e.g. in a response message with a + // repeated field), as the rectangle may cover a large area and contain a + // huge number of features. + rpc ListFeatures(Rectangle) returns (stream Feature) {} + + // A client-to-server streaming RPC. + // + // Accepts a stream of Points on a route being traversed, returning a + // RouteSummary when traversal is completed. + rpc RecordRoute(stream Point) returns (RouteSummary) {} + + // A Bidirectional streaming RPC. + // + // Accepts a stream of RouteNotes sent while a route is being traversed, + // while receiving other RouteNotes (e.g. from other users). + rpc RouteChat(stream RouteNote) returns (stream RouteNote) {} +} + +// Points are represented as latitude-longitude pairs in the E7 representation +// (degrees multiplied by 10**7 and rounded to the nearest integer). +// Latitudes should be in the range +/- 90 degrees and longitude should be in +// the range +/- 180 degrees (inclusive). +message Point { + int32 latitude = 1; + int32 longitude = 2; +} + +// A latitude-longitude rectangle, represented as two diagonally opposite +// points "lo" and "hi". +message Rectangle { + // One corner of the rectangle. + Point lo = 1; + + // The other corner of the rectangle. + Point hi = 2; +} + +// A feature names something at a given point. +// +// If a feature could not be named, the name is empty. +message Feature { + // The name of the feature. + string name = 1; + + // The point where the feature is detected. + Point location = 2; +} + +// A RouteNote is a message sent while at a given point. +message RouteNote { + // The location from which the message is sent. + Point location = 1; + + // The message to be sent. + string message = 2; +} + +// A RouteSummary is received in response to a RecordRoute rpc. +// +// It contains the number of individual points received, the number of +// detected features, and the total distance covered as the cumulative sum of +// the distance between each point. +message RouteSummary { + // The number of points received. + int32 point_count = 1; + + // The number of known features passed while traversing the route. + int32 feature_count = 2; + + // The distance covered in metres. + int32 distance = 3; + + // The duration of the traversal in seconds. + int32 elapsed_time = 4; +} diff --git a/vendor/google.golang.org/grpc/examples/route_guide/server/server.go b/vendor/google.golang.org/grpc/examples/route_guide/server/server.go new file mode 100644 index 0000000000..5d919047ec --- /dev/null +++ b/vendor/google.golang.org/grpc/examples/route_guide/server/server.go @@ -0,0 +1,233 @@ +/* + * + * Copyright 2015 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. + * + */ + +//go:generate protoc -I ../routeguide --go_out=plugins=grpc:../routeguide ../routeguide/route_guide.proto + +// Package main implements a simple gRPC server that demonstrates how to use gRPC-Go libraries +// to perform unary, client streaming, server streaming and full duplex RPCs. +// +// It implements the route guide service whose definition can be found in routeguide/route_guide.proto. +package main + +import ( + "encoding/json" + "flag" + "fmt" + "io" + "io/ioutil" + "log" + "math" + "net" + "time" + + "golang.org/x/net/context" + "google.golang.org/grpc" + + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/testdata" + + "github.com/golang/protobuf/proto" + + pb "google.golang.org/grpc/examples/route_guide/routeguide" +) + +var ( + tls = flag.Bool("tls", false, "Connection uses TLS if true, else plain TCP") + certFile = flag.String("cert_file", "", "The TLS cert file") + keyFile = flag.String("key_file", "", "The TLS key file") + jsonDBFile = flag.String("json_db_file", "testdata/route_guide_db.json", "A json file containing a list of features") + port = flag.Int("port", 10000, "The server port") +) + +type routeGuideServer struct { + savedFeatures []*pb.Feature + routeNotes map[string][]*pb.RouteNote +} + +// GetFeature returns the feature at the given point. +func (s *routeGuideServer) GetFeature(ctx context.Context, point *pb.Point) (*pb.Feature, error) { + for _, feature := range s.savedFeatures { + if proto.Equal(feature.Location, point) { + return feature, nil + } + } + // No feature was found, return an unnamed feature + return &pb.Feature{Location: point}, nil +} + +// ListFeatures lists all features contained within the given bounding Rectangle. +func (s *routeGuideServer) ListFeatures(rect *pb.Rectangle, stream pb.RouteGuide_ListFeaturesServer) error { + for _, feature := range s.savedFeatures { + if inRange(feature.Location, rect) { + if err := stream.Send(feature); err != nil { + return err + } + } + } + return nil +} + +// RecordRoute records a route composited of a sequence of points. +// +// It gets a stream of points, and responds with statistics about the "trip": +// number of points, number of known features visited, total distance traveled, and +// total time spent. +func (s *routeGuideServer) RecordRoute(stream pb.RouteGuide_RecordRouteServer) error { + var pointCount, featureCount, distance int32 + var lastPoint *pb.Point + startTime := time.Now() + for { + point, err := stream.Recv() + if err == io.EOF { + endTime := time.Now() + return stream.SendAndClose(&pb.RouteSummary{ + PointCount: pointCount, + FeatureCount: featureCount, + Distance: distance, + ElapsedTime: int32(endTime.Sub(startTime).Seconds()), + }) + } + if err != nil { + return err + } + pointCount++ + for _, feature := range s.savedFeatures { + if proto.Equal(feature.Location, point) { + featureCount++ + } + } + if lastPoint != nil { + distance += calcDistance(lastPoint, point) + } + lastPoint = point + } +} + +// RouteChat receives a stream of message/location pairs, and responds with a stream of all +// previous messages at each of those locations. +func (s *routeGuideServer) RouteChat(stream pb.RouteGuide_RouteChatServer) error { + for { + in, err := stream.Recv() + if err == io.EOF { + return nil + } + if err != nil { + return err + } + key := serialize(in.Location) + if _, present := s.routeNotes[key]; !present { + s.routeNotes[key] = []*pb.RouteNote{in} + } else { + s.routeNotes[key] = append(s.routeNotes[key], in) + } + for _, note := range s.routeNotes[key] { + if err := stream.Send(note); err != nil { + return err + } + } + } +} + +// loadFeatures loads features from a JSON file. +func (s *routeGuideServer) loadFeatures(filePath string) { + file, err := ioutil.ReadFile(filePath) + if err != nil { + log.Fatalf("Failed to load default features: %v", err) + } + if err := json.Unmarshal(file, &s.savedFeatures); err != nil { + log.Fatalf("Failed to load default features: %v", err) + } +} + +func toRadians(num float64) float64 { + return num * math.Pi / float64(180) +} + +// calcDistance calculates the distance between two points using the "haversine" formula. +// This code was taken from http://www.movable-type.co.uk/scripts/latlong.html. +func calcDistance(p1 *pb.Point, p2 *pb.Point) int32 { + const CordFactor float64 = 1e7 + const R float64 = float64(6371000) // metres + lat1 := float64(p1.Latitude) / CordFactor + lat2 := float64(p2.Latitude) / CordFactor + lng1 := float64(p1.Longitude) / CordFactor + lng2 := float64(p2.Longitude) / CordFactor + φ1 := toRadians(lat1) + φ2 := toRadians(lat2) + Δφ := toRadians(lat2 - lat1) + Δλ := toRadians(lng2 - lng1) + + a := math.Sin(Δφ/2)*math.Sin(Δφ/2) + + math.Cos(φ1)*math.Cos(φ2)* + math.Sin(Δλ/2)*math.Sin(Δλ/2) + c := 2 * math.Atan2(math.Sqrt(a), math.Sqrt(1-a)) + + distance := R * c + return int32(distance) +} + +func inRange(point *pb.Point, rect *pb.Rectangle) bool { + left := math.Min(float64(rect.Lo.Longitude), float64(rect.Hi.Longitude)) + right := math.Max(float64(rect.Lo.Longitude), float64(rect.Hi.Longitude)) + top := math.Max(float64(rect.Lo.Latitude), float64(rect.Hi.Latitude)) + bottom := math.Min(float64(rect.Lo.Latitude), float64(rect.Hi.Latitude)) + + if float64(point.Longitude) >= left && + float64(point.Longitude) <= right && + float64(point.Latitude) >= bottom && + float64(point.Latitude) <= top { + return true + } + return false +} + +func serialize(point *pb.Point) string { + return fmt.Sprintf("%d %d", point.Latitude, point.Longitude) +} + +func newServer() *routeGuideServer { + s := new(routeGuideServer) + s.loadFeatures(*jsonDBFile) + s.routeNotes = make(map[string][]*pb.RouteNote) + return s +} + +func main() { + flag.Parse() + lis, err := net.Listen("tcp", fmt.Sprintf("localhost:%d", *port)) + if err != nil { + log.Fatalf("failed to listen: %v", err) + } + var opts []grpc.ServerOption + if *tls { + if *certFile == "" { + *certFile = testdata.Path("server1.pem") + } + if *keyFile == "" { + *keyFile = testdata.Path("server1.key") + } + creds, err := credentials.NewServerTLSFromFile(*certFile, *keyFile) + if err != nil { + log.Fatalf("Failed to generate credentials %v", err) + } + opts = []grpc.ServerOption{grpc.Creds(creds)} + } + grpcServer := grpc.NewServer(opts...) + pb.RegisterRouteGuideServer(grpcServer, newServer()) + grpcServer.Serve(lis) +} diff --git a/vendor/google.golang.org/grpc/examples/route_guide/testdata/route_guide_db.json b/vendor/google.golang.org/grpc/examples/route_guide/testdata/route_guide_db.json new file mode 100644 index 0000000000..9d6a980ab7 --- /dev/null +++ b/vendor/google.golang.org/grpc/examples/route_guide/testdata/route_guide_db.json @@ -0,0 +1,601 @@ +[{ + "location": { + "latitude": 407838351, + "longitude": -746143763 + }, + "name": "Patriots Path, Mendham, NJ 07945, USA" +}, { + "location": { + "latitude": 408122808, + "longitude": -743999179 + }, + "name": "101 New Jersey 10, Whippany, NJ 07981, USA" +}, { + "location": { + "latitude": 413628156, + "longitude": -749015468 + }, + "name": "U.S. 6, Shohola, PA 18458, USA" +}, { + "location": { + "latitude": 419999544, + "longitude": -740371136 + }, + "name": "5 Conners Road, Kingston, NY 12401, USA" +}, { + "location": { + "latitude": 414008389, + "longitude": -743951297 + }, + "name": "Mid Hudson Psychiatric Center, New Hampton, NY 10958, USA" +}, { + "location": { + "latitude": 419611318, + "longitude": -746524769 + }, + "name": "287 Flugertown Road, Livingston Manor, NY 12758, USA" +}, { + "location": { + "latitude": 406109563, + "longitude": -742186778 + }, + "name": "4001 Tremley Point Road, Linden, NJ 07036, USA" +}, { + "location": { + "latitude": 416802456, + "longitude": -742370183 + }, + "name": "352 South Mountain Road, Wallkill, NY 12589, USA" +}, { + "location": { + "latitude": 412950425, + "longitude": -741077389 + }, + "name": "Bailey Turn Road, Harriman, NY 10926, USA" +}, { + "location": { + "latitude": 412144655, + "longitude": -743949739 + }, + "name": "193-199 Wawayanda Road, Hewitt, NJ 07421, USA" +}, { + "location": { + "latitude": 415736605, + "longitude": -742847522 + }, + "name": "406-496 Ward Avenue, Pine Bush, NY 12566, USA" +}, { + "location": { + "latitude": 413843930, + "longitude": -740501726 + }, + "name": "162 Merrill Road, Highland Mills, NY 10930, USA" +}, { + "location": { + "latitude": 410873075, + "longitude": -744459023 + }, + "name": "Clinton Road, West Milford, NJ 07480, USA" +}, { + "location": { + "latitude": 412346009, + "longitude": -744026814 + }, + "name": "16 Old Brook Lane, Warwick, NY 10990, USA" +}, { + "location": { + "latitude": 402948455, + "longitude": -747903913 + }, + "name": "3 Drake Lane, Pennington, NJ 08534, USA" +}, { + "location": { + "latitude": 406337092, + "longitude": -740122226 + }, + "name": "6324 8th Avenue, Brooklyn, NY 11220, USA" +}, { + "location": { + "latitude": 406421967, + "longitude": -747727624 + }, + "name": "1 Merck Access Road, Whitehouse Station, NJ 08889, USA" +}, { + "location": { + "latitude": 416318082, + "longitude": -749677716 + }, + "name": "78-98 Schalck Road, Narrowsburg, NY 12764, USA" +}, { + "location": { + "latitude": 415301720, + "longitude": -748416257 + }, + "name": "282 Lakeview Drive Road, Highland Lake, NY 12743, USA" +}, { + "location": { + "latitude": 402647019, + "longitude": -747071791 + }, + "name": "330 Evelyn Avenue, Hamilton Township, NJ 08619, USA" +}, { + "location": { + "latitude": 412567807, + "longitude": -741058078 + }, + "name": "New York State Reference Route 987E, Southfields, NY 10975, USA" +}, { + "location": { + "latitude": 416855156, + "longitude": -744420597 + }, + "name": "103-271 Tempaloni Road, Ellenville, NY 12428, USA" +}, { + "location": { + "latitude": 404663628, + "longitude": -744820157 + }, + "name": "1300 Airport Road, North Brunswick Township, NJ 08902, USA" +}, { + "location": { + "latitude": 407113723, + "longitude": -749746483 + }, + "name": "" +}, { + "location": { + "latitude": 402133926, + "longitude": -743613249 + }, + "name": "" +}, { + "location": { + "latitude": 400273442, + "longitude": -741220915 + }, + "name": "" +}, { + "location": { + "latitude": 411236786, + "longitude": -744070769 + }, + "name": "" +}, { + "location": { + "latitude": 411633782, + "longitude": -746784970 + }, + "name": "211-225 Plains Road, Augusta, NJ 07822, USA" +}, { + "location": { + "latitude": 415830701, + "longitude": -742952812 + }, + "name": "" +}, { + "location": { + "latitude": 413447164, + "longitude": -748712898 + }, + "name": "165 Pedersen Ridge Road, Milford, PA 18337, USA" +}, { + "location": { + "latitude": 405047245, + "longitude": -749800722 + }, + "name": "100-122 Locktown Road, Frenchtown, NJ 08825, USA" +}, { + "location": { + "latitude": 418858923, + "longitude": -746156790 + }, + "name": "" +}, { + "location": { + "latitude": 417951888, + "longitude": -748484944 + }, + "name": "650-652 Willi Hill Road, Swan Lake, NY 12783, USA" +}, { + "location": { + "latitude": 407033786, + "longitude": -743977337 + }, + "name": "26 East 3rd Street, New Providence, NJ 07974, USA" +}, { + "location": { + "latitude": 417548014, + "longitude": -740075041 + }, + "name": "" +}, { + "location": { + "latitude": 410395868, + "longitude": -744972325 + }, + "name": "" +}, { + "location": { + "latitude": 404615353, + "longitude": -745129803 + }, + "name": "" +}, { + "location": { + "latitude": 406589790, + "longitude": -743560121 + }, + "name": "611 Lawrence Avenue, Westfield, NJ 07090, USA" +}, { + "location": { + "latitude": 414653148, + "longitude": -740477477 + }, + "name": "18 Lannis Avenue, New Windsor, NY 12553, USA" +}, { + "location": { + "latitude": 405957808, + "longitude": -743255336 + }, + "name": "82-104 Amherst Avenue, Colonia, NJ 07067, USA" +}, { + "location": { + "latitude": 411733589, + "longitude": -741648093 + }, + "name": "170 Seven Lakes Drive, Sloatsburg, NY 10974, USA" +}, { + "location": { + "latitude": 412676291, + "longitude": -742606606 + }, + "name": "1270 Lakes Road, Monroe, NY 10950, USA" +}, { + "location": { + "latitude": 409224445, + "longitude": -748286738 + }, + "name": "509-535 Alphano Road, Great Meadows, NJ 07838, USA" +}, { + "location": { + "latitude": 406523420, + "longitude": -742135517 + }, + "name": "652 Garden Street, Elizabeth, NJ 07202, USA" +}, { + "location": { + "latitude": 401827388, + "longitude": -740294537 + }, + "name": "349 Sea Spray Court, Neptune City, NJ 07753, USA" +}, { + "location": { + "latitude": 410564152, + "longitude": -743685054 + }, + "name": "13-17 Stanley Street, West Milford, NJ 07480, USA" +}, { + "location": { + "latitude": 408472324, + "longitude": -740726046 + }, + "name": "47 Industrial Avenue, Teterboro, NJ 07608, USA" +}, { + "location": { + "latitude": 412452168, + "longitude": -740214052 + }, + "name": "5 White Oak Lane, Stony Point, NY 10980, USA" +}, { + "location": { + "latitude": 409146138, + "longitude": -746188906 + }, + "name": "Berkshire Valley Management Area Trail, Jefferson, NJ, USA" +}, { + "location": { + "latitude": 404701380, + "longitude": -744781745 + }, + "name": "1007 Jersey Avenue, New Brunswick, NJ 08901, USA" +}, { + "location": { + "latitude": 409642566, + "longitude": -746017679 + }, + "name": "6 East Emerald Isle Drive, Lake Hopatcong, NJ 07849, USA" +}, { + "location": { + "latitude": 408031728, + "longitude": -748645385 + }, + "name": "1358-1474 New Jersey 57, Port Murray, NJ 07865, USA" +}, { + "location": { + "latitude": 413700272, + "longitude": -742135189 + }, + "name": "367 Prospect Road, Chester, NY 10918, USA" +}, { + "location": { + "latitude": 404310607, + "longitude": -740282632 + }, + "name": "10 Simon Lake Drive, Atlantic Highlands, NJ 07716, USA" +}, { + "location": { + "latitude": 409319800, + "longitude": -746201391 + }, + "name": "11 Ward Street, Mount Arlington, NJ 07856, USA" +}, { + "location": { + "latitude": 406685311, + "longitude": -742108603 + }, + "name": "300-398 Jefferson Avenue, Elizabeth, NJ 07201, USA" +}, { + "location": { + "latitude": 419018117, + "longitude": -749142781 + }, + "name": "43 Dreher Road, Roscoe, NY 12776, USA" +}, { + "location": { + "latitude": 412856162, + "longitude": -745148837 + }, + "name": "Swan Street, Pine Island, NY 10969, USA" +}, { + "location": { + "latitude": 416560744, + "longitude": -746721964 + }, + "name": "66 Pleasantview Avenue, Monticello, NY 12701, USA" +}, { + "location": { + "latitude": 405314270, + "longitude": -749836354 + }, + "name": "" +}, { + "location": { + "latitude": 414219548, + "longitude": -743327440 + }, + "name": "" +}, { + "location": { + "latitude": 415534177, + "longitude": -742900616 + }, + "name": "565 Winding Hills Road, Montgomery, NY 12549, USA" +}, { + "location": { + "latitude": 406898530, + "longitude": -749127080 + }, + "name": "231 Rocky Run Road, Glen Gardner, NJ 08826, USA" +}, { + "location": { + "latitude": 407586880, + "longitude": -741670168 + }, + "name": "100 Mount Pleasant Avenue, Newark, NJ 07104, USA" +}, { + "location": { + "latitude": 400106455, + "longitude": -742870190 + }, + "name": "517-521 Huntington Drive, Manchester Township, NJ 08759, USA" +}, { + "location": { + "latitude": 400066188, + "longitude": -746793294 + }, + "name": "" +}, { + "location": { + "latitude": 418803880, + "longitude": -744102673 + }, + "name": "40 Mountain Road, Napanoch, NY 12458, USA" +}, { + "location": { + "latitude": 414204288, + "longitude": -747895140 + }, + "name": "" +}, { + "location": { + "latitude": 414777405, + "longitude": -740615601 + }, + "name": "" +}, { + "location": { + "latitude": 415464475, + "longitude": -747175374 + }, + "name": "48 North Road, Forestburgh, NY 12777, USA" +}, { + "location": { + "latitude": 404062378, + "longitude": -746376177 + }, + "name": "" +}, { + "location": { + "latitude": 405688272, + "longitude": -749285130 + }, + "name": "" +}, { + "location": { + "latitude": 400342070, + "longitude": -748788996 + }, + "name": "" +}, { + "location": { + "latitude": 401809022, + "longitude": -744157964 + }, + "name": "" +}, { + "location": { + "latitude": 404226644, + "longitude": -740517141 + }, + "name": "9 Thompson Avenue, Leonardo, NJ 07737, USA" +}, { + "location": { + "latitude": 410322033, + "longitude": -747871659 + }, + "name": "" +}, { + "location": { + "latitude": 407100674, + "longitude": -747742727 + }, + "name": "" +}, { + "location": { + "latitude": 418811433, + "longitude": -741718005 + }, + "name": "213 Bush Road, Stone Ridge, NY 12484, USA" +}, { + "location": { + "latitude": 415034302, + "longitude": -743850945 + }, + "name": "" +}, { + "location": { + "latitude": 411349992, + "longitude": -743694161 + }, + "name": "" +}, { + "location": { + "latitude": 404839914, + "longitude": -744759616 + }, + "name": "1-17 Bergen Court, New Brunswick, NJ 08901, USA" +}, { + "location": { + "latitude": 414638017, + "longitude": -745957854 + }, + "name": "35 Oakland Valley Road, Cuddebackville, NY 12729, USA" +}, { + "location": { + "latitude": 412127800, + "longitude": -740173578 + }, + "name": "" +}, { + "location": { + "latitude": 401263460, + "longitude": -747964303 + }, + "name": "" +}, { + "location": { + "latitude": 412843391, + "longitude": -749086026 + }, + "name": "" +}, { + "location": { + "latitude": 418512773, + "longitude": -743067823 + }, + "name": "" +}, { + "location": { + "latitude": 404318328, + "longitude": -740835638 + }, + "name": "42-102 Main Street, Belford, NJ 07718, USA" +}, { + "location": { + "latitude": 419020746, + "longitude": -741172328 + }, + "name": "" +}, { + "location": { + "latitude": 404080723, + "longitude": -746119569 + }, + "name": "" +}, { + "location": { + "latitude": 401012643, + "longitude": -744035134 + }, + "name": "" +}, { + "location": { + "latitude": 404306372, + "longitude": -741079661 + }, + "name": "" +}, { + "location": { + "latitude": 403966326, + "longitude": -748519297 + }, + "name": "" +}, { + "location": { + "latitude": 405002031, + "longitude": -748407866 + }, + "name": "" +}, { + "location": { + "latitude": 409532885, + "longitude": -742200683 + }, + "name": "" +}, { + "location": { + "latitude": 416851321, + "longitude": -742674555 + }, + "name": "" +}, { + "location": { + "latitude": 406411633, + "longitude": -741722051 + }, + "name": "3387 Richmond Terrace, Staten Island, NY 10303, USA" +}, { + "location": { + "latitude": 413069058, + "longitude": -744597778 + }, + "name": "261 Van Sickle Road, Goshen, NY 10924, USA" +}, { + "location": { + "latitude": 418465462, + "longitude": -746859398 + }, + "name": "" +}, { + "location": { + "latitude": 411733222, + "longitude": -744228360 + }, + "name": "" +}, { + "location": { + "latitude": 410248224, + "longitude": -747127767 + }, + "name": "3 Hasta Way, Newton, NJ 07860, USA" +}] diff --git a/vendor/google.golang.org/grpc/go16.go b/vendor/google.golang.org/grpc/go16.go new file mode 100644 index 0000000000..f3dbf21700 --- /dev/null +++ b/vendor/google.golang.org/grpc/go16.go @@ -0,0 +1,98 @@ +// +build go1.6,!go1.7 + +/* + * + * Copyright 2016 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. + * + */ + +package grpc + +import ( + "fmt" + "io" + "net" + "net/http" + "os" + + "golang.org/x/net/context" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/grpc/transport" +) + +// dialContext connects to the address on the named network. +func dialContext(ctx context.Context, network, address string) (net.Conn, error) { + return (&net.Dialer{Cancel: ctx.Done()}).Dial(network, address) +} + +func sendHTTPRequest(ctx context.Context, req *http.Request, conn net.Conn) error { + req.Cancel = ctx.Done() + if err := req.Write(conn); err != nil { + return fmt.Errorf("failed to write the HTTP request: %v", err) + } + return nil +} + +// toRPCErr converts an error into an error from the status package. +func toRPCErr(err error) error { + if _, ok := status.FromError(err); ok { + return err + } + switch e := err.(type) { + case transport.StreamError: + return status.Error(e.Code, e.Desc) + case transport.ConnectionError: + return status.Error(codes.Unavailable, e.Desc) + default: + switch err { + case context.DeadlineExceeded: + return status.Error(codes.DeadlineExceeded, err.Error()) + case context.Canceled: + return status.Error(codes.Canceled, err.Error()) + case ErrClientConnClosing: + return status.Error(codes.FailedPrecondition, err.Error()) + } + } + return status.Error(codes.Unknown, err.Error()) +} + +// convertCode converts a standard Go error into its canonical code. Note that +// this is only used to translate the error returned by the server applications. +func convertCode(err error) codes.Code { + switch err { + case nil: + return codes.OK + case io.EOF: + return codes.OutOfRange + case io.ErrClosedPipe, io.ErrNoProgress, io.ErrShortBuffer, io.ErrShortWrite, io.ErrUnexpectedEOF: + return codes.FailedPrecondition + case os.ErrInvalid: + return codes.InvalidArgument + case context.Canceled: + return codes.Canceled + case context.DeadlineExceeded: + return codes.DeadlineExceeded + } + switch { + case os.IsExist(err): + return codes.AlreadyExists + case os.IsNotExist(err): + return codes.NotFound + case os.IsPermission(err): + return codes.PermissionDenied + } + return codes.Unknown +} diff --git a/vendor/google.golang.org/grpc/go17.go b/vendor/google.golang.org/grpc/go17.go new file mode 100644 index 0000000000..de23098eb9 --- /dev/null +++ b/vendor/google.golang.org/grpc/go17.go @@ -0,0 +1,99 @@ +// +build go1.7 + +/* + * + * Copyright 2016 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. + * + */ + +package grpc + +import ( + "context" + "fmt" + "io" + "net" + "net/http" + "os" + + netctx "golang.org/x/net/context" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/grpc/transport" +) + +// dialContext connects to the address on the named network. +func dialContext(ctx context.Context, network, address string) (net.Conn, error) { + return (&net.Dialer{}).DialContext(ctx, network, address) +} + +func sendHTTPRequest(ctx context.Context, req *http.Request, conn net.Conn) error { + req = req.WithContext(ctx) + if err := req.Write(conn); err != nil { + return fmt.Errorf("failed to write the HTTP request: %v", err) + } + return nil +} + +// toRPCErr converts an error into an error from the status package. +func toRPCErr(err error) error { + if _, ok := status.FromError(err); ok { + return err + } + switch e := err.(type) { + case transport.StreamError: + return status.Error(e.Code, e.Desc) + case transport.ConnectionError: + return status.Error(codes.Unavailable, e.Desc) + default: + switch err { + case context.DeadlineExceeded, netctx.DeadlineExceeded: + return status.Error(codes.DeadlineExceeded, err.Error()) + case context.Canceled, netctx.Canceled: + return status.Error(codes.Canceled, err.Error()) + case ErrClientConnClosing: + return status.Error(codes.FailedPrecondition, err.Error()) + } + } + return status.Error(codes.Unknown, err.Error()) +} + +// convertCode converts a standard Go error into its canonical code. Note that +// this is only used to translate the error returned by the server applications. +func convertCode(err error) codes.Code { + switch err { + case nil: + return codes.OK + case io.EOF: + return codes.OutOfRange + case io.ErrClosedPipe, io.ErrNoProgress, io.ErrShortBuffer, io.ErrShortWrite, io.ErrUnexpectedEOF: + return codes.FailedPrecondition + case os.ErrInvalid: + return codes.InvalidArgument + case context.Canceled, netctx.Canceled: + return codes.Canceled + case context.DeadlineExceeded, netctx.DeadlineExceeded: + return codes.DeadlineExceeded + } + switch { + case os.IsExist(err): + return codes.AlreadyExists + case os.IsNotExist(err): + return codes.NotFound + case os.IsPermission(err): + return codes.PermissionDenied + } + return codes.Unknown +} diff --git a/vendor/google.golang.org/grpc/grpclb.go b/vendor/google.golang.org/grpc/grpclb.go new file mode 100644 index 0000000000..db56ff3621 --- /dev/null +++ b/vendor/google.golang.org/grpc/grpclb.go @@ -0,0 +1,704 @@ +/* + * + * Copyright 2016 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. + * + */ + +package grpc + +import ( + "errors" + "fmt" + "math/rand" + "net" + "sync" + "time" + + "golang.org/x/net/context" + "google.golang.org/grpc/codes" + lbmpb "google.golang.org/grpc/grpclb/grpc_lb_v1/messages" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/naming" +) + +// Client API for LoadBalancer service. +// Mostly copied from generated pb.go file. +// To avoid circular dependency. +type loadBalancerClient struct { + cc *ClientConn +} + +func (c *loadBalancerClient) BalanceLoad(ctx context.Context, opts ...CallOption) (*balanceLoadClientStream, error) { + desc := &StreamDesc{ + StreamName: "BalanceLoad", + ServerStreams: true, + ClientStreams: true, + } + stream, err := NewClientStream(ctx, desc, c.cc, "/grpc.lb.v1.LoadBalancer/BalanceLoad", opts...) + if err != nil { + return nil, err + } + x := &balanceLoadClientStream{stream} + return x, nil +} + +type balanceLoadClientStream struct { + ClientStream +} + +func (x *balanceLoadClientStream) Send(m *lbmpb.LoadBalanceRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *balanceLoadClientStream) Recv() (*lbmpb.LoadBalanceResponse, error) { + m := new(lbmpb.LoadBalanceResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// NewGRPCLBBalancer creates a grpclb load balancer. +func NewGRPCLBBalancer(r naming.Resolver) Balancer { + return &grpclbBalancer{ + r: r, + } +} + +type remoteBalancerInfo struct { + addr string + // the server name used for authentication with the remote LB server. + name string +} + +// grpclbAddrInfo consists of the information of a backend server. +type grpclbAddrInfo struct { + addr Address + connected bool + // dropForRateLimiting indicates whether this particular request should be + // dropped by the client for rate limiting. + dropForRateLimiting bool + // dropForLoadBalancing indicates whether this particular request should be + // dropped by the client for load balancing. + dropForLoadBalancing bool +} + +type grpclbBalancer struct { + r naming.Resolver + target string + mu sync.Mutex + seq int // a sequence number to make sure addrCh does not get stale addresses. + w naming.Watcher + addrCh chan []Address + rbs []remoteBalancerInfo + addrs []*grpclbAddrInfo + next int + waitCh chan struct{} + done bool + rand *rand.Rand + + clientStats lbmpb.ClientStats +} + +func (b *grpclbBalancer) watchAddrUpdates(w naming.Watcher, ch chan []remoteBalancerInfo) error { + updates, err := w.Next() + if err != nil { + grpclog.Warningf("grpclb: failed to get next addr update from watcher: %v", err) + return err + } + b.mu.Lock() + defer b.mu.Unlock() + if b.done { + return ErrClientConnClosing + } + for _, update := range updates { + switch update.Op { + case naming.Add: + var exist bool + for _, v := range b.rbs { + // TODO: Is the same addr with different server name a different balancer? + if update.Addr == v.addr { + exist = true + break + } + } + if exist { + continue + } + md, ok := update.Metadata.(*naming.AddrMetadataGRPCLB) + if !ok { + // TODO: Revisit the handling here and may introduce some fallback mechanism. + grpclog.Errorf("The name resolution contains unexpected metadata %v", update.Metadata) + continue + } + switch md.AddrType { + case naming.Backend: + // TODO: Revisit the handling here and may introduce some fallback mechanism. + grpclog.Errorf("The name resolution does not give grpclb addresses") + continue + case naming.GRPCLB: + b.rbs = append(b.rbs, remoteBalancerInfo{ + addr: update.Addr, + name: md.ServerName, + }) + default: + grpclog.Errorf("Received unknow address type %d", md.AddrType) + continue + } + case naming.Delete: + for i, v := range b.rbs { + if update.Addr == v.addr { + copy(b.rbs[i:], b.rbs[i+1:]) + b.rbs = b.rbs[:len(b.rbs)-1] + break + } + } + default: + grpclog.Errorf("Unknown update.Op %v", update.Op) + } + } + // TODO: Fall back to the basic round-robin load balancing if the resulting address is + // not a load balancer. + select { + case <-ch: + default: + } + ch <- b.rbs + return nil +} + +func convertDuration(d *lbmpb.Duration) time.Duration { + if d == nil { + return 0 + } + return time.Duration(d.Seconds)*time.Second + time.Duration(d.Nanos)*time.Nanosecond +} + +func (b *grpclbBalancer) processServerList(l *lbmpb.ServerList, seq int) { + if l == nil { + return + } + servers := l.GetServers() + var ( + sl []*grpclbAddrInfo + addrs []Address + ) + for _, s := range servers { + md := metadata.Pairs("lb-token", s.LoadBalanceToken) + ip := net.IP(s.IpAddress) + ipStr := ip.String() + if ip.To4() == nil { + // Add square brackets to ipv6 addresses, otherwise net.Dial() and + // net.SplitHostPort() will return too many colons error. + ipStr = fmt.Sprintf("[%s]", ipStr) + } + addr := Address{ + Addr: fmt.Sprintf("%s:%d", ipStr, s.Port), + Metadata: &md, + } + sl = append(sl, &grpclbAddrInfo{ + addr: addr, + dropForRateLimiting: s.DropForRateLimiting, + dropForLoadBalancing: s.DropForLoadBalancing, + }) + addrs = append(addrs, addr) + } + b.mu.Lock() + defer b.mu.Unlock() + if b.done || seq < b.seq { + return + } + if len(sl) > 0 { + // reset b.next to 0 when replacing the server list. + b.next = 0 + b.addrs = sl + b.addrCh <- addrs + } + return +} + +func (b *grpclbBalancer) sendLoadReport(s *balanceLoadClientStream, interval time.Duration, done <-chan struct{}) { + ticker := time.NewTicker(interval) + defer ticker.Stop() + for { + select { + case <-ticker.C: + case <-done: + return + } + b.mu.Lock() + stats := b.clientStats + b.clientStats = lbmpb.ClientStats{} // Clear the stats. + b.mu.Unlock() + t := time.Now() + stats.Timestamp = &lbmpb.Timestamp{ + Seconds: t.Unix(), + Nanos: int32(t.Nanosecond()), + } + if err := s.Send(&lbmpb.LoadBalanceRequest{ + LoadBalanceRequestType: &lbmpb.LoadBalanceRequest_ClientStats{ + ClientStats: &stats, + }, + }); err != nil { + grpclog.Errorf("grpclb: failed to send load report: %v", err) + return + } + } +} + +func (b *grpclbBalancer) callRemoteBalancer(lbc *loadBalancerClient, seq int) (retry bool) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + stream, err := lbc.BalanceLoad(ctx) + if err != nil { + grpclog.Errorf("grpclb: failed to perform RPC to the remote balancer %v", err) + return + } + b.mu.Lock() + if b.done { + b.mu.Unlock() + return + } + b.mu.Unlock() + initReq := &lbmpb.LoadBalanceRequest{ + LoadBalanceRequestType: &lbmpb.LoadBalanceRequest_InitialRequest{ + InitialRequest: &lbmpb.InitialLoadBalanceRequest{ + Name: b.target, + }, + }, + } + if err := stream.Send(initReq); err != nil { + grpclog.Errorf("grpclb: failed to send init request: %v", err) + // TODO: backoff on retry? + return true + } + reply, err := stream.Recv() + if err != nil { + grpclog.Errorf("grpclb: failed to recv init response: %v", err) + // TODO: backoff on retry? + return true + } + initResp := reply.GetInitialResponse() + if initResp == nil { + grpclog.Errorf("grpclb: reply from remote balancer did not include initial response.") + return + } + // TODO: Support delegation. + if initResp.LoadBalancerDelegate != "" { + // delegation + grpclog.Errorf("TODO: Delegation is not supported yet.") + return + } + streamDone := make(chan struct{}) + defer close(streamDone) + b.mu.Lock() + b.clientStats = lbmpb.ClientStats{} // Clear client stats. + b.mu.Unlock() + if d := convertDuration(initResp.ClientStatsReportInterval); d > 0 { + go b.sendLoadReport(stream, d, streamDone) + } + // Retrieve the server list. + for { + reply, err := stream.Recv() + if err != nil { + grpclog.Errorf("grpclb: failed to recv server list: %v", err) + break + } + b.mu.Lock() + if b.done || seq < b.seq { + b.mu.Unlock() + return + } + b.seq++ // tick when receiving a new list of servers. + seq = b.seq + b.mu.Unlock() + if serverList := reply.GetServerList(); serverList != nil { + b.processServerList(serverList, seq) + } + } + return true +} + +func (b *grpclbBalancer) Start(target string, config BalancerConfig) error { + b.rand = rand.New(rand.NewSource(time.Now().Unix())) + // TODO: Fall back to the basic direct connection if there is no name resolver. + if b.r == nil { + return errors.New("there is no name resolver installed") + } + b.target = target + b.mu.Lock() + if b.done { + b.mu.Unlock() + return ErrClientConnClosing + } + b.addrCh = make(chan []Address) + w, err := b.r.Resolve(target) + if err != nil { + b.mu.Unlock() + grpclog.Errorf("grpclb: failed to resolve address: %v, err: %v", target, err) + return err + } + b.w = w + b.mu.Unlock() + balancerAddrsCh := make(chan []remoteBalancerInfo, 1) + // Spawn a goroutine to monitor the name resolution of remote load balancer. + go func() { + for { + if err := b.watchAddrUpdates(w, balancerAddrsCh); err != nil { + grpclog.Warningf("grpclb: the naming watcher stops working due to %v.\n", err) + close(balancerAddrsCh) + return + } + } + }() + // Spawn a goroutine to talk to the remote load balancer. + go func() { + var ( + cc *ClientConn + // ccError is closed when there is an error in the current cc. + // A new rb should be picked from rbs and connected. + ccError chan struct{} + rb *remoteBalancerInfo + rbs []remoteBalancerInfo + rbIdx int + ) + + defer func() { + if ccError != nil { + select { + case <-ccError: + default: + close(ccError) + } + } + if cc != nil { + cc.Close() + } + }() + + for { + var ok bool + select { + case rbs, ok = <-balancerAddrsCh: + if !ok { + return + } + foundIdx := -1 + if rb != nil { + for i, trb := range rbs { + if trb == *rb { + foundIdx = i + break + } + } + } + if foundIdx >= 0 { + if foundIdx >= 1 { + // Move the address in use to the beginning of the list. + b.rbs[0], b.rbs[foundIdx] = b.rbs[foundIdx], b.rbs[0] + rbIdx = 0 + } + continue // If found, don't dial new cc. + } else if len(rbs) > 0 { + // Pick a random one from the list, instead of always using the first one. + if l := len(rbs); l > 1 && rb != nil { + tmpIdx := b.rand.Intn(l - 1) + b.rbs[0], b.rbs[tmpIdx] = b.rbs[tmpIdx], b.rbs[0] + } + rbIdx = 0 + rb = &rbs[0] + } else { + // foundIdx < 0 && len(rbs) <= 0. + rb = nil + } + case <-ccError: + ccError = nil + if rbIdx < len(rbs)-1 { + rbIdx++ + rb = &rbs[rbIdx] + } else { + rb = nil + } + } + + if rb == nil { + continue + } + + if cc != nil { + cc.Close() + } + // Talk to the remote load balancer to get the server list. + var ( + err error + dopts []DialOption + ) + if creds := config.DialCreds; creds != nil { + if rb.name != "" { + if err := creds.OverrideServerName(rb.name); err != nil { + grpclog.Warningf("grpclb: failed to override the server name in the credentials: %v", err) + continue + } + } + dopts = append(dopts, WithTransportCredentials(creds)) + } else { + dopts = append(dopts, WithInsecure()) + } + if dialer := config.Dialer; dialer != nil { + // WithDialer takes a different type of function, so we instead use a special DialOption here. + dopts = append(dopts, func(o *dialOptions) { o.copts.Dialer = dialer }) + } + dopts = append(dopts, WithBlock()) + ccError = make(chan struct{}) + ctx, cancel := context.WithTimeout(context.Background(), time.Second) + cc, err = DialContext(ctx, rb.addr, dopts...) + cancel() + if err != nil { + grpclog.Warningf("grpclb: failed to setup a connection to the remote balancer %v: %v", rb.addr, err) + close(ccError) + continue + } + b.mu.Lock() + b.seq++ // tick when getting a new balancer address + seq := b.seq + b.next = 0 + b.mu.Unlock() + go func(cc *ClientConn, ccError chan struct{}) { + lbc := &loadBalancerClient{cc} + b.callRemoteBalancer(lbc, seq) + cc.Close() + select { + case <-ccError: + default: + close(ccError) + } + }(cc, ccError) + } + }() + return nil +} + +func (b *grpclbBalancer) down(addr Address, err error) { + b.mu.Lock() + defer b.mu.Unlock() + for _, a := range b.addrs { + if addr == a.addr { + a.connected = false + break + } + } +} + +func (b *grpclbBalancer) Up(addr Address) func(error) { + b.mu.Lock() + defer b.mu.Unlock() + if b.done { + return nil + } + var cnt int + for _, a := range b.addrs { + if a.addr == addr { + if a.connected { + return nil + } + a.connected = true + } + if a.connected && !a.dropForRateLimiting && !a.dropForLoadBalancing { + cnt++ + } + } + // addr is the only one which is connected. Notify the Get() callers who are blocking. + if cnt == 1 && b.waitCh != nil { + close(b.waitCh) + b.waitCh = nil + } + return func(err error) { + b.down(addr, err) + } +} + +func (b *grpclbBalancer) Get(ctx context.Context, opts BalancerGetOptions) (addr Address, put func(), err error) { + var ch chan struct{} + b.mu.Lock() + if b.done { + b.mu.Unlock() + err = ErrClientConnClosing + return + } + seq := b.seq + + defer func() { + if err != nil { + return + } + put = func() { + s, ok := rpcInfoFromContext(ctx) + if !ok { + return + } + b.mu.Lock() + defer b.mu.Unlock() + if b.done || seq < b.seq { + return + } + b.clientStats.NumCallsFinished++ + if !s.bytesSent { + b.clientStats.NumCallsFinishedWithClientFailedToSend++ + } else if s.bytesReceived { + b.clientStats.NumCallsFinishedKnownReceived++ + } + } + }() + + b.clientStats.NumCallsStarted++ + if len(b.addrs) > 0 { + if b.next >= len(b.addrs) { + b.next = 0 + } + next := b.next + for { + a := b.addrs[next] + next = (next + 1) % len(b.addrs) + if a.connected { + if !a.dropForRateLimiting && !a.dropForLoadBalancing { + addr = a.addr + b.next = next + b.mu.Unlock() + return + } + if !opts.BlockingWait { + b.next = next + if a.dropForLoadBalancing { + b.clientStats.NumCallsFinished++ + b.clientStats.NumCallsFinishedWithDropForLoadBalancing++ + } else if a.dropForRateLimiting { + b.clientStats.NumCallsFinished++ + b.clientStats.NumCallsFinishedWithDropForRateLimiting++ + } + b.mu.Unlock() + err = Errorf(codes.Unavailable, "%s drops requests", a.addr.Addr) + return + } + } + if next == b.next { + // Has iterated all the possible address but none is connected. + break + } + } + } + if !opts.BlockingWait { + b.clientStats.NumCallsFinished++ + b.clientStats.NumCallsFinishedWithClientFailedToSend++ + b.mu.Unlock() + err = Errorf(codes.Unavailable, "there is no address available") + return + } + // Wait on b.waitCh for non-failfast RPCs. + if b.waitCh == nil { + ch = make(chan struct{}) + b.waitCh = ch + } else { + ch = b.waitCh + } + b.mu.Unlock() + for { + select { + case <-ctx.Done(): + b.mu.Lock() + b.clientStats.NumCallsFinished++ + b.clientStats.NumCallsFinishedWithClientFailedToSend++ + b.mu.Unlock() + err = ctx.Err() + return + case <-ch: + b.mu.Lock() + if b.done { + b.clientStats.NumCallsFinished++ + b.clientStats.NumCallsFinishedWithClientFailedToSend++ + b.mu.Unlock() + err = ErrClientConnClosing + return + } + + if len(b.addrs) > 0 { + if b.next >= len(b.addrs) { + b.next = 0 + } + next := b.next + for { + a := b.addrs[next] + next = (next + 1) % len(b.addrs) + if a.connected { + if !a.dropForRateLimiting && !a.dropForLoadBalancing { + addr = a.addr + b.next = next + b.mu.Unlock() + return + } + if !opts.BlockingWait { + b.next = next + if a.dropForLoadBalancing { + b.clientStats.NumCallsFinished++ + b.clientStats.NumCallsFinishedWithDropForLoadBalancing++ + } else if a.dropForRateLimiting { + b.clientStats.NumCallsFinished++ + b.clientStats.NumCallsFinishedWithDropForRateLimiting++ + } + b.mu.Unlock() + err = Errorf(codes.Unavailable, "drop requests for the addreess %s", a.addr.Addr) + return + } + } + if next == b.next { + // Has iterated all the possible address but none is connected. + break + } + } + } + // The newly added addr got removed by Down() again. + if b.waitCh == nil { + ch = make(chan struct{}) + b.waitCh = ch + } else { + ch = b.waitCh + } + b.mu.Unlock() + } + } +} + +func (b *grpclbBalancer) Notify() <-chan []Address { + return b.addrCh +} + +func (b *grpclbBalancer) Close() error { + b.mu.Lock() + defer b.mu.Unlock() + if b.done { + return errBalancerClosed + } + b.done = true + if b.waitCh != nil { + close(b.waitCh) + } + if b.addrCh != nil { + close(b.addrCh) + } + if b.w != nil { + b.w.Close() + } + return nil +} diff --git a/vendor/google.golang.org/grpc/grpclb/grpc_lb_v1/messages/messages.pb.go b/vendor/google.golang.org/grpc/grpclb/grpc_lb_v1/messages/messages.pb.go new file mode 100644 index 0000000000..f4a27125a4 --- /dev/null +++ b/vendor/google.golang.org/grpc/grpclb/grpc_lb_v1/messages/messages.pb.go @@ -0,0 +1,615 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: grpc_lb_v1/messages/messages.proto + +/* +Package messages is a generated protocol buffer package. + +It is generated from these files: + grpc_lb_v1/messages/messages.proto + +It has these top-level messages: + Duration + Timestamp + LoadBalanceRequest + InitialLoadBalanceRequest + ClientStats + LoadBalanceResponse + InitialLoadBalanceResponse + ServerList + Server +*/ +package messages + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import 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.ProtoPackageIsVersion2 // please upgrade the proto package + +type Duration struct { + // Signed seconds of the span of time. Must be from -315,576,000,000 + // to +315,576,000,000 inclusive. + Seconds int64 `protobuf:"varint,1,opt,name=seconds" 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" json:"nanos,omitempty"` +} + +func (m *Duration) Reset() { *m = Duration{} } +func (m *Duration) String() string { return proto.CompactTextString(m) } +func (*Duration) ProtoMessage() {} +func (*Duration) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +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 +} + +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" 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" json:"nanos,omitempty"` +} + +func (m *Timestamp) Reset() { *m = Timestamp{} } +func (m *Timestamp) String() string { return proto.CompactTextString(m) } +func (*Timestamp) ProtoMessage() {} +func (*Timestamp) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +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 +} + +type LoadBalanceRequest struct { + // Types that are valid to be assigned to LoadBalanceRequestType: + // *LoadBalanceRequest_InitialRequest + // *LoadBalanceRequest_ClientStats + LoadBalanceRequestType isLoadBalanceRequest_LoadBalanceRequestType `protobuf_oneof:"load_balance_request_type"` +} + +func (m *LoadBalanceRequest) Reset() { *m = LoadBalanceRequest{} } +func (m *LoadBalanceRequest) String() string { return proto.CompactTextString(m) } +func (*LoadBalanceRequest) ProtoMessage() {} +func (*LoadBalanceRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +type isLoadBalanceRequest_LoadBalanceRequestType interface { + isLoadBalanceRequest_LoadBalanceRequestType() +} + +type LoadBalanceRequest_InitialRequest struct { + InitialRequest *InitialLoadBalanceRequest `protobuf:"bytes,1,opt,name=initial_request,json=initialRequest,oneof"` +} +type LoadBalanceRequest_ClientStats struct { + ClientStats *ClientStats `protobuf:"bytes,2,opt,name=client_stats,json=clientStats,oneof"` +} + +func (*LoadBalanceRequest_InitialRequest) isLoadBalanceRequest_LoadBalanceRequestType() {} +func (*LoadBalanceRequest_ClientStats) isLoadBalanceRequest_LoadBalanceRequestType() {} + +func (m *LoadBalanceRequest) GetLoadBalanceRequestType() isLoadBalanceRequest_LoadBalanceRequestType { + if m != nil { + return m.LoadBalanceRequestType + } + return nil +} + +func (m *LoadBalanceRequest) GetInitialRequest() *InitialLoadBalanceRequest { + if x, ok := m.GetLoadBalanceRequestType().(*LoadBalanceRequest_InitialRequest); ok { + return x.InitialRequest + } + return nil +} + +func (m *LoadBalanceRequest) GetClientStats() *ClientStats { + if x, ok := m.GetLoadBalanceRequestType().(*LoadBalanceRequest_ClientStats); ok { + return x.ClientStats + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*LoadBalanceRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _LoadBalanceRequest_OneofMarshaler, _LoadBalanceRequest_OneofUnmarshaler, _LoadBalanceRequest_OneofSizer, []interface{}{ + (*LoadBalanceRequest_InitialRequest)(nil), + (*LoadBalanceRequest_ClientStats)(nil), + } +} + +func _LoadBalanceRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*LoadBalanceRequest) + // load_balance_request_type + switch x := m.LoadBalanceRequestType.(type) { + case *LoadBalanceRequest_InitialRequest: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.InitialRequest); err != nil { + return err + } + case *LoadBalanceRequest_ClientStats: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ClientStats); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("LoadBalanceRequest.LoadBalanceRequestType has unexpected type %T", x) + } + return nil +} + +func _LoadBalanceRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*LoadBalanceRequest) + switch tag { + case 1: // load_balance_request_type.initial_request + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(InitialLoadBalanceRequest) + err := b.DecodeMessage(msg) + m.LoadBalanceRequestType = &LoadBalanceRequest_InitialRequest{msg} + return true, err + case 2: // load_balance_request_type.client_stats + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ClientStats) + err := b.DecodeMessage(msg) + m.LoadBalanceRequestType = &LoadBalanceRequest_ClientStats{msg} + return true, err + default: + return false, nil + } +} + +func _LoadBalanceRequest_OneofSizer(msg proto.Message) (n int) { + m := msg.(*LoadBalanceRequest) + // load_balance_request_type + switch x := m.LoadBalanceRequestType.(type) { + case *LoadBalanceRequest_InitialRequest: + s := proto.Size(x.InitialRequest) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *LoadBalanceRequest_ClientStats: + s := proto.Size(x.ClientStats) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +type InitialLoadBalanceRequest struct { + // Name of load balanced service (IE, balancer.service.com) + // length should be less than 256 bytes. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *InitialLoadBalanceRequest) Reset() { *m = InitialLoadBalanceRequest{} } +func (m *InitialLoadBalanceRequest) String() string { return proto.CompactTextString(m) } +func (*InitialLoadBalanceRequest) ProtoMessage() {} +func (*InitialLoadBalanceRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *InitialLoadBalanceRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Contains client level statistics that are useful to load balancing. Each +// count except the timestamp should be reset to zero after reporting the stats. +type ClientStats struct { + // The timestamp of generating the report. + Timestamp *Timestamp `protobuf:"bytes,1,opt,name=timestamp" json:"timestamp,omitempty"` + // The total number of RPCs that started. + NumCallsStarted int64 `protobuf:"varint,2,opt,name=num_calls_started,json=numCallsStarted" json:"num_calls_started,omitempty"` + // The total number of RPCs that finished. + NumCallsFinished int64 `protobuf:"varint,3,opt,name=num_calls_finished,json=numCallsFinished" json:"num_calls_finished,omitempty"` + // The total number of RPCs that were dropped by the client because of rate + // limiting. + NumCallsFinishedWithDropForRateLimiting int64 `protobuf:"varint,4,opt,name=num_calls_finished_with_drop_for_rate_limiting,json=numCallsFinishedWithDropForRateLimiting" json:"num_calls_finished_with_drop_for_rate_limiting,omitempty"` + // The total number of RPCs that were dropped by the client because of load + // balancing. + NumCallsFinishedWithDropForLoadBalancing int64 `protobuf:"varint,5,opt,name=num_calls_finished_with_drop_for_load_balancing,json=numCallsFinishedWithDropForLoadBalancing" json:"num_calls_finished_with_drop_for_load_balancing,omitempty"` + // The total number of RPCs that failed to reach a server except dropped RPCs. + NumCallsFinishedWithClientFailedToSend int64 `protobuf:"varint,6,opt,name=num_calls_finished_with_client_failed_to_send,json=numCallsFinishedWithClientFailedToSend" json:"num_calls_finished_with_client_failed_to_send,omitempty"` + // The total number of RPCs that finished and are known to have been received + // by a server. + NumCallsFinishedKnownReceived int64 `protobuf:"varint,7,opt,name=num_calls_finished_known_received,json=numCallsFinishedKnownReceived" json:"num_calls_finished_known_received,omitempty"` +} + +func (m *ClientStats) Reset() { *m = ClientStats{} } +func (m *ClientStats) String() string { return proto.CompactTextString(m) } +func (*ClientStats) ProtoMessage() {} +func (*ClientStats) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *ClientStats) GetTimestamp() *Timestamp { + if m != nil { + return m.Timestamp + } + return nil +} + +func (m *ClientStats) GetNumCallsStarted() int64 { + if m != nil { + return m.NumCallsStarted + } + return 0 +} + +func (m *ClientStats) GetNumCallsFinished() int64 { + if m != nil { + return m.NumCallsFinished + } + return 0 +} + +func (m *ClientStats) GetNumCallsFinishedWithDropForRateLimiting() int64 { + if m != nil { + return m.NumCallsFinishedWithDropForRateLimiting + } + return 0 +} + +func (m *ClientStats) GetNumCallsFinishedWithDropForLoadBalancing() int64 { + if m != nil { + return m.NumCallsFinishedWithDropForLoadBalancing + } + return 0 +} + +func (m *ClientStats) GetNumCallsFinishedWithClientFailedToSend() int64 { + if m != nil { + return m.NumCallsFinishedWithClientFailedToSend + } + return 0 +} + +func (m *ClientStats) GetNumCallsFinishedKnownReceived() int64 { + if m != nil { + return m.NumCallsFinishedKnownReceived + } + return 0 +} + +type LoadBalanceResponse struct { + // Types that are valid to be assigned to LoadBalanceResponseType: + // *LoadBalanceResponse_InitialResponse + // *LoadBalanceResponse_ServerList + LoadBalanceResponseType isLoadBalanceResponse_LoadBalanceResponseType `protobuf_oneof:"load_balance_response_type"` +} + +func (m *LoadBalanceResponse) Reset() { *m = LoadBalanceResponse{} } +func (m *LoadBalanceResponse) String() string { return proto.CompactTextString(m) } +func (*LoadBalanceResponse) ProtoMessage() {} +func (*LoadBalanceResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +type isLoadBalanceResponse_LoadBalanceResponseType interface { + isLoadBalanceResponse_LoadBalanceResponseType() +} + +type LoadBalanceResponse_InitialResponse struct { + InitialResponse *InitialLoadBalanceResponse `protobuf:"bytes,1,opt,name=initial_response,json=initialResponse,oneof"` +} +type LoadBalanceResponse_ServerList struct { + ServerList *ServerList `protobuf:"bytes,2,opt,name=server_list,json=serverList,oneof"` +} + +func (*LoadBalanceResponse_InitialResponse) isLoadBalanceResponse_LoadBalanceResponseType() {} +func (*LoadBalanceResponse_ServerList) isLoadBalanceResponse_LoadBalanceResponseType() {} + +func (m *LoadBalanceResponse) GetLoadBalanceResponseType() isLoadBalanceResponse_LoadBalanceResponseType { + if m != nil { + return m.LoadBalanceResponseType + } + return nil +} + +func (m *LoadBalanceResponse) GetInitialResponse() *InitialLoadBalanceResponse { + if x, ok := m.GetLoadBalanceResponseType().(*LoadBalanceResponse_InitialResponse); ok { + return x.InitialResponse + } + return nil +} + +func (m *LoadBalanceResponse) GetServerList() *ServerList { + if x, ok := m.GetLoadBalanceResponseType().(*LoadBalanceResponse_ServerList); ok { + return x.ServerList + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*LoadBalanceResponse) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _LoadBalanceResponse_OneofMarshaler, _LoadBalanceResponse_OneofUnmarshaler, _LoadBalanceResponse_OneofSizer, []interface{}{ + (*LoadBalanceResponse_InitialResponse)(nil), + (*LoadBalanceResponse_ServerList)(nil), + } +} + +func _LoadBalanceResponse_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*LoadBalanceResponse) + // load_balance_response_type + switch x := m.LoadBalanceResponseType.(type) { + case *LoadBalanceResponse_InitialResponse: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.InitialResponse); err != nil { + return err + } + case *LoadBalanceResponse_ServerList: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ServerList); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("LoadBalanceResponse.LoadBalanceResponseType has unexpected type %T", x) + } + return nil +} + +func _LoadBalanceResponse_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*LoadBalanceResponse) + switch tag { + case 1: // load_balance_response_type.initial_response + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(InitialLoadBalanceResponse) + err := b.DecodeMessage(msg) + m.LoadBalanceResponseType = &LoadBalanceResponse_InitialResponse{msg} + return true, err + case 2: // load_balance_response_type.server_list + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ServerList) + err := b.DecodeMessage(msg) + m.LoadBalanceResponseType = &LoadBalanceResponse_ServerList{msg} + return true, err + default: + return false, nil + } +} + +func _LoadBalanceResponse_OneofSizer(msg proto.Message) (n int) { + m := msg.(*LoadBalanceResponse) + // load_balance_response_type + switch x := m.LoadBalanceResponseType.(type) { + case *LoadBalanceResponse_InitialResponse: + s := proto.Size(x.InitialResponse) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *LoadBalanceResponse_ServerList: + s := proto.Size(x.ServerList) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +type InitialLoadBalanceResponse struct { + // This is an application layer redirect that indicates the client should use + // the specified server for load balancing. When this field is non-empty in + // the response, the client should open a separate connection to the + // load_balancer_delegate and call the BalanceLoad method. Its length should + // be less than 64 bytes. + LoadBalancerDelegate string `protobuf:"bytes,1,opt,name=load_balancer_delegate,json=loadBalancerDelegate" json:"load_balancer_delegate,omitempty"` + // This interval defines how often the client should send the client stats + // to the load balancer. Stats should only be reported when the duration is + // positive. + ClientStatsReportInterval *Duration `protobuf:"bytes,2,opt,name=client_stats_report_interval,json=clientStatsReportInterval" json:"client_stats_report_interval,omitempty"` +} + +func (m *InitialLoadBalanceResponse) Reset() { *m = InitialLoadBalanceResponse{} } +func (m *InitialLoadBalanceResponse) String() string { return proto.CompactTextString(m) } +func (*InitialLoadBalanceResponse) ProtoMessage() {} +func (*InitialLoadBalanceResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *InitialLoadBalanceResponse) GetLoadBalancerDelegate() string { + if m != nil { + return m.LoadBalancerDelegate + } + return "" +} + +func (m *InitialLoadBalanceResponse) GetClientStatsReportInterval() *Duration { + if m != nil { + return m.ClientStatsReportInterval + } + return nil +} + +type ServerList struct { + // Contains a list of servers selected by the load balancer. The list will + // be updated when server resolutions change or as needed to balance load + // across more servers. The client should consume the server list in order + // unless instructed otherwise via the client_config. + Servers []*Server `protobuf:"bytes,1,rep,name=servers" json:"servers,omitempty"` +} + +func (m *ServerList) Reset() { *m = ServerList{} } +func (m *ServerList) String() string { return proto.CompactTextString(m) } +func (*ServerList) ProtoMessage() {} +func (*ServerList) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *ServerList) GetServers() []*Server { + if m != nil { + return m.Servers + } + return nil +} + +// Contains server information. When none of the [drop_for_*] fields are true, +// use the other fields. When drop_for_rate_limiting is true, ignore all other +// fields. Use drop_for_load_balancing only when it is true and +// drop_for_rate_limiting is false. +type Server struct { + // A resolved address for the server, serialized in network-byte-order. It may + // either be an IPv4 or IPv6 address. + IpAddress []byte `protobuf:"bytes,1,opt,name=ip_address,json=ipAddress,proto3" json:"ip_address,omitempty"` + // A resolved port number for the server. + Port int32 `protobuf:"varint,2,opt,name=port" json:"port,omitempty"` + // An opaque but printable token given to the frontend for each pick. All + // frontend requests for that pick must include the token in its initial + // metadata. The token is used by the backend to verify the request and to + // allow the backend to report load to the gRPC LB system. + // + // Its length is variable but less than 50 bytes. + LoadBalanceToken string `protobuf:"bytes,3,opt,name=load_balance_token,json=loadBalanceToken" json:"load_balance_token,omitempty"` + // Indicates whether this particular request should be dropped by the client + // for rate limiting. + DropForRateLimiting bool `protobuf:"varint,4,opt,name=drop_for_rate_limiting,json=dropForRateLimiting" json:"drop_for_rate_limiting,omitempty"` + // Indicates whether this particular request should be dropped by the client + // for load balancing. + DropForLoadBalancing bool `protobuf:"varint,5,opt,name=drop_for_load_balancing,json=dropForLoadBalancing" json:"drop_for_load_balancing,omitempty"` +} + +func (m *Server) Reset() { *m = Server{} } +func (m *Server) String() string { return proto.CompactTextString(m) } +func (*Server) ProtoMessage() {} +func (*Server) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *Server) GetIpAddress() []byte { + if m != nil { + return m.IpAddress + } + return nil +} + +func (m *Server) GetPort() int32 { + if m != nil { + return m.Port + } + return 0 +} + +func (m *Server) GetLoadBalanceToken() string { + if m != nil { + return m.LoadBalanceToken + } + return "" +} + +func (m *Server) GetDropForRateLimiting() bool { + if m != nil { + return m.DropForRateLimiting + } + return false +} + +func (m *Server) GetDropForLoadBalancing() bool { + if m != nil { + return m.DropForLoadBalancing + } + return false +} + +func init() { + proto.RegisterType((*Duration)(nil), "grpc.lb.v1.Duration") + proto.RegisterType((*Timestamp)(nil), "grpc.lb.v1.Timestamp") + proto.RegisterType((*LoadBalanceRequest)(nil), "grpc.lb.v1.LoadBalanceRequest") + proto.RegisterType((*InitialLoadBalanceRequest)(nil), "grpc.lb.v1.InitialLoadBalanceRequest") + proto.RegisterType((*ClientStats)(nil), "grpc.lb.v1.ClientStats") + proto.RegisterType((*LoadBalanceResponse)(nil), "grpc.lb.v1.LoadBalanceResponse") + proto.RegisterType((*InitialLoadBalanceResponse)(nil), "grpc.lb.v1.InitialLoadBalanceResponse") + proto.RegisterType((*ServerList)(nil), "grpc.lb.v1.ServerList") + proto.RegisterType((*Server)(nil), "grpc.lb.v1.Server") +} + +func init() { proto.RegisterFile("grpc_lb_v1/messages/messages.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 709 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0xdd, 0x4e, 0x1b, 0x3b, + 0x10, 0x26, 0x27, 0x01, 0x92, 0x09, 0x3a, 0xe4, 0x98, 0x1c, 0x08, 0x14, 0x24, 0xba, 0x52, 0x69, + 0x54, 0xd1, 0x20, 0xa0, 0xbd, 0xe8, 0xcf, 0x45, 0x1b, 0x10, 0x0a, 0x2d, 0x17, 0x95, 0x43, 0x55, + 0xa9, 0x52, 0x65, 0x39, 0xd9, 0x21, 0x58, 0x6c, 0xec, 0xad, 0xed, 0x04, 0xf5, 0x11, 0xfa, 0x28, + 0x7d, 0x8c, 0xaa, 0xcf, 0xd0, 0xf7, 0xa9, 0xd6, 0xbb, 0x9b, 0x5d, 0x20, 0x80, 0x7a, 0x67, 0x8f, + 0xbf, 0xf9, 0xbe, 0xf1, 0xac, 0xbf, 0x59, 0xf0, 0x06, 0x3a, 0xec, 0xb3, 0xa0, 0xc7, 0xc6, 0xbb, + 0x3b, 0x43, 0x34, 0x86, 0x0f, 0xd0, 0x4c, 0x16, 0xad, 0x50, 0x2b, 0xab, 0x08, 0x44, 0x98, 0x56, + 0xd0, 0x6b, 0x8d, 0x77, 0xbd, 0x97, 0x50, 0x3e, 0x1c, 0x69, 0x6e, 0x85, 0x92, 0xa4, 0x01, 0xf3, + 0x06, 0xfb, 0x4a, 0xfa, 0xa6, 0x51, 0xd8, 0x2c, 0x34, 0x8b, 0x34, 0xdd, 0x92, 0x3a, 0xcc, 0x4a, + 0x2e, 0x95, 0x69, 0xfc, 0xb3, 0x59, 0x68, 0xce, 0xd2, 0x78, 0xe3, 0xbd, 0x82, 0xca, 0xa9, 0x18, + 0xa2, 0xb1, 0x7c, 0x18, 0xfe, 0x75, 0xf2, 0xcf, 0x02, 0x90, 0x13, 0xc5, 0xfd, 0x36, 0x0f, 0xb8, + 0xec, 0x23, 0xc5, 0xaf, 0x23, 0x34, 0x96, 0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a4, 0x0f, 0x93, 0x33, 0xf2, 0x11, 0xd6, 0xf3, 0x96, 0x65, 0x1a, + 0x43, 0xa5, 0x2d, 0x13, 0xd2, 0xa2, 0x1e, 0xf3, 0x20, 0x29, 0xbf, 0x9e, 0x2f, 0x3f, 0x1d, 0x62, + 0x74, 0x35, 0xe7, 0x5e, 0xea, 0xf2, 0x8e, 0x93, 0x34, 0xef, 0x0d, 0x40, 0x76, 0x4b, 0xb2, 0x1d, + 0x0d, 0xac, 0x68, 0x17, 0x0d, 0xac, 0x62, 0xb3, 0xba, 0x47, 0x6e, 0xb6, 0x83, 0xa6, 0x90, 0x77, + 0xa5, 0x72, 0xb1, 0x56, 0xf2, 0x7e, 0x17, 0x60, 0x2e, 0x3e, 0x21, 0x1b, 0x00, 0x22, 0x64, 0xdc, + 0xf7, 0x35, 0x9a, 0x78, 0xe4, 0x2d, 0xd0, 0x8a, 0x08, 0xdf, 0xc6, 0x81, 0xc8, 0xfd, 0x91, 0x76, + 0x32, 0xf3, 0xdc, 0x3a, 0x32, 0xe3, 0x95, 0x4e, 0x5a, 0x75, 0x81, 0xd2, 0x99, 0xb1, 0x42, 0x6b, + 0xb9, 0x46, 0x9c, 0x46, 0x71, 0xb2, 0x0f, 0xcb, 0x77, 0x98, 0xae, 0x4c, 0x97, 0xfc, 0x29, 0x06, + 0x7b, 0x0e, 0x2b, 0x77, 0x19, 0xa9, 0x4c, 0xeb, 0xfe, 0x14, 0xd3, 0xb4, 0xe1, 0x73, 0x39, 0xfd, + 0x47, 0xf4, 0xe6, 0xdc, 0x4f, 0x62, 0xff, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa3, 0x36, 0x86, + 0xa6, 0x4a, 0x06, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/grpc/grpclb/grpc_lb_v1/messages/messages.proto b/vendor/google.golang.org/grpc/grpclb/grpc_lb_v1/messages/messages.proto new file mode 100644 index 0000000000..42d99c109f --- /dev/null +++ b/vendor/google.golang.org/grpc/grpclb/grpc_lb_v1/messages/messages.proto @@ -0,0 +1,155 @@ +// Copyright 2016 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. + +syntax = "proto3"; + +package grpc.lb.v1; +option go_package = "google.golang.org/grpc/grpclb/grpc_lb_v1/messages"; + +message Duration { + // Signed seconds of the span of time. Must be from -315,576,000,000 + // to +315,576,000,000 inclusive. + int64 seconds = 1; + + // 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. + int32 nanos = 2; +} + +message Timestamp { + // 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. + int64 seconds = 1; + + // 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. + int32 nanos = 2; +} + +message LoadBalanceRequest { + oneof load_balance_request_type { + // This message should be sent on the first request to the load balancer. + InitialLoadBalanceRequest initial_request = 1; + + // The client stats should be periodically reported to the load balancer + // based on the duration defined in the InitialLoadBalanceResponse. + ClientStats client_stats = 2; + } +} + +message InitialLoadBalanceRequest { + // Name of load balanced service (IE, balancer.service.com) + // length should be less than 256 bytes. + string name = 1; +} + +// Contains client level statistics that are useful to load balancing. Each +// count except the timestamp should be reset to zero after reporting the stats. +message ClientStats { + // The timestamp of generating the report. + Timestamp timestamp = 1; + + // The total number of RPCs that started. + int64 num_calls_started = 2; + + // The total number of RPCs that finished. + int64 num_calls_finished = 3; + + // The total number of RPCs that were dropped by the client because of rate + // limiting. + int64 num_calls_finished_with_drop_for_rate_limiting = 4; + + // The total number of RPCs that were dropped by the client because of load + // balancing. + int64 num_calls_finished_with_drop_for_load_balancing = 5; + + // The total number of RPCs that failed to reach a server except dropped RPCs. + int64 num_calls_finished_with_client_failed_to_send = 6; + + // The total number of RPCs that finished and are known to have been received + // by a server. + int64 num_calls_finished_known_received = 7; +} + +message LoadBalanceResponse { + oneof load_balance_response_type { + // This message should be sent on the first response to the client. + InitialLoadBalanceResponse initial_response = 1; + + // Contains the list of servers selected by the load balancer. The client + // should send requests to these servers in the specified order. + ServerList server_list = 2; + } +} + +message InitialLoadBalanceResponse { + // This is an application layer redirect that indicates the client should use + // the specified server for load balancing. When this field is non-empty in + // the response, the client should open a separate connection to the + // load_balancer_delegate and call the BalanceLoad method. Its length should + // be less than 64 bytes. + string load_balancer_delegate = 1; + + // This interval defines how often the client should send the client stats + // to the load balancer. Stats should only be reported when the duration is + // positive. + Duration client_stats_report_interval = 2; +} + +message ServerList { + // Contains a list of servers selected by the load balancer. The list will + // be updated when server resolutions change or as needed to balance load + // across more servers. The client should consume the server list in order + // unless instructed otherwise via the client_config. + repeated Server servers = 1; + + // Was google.protobuf.Duration expiration_interval. + reserved 3; +} + +// Contains server information. When none of the [drop_for_*] fields are true, +// use the other fields. When drop_for_rate_limiting is true, ignore all other +// fields. Use drop_for_load_balancing only when it is true and +// drop_for_rate_limiting is false. +message Server { + // A resolved address for the server, serialized in network-byte-order. It may + // either be an IPv4 or IPv6 address. + bytes ip_address = 1; + + // A resolved port number for the server. + int32 port = 2; + + // An opaque but printable token given to the frontend for each pick. All + // frontend requests for that pick must include the token in its initial + // metadata. The token is used by the backend to verify the request and to + // allow the backend to report load to the gRPC LB system. + // + // Its length is variable but less than 50 bytes. + string load_balance_token = 3; + + // Indicates whether this particular request should be dropped by the client + // for rate limiting. + bool drop_for_rate_limiting = 4; + + // Indicates whether this particular request should be dropped by the client + // for load balancing. + bool drop_for_load_balancing = 5; +} diff --git a/vendor/google.golang.org/grpc/grpclb/grpc_lb_v1/service/service.pb.go b/vendor/google.golang.org/grpc/grpclb/grpc_lb_v1/service/service.pb.go new file mode 100644 index 0000000000..ebcbe56d8d --- /dev/null +++ b/vendor/google.golang.org/grpc/grpclb/grpc_lb_v1/service/service.pb.go @@ -0,0 +1,154 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: grpc_lb_v1/service/service.proto + +/* +Package service is a generated protocol buffer package. + +It is generated from these files: + grpc_lb_v1/service/service.proto + +It has these top-level messages: +*/ +package service + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import grpc_lb_v1 "google.golang.org/grpc/grpclb/grpc_lb_v1/messages" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// 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 + +// Client API for LoadBalancer service + +type LoadBalancerClient interface { + // Bidirectional rpc to get a list of servers. + BalanceLoad(ctx context.Context, opts ...grpc.CallOption) (LoadBalancer_BalanceLoadClient, error) +} + +type loadBalancerClient struct { + cc *grpc.ClientConn +} + +func NewLoadBalancerClient(cc *grpc.ClientConn) LoadBalancerClient { + return &loadBalancerClient{cc} +} + +func (c *loadBalancerClient) BalanceLoad(ctx context.Context, opts ...grpc.CallOption) (LoadBalancer_BalanceLoadClient, error) { + stream, err := grpc.NewClientStream(ctx, &_LoadBalancer_serviceDesc.Streams[0], c.cc, "/grpc.lb.v1.LoadBalancer/BalanceLoad", opts...) + if err != nil { + return nil, err + } + x := &loadBalancerBalanceLoadClient{stream} + return x, nil +} + +type LoadBalancer_BalanceLoadClient interface { + Send(*grpc_lb_v1.LoadBalanceRequest) error + Recv() (*grpc_lb_v1.LoadBalanceResponse, error) + grpc.ClientStream +} + +type loadBalancerBalanceLoadClient struct { + grpc.ClientStream +} + +func (x *loadBalancerBalanceLoadClient) Send(m *grpc_lb_v1.LoadBalanceRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *loadBalancerBalanceLoadClient) Recv() (*grpc_lb_v1.LoadBalanceResponse, error) { + m := new(grpc_lb_v1.LoadBalanceResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// Server API for LoadBalancer service + +type LoadBalancerServer interface { + // Bidirectional rpc to get a list of servers. + BalanceLoad(LoadBalancer_BalanceLoadServer) error +} + +func RegisterLoadBalancerServer(s *grpc.Server, srv LoadBalancerServer) { + s.RegisterService(&_LoadBalancer_serviceDesc, srv) +} + +func _LoadBalancer_BalanceLoad_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(LoadBalancerServer).BalanceLoad(&loadBalancerBalanceLoadServer{stream}) +} + +type LoadBalancer_BalanceLoadServer interface { + Send(*grpc_lb_v1.LoadBalanceResponse) error + Recv() (*grpc_lb_v1.LoadBalanceRequest, error) + grpc.ServerStream +} + +type loadBalancerBalanceLoadServer struct { + grpc.ServerStream +} + +func (x *loadBalancerBalanceLoadServer) Send(m *grpc_lb_v1.LoadBalanceResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *loadBalancerBalanceLoadServer) Recv() (*grpc_lb_v1.LoadBalanceRequest, error) { + m := new(grpc_lb_v1.LoadBalanceRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +var _LoadBalancer_serviceDesc = grpc.ServiceDesc{ + ServiceName: "grpc.lb.v1.LoadBalancer", + HandlerType: (*LoadBalancerServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "BalanceLoad", + Handler: _LoadBalancer_BalanceLoad_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "grpc_lb_v1/service/service.proto", +} + +func init() { proto.RegisterFile("grpc_lb_v1/service/service.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 142 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0x2f, 0x2a, 0x48, + 0x8e, 0xcf, 0x49, 0x8a, 0x2f, 0x33, 0xd4, 0x2f, 0x4e, 0x2d, 0x2a, 0xcb, 0x4c, 0x4e, 0x85, 0xd1, + 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0x5c, 0x20, 0x15, 0x7a, 0x39, 0x49, 0x7a, 0x65, 0x86, + 0x52, 0x4a, 0x48, 0xaa, 0x73, 0x53, 0x8b, 0x8b, 0x13, 0xd3, 0x53, 0x8b, 0xe1, 0x0c, 0x88, 0x7a, + 0xa3, 0x24, 0x2e, 0x1e, 0x9f, 0xfc, 0xc4, 0x14, 0xa7, 0xc4, 0x9c, 0xc4, 0xbc, 0xe4, 0xd4, 0x22, + 0xa1, 0x20, 0x2e, 0x6e, 0x28, 0x1b, 0x24, 0x2c, 0x24, 0xa7, 0x87, 0x30, 0x4f, 0x0f, 0x49, 0x61, + 0x50, 0x6a, 0x61, 0x69, 0x6a, 0x71, 0x89, 0x94, 0x3c, 0x4e, 0xf9, 0xe2, 0x82, 0xfc, 0xbc, 0xe2, + 0x54, 0x0d, 0x46, 0x03, 0x46, 0x27, 0xce, 0x28, 0x76, 0xa8, 0x23, 0x93, 0xd8, 0xc0, 0xb6, 0x1a, + 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x39, 0x4e, 0xb0, 0xf8, 0xc9, 0x00, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/grpc/grpclb/grpc_lb_v1/service/service.proto b/vendor/google.golang.org/grpc/grpclb/grpc_lb_v1/service/service.proto new file mode 100644 index 0000000000..6971fdba59 --- /dev/null +++ b/vendor/google.golang.org/grpc/grpclb/grpc_lb_v1/service/service.proto @@ -0,0 +1,26 @@ +// Copyright 2016 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. + +syntax = "proto3"; + +package grpc.lb.v1; +option go_package = "google.golang.org/grpc/grpclb/grpc_lb_v1/service"; + +import "grpc_lb_v1/messages/messages.proto"; + +service LoadBalancer { + // Bidirectional rpc to get a list of servers. + rpc BalanceLoad(stream LoadBalanceRequest) + returns (stream LoadBalanceResponse); +} diff --git a/vendor/google.golang.org/grpc/grpclb/grpclb_test.go b/vendor/google.golang.org/grpc/grpclb/grpclb_test.go new file mode 100644 index 0000000000..1491be7887 --- /dev/null +++ b/vendor/google.golang.org/grpc/grpclb/grpclb_test.go @@ -0,0 +1,902 @@ +/* + * + * Copyright 2016 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. + * + */ + +//go:generate protoc --go_out=plugins=:$GOPATH grpc_lb_v1/messages/messages.proto +//go:generate protoc --go_out=plugins=grpc:$GOPATH grpc_lb_v1/service/service.proto + +// Package grpclb_test is currently used only for grpclb testing. +package grpclb_test + +import ( + "errors" + "fmt" + "io" + "net" + "strings" + "sync" + "testing" + "time" + + "github.com/golang/protobuf/proto" + "golang.org/x/net/context" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/credentials" + lbmpb "google.golang.org/grpc/grpclb/grpc_lb_v1/messages" + lbspb "google.golang.org/grpc/grpclb/grpc_lb_v1/service" + _ "google.golang.org/grpc/grpclog/glogger" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/naming" + "google.golang.org/grpc/status" + testpb "google.golang.org/grpc/test/grpc_testing" + "google.golang.org/grpc/test/leakcheck" +) + +var ( + lbsn = "bar.com" + besn = "foo.com" + lbToken = "iamatoken" + + // Resolver replaces localhost with fakeName in Next(). + // Dialer replaces fakeName with localhost when dialing. + // This will test that custom dialer is passed from Dial to grpclb. + fakeName = "fake.Name" +) + +type testWatcher struct { + // the channel to receives name resolution updates + update chan *naming.Update + // the side channel to get to know how many updates in a batch + side chan int + // the channel to notifiy update injector that the update reading is done + readDone chan int +} + +func (w *testWatcher) Next() (updates []*naming.Update, err error) { + n, ok := <-w.side + if !ok { + return nil, fmt.Errorf("w.side is closed") + } + for i := 0; i < n; i++ { + u, ok := <-w.update + if !ok { + break + } + if u != nil { + // Resolver replaces localhost with fakeName in Next(). + // Custom dialer will replace fakeName with localhost when dialing. + u.Addr = strings.Replace(u.Addr, "localhost", fakeName, 1) + updates = append(updates, u) + } + } + w.readDone <- 0 + return +} + +func (w *testWatcher) Close() { + close(w.side) +} + +// Inject naming resolution updates to the testWatcher. +func (w *testWatcher) inject(updates []*naming.Update) { + w.side <- len(updates) + for _, u := range updates { + w.update <- u + } + <-w.readDone +} + +type testNameResolver struct { + w *testWatcher + addrs []string +} + +func (r *testNameResolver) Resolve(target string) (naming.Watcher, error) { + r.w = &testWatcher{ + update: make(chan *naming.Update, len(r.addrs)), + side: make(chan int, 1), + readDone: make(chan int), + } + r.w.side <- len(r.addrs) + for _, addr := range r.addrs { + r.w.update <- &naming.Update{ + Op: naming.Add, + Addr: addr, + Metadata: &naming.AddrMetadataGRPCLB{ + AddrType: naming.GRPCLB, + ServerName: lbsn, + }, + } + } + go func() { + <-r.w.readDone + }() + return r.w, nil +} + +func (r *testNameResolver) inject(updates []*naming.Update) { + if r.w != nil { + r.w.inject(updates) + } +} + +type serverNameCheckCreds struct { + mu sync.Mutex + sn string + expected string +} + +func (c *serverNameCheckCreds) ServerHandshake(rawConn net.Conn) (net.Conn, credentials.AuthInfo, error) { + if _, err := io.WriteString(rawConn, c.sn); err != nil { + fmt.Printf("Failed to write the server name %s to the client %v", c.sn, err) + return nil, nil, err + } + return rawConn, nil, nil +} +func (c *serverNameCheckCreds) ClientHandshake(ctx context.Context, addr string, rawConn net.Conn) (net.Conn, credentials.AuthInfo, error) { + c.mu.Lock() + defer c.mu.Unlock() + b := make([]byte, len(c.expected)) + errCh := make(chan error, 1) + go func() { + _, err := rawConn.Read(b) + errCh <- err + }() + select { + case err := <-errCh: + if err != nil { + fmt.Printf("Failed to read the server name from the server %v", err) + return nil, nil, err + } + case <-ctx.Done(): + return nil, nil, ctx.Err() + } + if c.expected != string(b) { + fmt.Printf("Read the server name %s want %s", string(b), c.expected) + return nil, nil, errors.New("received unexpected server name") + } + return rawConn, nil, nil +} +func (c *serverNameCheckCreds) Info() credentials.ProtocolInfo { + c.mu.Lock() + defer c.mu.Unlock() + return credentials.ProtocolInfo{} +} +func (c *serverNameCheckCreds) Clone() credentials.TransportCredentials { + c.mu.Lock() + defer c.mu.Unlock() + return &serverNameCheckCreds{ + expected: c.expected, + } +} +func (c *serverNameCheckCreds) OverrideServerName(s string) error { + c.mu.Lock() + defer c.mu.Unlock() + c.expected = s + return nil +} + +// fakeNameDialer replaces fakeName with localhost when dialing. +// This will test that custom dialer is passed from Dial to grpclb. +func fakeNameDialer(addr string, timeout time.Duration) (net.Conn, error) { + addr = strings.Replace(addr, fakeName, "localhost", 1) + return net.DialTimeout("tcp", addr, timeout) +} + +type remoteBalancer struct { + sls []*lbmpb.ServerList + intervals []time.Duration + statsDura time.Duration + done chan struct{} + mu sync.Mutex + stats lbmpb.ClientStats +} + +func newRemoteBalancer(sls []*lbmpb.ServerList, intervals []time.Duration) *remoteBalancer { + return &remoteBalancer{ + sls: sls, + intervals: intervals, + done: make(chan struct{}), + } +} + +func (b *remoteBalancer) stop() { + close(b.done) +} + +func (b *remoteBalancer) BalanceLoad(stream lbspb.LoadBalancer_BalanceLoadServer) error { + req, err := stream.Recv() + if err != nil { + return err + } + initReq := req.GetInitialRequest() + if initReq.Name != besn { + return status.Errorf(codes.InvalidArgument, "invalid service name: %v", initReq.Name) + } + resp := &lbmpb.LoadBalanceResponse{ + LoadBalanceResponseType: &lbmpb.LoadBalanceResponse_InitialResponse{ + InitialResponse: &lbmpb.InitialLoadBalanceResponse{ + ClientStatsReportInterval: &lbmpb.Duration{ + Seconds: int64(b.statsDura.Seconds()), + Nanos: int32(b.statsDura.Nanoseconds() - int64(b.statsDura.Seconds())*1e9), + }, + }, + }, + } + if err := stream.Send(resp); err != nil { + return err + } + go func() { + for { + var ( + req *lbmpb.LoadBalanceRequest + err error + ) + if req, err = stream.Recv(); err != nil { + return + } + b.mu.Lock() + b.stats.NumCallsStarted += req.GetClientStats().NumCallsStarted + b.stats.NumCallsFinished += req.GetClientStats().NumCallsFinished + b.stats.NumCallsFinishedWithDropForRateLimiting += req.GetClientStats().NumCallsFinishedWithDropForRateLimiting + b.stats.NumCallsFinishedWithDropForLoadBalancing += req.GetClientStats().NumCallsFinishedWithDropForLoadBalancing + b.stats.NumCallsFinishedWithClientFailedToSend += req.GetClientStats().NumCallsFinishedWithClientFailedToSend + b.stats.NumCallsFinishedKnownReceived += req.GetClientStats().NumCallsFinishedKnownReceived + b.mu.Unlock() + } + }() + for k, v := range b.sls { + time.Sleep(b.intervals[k]) + resp = &lbmpb.LoadBalanceResponse{ + LoadBalanceResponseType: &lbmpb.LoadBalanceResponse_ServerList{ + ServerList: v, + }, + } + if err := stream.Send(resp); err != nil { + return err + } + } + <-b.done + return nil +} + +type testServer struct { + testpb.TestServiceServer + + addr string +} + +const testmdkey = "testmd" + +func (s *testServer) EmptyCall(ctx context.Context, in *testpb.Empty) (*testpb.Empty, error) { + md, ok := metadata.FromIncomingContext(ctx) + if !ok { + return nil, status.Error(codes.Internal, "failed to receive metadata") + } + if md == nil || md["lb-token"][0] != lbToken { + return nil, status.Errorf(codes.Internal, "received unexpected metadata: %v", md) + } + grpc.SetTrailer(ctx, metadata.Pairs(testmdkey, s.addr)) + return &testpb.Empty{}, nil +} + +func (s *testServer) FullDuplexCall(stream testpb.TestService_FullDuplexCallServer) error { + return nil +} + +func startBackends(sn string, lis ...net.Listener) (servers []*grpc.Server) { + for _, l := range lis { + creds := &serverNameCheckCreds{ + sn: sn, + } + s := grpc.NewServer(grpc.Creds(creds)) + testpb.RegisterTestServiceServer(s, &testServer{addr: l.Addr().String()}) + servers = append(servers, s) + go func(s *grpc.Server, l net.Listener) { + s.Serve(l) + }(s, l) + } + return +} + +func stopBackends(servers []*grpc.Server) { + for _, s := range servers { + s.Stop() + } +} + +type testServers struct { + lbAddr string + ls *remoteBalancer + lb *grpc.Server + beIPs []net.IP + bePorts []int +} + +func newLoadBalancer(numberOfBackends int) (tss *testServers, cleanup func(), err error) { + var ( + beListeners []net.Listener + ls *remoteBalancer + lb *grpc.Server + beIPs []net.IP + bePorts []int + ) + for i := 0; i < numberOfBackends; i++ { + // Start a backend. + beLis, e := net.Listen("tcp", "localhost:0") + if e != nil { + err = fmt.Errorf("Failed to listen %v", err) + return + } + beIPs = append(beIPs, beLis.Addr().(*net.TCPAddr).IP) + bePorts = append(bePorts, beLis.Addr().(*net.TCPAddr).Port) + + beListeners = append(beListeners, beLis) + } + backends := startBackends(besn, beListeners...) + + // Start a load balancer. + lbLis, err := net.Listen("tcp", "localhost:0") + if err != nil { + err = fmt.Errorf("Failed to create the listener for the load balancer %v", err) + return + } + lbCreds := &serverNameCheckCreds{ + sn: lbsn, + } + lb = grpc.NewServer(grpc.Creds(lbCreds)) + if err != nil { + err = fmt.Errorf("Failed to generate the port number %v", err) + return + } + ls = newRemoteBalancer(nil, nil) + lbspb.RegisterLoadBalancerServer(lb, ls) + go func() { + lb.Serve(lbLis) + }() + + tss = &testServers{ + lbAddr: lbLis.Addr().String(), + ls: ls, + lb: lb, + beIPs: beIPs, + bePorts: bePorts, + } + cleanup = func() { + defer stopBackends(backends) + defer func() { + ls.stop() + lb.Stop() + }() + } + return +} + +func TestGRPCLB(t *testing.T) { + defer leakcheck.Check(t) + tss, cleanup, err := newLoadBalancer(1) + if err != nil { + t.Fatalf("failed to create new load balancer: %v", err) + } + defer cleanup() + + be := &lbmpb.Server{ + IpAddress: tss.beIPs[0], + Port: int32(tss.bePorts[0]), + LoadBalanceToken: lbToken, + } + var bes []*lbmpb.Server + bes = append(bes, be) + sl := &lbmpb.ServerList{ + Servers: bes, + } + tss.ls.sls = []*lbmpb.ServerList{sl} + tss.ls.intervals = []time.Duration{0} + creds := serverNameCheckCreds{ + expected: besn, + } + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + cc, err := grpc.DialContext(ctx, besn, + grpc.WithBalancer(grpc.NewGRPCLBBalancer(&testNameResolver{addrs: []string{tss.lbAddr}})), + grpc.WithBlock(), grpc.WithTransportCredentials(&creds), grpc.WithDialer(fakeNameDialer)) + if err != nil { + t.Fatalf("Failed to dial to the backend %v", err) + } + defer cc.Close() + testC := testpb.NewTestServiceClient(cc) + if _, err := testC.EmptyCall(context.Background(), &testpb.Empty{}, grpc.FailFast(false)); err != nil { + t.Fatalf("%v.EmptyCall(_, _) = _, %v, want _, ", testC, err) + } +} + +func TestDropRequest(t *testing.T) { + defer leakcheck.Check(t) + tss, cleanup, err := newLoadBalancer(2) + if err != nil { + t.Fatalf("failed to create new load balancer: %v", err) + } + defer cleanup() + tss.ls.sls = []*lbmpb.ServerList{{ + Servers: []*lbmpb.Server{{ + IpAddress: tss.beIPs[0], + Port: int32(tss.bePorts[0]), + LoadBalanceToken: lbToken, + DropForLoadBalancing: true, + }, { + IpAddress: tss.beIPs[1], + Port: int32(tss.bePorts[1]), + LoadBalanceToken: lbToken, + DropForLoadBalancing: false, + }}, + }} + tss.ls.intervals = []time.Duration{0} + creds := serverNameCheckCreds{ + expected: besn, + } + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + cc, err := grpc.DialContext(ctx, besn, + grpc.WithBalancer(grpc.NewGRPCLBBalancer(&testNameResolver{addrs: []string{tss.lbAddr}})), + grpc.WithBlock(), grpc.WithTransportCredentials(&creds), grpc.WithDialer(fakeNameDialer)) + if err != nil { + t.Fatalf("Failed to dial to the backend %v", err) + } + defer cc.Close() + testC := testpb.NewTestServiceClient(cc) + // Wait until the first connection is up. + // The first one has Drop set to true, error should contain "drop requests". + for { + if _, err := testC.EmptyCall(context.Background(), &testpb.Empty{}); err != nil { + if strings.Contains(err.Error(), "drops requests") { + break + } + } + } + // The 1st, non-fail-fast RPC should succeed. This ensures both server + // connections are made, because the first one has DropForLoadBalancing set to true. + if _, err := testC.EmptyCall(context.Background(), &testpb.Empty{}, grpc.FailFast(false)); err != nil { + t.Fatalf("%v.SayHello(_, _) = _, %v, want _, ", testC, err) + } + for i := 0; i < 3; i++ { + // Odd fail-fast RPCs should fail, because the 1st backend has DropForLoadBalancing + // set to true. + if _, err := testC.EmptyCall(context.Background(), &testpb.Empty{}); grpc.Code(err) != codes.Unavailable { + t.Fatalf("%v.EmptyCall(_, _) = _, %v, want _, %s", testC, err, codes.Unavailable) + } + // Even fail-fast RPCs should succeed since they choose the + // non-drop-request backend according to the round robin policy. + if _, err := testC.EmptyCall(context.Background(), &testpb.Empty{}); err != nil { + t.Fatalf("%v.EmptyCall(_, _) = _, %v, want _, ", testC, err) + } + } +} + +func TestDropRequestFailedNonFailFast(t *testing.T) { + defer leakcheck.Check(t) + tss, cleanup, err := newLoadBalancer(1) + if err != nil { + t.Fatalf("failed to create new load balancer: %v", err) + } + defer cleanup() + be := &lbmpb.Server{ + IpAddress: tss.beIPs[0], + Port: int32(tss.bePorts[0]), + LoadBalanceToken: lbToken, + DropForLoadBalancing: true, + } + var bes []*lbmpb.Server + bes = append(bes, be) + sl := &lbmpb.ServerList{ + Servers: bes, + } + tss.ls.sls = []*lbmpb.ServerList{sl} + tss.ls.intervals = []time.Duration{0} + creds := serverNameCheckCreds{ + expected: besn, + } + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + cc, err := grpc.DialContext(ctx, besn, + grpc.WithBalancer(grpc.NewGRPCLBBalancer(&testNameResolver{addrs: []string{tss.lbAddr}})), + grpc.WithBlock(), grpc.WithTransportCredentials(&creds), grpc.WithDialer(fakeNameDialer)) + if err != nil { + t.Fatalf("Failed to dial to the backend %v", err) + } + defer cc.Close() + testC := testpb.NewTestServiceClient(cc) + ctx, cancel = context.WithTimeout(context.Background(), 10*time.Millisecond) + defer cancel() + if _, err := testC.EmptyCall(ctx, &testpb.Empty{}, grpc.FailFast(false)); grpc.Code(err) != codes.DeadlineExceeded { + t.Fatalf("%v.EmptyCall(_, _) = _, %v, want _, %s", testC, err, codes.DeadlineExceeded) + } +} + +// When the balancer in use disconnects, grpclb should connect to the next address from resolved balancer address list. +func TestBalancerDisconnects(t *testing.T) { + defer leakcheck.Check(t) + var ( + lbAddrs []string + lbs []*grpc.Server + ) + for i := 0; i < 3; i++ { + tss, cleanup, err := newLoadBalancer(1) + if err != nil { + t.Fatalf("failed to create new load balancer: %v", err) + } + defer cleanup() + + be := &lbmpb.Server{ + IpAddress: tss.beIPs[0], + Port: int32(tss.bePorts[0]), + LoadBalanceToken: lbToken, + } + var bes []*lbmpb.Server + bes = append(bes, be) + sl := &lbmpb.ServerList{ + Servers: bes, + } + tss.ls.sls = []*lbmpb.ServerList{sl} + tss.ls.intervals = []time.Duration{0} + + lbAddrs = append(lbAddrs, tss.lbAddr) + lbs = append(lbs, tss.lb) + } + + creds := serverNameCheckCreds{ + expected: besn, + } + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + resolver := &testNameResolver{ + addrs: lbAddrs[:2], + } + cc, err := grpc.DialContext(ctx, besn, + grpc.WithBalancer(grpc.NewGRPCLBBalancer(resolver)), + grpc.WithBlock(), grpc.WithTransportCredentials(&creds), grpc.WithDialer(fakeNameDialer)) + if err != nil { + t.Fatalf("Failed to dial to the backend %v", err) + } + defer cc.Close() + testC := testpb.NewTestServiceClient(cc) + var previousTrailer string + trailer := metadata.MD{} + if _, err := testC.EmptyCall(context.Background(), &testpb.Empty{}, grpc.Trailer(&trailer), grpc.FailFast(false)); err != nil { + t.Fatalf("%v.EmptyCall(_, _) = _, %v, want _, ", testC, err) + } else { + previousTrailer = trailer[testmdkey][0] + } + // The initial resolver update contains lbs[0] and lbs[1]. + // When lbs[0] is stopped, lbs[1] should be used. + lbs[0].Stop() + for { + if _, err := testC.EmptyCall(context.Background(), &testpb.Empty{}, grpc.Trailer(&trailer), grpc.FailFast(false)); err != nil { + t.Fatalf("%v.EmptyCall(_, _) = _, %v, want _, ", testC, err) + } else if trailer[testmdkey][0] != previousTrailer { + // A new backend server should receive the request. + // The trailer contains the backend address, so the trailer should be different from the previous one. + previousTrailer = trailer[testmdkey][0] + break + } + time.Sleep(100 * time.Millisecond) + } + // Inject a update to add lbs[2] to resolved addresses. + resolver.inject([]*naming.Update{ + {Op: naming.Add, + Addr: lbAddrs[2], + Metadata: &naming.AddrMetadataGRPCLB{ + AddrType: naming.GRPCLB, + ServerName: lbsn, + }, + }, + }) + // Stop lbs[1]. Now lbs[0] and lbs[1] are all stopped. lbs[2] should be used. + lbs[1].Stop() + for { + if _, err := testC.EmptyCall(context.Background(), &testpb.Empty{}, grpc.Trailer(&trailer), grpc.FailFast(false)); err != nil { + t.Fatalf("%v.EmptyCall(_, _) = _, %v, want _, ", testC, err) + } else if trailer[testmdkey][0] != previousTrailer { + // A new backend server should receive the request. + // The trailer contains the backend address, so the trailer should be different from the previous one. + break + } + time.Sleep(100 * time.Millisecond) + } +} + +type failPreRPCCred struct{} + +func (failPreRPCCred) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) { + if strings.Contains(uri[0], "failtosend") { + return nil, fmt.Errorf("rpc should fail to send") + } + return nil, nil +} + +func (failPreRPCCred) RequireTransportSecurity() bool { + return false +} + +func checkStats(stats *lbmpb.ClientStats, expected *lbmpb.ClientStats) error { + if !proto.Equal(stats, expected) { + return fmt.Errorf("stats not equal: got %+v, want %+v", stats, expected) + } + return nil +} + +func runAndGetStats(t *testing.T, dropForLoadBalancing, dropForRateLimiting bool, runRPCs func(*grpc.ClientConn)) lbmpb.ClientStats { + tss, cleanup, err := newLoadBalancer(3) + if err != nil { + t.Fatalf("failed to create new load balancer: %v", err) + } + defer cleanup() + tss.ls.sls = []*lbmpb.ServerList{{ + Servers: []*lbmpb.Server{{ + IpAddress: tss.beIPs[2], + Port: int32(tss.bePorts[2]), + LoadBalanceToken: lbToken, + DropForLoadBalancing: dropForLoadBalancing, + DropForRateLimiting: dropForRateLimiting, + }}, + }} + tss.ls.intervals = []time.Duration{0} + tss.ls.statsDura = 100 * time.Millisecond + creds := serverNameCheckCreds{expected: besn} + + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + cc, err := grpc.DialContext(ctx, besn, + grpc.WithBalancer(grpc.NewGRPCLBBalancer(&testNameResolver{addrs: []string{tss.lbAddr}})), + grpc.WithTransportCredentials(&creds), grpc.WithPerRPCCredentials(failPreRPCCred{}), + grpc.WithBlock(), grpc.WithDialer(fakeNameDialer)) + if err != nil { + t.Fatalf("Failed to dial to the backend %v", err) + } + defer cc.Close() + + runRPCs(cc) + time.Sleep(1 * time.Second) + tss.ls.mu.Lock() + stats := tss.ls.stats + tss.ls.mu.Unlock() + return stats +} + +const countRPC = 40 + +func TestGRPCLBStatsUnarySuccess(t *testing.T) { + defer leakcheck.Check(t) + stats := runAndGetStats(t, false, false, func(cc *grpc.ClientConn) { + testC := testpb.NewTestServiceClient(cc) + // The first non-failfast RPC succeeds, all connections are up. + if _, err := testC.EmptyCall(context.Background(), &testpb.Empty{}, grpc.FailFast(false)); err != nil { + t.Fatalf("%v.EmptyCall(_, _) = _, %v, want _, ", testC, err) + } + for i := 0; i < countRPC-1; i++ { + testC.EmptyCall(context.Background(), &testpb.Empty{}) + } + }) + + if err := checkStats(&stats, &lbmpb.ClientStats{ + NumCallsStarted: int64(countRPC), + NumCallsFinished: int64(countRPC), + NumCallsFinishedKnownReceived: int64(countRPC), + }); err != nil { + t.Fatal(err) + } +} + +func TestGRPCLBStatsUnaryDropLoadBalancing(t *testing.T) { + defer leakcheck.Check(t) + c := 0 + stats := runAndGetStats(t, true, false, func(cc *grpc.ClientConn) { + testC := testpb.NewTestServiceClient(cc) + for { + c++ + if _, err := testC.EmptyCall(context.Background(), &testpb.Empty{}); err != nil { + if strings.Contains(err.Error(), "drops requests") { + break + } + } + } + for i := 0; i < countRPC; i++ { + testC.EmptyCall(context.Background(), &testpb.Empty{}) + } + }) + + if err := checkStats(&stats, &lbmpb.ClientStats{ + NumCallsStarted: int64(countRPC + c), + NumCallsFinished: int64(countRPC + c), + NumCallsFinishedWithDropForLoadBalancing: int64(countRPC + 1), + NumCallsFinishedWithClientFailedToSend: int64(c - 1), + }); err != nil { + t.Fatal(err) + } +} + +func TestGRPCLBStatsUnaryDropRateLimiting(t *testing.T) { + defer leakcheck.Check(t) + c := 0 + stats := runAndGetStats(t, false, true, func(cc *grpc.ClientConn) { + testC := testpb.NewTestServiceClient(cc) + for { + c++ + if _, err := testC.EmptyCall(context.Background(), &testpb.Empty{}); err != nil { + if strings.Contains(err.Error(), "drops requests") { + break + } + } + } + for i := 0; i < countRPC; i++ { + testC.EmptyCall(context.Background(), &testpb.Empty{}) + } + }) + + if err := checkStats(&stats, &lbmpb.ClientStats{ + NumCallsStarted: int64(countRPC + c), + NumCallsFinished: int64(countRPC + c), + NumCallsFinishedWithDropForRateLimiting: int64(countRPC + 1), + NumCallsFinishedWithClientFailedToSend: int64(c - 1), + }); err != nil { + t.Fatal(err) + } +} + +func TestGRPCLBStatsUnaryFailedToSend(t *testing.T) { + defer leakcheck.Check(t) + stats := runAndGetStats(t, false, false, func(cc *grpc.ClientConn) { + testC := testpb.NewTestServiceClient(cc) + // The first non-failfast RPC succeeds, all connections are up. + if _, err := testC.EmptyCall(context.Background(), &testpb.Empty{}, grpc.FailFast(false)); err != nil { + t.Fatalf("%v.EmptyCall(_, _) = _, %v, want _, ", testC, err) + } + for i := 0; i < countRPC-1; i++ { + grpc.Invoke(context.Background(), "failtosend", &testpb.Empty{}, nil, cc) + } + }) + + if err := checkStats(&stats, &lbmpb.ClientStats{ + NumCallsStarted: int64(countRPC), + NumCallsFinished: int64(countRPC), + NumCallsFinishedWithClientFailedToSend: int64(countRPC - 1), + NumCallsFinishedKnownReceived: 1, + }); err != nil { + t.Fatal(err) + } +} + +func TestGRPCLBStatsStreamingSuccess(t *testing.T) { + defer leakcheck.Check(t) + stats := runAndGetStats(t, false, false, func(cc *grpc.ClientConn) { + testC := testpb.NewTestServiceClient(cc) + // The first non-failfast RPC succeeds, all connections are up. + stream, err := testC.FullDuplexCall(context.Background(), grpc.FailFast(false)) + if err != nil { + t.Fatalf("%v.FullDuplexCall(_, _) = _, %v, want _, ", testC, err) + } + for { + if _, err = stream.Recv(); err == io.EOF { + break + } + } + for i := 0; i < countRPC-1; i++ { + stream, err = testC.FullDuplexCall(context.Background()) + if err == nil { + // Wait for stream to end if err is nil. + for { + if _, err = stream.Recv(); err == io.EOF { + break + } + } + } + } + }) + + if err := checkStats(&stats, &lbmpb.ClientStats{ + NumCallsStarted: int64(countRPC), + NumCallsFinished: int64(countRPC), + NumCallsFinishedKnownReceived: int64(countRPC), + }); err != nil { + t.Fatal(err) + } +} + +func TestGRPCLBStatsStreamingDropLoadBalancing(t *testing.T) { + defer leakcheck.Check(t) + c := 0 + stats := runAndGetStats(t, true, false, func(cc *grpc.ClientConn) { + testC := testpb.NewTestServiceClient(cc) + for { + c++ + if _, err := testC.EmptyCall(context.Background(), &testpb.Empty{}); err != nil { + if strings.Contains(err.Error(), "drops requests") { + break + } + } + } + for i := 0; i < countRPC; i++ { + testC.FullDuplexCall(context.Background()) + } + }) + + if err := checkStats(&stats, &lbmpb.ClientStats{ + NumCallsStarted: int64(countRPC + c), + NumCallsFinished: int64(countRPC + c), + NumCallsFinishedWithDropForLoadBalancing: int64(countRPC + 1), + NumCallsFinishedWithClientFailedToSend: int64(c - 1), + }); err != nil { + t.Fatal(err) + } +} + +func TestGRPCLBStatsStreamingDropRateLimiting(t *testing.T) { + defer leakcheck.Check(t) + c := 0 + stats := runAndGetStats(t, false, true, func(cc *grpc.ClientConn) { + testC := testpb.NewTestServiceClient(cc) + for { + c++ + if _, err := testC.EmptyCall(context.Background(), &testpb.Empty{}); err != nil { + if strings.Contains(err.Error(), "drops requests") { + break + } + } + } + for i := 0; i < countRPC; i++ { + testC.FullDuplexCall(context.Background()) + } + }) + + if err := checkStats(&stats, &lbmpb.ClientStats{ + NumCallsStarted: int64(countRPC + c), + NumCallsFinished: int64(countRPC + c), + NumCallsFinishedWithDropForRateLimiting: int64(countRPC + 1), + NumCallsFinishedWithClientFailedToSend: int64(c - 1), + }); err != nil { + t.Fatal(err) + } +} + +func TestGRPCLBStatsStreamingFailedToSend(t *testing.T) { + defer leakcheck.Check(t) + stats := runAndGetStats(t, false, false, func(cc *grpc.ClientConn) { + testC := testpb.NewTestServiceClient(cc) + // The first non-failfast RPC succeeds, all connections are up. + stream, err := testC.FullDuplexCall(context.Background(), grpc.FailFast(false)) + if err != nil { + t.Fatalf("%v.FullDuplexCall(_, _) = _, %v, want _, ", testC, err) + } + for { + if _, err = stream.Recv(); err == io.EOF { + break + } + } + for i := 0; i < countRPC-1; i++ { + grpc.NewClientStream(context.Background(), &grpc.StreamDesc{}, cc, "failtosend") + } + }) + + if err := checkStats(&stats, &lbmpb.ClientStats{ + NumCallsStarted: int64(countRPC), + NumCallsFinished: int64(countRPC), + NumCallsFinishedWithClientFailedToSend: int64(countRPC - 1), + NumCallsFinishedKnownReceived: 1, + }); err != nil { + t.Fatal(err) + } +} diff --git a/vendor/google.golang.org/grpc/grpclog/glogger/glogger.go b/vendor/google.golang.org/grpc/grpclog/glogger/glogger.go new file mode 100644 index 0000000000..e5498f823a --- /dev/null +++ b/vendor/google.golang.org/grpc/grpclog/glogger/glogger.go @@ -0,0 +1,86 @@ +/* + * + * Copyright 2015 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. + * + */ + +// Package glogger defines glog-based logging for grpc. +// Importing this package will install glog as the logger used by grpclog. +package glogger + +import ( + "fmt" + + "github.com/golang/glog" + "google.golang.org/grpc/grpclog" +) + +func init() { + grpclog.SetLoggerV2(&glogger{}) +} + +type glogger struct{} + +func (g *glogger) Info(args ...interface{}) { + glog.InfoDepth(2, args...) +} + +func (g *glogger) Infoln(args ...interface{}) { + glog.InfoDepth(2, fmt.Sprintln(args...)) +} + +func (g *glogger) Infof(format string, args ...interface{}) { + glog.InfoDepth(2, fmt.Sprintf(format, args...)) +} + +func (g *glogger) Warning(args ...interface{}) { + glog.WarningDepth(2, args...) +} + +func (g *glogger) Warningln(args ...interface{}) { + glog.WarningDepth(2, fmt.Sprintln(args...)) +} + +func (g *glogger) Warningf(format string, args ...interface{}) { + glog.WarningDepth(2, fmt.Sprintf(format, args...)) +} + +func (g *glogger) Error(args ...interface{}) { + glog.ErrorDepth(2, args...) +} + +func (g *glogger) Errorln(args ...interface{}) { + glog.ErrorDepth(2, fmt.Sprintln(args...)) +} + +func (g *glogger) Errorf(format string, args ...interface{}) { + glog.ErrorDepth(2, fmt.Sprintf(format, args...)) +} + +func (g *glogger) Fatal(args ...interface{}) { + glog.FatalDepth(2, args...) +} + +func (g *glogger) Fatalln(args ...interface{}) { + glog.FatalDepth(2, fmt.Sprintln(args...)) +} + +func (g *glogger) Fatalf(format string, args ...interface{}) { + glog.FatalDepth(2, fmt.Sprintf(format, args...)) +} + +func (g *glogger) V(l int) bool { + return bool(glog.V(glog.Level(l))) +} diff --git a/vendor/google.golang.org/grpc/grpclog/grpclog.go b/vendor/google.golang.org/grpc/grpclog/grpclog.go new file mode 100644 index 0000000000..16a7d88867 --- /dev/null +++ b/vendor/google.golang.org/grpc/grpclog/grpclog.go @@ -0,0 +1,123 @@ +/* + * + * Copyright 2017 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. + * + */ + +// Package grpclog defines logging for grpc. +// +// All logs in transport package only go to verbose level 2. +// All logs in other packages in grpc are logged in spite of the verbosity level. +// +// In the default logger, +// severity level can be set by environment variable GRPC_GO_LOG_SEVERITY_LEVEL, +// verbosity level can be set by GRPC_GO_LOG_VERBOSITY_LEVEL. +package grpclog // import "google.golang.org/grpc/grpclog" + +import "os" + +var logger = newLoggerV2() + +// V reports whether verbosity level l is at least the requested verbose level. +func V(l int) bool { + return logger.V(l) +} + +// Info logs to the INFO log. +func Info(args ...interface{}) { + logger.Info(args...) +} + +// Infof logs to the INFO log. Arguments are handled in the manner of fmt.Printf. +func Infof(format string, args ...interface{}) { + logger.Infof(format, args...) +} + +// Infoln logs to the INFO log. Arguments are handled in the manner of fmt.Println. +func Infoln(args ...interface{}) { + logger.Infoln(args...) +} + +// Warning logs to the WARNING log. +func Warning(args ...interface{}) { + logger.Warning(args...) +} + +// Warningf logs to the WARNING log. Arguments are handled in the manner of fmt.Printf. +func Warningf(format string, args ...interface{}) { + logger.Warningf(format, args...) +} + +// Warningln logs to the WARNING log. Arguments are handled in the manner of fmt.Println. +func Warningln(args ...interface{}) { + logger.Warningln(args...) +} + +// Error logs to the ERROR log. +func Error(args ...interface{}) { + logger.Error(args...) +} + +// Errorf logs to the ERROR log. Arguments are handled in the manner of fmt.Printf. +func Errorf(format string, args ...interface{}) { + logger.Errorf(format, args...) +} + +// Errorln logs to the ERROR log. Arguments are handled in the manner of fmt.Println. +func Errorln(args ...interface{}) { + logger.Errorln(args...) +} + +// Fatal logs to the FATAL log. Arguments are handled in the manner of fmt.Print. +// It calls os.Exit() with exit code 1. +func Fatal(args ...interface{}) { + logger.Fatal(args...) + // Make sure fatal logs will exit. + os.Exit(1) +} + +// Fatalf logs to the FATAL log. Arguments are handled in the manner of fmt.Printf. +// It calles os.Exit() with exit code 1. +func Fatalf(format string, args ...interface{}) { + logger.Fatalf(format, args...) + // Make sure fatal logs will exit. + os.Exit(1) +} + +// Fatalln logs to the FATAL log. Arguments are handled in the manner of fmt.Println. +// It calle os.Exit()) with exit code 1. +func Fatalln(args ...interface{}) { + logger.Fatalln(args...) + // Make sure fatal logs will exit. + os.Exit(1) +} + +// Print prints to the logger. Arguments are handled in the manner of fmt.Print. +// Deprecated: use Info. +func Print(args ...interface{}) { + logger.Info(args...) +} + +// Printf prints to the logger. Arguments are handled in the manner of fmt.Printf. +// Deprecated: use Infof. +func Printf(format string, args ...interface{}) { + logger.Infof(format, args...) +} + +// Println prints to the logger. Arguments are handled in the manner of fmt.Println. +// Deprecated: use Infoln. +func Println(args ...interface{}) { + logger.Infoln(args...) +} diff --git a/vendor/google.golang.org/grpc/grpclog/logger.go b/vendor/google.golang.org/grpc/grpclog/logger.go new file mode 100644 index 0000000000..d03b2397bf --- /dev/null +++ b/vendor/google.golang.org/grpc/grpclog/logger.go @@ -0,0 +1,83 @@ +/* + * + * Copyright 2015 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. + * + */ + +package grpclog + +// Logger mimics golang's standard Logger as an interface. +// Deprecated: use LoggerV2. +type Logger interface { + Fatal(args ...interface{}) + Fatalf(format string, args ...interface{}) + Fatalln(args ...interface{}) + Print(args ...interface{}) + Printf(format string, args ...interface{}) + Println(args ...interface{}) +} + +// SetLogger sets the logger that is used in grpc. Call only from +// init() functions. +// Deprecated: use SetLoggerV2. +func SetLogger(l Logger) { + logger = &loggerWrapper{Logger: l} +} + +// loggerWrapper wraps Logger into a LoggerV2. +type loggerWrapper struct { + Logger +} + +func (g *loggerWrapper) Info(args ...interface{}) { + g.Logger.Print(args...) +} + +func (g *loggerWrapper) Infoln(args ...interface{}) { + g.Logger.Println(args...) +} + +func (g *loggerWrapper) Infof(format string, args ...interface{}) { + g.Logger.Printf(format, args...) +} + +func (g *loggerWrapper) Warning(args ...interface{}) { + g.Logger.Print(args...) +} + +func (g *loggerWrapper) Warningln(args ...interface{}) { + g.Logger.Println(args...) +} + +func (g *loggerWrapper) Warningf(format string, args ...interface{}) { + g.Logger.Printf(format, args...) +} + +func (g *loggerWrapper) Error(args ...interface{}) { + g.Logger.Print(args...) +} + +func (g *loggerWrapper) Errorln(args ...interface{}) { + g.Logger.Println(args...) +} + +func (g *loggerWrapper) Errorf(format string, args ...interface{}) { + g.Logger.Printf(format, args...) +} + +func (g *loggerWrapper) V(l int) bool { + // Returns true for all verbose level. + return true +} diff --git a/vendor/google.golang.org/grpc/grpclog/loggerv2.go b/vendor/google.golang.org/grpc/grpclog/loggerv2.go new file mode 100644 index 0000000000..d493257769 --- /dev/null +++ b/vendor/google.golang.org/grpc/grpclog/loggerv2.go @@ -0,0 +1,195 @@ +/* + * + * Copyright 2017 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. + * + */ + +package grpclog + +import ( + "io" + "io/ioutil" + "log" + "os" + "strconv" +) + +// LoggerV2 does underlying logging work for grpclog. +type LoggerV2 interface { + // Info logs to INFO log. Arguments are handled in the manner of fmt.Print. + Info(args ...interface{}) + // Infoln logs to INFO log. Arguments are handled in the manner of fmt.Println. + Infoln(args ...interface{}) + // Infof logs to INFO log. Arguments are handled in the manner of fmt.Printf. + Infof(format string, args ...interface{}) + // Warning logs to WARNING log. Arguments are handled in the manner of fmt.Print. + Warning(args ...interface{}) + // Warningln logs to WARNING log. Arguments are handled in the manner of fmt.Println. + Warningln(args ...interface{}) + // Warningf logs to WARNING log. Arguments are handled in the manner of fmt.Printf. + Warningf(format string, args ...interface{}) + // Error logs to ERROR log. Arguments are handled in the manner of fmt.Print. + Error(args ...interface{}) + // Errorln logs to ERROR log. Arguments are handled in the manner of fmt.Println. + Errorln(args ...interface{}) + // Errorf logs to ERROR log. Arguments are handled in the manner of fmt.Printf. + Errorf(format string, args ...interface{}) + // Fatal logs to ERROR log. Arguments are handled in the manner of fmt.Print. + // gRPC ensures that all Fatal logs will exit with os.Exit(1). + // Implementations may also call os.Exit() with a non-zero exit code. + Fatal(args ...interface{}) + // Fatalln logs to ERROR log. Arguments are handled in the manner of fmt.Println. + // gRPC ensures that all Fatal logs will exit with os.Exit(1). + // Implementations may also call os.Exit() with a non-zero exit code. + Fatalln(args ...interface{}) + // Fatalf logs to ERROR log. Arguments are handled in the manner of fmt.Printf. + // gRPC ensures that all Fatal logs will exit with os.Exit(1). + // Implementations may also call os.Exit() with a non-zero exit code. + Fatalf(format string, args ...interface{}) + // V reports whether verbosity level l is at least the requested verbose level. + V(l int) bool +} + +// SetLoggerV2 sets logger that is used in grpc to a V2 logger. +// Not mutex-protected, should be called before any gRPC functions. +func SetLoggerV2(l LoggerV2) { + logger = l +} + +const ( + // infoLog indicates Info severity. + infoLog int = iota + // warningLog indicates Warning severity. + warningLog + // errorLog indicates Error severity. + errorLog + // fatalLog indicates Fatal severity. + fatalLog +) + +// severityName contains the string representation of each severity. +var severityName = []string{ + infoLog: "INFO", + warningLog: "WARNING", + errorLog: "ERROR", + fatalLog: "FATAL", +} + +// loggerT is the default logger used by grpclog. +type loggerT struct { + m []*log.Logger + v int +} + +// NewLoggerV2 creates a loggerV2 with the provided writers. +// Fatal logs will be written to errorW, warningW, infoW, followed by exit(1). +// Error logs will be written to errorW, warningW and infoW. +// Warning logs will be written to warningW and infoW. +// Info logs will be written to infoW. +func NewLoggerV2(infoW, warningW, errorW io.Writer) LoggerV2 { + return NewLoggerV2WithVerbosity(infoW, warningW, errorW, 0) +} + +// NewLoggerV2WithVerbosity creates a loggerV2 with the provided writers and +// verbosity level. +func NewLoggerV2WithVerbosity(infoW, warningW, errorW io.Writer, v int) LoggerV2 { + var m []*log.Logger + m = append(m, log.New(infoW, severityName[infoLog]+": ", log.LstdFlags)) + m = append(m, log.New(io.MultiWriter(infoW, warningW), severityName[warningLog]+": ", log.LstdFlags)) + ew := io.MultiWriter(infoW, warningW, errorW) // ew will be used for error and fatal. + m = append(m, log.New(ew, severityName[errorLog]+": ", log.LstdFlags)) + m = append(m, log.New(ew, severityName[fatalLog]+": ", log.LstdFlags)) + return &loggerT{m: m, v: v} +} + +// newLoggerV2 creates a loggerV2 to be used as default logger. +// All logs are written to stderr. +func newLoggerV2() LoggerV2 { + errorW := ioutil.Discard + warningW := ioutil.Discard + infoW := ioutil.Discard + + logLevel := os.Getenv("GRPC_GO_LOG_SEVERITY_LEVEL") + switch logLevel { + case "", "ERROR", "error": // If env is unset, set level to ERROR. + errorW = os.Stderr + case "WARNING", "warning": + warningW = os.Stderr + case "INFO", "info": + infoW = os.Stderr + } + + var v int + vLevel := os.Getenv("GRPC_GO_LOG_VERBOSITY_LEVEL") + if vl, err := strconv.Atoi(vLevel); err == nil { + v = vl + } + return NewLoggerV2WithVerbosity(infoW, warningW, errorW, v) +} + +func (g *loggerT) Info(args ...interface{}) { + g.m[infoLog].Print(args...) +} + +func (g *loggerT) Infoln(args ...interface{}) { + g.m[infoLog].Println(args...) +} + +func (g *loggerT) Infof(format string, args ...interface{}) { + g.m[infoLog].Printf(format, args...) +} + +func (g *loggerT) Warning(args ...interface{}) { + g.m[warningLog].Print(args...) +} + +func (g *loggerT) Warningln(args ...interface{}) { + g.m[warningLog].Println(args...) +} + +func (g *loggerT) Warningf(format string, args ...interface{}) { + g.m[warningLog].Printf(format, args...) +} + +func (g *loggerT) Error(args ...interface{}) { + g.m[errorLog].Print(args...) +} + +func (g *loggerT) Errorln(args ...interface{}) { + g.m[errorLog].Println(args...) +} + +func (g *loggerT) Errorf(format string, args ...interface{}) { + g.m[errorLog].Printf(format, args...) +} + +func (g *loggerT) Fatal(args ...interface{}) { + g.m[fatalLog].Fatal(args...) + // No need to call os.Exit() again because log.Logger.Fatal() calls os.Exit(). +} + +func (g *loggerT) Fatalln(args ...interface{}) { + g.m[fatalLog].Fatalln(args...) + // No need to call os.Exit() again because log.Logger.Fatal() calls os.Exit(). +} + +func (g *loggerT) Fatalf(format string, args ...interface{}) { + g.m[fatalLog].Fatalf(format, args...) + // No need to call os.Exit() again because log.Logger.Fatal() calls os.Exit(). +} + +func (g *loggerT) V(l int) bool { + return l <= g.v +} diff --git a/vendor/google.golang.org/grpc/grpclog/loggerv2_test.go b/vendor/google.golang.org/grpc/grpclog/loggerv2_test.go new file mode 100644 index 0000000000..756f215f9c --- /dev/null +++ b/vendor/google.golang.org/grpc/grpclog/loggerv2_test.go @@ -0,0 +1,62 @@ +/* + * + * Copyright 2017 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. + * + */ + +package grpclog + +import ( + "bytes" + "fmt" + "regexp" + "testing" +) + +func TestLoggerV2Severity(t *testing.T) { + buffers := []*bytes.Buffer{new(bytes.Buffer), new(bytes.Buffer), new(bytes.Buffer)} + SetLoggerV2(NewLoggerV2(buffers[infoLog], buffers[warningLog], buffers[errorLog])) + + Info(severityName[infoLog]) + Warning(severityName[warningLog]) + Error(severityName[errorLog]) + + for i := 0; i < fatalLog; i++ { + buf := buffers[i] + // The content of info buffer should be something like: + // INFO: 2017/04/07 14:55:42 INFO + // WARNING: 2017/04/07 14:55:42 WARNING + // ERROR: 2017/04/07 14:55:42 ERROR + for j := i; j < fatalLog; j++ { + b, err := buf.ReadBytes('\n') + if err != nil { + t.Fatal(err) + } + if err := checkLogForSeverity(j, b); err != nil { + t.Fatal(err) + } + } + } +} + +// check if b is in the format of: +// WARNING: 2017/04/07 14:55:42 WARNING +func checkLogForSeverity(s int, b []byte) error { + expected := regexp.MustCompile(fmt.Sprintf(`^%s: [0-9]{4}/[0-9]{2}/[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2} %s\n$`, severityName[s], severityName[s])) + if m := expected.Match(b); !m { + return fmt.Errorf("got: %v, want string in format of: %v", string(b), severityName[s]+": 2016/10/05 17:09:26 "+severityName[s]) + } + return nil +} 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 new file mode 100644 index 0000000000..fdcbb9e0b7 --- /dev/null +++ b/vendor/google.golang.org/grpc/health/grpc_health_v1/health.pb.go @@ -0,0 +1,190 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: grpc_health_v1/health.proto + +/* +Package grpc_health_v1 is a generated protocol buffer package. + +It is generated from these files: + grpc_health_v1/health.proto + +It has these top-level messages: + HealthCheckRequest + HealthCheckResponse +*/ +package grpc_health_v1 + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // 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 fileDescriptor0, []int{1, 0} +} + +type HealthCheckRequest struct { + Service string `protobuf:"bytes,1,opt,name=service" json:"service,omitempty"` +} + +func (m *HealthCheckRequest) Reset() { *m = HealthCheckRequest{} } +func (m *HealthCheckRequest) String() string { return proto.CompactTextString(m) } +func (*HealthCheckRequest) ProtoMessage() {} +func (*HealthCheckRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *HealthCheckRequest) GetService() string { + if m != nil { + return m.Service + } + return "" +} + +type HealthCheckResponse struct { + Status HealthCheckResponse_ServingStatus `protobuf:"varint,1,opt,name=status,enum=grpc.health.v1.HealthCheckResponse_ServingStatus" json:"status,omitempty"` +} + +func (m *HealthCheckResponse) Reset() { *m = HealthCheckResponse{} } +func (m *HealthCheckResponse) String() string { return proto.CompactTextString(m) } +func (*HealthCheckResponse) ProtoMessage() {} +func (*HealthCheckResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *HealthCheckResponse) GetStatus() HealthCheckResponse_ServingStatus { + if m != nil { + return m.Status + } + return HealthCheckResponse_UNKNOWN +} + +func init() { + proto.RegisterType((*HealthCheckRequest)(nil), "grpc.health.v1.HealthCheckRequest") + proto.RegisterType((*HealthCheckResponse)(nil), "grpc.health.v1.HealthCheckResponse") + proto.RegisterEnum("grpc.health.v1.HealthCheckResponse_ServingStatus", HealthCheckResponse_ServingStatus_name, HealthCheckResponse_ServingStatus_value) +} + +// 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 + +// Client API for Health service + +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 := grpc.Invoke(ctx, "/grpc.health.v1.Health/Check", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for Health service + +type HealthServer interface { + Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) +} + +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: "/grpc.health.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: "grpc.health.v1.Health", + HandlerType: (*HealthServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Check", + Handler: _Health_Check_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "grpc_health_v1/health.proto", +} + +func init() { proto.RegisterFile("grpc_health_v1/health.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 213 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4e, 0x2f, 0x2a, 0x48, + 0x8e, 0xcf, 0x48, 0x4d, 0xcc, 0x29, 0xc9, 0x88, 0x2f, 0x33, 0xd4, 0x87, 0xb0, 0xf4, 0x0a, 0x8a, + 0xf2, 0x4b, 0xf2, 0x85, 0xf8, 0x40, 0x92, 0x7a, 0x50, 0xa1, 0x32, 0x43, 0x25, 0x3d, 0x2e, 0x21, + 0x0f, 0x30, 0xc7, 0x39, 0x23, 0x35, 0x39, 0x3b, 0x28, 0xb5, 0xb0, 0x34, 0xb5, 0xb8, 0x44, 0x48, + 0x82, 0x8b, 0xbd, 0x38, 0xb5, 0xa8, 0x2c, 0x33, 0x39, 0x55, 0x82, 0x51, 0x81, 0x51, 0x83, 0x33, + 0x08, 0xc6, 0x55, 0x9a, 0xc3, 0xc8, 0x25, 0x8c, 0xa2, 0xa1, 0xb8, 0x20, 0x3f, 0xaf, 0x38, 0x55, + 0xc8, 0x93, 0x8b, 0xad, 0xb8, 0x24, 0xb1, 0xa4, 0xb4, 0x18, 0xac, 0x81, 0xcf, 0xc8, 0x50, 0x0f, + 0xd5, 0x22, 0x3d, 0x2c, 0x9a, 0xf4, 0x82, 0x41, 0x86, 0xe6, 0xa5, 0x07, 0x83, 0x35, 0x06, 0x41, + 0x0d, 0x50, 0xb2, 0xe2, 0xe2, 0x45, 0x91, 0x10, 0xe2, 0xe6, 0x62, 0x0f, 0xf5, 0xf3, 0xf6, 0xf3, + 0x0f, 0xf7, 0x13, 0x60, 0x00, 0x71, 0x82, 0x5d, 0x83, 0xc2, 0x3c, 0xfd, 0xdc, 0x05, 0x18, 0x85, + 0xf8, 0xb9, 0xb8, 0xfd, 0xfc, 0x43, 0xe2, 0x61, 0x02, 0x4c, 0x46, 0x51, 0x5c, 0x6c, 0x10, 0x8b, + 0x84, 0x02, 0xb8, 0x58, 0xc1, 0x96, 0x09, 0x29, 0xe1, 0x75, 0x09, 0xd8, 0xbf, 0x52, 0xca, 0x44, + 0xb8, 0x36, 0x89, 0x0d, 0x1c, 0x82, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x53, 0x2b, 0x65, + 0x20, 0x60, 0x01, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/grpc/health/grpc_health_v1/health.proto b/vendor/google.golang.org/grpc/health/grpc_health_v1/health.proto new file mode 100644 index 0000000000..6072fdc3b8 --- /dev/null +++ b/vendor/google.golang.org/grpc/health/grpc_health_v1/health.proto @@ -0,0 +1,34 @@ +// Copyright 2017 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. + +syntax = "proto3"; + +package grpc.health.v1; + +message HealthCheckRequest { + string service = 1; +} + +message HealthCheckResponse { + enum ServingStatus { + UNKNOWN = 0; + SERVING = 1; + NOT_SERVING = 2; + } + ServingStatus status = 1; +} + +service Health{ + rpc Check(HealthCheckRequest) returns (HealthCheckResponse); +} diff --git a/vendor/google.golang.org/grpc/health/health.go b/vendor/google.golang.org/grpc/health/health.go new file mode 100644 index 0000000000..30a78667e6 --- /dev/null +++ b/vendor/google.golang.org/grpc/health/health.go @@ -0,0 +1,72 @@ +/* + * + * Copyright 2017 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. + * + */ + +//go:generate protoc --go_out=plugins=grpc:. grpc_health_v1/health.proto + +// Package health provides some utility functions to health-check a server. The implementation +// is based on protobuf. Users need to write their own implementations if other IDLs are used. +package health + +import ( + "sync" + + "golang.org/x/net/context" + "google.golang.org/grpc/codes" + healthpb "google.golang.org/grpc/health/grpc_health_v1" + "google.golang.org/grpc/status" +) + +// Server implements `service Health`. +type Server struct { + mu sync.Mutex + // statusMap stores the serving status of the services this Server monitors. + statusMap map[string]healthpb.HealthCheckResponse_ServingStatus +} + +// NewServer returns a new Server. +func NewServer() *Server { + return &Server{ + statusMap: make(map[string]healthpb.HealthCheckResponse_ServingStatus), + } +} + +// Check implements `service Health`. +func (s *Server) Check(ctx context.Context, in *healthpb.HealthCheckRequest) (*healthpb.HealthCheckResponse, error) { + s.mu.Lock() + defer s.mu.Unlock() + if in.Service == "" { + // check the server overall health status. + return &healthpb.HealthCheckResponse{ + Status: healthpb.HealthCheckResponse_SERVING, + }, nil + } + if status, ok := s.statusMap[in.Service]; ok { + return &healthpb.HealthCheckResponse{ + Status: status, + }, nil + } + return nil, status.Error(codes.NotFound, "unknown service") +} + +// SetServingStatus is called when need to reset the serving status of a service +// or insert a new service entry into the statusMap. +func (s *Server) SetServingStatus(service string, status healthpb.HealthCheckResponse_ServingStatus) { + s.mu.Lock() + s.statusMap[service] = status + s.mu.Unlock() +} diff --git a/vendor/google.golang.org/grpc/interceptor.go b/vendor/google.golang.org/grpc/interceptor.go new file mode 100644 index 0000000000..06dc825b9f --- /dev/null +++ b/vendor/google.golang.org/grpc/interceptor.go @@ -0,0 +1,75 @@ +/* + * + * Copyright 2016 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. + * + */ + +package grpc + +import ( + "golang.org/x/net/context" +) + +// UnaryInvoker is called by UnaryClientInterceptor to complete RPCs. +type UnaryInvoker func(ctx context.Context, method string, req, reply interface{}, cc *ClientConn, opts ...CallOption) error + +// UnaryClientInterceptor intercepts the execution of a unary RPC on the client. invoker is the handler to complete the RPC +// and it is the responsibility of the interceptor to call it. +// This is an EXPERIMENTAL API. +type UnaryClientInterceptor func(ctx context.Context, method string, req, reply interface{}, cc *ClientConn, invoker UnaryInvoker, opts ...CallOption) error + +// Streamer is called by StreamClientInterceptor to create a ClientStream. +type Streamer func(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, opts ...CallOption) (ClientStream, error) + +// StreamClientInterceptor intercepts the creation of ClientStream. It may return a custom ClientStream to intercept all I/O +// operations. streamer is the handler to create a ClientStream and it is the responsibility of the interceptor to call it. +// This is an EXPERIMENTAL API. +type StreamClientInterceptor func(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, streamer Streamer, opts ...CallOption) (ClientStream, error) + +// UnaryServerInfo consists of various information about a unary RPC on +// server side. All per-rpc information may be mutated by the interceptor. +type UnaryServerInfo struct { + // Server is the service implementation the user provides. This is read-only. + Server interface{} + // FullMethod is the full RPC method string, i.e., /package.service/method. + FullMethod string +} + +// UnaryHandler defines the handler invoked by UnaryServerInterceptor to complete the normal +// execution of a unary RPC. +type UnaryHandler func(ctx context.Context, req interface{}) (interface{}, error) + +// UnaryServerInterceptor provides a hook to intercept the execution of a unary RPC on the server. info +// contains all the information of this RPC the interceptor can operate on. And handler is the wrapper +// of the service method implementation. It is the responsibility of the interceptor to invoke handler +// to complete the RPC. +type UnaryServerInterceptor func(ctx context.Context, req interface{}, info *UnaryServerInfo, handler UnaryHandler) (resp interface{}, err error) + +// StreamServerInfo consists of various information about a streaming RPC on +// server side. All per-rpc information may be mutated by the interceptor. +type StreamServerInfo struct { + // FullMethod is the full RPC method string, i.e., /package.service/method. + FullMethod string + // IsClientStream indicates whether the RPC is a client streaming RPC. + IsClientStream bool + // IsServerStream indicates whether the RPC is a server streaming RPC. + IsServerStream bool +} + +// StreamServerInterceptor provides a hook to intercept the execution of a streaming RPC on the server. +// info contains all the information of this RPC the interceptor can operate on. And handler is the +// service method implementation. It is the responsibility of the interceptor to invoke handler to +// complete the RPC. +type StreamServerInterceptor func(srv interface{}, ss ServerStream, info *StreamServerInfo, handler StreamHandler) error diff --git a/vendor/google.golang.org/grpc/internal/internal.go b/vendor/google.golang.org/grpc/internal/internal.go new file mode 100644 index 0000000000..53f1775201 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/internal.go @@ -0,0 +1,27 @@ +/* + * Copyright 2016 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. + * + */ + +// Package internal contains gRPC-internal code for testing, to avoid polluting +// the godoc of the top-level grpc package. +package internal + +// TestingUseHandlerImpl enables the http.Handler-based server implementation. +// It must be called before Serve and requires TLS credentials. +// +// The provided grpcServer must be of type *grpc.Server. It is untyped +// for circular dependency reasons. +var TestingUseHandlerImpl func(grpcServer interface{}) diff --git a/vendor/google.golang.org/grpc/interop/client/client.go b/vendor/google.golang.org/grpc/interop/client/client.go new file mode 100644 index 0000000000..da6bc2d20e --- /dev/null +++ b/vendor/google.golang.org/grpc/interop/client/client.go @@ -0,0 +1,190 @@ +/* + * + * Copyright 2014 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. + * + */ + +package main + +import ( + "flag" + "net" + "strconv" + + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/credentials/oauth" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/interop" + testpb "google.golang.org/grpc/interop/grpc_testing" + "google.golang.org/grpc/testdata" +) + +var ( + caFile = flag.String("ca_file", "", "The file containning the CA root cert file") + useTLS = flag.Bool("use_tls", false, "Connection uses TLS if true, else plain TCP") + testCA = flag.Bool("use_test_ca", false, "Whether to replace platform root CAs with test CA as the CA root") + serviceAccountKeyFile = flag.String("service_account_key_file", "", "Path to service account json key file") + oauthScope = flag.String("oauth_scope", "", "The scope for OAuth2 tokens") + defaultServiceAccount = flag.String("default_service_account", "", "Email of GCE default service account") + serverHost = flag.String("server_host", "localhost", "The server host name") + serverPort = flag.Int("server_port", 10000, "The server port number") + tlsServerName = flag.String("server_host_override", "", "The server name use to verify the hostname returned by TLS handshake if it is not empty. Otherwise, --server_host is used.") + testCase = flag.String("test_case", "large_unary", + `Configure different test cases. Valid options are: + empty_unary : empty (zero bytes) request and response; + large_unary : single request and (large) response; + client_streaming : request streaming with single response; + server_streaming : single request with response streaming; + ping_pong : full-duplex streaming; + empty_stream : full-duplex streaming with zero message; + timeout_on_sleeping_server: fullduplex streaming on a sleeping server; + compute_engine_creds: large_unary with compute engine auth; + service_account_creds: large_unary with service account auth; + jwt_token_creds: large_unary with jwt token auth; + per_rpc_creds: large_unary with per rpc token; + oauth2_auth_token: large_unary with oauth2 token auth; + cancel_after_begin: cancellation after metadata has been sent but before payloads are sent; + cancel_after_first_response: cancellation after receiving 1st message from the server; + status_code_and_message: status code propagated back to client; + custom_metadata: server will echo custom metadata; + unimplemented_method: client attempts to call unimplemented method; + unimplemented_service: client attempts to call unimplemented service.`) +) + +func main() { + flag.Parse() + serverAddr := net.JoinHostPort(*serverHost, strconv.Itoa(*serverPort)) + var opts []grpc.DialOption + if *useTLS { + var sn string + if *tlsServerName != "" { + sn = *tlsServerName + } + var creds credentials.TransportCredentials + if *testCA { + var err error + if *caFile == "" { + *caFile = testdata.Path("ca.pem") + } + creds, err = credentials.NewClientTLSFromFile(*caFile, sn) + if err != nil { + grpclog.Fatalf("Failed to create TLS credentials %v", err) + } + } else { + creds = credentials.NewClientTLSFromCert(nil, sn) + } + opts = append(opts, grpc.WithTransportCredentials(creds)) + if *testCase == "compute_engine_creds" { + opts = append(opts, grpc.WithPerRPCCredentials(oauth.NewComputeEngine())) + } else if *testCase == "service_account_creds" { + jwtCreds, err := oauth.NewServiceAccountFromFile(*serviceAccountKeyFile, *oauthScope) + if err != nil { + grpclog.Fatalf("Failed to create JWT credentials: %v", err) + } + opts = append(opts, grpc.WithPerRPCCredentials(jwtCreds)) + } else if *testCase == "jwt_token_creds" { + jwtCreds, err := oauth.NewJWTAccessFromFile(*serviceAccountKeyFile) + if err != nil { + grpclog.Fatalf("Failed to create JWT credentials: %v", err) + } + opts = append(opts, grpc.WithPerRPCCredentials(jwtCreds)) + } else if *testCase == "oauth2_auth_token" { + opts = append(opts, grpc.WithPerRPCCredentials(oauth.NewOauthAccess(interop.GetToken(*serviceAccountKeyFile, *oauthScope)))) + } + } else { + opts = append(opts, grpc.WithInsecure()) + } + opts = append(opts, grpc.WithBlock()) + conn, err := grpc.Dial(serverAddr, opts...) + if err != nil { + grpclog.Fatalf("Fail to dial: %v", err) + } + defer conn.Close() + tc := testpb.NewTestServiceClient(conn) + switch *testCase { + case "empty_unary": + interop.DoEmptyUnaryCall(tc) + grpclog.Println("EmptyUnaryCall done") + case "large_unary": + interop.DoLargeUnaryCall(tc) + grpclog.Println("LargeUnaryCall done") + case "client_streaming": + interop.DoClientStreaming(tc) + grpclog.Println("ClientStreaming done") + case "server_streaming": + interop.DoServerStreaming(tc) + grpclog.Println("ServerStreaming done") + case "ping_pong": + interop.DoPingPong(tc) + grpclog.Println("Pingpong done") + case "empty_stream": + interop.DoEmptyStream(tc) + grpclog.Println("Emptystream done") + case "timeout_on_sleeping_server": + interop.DoTimeoutOnSleepingServer(tc) + grpclog.Println("TimeoutOnSleepingServer done") + case "compute_engine_creds": + if !*useTLS { + grpclog.Fatalf("TLS is not enabled. TLS is required to execute compute_engine_creds test case.") + } + interop.DoComputeEngineCreds(tc, *defaultServiceAccount, *oauthScope) + grpclog.Println("ComputeEngineCreds done") + case "service_account_creds": + if !*useTLS { + grpclog.Fatalf("TLS is not enabled. TLS is required to execute service_account_creds test case.") + } + interop.DoServiceAccountCreds(tc, *serviceAccountKeyFile, *oauthScope) + grpclog.Println("ServiceAccountCreds done") + case "jwt_token_creds": + if !*useTLS { + grpclog.Fatalf("TLS is not enabled. TLS is required to execute jwt_token_creds test case.") + } + interop.DoJWTTokenCreds(tc, *serviceAccountKeyFile) + grpclog.Println("JWTtokenCreds done") + case "per_rpc_creds": + if !*useTLS { + grpclog.Fatalf("TLS is not enabled. TLS is required to execute per_rpc_creds test case.") + } + interop.DoPerRPCCreds(tc, *serviceAccountKeyFile, *oauthScope) + grpclog.Println("PerRPCCreds done") + case "oauth2_auth_token": + if !*useTLS { + grpclog.Fatalf("TLS is not enabled. TLS is required to execute oauth2_auth_token test case.") + } + interop.DoOauth2TokenCreds(tc, *serviceAccountKeyFile, *oauthScope) + grpclog.Println("Oauth2TokenCreds done") + case "cancel_after_begin": + interop.DoCancelAfterBegin(tc) + grpclog.Println("CancelAfterBegin done") + case "cancel_after_first_response": + interop.DoCancelAfterFirstResponse(tc) + grpclog.Println("CancelAfterFirstResponse done") + case "status_code_and_message": + interop.DoStatusCodeAndMessage(tc) + grpclog.Println("StatusCodeAndMessage done") + case "custom_metadata": + interop.DoCustomMetadata(tc) + grpclog.Println("CustomMetadata done") + case "unimplemented_method": + interop.DoUnimplementedMethod(conn) + grpclog.Println("UnimplementedMethod done") + case "unimplemented_service": + interop.DoUnimplementedService(testpb.NewUnimplementedServiceClient(conn)) + grpclog.Println("UnimplementedService done") + default: + grpclog.Fatal("Unsupported test case: ", *testCase) + } +} diff --git a/vendor/google.golang.org/grpc/interop/grpc_testing/test.pb.go b/vendor/google.golang.org/grpc/interop/grpc_testing/test.pb.go new file mode 100644 index 0000000000..1e7a9abdf2 --- /dev/null +++ b/vendor/google.golang.org/grpc/interop/grpc_testing/test.pb.go @@ -0,0 +1,883 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: grpc_testing/test.proto + +/* +Package grpc_testing is a generated protocol buffer package. + +It is generated from these files: + grpc_testing/test.proto + +It has these top-level messages: + Empty + Payload + EchoStatus + SimpleRequest + SimpleResponse + StreamingInputCallRequest + StreamingInputCallResponse + ResponseParameters + StreamingOutputCallRequest + StreamingOutputCallResponse +*/ +package grpc_testing + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// The type of payload that should be returned. +type PayloadType int32 + +const ( + // Compressable text format. + PayloadType_COMPRESSABLE PayloadType = 0 + // Uncompressable binary format. + PayloadType_UNCOMPRESSABLE PayloadType = 1 + // Randomly chosen from all other formats defined in this enum. + PayloadType_RANDOM PayloadType = 2 +) + +var PayloadType_name = map[int32]string{ + 0: "COMPRESSABLE", + 1: "UNCOMPRESSABLE", + 2: "RANDOM", +} +var PayloadType_value = map[string]int32{ + "COMPRESSABLE": 0, + "UNCOMPRESSABLE": 1, + "RANDOM": 2, +} + +func (x PayloadType) String() string { + return proto.EnumName(PayloadType_name, int32(x)) +} +func (PayloadType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +type Empty struct { +} + +func (m *Empty) Reset() { *m = Empty{} } +func (m *Empty) String() string { return proto.CompactTextString(m) } +func (*Empty) ProtoMessage() {} +func (*Empty) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +// A block of data, to simply increase gRPC message size. +type Payload struct { + // The type of data in body. + Type PayloadType `protobuf:"varint,1,opt,name=type,enum=grpc.testing.PayloadType" json:"type,omitempty"` + // Primary contents of payload. + Body []byte `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"` +} + +func (m *Payload) Reset() { *m = Payload{} } +func (m *Payload) String() string { return proto.CompactTextString(m) } +func (*Payload) ProtoMessage() {} +func (*Payload) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *Payload) GetType() PayloadType { + if m != nil { + return m.Type + } + return PayloadType_COMPRESSABLE +} + +func (m *Payload) GetBody() []byte { + if m != nil { + return m.Body + } + return nil +} + +// A protobuf representation for grpc status. This is used by test +// clients to specify a status that the server should attempt to return. +type EchoStatus struct { + Code int32 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"` +} + +func (m *EchoStatus) Reset() { *m = EchoStatus{} } +func (m *EchoStatus) String() string { return proto.CompactTextString(m) } +func (*EchoStatus) ProtoMessage() {} +func (*EchoStatus) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *EchoStatus) GetCode() int32 { + if m != nil { + return m.Code + } + return 0 +} + +func (m *EchoStatus) GetMessage() string { + if m != nil { + return m.Message + } + return "" +} + +// Unary request. +type SimpleRequest struct { + // Desired payload type in the response from the server. + // If response_type is RANDOM, server randomly chooses one from other formats. + ResponseType PayloadType `protobuf:"varint,1,opt,name=response_type,json=responseType,enum=grpc.testing.PayloadType" json:"response_type,omitempty"` + // Desired payload size in the response from the server. + // If response_type is COMPRESSABLE, this denotes the size before compression. + ResponseSize int32 `protobuf:"varint,2,opt,name=response_size,json=responseSize" json:"response_size,omitempty"` + // Optional input payload sent along with the request. + Payload *Payload `protobuf:"bytes,3,opt,name=payload" json:"payload,omitempty"` + // Whether SimpleResponse should include username. + FillUsername bool `protobuf:"varint,4,opt,name=fill_username,json=fillUsername" json:"fill_username,omitempty"` + // Whether SimpleResponse should include OAuth scope. + FillOauthScope bool `protobuf:"varint,5,opt,name=fill_oauth_scope,json=fillOauthScope" json:"fill_oauth_scope,omitempty"` + // Whether server should return a given status + ResponseStatus *EchoStatus `protobuf:"bytes,7,opt,name=response_status,json=responseStatus" json:"response_status,omitempty"` +} + +func (m *SimpleRequest) Reset() { *m = SimpleRequest{} } +func (m *SimpleRequest) String() string { return proto.CompactTextString(m) } +func (*SimpleRequest) ProtoMessage() {} +func (*SimpleRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *SimpleRequest) GetResponseType() PayloadType { + if m != nil { + return m.ResponseType + } + return PayloadType_COMPRESSABLE +} + +func (m *SimpleRequest) GetResponseSize() int32 { + if m != nil { + return m.ResponseSize + } + return 0 +} + +func (m *SimpleRequest) GetPayload() *Payload { + if m != nil { + return m.Payload + } + return nil +} + +func (m *SimpleRequest) GetFillUsername() bool { + if m != nil { + return m.FillUsername + } + return false +} + +func (m *SimpleRequest) GetFillOauthScope() bool { + if m != nil { + return m.FillOauthScope + } + return false +} + +func (m *SimpleRequest) GetResponseStatus() *EchoStatus { + if m != nil { + return m.ResponseStatus + } + return nil +} + +// Unary response, as configured by the request. +type SimpleResponse struct { + // Payload to increase message size. + Payload *Payload `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"` + // The user the request came from, for verifying authentication was + // successful when the client expected it. + Username string `protobuf:"bytes,2,opt,name=username" json:"username,omitempty"` + // OAuth scope. + OauthScope string `protobuf:"bytes,3,opt,name=oauth_scope,json=oauthScope" json:"oauth_scope,omitempty"` +} + +func (m *SimpleResponse) Reset() { *m = SimpleResponse{} } +func (m *SimpleResponse) String() string { return proto.CompactTextString(m) } +func (*SimpleResponse) ProtoMessage() {} +func (*SimpleResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *SimpleResponse) GetPayload() *Payload { + if m != nil { + return m.Payload + } + return nil +} + +func (m *SimpleResponse) GetUsername() string { + if m != nil { + return m.Username + } + return "" +} + +func (m *SimpleResponse) GetOauthScope() string { + if m != nil { + return m.OauthScope + } + return "" +} + +// Client-streaming request. +type StreamingInputCallRequest struct { + // Optional input payload sent along with the request. + Payload *Payload `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"` +} + +func (m *StreamingInputCallRequest) Reset() { *m = StreamingInputCallRequest{} } +func (m *StreamingInputCallRequest) String() string { return proto.CompactTextString(m) } +func (*StreamingInputCallRequest) ProtoMessage() {} +func (*StreamingInputCallRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *StreamingInputCallRequest) GetPayload() *Payload { + if m != nil { + return m.Payload + } + return nil +} + +// Client-streaming response. +type StreamingInputCallResponse struct { + // Aggregated size of payloads received from the client. + AggregatedPayloadSize int32 `protobuf:"varint,1,opt,name=aggregated_payload_size,json=aggregatedPayloadSize" json:"aggregated_payload_size,omitempty"` +} + +func (m *StreamingInputCallResponse) Reset() { *m = StreamingInputCallResponse{} } +func (m *StreamingInputCallResponse) String() string { return proto.CompactTextString(m) } +func (*StreamingInputCallResponse) ProtoMessage() {} +func (*StreamingInputCallResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *StreamingInputCallResponse) GetAggregatedPayloadSize() int32 { + if m != nil { + return m.AggregatedPayloadSize + } + return 0 +} + +// Configuration for a particular response. +type ResponseParameters struct { + // Desired payload sizes in responses from the server. + // If response_type is COMPRESSABLE, this denotes the size before compression. + Size int32 `protobuf:"varint,1,opt,name=size" json:"size,omitempty"` + // Desired interval between consecutive responses in the response stream in + // microseconds. + IntervalUs int32 `protobuf:"varint,2,opt,name=interval_us,json=intervalUs" json:"interval_us,omitempty"` +} + +func (m *ResponseParameters) Reset() { *m = ResponseParameters{} } +func (m *ResponseParameters) String() string { return proto.CompactTextString(m) } +func (*ResponseParameters) ProtoMessage() {} +func (*ResponseParameters) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *ResponseParameters) GetSize() int32 { + if m != nil { + return m.Size + } + return 0 +} + +func (m *ResponseParameters) GetIntervalUs() int32 { + if m != nil { + return m.IntervalUs + } + return 0 +} + +// Server-streaming request. +type StreamingOutputCallRequest struct { + // Desired payload type in the response from the server. + // If response_type is RANDOM, the payload from each response in the stream + // might be of different types. This is to simulate a mixed type of payload + // stream. + ResponseType PayloadType `protobuf:"varint,1,opt,name=response_type,json=responseType,enum=grpc.testing.PayloadType" json:"response_type,omitempty"` + // Configuration for each expected response message. + ResponseParameters []*ResponseParameters `protobuf:"bytes,2,rep,name=response_parameters,json=responseParameters" json:"response_parameters,omitempty"` + // Optional input payload sent along with the request. + Payload *Payload `protobuf:"bytes,3,opt,name=payload" json:"payload,omitempty"` + // Whether server should return a given status + ResponseStatus *EchoStatus `protobuf:"bytes,7,opt,name=response_status,json=responseStatus" json:"response_status,omitempty"` +} + +func (m *StreamingOutputCallRequest) Reset() { *m = StreamingOutputCallRequest{} } +func (m *StreamingOutputCallRequest) String() string { return proto.CompactTextString(m) } +func (*StreamingOutputCallRequest) ProtoMessage() {} +func (*StreamingOutputCallRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *StreamingOutputCallRequest) GetResponseType() PayloadType { + if m != nil { + return m.ResponseType + } + return PayloadType_COMPRESSABLE +} + +func (m *StreamingOutputCallRequest) GetResponseParameters() []*ResponseParameters { + if m != nil { + return m.ResponseParameters + } + return nil +} + +func (m *StreamingOutputCallRequest) GetPayload() *Payload { + if m != nil { + return m.Payload + } + return nil +} + +func (m *StreamingOutputCallRequest) GetResponseStatus() *EchoStatus { + if m != nil { + return m.ResponseStatus + } + return nil +} + +// Server-streaming response, as configured by the request and parameters. +type StreamingOutputCallResponse struct { + // Payload to increase response size. + Payload *Payload `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"` +} + +func (m *StreamingOutputCallResponse) Reset() { *m = StreamingOutputCallResponse{} } +func (m *StreamingOutputCallResponse) String() string { return proto.CompactTextString(m) } +func (*StreamingOutputCallResponse) ProtoMessage() {} +func (*StreamingOutputCallResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *StreamingOutputCallResponse) GetPayload() *Payload { + if m != nil { + return m.Payload + } + return nil +} + +func init() { + proto.RegisterType((*Empty)(nil), "grpc.testing.Empty") + proto.RegisterType((*Payload)(nil), "grpc.testing.Payload") + proto.RegisterType((*EchoStatus)(nil), "grpc.testing.EchoStatus") + proto.RegisterType((*SimpleRequest)(nil), "grpc.testing.SimpleRequest") + proto.RegisterType((*SimpleResponse)(nil), "grpc.testing.SimpleResponse") + proto.RegisterType((*StreamingInputCallRequest)(nil), "grpc.testing.StreamingInputCallRequest") + proto.RegisterType((*StreamingInputCallResponse)(nil), "grpc.testing.StreamingInputCallResponse") + proto.RegisterType((*ResponseParameters)(nil), "grpc.testing.ResponseParameters") + proto.RegisterType((*StreamingOutputCallRequest)(nil), "grpc.testing.StreamingOutputCallRequest") + proto.RegisterType((*StreamingOutputCallResponse)(nil), "grpc.testing.StreamingOutputCallResponse") + proto.RegisterEnum("grpc.testing.PayloadType", PayloadType_name, PayloadType_value) +} + +// 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 + +// Client API for TestService service + +type TestServiceClient interface { + // One empty request followed by one empty response. + EmptyCall(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) + // One request followed by one response. + // The server returns the client payload as-is. + UnaryCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (*SimpleResponse, error) + // One request followed by a sequence of responses (streamed download). + // The server returns the payload with client desired type and sizes. + StreamingOutputCall(ctx context.Context, in *StreamingOutputCallRequest, opts ...grpc.CallOption) (TestService_StreamingOutputCallClient, error) + // A sequence of requests followed by one response (streamed upload). + // The server returns the aggregated size of client payload as the result. + StreamingInputCall(ctx context.Context, opts ...grpc.CallOption) (TestService_StreamingInputCallClient, error) + // A sequence of requests with each request served by the server immediately. + // As one request could lead to multiple responses, this interface + // demonstrates the idea of full duplexing. + FullDuplexCall(ctx context.Context, opts ...grpc.CallOption) (TestService_FullDuplexCallClient, error) + // A sequence of requests followed by a sequence of responses. + // The server buffers all the client requests and then serves them in order. A + // stream of responses are returned to the client when the server starts with + // first request. + HalfDuplexCall(ctx context.Context, opts ...grpc.CallOption) (TestService_HalfDuplexCallClient, error) +} + +type testServiceClient struct { + cc *grpc.ClientConn +} + +func NewTestServiceClient(cc *grpc.ClientConn) TestServiceClient { + return &testServiceClient{cc} +} + +func (c *testServiceClient) EmptyCall(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) { + out := new(Empty) + err := grpc.Invoke(ctx, "/grpc.testing.TestService/EmptyCall", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *testServiceClient) UnaryCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (*SimpleResponse, error) { + out := new(SimpleResponse) + err := grpc.Invoke(ctx, "/grpc.testing.TestService/UnaryCall", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *testServiceClient) StreamingOutputCall(ctx context.Context, in *StreamingOutputCallRequest, opts ...grpc.CallOption) (TestService_StreamingOutputCallClient, error) { + stream, err := grpc.NewClientStream(ctx, &_TestService_serviceDesc.Streams[0], c.cc, "/grpc.testing.TestService/StreamingOutputCall", opts...) + if err != nil { + return nil, err + } + x := &testServiceStreamingOutputCallClient{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 TestService_StreamingOutputCallClient interface { + Recv() (*StreamingOutputCallResponse, error) + grpc.ClientStream +} + +type testServiceStreamingOutputCallClient struct { + grpc.ClientStream +} + +func (x *testServiceStreamingOutputCallClient) Recv() (*StreamingOutputCallResponse, error) { + m := new(StreamingOutputCallResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *testServiceClient) StreamingInputCall(ctx context.Context, opts ...grpc.CallOption) (TestService_StreamingInputCallClient, error) { + stream, err := grpc.NewClientStream(ctx, &_TestService_serviceDesc.Streams[1], c.cc, "/grpc.testing.TestService/StreamingInputCall", opts...) + if err != nil { + return nil, err + } + x := &testServiceStreamingInputCallClient{stream} + return x, nil +} + +type TestService_StreamingInputCallClient interface { + Send(*StreamingInputCallRequest) error + CloseAndRecv() (*StreamingInputCallResponse, error) + grpc.ClientStream +} + +type testServiceStreamingInputCallClient struct { + grpc.ClientStream +} + +func (x *testServiceStreamingInputCallClient) Send(m *StreamingInputCallRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *testServiceStreamingInputCallClient) CloseAndRecv() (*StreamingInputCallResponse, error) { + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + m := new(StreamingInputCallResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *testServiceClient) FullDuplexCall(ctx context.Context, opts ...grpc.CallOption) (TestService_FullDuplexCallClient, error) { + stream, err := grpc.NewClientStream(ctx, &_TestService_serviceDesc.Streams[2], c.cc, "/grpc.testing.TestService/FullDuplexCall", opts...) + if err != nil { + return nil, err + } + x := &testServiceFullDuplexCallClient{stream} + return x, nil +} + +type TestService_FullDuplexCallClient interface { + Send(*StreamingOutputCallRequest) error + Recv() (*StreamingOutputCallResponse, error) + grpc.ClientStream +} + +type testServiceFullDuplexCallClient struct { + grpc.ClientStream +} + +func (x *testServiceFullDuplexCallClient) Send(m *StreamingOutputCallRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *testServiceFullDuplexCallClient) Recv() (*StreamingOutputCallResponse, error) { + m := new(StreamingOutputCallResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *testServiceClient) HalfDuplexCall(ctx context.Context, opts ...grpc.CallOption) (TestService_HalfDuplexCallClient, error) { + stream, err := grpc.NewClientStream(ctx, &_TestService_serviceDesc.Streams[3], c.cc, "/grpc.testing.TestService/HalfDuplexCall", opts...) + if err != nil { + return nil, err + } + x := &testServiceHalfDuplexCallClient{stream} + return x, nil +} + +type TestService_HalfDuplexCallClient interface { + Send(*StreamingOutputCallRequest) error + Recv() (*StreamingOutputCallResponse, error) + grpc.ClientStream +} + +type testServiceHalfDuplexCallClient struct { + grpc.ClientStream +} + +func (x *testServiceHalfDuplexCallClient) Send(m *StreamingOutputCallRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *testServiceHalfDuplexCallClient) Recv() (*StreamingOutputCallResponse, error) { + m := new(StreamingOutputCallResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// Server API for TestService service + +type TestServiceServer interface { + // One empty request followed by one empty response. + EmptyCall(context.Context, *Empty) (*Empty, error) + // One request followed by one response. + // The server returns the client payload as-is. + UnaryCall(context.Context, *SimpleRequest) (*SimpleResponse, error) + // One request followed by a sequence of responses (streamed download). + // The server returns the payload with client desired type and sizes. + StreamingOutputCall(*StreamingOutputCallRequest, TestService_StreamingOutputCallServer) error + // A sequence of requests followed by one response (streamed upload). + // The server returns the aggregated size of client payload as the result. + StreamingInputCall(TestService_StreamingInputCallServer) error + // A sequence of requests with each request served by the server immediately. + // As one request could lead to multiple responses, this interface + // demonstrates the idea of full duplexing. + FullDuplexCall(TestService_FullDuplexCallServer) error + // A sequence of requests followed by a sequence of responses. + // The server buffers all the client requests and then serves them in order. A + // stream of responses are returned to the client when the server starts with + // first request. + HalfDuplexCall(TestService_HalfDuplexCallServer) error +} + +func RegisterTestServiceServer(s *grpc.Server, srv TestServiceServer) { + s.RegisterService(&_TestService_serviceDesc, srv) +} + +func _TestService_EmptyCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TestServiceServer).EmptyCall(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.testing.TestService/EmptyCall", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TestServiceServer).EmptyCall(ctx, req.(*Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _TestService_UnaryCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SimpleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TestServiceServer).UnaryCall(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.testing.TestService/UnaryCall", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TestServiceServer).UnaryCall(ctx, req.(*SimpleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TestService_StreamingOutputCall_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(StreamingOutputCallRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(TestServiceServer).StreamingOutputCall(m, &testServiceStreamingOutputCallServer{stream}) +} + +type TestService_StreamingOutputCallServer interface { + Send(*StreamingOutputCallResponse) error + grpc.ServerStream +} + +type testServiceStreamingOutputCallServer struct { + grpc.ServerStream +} + +func (x *testServiceStreamingOutputCallServer) Send(m *StreamingOutputCallResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _TestService_StreamingInputCall_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(TestServiceServer).StreamingInputCall(&testServiceStreamingInputCallServer{stream}) +} + +type TestService_StreamingInputCallServer interface { + SendAndClose(*StreamingInputCallResponse) error + Recv() (*StreamingInputCallRequest, error) + grpc.ServerStream +} + +type testServiceStreamingInputCallServer struct { + grpc.ServerStream +} + +func (x *testServiceStreamingInputCallServer) SendAndClose(m *StreamingInputCallResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *testServiceStreamingInputCallServer) Recv() (*StreamingInputCallRequest, error) { + m := new(StreamingInputCallRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _TestService_FullDuplexCall_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(TestServiceServer).FullDuplexCall(&testServiceFullDuplexCallServer{stream}) +} + +type TestService_FullDuplexCallServer interface { + Send(*StreamingOutputCallResponse) error + Recv() (*StreamingOutputCallRequest, error) + grpc.ServerStream +} + +type testServiceFullDuplexCallServer struct { + grpc.ServerStream +} + +func (x *testServiceFullDuplexCallServer) Send(m *StreamingOutputCallResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *testServiceFullDuplexCallServer) Recv() (*StreamingOutputCallRequest, error) { + m := new(StreamingOutputCallRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _TestService_HalfDuplexCall_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(TestServiceServer).HalfDuplexCall(&testServiceHalfDuplexCallServer{stream}) +} + +type TestService_HalfDuplexCallServer interface { + Send(*StreamingOutputCallResponse) error + Recv() (*StreamingOutputCallRequest, error) + grpc.ServerStream +} + +type testServiceHalfDuplexCallServer struct { + grpc.ServerStream +} + +func (x *testServiceHalfDuplexCallServer) Send(m *StreamingOutputCallResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *testServiceHalfDuplexCallServer) Recv() (*StreamingOutputCallRequest, error) { + m := new(StreamingOutputCallRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +var _TestService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "grpc.testing.TestService", + HandlerType: (*TestServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "EmptyCall", + Handler: _TestService_EmptyCall_Handler, + }, + { + MethodName: "UnaryCall", + Handler: _TestService_UnaryCall_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "StreamingOutputCall", + Handler: _TestService_StreamingOutputCall_Handler, + ServerStreams: true, + }, + { + StreamName: "StreamingInputCall", + Handler: _TestService_StreamingInputCall_Handler, + ClientStreams: true, + }, + { + StreamName: "FullDuplexCall", + Handler: _TestService_FullDuplexCall_Handler, + ServerStreams: true, + ClientStreams: true, + }, + { + StreamName: "HalfDuplexCall", + Handler: _TestService_HalfDuplexCall_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "grpc_testing/test.proto", +} + +// Client API for UnimplementedService service + +type UnimplementedServiceClient interface { + // A call that no server should implement + UnimplementedCall(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) +} + +type unimplementedServiceClient struct { + cc *grpc.ClientConn +} + +func NewUnimplementedServiceClient(cc *grpc.ClientConn) UnimplementedServiceClient { + return &unimplementedServiceClient{cc} +} + +func (c *unimplementedServiceClient) UnimplementedCall(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) { + out := new(Empty) + err := grpc.Invoke(ctx, "/grpc.testing.UnimplementedService/UnimplementedCall", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for UnimplementedService service + +type UnimplementedServiceServer interface { + // A call that no server should implement + UnimplementedCall(context.Context, *Empty) (*Empty, error) +} + +func RegisterUnimplementedServiceServer(s *grpc.Server, srv UnimplementedServiceServer) { + s.RegisterService(&_UnimplementedService_serviceDesc, srv) +} + +func _UnimplementedService_UnimplementedCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UnimplementedServiceServer).UnimplementedCall(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.testing.UnimplementedService/UnimplementedCall", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UnimplementedServiceServer).UnimplementedCall(ctx, req.(*Empty)) + } + return interceptor(ctx, in, info, handler) +} + +var _UnimplementedService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "grpc.testing.UnimplementedService", + HandlerType: (*UnimplementedServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UnimplementedCall", + Handler: _UnimplementedService_UnimplementedCall_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "grpc_testing/test.proto", +} + +func init() { proto.RegisterFile("grpc_testing/test.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 664 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0xdd, 0x6e, 0xd3, 0x4c, + 0x10, 0xfd, 0x9c, 0x26, 0x4d, 0x3b, 0x49, 0xfd, 0x85, 0x2d, 0x55, 0xdd, 0x14, 0x89, 0xc8, 0x5c, + 0x60, 0x90, 0x48, 0x51, 0x10, 0x5c, 0x20, 0x01, 0x2a, 0x6d, 0x2a, 0x2a, 0xb5, 0x4d, 0xb1, 0x9b, + 0xeb, 0x68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x73, 0x62, 0x72, 0x95, 0x21, 0xae, 0x52, 0x0f, 0x62, 0xd7, 0xdd, 0x8f, + 0x43, 0x17, 0x3f, 0xff, 0x35, 0x4d, 0x86, 0x22, 0x55, 0xa9, 0x1f, 0xa8, 0x7b, 0xf1, 0x0f, 0xae, + 0xea, 0xf4, 0xe1, 0x7e, 0xdf, 0x97, 0x1b, 0xf4, 0xd0, 0xe7, 0x38, 0xca, 0x5c, 0xf4, 0x06, 0xee, + 0xcd, 0xe0, 0x8b, 0xb9, 0xe9, 0x7c, 0x59, 0xfe, 0x39, 0xbf, 0xf8, 0x11, 0x00, 0x00, 0xff, 0xff, + 0x87, 0xd4, 0xf3, 0x98, 0xb7, 0x07, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/grpc/interop/grpc_testing/test.proto b/vendor/google.golang.org/grpc/interop/grpc_testing/test.proto new file mode 100644 index 0000000000..f9f303dbb9 --- /dev/null +++ b/vendor/google.golang.org/grpc/interop/grpc_testing/test.proto @@ -0,0 +1,174 @@ +// Copyright 2017 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. + +// An integration test service that covers all the method signature permutations +// of unary/streaming requests/responses. +syntax = "proto3"; + +package grpc.testing; + +message Empty {} + +// The type of payload that should be returned. +enum PayloadType { + // Compressable text format. + COMPRESSABLE = 0; + + // Uncompressable binary format. + UNCOMPRESSABLE = 1; + + // Randomly chosen from all other formats defined in this enum. + RANDOM = 2; +} + +// A block of data, to simply increase gRPC message size. +message Payload { + // The type of data in body. + PayloadType type = 1; + // Primary contents of payload. + bytes body = 2; +} + +// A protobuf representation for grpc status. This is used by test +// clients to specify a status that the server should attempt to return. +message EchoStatus { + int32 code = 1; + string message = 2; +} + +// Unary request. +message SimpleRequest { + // Desired payload type in the response from the server. + // If response_type is RANDOM, server randomly chooses one from other formats. + PayloadType response_type = 1; + + // Desired payload size in the response from the server. + // If response_type is COMPRESSABLE, this denotes the size before compression. + int32 response_size = 2; + + // Optional input payload sent along with the request. + Payload payload = 3; + + // Whether SimpleResponse should include username. + bool fill_username = 4; + + // Whether SimpleResponse should include OAuth scope. + bool fill_oauth_scope = 5; + + // Whether server should return a given status + EchoStatus response_status = 7; +} + +// Unary response, as configured by the request. +message SimpleResponse { + // Payload to increase message size. + Payload payload = 1; + + // The user the request came from, for verifying authentication was + // successful when the client expected it. + string username = 2; + + // OAuth scope. + string oauth_scope = 3; +} + +// Client-streaming request. +message StreamingInputCallRequest { + // Optional input payload sent along with the request. + Payload payload = 1; + + // Not expecting any payload from the response. +} + +// Client-streaming response. +message StreamingInputCallResponse { + // Aggregated size of payloads received from the client. + int32 aggregated_payload_size = 1; +} + +// Configuration for a particular response. +message ResponseParameters { + // Desired payload sizes in responses from the server. + // If response_type is COMPRESSABLE, this denotes the size before compression. + int32 size = 1; + + // Desired interval between consecutive responses in the response stream in + // microseconds. + int32 interval_us = 2; +} + +// Server-streaming request. +message StreamingOutputCallRequest { + // Desired payload type in the response from the server. + // If response_type is RANDOM, the payload from each response in the stream + // might be of different types. This is to simulate a mixed type of payload + // stream. + PayloadType response_type = 1; + + // Configuration for each expected response message. + repeated ResponseParameters response_parameters = 2; + + // Optional input payload sent along with the request. + Payload payload = 3; + + // Whether server should return a given status + EchoStatus response_status = 7; +} + +// Server-streaming response, as configured by the request and parameters. +message StreamingOutputCallResponse { + // Payload to increase response size. + Payload payload = 1; +} + +// A simple service to test the various types of RPCs and experiment with +// performance with various types of payload. +service TestService { + // One empty request followed by one empty response. + rpc EmptyCall(Empty) returns (Empty); + + // One request followed by one response. + // The server returns the client payload as-is. + rpc UnaryCall(SimpleRequest) returns (SimpleResponse); + + // One request followed by a sequence of responses (streamed download). + // The server returns the payload with client desired type and sizes. + rpc StreamingOutputCall(StreamingOutputCallRequest) + returns (stream StreamingOutputCallResponse); + + // A sequence of requests followed by one response (streamed upload). + // The server returns the aggregated size of client payload as the result. + rpc StreamingInputCall(stream StreamingInputCallRequest) + returns (StreamingInputCallResponse); + + // A sequence of requests with each request served by the server immediately. + // As one request could lead to multiple responses, this interface + // demonstrates the idea of full duplexing. + rpc FullDuplexCall(stream StreamingOutputCallRequest) + returns (stream StreamingOutputCallResponse); + + // A sequence of requests followed by a sequence of responses. + // The server buffers all the client requests and then serves them in order. A + // stream of responses are returned to the client when the server starts with + // first request. + rpc HalfDuplexCall(stream StreamingOutputCallRequest) + returns (stream StreamingOutputCallResponse); +} + +// A simple service NOT implemented at servers so clients can test for +// that case. +service UnimplementedService { + // A call that no server should implement + rpc UnimplementedCall(grpc.testing.Empty) returns (grpc.testing.Empty); +} diff --git a/vendor/google.golang.org/grpc/interop/http2/negative_http2_client.go b/vendor/google.golang.org/grpc/interop/http2/negative_http2_client.go new file mode 100644 index 0000000000..8f94edd4ae --- /dev/null +++ b/vendor/google.golang.org/grpc/interop/http2/negative_http2_client.go @@ -0,0 +1,158 @@ +/* + * + * Copyright 2016 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. + * + * + * Client used to test http2 error edge cases like GOAWAYs and RST_STREAMs + * + * Documentation: + * https://github.com/grpc/grpc/blob/master/doc/negative-http2-interop-test-descriptions.md + */ + +package main + +import ( + "flag" + "net" + "strconv" + "sync" + "time" + + "golang.org/x/net/context" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/interop" + testpb "google.golang.org/grpc/interop/grpc_testing" +) + +var ( + serverHost = flag.String("server_host", "127.0.0.1", "The server host name") + serverPort = flag.Int("server_port", 8080, "The server port number") + testCase = flag.String("test_case", "goaway", + `Configure different test cases. Valid options are: + goaway : client sends two requests, the server will send a goaway in between; + rst_after_header : server will send rst_stream after it sends headers; + rst_during_data : server will send rst_stream while sending data; + rst_after_data : server will send rst_stream after sending data; + ping : server will send pings between each http2 frame; + max_streams : server will ensure that the max_concurrent_streams limit is upheld;`) + largeReqSize = 271828 + largeRespSize = 314159 +) + +func largeSimpleRequest() *testpb.SimpleRequest { + pl := interop.ClientNewPayload(testpb.PayloadType_COMPRESSABLE, largeReqSize) + return &testpb.SimpleRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseSize: int32(largeRespSize), + Payload: pl, + } +} + +// sends two unary calls. The server asserts that the calls use different connections. +func goaway(tc testpb.TestServiceClient) { + interop.DoLargeUnaryCall(tc) + // sleep to ensure that the client has time to recv the GOAWAY. + // TODO(ncteisen): make this less hacky. + time.Sleep(1 * time.Second) + interop.DoLargeUnaryCall(tc) +} + +func rstAfterHeader(tc testpb.TestServiceClient) { + req := largeSimpleRequest() + reply, err := tc.UnaryCall(context.Background(), req) + if reply != nil { + grpclog.Fatalf("Client received reply despite server sending rst stream after header") + } + if grpc.Code(err) != codes.Internal { + grpclog.Fatalf("%v.UnaryCall() = _, %v, want _, %v", tc, grpc.Code(err), codes.Internal) + } +} + +func rstDuringData(tc testpb.TestServiceClient) { + req := largeSimpleRequest() + reply, err := tc.UnaryCall(context.Background(), req) + if reply != nil { + grpclog.Fatalf("Client received reply despite server sending rst stream during data") + } + if grpc.Code(err) != codes.Unknown { + grpclog.Fatalf("%v.UnaryCall() = _, %v, want _, %v", tc, grpc.Code(err), codes.Unknown) + } +} + +func rstAfterData(tc testpb.TestServiceClient) { + req := largeSimpleRequest() + reply, err := tc.UnaryCall(context.Background(), req) + if reply != nil { + grpclog.Fatalf("Client received reply despite server sending rst stream after data") + } + if grpc.Code(err) != codes.Internal { + grpclog.Fatalf("%v.UnaryCall() = _, %v, want _, %v", tc, grpc.Code(err), codes.Internal) + } +} + +func ping(tc testpb.TestServiceClient) { + // The server will assert that every ping it sends was ACK-ed by the client. + interop.DoLargeUnaryCall(tc) +} + +func maxStreams(tc testpb.TestServiceClient) { + interop.DoLargeUnaryCall(tc) + var wg sync.WaitGroup + for i := 0; i < 15; i++ { + wg.Add(1) + go func() { + defer wg.Done() + interop.DoLargeUnaryCall(tc) + }() + } + wg.Wait() +} + +func main() { + flag.Parse() + serverAddr := net.JoinHostPort(*serverHost, strconv.Itoa(*serverPort)) + var opts []grpc.DialOption + opts = append(opts, grpc.WithInsecure()) + conn, err := grpc.Dial(serverAddr, opts...) + if err != nil { + grpclog.Fatalf("Fail to dial: %v", err) + } + defer conn.Close() + tc := testpb.NewTestServiceClient(conn) + switch *testCase { + case "goaway": + goaway(tc) + grpclog.Println("goaway done") + case "rst_after_header": + rstAfterHeader(tc) + grpclog.Println("rst_after_header done") + case "rst_during_data": + rstDuringData(tc) + grpclog.Println("rst_during_data done") + case "rst_after_data": + rstAfterData(tc) + grpclog.Println("rst_after_data done") + case "ping": + ping(tc) + grpclog.Println("ping done") + case "max_streams": + maxStreams(tc) + grpclog.Println("max_streams done") + default: + grpclog.Fatal("Unsupported test case: ", *testCase) + } +} diff --git a/vendor/google.golang.org/grpc/interop/server/server.go b/vendor/google.golang.org/grpc/interop/server/server.go new file mode 100644 index 0000000000..b833c76f68 --- /dev/null +++ b/vendor/google.golang.org/grpc/interop/server/server.go @@ -0,0 +1,65 @@ +/* + * + * Copyright 2014 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. + * + */ + +package main + +import ( + "flag" + "net" + "strconv" + + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/interop" + testpb "google.golang.org/grpc/interop/grpc_testing" + "google.golang.org/grpc/testdata" +) + +var ( + useTLS = flag.Bool("use_tls", false, "Connection uses TLS if true, else plain TCP") + certFile = flag.String("tls_cert_file", "", "The TLS cert file") + keyFile = flag.String("tls_key_file", "", "The TLS key file") + port = flag.Int("port", 10000, "The server port") +) + +func main() { + flag.Parse() + p := strconv.Itoa(*port) + lis, err := net.Listen("tcp", ":"+p) + if err != nil { + grpclog.Fatalf("failed to listen: %v", err) + } + var opts []grpc.ServerOption + if *useTLS { + if *certFile == "" { + *certFile = testdata.Path("server1.pem") + } + if *keyFile == "" { + *keyFile = testdata.Path("server1.key") + } + creds, err := credentials.NewServerTLSFromFile(*certFile, *keyFile) + if err != nil { + grpclog.Fatalf("Failed to generate credentials %v", err) + } + opts = []grpc.ServerOption{grpc.Creds(creds)} + } + server := grpc.NewServer(opts...) + testpb.RegisterTestServiceServer(server, interop.NewTestServer()) + server.Serve(lis) +} diff --git a/vendor/google.golang.org/grpc/interop/test_utils.go b/vendor/google.golang.org/grpc/interop/test_utils.go new file mode 100644 index 0000000000..b1534b3fc6 --- /dev/null +++ b/vendor/google.golang.org/grpc/interop/test_utils.go @@ -0,0 +1,747 @@ +/* + * + * Copyright 2014 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. + * + */ + +//go:generate protoc --go_out=plugins=grpc:. grpc_testing/test.proto + +package interop + +import ( + "fmt" + "io" + "io/ioutil" + "strings" + "time" + + "github.com/golang/protobuf/proto" + "golang.org/x/net/context" + "golang.org/x/oauth2" + "golang.org/x/oauth2/google" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + testpb "google.golang.org/grpc/interop/grpc_testing" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +var ( + reqSizes = []int{27182, 8, 1828, 45904} + respSizes = []int{31415, 9, 2653, 58979} + largeReqSize = 271828 + largeRespSize = 314159 + initialMetadataKey = "x-grpc-test-echo-initial" + trailingMetadataKey = "x-grpc-test-echo-trailing-bin" +) + +// ClientNewPayload returns a payload of the given type and size. +func ClientNewPayload(t testpb.PayloadType, size int) *testpb.Payload { + if size < 0 { + grpclog.Fatalf("Requested a response with invalid length %d", size) + } + body := make([]byte, size) + switch t { + case testpb.PayloadType_COMPRESSABLE: + case testpb.PayloadType_UNCOMPRESSABLE: + grpclog.Fatalf("PayloadType UNCOMPRESSABLE is not supported") + default: + grpclog.Fatalf("Unsupported payload type: %d", t) + } + return &testpb.Payload{ + Type: t, + Body: body, + } +} + +// DoEmptyUnaryCall performs a unary RPC with empty request and response messages. +func DoEmptyUnaryCall(tc testpb.TestServiceClient, args ...grpc.CallOption) { + reply, err := tc.EmptyCall(context.Background(), &testpb.Empty{}, args...) + if err != nil { + grpclog.Fatal("/TestService/EmptyCall RPC failed: ", err) + } + if !proto.Equal(&testpb.Empty{}, reply) { + grpclog.Fatalf("/TestService/EmptyCall receives %v, want %v", reply, testpb.Empty{}) + } +} + +// DoLargeUnaryCall performs a unary RPC with large payload in the request and response. +func DoLargeUnaryCall(tc testpb.TestServiceClient, args ...grpc.CallOption) { + pl := ClientNewPayload(testpb.PayloadType_COMPRESSABLE, largeReqSize) + req := &testpb.SimpleRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseSize: int32(largeRespSize), + Payload: pl, + } + reply, err := tc.UnaryCall(context.Background(), req, args...) + if err != nil { + grpclog.Fatal("/TestService/UnaryCall RPC failed: ", err) + } + t := reply.GetPayload().GetType() + s := len(reply.GetPayload().GetBody()) + if t != testpb.PayloadType_COMPRESSABLE || s != largeRespSize { + grpclog.Fatalf("Got the reply with type %d len %d; want %d, %d", t, s, testpb.PayloadType_COMPRESSABLE, largeRespSize) + } +} + +// DoClientStreaming performs a client streaming RPC. +func DoClientStreaming(tc testpb.TestServiceClient, args ...grpc.CallOption) { + stream, err := tc.StreamingInputCall(context.Background(), args...) + if err != nil { + grpclog.Fatalf("%v.StreamingInputCall(_) = _, %v", tc, err) + } + var sum int + for _, s := range reqSizes { + pl := ClientNewPayload(testpb.PayloadType_COMPRESSABLE, s) + req := &testpb.StreamingInputCallRequest{ + Payload: pl, + } + if err := stream.Send(req); err != nil { + grpclog.Fatalf("%v has error %v while sending %v", stream, err, req) + } + sum += s + } + reply, err := stream.CloseAndRecv() + if err != nil { + grpclog.Fatalf("%v.CloseAndRecv() got error %v, want %v", stream, err, nil) + } + if reply.GetAggregatedPayloadSize() != int32(sum) { + grpclog.Fatalf("%v.CloseAndRecv().GetAggregatePayloadSize() = %v; want %v", stream, reply.GetAggregatedPayloadSize(), sum) + } +} + +// DoServerStreaming performs a server streaming RPC. +func DoServerStreaming(tc testpb.TestServiceClient, args ...grpc.CallOption) { + respParam := make([]*testpb.ResponseParameters, len(respSizes)) + for i, s := range respSizes { + respParam[i] = &testpb.ResponseParameters{ + Size: int32(s), + } + } + req := &testpb.StreamingOutputCallRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseParameters: respParam, + } + stream, err := tc.StreamingOutputCall(context.Background(), req, args...) + if err != nil { + grpclog.Fatalf("%v.StreamingOutputCall(_) = _, %v", tc, err) + } + var rpcStatus error + var respCnt int + var index int + for { + reply, err := stream.Recv() + if err != nil { + rpcStatus = err + break + } + t := reply.GetPayload().GetType() + if t != testpb.PayloadType_COMPRESSABLE { + grpclog.Fatalf("Got the reply of type %d, want %d", t, testpb.PayloadType_COMPRESSABLE) + } + size := len(reply.GetPayload().GetBody()) + if size != int(respSizes[index]) { + grpclog.Fatalf("Got reply body of length %d, want %d", size, respSizes[index]) + } + index++ + respCnt++ + } + if rpcStatus != io.EOF { + grpclog.Fatalf("Failed to finish the server streaming rpc: %v", rpcStatus) + } + if respCnt != len(respSizes) { + grpclog.Fatalf("Got %d reply, want %d", len(respSizes), respCnt) + } +} + +// DoPingPong performs ping-pong style bi-directional streaming RPC. +func DoPingPong(tc testpb.TestServiceClient, args ...grpc.CallOption) { + stream, err := tc.FullDuplexCall(context.Background(), args...) + if err != nil { + grpclog.Fatalf("%v.FullDuplexCall(_) = _, %v", tc, err) + } + var index int + for index < len(reqSizes) { + respParam := []*testpb.ResponseParameters{ + { + Size: int32(respSizes[index]), + }, + } + pl := ClientNewPayload(testpb.PayloadType_COMPRESSABLE, reqSizes[index]) + req := &testpb.StreamingOutputCallRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseParameters: respParam, + Payload: pl, + } + if err := stream.Send(req); err != nil { + grpclog.Fatalf("%v has error %v while sending %v", stream, err, req) + } + reply, err := stream.Recv() + if err != nil { + grpclog.Fatalf("%v.Recv() = %v", stream, err) + } + t := reply.GetPayload().GetType() + if t != testpb.PayloadType_COMPRESSABLE { + grpclog.Fatalf("Got the reply of type %d, want %d", t, testpb.PayloadType_COMPRESSABLE) + } + size := len(reply.GetPayload().GetBody()) + if size != int(respSizes[index]) { + grpclog.Fatalf("Got reply body of length %d, want %d", size, respSizes[index]) + } + index++ + } + if err := stream.CloseSend(); err != nil { + grpclog.Fatalf("%v.CloseSend() got %v, want %v", stream, err, nil) + } + if _, err := stream.Recv(); err != io.EOF { + grpclog.Fatalf("%v failed to complele the ping pong test: %v", stream, err) + } +} + +// DoEmptyStream sets up a bi-directional streaming with zero message. +func DoEmptyStream(tc testpb.TestServiceClient, args ...grpc.CallOption) { + stream, err := tc.FullDuplexCall(context.Background(), args...) + if err != nil { + grpclog.Fatalf("%v.FullDuplexCall(_) = _, %v", tc, err) + } + if err := stream.CloseSend(); err != nil { + grpclog.Fatalf("%v.CloseSend() got %v, want %v", stream, err, nil) + } + if _, err := stream.Recv(); err != io.EOF { + grpclog.Fatalf("%v failed to complete the empty stream test: %v", stream, err) + } +} + +// DoTimeoutOnSleepingServer performs an RPC on a sleep server which causes RPC timeout. +func DoTimeoutOnSleepingServer(tc testpb.TestServiceClient, args ...grpc.CallOption) { + ctx, cancel := context.WithTimeout(context.Background(), 1*time.Millisecond) + defer cancel() + stream, err := tc.FullDuplexCall(ctx, args...) + if err != nil { + if grpc.Code(err) == codes.DeadlineExceeded { + return + } + grpclog.Fatalf("%v.FullDuplexCall(_) = _, %v", tc, err) + } + pl := ClientNewPayload(testpb.PayloadType_COMPRESSABLE, 27182) + req := &testpb.StreamingOutputCallRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + Payload: pl, + } + if err := stream.Send(req); err != nil { + if grpc.Code(err) != codes.DeadlineExceeded { + grpclog.Fatalf("%v.Send(_) = %v", stream, err) + } + } + if _, err := stream.Recv(); grpc.Code(err) != codes.DeadlineExceeded { + grpclog.Fatalf("%v.Recv() = _, %v, want error code %d", stream, err, codes.DeadlineExceeded) + } +} + +// DoComputeEngineCreds performs a unary RPC with compute engine auth. +func DoComputeEngineCreds(tc testpb.TestServiceClient, serviceAccount, oauthScope string) { + pl := ClientNewPayload(testpb.PayloadType_COMPRESSABLE, largeReqSize) + req := &testpb.SimpleRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseSize: int32(largeRespSize), + Payload: pl, + FillUsername: true, + FillOauthScope: true, + } + reply, err := tc.UnaryCall(context.Background(), req) + if err != nil { + grpclog.Fatal("/TestService/UnaryCall RPC failed: ", err) + } + user := reply.GetUsername() + scope := reply.GetOauthScope() + if user != serviceAccount { + grpclog.Fatalf("Got user name %q, want %q.", user, serviceAccount) + } + if !strings.Contains(oauthScope, scope) { + grpclog.Fatalf("Got OAuth scope %q which is NOT a substring of %q.", scope, oauthScope) + } +} + +func getServiceAccountJSONKey(keyFile string) []byte { + jsonKey, err := ioutil.ReadFile(keyFile) + if err != nil { + grpclog.Fatalf("Failed to read the service account key file: %v", err) + } + return jsonKey +} + +// DoServiceAccountCreds performs a unary RPC with service account auth. +func DoServiceAccountCreds(tc testpb.TestServiceClient, serviceAccountKeyFile, oauthScope string) { + pl := ClientNewPayload(testpb.PayloadType_COMPRESSABLE, largeReqSize) + req := &testpb.SimpleRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseSize: int32(largeRespSize), + Payload: pl, + FillUsername: true, + FillOauthScope: true, + } + reply, err := tc.UnaryCall(context.Background(), req) + if err != nil { + grpclog.Fatal("/TestService/UnaryCall RPC failed: ", err) + } + jsonKey := getServiceAccountJSONKey(serviceAccountKeyFile) + user := reply.GetUsername() + scope := reply.GetOauthScope() + if !strings.Contains(string(jsonKey), user) { + grpclog.Fatalf("Got user name %q which is NOT a substring of %q.", user, jsonKey) + } + if !strings.Contains(oauthScope, scope) { + grpclog.Fatalf("Got OAuth scope %q which is NOT a substring of %q.", scope, oauthScope) + } +} + +// DoJWTTokenCreds performs a unary RPC with JWT token auth. +func DoJWTTokenCreds(tc testpb.TestServiceClient, serviceAccountKeyFile string) { + pl := ClientNewPayload(testpb.PayloadType_COMPRESSABLE, largeReqSize) + req := &testpb.SimpleRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseSize: int32(largeRespSize), + Payload: pl, + FillUsername: true, + } + reply, err := tc.UnaryCall(context.Background(), req) + if err != nil { + grpclog.Fatal("/TestService/UnaryCall RPC failed: ", err) + } + jsonKey := getServiceAccountJSONKey(serviceAccountKeyFile) + user := reply.GetUsername() + if !strings.Contains(string(jsonKey), user) { + grpclog.Fatalf("Got user name %q which is NOT a substring of %q.", user, jsonKey) + } +} + +// GetToken obtains an OAUTH token from the input. +func GetToken(serviceAccountKeyFile string, oauthScope string) *oauth2.Token { + jsonKey := getServiceAccountJSONKey(serviceAccountKeyFile) + config, err := google.JWTConfigFromJSON(jsonKey, oauthScope) + if err != nil { + grpclog.Fatalf("Failed to get the config: %v", err) + } + token, err := config.TokenSource(context.Background()).Token() + if err != nil { + grpclog.Fatalf("Failed to get the token: %v", err) + } + return token +} + +// DoOauth2TokenCreds performs a unary RPC with OAUTH2 token auth. +func DoOauth2TokenCreds(tc testpb.TestServiceClient, serviceAccountKeyFile, oauthScope string) { + pl := ClientNewPayload(testpb.PayloadType_COMPRESSABLE, largeReqSize) + req := &testpb.SimpleRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseSize: int32(largeRespSize), + Payload: pl, + FillUsername: true, + FillOauthScope: true, + } + reply, err := tc.UnaryCall(context.Background(), req) + if err != nil { + grpclog.Fatal("/TestService/UnaryCall RPC failed: ", err) + } + jsonKey := getServiceAccountJSONKey(serviceAccountKeyFile) + user := reply.GetUsername() + scope := reply.GetOauthScope() + if !strings.Contains(string(jsonKey), user) { + grpclog.Fatalf("Got user name %q which is NOT a substring of %q.", user, jsonKey) + } + if !strings.Contains(oauthScope, scope) { + grpclog.Fatalf("Got OAuth scope %q which is NOT a substring of %q.", scope, oauthScope) + } +} + +// DoPerRPCCreds performs a unary RPC with per RPC OAUTH2 token. +func DoPerRPCCreds(tc testpb.TestServiceClient, serviceAccountKeyFile, oauthScope string) { + jsonKey := getServiceAccountJSONKey(serviceAccountKeyFile) + pl := ClientNewPayload(testpb.PayloadType_COMPRESSABLE, largeReqSize) + req := &testpb.SimpleRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseSize: int32(largeRespSize), + Payload: pl, + FillUsername: true, + FillOauthScope: true, + } + token := GetToken(serviceAccountKeyFile, oauthScope) + kv := map[string]string{"authorization": token.Type() + " " + token.AccessToken} + ctx := metadata.NewOutgoingContext(context.Background(), metadata.MD{"authorization": []string{kv["authorization"]}}) + reply, err := tc.UnaryCall(ctx, req) + if err != nil { + grpclog.Fatal("/TestService/UnaryCall RPC failed: ", err) + } + user := reply.GetUsername() + scope := reply.GetOauthScope() + if !strings.Contains(string(jsonKey), user) { + grpclog.Fatalf("Got user name %q which is NOT a substring of %q.", user, jsonKey) + } + if !strings.Contains(oauthScope, scope) { + grpclog.Fatalf("Got OAuth scope %q which is NOT a substring of %q.", scope, oauthScope) + } +} + +var testMetadata = metadata.MD{ + "key1": []string{"value1"}, + "key2": []string{"value2"}, +} + +// DoCancelAfterBegin cancels the RPC after metadata has been sent but before payloads are sent. +func DoCancelAfterBegin(tc testpb.TestServiceClient, args ...grpc.CallOption) { + ctx, cancel := context.WithCancel(metadata.NewOutgoingContext(context.Background(), testMetadata)) + stream, err := tc.StreamingInputCall(ctx, args...) + if err != nil { + grpclog.Fatalf("%v.StreamingInputCall(_) = _, %v", tc, err) + } + cancel() + _, err = stream.CloseAndRecv() + if grpc.Code(err) != codes.Canceled { + grpclog.Fatalf("%v.CloseAndRecv() got error code %d, want %d", stream, grpc.Code(err), codes.Canceled) + } +} + +// DoCancelAfterFirstResponse cancels the RPC after receiving the first message from the server. +func DoCancelAfterFirstResponse(tc testpb.TestServiceClient, args ...grpc.CallOption) { + ctx, cancel := context.WithCancel(context.Background()) + stream, err := tc.FullDuplexCall(ctx, args...) + if err != nil { + grpclog.Fatalf("%v.FullDuplexCall(_) = _, %v", tc, err) + } + respParam := []*testpb.ResponseParameters{ + { + Size: 31415, + }, + } + pl := ClientNewPayload(testpb.PayloadType_COMPRESSABLE, 27182) + req := &testpb.StreamingOutputCallRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseParameters: respParam, + Payload: pl, + } + if err := stream.Send(req); err != nil { + grpclog.Fatalf("%v has error %v while sending %v", stream, err, req) + } + if _, err := stream.Recv(); err != nil { + grpclog.Fatalf("%v.Recv() = %v", stream, err) + } + cancel() + if _, err := stream.Recv(); grpc.Code(err) != codes.Canceled { + grpclog.Fatalf("%v compleled with error code %d, want %d", stream, grpc.Code(err), codes.Canceled) + } +} + +var ( + initialMetadataValue = "test_initial_metadata_value" + trailingMetadataValue = "\x0a\x0b\x0a\x0b\x0a\x0b" + customMetadata = metadata.Pairs( + initialMetadataKey, initialMetadataValue, + trailingMetadataKey, trailingMetadataValue, + ) +) + +func validateMetadata(header, trailer metadata.MD) { + if len(header[initialMetadataKey]) != 1 { + grpclog.Fatalf("Expected exactly one header from server. Received %d", len(header[initialMetadataKey])) + } + if header[initialMetadataKey][0] != initialMetadataValue { + grpclog.Fatalf("Got header %s; want %s", header[initialMetadataKey][0], initialMetadataValue) + } + if len(trailer[trailingMetadataKey]) != 1 { + grpclog.Fatalf("Expected exactly one trailer from server. Received %d", len(trailer[trailingMetadataKey])) + } + if trailer[trailingMetadataKey][0] != trailingMetadataValue { + grpclog.Fatalf("Got trailer %s; want %s", trailer[trailingMetadataKey][0], trailingMetadataValue) + } +} + +// DoCustomMetadata checks that metadata is echoed back to the client. +func DoCustomMetadata(tc testpb.TestServiceClient, args ...grpc.CallOption) { + // Testing with UnaryCall. + pl := ClientNewPayload(testpb.PayloadType_COMPRESSABLE, 1) + req := &testpb.SimpleRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseSize: int32(1), + Payload: pl, + } + ctx := metadata.NewOutgoingContext(context.Background(), customMetadata) + var header, trailer metadata.MD + args = append(args, grpc.Header(&header), grpc.Trailer(&trailer)) + reply, err := tc.UnaryCall( + ctx, + req, + args..., + ) + if err != nil { + grpclog.Fatal("/TestService/UnaryCall RPC failed: ", err) + } + t := reply.GetPayload().GetType() + s := len(reply.GetPayload().GetBody()) + if t != testpb.PayloadType_COMPRESSABLE || s != 1 { + grpclog.Fatalf("Got the reply with type %d len %d; want %d, %d", t, s, testpb.PayloadType_COMPRESSABLE, 1) + } + validateMetadata(header, trailer) + + // Testing with FullDuplex. + stream, err := tc.FullDuplexCall(ctx, args...) + if err != nil { + grpclog.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) + } + respParam := []*testpb.ResponseParameters{ + { + Size: 1, + }, + } + streamReq := &testpb.StreamingOutputCallRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseParameters: respParam, + Payload: pl, + } + if err := stream.Send(streamReq); err != nil { + grpclog.Fatalf("%v has error %v while sending %v", stream, err, streamReq) + } + streamHeader, err := stream.Header() + if err != nil { + grpclog.Fatalf("%v.Header() = %v", stream, err) + } + if _, err := stream.Recv(); err != nil { + grpclog.Fatalf("%v.Recv() = %v", stream, err) + } + if err := stream.CloseSend(); err != nil { + grpclog.Fatalf("%v.CloseSend() = %v, want ", stream, err) + } + if _, err := stream.Recv(); err != io.EOF { + grpclog.Fatalf("%v failed to complete the custom metadata test: %v", stream, err) + } + streamTrailer := stream.Trailer() + validateMetadata(streamHeader, streamTrailer) +} + +// DoStatusCodeAndMessage checks that the status code is propagated back to the client. +func DoStatusCodeAndMessage(tc testpb.TestServiceClient, args ...grpc.CallOption) { + var code int32 = 2 + msg := "test status message" + expectedErr := status.Error(codes.Code(code), msg) + respStatus := &testpb.EchoStatus{ + Code: code, + Message: msg, + } + // Test UnaryCall. + req := &testpb.SimpleRequest{ + ResponseStatus: respStatus, + } + if _, err := tc.UnaryCall(context.Background(), req, args...); err == nil || err.Error() != expectedErr.Error() { + grpclog.Fatalf("%v.UnaryCall(_, %v) = _, %v, want _, %v", tc, req, err, expectedErr) + } + // Test FullDuplexCall. + stream, err := tc.FullDuplexCall(context.Background(), args...) + if err != nil { + grpclog.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) + } + streamReq := &testpb.StreamingOutputCallRequest{ + ResponseStatus: respStatus, + } + if err := stream.Send(streamReq); err != nil { + grpclog.Fatalf("%v has error %v while sending %v, want ", stream, err, streamReq) + } + if err := stream.CloseSend(); err != nil { + grpclog.Fatalf("%v.CloseSend() = %v, want ", stream, err) + } + if _, err = stream.Recv(); err.Error() != expectedErr.Error() { + grpclog.Fatalf("%v.Recv() returned error %v, want %v", stream, err, expectedErr) + } +} + +// DoUnimplementedService attempts to call a method from an unimplemented service. +func DoUnimplementedService(tc testpb.UnimplementedServiceClient) { + _, err := tc.UnimplementedCall(context.Background(), &testpb.Empty{}) + if grpc.Code(err) != codes.Unimplemented { + grpclog.Fatalf("%v.UnimplementedCall() = _, %v, want _, %v", tc, grpc.Code(err), codes.Unimplemented) + } +} + +// DoUnimplementedMethod attempts to call an unimplemented method. +func DoUnimplementedMethod(cc *grpc.ClientConn) { + var req, reply proto.Message + if err := grpc.Invoke(context.Background(), "/grpc.testing.TestService/UnimplementedCall", req, reply, cc); err == nil || grpc.Code(err) != codes.Unimplemented { + grpclog.Fatalf("grpc.Invoke(_, _, _, _, _) = %v, want error code %s", err, codes.Unimplemented) + } +} + +type testServer struct { +} + +// NewTestServer creates a test server for test service. +func NewTestServer() testpb.TestServiceServer { + return &testServer{} +} + +func (s *testServer) EmptyCall(ctx context.Context, in *testpb.Empty) (*testpb.Empty, error) { + return new(testpb.Empty), nil +} + +func serverNewPayload(t testpb.PayloadType, size int32) (*testpb.Payload, error) { + if size < 0 { + return nil, fmt.Errorf("requested a response with invalid length %d", size) + } + body := make([]byte, size) + switch t { + case testpb.PayloadType_COMPRESSABLE: + case testpb.PayloadType_UNCOMPRESSABLE: + return nil, fmt.Errorf("payloadType UNCOMPRESSABLE is not supported") + default: + return nil, fmt.Errorf("unsupported payload type: %d", t) + } + return &testpb.Payload{ + Type: t, + Body: body, + }, nil +} + +func (s *testServer) UnaryCall(ctx context.Context, in *testpb.SimpleRequest) (*testpb.SimpleResponse, error) { + st := in.GetResponseStatus() + if md, ok := metadata.FromIncomingContext(ctx); ok { + if initialMetadata, ok := md[initialMetadataKey]; ok { + header := metadata.Pairs(initialMetadataKey, initialMetadata[0]) + grpc.SendHeader(ctx, header) + } + if trailingMetadata, ok := md[trailingMetadataKey]; ok { + trailer := metadata.Pairs(trailingMetadataKey, trailingMetadata[0]) + grpc.SetTrailer(ctx, trailer) + } + } + if st != nil && st.Code != 0 { + return nil, status.Error(codes.Code(st.Code), st.Message) + } + pl, err := serverNewPayload(in.GetResponseType(), in.GetResponseSize()) + if err != nil { + return nil, err + } + return &testpb.SimpleResponse{ + Payload: pl, + }, nil +} + +func (s *testServer) StreamingOutputCall(args *testpb.StreamingOutputCallRequest, stream testpb.TestService_StreamingOutputCallServer) error { + cs := args.GetResponseParameters() + for _, c := range cs { + if us := c.GetIntervalUs(); us > 0 { + time.Sleep(time.Duration(us) * time.Microsecond) + } + pl, err := serverNewPayload(args.GetResponseType(), c.GetSize()) + if err != nil { + return err + } + if err := stream.Send(&testpb.StreamingOutputCallResponse{ + Payload: pl, + }); err != nil { + return err + } + } + return nil +} + +func (s *testServer) StreamingInputCall(stream testpb.TestService_StreamingInputCallServer) error { + var sum int + for { + in, err := stream.Recv() + if err == io.EOF { + return stream.SendAndClose(&testpb.StreamingInputCallResponse{ + AggregatedPayloadSize: int32(sum), + }) + } + if err != nil { + return err + } + p := in.GetPayload().GetBody() + sum += len(p) + } +} + +func (s *testServer) FullDuplexCall(stream testpb.TestService_FullDuplexCallServer) error { + if md, ok := metadata.FromIncomingContext(stream.Context()); ok { + if initialMetadata, ok := md[initialMetadataKey]; ok { + header := metadata.Pairs(initialMetadataKey, initialMetadata[0]) + stream.SendHeader(header) + } + if trailingMetadata, ok := md[trailingMetadataKey]; ok { + trailer := metadata.Pairs(trailingMetadataKey, trailingMetadata[0]) + stream.SetTrailer(trailer) + } + } + for { + in, err := stream.Recv() + if err == io.EOF { + // read done. + return nil + } + if err != nil { + return err + } + st := in.GetResponseStatus() + if st != nil && st.Code != 0 { + return status.Error(codes.Code(st.Code), st.Message) + } + cs := in.GetResponseParameters() + for _, c := range cs { + if us := c.GetIntervalUs(); us > 0 { + time.Sleep(time.Duration(us) * time.Microsecond) + } + pl, err := serverNewPayload(in.GetResponseType(), c.GetSize()) + if err != nil { + return err + } + if err := stream.Send(&testpb.StreamingOutputCallResponse{ + Payload: pl, + }); err != nil { + return err + } + } + } +} + +func (s *testServer) HalfDuplexCall(stream testpb.TestService_HalfDuplexCallServer) error { + var msgBuf []*testpb.StreamingOutputCallRequest + for { + in, err := stream.Recv() + if err == io.EOF { + // read done. + break + } + if err != nil { + return err + } + msgBuf = append(msgBuf, in) + } + for _, m := range msgBuf { + cs := m.GetResponseParameters() + for _, c := range cs { + if us := c.GetIntervalUs(); us > 0 { + time.Sleep(time.Duration(us) * time.Microsecond) + } + pl, err := serverNewPayload(m.GetResponseType(), c.GetSize()) + if err != nil { + return err + } + if err := stream.Send(&testpb.StreamingOutputCallResponse{ + Payload: pl, + }); err != nil { + return err + } + } + } + return nil +} diff --git a/vendor/google.golang.org/grpc/keepalive/keepalive.go b/vendor/google.golang.org/grpc/keepalive/keepalive.go new file mode 100644 index 0000000000..f8adc7e6d4 --- /dev/null +++ b/vendor/google.golang.org/grpc/keepalive/keepalive.go @@ -0,0 +1,65 @@ +/* + * + * Copyright 2017 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. + * + */ + +// Package keepalive defines configurable parameters for point-to-point healthcheck. +package keepalive + +import ( + "time" +) + +// ClientParameters is used to set keepalive parameters on the client-side. +// These configure how the client will actively probe to notice when a connection is broken +// and send pings so intermediaries will be aware of the liveness of the connection. +// Make sure these parameters are set in coordination with the keepalive policy on the server, +// as incompatible settings can result in closing of connection. +type ClientParameters struct { + // After a duration of this time if the client doesn't see any activity it pings the server to see if the transport is still alive. + Time time.Duration // The current default value is infinity. + // After having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that + // the connection is closed. + Timeout time.Duration // The current default value is 20 seconds. + // If true, client runs keepalive checks even with no active RPCs. + PermitWithoutStream bool // false by default. +} + +// ServerParameters is used to set keepalive and max-age parameters on the server-side. +type ServerParameters struct { + // MaxConnectionIdle is a duration for the amount of time after which an idle connection would be closed by sending a GoAway. + // Idleness duration is defined since the most recent time the number of outstanding RPCs became zero or the connection establishment. + MaxConnectionIdle time.Duration // The current default value is infinity. + // MaxConnectionAge is a duration for the maximum amount of time a connection may exist before it will be closed by sending a GoAway. + // A random jitter of +/-10% will be added to MaxConnectionAge to spread out connection storms. + MaxConnectionAge time.Duration // The current default value is infinity. + // MaxConnectinoAgeGrace is an additive period after MaxConnectionAge after which the connection will be forcibly closed. + MaxConnectionAgeGrace time.Duration // The current default value is infinity. + // After a duration of this time if the server doesn't see any activity it pings the client to see if the transport is still alive. + Time time.Duration // The current default value is 2 hours. + // After having pinged for keepalive check, the server waits for a duration of Timeout and if no activity is seen even after that + // the connection is closed. + Timeout time.Duration // The current default value is 20 seconds. +} + +// EnforcementPolicy is used to set keepalive enforcement policy on the server-side. +// Server will close connection with a client that violates this policy. +type EnforcementPolicy struct { + // MinTime is the minimum amount of time a client should wait before sending a keepalive ping. + MinTime time.Duration // The current default value is 5 minutes. + // If true, server expects keepalive pings even when there are no active streams(RPCs). + PermitWithoutStream bool // false by default. +} diff --git a/vendor/google.golang.org/grpc/metadata/metadata.go b/vendor/google.golang.org/grpc/metadata/metadata.go new file mode 100644 index 0000000000..ccfea5d453 --- /dev/null +++ b/vendor/google.golang.org/grpc/metadata/metadata.go @@ -0,0 +1,137 @@ +/* + * + * Copyright 2014 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. + * + */ + +// Package metadata define the structure of the metadata supported by gRPC library. +// Please refer to https://grpc.io/docs/guides/wire.html for more information about custom-metadata. +package metadata // import "google.golang.org/grpc/metadata" + +import ( + "fmt" + "strings" + + "golang.org/x/net/context" +) + +// DecodeKeyValue returns k, v, nil. It is deprecated and should not be used. +func DecodeKeyValue(k, v string) (string, string, error) { + return k, v, nil +} + +// MD is a mapping from metadata keys to values. Users should use the following +// two convenience functions New and Pairs to generate MD. +type MD map[string][]string + +// New creates an MD from a given key-value map. +// +// Only the following ASCII characters are allowed in keys: +// - digits: 0-9 +// - uppercase letters: A-Z (normalized to lower) +// - lowercase letters: a-z +// - special characters: -_. +// Uppercase letters are automatically converted to lowercase. +// +// Keys beginning with "grpc-" are reserved for grpc-internal use only and may +// result in errors if set in metadata. +func New(m map[string]string) MD { + md := MD{} + for k, val := range m { + key := strings.ToLower(k) + md[key] = append(md[key], val) + } + return md +} + +// Pairs returns an MD formed by the mapping of key, value ... +// Pairs panics if len(kv) is odd. +// +// Only the following ASCII characters are allowed in keys: +// - digits: 0-9 +// - uppercase letters: A-Z (normalized to lower) +// - lowercase letters: a-z +// - special characters: -_. +// Uppercase letters are automatically converted to lowercase. +// +// Keys beginning with "grpc-" are reserved for grpc-internal use only and may +// result in errors if set in metadata. +func Pairs(kv ...string) MD { + if len(kv)%2 == 1 { + panic(fmt.Sprintf("metadata: Pairs got the odd number of input pairs for metadata: %d", len(kv))) + } + md := MD{} + var key string + for i, s := range kv { + if i%2 == 0 { + key = strings.ToLower(s) + continue + } + md[key] = append(md[key], s) + } + return md +} + +// Len returns the number of items in md. +func (md MD) Len() int { + return len(md) +} + +// Copy returns a copy of md. +func (md MD) Copy() MD { + return Join(md) +} + +// Join joins any number of mds into a single MD. +// The order of values for each key is determined by the order in which +// the mds containing those values are presented to Join. +func Join(mds ...MD) MD { + out := MD{} + for _, md := range mds { + for k, v := range md { + out[k] = append(out[k], v...) + } + } + return out +} + +type mdIncomingKey struct{} +type mdOutgoingKey struct{} + +// NewIncomingContext creates a new context with incoming md attached. +func NewIncomingContext(ctx context.Context, md MD) context.Context { + return context.WithValue(ctx, mdIncomingKey{}, md) +} + +// NewOutgoingContext creates a new context with outgoing md attached. +func NewOutgoingContext(ctx context.Context, md MD) context.Context { + return context.WithValue(ctx, mdOutgoingKey{}, md) +} + +// FromIncomingContext returns the incoming metadata in ctx if it exists. The +// returned MD should not be modified. Writing to it may cause races. +// Modification should be made to copies of the returned MD. +func FromIncomingContext(ctx context.Context) (md MD, ok bool) { + md, ok = ctx.Value(mdIncomingKey{}).(MD) + return +} + +// FromOutgoingContext returns the outgoing metadata in ctx if it exists. The +// returned MD should not be modified. Writing to it may cause races. +// Modification should be made to the copies of the returned MD. +func FromOutgoingContext(ctx context.Context) (md MD, ok bool) { + md, ok = ctx.Value(mdOutgoingKey{}).(MD) + return +} diff --git a/vendor/google.golang.org/grpc/metadata/metadata_test.go b/vendor/google.golang.org/grpc/metadata/metadata_test.go new file mode 100644 index 0000000000..210cbb2676 --- /dev/null +++ b/vendor/google.golang.org/grpc/metadata/metadata_test.go @@ -0,0 +1,71 @@ +/* + * + * Copyright 2014 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. + * + */ + +package metadata + +import ( + "reflect" + "testing" +) + +func TestPairsMD(t *testing.T) { + for _, test := range []struct { + // input + kv []string + // output + md MD + }{ + {[]string{}, MD{}}, + {[]string{"k1", "v1", "k1", "v2"}, MD{"k1": []string{"v1", "v2"}}}, + } { + md := Pairs(test.kv...) + if !reflect.DeepEqual(md, test.md) { + t.Fatalf("Pairs(%v) = %v, want %v", test.kv, md, test.md) + } + } +} + +func TestCopy(t *testing.T) { + const key, val = "key", "val" + orig := Pairs(key, val) + copy := orig.Copy() + if !reflect.DeepEqual(orig, copy) { + t.Errorf("copied value not equal to the original, got %v, want %v", copy, orig) + } + orig[key][0] = "foo" + if v := copy[key][0]; v != val { + t.Errorf("change in original should not affect copy, got %q, want %q", v, val) + } +} + +func TestJoin(t *testing.T) { + for _, test := range []struct { + mds []MD + want MD + }{ + {[]MD{}, MD{}}, + {[]MD{Pairs("foo", "bar")}, Pairs("foo", "bar")}, + {[]MD{Pairs("foo", "bar"), Pairs("foo", "baz")}, Pairs("foo", "bar", "foo", "baz")}, + {[]MD{Pairs("foo", "bar"), Pairs("foo", "baz"), Pairs("zip", "zap")}, Pairs("foo", "bar", "foo", "baz", "zip", "zap")}, + } { + md := Join(test.mds...) + if !reflect.DeepEqual(md, test.want) { + t.Errorf("context's metadata is %v, want %v", md, test.want) + } + } +} diff --git a/vendor/google.golang.org/grpc/naming/dns_resolver.go b/vendor/google.golang.org/grpc/naming/dns_resolver.go new file mode 100644 index 0000000000..7e69a2ca0a --- /dev/null +++ b/vendor/google.golang.org/grpc/naming/dns_resolver.go @@ -0,0 +1,290 @@ +/* + * + * Copyright 2017 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. + * + */ + +package naming + +import ( + "errors" + "fmt" + "net" + "strconv" + "time" + + "golang.org/x/net/context" + "google.golang.org/grpc/grpclog" +) + +const ( + defaultPort = "443" + defaultFreq = time.Minute * 30 +) + +var ( + errMissingAddr = errors.New("missing address") + errWatcherClose = errors.New("watcher has been closed") +) + +// NewDNSResolverWithFreq creates a DNS Resolver that can resolve DNS names, and +// create watchers that poll the DNS server using the frequency set by freq. +func NewDNSResolverWithFreq(freq time.Duration) (Resolver, error) { + return &dnsResolver{freq: freq}, nil +} + +// NewDNSResolver creates a DNS Resolver that can resolve DNS names, and create +// watchers that poll the DNS server using the default frequency defined by defaultFreq. +func NewDNSResolver() (Resolver, error) { + return NewDNSResolverWithFreq(defaultFreq) +} + +// dnsResolver handles name resolution for names following the DNS scheme +type dnsResolver struct { + // frequency of polling the DNS server that the watchers created by this resolver will use. + freq time.Duration +} + +// formatIP returns ok = false if addr is not a valid textual representation of an IP address. +// If addr is an IPv4 address, return the addr and ok = true. +// If addr is an IPv6 address, return the addr enclosed in square brackets and ok = true. +func formatIP(addr string) (addrIP string, ok bool) { + ip := net.ParseIP(addr) + if ip == nil { + return "", false + } + if ip.To4() != nil { + return addr, true + } + return "[" + addr + "]", true +} + +// parseTarget takes the user input target string, returns formatted host and port info. +// If target doesn't specify a port, set the port to be the defaultPort. +// If target is in IPv6 format and host-name is enclosed in sqarue brackets, brackets +// are strippd when setting the host. +// examples: +// target: "www.google.com" returns host: "www.google.com", port: "443" +// target: "ipv4-host:80" returns host: "ipv4-host", port: "80" +// target: "[ipv6-host]" returns host: "ipv6-host", port: "443" +// target: ":80" returns host: "localhost", port: "80" +// target: ":" returns host: "localhost", port: "443" +func parseTarget(target string) (host, port string, err error) { + if target == "" { + return "", "", errMissingAddr + } + + if ip := net.ParseIP(target); ip != nil { + // target is an IPv4 or IPv6(without brackets) address + return target, defaultPort, nil + } + if host, port, err := net.SplitHostPort(target); err == nil { + // target has port, i.e ipv4-host:port, [ipv6-host]:port, host-name:port + if host == "" { + // Keep consistent with net.Dial(): If the host is empty, as in ":80", the local system is assumed. + host = "localhost" + } + if port == "" { + // If the port field is empty(target ends with colon), e.g. "[::1]:", defaultPort is used. + port = defaultPort + } + return host, port, nil + } + if host, port, err := net.SplitHostPort(target + ":" + defaultPort); err == nil { + // target doesn't have port + return host, port, nil + } + return "", "", fmt.Errorf("invalid target address %v", target) +} + +// Resolve creates a watcher that watches the name resolution of the target. +func (r *dnsResolver) Resolve(target string) (Watcher, error) { + host, port, err := parseTarget(target) + if err != nil { + return nil, err + } + + if net.ParseIP(host) != nil { + ipWatcher := &ipWatcher{ + updateChan: make(chan *Update, 1), + } + host, _ = formatIP(host) + ipWatcher.updateChan <- &Update{Op: Add, Addr: host + ":" + port} + return ipWatcher, nil + } + + ctx, cancel := context.WithCancel(context.Background()) + return &dnsWatcher{ + r: r, + host: host, + port: port, + ctx: ctx, + cancel: cancel, + t: time.NewTimer(0), + }, nil +} + +// dnsWatcher watches for the name resolution update for a specific target +type dnsWatcher struct { + r *dnsResolver + host string + port string + // The latest resolved address set + curAddrs map[string]*Update + ctx context.Context + cancel context.CancelFunc + t *time.Timer +} + +// ipWatcher watches for the name resolution update for an IP address. +type ipWatcher struct { + updateChan chan *Update +} + +// Next returns the adrress resolution Update for the target. For IP address, +// the resolution is itself, thus polling name server is unncessary. Therefore, +// Next() will return an Update the first time it is called, and will be blocked +// for all following calls as no Update exisits until watcher is closed. +func (i *ipWatcher) Next() ([]*Update, error) { + u, ok := <-i.updateChan + if !ok { + return nil, errWatcherClose + } + return []*Update{u}, nil +} + +// Close closes the ipWatcher. +func (i *ipWatcher) Close() { + close(i.updateChan) +} + +// AddressType indicates the address type returned by name resolution. +type AddressType uint8 + +const ( + // Backend indicates the server is a backend server. + Backend AddressType = iota + // GRPCLB indicates the server is a grpclb load balancer. + GRPCLB +) + +// AddrMetadataGRPCLB contains the information the name resolver for grpclb should provide. The +// name resolver used by the grpclb balancer is required to provide this type of metadata in +// its address updates. +type AddrMetadataGRPCLB struct { + // AddrType is the type of server (grpc load balancer or backend). + AddrType AddressType + // ServerName is the name of the grpc load balancer. Used for authentication. + ServerName string +} + +// compileUpdate compares the old resolved addresses and newly resolved addresses, +// and generates an update list +func (w *dnsWatcher) compileUpdate(newAddrs map[string]*Update) []*Update { + var res []*Update + for a, u := range w.curAddrs { + if _, ok := newAddrs[a]; !ok { + u.Op = Delete + res = append(res, u) + } + } + for a, u := range newAddrs { + if _, ok := w.curAddrs[a]; !ok { + res = append(res, u) + } + } + return res +} + +func (w *dnsWatcher) lookupSRV() map[string]*Update { + newAddrs := make(map[string]*Update) + _, srvs, err := lookupSRV(w.ctx, "grpclb", "tcp", w.host) + if err != nil { + grpclog.Infof("grpc: failed dns SRV record lookup due to %v.\n", err) + return nil + } + for _, s := range srvs { + lbAddrs, err := lookupHost(w.ctx, s.Target) + if err != nil { + grpclog.Warningf("grpc: failed load banlacer address dns lookup due to %v.\n", err) + continue + } + for _, a := range lbAddrs { + a, ok := formatIP(a) + if !ok { + grpclog.Errorf("grpc: failed IP parsing due to %v.\n", err) + continue + } + addr := a + ":" + strconv.Itoa(int(s.Port)) + newAddrs[addr] = &Update{Addr: addr, + Metadata: AddrMetadataGRPCLB{AddrType: GRPCLB, ServerName: s.Target}} + } + } + return newAddrs +} + +func (w *dnsWatcher) lookupHost() map[string]*Update { + newAddrs := make(map[string]*Update) + addrs, err := lookupHost(w.ctx, w.host) + if err != nil { + grpclog.Warningf("grpc: failed dns A record lookup due to %v.\n", err) + return nil + } + for _, a := range addrs { + a, ok := formatIP(a) + if !ok { + grpclog.Errorf("grpc: failed IP parsing due to %v.\n", err) + continue + } + addr := a + ":" + w.port + newAddrs[addr] = &Update{Addr: addr} + } + return newAddrs +} + +func (w *dnsWatcher) lookup() []*Update { + newAddrs := w.lookupSRV() + if newAddrs == nil { + // If failed to get any balancer address (either no corresponding SRV for the + // target, or caused by failure during resolution/parsing of the balancer target), + // return any A record info available. + newAddrs = w.lookupHost() + } + result := w.compileUpdate(newAddrs) + w.curAddrs = newAddrs + return result +} + +// Next returns the resolved address update(delta) for the target. If there's no +// change, it will sleep for 30 mins and try to resolve again after that. +func (w *dnsWatcher) Next() ([]*Update, error) { + for { + select { + case <-w.ctx.Done(): + return nil, errWatcherClose + case <-w.t.C: + } + result := w.lookup() + // Next lookup should happen after an interval defined by w.r.freq. + w.t.Reset(w.r.freq) + if len(result) > 0 { + return result, nil + } + } +} + +func (w *dnsWatcher) Close() { + w.cancel() +} diff --git a/vendor/google.golang.org/grpc/naming/dns_resolver_test.go b/vendor/google.golang.org/grpc/naming/dns_resolver_test.go new file mode 100644 index 0000000000..be1ac1aeca --- /dev/null +++ b/vendor/google.golang.org/grpc/naming/dns_resolver_test.go @@ -0,0 +1,315 @@ +/* + * + * Copyright 2017 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. + * + */ + +package naming + +import ( + "fmt" + "net" + "reflect" + "sync" + "testing" + "time" +) + +func newUpdateWithMD(op Operation, addr, lb string) *Update { + return &Update{ + Op: op, + Addr: addr, + Metadata: AddrMetadataGRPCLB{AddrType: GRPCLB, ServerName: lb}, + } +} + +func toMap(u []*Update) map[string]*Update { + m := make(map[string]*Update) + for _, v := range u { + m[v.Addr] = v + } + return m +} + +func TestCompileUpdate(t *testing.T) { + tests := []struct { + oldAddrs []string + newAddrs []string + want []*Update + }{ + { + []string{}, + []string{"1.0.0.1"}, + []*Update{{Op: Add, Addr: "1.0.0.1"}}, + }, + { + []string{"1.0.0.1"}, + []string{"1.0.0.1"}, + []*Update{}, + }, + { + []string{"1.0.0.0"}, + []string{"1.0.0.1"}, + []*Update{{Op: Delete, Addr: "1.0.0.0"}, {Op: Add, Addr: "1.0.0.1"}}, + }, + { + []string{"1.0.0.1"}, + []string{"1.0.0.0"}, + []*Update{{Op: Add, Addr: "1.0.0.0"}, {Op: Delete, Addr: "1.0.0.1"}}, + }, + { + []string{"1.0.0.1"}, + []string{"1.0.0.1", "1.0.0.2", "1.0.0.3"}, + []*Update{{Op: Add, Addr: "1.0.0.2"}, {Op: Add, Addr: "1.0.0.3"}}, + }, + { + []string{"1.0.0.1", "1.0.0.2", "1.0.0.3"}, + []string{"1.0.0.0"}, + []*Update{{Op: Add, Addr: "1.0.0.0"}, {Op: Delete, Addr: "1.0.0.1"}, {Op: Delete, Addr: "1.0.0.2"}, {Op: Delete, Addr: "1.0.0.3"}}, + }, + { + []string{"1.0.0.1", "1.0.0.3", "1.0.0.5"}, + []string{"1.0.0.2", "1.0.0.3", "1.0.0.6"}, + []*Update{{Op: Delete, Addr: "1.0.0.1"}, {Op: Add, Addr: "1.0.0.2"}, {Op: Delete, Addr: "1.0.0.5"}, {Op: Add, Addr: "1.0.0.6"}}, + }, + { + []string{"1.0.0.1", "1.0.0.1", "1.0.0.2"}, + []string{"1.0.0.1"}, + []*Update{{Op: Delete, Addr: "1.0.0.2"}}, + }, + } + + var w dnsWatcher + for _, c := range tests { + w.curAddrs = make(map[string]*Update) + newUpdates := make(map[string]*Update) + for _, a := range c.oldAddrs { + w.curAddrs[a] = &Update{Addr: a} + } + for _, a := range c.newAddrs { + newUpdates[a] = &Update{Addr: a} + } + r := w.compileUpdate(newUpdates) + if !reflect.DeepEqual(toMap(c.want), toMap(r)) { + t.Errorf("w(%+v).compileUpdate(%+v) = %+v, want %+v", c.oldAddrs, c.newAddrs, updatesToSlice(r), updatesToSlice(c.want)) + } + } +} + +func TestResolveFunc(t *testing.T) { + tests := []struct { + addr string + want error + }{ + // TODO(yuxuanli): More false cases? + {"www.google.com", nil}, + {"foo.bar:12345", nil}, + {"127.0.0.1", nil}, + {"127.0.0.1:12345", nil}, + {"[::1]:80", nil}, + {"[2001:db8:a0b:12f0::1]:21", nil}, + {":80", nil}, + {"127.0.0...1:12345", nil}, + {"[fe80::1%lo0]:80", nil}, + {"golang.org:http", nil}, + {"[2001:db8::1]:http", nil}, + {":", nil}, + {"", errMissingAddr}, + {"[2001:db8:a0b:12f0::1", fmt.Errorf("invalid target address %v", "[2001:db8:a0b:12f0::1")}, + } + + r, err := NewDNSResolver() + if err != nil { + t.Errorf("%v", err) + } + for _, v := range tests { + _, err := r.Resolve(v.addr) + if !reflect.DeepEqual(err, v.want) { + t.Errorf("Resolve(%q) = %v, want %v", v.addr, err, v.want) + } + } +} + +var hostLookupTbl = map[string][]string{ + "foo.bar.com": {"1.2.3.4", "5.6.7.8"}, + "ipv4.single.fake": {"1.2.3.4"}, + "ipv4.multi.fake": {"1.2.3.4", "5.6.7.8", "9.10.11.12"}, + "ipv6.single.fake": {"2607:f8b0:400a:801::1001"}, + "ipv6.multi.fake": {"2607:f8b0:400a:801::1001", "2607:f8b0:400a:801::1002", "2607:f8b0:400a:801::1003"}, +} + +func hostLookup(host string) ([]string, error) { + if addrs, ok := hostLookupTbl[host]; ok { + return addrs, nil + } + return nil, fmt.Errorf("failed to lookup host:%s resolution in hostLookupTbl", host) +} + +var srvLookupTbl = map[string][]*net.SRV{ + "_grpclb._tcp.srv.ipv4.single.fake": {&net.SRV{Target: "ipv4.single.fake", Port: 1234}}, + "_grpclb._tcp.srv.ipv4.multi.fake": {&net.SRV{Target: "ipv4.multi.fake", Port: 1234}}, + "_grpclb._tcp.srv.ipv6.single.fake": {&net.SRV{Target: "ipv6.single.fake", Port: 1234}}, + "_grpclb._tcp.srv.ipv6.multi.fake": {&net.SRV{Target: "ipv6.multi.fake", Port: 1234}}, +} + +func srvLookup(service, proto, name string) (string, []*net.SRV, error) { + cname := "_" + service + "._" + proto + "." + name + if srvs, ok := srvLookupTbl[cname]; ok { + return cname, srvs, nil + } + return "", nil, fmt.Errorf("failed to lookup srv record for %s in srvLookupTbl", cname) +} + +func updatesToSlice(updates []*Update) []Update { + res := make([]Update, len(updates)) + for i, u := range updates { + res[i] = *u + } + return res +} + +func testResolver(t *testing.T, freq time.Duration, slp time.Duration) { + tests := []struct { + target string + want []*Update + }{ + { + "foo.bar.com", + []*Update{{Op: Add, Addr: "1.2.3.4" + colonDefaultPort}, {Op: Add, Addr: "5.6.7.8" + colonDefaultPort}}, + }, + { + "foo.bar.com:1234", + []*Update{{Op: Add, Addr: "1.2.3.4:1234"}, {Op: Add, Addr: "5.6.7.8:1234"}}, + }, + { + "srv.ipv4.single.fake", + []*Update{newUpdateWithMD(Add, "1.2.3.4:1234", "ipv4.single.fake")}, + }, + { + "srv.ipv4.multi.fake", + []*Update{ + newUpdateWithMD(Add, "1.2.3.4:1234", "ipv4.multi.fake"), + newUpdateWithMD(Add, "5.6.7.8:1234", "ipv4.multi.fake"), + newUpdateWithMD(Add, "9.10.11.12:1234", "ipv4.multi.fake")}, + }, + { + "srv.ipv6.single.fake", + []*Update{newUpdateWithMD(Add, "[2607:f8b0:400a:801::1001]:1234", "ipv6.single.fake")}, + }, + { + "srv.ipv6.multi.fake", + []*Update{ + newUpdateWithMD(Add, "[2607:f8b0:400a:801::1001]:1234", "ipv6.multi.fake"), + newUpdateWithMD(Add, "[2607:f8b0:400a:801::1002]:1234", "ipv6.multi.fake"), + newUpdateWithMD(Add, "[2607:f8b0:400a:801::1003]:1234", "ipv6.multi.fake"), + }, + }, + } + + for _, a := range tests { + r, err := NewDNSResolverWithFreq(freq) + if err != nil { + t.Fatalf("%v\n", err) + } + w, err := r.Resolve(a.target) + if err != nil { + t.Fatalf("%v\n", err) + } + updates, err := w.Next() + if err != nil { + t.Fatalf("%v\n", err) + } + if !reflect.DeepEqual(toMap(a.want), toMap(updates)) { + t.Errorf("Resolve(%q) = %+v, want %+v\n", a.target, updatesToSlice(updates), updatesToSlice(a.want)) + } + var wg sync.WaitGroup + wg.Add(1) + go func() { + defer wg.Done() + for { + _, err := w.Next() + if err != nil { + return + } + t.Error("Execution shouldn't reach here, since w.Next() should be blocked until close happen.") + } + }() + // Sleep for sometime to let watcher do more than one lookup + time.Sleep(slp) + w.Close() + wg.Wait() + } +} + +func TestResolve(t *testing.T) { + defer replaceNetFunc()() + testResolver(t, time.Millisecond*5, time.Millisecond*10) +} + +const colonDefaultPort = ":" + defaultPort + +func TestIPWatcher(t *testing.T) { + tests := []struct { + target string + want []*Update + }{ + {"127.0.0.1", []*Update{{Op: Add, Addr: "127.0.0.1" + colonDefaultPort}}}, + {"127.0.0.1:12345", []*Update{{Op: Add, Addr: "127.0.0.1:12345"}}}, + {"::1", []*Update{{Op: Add, Addr: "[::1]" + colonDefaultPort}}}, + {"[::1]:12345", []*Update{{Op: Add, Addr: "[::1]:12345"}}}, + {"[::1]:", []*Update{{Op: Add, Addr: "[::1]:443"}}}, + {"2001:db8:85a3::8a2e:370:7334", []*Update{{Op: Add, Addr: "[2001:db8:85a3::8a2e:370:7334]" + colonDefaultPort}}}, + {"[2001:db8:85a3::8a2e:370:7334]", []*Update{{Op: Add, Addr: "[2001:db8:85a3::8a2e:370:7334]" + colonDefaultPort}}}, + {"[2001:db8:85a3::8a2e:370:7334]:12345", []*Update{{Op: Add, Addr: "[2001:db8:85a3::8a2e:370:7334]:12345"}}}, + {"[2001:db8::1]:http", []*Update{{Op: Add, Addr: "[2001:db8::1]:http"}}}, + // TODO(yuxuanli): zone support? + } + + for _, v := range tests { + r, err := NewDNSResolverWithFreq(time.Millisecond * 5) + if err != nil { + t.Fatalf("%v\n", err) + } + w, err := r.Resolve(v.target) + if err != nil { + t.Fatalf("%v\n", err) + } + var updates []*Update + var wg sync.WaitGroup + wg.Add(1) + count := 0 + go func() { + defer wg.Done() + for { + u, err := w.Next() + if err != nil { + return + } + updates = u + count++ + } + }() + // Sleep for sometime to let watcher do more than one lookup + time.Sleep(time.Millisecond * 10) + w.Close() + wg.Wait() + if !reflect.DeepEqual(v.want, updates) { + t.Errorf("Resolve(%q) = %v, want %+v\n", v.target, updatesToSlice(updates), updatesToSlice(v.want)) + } + if count != 1 { + t.Errorf("IPWatcher Next() should return only once, not %d times\n", count) + } + } +} diff --git a/vendor/google.golang.org/grpc/naming/go17.go b/vendor/google.golang.org/grpc/naming/go17.go new file mode 100644 index 0000000000..a537b08c60 --- /dev/null +++ b/vendor/google.golang.org/grpc/naming/go17.go @@ -0,0 +1,34 @@ +// +build go1.6, !go1.8 + +/* + * + * Copyright 2017 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. + * + */ + +package naming + +import ( + "net" + + "golang.org/x/net/context" +) + +var ( + lookupHost = func(ctx context.Context, host string) ([]string, error) { return net.LookupHost(host) } + lookupSRV = func(ctx context.Context, service, proto, name string) (string, []*net.SRV, error) { + return net.LookupSRV(service, proto, name) + } +) diff --git a/vendor/google.golang.org/grpc/naming/go17_test.go b/vendor/google.golang.org/grpc/naming/go17_test.go new file mode 100644 index 0000000000..db39b9ab78 --- /dev/null +++ b/vendor/google.golang.org/grpc/naming/go17_test.go @@ -0,0 +1,42 @@ +// +build go1.6, !go1.8 + +/* + * + * Copyright 2017 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. + * + */ + +package naming + +import ( + "net" + + "golang.org/x/net/context" +) + +func replaceNetFunc() func() { + oldLookupHost := lookupHost + oldLookupSRV := lookupSRV + lookupHost = func(ctx context.Context, host string) ([]string, error) { + return hostLookup(host) + } + lookupSRV = func(ctx context.Context, service, proto, name string) (string, []*net.SRV, error) { + return srvLookup(service, proto, name) + } + return func() { + lookupHost = oldLookupHost + lookupSRV = oldLookupSRV + } +} diff --git a/vendor/google.golang.org/grpc/naming/go18.go b/vendor/google.golang.org/grpc/naming/go18.go new file mode 100644 index 0000000000..b5a0f84274 --- /dev/null +++ b/vendor/google.golang.org/grpc/naming/go18.go @@ -0,0 +1,28 @@ +// +build go1.8 + +/* + * + * Copyright 2017 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. + * + */ + +package naming + +import "net" + +var ( + lookupHost = net.DefaultResolver.LookupHost + lookupSRV = net.DefaultResolver.LookupSRV +) diff --git a/vendor/google.golang.org/grpc/naming/go18_test.go b/vendor/google.golang.org/grpc/naming/go18_test.go new file mode 100644 index 0000000000..5e297539ba --- /dev/null +++ b/vendor/google.golang.org/grpc/naming/go18_test.go @@ -0,0 +1,41 @@ +// +build go1.8 + +/* + * + * Copyright 2017 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. + * + */ + +package naming + +import ( + "context" + "net" +) + +func replaceNetFunc() func() { + oldLookupHost := lookupHost + oldLookupSRV := lookupSRV + lookupHost = func(ctx context.Context, host string) ([]string, error) { + return hostLookup(host) + } + lookupSRV = func(ctx context.Context, service, proto, name string) (string, []*net.SRV, error) { + return srvLookup(service, proto, name) + } + return func() { + lookupHost = oldLookupHost + lookupSRV = oldLookupSRV + } +} diff --git a/vendor/google.golang.org/grpc/naming/naming.go b/vendor/google.golang.org/grpc/naming/naming.go new file mode 100644 index 0000000000..1af7e32f86 --- /dev/null +++ b/vendor/google.golang.org/grpc/naming/naming.go @@ -0,0 +1,59 @@ +/* + * + * Copyright 2014 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. + * + */ + +// Package naming defines the naming API and related data structures for gRPC. +// The interface is EXPERIMENTAL and may be suject to change. +package naming + +// Operation defines the corresponding operations for a name resolution change. +type Operation uint8 + +const ( + // Add indicates a new address is added. + Add Operation = iota + // Delete indicates an exisiting address is deleted. + Delete +) + +// Update defines a name resolution update. Notice that it is not valid having both +// empty string Addr and nil Metadata in an Update. +type Update struct { + // Op indicates the operation of the update. + Op Operation + // Addr is the updated address. It is empty string if there is no address update. + Addr string + // Metadata is the updated metadata. It is nil if there is no metadata update. + // Metadata is not required for a custom naming implementation. + Metadata interface{} +} + +// Resolver creates a Watcher for a target to track its resolution changes. +type Resolver interface { + // Resolve creates a Watcher for target. + Resolve(target string) (Watcher, error) +} + +// Watcher watches for the updates on the specified target. +type Watcher interface { + // Next blocks until an update or error happens. It may return one or more + // updates. The first call should get the full set of the results. It should + // return an error if and only if Watcher cannot recover. + Next() ([]*Update, error) + // Close closes the Watcher. + Close() +} diff --git a/vendor/google.golang.org/grpc/peer/peer.go b/vendor/google.golang.org/grpc/peer/peer.go new file mode 100644 index 0000000000..317b8b9d09 --- /dev/null +++ b/vendor/google.golang.org/grpc/peer/peer.go @@ -0,0 +1,51 @@ +/* + * + * Copyright 2014 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. + * + */ + +// Package peer defines various peer information associated with RPCs and +// corresponding utils. +package peer + +import ( + "net" + + "golang.org/x/net/context" + "google.golang.org/grpc/credentials" +) + +// Peer contains the information of the peer for an RPC, such as the address +// and authentication information. +type Peer struct { + // Addr is the peer address. + Addr net.Addr + // AuthInfo is the authentication information of the transport. + // It is nil if there is no transport security being used. + AuthInfo credentials.AuthInfo +} + +type peerKey struct{} + +// NewContext creates a new context with peer information attached. +func NewContext(ctx context.Context, p *Peer) context.Context { + return context.WithValue(ctx, peerKey{}, p) +} + +// FromContext returns the peer information in ctx if it exists. +func FromContext(ctx context.Context) (p *Peer, ok bool) { + p, ok = ctx.Value(peerKey{}).(*Peer) + return +} diff --git a/vendor/google.golang.org/grpc/picker_wrapper.go b/vendor/google.golang.org/grpc/picker_wrapper.go new file mode 100644 index 0000000000..9085dbc9c9 --- /dev/null +++ b/vendor/google.golang.org/grpc/picker_wrapper.go @@ -0,0 +1,141 @@ +/* + * + * Copyright 2017 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. + * + */ + +package grpc + +import ( + "sync" + + "golang.org/x/net/context" + "google.golang.org/grpc/balancer" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/status" + "google.golang.org/grpc/transport" +) + +// pickerWrapper is a wrapper of balancer.Picker. It blocks on certain pick +// actions and unblock when there's a picker update. +type pickerWrapper struct { + mu sync.Mutex + done bool + blockingCh chan struct{} + picker balancer.Picker +} + +func newPickerWrapper() *pickerWrapper { + bp := &pickerWrapper{blockingCh: make(chan struct{})} + return bp +} + +// updatePicker is called by UpdateBalancerState. It unblocks all blocked pick. +func (bp *pickerWrapper) updatePicker(p balancer.Picker) { + bp.mu.Lock() + if bp.done { + bp.mu.Unlock() + return + } + bp.picker = p + // bp.blockingCh should never be nil. + close(bp.blockingCh) + bp.blockingCh = make(chan struct{}) + bp.mu.Unlock() +} + +// pick returns the transport that will be used for the RPC. +// It may block in the following cases: +// - there's no picker +// - the current picker returns ErrNoSubConnAvailable +// - the current picker returns other errors and failfast is false. +// - the subConn returned by the current picker is not READY +// When one of these situations happens, pick blocks until the picker gets updated. +func (bp *pickerWrapper) pick(ctx context.Context, failfast bool, opts balancer.PickOptions) (transport.ClientTransport, func(balancer.DoneInfo), error) { + var ( + p balancer.Picker + ch chan struct{} + ) + + for { + bp.mu.Lock() + if bp.done { + bp.mu.Unlock() + return nil, nil, ErrClientConnClosing + } + + if bp.picker == nil { + ch = bp.blockingCh + } + if ch == bp.blockingCh { + // This could happen when either: + // - bp.picker is nil (the previous if condition), or + // - has called pick on the current picker. + bp.mu.Unlock() + select { + case <-ctx.Done(): + return nil, nil, ctx.Err() + case <-ch: + } + continue + } + + ch = bp.blockingCh + p = bp.picker + bp.mu.Unlock() + + subConn, put, err := p.Pick(ctx, opts) + + if err != nil { + switch err { + case balancer.ErrNoSubConnAvailable: + continue + case balancer.ErrTransientFailure: + if !failfast { + continue + } + return nil, nil, status.Errorf(codes.Unavailable, "%v", err) + default: + // err is some other error. + return nil, nil, toRPCErr(err) + } + } + + acw, ok := subConn.(*acBalancerWrapper) + if !ok { + grpclog.Infof("subconn returned from pick is not *acBalancerWrapper") + continue + } + if t, ok := acw.getAddrConn().getReadyTransport(); ok { + return t, put, nil + } + grpclog.Infof("blockingPicker: the picked transport is not ready, loop back to repick") + // If ok == false, ac.state is not READY. + // A valid picker always returns READY subConn. This means the state of ac + // just changed, and picker will be updated shortly. + // continue back to the beginning of the for loop to repick. + } +} + +func (bp *pickerWrapper) close() { + bp.mu.Lock() + defer bp.mu.Unlock() + if bp.done { + return + } + bp.done = true + close(bp.blockingCh) +} diff --git a/vendor/google.golang.org/grpc/picker_wrapper_test.go b/vendor/google.golang.org/grpc/picker_wrapper_test.go new file mode 100644 index 0000000000..37dffa9e9d --- /dev/null +++ b/vendor/google.golang.org/grpc/picker_wrapper_test.go @@ -0,0 +1,160 @@ +/* + * + * Copyright 2017 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. + * + */ + +package grpc + +import ( + "fmt" + "sync/atomic" + "testing" + "time" + + "golang.org/x/net/context" + "google.golang.org/grpc/balancer" + "google.golang.org/grpc/connectivity" + _ "google.golang.org/grpc/grpclog/glogger" + "google.golang.org/grpc/test/leakcheck" + "google.golang.org/grpc/transport" +) + +const goroutineCount = 5 + +var ( + testT = &testTransport{} + testSC = &acBalancerWrapper{ac: &addrConn{ + state: connectivity.Ready, + transport: testT, + }} + testSCNotReady = &acBalancerWrapper{ac: &addrConn{ + state: connectivity.TransientFailure, + }} +) + +type testTransport struct { + transport.ClientTransport +} + +type testingPicker struct { + err error + sc balancer.SubConn + maxCalled int64 +} + +func (p *testingPicker) Pick(ctx context.Context, opts balancer.PickOptions) (balancer.SubConn, func(balancer.DoneInfo), error) { + if atomic.AddInt64(&p.maxCalled, -1) < 0 { + return nil, nil, fmt.Errorf("Pick called to many times (> goroutineCount)") + } + if p.err != nil { + return nil, nil, p.err + } + return p.sc, nil, nil +} + +func TestBlockingPickTimeout(t *testing.T) { + defer leakcheck.Check(t) + bp := newPickerWrapper() + ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond) + defer cancel() + if _, _, err := bp.pick(ctx, true, balancer.PickOptions{}); err != context.DeadlineExceeded { + t.Errorf("bp.pick returned error %v, want DeadlineExceeded", err) + } +} + +func TestBlockingPick(t *testing.T) { + defer leakcheck.Check(t) + bp := newPickerWrapper() + // All goroutines should block because picker is nil in bp. + var finishedCount uint64 + for i := goroutineCount; i > 0; i-- { + go func() { + if tr, _, err := bp.pick(context.Background(), true, balancer.PickOptions{}); err != nil || tr != testT { + t.Errorf("bp.pick returned non-nil error: %v", err) + } + atomic.AddUint64(&finishedCount, 1) + }() + } + time.Sleep(50 * time.Millisecond) + if c := atomic.LoadUint64(&finishedCount); c != 0 { + t.Errorf("finished goroutines count: %v, want 0", c) + } + bp.updatePicker(&testingPicker{sc: testSC, maxCalled: goroutineCount}) +} + +func TestBlockingPickNoSubAvailable(t *testing.T) { + defer leakcheck.Check(t) + bp := newPickerWrapper() + var finishedCount uint64 + bp.updatePicker(&testingPicker{err: balancer.ErrNoSubConnAvailable, maxCalled: goroutineCount}) + // All goroutines should block because picker returns no sc available. + for i := goroutineCount; i > 0; i-- { + go func() { + if tr, _, err := bp.pick(context.Background(), true, balancer.PickOptions{}); err != nil || tr != testT { + t.Errorf("bp.pick returned non-nil error: %v", err) + } + atomic.AddUint64(&finishedCount, 1) + }() + } + time.Sleep(50 * time.Millisecond) + if c := atomic.LoadUint64(&finishedCount); c != 0 { + t.Errorf("finished goroutines count: %v, want 0", c) + } + bp.updatePicker(&testingPicker{sc: testSC, maxCalled: goroutineCount}) +} + +func TestBlockingPickTransientWaitforready(t *testing.T) { + defer leakcheck.Check(t) + bp := newPickerWrapper() + bp.updatePicker(&testingPicker{err: balancer.ErrTransientFailure, maxCalled: goroutineCount}) + var finishedCount uint64 + // All goroutines should block because picker returns transientFailure and + // picks are not failfast. + for i := goroutineCount; i > 0; i-- { + go func() { + if tr, _, err := bp.pick(context.Background(), false, balancer.PickOptions{}); err != nil || tr != testT { + t.Errorf("bp.pick returned non-nil error: %v", err) + } + atomic.AddUint64(&finishedCount, 1) + }() + } + time.Sleep(time.Millisecond) + if c := atomic.LoadUint64(&finishedCount); c != 0 { + t.Errorf("finished goroutines count: %v, want 0", c) + } + bp.updatePicker(&testingPicker{sc: testSC, maxCalled: goroutineCount}) +} + +func TestBlockingPickSCNotReady(t *testing.T) { + defer leakcheck.Check(t) + bp := newPickerWrapper() + bp.updatePicker(&testingPicker{sc: testSCNotReady, maxCalled: goroutineCount}) + var finishedCount uint64 + // All goroutines should block because sc is not ready. + for i := goroutineCount; i > 0; i-- { + go func() { + if tr, _, err := bp.pick(context.Background(), true, balancer.PickOptions{}); err != nil || tr != testT { + t.Errorf("bp.pick returned non-nil error: %v", err) + } + atomic.AddUint64(&finishedCount, 1) + }() + } + time.Sleep(time.Millisecond) + if c := atomic.LoadUint64(&finishedCount); c != 0 { + t.Errorf("finished goroutines count: %v, want 0", c) + } + bp.updatePicker(&testingPicker{sc: testSC, maxCalled: goroutineCount}) +} diff --git a/vendor/google.golang.org/grpc/pickfirst.go b/vendor/google.golang.org/grpc/pickfirst.go new file mode 100644 index 0000000000..e83ca2b0db --- /dev/null +++ b/vendor/google.golang.org/grpc/pickfirst.go @@ -0,0 +1,105 @@ +/* + * + * Copyright 2017 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. + * + */ + +package grpc + +import ( + "golang.org/x/net/context" + "google.golang.org/grpc/balancer" + "google.golang.org/grpc/connectivity" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/resolver" +) + +func newPickfirstBuilder() balancer.Builder { + return &pickfirstBuilder{} +} + +type pickfirstBuilder struct{} + +func (*pickfirstBuilder) Build(cc balancer.ClientConn, opt balancer.BuildOptions) balancer.Balancer { + return &pickfirstBalancer{cc: cc} +} + +func (*pickfirstBuilder) Name() string { + return "pick_first" +} + +type pickfirstBalancer struct { + cc balancer.ClientConn + sc balancer.SubConn +} + +func (b *pickfirstBalancer) HandleResolvedAddrs(addrs []resolver.Address, err error) { + if err != nil { + grpclog.Infof("pickfirstBalancer: HandleResolvedAddrs called with error %v", err) + return + } + if b.sc == nil { + b.sc, err = b.cc.NewSubConn(addrs, balancer.NewSubConnOptions{}) + if err != nil { + grpclog.Errorf("pickfirstBalancer: failed to NewSubConn: %v", err) + return + } + b.cc.UpdateBalancerState(connectivity.Idle, &picker{sc: b.sc}) + b.sc.Connect() + } else { + b.sc.UpdateAddresses(addrs) + b.sc.Connect() + } +} + +func (b *pickfirstBalancer) HandleSubConnStateChange(sc balancer.SubConn, s connectivity.State) { + grpclog.Infof("pickfirstBalancer: HandleSubConnStateChange: %p, %v", sc, s) + if b.sc != sc { + grpclog.Infof("pickfirstBalancer: ignored state change because sc is not recognized") + return + } + if s == connectivity.Shutdown { + b.sc = nil + return + } + + switch s { + case connectivity.Ready, connectivity.Idle: + b.cc.UpdateBalancerState(s, &picker{sc: sc}) + case connectivity.Connecting: + b.cc.UpdateBalancerState(s, &picker{err: balancer.ErrNoSubConnAvailable}) + case connectivity.TransientFailure: + b.cc.UpdateBalancerState(s, &picker{err: balancer.ErrTransientFailure}) + } +} + +func (b *pickfirstBalancer) Close() { +} + +type picker struct { + err error + sc balancer.SubConn +} + +func (p *picker) Pick(ctx context.Context, opts balancer.PickOptions) (balancer.SubConn, func(balancer.DoneInfo), error) { + if p.err != nil { + return nil, nil, p.err + } + return p.sc, nil, nil +} + +func init() { + balancer.Register(newPickfirstBuilder()) +} diff --git a/vendor/google.golang.org/grpc/pickfirst_test.go b/vendor/google.golang.org/grpc/pickfirst_test.go new file mode 100644 index 0000000000..e58b3422c1 --- /dev/null +++ b/vendor/google.golang.org/grpc/pickfirst_test.go @@ -0,0 +1,352 @@ +/* + * + * Copyright 2017 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. + * + */ + +package grpc + +import ( + "math" + "sync" + "testing" + "time" + + "golang.org/x/net/context" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/resolver" + "google.golang.org/grpc/resolver/manual" + "google.golang.org/grpc/test/leakcheck" +) + +func TestOneBackendPickfirst(t *testing.T) { + defer leakcheck.Check(t) + r, rcleanup := manual.GenerateAndRegisterManualResolver() + defer rcleanup() + + numServers := 1 + servers, _, scleanup := startServers(t, numServers, math.MaxInt32) + defer scleanup() + + cc, err := Dial(r.Scheme()+":///test.server", WithInsecure(), WithBalancerBuilder(newPickfirstBuilder()), WithCodec(testCodec{})) + if err != nil { + t.Fatalf("failed to dial: %v", err) + } + defer cc.Close() + // The first RPC should fail because there's no address. + ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond) + defer cancel() + req := "port" + var reply string + if err := Invoke(ctx, "/foo/bar", &req, &reply, cc); err == nil || Code(err) != codes.DeadlineExceeded { + t.Fatalf("EmptyCall() = _, %v, want _, DeadlineExceeded", err) + } + + r.NewAddress([]resolver.Address{{Addr: servers[0].addr}}) + // The second RPC should succeed. + for i := 0; i < 1000; i++ { + if err = Invoke(context.Background(), "/foo/bar", &req, &reply, cc); err != nil && ErrorDesc(err) == servers[0].port { + return + } + time.Sleep(time.Millisecond) + } + t.Fatalf("EmptyCall() = _, %v, want _, %v", err, servers[0].port) +} + +func TestBackendsPickfirst(t *testing.T) { + defer leakcheck.Check(t) + r, rcleanup := manual.GenerateAndRegisterManualResolver() + defer rcleanup() + + numServers := 2 + servers, _, scleanup := startServers(t, numServers, math.MaxInt32) + defer scleanup() + + cc, err := Dial(r.Scheme()+":///test.server", WithInsecure(), WithBalancerBuilder(newPickfirstBuilder()), WithCodec(testCodec{})) + if err != nil { + t.Fatalf("failed to dial: %v", err) + } + defer cc.Close() + // The first RPC should fail because there's no address. + ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond) + defer cancel() + req := "port" + var reply string + if err := Invoke(ctx, "/foo/bar", &req, &reply, cc); err == nil || Code(err) != codes.DeadlineExceeded { + t.Fatalf("EmptyCall() = _, %v, want _, DeadlineExceeded", err) + } + + r.NewAddress([]resolver.Address{{Addr: servers[0].addr}, {Addr: servers[1].addr}}) + // The second RPC should succeed with the first server. + for i := 0; i < 1000; i++ { + if err = Invoke(context.Background(), "/foo/bar", &req, &reply, cc); err != nil && ErrorDesc(err) == servers[0].port { + return + } + time.Sleep(time.Millisecond) + } + t.Fatalf("EmptyCall() = _, %v, want _, %v", err, servers[0].port) +} + +func TestNewAddressWhileBlockingPickfirst(t *testing.T) { + defer leakcheck.Check(t) + r, rcleanup := manual.GenerateAndRegisterManualResolver() + defer rcleanup() + + numServers := 1 + servers, _, scleanup := startServers(t, numServers, math.MaxInt32) + defer scleanup() + + cc, err := Dial(r.Scheme()+":///test.server", WithInsecure(), WithBalancerBuilder(newPickfirstBuilder()), WithCodec(testCodec{})) + if err != nil { + t.Fatalf("failed to dial: %v", err) + } + defer cc.Close() + // The first RPC should fail because there's no address. + ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond) + defer cancel() + req := "port" + var reply string + if err := Invoke(ctx, "/foo/bar", &req, &reply, cc); err == nil || Code(err) != codes.DeadlineExceeded { + t.Fatalf("EmptyCall() = _, %v, want _, DeadlineExceeded", err) + } + + var wg sync.WaitGroup + for i := 0; i < 3; i++ { + wg.Add(1) + go func() { + defer wg.Done() + // This RPC blocks until NewAddress is called. + Invoke(context.Background(), "/foo/bar", &req, &reply, cc) + }() + } + time.Sleep(50 * time.Millisecond) + r.NewAddress([]resolver.Address{{Addr: servers[0].addr}}) + wg.Wait() +} + +func TestCloseWithPendingRPCPickfirst(t *testing.T) { + defer leakcheck.Check(t) + r, rcleanup := manual.GenerateAndRegisterManualResolver() + defer rcleanup() + + numServers := 1 + _, _, scleanup := startServers(t, numServers, math.MaxInt32) + defer scleanup() + + cc, err := Dial(r.Scheme()+":///test.server", WithInsecure(), WithBalancerBuilder(newPickfirstBuilder()), WithCodec(testCodec{})) + if err != nil { + t.Fatalf("failed to dial: %v", err) + } + defer cc.Close() + // The first RPC should fail because there's no address. + ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond) + defer cancel() + req := "port" + var reply string + if err := Invoke(ctx, "/foo/bar", &req, &reply, cc); err == nil || Code(err) != codes.DeadlineExceeded { + t.Fatalf("EmptyCall() = _, %v, want _, DeadlineExceeded", err) + } + + var wg sync.WaitGroup + for i := 0; i < 3; i++ { + wg.Add(1) + go func() { + defer wg.Done() + // This RPC blocks until NewAddress is called. + Invoke(context.Background(), "/foo/bar", &req, &reply, cc) + }() + } + time.Sleep(50 * time.Millisecond) + cc.Close() + wg.Wait() +} + +func TestOneServerDownPickfirst(t *testing.T) { + defer leakcheck.Check(t) + r, rcleanup := manual.GenerateAndRegisterManualResolver() + defer rcleanup() + + numServers := 2 + servers, _, scleanup := startServers(t, numServers, math.MaxInt32) + defer scleanup() + + cc, err := Dial(r.Scheme()+":///test.server", WithInsecure(), WithBalancerBuilder(newPickfirstBuilder()), WithCodec(testCodec{})) + if err != nil { + t.Fatalf("failed to dial: %v", err) + } + defer cc.Close() + // The first RPC should fail because there's no address. + ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond) + defer cancel() + req := "port" + var reply string + if err := Invoke(ctx, "/foo/bar", &req, &reply, cc); err == nil || Code(err) != codes.DeadlineExceeded { + t.Fatalf("EmptyCall() = _, %v, want _, DeadlineExceeded", err) + } + + r.NewAddress([]resolver.Address{{Addr: servers[0].addr}, {Addr: servers[1].addr}}) + // The second RPC should succeed with the first server. + for i := 0; i < 1000; i++ { + if err = Invoke(context.Background(), "/foo/bar", &req, &reply, cc); err != nil && ErrorDesc(err) == servers[0].port { + break + } + time.Sleep(time.Millisecond) + } + + servers[0].stop() + for i := 0; i < 1000; i++ { + if err = Invoke(context.Background(), "/foo/bar", &req, &reply, cc); err != nil && ErrorDesc(err) == servers[1].port { + return + } + time.Sleep(time.Millisecond) + } + t.Fatalf("EmptyCall() = _, %v, want _, %v", err, servers[0].port) +} + +func TestAllServersDownPickfirst(t *testing.T) { + defer leakcheck.Check(t) + r, rcleanup := manual.GenerateAndRegisterManualResolver() + defer rcleanup() + + numServers := 2 + servers, _, scleanup := startServers(t, numServers, math.MaxInt32) + defer scleanup() + + cc, err := Dial(r.Scheme()+":///test.server", WithInsecure(), WithBalancerBuilder(newPickfirstBuilder()), WithCodec(testCodec{})) + if err != nil { + t.Fatalf("failed to dial: %v", err) + } + defer cc.Close() + // The first RPC should fail because there's no address. + ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond) + defer cancel() + req := "port" + var reply string + if err := Invoke(ctx, "/foo/bar", &req, &reply, cc); err == nil || Code(err) != codes.DeadlineExceeded { + t.Fatalf("EmptyCall() = _, %v, want _, DeadlineExceeded", err) + } + + r.NewAddress([]resolver.Address{{Addr: servers[0].addr}, {Addr: servers[1].addr}}) + // The second RPC should succeed with the first server. + for i := 0; i < 1000; i++ { + if err = Invoke(context.Background(), "/foo/bar", &req, &reply, cc); err != nil && ErrorDesc(err) == servers[0].port { + break + } + time.Sleep(time.Millisecond) + } + + for i := 0; i < numServers; i++ { + servers[i].stop() + } + for i := 0; i < 1000; i++ { + if err = Invoke(context.Background(), "/foo/bar", &req, &reply, cc); Code(err) == codes.Unavailable { + return + } + time.Sleep(time.Millisecond) + } + t.Fatalf("EmptyCall() = _, %v, want _, error with code unavailable", err) +} + +func TestAddressesRemovedPickfirst(t *testing.T) { + defer leakcheck.Check(t) + r, rcleanup := manual.GenerateAndRegisterManualResolver() + defer rcleanup() + + numServers := 3 + servers, _, scleanup := startServers(t, numServers, math.MaxInt32) + defer scleanup() + + cc, err := Dial(r.Scheme()+":///test.server", WithInsecure(), WithBalancerBuilder(newPickfirstBuilder()), WithCodec(testCodec{})) + if err != nil { + t.Fatalf("failed to dial: %v", err) + } + defer cc.Close() + // The first RPC should fail because there's no address. + ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond) + defer cancel() + req := "port" + var reply string + if err := Invoke(ctx, "/foo/bar", &req, &reply, cc); err == nil || Code(err) != codes.DeadlineExceeded { + t.Fatalf("EmptyCall() = _, %v, want _, DeadlineExceeded", err) + } + + r.NewAddress([]resolver.Address{{Addr: servers[0].addr}, {Addr: servers[1].addr}, {Addr: servers[2].addr}}) + for i := 0; i < 1000; i++ { + if err = Invoke(context.Background(), "/foo/bar", &req, &reply, cc); err != nil && ErrorDesc(err) == servers[0].port { + break + } + time.Sleep(time.Millisecond) + } + for i := 0; i < 20; i++ { + if err := Invoke(context.Background(), "/foo/bar", &req, &reply, cc); err == nil || ErrorDesc(err) != servers[0].port { + t.Fatalf("Index %d: Invoke(_, _, _, _, _) = %v, want %s", 0, err, servers[0].port) + } + time.Sleep(10 * time.Millisecond) + } + + // Remove server[0]. + r.NewAddress([]resolver.Address{{Addr: servers[1].addr}, {Addr: servers[2].addr}}) + for i := 0; i < 1000; i++ { + if err = Invoke(context.Background(), "/foo/bar", &req, &reply, cc); err != nil && ErrorDesc(err) == servers[1].port { + break + } + time.Sleep(time.Millisecond) + } + for i := 0; i < 20; i++ { + if err := Invoke(context.Background(), "/foo/bar", &req, &reply, cc); err == nil || ErrorDesc(err) != servers[1].port { + t.Fatalf("Index %d: Invoke(_, _, _, _, _) = %v, want %s", 1, err, servers[1].port) + } + time.Sleep(10 * time.Millisecond) + } + + // Append server[0], nothing should change. + r.NewAddress([]resolver.Address{{Addr: servers[1].addr}, {Addr: servers[2].addr}, {Addr: servers[0].addr}}) + for i := 0; i < 20; i++ { + if err := Invoke(context.Background(), "/foo/bar", &req, &reply, cc); err == nil || ErrorDesc(err) != servers[1].port { + t.Fatalf("Index %d: Invoke(_, _, _, _, _) = %v, want %s", 1, err, servers[1].port) + } + time.Sleep(10 * time.Millisecond) + } + + // Remove server[1]. + r.NewAddress([]resolver.Address{{Addr: servers[2].addr}, {Addr: servers[0].addr}}) + for i := 0; i < 1000; i++ { + if err = Invoke(context.Background(), "/foo/bar", &req, &reply, cc); err != nil && ErrorDesc(err) == servers[2].port { + break + } + time.Sleep(time.Millisecond) + } + for i := 0; i < 20; i++ { + if err := Invoke(context.Background(), "/foo/bar", &req, &reply, cc); err == nil || ErrorDesc(err) != servers[2].port { + t.Fatalf("Index %d: Invoke(_, _, _, _, _) = %v, want %s", 2, err, servers[2].port) + } + time.Sleep(10 * time.Millisecond) + } + + // Remove server[2]. + r.NewAddress([]resolver.Address{{Addr: servers[0].addr}}) + for i := 0; i < 1000; i++ { + if err = Invoke(context.Background(), "/foo/bar", &req, &reply, cc); err != nil && ErrorDesc(err) == servers[0].port { + break + } + time.Sleep(time.Millisecond) + } + for i := 0; i < 20; i++ { + if err := Invoke(context.Background(), "/foo/bar", &req, &reply, cc); err == nil || ErrorDesc(err) != servers[0].port { + t.Fatalf("Index %d: Invoke(_, _, _, _, _) = %v, want %s", 0, err, servers[0].port) + } + time.Sleep(10 * time.Millisecond) + } +} diff --git a/vendor/google.golang.org/grpc/proxy.go b/vendor/google.golang.org/grpc/proxy.go new file mode 100644 index 0000000000..2d40236e21 --- /dev/null +++ b/vendor/google.golang.org/grpc/proxy.go @@ -0,0 +1,130 @@ +/* + * + * Copyright 2017 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. + * + */ + +package grpc + +import ( + "bufio" + "errors" + "fmt" + "io" + "net" + "net/http" + "net/http/httputil" + "net/url" + + "golang.org/x/net/context" +) + +var ( + // errDisabled indicates that proxy is disabled for the address. + errDisabled = errors.New("proxy is disabled for the address") + // The following variable will be overwritten in the tests. + httpProxyFromEnvironment = http.ProxyFromEnvironment +) + +func mapAddress(ctx context.Context, address string) (string, error) { + req := &http.Request{ + URL: &url.URL{ + Scheme: "https", + Host: address, + }, + } + url, err := httpProxyFromEnvironment(req) + if err != nil { + return "", err + } + if url == nil { + return "", errDisabled + } + return url.Host, nil +} + +// To read a response from a net.Conn, http.ReadResponse() takes a bufio.Reader. +// It's possible that this reader reads more than what's need for the response and stores +// those bytes in the buffer. +// bufConn wraps the original net.Conn and the bufio.Reader to make sure we don't lose the +// bytes in the buffer. +type bufConn struct { + net.Conn + r io.Reader +} + +func (c *bufConn) Read(b []byte) (int, error) { + return c.r.Read(b) +} + +func doHTTPConnectHandshake(ctx context.Context, conn net.Conn, addr string) (_ net.Conn, err error) { + defer func() { + if err != nil { + conn.Close() + } + }() + + req := (&http.Request{ + Method: http.MethodConnect, + URL: &url.URL{Host: addr}, + Header: map[string][]string{"User-Agent": {grpcUA}}, + }) + + if err := sendHTTPRequest(ctx, req, conn); err != nil { + return nil, fmt.Errorf("failed to write the HTTP request: %v", err) + } + + r := bufio.NewReader(conn) + resp, err := http.ReadResponse(r, req) + if err != nil { + return nil, fmt.Errorf("reading server HTTP response: %v", err) + } + defer resp.Body.Close() + if resp.StatusCode != http.StatusOK { + dump, err := httputil.DumpResponse(resp, true) + if err != nil { + return nil, fmt.Errorf("failed to do connect handshake, status code: %s", resp.Status) + } + return nil, fmt.Errorf("failed to do connect handshake, response: %q", dump) + } + + return &bufConn{Conn: conn, r: r}, nil +} + +// newProxyDialer returns a dialer that connects to proxy first if necessary. +// The returned dialer checks if a proxy is necessary, dial to the proxy with the +// provided dialer, does HTTP CONNECT handshake and returns the connection. +func newProxyDialer(dialer func(context.Context, string) (net.Conn, error)) func(context.Context, string) (net.Conn, error) { + return func(ctx context.Context, addr string) (conn net.Conn, err error) { + var skipHandshake bool + newAddr, err := mapAddress(ctx, addr) + if err != nil { + if err != errDisabled { + return nil, err + } + skipHandshake = true + newAddr = addr + } + + conn, err = dialer(ctx, newAddr) + if err != nil { + return + } + if !skipHandshake { + conn, err = doHTTPConnectHandshake(ctx, conn, addr) + } + return + } +} diff --git a/vendor/google.golang.org/grpc/proxy_test.go b/vendor/google.golang.org/grpc/proxy_test.go new file mode 100644 index 0000000000..39ee123cca --- /dev/null +++ b/vendor/google.golang.org/grpc/proxy_test.go @@ -0,0 +1,182 @@ +// +build !race + +/* + * + * Copyright 2017 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. + * + */ + +package grpc + +import ( + "bufio" + "io" + "net" + "net/http" + "net/url" + "testing" + "time" + + "golang.org/x/net/context" + "google.golang.org/grpc/test/leakcheck" +) + +const ( + envTestAddr = "1.2.3.4:8080" + envProxyAddr = "2.3.4.5:7687" +) + +// overwriteAndRestore overwrite function httpProxyFromEnvironment and +// returns a function to restore the default values. +func overwrite(hpfe func(req *http.Request) (*url.URL, error)) func() { + backHPFE := httpProxyFromEnvironment + httpProxyFromEnvironment = hpfe + return func() { + httpProxyFromEnvironment = backHPFE + } +} + +type proxyServer struct { + t *testing.T + lis net.Listener + in net.Conn + out net.Conn +} + +func (p *proxyServer) run() { + in, err := p.lis.Accept() + if err != nil { + return + } + p.in = in + + req, err := http.ReadRequest(bufio.NewReader(in)) + if err != nil { + p.t.Errorf("failed to read CONNECT req: %v", err) + return + } + if req.Method != http.MethodConnect || req.UserAgent() != grpcUA { + resp := http.Response{StatusCode: http.StatusMethodNotAllowed} + resp.Write(p.in) + p.in.Close() + p.t.Errorf("get wrong CONNECT req: %+v", req) + return + } + + out, err := net.Dial("tcp", req.URL.Host) + if err != nil { + p.t.Errorf("failed to dial to server: %v", err) + return + } + resp := http.Response{StatusCode: http.StatusOK, Proto: "HTTP/1.0"} + resp.Write(p.in) + p.out = out + go io.Copy(p.in, p.out) + go io.Copy(p.out, p.in) +} + +func (p *proxyServer) stop() { + p.lis.Close() + if p.in != nil { + p.in.Close() + } + if p.out != nil { + p.out.Close() + } +} + +func TestHTTPConnect(t *testing.T) { + defer leakcheck.Check(t) + plis, err := net.Listen("tcp", "localhost:0") + if err != nil { + t.Fatalf("failed to listen: %v", err) + } + p := &proxyServer{t: t, lis: plis} + go p.run() + defer p.stop() + + blis, err := net.Listen("tcp", "localhost:0") + if err != nil { + t.Fatalf("failed to listen: %v", err) + } + + msg := []byte{4, 3, 5, 2} + recvBuf := make([]byte, len(msg), len(msg)) + done := make(chan struct{}) + go func() { + in, err := blis.Accept() + if err != nil { + t.Errorf("failed to accept: %v", err) + return + } + defer in.Close() + in.Read(recvBuf) + close(done) + }() + + // Overwrite the function in the test and restore them in defer. + hpfe := func(req *http.Request) (*url.URL, error) { + return &url.URL{Host: plis.Addr().String()}, nil + } + defer overwrite(hpfe)() + + // Dial to proxy server. + dialer := newProxyDialer(func(ctx context.Context, addr string) (net.Conn, error) { + if deadline, ok := ctx.Deadline(); ok { + return net.DialTimeout("tcp", addr, deadline.Sub(time.Now())) + } + return net.Dial("tcp", addr) + }) + ctx, cancel := context.WithTimeout(context.Background(), time.Second) + defer cancel() + c, err := dialer(ctx, blis.Addr().String()) + if err != nil { + t.Fatalf("http connect Dial failed: %v", err) + } + defer c.Close() + + // Send msg on the connection. + c.Write(msg) + <-done + + // Check received msg. + if string(recvBuf) != string(msg) { + t.Fatalf("received msg: %v, want %v", recvBuf, msg) + } +} + +func TestMapAddressEnv(t *testing.T) { + defer leakcheck.Check(t) + // Overwrite the function in the test and restore them in defer. + hpfe := func(req *http.Request) (*url.URL, error) { + if req.URL.Host == envTestAddr { + return &url.URL{ + Scheme: "https", + Host: envProxyAddr, + }, nil + } + return nil, nil + } + defer overwrite(hpfe)() + + // envTestAddr should be handled by ProxyFromEnvironment. + got, err := mapAddress(context.Background(), envTestAddr) + if err != nil { + t.Error(err) + } + if got != envProxyAddr { + t.Errorf("want %v, got %v", envProxyAddr, got) + } +} diff --git a/vendor/google.golang.org/grpc/reflection/README.md b/vendor/google.golang.org/grpc/reflection/README.md new file mode 100644 index 0000000000..04b6371afc --- /dev/null +++ b/vendor/google.golang.org/grpc/reflection/README.md @@ -0,0 +1,18 @@ +# Reflection + +Package reflection implements server reflection service. + +The service implemented is defined in: https://github.com/grpc/grpc/blob/master/src/proto/grpc/reflection/v1alpha/reflection.proto. + +To register server reflection on a gRPC server: +```go +import "google.golang.org/grpc/reflection" + +s := grpc.NewServer() +pb.RegisterYourOwnServer(s, &server{}) + +// Register reflection service on gRPC server. +reflection.Register(s) + +s.Serve(lis) +``` diff --git a/vendor/google.golang.org/grpc/reflection/grpc_reflection_v1alpha/reflection.pb.go b/vendor/google.golang.org/grpc/reflection/grpc_reflection_v1alpha/reflection.pb.go new file mode 100644 index 0000000000..b407253274 --- /dev/null +++ b/vendor/google.golang.org/grpc/reflection/grpc_reflection_v1alpha/reflection.pb.go @@ -0,0 +1,763 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: grpc_reflection_v1alpha/reflection.proto + +/* +Package grpc_reflection_v1alpha is a generated protocol buffer package. + +It is generated from these files: + grpc_reflection_v1alpha/reflection.proto + +It has these top-level messages: + ServerReflectionRequest + ExtensionRequest + ServerReflectionResponse + FileDescriptorResponse + ExtensionNumberResponse + ListServiceResponse + ServiceResponse + ErrorResponse +*/ +package grpc_reflection_v1alpha + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// The message sent by the client when calling ServerReflectionInfo method. +type ServerReflectionRequest struct { + Host string `protobuf:"bytes,1,opt,name=host" json:"host,omitempty"` + // To use reflection service, the client should set one of the following + // fields in message_request. The server distinguishes requests by their + // defined field and then handles them using corresponding methods. + // + // Types that are valid to be assigned to MessageRequest: + // *ServerReflectionRequest_FileByFilename + // *ServerReflectionRequest_FileContainingSymbol + // *ServerReflectionRequest_FileContainingExtension + // *ServerReflectionRequest_AllExtensionNumbersOfType + // *ServerReflectionRequest_ListServices + MessageRequest isServerReflectionRequest_MessageRequest `protobuf_oneof:"message_request"` +} + +func (m *ServerReflectionRequest) Reset() { *m = ServerReflectionRequest{} } +func (m *ServerReflectionRequest) String() string { return proto.CompactTextString(m) } +func (*ServerReflectionRequest) ProtoMessage() {} +func (*ServerReflectionRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +type isServerReflectionRequest_MessageRequest interface { + isServerReflectionRequest_MessageRequest() +} + +type ServerReflectionRequest_FileByFilename struct { + FileByFilename string `protobuf:"bytes,3,opt,name=file_by_filename,json=fileByFilename,oneof"` +} +type ServerReflectionRequest_FileContainingSymbol struct { + FileContainingSymbol string `protobuf:"bytes,4,opt,name=file_containing_symbol,json=fileContainingSymbol,oneof"` +} +type ServerReflectionRequest_FileContainingExtension struct { + FileContainingExtension *ExtensionRequest `protobuf:"bytes,5,opt,name=file_containing_extension,json=fileContainingExtension,oneof"` +} +type ServerReflectionRequest_AllExtensionNumbersOfType struct { + AllExtensionNumbersOfType string `protobuf:"bytes,6,opt,name=all_extension_numbers_of_type,json=allExtensionNumbersOfType,oneof"` +} +type ServerReflectionRequest_ListServices struct { + ListServices string `protobuf:"bytes,7,opt,name=list_services,json=listServices,oneof"` +} + +func (*ServerReflectionRequest_FileByFilename) isServerReflectionRequest_MessageRequest() {} +func (*ServerReflectionRequest_FileContainingSymbol) isServerReflectionRequest_MessageRequest() {} +func (*ServerReflectionRequest_FileContainingExtension) isServerReflectionRequest_MessageRequest() {} +func (*ServerReflectionRequest_AllExtensionNumbersOfType) isServerReflectionRequest_MessageRequest() {} +func (*ServerReflectionRequest_ListServices) isServerReflectionRequest_MessageRequest() {} + +func (m *ServerReflectionRequest) GetMessageRequest() isServerReflectionRequest_MessageRequest { + if m != nil { + return m.MessageRequest + } + return nil +} + +func (m *ServerReflectionRequest) GetHost() string { + if m != nil { + return m.Host + } + return "" +} + +func (m *ServerReflectionRequest) GetFileByFilename() string { + if x, ok := m.GetMessageRequest().(*ServerReflectionRequest_FileByFilename); ok { + return x.FileByFilename + } + return "" +} + +func (m *ServerReflectionRequest) GetFileContainingSymbol() string { + if x, ok := m.GetMessageRequest().(*ServerReflectionRequest_FileContainingSymbol); ok { + return x.FileContainingSymbol + } + return "" +} + +func (m *ServerReflectionRequest) GetFileContainingExtension() *ExtensionRequest { + if x, ok := m.GetMessageRequest().(*ServerReflectionRequest_FileContainingExtension); ok { + return x.FileContainingExtension + } + return nil +} + +func (m *ServerReflectionRequest) GetAllExtensionNumbersOfType() string { + if x, ok := m.GetMessageRequest().(*ServerReflectionRequest_AllExtensionNumbersOfType); ok { + return x.AllExtensionNumbersOfType + } + return "" +} + +func (m *ServerReflectionRequest) GetListServices() string { + if x, ok := m.GetMessageRequest().(*ServerReflectionRequest_ListServices); ok { + return x.ListServices + } + return "" +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*ServerReflectionRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _ServerReflectionRequest_OneofMarshaler, _ServerReflectionRequest_OneofUnmarshaler, _ServerReflectionRequest_OneofSizer, []interface{}{ + (*ServerReflectionRequest_FileByFilename)(nil), + (*ServerReflectionRequest_FileContainingSymbol)(nil), + (*ServerReflectionRequest_FileContainingExtension)(nil), + (*ServerReflectionRequest_AllExtensionNumbersOfType)(nil), + (*ServerReflectionRequest_ListServices)(nil), + } +} + +func _ServerReflectionRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*ServerReflectionRequest) + // message_request + switch x := m.MessageRequest.(type) { + case *ServerReflectionRequest_FileByFilename: + b.EncodeVarint(3<<3 | proto.WireBytes) + b.EncodeStringBytes(x.FileByFilename) + case *ServerReflectionRequest_FileContainingSymbol: + b.EncodeVarint(4<<3 | proto.WireBytes) + b.EncodeStringBytes(x.FileContainingSymbol) + case *ServerReflectionRequest_FileContainingExtension: + b.EncodeVarint(5<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.FileContainingExtension); err != nil { + return err + } + case *ServerReflectionRequest_AllExtensionNumbersOfType: + b.EncodeVarint(6<<3 | proto.WireBytes) + b.EncodeStringBytes(x.AllExtensionNumbersOfType) + case *ServerReflectionRequest_ListServices: + b.EncodeVarint(7<<3 | proto.WireBytes) + b.EncodeStringBytes(x.ListServices) + case nil: + default: + return fmt.Errorf("ServerReflectionRequest.MessageRequest has unexpected type %T", x) + } + return nil +} + +func _ServerReflectionRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*ServerReflectionRequest) + switch tag { + case 3: // message_request.file_by_filename + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.MessageRequest = &ServerReflectionRequest_FileByFilename{x} + return true, err + case 4: // message_request.file_containing_symbol + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.MessageRequest = &ServerReflectionRequest_FileContainingSymbol{x} + return true, err + case 5: // message_request.file_containing_extension + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ExtensionRequest) + err := b.DecodeMessage(msg) + m.MessageRequest = &ServerReflectionRequest_FileContainingExtension{msg} + return true, err + case 6: // message_request.all_extension_numbers_of_type + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.MessageRequest = &ServerReflectionRequest_AllExtensionNumbersOfType{x} + return true, err + case 7: // message_request.list_services + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.MessageRequest = &ServerReflectionRequest_ListServices{x} + return true, err + default: + return false, nil + } +} + +func _ServerReflectionRequest_OneofSizer(msg proto.Message) (n int) { + m := msg.(*ServerReflectionRequest) + // message_request + switch x := m.MessageRequest.(type) { + case *ServerReflectionRequest_FileByFilename: + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.FileByFilename))) + n += len(x.FileByFilename) + case *ServerReflectionRequest_FileContainingSymbol: + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.FileContainingSymbol))) + n += len(x.FileContainingSymbol) + case *ServerReflectionRequest_FileContainingExtension: + s := proto.Size(x.FileContainingExtension) + n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *ServerReflectionRequest_AllExtensionNumbersOfType: + n += proto.SizeVarint(6<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.AllExtensionNumbersOfType))) + n += len(x.AllExtensionNumbersOfType) + case *ServerReflectionRequest_ListServices: + n += proto.SizeVarint(7<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.ListServices))) + n += len(x.ListServices) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// The type name and extension number sent by the client when requesting +// file_containing_extension. +type ExtensionRequest struct { + // Fully-qualified type name. The format should be . + ContainingType string `protobuf:"bytes,1,opt,name=containing_type,json=containingType" json:"containing_type,omitempty"` + ExtensionNumber int32 `protobuf:"varint,2,opt,name=extension_number,json=extensionNumber" json:"extension_number,omitempty"` +} + +func (m *ExtensionRequest) Reset() { *m = ExtensionRequest{} } +func (m *ExtensionRequest) String() string { return proto.CompactTextString(m) } +func (*ExtensionRequest) ProtoMessage() {} +func (*ExtensionRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *ExtensionRequest) GetContainingType() string { + if m != nil { + return m.ContainingType + } + return "" +} + +func (m *ExtensionRequest) GetExtensionNumber() int32 { + if m != nil { + return m.ExtensionNumber + } + return 0 +} + +// The message sent by the server to answer ServerReflectionInfo method. +type ServerReflectionResponse struct { + ValidHost string `protobuf:"bytes,1,opt,name=valid_host,json=validHost" json:"valid_host,omitempty"` + OriginalRequest *ServerReflectionRequest `protobuf:"bytes,2,opt,name=original_request,json=originalRequest" json:"original_request,omitempty"` + // The server set one of the following fields according to the message_request + // in the request. + // + // Types that are valid to be assigned to MessageResponse: + // *ServerReflectionResponse_FileDescriptorResponse + // *ServerReflectionResponse_AllExtensionNumbersResponse + // *ServerReflectionResponse_ListServicesResponse + // *ServerReflectionResponse_ErrorResponse + MessageResponse isServerReflectionResponse_MessageResponse `protobuf_oneof:"message_response"` +} + +func (m *ServerReflectionResponse) Reset() { *m = ServerReflectionResponse{} } +func (m *ServerReflectionResponse) String() string { return proto.CompactTextString(m) } +func (*ServerReflectionResponse) ProtoMessage() {} +func (*ServerReflectionResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +type isServerReflectionResponse_MessageResponse interface { + isServerReflectionResponse_MessageResponse() +} + +type ServerReflectionResponse_FileDescriptorResponse struct { + FileDescriptorResponse *FileDescriptorResponse `protobuf:"bytes,4,opt,name=file_descriptor_response,json=fileDescriptorResponse,oneof"` +} +type ServerReflectionResponse_AllExtensionNumbersResponse struct { + AllExtensionNumbersResponse *ExtensionNumberResponse `protobuf:"bytes,5,opt,name=all_extension_numbers_response,json=allExtensionNumbersResponse,oneof"` +} +type ServerReflectionResponse_ListServicesResponse struct { + ListServicesResponse *ListServiceResponse `protobuf:"bytes,6,opt,name=list_services_response,json=listServicesResponse,oneof"` +} +type ServerReflectionResponse_ErrorResponse struct { + ErrorResponse *ErrorResponse `protobuf:"bytes,7,opt,name=error_response,json=errorResponse,oneof"` +} + +func (*ServerReflectionResponse_FileDescriptorResponse) isServerReflectionResponse_MessageResponse() {} +func (*ServerReflectionResponse_AllExtensionNumbersResponse) isServerReflectionResponse_MessageResponse() { +} +func (*ServerReflectionResponse_ListServicesResponse) isServerReflectionResponse_MessageResponse() {} +func (*ServerReflectionResponse_ErrorResponse) isServerReflectionResponse_MessageResponse() {} + +func (m *ServerReflectionResponse) GetMessageResponse() isServerReflectionResponse_MessageResponse { + if m != nil { + return m.MessageResponse + } + return nil +} + +func (m *ServerReflectionResponse) GetValidHost() string { + if m != nil { + return m.ValidHost + } + return "" +} + +func (m *ServerReflectionResponse) GetOriginalRequest() *ServerReflectionRequest { + if m != nil { + return m.OriginalRequest + } + return nil +} + +func (m *ServerReflectionResponse) GetFileDescriptorResponse() *FileDescriptorResponse { + if x, ok := m.GetMessageResponse().(*ServerReflectionResponse_FileDescriptorResponse); ok { + return x.FileDescriptorResponse + } + return nil +} + +func (m *ServerReflectionResponse) GetAllExtensionNumbersResponse() *ExtensionNumberResponse { + if x, ok := m.GetMessageResponse().(*ServerReflectionResponse_AllExtensionNumbersResponse); ok { + return x.AllExtensionNumbersResponse + } + return nil +} + +func (m *ServerReflectionResponse) GetListServicesResponse() *ListServiceResponse { + if x, ok := m.GetMessageResponse().(*ServerReflectionResponse_ListServicesResponse); ok { + return x.ListServicesResponse + } + return nil +} + +func (m *ServerReflectionResponse) GetErrorResponse() *ErrorResponse { + if x, ok := m.GetMessageResponse().(*ServerReflectionResponse_ErrorResponse); ok { + return x.ErrorResponse + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*ServerReflectionResponse) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _ServerReflectionResponse_OneofMarshaler, _ServerReflectionResponse_OneofUnmarshaler, _ServerReflectionResponse_OneofSizer, []interface{}{ + (*ServerReflectionResponse_FileDescriptorResponse)(nil), + (*ServerReflectionResponse_AllExtensionNumbersResponse)(nil), + (*ServerReflectionResponse_ListServicesResponse)(nil), + (*ServerReflectionResponse_ErrorResponse)(nil), + } +} + +func _ServerReflectionResponse_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*ServerReflectionResponse) + // message_response + switch x := m.MessageResponse.(type) { + case *ServerReflectionResponse_FileDescriptorResponse: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.FileDescriptorResponse); err != nil { + return err + } + case *ServerReflectionResponse_AllExtensionNumbersResponse: + b.EncodeVarint(5<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.AllExtensionNumbersResponse); err != nil { + return err + } + case *ServerReflectionResponse_ListServicesResponse: + b.EncodeVarint(6<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ListServicesResponse); err != nil { + return err + } + case *ServerReflectionResponse_ErrorResponse: + b.EncodeVarint(7<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ErrorResponse); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("ServerReflectionResponse.MessageResponse has unexpected type %T", x) + } + return nil +} + +func _ServerReflectionResponse_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*ServerReflectionResponse) + switch tag { + case 4: // message_response.file_descriptor_response + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(FileDescriptorResponse) + err := b.DecodeMessage(msg) + m.MessageResponse = &ServerReflectionResponse_FileDescriptorResponse{msg} + return true, err + case 5: // message_response.all_extension_numbers_response + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ExtensionNumberResponse) + err := b.DecodeMessage(msg) + m.MessageResponse = &ServerReflectionResponse_AllExtensionNumbersResponse{msg} + return true, err + case 6: // message_response.list_services_response + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ListServiceResponse) + err := b.DecodeMessage(msg) + m.MessageResponse = &ServerReflectionResponse_ListServicesResponse{msg} + return true, err + case 7: // message_response.error_response + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ErrorResponse) + err := b.DecodeMessage(msg) + m.MessageResponse = &ServerReflectionResponse_ErrorResponse{msg} + return true, err + default: + return false, nil + } +} + +func _ServerReflectionResponse_OneofSizer(msg proto.Message) (n int) { + m := msg.(*ServerReflectionResponse) + // message_response + switch x := m.MessageResponse.(type) { + case *ServerReflectionResponse_FileDescriptorResponse: + s := proto.Size(x.FileDescriptorResponse) + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *ServerReflectionResponse_AllExtensionNumbersResponse: + s := proto.Size(x.AllExtensionNumbersResponse) + n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *ServerReflectionResponse_ListServicesResponse: + s := proto.Size(x.ListServicesResponse) + n += proto.SizeVarint(6<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *ServerReflectionResponse_ErrorResponse: + s := proto.Size(x.ErrorResponse) + n += proto.SizeVarint(7<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Serialized FileDescriptorProto messages sent by the server answering +// a file_by_filename, file_containing_symbol, or file_containing_extension +// request. +type FileDescriptorResponse struct { + // Serialized FileDescriptorProto messages. We avoid taking a dependency on + // descriptor.proto, which uses proto2 only features, by making them opaque + // bytes instead. + FileDescriptorProto [][]byte `protobuf:"bytes,1,rep,name=file_descriptor_proto,json=fileDescriptorProto,proto3" json:"file_descriptor_proto,omitempty"` +} + +func (m *FileDescriptorResponse) Reset() { *m = FileDescriptorResponse{} } +func (m *FileDescriptorResponse) String() string { return proto.CompactTextString(m) } +func (*FileDescriptorResponse) ProtoMessage() {} +func (*FileDescriptorResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *FileDescriptorResponse) GetFileDescriptorProto() [][]byte { + if m != nil { + return m.FileDescriptorProto + } + return nil +} + +// A list of extension numbers sent by the server answering +// all_extension_numbers_of_type request. +type ExtensionNumberResponse struct { + // Full name of the base type, including the package name. The format + // is . + BaseTypeName string `protobuf:"bytes,1,opt,name=base_type_name,json=baseTypeName" json:"base_type_name,omitempty"` + ExtensionNumber []int32 `protobuf:"varint,2,rep,packed,name=extension_number,json=extensionNumber" json:"extension_number,omitempty"` +} + +func (m *ExtensionNumberResponse) Reset() { *m = ExtensionNumberResponse{} } +func (m *ExtensionNumberResponse) String() string { return proto.CompactTextString(m) } +func (*ExtensionNumberResponse) ProtoMessage() {} +func (*ExtensionNumberResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *ExtensionNumberResponse) GetBaseTypeName() string { + if m != nil { + return m.BaseTypeName + } + return "" +} + +func (m *ExtensionNumberResponse) GetExtensionNumber() []int32 { + if m != nil { + return m.ExtensionNumber + } + return nil +} + +// A list of ServiceResponse sent by the server answering list_services request. +type ListServiceResponse struct { + // The information of each service may be expanded in the future, so we use + // ServiceResponse message to encapsulate it. + Service []*ServiceResponse `protobuf:"bytes,1,rep,name=service" json:"service,omitempty"` +} + +func (m *ListServiceResponse) Reset() { *m = ListServiceResponse{} } +func (m *ListServiceResponse) String() string { return proto.CompactTextString(m) } +func (*ListServiceResponse) ProtoMessage() {} +func (*ListServiceResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *ListServiceResponse) GetService() []*ServiceResponse { + if m != nil { + return m.Service + } + return nil +} + +// The information of a single service used by ListServiceResponse to answer +// list_services request. +type ServiceResponse struct { + // Full name of a registered service, including its package name. The format + // is . + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *ServiceResponse) Reset() { *m = ServiceResponse{} } +func (m *ServiceResponse) String() string { return proto.CompactTextString(m) } +func (*ServiceResponse) ProtoMessage() {} +func (*ServiceResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *ServiceResponse) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// The error code and error message sent by the server when an error occurs. +type ErrorResponse struct { + // This field uses the error codes defined in grpc::StatusCode. + ErrorCode int32 `protobuf:"varint,1,opt,name=error_code,json=errorCode" json:"error_code,omitempty"` + ErrorMessage string `protobuf:"bytes,2,opt,name=error_message,json=errorMessage" json:"error_message,omitempty"` +} + +func (m *ErrorResponse) Reset() { *m = ErrorResponse{} } +func (m *ErrorResponse) String() string { return proto.CompactTextString(m) } +func (*ErrorResponse) ProtoMessage() {} +func (*ErrorResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *ErrorResponse) GetErrorCode() int32 { + if m != nil { + return m.ErrorCode + } + return 0 +} + +func (m *ErrorResponse) GetErrorMessage() string { + if m != nil { + return m.ErrorMessage + } + return "" +} + +func init() { + proto.RegisterType((*ServerReflectionRequest)(nil), "grpc.reflection.v1alpha.ServerReflectionRequest") + proto.RegisterType((*ExtensionRequest)(nil), "grpc.reflection.v1alpha.ExtensionRequest") + proto.RegisterType((*ServerReflectionResponse)(nil), "grpc.reflection.v1alpha.ServerReflectionResponse") + proto.RegisterType((*FileDescriptorResponse)(nil), "grpc.reflection.v1alpha.FileDescriptorResponse") + proto.RegisterType((*ExtensionNumberResponse)(nil), "grpc.reflection.v1alpha.ExtensionNumberResponse") + proto.RegisterType((*ListServiceResponse)(nil), "grpc.reflection.v1alpha.ListServiceResponse") + proto.RegisterType((*ServiceResponse)(nil), "grpc.reflection.v1alpha.ServiceResponse") + proto.RegisterType((*ErrorResponse)(nil), "grpc.reflection.v1alpha.ErrorResponse") +} + +// 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 + +// Client API for ServerReflection service + +type ServerReflectionClient interface { + // The reflection service is structured as a bidirectional stream, ensuring + // all related requests go to a single server. + ServerReflectionInfo(ctx context.Context, opts ...grpc.CallOption) (ServerReflection_ServerReflectionInfoClient, error) +} + +type serverReflectionClient struct { + cc *grpc.ClientConn +} + +func NewServerReflectionClient(cc *grpc.ClientConn) ServerReflectionClient { + return &serverReflectionClient{cc} +} + +func (c *serverReflectionClient) ServerReflectionInfo(ctx context.Context, opts ...grpc.CallOption) (ServerReflection_ServerReflectionInfoClient, error) { + stream, err := grpc.NewClientStream(ctx, &_ServerReflection_serviceDesc.Streams[0], c.cc, "/grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo", opts...) + if err != nil { + return nil, err + } + x := &serverReflectionServerReflectionInfoClient{stream} + return x, nil +} + +type ServerReflection_ServerReflectionInfoClient interface { + Send(*ServerReflectionRequest) error + Recv() (*ServerReflectionResponse, error) + grpc.ClientStream +} + +type serverReflectionServerReflectionInfoClient struct { + grpc.ClientStream +} + +func (x *serverReflectionServerReflectionInfoClient) Send(m *ServerReflectionRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *serverReflectionServerReflectionInfoClient) Recv() (*ServerReflectionResponse, error) { + m := new(ServerReflectionResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// Server API for ServerReflection service + +type ServerReflectionServer interface { + // The reflection service is structured as a bidirectional stream, ensuring + // all related requests go to a single server. + ServerReflectionInfo(ServerReflection_ServerReflectionInfoServer) error +} + +func RegisterServerReflectionServer(s *grpc.Server, srv ServerReflectionServer) { + s.RegisterService(&_ServerReflection_serviceDesc, srv) +} + +func _ServerReflection_ServerReflectionInfo_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(ServerReflectionServer).ServerReflectionInfo(&serverReflectionServerReflectionInfoServer{stream}) +} + +type ServerReflection_ServerReflectionInfoServer interface { + Send(*ServerReflectionResponse) error + Recv() (*ServerReflectionRequest, error) + grpc.ServerStream +} + +type serverReflectionServerReflectionInfoServer struct { + grpc.ServerStream +} + +func (x *serverReflectionServerReflectionInfoServer) Send(m *ServerReflectionResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *serverReflectionServerReflectionInfoServer) Recv() (*ServerReflectionRequest, error) { + m := new(ServerReflectionRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +var _ServerReflection_serviceDesc = grpc.ServiceDesc{ + ServiceName: "grpc.reflection.v1alpha.ServerReflection", + HandlerType: (*ServerReflectionServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "ServerReflectionInfo", + Handler: _ServerReflection_ServerReflectionInfo_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "grpc_reflection_v1alpha/reflection.proto", +} + +func init() { proto.RegisterFile("grpc_reflection_v1alpha/reflection.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 656 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0x51, 0x73, 0xd2, 0x40, + 0x10, 0x6e, 0x5a, 0x68, 0x87, 0x85, 0x02, 0x5e, 0x2b, 0xa4, 0x3a, 0x75, 0x98, 0x68, 0x35, 0x75, + 0x1c, 0xda, 0xe2, 0x8c, 0x3f, 0x80, 0xaa, 0x83, 0x33, 0xb5, 0x75, 0x0e, 0x5f, 0x1c, 0x1f, 0x6e, + 0x02, 0x2c, 0x34, 0x1a, 0x72, 0xf1, 0x2e, 0x45, 0x79, 0xf2, 0x47, 0xf8, 0xa3, 0xfc, 0x4b, 0x3e, + 0x3a, 0x77, 0x09, 0x21, 0xa4, 0x44, 0xa7, 0x4f, 0x30, 0xdf, 0xee, 0xde, 0xb7, 0xbb, 0xdf, 0xb7, + 0x01, 0x7b, 0x22, 0x82, 0x21, 0x13, 0x38, 0xf6, 0x70, 0x18, 0xba, 0xdc, 0x67, 0xb3, 0x33, 0xc7, + 0x0b, 0xae, 0x9d, 0x93, 0x25, 0xd4, 0x0e, 0x04, 0x0f, 0x39, 0x69, 0xaa, 0xcc, 0x76, 0x0a, 0x8e, + 0x33, 0xad, 0x3f, 0x9b, 0xd0, 0xec, 0xa3, 0x98, 0xa1, 0x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xeb, 0xf7, 0x4e, 0x3a, 0x70, 0x3f, 0x2b, 0xa5, 0xfe, 0xf0, + 0x98, 0x46, 0x6b, 0xcb, 0xae, 0xd0, 0xbd, 0x55, 0x51, 0x3e, 0xa8, 0x90, 0xf5, 0x05, 0x9a, 0x39, + 0x2b, 0x25, 0x4f, 0xa0, 0x3a, 0x70, 0x24, 0xea, 0x03, 0x60, 0xfa, 0x1b, 0x13, 0x39, 0xb3, 0xa2, + 0x50, 0xe5, 0xff, 0x4b, 0xf5, 0x7d, 0x59, 0x7f, 0x03, 0x5b, 0xeb, 0x6e, 0xe0, 0x13, 0xec, 0xad, + 0xd9, 0x26, 0xe9, 0xc2, 0x4e, 0x2c, 0x8b, 0x6e, 0xb4, 0xdc, 0xb1, 0xff, 0xe9, 0xea, 0x54, 0x29, + 0x5d, 0x14, 0x5a, 0x47, 0x50, 0xcb, 0x3e, 0x4b, 0xa0, 0x90, 0x6a, 0x5a, 0xff, 0xb7, 0xfa, 0xb0, + 0xbb, 0xb2, 0x71, 0x75, 0x79, 0x91, 0x62, 0x43, 0x3e, 0x8a, 0x52, 0x8b, 0xb4, 0xa4, 0x91, 0x73, + 0x3e, 0x42, 0xf2, 0x18, 0x22, 0x41, 0x58, 0xac, 0x82, 0x3e, 0xbb, 0x12, 0xad, 0x68, 0xf0, 0x7d, + 0x84, 0x75, 0x7e, 0x19, 0x50, 0xcf, 0x9e, 0x1b, 0xf9, 0x09, 0xfb, 0x59, 0xec, 0x9d, 0x3f, 0xe6, + 0xe4, 0xce, 0x17, 0xfb, 0xe0, 0xec, 0x0e, 0x15, 0xd1, 0x54, 0xb6, 0x71, 0x6a, 0x0c, 0xb6, 0xb5, + 0xf4, 0x2f, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x85, 0x02, 0x09, 0x9d, 0x9f, 0x06, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/grpc/reflection/grpc_reflection_v1alpha/reflection.proto b/vendor/google.golang.org/grpc/reflection/grpc_reflection_v1alpha/reflection.proto new file mode 100644 index 0000000000..c52ccc6ab2 --- /dev/null +++ b/vendor/google.golang.org/grpc/reflection/grpc_reflection_v1alpha/reflection.proto @@ -0,0 +1,136 @@ +// Copyright 2016 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. + +// Service exported by server reflection + +syntax = "proto3"; + +package grpc.reflection.v1alpha; + +service ServerReflection { + // The reflection service is structured as a bidirectional stream, ensuring + // all related requests go to a single server. + rpc ServerReflectionInfo(stream ServerReflectionRequest) + returns (stream ServerReflectionResponse); +} + +// The message sent by the client when calling ServerReflectionInfo method. +message ServerReflectionRequest { + string host = 1; + // To use reflection service, the client should set one of the following + // fields in message_request. The server distinguishes requests by their + // defined field and then handles them using corresponding methods. + oneof message_request { + // Find a proto file by the file name. + string file_by_filename = 3; + + // Find the proto file that declares the given fully-qualified symbol name. + // This field should be a fully-qualified symbol name + // (e.g. .[.] or .). + string file_containing_symbol = 4; + + // Find the proto file which defines an extension extending the given + // message type with the given field number. + ExtensionRequest file_containing_extension = 5; + + // Finds the tag numbers used by all known extensions of extendee_type, and + // appends them to ExtensionNumberResponse in an undefined order. + // Its corresponding method is best-effort: it's not guaranteed that the + // reflection service will implement this method, and it's not guaranteed + // that this method will provide all extensions. Returns + // StatusCode::UNIMPLEMENTED if it's not implemented. + // This field should be a fully-qualified type name. The format is + // . + string all_extension_numbers_of_type = 6; + + // List the full names of registered services. The content will not be + // checked. + string list_services = 7; + } +} + +// The type name and extension number sent by the client when requesting +// file_containing_extension. +message ExtensionRequest { + // Fully-qualified type name. The format should be . + string containing_type = 1; + int32 extension_number = 2; +} + +// The message sent by the server to answer ServerReflectionInfo method. +message ServerReflectionResponse { + string valid_host = 1; + ServerReflectionRequest original_request = 2; + // The server set one of the following fields according to the message_request + // in the request. + oneof message_response { + // This message is used to answer file_by_filename, file_containing_symbol, + // file_containing_extension requests with transitive dependencies. As + // the repeated label is not allowed in oneof fields, we use a + // FileDescriptorResponse message to encapsulate the repeated fields. + // The reflection service is allowed to avoid sending FileDescriptorProtos + // that were previously sent in response to earlier requests in the stream. + FileDescriptorResponse file_descriptor_response = 4; + + // This message is used to answer all_extension_numbers_of_type requst. + ExtensionNumberResponse all_extension_numbers_response = 5; + + // This message is used to answer list_services request. + ListServiceResponse list_services_response = 6; + + // This message is used when an error occurs. + ErrorResponse error_response = 7; + } +} + +// Serialized FileDescriptorProto messages sent by the server answering +// a file_by_filename, file_containing_symbol, or file_containing_extension +// request. +message FileDescriptorResponse { + // Serialized FileDescriptorProto messages. We avoid taking a dependency on + // descriptor.proto, which uses proto2 only features, by making them opaque + // bytes instead. + repeated bytes file_descriptor_proto = 1; +} + +// A list of extension numbers sent by the server answering +// all_extension_numbers_of_type request. +message ExtensionNumberResponse { + // Full name of the base type, including the package name. The format + // is . + string base_type_name = 1; + repeated int32 extension_number = 2; +} + +// A list of ServiceResponse sent by the server answering list_services request. +message ListServiceResponse { + // The information of each service may be expanded in the future, so we use + // ServiceResponse message to encapsulate it. + repeated ServiceResponse service = 1; +} + +// The information of a single service used by ListServiceResponse to answer +// list_services request. +message ServiceResponse { + // Full name of a registered service, including its package name. The format + // is . + string name = 1; +} + +// The error code and error message sent by the server when an error occurs. +message ErrorResponse { + // This field uses the error codes defined in grpc::StatusCode. + int32 error_code = 1; + string error_message = 2; +} diff --git a/vendor/google.golang.org/grpc/reflection/grpc_testing/proto2.pb.go b/vendor/google.golang.org/grpc/reflection/grpc_testing/proto2.pb.go new file mode 100644 index 0000000000..5b01618859 --- /dev/null +++ b/vendor/google.golang.org/grpc/reflection/grpc_testing/proto2.pb.go @@ -0,0 +1,77 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: proto2.proto + +/* +Package grpc_testing is a generated protocol buffer package. + +It is generated from these files: + proto2.proto + proto2_ext.proto + proto2_ext2.proto + test.proto + +It has these top-level messages: + ToBeExtended + Extension + AnotherExtension + SearchResponse + SearchRequest +*/ +package grpc_testing + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import 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.ProtoPackageIsVersion2 // please upgrade the proto package + +type ToBeExtended struct { + Foo *int32 `protobuf:"varint,1,req,name=foo" json:"foo,omitempty"` + proto.XXX_InternalExtensions `json:"-"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *ToBeExtended) Reset() { *m = ToBeExtended{} } +func (m *ToBeExtended) String() string { return proto.CompactTextString(m) } +func (*ToBeExtended) ProtoMessage() {} +func (*ToBeExtended) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +var extRange_ToBeExtended = []proto.ExtensionRange{ + {10, 30}, +} + +func (*ToBeExtended) ExtensionRangeArray() []proto.ExtensionRange { + return extRange_ToBeExtended +} + +func (m *ToBeExtended) GetFoo() int32 { + if m != nil && m.Foo != nil { + return *m.Foo + } + return 0 +} + +func init() { + proto.RegisterType((*ToBeExtended)(nil), "grpc.testing.ToBeExtended") +} + +func init() { proto.RegisterFile("proto2.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 86 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x29, 0x28, 0xca, 0x2f, + 0xc9, 0x37, 0xd2, 0x03, 0x53, 0x42, 0x3c, 0xe9, 0x45, 0x05, 0xc9, 0x7a, 0x25, 0xa9, 0xc5, 0x25, + 0x99, 0x79, 0xe9, 0x4a, 0x6a, 0x5c, 0x3c, 0x21, 0xf9, 0x4e, 0xa9, 0xae, 0x15, 0x25, 0xa9, 0x79, + 0x29, 0xa9, 0x29, 0x42, 0x02, 0x5c, 0xcc, 0x69, 0xf9, 0xf9, 0x12, 0x8c, 0x0a, 0x4c, 0x1a, 0xac, + 0x41, 0x20, 0xa6, 0x16, 0x0b, 0x07, 0x97, 0x80, 0x3c, 0x20, 0x00, 0x00, 0xff, 0xff, 0x74, 0x86, + 0x9c, 0x08, 0x44, 0x00, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/grpc/reflection/grpc_testing/proto2.proto b/vendor/google.golang.org/grpc/reflection/grpc_testing/proto2.proto new file mode 100644 index 0000000000..a675d143d7 --- /dev/null +++ b/vendor/google.golang.org/grpc/reflection/grpc_testing/proto2.proto @@ -0,0 +1,22 @@ +// Copyright 2017 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. + +syntax = "proto2"; + +package grpc.testing; + +message ToBeExtended { + required int32 foo = 1; + extensions 10 to 30; +} diff --git a/vendor/google.golang.org/grpc/reflection/grpc_testing/proto2_ext.pb.go b/vendor/google.golang.org/grpc/reflection/grpc_testing/proto2_ext.pb.go new file mode 100644 index 0000000000..9ae4f07af1 --- /dev/null +++ b/vendor/google.golang.org/grpc/reflection/grpc_testing/proto2_ext.pb.go @@ -0,0 +1,82 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: proto2_ext.proto + +package grpc_testing + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +type Extension struct { + Whatzit *int32 `protobuf:"varint,1,opt,name=whatzit" json:"whatzit,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Extension) Reset() { *m = Extension{} } +func (m *Extension) String() string { return proto.CompactTextString(m) } +func (*Extension) ProtoMessage() {} +func (*Extension) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +func (m *Extension) GetWhatzit() int32 { + if m != nil && m.Whatzit != nil { + return *m.Whatzit + } + return 0 +} + +var E_Foo = &proto.ExtensionDesc{ + ExtendedType: (*ToBeExtended)(nil), + ExtensionType: (*int32)(nil), + Field: 13, + Name: "grpc.testing.foo", + Tag: "varint,13,opt,name=foo", + Filename: "proto2_ext.proto", +} + +var E_Bar = &proto.ExtensionDesc{ + ExtendedType: (*ToBeExtended)(nil), + ExtensionType: (*Extension)(nil), + Field: 17, + Name: "grpc.testing.bar", + Tag: "bytes,17,opt,name=bar", + Filename: "proto2_ext.proto", +} + +var E_Baz = &proto.ExtensionDesc{ + ExtendedType: (*ToBeExtended)(nil), + ExtensionType: (*SearchRequest)(nil), + Field: 19, + Name: "grpc.testing.baz", + Tag: "bytes,19,opt,name=baz", + Filename: "proto2_ext.proto", +} + +func init() { + proto.RegisterType((*Extension)(nil), "grpc.testing.Extension") + proto.RegisterExtension(E_Foo) + proto.RegisterExtension(E_Bar) + proto.RegisterExtension(E_Baz) +} + +func init() { proto.RegisterFile("proto2_ext.proto", fileDescriptor1) } + +var fileDescriptor1 = []byte{ + // 179 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x28, 0x28, 0xca, 0x2f, + 0xc9, 0x37, 0x8a, 0x4f, 0xad, 0x28, 0xd1, 0x03, 0x33, 0x85, 0x78, 0xd2, 0x8b, 0x0a, 0x92, 0xf5, + 0x4a, 0x52, 0x8b, 0x4b, 0x32, 0xf3, 0xd2, 0xa5, 0x78, 0x20, 0xf2, 0x10, 0x39, 0x29, 0x2e, 0x90, + 0x30, 0x84, 0xad, 0xa4, 0xca, 0xc5, 0xe9, 0x5a, 0x51, 0x92, 0x9a, 0x57, 0x9c, 0x99, 0x9f, 0x27, + 0x24, 0xc1, 0xc5, 0x5e, 0x9e, 0x91, 0x58, 0x52, 0x95, 0x59, 0x22, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, + 0x1a, 0x04, 0xe3, 0x5a, 0xe9, 0x70, 0x31, 0xa7, 0xe5, 0xe7, 0x0b, 0x49, 0xe9, 0x21, 0x1b, 0xab, + 0x17, 0x92, 0xef, 0x94, 0x0a, 0xd6, 0x9d, 0x92, 0x9a, 0x22, 0xc1, 0x0b, 0xd6, 0x01, 0x52, 0x66, + 0xe5, 0xca, 0xc5, 0x9c, 0x94, 0x58, 0x84, 0x57, 0xb5, 0xa0, 0x02, 0xa3, 0x06, 0xb7, 0x91, 0x38, + 0xaa, 0x0a, 0xb8, 0x4b, 0x82, 0x40, 0xfa, 0xad, 0x3c, 0x41, 0xc6, 0x54, 0xe1, 0x35, 0x46, 0x18, + 0x6c, 0x8c, 0x34, 0xaa, 0x8a, 0xe0, 0xd4, 0xc4, 0xa2, 0xe4, 0x8c, 0xa0, 0xd4, 0xc2, 0xd2, 0xd4, + 0xe2, 0x12, 0x90, 0x51, 0x55, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x71, 0x6b, 0x94, 0x9f, 0x21, + 0x01, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/grpc/reflection/grpc_testing/proto2_ext.proto b/vendor/google.golang.org/grpc/reflection/grpc_testing/proto2_ext.proto new file mode 100644 index 0000000000..a4942e481b --- /dev/null +++ b/vendor/google.golang.org/grpc/reflection/grpc_testing/proto2_ext.proto @@ -0,0 +1,30 @@ +// Copyright 2017 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. + +syntax = "proto2"; + +package grpc.testing; + +import "proto2.proto"; +import "test.proto"; + +extend ToBeExtended { + optional int32 foo = 13; + optional Extension bar = 17; + optional SearchRequest baz = 19; +} + +message Extension { + optional int32 whatzit = 1; +} diff --git a/vendor/google.golang.org/grpc/reflection/grpc_testing/proto2_ext2.pb.go b/vendor/google.golang.org/grpc/reflection/grpc_testing/proto2_ext2.pb.go new file mode 100644 index 0000000000..26ec982aa4 --- /dev/null +++ b/vendor/google.golang.org/grpc/reflection/grpc_testing/proto2_ext2.pb.go @@ -0,0 +1,71 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: proto2_ext2.proto + +package grpc_testing + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +type AnotherExtension struct { + Whatchamacallit *int32 `protobuf:"varint,1,opt,name=whatchamacallit" json:"whatchamacallit,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *AnotherExtension) Reset() { *m = AnotherExtension{} } +func (m *AnotherExtension) String() string { return proto.CompactTextString(m) } +func (*AnotherExtension) ProtoMessage() {} +func (*AnotherExtension) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} } + +func (m *AnotherExtension) GetWhatchamacallit() int32 { + if m != nil && m.Whatchamacallit != nil { + return *m.Whatchamacallit + } + return 0 +} + +var E_Frob = &proto.ExtensionDesc{ + ExtendedType: (*ToBeExtended)(nil), + ExtensionType: (*string)(nil), + Field: 23, + Name: "grpc.testing.frob", + Tag: "bytes,23,opt,name=frob", + Filename: "proto2_ext2.proto", +} + +var E_Nitz = &proto.ExtensionDesc{ + ExtendedType: (*ToBeExtended)(nil), + ExtensionType: (*AnotherExtension)(nil), + Field: 29, + Name: "grpc.testing.nitz", + Tag: "bytes,29,opt,name=nitz", + Filename: "proto2_ext2.proto", +} + +func init() { + proto.RegisterType((*AnotherExtension)(nil), "grpc.testing.AnotherExtension") + proto.RegisterExtension(E_Frob) + proto.RegisterExtension(E_Nitz) +} + +func init() { proto.RegisterFile("proto2_ext2.proto", fileDescriptor2) } + +var fileDescriptor2 = []byte{ + // 165 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2c, 0x28, 0xca, 0x2f, + 0xc9, 0x37, 0x8a, 0x4f, 0xad, 0x28, 0x31, 0xd2, 0x03, 0xb3, 0x85, 0x78, 0xd2, 0x8b, 0x0a, 0x92, + 0xf5, 0x4a, 0x52, 0x8b, 0x4b, 0x32, 0xf3, 0xd2, 0xa5, 0x78, 0x20, 0x0a, 0x20, 0x72, 0x4a, 0x36, + 0x5c, 0x02, 0x8e, 0x79, 0xf9, 0x25, 0x19, 0xa9, 0x45, 0xae, 0x15, 0x25, 0xa9, 0x79, 0xc5, 0x99, + 0xf9, 0x79, 0x42, 0x1a, 0x5c, 0xfc, 0xe5, 0x19, 0x89, 0x25, 0xc9, 0x19, 0x89, 0xb9, 0x89, 0xc9, + 0x89, 0x39, 0x39, 0x99, 0x25, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0xac, 0x41, 0xe8, 0xc2, 0x56, 0x7a, + 0x5c, 0x2c, 0x69, 0x45, 0xf9, 0x49, 0x42, 0x52, 0x7a, 0xc8, 0x56, 0xe8, 0x85, 0xe4, 0x3b, 0xa5, + 0x82, 0x8d, 0x4b, 0x49, 0x4d, 0x91, 0x10, 0x57, 0x60, 0xd4, 0xe0, 0x0c, 0x02, 0xab, 0xb3, 0xf2, + 0xe3, 0x62, 0xc9, 0xcb, 0x2c, 0xa9, 0xc2, 0xab, 0x5e, 0x56, 0x81, 0x51, 0x83, 0xdb, 0x48, 0x0e, + 0x55, 0x05, 0xba, 0x1b, 0x83, 0xc0, 0xe6, 0x00, 0x02, 0x00, 0x00, 0xff, 0xff, 0xf0, 0x7e, 0x0d, + 0x26, 0xed, 0x00, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/grpc/reflection/grpc_testing/proto2_ext2.proto b/vendor/google.golang.org/grpc/reflection/grpc_testing/proto2_ext2.proto new file mode 100644 index 0000000000..d91ba00619 --- /dev/null +++ b/vendor/google.golang.org/grpc/reflection/grpc_testing/proto2_ext2.proto @@ -0,0 +1,28 @@ +// Copyright 2017 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. + +syntax = "proto2"; + +package grpc.testing; + +import "proto2.proto"; + +extend ToBeExtended { + optional string frob = 23; + optional AnotherExtension nitz = 29; +} + +message AnotherExtension { + optional int32 whatchamacallit = 1; +} diff --git a/vendor/google.golang.org/grpc/reflection/grpc_testing/test.pb.go b/vendor/google.golang.org/grpc/reflection/grpc_testing/test.pb.go new file mode 100644 index 0000000000..62f71ff158 --- /dev/null +++ b/vendor/google.golang.org/grpc/reflection/grpc_testing/test.pb.go @@ -0,0 +1,247 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: test.proto + +package grpc_testing + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +type SearchResponse struct { + Results []*SearchResponse_Result `protobuf:"bytes,1,rep,name=results" json:"results,omitempty"` +} + +func (m *SearchResponse) Reset() { *m = SearchResponse{} } +func (m *SearchResponse) String() string { return proto.CompactTextString(m) } +func (*SearchResponse) ProtoMessage() {} +func (*SearchResponse) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} } + +func (m *SearchResponse) GetResults() []*SearchResponse_Result { + if m != nil { + return m.Results + } + return nil +} + +type SearchResponse_Result struct { + Url string `protobuf:"bytes,1,opt,name=url" json:"url,omitempty"` + Title string `protobuf:"bytes,2,opt,name=title" json:"title,omitempty"` + Snippets []string `protobuf:"bytes,3,rep,name=snippets" json:"snippets,omitempty"` +} + +func (m *SearchResponse_Result) Reset() { *m = SearchResponse_Result{} } +func (m *SearchResponse_Result) String() string { return proto.CompactTextString(m) } +func (*SearchResponse_Result) ProtoMessage() {} +func (*SearchResponse_Result) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0, 0} } + +func (m *SearchResponse_Result) GetUrl() string { + if m != nil { + return m.Url + } + return "" +} + +func (m *SearchResponse_Result) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *SearchResponse_Result) GetSnippets() []string { + if m != nil { + return m.Snippets + } + return nil +} + +type SearchRequest struct { + Query string `protobuf:"bytes,1,opt,name=query" json:"query,omitempty"` +} + +func (m *SearchRequest) Reset() { *m = SearchRequest{} } +func (m *SearchRequest) String() string { return proto.CompactTextString(m) } +func (*SearchRequest) ProtoMessage() {} +func (*SearchRequest) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{1} } + +func (m *SearchRequest) GetQuery() string { + if m != nil { + return m.Query + } + return "" +} + +func init() { + proto.RegisterType((*SearchResponse)(nil), "grpc.testing.SearchResponse") + proto.RegisterType((*SearchResponse_Result)(nil), "grpc.testing.SearchResponse.Result") + proto.RegisterType((*SearchRequest)(nil), "grpc.testing.SearchRequest") +} + +// 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 + +// Client API for SearchService service + +type SearchServiceClient interface { + Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error) + StreamingSearch(ctx context.Context, opts ...grpc.CallOption) (SearchService_StreamingSearchClient, error) +} + +type searchServiceClient struct { + cc *grpc.ClientConn +} + +func NewSearchServiceClient(cc *grpc.ClientConn) SearchServiceClient { + return &searchServiceClient{cc} +} + +func (c *searchServiceClient) Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error) { + out := new(SearchResponse) + err := grpc.Invoke(ctx, "/grpc.testing.SearchService/Search", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *searchServiceClient) StreamingSearch(ctx context.Context, opts ...grpc.CallOption) (SearchService_StreamingSearchClient, error) { + stream, err := grpc.NewClientStream(ctx, &_SearchService_serviceDesc.Streams[0], c.cc, "/grpc.testing.SearchService/StreamingSearch", opts...) + if err != nil { + return nil, err + } + x := &searchServiceStreamingSearchClient{stream} + return x, nil +} + +type SearchService_StreamingSearchClient interface { + Send(*SearchRequest) error + Recv() (*SearchResponse, error) + grpc.ClientStream +} + +type searchServiceStreamingSearchClient struct { + grpc.ClientStream +} + +func (x *searchServiceStreamingSearchClient) Send(m *SearchRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *searchServiceStreamingSearchClient) Recv() (*SearchResponse, error) { + m := new(SearchResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// Server API for SearchService service + +type SearchServiceServer interface { + Search(context.Context, *SearchRequest) (*SearchResponse, error) + StreamingSearch(SearchService_StreamingSearchServer) error +} + +func RegisterSearchServiceServer(s *grpc.Server, srv SearchServiceServer) { + s.RegisterService(&_SearchService_serviceDesc, srv) +} + +func _SearchService_Search_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SearchRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SearchServiceServer).Search(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.testing.SearchService/Search", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SearchServiceServer).Search(ctx, req.(*SearchRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SearchService_StreamingSearch_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(SearchServiceServer).StreamingSearch(&searchServiceStreamingSearchServer{stream}) +} + +type SearchService_StreamingSearchServer interface { + Send(*SearchResponse) error + Recv() (*SearchRequest, error) + grpc.ServerStream +} + +type searchServiceStreamingSearchServer struct { + grpc.ServerStream +} + +func (x *searchServiceStreamingSearchServer) Send(m *SearchResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *searchServiceStreamingSearchServer) Recv() (*SearchRequest, error) { + m := new(SearchRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +var _SearchService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "grpc.testing.SearchService", + HandlerType: (*SearchServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Search", + Handler: _SearchService_Search_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "StreamingSearch", + Handler: _SearchService_StreamingSearch_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "test.proto", +} + +func init() { proto.RegisterFile("test.proto", fileDescriptor3) } + +var fileDescriptor3 = []byte{ + // 231 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x91, 0xbd, 0x4a, 0xc5, 0x40, + 0x10, 0x85, 0x59, 0x83, 0xd1, 0x3b, 0xfe, 0x32, 0x58, 0x84, 0x68, 0x11, 0xae, 0x08, 0xa9, 0x16, + 0xb9, 0xd6, 0x56, 0xb6, 0x16, 0xb2, 0x79, 0x82, 0x6b, 0x18, 0xe2, 0x42, 0x4c, 0x36, 0x33, 0x13, + 0xc1,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--git a/vendor/google.golang.org/grpc/reflection/grpc_testing/test.proto b/vendor/google.golang.org/grpc/reflection/grpc_testing/test.proto new file mode 100644 index 0000000000..cae3f01a04 --- /dev/null +++ b/vendor/google.golang.org/grpc/reflection/grpc_testing/test.proto @@ -0,0 +1,35 @@ +// Copyright 2017 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. + +syntax = "proto3"; + +package grpc.testing; + +message SearchResponse { + message Result { + string url = 1; + string title = 2; + repeated string snippets = 3; + } + repeated Result results = 1; +} + +message SearchRequest { + string query = 1; +} + +service SearchService { + rpc Search(SearchRequest) returns (SearchResponse); + rpc StreamingSearch(stream SearchRequest) returns (stream SearchResponse); +} diff --git a/vendor/google.golang.org/grpc/reflection/grpc_testingv3/testv3.pb.go b/vendor/google.golang.org/grpc/reflection/grpc_testingv3/testv3.pb.go new file mode 100644 index 0000000000..78876aae78 --- /dev/null +++ b/vendor/google.golang.org/grpc/reflection/grpc_testingv3/testv3.pb.go @@ -0,0 +1,236 @@ +// Code generated by protoc-gen-go. +// source: testv3.proto +// DO NOT EDIT! + +/* +Package grpc_testingv3 is a generated protocol buffer package. + +It is generated from these files: + testv3.proto + +It has these top-level messages: + SearchResponseV3 + SearchRequestV3 +*/ +package grpc_testingv3 + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +type SearchResponseV3 struct { + Results []*SearchResponseV3_Result `protobuf:"bytes,1,rep,name=results" json:"results,omitempty"` +} + +func (m *SearchResponseV3) Reset() { *m = SearchResponseV3{} } +func (m *SearchResponseV3) String() string { return proto.CompactTextString(m) } +func (*SearchResponseV3) ProtoMessage() {} +func (*SearchResponseV3) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *SearchResponseV3) GetResults() []*SearchResponseV3_Result { + if m != nil { + return m.Results + } + return nil +} + +type SearchResponseV3_Result struct { + Url string `protobuf:"bytes,1,opt,name=url" json:"url,omitempty"` + Title string `protobuf:"bytes,2,opt,name=title" json:"title,omitempty"` + Snippets []string `protobuf:"bytes,3,rep,name=snippets" json:"snippets,omitempty"` +} + +func (m *SearchResponseV3_Result) Reset() { *m = SearchResponseV3_Result{} } +func (m *SearchResponseV3_Result) String() string { return proto.CompactTextString(m) } +func (*SearchResponseV3_Result) ProtoMessage() {} +func (*SearchResponseV3_Result) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 0} } + +type SearchRequestV3 struct { + Query string `protobuf:"bytes,1,opt,name=query" json:"query,omitempty"` +} + +func (m *SearchRequestV3) Reset() { *m = SearchRequestV3{} } +func (m *SearchRequestV3) String() string { return proto.CompactTextString(m) } +func (*SearchRequestV3) ProtoMessage() {} +func (*SearchRequestV3) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func init() { + proto.RegisterType((*SearchResponseV3)(nil), "grpc.testingv3.SearchResponseV3") + proto.RegisterType((*SearchResponseV3_Result)(nil), "grpc.testingv3.SearchResponseV3.Result") + proto.RegisterType((*SearchRequestV3)(nil), "grpc.testingv3.SearchRequestV3") +} + +// 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.SupportPackageIsVersion3 + +// Client API for SearchServiceV3 service + +type SearchServiceV3Client interface { + Search(ctx context.Context, in *SearchRequestV3, opts ...grpc.CallOption) (*SearchResponseV3, error) + StreamingSearch(ctx context.Context, opts ...grpc.CallOption) (SearchServiceV3_StreamingSearchClient, error) +} + +type searchServiceV3Client struct { + cc *grpc.ClientConn +} + +func NewSearchServiceV3Client(cc *grpc.ClientConn) SearchServiceV3Client { + return &searchServiceV3Client{cc} +} + +func (c *searchServiceV3Client) Search(ctx context.Context, in *SearchRequestV3, opts ...grpc.CallOption) (*SearchResponseV3, error) { + out := new(SearchResponseV3) + err := grpc.Invoke(ctx, "/grpc.testingv3.SearchServiceV3/Search", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *searchServiceV3Client) StreamingSearch(ctx context.Context, opts ...grpc.CallOption) (SearchServiceV3_StreamingSearchClient, error) { + stream, err := grpc.NewClientStream(ctx, &_SearchServiceV3_serviceDesc.Streams[0], c.cc, "/grpc.testingv3.SearchServiceV3/StreamingSearch", opts...) + if err != nil { + return nil, err + } + x := &searchServiceV3StreamingSearchClient{stream} + return x, nil +} + +type SearchServiceV3_StreamingSearchClient interface { + Send(*SearchRequestV3) error + Recv() (*SearchResponseV3, error) + grpc.ClientStream +} + +type searchServiceV3StreamingSearchClient struct { + grpc.ClientStream +} + +func (x *searchServiceV3StreamingSearchClient) Send(m *SearchRequestV3) error { + return x.ClientStream.SendMsg(m) +} + +func (x *searchServiceV3StreamingSearchClient) Recv() (*SearchResponseV3, error) { + m := new(SearchResponseV3) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// Server API for SearchServiceV3 service + +type SearchServiceV3Server interface { + Search(context.Context, *SearchRequestV3) (*SearchResponseV3, error) + StreamingSearch(SearchServiceV3_StreamingSearchServer) error +} + +func RegisterSearchServiceV3Server(s *grpc.Server, srv SearchServiceV3Server) { + s.RegisterService(&_SearchServiceV3_serviceDesc, srv) +} + +func _SearchServiceV3_Search_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SearchRequestV3) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SearchServiceV3Server).Search(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.testingv3.SearchServiceV3/Search", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SearchServiceV3Server).Search(ctx, req.(*SearchRequestV3)) + } + return interceptor(ctx, in, info, handler) +} + +func _SearchServiceV3_StreamingSearch_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(SearchServiceV3Server).StreamingSearch(&searchServiceV3StreamingSearchServer{stream}) +} + +type SearchServiceV3_StreamingSearchServer interface { + Send(*SearchResponseV3) error + Recv() (*SearchRequestV3, error) + grpc.ServerStream +} + +type searchServiceV3StreamingSearchServer struct { + grpc.ServerStream +} + +func (x *searchServiceV3StreamingSearchServer) Send(m *SearchResponseV3) error { + return x.ServerStream.SendMsg(m) +} + +func (x *searchServiceV3StreamingSearchServer) Recv() (*SearchRequestV3, error) { + m := new(SearchRequestV3) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +var _SearchServiceV3_serviceDesc = grpc.ServiceDesc{ + ServiceName: "grpc.testingv3.SearchServiceV3", + HandlerType: (*SearchServiceV3Server)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Search", + Handler: _SearchServiceV3_Search_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "StreamingSearch", + Handler: _SearchServiceV3_StreamingSearch_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: fileDescriptor0, +} + +func init() { proto.RegisterFile("testv3.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 240 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x91, 0x41, 0x4b, 0xc3, 0x40, + 0x10, 0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, 0xfe, 0x9a, 0x71, 0x84, 0xa6, 0xd9, 0x7f, 0x3b, 0xf5, + 0x33, 0x2c, 0x0b, 0x21, 0xdc, 0xbf, 0xf9, 0xa6, 0x3a, 0x19, 0x35, 0x57, 0xf7, 0xea, 0x25, 0x1e, + 0x0f, 0x64, 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff, 0xd4, 0xe6, 0xa0, 0xf9, 0xb0, 0x01, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/grpc/reflection/grpc_testingv3/testv3.proto b/vendor/google.golang.org/grpc/reflection/grpc_testingv3/testv3.proto new file mode 100644 index 0000000000..1e175193ef --- /dev/null +++ b/vendor/google.golang.org/grpc/reflection/grpc_testingv3/testv3.proto @@ -0,0 +1,21 @@ +syntax = "proto3"; + +package grpc.testingv3; + +message SearchResponseV3 { + message Result { + string url = 1; + string title = 2; + repeated string snippets = 3; + } + repeated Result results = 1; +} + +message SearchRequestV3 { + string query = 1; +} + +service SearchServiceV3 { + rpc Search(SearchRequestV3) returns (SearchResponseV3); + rpc StreamingSearch(stream SearchRequestV3) returns (stream SearchResponseV3); +} diff --git a/vendor/google.golang.org/grpc/reflection/serverreflection.go b/vendor/google.golang.org/grpc/reflection/serverreflection.go new file mode 100644 index 0000000000..1bfbf3e780 --- /dev/null +++ b/vendor/google.golang.org/grpc/reflection/serverreflection.go @@ -0,0 +1,399 @@ +/* + * + * Copyright 2016 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. + * + */ + +//go:generate protoc --go_out=plugins=grpc:. grpc_reflection_v1alpha/reflection.proto + +/* +Package reflection implements server reflection service. + +The service implemented is defined in: +https://github.com/grpc/grpc/blob/master/src/proto/grpc/reflection/v1alpha/reflection.proto. + +To register server reflection on a gRPC server: + import "google.golang.org/grpc/reflection" + + s := grpc.NewServer() + pb.RegisterYourOwnServer(s, &server{}) + + // Register reflection service on gRPC server. + reflection.Register(s) + + s.Serve(lis) + +*/ +package reflection // import "google.golang.org/grpc/reflection" + +import ( + "bytes" + "compress/gzip" + "fmt" + "io" + "io/ioutil" + "reflect" + "strings" + + "github.com/golang/protobuf/proto" + dpb "github.com/golang/protobuf/protoc-gen-go/descriptor" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + rpb "google.golang.org/grpc/reflection/grpc_reflection_v1alpha" + "google.golang.org/grpc/status" +) + +type serverReflectionServer struct { + s *grpc.Server + // TODO add more cache if necessary + serviceInfo map[string]grpc.ServiceInfo // cache for s.GetServiceInfo() +} + +// Register registers the server reflection service on the given gRPC server. +func Register(s *grpc.Server) { + rpb.RegisterServerReflectionServer(s, &serverReflectionServer{ + s: s, + }) +} + +// protoMessage is used for type assertion on proto messages. +// Generated proto message implements function Descriptor(), but Descriptor() +// is not part of interface proto.Message. This interface is needed to +// call Descriptor(). +type protoMessage interface { + Descriptor() ([]byte, []int) +} + +// fileDescForType gets the file descriptor for the given type. +// The given type should be a proto message. +func (s *serverReflectionServer) fileDescForType(st reflect.Type) (*dpb.FileDescriptorProto, error) { + m, ok := reflect.Zero(reflect.PtrTo(st)).Interface().(protoMessage) + if !ok { + return nil, fmt.Errorf("failed to create message from type: %v", st) + } + enc, _ := m.Descriptor() + + return s.decodeFileDesc(enc) +} + +// decodeFileDesc does decompression and unmarshalling on the given +// file descriptor byte slice. +func (s *serverReflectionServer) decodeFileDesc(enc []byte) (*dpb.FileDescriptorProto, error) { + raw, err := decompress(enc) + if err != nil { + return nil, fmt.Errorf("failed to decompress enc: %v", err) + } + + fd := new(dpb.FileDescriptorProto) + if err := proto.Unmarshal(raw, fd); err != nil { + return nil, fmt.Errorf("bad descriptor: %v", err) + } + return fd, nil +} + +// decompress does gzip decompression. +func decompress(b []byte) ([]byte, error) { + r, err := gzip.NewReader(bytes.NewReader(b)) + if err != nil { + return nil, fmt.Errorf("bad gzipped descriptor: %v", err) + } + out, err := ioutil.ReadAll(r) + if err != nil { + return nil, fmt.Errorf("bad gzipped descriptor: %v", err) + } + return out, nil +} + +func (s *serverReflectionServer) typeForName(name string) (reflect.Type, error) { + pt := proto.MessageType(name) + if pt == nil { + return nil, fmt.Errorf("unknown type: %q", name) + } + st := pt.Elem() + + return st, nil +} + +func (s *serverReflectionServer) fileDescContainingExtension(st reflect.Type, ext int32) (*dpb.FileDescriptorProto, error) { + m, ok := reflect.Zero(reflect.PtrTo(st)).Interface().(proto.Message) + if !ok { + return nil, fmt.Errorf("failed to create message from type: %v", st) + } + + var extDesc *proto.ExtensionDesc + for id, desc := range proto.RegisteredExtensions(m) { + if id == ext { + extDesc = desc + break + } + } + + if extDesc == nil { + return nil, fmt.Errorf("failed to find registered extension for extension number %v", ext) + } + + return s.decodeFileDesc(proto.FileDescriptor(extDesc.Filename)) +} + +func (s *serverReflectionServer) allExtensionNumbersForType(st reflect.Type) ([]int32, error) { + m, ok := reflect.Zero(reflect.PtrTo(st)).Interface().(proto.Message) + if !ok { + return nil, fmt.Errorf("failed to create message from type: %v", st) + } + + exts := proto.RegisteredExtensions(m) + out := make([]int32, 0, len(exts)) + for id := range exts { + out = append(out, id) + } + return out, nil +} + +// fileDescEncodingByFilename finds the file descriptor for given filename, +// does marshalling on it and returns the marshalled result. +func (s *serverReflectionServer) fileDescEncodingByFilename(name string) ([]byte, error) { + enc := proto.FileDescriptor(name) + if enc == nil { + return nil, fmt.Errorf("unknown file: %v", name) + } + fd, err := s.decodeFileDesc(enc) + if err != nil { + return nil, err + } + return proto.Marshal(fd) +} + +// serviceMetadataForSymbol finds the metadata for name in s.serviceInfo. +// name should be a service name or a method name. +func (s *serverReflectionServer) serviceMetadataForSymbol(name string) (interface{}, error) { + if s.serviceInfo == nil { + s.serviceInfo = s.s.GetServiceInfo() + } + + // Check if it's a service name. + if info, ok := s.serviceInfo[name]; ok { + return info.Metadata, nil + } + + // Check if it's a method name. + pos := strings.LastIndex(name, ".") + // Not a valid method name. + if pos == -1 { + return nil, fmt.Errorf("unknown symbol: %v", name) + } + + info, ok := s.serviceInfo[name[:pos]] + // Substring before last "." is not a service name. + if !ok { + return nil, fmt.Errorf("unknown symbol: %v", name) + } + + // Search the method name in info.Methods. + var found bool + for _, m := range info.Methods { + if m.Name == name[pos+1:] { + found = true + break + } + } + if found { + return info.Metadata, nil + } + + return nil, fmt.Errorf("unknown symbol: %v", name) +} + +// parseMetadata finds the file descriptor bytes specified meta. +// For SupportPackageIsVersion4, m is the name of the proto file, we +// call proto.FileDescriptor to get the byte slice. +// For SupportPackageIsVersion3, m is a byte slice itself. +func parseMetadata(meta interface{}) ([]byte, bool) { + // Check if meta is the file name. + if fileNameForMeta, ok := meta.(string); ok { + return proto.FileDescriptor(fileNameForMeta), true + } + + // Check if meta is the byte slice. + if enc, ok := meta.([]byte); ok { + return enc, true + } + + return nil, false +} + +// fileDescEncodingContainingSymbol finds the file descriptor containing the given symbol, +// does marshalling on it and returns the marshalled result. +// The given symbol can be a type, a service or a method. +func (s *serverReflectionServer) fileDescEncodingContainingSymbol(name string) ([]byte, error) { + var ( + fd *dpb.FileDescriptorProto + ) + // Check if it's a type name. + if st, err := s.typeForName(name); err == nil { + fd, err = s.fileDescForType(st) + if err != nil { + return nil, err + } + } else { // Check if it's a service name or a method name. + meta, err := s.serviceMetadataForSymbol(name) + + // Metadata not found. + if err != nil { + return nil, err + } + + // Metadata not valid. + enc, ok := parseMetadata(meta) + if !ok { + return nil, fmt.Errorf("invalid file descriptor for symbol: %v", name) + } + + fd, err = s.decodeFileDesc(enc) + if err != nil { + return nil, err + } + } + + return proto.Marshal(fd) +} + +// fileDescEncodingContainingExtension finds the file descriptor containing given extension, +// does marshalling on it and returns the marshalled result. +func (s *serverReflectionServer) fileDescEncodingContainingExtension(typeName string, extNum int32) ([]byte, error) { + st, err := s.typeForName(typeName) + if err != nil { + return nil, err + } + fd, err := s.fileDescContainingExtension(st, extNum) + if err != nil { + return nil, err + } + return proto.Marshal(fd) +} + +// allExtensionNumbersForTypeName returns all extension numbers for the given type. +func (s *serverReflectionServer) allExtensionNumbersForTypeName(name string) ([]int32, error) { + st, err := s.typeForName(name) + if err != nil { + return nil, err + } + extNums, err := s.allExtensionNumbersForType(st) + if err != nil { + return nil, err + } + return extNums, nil +} + +// ServerReflectionInfo is the reflection service handler. +func (s *serverReflectionServer) ServerReflectionInfo(stream rpb.ServerReflection_ServerReflectionInfoServer) error { + for { + in, err := stream.Recv() + if err == io.EOF { + return nil + } + if err != nil { + return err + } + + out := &rpb.ServerReflectionResponse{ + ValidHost: in.Host, + OriginalRequest: in, + } + switch req := in.MessageRequest.(type) { + case *rpb.ServerReflectionRequest_FileByFilename: + b, err := s.fileDescEncodingByFilename(req.FileByFilename) + if err != nil { + out.MessageResponse = &rpb.ServerReflectionResponse_ErrorResponse{ + ErrorResponse: &rpb.ErrorResponse{ + ErrorCode: int32(codes.NotFound), + ErrorMessage: err.Error(), + }, + } + } else { + out.MessageResponse = &rpb.ServerReflectionResponse_FileDescriptorResponse{ + FileDescriptorResponse: &rpb.FileDescriptorResponse{FileDescriptorProto: [][]byte{b}}, + } + } + case *rpb.ServerReflectionRequest_FileContainingSymbol: + b, err := s.fileDescEncodingContainingSymbol(req.FileContainingSymbol) + if err != nil { + out.MessageResponse = &rpb.ServerReflectionResponse_ErrorResponse{ + ErrorResponse: &rpb.ErrorResponse{ + ErrorCode: int32(codes.NotFound), + ErrorMessage: err.Error(), + }, + } + } else { + out.MessageResponse = &rpb.ServerReflectionResponse_FileDescriptorResponse{ + FileDescriptorResponse: &rpb.FileDescriptorResponse{FileDescriptorProto: [][]byte{b}}, + } + } + case *rpb.ServerReflectionRequest_FileContainingExtension: + typeName := req.FileContainingExtension.ContainingType + extNum := req.FileContainingExtension.ExtensionNumber + b, err := s.fileDescEncodingContainingExtension(typeName, extNum) + if err != nil { + out.MessageResponse = &rpb.ServerReflectionResponse_ErrorResponse{ + ErrorResponse: &rpb.ErrorResponse{ + ErrorCode: int32(codes.NotFound), + ErrorMessage: err.Error(), + }, + } + } else { + out.MessageResponse = &rpb.ServerReflectionResponse_FileDescriptorResponse{ + FileDescriptorResponse: &rpb.FileDescriptorResponse{FileDescriptorProto: [][]byte{b}}, + } + } + case *rpb.ServerReflectionRequest_AllExtensionNumbersOfType: + extNums, err := s.allExtensionNumbersForTypeName(req.AllExtensionNumbersOfType) + if err != nil { + out.MessageResponse = &rpb.ServerReflectionResponse_ErrorResponse{ + ErrorResponse: &rpb.ErrorResponse{ + ErrorCode: int32(codes.NotFound), + ErrorMessage: err.Error(), + }, + } + } else { + out.MessageResponse = &rpb.ServerReflectionResponse_AllExtensionNumbersResponse{ + AllExtensionNumbersResponse: &rpb.ExtensionNumberResponse{ + BaseTypeName: req.AllExtensionNumbersOfType, + ExtensionNumber: extNums, + }, + } + } + case *rpb.ServerReflectionRequest_ListServices: + if s.serviceInfo == nil { + s.serviceInfo = s.s.GetServiceInfo() + } + serviceResponses := make([]*rpb.ServiceResponse, 0, len(s.serviceInfo)) + for n := range s.serviceInfo { + serviceResponses = append(serviceResponses, &rpb.ServiceResponse{ + Name: n, + }) + } + out.MessageResponse = &rpb.ServerReflectionResponse_ListServicesResponse{ + ListServicesResponse: &rpb.ListServiceResponse{ + Service: serviceResponses, + }, + } + default: + return status.Errorf(codes.InvalidArgument, "invalid MessageRequest: %v", in.MessageRequest) + } + + if err := stream.Send(out); err != nil { + return err + } + } +} diff --git a/vendor/google.golang.org/grpc/reflection/serverreflection_test.go b/vendor/google.golang.org/grpc/reflection/serverreflection_test.go new file mode 100644 index 0000000000..908589085a --- /dev/null +++ b/vendor/google.golang.org/grpc/reflection/serverreflection_test.go @@ -0,0 +1,520 @@ +/* + * + * Copyright 2016 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. + * + */ + +//go:generate protoc -I grpc_testing --go_out=plugins=grpc:grpc_testing/ grpc_testing/proto2.proto grpc_testing/proto2_ext.proto grpc_testing/proto2_ext2.proto grpc_testing/test.proto + +// Note: grpc_testingv3/testv3.pb.go is not re-generated because it was +// intentionally generated by an older version of protoc-gen-go. + +package reflection + +import ( + "fmt" + "net" + "reflect" + "sort" + "testing" + + "github.com/golang/protobuf/proto" + dpb "github.com/golang/protobuf/protoc-gen-go/descriptor" + "golang.org/x/net/context" + "google.golang.org/grpc" + rpb "google.golang.org/grpc/reflection/grpc_reflection_v1alpha" + pb "google.golang.org/grpc/reflection/grpc_testing" + pbv3 "google.golang.org/grpc/reflection/grpc_testingv3" +) + +var ( + s = &serverReflectionServer{} + // fileDescriptor of each test proto file. + fdTest *dpb.FileDescriptorProto + fdTestv3 *dpb.FileDescriptorProto + fdProto2 *dpb.FileDescriptorProto + fdProto2Ext *dpb.FileDescriptorProto + fdProto2Ext2 *dpb.FileDescriptorProto + // fileDescriptor marshalled. + fdTestByte []byte + fdTestv3Byte []byte + fdProto2Byte []byte + fdProto2ExtByte []byte + fdProto2Ext2Byte []byte +) + +func loadFileDesc(filename string) (*dpb.FileDescriptorProto, []byte) { + enc := proto.FileDescriptor(filename) + if enc == nil { + panic(fmt.Sprintf("failed to find fd for file: %v", filename)) + } + fd, err := s.decodeFileDesc(enc) + if err != nil { + panic(fmt.Sprintf("failed to decode enc: %v", err)) + } + b, err := proto.Marshal(fd) + if err != nil { + panic(fmt.Sprintf("failed to marshal fd: %v", err)) + } + return fd, b +} + +func init() { + fdTest, fdTestByte = loadFileDesc("test.proto") + fdTestv3, fdTestv3Byte = loadFileDesc("testv3.proto") + fdProto2, fdProto2Byte = loadFileDesc("proto2.proto") + fdProto2Ext, fdProto2ExtByte = loadFileDesc("proto2_ext.proto") + fdProto2Ext2, fdProto2Ext2Byte = loadFileDesc("proto2_ext2.proto") +} + +func TestFileDescForType(t *testing.T) { + for _, test := range []struct { + st reflect.Type + wantFd *dpb.FileDescriptorProto + }{ + {reflect.TypeOf(pb.SearchResponse_Result{}), fdTest}, + {reflect.TypeOf(pb.ToBeExtended{}), fdProto2}, + } { + fd, err := s.fileDescForType(test.st) + if err != nil || !proto.Equal(fd, test.wantFd) { + t.Errorf("fileDescForType(%q) = %q, %v, want %q, ", test.st, fd, err, test.wantFd) + } + } +} + +func TestTypeForName(t *testing.T) { + for _, test := range []struct { + name string + want reflect.Type + }{ + {"grpc.testing.SearchResponse", reflect.TypeOf(pb.SearchResponse{})}, + } { + r, err := s.typeForName(test.name) + if err != nil || r != test.want { + t.Errorf("typeForName(%q) = %q, %v, want %q, ", test.name, r, err, test.want) + } + } +} + +func TestTypeForNameNotFound(t *testing.T) { + for _, test := range []string{ + "grpc.testing.not_exiting", + } { + _, err := s.typeForName(test) + if err == nil { + t.Errorf("typeForName(%q) = _, %v, want _, ", test, err) + } + } +} + +func TestFileDescContainingExtension(t *testing.T) { + for _, test := range []struct { + st reflect.Type + extNum int32 + want *dpb.FileDescriptorProto + }{ + {reflect.TypeOf(pb.ToBeExtended{}), 13, fdProto2Ext}, + {reflect.TypeOf(pb.ToBeExtended{}), 17, fdProto2Ext}, + {reflect.TypeOf(pb.ToBeExtended{}), 19, fdProto2Ext}, + {reflect.TypeOf(pb.ToBeExtended{}), 23, fdProto2Ext2}, + {reflect.TypeOf(pb.ToBeExtended{}), 29, fdProto2Ext2}, + } { + fd, err := s.fileDescContainingExtension(test.st, test.extNum) + if err != nil || !proto.Equal(fd, test.want) { + t.Errorf("fileDescContainingExtension(%q) = %q, %v, want %q, ", test.st, fd, err, test.want) + } + } +} + +// intArray is used to sort []int32 +type intArray []int32 + +func (s intArray) Len() int { return len(s) } +func (s intArray) Swap(i, j int) { s[i], s[j] = s[j], s[i] } +func (s intArray) Less(i, j int) bool { return s[i] < s[j] } + +func TestAllExtensionNumbersForType(t *testing.T) { + for _, test := range []struct { + st reflect.Type + want []int32 + }{ + {reflect.TypeOf(pb.ToBeExtended{}), []int32{13, 17, 19, 23, 29}}, + } { + r, err := s.allExtensionNumbersForType(test.st) + sort.Sort(intArray(r)) + if err != nil || !reflect.DeepEqual(r, test.want) { + t.Errorf("allExtensionNumbersForType(%q) = %v, %v, want %v, ", test.st, r, err, test.want) + } + } +} + +// Do end2end tests. + +type server struct{} + +func (s *server) Search(ctx context.Context, in *pb.SearchRequest) (*pb.SearchResponse, error) { + return &pb.SearchResponse{}, nil +} + +func (s *server) StreamingSearch(stream pb.SearchService_StreamingSearchServer) error { + return nil +} + +type serverV3 struct{} + +func (s *serverV3) Search(ctx context.Context, in *pbv3.SearchRequestV3) (*pbv3.SearchResponseV3, error) { + return &pbv3.SearchResponseV3{}, nil +} + +func (s *serverV3) StreamingSearch(stream pbv3.SearchServiceV3_StreamingSearchServer) error { + return nil +} + +func TestReflectionEnd2end(t *testing.T) { + // Start server. + lis, err := net.Listen("tcp", "localhost:0") + if err != nil { + t.Fatalf("failed to listen: %v", err) + } + s := grpc.NewServer() + pb.RegisterSearchServiceServer(s, &server{}) + pbv3.RegisterSearchServiceV3Server(s, &serverV3{}) + // Register reflection service on s. + Register(s) + go s.Serve(lis) + + // Create client. + conn, err := grpc.Dial(lis.Addr().String(), grpc.WithInsecure()) + if err != nil { + t.Fatalf("cannot connect to server: %v", err) + } + defer conn.Close() + + c := rpb.NewServerReflectionClient(conn) + stream, err := c.ServerReflectionInfo(context.Background(), grpc.FailFast(false)) + if err != nil { + t.Fatalf("cannot get ServerReflectionInfo: %v", err) + } + + testFileByFilename(t, stream) + testFileByFilenameError(t, stream) + testFileContainingSymbol(t, stream) + testFileContainingSymbolError(t, stream) + testFileContainingExtension(t, stream) + testFileContainingExtensionError(t, stream) + testAllExtensionNumbersOfType(t, stream) + testAllExtensionNumbersOfTypeError(t, stream) + testListServices(t, stream) + + s.Stop() +} + +func testFileByFilename(t *testing.T, stream rpb.ServerReflection_ServerReflectionInfoClient) { + for _, test := range []struct { + filename string + want []byte + }{ + {"test.proto", fdTestByte}, + {"proto2.proto", fdProto2Byte}, + {"proto2_ext.proto", fdProto2ExtByte}, + } { + if err := stream.Send(&rpb.ServerReflectionRequest{ + MessageRequest: &rpb.ServerReflectionRequest_FileByFilename{ + FileByFilename: test.filename, + }, + }); err != nil { + t.Fatalf("failed to send request: %v", err) + } + r, err := stream.Recv() + if err != nil { + // io.EOF is not ok. + t.Fatalf("failed to recv response: %v", err) + } + + switch r.MessageResponse.(type) { + case *rpb.ServerReflectionResponse_FileDescriptorResponse: + if !reflect.DeepEqual(r.GetFileDescriptorResponse().FileDescriptorProto[0], test.want) { + t.Errorf("FileByFilename(%v)\nreceived: %q,\nwant: %q", test.filename, r.GetFileDescriptorResponse().FileDescriptorProto[0], test.want) + } + default: + t.Errorf("FileByFilename(%v) = %v, want type ", test.filename, r.MessageResponse) + } + } +} + +func testFileByFilenameError(t *testing.T, stream rpb.ServerReflection_ServerReflectionInfoClient) { + for _, test := range []string{ + "test.poto", + "proo2.proto", + "proto2_et.proto", + } { + if err := stream.Send(&rpb.ServerReflectionRequest{ + MessageRequest: &rpb.ServerReflectionRequest_FileByFilename{ + FileByFilename: test, + }, + }); err != nil { + t.Fatalf("failed to send request: %v", err) + } + r, err := stream.Recv() + if err != nil { + // io.EOF is not ok. + t.Fatalf("failed to recv response: %v", err) + } + + switch r.MessageResponse.(type) { + case *rpb.ServerReflectionResponse_ErrorResponse: + default: + t.Errorf("FileByFilename(%v) = %v, want type ", test, r.MessageResponse) + } + } +} + +func testFileContainingSymbol(t *testing.T, stream rpb.ServerReflection_ServerReflectionInfoClient) { + for _, test := range []struct { + symbol string + want []byte + }{ + {"grpc.testing.SearchService", fdTestByte}, + {"grpc.testing.SearchService.Search", fdTestByte}, + {"grpc.testing.SearchService.StreamingSearch", fdTestByte}, + {"grpc.testing.SearchResponse", fdTestByte}, + {"grpc.testing.ToBeExtended", fdProto2Byte}, + // Test support package v3. + {"grpc.testingv3.SearchServiceV3", fdTestv3Byte}, + {"grpc.testingv3.SearchServiceV3.Search", fdTestv3Byte}, + {"grpc.testingv3.SearchServiceV3.StreamingSearch", fdTestv3Byte}, + {"grpc.testingv3.SearchResponseV3", fdTestv3Byte}, + } { + if err := stream.Send(&rpb.ServerReflectionRequest{ + MessageRequest: &rpb.ServerReflectionRequest_FileContainingSymbol{ + FileContainingSymbol: test.symbol, + }, + }); err != nil { + t.Fatalf("failed to send request: %v", err) + } + r, err := stream.Recv() + if err != nil { + // io.EOF is not ok. + t.Fatalf("failed to recv response: %v", err) + } + + switch r.MessageResponse.(type) { + case *rpb.ServerReflectionResponse_FileDescriptorResponse: + if !reflect.DeepEqual(r.GetFileDescriptorResponse().FileDescriptorProto[0], test.want) { + t.Errorf("FileContainingSymbol(%v)\nreceived: %q,\nwant: %q", test.symbol, r.GetFileDescriptorResponse().FileDescriptorProto[0], test.want) + } + default: + t.Errorf("FileContainingSymbol(%v) = %v, want type ", test.symbol, r.MessageResponse) + } + } +} + +func testFileContainingSymbolError(t *testing.T, stream rpb.ServerReflection_ServerReflectionInfoClient) { + for _, test := range []string{ + "grpc.testing.SerchService", + "grpc.testing.SearchService.SearchE", + "grpc.tesing.SearchResponse", + "gpc.testing.ToBeExtended", + } { + if err := stream.Send(&rpb.ServerReflectionRequest{ + MessageRequest: &rpb.ServerReflectionRequest_FileContainingSymbol{ + FileContainingSymbol: test, + }, + }); err != nil { + t.Fatalf("failed to send request: %v", err) + } + r, err := stream.Recv() + if err != nil { + // io.EOF is not ok. + t.Fatalf("failed to recv response: %v", err) + } + + switch r.MessageResponse.(type) { + case *rpb.ServerReflectionResponse_ErrorResponse: + default: + t.Errorf("FileContainingSymbol(%v) = %v, want type ", test, r.MessageResponse) + } + } +} + +func testFileContainingExtension(t *testing.T, stream rpb.ServerReflection_ServerReflectionInfoClient) { + for _, test := range []struct { + typeName string + extNum int32 + want []byte + }{ + {"grpc.testing.ToBeExtended", 13, fdProto2ExtByte}, + {"grpc.testing.ToBeExtended", 17, fdProto2ExtByte}, + {"grpc.testing.ToBeExtended", 19, fdProto2ExtByte}, + {"grpc.testing.ToBeExtended", 23, fdProto2Ext2Byte}, + {"grpc.testing.ToBeExtended", 29, fdProto2Ext2Byte}, + } { + if err := stream.Send(&rpb.ServerReflectionRequest{ + MessageRequest: &rpb.ServerReflectionRequest_FileContainingExtension{ + FileContainingExtension: &rpb.ExtensionRequest{ + ContainingType: test.typeName, + ExtensionNumber: test.extNum, + }, + }, + }); err != nil { + t.Fatalf("failed to send request: %v", err) + } + r, err := stream.Recv() + if err != nil { + // io.EOF is not ok. + t.Fatalf("failed to recv response: %v", err) + } + + switch r.MessageResponse.(type) { + case *rpb.ServerReflectionResponse_FileDescriptorResponse: + if !reflect.DeepEqual(r.GetFileDescriptorResponse().FileDescriptorProto[0], test.want) { + t.Errorf("FileContainingExtension(%v, %v)\nreceived: %q,\nwant: %q", test.typeName, test.extNum, r.GetFileDescriptorResponse().FileDescriptorProto[0], test.want) + } + default: + t.Errorf("FileContainingExtension(%v, %v) = %v, want type ", test.typeName, test.extNum, r.MessageResponse) + } + } +} + +func testFileContainingExtensionError(t *testing.T, stream rpb.ServerReflection_ServerReflectionInfoClient) { + for _, test := range []struct { + typeName string + extNum int32 + }{ + {"grpc.testing.ToBExtended", 17}, + {"grpc.testing.ToBeExtended", 15}, + } { + if err := stream.Send(&rpb.ServerReflectionRequest{ + MessageRequest: &rpb.ServerReflectionRequest_FileContainingExtension{ + FileContainingExtension: &rpb.ExtensionRequest{ + ContainingType: test.typeName, + ExtensionNumber: test.extNum, + }, + }, + }); err != nil { + t.Fatalf("failed to send request: %v", err) + } + r, err := stream.Recv() + if err != nil { + // io.EOF is not ok. + t.Fatalf("failed to recv response: %v", err) + } + + switch r.MessageResponse.(type) { + case *rpb.ServerReflectionResponse_ErrorResponse: + default: + t.Errorf("FileContainingExtension(%v, %v) = %v, want type ", test.typeName, test.extNum, r.MessageResponse) + } + } +} + +func testAllExtensionNumbersOfType(t *testing.T, stream rpb.ServerReflection_ServerReflectionInfoClient) { + for _, test := range []struct { + typeName string + want []int32 + }{ + {"grpc.testing.ToBeExtended", []int32{13, 17, 19, 23, 29}}, + } { + if err := stream.Send(&rpb.ServerReflectionRequest{ + MessageRequest: &rpb.ServerReflectionRequest_AllExtensionNumbersOfType{ + AllExtensionNumbersOfType: test.typeName, + }, + }); err != nil { + t.Fatalf("failed to send request: %v", err) + } + r, err := stream.Recv() + if err != nil { + // io.EOF is not ok. + t.Fatalf("failed to recv response: %v", err) + } + + switch r.MessageResponse.(type) { + case *rpb.ServerReflectionResponse_AllExtensionNumbersResponse: + extNum := r.GetAllExtensionNumbersResponse().ExtensionNumber + sort.Sort(intArray(extNum)) + if r.GetAllExtensionNumbersResponse().BaseTypeName != test.typeName || + !reflect.DeepEqual(extNum, test.want) { + t.Errorf("AllExtensionNumbersOfType(%v)\nreceived: %v,\nwant: {%q %v}", r.GetAllExtensionNumbersResponse(), test.typeName, test.typeName, test.want) + } + default: + t.Errorf("AllExtensionNumbersOfType(%v) = %v, want type ", test.typeName, r.MessageResponse) + } + } +} + +func testAllExtensionNumbersOfTypeError(t *testing.T, stream rpb.ServerReflection_ServerReflectionInfoClient) { + for _, test := range []string{ + "grpc.testing.ToBeExtendedE", + } { + if err := stream.Send(&rpb.ServerReflectionRequest{ + MessageRequest: &rpb.ServerReflectionRequest_AllExtensionNumbersOfType{ + AllExtensionNumbersOfType: test, + }, + }); err != nil { + t.Fatalf("failed to send request: %v", err) + } + r, err := stream.Recv() + if err != nil { + // io.EOF is not ok. + t.Fatalf("failed to recv response: %v", err) + } + + switch r.MessageResponse.(type) { + case *rpb.ServerReflectionResponse_ErrorResponse: + default: + t.Errorf("AllExtensionNumbersOfType(%v) = %v, want type ", test, r.MessageResponse) + } + } +} + +func testListServices(t *testing.T, stream rpb.ServerReflection_ServerReflectionInfoClient) { + if err := stream.Send(&rpb.ServerReflectionRequest{ + MessageRequest: &rpb.ServerReflectionRequest_ListServices{}, + }); err != nil { + t.Fatalf("failed to send request: %v", err) + } + r, err := stream.Recv() + if err != nil { + // io.EOF is not ok. + t.Fatalf("failed to recv response: %v", err) + } + + switch r.MessageResponse.(type) { + case *rpb.ServerReflectionResponse_ListServicesResponse: + services := r.GetListServicesResponse().Service + want := []string{ + "grpc.testingv3.SearchServiceV3", + "grpc.testing.SearchService", + "grpc.reflection.v1alpha.ServerReflection", + } + // Compare service names in response with want. + if len(services) != len(want) { + t.Errorf("= %v, want service names: %v", services, want) + } + m := make(map[string]int) + for _, e := range services { + m[e.Name]++ + } + for _, e := range want { + if m[e] > 0 { + m[e]-- + continue + } + t.Errorf("ListService\nreceived: %v,\nwant: %q", services, want) + } + default: + t.Errorf("ListServices = %v, want type ", r.MessageResponse) + } +} diff --git a/vendor/google.golang.org/grpc/resolver/dns/dns_resolver.go b/vendor/google.golang.org/grpc/resolver/dns/dns_resolver.go new file mode 100644 index 0000000000..a543a709a6 --- /dev/null +++ b/vendor/google.golang.org/grpc/resolver/dns/dns_resolver.go @@ -0,0 +1,377 @@ +/* + * + * Copyright 2017 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. + * + */ + +// Package dns implements a dns resolver to be installed as the default resolver +// in grpc. +package dns + +import ( + "encoding/json" + "errors" + "fmt" + "math/rand" + "net" + "os" + "strconv" + "strings" + "sync" + "time" + + "golang.org/x/net/context" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/resolver" +) + +func init() { + resolver.Register(NewBuilder()) +} + +const ( + defaultPort = "443" + defaultFreq = time.Minute * 30 + golang = "GO" + // In DNS, service config is encoded in a TXT record via the mechanism + // described in RFC-1464 using the attribute name grpc_config. + txtAttribute = "grpc_config=" +) + +var errMissingAddr = errors.New("missing address") + +// NewBuilder creates a dnsBuilder which is used to factory DNS resolvers. +func NewBuilder() resolver.Builder { + return &dnsBuilder{freq: defaultFreq} +} + +type dnsBuilder struct { + // frequency of polling the DNS server. + freq time.Duration +} + +// Build creates and starts a DNS resolver that watches the name resolution of the target. +func (b *dnsBuilder) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOption) (resolver.Resolver, error) { + host, port, err := parseTarget(target.Endpoint) + if err != nil { + return nil, err + } + + // IP address. + if net.ParseIP(host) != nil { + host, _ = formatIP(host) + addr := []resolver.Address{{Addr: host + ":" + port}} + i := &ipResolver{ + cc: cc, + ip: addr, + rn: make(chan struct{}, 1), + q: make(chan struct{}), + } + cc.NewAddress(addr) + go i.watcher() + return i, nil + } + + // DNS address (non-IP). + ctx, cancel := context.WithCancel(context.Background()) + d := &dnsResolver{ + freq: b.freq, + host: host, + port: port, + ctx: ctx, + cancel: cancel, + cc: cc, + t: time.NewTimer(0), + rn: make(chan struct{}, 1), + } + + d.wg.Add(1) + go d.watcher() + return d, nil +} + +// Scheme returns the naming scheme of this resolver builder, which is "dns". +func (b *dnsBuilder) Scheme() string { + return "dns" +} + +// ipResolver watches for the name resolution update for an IP address. +type ipResolver struct { + cc resolver.ClientConn + ip []resolver.Address + // rn channel is used by ResolveNow() to force an immediate resolution of the target. + rn chan struct{} + q chan struct{} +} + +// ResolveNow resend the address it stores, no resolution is needed. +func (i *ipResolver) ResolveNow(opt resolver.ResolveNowOption) { + select { + case i.rn <- struct{}{}: + default: + } +} + +// Close closes the ipResolver. +func (i *ipResolver) Close() { + close(i.q) +} + +func (i *ipResolver) watcher() { + for { + select { + case <-i.rn: + i.cc.NewAddress(i.ip) + case <-i.q: + return + } + } +} + +// dnsResolver watches for the name resolution update for a non-IP target. +type dnsResolver struct { + freq time.Duration + host string + port string + ctx context.Context + cancel context.CancelFunc + cc resolver.ClientConn + // rn channel is used by ResolveNow() to force an immediate resolution of the target. + rn chan struct{} + t *time.Timer + // wg is used to enforce Close() to return after the watcher() goroutine has finished. + // Otherwise, data race will be possible. [Race Example] in dns_resolver_test we + // replace the real lookup functions with mocked ones to facilitate testing. + // If Close() doesn't wait for watcher() goroutine finishes, race detector sometimes + // will warns lookup (READ the lookup function pointers) inside watcher() goroutine + // has data race with replaceNetFunc (WRITE the lookup function pointers). + wg sync.WaitGroup +} + +// ResolveNow invoke an immediate resolution of the target that this dnsResolver watches. +func (d *dnsResolver) ResolveNow(opt resolver.ResolveNowOption) { + select { + case d.rn <- struct{}{}: + default: + } +} + +// Close closes the dnsResolver. +func (d *dnsResolver) Close() { + d.cancel() + d.wg.Wait() + d.t.Stop() +} + +func (d *dnsResolver) watcher() { + defer d.wg.Done() + for { + select { + case <-d.ctx.Done(): + return + case <-d.t.C: + case <-d.rn: + } + result, sc := d.lookup() + // Next lookup should happen after an interval defined by d.freq. + d.t.Reset(d.freq) + d.cc.NewServiceConfig(string(sc)) + d.cc.NewAddress(result) + } +} + +func (d *dnsResolver) lookupSRV() []resolver.Address { + var newAddrs []resolver.Address + _, srvs, err := lookupSRV(d.ctx, "grpclb", "tcp", d.host) + if err != nil { + grpclog.Infof("grpc: failed dns SRV record lookup due to %v.\n", err) + return nil + } + for _, s := range srvs { + lbAddrs, err := lookupHost(d.ctx, s.Target) + if err != nil { + grpclog.Warningf("grpc: failed load banlacer address dns lookup due to %v.\n", err) + continue + } + for _, a := range lbAddrs { + a, ok := formatIP(a) + if !ok { + grpclog.Errorf("grpc: failed IP parsing due to %v.\n", err) + continue + } + addr := a + ":" + strconv.Itoa(int(s.Port)) + newAddrs = append(newAddrs, resolver.Address{Addr: addr, Type: resolver.GRPCLB, ServerName: s.Target}) + } + } + return newAddrs +} + +func (d *dnsResolver) lookupTXT() string { + ss, err := lookupTXT(d.ctx, d.host) + if err != nil { + grpclog.Warningf("grpc: failed dns TXT record lookup due to %v.\n", err) + return "" + } + var res string + for _, s := range ss { + res += s + } + + // TXT record must have "grpc_config=" attribute in order to be used as service config. + if !strings.HasPrefix(res, txtAttribute) { + grpclog.Warningf("grpc: TXT record %v missing %v attribute", res, txtAttribute) + return "" + } + return strings.TrimPrefix(res, txtAttribute) +} + +func (d *dnsResolver) lookupHost() []resolver.Address { + var newAddrs []resolver.Address + addrs, err := lookupHost(d.ctx, d.host) + if err != nil { + grpclog.Warningf("grpc: failed dns A record lookup due to %v.\n", err) + return nil + } + for _, a := range addrs { + a, ok := formatIP(a) + if !ok { + grpclog.Errorf("grpc: failed IP parsing due to %v.\n", err) + continue + } + addr := a + ":" + d.port + newAddrs = append(newAddrs, resolver.Address{Addr: addr}) + } + return newAddrs +} + +func (d *dnsResolver) lookup() ([]resolver.Address, string) { + var newAddrs []resolver.Address + newAddrs = d.lookupSRV() + // Support fallback to non-balancer address. + newAddrs = append(newAddrs, d.lookupHost()...) + sc := d.lookupTXT() + return newAddrs, canaryingSC(sc) +} + +// formatIP returns ok = false if addr is not a valid textual representation of an IP address. +// If addr is an IPv4 address, return the addr and ok = true. +// If addr is an IPv6 address, return the addr enclosed in square brackets and ok = true. +func formatIP(addr string) (addrIP string, ok bool) { + ip := net.ParseIP(addr) + if ip == nil { + return "", false + } + if ip.To4() != nil { + return addr, true + } + return "[" + addr + "]", true +} + +// parseTarget takes the user input target string, returns formatted host and port info. +// If target doesn't specify a port, set the port to be the defaultPort. +// If target is in IPv6 format and host-name is enclosed in sqarue brackets, brackets +// are strippd when setting the host. +// examples: +// target: "www.google.com" returns host: "www.google.com", port: "443" +// target: "ipv4-host:80" returns host: "ipv4-host", port: "80" +// target: "[ipv6-host]" returns host: "ipv6-host", port: "443" +// target: ":80" returns host: "localhost", port: "80" +// target: ":" returns host: "localhost", port: "443" +func parseTarget(target string) (host, port string, err error) { + if target == "" { + return "", "", errMissingAddr + } + if ip := net.ParseIP(target); ip != nil { + // target is an IPv4 or IPv6(without brackets) address + return target, defaultPort, nil + } + if host, port, err = net.SplitHostPort(target); err == nil { + // target has port, i.e ipv4-host:port, [ipv6-host]:port, host-name:port + if host == "" { + // Keep consistent with net.Dial(): If the host is empty, as in ":80", the local system is assumed. + host = "localhost" + } + if port == "" { + // If the port field is empty(target ends with colon), e.g. "[::1]:", defaultPort is used. + port = defaultPort + } + return host, port, nil + } + if host, port, err = net.SplitHostPort(target + ":" + defaultPort); err == nil { + // target doesn't have port + return host, port, nil + } + return "", "", fmt.Errorf("invalid target address %v, error info: %v", target, err) +} + +type rawChoice struct { + ClientLanguage *[]string `json:"clientLanguage,omitempty"` + Percentage *int `json:"percentage,omitempty"` + ClientHostName *[]string `json:"clientHostName,omitempty"` + ServiceConfig *json.RawMessage `json:"serviceConfig,omitempty"` +} + +func containsString(a *[]string, b string) bool { + if a == nil { + return true + } + for _, c := range *a { + if c == b { + return true + } + } + return false +} + +func chosenByPercentage(a *int) bool { + if a == nil { + return true + } + s := rand.NewSource(time.Now().UnixNano()) + r := rand.New(s) + if r.Intn(100)+1 > *a { + return false + } + return true +} + +func canaryingSC(js string) string { + if js == "" { + return "" + } + var rcs []rawChoice + err := json.Unmarshal([]byte(js), &rcs) + if err != nil { + grpclog.Warningf("grpc: failed to parse service config json string due to %v.\n", err) + return "" + } + cliHostname, err := os.Hostname() + if err != nil { + grpclog.Warningf("grpc: failed to get client hostname due to %v.\n", err) + return "" + } + var sc string + for _, c := range rcs { + if !containsString(c.ClientLanguage, golang) || + !chosenByPercentage(c.Percentage) || + !containsString(c.ClientHostName, cliHostname) || + c.ServiceConfig == nil { + continue + } + sc = string(*c.ServiceConfig) + break + } + return sc +} diff --git a/vendor/google.golang.org/grpc/resolver/dns/dns_resolver_test.go b/vendor/google.golang.org/grpc/resolver/dns/dns_resolver_test.go new file mode 100644 index 0000000000..41a9ecb914 --- /dev/null +++ b/vendor/google.golang.org/grpc/resolver/dns/dns_resolver_test.go @@ -0,0 +1,894 @@ +/* + * + * Copyright 2017 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. + * + */ + +package dns + +import ( + "fmt" + "net" + "os" + "reflect" + "sync" + "testing" + "time" + + "google.golang.org/grpc/resolver" + "google.golang.org/grpc/test/leakcheck" +) + +func TestMain(m *testing.M) { + cleanup := replaceNetFunc() + code := m.Run() + cleanup() + os.Exit(code) +} + +const ( + txtBytesLimit = 255 +) + +type testClientConn struct { + target string + m1 sync.Mutex + addrs []resolver.Address + a int + m2 sync.Mutex + sc string + s int +} + +func (t *testClientConn) NewAddress(addresses []resolver.Address) { + t.m1.Lock() + defer t.m1.Unlock() + t.addrs = addresses + t.a++ +} + +func (t *testClientConn) getAddress() ([]resolver.Address, int) { + t.m1.Lock() + defer t.m1.Unlock() + return t.addrs, t.a +} + +func (t *testClientConn) NewServiceConfig(serviceConfig string) { + t.m2.Lock() + defer t.m2.Unlock() + t.sc = serviceConfig + t.s++ +} + +func (t *testClientConn) getSc() (string, int) { + t.m2.Lock() + defer t.m2.Unlock() + return t.sc, t.s +} + +var hostLookupTbl = struct { + sync.Mutex + tbl map[string][]string +}{ + tbl: map[string][]string{ + "foo.bar.com": {"1.2.3.4", "5.6.7.8"}, + "ipv4.single.fake": {"1.2.3.4"}, + "srv.ipv4.single.fake": {"2.4.6.8"}, + "ipv4.multi.fake": {"1.2.3.4", "5.6.7.8", "9.10.11.12"}, + "ipv6.single.fake": {"2607:f8b0:400a:801::1001"}, + "ipv6.multi.fake": {"2607:f8b0:400a:801::1001", "2607:f8b0:400a:801::1002", "2607:f8b0:400a:801::1003"}, + }, +} + +func hostLookup(host string) ([]string, error) { + hostLookupTbl.Lock() + defer hostLookupTbl.Unlock() + if addrs, cnt := hostLookupTbl.tbl[host]; cnt { + return addrs, nil + } + return nil, fmt.Errorf("failed to lookup host:%s resolution in hostLookupTbl", host) +} + +var srvLookupTbl = struct { + sync.Mutex + tbl map[string][]*net.SRV +}{ + tbl: map[string][]*net.SRV{ + "_grpclb._tcp.srv.ipv4.single.fake": {&net.SRV{Target: "ipv4.single.fake", Port: 1234}}, + "_grpclb._tcp.srv.ipv4.multi.fake": {&net.SRV{Target: "ipv4.multi.fake", Port: 1234}}, + "_grpclb._tcp.srv.ipv6.single.fake": {&net.SRV{Target: "ipv6.single.fake", Port: 1234}}, + "_grpclb._tcp.srv.ipv6.multi.fake": {&net.SRV{Target: "ipv6.multi.fake", Port: 1234}}, + }, +} + +func srvLookup(service, proto, name string) (string, []*net.SRV, error) { + cname := "_" + service + "._" + proto + "." + name + srvLookupTbl.Lock() + defer srvLookupTbl.Unlock() + if srvs, cnt := srvLookupTbl.tbl[cname]; cnt { + return cname, srvs, nil + } + return "", nil, fmt.Errorf("failed to lookup srv record for %s in srvLookupTbl", cname) +} + +// div divides a byte slice into a slice of strings, each of which is of maximum +// 255 bytes length, which is the length limit per TXT record in DNS. +func div(b []byte) []string { + var r []string + for i := 0; i < len(b); i += txtBytesLimit { + if i+txtBytesLimit > len(b) { + r = append(r, string(b[i:])) + } else { + r = append(r, string(b[i:i+txtBytesLimit])) + } + } + return r +} + +// scfs contains an array of service config file string in JSON format. +// Notes about the scfs contents and usage: +// scfs contains 4 service config file JSON strings for testing. Inside each +// service config file, there are multiple choices. scfs[0:3] each contains 5 +// choices, and first 3 choices are nonmatching choices based on canarying rule, +// while the last two are matched choices. scfs[3] only contains 3 choices, and +// all of them are nonmatching based on canarying rule. For each of scfs[0:3], +// the eventually returned service config, which is from the first of the two +// matched choices, is stored in the corresponding scs element (e.g. +// scfs[0]->scs[0]). scfs and scs elements are used in pair to test the dns +// resolver functionality, with scfs as the input and scs used for validation of +// the output. For scfs[3], it corresponds to empty service config, since there +// isn't a matched choice. +var scfs = []string{ + `[ + { + "clientLanguage": [ + "CPP", + "JAVA" + ], + "serviceConfig": { + "loadBalancingPolicy": "grpclb", + "methodConfig": [ + { + "name": [ + { + "service": "all" + } + ], + "timeout": "1s" + } + ] + } + }, + { + "percentage": 0, + "serviceConfig": { + "loadBalancingPolicy": "grpclb", + "methodConfig": [ + { + "name": [ + { + "service": "all" + } + ], + "timeout": "1s" + } + ] + } + }, + { + "clientHostName": [ + "localhost" + ], + "serviceConfig": { + "loadBalancingPolicy": "grpclb", + "methodConfig": [ + { + "name": [ + { + "service": "all" + } + ], + "timeout": "1s" + } + ] + } + }, + { + "clientLanguage": [ + "GO" + ], + "percentage": 100, + "serviceConfig": { + "methodConfig": [ + { + "name": [ + { + "method": "bar" + } + ], + "maxRequestMessageBytes": 1024, + "maxResponseMessageBytes": 1024 + } + ] + } + }, + { + "serviceConfig": { + "loadBalancingPolicy": "round_robin", + "methodConfig": [ + { + "name": [ + { + "service": "foo", + "method": "bar" + } + ], + "waitForReady": true + } + ] + } + } +]`, + `[ + { + "clientLanguage": [ + "CPP", + "JAVA" + ], + "serviceConfig": { + "loadBalancingPolicy": "grpclb", + "methodConfig": [ + { + "name": [ + { + "service": "all" + } + ], + "timeout": "1s" + } + ] + } + }, + { + "percentage": 0, + "serviceConfig": { + "loadBalancingPolicy": "grpclb", + "methodConfig": [ + { + "name": [ + { + "service": "all" + } + ], + "timeout": "1s" + } + ] + } + }, + { + "clientHostName": [ + "localhost" + ], + "serviceConfig": { + "loadBalancingPolicy": "grpclb", + "methodConfig": [ + { + "name": [ + { + "service": "all" + } + ], + "timeout": "1s" + } + ] + } + }, + { + "clientLanguage": [ + "GO" + ], + "percentage": 100, + "serviceConfig": { + "methodConfig": [ + { + "name": [ + { + "service": "foo", + "method": "bar" + } + ], + "waitForReady": true, + "timeout": "1s", + "maxRequestMessageBytes": 1024, + "maxResponseMessageBytes": 1024 + } + ] + } + }, + { + "serviceConfig": { + "loadBalancingPolicy": "round_robin", + "methodConfig": [ + { + "name": [ + { + "service": "foo", + "method": "bar" + } + ], + "waitForReady": true + } + ] + } + } +]`, + `[ + { + "clientLanguage": [ + "CPP", + "JAVA" + ], + "serviceConfig": { + "loadBalancingPolicy": "grpclb", + "methodConfig": [ + { + "name": [ + { + "service": "all" + } + ], + "timeout": "1s" + } + ] + } + }, + { + "percentage": 0, + "serviceConfig": { + "loadBalancingPolicy": "grpclb", + "methodConfig": [ + { + "name": [ + { + "service": "all" + } + ], + "timeout": "1s" + } + ] + } + }, + { + "clientHostName": [ + "localhost" + ], + "serviceConfig": { + "loadBalancingPolicy": "grpclb", + "methodConfig": [ + { + "name": [ + { + "service": "all" + } + ], + "timeout": "1s" + } + ] + } + }, + { + "clientLanguage": [ + "GO" + ], + "percentage": 100, + "serviceConfig": { + "loadBalancingPolicy": "round_robin", + "methodConfig": [ + { + "name": [ + { + "service": "foo" + } + ], + "waitForReady": true, + "timeout": "1s" + }, + { + "name": [ + { + "service": "bar" + } + ], + "waitForReady": false + } + ] + } + }, + { + "serviceConfig": { + "loadBalancingPolicy": "round_robin", + "methodConfig": [ + { + "name": [ + { + "service": "foo", + "method": "bar" + } + ], + "waitForReady": true + } + ] + } + } +]`, + `[ + { + "clientLanguage": [ + "CPP", + "JAVA" + ], + "serviceConfig": { + "loadBalancingPolicy": "grpclb", + "methodConfig": [ + { + "name": [ + { + "service": "all" + } + ], + "timeout": "1s" + } + ] + } + }, + { + "percentage": 0, + "serviceConfig": { + "loadBalancingPolicy": "grpclb", + "methodConfig": [ + { + "name": [ + { + "service": "all" + } + ], + "timeout": "1s" + } + ] + } + }, + { + "clientHostName": [ + "localhost" + ], + "serviceConfig": { + "loadBalancingPolicy": "grpclb", + "methodConfig": [ + { + "name": [ + { + "service": "all" + } + ], + "timeout": "1s" + } + ] + } + } +]`, +} + +// scs contains an array of service config string in JSON format. +var scs = []string{ + `{ + "methodConfig": [ + { + "name": [ + { + "method": "bar" + } + ], + "maxRequestMessageBytes": 1024, + "maxResponseMessageBytes": 1024 + } + ] + }`, + `{ + "methodConfig": [ + { + "name": [ + { + "service": "foo", + "method": "bar" + } + ], + "waitForReady": true, + "timeout": "1s", + "maxRequestMessageBytes": 1024, + "maxResponseMessageBytes": 1024 + } + ] + }`, + `{ + "loadBalancingPolicy": "round_robin", + "methodConfig": [ + { + "name": [ + { + "service": "foo" + } + ], + "waitForReady": true, + "timeout": "1s" + }, + { + "name": [ + { + "service": "bar" + } + ], + "waitForReady": false + } + ] + }`, +} + +// scLookupTbl is a set, which contains targets that have service config. Target +// not in this set should not have service config. +var scLookupTbl = map[string]bool{ + "foo.bar.com": true, + "srv.ipv4.single.fake": true, + "srv.ipv4.multi.fake": true, + "no.attribute": true, +} + +// generateSCF generates a slice of strings (aggregately representing a single +// service config file) for the input name, which mocks the result from a real +// DNS TXT record lookup. +func generateSCF(name string) []string { + var b []byte + switch name { + case "foo.bar.com": + b = []byte(scfs[0]) + case "srv.ipv4.single.fake": + b = []byte(scfs[1]) + case "srv.ipv4.multi.fake": + b = []byte(scfs[2]) + default: + b = []byte(scfs[3]) + } + if name == "no.attribute" { + return div(b) + } + return div(append([]byte(txtAttribute), b...)) +} + +// generateSC returns a service config string in JSON format for the input name. +func generateSC(name string) string { + _, cnt := scLookupTbl[name] + if !cnt || name == "no.attribute" { + return "" + } + switch name { + case "foo.bar.com": + return scs[0] + case "srv.ipv4.single.fake": + return scs[1] + case "srv.ipv4.multi.fake": + return scs[2] + default: + return "" + } +} + +var txtLookupTbl = struct { + sync.Mutex + tbl map[string][]string +}{ + tbl: map[string][]string{ + "foo.bar.com": generateSCF("foo.bar.com"), + "srv.ipv4.single.fake": generateSCF("srv.ipv4.single.fake"), + "srv.ipv4.multi.fake": generateSCF("srv.ipv4.multi.fake"), + "srv.ipv6.single.fake": generateSCF("srv.ipv6.single.fake"), + "srv.ipv6.multi.fake": generateSCF("srv.ipv6.multi.fake"), + "no.attribute": generateSCF("no.attribute"), + }, +} + +func txtLookup(host string) ([]string, error) { + txtLookupTbl.Lock() + defer txtLookupTbl.Unlock() + if scs, cnt := txtLookupTbl.tbl[host]; cnt { + return scs, nil + } + return nil, fmt.Errorf("failed to lookup TXT:%s resolution in txtLookupTbl", host) +} + +func TestResolve(t *testing.T) { + testDNSResolver(t) + testDNSResolveNow(t) + testIPResolver(t) +} + +func testDNSResolver(t *testing.T) { + defer leakcheck.Check(t) + tests := []struct { + target string + addrWant []resolver.Address + scWant string + }{ + { + "foo.bar.com", + []resolver.Address{{Addr: "1.2.3.4" + colonDefaultPort}, {Addr: "5.6.7.8" + colonDefaultPort}}, + generateSC("foo.bar.com"), + }, + { + "foo.bar.com:1234", + []resolver.Address{{Addr: "1.2.3.4:1234"}, {Addr: "5.6.7.8:1234"}}, + generateSC("foo.bar.com"), + }, + { + "srv.ipv4.single.fake", + []resolver.Address{{Addr: "1.2.3.4:1234", Type: resolver.GRPCLB, ServerName: "ipv4.single.fake"}, {Addr: "2.4.6.8" + colonDefaultPort}}, + generateSC("srv.ipv4.single.fake"), + }, + { + "srv.ipv4.multi.fake", + []resolver.Address{ + {Addr: "1.2.3.4:1234", Type: resolver.GRPCLB, ServerName: "ipv4.multi.fake"}, + {Addr: "5.6.7.8:1234", Type: resolver.GRPCLB, ServerName: "ipv4.multi.fake"}, + {Addr: "9.10.11.12:1234", Type: resolver.GRPCLB, ServerName: "ipv4.multi.fake"}, + }, + generateSC("srv.ipv4.multi.fake"), + }, + { + "srv.ipv6.single.fake", + []resolver.Address{{Addr: "[2607:f8b0:400a:801::1001]:1234", Type: resolver.GRPCLB, ServerName: "ipv6.single.fake"}}, + generateSC("srv.ipv6.single.fake"), + }, + { + "srv.ipv6.multi.fake", + []resolver.Address{ + {Addr: "[2607:f8b0:400a:801::1001]:1234", Type: resolver.GRPCLB, ServerName: "ipv6.multi.fake"}, + {Addr: "[2607:f8b0:400a:801::1002]:1234", Type: resolver.GRPCLB, ServerName: "ipv6.multi.fake"}, + {Addr: "[2607:f8b0:400a:801::1003]:1234", Type: resolver.GRPCLB, ServerName: "ipv6.multi.fake"}, + }, + generateSC("srv.ipv6.multi.fake"), + }, + { + "no.attribute", + nil, + generateSC("no.attribute"), + }, + } + + for _, a := range tests { + b := NewBuilder() + cc := &testClientConn{target: a.target} + r, err := b.Build(resolver.Target{Endpoint: a.target}, cc, resolver.BuildOption{}) + if err != nil { + t.Fatalf("%v\n", err) + } + var addrs []resolver.Address + var cnt int + for { + addrs, cnt = cc.getAddress() + if cnt > 0 { + break + } + time.Sleep(time.Millisecond) + } + var sc string + for { + sc, cnt = cc.getSc() + if cnt > 0 { + break + } + time.Sleep(time.Millisecond) + } + if !reflect.DeepEqual(a.addrWant, addrs) { + t.Errorf("Resolved addresses of target: %q = %+v, want %+v\n", a.target, addrs, a.addrWant) + } + if !reflect.DeepEqual(a.scWant, sc) { + t.Errorf("Resolved service config of target: %q = %+v, want %+v\n", a.target, sc, a.scWant) + } + r.Close() + } +} + +func mutateTbl(target string) func() { + hostLookupTbl.Lock() + oldHostTblEntry := hostLookupTbl.tbl[target] + hostLookupTbl.tbl[target] = hostLookupTbl.tbl[target][:len(oldHostTblEntry)-1] + hostLookupTbl.Unlock() + txtLookupTbl.Lock() + oldTxtTblEntry := txtLookupTbl.tbl[target] + txtLookupTbl.tbl[target] = []string{""} + txtLookupTbl.Unlock() + + return func() { + hostLookupTbl.Lock() + hostLookupTbl.tbl[target] = oldHostTblEntry + hostLookupTbl.Unlock() + txtLookupTbl.Lock() + txtLookupTbl.tbl[target] = oldTxtTblEntry + txtLookupTbl.Unlock() + } +} + +func testDNSResolveNow(t *testing.T) { + defer leakcheck.Check(t) + tests := []struct { + target string + addrWant []resolver.Address + addrNext []resolver.Address + scWant string + scNext string + }{ + { + "foo.bar.com", + []resolver.Address{{Addr: "1.2.3.4" + colonDefaultPort}, {Addr: "5.6.7.8" + colonDefaultPort}}, + []resolver.Address{{Addr: "1.2.3.4" + colonDefaultPort}}, + generateSC("foo.bar.com"), + "", + }, + } + + for _, a := range tests { + b := NewBuilder() + cc := &testClientConn{target: a.target} + r, err := b.Build(resolver.Target{Endpoint: a.target}, cc, resolver.BuildOption{}) + if err != nil { + t.Fatalf("%v\n", err) + } + var addrs []resolver.Address + var cnt int + for { + addrs, cnt = cc.getAddress() + if cnt > 0 { + break + } + time.Sleep(time.Millisecond) + } + var sc string + for { + sc, cnt = cc.getSc() + if cnt > 0 { + break + } + time.Sleep(time.Millisecond) + } + if !reflect.DeepEqual(a.addrWant, addrs) { + t.Errorf("Resolved addresses of target: %q = %+v, want %+v\n", a.target, addrs, a.addrWant) + } + if !reflect.DeepEqual(a.scWant, sc) { + t.Errorf("Resolved service config of target: %q = %+v, want %+v\n", a.target, sc, a.scWant) + } + revertTbl := mutateTbl(a.target) + r.ResolveNow(resolver.ResolveNowOption{}) + for { + addrs, cnt = cc.getAddress() + if cnt == 2 { + break + } + time.Sleep(time.Millisecond) + } + for { + sc, cnt = cc.getSc() + if cnt == 2 { + break + } + time.Sleep(time.Millisecond) + } + if !reflect.DeepEqual(a.addrNext, addrs) { + t.Errorf("Resolved addresses of target: %q = %+v, want %+v\n", a.target, addrs, a.addrNext) + } + if !reflect.DeepEqual(a.scNext, sc) { + t.Errorf("Resolved service config of target: %q = %+v, want %+v\n", a.target, sc, a.scNext) + } + revertTbl() + r.Close() + } +} + +const colonDefaultPort = ":" + defaultPort + +func testIPResolver(t *testing.T) { + defer leakcheck.Check(t) + tests := []struct { + target string + want []resolver.Address + }{ + {"127.0.0.1", []resolver.Address{{Addr: "127.0.0.1" + colonDefaultPort}}}, + {"127.0.0.1:12345", []resolver.Address{{Addr: "127.0.0.1:12345"}}}, + {"::1", []resolver.Address{{Addr: "[::1]" + colonDefaultPort}}}, + {"[::1]:12345", []resolver.Address{{Addr: "[::1]:12345"}}}, + {"[::1]:", []resolver.Address{{Addr: "[::1]:443"}}}, + {"2001:db8:85a3::8a2e:370:7334", []resolver.Address{{Addr: "[2001:db8:85a3::8a2e:370:7334]" + colonDefaultPort}}}, + {"[2001:db8:85a3::8a2e:370:7334]", []resolver.Address{{Addr: "[2001:db8:85a3::8a2e:370:7334]" + colonDefaultPort}}}, + {"[2001:db8:85a3::8a2e:370:7334]:12345", []resolver.Address{{Addr: "[2001:db8:85a3::8a2e:370:7334]:12345"}}}, + {"[2001:db8::1]:http", []resolver.Address{{Addr: "[2001:db8::1]:http"}}}, + // TODO(yuxuanli): zone support? + } + + for _, v := range tests { + b := NewBuilder() + cc := &testClientConn{target: v.target} + r, err := b.Build(resolver.Target{Endpoint: v.target}, cc, resolver.BuildOption{}) + if err != nil { + t.Fatalf("%v\n", err) + } + var addrs []resolver.Address + var cnt int + for { + addrs, cnt = cc.getAddress() + if cnt > 0 { + break + } + time.Sleep(time.Millisecond) + } + if !reflect.DeepEqual(v.want, addrs) { + t.Errorf("Resolved addresses of target: %q = %+v, want %+v\n", v.target, addrs, v.want) + } + r.ResolveNow(resolver.ResolveNowOption{}) + for { + addrs, cnt = cc.getAddress() + if cnt == 2 { + break + } + time.Sleep(time.Millisecond) + } + if !reflect.DeepEqual(v.want, addrs) { + t.Errorf("Resolved addresses of target: %q = %+v, want %+v\n", v.target, addrs, v.want) + } + r.Close() + } +} + +func TestResolveFunc(t *testing.T) { + defer leakcheck.Check(t) + tests := []struct { + addr string + want error + }{ + // TODO(yuxuanli): More false cases? + {"www.google.com", nil}, + {"foo.bar:12345", nil}, + {"127.0.0.1", nil}, + {"127.0.0.1:12345", nil}, + {"[::1]:80", nil}, + {"[2001:db8:a0b:12f0::1]:21", nil}, + {":80", nil}, + {"127.0.0...1:12345", nil}, + {"[fe80::1%lo0]:80", nil}, + {"golang.org:http", nil}, + {"[2001:db8::1]:http", nil}, + {":", nil}, + {"", errMissingAddr}, + {"[2001:db8:a0b:12f0::1", errForInvalidTarget}, + } + + b := NewBuilder() + for _, v := range tests { + cc := &testClientConn{target: v.addr} + r, err := b.Build(resolver.Target{Endpoint: v.addr}, cc, resolver.BuildOption{}) + if err == nil { + r.Close() + } + if !reflect.DeepEqual(err, v.want) { + t.Errorf("Build(%q, cc, resolver.BuildOption{}) = %v, want %v", v.addr, err, v.want) + } + } +} diff --git a/vendor/google.golang.org/grpc/resolver/dns/go17.go b/vendor/google.golang.org/grpc/resolver/dns/go17.go new file mode 100644 index 0000000000..b466bc8f6d --- /dev/null +++ b/vendor/google.golang.org/grpc/resolver/dns/go17.go @@ -0,0 +1,35 @@ +// +build go1.6, !go1.8 + +/* + * + * Copyright 2017 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. + * + */ + +package dns + +import ( + "net" + + "golang.org/x/net/context" +) + +var ( + lookupHost = func(ctx context.Context, host string) ([]string, error) { return net.LookupHost(host) } + lookupSRV = func(ctx context.Context, service, proto, name string) (string, []*net.SRV, error) { + return net.LookupSRV(service, proto, name) + } + lookupTXT = func(ctx context.Context, name string) ([]string, error) { return net.LookupTXT(name) } +) diff --git a/vendor/google.golang.org/grpc/resolver/dns/go17_test.go b/vendor/google.golang.org/grpc/resolver/dns/go17_test.go new file mode 100644 index 0000000000..21eaa8885c --- /dev/null +++ b/vendor/google.golang.org/grpc/resolver/dns/go17_test.go @@ -0,0 +1,50 @@ +// +build go1.6, !go1.8 + +/* + * + * Copyright 2017 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. + * + */ + +package dns + +import ( + "fmt" + "net" + + "golang.org/x/net/context" +) + +var errForInvalidTarget = fmt.Errorf("invalid target address [2001:db8:a0b:12f0::1, error info: missing ']' in address [2001:db8:a0b:12f0::1:443") + +func replaceNetFunc() func() { + oldLookupHost := lookupHost + oldLookupSRV := lookupSRV + oldLookupTXT := lookupTXT + lookupHost = func(ctx context.Context, host string) ([]string, error) { + return hostLookup(host) + } + lookupSRV = func(ctx context.Context, service, proto, name string) (string, []*net.SRV, error) { + return srvLookup(service, proto, name) + } + lookupTXT = func(ctx context.Context, host string) ([]string, error) { + return txtLookup(host) + } + return func() { + lookupHost = oldLookupHost + lookupSRV = oldLookupSRV + lookupTXT = oldLookupTXT + } +} diff --git a/vendor/google.golang.org/grpc/resolver/dns/go18.go b/vendor/google.golang.org/grpc/resolver/dns/go18.go new file mode 100644 index 0000000000..fa34f14cad --- /dev/null +++ b/vendor/google.golang.org/grpc/resolver/dns/go18.go @@ -0,0 +1,29 @@ +// +build go1.8 + +/* + * + * Copyright 2017 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. + * + */ + +package dns + +import "net" + +var ( + lookupHost = net.DefaultResolver.LookupHost + lookupSRV = net.DefaultResolver.LookupSRV + lookupTXT = net.DefaultResolver.LookupTXT +) diff --git a/vendor/google.golang.org/grpc/resolver/dns/go18_test.go b/vendor/google.golang.org/grpc/resolver/dns/go18_test.go new file mode 100644 index 0000000000..b0149c8677 --- /dev/null +++ b/vendor/google.golang.org/grpc/resolver/dns/go18_test.go @@ -0,0 +1,49 @@ +// +build go1.8 + +/* + * + * Copyright 2017 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. + * + */ + +package dns + +import ( + "context" + "fmt" + "net" +) + +var errForInvalidTarget = fmt.Errorf("invalid target address [2001:db8:a0b:12f0::1, error info: address [2001:db8:a0b:12f0::1:443: missing ']' in address") + +func replaceNetFunc() func() { + oldLookupHost := lookupHost + oldLookupSRV := lookupSRV + oldLookupTXT := lookupTXT + lookupHost = func(ctx context.Context, host string) ([]string, error) { + return hostLookup(host) + } + lookupSRV = func(ctx context.Context, service, proto, name string) (string, []*net.SRV, error) { + return srvLookup(service, proto, name) + } + lookupTXT = func(ctx context.Context, host string) ([]string, error) { + return txtLookup(host) + } + return func() { + lookupHost = oldLookupHost + lookupSRV = oldLookupSRV + lookupTXT = oldLookupTXT + } +} diff --git a/vendor/google.golang.org/grpc/resolver/manual/manual.go b/vendor/google.golang.org/grpc/resolver/manual/manual.go new file mode 100644 index 0000000000..de2fb25b55 --- /dev/null +++ b/vendor/google.golang.org/grpc/resolver/manual/manual.go @@ -0,0 +1,80 @@ +/* + * + * Copyright 2017 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. + * + */ + +// Package manual contains a resolver for testing purpose only. +package manual + +import ( + "strconv" + "time" + + "google.golang.org/grpc/resolver" +) + +// NewBuilderWithScheme creates a new test resolver builder with the given scheme. +func NewBuilderWithScheme(scheme string) *Resolver { + return &Resolver{ + scheme: scheme, + } +} + +// Resolver is also a resolver builder. +// It's build() function always returns itself. +type Resolver struct { + scheme string + + // Fields actually belong to the resolver. + cc resolver.ClientConn +} + +// Build returns itself for Resolver, because it's both a builder and a resolver. +func (r *Resolver) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOption) (resolver.Resolver, error) { + r.cc = cc + return r, nil +} + +// Scheme returns the test scheme. +func (r *Resolver) Scheme() string { + return r.scheme +} + +// ResolveNow is a noop for Resolver. +func (*Resolver) ResolveNow(o resolver.ResolveNowOption) {} + +// Close is a noop for Resolver. +func (*Resolver) Close() {} + +// NewAddress calls cc.NewAddress. +func (r *Resolver) NewAddress(addrs []resolver.Address) { + r.cc.NewAddress(addrs) +} + +// NewServiceConfig calls cc.NewServiceConfig. +func (r *Resolver) NewServiceConfig(sc string) { + r.cc.NewServiceConfig(sc) +} + +// GenerateAndRegisterManualResolver generates a random scheme and a Resolver +// with it. It also regieter this Resolver. +// It returns the Resolver and a cleanup function to unregister it. +func GenerateAndRegisterManualResolver() (*Resolver, func()) { + scheme := strconv.FormatInt(time.Now().UnixNano(), 36) + r := NewBuilderWithScheme(scheme) + resolver.Register(r) + return r, func() { resolver.UnregisterForTesting(scheme) } +} diff --git a/vendor/google.golang.org/grpc/resolver/passthrough/passthrough.go b/vendor/google.golang.org/grpc/resolver/passthrough/passthrough.go new file mode 100644 index 0000000000..b76010d74d --- /dev/null +++ b/vendor/google.golang.org/grpc/resolver/passthrough/passthrough.go @@ -0,0 +1,57 @@ +/* + * + * Copyright 2017 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. + * + */ + +// Package passthrough implements a pass-through resolver. It sends the target +// name without scheme back to gRPC as resolved address. +package passthrough + +import "google.golang.org/grpc/resolver" + +const scheme = "passthrough" + +type passthroughBuilder struct{} + +func (*passthroughBuilder) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOption) (resolver.Resolver, error) { + r := &passthroughResolver{ + target: target, + cc: cc, + } + r.start() + return r, nil +} + +func (*passthroughBuilder) Scheme() string { + return scheme +} + +type passthroughResolver struct { + target resolver.Target + cc resolver.ClientConn +} + +func (r *passthroughResolver) start() { + r.cc.NewAddress([]resolver.Address{{Addr: r.target.Endpoint}}) +} + +func (*passthroughResolver) ResolveNow(o resolver.ResolveNowOption) {} + +func (*passthroughResolver) Close() {} + +func init() { + resolver.Register(&passthroughBuilder{}) +} diff --git a/vendor/google.golang.org/grpc/resolver/resolver.go b/vendor/google.golang.org/grpc/resolver/resolver.go new file mode 100644 index 0000000000..0dd887fa54 --- /dev/null +++ b/vendor/google.golang.org/grpc/resolver/resolver.go @@ -0,0 +1,143 @@ +/* + * + * Copyright 2017 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. + * + */ + +// Package resolver defines APIs for name resolution in gRPC. +// All APIs in this package are experimental. +package resolver + +var ( + // m is a map from scheme to resolver builder. + m = make(map[string]Builder) + // defaultScheme is the default scheme to use. + defaultScheme = "passthrough" +) + +// TODO(bar) install dns resolver in init(){}. + +// Register registers the resolver builder to the resolver map. +// b.Scheme will be used as the scheme registered with this builder. +func Register(b Builder) { + m[b.Scheme()] = b +} + +// Get returns the resolver builder registered with the given scheme. +// If no builder is register with the scheme, the default scheme will +// be used. +// If the default scheme is not modified, "dns" will be the default +// scheme, and the preinstalled dns resolver will be used. +// If the default scheme is modified, and a resolver is registered with +// the scheme, that resolver will be returned. +// If the default scheme is modified, and no resolver is registered with +// the scheme, nil will be returned. +func Get(scheme string) Builder { + if b, ok := m[scheme]; ok { + return b + } + if b, ok := m[defaultScheme]; ok { + return b + } + return nil +} + +// SetDefaultScheme sets the default scheme that will be used. +// The default default scheme is "dns". +func SetDefaultScheme(scheme string) { + defaultScheme = scheme +} + +// AddressType indicates the address type returned by name resolution. +type AddressType uint8 + +const ( + // Backend indicates the address is for a backend server. + Backend AddressType = iota + // GRPCLB indicates the address is for a grpclb load balancer. + GRPCLB +) + +// Address represents a server the client connects to. +// This is the EXPERIMENTAL API and may be changed or extended in the future. +type Address struct { + // Addr is the server address on which a connection will be established. + Addr string + // Type is the type of this address. + Type AddressType + // ServerName is the name of this address. + // It's the name of the grpc load balancer, which will be used for authentication. + ServerName string + // Metadata is the information associated with Addr, which may be used + // to make load balancing decision. + Metadata interface{} +} + +// BuildOption includes additional information for the builder to create +// the resolver. +type BuildOption struct { +} + +// ClientConn contains the callbacks for resolver to notify any updates +// to the gRPC ClientConn. +type ClientConn interface { + // NewAddress is called by resolver to notify ClientConn a new list + // of resolved addresses. + // The address list should be the complete list of resolved addresses. + NewAddress(addresses []Address) + // NewServiceConfig is called by resolver to notify ClientConn a new + // service config. The service config should be provided as a json string. + NewServiceConfig(serviceConfig string) +} + +// Target represents a target for gRPC, as specified in: +// https://github.com/grpc/grpc/blob/master/doc/naming.md. +type Target struct { + Scheme string + Authority string + Endpoint string +} + +// Builder creates a resolver that will be used to watch name resolution updates. +type Builder interface { + // Build creates a new resolver for the given target. + // + // gRPC dial calls Build synchronously, and fails if the returned error is + // not nil. + Build(target Target, cc ClientConn, opts BuildOption) (Resolver, error) + // Scheme returns the scheme supported by this resolver. + // Scheme is defined at https://github.com/grpc/grpc/blob/master/doc/naming.md. + Scheme() string +} + +// ResolveNowOption includes additional information for ResolveNow. +type ResolveNowOption struct{} + +// Resolver watches for the updates on the specified target. +// Updates include address updates and service config updates. +type Resolver interface { + // ResolveNow will be called by gRPC to try to resolve the target name again. + // It's just a hint, resolver can ignore this if it's not necessary. + ResolveNow(ResolveNowOption) + // Close closes the resolver. + Close() +} + +// UnregisterForTesting removes the resolver builder with the given scheme from the +// resolver map. +// This function is for testing only. +func UnregisterForTesting(scheme string) { + delete(m, scheme) +} diff --git a/vendor/google.golang.org/grpc/resolver_conn_wrapper.go b/vendor/google.golang.org/grpc/resolver_conn_wrapper.go new file mode 100644 index 0000000000..c07e174a84 --- /dev/null +++ b/vendor/google.golang.org/grpc/resolver_conn_wrapper.go @@ -0,0 +1,144 @@ +/* + * + * Copyright 2017 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. + * + */ + +package grpc + +import ( + "fmt" + "strings" + + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/resolver" +) + +// ccResolverWrapper is a wrapper on top of cc for resolvers. +// It implements resolver.ClientConnection interface. +type ccResolverWrapper struct { + cc *ClientConn + resolver resolver.Resolver + addrCh chan []resolver.Address + scCh chan string + done chan struct{} +} + +// split2 returns the values from strings.SplitN(s, sep, 2). +// If sep is not found, it returns ("", s, false) instead. +func split2(s, sep string) (string, string, bool) { + spl := strings.SplitN(s, sep, 2) + if len(spl) < 2 { + return "", "", false + } + return spl[0], spl[1], true +} + +// parseTarget splits target into a struct containing scheme, authority and +// endpoint. +func parseTarget(target string) (ret resolver.Target) { + var ok bool + ret.Scheme, ret.Endpoint, ok = split2(target, "://") + if !ok { + return resolver.Target{Endpoint: target} + } + ret.Authority, ret.Endpoint, _ = split2(ret.Endpoint, "/") + return ret +} + +// newCCResolverWrapper parses cc.target for scheme and gets the resolver +// builder for this scheme. It then builds the resolver and starts the +// monitoring goroutine for it. +func newCCResolverWrapper(cc *ClientConn) (*ccResolverWrapper, error) { + grpclog.Infof("dialing to target with scheme: %q", cc.parsedTarget.Scheme) + + rb := resolver.Get(cc.parsedTarget.Scheme) + if rb == nil { + return nil, fmt.Errorf("could not get resolver for scheme: %q", cc.parsedTarget.Scheme) + } + + ccr := &ccResolverWrapper{ + cc: cc, + addrCh: make(chan []resolver.Address, 1), + scCh: make(chan string, 1), + done: make(chan struct{}), + } + + var err error + ccr.resolver, err = rb.Build(cc.parsedTarget, ccr, resolver.BuildOption{}) + if err != nil { + return nil, err + } + go ccr.watcher() + return ccr, nil +} + +// watcher processes address updates and service config updates sequencially. +// Otherwise, we need to resolve possible races between address and service +// config (e.g. they specify different balancer types). +func (ccr *ccResolverWrapper) watcher() { + for { + select { + case <-ccr.done: + return + default: + } + + select { + case addrs := <-ccr.addrCh: + select { + case <-ccr.done: + return + default: + } + grpclog.Infof("ccResolverWrapper: sending new addresses to cc: %v", addrs) + ccr.cc.handleResolvedAddrs(addrs, nil) + case sc := <-ccr.scCh: + select { + case <-ccr.done: + return + default: + } + grpclog.Infof("ccResolverWrapper: got new service config: %v", sc) + ccr.cc.handleServiceConfig(sc) + case <-ccr.done: + return + } + } +} + +func (ccr *ccResolverWrapper) close() { + ccr.resolver.Close() + close(ccr.done) +} + +// NewAddress is called by the resolver implemenetion to send addresses to gRPC. +func (ccr *ccResolverWrapper) NewAddress(addrs []resolver.Address) { + select { + case <-ccr.addrCh: + default: + } + ccr.addrCh <- addrs +} + +// NewServiceConfig is called by the resolver implemenetion to send service +// configs to gPRC. +func (ccr *ccResolverWrapper) NewServiceConfig(sc string) { + select { + case <-ccr.scCh: + default: + } + ccr.scCh <- sc +} diff --git a/vendor/google.golang.org/grpc/resolver_conn_wrapper_test.go b/vendor/google.golang.org/grpc/resolver_conn_wrapper_test.go new file mode 100644 index 0000000000..d857f4370a --- /dev/null +++ b/vendor/google.golang.org/grpc/resolver_conn_wrapper_test.go @@ -0,0 +1,79 @@ +/* + * + * Copyright 2017 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. + * + */ + +package grpc + +import ( + "testing" + + "google.golang.org/grpc/resolver" +) + +func TestParseTarget(t *testing.T) { + for _, test := range []resolver.Target{ + {"", "", ""}, + {"a", "", ""}, + {"", "a", ""}, + {"", "", "a"}, + {"a", "b", ""}, + {"a", "", "b"}, + {"", "a", "b"}, + {"a", "b", "c"}, + {"dns", "", "google.com"}, + {"dns", "a.server.com", "google.com"}, + {"dns", "a.server.com", "google.com/?a=b"}, + {"", "", "/unix/socket/address"}, + } { + str := test.Scheme + "://" + test.Authority + "/" + test.Endpoint + got := parseTarget(str) + if got != test { + t.Errorf("parseTarget(%q) = %+v, want %+v", str, got, test) + } + } +} + +func TestParseTargetString(t *testing.T) { + for _, test := range []struct { + targetStr string + want resolver.Target + }{ + {"", resolver.Target{"", "", ""}}, + {"://", resolver.Target{"", "", ""}}, + {":///", resolver.Target{"", "", ""}}, + {"a:///", resolver.Target{"a", "", ""}}, + {"://a/", resolver.Target{"", "a", ""}}, + {":///a", resolver.Target{"", "", "a"}}, + {"a://b/", resolver.Target{"a", "b", ""}}, + {"a:///b", resolver.Target{"a", "", "b"}}, + {"://a/b", resolver.Target{"", "a", "b"}}, + {"a://b/c", resolver.Target{"a", "b", "c"}}, + {"dns:///google.com", resolver.Target{"dns", "", "google.com"}}, + {"dns://a.server.com/google.com", resolver.Target{"dns", "a.server.com", "google.com"}}, + {"dns://a.server.com/google.com/?a=b", resolver.Target{"dns", "a.server.com", "google.com/?a=b"}}, + + {"/", resolver.Target{"", "", "/"}}, + {"google.com", resolver.Target{"", "", "google.com"}}, + {"google.com/?a=b", resolver.Target{"", "", "google.com/?a=b"}}, + {"/unix/socket/address", resolver.Target{"", "", "/unix/socket/address"}}, + } { + got := parseTarget(test.targetStr) + if got != test.want { + t.Errorf("parseTarget(%q) = %+v, want %+v", test.targetStr, got, test.want) + } + } +} diff --git a/vendor/google.golang.org/grpc/rpc_util.go b/vendor/google.golang.org/grpc/rpc_util.go new file mode 100644 index 0000000000..1b11ae05ef --- /dev/null +++ b/vendor/google.golang.org/grpc/rpc_util.go @@ -0,0 +1,515 @@ +/* + * + * Copyright 2014 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. + * + */ + +package grpc + +import ( + "bytes" + "compress/gzip" + "encoding/binary" + "io" + "io/ioutil" + "math" + "sync" + "time" + + "golang.org/x/net/context" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/encoding" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/peer" + "google.golang.org/grpc/stats" + "google.golang.org/grpc/status" + "google.golang.org/grpc/transport" +) + +// Compressor defines the interface gRPC uses to compress a message. +type Compressor interface { + // Do compresses p into w. + Do(w io.Writer, p []byte) error + // Type returns the compression algorithm the Compressor uses. + Type() string +} + +type gzipCompressor struct { + pool sync.Pool +} + +// NewGZIPCompressor creates a Compressor based on GZIP. +func NewGZIPCompressor() Compressor { + return &gzipCompressor{ + pool: sync.Pool{ + New: func() interface{} { + return gzip.NewWriter(ioutil.Discard) + }, + }, + } +} + +func (c *gzipCompressor) Do(w io.Writer, p []byte) error { + z := c.pool.Get().(*gzip.Writer) + defer c.pool.Put(z) + z.Reset(w) + if _, err := z.Write(p); err != nil { + return err + } + return z.Close() +} + +func (c *gzipCompressor) Type() string { + return "gzip" +} + +// Decompressor defines the interface gRPC uses to decompress a message. +type Decompressor interface { + // Do reads the data from r and uncompress them. + Do(r io.Reader) ([]byte, error) + // Type returns the compression algorithm the Decompressor uses. + Type() string +} + +type gzipDecompressor struct { + pool sync.Pool +} + +// NewGZIPDecompressor creates a Decompressor based on GZIP. +func NewGZIPDecompressor() Decompressor { + return &gzipDecompressor{} +} + +func (d *gzipDecompressor) Do(r io.Reader) ([]byte, error) { + var z *gzip.Reader + switch maybeZ := d.pool.Get().(type) { + case nil: + newZ, err := gzip.NewReader(r) + if err != nil { + return nil, err + } + z = newZ + case *gzip.Reader: + z = maybeZ + if err := z.Reset(r); err != nil { + d.pool.Put(z) + return nil, err + } + } + + defer func() { + z.Close() + d.pool.Put(z) + }() + return ioutil.ReadAll(z) +} + +func (d *gzipDecompressor) Type() string { + return "gzip" +} + +// callInfo contains all related configuration and information about an RPC. +type callInfo struct { + compressorType string + failFast bool + headerMD metadata.MD + trailerMD metadata.MD + peer *peer.Peer + traceInfo traceInfo // in trace.go + maxReceiveMessageSize *int + maxSendMessageSize *int + creds credentials.PerRPCCredentials +} + +func defaultCallInfo() *callInfo { + return &callInfo{failFast: true} +} + +// CallOption configures a Call before it starts or extracts information from +// a Call after it completes. +type CallOption interface { + // before is called before the call is sent to any server. If before + // returns a non-nil error, the RPC fails with that error. + before(*callInfo) error + + // after is called after the call has completed. after cannot return an + // error, so any failures should be reported via output parameters. + after(*callInfo) +} + +// EmptyCallOption does not alter the Call configuration. +// It can be embedded in another structure to carry satellite data for use +// by interceptors. +type EmptyCallOption struct{} + +func (EmptyCallOption) before(*callInfo) error { return nil } +func (EmptyCallOption) after(*callInfo) {} + +type beforeCall func(c *callInfo) error + +func (o beforeCall) before(c *callInfo) error { return o(c) } +func (o beforeCall) after(c *callInfo) {} + +type afterCall func(c *callInfo) + +func (o afterCall) before(c *callInfo) error { return nil } +func (o afterCall) after(c *callInfo) { o(c) } + +// Header returns a CallOptions that retrieves the header metadata +// for a unary RPC. +func Header(md *metadata.MD) CallOption { + return afterCall(func(c *callInfo) { + *md = c.headerMD + }) +} + +// Trailer returns a CallOptions that retrieves the trailer metadata +// for a unary RPC. +func Trailer(md *metadata.MD) CallOption { + return afterCall(func(c *callInfo) { + *md = c.trailerMD + }) +} + +// Peer returns a CallOption that retrieves peer information for a +// unary RPC. +func Peer(peer *peer.Peer) CallOption { + return afterCall(func(c *callInfo) { + if c.peer != nil { + *peer = *c.peer + } + }) +} + +// FailFast configures the action to take when an RPC is attempted on broken +// connections or unreachable servers. If failFast is true, the RPC will fail +// immediately. Otherwise, the RPC client will block the call until a +// connection is available (or the call is canceled or times out) and will +// retry the call if it fails due to a transient error. gRPC will not retry if +// data was written to the wire unless the server indicates it did not process +// the data. Please refer to +// https://github.com/grpc/grpc/blob/master/doc/wait-for-ready.md. +// +// By default, RPCs are "Fail Fast". +func FailFast(failFast bool) CallOption { + return beforeCall(func(c *callInfo) error { + c.failFast = failFast + return nil + }) +} + +// MaxCallRecvMsgSize returns a CallOption which sets the maximum message size the client can receive. +func MaxCallRecvMsgSize(s int) CallOption { + return beforeCall(func(o *callInfo) error { + o.maxReceiveMessageSize = &s + return nil + }) +} + +// MaxCallSendMsgSize returns a CallOption which sets the maximum message size the client can send. +func MaxCallSendMsgSize(s int) CallOption { + return beforeCall(func(o *callInfo) error { + o.maxSendMessageSize = &s + return nil + }) +} + +// PerRPCCredentials returns a CallOption that sets credentials.PerRPCCredentials +// for a call. +func PerRPCCredentials(creds credentials.PerRPCCredentials) CallOption { + return beforeCall(func(c *callInfo) error { + c.creds = creds + return nil + }) +} + +// UseCompressor returns a CallOption which sets the compressor used when +// sending the request. If WithCompressor is also set, UseCompressor has +// higher priority. +// +// This API is EXPERIMENTAL. +func UseCompressor(name string) CallOption { + return beforeCall(func(c *callInfo) error { + c.compressorType = name + return nil + }) +} + +// The format of the payload: compressed or not? +type payloadFormat uint8 + +const ( + compressionNone payloadFormat = iota // no compression + compressionMade +) + +// parser reads complete gRPC messages from the underlying reader. +type parser struct { + // r is the underlying reader. + // See the comment on recvMsg for the permissible + // error types. + r io.Reader + + // The header of a gRPC message. Find more detail + // at https://grpc.io/docs/guides/wire.html. + header [5]byte +} + +// recvMsg reads a complete gRPC message from the stream. +// +// It returns the message and its payload (compression/encoding) +// format. The caller owns the returned msg memory. +// +// If there is an error, possible values are: +// * io.EOF, when no messages remain +// * io.ErrUnexpectedEOF +// * of type transport.ConnectionError +// * of type transport.StreamError +// No other error values or types must be returned, which also means +// that the underlying io.Reader must not return an incompatible +// error. +func (p *parser) recvMsg(maxReceiveMessageSize int) (pf payloadFormat, msg []byte, err error) { + if _, err := p.r.Read(p.header[:]); err != nil { + return 0, nil, err + } + + pf = payloadFormat(p.header[0]) + length := binary.BigEndian.Uint32(p.header[1:]) + + if length == 0 { + return pf, nil, nil + } + if int64(length) > int64(maxInt) { + return 0, nil, Errorf(codes.ResourceExhausted, "grpc: received message larger than max length allowed on current machine (%d vs. %d)", length, maxInt) + } + if int(length) > maxReceiveMessageSize { + return 0, nil, Errorf(codes.ResourceExhausted, "grpc: received message larger than max (%d vs. %d)", length, maxReceiveMessageSize) + } + // TODO(bradfitz,zhaoq): garbage. reuse buffer after proto decoding instead + // of making it for each message: + msg = make([]byte, int(length)) + if _, err := p.r.Read(msg); err != nil { + if err == io.EOF { + err = io.ErrUnexpectedEOF + } + return 0, nil, err + } + return pf, msg, nil +} + +// encode serializes msg and returns a buffer of message header and a buffer of msg. +// If msg is nil, it generates the message header and an empty msg buffer. +// TODO(ddyihai): eliminate extra Compressor parameter. +func encode(c Codec, msg interface{}, cp Compressor, outPayload *stats.OutPayload, compressor encoding.Compressor) ([]byte, []byte, error) { + var ( + b []byte + cbuf *bytes.Buffer + ) + const ( + payloadLen = 1 + sizeLen = 4 + ) + if msg != nil { + var err error + b, err = c.Marshal(msg) + if err != nil { + return nil, nil, Errorf(codes.Internal, "grpc: error while marshaling: %v", err.Error()) + } + if outPayload != nil { + outPayload.Payload = msg + // TODO truncate large payload. + outPayload.Data = b + outPayload.Length = len(b) + } + if compressor != nil || cp != nil { + cbuf = new(bytes.Buffer) + // Has compressor, check Compressor is set by UseCompressor first. + if compressor != nil { + z, _ := compressor.Compress(cbuf) + if _, err := z.Write(b); err != nil { + return nil, nil, Errorf(codes.Internal, "grpc: error while compressing: %v", err.Error()) + } + z.Close() + } else { + // If Compressor is not set by UseCompressor, use default Compressor + if err := cp.Do(cbuf, b); err != nil { + return nil, nil, Errorf(codes.Internal, "grpc: error while compressing: %v", err.Error()) + } + } + b = cbuf.Bytes() + } + } + if uint(len(b)) > math.MaxUint32 { + return nil, nil, Errorf(codes.ResourceExhausted, "grpc: message too large (%d bytes)", len(b)) + } + + bufHeader := make([]byte, payloadLen+sizeLen) + if compressor != nil || cp != nil { + bufHeader[0] = byte(compressionMade) + } else { + bufHeader[0] = byte(compressionNone) + } + + // Write length of b into buf + binary.BigEndian.PutUint32(bufHeader[payloadLen:], uint32(len(b))) + if outPayload != nil { + outPayload.WireLength = payloadLen + sizeLen + len(b) + } + return bufHeader, b, nil +} + +func checkRecvPayload(pf payloadFormat, recvCompress string, haveCompressor bool) *status.Status { + switch pf { + case compressionNone: + case compressionMade: + if recvCompress == "" || recvCompress == encoding.Identity { + return status.New(codes.Internal, "grpc: compressed flag set with identity or empty encoding") + } + if !haveCompressor { + return status.Newf(codes.Unimplemented, "grpc: Decompressor is not installed for grpc-encoding %q", recvCompress) + } + default: + return status.Newf(codes.Internal, "grpc: received unexpected payload format %d", pf) + } + return nil +} + +// For the two compressor parameters, both should not be set, but if they are, +// dc takes precedence over compressor. +// TODO(dfawley): wrap the old compressor/decompressor using the new API? +func recv(p *parser, c Codec, s *transport.Stream, dc Decompressor, m interface{}, maxReceiveMessageSize int, inPayload *stats.InPayload, compressor encoding.Compressor) error { + pf, d, err := p.recvMsg(maxReceiveMessageSize) + if err != nil { + return err + } + if inPayload != nil { + inPayload.WireLength = len(d) + } + + if st := checkRecvPayload(pf, s.RecvCompress(), compressor != nil || dc != nil); st != nil { + return st.Err() + } + + if pf == compressionMade { + // To match legacy behavior, if the decompressor is set by WithDecompressor or RPCDecompressor, + // use this decompressor as the default. + if dc != nil { + d, err = dc.Do(bytes.NewReader(d)) + if err != nil { + return Errorf(codes.Internal, "grpc: failed to decompress the received message %v", err) + } + } else { + dcReader, err := compressor.Decompress(bytes.NewReader(d)) + if err != nil { + return Errorf(codes.Internal, "grpc: failed to decompress the received message %v", err) + } + d, err = ioutil.ReadAll(dcReader) + if err != nil { + return Errorf(codes.Internal, "grpc: failed to decompress the received message %v", err) + } + } + } + if len(d) > maxReceiveMessageSize { + // TODO: Revisit the error code. Currently keep it consistent with java + // implementation. + return Errorf(codes.ResourceExhausted, "grpc: received message larger than max (%d vs. %d)", len(d), maxReceiveMessageSize) + } + if err := c.Unmarshal(d, m); err != nil { + return Errorf(codes.Internal, "grpc: failed to unmarshal the received message %v", err) + } + if inPayload != nil { + inPayload.RecvTime = time.Now() + inPayload.Payload = m + // TODO truncate large payload. + inPayload.Data = d + inPayload.Length = len(d) + } + return nil +} + +type rpcInfo struct { + failfast bool + bytesSent bool + bytesReceived bool +} + +type rpcInfoContextKey struct{} + +func newContextWithRPCInfo(ctx context.Context, failfast bool) context.Context { + return context.WithValue(ctx, rpcInfoContextKey{}, &rpcInfo{failfast: failfast}) +} + +func rpcInfoFromContext(ctx context.Context) (s *rpcInfo, ok bool) { + s, ok = ctx.Value(rpcInfoContextKey{}).(*rpcInfo) + return +} + +func updateRPCInfoInContext(ctx context.Context, s rpcInfo) { + if ss, ok := rpcInfoFromContext(ctx); ok { + ss.bytesReceived = s.bytesReceived + ss.bytesSent = s.bytesSent + } + return +} + +// Code returns the error code for err if it was produced by the rpc system. +// Otherwise, it returns codes.Unknown. +// +// Deprecated; use status.FromError and Code method instead. +func Code(err error) codes.Code { + if s, ok := status.FromError(err); ok { + return s.Code() + } + return codes.Unknown +} + +// ErrorDesc returns the error description of err if it was produced by the rpc system. +// Otherwise, it returns err.Error() or empty string when err is nil. +// +// Deprecated; use status.FromError and Message method instead. +func ErrorDesc(err error) string { + if s, ok := status.FromError(err); ok { + return s.Message() + } + return err.Error() +} + +// Errorf returns an error containing an error code and a description; +// Errorf returns nil if c is OK. +// +// Deprecated; use status.Errorf instead. +func Errorf(c codes.Code, format string, a ...interface{}) error { + return status.Errorf(c, format, a...) +} + +// The SupportPackageIsVersion variables are referenced from generated protocol +// buffer files to ensure compatibility with the gRPC version used. The latest +// support package version is 5. +// +// Older versions are kept for compatibility. They may be removed if +// compatibility cannot be maintained. +// +// These constants should not be referenced from any other code. +const ( + SupportPackageIsVersion3 = true + SupportPackageIsVersion4 = true + SupportPackageIsVersion5 = true +) + +// Version is the current grpc version. +const Version = "1.8.0" + +const grpcUA = "grpc-go/" + Version diff --git a/vendor/google.golang.org/grpc/rpc_util_test.go b/vendor/google.golang.org/grpc/rpc_util_test.go new file mode 100644 index 0000000000..23c471e2e4 --- /dev/null +++ b/vendor/google.golang.org/grpc/rpc_util_test.go @@ -0,0 +1,237 @@ +/* + * + * Copyright 2014 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. + * + */ + +package grpc + +import ( + "bytes" + "io" + "math" + "reflect" + "testing" + + "github.com/golang/protobuf/proto" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + perfpb "google.golang.org/grpc/test/codec_perf" + "google.golang.org/grpc/transport" +) + +type fullReader struct { + reader io.Reader +} + +func (f fullReader) Read(p []byte) (int, error) { + return io.ReadFull(f.reader, p) +} + +var _ CallOption = EmptyCallOption{} // ensure EmptyCallOption implements the interface + +func TestSimpleParsing(t *testing.T) { + bigMsg := bytes.Repeat([]byte{'x'}, 1<<24) + for _, test := range []struct { + // input + p []byte + // outputs + err error + b []byte + pt payloadFormat + }{ + {nil, io.EOF, nil, compressionNone}, + {[]byte{0, 0, 0, 0, 0}, nil, nil, compressionNone}, + {[]byte{0, 0, 0, 0, 1, 'a'}, nil, []byte{'a'}, compressionNone}, + {[]byte{1, 0}, io.ErrUnexpectedEOF, nil, compressionNone}, + {[]byte{0, 0, 0, 0, 10, 'a'}, io.ErrUnexpectedEOF, nil, compressionNone}, + // Check that messages with length >= 2^24 are parsed. + {append([]byte{0, 1, 0, 0, 0}, bigMsg...), nil, bigMsg, compressionNone}, + } { + buf := fullReader{bytes.NewReader(test.p)} + parser := &parser{r: buf} + pt, b, err := parser.recvMsg(math.MaxInt32) + if err != test.err || !bytes.Equal(b, test.b) || pt != test.pt { + t.Fatalf("parser{%v}.recvMsg(_) = %v, %v, %v\nwant %v, %v, %v", test.p, pt, b, err, test.pt, test.b, test.err) + } + } +} + +func TestMultipleParsing(t *testing.T) { + // Set a byte stream consists of 3 messages with their headers. + p := []byte{0, 0, 0, 0, 1, 'a', 0, 0, 0, 0, 2, 'b', 'c', 0, 0, 0, 0, 1, 'd'} + b := fullReader{bytes.NewReader(p)} + parser := &parser{r: b} + + wantRecvs := []struct { + pt payloadFormat + data []byte + }{ + {compressionNone, []byte("a")}, + {compressionNone, []byte("bc")}, + {compressionNone, []byte("d")}, + } + for i, want := range wantRecvs { + pt, data, err := parser.recvMsg(math.MaxInt32) + if err != nil || pt != want.pt || !reflect.DeepEqual(data, want.data) { + t.Fatalf("after %d calls, parser{%v}.recvMsg(_) = %v, %v, %v\nwant %v, %v, ", + i, p, pt, data, err, want.pt, want.data) + } + } + + pt, data, err := parser.recvMsg(math.MaxInt32) + if err != io.EOF { + t.Fatalf("after %d recvMsgs calls, parser{%v}.recvMsg(_) = %v, %v, %v\nwant _, _, %v", + len(wantRecvs), p, pt, data, err, io.EOF) + } +} + +func TestEncode(t *testing.T) { + for _, test := range []struct { + // input + msg proto.Message + cp Compressor + // outputs + hdr []byte + data []byte + err error + }{ + {nil, nil, []byte{0, 0, 0, 0, 0}, []byte{}, nil}, + } { + hdr, data, err := encode(protoCodec{}, test.msg, nil, nil, nil) + if err != test.err || !bytes.Equal(hdr, test.hdr) || !bytes.Equal(data, test.data) { + t.Fatalf("encode(_, _, %v, _) = %v, %v, %v\nwant %v, %v, %v", test.cp, hdr, data, err, test.hdr, test.data, test.err) + } + } +} + +func TestCompress(t *testing.T) { + for _, test := range []struct { + // input + data []byte + cp Compressor + dc Decompressor + // outputs + err error + }{ + {make([]byte, 1024), NewGZIPCompressor(), NewGZIPDecompressor(), nil}, + } { + b := new(bytes.Buffer) + if err := test.cp.Do(b, test.data); err != test.err { + t.Fatalf("Compressor.Do(_, %v) = %v, want %v", test.data, err, test.err) + } + if b.Len() >= len(test.data) { + t.Fatalf("The compressor fails to compress data.") + } + if p, err := test.dc.Do(b); err != nil || !bytes.Equal(test.data, p) { + t.Fatalf("Decompressor.Do(%v) = %v, %v, want %v, ", b, p, err, test.data) + } + } +} + +func TestToRPCErr(t *testing.T) { + for _, test := range []struct { + // input + errIn error + // outputs + errOut error + }{ + {transport.StreamError{Code: codes.Unknown, Desc: ""}, status.Error(codes.Unknown, "")}, + {transport.ErrConnClosing, status.Error(codes.Unavailable, transport.ErrConnClosing.Desc)}, + } { + err := toRPCErr(test.errIn) + if _, ok := status.FromError(err); !ok { + t.Fatalf("toRPCErr{%v} returned type %T, want %T", test.errIn, err, status.Error(codes.Unknown, "")) + } + if !reflect.DeepEqual(err, test.errOut) { + t.Fatalf("toRPCErr{%v} = %v \nwant %v", test.errIn, err, test.errOut) + } + } +} + +// bmEncode benchmarks encoding a Protocol Buffer message containing mSize +// bytes. +func bmEncode(b *testing.B, mSize int) { + msg := &perfpb.Buffer{Body: make([]byte, mSize)} + encodeHdr, encodeData, _ := encode(protoCodec{}, msg, nil, nil, nil) + encodedSz := int64(len(encodeHdr) + len(encodeData)) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + encode(protoCodec{}, msg, nil, nil, nil) + } + b.SetBytes(encodedSz) +} + +func BenchmarkEncode1B(b *testing.B) { + bmEncode(b, 1) +} + +func BenchmarkEncode1KiB(b *testing.B) { + bmEncode(b, 1024) +} + +func BenchmarkEncode8KiB(b *testing.B) { + bmEncode(b, 8*1024) +} + +func BenchmarkEncode64KiB(b *testing.B) { + bmEncode(b, 64*1024) +} + +func BenchmarkEncode512KiB(b *testing.B) { + bmEncode(b, 512*1024) +} + +func BenchmarkEncode1MiB(b *testing.B) { + bmEncode(b, 1024*1024) +} + +// bmCompressor benchmarks a compressor of a Protocol Buffer message containing +// mSize bytes. +func bmCompressor(b *testing.B, mSize int, cp Compressor) { + payload := make([]byte, mSize) + cBuf := bytes.NewBuffer(make([]byte, mSize)) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + cp.Do(cBuf, payload) + cBuf.Reset() + } +} + +func BenchmarkGZIPCompressor1B(b *testing.B) { + bmCompressor(b, 1, NewGZIPCompressor()) +} + +func BenchmarkGZIPCompressor1KiB(b *testing.B) { + bmCompressor(b, 1024, NewGZIPCompressor()) +} + +func BenchmarkGZIPCompressor8KiB(b *testing.B) { + bmCompressor(b, 8*1024, NewGZIPCompressor()) +} + +func BenchmarkGZIPCompressor64KiB(b *testing.B) { + bmCompressor(b, 64*1024, NewGZIPCompressor()) +} + +func BenchmarkGZIPCompressor512KiB(b *testing.B) { + bmCompressor(b, 512*1024, NewGZIPCompressor()) +} + +func BenchmarkGZIPCompressor1MiB(b *testing.B) { + bmCompressor(b, 1024*1024, NewGZIPCompressor()) +} diff --git a/vendor/google.golang.org/grpc/server.go b/vendor/google.golang.org/grpc/server.go new file mode 100644 index 0000000000..e9737fc499 --- /dev/null +++ b/vendor/google.golang.org/grpc/server.go @@ -0,0 +1,1282 @@ +/* + * + * Copyright 2014 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. + * + */ + +package grpc + +import ( + "bytes" + "errors" + "fmt" + "io" + "math" + "net" + "net/http" + "reflect" + "runtime" + "strings" + "sync" + "time" + + "io/ioutil" + + "golang.org/x/net/context" + "golang.org/x/net/http2" + "golang.org/x/net/trace" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/encoding" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/internal" + "google.golang.org/grpc/keepalive" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/stats" + "google.golang.org/grpc/status" + "google.golang.org/grpc/tap" + "google.golang.org/grpc/transport" +) + +const ( + defaultServerMaxReceiveMessageSize = 1024 * 1024 * 4 + defaultServerMaxSendMessageSize = math.MaxInt32 +) + +type methodHandler func(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor UnaryServerInterceptor) (interface{}, error) + +// MethodDesc represents an RPC service's method specification. +type MethodDesc struct { + MethodName string + Handler methodHandler +} + +// ServiceDesc represents an RPC service's specification. +type ServiceDesc struct { + ServiceName string + // The pointer to the service interface. Used to check whether the user + // provided implementation satisfies the interface requirements. + HandlerType interface{} + Methods []MethodDesc + Streams []StreamDesc + Metadata interface{} +} + +// service consists of the information of the server serving this service and +// the methods in this service. +type service struct { + server interface{} // the server for service methods + md map[string]*MethodDesc + sd map[string]*StreamDesc + mdata interface{} +} + +// Server is a gRPC server to serve RPC requests. +type Server struct { + opts options + + mu sync.Mutex // guards following + lis map[net.Listener]bool + conns map[io.Closer]bool + serve bool + drain bool + ctx context.Context + cancel context.CancelFunc + // A CondVar to let GracefulStop() blocks until all the pending RPCs are finished + // and all the transport goes away. + cv *sync.Cond + m map[string]*service // service name -> service info + events trace.EventLog + + quit chan struct{} + done chan struct{} + quitOnce sync.Once + doneOnce sync.Once +} + +type options struct { + creds credentials.TransportCredentials + codec Codec + cp Compressor + dc Decompressor + unaryInt UnaryServerInterceptor + streamInt StreamServerInterceptor + inTapHandle tap.ServerInHandle + statsHandler stats.Handler + maxConcurrentStreams uint32 + maxReceiveMessageSize int + maxSendMessageSize int + useHandlerImpl bool // use http.Handler-based server + unknownStreamDesc *StreamDesc + keepaliveParams keepalive.ServerParameters + keepalivePolicy keepalive.EnforcementPolicy + initialWindowSize int32 + initialConnWindowSize int32 + writeBufferSize int + readBufferSize int + connectionTimeout time.Duration +} + +var defaultServerOptions = options{ + maxReceiveMessageSize: defaultServerMaxReceiveMessageSize, + maxSendMessageSize: defaultServerMaxSendMessageSize, + connectionTimeout: 120 * time.Second, +} + +// A ServerOption sets options such as credentials, codec and keepalive parameters, etc. +type ServerOption func(*options) + +// WriteBufferSize lets you set the size of write buffer, this determines how much data can be batched +// before doing a write on the wire. +func WriteBufferSize(s int) ServerOption { + return func(o *options) { + o.writeBufferSize = s + } +} + +// ReadBufferSize lets you set the size of read buffer, this determines how much data can be read at most +// for one read syscall. +func ReadBufferSize(s int) ServerOption { + return func(o *options) { + o.readBufferSize = s + } +} + +// InitialWindowSize returns a ServerOption that sets window size for stream. +// The lower bound for window size is 64K and any value smaller than that will be ignored. +func InitialWindowSize(s int32) ServerOption { + return func(o *options) { + o.initialWindowSize = s + } +} + +// InitialConnWindowSize returns a ServerOption that sets window size for a connection. +// The lower bound for window size is 64K and any value smaller than that will be ignored. +func InitialConnWindowSize(s int32) ServerOption { + return func(o *options) { + o.initialConnWindowSize = s + } +} + +// KeepaliveParams returns a ServerOption that sets keepalive and max-age parameters for the server. +func KeepaliveParams(kp keepalive.ServerParameters) ServerOption { + return func(o *options) { + o.keepaliveParams = kp + } +} + +// KeepaliveEnforcementPolicy returns a ServerOption that sets keepalive enforcement policy for the server. +func KeepaliveEnforcementPolicy(kep keepalive.EnforcementPolicy) ServerOption { + return func(o *options) { + o.keepalivePolicy = kep + } +} + +// CustomCodec returns a ServerOption that sets a codec for message marshaling and unmarshaling. +func CustomCodec(codec Codec) ServerOption { + return func(o *options) { + o.codec = codec + } +} + +// RPCCompressor returns a ServerOption that sets a compressor for outbound +// messages. For backward compatibility, all outbound messages will be sent +// using this compressor, regardless of incoming message compression. By +// default, server messages will be sent using the same compressor with which +// request messages were sent. +// +// Deprecated: use encoding.RegisterCompressor instead. +func RPCCompressor(cp Compressor) ServerOption { + return func(o *options) { + o.cp = cp + } +} + +// RPCDecompressor returns a ServerOption that sets a decompressor for inbound +// messages. It has higher priority than decompressors registered via +// encoding.RegisterCompressor. +// +// Deprecated: use encoding.RegisterCompressor instead. +func RPCDecompressor(dc Decompressor) ServerOption { + return func(o *options) { + o.dc = dc + } +} + +// MaxMsgSize returns a ServerOption to set the max message size in bytes the server can receive. +// If this is not set, gRPC uses the default limit. Deprecated: use MaxRecvMsgSize instead. +func MaxMsgSize(m int) ServerOption { + return MaxRecvMsgSize(m) +} + +// MaxRecvMsgSize returns a ServerOption to set the max message size in bytes the server can receive. +// If this is not set, gRPC uses the default 4MB. +func MaxRecvMsgSize(m int) ServerOption { + return func(o *options) { + o.maxReceiveMessageSize = m + } +} + +// MaxSendMsgSize returns a ServerOption to set the max message size in bytes the server can send. +// If this is not set, gRPC uses the default 4MB. +func MaxSendMsgSize(m int) ServerOption { + return func(o *options) { + o.maxSendMessageSize = m + } +} + +// MaxConcurrentStreams returns a ServerOption that will apply a limit on the number +// of concurrent streams to each ServerTransport. +func MaxConcurrentStreams(n uint32) ServerOption { + return func(o *options) { + o.maxConcurrentStreams = n + } +} + +// Creds returns a ServerOption that sets credentials for server connections. +func Creds(c credentials.TransportCredentials) ServerOption { + return func(o *options) { + o.creds = c + } +} + +// UnaryInterceptor returns a ServerOption that sets the UnaryServerInterceptor for the +// server. Only one unary interceptor can be installed. The construction of multiple +// interceptors (e.g., chaining) can be implemented at the caller. +func UnaryInterceptor(i UnaryServerInterceptor) ServerOption { + return func(o *options) { + if o.unaryInt != nil { + panic("The unary server interceptor was already set and may not be reset.") + } + o.unaryInt = i + } +} + +// StreamInterceptor returns a ServerOption that sets the StreamServerInterceptor for the +// server. Only one stream interceptor can be installed. +func StreamInterceptor(i StreamServerInterceptor) ServerOption { + return func(o *options) { + if o.streamInt != nil { + panic("The stream server interceptor was already set and may not be reset.") + } + o.streamInt = i + } +} + +// InTapHandle returns a ServerOption that sets the tap handle for all the server +// transport to be created. Only one can be installed. +func InTapHandle(h tap.ServerInHandle) ServerOption { + return func(o *options) { + if o.inTapHandle != nil { + panic("The tap handle was already set and may not be reset.") + } + o.inTapHandle = h + } +} + +// StatsHandler returns a ServerOption that sets the stats handler for the server. +func StatsHandler(h stats.Handler) ServerOption { + return func(o *options) { + o.statsHandler = h + } +} + +// UnknownServiceHandler returns a ServerOption that allows for adding a custom +// unknown service handler. The provided method is a bidi-streaming RPC service +// handler that will be invoked instead of returning the "unimplemented" gRPC +// error whenever a request is received for an unregistered service or method. +// The handling function has full access to the Context of the request and the +// stream, and the invocation bypasses interceptors. +func UnknownServiceHandler(streamHandler StreamHandler) ServerOption { + return func(o *options) { + o.unknownStreamDesc = &StreamDesc{ + StreamName: "unknown_service_handler", + Handler: streamHandler, + // We need to assume that the users of the streamHandler will want to use both. + ClientStreams: true, + ServerStreams: true, + } + } +} + +// ConnectionTimeout returns a ServerOption that sets the timeout for +// connection establishment (up to and including HTTP/2 handshaking) for all +// new connections. If this is not set, the default is 120 seconds. A zero or +// negative value will result in an immediate timeout. +// +// This API is EXPERIMENTAL. +func ConnectionTimeout(d time.Duration) ServerOption { + return func(o *options) { + o.connectionTimeout = d + } +} + +// NewServer creates a gRPC server which has no service registered and has not +// started to accept requests yet. +func NewServer(opt ...ServerOption) *Server { + opts := defaultServerOptions + for _, o := range opt { + o(&opts) + } + if opts.codec == nil { + // Set the default codec. + opts.codec = protoCodec{} + } + s := &Server{ + lis: make(map[net.Listener]bool), + opts: opts, + conns: make(map[io.Closer]bool), + m: make(map[string]*service), + quit: make(chan struct{}), + done: make(chan struct{}), + } + s.cv = sync.NewCond(&s.mu) + s.ctx, s.cancel = context.WithCancel(context.Background()) + if EnableTracing { + _, file, line, _ := runtime.Caller(1) + s.events = trace.NewEventLog("grpc.Server", fmt.Sprintf("%s:%d", file, line)) + } + return s +} + +// printf records an event in s's event log, unless s has been stopped. +// REQUIRES s.mu is held. +func (s *Server) printf(format string, a ...interface{}) { + if s.events != nil { + s.events.Printf(format, a...) + } +} + +// errorf records an error in s's event log, unless s has been stopped. +// REQUIRES s.mu is held. +func (s *Server) errorf(format string, a ...interface{}) { + if s.events != nil { + s.events.Errorf(format, a...) + } +} + +// RegisterService registers a service and its implementation to the gRPC +// server. It is called from the IDL generated code. This must be called before +// invoking Serve. +func (s *Server) RegisterService(sd *ServiceDesc, ss interface{}) { + ht := reflect.TypeOf(sd.HandlerType).Elem() + st := reflect.TypeOf(ss) + if !st.Implements(ht) { + grpclog.Fatalf("grpc: Server.RegisterService found the handler of type %v that does not satisfy %v", st, ht) + } + s.register(sd, ss) +} + +func (s *Server) register(sd *ServiceDesc, ss interface{}) { + s.mu.Lock() + defer s.mu.Unlock() + s.printf("RegisterService(%q)", sd.ServiceName) + if s.serve { + grpclog.Fatalf("grpc: Server.RegisterService after Server.Serve for %q", sd.ServiceName) + } + if _, ok := s.m[sd.ServiceName]; ok { + grpclog.Fatalf("grpc: Server.RegisterService found duplicate service registration for %q", sd.ServiceName) + } + srv := &service{ + server: ss, + md: make(map[string]*MethodDesc), + sd: make(map[string]*StreamDesc), + mdata: sd.Metadata, + } + for i := range sd.Methods { + d := &sd.Methods[i] + srv.md[d.MethodName] = d + } + for i := range sd.Streams { + d := &sd.Streams[i] + srv.sd[d.StreamName] = d + } + s.m[sd.ServiceName] = srv +} + +// MethodInfo contains the information of an RPC including its method name and type. +type MethodInfo struct { + // Name is the method name only, without the service name or package name. + Name string + // IsClientStream indicates whether the RPC is a client streaming RPC. + IsClientStream bool + // IsServerStream indicates whether the RPC is a server streaming RPC. + IsServerStream bool +} + +// ServiceInfo contains unary RPC method info, streaming RPC method info and metadata for a service. +type ServiceInfo struct { + Methods []MethodInfo + // Metadata is the metadata specified in ServiceDesc when registering service. + Metadata interface{} +} + +// GetServiceInfo returns a map from service names to ServiceInfo. +// Service names include the package names, in the form of .. +func (s *Server) GetServiceInfo() map[string]ServiceInfo { + ret := make(map[string]ServiceInfo) + for n, srv := range s.m { + methods := make([]MethodInfo, 0, len(srv.md)+len(srv.sd)) + for m := range srv.md { + methods = append(methods, MethodInfo{ + Name: m, + IsClientStream: false, + IsServerStream: false, + }) + } + for m, d := range srv.sd { + methods = append(methods, MethodInfo{ + Name: m, + IsClientStream: d.ClientStreams, + IsServerStream: d.ServerStreams, + }) + } + + ret[n] = ServiceInfo{ + Methods: methods, + Metadata: srv.mdata, + } + } + return ret +} + +// ErrServerStopped indicates that the operation is now illegal because of +// the server being stopped. +var ErrServerStopped = errors.New("grpc: the server has been stopped") + +func (s *Server) useTransportAuthenticator(rawConn net.Conn) (net.Conn, credentials.AuthInfo, error) { + if s.opts.creds == nil { + return rawConn, nil, nil + } + return s.opts.creds.ServerHandshake(rawConn) +} + +// Serve accepts incoming connections on the listener lis, creating a new +// ServerTransport and service goroutine for each. The service goroutines +// read gRPC requests and then call the registered handlers to reply to them. +// Serve returns when lis.Accept fails with fatal errors. lis will be closed when +// this method returns. +// Serve will return a non-nil error unless Stop or GracefulStop is called. +func (s *Server) Serve(lis net.Listener) error { + s.mu.Lock() + s.printf("serving") + s.serve = true + if s.lis == nil { + s.mu.Unlock() + lis.Close() + return ErrServerStopped + } + s.lis[lis] = true + s.mu.Unlock() + defer func() { + s.mu.Lock() + if s.lis != nil && s.lis[lis] { + lis.Close() + delete(s.lis, lis) + } + s.mu.Unlock() + }() + + var tempDelay time.Duration // how long to sleep on accept failure + + for { + rawConn, err := lis.Accept() + if err != nil { + if ne, ok := err.(interface { + Temporary() bool + }); ok && ne.Temporary() { + if tempDelay == 0 { + tempDelay = 5 * time.Millisecond + } else { + tempDelay *= 2 + } + if max := 1 * time.Second; tempDelay > max { + tempDelay = max + } + s.mu.Lock() + s.printf("Accept error: %v; retrying in %v", err, tempDelay) + s.mu.Unlock() + timer := time.NewTimer(tempDelay) + select { + case <-timer.C: + case <-s.ctx.Done(): + } + timer.Stop() + continue + } + s.mu.Lock() + s.printf("done serving; Accept = %v", err) + s.mu.Unlock() + + // If Stop or GracefulStop is called, block until they are done and return nil + select { + case <-s.quit: + <-s.done + return nil + default: + } + return err + } + tempDelay = 0 + // Start a new goroutine to deal with rawConn + // so we don't stall this Accept loop goroutine. + go s.handleRawConn(rawConn) + } +} + +// handleRawConn is run in its own goroutine and handles a just-accepted +// connection that has not had any I/O performed on it yet. +func (s *Server) handleRawConn(rawConn net.Conn) { + rawConn.SetDeadline(time.Now().Add(s.opts.connectionTimeout)) + conn, authInfo, err := s.useTransportAuthenticator(rawConn) + if err != nil { + s.mu.Lock() + s.errorf("ServerHandshake(%q) failed: %v", rawConn.RemoteAddr(), err) + s.mu.Unlock() + grpclog.Warningf("grpc: Server.Serve failed to complete security handshake from %q: %v", rawConn.RemoteAddr(), err) + // If serverHandshake returns ErrConnDispatched, keep rawConn open. + if err != credentials.ErrConnDispatched { + rawConn.Close() + } + rawConn.SetDeadline(time.Time{}) + return + } + + s.mu.Lock() + if s.conns == nil { + s.mu.Unlock() + conn.Close() + return + } + s.mu.Unlock() + + if s.opts.useHandlerImpl { + rawConn.SetDeadline(time.Time{}) + s.serveUsingHandler(conn) + } else { + st := s.newHTTP2Transport(conn, authInfo) + if st == nil { + return + } + rawConn.SetDeadline(time.Time{}) + s.serveStreams(st) + } +} + +// newHTTP2Transport sets up a http/2 transport (using the +// gRPC http2 server transport in transport/http2_server.go). +func (s *Server) newHTTP2Transport(c net.Conn, authInfo credentials.AuthInfo) transport.ServerTransport { + config := &transport.ServerConfig{ + MaxStreams: s.opts.maxConcurrentStreams, + AuthInfo: authInfo, + InTapHandle: s.opts.inTapHandle, + StatsHandler: s.opts.statsHandler, + KeepaliveParams: s.opts.keepaliveParams, + KeepalivePolicy: s.opts.keepalivePolicy, + InitialWindowSize: s.opts.initialWindowSize, + InitialConnWindowSize: s.opts.initialConnWindowSize, + WriteBufferSize: s.opts.writeBufferSize, + ReadBufferSize: s.opts.readBufferSize, + } + st, err := transport.NewServerTransport("http2", c, config) + if err != nil { + s.mu.Lock() + s.errorf("NewServerTransport(%q) failed: %v", c.RemoteAddr(), err) + s.mu.Unlock() + c.Close() + grpclog.Warningln("grpc: Server.Serve failed to create ServerTransport: ", err) + return nil + } + if !s.addConn(st) { + st.Close() + return nil + } + return st +} + +func (s *Server) serveStreams(st transport.ServerTransport) { + defer s.removeConn(st) + defer st.Close() + var wg sync.WaitGroup + st.HandleStreams(func(stream *transport.Stream) { + wg.Add(1) + go func() { + defer wg.Done() + s.handleStream(st, stream, s.traceInfo(st, stream)) + }() + }, func(ctx context.Context, method string) context.Context { + if !EnableTracing { + return ctx + } + tr := trace.New("grpc.Recv."+methodFamily(method), method) + return trace.NewContext(ctx, tr) + }) + wg.Wait() +} + +var _ http.Handler = (*Server)(nil) + +// serveUsingHandler is called from handleRawConn when s is configured +// to handle requests via the http.Handler interface. It sets up a +// net/http.Server to handle the just-accepted conn. The http.Server +// is configured to route all incoming requests (all HTTP/2 streams) +// to ServeHTTP, which creates a new ServerTransport for each stream. +// serveUsingHandler blocks until conn closes. +// +// This codepath is only used when Server.TestingUseHandlerImpl has +// been configured. This lets the end2end tests exercise the ServeHTTP +// method as one of the environment types. +// +// conn is the *tls.Conn that's already been authenticated. +func (s *Server) serveUsingHandler(conn net.Conn) { + if !s.addConn(conn) { + conn.Close() + return + } + defer s.removeConn(conn) + h2s := &http2.Server{ + MaxConcurrentStreams: s.opts.maxConcurrentStreams, + } + h2s.ServeConn(conn, &http2.ServeConnOpts{ + Handler: s, + }) +} + +// ServeHTTP implements the Go standard library's http.Handler +// interface by responding to the gRPC request r, by looking up +// the requested gRPC method in the gRPC server s. +// +// The provided HTTP request must have arrived on an HTTP/2 +// connection. When using the Go standard library's server, +// practically this means that the Request must also have arrived +// over TLS. +// +// To share one port (such as 443 for https) between gRPC and an +// existing http.Handler, use a root http.Handler such as: +// +// if r.ProtoMajor == 2 && strings.HasPrefix( +// r.Header.Get("Content-Type"), "application/grpc") { +// grpcServer.ServeHTTP(w, r) +// } else { +// yourMux.ServeHTTP(w, r) +// } +// +// Note that ServeHTTP uses Go's HTTP/2 server implementation which is totally +// separate from grpc-go's HTTP/2 server. Performance and features may vary +// between the two paths. ServeHTTP does not support some gRPC features +// available through grpc-go's HTTP/2 server, and it is currently EXPERIMENTAL +// and subject to change. +func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { + st, err := transport.NewServerHandlerTransport(w, r) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + if !s.addConn(st) { + st.Close() + return + } + defer s.removeConn(st) + s.serveStreams(st) +} + +// traceInfo returns a traceInfo and associates it with stream, if tracing is enabled. +// If tracing is not enabled, it returns nil. +func (s *Server) traceInfo(st transport.ServerTransport, stream *transport.Stream) (trInfo *traceInfo) { + tr, ok := trace.FromContext(stream.Context()) + if !ok { + return nil + } + + trInfo = &traceInfo{ + tr: tr, + } + trInfo.firstLine.client = false + trInfo.firstLine.remoteAddr = st.RemoteAddr() + + if dl, ok := stream.Context().Deadline(); ok { + trInfo.firstLine.deadline = dl.Sub(time.Now()) + } + return trInfo +} + +func (s *Server) addConn(c io.Closer) bool { + s.mu.Lock() + defer s.mu.Unlock() + if s.conns == nil || s.drain { + return false + } + s.conns[c] = true + return true +} + +func (s *Server) removeConn(c io.Closer) { + s.mu.Lock() + defer s.mu.Unlock() + if s.conns != nil { + delete(s.conns, c) + s.cv.Broadcast() + } +} + +func (s *Server) sendResponse(t transport.ServerTransport, stream *transport.Stream, msg interface{}, cp Compressor, opts *transport.Options, comp encoding.Compressor) error { + var ( + outPayload *stats.OutPayload + ) + if s.opts.statsHandler != nil { + outPayload = &stats.OutPayload{} + } + hdr, data, err := encode(s.opts.codec, msg, cp, outPayload, comp) + if err != nil { + grpclog.Errorln("grpc: server failed to encode response: ", err) + return err + } + if len(data) > s.opts.maxSendMessageSize { + return status.Errorf(codes.ResourceExhausted, "grpc: trying to send message larger than max (%d vs. %d)", len(data), s.opts.maxSendMessageSize) + } + err = t.Write(stream, hdr, data, opts) + if err == nil && outPayload != nil { + outPayload.SentTime = time.Now() + s.opts.statsHandler.HandleRPC(stream.Context(), outPayload) + } + return err +} + +func (s *Server) processUnaryRPC(t transport.ServerTransport, stream *transport.Stream, srv *service, md *MethodDesc, trInfo *traceInfo) (err error) { + sh := s.opts.statsHandler + if sh != nil { + begin := &stats.Begin{ + BeginTime: time.Now(), + } + sh.HandleRPC(stream.Context(), begin) + defer func() { + end := &stats.End{ + EndTime: time.Now(), + } + if err != nil && err != io.EOF { + end.Error = toRPCErr(err) + } + sh.HandleRPC(stream.Context(), end) + }() + } + if trInfo != nil { + defer trInfo.tr.Finish() + trInfo.firstLine.client = false + trInfo.tr.LazyLog(&trInfo.firstLine, false) + defer func() { + if err != nil && err != io.EOF { + trInfo.tr.LazyLog(&fmtStringer{"%v", []interface{}{err}}, true) + trInfo.tr.SetError() + } + }() + } + + // comp and cp are used for compression. decomp and dc are used for + // decompression. If comp and decomp are both set, they are the same; + // however they are kept separate to ensure that at most one of the + // compressor/decompressor variable pairs are set for use later. + var comp, decomp encoding.Compressor + var cp Compressor + var dc Decompressor + + // If dc is set and matches the stream's compression, use it. Otherwise, try + // to find a matching registered compressor for decomp. + if rc := stream.RecvCompress(); s.opts.dc != nil && s.opts.dc.Type() == rc { + dc = s.opts.dc + } else if rc != "" && rc != encoding.Identity { + decomp = encoding.GetCompressor(rc) + if decomp == nil { + st := status.Newf(codes.Unimplemented, "grpc: Decompressor is not installed for grpc-encoding %q", rc) + t.WriteStatus(stream, st) + return st.Err() + } + } + + // If cp is set, use it. Otherwise, attempt to compress the response using + // the incoming message compression method. + // + // NOTE: this needs to be ahead of all handling, https://github.com/grpc/grpc-go/issues/686. + if s.opts.cp != nil { + cp = s.opts.cp + stream.SetSendCompress(cp.Type()) + } else if rc := stream.RecvCompress(); rc != "" && rc != encoding.Identity { + // Legacy compressor not specified; attempt to respond with same encoding. + comp = encoding.GetCompressor(rc) + if comp != nil { + stream.SetSendCompress(rc) + } + } + + p := &parser{r: stream} + pf, req, err := p.recvMsg(s.opts.maxReceiveMessageSize) + if err == io.EOF { + // The entire stream is done (for unary RPC only). + return err + } + if err == io.ErrUnexpectedEOF { + err = Errorf(codes.Internal, io.ErrUnexpectedEOF.Error()) + } + if err != nil { + if st, ok := status.FromError(err); ok { + if e := t.WriteStatus(stream, st); e != nil { + grpclog.Warningf("grpc: Server.processUnaryRPC failed to write status %v", e) + } + } else { + switch st := err.(type) { + case transport.ConnectionError: + // Nothing to do here. + case transport.StreamError: + if e := t.WriteStatus(stream, status.New(st.Code, st.Desc)); e != nil { + grpclog.Warningf("grpc: Server.processUnaryRPC failed to write status %v", e) + } + default: + panic(fmt.Sprintf("grpc: Unexpected error (%T) from recvMsg: %v", st, st)) + } + } + return err + } + if st := checkRecvPayload(pf, stream.RecvCompress(), dc != nil || decomp != nil); st != nil { + if e := t.WriteStatus(stream, st); e != nil { + grpclog.Warningf("grpc: Server.processUnaryRPC failed to write status %v", e) + } + return st.Err() + } + var inPayload *stats.InPayload + if sh != nil { + inPayload = &stats.InPayload{ + RecvTime: time.Now(), + } + } + df := func(v interface{}) error { + if inPayload != nil { + inPayload.WireLength = len(req) + } + if pf == compressionMade { + var err error + if dc != nil { + req, err = dc.Do(bytes.NewReader(req)) + if err != nil { + return Errorf(codes.Internal, err.Error()) + } + } else { + tmp, _ := decomp.Decompress(bytes.NewReader(req)) + req, err = ioutil.ReadAll(tmp) + if err != nil { + return Errorf(codes.Internal, "grpc: failed to decompress the received message %v", err) + } + } + } + if len(req) > s.opts.maxReceiveMessageSize { + // TODO: Revisit the error code. Currently keep it consistent with + // java implementation. + return status.Errorf(codes.ResourceExhausted, "grpc: received message larger than max (%d vs. %d)", len(req), s.opts.maxReceiveMessageSize) + } + if err := s.opts.codec.Unmarshal(req, v); err != nil { + return status.Errorf(codes.Internal, "grpc: error unmarshalling request: %v", err) + } + if inPayload != nil { + inPayload.Payload = v + inPayload.Data = req + inPayload.Length = len(req) + sh.HandleRPC(stream.Context(), inPayload) + } + if trInfo != nil { + trInfo.tr.LazyLog(&payload{sent: false, msg: v}, true) + } + return nil + } + reply, appErr := md.Handler(srv.server, stream.Context(), df, s.opts.unaryInt) + if appErr != nil { + appStatus, ok := status.FromError(appErr) + if !ok { + // Convert appErr if it is not a grpc status error. + appErr = status.Error(convertCode(appErr), appErr.Error()) + appStatus, _ = status.FromError(appErr) + } + if trInfo != nil { + trInfo.tr.LazyLog(stringer(appStatus.Message()), true) + trInfo.tr.SetError() + } + if e := t.WriteStatus(stream, appStatus); e != nil { + grpclog.Warningf("grpc: Server.processUnaryRPC failed to write status: %v", e) + } + return appErr + } + if trInfo != nil { + trInfo.tr.LazyLog(stringer("OK"), false) + } + opts := &transport.Options{ + Last: true, + Delay: false, + } + + if err := s.sendResponse(t, stream, reply, cp, opts, comp); err != nil { + if err == io.EOF { + // The entire stream is done (for unary RPC only). + return err + } + if s, ok := status.FromError(err); ok { + if e := t.WriteStatus(stream, s); e != nil { + grpclog.Warningf("grpc: Server.processUnaryRPC failed to write status: %v", e) + } + } else { + switch st := err.(type) { + case transport.ConnectionError: + // Nothing to do here. + case transport.StreamError: + if e := t.WriteStatus(stream, status.New(st.Code, st.Desc)); e != nil { + grpclog.Warningf("grpc: Server.processUnaryRPC failed to write status %v", e) + } + default: + panic(fmt.Sprintf("grpc: Unexpected error (%T) from sendResponse: %v", st, st)) + } + } + return err + } + if trInfo != nil { + trInfo.tr.LazyLog(&payload{sent: true, msg: reply}, true) + } + // TODO: Should we be logging if writing status failed here, like above? + // Should the logging be in WriteStatus? Should we ignore the WriteStatus + // error or allow the stats handler to see it? + return t.WriteStatus(stream, status.New(codes.OK, "")) +} + +func (s *Server) processStreamingRPC(t transport.ServerTransport, stream *transport.Stream, srv *service, sd *StreamDesc, trInfo *traceInfo) (err error) { + sh := s.opts.statsHandler + if sh != nil { + begin := &stats.Begin{ + BeginTime: time.Now(), + } + sh.HandleRPC(stream.Context(), begin) + defer func() { + end := &stats.End{ + EndTime: time.Now(), + } + if err != nil && err != io.EOF { + end.Error = toRPCErr(err) + } + sh.HandleRPC(stream.Context(), end) + }() + } + ss := &serverStream{ + t: t, + s: stream, + p: &parser{r: stream}, + codec: s.opts.codec, + maxReceiveMessageSize: s.opts.maxReceiveMessageSize, + maxSendMessageSize: s.opts.maxSendMessageSize, + trInfo: trInfo, + statsHandler: sh, + } + + // If dc is set and matches the stream's compression, use it. Otherwise, try + // to find a matching registered compressor for decomp. + if rc := stream.RecvCompress(); s.opts.dc != nil && s.opts.dc.Type() == rc { + ss.dc = s.opts.dc + } else if rc != "" && rc != encoding.Identity { + ss.decomp = encoding.GetCompressor(rc) + if ss.decomp == nil { + st := status.Newf(codes.Unimplemented, "grpc: Decompressor is not installed for grpc-encoding %q", rc) + t.WriteStatus(ss.s, st) + return st.Err() + } + } + + // If cp is set, use it. Otherwise, attempt to compress the response using + // the incoming message compression method. + // + // NOTE: this needs to be ahead of all handling, https://github.com/grpc/grpc-go/issues/686. + if s.opts.cp != nil { + ss.cp = s.opts.cp + stream.SetSendCompress(s.opts.cp.Type()) + } else if rc := stream.RecvCompress(); rc != "" && rc != encoding.Identity { + // Legacy compressor not specified; attempt to respond with same encoding. + ss.comp = encoding.GetCompressor(rc) + if ss.comp != nil { + stream.SetSendCompress(rc) + } + } + + if trInfo != nil { + trInfo.tr.LazyLog(&trInfo.firstLine, false) + defer func() { + ss.mu.Lock() + if err != nil && err != io.EOF { + ss.trInfo.tr.LazyLog(&fmtStringer{"%v", []interface{}{err}}, true) + ss.trInfo.tr.SetError() + } + ss.trInfo.tr.Finish() + ss.trInfo.tr = nil + ss.mu.Unlock() + }() + } + var appErr error + var server interface{} + if srv != nil { + server = srv.server + } + if s.opts.streamInt == nil { + appErr = sd.Handler(server, ss) + } else { + info := &StreamServerInfo{ + FullMethod: stream.Method(), + IsClientStream: sd.ClientStreams, + IsServerStream: sd.ServerStreams, + } + appErr = s.opts.streamInt(server, ss, info, sd.Handler) + } + if appErr != nil { + appStatus, ok := status.FromError(appErr) + if !ok { + switch err := appErr.(type) { + case transport.StreamError: + appStatus = status.New(err.Code, err.Desc) + default: + appStatus = status.New(convertCode(appErr), appErr.Error()) + } + appErr = appStatus.Err() + } + if trInfo != nil { + ss.mu.Lock() + ss.trInfo.tr.LazyLog(stringer(appStatus.Message()), true) + ss.trInfo.tr.SetError() + ss.mu.Unlock() + } + t.WriteStatus(ss.s, appStatus) + // TODO: Should we log an error from WriteStatus here and below? + return appErr + } + if trInfo != nil { + ss.mu.Lock() + ss.trInfo.tr.LazyLog(stringer("OK"), false) + ss.mu.Unlock() + } + return t.WriteStatus(ss.s, status.New(codes.OK, "")) + +} + +func (s *Server) handleStream(t transport.ServerTransport, stream *transport.Stream, trInfo *traceInfo) { + sm := stream.Method() + if sm != "" && sm[0] == '/' { + sm = sm[1:] + } + pos := strings.LastIndex(sm, "/") + if pos == -1 { + if trInfo != nil { + trInfo.tr.LazyLog(&fmtStringer{"Malformed method name %q", []interface{}{sm}}, true) + trInfo.tr.SetError() + } + errDesc := fmt.Sprintf("malformed method name: %q", stream.Method()) + if err := t.WriteStatus(stream, status.New(codes.ResourceExhausted, errDesc)); err != nil { + if trInfo != nil { + trInfo.tr.LazyLog(&fmtStringer{"%v", []interface{}{err}}, true) + trInfo.tr.SetError() + } + grpclog.Warningf("grpc: Server.handleStream failed to write status: %v", err) + } + if trInfo != nil { + trInfo.tr.Finish() + } + return + } + service := sm[:pos] + method := sm[pos+1:] + srv, ok := s.m[service] + if !ok { + if unknownDesc := s.opts.unknownStreamDesc; unknownDesc != nil { + s.processStreamingRPC(t, stream, nil, unknownDesc, trInfo) + return + } + if trInfo != nil { + trInfo.tr.LazyLog(&fmtStringer{"Unknown service %v", []interface{}{service}}, true) + trInfo.tr.SetError() + } + errDesc := fmt.Sprintf("unknown service %v", service) + if err := t.WriteStatus(stream, status.New(codes.Unimplemented, errDesc)); err != nil { + if trInfo != nil { + trInfo.tr.LazyLog(&fmtStringer{"%v", []interface{}{err}}, true) + trInfo.tr.SetError() + } + grpclog.Warningf("grpc: Server.handleStream failed to write status: %v", err) + } + if trInfo != nil { + trInfo.tr.Finish() + } + return + } + // Unary RPC or Streaming RPC? + if md, ok := srv.md[method]; ok { + s.processUnaryRPC(t, stream, srv, md, trInfo) + return + } + if sd, ok := srv.sd[method]; ok { + s.processStreamingRPC(t, stream, srv, sd, trInfo) + return + } + if trInfo != nil { + trInfo.tr.LazyLog(&fmtStringer{"Unknown method %v", []interface{}{method}}, true) + trInfo.tr.SetError() + } + if unknownDesc := s.opts.unknownStreamDesc; unknownDesc != nil { + s.processStreamingRPC(t, stream, nil, unknownDesc, trInfo) + return + } + errDesc := fmt.Sprintf("unknown method %v", method) + if err := t.WriteStatus(stream, status.New(codes.Unimplemented, errDesc)); err != nil { + if trInfo != nil { + trInfo.tr.LazyLog(&fmtStringer{"%v", []interface{}{err}}, true) + trInfo.tr.SetError() + } + grpclog.Warningf("grpc: Server.handleStream failed to write status: %v", err) + } + if trInfo != nil { + trInfo.tr.Finish() + } +} + +// Stop stops the gRPC server. It immediately closes all open +// connections and listeners. +// It cancels all active RPCs on the server side and the corresponding +// pending RPCs on the client side will get notified by connection +// errors. +func (s *Server) Stop() { + s.quitOnce.Do(func() { + close(s.quit) + }) + + defer func() { + s.doneOnce.Do(func() { + close(s.done) + }) + }() + + s.mu.Lock() + listeners := s.lis + s.lis = nil + st := s.conns + s.conns = nil + // interrupt GracefulStop if Stop and GracefulStop are called concurrently. + s.cv.Broadcast() + s.mu.Unlock() + + for lis := range listeners { + lis.Close() + } + for c := range st { + c.Close() + } + + s.mu.Lock() + s.cancel() + if s.events != nil { + s.events.Finish() + s.events = nil + } + s.mu.Unlock() +} + +// GracefulStop stops the gRPC server gracefully. It stops the server from +// accepting new connections and RPCs and blocks until all the pending RPCs are +// finished. +func (s *Server) GracefulStop() { + s.quitOnce.Do(func() { + close(s.quit) + }) + + defer func() { + s.doneOnce.Do(func() { + close(s.done) + }) + }() + + s.mu.Lock() + defer s.mu.Unlock() + if s.conns == nil { + return + } + for lis := range s.lis { + lis.Close() + } + s.lis = nil + s.cancel() + if !s.drain { + for c := range s.conns { + c.(transport.ServerTransport).Drain() + } + s.drain = true + } + for len(s.conns) != 0 { + s.cv.Wait() + } + s.conns = nil + if s.events != nil { + s.events.Finish() + s.events = nil + } +} + +func init() { + internal.TestingUseHandlerImpl = func(arg interface{}) { + arg.(*Server).opts.useHandlerImpl = true + } +} + +// SetHeader sets the header metadata. +// When called multiple times, all the provided metadata will be merged. +// All the metadata will be sent out when one of the following happens: +// - grpc.SendHeader() is called; +// - The first response is sent out; +// - An RPC status is sent out (error or success). +func SetHeader(ctx context.Context, md metadata.MD) error { + if md.Len() == 0 { + return nil + } + stream, ok := transport.StreamFromContext(ctx) + if !ok { + return Errorf(codes.Internal, "grpc: failed to fetch the stream from the context %v", ctx) + } + return stream.SetHeader(md) +} + +// SendHeader sends header metadata. It may be called at most once. +// The provided md and headers set by SetHeader() will be sent. +func SendHeader(ctx context.Context, md metadata.MD) error { + stream, ok := transport.StreamFromContext(ctx) + if !ok { + return Errorf(codes.Internal, "grpc: failed to fetch the stream from the context %v", ctx) + } + t := stream.ServerTransport() + if t == nil { + grpclog.Fatalf("grpc: SendHeader: %v has no ServerTransport to send header metadata.", stream) + } + if err := t.WriteHeader(stream, md); err != nil { + return toRPCErr(err) + } + return nil +} + +// SetTrailer sets the trailer metadata that will be sent when an RPC returns. +// When called more than once, all the provided metadata will be merged. +func SetTrailer(ctx context.Context, md metadata.MD) error { + if md.Len() == 0 { + return nil + } + stream, ok := transport.StreamFromContext(ctx) + if !ok { + return Errorf(codes.Internal, "grpc: failed to fetch the stream from the context %v", ctx) + } + return stream.SetTrailer(md) +} diff --git a/vendor/google.golang.org/grpc/server_test.go b/vendor/google.golang.org/grpc/server_test.go new file mode 100644 index 0000000000..cd2f2c0838 --- /dev/null +++ b/vendor/google.golang.org/grpc/server_test.go @@ -0,0 +1,124 @@ +/* + * + * Copyright 2016 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. + * + */ + +package grpc + +import ( + "net" + "reflect" + "strings" + "testing" + "time" + + "google.golang.org/grpc/test/leakcheck" +) + +type emptyServiceServer interface{} + +type testServer struct{} + +func TestStopBeforeServe(t *testing.T) { + defer leakcheck.Check(t) + lis, err := net.Listen("tcp", "localhost:0") + if err != nil { + t.Fatalf("failed to create listener: %v", err) + } + + server := NewServer() + server.Stop() + err = server.Serve(lis) + if err != ErrServerStopped { + t.Fatalf("server.Serve() error = %v, want %v", err, ErrServerStopped) + } + + // server.Serve is responsible for closing the listener, even if the + // server was already stopped. + err = lis.Close() + if got, want := ErrorDesc(err), "use of closed"; !strings.Contains(got, want) { + t.Errorf("Close() error = %q, want %q", got, want) + } +} + +func TestGracefulStop(t *testing.T) { + defer leakcheck.Check(t) + + lis, err := net.Listen("tcp", "localhost:0") + if err != nil { + t.Fatalf("failed to create listener: %v", err) + } + + server := NewServer() + go func() { + // make sure Serve() is called + time.Sleep(time.Millisecond * 500) + server.GracefulStop() + }() + + err = server.Serve(lis) + if err != nil { + t.Fatalf("Serve() returned non-nil error on GracefulStop: %v", err) + } +} + +func TestGetServiceInfo(t *testing.T) { + defer leakcheck.Check(t) + testSd := ServiceDesc{ + ServiceName: "grpc.testing.EmptyService", + HandlerType: (*emptyServiceServer)(nil), + Methods: []MethodDesc{ + { + MethodName: "EmptyCall", + Handler: nil, + }, + }, + Streams: []StreamDesc{ + { + StreamName: "EmptyStream", + Handler: nil, + ServerStreams: false, + ClientStreams: true, + }, + }, + Metadata: []int{0, 2, 1, 3}, + } + + server := NewServer() + server.RegisterService(&testSd, &testServer{}) + + info := server.GetServiceInfo() + want := map[string]ServiceInfo{ + "grpc.testing.EmptyService": { + Methods: []MethodInfo{ + { + Name: "EmptyCall", + IsClientStream: false, + IsServerStream: false, + }, + { + Name: "EmptyStream", + IsClientStream: true, + IsServerStream: false, + }}, + Metadata: []int{0, 2, 1, 3}, + }, + } + + if !reflect.DeepEqual(info, want) { + t.Errorf("GetServiceInfo() = %+v, want %+v", info, want) + } +} diff --git a/vendor/google.golang.org/grpc/service_config.go b/vendor/google.golang.org/grpc/service_config.go new file mode 100644 index 0000000000..cde6483348 --- /dev/null +++ b/vendor/google.golang.org/grpc/service_config.go @@ -0,0 +1,199 @@ +/* + * + * Copyright 2017 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. + * + */ + +package grpc + +import ( + "encoding/json" + "time" + + "google.golang.org/grpc/grpclog" +) + +const maxInt = int(^uint(0) >> 1) + +// MethodConfig defines the configuration recommended by the service providers for a +// particular method. +// DEPRECATED: Users should not use this struct. Service config should be received +// through name resolver, as specified here +// https://github.com/grpc/grpc/blob/master/doc/service_config.md +type MethodConfig struct { + // WaitForReady indicates whether RPCs sent to this method should wait until + // the connection is ready by default (!failfast). The value specified via the + // gRPC client API will override the value set here. + WaitForReady *bool + // Timeout is the default timeout for RPCs sent to this method. The actual + // deadline used will be the minimum of the value specified here and the value + // set by the application via the gRPC client API. If either one is not set, + // then the other will be used. If neither is set, then the RPC has no deadline. + Timeout *time.Duration + // MaxReqSize is the maximum allowed payload size for an individual request in a + // stream (client->server) in bytes. The size which is measured is the serialized + // payload after per-message compression (but before stream compression) in bytes. + // The actual value used is the minimum of the value specified here and the value set + // by the application via the gRPC client API. If either one is not set, then the other + // will be used. If neither is set, then the built-in default is used. + MaxReqSize *int + // MaxRespSize is the maximum allowed payload size for an individual response in a + // stream (server->client) in bytes. + MaxRespSize *int +} + +// ServiceConfig is provided by the service provider and contains parameters for how +// clients that connect to the service should behave. +// DEPRECATED: Users should not use this struct. Service config should be received +// through name resolver, as specified here +// https://github.com/grpc/grpc/blob/master/doc/service_config.md +type ServiceConfig struct { + // LB is the load balancer the service providers recommends. The balancer specified + // via grpc.WithBalancer will override this. + LB *string + // Methods contains a map for the methods in this service. + // If there is an exact match for a method (i.e. /service/method) in the map, use the corresponding MethodConfig. + // If there's no exact match, look for the default config for the service (/service/) and use the corresponding MethodConfig if it exists. + // Otherwise, the method has no MethodConfig to use. + Methods map[string]MethodConfig +} + +func parseTimeout(t *string) (*time.Duration, error) { + if t == nil { + return nil, nil + } + d, err := time.ParseDuration(*t) + return &d, err +} + +type jsonName struct { + Service *string + Method *string +} + +func (j jsonName) generatePath() (string, bool) { + if j.Service == nil { + return "", false + } + res := "/" + *j.Service + "/" + if j.Method != nil { + res += *j.Method + } + return res, true +} + +// TODO(lyuxuan): delete this struct after cleaning up old service config implementation. +type jsonMC struct { + Name *[]jsonName + WaitForReady *bool + Timeout *string + MaxRequestMessageBytes *int64 + MaxResponseMessageBytes *int64 +} + +// TODO(lyuxuan): delete this struct after cleaning up old service config implementation. +type jsonSC struct { + LoadBalancingPolicy *string + MethodConfig *[]jsonMC +} + +func parseServiceConfig(js string) (ServiceConfig, error) { + var rsc jsonSC + err := json.Unmarshal([]byte(js), &rsc) + if err != nil { + grpclog.Warningf("grpc: parseServiceConfig error unmarshaling %s due to %v", js, err) + return ServiceConfig{}, err + } + sc := ServiceConfig{ + LB: rsc.LoadBalancingPolicy, + Methods: make(map[string]MethodConfig), + } + if rsc.MethodConfig == nil { + return sc, nil + } + + for _, m := range *rsc.MethodConfig { + if m.Name == nil { + continue + } + d, err := parseTimeout(m.Timeout) + if err != nil { + grpclog.Warningf("grpc: parseServiceConfig error unmarshaling %s due to %v", js, err) + return ServiceConfig{}, err + } + + mc := MethodConfig{ + WaitForReady: m.WaitForReady, + Timeout: d, + } + if m.MaxRequestMessageBytes != nil { + if *m.MaxRequestMessageBytes > int64(maxInt) { + mc.MaxReqSize = newInt(maxInt) + } else { + mc.MaxReqSize = newInt(int(*m.MaxRequestMessageBytes)) + } + } + if m.MaxResponseMessageBytes != nil { + if *m.MaxResponseMessageBytes > int64(maxInt) { + mc.MaxRespSize = newInt(maxInt) + } else { + mc.MaxRespSize = newInt(int(*m.MaxResponseMessageBytes)) + } + } + for _, n := range *m.Name { + if path, valid := n.generatePath(); valid { + sc.Methods[path] = mc + } + } + } + + return sc, nil +} + +func min(a, b *int) *int { + if *a < *b { + return a + } + return b +} + +func getMaxSize(mcMax, doptMax *int, defaultVal int) *int { + if mcMax == nil && doptMax == nil { + return &defaultVal + } + if mcMax != nil && doptMax != nil { + return min(mcMax, doptMax) + } + if mcMax != nil { + return mcMax + } + return doptMax +} + +func newBool(b bool) *bool { + return &b +} + +func newInt(b int) *int { + return &b +} + +func newDuration(b time.Duration) *time.Duration { + return &b +} + +func newString(b string) *string { + return &b +} diff --git a/vendor/google.golang.org/grpc/service_config_test.go b/vendor/google.golang.org/grpc/service_config_test.go new file mode 100644 index 0000000000..7e985457eb --- /dev/null +++ b/vendor/google.golang.org/grpc/service_config_test.go @@ -0,0 +1,323 @@ +/* + * + * Copyright 2017 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. + * + */ + +package grpc + +import ( + "reflect" + "testing" + "time" +) + +func TestParseLoadBalancer(t *testing.T) { + testcases := []struct { + scjs string + wantSC ServiceConfig + wantErr bool + }{ + { + `{ + "loadBalancingPolicy": "round_robin", + "methodConfig": [ + { + "name": [ + { + "service": "foo", + "method": "Bar" + } + ], + "waitForReady": true + } + ] +}`, + ServiceConfig{ + LB: newString("round_robin"), + Methods: map[string]MethodConfig{ + "/foo/Bar": { + WaitForReady: newBool(true), + }, + }, + }, + false, + }, + { + `{ + "loadBalancingPolicy": 1, + "methodConfig": [ + { + "name": [ + { + "service": "foo", + "method": "Bar" + } + ], + "waitForReady": false + } + ] +}`, + ServiceConfig{}, + true, + }, + } + + for _, c := range testcases { + sc, err := parseServiceConfig(c.scjs) + if c.wantErr != (err != nil) || !reflect.DeepEqual(sc, c.wantSC) { + t.Fatalf("parseServiceConfig(%s) = %+v, %v, want %+v, %v", c.scjs, sc, err, c.wantSC, c.wantErr) + } + } +} + +func TestParseWaitForReady(t *testing.T) { + testcases := []struct { + scjs string + wantSC ServiceConfig + wantErr bool + }{ + { + `{ + "methodConfig": [ + { + "name": [ + { + "service": "foo", + "method": "Bar" + } + ], + "waitForReady": true + } + ] +}`, + ServiceConfig{ + Methods: map[string]MethodConfig{ + "/foo/Bar": { + WaitForReady: newBool(true), + }, + }, + }, + false, + }, + { + `{ + "methodConfig": [ + { + "name": [ + { + "service": "foo", + "method": "Bar" + } + ], + "waitForReady": false + } + ] +}`, + ServiceConfig{ + Methods: map[string]MethodConfig{ + "/foo/Bar": { + WaitForReady: newBool(false), + }, + }, + }, + false, + }, + { + `{ + "methodConfig": [ + { + "name": [ + { + "service": "foo", + "method": "Bar" + } + ], + "waitForReady": fall + }, + { + "name": [ + { + "service": "foo", + "method": "Bar" + } + ], + "waitForReady": true + } + ] +}`, + ServiceConfig{}, + true, + }, + } + + for _, c := range testcases { + sc, err := parseServiceConfig(c.scjs) + if c.wantErr != (err != nil) || !reflect.DeepEqual(sc, c.wantSC) { + t.Fatalf("parseServiceConfig(%s) = %+v, %v, want %+v, %v", c.scjs, sc, err, c.wantSC, c.wantErr) + } + } +} + +func TestPraseTimeOut(t *testing.T) { + testcases := []struct { + scjs string + wantSC ServiceConfig + wantErr bool + }{ + { + `{ + "methodConfig": [ + { + "name": [ + { + "service": "foo", + "method": "Bar" + } + ], + "timeout": "1s" + } + ] +}`, + ServiceConfig{ + Methods: map[string]MethodConfig{ + "/foo/Bar": { + Timeout: newDuration(time.Second), + }, + }, + }, + false, + }, + { + `{ + "methodConfig": [ + { + "name": [ + { + "service": "foo", + "method": "Bar" + } + ], + "timeout": "3c" + } + ] +}`, + ServiceConfig{}, + true, + }, + { + `{ + "methodConfig": [ + { + "name": [ + { + "service": "foo", + "method": "Bar" + } + ], + "timeout": "3c" + }, + { + "name": [ + { + "service": "foo", + "method": "Bar" + } + ], + "timeout": "1s" + } + ] +}`, + ServiceConfig{}, + true, + }, + } + + for _, c := range testcases { + sc, err := parseServiceConfig(c.scjs) + if c.wantErr != (err != nil) || !reflect.DeepEqual(sc, c.wantSC) { + t.Fatalf("parseServiceConfig(%s) = %+v, %v, want %+v, %v", c.scjs, sc, err, c.wantSC, c.wantErr) + } + } +} + +func TestPraseMsgSize(t *testing.T) { + testcases := []struct { + scjs string + wantSC ServiceConfig + wantErr bool + }{ + { + `{ + "methodConfig": [ + { + "name": [ + { + "service": "foo", + "method": "Bar" + } + ], + "maxRequestMessageBytes": 1024, + "maxResponseMessageBytes": 2048 + } + ] +}`, + ServiceConfig{ + Methods: map[string]MethodConfig{ + "/foo/Bar": { + MaxReqSize: newInt(1024), + MaxRespSize: newInt(2048), + }, + }, + }, + false, + }, + { + `{ + "methodConfig": [ + { + "name": [ + { + "service": "foo", + "method": "Bar" + } + ], + "maxRequestMessageBytes": "1024", + "maxResponseMessageBytes": "2048" + }, + { + "name": [ + { + "service": "foo", + "method": "Bar" + } + ], + "maxRequestMessageBytes": 1024, + "maxResponseMessageBytes": 2048 + } + ] +}`, + ServiceConfig{}, + true, + }, + } + + for _, c := range testcases { + sc, err := parseServiceConfig(c.scjs) + if c.wantErr != (err != nil) || !reflect.DeepEqual(sc, c.wantSC) { + t.Fatalf("parseServiceConfig(%s) = %+v, %v, want %+v, %v", c.scjs, sc, err, c.wantSC, c.wantErr) + } + } +} diff --git a/vendor/google.golang.org/grpc/stats/grpc_testing/test.pb.go b/vendor/google.golang.org/grpc/stats/grpc_testing/test.pb.go new file mode 100644 index 0000000000..c0c14a24bb --- /dev/null +++ b/vendor/google.golang.org/grpc/stats/grpc_testing/test.pb.go @@ -0,0 +1,369 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: grpc_testing/test.proto + +/* +Package grpc_testing is a generated protocol buffer package. + +It is generated from these files: + grpc_testing/test.proto + +It has these top-level messages: + SimpleRequest + SimpleResponse +*/ +package grpc_testing + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +type SimpleRequest struct { + Id int32 `protobuf:"varint,2,opt,name=id" json:"id,omitempty"` +} + +func (m *SimpleRequest) Reset() { *m = SimpleRequest{} } +func (m *SimpleRequest) String() string { return proto.CompactTextString(m) } +func (*SimpleRequest) ProtoMessage() {} +func (*SimpleRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *SimpleRequest) GetId() int32 { + if m != nil { + return m.Id + } + return 0 +} + +type SimpleResponse struct { + Id int32 `protobuf:"varint,3,opt,name=id" json:"id,omitempty"` +} + +func (m *SimpleResponse) Reset() { *m = SimpleResponse{} } +func (m *SimpleResponse) String() string { return proto.CompactTextString(m) } +func (*SimpleResponse) ProtoMessage() {} +func (*SimpleResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *SimpleResponse) GetId() int32 { + if m != nil { + return m.Id + } + return 0 +} + +func init() { + proto.RegisterType((*SimpleRequest)(nil), "grpc.testing.SimpleRequest") + proto.RegisterType((*SimpleResponse)(nil), "grpc.testing.SimpleResponse") +} + +// 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 + +// Client API for TestService service + +type TestServiceClient interface { + // One request followed by one response. + // The server returns the client id as-is. + UnaryCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (*SimpleResponse, error) + // A sequence of requests with each request served by the server immediately. + // As one request could lead to multiple responses, this interface + // demonstrates the idea of full duplexing. + FullDuplexCall(ctx context.Context, opts ...grpc.CallOption) (TestService_FullDuplexCallClient, error) + // Client stream + ClientStreamCall(ctx context.Context, opts ...grpc.CallOption) (TestService_ClientStreamCallClient, error) + // Server stream + ServerStreamCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (TestService_ServerStreamCallClient, error) +} + +type testServiceClient struct { + cc *grpc.ClientConn +} + +func NewTestServiceClient(cc *grpc.ClientConn) TestServiceClient { + return &testServiceClient{cc} +} + +func (c *testServiceClient) UnaryCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (*SimpleResponse, error) { + out := new(SimpleResponse) + err := grpc.Invoke(ctx, "/grpc.testing.TestService/UnaryCall", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *testServiceClient) FullDuplexCall(ctx context.Context, opts ...grpc.CallOption) (TestService_FullDuplexCallClient, error) { + stream, err := grpc.NewClientStream(ctx, &_TestService_serviceDesc.Streams[0], c.cc, "/grpc.testing.TestService/FullDuplexCall", opts...) + if err != nil { + return nil, err + } + x := &testServiceFullDuplexCallClient{stream} + return x, nil +} + +type TestService_FullDuplexCallClient interface { + Send(*SimpleRequest) error + Recv() (*SimpleResponse, error) + grpc.ClientStream +} + +type testServiceFullDuplexCallClient struct { + grpc.ClientStream +} + +func (x *testServiceFullDuplexCallClient) Send(m *SimpleRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *testServiceFullDuplexCallClient) Recv() (*SimpleResponse, error) { + m := new(SimpleResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *testServiceClient) ClientStreamCall(ctx context.Context, opts ...grpc.CallOption) (TestService_ClientStreamCallClient, error) { + stream, err := grpc.NewClientStream(ctx, &_TestService_serviceDesc.Streams[1], c.cc, "/grpc.testing.TestService/ClientStreamCall", opts...) + if err != nil { + return nil, err + } + x := &testServiceClientStreamCallClient{stream} + return x, nil +} + +type TestService_ClientStreamCallClient interface { + Send(*SimpleRequest) error + CloseAndRecv() (*SimpleResponse, error) + grpc.ClientStream +} + +type testServiceClientStreamCallClient struct { + grpc.ClientStream +} + +func (x *testServiceClientStreamCallClient) Send(m *SimpleRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *testServiceClientStreamCallClient) CloseAndRecv() (*SimpleResponse, error) { + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + m := new(SimpleResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *testServiceClient) ServerStreamCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (TestService_ServerStreamCallClient, error) { + stream, err := grpc.NewClientStream(ctx, &_TestService_serviceDesc.Streams[2], c.cc, "/grpc.testing.TestService/ServerStreamCall", opts...) + if err != nil { + return nil, err + } + x := &testServiceServerStreamCallClient{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 TestService_ServerStreamCallClient interface { + Recv() (*SimpleResponse, error) + grpc.ClientStream +} + +type testServiceServerStreamCallClient struct { + grpc.ClientStream +} + +func (x *testServiceServerStreamCallClient) Recv() (*SimpleResponse, error) { + m := new(SimpleResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// Server API for TestService service + +type TestServiceServer interface { + // One request followed by one response. + // The server returns the client id as-is. + UnaryCall(context.Context, *SimpleRequest) (*SimpleResponse, error) + // A sequence of requests with each request served by the server immediately. + // As one request could lead to multiple responses, this interface + // demonstrates the idea of full duplexing. + FullDuplexCall(TestService_FullDuplexCallServer) error + // Client stream + ClientStreamCall(TestService_ClientStreamCallServer) error + // Server stream + ServerStreamCall(*SimpleRequest, TestService_ServerStreamCallServer) error +} + +func RegisterTestServiceServer(s *grpc.Server, srv TestServiceServer) { + s.RegisterService(&_TestService_serviceDesc, srv) +} + +func _TestService_UnaryCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SimpleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TestServiceServer).UnaryCall(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.testing.TestService/UnaryCall", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TestServiceServer).UnaryCall(ctx, req.(*SimpleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TestService_FullDuplexCall_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(TestServiceServer).FullDuplexCall(&testServiceFullDuplexCallServer{stream}) +} + +type TestService_FullDuplexCallServer interface { + Send(*SimpleResponse) error + Recv() (*SimpleRequest, error) + grpc.ServerStream +} + +type testServiceFullDuplexCallServer struct { + grpc.ServerStream +} + +func (x *testServiceFullDuplexCallServer) Send(m *SimpleResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *testServiceFullDuplexCallServer) Recv() (*SimpleRequest, error) { + m := new(SimpleRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _TestService_ClientStreamCall_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(TestServiceServer).ClientStreamCall(&testServiceClientStreamCallServer{stream}) +} + +type TestService_ClientStreamCallServer interface { + SendAndClose(*SimpleResponse) error + Recv() (*SimpleRequest, error) + grpc.ServerStream +} + +type testServiceClientStreamCallServer struct { + grpc.ServerStream +} + +func (x *testServiceClientStreamCallServer) SendAndClose(m *SimpleResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *testServiceClientStreamCallServer) Recv() (*SimpleRequest, error) { + m := new(SimpleRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _TestService_ServerStreamCall_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(SimpleRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(TestServiceServer).ServerStreamCall(m, &testServiceServerStreamCallServer{stream}) +} + +type TestService_ServerStreamCallServer interface { + Send(*SimpleResponse) error + grpc.ServerStream +} + +type testServiceServerStreamCallServer struct { + grpc.ServerStream +} + +func (x *testServiceServerStreamCallServer) Send(m *SimpleResponse) error { + return x.ServerStream.SendMsg(m) +} + +var _TestService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "grpc.testing.TestService", + HandlerType: (*TestServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UnaryCall", + Handler: _TestService_UnaryCall_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "FullDuplexCall", + Handler: _TestService_FullDuplexCall_Handler, + ServerStreams: true, + ClientStreams: true, + }, + { + StreamName: "ClientStreamCall", + Handler: _TestService_ClientStreamCall_Handler, + ClientStreams: true, + }, + { + StreamName: "ServerStreamCall", + Handler: _TestService_ServerStreamCall_Handler, + ServerStreams: true, + }, + }, + Metadata: "grpc_testing/test.proto", +} + +func init() { proto.RegisterFile("grpc_testing/test.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 202 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4f, 0x2f, 0x2a, 0x48, + 0x8e, 0x2f, 0x49, 0x2d, 0x2e, 0xc9, 0xcc, 0x4b, 0xd7, 0x07, 0xd1, 0x7a, 0x05, 0x45, 0xf9, 0x25, + 0xf9, 0x42, 0x3c, 0x20, 0x09, 0x3d, 0xa8, 0x84, 0x92, 0x3c, 0x17, 0x6f, 0x70, 0x66, 0x6e, 0x41, + 0x4e, 0x6a, 0x50, 0x6a, 0x61, 0x69, 0x6a, 0x71, 0x89, 0x10, 0x1f, 0x17, 0x53, 0x66, 0x8a, 0x04, + 0x93, 0x02, 0xa3, 0x06, 0x6b, 0x10, 0x53, 0x66, 0x8a, 0x92, 0x02, 0x17, 0x1f, 0x4c, 0x41, 0x71, + 0x41, 0x7e, 0x5e, 0x71, 0x2a, 0x54, 0x05, 0x33, 0x4c, 0x85, 0xd1, 0x09, 0x26, 0x2e, 0xee, 0x90, + 0xd4, 0xe2, 0x92, 0xe0, 0xd4, 0xa2, 0xb2, 0xcc, 0xe4, 0x54, 0x21, 0x37, 0x2e, 0xce, 0xd0, 0xbc, + 0xc4, 0xa2, 0x4a, 0xe7, 0xc4, 0x9c, 0x1c, 0x21, 0x69, 0x3d, 0x64, 0xeb, 0xf4, 0x50, 0xec, 0x92, + 0x92, 0xc1, 0x2e, 0x09, 0xb5, 0xc7, 0x9f, 0x8b, 0xcf, 0xad, 0x34, 0x27, 0xc7, 0xa5, 0xb4, 0x20, + 0x27, 0xb5, 0x82, 0x42, 0xc3, 0x34, 0x18, 0x0d, 0x18, 0x85, 0xfc, 0xb9, 0x04, 0x9c, 0x73, 0x32, + 0x53, 0xf3, 0x4a, 0x82, 0x4b, 0x8a, 0x52, 0x13, 0x73, 0x29, 0x36, 0x12, 0x64, 0x20, 0xc8, 0xd3, + 0xa9, 0x45, 0x54, 0x31, 0xd0, 0x80, 0x31, 0x89, 0x0d, 0x1c, 0x45, 0xc6, 0x80, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x4c, 0x43, 0x27, 0x67, 0xbd, 0x01, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/grpc/stats/grpc_testing/test.proto b/vendor/google.golang.org/grpc/stats/grpc_testing/test.proto new file mode 100644 index 0000000000..b49a0d5a7c --- /dev/null +++ b/vendor/google.golang.org/grpc/stats/grpc_testing/test.proto @@ -0,0 +1,43 @@ +// Copyright 2017 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. + +syntax = "proto3"; + +package grpc.testing; + +message SimpleRequest { + int32 id = 2; +} + +message SimpleResponse { + int32 id = 3; +} + +// A simple test service. +service TestService { + // One request followed by one response. + // The server returns the client id as-is. + rpc UnaryCall(SimpleRequest) returns (SimpleResponse); + + // A sequence of requests with each request served by the server immediately. + // As one request could lead to multiple responses, this interface + // demonstrates the idea of full duplexing. + rpc FullDuplexCall(stream SimpleRequest) returns (stream SimpleResponse); + + // Client stream + rpc ClientStreamCall(stream SimpleRequest) returns (SimpleResponse); + + // Server stream + rpc ServerStreamCall(SimpleRequest) returns (stream SimpleResponse); +} diff --git a/vendor/google.golang.org/grpc/stats/handlers.go b/vendor/google.golang.org/grpc/stats/handlers.go new file mode 100644 index 0000000000..05b384c693 --- /dev/null +++ b/vendor/google.golang.org/grpc/stats/handlers.go @@ -0,0 +1,64 @@ +/* + * + * Copyright 2016 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. + * + */ + +package stats + +import ( + "net" + + "golang.org/x/net/context" +) + +// ConnTagInfo defines the relevant information needed by connection context tagger. +type ConnTagInfo struct { + // RemoteAddr is the remote address of the corresponding connection. + RemoteAddr net.Addr + // LocalAddr is the local address of the corresponding connection. + LocalAddr net.Addr +} + +// RPCTagInfo defines the relevant information needed by RPC context tagger. +type RPCTagInfo struct { + // FullMethodName is the RPC method in the format of /package.service/method. + FullMethodName string + // FailFast indicates if this RPC is failfast. + // This field is only valid on client side, it's always false on server side. + FailFast bool +} + +// Handler defines the interface for the related stats handling (e.g., RPCs, connections). +type Handler interface { + // TagRPC can attach some information to the given context. + // The context used for the rest lifetime of the RPC will be derived from + // the returned context. + TagRPC(context.Context, *RPCTagInfo) context.Context + // HandleRPC processes the RPC stats. + HandleRPC(context.Context, RPCStats) + + // TagConn can attach some information to the given context. + // The returned context will be used for stats handling. + // For conn stats handling, the context used in HandleConn for this + // connection will be derived from the context returned. + // For RPC stats handling, + // - On server side, the context used in HandleRPC for all RPCs on this + // connection will be derived from the context returned. + // - On client side, the context is not derived from the context returned. + TagConn(context.Context, *ConnTagInfo) context.Context + // HandleConn processes the Conn stats. + HandleConn(context.Context, ConnStats) +} diff --git a/vendor/google.golang.org/grpc/stats/stats.go b/vendor/google.golang.org/grpc/stats/stats.go new file mode 100644 index 0000000000..d5aa2f793b --- /dev/null +++ b/vendor/google.golang.org/grpc/stats/stats.go @@ -0,0 +1,294 @@ +/* + * + * Copyright 2016 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. + * + */ + +//go:generate protoc --go_out=plugins=grpc:. grpc_testing/test.proto + +// Package stats is for collecting and reporting various network and RPC stats. +// This package is for monitoring purpose only. All fields are read-only. +// All APIs are experimental. +package stats // import "google.golang.org/grpc/stats" + +import ( + "net" + "time" + + "golang.org/x/net/context" +) + +// RPCStats contains stats information about RPCs. +type RPCStats interface { + isRPCStats() + // IsClient returns true if this RPCStats is from client side. + IsClient() bool +} + +// Begin contains stats when an RPC begins. +// FailFast is only valid if this Begin is from client side. +type Begin struct { + // Client is true if this Begin is from client side. + Client bool + // BeginTime is the time when the RPC begins. + BeginTime time.Time + // FailFast indicates if this RPC is failfast. + FailFast bool +} + +// IsClient indicates if the stats information is from client side. +func (s *Begin) IsClient() bool { return s.Client } + +func (s *Begin) isRPCStats() {} + +// InPayload contains the information for an incoming payload. +type InPayload struct { + // Client is true if this InPayload is from client side. + Client bool + // Payload is the payload with original type. + Payload interface{} + // Data is the serialized message payload. + Data []byte + // Length is the length of uncompressed data. + Length int + // WireLength is the length of data on wire (compressed, signed, encrypted). + WireLength int + // RecvTime is the time when the payload is received. + RecvTime time.Time +} + +// IsClient indicates if the stats information is from client side. +func (s *InPayload) IsClient() bool { return s.Client } + +func (s *InPayload) isRPCStats() {} + +// InHeader contains stats when a header is received. +type InHeader struct { + // Client is true if this InHeader is from client side. + Client bool + // WireLength is the wire length of header. + WireLength int + + // The following fields are valid only if Client is false. + // FullMethod is the full RPC method string, i.e., /package.service/method. + FullMethod string + // RemoteAddr is the remote address of the corresponding connection. + RemoteAddr net.Addr + // LocalAddr is the local address of the corresponding connection. + LocalAddr net.Addr + // Compression is the compression algorithm used for the RPC. + Compression string +} + +// IsClient indicates if the stats information is from client side. +func (s *InHeader) IsClient() bool { return s.Client } + +func (s *InHeader) isRPCStats() {} + +// InTrailer contains stats when a trailer is received. +type InTrailer struct { + // Client is true if this InTrailer is from client side. + Client bool + // WireLength is the wire length of trailer. + WireLength int +} + +// IsClient indicates if the stats information is from client side. +func (s *InTrailer) IsClient() bool { return s.Client } + +func (s *InTrailer) isRPCStats() {} + +// OutPayload contains the information for an outgoing payload. +type OutPayload struct { + // Client is true if this OutPayload is from client side. + Client bool + // Payload is the payload with original type. + Payload interface{} + // Data is the serialized message payload. + Data []byte + // Length is the length of uncompressed data. + Length int + // WireLength is the length of data on wire (compressed, signed, encrypted). + WireLength int + // SentTime is the time when the payload is sent. + SentTime time.Time +} + +// IsClient indicates if this stats information is from client side. +func (s *OutPayload) IsClient() bool { return s.Client } + +func (s *OutPayload) isRPCStats() {} + +// OutHeader contains stats when a header is sent. +type OutHeader struct { + // Client is true if this OutHeader is from client side. + Client bool + + // The following fields are valid only if Client is true. + // FullMethod is the full RPC method string, i.e., /package.service/method. + FullMethod string + // RemoteAddr is the remote address of the corresponding connection. + RemoteAddr net.Addr + // LocalAddr is the local address of the corresponding connection. + LocalAddr net.Addr + // Compression is the compression algorithm used for the RPC. + Compression string +} + +// IsClient indicates if this stats information is from client side. +func (s *OutHeader) IsClient() bool { return s.Client } + +func (s *OutHeader) isRPCStats() {} + +// OutTrailer contains stats when a trailer is sent. +type OutTrailer struct { + // Client is true if this OutTrailer is from client side. + Client bool + // WireLength is the wire length of trailer. + WireLength int +} + +// IsClient indicates if this stats information is from client side. +func (s *OutTrailer) IsClient() bool { return s.Client } + +func (s *OutTrailer) isRPCStats() {} + +// End contains stats when an RPC ends. +type End struct { + // Client is true if this End is from client side. + Client bool + // EndTime is the time when the RPC ends. + EndTime time.Time + // Error is the error the RPC ended with. It is an error generated from + // status.Status and can be converted back to status.Status using + // status.FromError if non-nil. + Error error +} + +// IsClient indicates if this is from client side. +func (s *End) IsClient() bool { return s.Client } + +func (s *End) isRPCStats() {} + +// ConnStats contains stats information about connections. +type ConnStats interface { + isConnStats() + // IsClient returns true if this ConnStats is from client side. + IsClient() bool +} + +// ConnBegin contains the stats of a connection when it is established. +type ConnBegin struct { + // Client is true if this ConnBegin is from client side. + Client bool +} + +// IsClient indicates if this is from client side. +func (s *ConnBegin) IsClient() bool { return s.Client } + +func (s *ConnBegin) isConnStats() {} + +// ConnEnd contains the stats of a connection when it ends. +type ConnEnd struct { + // Client is true if this ConnEnd is from client side. + Client bool +} + +// IsClient indicates if this is from client side. +func (s *ConnEnd) IsClient() bool { return s.Client } + +func (s *ConnEnd) isConnStats() {} + +type incomingTagsKey struct{} +type outgoingTagsKey struct{} + +// SetTags attaches stats tagging data to the context, which will be sent in +// the outgoing RPC with the header grpc-tags-bin. Subsequent calls to +// SetTags will overwrite the values from earlier calls. +// +// NOTE: this is provided only for backward compatibility with existing clients +// and will likely be removed in an upcoming release. New uses should transmit +// this type of data using metadata with a different, non-reserved (i.e. does +// not begin with "grpc-") header name. +func SetTags(ctx context.Context, b []byte) context.Context { + return context.WithValue(ctx, outgoingTagsKey{}, b) +} + +// Tags returns the tags from the context for the inbound RPC. +// +// NOTE: this is provided only for backward compatibility with existing clients +// and will likely be removed in an upcoming release. New uses should transmit +// this type of data using metadata with a different, non-reserved (i.e. does +// not begin with "grpc-") header name. +func Tags(ctx context.Context) []byte { + b, _ := ctx.Value(incomingTagsKey{}).([]byte) + return b +} + +// SetIncomingTags attaches stats tagging data to the context, to be read by +// the application (not sent in outgoing RPCs). +// +// This is intended for gRPC-internal use ONLY. +func SetIncomingTags(ctx context.Context, b []byte) context.Context { + return context.WithValue(ctx, incomingTagsKey{}, b) +} + +// OutgoingTags returns the tags from the context for the outbound RPC. +// +// This is intended for gRPC-internal use ONLY. +func OutgoingTags(ctx context.Context) []byte { + b, _ := ctx.Value(outgoingTagsKey{}).([]byte) + return b +} + +type incomingTraceKey struct{} +type outgoingTraceKey struct{} + +// SetTrace attaches stats tagging data to the context, which will be sent in +// the outgoing RPC with the header grpc-trace-bin. Subsequent calls to +// SetTrace will overwrite the values from earlier calls. +// +// NOTE: this is provided only for backward compatibility with existing clients +// and will likely be removed in an upcoming release. New uses should transmit +// this type of data using metadata with a different, non-reserved (i.e. does +// not begin with "grpc-") header name. +func SetTrace(ctx context.Context, b []byte) context.Context { + return context.WithValue(ctx, outgoingTraceKey{}, b) +} + +// Trace returns the trace from the context for the inbound RPC. +// +// NOTE: this is provided only for backward compatibility with existing clients +// and will likely be removed in an upcoming release. New uses should transmit +// this type of data using metadata with a different, non-reserved (i.e. does +// not begin with "grpc-") header name. +func Trace(ctx context.Context) []byte { + b, _ := ctx.Value(incomingTraceKey{}).([]byte) + return b +} + +// SetIncomingTrace attaches stats tagging data to the context, to be read by +// the application (not sent in outgoing RPCs). It is intended for +// gRPC-internal use. +func SetIncomingTrace(ctx context.Context, b []byte) context.Context { + return context.WithValue(ctx, incomingTraceKey{}, b) +} + +// OutgoingTrace returns the trace from the context for the outbound RPC. It is +// intended for gRPC-internal use. +func OutgoingTrace(ctx context.Context) []byte { + b, _ := ctx.Value(outgoingTraceKey{}).([]byte) + return b +} diff --git a/vendor/google.golang.org/grpc/stats/stats_test.go b/vendor/google.golang.org/grpc/stats/stats_test.go new file mode 100644 index 0000000000..0df23f3dc1 --- /dev/null +++ b/vendor/google.golang.org/grpc/stats/stats_test.go @@ -0,0 +1,1266 @@ +/* + * + * Copyright 2016 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. + * + */ + +package stats_test + +import ( + "fmt" + "io" + "net" + "reflect" + "sync" + "testing" + "time" + + "github.com/golang/protobuf/proto" + "golang.org/x/net/context" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/stats" + testpb "google.golang.org/grpc/stats/grpc_testing" + "google.golang.org/grpc/status" +) + +func init() { + grpc.EnableTracing = false +} + +type connCtxKey struct{} +type rpcCtxKey struct{} + +var ( + // For headers: + testMetadata = metadata.MD{ + "key1": []string{"value1"}, + "key2": []string{"value2"}, + } + // For trailers: + testTrailerMetadata = metadata.MD{ + "tkey1": []string{"trailerValue1"}, + "tkey2": []string{"trailerValue2"}, + } + // The id for which the service handler should return error. + errorID int32 = 32202 +) + +type testServer struct{} + +func (s *testServer) UnaryCall(ctx context.Context, in *testpb.SimpleRequest) (*testpb.SimpleResponse, error) { + md, ok := metadata.FromIncomingContext(ctx) + if ok { + if err := grpc.SendHeader(ctx, md); err != nil { + return nil, status.Errorf(grpc.Code(err), "grpc.SendHeader(_, %v) = %v, want ", md, err) + } + if err := grpc.SetTrailer(ctx, testTrailerMetadata); err != nil { + return nil, status.Errorf(grpc.Code(err), "grpc.SetTrailer(_, %v) = %v, want ", testTrailerMetadata, err) + } + } + + if in.Id == errorID { + return nil, fmt.Errorf("got error id: %v", in.Id) + } + + return &testpb.SimpleResponse{Id: in.Id}, nil +} + +func (s *testServer) FullDuplexCall(stream testpb.TestService_FullDuplexCallServer) error { + md, ok := metadata.FromIncomingContext(stream.Context()) + if ok { + if err := stream.SendHeader(md); err != nil { + return status.Errorf(grpc.Code(err), "%v.SendHeader(%v) = %v, want %v", stream, md, err, nil) + } + stream.SetTrailer(testTrailerMetadata) + } + for { + in, err := stream.Recv() + if err == io.EOF { + // read done. + return nil + } + if err != nil { + return err + } + + if in.Id == errorID { + return fmt.Errorf("got error id: %v", in.Id) + } + + if err := stream.Send(&testpb.SimpleResponse{Id: in.Id}); err != nil { + return err + } + } +} + +func (s *testServer) ClientStreamCall(stream testpb.TestService_ClientStreamCallServer) error { + md, ok := metadata.FromIncomingContext(stream.Context()) + if ok { + if err := stream.SendHeader(md); err != nil { + return status.Errorf(grpc.Code(err), "%v.SendHeader(%v) = %v, want %v", stream, md, err, nil) + } + stream.SetTrailer(testTrailerMetadata) + } + for { + in, err := stream.Recv() + if err == io.EOF { + // read done. + return stream.SendAndClose(&testpb.SimpleResponse{Id: int32(0)}) + } + if err != nil { + return err + } + + if in.Id == errorID { + return fmt.Errorf("got error id: %v", in.Id) + } + } +} + +func (s *testServer) ServerStreamCall(in *testpb.SimpleRequest, stream testpb.TestService_ServerStreamCallServer) error { + md, ok := metadata.FromIncomingContext(stream.Context()) + if ok { + if err := stream.SendHeader(md); err != nil { + return status.Errorf(grpc.Code(err), "%v.SendHeader(%v) = %v, want %v", stream, md, err, nil) + } + stream.SetTrailer(testTrailerMetadata) + } + + if in.Id == errorID { + return fmt.Errorf("got error id: %v", in.Id) + } + + for i := 0; i < 5; i++ { + if err := stream.Send(&testpb.SimpleResponse{Id: in.Id}); err != nil { + return err + } + } + return nil +} + +// test is an end-to-end test. It should be created with the newTest +// func, modified as needed, and then started with its startServer method. +// It should be cleaned up with the tearDown method. +type test struct { + t *testing.T + compress string + clientStatsHandler stats.Handler + serverStatsHandler stats.Handler + + testServer testpb.TestServiceServer // nil means none + // srv and srvAddr are set once startServer is called. + srv *grpc.Server + srvAddr string + + cc *grpc.ClientConn // nil until requested via clientConn +} + +func (te *test) tearDown() { + if te.cc != nil { + te.cc.Close() + te.cc = nil + } + te.srv.Stop() +} + +type testConfig struct { + compress string +} + +// newTest returns a new test using the provided testing.T and +// environment. It is returned with default values. Tests should +// modify it before calling its startServer and clientConn methods. +func newTest(t *testing.T, tc *testConfig, ch stats.Handler, sh stats.Handler) *test { + te := &test{ + t: t, + compress: tc.compress, + clientStatsHandler: ch, + serverStatsHandler: sh, + } + return te +} + +// startServer starts a gRPC server listening. Callers should defer a +// call to te.tearDown to clean up. +func (te *test) startServer(ts testpb.TestServiceServer) { + te.testServer = ts + lis, err := net.Listen("tcp", "localhost:0") + if err != nil { + te.t.Fatalf("Failed to listen: %v", err) + } + var opts []grpc.ServerOption + if te.compress == "gzip" { + opts = append(opts, + grpc.RPCCompressor(grpc.NewGZIPCompressor()), + grpc.RPCDecompressor(grpc.NewGZIPDecompressor()), + ) + } + if te.serverStatsHandler != nil { + opts = append(opts, grpc.StatsHandler(te.serverStatsHandler)) + } + s := grpc.NewServer(opts...) + te.srv = s + if te.testServer != nil { + testpb.RegisterTestServiceServer(s, te.testServer) + } + + go s.Serve(lis) + te.srvAddr = lis.Addr().String() +} + +func (te *test) clientConn() *grpc.ClientConn { + if te.cc != nil { + return te.cc + } + opts := []grpc.DialOption{grpc.WithInsecure(), grpc.WithBlock()} + if te.compress == "gzip" { + opts = append(opts, + grpc.WithCompressor(grpc.NewGZIPCompressor()), + grpc.WithDecompressor(grpc.NewGZIPDecompressor()), + ) + } + if te.clientStatsHandler != nil { + opts = append(opts, grpc.WithStatsHandler(te.clientStatsHandler)) + } + + var err error + te.cc, err = grpc.Dial(te.srvAddr, opts...) + if err != nil { + te.t.Fatalf("Dial(%q) = %v", te.srvAddr, err) + } + return te.cc +} + +type rpcType int + +const ( + unaryRPC rpcType = iota + clientStreamRPC + serverStreamRPC + fullDuplexStreamRPC +) + +type rpcConfig struct { + count int // Number of requests and responses for streaming RPCs. + success bool // Whether the RPC should succeed or return error. + failfast bool + callType rpcType // Type of RPC. + noLastRecv bool // Whether to call recv for io.EOF. When true, last recv won't be called. Only valid for streaming RPCs. +} + +func (te *test) doUnaryCall(c *rpcConfig) (*testpb.SimpleRequest, *testpb.SimpleResponse, error) { + var ( + resp *testpb.SimpleResponse + req *testpb.SimpleRequest + err error + ) + tc := testpb.NewTestServiceClient(te.clientConn()) + if c.success { + req = &testpb.SimpleRequest{Id: errorID + 1} + } else { + req = &testpb.SimpleRequest{Id: errorID} + } + ctx := metadata.NewOutgoingContext(context.Background(), testMetadata) + + resp, err = tc.UnaryCall(ctx, req, grpc.FailFast(c.failfast)) + return req, resp, err +} + +func (te *test) doFullDuplexCallRoundtrip(c *rpcConfig) ([]*testpb.SimpleRequest, []*testpb.SimpleResponse, error) { + var ( + reqs []*testpb.SimpleRequest + resps []*testpb.SimpleResponse + err error + ) + tc := testpb.NewTestServiceClient(te.clientConn()) + stream, err := tc.FullDuplexCall(metadata.NewOutgoingContext(context.Background(), testMetadata), grpc.FailFast(c.failfast)) + if err != nil { + return reqs, resps, err + } + var startID int32 + if !c.success { + startID = errorID + } + for i := 0; i < c.count; i++ { + req := &testpb.SimpleRequest{ + Id: int32(i) + startID, + } + reqs = append(reqs, req) + if err = stream.Send(req); err != nil { + return reqs, resps, err + } + var resp *testpb.SimpleResponse + if resp, err = stream.Recv(); err != nil { + return reqs, resps, err + } + resps = append(resps, resp) + } + if err = stream.CloseSend(); err != nil && err != io.EOF { + return reqs, resps, err + } + if !c.noLastRecv { + if _, err = stream.Recv(); err != io.EOF { + return reqs, resps, err + } + } else { + // In the case of not calling the last recv, sleep to avoid + // returning too fast to miss the remaining stats (InTrailer and End). + time.Sleep(time.Second) + } + + return reqs, resps, nil +} + +func (te *test) doClientStreamCall(c *rpcConfig) ([]*testpb.SimpleRequest, *testpb.SimpleResponse, error) { + var ( + reqs []*testpb.SimpleRequest + resp *testpb.SimpleResponse + err error + ) + tc := testpb.NewTestServiceClient(te.clientConn()) + stream, err := tc.ClientStreamCall(metadata.NewOutgoingContext(context.Background(), testMetadata), grpc.FailFast(c.failfast)) + if err != nil { + return reqs, resp, err + } + var startID int32 + if !c.success { + startID = errorID + } + for i := 0; i < c.count; i++ { + req := &testpb.SimpleRequest{ + Id: int32(i) + startID, + } + reqs = append(reqs, req) + if err = stream.Send(req); err != nil { + return reqs, resp, err + } + } + resp, err = stream.CloseAndRecv() + return reqs, resp, err +} + +func (te *test) doServerStreamCall(c *rpcConfig) (*testpb.SimpleRequest, []*testpb.SimpleResponse, error) { + var ( + req *testpb.SimpleRequest + resps []*testpb.SimpleResponse + err error + ) + + tc := testpb.NewTestServiceClient(te.clientConn()) + + var startID int32 + if !c.success { + startID = errorID + } + req = &testpb.SimpleRequest{Id: startID} + stream, err := tc.ServerStreamCall(metadata.NewOutgoingContext(context.Background(), testMetadata), req, grpc.FailFast(c.failfast)) + if err != nil { + return req, resps, err + } + for { + var resp *testpb.SimpleResponse + resp, err := stream.Recv() + if err == io.EOF { + return req, resps, nil + } else if err != nil { + return req, resps, err + } + resps = append(resps, resp) + } +} + +type expectedData struct { + method string + serverAddr string + compression string + reqIdx int + requests []*testpb.SimpleRequest + respIdx int + responses []*testpb.SimpleResponse + err error + failfast bool +} + +type gotData struct { + ctx context.Context + client bool + s interface{} // This could be RPCStats or ConnStats. +} + +const ( + begin int = iota + end + inPayload + inHeader + inTrailer + outPayload + outHeader + outTrailer + connbegin + connend +) + +func checkBegin(t *testing.T, d *gotData, e *expectedData) { + var ( + ok bool + st *stats.Begin + ) + if st, ok = d.s.(*stats.Begin); !ok { + t.Fatalf("got %T, want Begin", d.s) + } + if d.ctx == nil { + t.Fatalf("d.ctx = nil, want ") + } + if st.BeginTime.IsZero() { + t.Fatalf("st.BeginTime = %v, want ", st.BeginTime) + } + if d.client { + if st.FailFast != e.failfast { + t.Fatalf("st.FailFast = %v, want %v", st.FailFast, e.failfast) + } + } +} + +func checkInHeader(t *testing.T, d *gotData, e *expectedData) { + var ( + ok bool + st *stats.InHeader + ) + if st, ok = d.s.(*stats.InHeader); !ok { + t.Fatalf("got %T, want InHeader", d.s) + } + if d.ctx == nil { + t.Fatalf("d.ctx = nil, want ") + } + if !d.client { + if st.FullMethod != e.method { + t.Fatalf("st.FullMethod = %s, want %v", st.FullMethod, e.method) + } + if st.LocalAddr.String() != e.serverAddr { + t.Fatalf("st.LocalAddr = %v, want %v", st.LocalAddr, e.serverAddr) + } + if st.Compression != e.compression { + t.Fatalf("st.Compression = %v, want %v", st.Compression, e.compression) + } + + if connInfo, ok := d.ctx.Value(connCtxKey{}).(*stats.ConnTagInfo); ok { + if connInfo.RemoteAddr != st.RemoteAddr { + t.Fatalf("connInfo.RemoteAddr = %v, want %v", connInfo.RemoteAddr, st.RemoteAddr) + } + if connInfo.LocalAddr != st.LocalAddr { + t.Fatalf("connInfo.LocalAddr = %v, want %v", connInfo.LocalAddr, st.LocalAddr) + } + } else { + t.Fatalf("got context %v, want one with connCtxKey", d.ctx) + } + if rpcInfo, ok := d.ctx.Value(rpcCtxKey{}).(*stats.RPCTagInfo); ok { + if rpcInfo.FullMethodName != st.FullMethod { + t.Fatalf("rpcInfo.FullMethod = %s, want %v", rpcInfo.FullMethodName, st.FullMethod) + } + } else { + t.Fatalf("got context %v, want one with rpcCtxKey", d.ctx) + } + } +} + +func checkInPayload(t *testing.T, d *gotData, e *expectedData) { + var ( + ok bool + st *stats.InPayload + ) + if st, ok = d.s.(*stats.InPayload); !ok { + t.Fatalf("got %T, want InPayload", d.s) + } + if d.ctx == nil { + t.Fatalf("d.ctx = nil, want ") + } + if d.client { + b, err := proto.Marshal(e.responses[e.respIdx]) + if err != nil { + t.Fatalf("failed to marshal message: %v", err) + } + if reflect.TypeOf(st.Payload) != reflect.TypeOf(e.responses[e.respIdx]) { + t.Fatalf("st.Payload = %T, want %T", st.Payload, e.responses[e.respIdx]) + } + e.respIdx++ + if string(st.Data) != string(b) { + t.Fatalf("st.Data = %v, want %v", st.Data, b) + } + if st.Length != len(b) { + t.Fatalf("st.Lenght = %v, want %v", st.Length, len(b)) + } + } else { + b, err := proto.Marshal(e.requests[e.reqIdx]) + if err != nil { + t.Fatalf("failed to marshal message: %v", err) + } + if reflect.TypeOf(st.Payload) != reflect.TypeOf(e.requests[e.reqIdx]) { + t.Fatalf("st.Payload = %T, want %T", st.Payload, e.requests[e.reqIdx]) + } + e.reqIdx++ + if string(st.Data) != string(b) { + t.Fatalf("st.Data = %v, want %v", st.Data, b) + } + if st.Length != len(b) { + t.Fatalf("st.Lenght = %v, want %v", st.Length, len(b)) + } + } + // TODO check WireLength and ReceivedTime. + if st.RecvTime.IsZero() { + t.Fatalf("st.ReceivedTime = %v, want ", st.RecvTime) + } +} + +func checkInTrailer(t *testing.T, d *gotData, e *expectedData) { + var ( + ok bool + ) + if _, ok = d.s.(*stats.InTrailer); !ok { + t.Fatalf("got %T, want InTrailer", d.s) + } + if d.ctx == nil { + t.Fatalf("d.ctx = nil, want ") + } +} + +func checkOutHeader(t *testing.T, d *gotData, e *expectedData) { + var ( + ok bool + st *stats.OutHeader + ) + if st, ok = d.s.(*stats.OutHeader); !ok { + t.Fatalf("got %T, want OutHeader", d.s) + } + if d.ctx == nil { + t.Fatalf("d.ctx = nil, want ") + } + if d.client { + if st.FullMethod != e.method { + t.Fatalf("st.FullMethod = %s, want %v", st.FullMethod, e.method) + } + if st.RemoteAddr.String() != e.serverAddr { + t.Fatalf("st.RemoteAddr = %v, want %v", st.RemoteAddr, e.serverAddr) + } + if st.Compression != e.compression { + t.Fatalf("st.Compression = %v, want %v", st.Compression, e.compression) + } + + if rpcInfo, ok := d.ctx.Value(rpcCtxKey{}).(*stats.RPCTagInfo); ok { + if rpcInfo.FullMethodName != st.FullMethod { + t.Fatalf("rpcInfo.FullMethod = %s, want %v", rpcInfo.FullMethodName, st.FullMethod) + } + } else { + t.Fatalf("got context %v, want one with rpcCtxKey", d.ctx) + } + } +} + +func checkOutPayload(t *testing.T, d *gotData, e *expectedData) { + var ( + ok bool + st *stats.OutPayload + ) + if st, ok = d.s.(*stats.OutPayload); !ok { + t.Fatalf("got %T, want OutPayload", d.s) + } + if d.ctx == nil { + t.Fatalf("d.ctx = nil, want ") + } + if d.client { + b, err := proto.Marshal(e.requests[e.reqIdx]) + if err != nil { + t.Fatalf("failed to marshal message: %v", err) + } + if reflect.TypeOf(st.Payload) != reflect.TypeOf(e.requests[e.reqIdx]) { + t.Fatalf("st.Payload = %T, want %T", st.Payload, e.requests[e.reqIdx]) + } + e.reqIdx++ + if string(st.Data) != string(b) { + t.Fatalf("st.Data = %v, want %v", st.Data, b) + } + if st.Length != len(b) { + t.Fatalf("st.Lenght = %v, want %v", st.Length, len(b)) + } + } else { + b, err := proto.Marshal(e.responses[e.respIdx]) + if err != nil { + t.Fatalf("failed to marshal message: %v", err) + } + if reflect.TypeOf(st.Payload) != reflect.TypeOf(e.responses[e.respIdx]) { + t.Fatalf("st.Payload = %T, want %T", st.Payload, e.responses[e.respIdx]) + } + e.respIdx++ + if string(st.Data) != string(b) { + t.Fatalf("st.Data = %v, want %v", st.Data, b) + } + if st.Length != len(b) { + t.Fatalf("st.Lenght = %v, want %v", st.Length, len(b)) + } + } + // TODO check WireLength and ReceivedTime. + if st.SentTime.IsZero() { + t.Fatalf("st.SentTime = %v, want ", st.SentTime) + } +} + +func checkOutTrailer(t *testing.T, d *gotData, e *expectedData) { + var ( + ok bool + st *stats.OutTrailer + ) + if st, ok = d.s.(*stats.OutTrailer); !ok { + t.Fatalf("got %T, want OutTrailer", d.s) + } + if d.ctx == nil { + t.Fatalf("d.ctx = nil, want ") + } + if st.Client { + t.Fatalf("st IsClient = true, want false") + } +} + +func checkEnd(t *testing.T, d *gotData, e *expectedData) { + var ( + ok bool + st *stats.End + ) + if st, ok = d.s.(*stats.End); !ok { + t.Fatalf("got %T, want End", d.s) + } + if d.ctx == nil { + t.Fatalf("d.ctx = nil, want ") + } + if st.EndTime.IsZero() { + t.Fatalf("st.EndTime = %v, want ", st.EndTime) + } + if grpc.Code(st.Error) != grpc.Code(e.err) || grpc.ErrorDesc(st.Error) != grpc.ErrorDesc(e.err) { + t.Fatalf("st.Error = %v, want %v", st.Error, e.err) + } +} + +func checkConnBegin(t *testing.T, d *gotData, e *expectedData) { + var ( + ok bool + st *stats.ConnBegin + ) + if st, ok = d.s.(*stats.ConnBegin); !ok { + t.Fatalf("got %T, want ConnBegin", d.s) + } + if d.ctx == nil { + t.Fatalf("d.ctx = nil, want ") + } + st.IsClient() // TODO remove this. +} + +func checkConnEnd(t *testing.T, d *gotData, e *expectedData) { + var ( + ok bool + st *stats.ConnEnd + ) + if st, ok = d.s.(*stats.ConnEnd); !ok { + t.Fatalf("got %T, want ConnEnd", d.s) + } + if d.ctx == nil { + t.Fatalf("d.ctx = nil, want ") + } + st.IsClient() // TODO remove this. +} + +type statshandler struct { + mu sync.Mutex + gotRPC []*gotData + gotConn []*gotData +} + +func (h *statshandler) TagConn(ctx context.Context, info *stats.ConnTagInfo) context.Context { + return context.WithValue(ctx, connCtxKey{}, info) +} + +func (h *statshandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context { + return context.WithValue(ctx, rpcCtxKey{}, info) +} + +func (h *statshandler) HandleConn(ctx context.Context, s stats.ConnStats) { + h.mu.Lock() + defer h.mu.Unlock() + h.gotConn = append(h.gotConn, &gotData{ctx, s.IsClient(), s}) +} + +func (h *statshandler) HandleRPC(ctx context.Context, s stats.RPCStats) { + h.mu.Lock() + defer h.mu.Unlock() + h.gotRPC = append(h.gotRPC, &gotData{ctx, s.IsClient(), s}) +} + +func checkConnStats(t *testing.T, got []*gotData) { + if len(got) <= 0 || len(got)%2 != 0 { + for i, g := range got { + t.Errorf(" - %v, %T = %+v, ctx: %v", i, g.s, g.s, g.ctx) + } + t.Fatalf("got %v stats, want even positive number", len(got)) + } + // The first conn stats must be a ConnBegin. + checkConnBegin(t, got[0], nil) + // The last conn stats must be a ConnEnd. + checkConnEnd(t, got[len(got)-1], nil) +} + +func checkServerStats(t *testing.T, got []*gotData, expect *expectedData, checkFuncs []func(t *testing.T, d *gotData, e *expectedData)) { + if len(got) != len(checkFuncs) { + for i, g := range got { + t.Errorf(" - %v, %T", i, g.s) + } + t.Fatalf("got %v stats, want %v stats", len(got), len(checkFuncs)) + } + + var rpcctx context.Context + for i := 0; i < len(got); i++ { + if _, ok := got[i].s.(stats.RPCStats); ok { + if rpcctx != nil && got[i].ctx != rpcctx { + t.Fatalf("got different contexts with stats %T", got[i].s) + } + rpcctx = got[i].ctx + } + } + + for i, f := range checkFuncs { + f(t, got[i], expect) + } +} + +func testServerStats(t *testing.T, tc *testConfig, cc *rpcConfig, checkFuncs []func(t *testing.T, d *gotData, e *expectedData)) { + h := &statshandler{} + te := newTest(t, tc, nil, h) + te.startServer(&testServer{}) + defer te.tearDown() + + var ( + reqs []*testpb.SimpleRequest + resps []*testpb.SimpleResponse + err error + method string + + req *testpb.SimpleRequest + resp *testpb.SimpleResponse + e error + ) + + switch cc.callType { + case unaryRPC: + method = "/grpc.testing.TestService/UnaryCall" + req, resp, e = te.doUnaryCall(cc) + reqs = []*testpb.SimpleRequest{req} + resps = []*testpb.SimpleResponse{resp} + err = e + case clientStreamRPC: + method = "/grpc.testing.TestService/ClientStreamCall" + reqs, resp, e = te.doClientStreamCall(cc) + resps = []*testpb.SimpleResponse{resp} + err = e + case serverStreamRPC: + method = "/grpc.testing.TestService/ServerStreamCall" + req, resps, e = te.doServerStreamCall(cc) + reqs = []*testpb.SimpleRequest{req} + err = e + case fullDuplexStreamRPC: + method = "/grpc.testing.TestService/FullDuplexCall" + reqs, resps, err = te.doFullDuplexCallRoundtrip(cc) + } + if cc.success != (err == nil) { + t.Fatalf("cc.success: %v, got error: %v", cc.success, err) + } + te.cc.Close() + te.srv.GracefulStop() // Wait for the server to stop. + + for { + h.mu.Lock() + if len(h.gotRPC) >= len(checkFuncs) { + h.mu.Unlock() + break + } + h.mu.Unlock() + time.Sleep(10 * time.Millisecond) + } + + for { + h.mu.Lock() + if _, ok := h.gotConn[len(h.gotConn)-1].s.(*stats.ConnEnd); ok { + h.mu.Unlock() + break + } + h.mu.Unlock() + time.Sleep(10 * time.Millisecond) + } + + expect := &expectedData{ + serverAddr: te.srvAddr, + compression: tc.compress, + method: method, + requests: reqs, + responses: resps, + err: err, + } + + h.mu.Lock() + checkConnStats(t, h.gotConn) + h.mu.Unlock() + checkServerStats(t, h.gotRPC, expect, checkFuncs) +} + +func TestServerStatsUnaryRPC(t *testing.T) { + testServerStats(t, &testConfig{compress: ""}, &rpcConfig{success: true, callType: unaryRPC}, []func(t *testing.T, d *gotData, e *expectedData){ + checkInHeader, + checkBegin, + checkInPayload, + checkOutHeader, + checkOutPayload, + checkOutTrailer, + checkEnd, + }) +} + +func TestServerStatsUnaryRPCError(t *testing.T) { + testServerStats(t, &testConfig{compress: ""}, &rpcConfig{success: false, callType: unaryRPC}, []func(t *testing.T, d *gotData, e *expectedData){ + checkInHeader, + checkBegin, + checkInPayload, + checkOutHeader, + checkOutTrailer, + checkEnd, + }) +} + +func TestServerStatsClientStreamRPC(t *testing.T) { + count := 5 + checkFuncs := []func(t *testing.T, d *gotData, e *expectedData){ + checkInHeader, + checkBegin, + checkOutHeader, + } + ioPayFuncs := []func(t *testing.T, d *gotData, e *expectedData){ + checkInPayload, + } + for i := 0; i < count; i++ { + checkFuncs = append(checkFuncs, ioPayFuncs...) + } + checkFuncs = append(checkFuncs, + checkOutPayload, + checkOutTrailer, + checkEnd, + ) + testServerStats(t, &testConfig{compress: "gzip"}, &rpcConfig{count: count, success: true, callType: clientStreamRPC}, checkFuncs) +} + +func TestServerStatsClientStreamRPCError(t *testing.T) { + count := 1 + testServerStats(t, &testConfig{compress: "gzip"}, &rpcConfig{count: count, success: false, callType: clientStreamRPC}, []func(t *testing.T, d *gotData, e *expectedData){ + checkInHeader, + checkBegin, + checkOutHeader, + checkInPayload, + checkOutTrailer, + checkEnd, + }) +} + +func TestServerStatsServerStreamRPC(t *testing.T) { + count := 5 + checkFuncs := []func(t *testing.T, d *gotData, e *expectedData){ + checkInHeader, + checkBegin, + checkInPayload, + checkOutHeader, + } + ioPayFuncs := []func(t *testing.T, d *gotData, e *expectedData){ + checkOutPayload, + } + for i := 0; i < count; i++ { + checkFuncs = append(checkFuncs, ioPayFuncs...) + } + checkFuncs = append(checkFuncs, + checkOutTrailer, + checkEnd, + ) + testServerStats(t, &testConfig{compress: "gzip"}, &rpcConfig{count: count, success: true, callType: serverStreamRPC}, checkFuncs) +} + +func TestServerStatsServerStreamRPCError(t *testing.T) { + count := 5 + testServerStats(t, &testConfig{compress: "gzip"}, &rpcConfig{count: count, success: false, callType: serverStreamRPC}, []func(t *testing.T, d *gotData, e *expectedData){ + checkInHeader, + checkBegin, + checkInPayload, + checkOutHeader, + checkOutTrailer, + checkEnd, + }) +} + +func TestServerStatsFullDuplexRPC(t *testing.T) { + count := 5 + checkFuncs := []func(t *testing.T, d *gotData, e *expectedData){ + checkInHeader, + checkBegin, + checkOutHeader, + } + ioPayFuncs := []func(t *testing.T, d *gotData, e *expectedData){ + checkInPayload, + checkOutPayload, + } + for i := 0; i < count; i++ { + checkFuncs = append(checkFuncs, ioPayFuncs...) + } + checkFuncs = append(checkFuncs, + checkOutTrailer, + checkEnd, + ) + testServerStats(t, &testConfig{compress: "gzip"}, &rpcConfig{count: count, success: true, callType: fullDuplexStreamRPC}, checkFuncs) +} + +func TestServerStatsFullDuplexRPCError(t *testing.T) { + count := 5 + testServerStats(t, &testConfig{compress: "gzip"}, &rpcConfig{count: count, success: false, callType: fullDuplexStreamRPC}, []func(t *testing.T, d *gotData, e *expectedData){ + checkInHeader, + checkBegin, + checkOutHeader, + checkInPayload, + checkOutTrailer, + checkEnd, + }) +} + +type checkFuncWithCount struct { + f func(t *testing.T, d *gotData, e *expectedData) + c int // expected count +} + +func checkClientStats(t *testing.T, got []*gotData, expect *expectedData, checkFuncs map[int]*checkFuncWithCount) { + var expectLen int + for _, v := range checkFuncs { + expectLen += v.c + } + if len(got) != expectLen { + for i, g := range got { + t.Errorf(" - %v, %T", i, g.s) + } + t.Fatalf("got %v stats, want %v stats", len(got), expectLen) + } + + var tagInfoInCtx *stats.RPCTagInfo + for i := 0; i < len(got); i++ { + if _, ok := got[i].s.(stats.RPCStats); ok { + tagInfoInCtxNew, _ := got[i].ctx.Value(rpcCtxKey{}).(*stats.RPCTagInfo) + if tagInfoInCtx != nil && tagInfoInCtx != tagInfoInCtxNew { + t.Fatalf("got context containing different tagInfo with stats %T", got[i].s) + } + tagInfoInCtx = tagInfoInCtxNew + } + } + + for _, s := range got { + switch s.s.(type) { + case *stats.Begin: + if checkFuncs[begin].c <= 0 { + t.Fatalf("unexpected stats: %T", s.s) + } + checkFuncs[begin].f(t, s, expect) + checkFuncs[begin].c-- + case *stats.OutHeader: + if checkFuncs[outHeader].c <= 0 { + t.Fatalf("unexpected stats: %T", s.s) + } + checkFuncs[outHeader].f(t, s, expect) + checkFuncs[outHeader].c-- + case *stats.OutPayload: + if checkFuncs[outPayload].c <= 0 { + t.Fatalf("unexpected stats: %T", s.s) + } + checkFuncs[outPayload].f(t, s, expect) + checkFuncs[outPayload].c-- + case *stats.InHeader: + if checkFuncs[inHeader].c <= 0 { + t.Fatalf("unexpected stats: %T", s.s) + } + checkFuncs[inHeader].f(t, s, expect) + checkFuncs[inHeader].c-- + case *stats.InPayload: + if checkFuncs[inPayload].c <= 0 { + t.Fatalf("unexpected stats: %T", s.s) + } + checkFuncs[inPayload].f(t, s, expect) + checkFuncs[inPayload].c-- + case *stats.InTrailer: + if checkFuncs[inTrailer].c <= 0 { + t.Fatalf("unexpected stats: %T", s.s) + } + checkFuncs[inTrailer].f(t, s, expect) + checkFuncs[inTrailer].c-- + case *stats.End: + if checkFuncs[end].c <= 0 { + t.Fatalf("unexpected stats: %T", s.s) + } + checkFuncs[end].f(t, s, expect) + checkFuncs[end].c-- + case *stats.ConnBegin: + if checkFuncs[connbegin].c <= 0 { + t.Fatalf("unexpected stats: %T", s.s) + } + checkFuncs[connbegin].f(t, s, expect) + checkFuncs[connbegin].c-- + case *stats.ConnEnd: + if checkFuncs[connend].c <= 0 { + t.Fatalf("unexpected stats: %T", s.s) + } + checkFuncs[connend].f(t, s, expect) + checkFuncs[connend].c-- + default: + t.Fatalf("unexpected stats: %T", s.s) + } + } +} + +func testClientStats(t *testing.T, tc *testConfig, cc *rpcConfig, checkFuncs map[int]*checkFuncWithCount) { + h := &statshandler{} + te := newTest(t, tc, h, nil) + te.startServer(&testServer{}) + defer te.tearDown() + + var ( + reqs []*testpb.SimpleRequest + resps []*testpb.SimpleResponse + method string + err error + + req *testpb.SimpleRequest + resp *testpb.SimpleResponse + e error + ) + switch cc.callType { + case unaryRPC: + method = "/grpc.testing.TestService/UnaryCall" + req, resp, e = te.doUnaryCall(cc) + reqs = []*testpb.SimpleRequest{req} + resps = []*testpb.SimpleResponse{resp} + err = e + case clientStreamRPC: + method = "/grpc.testing.TestService/ClientStreamCall" + reqs, resp, e = te.doClientStreamCall(cc) + resps = []*testpb.SimpleResponse{resp} + err = e + case serverStreamRPC: + method = "/grpc.testing.TestService/ServerStreamCall" + req, resps, e = te.doServerStreamCall(cc) + reqs = []*testpb.SimpleRequest{req} + err = e + case fullDuplexStreamRPC: + method = "/grpc.testing.TestService/FullDuplexCall" + reqs, resps, err = te.doFullDuplexCallRoundtrip(cc) + } + if cc.success != (err == nil) { + t.Fatalf("cc.success: %v, got error: %v", cc.success, err) + } + te.cc.Close() + te.srv.GracefulStop() // Wait for the server to stop. + + lenRPCStats := 0 + for _, v := range checkFuncs { + lenRPCStats += v.c + } + for { + h.mu.Lock() + if len(h.gotRPC) >= lenRPCStats { + h.mu.Unlock() + break + } + h.mu.Unlock() + time.Sleep(10 * time.Millisecond) + } + + for { + h.mu.Lock() + if _, ok := h.gotConn[len(h.gotConn)-1].s.(*stats.ConnEnd); ok { + h.mu.Unlock() + break + } + h.mu.Unlock() + time.Sleep(10 * time.Millisecond) + } + + expect := &expectedData{ + serverAddr: te.srvAddr, + compression: tc.compress, + method: method, + requests: reqs, + responses: resps, + failfast: cc.failfast, + err: err, + } + + h.mu.Lock() + checkConnStats(t, h.gotConn) + h.mu.Unlock() + checkClientStats(t, h.gotRPC, expect, checkFuncs) +} + +func TestClientStatsUnaryRPC(t *testing.T) { + testClientStats(t, &testConfig{compress: ""}, &rpcConfig{success: true, failfast: false, callType: unaryRPC}, map[int]*checkFuncWithCount{ + begin: {checkBegin, 1}, + outHeader: {checkOutHeader, 1}, + outPayload: {checkOutPayload, 1}, + inHeader: {checkInHeader, 1}, + inPayload: {checkInPayload, 1}, + inTrailer: {checkInTrailer, 1}, + end: {checkEnd, 1}, + }) +} + +func TestClientStatsUnaryRPCError(t *testing.T) { + testClientStats(t, &testConfig{compress: ""}, &rpcConfig{success: false, failfast: false, callType: unaryRPC}, map[int]*checkFuncWithCount{ + begin: {checkBegin, 1}, + outHeader: {checkOutHeader, 1}, + outPayload: {checkOutPayload, 1}, + inHeader: {checkInHeader, 1}, + inTrailer: {checkInTrailer, 1}, + end: {checkEnd, 1}, + }) +} + +func TestClientStatsClientStreamRPC(t *testing.T) { + count := 5 + testClientStats(t, &testConfig{compress: "gzip"}, &rpcConfig{count: count, success: true, failfast: false, callType: clientStreamRPC}, map[int]*checkFuncWithCount{ + begin: {checkBegin, 1}, + outHeader: {checkOutHeader, 1}, + inHeader: {checkInHeader, 1}, + outPayload: {checkOutPayload, count}, + inTrailer: {checkInTrailer, 1}, + inPayload: {checkInPayload, 1}, + end: {checkEnd, 1}, + }) +} + +func TestClientStatsClientStreamRPCError(t *testing.T) { + count := 1 + testClientStats(t, &testConfig{compress: "gzip"}, &rpcConfig{count: count, success: false, failfast: false, callType: clientStreamRPC}, map[int]*checkFuncWithCount{ + begin: {checkBegin, 1}, + outHeader: {checkOutHeader, 1}, + inHeader: {checkInHeader, 1}, + outPayload: {checkOutPayload, 1}, + inTrailer: {checkInTrailer, 1}, + end: {checkEnd, 1}, + }) +} + +func TestClientStatsServerStreamRPC(t *testing.T) { + count := 5 + testClientStats(t, &testConfig{compress: "gzip"}, &rpcConfig{count: count, success: true, failfast: false, callType: serverStreamRPC}, map[int]*checkFuncWithCount{ + begin: {checkBegin, 1}, + outHeader: {checkOutHeader, 1}, + outPayload: {checkOutPayload, 1}, + inHeader: {checkInHeader, 1}, + inPayload: {checkInPayload, count}, + inTrailer: {checkInTrailer, 1}, + end: {checkEnd, 1}, + }) +} + +func TestClientStatsServerStreamRPCError(t *testing.T) { + count := 5 + testClientStats(t, &testConfig{compress: "gzip"}, &rpcConfig{count: count, success: false, failfast: false, callType: serverStreamRPC}, map[int]*checkFuncWithCount{ + begin: {checkBegin, 1}, + outHeader: {checkOutHeader, 1}, + outPayload: {checkOutPayload, 1}, + inHeader: {checkInHeader, 1}, + inTrailer: {checkInTrailer, 1}, + end: {checkEnd, 1}, + }) +} + +func TestClientStatsFullDuplexRPC(t *testing.T) { + count := 5 + testClientStats(t, &testConfig{compress: "gzip"}, &rpcConfig{count: count, success: true, failfast: false, callType: fullDuplexStreamRPC}, map[int]*checkFuncWithCount{ + begin: {checkBegin, 1}, + outHeader: {checkOutHeader, 1}, + outPayload: {checkOutPayload, count}, + inHeader: {checkInHeader, 1}, + inPayload: {checkInPayload, count}, + inTrailer: {checkInTrailer, 1}, + end: {checkEnd, 1}, + }) +} + +func TestClientStatsFullDuplexRPCError(t *testing.T) { + count := 5 + testClientStats(t, &testConfig{compress: "gzip"}, &rpcConfig{count: count, success: false, failfast: false, callType: fullDuplexStreamRPC}, map[int]*checkFuncWithCount{ + begin: {checkBegin, 1}, + outHeader: {checkOutHeader, 1}, + outPayload: {checkOutPayload, 1}, + inHeader: {checkInHeader, 1}, + inTrailer: {checkInTrailer, 1}, + end: {checkEnd, 1}, + }) +} + +// If the user doesn't call the last recv() on clientStream. +func TestClientStatsFullDuplexRPCNotCallingLastRecv(t *testing.T) { + count := 1 + testClientStats(t, &testConfig{compress: "gzip"}, &rpcConfig{count: count, success: true, failfast: false, callType: fullDuplexStreamRPC, noLastRecv: true}, map[int]*checkFuncWithCount{ + begin: {checkBegin, 1}, + outHeader: {checkOutHeader, 1}, + outPayload: {checkOutPayload, count}, + inHeader: {checkInHeader, 1}, + inPayload: {checkInPayload, count}, + inTrailer: {checkInTrailer, 1}, + end: {checkEnd, 1}, + }) +} + +func TestTags(t *testing.T) { + b := []byte{5, 2, 4, 3, 1} + ctx := stats.SetTags(context.Background(), b) + if tg := stats.OutgoingTags(ctx); !reflect.DeepEqual(tg, b) { + t.Errorf("OutgoingTags(%v) = %v; want %v", ctx, tg, b) + } + if tg := stats.Tags(ctx); tg != nil { + t.Errorf("Tags(%v) = %v; want nil", ctx, tg) + } + + ctx = stats.SetIncomingTags(context.Background(), b) + if tg := stats.Tags(ctx); !reflect.DeepEqual(tg, b) { + t.Errorf("Tags(%v) = %v; want %v", ctx, tg, b) + } + if tg := stats.OutgoingTags(ctx); tg != nil { + t.Errorf("OutgoingTags(%v) = %v; want nil", ctx, tg) + } +} + +func TestTrace(t *testing.T) { + b := []byte{5, 2, 4, 3, 1} + ctx := stats.SetTrace(context.Background(), b) + if tr := stats.OutgoingTrace(ctx); !reflect.DeepEqual(tr, b) { + t.Errorf("OutgoingTrace(%v) = %v; want %v", ctx, tr, b) + } + if tr := stats.Trace(ctx); tr != nil { + t.Errorf("Trace(%v) = %v; want nil", ctx, tr) + } + + ctx = stats.SetIncomingTrace(context.Background(), b) + if tr := stats.Trace(ctx); !reflect.DeepEqual(tr, b) { + t.Errorf("Trace(%v) = %v; want %v", ctx, tr, b) + } + if tr := stats.OutgoingTrace(ctx); tr != nil { + t.Errorf("OutgoingTrace(%v) = %v; want nil", ctx, tr) + } +} diff --git a/vendor/google.golang.org/grpc/status/status.go b/vendor/google.golang.org/grpc/status/status.go new file mode 100644 index 0000000000..871dc4b31c --- /dev/null +++ b/vendor/google.golang.org/grpc/status/status.go @@ -0,0 +1,168 @@ +/* + * + * Copyright 2017 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. + * + */ + +// Package status implements errors returned by gRPC. These errors are +// serialized and transmitted on the wire between server and client, and allow +// for additional data to be transmitted via the Details field in the status +// proto. gRPC service handlers should return an error created by this +// package, and gRPC clients should expect a corresponding error to be +// returned from the RPC call. +// +// This package upholds the invariants that a non-nil error may not +// contain an OK code, and an OK code must result in a nil error. +package status + +import ( + "errors" + "fmt" + + "github.com/golang/protobuf/proto" + "github.com/golang/protobuf/ptypes" + spb "google.golang.org/genproto/googleapis/rpc/status" + "google.golang.org/grpc/codes" +) + +// statusError is an alias of a status proto. It implements error and Status, +// and a nil statusError should never be returned by this package. +type statusError spb.Status + +func (se *statusError) Error() string { + p := (*spb.Status)(se) + return fmt.Sprintf("rpc error: code = %s desc = %s", codes.Code(p.GetCode()), p.GetMessage()) +} + +func (se *statusError) status() *Status { + return &Status{s: (*spb.Status)(se)} +} + +// Status represents an RPC status code, message, and details. It is immutable +// and should be created with New, Newf, or FromProto. +type Status struct { + s *spb.Status +} + +// Code returns the status code contained in s. +func (s *Status) Code() codes.Code { + if s == nil || s.s == nil { + return codes.OK + } + return codes.Code(s.s.Code) +} + +// Message returns the message contained in s. +func (s *Status) Message() string { + if s == nil || s.s == nil { + return "" + } + return s.s.Message +} + +// Proto returns s's status as an spb.Status proto message. +func (s *Status) Proto() *spb.Status { + if s == nil { + return nil + } + return proto.Clone(s.s).(*spb.Status) +} + +// Err returns an immutable error representing s; returns nil if s.Code() is +// OK. +func (s *Status) Err() error { + if s.Code() == codes.OK { + return nil + } + return (*statusError)(s.s) +} + +// New returns a Status representing c and msg. +func New(c codes.Code, msg string) *Status { + return &Status{s: &spb.Status{Code: int32(c), Message: msg}} +} + +// Newf returns New(c, fmt.Sprintf(format, a...)). +func Newf(c codes.Code, format string, a ...interface{}) *Status { + return New(c, fmt.Sprintf(format, a...)) +} + +// Error returns an error representing c and msg. If c is OK, returns nil. +func Error(c codes.Code, msg string) error { + return New(c, msg).Err() +} + +// Errorf returns Error(c, fmt.Sprintf(format, a...)). +func Errorf(c codes.Code, format string, a ...interface{}) error { + return Error(c, fmt.Sprintf(format, a...)) +} + +// ErrorProto returns an error representing s. If s.Code is OK, returns nil. +func ErrorProto(s *spb.Status) error { + return FromProto(s).Err() +} + +// FromProto returns a Status representing s. +func FromProto(s *spb.Status) *Status { + return &Status{s: proto.Clone(s).(*spb.Status)} +} + +// FromError returns a Status representing err if it was produced from this +// package, otherwise it returns nil, false. +func FromError(err error) (s *Status, ok bool) { + if err == nil { + return &Status{s: &spb.Status{Code: int32(codes.OK)}}, true + } + if s, ok := err.(*statusError); ok { + return s.status(), true + } + return nil, false +} + +// WithDetails returns a new status with the provided details messages appended to the status. +// If any errors are encountered, it returns nil and the first error encountered. +func (s *Status) WithDetails(details ...proto.Message) (*Status, error) { + if s.Code() == codes.OK { + return nil, errors.New("no error details for status with code OK") + } + // s.Code() != OK implies that s.Proto() != nil. + p := s.Proto() + for _, detail := range details { + any, err := ptypes.MarshalAny(detail) + if err != nil { + return nil, err + } + p.Details = append(p.Details, any) + } + return &Status{s: p}, nil +} + +// Details returns a slice of details messages attached to the status. +// If a detail cannot be decoded, the error is returned in place of the detail. +func (s *Status) Details() []interface{} { + if s == nil || s.s == nil { + return nil + } + details := make([]interface{}, 0, len(s.s.Details)) + for _, any := range s.s.Details { + detail := &ptypes.DynamicAny{} + if err := ptypes.UnmarshalAny(any, detail); err != nil { + details = append(details, err) + continue + } + details = append(details, detail.Message) + } + return details +} diff --git a/vendor/google.golang.org/grpc/status/status_test.go b/vendor/google.golang.org/grpc/status/status_test.go new file mode 100644 index 0000000000..69be8c9f6a --- /dev/null +++ b/vendor/google.golang.org/grpc/status/status_test.go @@ -0,0 +1,261 @@ +/* + * + * Copyright 2017 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. + * + */ + +package status + +import ( + "errors" + "fmt" + "reflect" + "testing" + + "github.com/golang/protobuf/proto" + "github.com/golang/protobuf/ptypes" + apb "github.com/golang/protobuf/ptypes/any" + dpb "github.com/golang/protobuf/ptypes/duration" + cpb "google.golang.org/genproto/googleapis/rpc/code" + epb "google.golang.org/genproto/googleapis/rpc/errdetails" + spb "google.golang.org/genproto/googleapis/rpc/status" + "google.golang.org/grpc/codes" +) + +func TestErrorsWithSameParameters(t *testing.T) { + const description = "some description" + e1 := Errorf(codes.AlreadyExists, description) + e2 := Errorf(codes.AlreadyExists, description) + if e1 == e2 || !reflect.DeepEqual(e1, e2) { + t.Fatalf("Errors should be equivalent but unique - e1: %v, %v e2: %p, %v", e1.(*statusError), e1, e2.(*statusError), e2) + } +} + +func TestFromToProto(t *testing.T) { + s := &spb.Status{ + Code: int32(codes.Internal), + Message: "test test test", + Details: []*apb.Any{{TypeUrl: "foo", Value: []byte{3, 2, 1}}}, + } + + err := FromProto(s) + if got := err.Proto(); !proto.Equal(s, got) { + t.Fatalf("Expected errors to be identical - s: %v got: %v", s, got) + } +} + +func TestFromNilProto(t *testing.T) { + tests := []*Status{nil, FromProto(nil)} + for _, s := range tests { + if c := s.Code(); c != codes.OK { + t.Errorf("s: %v - Expected s.Code() = OK; got %v", s, c) + } + if m := s.Message(); m != "" { + t.Errorf("s: %v - Expected s.Message() = \"\"; got %q", s, m) + } + if p := s.Proto(); p != nil { + t.Errorf("s: %v - Expected s.Proto() = nil; got %q", s, p) + } + if e := s.Err(); e != nil { + t.Errorf("s: %v - Expected s.Err() = nil; got %v", s, e) + } + } +} + +func TestError(t *testing.T) { + err := Error(codes.Internal, "test description") + if got, want := err.Error(), "rpc error: code = Internal desc = test description"; got != want { + t.Fatalf("err.Error() = %q; want %q", got, want) + } + s, _ := FromError(err) + if got, want := s.Code(), codes.Internal; got != want { + t.Fatalf("err.Code() = %s; want %s", got, want) + } + if got, want := s.Message(), "test description"; got != want { + t.Fatalf("err.Message() = %s; want %s", got, want) + } +} + +func TestErrorOK(t *testing.T) { + err := Error(codes.OK, "foo") + if err != nil { + t.Fatalf("Error(codes.OK, _) = %p; want nil", err.(*statusError)) + } +} + +func TestErrorProtoOK(t *testing.T) { + s := &spb.Status{Code: int32(codes.OK)} + if got := ErrorProto(s); got != nil { + t.Fatalf("ErrorProto(%v) = %v; want nil", s, got) + } +} + +func TestFromError(t *testing.T) { + code, message := codes.Internal, "test description" + err := Error(code, message) + s, ok := FromError(err) + if !ok || s.Code() != code || s.Message() != message || s.Err() == nil { + t.Fatalf("FromError(%v) = %v, %v; want , true", err, s, ok, code, message) + } +} + +func TestFromErrorOK(t *testing.T) { + code, message := codes.OK, "" + s, ok := FromError(nil) + if !ok || s.Code() != code || s.Message() != message || s.Err() != nil { + t.Fatalf("FromError(nil) = %v, %v; want , true", s, ok, code, message) + } +} + +func TestStatus_ErrorDetails(t *testing.T) { + tests := []struct { + code codes.Code + details []proto.Message + }{ + { + code: codes.NotFound, + details: nil, + }, + { + code: codes.NotFound, + details: []proto.Message{ + &epb.ResourceInfo{ + ResourceType: "book", + ResourceName: "projects/1234/books/5678", + Owner: "User", + }, + }, + }, + { + code: codes.Internal, + details: []proto.Message{ + &epb.DebugInfo{ + StackEntries: []string{ + "first stack", + "second stack", + }, + }, + }, + }, + { + code: codes.Unavailable, + details: []proto.Message{ + &epb.RetryInfo{ + RetryDelay: &dpb.Duration{Seconds: 60}, + }, + &epb.ResourceInfo{ + ResourceType: "book", + ResourceName: "projects/1234/books/5678", + Owner: "User", + }, + }, + }, + } + + for _, tc := range tests { + s, err := New(tc.code, "").WithDetails(tc.details...) + if err != nil { + t.Fatalf("(%v).WithDetails(%+v) failed: %v", str(s), tc.details, err) + } + details := s.Details() + for i := range details { + if !proto.Equal(details[i].(proto.Message), tc.details[i]) { + t.Fatalf("(%v).Details()[%d] = %+v, want %+v", str(s), i, details[i], tc.details[i]) + } + } + } +} + +func TestStatus_WithDetails_Fail(t *testing.T) { + tests := []*Status{ + nil, + FromProto(nil), + New(codes.OK, ""), + } + for _, s := range tests { + if s, err := s.WithDetails(); err == nil || s != nil { + t.Fatalf("(%v).WithDetails(%+v) = %v, %v; want nil, non-nil", str(s), []proto.Message{}, s, err) + } + } +} + +func TestStatus_ErrorDetails_Fail(t *testing.T) { + tests := []struct { + s *Status + i []interface{} + }{ + { + nil, + nil, + }, + { + FromProto(nil), + nil, + }, + { + New(codes.OK, ""), + []interface{}{}, + }, + { + FromProto(&spb.Status{ + Code: int32(cpb.Code_CANCELLED), + Details: []*apb.Any{ + { + TypeUrl: "", + Value: []byte{}, + }, + mustMarshalAny(&epb.ResourceInfo{ + ResourceType: "book", + ResourceName: "projects/1234/books/5678", + Owner: "User", + }), + }, + }), + []interface{}{ + errors.New(`message type url "" is invalid`), + &epb.ResourceInfo{ + ResourceType: "book", + ResourceName: "projects/1234/books/5678", + Owner: "User", + }, + }, + }, + } + for _, tc := range tests { + got := tc.s.Details() + if !reflect.DeepEqual(got, tc.i) { + t.Errorf("(%v).Details() = %+v, want %+v", str(tc.s), got, tc.i) + } + } +} + +func str(s *Status) string { + if s == nil { + return "nil" + } + if s.s == nil { + return "" + } + return fmt.Sprintf("", codes.Code(s.s.GetCode()), s.s.GetMessage(), s.s.GetDetails()) +} + +// mustMarshalAny converts a protobuf message to an any. +func mustMarshalAny(msg proto.Message) *apb.Any { + any, err := ptypes.MarshalAny(msg) + if err != nil { + panic(fmt.Sprintf("ptypes.MarshalAny(%+v) failed: %v", msg, err)) + } + return any +} diff --git a/vendor/google.golang.org/grpc/stream.go b/vendor/google.golang.org/grpc/stream.go new file mode 100644 index 0000000000..9eeaafef88 --- /dev/null +++ b/vendor/google.golang.org/grpc/stream.go @@ -0,0 +1,714 @@ +/* + * + * Copyright 2014 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. + * + */ + +package grpc + +import ( + "errors" + "io" + "sync" + "time" + + "golang.org/x/net/context" + "golang.org/x/net/trace" + "google.golang.org/grpc/balancer" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/encoding" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/peer" + "google.golang.org/grpc/stats" + "google.golang.org/grpc/status" + "google.golang.org/grpc/transport" +) + +// StreamHandler defines the handler called by gRPC server to complete the +// execution of a streaming RPC. +type StreamHandler func(srv interface{}, stream ServerStream) error + +// StreamDesc represents a streaming RPC service's method specification. +type StreamDesc struct { + StreamName string + Handler StreamHandler + + // At least one of these is true. + ServerStreams bool + ClientStreams bool +} + +// Stream defines the common interface a client or server stream has to satisfy. +type Stream interface { + // Context returns the context for this stream. + Context() context.Context + // SendMsg blocks until it sends m, the stream is done or the stream + // breaks. + // On error, it aborts the stream and returns an RPC status on client + // side. On server side, it simply returns the error to the caller. + // SendMsg is called by generated code. Also Users can call SendMsg + // directly when it is really needed in their use cases. + // It's safe to have a goroutine calling SendMsg and another goroutine calling + // recvMsg on the same stream at the same time. + // But it is not safe to call SendMsg on the same stream in different goroutines. + SendMsg(m interface{}) error + // RecvMsg blocks until it receives a message or the stream is + // done. On client side, it returns io.EOF when the stream is done. On + // any other error, it aborts the stream and returns an RPC status. On + // server side, it simply returns the error to the caller. + // It's safe to have a goroutine calling SendMsg and another goroutine calling + // recvMsg on the same stream at the same time. + // But it is not safe to call RecvMsg on the same stream in different goroutines. + RecvMsg(m interface{}) error +} + +// ClientStream defines the interface a client stream has to satisfy. +type ClientStream interface { + // Header returns the header metadata received from the server if there + // is any. It blocks if the metadata is not ready to read. + Header() (metadata.MD, error) + // Trailer returns the trailer metadata from the server, if there is any. + // It must only be called after stream.CloseAndRecv has returned, or + // stream.Recv has returned a non-nil error (including io.EOF). + Trailer() metadata.MD + // CloseSend closes the send direction of the stream. It closes the stream + // when non-nil error is met. + CloseSend() error + // Stream.SendMsg() may return a non-nil error when something wrong happens sending + // the request. The returned error indicates the status of this sending, not the final + // status of the RPC. + // Always call Stream.RecvMsg() to get the final status if you care about the status of + // the RPC. + Stream +} + +// NewStream creates a new Stream for the client side. This is typically +// called by generated code. +func (cc *ClientConn) NewStream(ctx context.Context, desc *StreamDesc, method string, opts ...CallOption) (ClientStream, error) { + if cc.dopts.streamInt != nil { + return cc.dopts.streamInt(ctx, desc, cc, method, newClientStream, opts...) + } + return newClientStream(ctx, desc, cc, method, opts...) +} + +// NewClientStream creates a new Stream for the client side. This is typically +// called by generated code. +// +// DEPRECATED: Use ClientConn.NewStream instead. +func NewClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, opts ...CallOption) (ClientStream, error) { + return cc.NewStream(ctx, desc, method, opts...) +} + +func newClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, opts ...CallOption) (_ ClientStream, err error) { + var ( + t transport.ClientTransport + s *transport.Stream + done func(balancer.DoneInfo) + cancel context.CancelFunc + ) + c := defaultCallInfo() + mc := cc.GetMethodConfig(method) + if mc.WaitForReady != nil { + c.failFast = !*mc.WaitForReady + } + + if mc.Timeout != nil && *mc.Timeout >= 0 { + ctx, cancel = context.WithTimeout(ctx, *mc.Timeout) + defer func() { + if err != nil { + cancel() + } + }() + } + + opts = append(cc.dopts.callOptions, opts...) + for _, o := range opts { + if err := o.before(c); err != nil { + return nil, toRPCErr(err) + } + } + c.maxSendMessageSize = getMaxSize(mc.MaxReqSize, c.maxSendMessageSize, defaultClientMaxSendMessageSize) + c.maxReceiveMessageSize = getMaxSize(mc.MaxRespSize, c.maxReceiveMessageSize, defaultClientMaxReceiveMessageSize) + + callHdr := &transport.CallHdr{ + Host: cc.authority, + Method: method, + // If it's not client streaming, we should already have the request to be sent, + // so we don't flush the header. + // If it's client streaming, the user may never send a request or send it any + // time soon, so we ask the transport to flush the header. + Flush: desc.ClientStreams, + } + + // Set our outgoing compression according to the UseCompressor CallOption, if + // set. In that case, also find the compressor from the encoding package. + // Otherwise, use the compressor configured by the WithCompressor DialOption, + // if set. + var cp Compressor + var comp encoding.Compressor + if ct := c.compressorType; ct != "" { + callHdr.SendCompress = ct + if ct != encoding.Identity { + comp = encoding.GetCompressor(ct) + if comp == nil { + return nil, Errorf(codes.Internal, "grpc: Compressor is not installed for requested grpc-encoding %q", ct) + } + } + } else if cc.dopts.cp != nil { + callHdr.SendCompress = cc.dopts.cp.Type() + cp = cc.dopts.cp + } + if c.creds != nil { + callHdr.Creds = c.creds + } + var trInfo traceInfo + if EnableTracing { + trInfo.tr = trace.New("grpc.Sent."+methodFamily(method), method) + trInfo.firstLine.client = true + if deadline, ok := ctx.Deadline(); ok { + trInfo.firstLine.deadline = deadline.Sub(time.Now()) + } + trInfo.tr.LazyLog(&trInfo.firstLine, false) + ctx = trace.NewContext(ctx, trInfo.tr) + defer func() { + if err != nil { + // Need to call tr.finish() if error is returned. + // Because tr will not be returned to caller. + trInfo.tr.LazyPrintf("RPC: [%v]", err) + trInfo.tr.SetError() + trInfo.tr.Finish() + } + }() + } + ctx = newContextWithRPCInfo(ctx, c.failFast) + sh := cc.dopts.copts.StatsHandler + if sh != nil { + ctx = sh.TagRPC(ctx, &stats.RPCTagInfo{FullMethodName: method, FailFast: c.failFast}) + begin := &stats.Begin{ + Client: true, + BeginTime: time.Now(), + FailFast: c.failFast, + } + sh.HandleRPC(ctx, begin) + defer func() { + if err != nil { + // Only handle end stats if err != nil. + end := &stats.End{ + Client: true, + Error: err, + } + sh.HandleRPC(ctx, end) + } + }() + } + + for { + // Check to make sure the context has expired. This will prevent us from + // looping forever if an error occurs for wait-for-ready RPCs where no data + // is sent on the wire. + select { + case <-ctx.Done(): + return nil, toRPCErr(ctx.Err()) + default: + } + + t, done, err = cc.getTransport(ctx, c.failFast) + if err != nil { + return nil, err + } + + s, err = t.NewStream(ctx, callHdr) + if err != nil { + if done != nil { + done(balancer.DoneInfo{Err: err}) + done = nil + } + // In the event of any error from NewStream, we never attempted to write + // anything to the wire, so we can retry indefinitely for non-fail-fast + // RPCs. + if !c.failFast { + continue + } + return nil, toRPCErr(err) + } + break + } + + // Set callInfo.peer object from stream's context. + if peer, ok := peer.FromContext(s.Context()); ok { + c.peer = peer + } + cs := &clientStream{ + opts: opts, + c: c, + desc: desc, + codec: cc.dopts.codec, + cp: cp, + dc: cc.dopts.dc, + comp: comp, + cancel: cancel, + + done: done, + t: t, + s: s, + p: &parser{r: s}, + + tracing: EnableTracing, + trInfo: trInfo, + + statsCtx: ctx, + statsHandler: cc.dopts.copts.StatsHandler, + } + // Listen on s.Context().Done() to detect cancellation and s.Done() to detect + // normal termination when there is no pending I/O operations on this stream. + go func() { + select { + case <-t.Error(): + // Incur transport error, simply exit. + case <-cc.ctx.Done(): + cs.finish(ErrClientConnClosing) + cs.closeTransportStream(ErrClientConnClosing) + case <-s.Done(): + // TODO: The trace of the RPC is terminated here when there is no pending + // I/O, which is probably not the optimal solution. + cs.finish(s.Status().Err()) + cs.closeTransportStream(nil) + case <-s.GoAway(): + cs.finish(errConnDrain) + cs.closeTransportStream(errConnDrain) + case <-s.Context().Done(): + err := s.Context().Err() + cs.finish(err) + cs.closeTransportStream(transport.ContextErr(err)) + } + }() + return cs, nil +} + +// clientStream implements a client side Stream. +type clientStream struct { + opts []CallOption + c *callInfo + t transport.ClientTransport + s *transport.Stream + p *parser + desc *StreamDesc + + codec Codec + cp Compressor + dc Decompressor + comp encoding.Compressor + decomp encoding.Compressor + decompSet bool + + cancel context.CancelFunc + + tracing bool // set to EnableTracing when the clientStream is created. + + mu sync.Mutex + done func(balancer.DoneInfo) + closed bool + finished bool + // trInfo.tr is set when the clientStream is created (if EnableTracing is true), + // and is set to nil when the clientStream's finish method is called. + trInfo traceInfo + + // statsCtx keeps the user context for stats handling. + // All stats collection should use the statsCtx (instead of the stream context) + // so that all the generated stats for a particular RPC can be associated in the processing phase. + statsCtx context.Context + statsHandler stats.Handler +} + +func (cs *clientStream) Context() context.Context { + return cs.s.Context() +} + +func (cs *clientStream) Header() (metadata.MD, error) { + m, err := cs.s.Header() + if err != nil { + if _, ok := err.(transport.ConnectionError); !ok { + cs.closeTransportStream(err) + } + } + return m, err +} + +func (cs *clientStream) Trailer() metadata.MD { + return cs.s.Trailer() +} + +func (cs *clientStream) SendMsg(m interface{}) (err error) { + if cs.tracing { + cs.mu.Lock() + if cs.trInfo.tr != nil { + cs.trInfo.tr.LazyLog(&payload{sent: true, msg: m}, true) + } + cs.mu.Unlock() + } + // TODO Investigate how to signal the stats handling party. + // generate error stats if err != nil && err != io.EOF? + defer func() { + if err != nil { + cs.finish(err) + } + if err == nil { + return + } + if err == io.EOF { + // Specialize the process for server streaming. SendMsg is only called + // once when creating the stream object. io.EOF needs to be skipped when + // the rpc is early finished (before the stream object is created.). + // TODO: It is probably better to move this into the generated code. + if !cs.desc.ClientStreams && cs.desc.ServerStreams { + err = nil + } + return + } + if _, ok := err.(transport.ConnectionError); !ok { + cs.closeTransportStream(err) + } + err = toRPCErr(err) + }() + var outPayload *stats.OutPayload + if cs.statsHandler != nil { + outPayload = &stats.OutPayload{ + Client: true, + } + } + hdr, data, err := encode(cs.codec, m, cs.cp, outPayload, cs.comp) + if err != nil { + return err + } + if cs.c.maxSendMessageSize == nil { + return Errorf(codes.Internal, "callInfo maxSendMessageSize field uninitialized(nil)") + } + if len(data) > *cs.c.maxSendMessageSize { + return Errorf(codes.ResourceExhausted, "trying to send message larger than max (%d vs. %d)", len(data), *cs.c.maxSendMessageSize) + } + err = cs.t.Write(cs.s, hdr, data, &transport.Options{Last: false}) + if err == nil && outPayload != nil { + outPayload.SentTime = time.Now() + cs.statsHandler.HandleRPC(cs.statsCtx, outPayload) + } + return err +} + +func (cs *clientStream) RecvMsg(m interface{}) (err error) { + var inPayload *stats.InPayload + if cs.statsHandler != nil { + inPayload = &stats.InPayload{ + Client: true, + } + } + if cs.c.maxReceiveMessageSize == nil { + return Errorf(codes.Internal, "callInfo maxReceiveMessageSize field uninitialized(nil)") + } + if !cs.decompSet { + // Block until we receive headers containing received message encoding. + if ct := cs.s.RecvCompress(); ct != "" && ct != encoding.Identity { + if cs.dc == nil || cs.dc.Type() != ct { + // No configured decompressor, or it does not match the incoming + // message encoding; attempt to find a registered compressor that does. + cs.dc = nil + cs.decomp = encoding.GetCompressor(ct) + } + } else { + // No compression is used; disable our decompressor. + cs.dc = nil + } + // Only initialize this state once per stream. + cs.decompSet = true + } + err = recv(cs.p, cs.codec, cs.s, cs.dc, m, *cs.c.maxReceiveMessageSize, inPayload, cs.decomp) + defer func() { + // err != nil indicates the termination of the stream. + if err != nil { + cs.finish(err) + } + }() + if err == nil { + if cs.tracing { + cs.mu.Lock() + if cs.trInfo.tr != nil { + cs.trInfo.tr.LazyLog(&payload{sent: false, msg: m}, true) + } + cs.mu.Unlock() + } + if inPayload != nil { + cs.statsHandler.HandleRPC(cs.statsCtx, inPayload) + } + if !cs.desc.ClientStreams || cs.desc.ServerStreams { + return + } + // Special handling for client streaming rpc. + // This recv expects EOF or errors, so we don't collect inPayload. + if cs.c.maxReceiveMessageSize == nil { + return Errorf(codes.Internal, "callInfo maxReceiveMessageSize field uninitialized(nil)") + } + err = recv(cs.p, cs.codec, cs.s, cs.dc, m, *cs.c.maxReceiveMessageSize, nil, cs.decomp) + cs.closeTransportStream(err) + if err == nil { + return toRPCErr(errors.New("grpc: client streaming protocol violation: get , want ")) + } + if err == io.EOF { + if se := cs.s.Status().Err(); se != nil { + return se + } + cs.finish(err) + return nil + } + return toRPCErr(err) + } + if _, ok := err.(transport.ConnectionError); !ok { + cs.closeTransportStream(err) + } + if err == io.EOF { + if statusErr := cs.s.Status().Err(); statusErr != nil { + return statusErr + } + // Returns io.EOF to indicate the end of the stream. + return + } + return toRPCErr(err) +} + +func (cs *clientStream) CloseSend() (err error) { + err = cs.t.Write(cs.s, nil, nil, &transport.Options{Last: true}) + defer func() { + if err != nil { + cs.finish(err) + } + }() + if err == nil || err == io.EOF { + return nil + } + if _, ok := err.(transport.ConnectionError); !ok { + cs.closeTransportStream(err) + } + err = toRPCErr(err) + return +} + +func (cs *clientStream) closeTransportStream(err error) { + cs.mu.Lock() + if cs.closed { + cs.mu.Unlock() + return + } + cs.closed = true + cs.mu.Unlock() + cs.t.CloseStream(cs.s, err) +} + +func (cs *clientStream) finish(err error) { + cs.mu.Lock() + defer cs.mu.Unlock() + if cs.finished { + return + } + cs.finished = true + defer func() { + if cs.cancel != nil { + cs.cancel() + } + }() + for _, o := range cs.opts { + o.after(cs.c) + } + if cs.done != nil { + updateRPCInfoInContext(cs.s.Context(), rpcInfo{ + bytesSent: true, + bytesReceived: cs.s.BytesReceived(), + }) + cs.done(balancer.DoneInfo{Err: err}) + cs.done = nil + } + if cs.statsHandler != nil { + end := &stats.End{ + Client: true, + EndTime: time.Now(), + } + if err != io.EOF { + // end.Error is nil if the RPC finished successfully. + end.Error = toRPCErr(err) + } + cs.statsHandler.HandleRPC(cs.statsCtx, end) + } + if !cs.tracing { + return + } + if cs.trInfo.tr != nil { + if err == nil || err == io.EOF { + cs.trInfo.tr.LazyPrintf("RPC: [OK]") + } else { + cs.trInfo.tr.LazyPrintf("RPC: [%v]", err) + cs.trInfo.tr.SetError() + } + cs.trInfo.tr.Finish() + cs.trInfo.tr = nil + } +} + +// ServerStream defines the interface a server stream has to satisfy. +type ServerStream interface { + // SetHeader sets the header metadata. It may be called multiple times. + // When call multiple times, all the provided metadata will be merged. + // All the metadata will be sent out when one of the following happens: + // - ServerStream.SendHeader() is called; + // - The first response is sent out; + // - An RPC status is sent out (error or success). + SetHeader(metadata.MD) error + // SendHeader sends the header metadata. + // The provided md and headers set by SetHeader() will be sent. + // It fails if called multiple times. + SendHeader(metadata.MD) error + // SetTrailer sets the trailer metadata which will be sent with the RPC status. + // When called more than once, all the provided metadata will be merged. + SetTrailer(metadata.MD) + Stream +} + +// serverStream implements a server side Stream. +type serverStream struct { + t transport.ServerTransport + s *transport.Stream + p *parser + codec Codec + + cp Compressor + dc Decompressor + comp encoding.Compressor + decomp encoding.Compressor + + maxReceiveMessageSize int + maxSendMessageSize int + trInfo *traceInfo + + statsHandler stats.Handler + + mu sync.Mutex // protects trInfo.tr after the service handler runs. +} + +func (ss *serverStream) Context() context.Context { + return ss.s.Context() +} + +func (ss *serverStream) SetHeader(md metadata.MD) error { + if md.Len() == 0 { + return nil + } + return ss.s.SetHeader(md) +} + +func (ss *serverStream) SendHeader(md metadata.MD) error { + return ss.t.WriteHeader(ss.s, md) +} + +func (ss *serverStream) SetTrailer(md metadata.MD) { + if md.Len() == 0 { + return + } + ss.s.SetTrailer(md) + return +} + +func (ss *serverStream) SendMsg(m interface{}) (err error) { + defer func() { + if ss.trInfo != nil { + ss.mu.Lock() + if ss.trInfo.tr != nil { + if err == nil { + ss.trInfo.tr.LazyLog(&payload{sent: true, msg: m}, true) + } else { + ss.trInfo.tr.LazyLog(&fmtStringer{"%v", []interface{}{err}}, true) + ss.trInfo.tr.SetError() + } + } + ss.mu.Unlock() + } + if err != nil && err != io.EOF { + st, _ := status.FromError(toRPCErr(err)) + ss.t.WriteStatus(ss.s, st) + } + }() + var outPayload *stats.OutPayload + if ss.statsHandler != nil { + outPayload = &stats.OutPayload{} + } + hdr, data, err := encode(ss.codec, m, ss.cp, outPayload, ss.comp) + if err != nil { + return err + } + if len(data) > ss.maxSendMessageSize { + return Errorf(codes.ResourceExhausted, "trying to send message larger than max (%d vs. %d)", len(data), ss.maxSendMessageSize) + } + if err := ss.t.Write(ss.s, hdr, data, &transport.Options{Last: false}); err != nil { + return toRPCErr(err) + } + if outPayload != nil { + outPayload.SentTime = time.Now() + ss.statsHandler.HandleRPC(ss.s.Context(), outPayload) + } + return nil +} + +func (ss *serverStream) RecvMsg(m interface{}) (err error) { + defer func() { + if ss.trInfo != nil { + ss.mu.Lock() + if ss.trInfo.tr != nil { + if err == nil { + ss.trInfo.tr.LazyLog(&payload{sent: false, msg: m}, true) + } else if err != io.EOF { + ss.trInfo.tr.LazyLog(&fmtStringer{"%v", []interface{}{err}}, true) + ss.trInfo.tr.SetError() + } + } + ss.mu.Unlock() + } + if err != nil && err != io.EOF { + st, _ := status.FromError(toRPCErr(err)) + ss.t.WriteStatus(ss.s, st) + } + }() + var inPayload *stats.InPayload + if ss.statsHandler != nil { + inPayload = &stats.InPayload{} + } + if err := recv(ss.p, ss.codec, ss.s, ss.dc, m, ss.maxReceiveMessageSize, inPayload, ss.decomp); err != nil { + if err == io.EOF { + return err + } + if err == io.ErrUnexpectedEOF { + err = Errorf(codes.Internal, io.ErrUnexpectedEOF.Error()) + } + return toRPCErr(err) + } + if inPayload != nil { + ss.statsHandler.HandleRPC(ss.s.Context(), inPayload) + } + return nil +} + +// MethodFromServerStream returns the method string for the input stream. +// The returned string is in the format of "/service/method". +func MethodFromServerStream(stream ServerStream) (string, bool) { + s, ok := transport.StreamFromContext(stream.Context()) + if !ok { + return "", ok + } + return s.Method(), ok +} diff --git a/vendor/google.golang.org/grpc/stress/client/main.go b/vendor/google.golang.org/grpc/stress/client/main.go new file mode 100644 index 0000000000..6e7e733c80 --- /dev/null +++ b/vendor/google.golang.org/grpc/stress/client/main.go @@ -0,0 +1,337 @@ +/* + * + * Copyright 2016 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. + * + */ + +//go:generate protoc -I ../grpc_testing --go_out=plugins=grpc:../grpc_testing ../grpc_testing/metrics.proto + +// client starts an interop client to do stress test and a metrics server to report qps. +package main + +import ( + "flag" + "fmt" + "math/rand" + "net" + "strconv" + "strings" + "sync" + "time" + + "golang.org/x/net/context" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/interop" + testpb "google.golang.org/grpc/interop/grpc_testing" + "google.golang.org/grpc/status" + metricspb "google.golang.org/grpc/stress/grpc_testing" + "google.golang.org/grpc/testdata" +) + +var ( + serverAddresses = flag.String("server_addresses", "localhost:8080", "a list of server addresses") + testCases = flag.String("test_cases", "", "a list of test cases along with the relative weights") + testDurationSecs = flag.Int("test_duration_secs", -1, "test duration in seconds") + numChannelsPerServer = flag.Int("num_channels_per_server", 1, "Number of channels (i.e connections) to each server") + numStubsPerChannel = flag.Int("num_stubs_per_channel", 1, "Number of client stubs per each connection to server") + metricsPort = flag.Int("metrics_port", 8081, "The port at which the stress client exposes QPS metrics") + useTLS = flag.Bool("use_tls", false, "Connection uses TLS if true, else plain TCP") + testCA = flag.Bool("use_test_ca", false, "Whether to replace platform root CAs with test CA as the CA root") + tlsServerName = flag.String("server_host_override", "foo.test.google.fr", "The server name use to verify the hostname returned by TLS handshake if it is not empty. Otherwise, --server_host is used.") + caFile = flag.String("ca_file", "", "The file containning the CA root cert file") +) + +// testCaseWithWeight contains the test case type and its weight. +type testCaseWithWeight struct { + name string + weight int +} + +// parseTestCases converts test case string to a list of struct testCaseWithWeight. +func parseTestCases(testCaseString string) []testCaseWithWeight { + testCaseStrings := strings.Split(testCaseString, ",") + testCases := make([]testCaseWithWeight, len(testCaseStrings)) + for i, str := range testCaseStrings { + testCase := strings.Split(str, ":") + if len(testCase) != 2 { + panic(fmt.Sprintf("invalid test case with weight: %s", str)) + } + // Check if test case is supported. + switch testCase[0] { + case + "empty_unary", + "large_unary", + "client_streaming", + "server_streaming", + "ping_pong", + "empty_stream", + "timeout_on_sleeping_server", + "cancel_after_begin", + "cancel_after_first_response", + "status_code_and_message", + "custom_metadata": + default: + panic(fmt.Sprintf("unknown test type: %s", testCase[0])) + } + testCases[i].name = testCase[0] + w, err := strconv.Atoi(testCase[1]) + if err != nil { + panic(fmt.Sprintf("%v", err)) + } + testCases[i].weight = w + } + return testCases +} + +// weightedRandomTestSelector defines a weighted random selector for test case types. +type weightedRandomTestSelector struct { + tests []testCaseWithWeight + totalWeight int +} + +// newWeightedRandomTestSelector constructs a weightedRandomTestSelector with the given list of testCaseWithWeight. +func newWeightedRandomTestSelector(tests []testCaseWithWeight) *weightedRandomTestSelector { + var totalWeight int + for _, t := range tests { + totalWeight += t.weight + } + rand.Seed(time.Now().UnixNano()) + return &weightedRandomTestSelector{tests, totalWeight} +} + +func (selector weightedRandomTestSelector) getNextTest() string { + random := rand.Intn(selector.totalWeight) + var weightSofar int + for _, test := range selector.tests { + weightSofar += test.weight + if random < weightSofar { + return test.name + } + } + panic("no test case selected by weightedRandomTestSelector") +} + +// gauge stores the qps of one interop client (one stub). +type gauge struct { + mutex sync.RWMutex + val int64 +} + +func (g *gauge) set(v int64) { + g.mutex.Lock() + defer g.mutex.Unlock() + g.val = v +} + +func (g *gauge) get() int64 { + g.mutex.RLock() + defer g.mutex.RUnlock() + return g.val +} + +// server implements metrics server functions. +type server struct { + mutex sync.RWMutex + // gauges is a map from /stress_test/server_/channel_/stub_/qps to its qps gauge. + gauges map[string]*gauge +} + +// newMetricsServer returns a new metrics server. +func newMetricsServer() *server { + return &server{gauges: make(map[string]*gauge)} +} + +// GetAllGauges returns all gauges. +func (s *server) GetAllGauges(in *metricspb.EmptyMessage, stream metricspb.MetricsService_GetAllGaugesServer) error { + s.mutex.RLock() + defer s.mutex.RUnlock() + + for name, gauge := range s.gauges { + if err := stream.Send(&metricspb.GaugeResponse{Name: name, Value: &metricspb.GaugeResponse_LongValue{LongValue: gauge.get()}}); err != nil { + return err + } + } + return nil +} + +// GetGauge returns the gauge for the given name. +func (s *server) GetGauge(ctx context.Context, in *metricspb.GaugeRequest) (*metricspb.GaugeResponse, error) { + s.mutex.RLock() + defer s.mutex.RUnlock() + + if g, ok := s.gauges[in.Name]; ok { + return &metricspb.GaugeResponse{Name: in.Name, Value: &metricspb.GaugeResponse_LongValue{LongValue: g.get()}}, nil + } + return nil, status.Errorf(codes.InvalidArgument, "gauge with name %s not found", in.Name) +} + +// createGauge creates a gauge using the given name in metrics server. +func (s *server) createGauge(name string) *gauge { + s.mutex.Lock() + defer s.mutex.Unlock() + + if _, ok := s.gauges[name]; ok { + // gauge already exists. + panic(fmt.Sprintf("gauge %s already exists", name)) + } + var g gauge + s.gauges[name] = &g + return &g +} + +func startServer(server *server, port int) { + lis, err := net.Listen("tcp", ":"+strconv.Itoa(port)) + if err != nil { + grpclog.Fatalf("failed to listen: %v", err) + } + + s := grpc.NewServer() + metricspb.RegisterMetricsServiceServer(s, server) + s.Serve(lis) + +} + +// performRPCs uses weightedRandomTestSelector to select test case and runs the tests. +func performRPCs(gauge *gauge, conn *grpc.ClientConn, selector *weightedRandomTestSelector, stop <-chan bool) { + client := testpb.NewTestServiceClient(conn) + var numCalls int64 + startTime := time.Now() + for { + test := selector.getNextTest() + switch test { + case "empty_unary": + interop.DoEmptyUnaryCall(client, grpc.FailFast(false)) + case "large_unary": + interop.DoLargeUnaryCall(client, grpc.FailFast(false)) + case "client_streaming": + interop.DoClientStreaming(client, grpc.FailFast(false)) + case "server_streaming": + interop.DoServerStreaming(client, grpc.FailFast(false)) + case "ping_pong": + interop.DoPingPong(client, grpc.FailFast(false)) + case "empty_stream": + interop.DoEmptyStream(client, grpc.FailFast(false)) + case "timeout_on_sleeping_server": + interop.DoTimeoutOnSleepingServer(client, grpc.FailFast(false)) + case "cancel_after_begin": + interop.DoCancelAfterBegin(client, grpc.FailFast(false)) + case "cancel_after_first_response": + interop.DoCancelAfterFirstResponse(client, grpc.FailFast(false)) + case "status_code_and_message": + interop.DoStatusCodeAndMessage(client, grpc.FailFast(false)) + case "custom_metadata": + interop.DoCustomMetadata(client, grpc.FailFast(false)) + } + numCalls++ + gauge.set(int64(float64(numCalls) / time.Since(startTime).Seconds())) + + select { + case <-stop: + return + default: + } + } +} + +func logParameterInfo(addresses []string, tests []testCaseWithWeight) { + grpclog.Printf("server_addresses: %s", *serverAddresses) + grpclog.Printf("test_cases: %s", *testCases) + grpclog.Printf("test_duration_secs: %d", *testDurationSecs) + grpclog.Printf("num_channels_per_server: %d", *numChannelsPerServer) + grpclog.Printf("num_stubs_per_channel: %d", *numStubsPerChannel) + grpclog.Printf("metrics_port: %d", *metricsPort) + grpclog.Printf("use_tls: %t", *useTLS) + grpclog.Printf("use_test_ca: %t", *testCA) + grpclog.Printf("server_host_override: %s", *tlsServerName) + + grpclog.Println("addresses:") + for i, addr := range addresses { + grpclog.Printf("%d. %s\n", i+1, addr) + } + grpclog.Println("tests:") + for i, test := range tests { + grpclog.Printf("%d. %v\n", i+1, test) + } +} + +func newConn(address string, useTLS, testCA bool, tlsServerName string) (*grpc.ClientConn, error) { + var opts []grpc.DialOption + if useTLS { + var sn string + if tlsServerName != "" { + sn = tlsServerName + } + var creds credentials.TransportCredentials + if testCA { + var err error + if *caFile == "" { + *caFile = testdata.Path("ca.pem") + } + creds, err = credentials.NewClientTLSFromFile(*caFile, sn) + if err != nil { + grpclog.Fatalf("Failed to create TLS credentials %v", err) + } + } else { + creds = credentials.NewClientTLSFromCert(nil, sn) + } + opts = append(opts, grpc.WithTransportCredentials(creds)) + } else { + opts = append(opts, grpc.WithInsecure()) + } + return grpc.Dial(address, opts...) +} + +func main() { + flag.Parse() + addresses := strings.Split(*serverAddresses, ",") + tests := parseTestCases(*testCases) + logParameterInfo(addresses, tests) + testSelector := newWeightedRandomTestSelector(tests) + metricsServer := newMetricsServer() + + var wg sync.WaitGroup + wg.Add(len(addresses) * *numChannelsPerServer * *numStubsPerChannel) + stop := make(chan bool) + + for serverIndex, address := range addresses { + for connIndex := 0; connIndex < *numChannelsPerServer; connIndex++ { + conn, err := newConn(address, *useTLS, *testCA, *tlsServerName) + if err != nil { + grpclog.Fatalf("Fail to dial: %v", err) + } + defer conn.Close() + for clientIndex := 0; clientIndex < *numStubsPerChannel; clientIndex++ { + name := fmt.Sprintf("/stress_test/server_%d/channel_%d/stub_%d/qps", serverIndex+1, connIndex+1, clientIndex+1) + go func() { + defer wg.Done() + g := metricsServer.createGauge(name) + performRPCs(g, conn, testSelector, stop) + }() + } + + } + } + go startServer(metricsServer, *metricsPort) + if *testDurationSecs > 0 { + time.Sleep(time.Duration(*testDurationSecs) * time.Second) + close(stop) + } + wg.Wait() + grpclog.Printf(" ===== ALL DONE ===== ") + +} diff --git a/vendor/google.golang.org/grpc/stress/grpc_testing/metrics.pb.go b/vendor/google.golang.org/grpc/stress/grpc_testing/metrics.pb.go new file mode 100644 index 0000000000..466668a4df --- /dev/null +++ b/vendor/google.golang.org/grpc/stress/grpc_testing/metrics.pb.go @@ -0,0 +1,374 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: metrics.proto + +/* +Package grpc_testing is a generated protocol buffer package. + +It is generated from these files: + metrics.proto + +It has these top-level messages: + GaugeResponse + GaugeRequest + EmptyMessage +*/ +package grpc_testing + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Response message containing the gauge name and value +type GaugeResponse struct { + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Types that are valid to be assigned to Value: + // *GaugeResponse_LongValue + // *GaugeResponse_DoubleValue + // *GaugeResponse_StringValue + Value isGaugeResponse_Value `protobuf_oneof:"value"` +} + +func (m *GaugeResponse) Reset() { *m = GaugeResponse{} } +func (m *GaugeResponse) String() string { return proto.CompactTextString(m) } +func (*GaugeResponse) ProtoMessage() {} +func (*GaugeResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +type isGaugeResponse_Value interface { + isGaugeResponse_Value() +} + +type GaugeResponse_LongValue struct { + LongValue int64 `protobuf:"varint,2,opt,name=long_value,json=longValue,oneof"` +} +type GaugeResponse_DoubleValue struct { + DoubleValue float64 `protobuf:"fixed64,3,opt,name=double_value,json=doubleValue,oneof"` +} +type GaugeResponse_StringValue struct { + StringValue string `protobuf:"bytes,4,opt,name=string_value,json=stringValue,oneof"` +} + +func (*GaugeResponse_LongValue) isGaugeResponse_Value() {} +func (*GaugeResponse_DoubleValue) isGaugeResponse_Value() {} +func (*GaugeResponse_StringValue) isGaugeResponse_Value() {} + +func (m *GaugeResponse) GetValue() isGaugeResponse_Value { + if m != nil { + return m.Value + } + return nil +} + +func (m *GaugeResponse) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *GaugeResponse) GetLongValue() int64 { + if x, ok := m.GetValue().(*GaugeResponse_LongValue); ok { + return x.LongValue + } + return 0 +} + +func (m *GaugeResponse) GetDoubleValue() float64 { + if x, ok := m.GetValue().(*GaugeResponse_DoubleValue); ok { + return x.DoubleValue + } + return 0 +} + +func (m *GaugeResponse) GetStringValue() string { + if x, ok := m.GetValue().(*GaugeResponse_StringValue); ok { + return x.StringValue + } + return "" +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*GaugeResponse) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _GaugeResponse_OneofMarshaler, _GaugeResponse_OneofUnmarshaler, _GaugeResponse_OneofSizer, []interface{}{ + (*GaugeResponse_LongValue)(nil), + (*GaugeResponse_DoubleValue)(nil), + (*GaugeResponse_StringValue)(nil), + } +} + +func _GaugeResponse_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*GaugeResponse) + // value + switch x := m.Value.(type) { + case *GaugeResponse_LongValue: + b.EncodeVarint(2<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.LongValue)) + case *GaugeResponse_DoubleValue: + b.EncodeVarint(3<<3 | proto.WireFixed64) + b.EncodeFixed64(math.Float64bits(x.DoubleValue)) + case *GaugeResponse_StringValue: + b.EncodeVarint(4<<3 | proto.WireBytes) + b.EncodeStringBytes(x.StringValue) + case nil: + default: + return fmt.Errorf("GaugeResponse.Value has unexpected type %T", x) + } + return nil +} + +func _GaugeResponse_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*GaugeResponse) + switch tag { + case 2: // value.long_value + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Value = &GaugeResponse_LongValue{int64(x)} + return true, err + case 3: // value.double_value + if wire != proto.WireFixed64 { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeFixed64() + m.Value = &GaugeResponse_DoubleValue{math.Float64frombits(x)} + return true, err + case 4: // value.string_value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Value = &GaugeResponse_StringValue{x} + return true, err + default: + return false, nil + } +} + +func _GaugeResponse_OneofSizer(msg proto.Message) (n int) { + m := msg.(*GaugeResponse) + // value + switch x := m.Value.(type) { + case *GaugeResponse_LongValue: + n += proto.SizeVarint(2<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.LongValue)) + case *GaugeResponse_DoubleValue: + n += proto.SizeVarint(3<<3 | proto.WireFixed64) + n += 8 + case *GaugeResponse_StringValue: + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.StringValue))) + n += len(x.StringValue) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Request message containing the gauge name +type GaugeRequest struct { + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` +} + +func (m *GaugeRequest) Reset() { *m = GaugeRequest{} } +func (m *GaugeRequest) String() string { return proto.CompactTextString(m) } +func (*GaugeRequest) ProtoMessage() {} +func (*GaugeRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *GaugeRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +type EmptyMessage struct { +} + +func (m *EmptyMessage) Reset() { *m = EmptyMessage{} } +func (m *EmptyMessage) String() string { return proto.CompactTextString(m) } +func (*EmptyMessage) ProtoMessage() {} +func (*EmptyMessage) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func init() { + proto.RegisterType((*GaugeResponse)(nil), "grpc.testing.GaugeResponse") + proto.RegisterType((*GaugeRequest)(nil), "grpc.testing.GaugeRequest") + proto.RegisterType((*EmptyMessage)(nil), "grpc.testing.EmptyMessage") +} + +// 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 + +// Client API for MetricsService service + +type MetricsServiceClient interface { + // Returns the values of all the gauges that are currently being maintained by + // the service + GetAllGauges(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (MetricsService_GetAllGaugesClient, error) + // Returns the value of one gauge + GetGauge(ctx context.Context, in *GaugeRequest, opts ...grpc.CallOption) (*GaugeResponse, error) +} + +type metricsServiceClient struct { + cc *grpc.ClientConn +} + +func NewMetricsServiceClient(cc *grpc.ClientConn) MetricsServiceClient { + return &metricsServiceClient{cc} +} + +func (c *metricsServiceClient) GetAllGauges(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (MetricsService_GetAllGaugesClient, error) { + stream, err := grpc.NewClientStream(ctx, &_MetricsService_serviceDesc.Streams[0], c.cc, "/grpc.testing.MetricsService/GetAllGauges", opts...) + if err != nil { + return nil, err + } + x := &metricsServiceGetAllGaugesClient{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 MetricsService_GetAllGaugesClient interface { + Recv() (*GaugeResponse, error) + grpc.ClientStream +} + +type metricsServiceGetAllGaugesClient struct { + grpc.ClientStream +} + +func (x *metricsServiceGetAllGaugesClient) Recv() (*GaugeResponse, error) { + m := new(GaugeResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *metricsServiceClient) GetGauge(ctx context.Context, in *GaugeRequest, opts ...grpc.CallOption) (*GaugeResponse, error) { + out := new(GaugeResponse) + err := grpc.Invoke(ctx, "/grpc.testing.MetricsService/GetGauge", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for MetricsService service + +type MetricsServiceServer interface { + // Returns the values of all the gauges that are currently being maintained by + // the service + GetAllGauges(*EmptyMessage, MetricsService_GetAllGaugesServer) error + // Returns the value of one gauge + GetGauge(context.Context, *GaugeRequest) (*GaugeResponse, error) +} + +func RegisterMetricsServiceServer(s *grpc.Server, srv MetricsServiceServer) { + s.RegisterService(&_MetricsService_serviceDesc, srv) +} + +func _MetricsService_GetAllGauges_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(EmptyMessage) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(MetricsServiceServer).GetAllGauges(m, &metricsServiceGetAllGaugesServer{stream}) +} + +type MetricsService_GetAllGaugesServer interface { + Send(*GaugeResponse) error + grpc.ServerStream +} + +type metricsServiceGetAllGaugesServer struct { + grpc.ServerStream +} + +func (x *metricsServiceGetAllGaugesServer) Send(m *GaugeResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _MetricsService_GetGauge_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GaugeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetricsServiceServer).GetGauge(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.testing.MetricsService/GetGauge", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetricsServiceServer).GetGauge(ctx, req.(*GaugeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _MetricsService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "grpc.testing.MetricsService", + HandlerType: (*MetricsServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetGauge", + Handler: _MetricsService_GetGauge_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "GetAllGauges", + Handler: _MetricsService_GetAllGauges_Handler, + ServerStreams: true, + }, + }, + Metadata: "metrics.proto", +} + +func init() { proto.RegisterFile("metrics.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 256 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x91, 0x3f, 0x4f, 0xc3, 0x30, + 0x10, 0xc5, 0x6b, 0x5a, 0xfe, 0xf4, 0x70, 0x3b, 0x78, 0xaa, 0xca, 0x40, 0x14, 0x96, 0x4c, 0x11, + 0x82, 0x4f, 0x00, 0x08, 0xa5, 0x0c, 0x5d, 0x82, 0xc4, 0x8a, 0xd2, 0x70, 0xb2, 0x22, 0x39, 0x71, + 0xf0, 0x5d, 0x2a, 0xf1, 0x49, 0x58, 0xf9, 0xa8, 0xc8, 0x4e, 0x55, 0xa5, 0x08, 0x75, 0xb3, 0x7e, + 0xf7, 0xfc, 0xfc, 0x9e, 0x0f, 0x66, 0x35, 0xb2, 0xab, 0x4a, 0x4a, 0x5b, 0x67, 0xd9, 0x2a, 0xa9, + 0x5d, 0x5b, 0xa6, 0x8c, 0xc4, 0x55, 0xa3, 0xe3, 0x6f, 0x01, 0xb3, 0xac, 0xe8, 0x34, 0xe6, 0x48, + 0xad, 0x6d, 0x08, 0x95, 0x82, 0x49, 0x53, 0xd4, 0xb8, 0x10, 0x91, 0x48, 0xa6, 0x79, 0x38, 0xab, + 0x6b, 0x00, 0x63, 0x1b, 0xfd, 0xbe, 0x2d, 0x4c, 0x87, 0x8b, 0x93, 0x48, 0x24, 0xe3, 0xd5, 0x28, + 0x9f, 0x7a, 0xf6, 0xe6, 0x91, 0xba, 0x01, 0xf9, 0x61, 0xbb, 0x8d, 0xc1, 0x9d, 0x64, 0x1c, 0x89, + 0x44, 0xac, 0x46, 0xf9, 0x65, 0x4f, 0xf7, 0x22, 0x62, 0x57, 0xed, 0x7d, 0x26, 0xfe, 0x05, 0x2f, + 0xea, 0x69, 0x10, 0x3d, 0x9e, 0xc3, 0x69, 0x98, 0xc6, 0x31, 0xc8, 0x5d, 0xb0, 0xcf, 0x0e, 0x89, + 0xff, 0xcb, 0x15, 0xcf, 0x41, 0x3e, 0xd7, 0x2d, 0x7f, 0xad, 0x91, 0xa8, 0xd0, 0x78, 0xf7, 0x23, + 0x60, 0xbe, 0xee, 0xdb, 0xbe, 0xa2, 0xdb, 0x56, 0x25, 0xaa, 0x17, 0x90, 0x19, 0xf2, 0x83, 0x31, + 0xc1, 0x8c, 0xd4, 0x32, 0x1d, 0xf6, 0x4f, 0x87, 0xd7, 0x97, 0x57, 0x87, 0xb3, 0x83, 0x7f, 0xb9, + 0x15, 0xea, 0x09, 0x2e, 0x32, 0xe4, 0x40, 0xff, 0xda, 0x0c, 0x93, 0x1e, 0xb5, 0xd9, 0x9c, 0x85, + 0x2d, 0xdc, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x5e, 0x7d, 0xb2, 0xc9, 0x96, 0x01, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/grpc/stress/grpc_testing/metrics.proto b/vendor/google.golang.org/grpc/stress/grpc_testing/metrics.proto new file mode 100644 index 0000000000..6950400643 --- /dev/null +++ b/vendor/google.golang.org/grpc/stress/grpc_testing/metrics.proto @@ -0,0 +1,49 @@ +// Copyright 2015-2016 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. + +// Contains the definitions for a metrics service and the type of metrics +// exposed by the service. +// +// Currently, 'Gauge' (i.e a metric that represents the measured value of +// something at an instant of time) is the only metric type supported by the +// service. +syntax = "proto3"; + +package grpc.testing; + +// Response message containing the gauge name and value +message GaugeResponse { + string name = 1; + oneof value { + int64 long_value = 2; + double double_value = 3; + string string_value = 4; + } +} + +// Request message containing the gauge name +message GaugeRequest { + string name = 1; +} + +message EmptyMessage {} + +service MetricsService { + // Returns the values of all the gauges that are currently being maintained by + // the service + rpc GetAllGauges(EmptyMessage) returns (stream GaugeResponse); + + // Returns the value of one gauge + rpc GetGauge(GaugeRequest) returns (GaugeResponse); +} diff --git a/vendor/google.golang.org/grpc/stress/metrics_client/main.go b/vendor/google.golang.org/grpc/stress/metrics_client/main.go new file mode 100644 index 0000000000..6405ec85eb --- /dev/null +++ b/vendor/google.golang.org/grpc/stress/metrics_client/main.go @@ -0,0 +1,82 @@ +/* + * + * Copyright 2016 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. + * + */ + +package main + +import ( + "flag" + "fmt" + "io" + + "golang.org/x/net/context" + "google.golang.org/grpc" + "google.golang.org/grpc/grpclog" + metricspb "google.golang.org/grpc/stress/grpc_testing" +) + +var ( + metricsServerAddress = flag.String("metrics_server_address", "", "The metrics server addresses in the fomrat :") + totalOnly = flag.Bool("total_only", false, "If true, this prints only the total value of all gauges") +) + +func printMetrics(client metricspb.MetricsServiceClient, totalOnly bool) { + stream, err := client.GetAllGauges(context.Background(), &metricspb.EmptyMessage{}) + if err != nil { + grpclog.Fatalf("failed to call GetAllGuages: %v", err) + } + + var ( + overallQPS int64 + rpcStatus error + ) + for { + gaugeResponse, err := stream.Recv() + if err != nil { + rpcStatus = err + break + } + if _, ok := gaugeResponse.GetValue().(*metricspb.GaugeResponse_LongValue); !ok { + panic(fmt.Sprintf("gauge %s is not a long value", gaugeResponse.Name)) + } + v := gaugeResponse.GetLongValue() + if !totalOnly { + grpclog.Printf("%s: %d", gaugeResponse.Name, v) + } + overallQPS += v + } + if rpcStatus != io.EOF { + grpclog.Fatalf("failed to finish server streaming: %v", rpcStatus) + } + grpclog.Printf("overall qps: %d", overallQPS) +} + +func main() { + flag.Parse() + if *metricsServerAddress == "" { + grpclog.Fatalf("Metrics server address is empty.") + } + + conn, err := grpc.Dial(*metricsServerAddress, grpc.WithInsecure()) + if err != nil { + grpclog.Fatalf("cannot connect to metrics server: %v", err) + } + defer conn.Close() + + c := metricspb.NewMetricsServiceClient(conn) + printMetrics(c, *totalOnly) +} diff --git a/vendor/google.golang.org/grpc/tap/tap.go b/vendor/google.golang.org/grpc/tap/tap.go new file mode 100644 index 0000000000..22b8fb50de --- /dev/null +++ b/vendor/google.golang.org/grpc/tap/tap.go @@ -0,0 +1,51 @@ +/* + * + * Copyright 2016 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. + * + */ + +// Package tap defines the function handles which are executed on the transport +// layer of gRPC-Go and related information. Everything here is EXPERIMENTAL. +package tap + +import ( + "golang.org/x/net/context" +) + +// Info defines the relevant information needed by the handles. +type Info struct { + // FullMethodName is the string of grpc method (in the format of + // /package.service/method). + FullMethodName string + // TODO: More to be added. +} + +// ServerInHandle defines the function which runs before a new stream is created +// on the server side. If it returns a non-nil error, the stream will not be +// created and a RST_STREAM will be sent back to the client with REFUSED_STREAM. +// The client will receive an RPC error "code = Unavailable, desc = stream +// terminated by RST_STREAM with error code: REFUSED_STREAM". +// +// It's intended to be used in situations where you don't want to waste the +// resources to accept the new stream (e.g. rate-limiting). And the content of +// the error will be ignored and won't be sent back to the client. For other +// general usages, please use interceptors. +// +// Note that it is executed in the per-connection I/O goroutine(s) instead of +// per-RPC goroutine. Therefore, users should NOT have any +// blocking/time-consuming work in this handle. Otherwise all the RPCs would +// slow down. Also, for the same reason, this handle won't be called +// concurrently by gRPC. +type ServerInHandle func(ctx context.Context, info *Info) (context.Context, error) diff --git a/vendor/google.golang.org/grpc/test/bufconn/bufconn.go b/vendor/google.golang.org/grpc/test/bufconn/bufconn.go new file mode 100644 index 0000000000..bc0ab839fc --- /dev/null +++ b/vendor/google.golang.org/grpc/test/bufconn/bufconn.go @@ -0,0 +1,229 @@ +/* + * + * Copyright 2017 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. + * + */ + +// Package bufconn provides a net.Conn implemented by a buffer and related +// dialing and listening functionality. +package bufconn + +import ( + "fmt" + "io" + "net" + "sync" + "time" +) + +// Listener implements a net.Listener that creates local, buffered net.Conns +// via its Accept and Dial method. +type Listener struct { + mu sync.Mutex + sz int + ch chan net.Conn + done chan struct{} +} + +var errClosed = fmt.Errorf("Closed") + +// Listen returns a Listener that can only be contacted by its own Dialers and +// creates buffered connections between the two. +func Listen(sz int) *Listener { + return &Listener{sz: sz, ch: make(chan net.Conn), done: make(chan struct{})} +} + +// Accept blocks until Dial is called, then returns a net.Conn for the server +// half of the connection. +func (l *Listener) Accept() (net.Conn, error) { + select { + case <-l.done: + return nil, errClosed + case c := <-l.ch: + return c, nil + } +} + +// Close stops the listener. +func (l *Listener) Close() error { + l.mu.Lock() + defer l.mu.Unlock() + select { + case <-l.done: + // Already closed. + break + default: + close(l.done) + } + return nil +} + +// Addr reports the address of the listener. +func (l *Listener) Addr() net.Addr { return addr{} } + +// Dial creates an in-memory full-duplex network connection, unblocks Accept by +// providing it the server half of the connection, and returns the client half +// of the connection. +func (l *Listener) Dial() (net.Conn, error) { + p1, p2 := newPipe(l.sz), newPipe(l.sz) + select { + case <-l.done: + return nil, errClosed + case l.ch <- &conn{p1, p2}: + return &conn{p2, p1}, nil + } +} + +type pipe struct { + mu sync.Mutex + + // buf contains the data in the pipe. It is a ring buffer of fixed capacity, + // with r and w pointing to the offset to read and write, respsectively. + // + // Data is read between [r, w) and written to [w, r), wrapping around the end + // of the slice if necessary. + // + // The buffer is empty if r == len(buf), otherwise if r == w, it is full. + // + // w and r are always in the range [0, cap(buf)) and [0, len(buf)]. + buf []byte + w, r int + + wwait sync.Cond + rwait sync.Cond + closed bool +} + +func newPipe(sz int) *pipe { + p := &pipe{buf: make([]byte, 0, sz)} + p.wwait.L = &p.mu + p.rwait.L = &p.mu + return p +} + +func (p *pipe) empty() bool { + return p.r == len(p.buf) +} + +func (p *pipe) full() bool { + return p.r < len(p.buf) && p.r == p.w +} + +func (p *pipe) Read(b []byte) (n int, err error) { + p.mu.Lock() + defer p.mu.Unlock() + // Block until p has data. + for { + if p.closed { + return 0, io.ErrClosedPipe + } + if !p.empty() { + break + } + p.rwait.Wait() + } + wasFull := p.full() + + n = copy(b, p.buf[p.r:len(p.buf)]) + p.r += n + if p.r == cap(p.buf) { + p.r = 0 + p.buf = p.buf[:p.w] + } + + // Signal a blocked writer, if any + if wasFull { + p.wwait.Signal() + } + + return n, nil +} + +func (p *pipe) Write(b []byte) (n int, err error) { + p.mu.Lock() + defer p.mu.Unlock() + if p.closed { + return 0, io.ErrClosedPipe + } + for len(b) > 0 { + // Block until p is not full. + for { + if p.closed { + return 0, io.ErrClosedPipe + } + if !p.full() { + break + } + p.wwait.Wait() + } + wasEmpty := p.empty() + + end := cap(p.buf) + if p.w < p.r { + end = p.r + } + x := copy(p.buf[p.w:end], b) + b = b[x:] + n += x + p.w += x + if p.w > len(p.buf) { + p.buf = p.buf[:p.w] + } + if p.w == cap(p.buf) { + p.w = 0 + } + + // Signal a blocked reader, if any. + if wasEmpty { + p.rwait.Signal() + } + } + return n, nil +} + +func (p *pipe) Close() error { + p.mu.Lock() + defer p.mu.Unlock() + p.closed = true + // Signal all blocked readers and writers to return an error. + p.rwait.Broadcast() + p.wwait.Broadcast() + return nil +} + +type conn struct { + io.ReadCloser + io.WriteCloser +} + +func (c *conn) Close() error { + err1 := c.ReadCloser.Close() + err2 := c.WriteCloser.Close() + if err1 != nil { + return err1 + } + return err2 +} + +func (*conn) LocalAddr() net.Addr { return addr{} } +func (*conn) RemoteAddr() net.Addr { return addr{} } +func (c *conn) SetDeadline(t time.Time) error { return fmt.Errorf("unsupported") } +func (c *conn) SetReadDeadline(t time.Time) error { return fmt.Errorf("unsupported") } +func (c *conn) SetWriteDeadline(t time.Time) error { return fmt.Errorf("unsupported") } + +type addr struct{} + +func (addr) Network() string { return "bufconn" } +func (addr) String() string { return "bufconn" } diff --git a/vendor/google.golang.org/grpc/test/bufconn/bufconn_test.go b/vendor/google.golang.org/grpc/test/bufconn/bufconn_test.go new file mode 100644 index 0000000000..0f7bc22279 --- /dev/null +++ b/vendor/google.golang.org/grpc/test/bufconn/bufconn_test.go @@ -0,0 +1,149 @@ +/* + * + * Copyright 2017 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. + * + */ + +package bufconn + +import ( + "fmt" + "io" + "net" + "reflect" + "testing" + "time" +) + +func testRW(r io.Reader, w io.Writer) error { + for i := 0; i < 20; i++ { + d := make([]byte, i) + for j := 0; j < i; j++ { + d[j] = byte(i - j) + } + var rn int + var rerr error + b := make([]byte, i) + done := make(chan struct{}) + go func() { + for rn < len(b) && rerr == nil { + var x int + x, rerr = r.Read(b[rn:]) + rn += x + } + close(done) + }() + wn, werr := w.Write(d) + if wn != i || werr != nil { + return fmt.Errorf("%v: w.Write(%v) = %v, %v; want %v, nil", i, d, wn, werr, i) + } + select { + case <-done: + case <-time.After(500 * time.Millisecond): + return fmt.Errorf("%v: r.Read never returned", i) + } + if rn != i || rerr != nil { + return fmt.Errorf("%v: r.Read = %v, %v; want %v, nil", i, rn, rerr, i) + } + if !reflect.DeepEqual(b, d) { + return fmt.Errorf("%v: r.Read read %v; want %v", i, b, d) + } + } + return nil +} + +func TestPipe(t *testing.T) { + p := newPipe(10) + if err := testRW(p, p); err != nil { + t.Fatalf(err.Error()) + } +} + +func TestPipeClose(t *testing.T) { + p := newPipe(10) + p.Close() + if _, err := p.Write(nil); err != io.ErrClosedPipe { + t.Fatalf("p.Write = _, %v; want _, %v", err, io.ErrClosedPipe) + } + if _, err := p.Read(nil); err != io.ErrClosedPipe { + t.Fatalf("p.Read = _, %v; want _, %v", err, io.ErrClosedPipe) + } +} + +func TestConn(t *testing.T) { + p1, p2 := newPipe(10), newPipe(10) + c1, c2 := &conn{p1, p2}, &conn{p2, p1} + + if err := testRW(c1, c2); err != nil { + t.Fatalf(err.Error()) + } + if err := testRW(c2, c1); err != nil { + t.Fatalf(err.Error()) + } +} + +func TestListener(t *testing.T) { + l := Listen(7) + var s net.Conn + var serr error + done := make(chan struct{}) + go func() { + s, serr = l.Accept() + close(done) + }() + c, cerr := l.Dial() + <-done + if cerr != nil || serr != nil { + t.Fatalf("cerr = %v, serr = %v; want nil, nil", cerr, serr) + } + if err := testRW(c, s); err != nil { + t.Fatalf(err.Error()) + } + if err := testRW(s, c); err != nil { + t.Fatalf(err.Error()) + } +} + +func TestCloseWhileDialing(t *testing.T) { + l := Listen(7) + var c net.Conn + var err error + done := make(chan struct{}) + go func() { + c, err = l.Dial() + close(done) + }() + l.Close() + <-done + if c != nil || err != errClosed { + t.Fatalf("c, err = %v, %v; want nil, %v", c, err, errClosed) + } +} + +func TestCloseWhileAccepting(t *testing.T) { + l := Listen(7) + var c net.Conn + var err error + done := make(chan struct{}) + go func() { + c, err = l.Accept() + close(done) + }() + l.Close() + <-done + if c != nil || err != errClosed { + t.Fatalf("c, err = %v, %v; want nil, %v", c, err, errClosed) + } +} diff --git a/vendor/google.golang.org/grpc/test/codec_perf/perf.pb.go b/vendor/google.golang.org/grpc/test/codec_perf/perf.pb.go new file mode 100644 index 0000000000..fb6fc5d992 --- /dev/null +++ b/vendor/google.golang.org/grpc/test/codec_perf/perf.pb.go @@ -0,0 +1,62 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: codec_perf/perf.proto + +/* +Package codec_perf is a generated protocol buffer package. + +It is generated from these files: + codec_perf/perf.proto + +It has these top-level messages: + Buffer +*/ +package codec_perf + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// Buffer is a message that contains a body of bytes that is used to exercise +// encoding and decoding overheads. +type Buffer struct { + Body []byte `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` +} + +func (m *Buffer) Reset() { *m = Buffer{} } +func (m *Buffer) String() string { return proto.CompactTextString(m) } +func (*Buffer) ProtoMessage() {} +func (*Buffer) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *Buffer) GetBody() []byte { + if m != nil { + return m.Body + } + return nil +} + +func init() { + proto.RegisterType((*Buffer)(nil), "codec.perf.Buffer") +} + +func init() { proto.RegisterFile("codec_perf/perf.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 83 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4d, 0xce, 0x4f, 0x49, + 0x4d, 0x8e, 0x2f, 0x48, 0x2d, 0x4a, 0xd3, 0x07, 0x11, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, + 0x5c, 0x60, 0x61, 0x3d, 0x90, 0x88, 0x92, 0x0c, 0x17, 0x9b, 0x53, 0x69, 0x5a, 0x5a, 0x6a, 0x91, + 0x90, 0x10, 0x17, 0x4b, 0x52, 0x7e, 0x4a, 0xa5, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0x4f, 0x10, 0x98, + 0x9d, 0xc4, 0x06, 0xd6, 0x60, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xa3, 0x5f, 0x4f, 0x3c, 0x49, + 0x00, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/grpc/test/codec_perf/perf.proto b/vendor/google.golang.org/grpc/test/codec_perf/perf.proto new file mode 100644 index 0000000000..594c6f011f --- /dev/null +++ b/vendor/google.golang.org/grpc/test/codec_perf/perf.proto @@ -0,0 +1,25 @@ +// Copyright 2017 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. + +// Messages used for performance tests that may not reference grpc directly for +// reasons of import cycles. +syntax = "proto3"; + +package codec.perf; + +// Buffer is a message that contains a body of bytes that is used to exercise +// encoding and decoding overheads. +message Buffer { + bytes body = 1; +} diff --git a/vendor/google.golang.org/grpc/test/end2end_test.go b/vendor/google.golang.org/grpc/test/end2end_test.go new file mode 100644 index 0000000000..8b0d1ac13e --- /dev/null +++ b/vendor/google.golang.org/grpc/test/end2end_test.go @@ -0,0 +1,5775 @@ +/* + * + * Copyright 2014 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. + * + */ + +//go:generate protoc --go_out=plugins=grpc:. codec_perf/perf.proto +//go:generate protoc --go_out=plugins=grpc:. grpc_testing/test.proto + +package test + +import ( + "bytes" + "crypto/tls" + "errors" + "flag" + "fmt" + "io" + "math" + "net" + "os" + "reflect" + "runtime" + "strings" + "sync" + "sync/atomic" + "syscall" + "testing" + "time" + + "github.com/golang/protobuf/proto" + anypb "github.com/golang/protobuf/ptypes/any" + "golang.org/x/net/context" + "golang.org/x/net/http2" + spb "google.golang.org/genproto/googleapis/rpc/status" + "google.golang.org/grpc" + "google.golang.org/grpc/balancer" + _ "google.golang.org/grpc/balancer/roundrobin" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/connectivity" + "google.golang.org/grpc/credentials" + _ "google.golang.org/grpc/encoding/gzip" + _ "google.golang.org/grpc/grpclog/glogger" + "google.golang.org/grpc/health" + healthpb "google.golang.org/grpc/health/grpc_health_v1" + "google.golang.org/grpc/internal" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/peer" + "google.golang.org/grpc/resolver" + "google.golang.org/grpc/resolver/manual" + _ "google.golang.org/grpc/resolver/passthrough" + "google.golang.org/grpc/stats" + "google.golang.org/grpc/status" + "google.golang.org/grpc/tap" + testpb "google.golang.org/grpc/test/grpc_testing" + "google.golang.org/grpc/test/leakcheck" + "google.golang.org/grpc/testdata" +) + +var ( + // For headers: + testMetadata = metadata.MD{ + "key1": []string{"value1"}, + "key2": []string{"value2"}, + "key3-bin": []string{"binvalue1", string([]byte{1, 2, 3})}, + } + testMetadata2 = metadata.MD{ + "key1": []string{"value12"}, + "key2": []string{"value22"}, + } + // For trailers: + testTrailerMetadata = metadata.MD{ + "tkey1": []string{"trailerValue1"}, + "tkey2": []string{"trailerValue2"}, + "tkey3-bin": []string{"trailerbinvalue1", string([]byte{3, 2, 1})}, + } + testTrailerMetadata2 = metadata.MD{ + "tkey1": []string{"trailerValue12"}, + "tkey2": []string{"trailerValue22"}, + } + // capital "Key" is illegal in HTTP/2. + malformedHTTP2Metadata = metadata.MD{ + "Key": []string{"foo"}, + } + testAppUA = "myApp1/1.0 myApp2/0.9" + failAppUA = "fail-this-RPC" + detailedError = status.ErrorProto(&spb.Status{ + Code: int32(codes.DataLoss), + Message: "error for testing: " + failAppUA, + Details: []*anypb.Any{{ + TypeUrl: "url", + Value: []byte{6, 0, 0, 6, 1, 3}, + }}, + }) +) + +var raceMode bool // set by race.go in race mode + +type testServer struct { + security string // indicate the authentication protocol used by this server. + earlyFail bool // whether to error out the execution of a service handler prematurely. + setAndSendHeader bool // whether to call setHeader and sendHeader. + setHeaderOnly bool // whether to only call setHeader, not sendHeader. + multipleSetTrailer bool // whether to call setTrailer multiple times. + unaryCallSleepTime time.Duration +} + +func (s *testServer) EmptyCall(ctx context.Context, in *testpb.Empty) (*testpb.Empty, error) { + if md, ok := metadata.FromIncomingContext(ctx); ok { + // For testing purpose, returns an error if user-agent is failAppUA. + // To test that client gets the correct error. + if ua, ok := md["user-agent"]; !ok || strings.HasPrefix(ua[0], failAppUA) { + return nil, detailedError + } + var str []string + for _, entry := range md["user-agent"] { + str = append(str, "ua", entry) + } + grpc.SendHeader(ctx, metadata.Pairs(str...)) + } + return new(testpb.Empty), nil +} + +func newPayload(t testpb.PayloadType, size int32) (*testpb.Payload, error) { + if size < 0 { + return nil, fmt.Errorf("Requested a response with invalid length %d", size) + } + body := make([]byte, size) + switch t { + case testpb.PayloadType_COMPRESSABLE: + case testpb.PayloadType_UNCOMPRESSABLE: + return nil, fmt.Errorf("PayloadType UNCOMPRESSABLE is not supported") + default: + return nil, fmt.Errorf("Unsupported payload type: %d", t) + } + return &testpb.Payload{ + Type: t, + Body: body, + }, nil +} + +func (s *testServer) UnaryCall(ctx context.Context, in *testpb.SimpleRequest) (*testpb.SimpleResponse, error) { + md, ok := metadata.FromIncomingContext(ctx) + if ok { + if _, exists := md[":authority"]; !exists { + return nil, status.Errorf(codes.DataLoss, "expected an :authority metadata: %v", md) + } + if s.setAndSendHeader { + if err := grpc.SetHeader(ctx, md); err != nil { + return nil, status.Errorf(grpc.Code(err), "grpc.SetHeader(_, %v) = %v, want ", md, err) + } + if err := grpc.SendHeader(ctx, testMetadata2); err != nil { + return nil, status.Errorf(grpc.Code(err), "grpc.SendHeader(_, %v) = %v, want ", testMetadata2, err) + } + } else if s.setHeaderOnly { + if err := grpc.SetHeader(ctx, md); err != nil { + return nil, status.Errorf(grpc.Code(err), "grpc.SetHeader(_, %v) = %v, want ", md, err) + } + if err := grpc.SetHeader(ctx, testMetadata2); err != nil { + return nil, status.Errorf(grpc.Code(err), "grpc.SetHeader(_, %v) = %v, want ", testMetadata2, err) + } + } else { + if err := grpc.SendHeader(ctx, md); err != nil { + return nil, status.Errorf(grpc.Code(err), "grpc.SendHeader(_, %v) = %v, want ", md, err) + } + } + if err := grpc.SetTrailer(ctx, testTrailerMetadata); err != nil { + return nil, status.Errorf(grpc.Code(err), "grpc.SetTrailer(_, %v) = %v, want ", testTrailerMetadata, err) + } + if s.multipleSetTrailer { + if err := grpc.SetTrailer(ctx, testTrailerMetadata2); err != nil { + return nil, status.Errorf(grpc.Code(err), "grpc.SetTrailer(_, %v) = %v, want ", testTrailerMetadata2, err) + } + } + } + pr, ok := peer.FromContext(ctx) + if !ok { + return nil, status.Error(codes.DataLoss, "failed to get peer from ctx") + } + if pr.Addr == net.Addr(nil) { + return nil, status.Error(codes.DataLoss, "failed to get peer address") + } + if s.security != "" { + // Check Auth info + var authType, serverName string + switch info := pr.AuthInfo.(type) { + case credentials.TLSInfo: + authType = info.AuthType() + serverName = info.State.ServerName + default: + return nil, status.Error(codes.Unauthenticated, "Unknown AuthInfo type") + } + if authType != s.security { + return nil, status.Errorf(codes.Unauthenticated, "Wrong auth type: got %q, want %q", authType, s.security) + } + if serverName != "x.test.youtube.com" { + return nil, status.Errorf(codes.Unauthenticated, "Unknown server name %q", serverName) + } + } + // Simulate some service delay. + time.Sleep(s.unaryCallSleepTime) + + payload, err := newPayload(in.GetResponseType(), in.GetResponseSize()) + if err != nil { + return nil, err + } + + return &testpb.SimpleResponse{ + Payload: payload, + }, nil +} + +func (s *testServer) StreamingOutputCall(args *testpb.StreamingOutputCallRequest, stream testpb.TestService_StreamingOutputCallServer) error { + if md, ok := metadata.FromIncomingContext(stream.Context()); ok { + if _, exists := md[":authority"]; !exists { + return status.Errorf(codes.DataLoss, "expected an :authority metadata: %v", md) + } + // For testing purpose, returns an error if user-agent is failAppUA. + // To test that client gets the correct error. + if ua, ok := md["user-agent"]; !ok || strings.HasPrefix(ua[0], failAppUA) { + return status.Error(codes.DataLoss, "error for testing: "+failAppUA) + } + } + cs := args.GetResponseParameters() + for _, c := range cs { + if us := c.GetIntervalUs(); us > 0 { + time.Sleep(time.Duration(us) * time.Microsecond) + } + + payload, err := newPayload(args.GetResponseType(), c.GetSize()) + if err != nil { + return err + } + + if err := stream.Send(&testpb.StreamingOutputCallResponse{ + Payload: payload, + }); err != nil { + return err + } + } + return nil +} + +func (s *testServer) StreamingInputCall(stream testpb.TestService_StreamingInputCallServer) error { + var sum int + for { + in, err := stream.Recv() + if err == io.EOF { + return stream.SendAndClose(&testpb.StreamingInputCallResponse{ + AggregatedPayloadSize: int32(sum), + }) + } + if err != nil { + return err + } + p := in.GetPayload().GetBody() + sum += len(p) + if s.earlyFail { + return status.Error(codes.NotFound, "not found") + } + } +} + +func (s *testServer) FullDuplexCall(stream testpb.TestService_FullDuplexCallServer) error { + md, ok := metadata.FromIncomingContext(stream.Context()) + if ok { + if s.setAndSendHeader { + if err := stream.SetHeader(md); err != nil { + return status.Errorf(grpc.Code(err), "%v.SetHeader(_, %v) = %v, want ", stream, md, err) + } + if err := stream.SendHeader(testMetadata2); err != nil { + return status.Errorf(grpc.Code(err), "%v.SendHeader(_, %v) = %v, want ", stream, testMetadata2, err) + } + } else if s.setHeaderOnly { + if err := stream.SetHeader(md); err != nil { + return status.Errorf(grpc.Code(err), "%v.SetHeader(_, %v) = %v, want ", stream, md, err) + } + if err := stream.SetHeader(testMetadata2); err != nil { + return status.Errorf(grpc.Code(err), "%v.SetHeader(_, %v) = %v, want ", stream, testMetadata2, err) + } + } else { + if err := stream.SendHeader(md); err != nil { + return status.Errorf(grpc.Code(err), "%v.SendHeader(%v) = %v, want %v", stream, md, err, nil) + } + } + stream.SetTrailer(testTrailerMetadata) + if s.multipleSetTrailer { + stream.SetTrailer(testTrailerMetadata2) + } + } + for { + in, err := stream.Recv() + if err == io.EOF { + // read done. + return nil + } + if err != nil { + // to facilitate testSvrWriteStatusEarlyWrite + if grpc.Code(err) == codes.ResourceExhausted { + return status.Errorf(codes.Internal, "fake error for test testSvrWriteStatusEarlyWrite. true error: %s", err.Error()) + } + return err + } + cs := in.GetResponseParameters() + for _, c := range cs { + if us := c.GetIntervalUs(); us > 0 { + time.Sleep(time.Duration(us) * time.Microsecond) + } + + payload, err := newPayload(in.GetResponseType(), c.GetSize()) + if err != nil { + return err + } + + if err := stream.Send(&testpb.StreamingOutputCallResponse{ + Payload: payload, + }); err != nil { + // to facilitate testSvrWriteStatusEarlyWrite + if grpc.Code(err) == codes.ResourceExhausted { + return status.Errorf(codes.Internal, "fake error for test testSvrWriteStatusEarlyWrite. true error: %s", err.Error()) + } + return err + } + } + } +} + +func (s *testServer) HalfDuplexCall(stream testpb.TestService_HalfDuplexCallServer) error { + var msgBuf []*testpb.StreamingOutputCallRequest + for { + in, err := stream.Recv() + if err == io.EOF { + // read done. + break + } + if err != nil { + return err + } + msgBuf = append(msgBuf, in) + } + for _, m := range msgBuf { + cs := m.GetResponseParameters() + for _, c := range cs { + if us := c.GetIntervalUs(); us > 0 { + time.Sleep(time.Duration(us) * time.Microsecond) + } + + payload, err := newPayload(m.GetResponseType(), c.GetSize()) + if err != nil { + return err + } + + if err := stream.Send(&testpb.StreamingOutputCallResponse{ + Payload: payload, + }); err != nil { + return err + } + } + } + return nil +} + +type env struct { + name string + network string // The type of network such as tcp, unix, etc. + security string // The security protocol such as TLS, SSH, etc. + httpHandler bool // whether to use the http.Handler ServerTransport; requires TLS + balancer string // One of "round_robin", "pick_first", "v1", or "". + customDialer func(string, string, time.Duration) (net.Conn, error) +} + +func (e env) runnable() bool { + if runtime.GOOS == "windows" && e.network == "unix" { + return false + } + return true +} + +func (e env) dialer(addr string, timeout time.Duration) (net.Conn, error) { + if e.customDialer != nil { + return e.customDialer(e.network, addr, timeout) + } + return net.DialTimeout(e.network, addr, timeout) +} + +var ( + tcpClearEnv = env{name: "tcp-clear-v1-balancer", network: "tcp", balancer: "v1"} + tcpTLSEnv = env{name: "tcp-tls-v1-balancer", network: "tcp", security: "tls", balancer: "v1"} + tcpClearRREnv = env{name: "tcp-clear", network: "tcp", balancer: "round_robin"} + tcpTLSRREnv = env{name: "tcp-tls", network: "tcp", security: "tls", balancer: "round_robin"} + handlerEnv = env{name: "handler-tls", network: "tcp", security: "tls", httpHandler: true, balancer: "round_robin"} + noBalancerEnv = env{name: "no-balancer", network: "tcp", security: "tls"} + allEnv = []env{tcpClearEnv, tcpTLSEnv, tcpClearRREnv, tcpTLSRREnv, handlerEnv, noBalancerEnv} +) + +var onlyEnv = flag.String("only_env", "", "If non-empty, one of 'tcp-clear', 'tcp-tls', 'unix-clear', 'unix-tls', or 'handler-tls' to only run the tests for that environment. Empty means all.") + +func listTestEnv() (envs []env) { + if *onlyEnv != "" { + for _, e := range allEnv { + if e.name == *onlyEnv { + if !e.runnable() { + panic(fmt.Sprintf("--only_env environment %q does not run on %s", *onlyEnv, runtime.GOOS)) + } + return []env{e} + } + } + panic(fmt.Sprintf("invalid --only_env value %q", *onlyEnv)) + } + for _, e := range allEnv { + if e.runnable() { + envs = append(envs, e) + } + } + return envs +} + +// test is an end-to-end test. It should be created with the newTest +// func, modified as needed, and then started with its startServer method. +// It should be cleaned up with the tearDown method. +type test struct { + t *testing.T + e env + + ctx context.Context // valid for life of test, before tearDown + cancel context.CancelFunc + + // Configurable knobs, after newTest returns: + testServer testpb.TestServiceServer // nil means none + healthServer *health.Server // nil means disabled + maxStream uint32 + tapHandle tap.ServerInHandle + maxMsgSize *int + maxClientReceiveMsgSize *int + maxClientSendMsgSize *int + maxServerReceiveMsgSize *int + maxServerSendMsgSize *int + userAgent string + // clientCompression and serverCompression are set to test the deprecated API + // WithCompressor and WithDecompressor. + clientCompression bool + serverCompression bool + // clientUseCompression is set to test the new compressor registration API UseCompressor. + clientUseCompression bool + // clientNopCompression is set to create a compressor whose type is not supported. + clientNopCompression bool + unaryClientInt grpc.UnaryClientInterceptor + streamClientInt grpc.StreamClientInterceptor + unaryServerInt grpc.UnaryServerInterceptor + streamServerInt grpc.StreamServerInterceptor + unknownHandler grpc.StreamHandler + sc <-chan grpc.ServiceConfig + customCodec grpc.Codec + serverInitialWindowSize int32 + serverInitialConnWindowSize int32 + clientInitialWindowSize int32 + clientInitialConnWindowSize int32 + perRPCCreds credentials.PerRPCCredentials + resolverScheme string + + // All test dialing is blocking by default. Set this to true if dial + // should be non-blocking. + nonBlockingDial bool + + // srv and srvAddr are set once startServer is called. + srv *grpc.Server + srvAddr string + + cc *grpc.ClientConn // nil until requested via clientConn + restoreLogs func() // nil unless declareLogNoise is used +} + +func (te *test) tearDown() { + if te.cancel != nil { + te.cancel() + te.cancel = nil + } + if te.cc != nil { + te.cc.Close() + te.cc = nil + } + if te.restoreLogs != nil { + te.restoreLogs() + te.restoreLogs = nil + } + if te.srv != nil { + te.srv.Stop() + } +} + +// newTest returns a new test using the provided testing.T and +// environment. It is returned with default values. Tests should +// modify it before calling its startServer and clientConn methods. +func newTest(t *testing.T, e env) *test { + te := &test{ + t: t, + e: e, + maxStream: math.MaxUint32, + } + te.ctx, te.cancel = context.WithCancel(context.Background()) + return te +} + +// startServer starts a gRPC server listening. Callers should defer a +// call to te.tearDown to clean up. +func (te *test) startServer(ts testpb.TestServiceServer) { + te.testServer = ts + te.t.Logf("Running test in %s environment...", te.e.name) + sopts := []grpc.ServerOption{grpc.MaxConcurrentStreams(te.maxStream)} + if te.maxMsgSize != nil { + sopts = append(sopts, grpc.MaxMsgSize(*te.maxMsgSize)) + } + if te.maxServerReceiveMsgSize != nil { + sopts = append(sopts, grpc.MaxRecvMsgSize(*te.maxServerReceiveMsgSize)) + } + if te.maxServerSendMsgSize != nil { + sopts = append(sopts, grpc.MaxSendMsgSize(*te.maxServerSendMsgSize)) + } + if te.tapHandle != nil { + sopts = append(sopts, grpc.InTapHandle(te.tapHandle)) + } + if te.serverCompression { + sopts = append(sopts, + grpc.RPCCompressor(grpc.NewGZIPCompressor()), + grpc.RPCDecompressor(grpc.NewGZIPDecompressor()), + ) + } + if te.unaryServerInt != nil { + sopts = append(sopts, grpc.UnaryInterceptor(te.unaryServerInt)) + } + if te.streamServerInt != nil { + sopts = append(sopts, grpc.StreamInterceptor(te.streamServerInt)) + } + if te.unknownHandler != nil { + sopts = append(sopts, grpc.UnknownServiceHandler(te.unknownHandler)) + } + if te.serverInitialWindowSize > 0 { + sopts = append(sopts, grpc.InitialWindowSize(te.serverInitialWindowSize)) + } + if te.serverInitialConnWindowSize > 0 { + sopts = append(sopts, grpc.InitialConnWindowSize(te.serverInitialConnWindowSize)) + } + la := "localhost:0" + switch te.e.network { + case "unix": + la = "/tmp/testsock" + fmt.Sprintf("%d", time.Now().UnixNano()) + syscall.Unlink(la) + } + lis, err := net.Listen(te.e.network, la) + if err != nil { + te.t.Fatalf("Failed to listen: %v", err) + } + switch te.e.security { + case "tls": + creds, err := credentials.NewServerTLSFromFile(testdata.Path("server1.pem"), testdata.Path("server1.key")) + if err != nil { + te.t.Fatalf("Failed to generate credentials %v", err) + } + sopts = append(sopts, grpc.Creds(creds)) + case "clientTimeoutCreds": + sopts = append(sopts, grpc.Creds(&clientTimeoutCreds{})) + } + if te.customCodec != nil { + sopts = append(sopts, grpc.CustomCodec(te.customCodec)) + } + s := grpc.NewServer(sopts...) + te.srv = s + if te.e.httpHandler { + internal.TestingUseHandlerImpl(s) + } + if te.healthServer != nil { + healthpb.RegisterHealthServer(s, te.healthServer) + } + if te.testServer != nil { + testpb.RegisterTestServiceServer(s, te.testServer) + } + addr := la + switch te.e.network { + case "unix": + default: + _, port, err := net.SplitHostPort(lis.Addr().String()) + if err != nil { + te.t.Fatalf("Failed to parse listener address: %v", err) + } + addr = "localhost:" + port + } + + go s.Serve(lis) + te.srvAddr = addr +} + +type nopCompressor struct { + grpc.Compressor +} + +// NewNopCompressor creates a compressor to test the case that type is not supported. +func NewNopCompressor() grpc.Compressor { + return &nopCompressor{grpc.NewGZIPCompressor()} +} + +func (c *nopCompressor) Type() string { + return "nop" +} + +type nopDecompressor struct { + grpc.Decompressor +} + +// NewNopDecompressor creates a decompressor to test the case that type is not supported. +func NewNopDecompressor() grpc.Decompressor { + return &nopDecompressor{grpc.NewGZIPDecompressor()} +} + +func (d *nopDecompressor) Type() string { + return "nop" +} + +func (te *test) clientConn() *grpc.ClientConn { + if te.cc != nil { + return te.cc + } + opts := []grpc.DialOption{ + grpc.WithDialer(te.e.dialer), + grpc.WithUserAgent(te.userAgent), + } + + if te.sc != nil { + opts = append(opts, grpc.WithServiceConfig(te.sc)) + } + + if te.clientCompression { + opts = append(opts, + grpc.WithCompressor(grpc.NewGZIPCompressor()), + grpc.WithDecompressor(grpc.NewGZIPDecompressor()), + ) + } + if te.clientUseCompression { + opts = append(opts, grpc.WithDefaultCallOptions(grpc.UseCompressor("gzip"))) + } + if te.clientNopCompression { + opts = append(opts, + grpc.WithCompressor(NewNopCompressor()), + grpc.WithDecompressor(NewNopDecompressor()), + ) + } + if te.unaryClientInt != nil { + opts = append(opts, grpc.WithUnaryInterceptor(te.unaryClientInt)) + } + if te.streamClientInt != nil { + opts = append(opts, grpc.WithStreamInterceptor(te.streamClientInt)) + } + if te.maxMsgSize != nil { + opts = append(opts, grpc.WithMaxMsgSize(*te.maxMsgSize)) + } + if te.maxClientReceiveMsgSize != nil { + opts = append(opts, grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(*te.maxClientReceiveMsgSize))) + } + if te.maxClientSendMsgSize != nil { + opts = append(opts, grpc.WithDefaultCallOptions(grpc.MaxCallSendMsgSize(*te.maxClientSendMsgSize))) + } + switch te.e.security { + case "tls": + creds, err := credentials.NewClientTLSFromFile(testdata.Path("ca.pem"), "x.test.youtube.com") + if err != nil { + te.t.Fatalf("Failed to load credentials: %v", err) + } + opts = append(opts, grpc.WithTransportCredentials(creds)) + case "clientTimeoutCreds": + opts = append(opts, grpc.WithTransportCredentials(&clientTimeoutCreds{})) + default: + opts = append(opts, grpc.WithInsecure()) + } + // TODO(bar) switch balancer case "pick_first". + var scheme string + if te.resolverScheme == "" { + scheme = "passthrough:///" + } else { + scheme = te.resolverScheme + ":///" + } + switch te.e.balancer { + case "v1": + opts = append(opts, grpc.WithBalancer(grpc.RoundRobin(nil))) + case "round_robin": + rr := balancer.Get("round_robin") + if rr == nil { + te.t.Fatalf("got nil when trying to get roundrobin balancer builder") + } + opts = append(opts, grpc.WithBalancerBuilder(rr)) + } + if te.clientInitialWindowSize > 0 { + opts = append(opts, grpc.WithInitialWindowSize(te.clientInitialWindowSize)) + } + if te.clientInitialConnWindowSize > 0 { + opts = append(opts, grpc.WithInitialConnWindowSize(te.clientInitialConnWindowSize)) + } + if te.perRPCCreds != nil { + opts = append(opts, grpc.WithPerRPCCredentials(te.perRPCCreds)) + } + if te.customCodec != nil { + opts = append(opts, grpc.WithCodec(te.customCodec)) + } + if !te.nonBlockingDial && te.srvAddr != "" { + // Only do a blocking dial if server is up. + opts = append(opts, grpc.WithBlock()) + } + if te.srvAddr == "" { + te.srvAddr = "client.side.only.test" + } + var err error + te.cc, err = grpc.Dial(scheme+te.srvAddr, opts...) + if err != nil { + te.t.Fatalf("Dial(%q) = %v", scheme+te.srvAddr, err) + } + return te.cc +} + +func (te *test) declareLogNoise(phrases ...string) { + te.restoreLogs = declareLogNoise(te.t, phrases...) +} + +func (te *test) withServerTester(fn func(st *serverTester)) { + c, err := te.e.dialer(te.srvAddr, 10*time.Second) + if err != nil { + te.t.Fatal(err) + } + defer c.Close() + if te.e.security == "tls" { + c = tls.Client(c, &tls.Config{ + InsecureSkipVerify: true, + NextProtos: []string{http2.NextProtoTLS}, + }) + } + st := newServerTesterFromConn(te.t, c) + st.greet() + fn(st) +} + +type lazyConn struct { + net.Conn + beLazy int32 +} + +func (l *lazyConn) Write(b []byte) (int, error) { + if atomic.LoadInt32(&(l.beLazy)) == 1 { + // The sleep duration here needs to less than the leakCheck deadline. + time.Sleep(time.Second) + } + return l.Conn.Write(b) +} + +func TestContextDeadlineNotIgnored(t *testing.T) { + defer leakcheck.Check(t) + e := noBalancerEnv + var lc *lazyConn + e.customDialer = func(network, addr string, timeout time.Duration) (net.Conn, error) { + conn, err := net.DialTimeout(network, addr, timeout) + if err != nil { + return nil, err + } + lc = &lazyConn{Conn: conn} + return lc, nil + } + + te := newTest(t, e) + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + + cc := te.clientConn() + tc := testpb.NewTestServiceClient(cc) + if _, err := tc.EmptyCall(context.Background(), &testpb.Empty{}); err != nil { + t.Fatalf("TestService/EmptyCall(_, _) = _, %v, want _, ", err) + } + atomic.StoreInt32(&(lc.beLazy), 1) + ctx, cancel := context.WithTimeout(context.Background(), 50*time.Millisecond) + defer cancel() + t1 := time.Now() + if _, err := tc.EmptyCall(ctx, &testpb.Empty{}); grpc.Code(err) != codes.DeadlineExceeded { + t.Fatalf("TestService/EmptyCall(_, _) = _, %v, want _, context.DeadlineExceeded", err) + } + if time.Since(t1) > 2*time.Second { + t.Fatalf("TestService/EmptyCall(_, _) ran over the deadline") + } +} + +func TestTimeoutOnDeadServer(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testTimeoutOnDeadServer(t, e) + } +} + +func testTimeoutOnDeadServer(t *testing.T, e env) { + te := newTest(t, e) + te.userAgent = testAppUA + te.declareLogNoise( + "transport: http2Client.notifyError got notified that the client transport was broken EOF", + "grpc: addrConn.transportMonitor exits due to: grpc: the connection is closing", + "grpc: addrConn.resetTransport failed to create client transport: connection error", + ) + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + + cc := te.clientConn() + tc := testpb.NewTestServiceClient(cc) + if _, err := tc.EmptyCall(context.Background(), &testpb.Empty{}, grpc.FailFast(false)); err != nil { + t.Fatalf("TestService/EmptyCall(_, _) = _, %v, want _, ", err) + } + te.srv.Stop() + + // Wait for the client to notice the connection is gone. + ctx, cancel := context.WithTimeout(context.Background(), 500*time.Millisecond) + state := cc.GetState() + for ; state == connectivity.Ready && cc.WaitForStateChange(ctx, state); state = cc.GetState() { + } + cancel() + if state == connectivity.Ready { + t.Fatalf("Timed out waiting for non-ready state") + } + ctx, cancel = context.WithTimeout(context.Background(), time.Millisecond) + _, err := tc.EmptyCall(ctx, &testpb.Empty{}, grpc.FailFast(false)) + cancel() + if e.balancer != "" && grpc.Code(err) != codes.DeadlineExceeded { + // If e.balancer == nil, the ac will stop reconnecting because the dialer returns non-temp error, + // the error will be an internal error. + t.Fatalf("TestService/EmptyCall(%v, _) = _, %v, want _, error code: %s", ctx, err, codes.DeadlineExceeded) + } + awaitNewConnLogOutput() +} + +func TestServerGracefulStopIdempotent(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + if e.name == "handler-tls" { + continue + } + testServerGracefulStopIdempotent(t, e) + } +} + +func testServerGracefulStopIdempotent(t *testing.T, e env) { + te := newTest(t, e) + te.userAgent = testAppUA + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + + for i := 0; i < 3; i++ { + te.srv.GracefulStop() + } +} + +func TestServerGoAway(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + if e.name == "handler-tls" { + continue + } + testServerGoAway(t, e) + } +} + +func testServerGoAway(t *testing.T, e env) { + te := newTest(t, e) + te.userAgent = testAppUA + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + + cc := te.clientConn() + tc := testpb.NewTestServiceClient(cc) + // Finish an RPC to make sure the connection is good. + if _, err := tc.EmptyCall(context.Background(), &testpb.Empty{}, grpc.FailFast(false)); err != nil { + t.Fatalf("TestService/EmptyCall(_, _) = _, %v, want _, ", err) + } + ch := make(chan struct{}) + go func() { + te.srv.GracefulStop() + close(ch) + }() + // Loop until the server side GoAway signal is propagated to the client. + for { + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Millisecond) + if _, err := tc.EmptyCall(ctx, &testpb.Empty{}); err != nil && grpc.Code(err) != codes.DeadlineExceeded { + cancel() + break + } + cancel() + } + // A new RPC should fail. + if _, err := tc.EmptyCall(context.Background(), &testpb.Empty{}); grpc.Code(err) != codes.Unavailable && grpc.Code(err) != codes.Internal { + t.Fatalf("TestService/EmptyCall(_, _) = _, %v, want _, %s or %s", err, codes.Unavailable, codes.Internal) + } + <-ch + awaitNewConnLogOutput() +} + +func TestServerGoAwayPendingRPC(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + if e.name == "handler-tls" { + continue + } + testServerGoAwayPendingRPC(t, e) + } +} + +func testServerGoAwayPendingRPC(t *testing.T, e env) { + te := newTest(t, e) + te.userAgent = testAppUA + te.declareLogNoise( + "transport: http2Client.notifyError got notified that the client transport was broken EOF", + "grpc: addrConn.transportMonitor exits due to: grpc: the connection is closing", + "grpc: addrConn.resetTransport failed to create client transport: connection error", + ) + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + + cc := te.clientConn() + tc := testpb.NewTestServiceClient(cc) + ctx, cancel := context.WithCancel(context.Background()) + stream, err := tc.FullDuplexCall(ctx, grpc.FailFast(false)) + if err != nil { + t.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) + } + // Finish an RPC to make sure the connection is good. + if _, err := tc.EmptyCall(context.Background(), &testpb.Empty{}, grpc.FailFast(false)); err != nil { + t.Fatalf("%v.EmptyCall(_, _, _) = _, %v, want _, ", tc, err) + } + ch := make(chan struct{}) + go func() { + te.srv.GracefulStop() + close(ch) + }() + // Loop until the server side GoAway signal is propagated to the client. + abort := false + time.AfterFunc(time.Second, func() { abort = true }) + for !abort { + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Millisecond) + if _, err := tc.EmptyCall(ctx, &testpb.Empty{}, grpc.FailFast(false)); err != nil { + cancel() + break + } + cancel() + } + // Don't bother stopping the timer; it will have no effect past here. + if abort { + t.Fatalf("GoAway never received by client") + } + respParam := []*testpb.ResponseParameters{{Size: 1}} + payload, err := newPayload(testpb.PayloadType_COMPRESSABLE, int32(100)) + if err != nil { + t.Fatal(err) + } + req := &testpb.StreamingOutputCallRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseParameters: respParam, + Payload: payload, + } + // The existing RPC should be still good to proceed. + if err := stream.Send(req); err != nil { + t.Fatalf("%v.Send(%v) = %v, want ", stream, req, err) + } + if _, err := stream.Recv(); err != nil { + t.Fatalf("%v.Recv() = _, %v, want _, ", stream, err) + } + // The RPC will run until canceled. + cancel() + <-ch + awaitNewConnLogOutput() +} + +func TestServerMultipleGoAwayPendingRPC(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + if e.name == "handler-tls" { + continue + } + testServerMultipleGoAwayPendingRPC(t, e) + } +} + +func testServerMultipleGoAwayPendingRPC(t *testing.T, e env) { + te := newTest(t, e) + te.userAgent = testAppUA + te.declareLogNoise( + "transport: http2Client.notifyError got notified that the client transport was broken EOF", + "grpc: addrConn.transportMonitor exits due to: grpc: the connection is closing", + "grpc: addrConn.resetTransport failed to create client transport: connection error", + ) + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + + cc := te.clientConn() + tc := testpb.NewTestServiceClient(cc) + ctx, cancel := context.WithCancel(context.Background()) + stream, err := tc.FullDuplexCall(ctx, grpc.FailFast(false)) + if err != nil { + t.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) + } + // Finish an RPC to make sure the connection is good. + if _, err := tc.EmptyCall(context.Background(), &testpb.Empty{}, grpc.FailFast(false)); err != nil { + t.Fatalf("%v.EmptyCall(_, _, _) = _, %v, want _, ", tc, err) + } + ch1 := make(chan struct{}) + go func() { + te.srv.GracefulStop() + close(ch1) + }() + ch2 := make(chan struct{}) + go func() { + te.srv.GracefulStop() + close(ch2) + }() + // Loop until the server side GoAway signal is propagated to the client. + for { + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Millisecond) + if _, err := tc.EmptyCall(ctx, &testpb.Empty{}, grpc.FailFast(false)); err != nil { + cancel() + break + } + cancel() + } + select { + case <-ch1: + t.Fatal("GracefulStop() terminated early") + case <-ch2: + t.Fatal("GracefulStop() terminated early") + default: + } + respParam := []*testpb.ResponseParameters{ + { + Size: 1, + }, + } + payload, err := newPayload(testpb.PayloadType_COMPRESSABLE, int32(100)) + if err != nil { + t.Fatal(err) + } + req := &testpb.StreamingOutputCallRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseParameters: respParam, + Payload: payload, + } + // The existing RPC should be still good to proceed. + if err := stream.Send(req); err != nil { + t.Fatalf("%v.Send(%v) = %v, want ", stream, req, err) + } + if _, err := stream.Recv(); err != nil { + t.Fatalf("%v.Recv() = _, %v, want _, ", stream, err) + } + if err := stream.CloseSend(); err != nil { + t.Fatalf("%v.CloseSend() = %v, want ", stream, err) + } + <-ch1 + <-ch2 + cancel() + awaitNewConnLogOutput() +} + +func TestConcurrentClientConnCloseAndServerGoAway(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + if e.name == "handler-tls" { + continue + } + testConcurrentClientConnCloseAndServerGoAway(t, e) + } +} + +func testConcurrentClientConnCloseAndServerGoAway(t *testing.T, e env) { + te := newTest(t, e) + te.userAgent = testAppUA + te.declareLogNoise( + "transport: http2Client.notifyError got notified that the client transport was broken EOF", + "grpc: addrConn.transportMonitor exits due to: grpc: the connection is closing", + "grpc: addrConn.resetTransport failed to create client transport: connection error", + ) + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + + cc := te.clientConn() + tc := testpb.NewTestServiceClient(cc) + if _, err := tc.EmptyCall(context.Background(), &testpb.Empty{}, grpc.FailFast(false)); err != nil { + t.Fatalf("%v.EmptyCall(_, _, _) = _, %v, want _, ", tc, err) + } + ch := make(chan struct{}) + // Close ClientConn and Server concurrently. + go func() { + te.srv.GracefulStop() + close(ch) + }() + go func() { + cc.Close() + }() + <-ch +} + +func TestConcurrentServerStopAndGoAway(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + if e.name == "handler-tls" { + continue + } + testConcurrentServerStopAndGoAway(t, e) + } +} + +func testConcurrentServerStopAndGoAway(t *testing.T, e env) { + te := newTest(t, e) + te.userAgent = testAppUA + te.declareLogNoise( + "transport: http2Client.notifyError got notified that the client transport was broken EOF", + "grpc: addrConn.transportMonitor exits due to: grpc: the connection is closing", + "grpc: addrConn.resetTransport failed to create client transport: connection error", + ) + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + + cc := te.clientConn() + tc := testpb.NewTestServiceClient(cc) + stream, err := tc.FullDuplexCall(context.Background(), grpc.FailFast(false)) + if err != nil { + t.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) + } + // Finish an RPC to make sure the connection is good. + if _, err := tc.EmptyCall(context.Background(), &testpb.Empty{}, grpc.FailFast(false)); err != nil { + t.Fatalf("%v.EmptyCall(_, _, _) = _, %v, want _, ", tc, err) + } + ch := make(chan struct{}) + go func() { + te.srv.GracefulStop() + close(ch) + }() + // Loop until the server side GoAway signal is propagated to the client. + for { + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Millisecond) + if _, err := tc.EmptyCall(ctx, &testpb.Empty{}, grpc.FailFast(false)); err != nil { + cancel() + break + } + cancel() + } + // Stop the server and close all the connections. + te.srv.Stop() + respParam := []*testpb.ResponseParameters{ + { + Size: 1, + }, + } + payload, err := newPayload(testpb.PayloadType_COMPRESSABLE, int32(100)) + if err != nil { + t.Fatal(err) + } + req := &testpb.StreamingOutputCallRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseParameters: respParam, + Payload: payload, + } + if err := stream.Send(req); err == nil { + if _, err := stream.Recv(); err == nil { + t.Fatalf("%v.Recv() = _, %v, want _, ", stream, err) + } + } + <-ch + awaitNewConnLogOutput() +} + +func TestClientConnCloseAfterGoAwayWithActiveStream(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + if e.name == "handler-tls" { + continue + } + testClientConnCloseAfterGoAwayWithActiveStream(t, e) + } +} + +func testClientConnCloseAfterGoAwayWithActiveStream(t *testing.T, e env) { + te := newTest(t, e) + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + cc := te.clientConn() + tc := testpb.NewTestServiceClient(cc) + + if _, err := tc.FullDuplexCall(context.Background()); err != nil { + t.Fatalf("%v.FullDuplexCall(_) = _, %v, want _, ", tc, err) + } + done := make(chan struct{}) + go func() { + te.srv.GracefulStop() + close(done) + }() + time.Sleep(50 * time.Millisecond) + cc.Close() + timeout := time.NewTimer(time.Second) + select { + case <-done: + case <-timeout.C: + t.Fatalf("Test timed-out.") + } +} + +func TestFailFast(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testFailFast(t, e) + } +} + +func testFailFast(t *testing.T, e env) { + te := newTest(t, e) + te.userAgent = testAppUA + te.declareLogNoise( + "transport: http2Client.notifyError got notified that the client transport was broken EOF", + "grpc: addrConn.transportMonitor exits due to: grpc: the connection is closing", + "grpc: addrConn.resetTransport failed to create client transport: connection error", + ) + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + + cc := te.clientConn() + tc := testpb.NewTestServiceClient(cc) + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + if _, err := tc.EmptyCall(ctx, &testpb.Empty{}); err != nil { + t.Fatalf("TestService/EmptyCall(_, _) = _, %v, want _, ", err) + } + // Stop the server and tear down all the exisiting connections. + te.srv.Stop() + // Loop until the server teardown is propagated to the client. + for { + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + _, err := tc.EmptyCall(ctx, &testpb.Empty{}) + cancel() + if grpc.Code(err) == codes.Unavailable { + break + } + t.Logf("%v.EmptyCall(_, _) = _, %v", tc, err) + time.Sleep(10 * time.Millisecond) + } + // The client keeps reconnecting and ongoing fail-fast RPCs should fail with code.Unavailable. + if _, err := tc.EmptyCall(context.Background(), &testpb.Empty{}); grpc.Code(err) != codes.Unavailable { + t.Fatalf("TestService/EmptyCall(_, _, _) = _, %v, want _, error code: %s", err, codes.Unavailable) + } + if _, err := tc.StreamingInputCall(context.Background()); grpc.Code(err) != codes.Unavailable { + t.Fatalf("TestService/StreamingInputCall(_) = _, %v, want _, error code: %s", err, codes.Unavailable) + } + + awaitNewConnLogOutput() +} + +func testServiceConfigSetup(t *testing.T, e env) *test { + te := newTest(t, e) + te.userAgent = testAppUA + te.declareLogNoise( + "transport: http2Client.notifyError got notified that the client transport was broken EOF", + "grpc: addrConn.transportMonitor exits due to: grpc: the connection is closing", + "grpc: addrConn.resetTransport failed to create client transport: connection error", + "Failed to dial : context canceled; please retry.", + ) + return te +} + +func newBool(b bool) (a *bool) { + return &b +} + +func newInt(b int) (a *int) { + return &b +} + +func newDuration(b time.Duration) (a *time.Duration) { + a = new(time.Duration) + *a = b + return +} + +func TestGetMethodConfig(t *testing.T) { + te := testServiceConfigSetup(t, tcpClearRREnv) + defer te.tearDown() + r, rcleanup := manual.GenerateAndRegisterManualResolver() + defer rcleanup() + + te.resolverScheme = r.Scheme() + cc := te.clientConn() + r.NewAddress([]resolver.Address{{Addr: te.srvAddr}}) + r.NewServiceConfig(`{ + "methodConfig": [ + { + "name": [ + { + "service": "grpc.testing.TestService", + "method": "EmptyCall" + } + ], + "waitForReady": true, + "timeout": "1ms" + }, + { + "name": [ + { + "service": "grpc.testing.TestService" + } + ], + "waitForReady": false + } + ] +}`) + + tc := testpb.NewTestServiceClient(cc) + + // Make sure service config has been processed by grpc. + for { + if cc.GetMethodConfig("/grpc.testing.TestService/EmptyCall").WaitForReady != nil { + break + } + time.Sleep(time.Millisecond) + } + + // The following RPCs are expected to become non-fail-fast ones with 1ms deadline. + var err error + if _, err = tc.EmptyCall(context.Background(), &testpb.Empty{}); grpc.Code(err) != codes.DeadlineExceeded { + t.Fatalf("TestService/EmptyCall(_, _) = _, %v, want _, %s", err, codes.DeadlineExceeded) + } + + r.NewServiceConfig(`{ + "methodConfig": [ + { + "name": [ + { + "service": "grpc.testing.TestService", + "method": "UnaryCall" + } + ], + "waitForReady": true, + "timeout": "1ms" + }, + { + "name": [ + { + "service": "grpc.testing.TestService" + } + ], + "waitForReady": false + } + ] +}`) + + // Make sure service config has been processed by grpc. + for { + if mc := cc.GetMethodConfig("/grpc.testing.TestService/EmptyCall"); mc.WaitForReady != nil && !*mc.WaitForReady { + break + } + time.Sleep(time.Millisecond) + } + // The following RPCs are expected to become fail-fast. + if _, err = tc.EmptyCall(context.Background(), &testpb.Empty{}); grpc.Code(err) != codes.Unavailable { + t.Fatalf("TestService/EmptyCall(_, _) = _, %v, want _, %s", err, codes.Unavailable) + } +} + +func TestServiceConfigWaitForReady(t *testing.T) { + te := testServiceConfigSetup(t, tcpClearRREnv) + defer te.tearDown() + r, rcleanup := manual.GenerateAndRegisterManualResolver() + defer rcleanup() + + // Case1: Client API set failfast to be false, and service config set wait_for_ready to be false, Client API should win, and the rpc will wait until deadline exceeds. + te.resolverScheme = r.Scheme() + cc := te.clientConn() + r.NewAddress([]resolver.Address{{Addr: te.srvAddr}}) + r.NewServiceConfig(`{ + "methodConfig": [ + { + "name": [ + { + "service": "grpc.testing.TestService", + "method": "EmptyCall" + }, + { + "service": "grpc.testing.TestService", + "method": "FullDuplexCall" + } + ], + "waitForReady": false, + "timeout": "1ms" + } + ] +}`) + + tc := testpb.NewTestServiceClient(cc) + + // Make sure service config has been processed by grpc. + for { + if cc.GetMethodConfig("/grpc.testing.TestService/FullDuplexCall").WaitForReady != nil { + break + } + time.Sleep(time.Millisecond) + } + + // The following RPCs are expected to become non-fail-fast ones with 1ms deadline. + var err error + if _, err = tc.EmptyCall(context.Background(), &testpb.Empty{}, grpc.FailFast(false)); grpc.Code(err) != codes.DeadlineExceeded { + t.Fatalf("TestService/EmptyCall(_, _) = _, %v, want _, %s", err, codes.DeadlineExceeded) + } + if _, err := tc.FullDuplexCall(context.Background(), grpc.FailFast(false)); grpc.Code(err) != codes.DeadlineExceeded { + t.Fatalf("TestService/FullDuplexCall(_) = _, %v, want %s", err, codes.DeadlineExceeded) + } + + // Generate a service config update. + // Case2:Client API set failfast to be false, and service config set wait_for_ready to be true, and the rpc will wait until deadline exceeds. + r.NewServiceConfig(`{ + "methodConfig": [ + { + "name": [ + { + "service": "grpc.testing.TestService", + "method": "EmptyCall" + }, + { + "service": "grpc.testing.TestService", + "method": "FullDuplexCall" + } + ], + "waitForReady": true, + "timeout": "1ms" + } + ] +}`) + + // Wait for the new service config to take effect. + for { + if mc := cc.GetMethodConfig("/grpc.testing.TestService/EmptyCall"); mc.WaitForReady != nil && *mc.WaitForReady { + break + } + time.Sleep(time.Millisecond) + } + // The following RPCs are expected to become non-fail-fast ones with 1ms deadline. + if _, err := tc.EmptyCall(context.Background(), &testpb.Empty{}); grpc.Code(err) != codes.DeadlineExceeded { + t.Fatalf("TestService/EmptyCall(_, _) = _, %v, want _, %s", err, codes.DeadlineExceeded) + } + if _, err := tc.FullDuplexCall(context.Background()); grpc.Code(err) != codes.DeadlineExceeded { + t.Fatalf("TestService/FullDuplexCall(_) = _, %v, want %s", err, codes.DeadlineExceeded) + } +} + +func TestServiceConfigTimeout(t *testing.T) { + te := testServiceConfigSetup(t, tcpClearRREnv) + defer te.tearDown() + r, rcleanup := manual.GenerateAndRegisterManualResolver() + defer rcleanup() + + // Case1: Client API sets timeout to be 1ns and ServiceConfig sets timeout to be 1hr. Timeout should be 1ns (min of 1ns and 1hr) and the rpc will wait until deadline exceeds. + te.resolverScheme = r.Scheme() + cc := te.clientConn() + r.NewAddress([]resolver.Address{{Addr: te.srvAddr}}) + r.NewServiceConfig(`{ + "methodConfig": [ + { + "name": [ + { + "service": "grpc.testing.TestService", + "method": "EmptyCall" + }, + { + "service": "grpc.testing.TestService", + "method": "FullDuplexCall" + } + ], + "waitForReady": true, + "timeout": "1h" + } + ] +}`) + + tc := testpb.NewTestServiceClient(cc) + + // Make sure service config has been processed by grpc. + for { + if cc.GetMethodConfig("/grpc.testing.TestService/FullDuplexCall").Timeout != nil { + break + } + time.Sleep(time.Millisecond) + } + + // The following RPCs are expected to become non-fail-fast ones with 1ns deadline. + var err error + ctx, cancel := context.WithTimeout(context.Background(), time.Nanosecond) + if _, err = tc.EmptyCall(ctx, &testpb.Empty{}, grpc.FailFast(false)); grpc.Code(err) != codes.DeadlineExceeded { + t.Fatalf("TestService/EmptyCall(_, _) = _, %v, want _, %s", err, codes.DeadlineExceeded) + } + cancel() + + ctx, cancel = context.WithTimeout(context.Background(), time.Nanosecond) + if _, err = tc.FullDuplexCall(ctx, grpc.FailFast(false)); grpc.Code(err) != codes.DeadlineExceeded { + t.Fatalf("TestService/FullDuplexCall(_) = _, %v, want %s", err, codes.DeadlineExceeded) + } + cancel() + + // Generate a service config update. + // Case2: Client API sets timeout to be 1hr and ServiceConfig sets timeout to be 1ns. Timeout should be 1ns (min of 1ns and 1hr) and the rpc will wait until deadline exceeds. + r.NewServiceConfig(`{ + "methodConfig": [ + { + "name": [ + { + "service": "grpc.testing.TestService", + "method": "EmptyCall" + }, + { + "service": "grpc.testing.TestService", + "method": "FullDuplexCall" + } + ], + "waitForReady": true, + "timeout": "1ns" + } + ] +}`) + + // Wait for the new service config to take effect. + for { + if mc := cc.GetMethodConfig("/grpc.testing.TestService/FullDuplexCall"); mc.Timeout != nil && *mc.Timeout == time.Nanosecond { + break + } + time.Sleep(time.Millisecond) + } + + ctx, cancel = context.WithTimeout(context.Background(), time.Hour) + if _, err = tc.EmptyCall(ctx, &testpb.Empty{}, grpc.FailFast(false)); grpc.Code(err) != codes.DeadlineExceeded { + t.Fatalf("TestService/EmptyCall(_, _) = _, %v, want _, %s", err, codes.DeadlineExceeded) + } + cancel() + + ctx, cancel = context.WithTimeout(context.Background(), time.Hour) + if _, err = tc.FullDuplexCall(ctx, grpc.FailFast(false)); grpc.Code(err) != codes.DeadlineExceeded { + t.Fatalf("TestService/FullDuplexCall(_) = _, %v, want %s", err, codes.DeadlineExceeded) + } + cancel() +} + +func TestServiceConfigMaxMsgSize(t *testing.T) { + e := tcpClearRREnv + r, rcleanup := manual.GenerateAndRegisterManualResolver() + defer rcleanup() + + // Setting up values and objects shared across all test cases. + const smallSize = 1 + const largeSize = 1024 + const extraLargeSize = 2048 + + smallPayload, err := newPayload(testpb.PayloadType_COMPRESSABLE, smallSize) + if err != nil { + t.Fatal(err) + } + largePayload, err := newPayload(testpb.PayloadType_COMPRESSABLE, largeSize) + if err != nil { + t.Fatal(err) + } + extraLargePayload, err := newPayload(testpb.PayloadType_COMPRESSABLE, extraLargeSize) + if err != nil { + t.Fatal(err) + } + + scjs := `{ + "methodConfig": [ + { + "name": [ + { + "service": "grpc.testing.TestService", + "method": "UnaryCall" + }, + { + "service": "grpc.testing.TestService", + "method": "FullDuplexCall" + } + ], + "maxRequestMessageBytes": 2048, + "maxResponseMessageBytes": 2048 + } + ] +}` + + // Case1: sc set maxReqSize to 2048 (send), maxRespSize to 2048 (recv). + te1 := testServiceConfigSetup(t, e) + defer te1.tearDown() + + te1.resolverScheme = r.Scheme() + te1.nonBlockingDial = true + te1.startServer(&testServer{security: e.security}) + cc1 := te1.clientConn() + + r.NewAddress([]resolver.Address{{Addr: te1.srvAddr}}) + r.NewServiceConfig(scjs) + tc := testpb.NewTestServiceClient(cc1) + + req := &testpb.SimpleRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseSize: int32(extraLargeSize), + Payload: smallPayload, + } + + for { + if cc1.GetMethodConfig("/grpc.testing.TestService/FullDuplexCall").MaxReqSize != nil { + break + } + time.Sleep(time.Millisecond) + } + + // Test for unary RPC recv. + if _, err = tc.UnaryCall(context.Background(), req, grpc.FailFast(false)); err == nil || grpc.Code(err) != codes.ResourceExhausted { + t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want _, error code: %s", err, codes.ResourceExhausted) + } + + // Test for unary RPC send. + req.Payload = extraLargePayload + req.ResponseSize = int32(smallSize) + if _, err := tc.UnaryCall(context.Background(), req); err == nil || grpc.Code(err) != codes.ResourceExhausted { + t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want _, error code: %s", err, codes.ResourceExhausted) + } + + // Test for streaming RPC recv. + respParam := []*testpb.ResponseParameters{ + { + Size: int32(extraLargeSize), + }, + } + sreq := &testpb.StreamingOutputCallRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseParameters: respParam, + Payload: smallPayload, + } + stream, err := tc.FullDuplexCall(te1.ctx) + if err != nil { + t.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) + } + if err = stream.Send(sreq); err != nil { + t.Fatalf("%v.Send(%v) = %v, want ", stream, sreq, err) + } + if _, err = stream.Recv(); err == nil || grpc.Code(err) != codes.ResourceExhausted { + t.Fatalf("%v.Recv() = _, %v, want _, error code: %s", stream, err, codes.ResourceExhausted) + } + + // Test for streaming RPC send. + respParam[0].Size = int32(smallSize) + sreq.Payload = extraLargePayload + stream, err = tc.FullDuplexCall(te1.ctx) + if err != nil { + t.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) + } + if err = stream.Send(sreq); err == nil || grpc.Code(err) != codes.ResourceExhausted { + t.Fatalf("%v.Send(%v) = %v, want _, error code: %s", stream, sreq, err, codes.ResourceExhausted) + } + + // Case2: Client API set maxReqSize to 1024 (send), maxRespSize to 1024 (recv). Sc sets maxReqSize to 2048 (send), maxRespSize to 2048 (recv). + te2 := testServiceConfigSetup(t, e) + te2.resolverScheme = r.Scheme() + te2.nonBlockingDial = true + te2.maxClientReceiveMsgSize = newInt(1024) + te2.maxClientSendMsgSize = newInt(1024) + + te2.startServer(&testServer{security: e.security}) + defer te2.tearDown() + cc2 := te2.clientConn() + r.NewAddress([]resolver.Address{{Addr: te2.srvAddr}}) + r.NewServiceConfig(scjs) + tc = testpb.NewTestServiceClient(cc2) + + for { + if cc2.GetMethodConfig("/grpc.testing.TestService/FullDuplexCall").MaxReqSize != nil { + break + } + time.Sleep(time.Millisecond) + } + + // Test for unary RPC recv. + req.Payload = smallPayload + req.ResponseSize = int32(largeSize) + + if _, err = tc.UnaryCall(context.Background(), req, grpc.FailFast(false)); err == nil || grpc.Code(err) != codes.ResourceExhausted { + t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want _, error code: %s", err, codes.ResourceExhausted) + } + + // Test for unary RPC send. + req.Payload = largePayload + req.ResponseSize = int32(smallSize) + if _, err := tc.UnaryCall(context.Background(), req); err == nil || grpc.Code(err) != codes.ResourceExhausted { + t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want _, error code: %s", err, codes.ResourceExhausted) + } + + // Test for streaming RPC recv. + stream, err = tc.FullDuplexCall(te2.ctx) + respParam[0].Size = int32(largeSize) + sreq.Payload = smallPayload + if err != nil { + t.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) + } + if err = stream.Send(sreq); err != nil { + t.Fatalf("%v.Send(%v) = %v, want ", stream, sreq, err) + } + if _, err = stream.Recv(); err == nil || grpc.Code(err) != codes.ResourceExhausted { + t.Fatalf("%v.Recv() = _, %v, want _, error code: %s", stream, err, codes.ResourceExhausted) + } + + // Test for streaming RPC send. + respParam[0].Size = int32(smallSize) + sreq.Payload = largePayload + stream, err = tc.FullDuplexCall(te2.ctx) + if err != nil { + t.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) + } + if err = stream.Send(sreq); err == nil || grpc.Code(err) != codes.ResourceExhausted { + t.Fatalf("%v.Send(%v) = %v, want _, error code: %s", stream, sreq, err, codes.ResourceExhausted) + } + + // Case3: Client API set maxReqSize to 4096 (send), maxRespSize to 4096 (recv). Sc sets maxReqSize to 2048 (send), maxRespSize to 2048 (recv). + te3 := testServiceConfigSetup(t, e) + te3.resolverScheme = r.Scheme() + te3.nonBlockingDial = true + te3.maxClientReceiveMsgSize = newInt(4096) + te3.maxClientSendMsgSize = newInt(4096) + + te3.startServer(&testServer{security: e.security}) + defer te3.tearDown() + + cc3 := te3.clientConn() + r.NewAddress([]resolver.Address{{Addr: te3.srvAddr}}) + r.NewServiceConfig(scjs) + tc = testpb.NewTestServiceClient(cc3) + + for { + if cc3.GetMethodConfig("/grpc.testing.TestService/FullDuplexCall").MaxReqSize != nil { + break + } + time.Sleep(time.Millisecond) + } + + // Test for unary RPC recv. + req.Payload = smallPayload + req.ResponseSize = int32(largeSize) + + if _, err = tc.UnaryCall(context.Background(), req, grpc.FailFast(false)); err != nil { + t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want ", err) + } + + req.ResponseSize = int32(extraLargeSize) + if _, err := tc.UnaryCall(context.Background(), req); err == nil || grpc.Code(err) != codes.ResourceExhausted { + t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want _, error code: %s", err, codes.ResourceExhausted) + } + + // Test for unary RPC send. + req.Payload = largePayload + req.ResponseSize = int32(smallSize) + if _, err := tc.UnaryCall(context.Background(), req); err != nil { + t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want ", err) + } + + req.Payload = extraLargePayload + if _, err = tc.UnaryCall(context.Background(), req); err == nil || grpc.Code(err) != codes.ResourceExhausted { + t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want _, error code: %s", err, codes.ResourceExhausted) + } + + // Test for streaming RPC recv. + stream, err = tc.FullDuplexCall(te3.ctx) + if err != nil { + t.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) + } + respParam[0].Size = int32(largeSize) + sreq.Payload = smallPayload + + if err = stream.Send(sreq); err != nil { + t.Fatalf("%v.Send(%v) = %v, want ", stream, sreq, err) + } + if _, err = stream.Recv(); err != nil { + t.Fatalf("%v.Recv() = _, %v, want ", stream, err) + } + + respParam[0].Size = int32(extraLargeSize) + + if err = stream.Send(sreq); err != nil { + t.Fatalf("%v.Send(%v) = %v, want ", stream, sreq, err) + } + if _, err = stream.Recv(); err == nil || grpc.Code(err) != codes.ResourceExhausted { + t.Fatalf("%v.Recv() = _, %v, want _, error code: %s", stream, err, codes.ResourceExhausted) + } + + // Test for streaming RPC send. + respParam[0].Size = int32(smallSize) + sreq.Payload = largePayload + stream, err = tc.FullDuplexCall(te3.ctx) + if err != nil { + t.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) + } + if err := stream.Send(sreq); err != nil { + t.Fatalf("%v.Send(%v) = %v, want ", stream, sreq, err) + } + sreq.Payload = extraLargePayload + if err := stream.Send(sreq); err == nil || grpc.Code(err) != codes.ResourceExhausted { + t.Fatalf("%v.Send(%v) = %v, want _, error code: %s", stream, sreq, err, codes.ResourceExhausted) + } +} + +func TestMaxMsgSizeClientDefault(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testMaxMsgSizeClientDefault(t, e) + } +} + +func testMaxMsgSizeClientDefault(t *testing.T, e env) { + te := newTest(t, e) + te.userAgent = testAppUA + te.declareLogNoise( + "transport: http2Client.notifyError got notified that the client transport was broken EOF", + "grpc: addrConn.transportMonitor exits due to: grpc: the connection is closing", + "grpc: addrConn.resetTransport failed to create client transport: connection error", + "Failed to dial : context canceled; please retry.", + ) + te.startServer(&testServer{security: e.security}) + + defer te.tearDown() + tc := testpb.NewTestServiceClient(te.clientConn()) + + const smallSize = 1 + const largeSize = 4 * 1024 * 1024 + smallPayload, err := newPayload(testpb.PayloadType_COMPRESSABLE, smallSize) + if err != nil { + t.Fatal(err) + } + req := &testpb.SimpleRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseSize: int32(largeSize), + Payload: smallPayload, + } + // Test for unary RPC recv. + if _, err := tc.UnaryCall(context.Background(), req); err == nil || grpc.Code(err) != codes.ResourceExhausted { + t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want _, error code: %s", err, codes.ResourceExhausted) + } + + respParam := []*testpb.ResponseParameters{ + { + Size: int32(largeSize), + }, + } + sreq := &testpb.StreamingOutputCallRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseParameters: respParam, + Payload: smallPayload, + } + + // Test for streaming RPC recv. + stream, err := tc.FullDuplexCall(te.ctx) + if err != nil { + t.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) + } + if err := stream.Send(sreq); err != nil { + t.Fatalf("%v.Send(%v) = %v, want ", stream, sreq, err) + } + if _, err := stream.Recv(); err == nil || grpc.Code(err) != codes.ResourceExhausted { + t.Fatalf("%v.Recv() = _, %v, want _, error code: %s", stream, err, codes.ResourceExhausted) + } +} + +func TestMaxMsgSizeClientAPI(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testMaxMsgSizeClientAPI(t, e) + } +} + +func testMaxMsgSizeClientAPI(t *testing.T, e env) { + te := newTest(t, e) + te.userAgent = testAppUA + // To avoid error on server side. + te.maxServerSendMsgSize = newInt(5 * 1024 * 1024) + te.maxClientReceiveMsgSize = newInt(1024) + te.maxClientSendMsgSize = newInt(1024) + te.declareLogNoise( + "transport: http2Client.notifyError got notified that the client transport was broken EOF", + "grpc: addrConn.transportMonitor exits due to: grpc: the connection is closing", + "grpc: addrConn.resetTransport failed to create client transport: connection error", + "Failed to dial : context canceled; please retry.", + ) + te.startServer(&testServer{security: e.security}) + + defer te.tearDown() + tc := testpb.NewTestServiceClient(te.clientConn()) + + const smallSize = 1 + const largeSize = 1024 + smallPayload, err := newPayload(testpb.PayloadType_COMPRESSABLE, smallSize) + if err != nil { + t.Fatal(err) + } + + largePayload, err := newPayload(testpb.PayloadType_COMPRESSABLE, largeSize) + if err != nil { + t.Fatal(err) + } + req := &testpb.SimpleRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseSize: int32(largeSize), + Payload: smallPayload, + } + // Test for unary RPC recv. + if _, err := tc.UnaryCall(context.Background(), req); err == nil || grpc.Code(err) != codes.ResourceExhausted { + t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want _, error code: %s", err, codes.ResourceExhausted) + } + + // Test for unary RPC send. + req.Payload = largePayload + req.ResponseSize = int32(smallSize) + if _, err := tc.UnaryCall(context.Background(), req); err == nil || grpc.Code(err) != codes.ResourceExhausted { + t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want _, error code: %s", err, codes.ResourceExhausted) + } + + respParam := []*testpb.ResponseParameters{ + { + Size: int32(largeSize), + }, + } + sreq := &testpb.StreamingOutputCallRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseParameters: respParam, + Payload: smallPayload, + } + + // Test for streaming RPC recv. + stream, err := tc.FullDuplexCall(te.ctx) + if err != nil { + t.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) + } + if err := stream.Send(sreq); err != nil { + t.Fatalf("%v.Send(%v) = %v, want ", stream, sreq, err) + } + if _, err := stream.Recv(); err == nil || grpc.Code(err) != codes.ResourceExhausted { + t.Fatalf("%v.Recv() = _, %v, want _, error code: %s", stream, err, codes.ResourceExhausted) + } + + // Test for streaming RPC send. + respParam[0].Size = int32(smallSize) + sreq.Payload = largePayload + stream, err = tc.FullDuplexCall(te.ctx) + if err != nil { + t.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) + } + if err := stream.Send(sreq); err == nil || grpc.Code(err) != codes.ResourceExhausted { + t.Fatalf("%v.Send(%v) = %v, want _, error code: %s", stream, sreq, err, codes.ResourceExhausted) + } +} + +func TestMaxMsgSizeServerAPI(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testMaxMsgSizeServerAPI(t, e) + } +} + +func testMaxMsgSizeServerAPI(t *testing.T, e env) { + te := newTest(t, e) + te.userAgent = testAppUA + te.maxServerReceiveMsgSize = newInt(1024) + te.maxServerSendMsgSize = newInt(1024) + te.declareLogNoise( + "transport: http2Client.notifyError got notified that the client transport was broken EOF", + "grpc: addrConn.transportMonitor exits due to: grpc: the connection is closing", + "grpc: addrConn.resetTransport failed to create client transport: connection error", + "Failed to dial : context canceled; please retry.", + ) + te.startServer(&testServer{security: e.security}) + + defer te.tearDown() + tc := testpb.NewTestServiceClient(te.clientConn()) + + const smallSize = 1 + const largeSize = 1024 + smallPayload, err := newPayload(testpb.PayloadType_COMPRESSABLE, smallSize) + if err != nil { + t.Fatal(err) + } + + largePayload, err := newPayload(testpb.PayloadType_COMPRESSABLE, largeSize) + if err != nil { + t.Fatal(err) + } + req := &testpb.SimpleRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseSize: int32(largeSize), + Payload: smallPayload, + } + // Test for unary RPC send. + if _, err := tc.UnaryCall(context.Background(), req); err == nil || grpc.Code(err) != codes.ResourceExhausted { + t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want _, error code: %s", err, codes.ResourceExhausted) + } + + // Test for unary RPC recv. + req.Payload = largePayload + req.ResponseSize = int32(smallSize) + if _, err := tc.UnaryCall(context.Background(), req); err == nil || grpc.Code(err) != codes.ResourceExhausted { + t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want _, error code: %s", err, codes.ResourceExhausted) + } + + respParam := []*testpb.ResponseParameters{ + { + Size: int32(largeSize), + }, + } + sreq := &testpb.StreamingOutputCallRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseParameters: respParam, + Payload: smallPayload, + } + + // Test for streaming RPC send. + stream, err := tc.FullDuplexCall(te.ctx) + if err != nil { + t.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) + } + if err := stream.Send(sreq); err != nil { + t.Fatalf("%v.Send(%v) = %v, want ", stream, sreq, err) + } + if _, err := stream.Recv(); err == nil || grpc.Code(err) != codes.ResourceExhausted { + t.Fatalf("%v.Recv() = _, %v, want _, error code: %s", stream, err, codes.ResourceExhausted) + } + + // Test for streaming RPC recv. + respParam[0].Size = int32(smallSize) + sreq.Payload = largePayload + stream, err = tc.FullDuplexCall(te.ctx) + if err != nil { + t.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) + } + if err := stream.Send(sreq); err != nil { + t.Fatalf("%v.Send(%v) = %v, want ", stream, sreq, err) + } + if _, err := stream.Recv(); err == nil || grpc.Code(err) != codes.ResourceExhausted { + t.Fatalf("%v.Recv() = _, %v, want _, error code: %s", stream, err, codes.ResourceExhausted) + } +} + +func TestTap(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + if e.name == "handler-tls" { + continue + } + testTap(t, e) + } +} + +type myTap struct { + cnt int +} + +func (t *myTap) handle(ctx context.Context, info *tap.Info) (context.Context, error) { + if info != nil { + if info.FullMethodName == "/grpc.testing.TestService/EmptyCall" { + t.cnt++ + } else if info.FullMethodName == "/grpc.testing.TestService/UnaryCall" { + return nil, fmt.Errorf("tap error") + } + } + return ctx, nil +} + +func testTap(t *testing.T, e env) { + te := newTest(t, e) + te.userAgent = testAppUA + ttap := &myTap{} + te.tapHandle = ttap.handle + te.declareLogNoise( + "transport: http2Client.notifyError got notified that the client transport was broken EOF", + "grpc: addrConn.transportMonitor exits due to: grpc: the connection is closing", + "grpc: addrConn.resetTransport failed to create client transport: connection error", + ) + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + + cc := te.clientConn() + tc := testpb.NewTestServiceClient(cc) + if _, err := tc.EmptyCall(context.Background(), &testpb.Empty{}); err != nil { + t.Fatalf("TestService/EmptyCall(_, _) = _, %v, want _, ", err) + } + if ttap.cnt != 1 { + t.Fatalf("Get the count in ttap %d, want 1", ttap.cnt) + } + + payload, err := newPayload(testpb.PayloadType_COMPRESSABLE, 31) + if err != nil { + t.Fatal(err) + } + + req := &testpb.SimpleRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseSize: 45, + Payload: payload, + } + if _, err := tc.UnaryCall(context.Background(), req); grpc.Code(err) != codes.Unavailable { + t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want _, %s", err, codes.Unavailable) + } +} + +func healthCheck(d time.Duration, cc *grpc.ClientConn, serviceName string) (*healthpb.HealthCheckResponse, error) { + ctx, cancel := context.WithTimeout(context.Background(), d) + defer cancel() + hc := healthpb.NewHealthClient(cc) + req := &healthpb.HealthCheckRequest{ + Service: serviceName, + } + return hc.Check(ctx, req) +} + +func TestHealthCheckOnSuccess(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testHealthCheckOnSuccess(t, e) + } +} + +func testHealthCheckOnSuccess(t *testing.T, e env) { + te := newTest(t, e) + hs := health.NewServer() + hs.SetServingStatus("grpc.health.v1.Health", 1) + te.healthServer = hs + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + + cc := te.clientConn() + if _, err := healthCheck(1*time.Second, cc, "grpc.health.v1.Health"); err != nil { + t.Fatalf("Health/Check(_, _) = _, %v, want _, ", err) + } +} + +func TestHealthCheckOnFailure(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testHealthCheckOnFailure(t, e) + } +} + +func testHealthCheckOnFailure(t *testing.T, e env) { + defer leakcheck.Check(t) + te := newTest(t, e) + te.declareLogNoise( + "Failed to dial ", + "grpc: the client connection is closing; please retry", + ) + hs := health.NewServer() + hs.SetServingStatus("grpc.health.v1.HealthCheck", 1) + te.healthServer = hs + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + + cc := te.clientConn() + wantErr := status.Error(codes.DeadlineExceeded, "context deadline exceeded") + if _, err := healthCheck(0*time.Second, cc, "grpc.health.v1.Health"); !reflect.DeepEqual(err, wantErr) { + t.Fatalf("Health/Check(_, _) = _, %v, want _, error code %s", err, codes.DeadlineExceeded) + } + awaitNewConnLogOutput() +} + +func TestHealthCheckOff(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + // TODO(bradfitz): Temporarily skip this env due to #619. + if e.name == "handler-tls" { + continue + } + testHealthCheckOff(t, e) + } +} + +func testHealthCheckOff(t *testing.T, e env) { + te := newTest(t, e) + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + want := status.Error(codes.Unimplemented, "unknown service grpc.health.v1.Health") + if _, err := healthCheck(1*time.Second, te.clientConn(), ""); !reflect.DeepEqual(err, want) { + t.Fatalf("Health/Check(_, _) = _, %v, want _, %v", err, want) + } +} + +func TestUnknownHandler(t *testing.T) { + defer leakcheck.Check(t) + // An example unknownHandler that returns a different code and a different method, making sure that we do not + // expose what methods are implemented to a client that is not authenticated. + unknownHandler := func(srv interface{}, stream grpc.ServerStream) error { + return status.Error(codes.Unauthenticated, "user unauthenticated") + } + for _, e := range listTestEnv() { + // TODO(bradfitz): Temporarily skip this env due to #619. + if e.name == "handler-tls" { + continue + } + testUnknownHandler(t, e, unknownHandler) + } +} + +func testUnknownHandler(t *testing.T, e env, unknownHandler grpc.StreamHandler) { + te := newTest(t, e) + te.unknownHandler = unknownHandler + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + want := status.Error(codes.Unauthenticated, "user unauthenticated") + if _, err := healthCheck(1*time.Second, te.clientConn(), ""); !reflect.DeepEqual(err, want) { + t.Fatalf("Health/Check(_, _) = _, %v, want _, %v", err, want) + } +} + +func TestHealthCheckServingStatus(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testHealthCheckServingStatus(t, e) + } +} + +func testHealthCheckServingStatus(t *testing.T, e env) { + te := newTest(t, e) + hs := health.NewServer() + te.healthServer = hs + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + + cc := te.clientConn() + out, err := healthCheck(1*time.Second, cc, "") + if err != nil { + t.Fatalf("Health/Check(_, _) = _, %v, want _, ", err) + } + if out.Status != healthpb.HealthCheckResponse_SERVING { + t.Fatalf("Got the serving status %v, want SERVING", out.Status) + } + wantErr := status.Error(codes.NotFound, "unknown service") + if _, err := healthCheck(1*time.Second, cc, "grpc.health.v1.Health"); !reflect.DeepEqual(err, wantErr) { + t.Fatalf("Health/Check(_, _) = _, %v, want _, error code %s", err, codes.NotFound) + } + hs.SetServingStatus("grpc.health.v1.Health", healthpb.HealthCheckResponse_SERVING) + out, err = healthCheck(1*time.Second, cc, "grpc.health.v1.Health") + if err != nil { + t.Fatalf("Health/Check(_, _) = _, %v, want _, ", err) + } + if out.Status != healthpb.HealthCheckResponse_SERVING { + t.Fatalf("Got the serving status %v, want SERVING", out.Status) + } + hs.SetServingStatus("grpc.health.v1.Health", healthpb.HealthCheckResponse_NOT_SERVING) + out, err = healthCheck(1*time.Second, cc, "grpc.health.v1.Health") + if err != nil { + t.Fatalf("Health/Check(_, _) = _, %v, want _, ", err) + } + if out.Status != healthpb.HealthCheckResponse_NOT_SERVING { + t.Fatalf("Got the serving status %v, want NOT_SERVING", out.Status) + } + +} + +func TestErrorChanNoIO(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testErrorChanNoIO(t, e) + } +} + +func testErrorChanNoIO(t *testing.T, e env) { + te := newTest(t, e) + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + + tc := testpb.NewTestServiceClient(te.clientConn()) + if _, err := tc.FullDuplexCall(context.Background()); err != nil { + t.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) + } +} + +func TestEmptyUnaryWithUserAgent(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testEmptyUnaryWithUserAgent(t, e) + } +} + +func testEmptyUnaryWithUserAgent(t *testing.T, e env) { + te := newTest(t, e) + te.userAgent = testAppUA + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + + cc := te.clientConn() + tc := testpb.NewTestServiceClient(cc) + var header metadata.MD + reply, err := tc.EmptyCall(context.Background(), &testpb.Empty{}, grpc.Header(&header)) + if err != nil || !proto.Equal(&testpb.Empty{}, reply) { + t.Fatalf("TestService/EmptyCall(_, _) = %v, %v, want %v, ", reply, err, &testpb.Empty{}) + } + if v, ok := header["ua"]; !ok || !strings.HasPrefix(v[0], testAppUA) { + t.Fatalf("header[\"ua\"] = %q, %t, want string with prefix %q, true", v, ok, testAppUA) + } + + te.srv.Stop() +} + +func TestFailedEmptyUnary(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + if e.name == "handler-tls" { + // This test covers status details, but + // Grpc-Status-Details-Bin is not support in handler_server. + continue + } + testFailedEmptyUnary(t, e) + } +} + +func testFailedEmptyUnary(t *testing.T, e env) { + te := newTest(t, e) + te.userAgent = failAppUA + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + tc := testpb.NewTestServiceClient(te.clientConn()) + + ctx := metadata.NewOutgoingContext(context.Background(), testMetadata) + wantErr := detailedError + if _, err := tc.EmptyCall(ctx, &testpb.Empty{}); !reflect.DeepEqual(err, wantErr) { + t.Fatalf("TestService/EmptyCall(_, _) = _, %v, want _, %v", err, wantErr) + } +} + +func TestLargeUnary(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testLargeUnary(t, e) + } +} + +func testLargeUnary(t *testing.T, e env) { + te := newTest(t, e) + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + tc := testpb.NewTestServiceClient(te.clientConn()) + + const argSize = 271828 + const respSize = 314159 + + payload, err := newPayload(testpb.PayloadType_COMPRESSABLE, argSize) + if err != nil { + t.Fatal(err) + } + + req := &testpb.SimpleRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseSize: respSize, + Payload: payload, + } + reply, err := tc.UnaryCall(context.Background(), req) + if err != nil { + t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want _, ", err) + } + pt := reply.GetPayload().GetType() + ps := len(reply.GetPayload().GetBody()) + if pt != testpb.PayloadType_COMPRESSABLE || ps != respSize { + t.Fatalf("Got the reply with type %d len %d; want %d, %d", pt, ps, testpb.PayloadType_COMPRESSABLE, respSize) + } +} + +// Test backward-compatibility API for setting msg size limit. +func TestExceedMsgLimit(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testExceedMsgLimit(t, e) + } +} + +func testExceedMsgLimit(t *testing.T, e env) { + te := newTest(t, e) + te.maxMsgSize = newInt(1024) + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + tc := testpb.NewTestServiceClient(te.clientConn()) + + argSize := int32(*te.maxMsgSize + 1) + const smallSize = 1 + + payload, err := newPayload(testpb.PayloadType_COMPRESSABLE, argSize) + if err != nil { + t.Fatal(err) + } + smallPayload, err := newPayload(testpb.PayloadType_COMPRESSABLE, smallSize) + if err != nil { + t.Fatal(err) + } + + // Test on server side for unary RPC. + req := &testpb.SimpleRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseSize: smallSize, + Payload: payload, + } + if _, err := tc.UnaryCall(context.Background(), req); err == nil || grpc.Code(err) != codes.ResourceExhausted { + t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want _, error code: %s", err, codes.ResourceExhausted) + } + // Test on client side for unary RPC. + req.ResponseSize = int32(*te.maxMsgSize) + 1 + req.Payload = smallPayload + if _, err := tc.UnaryCall(context.Background(), req); err == nil || grpc.Code(err) != codes.ResourceExhausted { + t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want _, error code: %s", err, codes.ResourceExhausted) + } + + // Test on server side for streaming RPC. + stream, err := tc.FullDuplexCall(te.ctx) + if err != nil { + t.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) + } + respParam := []*testpb.ResponseParameters{ + { + Size: 1, + }, + } + + spayload, err := newPayload(testpb.PayloadType_COMPRESSABLE, int32(*te.maxMsgSize+1)) + if err != nil { + t.Fatal(err) + } + + sreq := &testpb.StreamingOutputCallRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseParameters: respParam, + Payload: spayload, + } + if err := stream.Send(sreq); err != nil { + t.Fatalf("%v.Send(%v) = %v, want ", stream, sreq, err) + } + if _, err := stream.Recv(); err == nil || grpc.Code(err) != codes.ResourceExhausted { + t.Fatalf("%v.Recv() = _, %v, want _, error code: %s", stream, err, codes.ResourceExhausted) + } + + // Test on client side for streaming RPC. + stream, err = tc.FullDuplexCall(te.ctx) + if err != nil { + t.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) + } + respParam[0].Size = int32(*te.maxMsgSize) + 1 + sreq.Payload = smallPayload + if err := stream.Send(sreq); err != nil { + t.Fatalf("%v.Send(%v) = %v, want ", stream, sreq, err) + } + if _, err := stream.Recv(); err == nil || grpc.Code(err) != codes.ResourceExhausted { + t.Fatalf("%v.Recv() = _, %v, want _, error code: %s", stream, err, codes.ResourceExhausted) + } + +} + +func TestPeerClientSide(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testPeerClientSide(t, e) + } +} + +func testPeerClientSide(t *testing.T, e env) { + te := newTest(t, e) + te.userAgent = testAppUA + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + tc := testpb.NewTestServiceClient(te.clientConn()) + peer := new(peer.Peer) + if _, err := tc.EmptyCall(context.Background(), &testpb.Empty{}, grpc.Peer(peer), grpc.FailFast(false)); err != nil { + t.Fatalf("TestService/EmptyCall(_, _) = _, %v, want _, ", err) + } + pa := peer.Addr.String() + if e.network == "unix" { + if pa != te.srvAddr { + t.Fatalf("peer.Addr = %v, want %v", pa, te.srvAddr) + } + return + } + _, pp, err := net.SplitHostPort(pa) + if err != nil { + t.Fatalf("Failed to parse address from peer.") + } + _, sp, err := net.SplitHostPort(te.srvAddr) + if err != nil { + t.Fatalf("Failed to parse address of test server.") + } + if pp != sp { + t.Fatalf("peer.Addr = localhost:%v, want localhost:%v", pp, sp) + } +} + +// TestPeerNegative tests that if call fails setting peer +// doesn't cause a segmentation fault. +// issue#1141 https://github.com/grpc/grpc-go/issues/1141 +func TestPeerNegative(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testPeerNegative(t, e) + } +} + +func testPeerNegative(t *testing.T, e env) { + te := newTest(t, e) + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + + cc := te.clientConn() + tc := testpb.NewTestServiceClient(cc) + peer := new(peer.Peer) + ctx, cancel := context.WithCancel(context.Background()) + cancel() + tc.EmptyCall(ctx, &testpb.Empty{}, grpc.Peer(peer)) +} + +func TestPeerFailedRPC(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testPeerFailedRPC(t, e) + } +} + +func testPeerFailedRPC(t *testing.T, e env) { + te := newTest(t, e) + te.maxServerReceiveMsgSize = newInt(1 * 1024) + te.startServer(&testServer{security: e.security}) + + defer te.tearDown() + tc := testpb.NewTestServiceClient(te.clientConn()) + + // first make a successful request to the server + if _, err := tc.EmptyCall(context.Background(), &testpb.Empty{}); err != nil { + t.Fatalf("TestService/EmptyCall(_, _) = _, %v, want _, ", err) + } + + // make a second request that will be rejected by the server + const largeSize = 5 * 1024 + largePayload, err := newPayload(testpb.PayloadType_COMPRESSABLE, largeSize) + if err != nil { + t.Fatal(err) + } + req := &testpb.SimpleRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + Payload: largePayload, + } + + peer := new(peer.Peer) + if _, err := tc.UnaryCall(context.Background(), req, grpc.Peer(peer)); err == nil || grpc.Code(err) != codes.ResourceExhausted { + t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want _, error code: %s", err, codes.ResourceExhausted) + } else { + pa := peer.Addr.String() + if e.network == "unix" { + if pa != te.srvAddr { + t.Fatalf("peer.Addr = %v, want %v", pa, te.srvAddr) + } + return + } + _, pp, err := net.SplitHostPort(pa) + if err != nil { + t.Fatalf("Failed to parse address from peer.") + } + _, sp, err := net.SplitHostPort(te.srvAddr) + if err != nil { + t.Fatalf("Failed to parse address of test server.") + } + if pp != sp { + t.Fatalf("peer.Addr = localhost:%v, want localhost:%v", pp, sp) + } + } +} + +func TestMetadataUnaryRPC(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testMetadataUnaryRPC(t, e) + } +} + +func testMetadataUnaryRPC(t *testing.T, e env) { + te := newTest(t, e) + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + tc := testpb.NewTestServiceClient(te.clientConn()) + + const argSize = 2718 + const respSize = 314 + + payload, err := newPayload(testpb.PayloadType_COMPRESSABLE, argSize) + if err != nil { + t.Fatal(err) + } + + req := &testpb.SimpleRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseSize: respSize, + Payload: payload, + } + var header, trailer metadata.MD + ctx := metadata.NewOutgoingContext(context.Background(), testMetadata) + if _, err := tc.UnaryCall(ctx, req, grpc.Header(&header), grpc.Trailer(&trailer)); err != nil { + t.Fatalf("TestService.UnaryCall(%v, _, _, _) = _, %v; want _, ", ctx, err) + } + // Ignore optional response headers that Servers may set: + if header != nil { + delete(header, "trailer") // RFC 2616 says server SHOULD (but optional) declare trailers + delete(header, "date") // the Date header is also optional + delete(header, "user-agent") + } + if !reflect.DeepEqual(header, testMetadata) { + t.Fatalf("Received header metadata %v, want %v", header, testMetadata) + } + if !reflect.DeepEqual(trailer, testTrailerMetadata) { + t.Fatalf("Received trailer metadata %v, want %v", trailer, testTrailerMetadata) + } +} + +func TestMultipleSetTrailerUnaryRPC(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testMultipleSetTrailerUnaryRPC(t, e) + } +} + +func testMultipleSetTrailerUnaryRPC(t *testing.T, e env) { + te := newTest(t, e) + te.startServer(&testServer{security: e.security, multipleSetTrailer: true}) + defer te.tearDown() + tc := testpb.NewTestServiceClient(te.clientConn()) + + const ( + argSize = 1 + respSize = 1 + ) + payload, err := newPayload(testpb.PayloadType_COMPRESSABLE, argSize) + if err != nil { + t.Fatal(err) + } + + req := &testpb.SimpleRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseSize: respSize, + Payload: payload, + } + var trailer metadata.MD + ctx := metadata.NewOutgoingContext(context.Background(), testMetadata) + if _, err := tc.UnaryCall(ctx, req, grpc.Trailer(&trailer), grpc.FailFast(false)); err != nil { + t.Fatalf("TestService.UnaryCall(%v, _, _, _) = _, %v; want _, ", ctx, err) + } + expectedTrailer := metadata.Join(testTrailerMetadata, testTrailerMetadata2) + if !reflect.DeepEqual(trailer, expectedTrailer) { + t.Fatalf("Received trailer metadata %v, want %v", trailer, expectedTrailer) + } +} + +func TestMultipleSetTrailerStreamingRPC(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testMultipleSetTrailerStreamingRPC(t, e) + } +} + +func testMultipleSetTrailerStreamingRPC(t *testing.T, e env) { + te := newTest(t, e) + te.startServer(&testServer{security: e.security, multipleSetTrailer: true}) + defer te.tearDown() + tc := testpb.NewTestServiceClient(te.clientConn()) + + ctx := metadata.NewOutgoingContext(context.Background(), testMetadata) + stream, err := tc.FullDuplexCall(ctx, grpc.FailFast(false)) + if err != nil { + t.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) + } + if err := stream.CloseSend(); err != nil { + t.Fatalf("%v.CloseSend() got %v, want %v", stream, err, nil) + } + if _, err := stream.Recv(); err != io.EOF { + t.Fatalf("%v failed to complele the FullDuplexCall: %v", stream, err) + } + + trailer := stream.Trailer() + expectedTrailer := metadata.Join(testTrailerMetadata, testTrailerMetadata2) + if !reflect.DeepEqual(trailer, expectedTrailer) { + t.Fatalf("Received trailer metadata %v, want %v", trailer, expectedTrailer) + } +} + +func TestSetAndSendHeaderUnaryRPC(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + if e.name == "handler-tls" { + continue + } + testSetAndSendHeaderUnaryRPC(t, e) + } +} + +// To test header metadata is sent on SendHeader(). +func testSetAndSendHeaderUnaryRPC(t *testing.T, e env) { + te := newTest(t, e) + te.startServer(&testServer{security: e.security, setAndSendHeader: true}) + defer te.tearDown() + tc := testpb.NewTestServiceClient(te.clientConn()) + + const ( + argSize = 1 + respSize = 1 + ) + payload, err := newPayload(testpb.PayloadType_COMPRESSABLE, argSize) + if err != nil { + t.Fatal(err) + } + + req := &testpb.SimpleRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseSize: respSize, + Payload: payload, + } + var header metadata.MD + ctx := metadata.NewOutgoingContext(context.Background(), testMetadata) + if _, err := tc.UnaryCall(ctx, req, grpc.Header(&header), grpc.FailFast(false)); err != nil { + t.Fatalf("TestService.UnaryCall(%v, _, _, _) = _, %v; want _, ", ctx, err) + } + delete(header, "user-agent") + expectedHeader := metadata.Join(testMetadata, testMetadata2) + if !reflect.DeepEqual(header, expectedHeader) { + t.Fatalf("Received header metadata %v, want %v", header, expectedHeader) + } +} + +func TestMultipleSetHeaderUnaryRPC(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + if e.name == "handler-tls" { + continue + } + testMultipleSetHeaderUnaryRPC(t, e) + } +} + +// To test header metadata is sent when sending response. +func testMultipleSetHeaderUnaryRPC(t *testing.T, e env) { + te := newTest(t, e) + te.startServer(&testServer{security: e.security, setHeaderOnly: true}) + defer te.tearDown() + tc := testpb.NewTestServiceClient(te.clientConn()) + + const ( + argSize = 1 + respSize = 1 + ) + payload, err := newPayload(testpb.PayloadType_COMPRESSABLE, argSize) + if err != nil { + t.Fatal(err) + } + + req := &testpb.SimpleRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseSize: respSize, + Payload: payload, + } + + var header metadata.MD + ctx := metadata.NewOutgoingContext(context.Background(), testMetadata) + if _, err := tc.UnaryCall(ctx, req, grpc.Header(&header), grpc.FailFast(false)); err != nil { + t.Fatalf("TestService.UnaryCall(%v, _, _, _) = _, %v; want _, ", ctx, err) + } + delete(header, "user-agent") + expectedHeader := metadata.Join(testMetadata, testMetadata2) + if !reflect.DeepEqual(header, expectedHeader) { + t.Fatalf("Received header metadata %v, want %v", header, expectedHeader) + } +} + +func TestMultipleSetHeaderUnaryRPCError(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + if e.name == "handler-tls" { + continue + } + testMultipleSetHeaderUnaryRPCError(t, e) + } +} + +// To test header metadata is sent when sending status. +func testMultipleSetHeaderUnaryRPCError(t *testing.T, e env) { + te := newTest(t, e) + te.startServer(&testServer{security: e.security, setHeaderOnly: true}) + defer te.tearDown() + tc := testpb.NewTestServiceClient(te.clientConn()) + + const ( + argSize = 1 + respSize = -1 // Invalid respSize to make RPC fail. + ) + payload, err := newPayload(testpb.PayloadType_COMPRESSABLE, argSize) + if err != nil { + t.Fatal(err) + } + + req := &testpb.SimpleRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseSize: respSize, + Payload: payload, + } + var header metadata.MD + ctx := metadata.NewOutgoingContext(context.Background(), testMetadata) + if _, err := tc.UnaryCall(ctx, req, grpc.Header(&header), grpc.FailFast(false)); err == nil { + t.Fatalf("TestService.UnaryCall(%v, _, _, _) = _, %v; want _, ", ctx, err) + } + delete(header, "user-agent") + expectedHeader := metadata.Join(testMetadata, testMetadata2) + if !reflect.DeepEqual(header, expectedHeader) { + t.Fatalf("Received header metadata %v, want %v", header, expectedHeader) + } +} + +func TestSetAndSendHeaderStreamingRPC(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + if e.name == "handler-tls" { + continue + } + testSetAndSendHeaderStreamingRPC(t, e) + } +} + +// To test header metadata is sent on SendHeader(). +func testSetAndSendHeaderStreamingRPC(t *testing.T, e env) { + te := newTest(t, e) + te.startServer(&testServer{security: e.security, setAndSendHeader: true}) + defer te.tearDown() + tc := testpb.NewTestServiceClient(te.clientConn()) + + const ( + argSize = 1 + respSize = 1 + ) + ctx := metadata.NewOutgoingContext(context.Background(), testMetadata) + stream, err := tc.FullDuplexCall(ctx) + if err != nil { + t.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) + } + if err := stream.CloseSend(); err != nil { + t.Fatalf("%v.CloseSend() got %v, want %v", stream, err, nil) + } + if _, err := stream.Recv(); err != io.EOF { + t.Fatalf("%v failed to complele the FullDuplexCall: %v", stream, err) + } + + header, err := stream.Header() + if err != nil { + t.Fatalf("%v.Header() = _, %v, want _, ", stream, err) + } + delete(header, "user-agent") + expectedHeader := metadata.Join(testMetadata, testMetadata2) + if !reflect.DeepEqual(header, expectedHeader) { + t.Fatalf("Received header metadata %v, want %v", header, expectedHeader) + } +} + +func TestMultipleSetHeaderStreamingRPC(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + if e.name == "handler-tls" { + continue + } + testMultipleSetHeaderStreamingRPC(t, e) + } +} + +// To test header metadata is sent when sending response. +func testMultipleSetHeaderStreamingRPC(t *testing.T, e env) { + te := newTest(t, e) + te.startServer(&testServer{security: e.security, setHeaderOnly: true}) + defer te.tearDown() + tc := testpb.NewTestServiceClient(te.clientConn()) + + const ( + argSize = 1 + respSize = 1 + ) + ctx := metadata.NewOutgoingContext(context.Background(), testMetadata) + stream, err := tc.FullDuplexCall(ctx) + if err != nil { + t.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) + } + + payload, err := newPayload(testpb.PayloadType_COMPRESSABLE, argSize) + if err != nil { + t.Fatal(err) + } + + req := &testpb.StreamingOutputCallRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseParameters: []*testpb.ResponseParameters{ + {Size: respSize}, + }, + Payload: payload, + } + if err := stream.Send(req); err != nil { + t.Fatalf("%v.Send(%v) = %v, want ", stream, req, err) + } + if _, err := stream.Recv(); err != nil { + t.Fatalf("%v.Recv() = %v, want ", stream, err) + } + if err := stream.CloseSend(); err != nil { + t.Fatalf("%v.CloseSend() got %v, want %v", stream, err, nil) + } + if _, err := stream.Recv(); err != io.EOF { + t.Fatalf("%v failed to complele the FullDuplexCall: %v", stream, err) + } + + header, err := stream.Header() + if err != nil { + t.Fatalf("%v.Header() = _, %v, want _, ", stream, err) + } + delete(header, "user-agent") + expectedHeader := metadata.Join(testMetadata, testMetadata2) + if !reflect.DeepEqual(header, expectedHeader) { + t.Fatalf("Received header metadata %v, want %v", header, expectedHeader) + } + +} + +func TestMultipleSetHeaderStreamingRPCError(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + if e.name == "handler-tls" { + continue + } + testMultipleSetHeaderStreamingRPCError(t, e) + } +} + +// To test header metadata is sent when sending status. +func testMultipleSetHeaderStreamingRPCError(t *testing.T, e env) { + te := newTest(t, e) + te.startServer(&testServer{security: e.security, setHeaderOnly: true}) + defer te.tearDown() + tc := testpb.NewTestServiceClient(te.clientConn()) + + const ( + argSize = 1 + respSize = -1 + ) + ctx := metadata.NewOutgoingContext(context.Background(), testMetadata) + stream, err := tc.FullDuplexCall(ctx) + if err != nil { + t.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) + } + + payload, err := newPayload(testpb.PayloadType_COMPRESSABLE, argSize) + if err != nil { + t.Fatal(err) + } + + req := &testpb.StreamingOutputCallRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseParameters: []*testpb.ResponseParameters{ + {Size: respSize}, + }, + Payload: payload, + } + if err := stream.Send(req); err != nil { + t.Fatalf("%v.Send(%v) = %v, want ", stream, req, err) + } + if _, err := stream.Recv(); err == nil { + t.Fatalf("%v.Recv() = %v, want ", stream, err) + } + + header, err := stream.Header() + if err != nil { + t.Fatalf("%v.Header() = _, %v, want _, ", stream, err) + } + delete(header, "user-agent") + expectedHeader := metadata.Join(testMetadata, testMetadata2) + if !reflect.DeepEqual(header, expectedHeader) { + t.Fatalf("Received header metadata %v, want %v", header, expectedHeader) + } + + if err := stream.CloseSend(); err != nil { + t.Fatalf("%v.CloseSend() got %v, want %v", stream, err, nil) + } +} + +// TestMalformedHTTP2Metedata verfies the returned error when the client +// sends an illegal metadata. +func TestMalformedHTTP2Metadata(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + if e.name == "handler-tls" { + // Failed with "server stops accepting new RPCs". + // Server stops accepting new RPCs when the client sends an illegal http2 header. + continue + } + testMalformedHTTP2Metadata(t, e) + } +} + +func testMalformedHTTP2Metadata(t *testing.T, e env) { + te := newTest(t, e) + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + tc := testpb.NewTestServiceClient(te.clientConn()) + + payload, err := newPayload(testpb.PayloadType_COMPRESSABLE, 2718) + if err != nil { + t.Fatal(err) + } + + req := &testpb.SimpleRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseSize: 314, + Payload: payload, + } + ctx := metadata.NewOutgoingContext(context.Background(), malformedHTTP2Metadata) + if _, err := tc.UnaryCall(ctx, req); grpc.Code(err) != codes.Internal { + t.Fatalf("TestService.UnaryCall(%v, _) = _, %v; want _, %s", ctx, err, codes.Internal) + } +} + +func TestRetry(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + if e.name == "handler-tls" { + // Fails with RST_STREAM / FLOW_CONTROL_ERROR + continue + } + testRetry(t, e) + } +} + +// This test make sure RPCs are retried times when they receive a RST_STREAM +// with the REFUSED_STREAM error code, which the InTapHandle provokes. +func testRetry(t *testing.T, e env) { + te := newTest(t, e) + attempts := 0 + successAttempt := 2 + te.tapHandle = func(ctx context.Context, _ *tap.Info) (context.Context, error) { + attempts++ + if attempts < successAttempt { + return nil, errors.New("not now") + } + return ctx, nil + } + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + + cc := te.clientConn() + tsc := testpb.NewTestServiceClient(cc) + testCases := []struct { + successAttempt int + failFast bool + errCode codes.Code + }{{ + successAttempt: 1, + }, { + successAttempt: 2, + }, { + successAttempt: 3, + errCode: codes.Unavailable, + }, { + successAttempt: 1, + failFast: true, + }, { + successAttempt: 2, + failFast: true, + errCode: codes.Unavailable, // We won't retry on fail fast. + }} + for _, tc := range testCases { + attempts = 0 + successAttempt = tc.successAttempt + + ctx, cancel := context.WithTimeout(context.Background(), time.Second) + _, err := tsc.EmptyCall(ctx, &testpb.Empty{}, grpc.FailFast(tc.failFast)) + cancel() + if grpc.Code(err) != tc.errCode { + t.Errorf("%+v: tsc.EmptyCall(_, _) = _, %v, want _, Code=%v", tc, err, tc.errCode) + } + } +} + +func TestRPCTimeout(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testRPCTimeout(t, e) + } +} + +// TODO(zhaoq): Have a better test coverage of timeout and cancellation mechanism. +func testRPCTimeout(t *testing.T, e env) { + te := newTest(t, e) + te.startServer(&testServer{security: e.security, unaryCallSleepTime: 50 * time.Millisecond}) + defer te.tearDown() + + cc := te.clientConn() + tc := testpb.NewTestServiceClient(cc) + + const argSize = 2718 + const respSize = 314 + + payload, err := newPayload(testpb.PayloadType_COMPRESSABLE, argSize) + if err != nil { + t.Fatal(err) + } + + req := &testpb.SimpleRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseSize: respSize, + Payload: payload, + } + for i := -1; i <= 10; i++ { + ctx, cancel := context.WithTimeout(context.Background(), time.Duration(i)*time.Millisecond) + if _, err := tc.UnaryCall(ctx, req); grpc.Code(err) != codes.DeadlineExceeded { + t.Fatalf("TestService/UnaryCallv(_, _) = _, %v; want , error code: %s", err, codes.DeadlineExceeded) + } + cancel() + } +} + +func TestCancel(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testCancel(t, e) + } +} + +func testCancel(t *testing.T, e env) { + te := newTest(t, e) + te.declareLogNoise("grpc: the client connection is closing; please retry") + te.startServer(&testServer{security: e.security, unaryCallSleepTime: time.Second}) + defer te.tearDown() + + cc := te.clientConn() + tc := testpb.NewTestServiceClient(cc) + + const argSize = 2718 + const respSize = 314 + + payload, err := newPayload(testpb.PayloadType_COMPRESSABLE, argSize) + if err != nil { + t.Fatal(err) + } + + req := &testpb.SimpleRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseSize: respSize, + Payload: payload, + } + ctx, cancel := context.WithCancel(context.Background()) + time.AfterFunc(1*time.Millisecond, cancel) + if r, err := tc.UnaryCall(ctx, req); grpc.Code(err) != codes.Canceled { + t.Fatalf("TestService/UnaryCall(_, _) = %v, %v; want _, error code: %s", r, err, codes.Canceled) + } + awaitNewConnLogOutput() +} + +func TestCancelNoIO(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testCancelNoIO(t, e) + } +} + +func testCancelNoIO(t *testing.T, e env) { + te := newTest(t, e) + te.declareLogNoise("http2Client.notifyError got notified that the client transport was broken") + te.maxStream = 1 // Only allows 1 live stream per server transport. + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + + cc := te.clientConn() + tc := testpb.NewTestServiceClient(cc) + + // Start one blocked RPC for which we'll never send streaming + // input. This will consume the 1 maximum concurrent streams, + // causing future RPCs to hang. + ctx, cancelFirst := context.WithCancel(context.Background()) + _, err := tc.StreamingInputCall(ctx) + if err != nil { + t.Fatalf("%v.StreamingInputCall(_) = _, %v, want _, ", tc, err) + } + + // Loop until the ClientConn receives the initial settings + // frame from the server, notifying it about the maximum + // concurrent streams. We know when it's received it because + // an RPC will fail with codes.DeadlineExceeded instead of + // succeeding. + // TODO(bradfitz): add internal test hook for this (Issue 534) + for { + ctx, cancelSecond := context.WithTimeout(context.Background(), 50*time.Millisecond) + _, err := tc.StreamingInputCall(ctx) + cancelSecond() + if err == nil { + continue + } + if grpc.Code(err) == codes.DeadlineExceeded { + break + } + t.Fatalf("%v.StreamingInputCall(_) = _, %v, want _, %s", tc, err, codes.DeadlineExceeded) + } + // If there are any RPCs in flight before the client receives + // the max streams setting, let them be expired. + // TODO(bradfitz): add internal test hook for this (Issue 534) + time.Sleep(50 * time.Millisecond) + + go func() { + time.Sleep(50 * time.Millisecond) + cancelFirst() + }() + + // This should be blocked until the 1st is canceled, then succeed. + ctx, cancelThird := context.WithTimeout(context.Background(), 500*time.Millisecond) + if _, err := tc.StreamingInputCall(ctx); err != nil { + t.Errorf("%v.StreamingInputCall(_) = _, %v, want _, ", tc, err) + } + cancelThird() +} + +// The following tests the gRPC streaming RPC implementations. +// TODO(zhaoq): Have better coverage on error cases. +var ( + reqSizes = []int{27182, 8, 1828, 45904} + respSizes = []int{31415, 9, 2653, 58979} +) + +func TestNoService(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testNoService(t, e) + } +} + +func testNoService(t *testing.T, e env) { + te := newTest(t, e) + te.startServer(nil) + defer te.tearDown() + + cc := te.clientConn() + tc := testpb.NewTestServiceClient(cc) + + stream, err := tc.FullDuplexCall(te.ctx, grpc.FailFast(false)) + if err != nil { + t.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) + } + if _, err := stream.Recv(); grpc.Code(err) != codes.Unimplemented { + t.Fatalf("stream.Recv() = _, %v, want _, error code %s", err, codes.Unimplemented) + } +} + +func TestPingPong(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testPingPong(t, e) + } +} + +func testPingPong(t *testing.T, e env) { + te := newTest(t, e) + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + tc := testpb.NewTestServiceClient(te.clientConn()) + + stream, err := tc.FullDuplexCall(te.ctx) + if err != nil { + t.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) + } + var index int + for index < len(reqSizes) { + respParam := []*testpb.ResponseParameters{ + { + Size: int32(respSizes[index]), + }, + } + + payload, err := newPayload(testpb.PayloadType_COMPRESSABLE, int32(reqSizes[index])) + if err != nil { + t.Fatal(err) + } + + req := &testpb.StreamingOutputCallRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseParameters: respParam, + Payload: payload, + } + if err := stream.Send(req); err != nil { + t.Fatalf("%v.Send(%v) = %v, want ", stream, req, err) + } + reply, err := stream.Recv() + if err != nil { + t.Fatalf("%v.Recv() = %v, want ", stream, err) + } + pt := reply.GetPayload().GetType() + if pt != testpb.PayloadType_COMPRESSABLE { + t.Fatalf("Got the reply of type %d, want %d", pt, testpb.PayloadType_COMPRESSABLE) + } + size := len(reply.GetPayload().GetBody()) + if size != int(respSizes[index]) { + t.Fatalf("Got reply body of length %d, want %d", size, respSizes[index]) + } + index++ + } + if err := stream.CloseSend(); err != nil { + t.Fatalf("%v.CloseSend() got %v, want %v", stream, err, nil) + } + if _, err := stream.Recv(); err != io.EOF { + t.Fatalf("%v failed to complele the ping pong test: %v", stream, err) + } +} + +func TestMetadataStreamingRPC(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testMetadataStreamingRPC(t, e) + } +} + +func testMetadataStreamingRPC(t *testing.T, e env) { + te := newTest(t, e) + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + tc := testpb.NewTestServiceClient(te.clientConn()) + + ctx := metadata.NewOutgoingContext(te.ctx, testMetadata) + stream, err := tc.FullDuplexCall(ctx) + if err != nil { + t.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) + } + go func() { + headerMD, err := stream.Header() + if e.security == "tls" { + delete(headerMD, "transport_security_type") + } + delete(headerMD, "trailer") // ignore if present + delete(headerMD, "user-agent") + if err != nil || !reflect.DeepEqual(testMetadata, headerMD) { + t.Errorf("#1 %v.Header() = %v, %v, want %v, ", stream, headerMD, err, testMetadata) + } + // test the cached value. + headerMD, err = stream.Header() + delete(headerMD, "trailer") // ignore if present + delete(headerMD, "user-agent") + if err != nil || !reflect.DeepEqual(testMetadata, headerMD) { + t.Errorf("#2 %v.Header() = %v, %v, want %v, ", stream, headerMD, err, testMetadata) + } + err = func() error { + for index := 0; index < len(reqSizes); index++ { + respParam := []*testpb.ResponseParameters{ + { + Size: int32(respSizes[index]), + }, + } + + payload, err := newPayload(testpb.PayloadType_COMPRESSABLE, int32(reqSizes[index])) + if err != nil { + return err + } + + req := &testpb.StreamingOutputCallRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseParameters: respParam, + Payload: payload, + } + if err := stream.Send(req); err != nil { + return fmt.Errorf("%v.Send(%v) = %v, want ", stream, req, err) + } + } + return nil + }() + // Tell the server we're done sending args. + stream.CloseSend() + if err != nil { + t.Error(err) + } + }() + for { + if _, err := stream.Recv(); err != nil { + break + } + } + trailerMD := stream.Trailer() + if !reflect.DeepEqual(testTrailerMetadata, trailerMD) { + t.Fatalf("%v.Trailer() = %v, want %v", stream, trailerMD, testTrailerMetadata) + } +} + +func TestServerStreaming(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testServerStreaming(t, e) + } +} + +func testServerStreaming(t *testing.T, e env) { + te := newTest(t, e) + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + tc := testpb.NewTestServiceClient(te.clientConn()) + + respParam := make([]*testpb.ResponseParameters, len(respSizes)) + for i, s := range respSizes { + respParam[i] = &testpb.ResponseParameters{ + Size: int32(s), + } + } + req := &testpb.StreamingOutputCallRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseParameters: respParam, + } + stream, err := tc.StreamingOutputCall(context.Background(), req) + if err != nil { + t.Fatalf("%v.StreamingOutputCall(_) = _, %v, want ", tc, err) + } + var rpcStatus error + var respCnt int + var index int + for { + reply, err := stream.Recv() + if err != nil { + rpcStatus = err + break + } + pt := reply.GetPayload().GetType() + if pt != testpb.PayloadType_COMPRESSABLE { + t.Fatalf("Got the reply of type %d, want %d", pt, testpb.PayloadType_COMPRESSABLE) + } + size := len(reply.GetPayload().GetBody()) + if size != int(respSizes[index]) { + t.Fatalf("Got reply body of length %d, want %d", size, respSizes[index]) + } + index++ + respCnt++ + } + if rpcStatus != io.EOF { + t.Fatalf("Failed to finish the server streaming rpc: %v, want ", rpcStatus) + } + if respCnt != len(respSizes) { + t.Fatalf("Got %d reply, want %d", len(respSizes), respCnt) + } +} + +func TestFailedServerStreaming(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testFailedServerStreaming(t, e) + } +} + +func testFailedServerStreaming(t *testing.T, e env) { + te := newTest(t, e) + te.userAgent = failAppUA + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + tc := testpb.NewTestServiceClient(te.clientConn()) + + respParam := make([]*testpb.ResponseParameters, len(respSizes)) + for i, s := range respSizes { + respParam[i] = &testpb.ResponseParameters{ + Size: int32(s), + } + } + req := &testpb.StreamingOutputCallRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseParameters: respParam, + } + ctx := metadata.NewOutgoingContext(te.ctx, testMetadata) + stream, err := tc.StreamingOutputCall(ctx, req) + if err != nil { + t.Fatalf("%v.StreamingOutputCall(_) = _, %v, want ", tc, err) + } + wantErr := status.Error(codes.DataLoss, "error for testing: "+failAppUA) + if _, err := stream.Recv(); !reflect.DeepEqual(err, wantErr) { + t.Fatalf("%v.Recv() = _, %v, want _, %v", stream, err, wantErr) + } +} + +// concurrentSendServer is a TestServiceServer whose +// StreamingOutputCall makes ten serial Send calls, sending payloads +// "0".."9", inclusive. TestServerStreamingConcurrent verifies they +// were received in the correct order, and that there were no races. +// +// All other TestServiceServer methods crash if called. +type concurrentSendServer struct { + testpb.TestServiceServer +} + +func (s concurrentSendServer) StreamingOutputCall(args *testpb.StreamingOutputCallRequest, stream testpb.TestService_StreamingOutputCallServer) error { + for i := 0; i < 10; i++ { + stream.Send(&testpb.StreamingOutputCallResponse{ + Payload: &testpb.Payload{ + Body: []byte{'0' + uint8(i)}, + }, + }) + } + return nil +} + +// Tests doing a bunch of concurrent streaming output calls. +func TestServerStreamingConcurrent(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testServerStreamingConcurrent(t, e) + } +} + +func testServerStreamingConcurrent(t *testing.T, e env) { + te := newTest(t, e) + te.startServer(concurrentSendServer{}) + defer te.tearDown() + + cc := te.clientConn() + tc := testpb.NewTestServiceClient(cc) + + doStreamingCall := func() { + req := &testpb.StreamingOutputCallRequest{} + stream, err := tc.StreamingOutputCall(context.Background(), req) + if err != nil { + t.Errorf("%v.StreamingOutputCall(_) = _, %v, want ", tc, err) + return + } + var ngot int + var buf bytes.Buffer + for { + reply, err := stream.Recv() + if err == io.EOF { + break + } + if err != nil { + t.Fatal(err) + } + ngot++ + if buf.Len() > 0 { + buf.WriteByte(',') + } + buf.Write(reply.GetPayload().GetBody()) + } + if want := 10; ngot != want { + t.Errorf("Got %d replies, want %d", ngot, want) + } + if got, want := buf.String(), "0,1,2,3,4,5,6,7,8,9"; got != want { + t.Errorf("Got replies %q; want %q", got, want) + } + } + + var wg sync.WaitGroup + for i := 0; i < 20; i++ { + wg.Add(1) + go func() { + defer wg.Done() + doStreamingCall() + }() + } + wg.Wait() + +} + +func generatePayloadSizes() [][]int { + reqSizes := [][]int{ + {27182, 8, 1828, 45904}, + } + + num8KPayloads := 1024 + eightKPayloads := []int{} + for i := 0; i < num8KPayloads; i++ { + eightKPayloads = append(eightKPayloads, (1 << 13)) + } + reqSizes = append(reqSizes, eightKPayloads) + + num2MPayloads := 8 + twoMPayloads := []int{} + for i := 0; i < num2MPayloads; i++ { + twoMPayloads = append(twoMPayloads, (1 << 21)) + } + reqSizes = append(reqSizes, twoMPayloads) + + return reqSizes +} + +func TestClientStreaming(t *testing.T) { + defer leakcheck.Check(t) + for _, s := range generatePayloadSizes() { + for _, e := range listTestEnv() { + testClientStreaming(t, e, s) + } + } +} + +func testClientStreaming(t *testing.T, e env, sizes []int) { + te := newTest(t, e) + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + tc := testpb.NewTestServiceClient(te.clientConn()) + + ctx, cancel := context.WithTimeout(te.ctx, time.Second*30) + defer cancel() + stream, err := tc.StreamingInputCall(ctx) + if err != nil { + t.Fatalf("%v.StreamingInputCall(_) = _, %v, want ", tc, err) + } + + var sum int + for _, s := range sizes { + payload, err := newPayload(testpb.PayloadType_COMPRESSABLE, int32(s)) + if err != nil { + t.Fatal(err) + } + + req := &testpb.StreamingInputCallRequest{ + Payload: payload, + } + if err := stream.Send(req); err != nil { + t.Fatalf("%v.Send(%v) = %v, want ", stream, req, err) + } + sum += s + } + reply, err := stream.CloseAndRecv() + if err != nil { + t.Fatalf("%v.CloseAndRecv() got error %v, want %v", stream, err, nil) + } + if reply.GetAggregatedPayloadSize() != int32(sum) { + t.Fatalf("%v.CloseAndRecv().GetAggregatePayloadSize() = %v; want %v", stream, reply.GetAggregatedPayloadSize(), sum) + } +} + +func TestClientStreamingError(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + if e.name == "handler-tls" { + continue + } + testClientStreamingError(t, e) + } +} + +func testClientStreamingError(t *testing.T, e env) { + te := newTest(t, e) + te.startServer(&testServer{security: e.security, earlyFail: true}) + defer te.tearDown() + tc := testpb.NewTestServiceClient(te.clientConn()) + + stream, err := tc.StreamingInputCall(te.ctx) + if err != nil { + t.Fatalf("%v.StreamingInputCall(_) = _, %v, want ", tc, err) + } + payload, err := newPayload(testpb.PayloadType_COMPRESSABLE, 1) + if err != nil { + t.Fatal(err) + } + + req := &testpb.StreamingInputCallRequest{ + Payload: payload, + } + // The 1st request should go through. + if err := stream.Send(req); err != nil { + t.Fatalf("%v.Send(%v) = %v, want ", stream, req, err) + } + for { + if err := stream.Send(req); err != io.EOF { + continue + } + if _, err := stream.CloseAndRecv(); grpc.Code(err) != codes.NotFound { + t.Fatalf("%v.CloseAndRecv() = %v, want error %s", stream, err, codes.NotFound) + } + break + } +} + +func TestExceedMaxStreamsLimit(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testExceedMaxStreamsLimit(t, e) + } +} + +func testExceedMaxStreamsLimit(t *testing.T, e env) { + te := newTest(t, e) + te.declareLogNoise( + "http2Client.notifyError got notified that the client transport was broken", + "Conn.resetTransport failed to create client transport", + "grpc: the connection is closing", + ) + te.maxStream = 1 // Only allows 1 live stream per server transport. + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + + cc := te.clientConn() + tc := testpb.NewTestServiceClient(cc) + + _, err := tc.StreamingInputCall(te.ctx) + if err != nil { + t.Fatalf("%v.StreamingInputCall(_) = _, %v, want _, ", tc, err) + } + // Loop until receiving the new max stream setting from the server. + for { + ctx, cancel := context.WithTimeout(context.Background(), 50*time.Millisecond) + defer cancel() + _, err := tc.StreamingInputCall(ctx) + if err == nil { + time.Sleep(50 * time.Millisecond) + continue + } + if grpc.Code(err) == codes.DeadlineExceeded { + break + } + t.Fatalf("%v.StreamingInputCall(_) = _, %v, want _, %s", tc, err, codes.DeadlineExceeded) + } +} + +func TestStreamsQuotaRecovery(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testStreamsQuotaRecovery(t, e) + } +} + +func testStreamsQuotaRecovery(t *testing.T, e env) { + te := newTest(t, e) + te.declareLogNoise( + "http2Client.notifyError got notified that the client transport was broken", + "Conn.resetTransport failed to create client transport", + "grpc: the connection is closing", + ) + te.maxStream = 1 // Allows 1 live stream. + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + + cc := te.clientConn() + tc := testpb.NewTestServiceClient(cc) + if _, err := tc.StreamingInputCall(context.Background()); err != nil { + t.Fatalf("%v.StreamingInputCall(_) = _, %v, want _, ", tc, err) + } + // Loop until the new max stream setting is effective. + for { + ctx, cancel := context.WithTimeout(context.Background(), 50*time.Millisecond) + defer cancel() + _, err := tc.StreamingInputCall(ctx) + if err == nil { + time.Sleep(50 * time.Millisecond) + continue + } + if grpc.Code(err) == codes.DeadlineExceeded { + break + } + t.Fatalf("%v.StreamingInputCall(_) = _, %v, want _, %s", tc, err, codes.DeadlineExceeded) + } + + var wg sync.WaitGroup + for i := 0; i < 10; i++ { + wg.Add(1) + go func() { + defer wg.Done() + payload, err := newPayload(testpb.PayloadType_COMPRESSABLE, 314) + if err != nil { + t.Error(err) + return + } + req := &testpb.SimpleRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseSize: 1592, + Payload: payload, + } + // No rpc should go through due to the max streams limit. + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Millisecond) + defer cancel() + if _, err := tc.UnaryCall(ctx, req, grpc.FailFast(false)); grpc.Code(err) != codes.DeadlineExceeded { + t.Errorf("TestService/UnaryCall(_, _) = _, %v, want _, %s", err, codes.DeadlineExceeded) + } + }() + } + wg.Wait() +} + +func TestCompressServerHasNoSupport(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testCompressServerHasNoSupport(t, e) + } +} + +func testCompressServerHasNoSupport(t *testing.T, e env) { + te := newTest(t, e) + te.serverCompression = false + te.clientCompression = false + te.clientNopCompression = true + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + tc := testpb.NewTestServiceClient(te.clientConn()) + + const argSize = 271828 + const respSize = 314159 + payload, err := newPayload(testpb.PayloadType_COMPRESSABLE, argSize) + if err != nil { + t.Fatal(err) + } + req := &testpb.SimpleRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseSize: respSize, + Payload: payload, + } + if _, err := tc.UnaryCall(context.Background(), req); err == nil || grpc.Code(err) != codes.Unimplemented { + t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want _, error code %s", err, codes.Unimplemented) + } + // Streaming RPC + stream, err := tc.FullDuplexCall(context.Background()) + if err != nil { + t.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) + } + respParam := []*testpb.ResponseParameters{ + { + Size: 31415, + }, + } + payload, err = newPayload(testpb.PayloadType_COMPRESSABLE, int32(31415)) + if err != nil { + t.Fatal(err) + } + sreq := &testpb.StreamingOutputCallRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseParameters: respParam, + Payload: payload, + } + if err := stream.Send(sreq); err != nil { + t.Fatalf("%v.Send(%v) = %v, want ", stream, sreq, err) + } + if _, err := stream.Recv(); err == nil || grpc.Code(err) != codes.Unimplemented { + t.Fatalf("%v.Recv() = %v, want error code %s", stream, err, codes.Unimplemented) + } +} + +func TestCompressOK(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testCompressOK(t, e) + } +} + +func testCompressOK(t *testing.T, e env) { + te := newTest(t, e) + te.serverCompression = true + te.clientCompression = true + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + tc := testpb.NewTestServiceClient(te.clientConn()) + + // Unary call + const argSize = 271828 + const respSize = 314159 + payload, err := newPayload(testpb.PayloadType_COMPRESSABLE, argSize) + if err != nil { + t.Fatal(err) + } + req := &testpb.SimpleRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseSize: respSize, + Payload: payload, + } + ctx := metadata.NewOutgoingContext(context.Background(), metadata.Pairs("something", "something")) + if _, err := tc.UnaryCall(ctx, req); err != nil { + t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want _, ", err) + } + // Streaming RPC + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + stream, err := tc.FullDuplexCall(ctx) + if err != nil { + t.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) + } + respParam := []*testpb.ResponseParameters{ + { + Size: 31415, + }, + } + payload, err = newPayload(testpb.PayloadType_COMPRESSABLE, int32(31415)) + if err != nil { + t.Fatal(err) + } + sreq := &testpb.StreamingOutputCallRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseParameters: respParam, + Payload: payload, + } + if err := stream.Send(sreq); err != nil { + t.Fatalf("%v.Send(%v) = %v, want ", stream, sreq, err) + } + stream.CloseSend() + if _, err := stream.Recv(); err != nil { + t.Fatalf("%v.Recv() = %v, want ", stream, err) + } + if _, err := stream.Recv(); err != io.EOF { + t.Fatalf("%v.Recv() = %v, want io.EOF", stream, err) + } +} + +func TestIdentityEncoding(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testIdentityEncoding(t, e) + } +} + +func testIdentityEncoding(t *testing.T, e env) { + te := newTest(t, e) + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + tc := testpb.NewTestServiceClient(te.clientConn()) + + // Unary call + payload, err := newPayload(testpb.PayloadType_COMPRESSABLE, 5) + if err != nil { + t.Fatal(err) + } + req := &testpb.SimpleRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseSize: 10, + Payload: payload, + } + ctx := metadata.NewOutgoingContext(context.Background(), metadata.Pairs("something", "something")) + if _, err := tc.UnaryCall(ctx, req); err != nil { + t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want _, ", err) + } + // Streaming RPC + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + stream, err := tc.FullDuplexCall(ctx, grpc.UseCompressor("identity")) + if err != nil { + t.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) + } + payload, err = newPayload(testpb.PayloadType_COMPRESSABLE, int32(31415)) + if err != nil { + t.Fatal(err) + } + sreq := &testpb.StreamingOutputCallRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseParameters: []*testpb.ResponseParameters{{Size: 10}}, + Payload: payload, + } + if err := stream.Send(sreq); err != nil { + t.Fatalf("%v.Send(%v) = %v, want ", stream, sreq, err) + } + stream.CloseSend() + if _, err := stream.Recv(); err != nil { + t.Fatalf("%v.Recv() = %v, want ", stream, err) + } + if _, err := stream.Recv(); err != io.EOF { + t.Fatalf("%v.Recv() = %v, want io.EOF", stream, err) + } +} + +func TestUnaryClientInterceptor(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testUnaryClientInterceptor(t, e) + } +} + +func failOkayRPC(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error { + err := invoker(ctx, method, req, reply, cc, opts...) + if err == nil { + return status.Error(codes.NotFound, "") + } + return err +} + +func testUnaryClientInterceptor(t *testing.T, e env) { + te := newTest(t, e) + te.userAgent = testAppUA + te.unaryClientInt = failOkayRPC + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + + tc := testpb.NewTestServiceClient(te.clientConn()) + if _, err := tc.EmptyCall(context.Background(), &testpb.Empty{}); grpc.Code(err) != codes.NotFound { + t.Fatalf("%v.EmptyCall(_, _) = _, %v, want _, error code %s", tc, err, codes.NotFound) + } +} + +func TestStreamClientInterceptor(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testStreamClientInterceptor(t, e) + } +} + +func failOkayStream(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error) { + s, err := streamer(ctx, desc, cc, method, opts...) + if err == nil { + return nil, status.Error(codes.NotFound, "") + } + return s, nil +} + +func testStreamClientInterceptor(t *testing.T, e env) { + te := newTest(t, e) + te.streamClientInt = failOkayStream + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + + tc := testpb.NewTestServiceClient(te.clientConn()) + respParam := []*testpb.ResponseParameters{ + { + Size: int32(1), + }, + } + payload, err := newPayload(testpb.PayloadType_COMPRESSABLE, int32(1)) + if err != nil { + t.Fatal(err) + } + req := &testpb.StreamingOutputCallRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseParameters: respParam, + Payload: payload, + } + if _, err := tc.StreamingOutputCall(context.Background(), req); grpc.Code(err) != codes.NotFound { + t.Fatalf("%v.StreamingOutputCall(_) = _, %v, want _, error code %s", tc, err, codes.NotFound) + } +} + +func TestUnaryServerInterceptor(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testUnaryServerInterceptor(t, e) + } +} + +func errInjector(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { + return nil, status.Error(codes.PermissionDenied, "") +} + +func testUnaryServerInterceptor(t *testing.T, e env) { + te := newTest(t, e) + te.unaryServerInt = errInjector + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + + tc := testpb.NewTestServiceClient(te.clientConn()) + if _, err := tc.EmptyCall(context.Background(), &testpb.Empty{}); grpc.Code(err) != codes.PermissionDenied { + t.Fatalf("%v.EmptyCall(_, _) = _, %v, want _, error code %s", tc, err, codes.PermissionDenied) + } +} + +func TestStreamServerInterceptor(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + // TODO(bradfitz): Temporarily skip this env due to #619. + if e.name == "handler-tls" { + continue + } + testStreamServerInterceptor(t, e) + } +} + +func fullDuplexOnly(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error { + if info.FullMethod == "/grpc.testing.TestService/FullDuplexCall" { + return handler(srv, ss) + } + // Reject the other methods. + return status.Error(codes.PermissionDenied, "") +} + +func testStreamServerInterceptor(t *testing.T, e env) { + te := newTest(t, e) + te.streamServerInt = fullDuplexOnly + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + + tc := testpb.NewTestServiceClient(te.clientConn()) + respParam := []*testpb.ResponseParameters{ + { + Size: int32(1), + }, + } + payload, err := newPayload(testpb.PayloadType_COMPRESSABLE, int32(1)) + if err != nil { + t.Fatal(err) + } + req := &testpb.StreamingOutputCallRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseParameters: respParam, + Payload: payload, + } + s1, err := tc.StreamingOutputCall(context.Background(), req) + if err != nil { + t.Fatalf("%v.StreamingOutputCall(_) = _, %v, want _, ", tc, err) + } + if _, err := s1.Recv(); grpc.Code(err) != codes.PermissionDenied { + t.Fatalf("%v.StreamingInputCall(_) = _, %v, want _, error code %s", tc, err, codes.PermissionDenied) + } + s2, err := tc.FullDuplexCall(context.Background()) + if err != nil { + t.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) + } + if err := s2.Send(req); err != nil { + t.Fatalf("%v.Send(_) = %v, want ", s2, err) + } + if _, err := s2.Recv(); err != nil { + t.Fatalf("%v.Recv() = _, %v, want _, ", s2, err) + } +} + +// funcServer implements methods of TestServiceServer using funcs, +// similar to an http.HandlerFunc. +// Any unimplemented method will crash. Tests implement the method(s) +// they need. +type funcServer struct { + testpb.TestServiceServer + unaryCall func(ctx context.Context, in *testpb.SimpleRequest) (*testpb.SimpleResponse, error) + streamingInputCall func(stream testpb.TestService_StreamingInputCallServer) error +} + +func (s *funcServer) UnaryCall(ctx context.Context, in *testpb.SimpleRequest) (*testpb.SimpleResponse, error) { + return s.unaryCall(ctx, in) +} + +func (s *funcServer) StreamingInputCall(stream testpb.TestService_StreamingInputCallServer) error { + return s.streamingInputCall(stream) +} + +func TestClientRequestBodyErrorUnexpectedEOF(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testClientRequestBodyErrorUnexpectedEOF(t, e) + } +} + +func testClientRequestBodyErrorUnexpectedEOF(t *testing.T, e env) { + te := newTest(t, e) + ts := &funcServer{unaryCall: func(ctx context.Context, in *testpb.SimpleRequest) (*testpb.SimpleResponse, error) { + errUnexpectedCall := errors.New("unexpected call func server method") + t.Error(errUnexpectedCall) + return nil, errUnexpectedCall + }} + te.startServer(ts) + defer te.tearDown() + te.withServerTester(func(st *serverTester) { + st.writeHeadersGRPC(1, "/grpc.testing.TestService/UnaryCall") + // Say we have 5 bytes coming, but set END_STREAM flag: + st.writeData(1, true, []byte{0, 0, 0, 0, 5}) + st.wantAnyFrame() // wait for server to crash (it used to crash) + }) +} + +func TestClientRequestBodyErrorCloseAfterLength(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testClientRequestBodyErrorCloseAfterLength(t, e) + } +} + +func testClientRequestBodyErrorCloseAfterLength(t *testing.T, e env) { + te := newTest(t, e) + te.declareLogNoise("Server.processUnaryRPC failed to write status") + ts := &funcServer{unaryCall: func(ctx context.Context, in *testpb.SimpleRequest) (*testpb.SimpleResponse, error) { + errUnexpectedCall := errors.New("unexpected call func server method") + t.Error(errUnexpectedCall) + return nil, errUnexpectedCall + }} + te.startServer(ts) + defer te.tearDown() + te.withServerTester(func(st *serverTester) { + st.writeHeadersGRPC(1, "/grpc.testing.TestService/UnaryCall") + // say we're sending 5 bytes, but then close the connection instead. + st.writeData(1, false, []byte{0, 0, 0, 0, 5}) + st.cc.Close() + }) +} + +func TestClientRequestBodyErrorCancel(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testClientRequestBodyErrorCancel(t, e) + } +} + +func testClientRequestBodyErrorCancel(t *testing.T, e env) { + te := newTest(t, e) + gotCall := make(chan bool, 1) + ts := &funcServer{unaryCall: func(ctx context.Context, in *testpb.SimpleRequest) (*testpb.SimpleResponse, error) { + gotCall <- true + return new(testpb.SimpleResponse), nil + }} + te.startServer(ts) + defer te.tearDown() + te.withServerTester(func(st *serverTester) { + st.writeHeadersGRPC(1, "/grpc.testing.TestService/UnaryCall") + // Say we have 5 bytes coming, but cancel it instead. + st.writeRSTStream(1, http2.ErrCodeCancel) + st.writeData(1, false, []byte{0, 0, 0, 0, 5}) + + // Verify we didn't a call yet. + select { + case <-gotCall: + t.Fatal("unexpected call") + default: + } + + // And now send an uncanceled (but still invalid), just to get a response. + st.writeHeadersGRPC(3, "/grpc.testing.TestService/UnaryCall") + st.writeData(3, true, []byte{0, 0, 0, 0, 0}) + <-gotCall + st.wantAnyFrame() + }) +} + +func TestClientRequestBodyErrorCancelStreamingInput(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testClientRequestBodyErrorCancelStreamingInput(t, e) + } +} + +func testClientRequestBodyErrorCancelStreamingInput(t *testing.T, e env) { + te := newTest(t, e) + recvErr := make(chan error, 1) + ts := &funcServer{streamingInputCall: func(stream testpb.TestService_StreamingInputCallServer) error { + _, err := stream.Recv() + recvErr <- err + return nil + }} + te.startServer(ts) + defer te.tearDown() + te.withServerTester(func(st *serverTester) { + st.writeHeadersGRPC(1, "/grpc.testing.TestService/StreamingInputCall") + // Say we have 5 bytes coming, but cancel it instead. + st.writeData(1, false, []byte{0, 0, 0, 0, 5}) + st.writeRSTStream(1, http2.ErrCodeCancel) + + var got error + select { + case got = <-recvErr: + case <-time.After(3 * time.Second): + t.Fatal("timeout waiting for error") + } + if grpc.Code(got) != codes.Canceled { + t.Errorf("error = %#v; want error code %s", got, codes.Canceled) + } + }) +} + +type clientTimeoutCreds struct { + timeoutReturned bool +} + +func (c *clientTimeoutCreds) ClientHandshake(ctx context.Context, addr string, rawConn net.Conn) (net.Conn, credentials.AuthInfo, error) { + if !c.timeoutReturned { + c.timeoutReturned = true + return nil, nil, context.DeadlineExceeded + } + return rawConn, nil, nil +} +func (c *clientTimeoutCreds) ServerHandshake(rawConn net.Conn) (net.Conn, credentials.AuthInfo, error) { + return rawConn, nil, nil +} +func (c *clientTimeoutCreds) Info() credentials.ProtocolInfo { + return credentials.ProtocolInfo{} +} +func (c *clientTimeoutCreds) Clone() credentials.TransportCredentials { + return nil +} +func (c *clientTimeoutCreds) OverrideServerName(s string) error { + return nil +} + +func TestNonFailFastRPCSucceedOnTimeoutCreds(t *testing.T) { + te := newTest(t, env{name: "timeout-cred", network: "tcp", security: "clientTimeoutCreds", balancer: "v1"}) + te.userAgent = testAppUA + te.startServer(&testServer{security: te.e.security}) + defer te.tearDown() + + cc := te.clientConn() + tc := testpb.NewTestServiceClient(cc) + // This unary call should succeed, because ClientHandshake will succeed for the second time. + if _, err := tc.EmptyCall(context.Background(), &testpb.Empty{}, grpc.FailFast(false)); err != nil { + te.t.Fatalf("TestService/EmptyCall(_, _) = _, %v, want ", err) + } +} + +type serverDispatchCred struct { + rawConnCh chan net.Conn +} + +func newServerDispatchCred() *serverDispatchCred { + return &serverDispatchCred{ + rawConnCh: make(chan net.Conn, 1), + } +} +func (c *serverDispatchCred) ClientHandshake(ctx context.Context, addr string, rawConn net.Conn) (net.Conn, credentials.AuthInfo, error) { + return rawConn, nil, nil +} +func (c *serverDispatchCred) ServerHandshake(rawConn net.Conn) (net.Conn, credentials.AuthInfo, error) { + select { + case c.rawConnCh <- rawConn: + default: + } + return nil, nil, credentials.ErrConnDispatched +} +func (c *serverDispatchCred) Info() credentials.ProtocolInfo { + return credentials.ProtocolInfo{} +} +func (c *serverDispatchCred) Clone() credentials.TransportCredentials { + return nil +} +func (c *serverDispatchCred) OverrideServerName(s string) error { + return nil +} +func (c *serverDispatchCred) getRawConn() net.Conn { + return <-c.rawConnCh +} + +func TestServerCredsDispatch(t *testing.T) { + lis, err := net.Listen("tcp", "localhost:0") + if err != nil { + t.Fatalf("Failed to listen: %v", err) + } + cred := newServerDispatchCred() + s := grpc.NewServer(grpc.Creds(cred)) + go s.Serve(lis) + defer s.Stop() + + cc, err := grpc.Dial(lis.Addr().String(), grpc.WithTransportCredentials(cred)) + if err != nil { + t.Fatalf("grpc.Dial(%q) = %v", lis.Addr().String(), err) + } + defer cc.Close() + + rawConn := cred.getRawConn() + // Give grpc a chance to see the error and potentially close the connection. + // And check that connection is not closed after that. + time.Sleep(100 * time.Millisecond) + // Check rawConn is not closed. + if n, err := rawConn.Write([]byte{0}); n <= 0 || err != nil { + t.Errorf("Read() = %v, %v; want n>0, ", n, err) + } +} + +type authorityCheckCreds struct { + got string +} + +func (c *authorityCheckCreds) ServerHandshake(rawConn net.Conn) (net.Conn, credentials.AuthInfo, error) { + return rawConn, nil, nil +} +func (c *authorityCheckCreds) ClientHandshake(ctx context.Context, authority string, rawConn net.Conn) (net.Conn, credentials.AuthInfo, error) { + c.got = authority + return rawConn, nil, nil +} +func (c *authorityCheckCreds) Info() credentials.ProtocolInfo { + return credentials.ProtocolInfo{} +} +func (c *authorityCheckCreds) Clone() credentials.TransportCredentials { + return c +} +func (c *authorityCheckCreds) OverrideServerName(s string) error { + return nil +} + +// This test makes sure that the authority client handshake gets is the endpoint +// in dial target, not the resolved ip address. +func TestCredsHandshakeAuthority(t *testing.T) { + const testAuthority = "test.auth.ori.ty" + + lis, err := net.Listen("tcp", "localhost:0") + if err != nil { + t.Fatalf("Failed to listen: %v", err) + } + cred := &authorityCheckCreds{} + s := grpc.NewServer() + go s.Serve(lis) + defer s.Stop() + + r, rcleanup := manual.GenerateAndRegisterManualResolver() + defer rcleanup() + + cc, err := grpc.Dial(r.Scheme()+":///"+testAuthority, grpc.WithTransportCredentials(cred)) + if err != nil { + t.Fatalf("grpc.Dial(%q) = %v", lis.Addr().String(), err) + } + defer cc.Close() + r.NewAddress([]resolver.Address{{Addr: lis.Addr().String()}}) + + ctx, cancel := context.WithTimeout(context.Background(), 100*time.Millisecond) + defer cancel() + for { + s := cc.GetState() + if s == connectivity.Ready { + break + } + if !cc.WaitForStateChange(ctx, s) { + // ctx got timeout or canceled. + t.Fatalf("ClientConn is not ready after 100 ms") + } + } + + if cred.got != testAuthority { + t.Fatalf("client creds got authority: %q, want: %q", cred.got, testAuthority) + } +} + +type clientFailCreds struct { + got string +} + +func (c *clientFailCreds) ServerHandshake(rawConn net.Conn) (net.Conn, credentials.AuthInfo, error) { + return rawConn, nil, nil +} +func (c *clientFailCreds) ClientHandshake(ctx context.Context, authority string, rawConn net.Conn) (net.Conn, credentials.AuthInfo, error) { + return nil, nil, fmt.Errorf("client handshake fails with fatal error") +} +func (c *clientFailCreds) Info() credentials.ProtocolInfo { + return credentials.ProtocolInfo{} +} +func (c *clientFailCreds) Clone() credentials.TransportCredentials { + return c +} +func (c *clientFailCreds) OverrideServerName(s string) error { + return nil +} + +// This test makes sure that failfast RPCs fail if client handshake fails with +// fatal errors. +func TestFailfastRPCFailOnFatalHandshakeError(t *testing.T) { + lis, err := net.Listen("tcp", "localhost:0") + if err != nil { + t.Fatalf("Failed to listen: %v", err) + } + defer lis.Close() + + cc, err := grpc.Dial("passthrough:///"+lis.Addr().String(), grpc.WithTransportCredentials(&clientFailCreds{})) + if err != nil { + t.Fatalf("grpc.Dial(_) = %v", err) + } + defer cc.Close() + + tc := testpb.NewTestServiceClient(cc) + // This unary call should fail, but not timeout. + ctx, cancel := context.WithTimeout(context.Background(), time.Second) + defer cancel() + if _, err := tc.EmptyCall(ctx, &testpb.Empty{}, grpc.FailFast(true)); grpc.Code(err) != codes.Unavailable { + t.Fatalf("TestService/EmptyCall(_, _) = _, %v, want ", err) + } +} + +func TestFlowControlLogicalRace(t *testing.T) { + // Test for a regression of https://github.com/grpc/grpc-go/issues/632, + // and other flow control bugs. + + defer leakcheck.Check(t) + + const ( + itemCount = 100 + itemSize = 1 << 10 + recvCount = 2 + maxFailures = 3 + + requestTimeout = time.Second * 5 + ) + + requestCount := 10000 + if raceMode { + requestCount = 1000 + } + + lis, err := net.Listen("tcp", "localhost:0") + if err != nil { + t.Fatalf("Failed to listen: %v", err) + } + defer lis.Close() + + s := grpc.NewServer() + testpb.RegisterTestServiceServer(s, &flowControlLogicalRaceServer{ + itemCount: itemCount, + itemSize: itemSize, + }) + defer s.Stop() + + go s.Serve(lis) + + ctx := context.Background() + + cc, err := grpc.Dial(lis.Addr().String(), grpc.WithInsecure(), grpc.WithBlock()) + if err != nil { + t.Fatalf("grpc.Dial(%q) = %v", lis.Addr().String(), err) + } + defer cc.Close() + cl := testpb.NewTestServiceClient(cc) + + failures := 0 + for i := 0; i < requestCount; i++ { + ctx, cancel := context.WithTimeout(ctx, requestTimeout) + output, err := cl.StreamingOutputCall(ctx, &testpb.StreamingOutputCallRequest{}) + if err != nil { + t.Fatalf("StreamingOutputCall; err = %q", err) + } + + j := 0 + loop: + for ; j < recvCount; j++ { + _, err := output.Recv() + if err != nil { + if err == io.EOF { + break loop + } + switch grpc.Code(err) { + case codes.DeadlineExceeded: + break loop + default: + t.Fatalf("Recv; err = %q", err) + } + } + } + cancel() + <-ctx.Done() + + if j < recvCount { + t.Errorf("got %d responses to request %d", j, i) + failures++ + if failures >= maxFailures { + // Continue past the first failure to see if the connection is + // entirely broken, or if only a single RPC was affected + break + } + } + } +} + +type flowControlLogicalRaceServer struct { + testpb.TestServiceServer + + itemSize int + itemCount int +} + +func (s *flowControlLogicalRaceServer) StreamingOutputCall(req *testpb.StreamingOutputCallRequest, srv testpb.TestService_StreamingOutputCallServer) error { + for i := 0; i < s.itemCount; i++ { + err := srv.Send(&testpb.StreamingOutputCallResponse{ + Payload: &testpb.Payload{ + // Sending a large stream of data which the client reject + // helps to trigger some types of flow control bugs. + // + // Reallocating memory here is inefficient, but the stress it + // puts on the GC leads to more frequent flow control + // failures. The GC likely causes more variety in the + // goroutine scheduling orders. + Body: bytes.Repeat([]byte("a"), s.itemSize), + }, + }) + if err != nil { + return err + } + } + return nil +} + +type lockingWriter struct { + mu sync.Mutex + w io.Writer +} + +func (lw *lockingWriter) Write(p []byte) (n int, err error) { + lw.mu.Lock() + defer lw.mu.Unlock() + return lw.w.Write(p) +} + +func (lw *lockingWriter) setWriter(w io.Writer) { + lw.mu.Lock() + defer lw.mu.Unlock() + lw.w = w +} + +var testLogOutput = &lockingWriter{w: os.Stderr} + +// awaitNewConnLogOutput waits for any of grpc.NewConn's goroutines to +// terminate, if they're still running. It spams logs with this +// message. We wait for it so our log filter is still +// active. Otherwise the "defer restore()" at the top of various test +// functions restores our log filter and then the goroutine spams. +func awaitNewConnLogOutput() { + awaitLogOutput(50*time.Millisecond, "grpc: the client connection is closing; please retry") +} + +func awaitLogOutput(maxWait time.Duration, phrase string) { + pb := []byte(phrase) + + timer := time.NewTimer(maxWait) + defer timer.Stop() + wakeup := make(chan bool, 1) + for { + if logOutputHasContents(pb, wakeup) { + return + } + select { + case <-timer.C: + // Too slow. Oh well. + return + case <-wakeup: + } + } +} + +func logOutputHasContents(v []byte, wakeup chan<- bool) bool { + testLogOutput.mu.Lock() + defer testLogOutput.mu.Unlock() + fw, ok := testLogOutput.w.(*filterWriter) + if !ok { + return false + } + fw.mu.Lock() + defer fw.mu.Unlock() + if bytes.Contains(fw.buf.Bytes(), v) { + return true + } + fw.wakeup = wakeup + return false +} + +var verboseLogs = flag.Bool("verbose_logs", false, "show all grpclog output, without filtering") + +func noop() {} + +// declareLogNoise declares that t is expected to emit the following noisy phrases, +// even on success. Those phrases will be filtered from grpclog output +// and only be shown if *verbose_logs or t ends up failing. +// The returned restore function should be called with defer to be run +// before the test ends. +func declareLogNoise(t *testing.T, phrases ...string) (restore func()) { + if *verboseLogs { + return noop + } + fw := &filterWriter{dst: os.Stderr, filter: phrases} + testLogOutput.setWriter(fw) + return func() { + if t.Failed() { + fw.mu.Lock() + defer fw.mu.Unlock() + if fw.buf.Len() > 0 { + t.Logf("Complete log output:\n%s", fw.buf.Bytes()) + } + } + testLogOutput.setWriter(os.Stderr) + } +} + +type filterWriter struct { + dst io.Writer + filter []string + + mu sync.Mutex + buf bytes.Buffer + wakeup chan<- bool // if non-nil, gets true on write +} + +func (fw *filterWriter) Write(p []byte) (n int, err error) { + fw.mu.Lock() + fw.buf.Write(p) + if fw.wakeup != nil { + select { + case fw.wakeup <- true: + default: + } + } + fw.mu.Unlock() + + ps := string(p) + for _, f := range fw.filter { + if strings.Contains(ps, f) { + return len(p), nil + } + } + return fw.dst.Write(p) +} + +// stubServer is a server that is easy to customize within individual test +// cases. +type stubServer struct { + // Guarantees we satisfy this interface; panics if unimplemented methods are called. + testpb.TestServiceServer + + // Customizable implementations of server handlers. + emptyCall func(ctx context.Context, in *testpb.Empty) (*testpb.Empty, error) + fullDuplexCall func(stream testpb.TestService_FullDuplexCallServer) error + + // A client connected to this service the test may use. Created in Start(). + client testpb.TestServiceClient + + cleanups []func() // Lambdas executed in Stop(); populated by Start(). +} + +func (ss *stubServer) EmptyCall(ctx context.Context, in *testpb.Empty) (*testpb.Empty, error) { + return ss.emptyCall(ctx, in) +} + +func (ss *stubServer) FullDuplexCall(stream testpb.TestService_FullDuplexCallServer) error { + return ss.fullDuplexCall(stream) +} + +// Start starts the server and creates a client connected to it. +func (ss *stubServer) Start(sopts []grpc.ServerOption) error { + lis, err := net.Listen("tcp", "localhost:0") + if err != nil { + return fmt.Errorf(`net.Listen("tcp", "localhost:0") = %v`, err) + } + ss.cleanups = append(ss.cleanups, func() { lis.Close() }) + + s := grpc.NewServer(sopts...) + testpb.RegisterTestServiceServer(s, ss) + go s.Serve(lis) + ss.cleanups = append(ss.cleanups, s.Stop) + + cc, err := grpc.Dial(lis.Addr().String(), grpc.WithInsecure(), grpc.WithBlock()) + if err != nil { + return fmt.Errorf("grpc.Dial(%q) = %v", lis.Addr().String(), err) + } + ss.cleanups = append(ss.cleanups, func() { cc.Close() }) + + ss.client = testpb.NewTestServiceClient(cc) + return nil +} + +func (ss *stubServer) Stop() { + for i := len(ss.cleanups) - 1; i >= 0; i-- { + ss.cleanups[i]() + } +} + +func TestUnaryProxyDoesNotForwardMetadata(t *testing.T) { + const mdkey = "somedata" + + // endpoint ensures mdkey is NOT in metadata and returns an error if it is. + endpoint := &stubServer{ + emptyCall: func(ctx context.Context, in *testpb.Empty) (*testpb.Empty, error) { + if md, ok := metadata.FromIncomingContext(ctx); !ok || md[mdkey] != nil { + return nil, status.Errorf(codes.Internal, "endpoint: md=%v; want !contains(%q)", md, mdkey) + } + return &testpb.Empty{}, nil + }, + } + if err := endpoint.Start(nil); err != nil { + t.Fatalf("Error starting endpoint server: %v", err) + } + defer endpoint.Stop() + + // proxy ensures mdkey IS in metadata, then forwards the RPC to endpoint + // without explicitly copying the metadata. + proxy := &stubServer{ + emptyCall: func(ctx context.Context, in *testpb.Empty) (*testpb.Empty, error) { + if md, ok := metadata.FromIncomingContext(ctx); !ok || md[mdkey] == nil { + return nil, status.Errorf(codes.Internal, "proxy: md=%v; want contains(%q)", md, mdkey) + } + return endpoint.client.EmptyCall(ctx, in) + }, + } + if err := proxy.Start(nil); err != nil { + t.Fatalf("Error starting proxy server: %v", err) + } + defer proxy.Stop() + + ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second) + defer cancel() + md := metadata.Pairs(mdkey, "val") + ctx = metadata.NewOutgoingContext(ctx, md) + + // Sanity check that endpoint properly errors when it sees mdkey. + _, err := endpoint.client.EmptyCall(ctx, &testpb.Empty{}) + if s, ok := status.FromError(err); !ok || s.Code() != codes.Internal { + t.Fatalf("endpoint.client.EmptyCall(_, _) = _, %v; want _, ", err) + } + + if _, err := proxy.client.EmptyCall(ctx, &testpb.Empty{}); err != nil { + t.Fatal(err.Error()) + } +} + +func TestStreamingProxyDoesNotForwardMetadata(t *testing.T) { + const mdkey = "somedata" + + // doFDC performs a FullDuplexCall with client and returns the error from the + // first stream.Recv call, or nil if that error is io.EOF. Calls t.Fatal if + // the stream cannot be established. + doFDC := func(ctx context.Context, client testpb.TestServiceClient) error { + stream, err := client.FullDuplexCall(ctx) + if err != nil { + t.Fatalf("Unwanted error: %v", err) + } + if _, err := stream.Recv(); err != io.EOF { + return err + } + return nil + } + + // endpoint ensures mdkey is NOT in metadata and returns an error if it is. + endpoint := &stubServer{ + fullDuplexCall: func(stream testpb.TestService_FullDuplexCallServer) error { + ctx := stream.Context() + if md, ok := metadata.FromIncomingContext(ctx); !ok || md[mdkey] != nil { + return status.Errorf(codes.Internal, "endpoint: md=%v; want !contains(%q)", md, mdkey) + } + return nil + }, + } + if err := endpoint.Start(nil); err != nil { + t.Fatalf("Error starting endpoint server: %v", err) + } + defer endpoint.Stop() + + // proxy ensures mdkey IS in metadata, then forwards the RPC to endpoint + // without explicitly copying the metadata. + proxy := &stubServer{ + fullDuplexCall: func(stream testpb.TestService_FullDuplexCallServer) error { + ctx := stream.Context() + if md, ok := metadata.FromIncomingContext(ctx); !ok || md[mdkey] == nil { + return status.Errorf(codes.Internal, "endpoint: md=%v; want !contains(%q)", md, mdkey) + } + return doFDC(ctx, endpoint.client) + }, + } + if err := proxy.Start(nil); err != nil { + t.Fatalf("Error starting proxy server: %v", err) + } + defer proxy.Stop() + + ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second) + defer cancel() + md := metadata.Pairs(mdkey, "val") + ctx = metadata.NewOutgoingContext(ctx, md) + + // Sanity check that endpoint properly errors when it sees mdkey in ctx. + err := doFDC(ctx, endpoint.client) + if s, ok := status.FromError(err); !ok || s.Code() != codes.Internal { + t.Fatalf("stream.Recv() = _, %v; want _, ", err) + } + + if err := doFDC(ctx, proxy.client); err != nil { + t.Fatalf("doFDC(_, proxy.client) = %v; want nil", err) + } +} + +func TestStatsTagsAndTrace(t *testing.T) { + // Data added to context by client (typically in a stats handler). + tags := []byte{1, 5, 2, 4, 3} + trace := []byte{5, 2, 1, 3, 4} + + // endpoint ensures Tags() and Trace() in context match those that were added + // by the client and returns an error if not. + endpoint := &stubServer{ + emptyCall: func(ctx context.Context, in *testpb.Empty) (*testpb.Empty, error) { + md, _ := metadata.FromIncomingContext(ctx) + if tg := stats.Tags(ctx); !reflect.DeepEqual(tg, tags) { + return nil, status.Errorf(codes.Internal, "stats.Tags(%v)=%v; want %v", ctx, tg, tags) + } + if !reflect.DeepEqual(md["grpc-tags-bin"], []string{string(tags)}) { + return nil, status.Errorf(codes.Internal, "md['grpc-tags-bin']=%v; want %v", md["grpc-tags-bin"], tags) + } + if tr := stats.Trace(ctx); !reflect.DeepEqual(tr, trace) { + return nil, status.Errorf(codes.Internal, "stats.Trace(%v)=%v; want %v", ctx, tr, trace) + } + if !reflect.DeepEqual(md["grpc-trace-bin"], []string{string(trace)}) { + return nil, status.Errorf(codes.Internal, "md['grpc-trace-bin']=%v; want %v", md["grpc-trace-bin"], trace) + } + return &testpb.Empty{}, nil + }, + } + if err := endpoint.Start(nil); err != nil { + t.Fatalf("Error starting endpoint server: %v", err) + } + defer endpoint.Stop() + + ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second) + defer cancel() + + testCases := []struct { + ctx context.Context + want codes.Code + }{ + {ctx: ctx, want: codes.Internal}, + {ctx: stats.SetTags(ctx, tags), want: codes.Internal}, + {ctx: stats.SetTrace(ctx, trace), want: codes.Internal}, + {ctx: stats.SetTags(stats.SetTrace(ctx, tags), tags), want: codes.Internal}, + {ctx: stats.SetTags(stats.SetTrace(ctx, trace), tags), want: codes.OK}, + } + + for _, tc := range testCases { + _, err := endpoint.client.EmptyCall(tc.ctx, &testpb.Empty{}) + if tc.want == codes.OK && err != nil { + t.Fatalf("endpoint.client.EmptyCall(%v, _) = _, %v; want _, nil", tc.ctx, err) + } + if s, ok := status.FromError(err); !ok || s.Code() != tc.want { + t.Fatalf("endpoint.client.EmptyCall(%v, _) = _, %v; want _, ", tc.ctx, err, tc.want) + } + } +} + +func TestTapTimeout(t *testing.T) { + sopts := []grpc.ServerOption{ + grpc.InTapHandle(func(ctx context.Context, _ *tap.Info) (context.Context, error) { + c, cancel := context.WithCancel(ctx) + // Call cancel instead of setting a deadline so we can detect which error + // occurred -- this cancellation (desired) or the client's deadline + // expired (indicating this cancellation did not affect the RPC). + time.AfterFunc(10*time.Millisecond, cancel) + return c, nil + }), + } + + ss := &stubServer{ + emptyCall: func(ctx context.Context, in *testpb.Empty) (*testpb.Empty, error) { + <-ctx.Done() + return &testpb.Empty{}, nil + }, + } + if err := ss.Start(sopts); err != nil { + t.Fatalf("Error starting endpoint server: %v", err) + } + defer ss.Stop() + + // This was known to be flaky; test several times. + for i := 0; i < 10; i++ { + // Set our own deadline in case the server hangs. + ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second) + res, err := ss.client.EmptyCall(ctx, &testpb.Empty{}) + cancel() + if s, ok := status.FromError(err); !ok || s.Code() != codes.Canceled { + t.Fatalf("ss.client.EmptyCall(context.Background(), _) = %v, %v; want nil, ", res, err) + } + } +} + +type windowSizeConfig struct { + serverStream int32 + serverConn int32 + clientStream int32 + clientConn int32 +} + +func max(a, b int32) int32 { + if a > b { + return a + } + return b +} + +func TestConfigurableWindowSizeWithLargeWindow(t *testing.T) { + defer leakcheck.Check(t) + wc := windowSizeConfig{ + serverStream: 8 * 1024 * 1024, + serverConn: 12 * 1024 * 1024, + clientStream: 6 * 1024 * 1024, + clientConn: 8 * 1024 * 1024, + } + for _, e := range listTestEnv() { + testConfigurableWindowSize(t, e, wc) + } +} + +func TestConfigurableWindowSizeWithSmallWindow(t *testing.T) { + defer leakcheck.Check(t) + wc := windowSizeConfig{ + serverStream: 1, + serverConn: 1, + clientStream: 1, + clientConn: 1, + } + for _, e := range listTestEnv() { + testConfigurableWindowSize(t, e, wc) + } +} + +func testConfigurableWindowSize(t *testing.T, e env, wc windowSizeConfig) { + te := newTest(t, e) + te.serverInitialWindowSize = wc.serverStream + te.serverInitialConnWindowSize = wc.serverConn + te.clientInitialWindowSize = wc.clientStream + te.clientInitialConnWindowSize = wc.clientConn + + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + + cc := te.clientConn() + tc := testpb.NewTestServiceClient(cc) + stream, err := tc.FullDuplexCall(context.Background()) + if err != nil { + t.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) + } + numOfIter := 11 + // Set message size to exhaust largest of window sizes. + messageSize := max(max(wc.serverStream, wc.serverConn), max(wc.clientStream, wc.clientConn)) / int32(numOfIter-1) + messageSize = max(messageSize, 64*1024) + payload, err := newPayload(testpb.PayloadType_COMPRESSABLE, messageSize) + if err != nil { + t.Fatal(err) + } + respParams := []*testpb.ResponseParameters{ + { + Size: messageSize, + }, + } + req := &testpb.StreamingOutputCallRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseParameters: respParams, + Payload: payload, + } + for i := 0; i < numOfIter; i++ { + if err := stream.Send(req); err != nil { + t.Fatalf("%v.Send(%v) = %v, want ", stream, req, err) + } + if _, err := stream.Recv(); err != nil { + t.Fatalf("%v.Recv() = _, %v, want _, ", stream, err) + } + } + if err := stream.CloseSend(); err != nil { + t.Fatalf("%v.CloseSend() = %v, want ", stream, err) + } +} + +var ( + // test authdata + authdata = map[string]string{ + "test-key": "test-value", + "test-key2-bin": string([]byte{1, 2, 3}), + } +) + +type testPerRPCCredentials struct{} + +func (cr testPerRPCCredentials) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) { + return authdata, nil +} + +func (cr testPerRPCCredentials) RequireTransportSecurity() bool { + return false +} + +func authHandle(ctx context.Context, info *tap.Info) (context.Context, error) { + md, ok := metadata.FromIncomingContext(ctx) + if !ok { + return ctx, fmt.Errorf("didn't find metadata in context") + } + for k, vwant := range authdata { + vgot, ok := md[k] + if !ok { + return ctx, fmt.Errorf("didn't find authdata key %v in context", k) + } + if vgot[0] != vwant { + return ctx, fmt.Errorf("for key %v, got value %v, want %v", k, vgot, vwant) + } + } + return ctx, nil +} + +func TestPerRPCCredentialsViaDialOptions(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testPerRPCCredentialsViaDialOptions(t, e) + } +} + +func testPerRPCCredentialsViaDialOptions(t *testing.T, e env) { + te := newTest(t, e) + te.tapHandle = authHandle + te.perRPCCreds = testPerRPCCredentials{} + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + + cc := te.clientConn() + tc := testpb.NewTestServiceClient(cc) + if _, err := tc.EmptyCall(context.Background(), &testpb.Empty{}); err != nil { + t.Fatalf("Test failed. Reason: %v", err) + } +} + +func TestPerRPCCredentialsViaCallOptions(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testPerRPCCredentialsViaCallOptions(t, e) + } +} + +func testPerRPCCredentialsViaCallOptions(t *testing.T, e env) { + te := newTest(t, e) + te.tapHandle = authHandle + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + + cc := te.clientConn() + tc := testpb.NewTestServiceClient(cc) + if _, err := tc.EmptyCall(context.Background(), &testpb.Empty{}, grpc.PerRPCCredentials(testPerRPCCredentials{})); err != nil { + t.Fatalf("Test failed. Reason: %v", err) + } +} + +func TestPerRPCCredentialsViaDialOptionsAndCallOptions(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testPerRPCCredentialsViaDialOptionsAndCallOptions(t, e) + } +} + +func testPerRPCCredentialsViaDialOptionsAndCallOptions(t *testing.T, e env) { + te := newTest(t, e) + te.perRPCCreds = testPerRPCCredentials{} + // When credentials are provided via both dial options and call options, + // we apply both sets. + te.tapHandle = func(ctx context.Context, _ *tap.Info) (context.Context, error) { + md, ok := metadata.FromIncomingContext(ctx) + if !ok { + return ctx, fmt.Errorf("couldn't find metadata in context") + } + for k, vwant := range authdata { + vgot, ok := md[k] + if !ok { + return ctx, fmt.Errorf("couldn't find metadata for key %v", k) + } + if len(vgot) != 2 { + return ctx, fmt.Errorf("len of value for key %v was %v, want 2", k, len(vgot)) + } + if vgot[0] != vwant || vgot[1] != vwant { + return ctx, fmt.Errorf("value for %v was %v, want [%v, %v]", k, vgot, vwant, vwant) + } + } + return ctx, nil + } + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + + cc := te.clientConn() + tc := testpb.NewTestServiceClient(cc) + if _, err := tc.EmptyCall(context.Background(), &testpb.Empty{}, grpc.PerRPCCredentials(testPerRPCCredentials{})); err != nil { + t.Fatalf("Test failed. Reason: %v", err) + } +} + +func TestWaitForReadyConnection(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testWaitForReadyConnection(t, e) + } + +} + +func testWaitForReadyConnection(t *testing.T, e env) { + te := newTest(t, e) + te.userAgent = testAppUA + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + + cc := te.clientConn() // Non-blocking dial. + tc := testpb.NewTestServiceClient(cc) + ctx, cancel := context.WithTimeout(context.Background(), time.Second) + defer cancel() + state := cc.GetState() + // Wait for connection to be Ready. + for ; state != connectivity.Ready && cc.WaitForStateChange(ctx, state); state = cc.GetState() { + } + if state != connectivity.Ready { + t.Fatalf("Want connection state to be Ready, got %v", state) + } + ctx, cancel = context.WithTimeout(context.Background(), time.Second) + defer cancel() + // Make a fail-fast RPC. + if _, err := tc.EmptyCall(ctx, &testpb.Empty{}); err != nil { + t.Fatalf("TestService/EmptyCall(_,_) = _, %v, want _, nil", err) + } +} + +type errCodec struct { + noError bool +} + +func (c *errCodec) Marshal(v interface{}) ([]byte, error) { + if c.noError { + return []byte{}, nil + } + return nil, fmt.Errorf("3987^12 + 4365^12 = 4472^12") +} + +func (c *errCodec) Unmarshal(data []byte, v interface{}) error { + return nil +} + +func (c *errCodec) String() string { + return "Fermat's near-miss." +} + +func TestEncodeDoesntPanic(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testEncodeDoesntPanic(t, e) + } +} + +func testEncodeDoesntPanic(t *testing.T, e env) { + te := newTest(t, e) + erc := &errCodec{} + te.customCodec = erc + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + te.customCodec = nil + tc := testpb.NewTestServiceClient(te.clientConn()) + // Failure case, should not panic. + tc.EmptyCall(context.Background(), &testpb.Empty{}) + erc.noError = true + // Passing case. + if _, err := tc.EmptyCall(context.Background(), &testpb.Empty{}); err != nil { + t.Fatalf("EmptyCall(_, _) = _, %v, want _, ", err) + } +} + +func TestSvrWriteStatusEarlyWrite(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testSvrWriteStatusEarlyWrite(t, e) + } +} + +func testSvrWriteStatusEarlyWrite(t *testing.T, e env) { + te := newTest(t, e) + const smallSize = 1024 + const largeSize = 2048 + const extraLargeSize = 4096 + te.maxServerReceiveMsgSize = newInt(largeSize) + te.maxServerSendMsgSize = newInt(largeSize) + smallPayload, err := newPayload(testpb.PayloadType_COMPRESSABLE, smallSize) + if err != nil { + t.Fatal(err) + } + extraLargePayload, err := newPayload(testpb.PayloadType_COMPRESSABLE, extraLargeSize) + if err != nil { + t.Fatal(err) + } + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + tc := testpb.NewTestServiceClient(te.clientConn()) + respParam := []*testpb.ResponseParameters{ + { + Size: int32(smallSize), + }, + } + sreq := &testpb.StreamingOutputCallRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseParameters: respParam, + Payload: extraLargePayload, + } + // Test recv case: server receives a message larger than maxServerReceiveMsgSize. + stream, err := tc.FullDuplexCall(te.ctx) + if err != nil { + t.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) + } + if err = stream.Send(sreq); err != nil { + t.Fatalf("%v.Send() = _, %v, want ", stream, err) + } + if _, err = stream.Recv(); err == nil || grpc.Code(err) != codes.ResourceExhausted { + t.Fatalf("%v.Recv() = _, %v, want _, error code: %s", stream, err, codes.ResourceExhausted) + } + // Test send case: server sends a message larger than maxServerSendMsgSize. + sreq.Payload = smallPayload + respParam[0].Size = int32(extraLargeSize) + + stream, err = tc.FullDuplexCall(te.ctx) + if err != nil { + t.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) + } + if err = stream.Send(sreq); err != nil { + t.Fatalf("%v.Send(%v) = %v, want ", stream, sreq, err) + } + if _, err = stream.Recv(); err == nil || grpc.Code(err) != codes.ResourceExhausted { + t.Fatalf("%v.Recv() = _, %v, want _, error code: %s", stream, err, codes.ResourceExhausted) + } +} + +// The following functions with function name ending with TD indicates that they +// should be deleted after old service config API is deprecated and deleted. +func testServiceConfigSetupTD(t *testing.T, e env) (*test, chan grpc.ServiceConfig) { + te := newTest(t, e) + // We write before read. + ch := make(chan grpc.ServiceConfig, 1) + te.sc = ch + te.userAgent = testAppUA + te.declareLogNoise( + "transport: http2Client.notifyError got notified that the client transport was broken EOF", + "grpc: addrConn.transportMonitor exits due to: grpc: the connection is closing", + "grpc: addrConn.resetTransport failed to create client transport: connection error", + "Failed to dial : context canceled; please retry.", + ) + return te, ch +} + +func TestServiceConfigGetMethodConfigTD(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testGetMethodConfigTD(t, e) + } +} + +func testGetMethodConfigTD(t *testing.T, e env) { + te, ch := testServiceConfigSetupTD(t, e) + defer te.tearDown() + + mc1 := grpc.MethodConfig{ + WaitForReady: newBool(true), + Timeout: newDuration(time.Millisecond), + } + mc2 := grpc.MethodConfig{WaitForReady: newBool(false)} + m := make(map[string]grpc.MethodConfig) + m["/grpc.testing.TestService/EmptyCall"] = mc1 + m["/grpc.testing.TestService/"] = mc2 + sc := grpc.ServiceConfig{ + Methods: m, + } + ch <- sc + + cc := te.clientConn() + tc := testpb.NewTestServiceClient(cc) + // The following RPCs are expected to become non-fail-fast ones with 1ms deadline. + if _, err := tc.EmptyCall(context.Background(), &testpb.Empty{}); grpc.Code(err) != codes.DeadlineExceeded { + t.Fatalf("TestService/EmptyCall(_, _) = _, %v, want _, %s", err, codes.DeadlineExceeded) + } + + m = make(map[string]grpc.MethodConfig) + m["/grpc.testing.TestService/UnaryCall"] = mc1 + m["/grpc.testing.TestService/"] = mc2 + sc = grpc.ServiceConfig{ + Methods: m, + } + ch <- sc + // Wait for the new service config to propagate. + for { + if _, err := tc.EmptyCall(context.Background(), &testpb.Empty{}); grpc.Code(err) == codes.DeadlineExceeded { + continue + } + break + } + // The following RPCs are expected to become fail-fast. + if _, err := tc.EmptyCall(context.Background(), &testpb.Empty{}); grpc.Code(err) != codes.Unavailable { + t.Fatalf("TestService/EmptyCall(_, _) = _, %v, want _, %s", err, codes.Unavailable) + } +} + +func TestServiceConfigWaitForReadyTD(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testServiceConfigWaitForReadyTD(t, e) + } +} + +func testServiceConfigWaitForReadyTD(t *testing.T, e env) { + te, ch := testServiceConfigSetupTD(t, e) + defer te.tearDown() + + // Case1: Client API set failfast to be false, and service config set wait_for_ready to be false, Client API should win, and the rpc will wait until deadline exceeds. + mc := grpc.MethodConfig{ + WaitForReady: newBool(false), + Timeout: newDuration(time.Millisecond), + } + m := make(map[string]grpc.MethodConfig) + m["/grpc.testing.TestService/EmptyCall"] = mc + m["/grpc.testing.TestService/FullDuplexCall"] = mc + sc := grpc.ServiceConfig{ + Methods: m, + } + ch <- sc + + cc := te.clientConn() + tc := testpb.NewTestServiceClient(cc) + // The following RPCs are expected to become non-fail-fast ones with 1ms deadline. + if _, err := tc.EmptyCall(context.Background(), &testpb.Empty{}, grpc.FailFast(false)); grpc.Code(err) != codes.DeadlineExceeded { + t.Fatalf("TestService/EmptyCall(_, _) = _, %v, want _, %s", err, codes.DeadlineExceeded) + } + if _, err := tc.FullDuplexCall(context.Background(), grpc.FailFast(false)); grpc.Code(err) != codes.DeadlineExceeded { + t.Fatalf("TestService/FullDuplexCall(_) = _, %v, want %s", err, codes.DeadlineExceeded) + } + + // Generate a service config update. + // Case2: Client API does not set failfast, and service config set wait_for_ready to be true, and the rpc will wait until deadline exceeds. + mc.WaitForReady = newBool(true) + m = make(map[string]grpc.MethodConfig) + m["/grpc.testing.TestService/EmptyCall"] = mc + m["/grpc.testing.TestService/FullDuplexCall"] = mc + sc = grpc.ServiceConfig{ + Methods: m, + } + ch <- sc + + // Wait for the new service config to take effect. + mc = cc.GetMethodConfig("/grpc.testing.TestService/EmptyCall") + for { + if !*mc.WaitForReady { + time.Sleep(100 * time.Millisecond) + mc = cc.GetMethodConfig("/grpc.testing.TestService/EmptyCall") + continue + } + break + } + // The following RPCs are expected to become non-fail-fast ones with 1ms deadline. + if _, err := tc.EmptyCall(context.Background(), &testpb.Empty{}); grpc.Code(err) != codes.DeadlineExceeded { + t.Fatalf("TestService/EmptyCall(_, _) = _, %v, want _, %s", err, codes.DeadlineExceeded) + } + if _, err := tc.FullDuplexCall(context.Background()); grpc.Code(err) != codes.DeadlineExceeded { + t.Fatalf("TestService/FullDuplexCall(_) = _, %v, want %s", err, codes.DeadlineExceeded) + } +} + +func TestServiceConfigTimeoutTD(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testServiceConfigTimeoutTD(t, e) + } +} + +func testServiceConfigTimeoutTD(t *testing.T, e env) { + te, ch := testServiceConfigSetupTD(t, e) + defer te.tearDown() + + // Case1: Client API sets timeout to be 1ns and ServiceConfig sets timeout to be 1hr. Timeout should be 1ns (min of 1ns and 1hr) and the rpc will wait until deadline exceeds. + mc := grpc.MethodConfig{ + Timeout: newDuration(time.Hour), + } + m := make(map[string]grpc.MethodConfig) + m["/grpc.testing.TestService/EmptyCall"] = mc + m["/grpc.testing.TestService/FullDuplexCall"] = mc + sc := grpc.ServiceConfig{ + Methods: m, + } + ch <- sc + + cc := te.clientConn() + tc := testpb.NewTestServiceClient(cc) + // The following RPCs are expected to become non-fail-fast ones with 1ns deadline. + ctx, cancel := context.WithTimeout(context.Background(), time.Nanosecond) + if _, err := tc.EmptyCall(ctx, &testpb.Empty{}, grpc.FailFast(false)); grpc.Code(err) != codes.DeadlineExceeded { + t.Fatalf("TestService/EmptyCall(_, _) = _, %v, want _, %s", err, codes.DeadlineExceeded) + } + cancel() + ctx, cancel = context.WithTimeout(context.Background(), time.Nanosecond) + if _, err := tc.FullDuplexCall(ctx, grpc.FailFast(false)); grpc.Code(err) != codes.DeadlineExceeded { + t.Fatalf("TestService/FullDuplexCall(_) = _, %v, want %s", err, codes.DeadlineExceeded) + } + cancel() + + // Generate a service config update. + // Case2: Client API sets timeout to be 1hr and ServiceConfig sets timeout to be 1ns. Timeout should be 1ns (min of 1ns and 1hr) and the rpc will wait until deadline exceeds. + mc.Timeout = newDuration(time.Nanosecond) + m = make(map[string]grpc.MethodConfig) + m["/grpc.testing.TestService/EmptyCall"] = mc + m["/grpc.testing.TestService/FullDuplexCall"] = mc + sc = grpc.ServiceConfig{ + Methods: m, + } + ch <- sc + + // Wait for the new service config to take effect. + mc = cc.GetMethodConfig("/grpc.testing.TestService/FullDuplexCall") + for { + if *mc.Timeout != time.Nanosecond { + time.Sleep(100 * time.Millisecond) + mc = cc.GetMethodConfig("/grpc.testing.TestService/FullDuplexCall") + continue + } + break + } + + ctx, cancel = context.WithTimeout(context.Background(), time.Hour) + if _, err := tc.EmptyCall(ctx, &testpb.Empty{}, grpc.FailFast(false)); grpc.Code(err) != codes.DeadlineExceeded { + t.Fatalf("TestService/EmptyCall(_, _) = _, %v, want _, %s", err, codes.DeadlineExceeded) + } + cancel() + + ctx, cancel = context.WithTimeout(context.Background(), time.Hour) + if _, err := tc.FullDuplexCall(ctx, grpc.FailFast(false)); grpc.Code(err) != codes.DeadlineExceeded { + t.Fatalf("TestService/FullDuplexCall(_) = _, %v, want %s", err, codes.DeadlineExceeded) + } + cancel() +} + +func TestServiceConfigMaxMsgSizeTD(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testServiceConfigMaxMsgSizeTD(t, e) + } +} + +func testServiceConfigMaxMsgSizeTD(t *testing.T, e env) { + // Setting up values and objects shared across all test cases. + const smallSize = 1 + const largeSize = 1024 + const extraLargeSize = 2048 + + smallPayload, err := newPayload(testpb.PayloadType_COMPRESSABLE, smallSize) + if err != nil { + t.Fatal(err) + } + largePayload, err := newPayload(testpb.PayloadType_COMPRESSABLE, largeSize) + if err != nil { + t.Fatal(err) + } + extraLargePayload, err := newPayload(testpb.PayloadType_COMPRESSABLE, extraLargeSize) + if err != nil { + t.Fatal(err) + } + + mc := grpc.MethodConfig{ + MaxReqSize: newInt(extraLargeSize), + MaxRespSize: newInt(extraLargeSize), + } + + m := make(map[string]grpc.MethodConfig) + m["/grpc.testing.TestService/UnaryCall"] = mc + m["/grpc.testing.TestService/FullDuplexCall"] = mc + sc := grpc.ServiceConfig{ + Methods: m, + } + // Case1: sc set maxReqSize to 2048 (send), maxRespSize to 2048 (recv). + te1, ch1 := testServiceConfigSetupTD(t, e) + te1.startServer(&testServer{security: e.security}) + defer te1.tearDown() + + ch1 <- sc + tc := testpb.NewTestServiceClient(te1.clientConn()) + + req := &testpb.SimpleRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseSize: int32(extraLargeSize), + Payload: smallPayload, + } + // Test for unary RPC recv. + if _, err := tc.UnaryCall(context.Background(), req); err == nil || grpc.Code(err) != codes.ResourceExhausted { + t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want _, error code: %s", err, codes.ResourceExhausted) + } + + // Test for unary RPC send. + req.Payload = extraLargePayload + req.ResponseSize = int32(smallSize) + if _, err := tc.UnaryCall(context.Background(), req); err == nil || grpc.Code(err) != codes.ResourceExhausted { + t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want _, error code: %s", err, codes.ResourceExhausted) + } + + // Test for streaming RPC recv. + respParam := []*testpb.ResponseParameters{ + { + Size: int32(extraLargeSize), + }, + } + sreq := &testpb.StreamingOutputCallRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseParameters: respParam, + Payload: smallPayload, + } + stream, err := tc.FullDuplexCall(te1.ctx) + if err != nil { + t.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) + } + if err := stream.Send(sreq); err != nil { + t.Fatalf("%v.Send(%v) = %v, want ", stream, sreq, err) + } + if _, err := stream.Recv(); err == nil || grpc.Code(err) != codes.ResourceExhausted { + t.Fatalf("%v.Recv() = _, %v, want _, error code: %s", stream, err, codes.ResourceExhausted) + } + + // Test for streaming RPC send. + respParam[0].Size = int32(smallSize) + sreq.Payload = extraLargePayload + stream, err = tc.FullDuplexCall(te1.ctx) + if err != nil { + t.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) + } + if err := stream.Send(sreq); err == nil || grpc.Code(err) != codes.ResourceExhausted { + t.Fatalf("%v.Send(%v) = %v, want _, error code: %s", stream, sreq, err, codes.ResourceExhausted) + } + + // Case2: Client API set maxReqSize to 1024 (send), maxRespSize to 1024 (recv). Sc sets maxReqSize to 2048 (send), maxRespSize to 2048 (recv). + te2, ch2 := testServiceConfigSetupTD(t, e) + te2.maxClientReceiveMsgSize = newInt(1024) + te2.maxClientSendMsgSize = newInt(1024) + te2.startServer(&testServer{security: e.security}) + defer te2.tearDown() + ch2 <- sc + tc = testpb.NewTestServiceClient(te2.clientConn()) + + // Test for unary RPC recv. + req.Payload = smallPayload + req.ResponseSize = int32(largeSize) + + if _, err := tc.UnaryCall(context.Background(), req); err == nil || grpc.Code(err) != codes.ResourceExhausted { + t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want _, error code: %s", err, codes.ResourceExhausted) + } + + // Test for unary RPC send. + req.Payload = largePayload + req.ResponseSize = int32(smallSize) + if _, err := tc.UnaryCall(context.Background(), req); err == nil || grpc.Code(err) != codes.ResourceExhausted { + t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want _, error code: %s", err, codes.ResourceExhausted) + } + + // Test for streaming RPC recv. + stream, err = tc.FullDuplexCall(te2.ctx) + respParam[0].Size = int32(largeSize) + sreq.Payload = smallPayload + if err != nil { + t.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) + } + if err := stream.Send(sreq); err != nil { + t.Fatalf("%v.Send(%v) = %v, want ", stream, sreq, err) + } + if _, err := stream.Recv(); err == nil || grpc.Code(err) != codes.ResourceExhausted { + t.Fatalf("%v.Recv() = _, %v, want _, error code: %s", stream, err, codes.ResourceExhausted) + } + + // Test for streaming RPC send. + respParam[0].Size = int32(smallSize) + sreq.Payload = largePayload + stream, err = tc.FullDuplexCall(te2.ctx) + if err != nil { + t.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) + } + if err := stream.Send(sreq); err == nil || grpc.Code(err) != codes.ResourceExhausted { + t.Fatalf("%v.Send(%v) = %v, want _, error code: %s", stream, sreq, err, codes.ResourceExhausted) + } + + // Case3: Client API set maxReqSize to 4096 (send), maxRespSize to 4096 (recv). Sc sets maxReqSize to 2048 (send), maxRespSize to 2048 (recv). + te3, ch3 := testServiceConfigSetupTD(t, e) + te3.maxClientReceiveMsgSize = newInt(4096) + te3.maxClientSendMsgSize = newInt(4096) + te3.startServer(&testServer{security: e.security}) + defer te3.tearDown() + ch3 <- sc + tc = testpb.NewTestServiceClient(te3.clientConn()) + + // Test for unary RPC recv. + req.Payload = smallPayload + req.ResponseSize = int32(largeSize) + + if _, err := tc.UnaryCall(context.Background(), req); err != nil { + t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want ", err) + } + + req.ResponseSize = int32(extraLargeSize) + if _, err := tc.UnaryCall(context.Background(), req); err == nil || grpc.Code(err) != codes.ResourceExhausted { + t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want _, error code: %s", err, codes.ResourceExhausted) + } + + // Test for unary RPC send. + req.Payload = largePayload + req.ResponseSize = int32(smallSize) + if _, err := tc.UnaryCall(context.Background(), req); err != nil { + t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want ", err) + } + + req.Payload = extraLargePayload + if _, err := tc.UnaryCall(context.Background(), req); err == nil || grpc.Code(err) != codes.ResourceExhausted { + t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want _, error code: %s", err, codes.ResourceExhausted) + } + + // Test for streaming RPC recv. + stream, err = tc.FullDuplexCall(te3.ctx) + if err != nil { + t.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) + } + respParam[0].Size = int32(largeSize) + sreq.Payload = smallPayload + + if err := stream.Send(sreq); err != nil { + t.Fatalf("%v.Send(%v) = %v, want ", stream, sreq, err) + } + if _, err := stream.Recv(); err != nil { + t.Fatalf("%v.Recv() = _, %v, want ", stream, err) + } + + respParam[0].Size = int32(extraLargeSize) + + if err := stream.Send(sreq); err != nil { + t.Fatalf("%v.Send(%v) = %v, want ", stream, sreq, err) + } + if _, err := stream.Recv(); err == nil || grpc.Code(err) != codes.ResourceExhausted { + t.Fatalf("%v.Recv() = _, %v, want _, error code: %s", stream, err, codes.ResourceExhausted) + } + + // Test for streaming RPC send. + respParam[0].Size = int32(smallSize) + sreq.Payload = largePayload + stream, err = tc.FullDuplexCall(te3.ctx) + if err != nil { + t.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) + } + if err := stream.Send(sreq); err != nil { + t.Fatalf("%v.Send(%v) = %v, want ", stream, sreq, err) + } + sreq.Payload = extraLargePayload + if err := stream.Send(sreq); err == nil || grpc.Code(err) != codes.ResourceExhausted { + t.Fatalf("%v.Send(%v) = %v, want _, error code: %s", stream, sreq, err, codes.ResourceExhausted) + } +} + +func TestMethodFromServerStream(t *testing.T) { + defer leakcheck.Check(t) + const testMethod = "/package.service/method" + e := tcpClearRREnv + te := newTest(t, e) + var method string + var ok bool + te.unknownHandler = func(srv interface{}, stream grpc.ServerStream) error { + method, ok = grpc.MethodFromServerStream(stream) + return nil + } + + te.startServer(nil) + defer te.tearDown() + _ = te.clientConn().Invoke(context.Background(), testMethod, nil, nil) + if !ok || method != testMethod { + t.Fatalf("Invoke with method %q, got %q, %v, want %q, true", testMethod, method, ok, testMethod) + } +} + +func TestCompressorRegister(t *testing.T) { + defer leakcheck.Check(t) + for _, e := range listTestEnv() { + testCompressorRegister(t, e) + } +} + +func testCompressorRegister(t *testing.T, e env) { + te := newTest(t, e) + te.clientCompression = false + te.serverCompression = false + te.clientUseCompression = true + + te.startServer(&testServer{security: e.security}) + defer te.tearDown() + tc := testpb.NewTestServiceClient(te.clientConn()) + + // Unary call + const argSize = 271828 + const respSize = 314159 + payload, err := newPayload(testpb.PayloadType_COMPRESSABLE, argSize) + if err != nil { + t.Fatal(err) + } + req := &testpb.SimpleRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseSize: respSize, + Payload: payload, + } + ctx := metadata.NewOutgoingContext(context.Background(), metadata.Pairs("something", "something")) + if _, err := tc.UnaryCall(ctx, req); err != nil { + t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want _, ", err) + } + // Streaming RPC + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + stream, err := tc.FullDuplexCall(ctx) + if err != nil { + t.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) + } + respParam := []*testpb.ResponseParameters{ + { + Size: 31415, + }, + } + payload, err = newPayload(testpb.PayloadType_COMPRESSABLE, int32(31415)) + if err != nil { + t.Fatal(err) + } + sreq := &testpb.StreamingOutputCallRequest{ + ResponseType: testpb.PayloadType_COMPRESSABLE, + ResponseParameters: respParam, + Payload: payload, + } + if err := stream.Send(sreq); err != nil { + t.Fatalf("%v.Send(%v) = %v, want ", stream, sreq, err) + } + if _, err := stream.Recv(); err != nil { + t.Fatalf("%v.Recv() = %v, want ", stream, err) + } +} diff --git a/vendor/google.golang.org/grpc/test/grpc_testing/test.pb.go b/vendor/google.golang.org/grpc/test/grpc_testing/test.pb.go new file mode 100644 index 0000000000..ab48a15241 --- /dev/null +++ b/vendor/google.golang.org/grpc/test/grpc_testing/test.pb.go @@ -0,0 +1,766 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: grpc_testing/test.proto + +/* +Package grpc_testing is a generated protocol buffer package. + +It is generated from these files: + grpc_testing/test.proto + +It has these top-level messages: + Empty + Payload + SimpleRequest + SimpleResponse + StreamingInputCallRequest + StreamingInputCallResponse + ResponseParameters + StreamingOutputCallRequest + StreamingOutputCallResponse +*/ +package grpc_testing + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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.ProtoPackageIsVersion2 // please upgrade the proto package + +// The type of payload that should be returned. +type PayloadType int32 + +const ( + // Compressable text format. + PayloadType_COMPRESSABLE PayloadType = 0 + // Uncompressable binary format. + PayloadType_UNCOMPRESSABLE PayloadType = 1 + // Randomly chosen from all other formats defined in this enum. + PayloadType_RANDOM PayloadType = 2 +) + +var PayloadType_name = map[int32]string{ + 0: "COMPRESSABLE", + 1: "UNCOMPRESSABLE", + 2: "RANDOM", +} +var PayloadType_value = map[string]int32{ + "COMPRESSABLE": 0, + "UNCOMPRESSABLE": 1, + "RANDOM": 2, +} + +func (x PayloadType) String() string { + return proto.EnumName(PayloadType_name, int32(x)) +} +func (PayloadType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +type Empty struct { +} + +func (m *Empty) Reset() { *m = Empty{} } +func (m *Empty) String() string { return proto.CompactTextString(m) } +func (*Empty) ProtoMessage() {} +func (*Empty) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +// A block of data, to simply increase gRPC message size. +type Payload struct { + // The type of data in body. + Type PayloadType `protobuf:"varint,1,opt,name=type,enum=grpc.testing.PayloadType" json:"type,omitempty"` + // Primary contents of payload. + Body []byte `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"` +} + +func (m *Payload) Reset() { *m = Payload{} } +func (m *Payload) String() string { return proto.CompactTextString(m) } +func (*Payload) ProtoMessage() {} +func (*Payload) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *Payload) GetType() PayloadType { + if m != nil { + return m.Type + } + return PayloadType_COMPRESSABLE +} + +func (m *Payload) GetBody() []byte { + if m != nil { + return m.Body + } + return nil +} + +// Unary request. +type SimpleRequest struct { + // Desired payload type in the response from the server. + // If response_type is RANDOM, server randomly chooses one from other formats. + ResponseType PayloadType `protobuf:"varint,1,opt,name=response_type,json=responseType,enum=grpc.testing.PayloadType" json:"response_type,omitempty"` + // Desired payload size in the response from the server. + // If response_type is COMPRESSABLE, this denotes the size before compression. + ResponseSize int32 `protobuf:"varint,2,opt,name=response_size,json=responseSize" json:"response_size,omitempty"` + // Optional input payload sent along with the request. + Payload *Payload `protobuf:"bytes,3,opt,name=payload" json:"payload,omitempty"` + // Whether SimpleResponse should include username. + FillUsername bool `protobuf:"varint,4,opt,name=fill_username,json=fillUsername" json:"fill_username,omitempty"` + // Whether SimpleResponse should include OAuth scope. + FillOauthScope bool `protobuf:"varint,5,opt,name=fill_oauth_scope,json=fillOauthScope" json:"fill_oauth_scope,omitempty"` +} + +func (m *SimpleRequest) Reset() { *m = SimpleRequest{} } +func (m *SimpleRequest) String() string { return proto.CompactTextString(m) } +func (*SimpleRequest) ProtoMessage() {} +func (*SimpleRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *SimpleRequest) GetResponseType() PayloadType { + if m != nil { + return m.ResponseType + } + return PayloadType_COMPRESSABLE +} + +func (m *SimpleRequest) GetResponseSize() int32 { + if m != nil { + return m.ResponseSize + } + return 0 +} + +func (m *SimpleRequest) GetPayload() *Payload { + if m != nil { + return m.Payload + } + return nil +} + +func (m *SimpleRequest) GetFillUsername() bool { + if m != nil { + return m.FillUsername + } + return false +} + +func (m *SimpleRequest) GetFillOauthScope() bool { + if m != nil { + return m.FillOauthScope + } + return false +} + +// Unary response, as configured by the request. +type SimpleResponse struct { + // Payload to increase message size. + Payload *Payload `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"` + // The user the request came from, for verifying authentication was + // successful when the client expected it. + Username string `protobuf:"bytes,2,opt,name=username" json:"username,omitempty"` + // OAuth scope. + OauthScope string `protobuf:"bytes,3,opt,name=oauth_scope,json=oauthScope" json:"oauth_scope,omitempty"` +} + +func (m *SimpleResponse) Reset() { *m = SimpleResponse{} } +func (m *SimpleResponse) String() string { return proto.CompactTextString(m) } +func (*SimpleResponse) ProtoMessage() {} +func (*SimpleResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *SimpleResponse) GetPayload() *Payload { + if m != nil { + return m.Payload + } + return nil +} + +func (m *SimpleResponse) GetUsername() string { + if m != nil { + return m.Username + } + return "" +} + +func (m *SimpleResponse) GetOauthScope() string { + if m != nil { + return m.OauthScope + } + return "" +} + +// Client-streaming request. +type StreamingInputCallRequest struct { + // Optional input payload sent along with the request. + Payload *Payload `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"` +} + +func (m *StreamingInputCallRequest) Reset() { *m = StreamingInputCallRequest{} } +func (m *StreamingInputCallRequest) String() string { return proto.CompactTextString(m) } +func (*StreamingInputCallRequest) ProtoMessage() {} +func (*StreamingInputCallRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *StreamingInputCallRequest) GetPayload() *Payload { + if m != nil { + return m.Payload + } + return nil +} + +// Client-streaming response. +type StreamingInputCallResponse struct { + // Aggregated size of payloads received from the client. + AggregatedPayloadSize int32 `protobuf:"varint,1,opt,name=aggregated_payload_size,json=aggregatedPayloadSize" json:"aggregated_payload_size,omitempty"` +} + +func (m *StreamingInputCallResponse) Reset() { *m = StreamingInputCallResponse{} } +func (m *StreamingInputCallResponse) String() string { return proto.CompactTextString(m) } +func (*StreamingInputCallResponse) ProtoMessage() {} +func (*StreamingInputCallResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *StreamingInputCallResponse) GetAggregatedPayloadSize() int32 { + if m != nil { + return m.AggregatedPayloadSize + } + return 0 +} + +// Configuration for a particular response. +type ResponseParameters struct { + // Desired payload sizes in responses from the server. + // If response_type is COMPRESSABLE, this denotes the size before compression. + Size int32 `protobuf:"varint,1,opt,name=size" json:"size,omitempty"` + // Desired interval between consecutive responses in the response stream in + // microseconds. + IntervalUs int32 `protobuf:"varint,2,opt,name=interval_us,json=intervalUs" json:"interval_us,omitempty"` +} + +func (m *ResponseParameters) Reset() { *m = ResponseParameters{} } +func (m *ResponseParameters) String() string { return proto.CompactTextString(m) } +func (*ResponseParameters) ProtoMessage() {} +func (*ResponseParameters) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *ResponseParameters) GetSize() int32 { + if m != nil { + return m.Size + } + return 0 +} + +func (m *ResponseParameters) GetIntervalUs() int32 { + if m != nil { + return m.IntervalUs + } + return 0 +} + +// Server-streaming request. +type StreamingOutputCallRequest struct { + // Desired payload type in the response from the server. + // If response_type is RANDOM, the payload from each response in the stream + // might be of different types. This is to simulate a mixed type of payload + // stream. + ResponseType PayloadType `protobuf:"varint,1,opt,name=response_type,json=responseType,enum=grpc.testing.PayloadType" json:"response_type,omitempty"` + // Configuration for each expected response message. + ResponseParameters []*ResponseParameters `protobuf:"bytes,2,rep,name=response_parameters,json=responseParameters" json:"response_parameters,omitempty"` + // Optional input payload sent along with the request. + Payload *Payload `protobuf:"bytes,3,opt,name=payload" json:"payload,omitempty"` +} + +func (m *StreamingOutputCallRequest) Reset() { *m = StreamingOutputCallRequest{} } +func (m *StreamingOutputCallRequest) String() string { return proto.CompactTextString(m) } +func (*StreamingOutputCallRequest) ProtoMessage() {} +func (*StreamingOutputCallRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *StreamingOutputCallRequest) GetResponseType() PayloadType { + if m != nil { + return m.ResponseType + } + return PayloadType_COMPRESSABLE +} + +func (m *StreamingOutputCallRequest) GetResponseParameters() []*ResponseParameters { + if m != nil { + return m.ResponseParameters + } + return nil +} + +func (m *StreamingOutputCallRequest) GetPayload() *Payload { + if m != nil { + return m.Payload + } + return nil +} + +// Server-streaming response, as configured by the request and parameters. +type StreamingOutputCallResponse struct { + // Payload to increase response size. + Payload *Payload `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"` +} + +func (m *StreamingOutputCallResponse) Reset() { *m = StreamingOutputCallResponse{} } +func (m *StreamingOutputCallResponse) String() string { return proto.CompactTextString(m) } +func (*StreamingOutputCallResponse) ProtoMessage() {} +func (*StreamingOutputCallResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *StreamingOutputCallResponse) GetPayload() *Payload { + if m != nil { + return m.Payload + } + return nil +} + +func init() { + proto.RegisterType((*Empty)(nil), "grpc.testing.Empty") + proto.RegisterType((*Payload)(nil), "grpc.testing.Payload") + proto.RegisterType((*SimpleRequest)(nil), "grpc.testing.SimpleRequest") + proto.RegisterType((*SimpleResponse)(nil), "grpc.testing.SimpleResponse") + proto.RegisterType((*StreamingInputCallRequest)(nil), "grpc.testing.StreamingInputCallRequest") + proto.RegisterType((*StreamingInputCallResponse)(nil), "grpc.testing.StreamingInputCallResponse") + proto.RegisterType((*ResponseParameters)(nil), "grpc.testing.ResponseParameters") + proto.RegisterType((*StreamingOutputCallRequest)(nil), "grpc.testing.StreamingOutputCallRequest") + proto.RegisterType((*StreamingOutputCallResponse)(nil), "grpc.testing.StreamingOutputCallResponse") + proto.RegisterEnum("grpc.testing.PayloadType", PayloadType_name, PayloadType_value) +} + +// 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 + +// Client API for TestService service + +type TestServiceClient interface { + // One empty request followed by one empty response. + EmptyCall(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) + // One request followed by one response. + // The server returns the client payload as-is. + UnaryCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (*SimpleResponse, error) + // One request followed by a sequence of responses (streamed download). + // The server returns the payload with client desired type and sizes. + StreamingOutputCall(ctx context.Context, in *StreamingOutputCallRequest, opts ...grpc.CallOption) (TestService_StreamingOutputCallClient, error) + // A sequence of requests followed by one response (streamed upload). + // The server returns the aggregated size of client payload as the result. + StreamingInputCall(ctx context.Context, opts ...grpc.CallOption) (TestService_StreamingInputCallClient, error) + // A sequence of requests with each request served by the server immediately. + // As one request could lead to multiple responses, this interface + // demonstrates the idea of full duplexing. + FullDuplexCall(ctx context.Context, opts ...grpc.CallOption) (TestService_FullDuplexCallClient, error) + // A sequence of requests followed by a sequence of responses. + // The server buffers all the client requests and then serves them in order. A + // stream of responses are returned to the client when the server starts with + // first request. + HalfDuplexCall(ctx context.Context, opts ...grpc.CallOption) (TestService_HalfDuplexCallClient, error) +} + +type testServiceClient struct { + cc *grpc.ClientConn +} + +func NewTestServiceClient(cc *grpc.ClientConn) TestServiceClient { + return &testServiceClient{cc} +} + +func (c *testServiceClient) EmptyCall(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) { + out := new(Empty) + err := grpc.Invoke(ctx, "/grpc.testing.TestService/EmptyCall", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *testServiceClient) UnaryCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (*SimpleResponse, error) { + out := new(SimpleResponse) + err := grpc.Invoke(ctx, "/grpc.testing.TestService/UnaryCall", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *testServiceClient) StreamingOutputCall(ctx context.Context, in *StreamingOutputCallRequest, opts ...grpc.CallOption) (TestService_StreamingOutputCallClient, error) { + stream, err := grpc.NewClientStream(ctx, &_TestService_serviceDesc.Streams[0], c.cc, "/grpc.testing.TestService/StreamingOutputCall", opts...) + if err != nil { + return nil, err + } + x := &testServiceStreamingOutputCallClient{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 TestService_StreamingOutputCallClient interface { + Recv() (*StreamingOutputCallResponse, error) + grpc.ClientStream +} + +type testServiceStreamingOutputCallClient struct { + grpc.ClientStream +} + +func (x *testServiceStreamingOutputCallClient) Recv() (*StreamingOutputCallResponse, error) { + m := new(StreamingOutputCallResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *testServiceClient) StreamingInputCall(ctx context.Context, opts ...grpc.CallOption) (TestService_StreamingInputCallClient, error) { + stream, err := grpc.NewClientStream(ctx, &_TestService_serviceDesc.Streams[1], c.cc, "/grpc.testing.TestService/StreamingInputCall", opts...) + if err != nil { + return nil, err + } + x := &testServiceStreamingInputCallClient{stream} + return x, nil +} + +type TestService_StreamingInputCallClient interface { + Send(*StreamingInputCallRequest) error + CloseAndRecv() (*StreamingInputCallResponse, error) + grpc.ClientStream +} + +type testServiceStreamingInputCallClient struct { + grpc.ClientStream +} + +func (x *testServiceStreamingInputCallClient) Send(m *StreamingInputCallRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *testServiceStreamingInputCallClient) CloseAndRecv() (*StreamingInputCallResponse, error) { + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + m := new(StreamingInputCallResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *testServiceClient) FullDuplexCall(ctx context.Context, opts ...grpc.CallOption) (TestService_FullDuplexCallClient, error) { + stream, err := grpc.NewClientStream(ctx, &_TestService_serviceDesc.Streams[2], c.cc, "/grpc.testing.TestService/FullDuplexCall", opts...) + if err != nil { + return nil, err + } + x := &testServiceFullDuplexCallClient{stream} + return x, nil +} + +type TestService_FullDuplexCallClient interface { + Send(*StreamingOutputCallRequest) error + Recv() (*StreamingOutputCallResponse, error) + grpc.ClientStream +} + +type testServiceFullDuplexCallClient struct { + grpc.ClientStream +} + +func (x *testServiceFullDuplexCallClient) Send(m *StreamingOutputCallRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *testServiceFullDuplexCallClient) Recv() (*StreamingOutputCallResponse, error) { + m := new(StreamingOutputCallResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *testServiceClient) HalfDuplexCall(ctx context.Context, opts ...grpc.CallOption) (TestService_HalfDuplexCallClient, error) { + stream, err := grpc.NewClientStream(ctx, &_TestService_serviceDesc.Streams[3], c.cc, "/grpc.testing.TestService/HalfDuplexCall", opts...) + if err != nil { + return nil, err + } + x := &testServiceHalfDuplexCallClient{stream} + return x, nil +} + +type TestService_HalfDuplexCallClient interface { + Send(*StreamingOutputCallRequest) error + Recv() (*StreamingOutputCallResponse, error) + grpc.ClientStream +} + +type testServiceHalfDuplexCallClient struct { + grpc.ClientStream +} + +func (x *testServiceHalfDuplexCallClient) Send(m *StreamingOutputCallRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *testServiceHalfDuplexCallClient) Recv() (*StreamingOutputCallResponse, error) { + m := new(StreamingOutputCallResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// Server API for TestService service + +type TestServiceServer interface { + // One empty request followed by one empty response. + EmptyCall(context.Context, *Empty) (*Empty, error) + // One request followed by one response. + // The server returns the client payload as-is. + UnaryCall(context.Context, *SimpleRequest) (*SimpleResponse, error) + // One request followed by a sequence of responses (streamed download). + // The server returns the payload with client desired type and sizes. + StreamingOutputCall(*StreamingOutputCallRequest, TestService_StreamingOutputCallServer) error + // A sequence of requests followed by one response (streamed upload). + // The server returns the aggregated size of client payload as the result. + StreamingInputCall(TestService_StreamingInputCallServer) error + // A sequence of requests with each request served by the server immediately. + // As one request could lead to multiple responses, this interface + // demonstrates the idea of full duplexing. + FullDuplexCall(TestService_FullDuplexCallServer) error + // A sequence of requests followed by a sequence of responses. + // The server buffers all the client requests and then serves them in order. A + // stream of responses are returned to the client when the server starts with + // first request. + HalfDuplexCall(TestService_HalfDuplexCallServer) error +} + +func RegisterTestServiceServer(s *grpc.Server, srv TestServiceServer) { + s.RegisterService(&_TestService_serviceDesc, srv) +} + +func _TestService_EmptyCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TestServiceServer).EmptyCall(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.testing.TestService/EmptyCall", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TestServiceServer).EmptyCall(ctx, req.(*Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _TestService_UnaryCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SimpleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TestServiceServer).UnaryCall(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.testing.TestService/UnaryCall", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TestServiceServer).UnaryCall(ctx, req.(*SimpleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TestService_StreamingOutputCall_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(StreamingOutputCallRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(TestServiceServer).StreamingOutputCall(m, &testServiceStreamingOutputCallServer{stream}) +} + +type TestService_StreamingOutputCallServer interface { + Send(*StreamingOutputCallResponse) error + grpc.ServerStream +} + +type testServiceStreamingOutputCallServer struct { + grpc.ServerStream +} + +func (x *testServiceStreamingOutputCallServer) Send(m *StreamingOutputCallResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _TestService_StreamingInputCall_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(TestServiceServer).StreamingInputCall(&testServiceStreamingInputCallServer{stream}) +} + +type TestService_StreamingInputCallServer interface { + SendAndClose(*StreamingInputCallResponse) error + Recv() (*StreamingInputCallRequest, error) + grpc.ServerStream +} + +type testServiceStreamingInputCallServer struct { + grpc.ServerStream +} + +func (x *testServiceStreamingInputCallServer) SendAndClose(m *StreamingInputCallResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *testServiceStreamingInputCallServer) Recv() (*StreamingInputCallRequest, error) { + m := new(StreamingInputCallRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _TestService_FullDuplexCall_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(TestServiceServer).FullDuplexCall(&testServiceFullDuplexCallServer{stream}) +} + +type TestService_FullDuplexCallServer interface { + Send(*StreamingOutputCallResponse) error + Recv() (*StreamingOutputCallRequest, error) + grpc.ServerStream +} + +type testServiceFullDuplexCallServer struct { + grpc.ServerStream +} + +func (x *testServiceFullDuplexCallServer) Send(m *StreamingOutputCallResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *testServiceFullDuplexCallServer) Recv() (*StreamingOutputCallRequest, error) { + m := new(StreamingOutputCallRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _TestService_HalfDuplexCall_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(TestServiceServer).HalfDuplexCall(&testServiceHalfDuplexCallServer{stream}) +} + +type TestService_HalfDuplexCallServer interface { + Send(*StreamingOutputCallResponse) error + Recv() (*StreamingOutputCallRequest, error) + grpc.ServerStream +} + +type testServiceHalfDuplexCallServer struct { + grpc.ServerStream +} + +func (x *testServiceHalfDuplexCallServer) Send(m *StreamingOutputCallResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *testServiceHalfDuplexCallServer) Recv() (*StreamingOutputCallRequest, error) { + m := new(StreamingOutputCallRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +var _TestService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "grpc.testing.TestService", + HandlerType: (*TestServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "EmptyCall", + Handler: _TestService_EmptyCall_Handler, + }, + { + MethodName: "UnaryCall", + Handler: _TestService_UnaryCall_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "StreamingOutputCall", + Handler: _TestService_StreamingOutputCall_Handler, + ServerStreams: true, + }, + { + StreamName: "StreamingInputCall", + Handler: _TestService_StreamingInputCall_Handler, + ClientStreams: true, + }, + { + StreamName: "FullDuplexCall", + Handler: _TestService_FullDuplexCall_Handler, + ServerStreams: true, + ClientStreams: true, + }, + { + StreamName: "HalfDuplexCall", + Handler: _TestService_HalfDuplexCall_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "grpc_testing/test.proto", +} + +func init() { proto.RegisterFile("grpc_testing/test.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 587 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0xdb, 0x6e, 0xd3, 0x40, + 0x10, 0x65, 0xdb, 0xf4, 0x36, 0x49, 0xad, 0x68, 0xab, 0xaa, 0xae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5f, 0x01, 0x00, + 0x00, 0xff, 0xff, 0x07, 0xc7, 0x76, 0x69, 0x9e, 0x06, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/grpc/test/grpc_testing/test.proto b/vendor/google.golang.org/grpc/test/grpc_testing/test.proto new file mode 100644 index 0000000000..6f62f3a7a6 --- /dev/null +++ b/vendor/google.golang.org/grpc/test/grpc_testing/test.proto @@ -0,0 +1,154 @@ +// Copyright 2017 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. + +// An integration test service that covers all the method signature permutations +// of unary/streaming requests/responses. +syntax = "proto3"; + +package grpc.testing; + +message Empty {} + +// The type of payload that should be returned. +enum PayloadType { + // Compressable text format. + COMPRESSABLE = 0; + + // Uncompressable binary format. + UNCOMPRESSABLE = 1; + + // Randomly chosen from all other formats defined in this enum. + RANDOM = 2; +} + +// A block of data, to simply increase gRPC message size. +message Payload { + // The type of data in body. + PayloadType type = 1; + // Primary contents of payload. + bytes body = 2; +} + +// Unary request. +message SimpleRequest { + // Desired payload type in the response from the server. + // If response_type is RANDOM, server randomly chooses one from other formats. + PayloadType response_type = 1; + + // Desired payload size in the response from the server. + // If response_type is COMPRESSABLE, this denotes the size before compression. + int32 response_size = 2; + + // Optional input payload sent along with the request. + Payload payload = 3; + + // Whether SimpleResponse should include username. + bool fill_username = 4; + + // Whether SimpleResponse should include OAuth scope. + bool fill_oauth_scope = 5; +} + +// Unary response, as configured by the request. +message SimpleResponse { + // Payload to increase message size. + Payload payload = 1; + + // The user the request came from, for verifying authentication was + // successful when the client expected it. + string username = 2; + + // OAuth scope. + string oauth_scope = 3; +} + +// Client-streaming request. +message StreamingInputCallRequest { + // Optional input payload sent along with the request. + Payload payload = 1; + + // Not expecting any payload from the response. +} + +// Client-streaming response. +message StreamingInputCallResponse { + // Aggregated size of payloads received from the client. + int32 aggregated_payload_size = 1; +} + +// Configuration for a particular response. +message ResponseParameters { + // Desired payload sizes in responses from the server. + // If response_type is COMPRESSABLE, this denotes the size before compression. + int32 size = 1; + + // Desired interval between consecutive responses in the response stream in + // microseconds. + int32 interval_us = 2; +} + +// Server-streaming request. +message StreamingOutputCallRequest { + // Desired payload type in the response from the server. + // If response_type is RANDOM, the payload from each response in the stream + // might be of different types. This is to simulate a mixed type of payload + // stream. + PayloadType response_type = 1; + + // Configuration for each expected response message. + repeated ResponseParameters response_parameters = 2; + + // Optional input payload sent along with the request. + Payload payload = 3; +} + +// Server-streaming response, as configured by the request and parameters. +message StreamingOutputCallResponse { + // Payload to increase response size. + Payload payload = 1; +} + +// A simple service to test the various types of RPCs and experiment with +// performance with various types of payload. +service TestService { + // One empty request followed by one empty response. + rpc EmptyCall(Empty) returns (Empty); + + // One request followed by one response. + // The server returns the client payload as-is. + rpc UnaryCall(SimpleRequest) returns (SimpleResponse); + + // One request followed by a sequence of responses (streamed download). + // The server returns the payload with client desired type and sizes. + rpc StreamingOutputCall(StreamingOutputCallRequest) + returns (stream StreamingOutputCallResponse); + + // A sequence of requests followed by one response (streamed upload). + // The server returns the aggregated size of client payload as the result. + rpc StreamingInputCall(stream StreamingInputCallRequest) + returns (StreamingInputCallResponse); + + // A sequence of requests with each request served by the server immediately. + // As one request could lead to multiple responses, this interface + // demonstrates the idea of full duplexing. + rpc FullDuplexCall(stream StreamingOutputCallRequest) + returns (stream StreamingOutputCallResponse); + + // A sequence of requests followed by a sequence of responses. + // The server buffers all the client requests and then serves them in order. A + // stream of responses are returned to the client when the server starts with + // first request. + rpc HalfDuplexCall(stream StreamingOutputCallRequest) + returns (stream StreamingOutputCallResponse); +} diff --git a/vendor/google.golang.org/grpc/test/leakcheck/leakcheck.go b/vendor/google.golang.org/grpc/test/leakcheck/leakcheck.go new file mode 100644 index 0000000000..76f9fc5417 --- /dev/null +++ b/vendor/google.golang.org/grpc/test/leakcheck/leakcheck.go @@ -0,0 +1,118 @@ +/* + * + * Copyright 2017 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. + * + */ + +// Package leakcheck contains functions to check leaked goroutines. +// +// Call "defer leakcheck.Check(t)" at the beginning of tests. +package leakcheck + +import ( + "runtime" + "sort" + "strings" + "time" +) + +var goroutinesToIgnore = []string{ + "testing.Main(", + "testing.tRunner(", + "testing.(*M).", + "runtime.goexit", + "created by runtime.gc", + "created by runtime/trace.Start", + "interestingGoroutines", + "runtime.MHeap_Scavenger", + "signal.signal_recv", + "sigterm.handler", + "runtime_mcall", + "(*loggingT).flushDaemon", + "goroutine in C code", +} + +// RegisterIgnoreGoroutine appends s into the ignore goroutine list. The +// goroutines whose stack trace contains s will not be identified as leaked +// goroutines. Not thread-safe, only call this function in init(). +func RegisterIgnoreGoroutine(s string) { + goroutinesToIgnore = append(goroutinesToIgnore, s) +} + +func ignore(g string) bool { + sl := strings.SplitN(g, "\n", 2) + if len(sl) != 2 { + return true + } + stack := strings.TrimSpace(sl[1]) + if strings.HasPrefix(stack, "testing.RunTests") { + return true + } + + if stack == "" { + return true + } + + for _, s := range goroutinesToIgnore { + if strings.Contains(stack, s) { + return true + } + } + + return false +} + +// interestingGoroutines returns all goroutines we care about for the purpose of +// leak checking. It excludes testing or runtime ones. +func interestingGoroutines() (gs []string) { + buf := make([]byte, 2<<20) + buf = buf[:runtime.Stack(buf, true)] + for _, g := range strings.Split(string(buf), "\n\n") { + if !ignore(g) { + gs = append(gs, g) + } + } + sort.Strings(gs) + return +} + +// Errorfer is the interface that wraps the Errorf method. It's a subset of +// testing.TB to make it easy to use Check. +type Errorfer interface { + Errorf(format string, args ...interface{}) +} + +func check(efer Errorfer, timeout time.Duration) { + // Loop, waiting for goroutines to shut down. + // Wait up to timeout, but finish as quickly as possible. + deadline := time.Now().Add(timeout) + var leaked []string + for time.Now().Before(deadline) { + if leaked = interestingGoroutines(); len(leaked) == 0 { + return + } + time.Sleep(50 * time.Millisecond) + } + for _, g := range leaked { + efer.Errorf("Leaked goroutine: %v", g) + } +} + +// Check looks at the currently-running goroutines and checks if there are any +// interestring (created by gRPC) goroutines leaked. It waits up to 10 seconds +// in the error cases. +func Check(efer Errorfer) { + check(efer, 10*time.Second) +} diff --git a/vendor/google.golang.org/grpc/test/leakcheck/leakcheck_test.go b/vendor/google.golang.org/grpc/test/leakcheck/leakcheck_test.go new file mode 100644 index 0000000000..50927e9db4 --- /dev/null +++ b/vendor/google.golang.org/grpc/test/leakcheck/leakcheck_test.go @@ -0,0 +1,76 @@ +/* + * + * Copyright 2017 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. + * + */ + +package leakcheck + +import ( + "fmt" + "strings" + "testing" + "time" +) + +type testErrorfer struct { + errorCount int + errors []string +} + +func (e *testErrorfer) Errorf(format string, args ...interface{}) { + e.errors = append(e.errors, fmt.Sprintf(format, args...)) + e.errorCount++ +} + +func TestCheck(t *testing.T) { + const leakCount = 3 + for i := 0; i < leakCount; i++ { + go func() { time.Sleep(2 * time.Second) }() + } + if ig := interestingGoroutines(); len(ig) == 0 { + t.Error("blah") + } + e := &testErrorfer{} + check(e, time.Second) + if e.errorCount != leakCount { + t.Errorf("check found %v leaks, want %v leaks", e.errorCount, leakCount) + t.Logf("leaked goroutines:\n%v", strings.Join(e.errors, "\n")) + } + check(t, 3*time.Second) +} + +func ignoredTestingLeak(d time.Duration) { + time.Sleep(d) +} + +func TestCheckRegisterIgnore(t *testing.T) { + RegisterIgnoreGoroutine("ignoredTestingLeak") + const leakCount = 3 + for i := 0; i < leakCount; i++ { + go func() { time.Sleep(2 * time.Second) }() + } + go func() { ignoredTestingLeak(3 * time.Second) }() + if ig := interestingGoroutines(); len(ig) == 0 { + t.Error("blah") + } + e := &testErrorfer{} + check(e, time.Second) + if e.errorCount != leakCount { + t.Errorf("check found %v leaks, want %v leaks", e.errorCount, leakCount) + t.Logf("leaked goroutines:\n%v", strings.Join(e.errors, "\n")) + } + check(t, 3*time.Second) +} diff --git a/vendor/google.golang.org/grpc/test/race.go b/vendor/google.golang.org/grpc/test/race.go new file mode 100644 index 0000000000..acfa0dfae3 --- /dev/null +++ b/vendor/google.golang.org/grpc/test/race.go @@ -0,0 +1,24 @@ +// +build race + +/* + * Copyright 2016 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. + * + */ + +package test + +func init() { + raceMode = true +} diff --git a/vendor/google.golang.org/grpc/test/servertester.go b/vendor/google.golang.org/grpc/test/servertester.go new file mode 100644 index 0000000000..daeca0622b --- /dev/null +++ b/vendor/google.golang.org/grpc/test/servertester.go @@ -0,0 +1,280 @@ +/* + * Copyright 2016 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. + */ + +package test + +import ( + "bytes" + "errors" + "io" + "strings" + "testing" + "time" + + "golang.org/x/net/http2" + "golang.org/x/net/http2/hpack" +) + +// This is a subset of http2's serverTester type. +// +// serverTester wraps a io.ReadWriter (acting like the underlying +// network connection) and provides utility methods to read and write +// http2 frames. +// +// NOTE(bradfitz): this could eventually be exported somewhere. Others +// have asked for it too. For now I'm still experimenting with the +// API and don't feel like maintaining a stable testing API. + +type serverTester struct { + cc io.ReadWriteCloser // client conn + t testing.TB + fr *http2.Framer + + // writing headers: + headerBuf bytes.Buffer + hpackEnc *hpack.Encoder + + // reading frames: + frc chan http2.Frame + frErrc chan error + readTimer *time.Timer +} + +func newServerTesterFromConn(t testing.TB, cc io.ReadWriteCloser) *serverTester { + st := &serverTester{ + t: t, + cc: cc, + frc: make(chan http2.Frame, 1), + frErrc: make(chan error, 1), + } + st.hpackEnc = hpack.NewEncoder(&st.headerBuf) + st.fr = http2.NewFramer(cc, cc) + st.fr.ReadMetaHeaders = hpack.NewDecoder(4096 /*initialHeaderTableSize*/, nil) + + return st +} + +func (st *serverTester) readFrame() (http2.Frame, error) { + go func() { + fr, err := st.fr.ReadFrame() + if err != nil { + st.frErrc <- err + } else { + st.frc <- fr + } + }() + t := time.NewTimer(2 * time.Second) + defer t.Stop() + select { + case f := <-st.frc: + return f, nil + case err := <-st.frErrc: + return nil, err + case <-t.C: + return nil, errors.New("timeout waiting for frame") + } +} + +// greet initiates the client's HTTP/2 connection into a state where +// frames may be sent. +func (st *serverTester) greet() { + st.writePreface() + st.writeInitialSettings() + st.wantSettings() + st.writeSettingsAck() + for { + f, err := st.readFrame() + if err != nil { + st.t.Fatal(err) + } + switch f := f.(type) { + case *http2.WindowUpdateFrame: + // grpc's transport/http2_server sends this + // before the settings ack. The Go http2 + // server uses a setting instead. + case *http2.SettingsFrame: + if f.IsAck() { + return + } + st.t.Fatalf("during greet, got non-ACK settings frame") + default: + st.t.Fatalf("during greet, unexpected frame type %T", f) + } + } +} + +func (st *serverTester) writePreface() { + n, err := st.cc.Write([]byte(http2.ClientPreface)) + if err != nil { + st.t.Fatalf("Error writing client preface: %v", err) + } + if n != len(http2.ClientPreface) { + st.t.Fatalf("Writing client preface, wrote %d bytes; want %d", n, len(http2.ClientPreface)) + } +} + +func (st *serverTester) writeInitialSettings() { + if err := st.fr.WriteSettings(); err != nil { + st.t.Fatalf("Error writing initial SETTINGS frame from client to server: %v", err) + } +} + +func (st *serverTester) writeSettingsAck() { + if err := st.fr.WriteSettingsAck(); err != nil { + st.t.Fatalf("Error writing ACK of server's SETTINGS: %v", err) + } +} + +func (st *serverTester) wantSettings() *http2.SettingsFrame { + f, err := st.readFrame() + if err != nil { + st.t.Fatalf("Error while expecting a SETTINGS frame: %v", err) + } + sf, ok := f.(*http2.SettingsFrame) + if !ok { + st.t.Fatalf("got a %T; want *SettingsFrame", f) + } + return sf +} + +func (st *serverTester) wantSettingsAck() { + f, err := st.readFrame() + if err != nil { + st.t.Fatal(err) + } + sf, ok := f.(*http2.SettingsFrame) + if !ok { + st.t.Fatalf("Wanting a settings ACK, received a %T", f) + } + if !sf.IsAck() { + st.t.Fatal("Settings Frame didn't have ACK set") + } +} + +// wait for any activity from the server +func (st *serverTester) wantAnyFrame() http2.Frame { + f, err := st.fr.ReadFrame() + if err != nil { + st.t.Fatal(err) + } + return f +} + +func (st *serverTester) encodeHeaderField(k, v string) { + err := st.hpackEnc.WriteField(hpack.HeaderField{Name: k, Value: v}) + if err != nil { + st.t.Fatalf("HPACK encoding error for %q/%q: %v", k, v, err) + } +} + +// encodeHeader encodes headers and returns their HPACK bytes. headers +// must contain an even number of key/value pairs. There may be +// multiple pairs for keys (e.g. "cookie"). The :method, :path, and +// :scheme headers default to GET, / and https. +func (st *serverTester) encodeHeader(headers ...string) []byte { + if len(headers)%2 == 1 { + panic("odd number of kv args") + } + + st.headerBuf.Reset() + + if len(headers) == 0 { + // Fast path, mostly for benchmarks, so test code doesn't pollute + // profiles when we're looking to improve server allocations. + st.encodeHeaderField(":method", "GET") + st.encodeHeaderField(":path", "/") + st.encodeHeaderField(":scheme", "https") + return st.headerBuf.Bytes() + } + + if len(headers) == 2 && headers[0] == ":method" { + // Another fast path for benchmarks. + st.encodeHeaderField(":method", headers[1]) + st.encodeHeaderField(":path", "/") + st.encodeHeaderField(":scheme", "https") + return st.headerBuf.Bytes() + } + + pseudoCount := map[string]int{} + keys := []string{":method", ":path", ":scheme"} + vals := map[string][]string{ + ":method": {"GET"}, + ":path": {"/"}, + ":scheme": {"https"}, + } + for len(headers) > 0 { + k, v := headers[0], headers[1] + headers = headers[2:] + if _, ok := vals[k]; !ok { + keys = append(keys, k) + } + if strings.HasPrefix(k, ":") { + pseudoCount[k]++ + if pseudoCount[k] == 1 { + vals[k] = []string{v} + } else { + // Allows testing of invalid headers w/ dup pseudo fields. + vals[k] = append(vals[k], v) + } + } else { + vals[k] = append(vals[k], v) + } + } + for _, k := range keys { + for _, v := range vals[k] { + st.encodeHeaderField(k, v) + } + } + return st.headerBuf.Bytes() +} + +func (st *serverTester) writeHeadersGRPC(streamID uint32, path string) { + st.writeHeaders(http2.HeadersFrameParam{ + StreamID: streamID, + BlockFragment: st.encodeHeader( + ":method", "POST", + ":path", path, + "content-type", "application/grpc", + "te", "trailers", + ), + EndStream: false, + EndHeaders: true, + }) +} + +func (st *serverTester) writeHeaders(p http2.HeadersFrameParam) { + if err := st.fr.WriteHeaders(p); err != nil { + st.t.Fatalf("Error writing HEADERS: %v", err) + } +} + +func (st *serverTester) writeData(streamID uint32, endStream bool, data []byte) { + if err := st.fr.WriteData(streamID, endStream, data); err != nil { + st.t.Fatalf("Error writing DATA: %v", err) + } +} + +func (st *serverTester) writeRSTStream(streamID uint32, code http2.ErrCode) { + if err := st.fr.WriteRSTStream(streamID, code); err != nil { + st.t.Fatalf("Error writing RST_STREAM: %v", err) + } +} + +func (st *serverTester) writeDataPadded(streamID uint32, endStream bool, data, padding []byte) { + if err := st.fr.WriteDataPadded(streamID, endStream, data, padding); err != nil { + st.t.Fatalf("Error writing DATA with padding: %v", err) + } +} diff --git a/vendor/google.golang.org/grpc/testdata/ca.pem b/vendor/google.golang.org/grpc/testdata/ca.pem new file mode 100644 index 0000000000..6c8511a73c --- /dev/null +++ b/vendor/google.golang.org/grpc/testdata/ca.pem @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICSjCCAbOgAwIBAgIJAJHGGR4dGioHMA0GCSqGSIb3DQEBCwUAMFYxCzAJBgNV +BAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX +aWRnaXRzIFB0eSBMdGQxDzANBgNVBAMTBnRlc3RjYTAeFw0xNDExMTEyMjMxMjla +Fw0yNDExMDgyMjMxMjlaMFYxCzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0 +YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxDzANBgNVBAMT +BnRlc3RjYTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAwEDfBV5MYdlHVHJ7 ++L4nxrZy7mBfAVXpOc5vMYztssUI7mL2/iYujiIXM+weZYNTEpLdjyJdu7R5gGUu +g1jSVK/EPHfc74O7AyZU34PNIP4Sh33N+/A5YexrNgJlPY+E3GdVYi4ldWJjgkAd +Qah2PH5ACLrIIC6tRka9hcaBlIECAwEAAaMgMB4wDAYDVR0TBAUwAwEB/zAOBgNV +HQ8BAf8EBAMCAgQwDQYJKoZIhvcNAQELBQADgYEAHzC7jdYlzAVmddi/gdAeKPau +sPBG/C2HCWqHzpCUHcKuvMzDVkY/MP2o6JIW2DBbY64bO/FceExhjcykgaYtCH/m +oIU63+CFOTtR7otyQAWHqXa7q4SbCDlG7DyRFxqG0txPtGvy12lgldA2+RgcigQG +Dfcog5wrJytaQ6UA0wE= +-----END CERTIFICATE----- diff --git a/vendor/google.golang.org/grpc/testdata/server1.key b/vendor/google.golang.org/grpc/testdata/server1.key new file mode 100644 index 0000000000..143a5b8765 --- /dev/null +++ b/vendor/google.golang.org/grpc/testdata/server1.key @@ -0,0 +1,16 @@ +-----BEGIN PRIVATE KEY----- +MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBAOHDFScoLCVJpYDD +M4HYtIdV6Ake/sMNaaKdODjDMsux/4tDydlumN+fm+AjPEK5GHhGn1BgzkWF+slf +3BxhrA/8dNsnunstVA7ZBgA/5qQxMfGAq4wHNVX77fBZOgp9VlSMVfyd9N8YwbBY +AckOeUQadTi2X1S6OgJXgQ0m3MWhAgMBAAECgYAn7qGnM2vbjJNBm0VZCkOkTIWm +V10okw7EPJrdL2mkre9NasghNXbE1y5zDshx5Nt3KsazKOxTT8d0Jwh/3KbaN+YY +tTCbKGW0pXDRBhwUHRcuRzScjli8Rih5UOCiZkhefUTcRb6xIhZJuQy71tjaSy0p +dHZRmYyBYO2YEQ8xoQJBAPrJPhMBkzmEYFtyIEqAxQ/o/A6E+E4w8i+KM7nQCK7q +K4JXzyXVAjLfyBZWHGM2uro/fjqPggGD6QH1qXCkI4MCQQDmdKeb2TrKRh5BY1LR +81aJGKcJ2XbcDu6wMZK4oqWbTX2KiYn9GB0woM6nSr/Y6iy1u145YzYxEV/iMwff +DJULAkB8B2MnyzOg0pNFJqBJuH29bKCcHa8gHJzqXhNO5lAlEbMK95p/P2Wi+4Hd +aiEIAF1BF326QJcvYKmwSmrORp85AkAlSNxRJ50OWrfMZnBgzVjDx3xG6KsFQVk2 +ol6VhqL6dFgKUORFUWBvnKSyhjJxurlPEahV6oo6+A+mPhFY8eUvAkAZQyTdupP3 +XEFQKctGz+9+gKkemDp7LBBMEMBXrGTLPhpEfcjv/7KPdnFHYmhYeBTBnuVmTVWe +F98XJ7tIFfJq +-----END PRIVATE KEY----- diff --git a/vendor/google.golang.org/grpc/testdata/server1.pem b/vendor/google.golang.org/grpc/testdata/server1.pem new file mode 100644 index 0000000000..f3d43fcc5b --- /dev/null +++ b/vendor/google.golang.org/grpc/testdata/server1.pem @@ -0,0 +1,16 @@ +-----BEGIN CERTIFICATE----- +MIICnDCCAgWgAwIBAgIBBzANBgkqhkiG9w0BAQsFADBWMQswCQYDVQQGEwJBVTET +MBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0cyBQ +dHkgTHRkMQ8wDQYDVQQDEwZ0ZXN0Y2EwHhcNMTUxMTA0MDIyMDI0WhcNMjUxMTAx +MDIyMDI0WjBlMQswCQYDVQQGEwJVUzERMA8GA1UECBMISWxsaW5vaXMxEDAOBgNV +BAcTB0NoaWNhZ28xFTATBgNVBAoTDEV4YW1wbGUsIENvLjEaMBgGA1UEAxQRKi50 +ZXN0Lmdvb2dsZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAOHDFSco +LCVJpYDDM4HYtIdV6Ake/sMNaaKdODjDMsux/4tDydlumN+fm+AjPEK5GHhGn1Bg +zkWF+slf3BxhrA/8dNsnunstVA7ZBgA/5qQxMfGAq4wHNVX77fBZOgp9VlSMVfyd +9N8YwbBYAckOeUQadTi2X1S6OgJXgQ0m3MWhAgMBAAGjazBpMAkGA1UdEwQCMAAw +CwYDVR0PBAQDAgXgME8GA1UdEQRIMEaCECoudGVzdC5nb29nbGUuZnKCGHdhdGVy +em9vaS50ZXN0Lmdvb2dsZS5iZYISKi50ZXN0LnlvdXR1YmUuY29thwTAqAEDMA0G +CSqGSIb3DQEBCwUAA4GBAJFXVifQNub1LUP4JlnX5lXNlo8FxZ2a12AFQs+bzoJ6 +hM044EDjqyxUqSbVePK0ni3w1fHQB5rY9yYC5f8G7aqqTY1QOhoUk8ZTSTRpnkTh +y4jjdvTZeLDVBlueZUTDRmy2feY5aZIU18vFDK08dTG0A87pppuv1LNIR3loveU8 +-----END CERTIFICATE----- diff --git a/vendor/google.golang.org/grpc/testdata/testdata.go b/vendor/google.golang.org/grpc/testdata/testdata.go new file mode 100644 index 0000000000..5609b19b3a --- /dev/null +++ b/vendor/google.golang.org/grpc/testdata/testdata.go @@ -0,0 +1,63 @@ +/* + * Copyright 2017 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. + * + */ + +package testdata + +import ( + "log" + "os" + "path/filepath" +) + +// Path returns the absolute path the given relative file or directory path, +// relative to the google.golang.org/grpc/testdata directory in the user's GOPATH. +// If rel is already absolute, it is returned unmodified. +func Path(rel string) string { + if filepath.IsAbs(rel) { + return rel + } + + v, err := goPackagePath("google.golang.org/grpc/testdata") + if err != nil { + log.Fatalf("Error finding google.golang.org/grpc/testdata directory: %v", err) + } + + return filepath.Join(v, rel) +} + +func goPackagePath(pkg string) (path string, err error) { + gp := os.Getenv("GOPATH") + if gp == "" { + return path, os.ErrNotExist + } + + for _, p := range filepath.SplitList(gp) { + dir := filepath.Join(p, "src", filepath.FromSlash(pkg)) + fi, err := os.Stat(dir) + if os.IsNotExist(err) { + continue + } + if err != nil { + return "", err + } + if !fi.IsDir() { + continue + } + return dir, nil + } + return path, os.ErrNotExist +} diff --git a/vendor/google.golang.org/grpc/trace.go b/vendor/google.golang.org/grpc/trace.go new file mode 100644 index 0000000000..c1c96dedcb --- /dev/null +++ b/vendor/google.golang.org/grpc/trace.go @@ -0,0 +1,113 @@ +/* + * + * Copyright 2015 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. + * + */ + +package grpc + +import ( + "bytes" + "fmt" + "io" + "net" + "strings" + "time" + + "golang.org/x/net/trace" +) + +// EnableTracing controls whether to trace RPCs using the golang.org/x/net/trace package. +// This should only be set before any RPCs are sent or received by this program. +var EnableTracing bool + +// methodFamily returns the trace family for the given method. +// It turns "/pkg.Service/GetFoo" into "pkg.Service". +func methodFamily(m string) string { + m = strings.TrimPrefix(m, "/") // remove leading slash + if i := strings.Index(m, "/"); i >= 0 { + m = m[:i] // remove everything from second slash + } + if i := strings.LastIndex(m, "."); i >= 0 { + m = m[i+1:] // cut down to last dotted component + } + return m +} + +// traceInfo contains tracing information for an RPC. +type traceInfo struct { + tr trace.Trace + firstLine firstLine +} + +// firstLine is the first line of an RPC trace. +type firstLine struct { + client bool // whether this is a client (outgoing) RPC + remoteAddr net.Addr + deadline time.Duration // may be zero +} + +func (f *firstLine) String() string { + var line bytes.Buffer + io.WriteString(&line, "RPC: ") + if f.client { + io.WriteString(&line, "to") + } else { + io.WriteString(&line, "from") + } + fmt.Fprintf(&line, " %v deadline:", f.remoteAddr) + if f.deadline != 0 { + fmt.Fprint(&line, f.deadline) + } else { + io.WriteString(&line, "none") + } + return line.String() +} + +const truncateSize = 100 + +func truncate(x string, l int) string { + if l > len(x) { + return x + } + return x[:l] +} + +// payload represents an RPC request or response payload. +type payload struct { + sent bool // whether this is an outgoing payload + msg interface{} // e.g. a proto.Message + // TODO(dsymonds): add stringifying info to codec, and limit how much we hold here? +} + +func (p payload) String() string { + if p.sent { + return truncate(fmt.Sprintf("sent: %v", p.msg), truncateSize) + } + return truncate(fmt.Sprintf("recv: %v", p.msg), truncateSize) +} + +type fmtStringer struct { + format string + a []interface{} +} + +func (f *fmtStringer) String() string { + return fmt.Sprintf(f.format, f.a...) +} + +type stringer string + +func (s stringer) String() string { return string(s) } diff --git a/vendor/google.golang.org/grpc/transport/bdp_estimator.go b/vendor/google.golang.org/grpc/transport/bdp_estimator.go new file mode 100644 index 0000000000..63cd2627c8 --- /dev/null +++ b/vendor/google.golang.org/grpc/transport/bdp_estimator.go @@ -0,0 +1,140 @@ +/* + * + * Copyright 2017 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. + * + */ + +package transport + +import ( + "sync" + "time" +) + +const ( + // bdpLimit is the maximum value the flow control windows + // will be increased to. + bdpLimit = (1 << 20) * 4 + // alpha is a constant factor used to keep a moving average + // of RTTs. + alpha = 0.9 + // If the current bdp sample is greater than or equal to + // our beta * our estimated bdp and the current bandwidth + // sample is the maximum bandwidth observed so far, we + // increase our bbp estimate by a factor of gamma. + beta = 0.66 + // To put our bdp to be smaller than or equal to twice the real BDP, + // we should multiply our current sample with 4/3, however to round things out + // we use 2 as the multiplication factor. + gamma = 2 +) + +// Adding arbitrary data to ping so that its ack can be identified. +// Easter-egg: what does the ping message say? +var bdpPing = &ping{data: [8]byte{2, 4, 16, 16, 9, 14, 7, 7}} + +type bdpEstimator struct { + // sentAt is the time when the ping was sent. + sentAt time.Time + + mu sync.Mutex + // bdp is the current bdp estimate. + bdp uint32 + // sample is the number of bytes received in one measurement cycle. + sample uint32 + // bwMax is the maximum bandwidth noted so far (bytes/sec). + bwMax float64 + // bool to keep track of the beginning of a new measurement cycle. + isSent bool + // Callback to update the window sizes. + updateFlowControl func(n uint32) + // sampleCount is the number of samples taken so far. + sampleCount uint64 + // round trip time (seconds) + rtt float64 +} + +// timesnap registers the time bdp ping was sent out so that +// network rtt can be calculated when its ack is received. +// It is called (by controller) when the bdpPing is +// being written on the wire. +func (b *bdpEstimator) timesnap(d [8]byte) { + if bdpPing.data != d { + return + } + b.sentAt = time.Now() +} + +// add adds bytes to the current sample for calculating bdp. +// It returns true only if a ping must be sent. This can be used +// by the caller (handleData) to make decision about batching +// a window update with it. +func (b *bdpEstimator) add(n uint32) bool { + b.mu.Lock() + defer b.mu.Unlock() + if b.bdp == bdpLimit { + return false + } + if !b.isSent { + b.isSent = true + b.sample = n + b.sentAt = time.Time{} + b.sampleCount++ + return true + } + b.sample += n + return false +} + +// calculate is called when an ack for a bdp ping is received. +// Here we calculate the current bdp and bandwidth sample and +// decide if the flow control windows should go up. +func (b *bdpEstimator) calculate(d [8]byte) { + // Check if the ping acked for was the bdp ping. + if bdpPing.data != d { + return + } + b.mu.Lock() + rttSample := time.Since(b.sentAt).Seconds() + if b.sampleCount < 10 { + // Bootstrap rtt with an average of first 10 rtt samples. + b.rtt += (rttSample - b.rtt) / float64(b.sampleCount) + } else { + // Heed to the recent past more. + b.rtt += (rttSample - b.rtt) * float64(alpha) + } + b.isSent = false + // The number of bytes accumulated so far in the sample is smaller + // than or equal to 1.5 times the real BDP on a saturated connection. + bwCurrent := float64(b.sample) / (b.rtt * float64(1.5)) + if bwCurrent > b.bwMax { + b.bwMax = bwCurrent + } + // If the current sample (which is smaller than or equal to the 1.5 times the real BDP) is + // greater than or equal to 2/3rd our perceived bdp AND this is the maximum bandwidth seen so far, we + // should update our perception of the network BDP. + if float64(b.sample) >= beta*float64(b.bdp) && bwCurrent == b.bwMax && b.bdp != bdpLimit { + sampleFloat := float64(b.sample) + b.bdp = uint32(gamma * sampleFloat) + if b.bdp > bdpLimit { + b.bdp = bdpLimit + } + bdp := b.bdp + b.mu.Unlock() + b.updateFlowControl(bdp) + return + } + b.mu.Unlock() +} diff --git a/vendor/google.golang.org/grpc/transport/control.go b/vendor/google.golang.org/grpc/transport/control.go new file mode 100644 index 0000000000..63194830d4 --- /dev/null +++ b/vendor/google.golang.org/grpc/transport/control.go @@ -0,0 +1,333 @@ +/* + * + * Copyright 2014 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. + * + */ + +package transport + +import ( + "fmt" + "io" + "math" + "sync" + "time" + + "golang.org/x/net/http2" + "golang.org/x/net/http2/hpack" +) + +const ( + // The default value of flow control window size in HTTP2 spec. + defaultWindowSize = 65535 + // The initial window size for flow control. + initialWindowSize = defaultWindowSize // for an RPC + infinity = time.Duration(math.MaxInt64) + defaultClientKeepaliveTime = infinity + defaultClientKeepaliveTimeout = time.Duration(20 * time.Second) + defaultMaxStreamsClient = 100 + defaultMaxConnectionIdle = infinity + defaultMaxConnectionAge = infinity + defaultMaxConnectionAgeGrace = infinity + defaultServerKeepaliveTime = time.Duration(2 * time.Hour) + defaultServerKeepaliveTimeout = time.Duration(20 * time.Second) + defaultKeepalivePolicyMinTime = time.Duration(5 * time.Minute) + // max window limit set by HTTP2 Specs. + maxWindowSize = math.MaxInt32 + // defaultLocalSendQuota sets is default value for number of data + // bytes that each stream can schedule before some of it being + // flushed out. + defaultLocalSendQuota = 128 * 1024 +) + +// The following defines various control items which could flow through +// the control buffer of transport. They represent different aspects of +// control tasks, e.g., flow control, settings, streaming resetting, etc. + +type headerFrame struct { + streamID uint32 + hf []hpack.HeaderField + endStream bool +} + +func (*headerFrame) item() {} + +type continuationFrame struct { + streamID uint32 + endHeaders bool + headerBlockFragment []byte +} + +type dataFrame struct { + streamID uint32 + endStream bool + d []byte + f func() +} + +func (*dataFrame) item() {} + +func (*continuationFrame) item() {} + +type windowUpdate struct { + streamID uint32 + increment uint32 +} + +func (*windowUpdate) item() {} + +type settings struct { + ss []http2.Setting +} + +func (*settings) item() {} + +type settingsAck struct { +} + +func (*settingsAck) item() {} + +type resetStream struct { + streamID uint32 + code http2.ErrCode +} + +func (*resetStream) item() {} + +type goAway struct { + code http2.ErrCode + debugData []byte + headsUp bool + closeConn bool +} + +func (*goAway) item() {} + +type flushIO struct { +} + +func (*flushIO) item() {} + +type ping struct { + ack bool + data [8]byte +} + +func (*ping) item() {} + +// quotaPool is a pool which accumulates the quota and sends it to acquire() +// when it is available. +type quotaPool struct { + mu sync.Mutex + c chan struct{} + version uint32 + quota int +} + +// newQuotaPool creates a quotaPool which has quota q available to consume. +func newQuotaPool(q int) *quotaPool { + qb := "aPool{ + quota: q, + c: make(chan struct{}, 1), + } + return qb +} + +// add cancels the pending quota sent on acquired, incremented by v and sends +// it back on acquire. +func (qb *quotaPool) add(v int) { + qb.mu.Lock() + defer qb.mu.Unlock() + qb.lockedAdd(v) +} + +func (qb *quotaPool) lockedAdd(v int) { + var wakeUp bool + if qb.quota <= 0 { + wakeUp = true // Wake up potential waiters. + } + qb.quota += v + if wakeUp && qb.quota > 0 { + select { + case qb.c <- struct{}{}: + default: + } + } +} + +func (qb *quotaPool) addAndUpdate(v int) { + qb.mu.Lock() + qb.lockedAdd(v) + qb.version++ + qb.mu.Unlock() +} + +func (qb *quotaPool) get(v int, wc waiters) (int, uint32, error) { + qb.mu.Lock() + if qb.quota > 0 { + if v > qb.quota { + v = qb.quota + } + qb.quota -= v + ver := qb.version + qb.mu.Unlock() + return v, ver, nil + } + qb.mu.Unlock() + for { + select { + case <-wc.ctx.Done(): + return 0, 0, ContextErr(wc.ctx.Err()) + case <-wc.tctx.Done(): + return 0, 0, ErrConnClosing + case <-wc.done: + return 0, 0, io.EOF + case <-wc.goAway: + return 0, 0, errStreamDrain + case <-qb.c: + qb.mu.Lock() + if qb.quota > 0 { + if v > qb.quota { + v = qb.quota + } + qb.quota -= v + ver := qb.version + if qb.quota > 0 { + select { + case qb.c <- struct{}{}: + default: + } + } + qb.mu.Unlock() + return v, ver, nil + + } + qb.mu.Unlock() + } + } +} + +func (qb *quotaPool) compareAndExecute(version uint32, success, failure func()) bool { + qb.mu.Lock() + if version == qb.version { + success() + qb.mu.Unlock() + return true + } + failure() + qb.mu.Unlock() + return false +} + +// inFlow deals with inbound flow control +type inFlow struct { + mu sync.Mutex + // The inbound flow control limit for pending data. + limit uint32 + // pendingData is the overall data which have been received but not been + // consumed by applications. + pendingData uint32 + // The amount of data the application has consumed but grpc has not sent + // window update for them. Used to reduce window update frequency. + pendingUpdate uint32 + // delta is the extra window update given by receiver when an application + // is reading data bigger in size than the inFlow limit. + delta uint32 +} + +// newLimit updates the inflow window to a new value n. +// It assumes that n is always greater than the old limit. +func (f *inFlow) newLimit(n uint32) uint32 { + f.mu.Lock() + defer f.mu.Unlock() + d := n - f.limit + f.limit = n + return d +} + +func (f *inFlow) maybeAdjust(n uint32) uint32 { + if n > uint32(math.MaxInt32) { + n = uint32(math.MaxInt32) + } + f.mu.Lock() + defer f.mu.Unlock() + // estSenderQuota is the receiver's view of the maximum number of bytes the sender + // can send without a window update. + estSenderQuota := int32(f.limit - (f.pendingData + f.pendingUpdate)) + // estUntransmittedData is the maximum number of bytes the sends might not have put + // on the wire yet. A value of 0 or less means that we have already received all or + // more bytes than the application is requesting to read. + estUntransmittedData := int32(n - f.pendingData) // Casting into int32 since it could be negative. + // This implies that unless we send a window update, the sender won't be able to send all the bytes + // for this message. Therefore we must send an update over the limit since there's an active read + // request from the application. + if estUntransmittedData > estSenderQuota { + // Sender's window shouldn't go more than 2^31 - 1 as speecified in the HTTP spec. + if f.limit+n > maxWindowSize { + f.delta = maxWindowSize - f.limit + } else { + // Send a window update for the whole message and not just the difference between + // estUntransmittedData and estSenderQuota. This will be helpful in case the message + // is padded; We will fallback on the current available window(at least a 1/4th of the limit). + f.delta = n + } + return f.delta + } + return 0 +} + +// onData is invoked when some data frame is received. It updates pendingData. +func (f *inFlow) onData(n uint32) error { + f.mu.Lock() + defer f.mu.Unlock() + f.pendingData += n + if f.pendingData+f.pendingUpdate > f.limit+f.delta { + return fmt.Errorf("received %d-bytes data exceeding the limit %d bytes", f.pendingData+f.pendingUpdate, f.limit) + } + return nil +} + +// onRead is invoked when the application reads the data. It returns the window size +// to be sent to the peer. +func (f *inFlow) onRead(n uint32) uint32 { + f.mu.Lock() + defer f.mu.Unlock() + if f.pendingData == 0 { + return 0 + } + f.pendingData -= n + if n > f.delta { + n -= f.delta + f.delta = 0 + } else { + f.delta -= n + n = 0 + } + f.pendingUpdate += n + if f.pendingUpdate >= f.limit/4 { + wu := f.pendingUpdate + f.pendingUpdate = 0 + return wu + } + return 0 +} + +func (f *inFlow) resetPendingUpdate() uint32 { + f.mu.Lock() + defer f.mu.Unlock() + n := f.pendingUpdate + f.pendingUpdate = 0 + return n +} diff --git a/vendor/google.golang.org/grpc/transport/go16.go b/vendor/google.golang.org/grpc/transport/go16.go new file mode 100644 index 0000000000..7cffee11e0 --- /dev/null +++ b/vendor/google.golang.org/grpc/transport/go16.go @@ -0,0 +1,45 @@ +// +build go1.6,!go1.7 + +/* + * + * Copyright 2016 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. + * + */ + +package transport + +import ( + "net" + + "google.golang.org/grpc/codes" + + "golang.org/x/net/context" +) + +// dialContext connects to the address on the named network. +func dialContext(ctx context.Context, network, address string) (net.Conn, error) { + return (&net.Dialer{Cancel: ctx.Done()}).Dial(network, address) +} + +// ContextErr converts the error from context package into a StreamError. +func ContextErr(err error) StreamError { + switch err { + case context.DeadlineExceeded: + return streamErrorf(codes.DeadlineExceeded, "%v", err) + case context.Canceled: + return streamErrorf(codes.Canceled, "%v", err) + } + return streamErrorf(codes.Internal, "Unexpected error from context packet: %v", err) +} diff --git a/vendor/google.golang.org/grpc/transport/go17.go b/vendor/google.golang.org/grpc/transport/go17.go new file mode 100644 index 0000000000..2464e69faf --- /dev/null +++ b/vendor/google.golang.org/grpc/transport/go17.go @@ -0,0 +1,46 @@ +// +build go1.7 + +/* + * + * Copyright 2016 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. + * + */ + +package transport + +import ( + "context" + "net" + + "google.golang.org/grpc/codes" + + netctx "golang.org/x/net/context" +) + +// dialContext connects to the address on the named network. +func dialContext(ctx context.Context, network, address string) (net.Conn, error) { + return (&net.Dialer{}).DialContext(ctx, network, address) +} + +// ContextErr converts the error from context package into a StreamError. +func ContextErr(err error) StreamError { + switch err { + case context.DeadlineExceeded, netctx.DeadlineExceeded: + return streamErrorf(codes.DeadlineExceeded, "%v", err) + case context.Canceled, netctx.Canceled: + return streamErrorf(codes.Canceled, "%v", err) + } + return streamErrorf(codes.Internal, "Unexpected error from context packet: %v", err) +} diff --git a/vendor/google.golang.org/grpc/transport/handler_server.go b/vendor/google.golang.org/grpc/transport/handler_server.go new file mode 100644 index 0000000000..f1f6caf89c --- /dev/null +++ b/vendor/google.golang.org/grpc/transport/handler_server.go @@ -0,0 +1,414 @@ +/* + * + * Copyright 2016 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. + * + */ + +// This file is the implementation of a gRPC server using HTTP/2 which +// uses the standard Go http2 Server implementation (via the +// http.Handler interface), rather than speaking low-level HTTP/2 +// frames itself. It is the implementation of *grpc.Server.ServeHTTP. + +package transport + +import ( + "errors" + "fmt" + "io" + "net" + "net/http" + "strings" + "sync" + "time" + + "github.com/golang/protobuf/proto" + "golang.org/x/net/context" + "golang.org/x/net/http2" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/peer" + "google.golang.org/grpc/status" +) + +// NewServerHandlerTransport returns a ServerTransport handling gRPC +// from inside an http.Handler. It requires that the http Server +// supports HTTP/2. +func NewServerHandlerTransport(w http.ResponseWriter, r *http.Request) (ServerTransport, error) { + if r.ProtoMajor != 2 { + return nil, errors.New("gRPC requires HTTP/2") + } + if r.Method != "POST" { + return nil, errors.New("invalid gRPC request method") + } + if !validContentType(r.Header.Get("Content-Type")) { + return nil, errors.New("invalid gRPC request content-type") + } + if _, ok := w.(http.Flusher); !ok { + return nil, errors.New("gRPC requires a ResponseWriter supporting http.Flusher") + } + if _, ok := w.(http.CloseNotifier); !ok { + return nil, errors.New("gRPC requires a ResponseWriter supporting http.CloseNotifier") + } + + st := &serverHandlerTransport{ + rw: w, + req: r, + closedCh: make(chan struct{}), + writes: make(chan func()), + } + + if v := r.Header.Get("grpc-timeout"); v != "" { + to, err := decodeTimeout(v) + if err != nil { + return nil, streamErrorf(codes.Internal, "malformed time-out: %v", err) + } + st.timeoutSet = true + st.timeout = to + } + + var metakv []string + if r.Host != "" { + metakv = append(metakv, ":authority", r.Host) + } + for k, vv := range r.Header { + k = strings.ToLower(k) + if isReservedHeader(k) && !isWhitelistedPseudoHeader(k) { + continue + } + for _, v := range vv { + v, err := decodeMetadataHeader(k, v) + if err != nil { + return nil, streamErrorf(codes.InvalidArgument, "malformed binary metadata: %v", err) + } + metakv = append(metakv, k, v) + } + } + st.headerMD = metadata.Pairs(metakv...) + + return st, nil +} + +// serverHandlerTransport is an implementation of ServerTransport +// which replies to exactly one gRPC request (exactly one HTTP request), +// using the net/http.Handler interface. This http.Handler is guaranteed +// at this point to be speaking over HTTP/2, so it's able to speak valid +// gRPC. +type serverHandlerTransport struct { + rw http.ResponseWriter + req *http.Request + timeoutSet bool + timeout time.Duration + didCommonHeaders bool + + headerMD metadata.MD + + closeOnce sync.Once + closedCh chan struct{} // closed on Close + + // writes is a channel of code to run serialized in the + // ServeHTTP (HandleStreams) goroutine. The channel is closed + // when WriteStatus is called. + writes chan func() + + mu sync.Mutex + // streamDone indicates whether WriteStatus has been called and writes channel + // has been closed. + streamDone bool +} + +func (ht *serverHandlerTransport) Close() error { + ht.closeOnce.Do(ht.closeCloseChanOnce) + return nil +} + +func (ht *serverHandlerTransport) closeCloseChanOnce() { close(ht.closedCh) } + +func (ht *serverHandlerTransport) RemoteAddr() net.Addr { return strAddr(ht.req.RemoteAddr) } + +// strAddr is a net.Addr backed by either a TCP "ip:port" string, or +// the empty string if unknown. +type strAddr string + +func (a strAddr) Network() string { + if a != "" { + // Per the documentation on net/http.Request.RemoteAddr, if this is + // set, it's set to the IP:port of the peer (hence, TCP): + // https://golang.org/pkg/net/http/#Request + // + // If we want to support Unix sockets later, we can + // add our own grpc-specific convention within the + // grpc codebase to set RemoteAddr to a different + // format, or probably better: we can attach it to the + // context and use that from serverHandlerTransport.RemoteAddr. + return "tcp" + } + return "" +} + +func (a strAddr) String() string { return string(a) } + +// do runs fn in the ServeHTTP goroutine. +func (ht *serverHandlerTransport) do(fn func()) error { + // Avoid a panic writing to closed channel. Imperfect but maybe good enough. + select { + case <-ht.closedCh: + return ErrConnClosing + default: + select { + case ht.writes <- fn: + return nil + case <-ht.closedCh: + return ErrConnClosing + } + } +} + +func (ht *serverHandlerTransport) WriteStatus(s *Stream, st *status.Status) error { + ht.mu.Lock() + if ht.streamDone { + ht.mu.Unlock() + return nil + } + ht.streamDone = true + ht.mu.Unlock() + err := ht.do(func() { + ht.writeCommonHeaders(s) + + // And flush, in case no header or body has been sent yet. + // This forces a separation of headers and trailers if this is the + // first call (for example, in end2end tests's TestNoService). + ht.rw.(http.Flusher).Flush() + + h := ht.rw.Header() + h.Set("Grpc-Status", fmt.Sprintf("%d", st.Code())) + if m := st.Message(); m != "" { + h.Set("Grpc-Message", encodeGrpcMessage(m)) + } + + if p := st.Proto(); p != nil && len(p.Details) > 0 { + stBytes, err := proto.Marshal(p) + if err != nil { + // TODO: return error instead, when callers are able to handle it. + panic(err) + } + + h.Set("Grpc-Status-Details-Bin", encodeBinHeader(stBytes)) + } + + if md := s.Trailer(); len(md) > 0 { + for k, vv := range md { + // Clients don't tolerate reading restricted headers after some non restricted ones were sent. + if isReservedHeader(k) { + continue + } + for _, v := range vv { + // http2 ResponseWriter mechanism to send undeclared Trailers after + // the headers have possibly been written. + h.Add(http2.TrailerPrefix+k, encodeMetadataHeader(k, v)) + } + } + } + }) + close(ht.writes) + return err +} + +// writeCommonHeaders sets common headers on the first write +// call (Write, WriteHeader, or WriteStatus). +func (ht *serverHandlerTransport) writeCommonHeaders(s *Stream) { + if ht.didCommonHeaders { + return + } + ht.didCommonHeaders = true + + h := ht.rw.Header() + h["Date"] = nil // suppress Date to make tests happy; TODO: restore + h.Set("Content-Type", "application/grpc") + + // Predeclare trailers we'll set later in WriteStatus (after the body). + // This is a SHOULD in the HTTP RFC, and the way you add (known) + // Trailers per the net/http.ResponseWriter contract. + // See https://golang.org/pkg/net/http/#ResponseWriter + // and https://golang.org/pkg/net/http/#example_ResponseWriter_trailers + h.Add("Trailer", "Grpc-Status") + h.Add("Trailer", "Grpc-Message") + h.Add("Trailer", "Grpc-Status-Details-Bin") + + if s.sendCompress != "" { + h.Set("Grpc-Encoding", s.sendCompress) + } +} + +func (ht *serverHandlerTransport) Write(s *Stream, hdr []byte, data []byte, opts *Options) error { + return ht.do(func() { + ht.writeCommonHeaders(s) + ht.rw.Write(hdr) + ht.rw.Write(data) + if !opts.Delay { + ht.rw.(http.Flusher).Flush() + } + }) +} + +func (ht *serverHandlerTransport) WriteHeader(s *Stream, md metadata.MD) error { + return ht.do(func() { + ht.writeCommonHeaders(s) + h := ht.rw.Header() + for k, vv := range md { + // Clients don't tolerate reading restricted headers after some non restricted ones were sent. + if isReservedHeader(k) { + continue + } + for _, v := range vv { + v = encodeMetadataHeader(k, v) + h.Add(k, v) + } + } + ht.rw.WriteHeader(200) + ht.rw.(http.Flusher).Flush() + }) +} + +func (ht *serverHandlerTransport) HandleStreams(startStream func(*Stream), traceCtx func(context.Context, string) context.Context) { + // With this transport type there will be exactly 1 stream: this HTTP request. + + var ctx context.Context + var cancel context.CancelFunc + if ht.timeoutSet { + ctx, cancel = context.WithTimeout(context.Background(), ht.timeout) + } else { + ctx, cancel = context.WithCancel(context.Background()) + } + + // requestOver is closed when either the request's context is done + // or the status has been written via WriteStatus. + requestOver := make(chan struct{}) + + // clientGone receives a single value if peer is gone, either + // because the underlying connection is dead or because the + // peer sends an http2 RST_STREAM. + clientGone := ht.rw.(http.CloseNotifier).CloseNotify() + go func() { + select { + case <-requestOver: + return + case <-ht.closedCh: + case <-clientGone: + } + cancel() + }() + + req := ht.req + + s := &Stream{ + id: 0, // irrelevant + requestRead: func(int) {}, + cancel: cancel, + buf: newRecvBuffer(), + st: ht, + method: req.URL.Path, + recvCompress: req.Header.Get("grpc-encoding"), + } + pr := &peer.Peer{ + Addr: ht.RemoteAddr(), + } + if req.TLS != nil { + pr.AuthInfo = credentials.TLSInfo{State: *req.TLS} + } + ctx = metadata.NewIncomingContext(ctx, ht.headerMD) + ctx = peer.NewContext(ctx, pr) + s.ctx = newContextWithStream(ctx, s) + s.trReader = &transportReader{ + reader: &recvBufferReader{ctx: s.ctx, recv: s.buf}, + windowHandler: func(int) {}, + } + + // readerDone is closed when the Body.Read-ing goroutine exits. + readerDone := make(chan struct{}) + go func() { + defer close(readerDone) + + // TODO: minimize garbage, optimize recvBuffer code/ownership + const readSize = 8196 + for buf := make([]byte, readSize); ; { + n, err := req.Body.Read(buf) + if n > 0 { + s.buf.put(recvMsg{data: buf[:n:n]}) + buf = buf[n:] + } + if err != nil { + s.buf.put(recvMsg{err: mapRecvMsgError(err)}) + return + } + if len(buf) == 0 { + buf = make([]byte, readSize) + } + } + }() + + // startStream is provided by the *grpc.Server's serveStreams. + // It starts a goroutine serving s and exits immediately. + // The goroutine that is started is the one that then calls + // into ht, calling WriteHeader, Write, WriteStatus, Close, etc. + startStream(s) + + ht.runStream() + close(requestOver) + + // Wait for reading goroutine to finish. + req.Body.Close() + <-readerDone +} + +func (ht *serverHandlerTransport) runStream() { + for { + select { + case fn, ok := <-ht.writes: + if !ok { + return + } + fn() + case <-ht.closedCh: + return + } + } +} + +func (ht *serverHandlerTransport) Drain() { + panic("Drain() is not implemented") +} + +// mapRecvMsgError returns the non-nil err into the appropriate +// error value as expected by callers of *grpc.parser.recvMsg. +// In particular, in can only be: +// * io.EOF +// * io.ErrUnexpectedEOF +// * of type transport.ConnectionError +// * of type transport.StreamError +func mapRecvMsgError(err error) error { + if err == io.EOF || err == io.ErrUnexpectedEOF { + return err + } + if se, ok := err.(http2.StreamError); ok { + if code, ok := http2ErrConvTab[se.Code]; ok { + return StreamError{ + Code: code, + Desc: se.Error(), + } + } + } + return connectionErrorf(true, err, err.Error()) +} diff --git a/vendor/google.golang.org/grpc/transport/handler_server_test.go b/vendor/google.golang.org/grpc/transport/handler_server_test.go new file mode 100644 index 0000000000..06fe813ca9 --- /dev/null +++ b/vendor/google.golang.org/grpc/transport/handler_server_test.go @@ -0,0 +1,462 @@ +/* + * + * Copyright 2016 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. + * + */ + +package transport + +import ( + "errors" + "fmt" + "io" + "net/http" + "net/http/httptest" + "net/url" + "reflect" + "sync" + "testing" + "time" + + "github.com/golang/protobuf/proto" + dpb "github.com/golang/protobuf/ptypes/duration" + "golang.org/x/net/context" + epb "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +func TestHandlerTransport_NewServerHandlerTransport(t *testing.T) { + type testCase struct { + name string + req *http.Request + wantErr string + modrw func(http.ResponseWriter) http.ResponseWriter + check func(*serverHandlerTransport, *testCase) error + } + tests := []testCase{ + { + name: "http/1.1", + req: &http.Request{ + ProtoMajor: 1, + ProtoMinor: 1, + }, + wantErr: "gRPC requires HTTP/2", + }, + { + name: "bad method", + req: &http.Request{ + ProtoMajor: 2, + Method: "GET", + Header: http.Header{}, + RequestURI: "/", + }, + wantErr: "invalid gRPC request method", + }, + { + name: "bad content type", + req: &http.Request{ + ProtoMajor: 2, + Method: "POST", + Header: http.Header{ + "Content-Type": {"application/foo"}, + }, + RequestURI: "/service/foo.bar", + }, + wantErr: "invalid gRPC request content-type", + }, + { + name: "not flusher", + req: &http.Request{ + ProtoMajor: 2, + Method: "POST", + Header: http.Header{ + "Content-Type": {"application/grpc"}, + }, + RequestURI: "/service/foo.bar", + }, + modrw: func(w http.ResponseWriter) http.ResponseWriter { + // Return w without its Flush method + type onlyCloseNotifier interface { + http.ResponseWriter + http.CloseNotifier + } + return struct{ onlyCloseNotifier }{w.(onlyCloseNotifier)} + }, + wantErr: "gRPC requires a ResponseWriter supporting http.Flusher", + }, + { + name: "not closenotifier", + req: &http.Request{ + ProtoMajor: 2, + Method: "POST", + Header: http.Header{ + "Content-Type": {"application/grpc"}, + }, + RequestURI: "/service/foo.bar", + }, + modrw: func(w http.ResponseWriter) http.ResponseWriter { + // Return w without its CloseNotify method + type onlyFlusher interface { + http.ResponseWriter + http.Flusher + } + return struct{ onlyFlusher }{w.(onlyFlusher)} + }, + wantErr: "gRPC requires a ResponseWriter supporting http.CloseNotifier", + }, + { + name: "valid", + req: &http.Request{ + ProtoMajor: 2, + Method: "POST", + Header: http.Header{ + "Content-Type": {"application/grpc"}, + }, + URL: &url.URL{ + Path: "/service/foo.bar", + }, + RequestURI: "/service/foo.bar", + }, + check: func(t *serverHandlerTransport, tt *testCase) error { + if t.req != tt.req { + return fmt.Errorf("t.req = %p; want %p", t.req, tt.req) + } + if t.rw == nil { + return errors.New("t.rw = nil; want non-nil") + } + return nil + }, + }, + { + name: "with timeout", + req: &http.Request{ + ProtoMajor: 2, + Method: "POST", + Header: http.Header{ + "Content-Type": []string{"application/grpc"}, + "Grpc-Timeout": {"200m"}, + }, + URL: &url.URL{ + Path: "/service/foo.bar", + }, + RequestURI: "/service/foo.bar", + }, + check: func(t *serverHandlerTransport, tt *testCase) error { + if !t.timeoutSet { + return errors.New("timeout not set") + } + if want := 200 * time.Millisecond; t.timeout != want { + return fmt.Errorf("timeout = %v; want %v", t.timeout, want) + } + return nil + }, + }, + { + name: "with bad timeout", + req: &http.Request{ + ProtoMajor: 2, + Method: "POST", + Header: http.Header{ + "Content-Type": []string{"application/grpc"}, + "Grpc-Timeout": {"tomorrow"}, + }, + URL: &url.URL{ + Path: "/service/foo.bar", + }, + RequestURI: "/service/foo.bar", + }, + wantErr: `stream error: code = Internal desc = "malformed time-out: transport: timeout unit is not recognized: \"tomorrow\""`, + }, + { + name: "with metadata", + req: &http.Request{ + ProtoMajor: 2, + Method: "POST", + Header: http.Header{ + "Content-Type": []string{"application/grpc"}, + "meta-foo": {"foo-val"}, + "meta-bar": {"bar-val1", "bar-val2"}, + "user-agent": {"x/y a/b"}, + }, + URL: &url.URL{ + Path: "/service/foo.bar", + }, + RequestURI: "/service/foo.bar", + }, + check: func(ht *serverHandlerTransport, tt *testCase) error { + want := metadata.MD{ + "meta-bar": {"bar-val1", "bar-val2"}, + "user-agent": {"x/y a/b"}, + "meta-foo": {"foo-val"}, + } + + if !reflect.DeepEqual(ht.headerMD, want) { + return fmt.Errorf("metdata = %#v; want %#v", ht.headerMD, want) + } + return nil + }, + }, + } + + for _, tt := range tests { + rw := newTestHandlerResponseWriter() + if tt.modrw != nil { + rw = tt.modrw(rw) + } + got, gotErr := NewServerHandlerTransport(rw, tt.req) + if (gotErr != nil) != (tt.wantErr != "") || (gotErr != nil && gotErr.Error() != tt.wantErr) { + t.Errorf("%s: error = %v; want %q", tt.name, gotErr, tt.wantErr) + continue + } + if gotErr != nil { + continue + } + if tt.check != nil { + if err := tt.check(got.(*serverHandlerTransport), &tt); err != nil { + t.Errorf("%s: %v", tt.name, err) + } + } + } +} + +type testHandlerResponseWriter struct { + *httptest.ResponseRecorder + closeNotify chan bool +} + +func (w testHandlerResponseWriter) CloseNotify() <-chan bool { return w.closeNotify } +func (w testHandlerResponseWriter) Flush() {} + +func newTestHandlerResponseWriter() http.ResponseWriter { + return testHandlerResponseWriter{ + ResponseRecorder: httptest.NewRecorder(), + closeNotify: make(chan bool, 1), + } +} + +type handleStreamTest struct { + t *testing.T + bodyw *io.PipeWriter + req *http.Request + rw testHandlerResponseWriter + ht *serverHandlerTransport +} + +func newHandleStreamTest(t *testing.T) *handleStreamTest { + bodyr, bodyw := io.Pipe() + req := &http.Request{ + ProtoMajor: 2, + Method: "POST", + Header: http.Header{ + "Content-Type": {"application/grpc"}, + }, + URL: &url.URL{ + Path: "/service/foo.bar", + }, + RequestURI: "/service/foo.bar", + Body: bodyr, + } + rw := newTestHandlerResponseWriter().(testHandlerResponseWriter) + ht, err := NewServerHandlerTransport(rw, req) + if err != nil { + t.Fatal(err) + } + return &handleStreamTest{ + t: t, + bodyw: bodyw, + ht: ht.(*serverHandlerTransport), + rw: rw, + } +} + +func TestHandlerTransport_HandleStreams(t *testing.T) { + st := newHandleStreamTest(t) + handleStream := func(s *Stream) { + if want := "/service/foo.bar"; s.method != want { + t.Errorf("stream method = %q; want %q", s.method, want) + } + st.bodyw.Close() // no body + st.ht.WriteStatus(s, status.New(codes.OK, "")) + } + st.ht.HandleStreams( + func(s *Stream) { go handleStream(s) }, + func(ctx context.Context, method string) context.Context { return ctx }, + ) + wantHeader := http.Header{ + "Date": nil, + "Content-Type": {"application/grpc"}, + "Trailer": {"Grpc-Status", "Grpc-Message", "Grpc-Status-Details-Bin"}, + "Grpc-Status": {"0"}, + } + if !reflect.DeepEqual(st.rw.HeaderMap, wantHeader) { + t.Errorf("Header+Trailer Map: %#v; want %#v", st.rw.HeaderMap, wantHeader) + } +} + +// Tests that codes.Unimplemented will close the body, per comment in handler_server.go. +func TestHandlerTransport_HandleStreams_Unimplemented(t *testing.T) { + handleStreamCloseBodyTest(t, codes.Unimplemented, "thingy is unimplemented") +} + +// Tests that codes.InvalidArgument will close the body, per comment in handler_server.go. +func TestHandlerTransport_HandleStreams_InvalidArgument(t *testing.T) { + handleStreamCloseBodyTest(t, codes.InvalidArgument, "bad arg") +} + +func handleStreamCloseBodyTest(t *testing.T, statusCode codes.Code, msg string) { + st := newHandleStreamTest(t) + + handleStream := func(s *Stream) { + st.ht.WriteStatus(s, status.New(statusCode, msg)) + } + st.ht.HandleStreams( + func(s *Stream) { go handleStream(s) }, + func(ctx context.Context, method string) context.Context { return ctx }, + ) + wantHeader := http.Header{ + "Date": nil, + "Content-Type": {"application/grpc"}, + "Trailer": {"Grpc-Status", "Grpc-Message", "Grpc-Status-Details-Bin"}, + "Grpc-Status": {fmt.Sprint(uint32(statusCode))}, + "Grpc-Message": {encodeGrpcMessage(msg)}, + } + + if !reflect.DeepEqual(st.rw.HeaderMap, wantHeader) { + t.Errorf("Header+Trailer mismatch.\n got: %#v\nwant: %#v", st.rw.HeaderMap, wantHeader) + } +} + +func TestHandlerTransport_HandleStreams_Timeout(t *testing.T) { + bodyr, bodyw := io.Pipe() + req := &http.Request{ + ProtoMajor: 2, + Method: "POST", + Header: http.Header{ + "Content-Type": {"application/grpc"}, + "Grpc-Timeout": {"200m"}, + }, + URL: &url.URL{ + Path: "/service/foo.bar", + }, + RequestURI: "/service/foo.bar", + Body: bodyr, + } + rw := newTestHandlerResponseWriter().(testHandlerResponseWriter) + ht, err := NewServerHandlerTransport(rw, req) + if err != nil { + t.Fatal(err) + } + runStream := func(s *Stream) { + defer bodyw.Close() + select { + case <-s.ctx.Done(): + case <-time.After(5 * time.Second): + t.Errorf("timeout waiting for ctx.Done") + return + } + err := s.ctx.Err() + if err != context.DeadlineExceeded { + t.Errorf("ctx.Err = %v; want %v", err, context.DeadlineExceeded) + return + } + ht.WriteStatus(s, status.New(codes.DeadlineExceeded, "too slow")) + } + ht.HandleStreams( + func(s *Stream) { go runStream(s) }, + func(ctx context.Context, method string) context.Context { return ctx }, + ) + wantHeader := http.Header{ + "Date": nil, + "Content-Type": {"application/grpc"}, + "Trailer": {"Grpc-Status", "Grpc-Message", "Grpc-Status-Details-Bin"}, + "Grpc-Status": {"4"}, + "Grpc-Message": {encodeGrpcMessage("too slow")}, + } + if !reflect.DeepEqual(rw.HeaderMap, wantHeader) { + t.Errorf("Header+Trailer Map mismatch.\n got: %#v\nwant: %#v", rw.HeaderMap, wantHeader) + } +} + +func TestHandlerTransport_HandleStreams_MultiWriteStatus(t *testing.T) { + st := newHandleStreamTest(t) + handleStream := func(s *Stream) { + if want := "/service/foo.bar"; s.method != want { + t.Errorf("stream method = %q; want %q", s.method, want) + } + st.bodyw.Close() // no body + + var wg sync.WaitGroup + wg.Add(5) + for i := 0; i < 5; i++ { + go func() { + defer wg.Done() + st.ht.WriteStatus(s, status.New(codes.OK, "")) + }() + } + wg.Wait() + } + st.ht.HandleStreams( + func(s *Stream) { go handleStream(s) }, + func(ctx context.Context, method string) context.Context { return ctx }, + ) +} + +func TestHandlerTransport_HandleStreams_ErrDetails(t *testing.T) { + errDetails := []proto.Message{ + &epb.RetryInfo{ + RetryDelay: &dpb.Duration{Seconds: 60}, + }, + &epb.ResourceInfo{ + ResourceType: "foo bar", + ResourceName: "service.foo.bar", + Owner: "User", + }, + } + + statusCode := codes.ResourceExhausted + msg := "you are being throttled" + st, err := status.New(statusCode, msg).WithDetails(errDetails...) + if err != nil { + t.Fatal(err) + } + + stBytes, err := proto.Marshal(st.Proto()) + if err != nil { + t.Fatal(err) + } + + hst := newHandleStreamTest(t) + handleStream := func(s *Stream) { + hst.ht.WriteStatus(s, st) + } + hst.ht.HandleStreams( + func(s *Stream) { go handleStream(s) }, + func(ctx context.Context, method string) context.Context { return ctx }, + ) + wantHeader := http.Header{ + "Date": nil, + "Content-Type": {"application/grpc"}, + "Trailer": {"Grpc-Status", "Grpc-Message", "Grpc-Status-Details-Bin"}, + "Grpc-Status": {fmt.Sprint(uint32(statusCode))}, + "Grpc-Message": {encodeGrpcMessage(msg)}, + "Grpc-Status-Details-Bin": {encodeBinHeader(stBytes)}, + } + + if !reflect.DeepEqual(hst.rw.HeaderMap, wantHeader) { + t.Errorf("Header+Trailer mismatch.\n got: %#v\nwant: %#v", hst.rw.HeaderMap, wantHeader) + } +} diff --git a/vendor/google.golang.org/grpc/transport/http2_client.go b/vendor/google.golang.org/grpc/transport/http2_client.go new file mode 100644 index 0000000000..0f58a390a3 --- /dev/null +++ b/vendor/google.golang.org/grpc/transport/http2_client.go @@ -0,0 +1,1371 @@ +/* + * + * Copyright 2014 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. + * + */ + +package transport + +import ( + "bytes" + "io" + "math" + "net" + "strings" + "sync" + "sync/atomic" + "time" + + "golang.org/x/net/context" + "golang.org/x/net/http2" + "golang.org/x/net/http2/hpack" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/keepalive" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/peer" + "google.golang.org/grpc/stats" + "google.golang.org/grpc/status" +) + +// http2Client implements the ClientTransport interface with HTTP2. +type http2Client struct { + ctx context.Context + cancel context.CancelFunc + userAgent string + md interface{} + conn net.Conn // underlying communication channel + remoteAddr net.Addr + localAddr net.Addr + authInfo credentials.AuthInfo // auth info about the connection + nextID uint32 // the next stream ID to be used + + // goAway is closed to notify the upper layer (i.e., addrConn.transportMonitor) + // that the server sent GoAway on this transport. + goAway chan struct{} + // awakenKeepalive is used to wake up keepalive when after it has gone dormant. + awakenKeepalive chan struct{} + + framer *framer + hBuf *bytes.Buffer // the buffer for HPACK encoding + hEnc *hpack.Encoder // HPACK encoder + + // controlBuf delivers all the control related tasks (e.g., window + // updates, reset streams, and various settings) to the controller. + controlBuf *controlBuffer + fc *inFlow + // sendQuotaPool provides flow control to outbound message. + sendQuotaPool *quotaPool + // localSendQuota limits the amount of data that can be scheduled + // for writing before it is actually written out. + localSendQuota *quotaPool + // streamsQuota limits the max number of concurrent streams. + streamsQuota *quotaPool + + // The scheme used: https if TLS is on, http otherwise. + scheme string + + isSecure bool + + creds []credentials.PerRPCCredentials + + // Boolean to keep track of reading activity on transport. + // 1 is true and 0 is false. + activity uint32 // Accessed atomically. + kp keepalive.ClientParameters + + statsHandler stats.Handler + + initialWindowSize int32 + + bdpEst *bdpEstimator + outQuotaVersion uint32 + + mu sync.Mutex // guard the following variables + state transportState // the state of underlying connection + activeStreams map[uint32]*Stream + // The max number of concurrent streams + maxStreams int + // the per-stream outbound flow control window size set by the peer. + streamSendQuota uint32 + // prevGoAway ID records the Last-Stream-ID in the previous GOAway frame. + prevGoAwayID uint32 + // goAwayReason records the http2.ErrCode and debug data received with the + // GoAway frame. + goAwayReason GoAwayReason +} + +func dial(ctx context.Context, fn func(context.Context, string) (net.Conn, error), addr string) (net.Conn, error) { + if fn != nil { + return fn(ctx, addr) + } + return dialContext(ctx, "tcp", addr) +} + +func isTemporary(err error) bool { + switch err { + case io.EOF: + // Connection closures may be resolved upon retry, and are thus + // treated as temporary. + return true + case context.DeadlineExceeded: + // In Go 1.7, context.DeadlineExceeded implements Timeout(), and this + // special case is not needed. Until then, we need to keep this + // clause. + return true + } + + switch err := err.(type) { + case interface { + Temporary() bool + }: + return err.Temporary() + case interface { + Timeout() bool + }: + // Timeouts may be resolved upon retry, and are thus treated as + // temporary. + return err.Timeout() + } + return false +} + +// newHTTP2Client constructs a connected ClientTransport to addr based on HTTP2 +// and starts to receive messages on it. Non-nil error returns if construction +// fails. +func newHTTP2Client(ctx context.Context, addr TargetInfo, opts ConnectOptions, timeout time.Duration) (_ ClientTransport, err error) { + scheme := "http" + ctx, cancel := context.WithCancel(ctx) + connectCtx, connectCancel := context.WithTimeout(ctx, timeout) + defer func() { + if err != nil { + cancel() + // Don't call connectCancel in success path due to a race in Go 1.6: + // https://github.com/golang/go/issues/15078. + connectCancel() + } + }() + + conn, err := dial(connectCtx, opts.Dialer, addr.Addr) + if err != nil { + if opts.FailOnNonTempDialError { + return nil, connectionErrorf(isTemporary(err), err, "transport: error while dialing: %v", err) + } + return nil, connectionErrorf(true, err, "transport: Error while dialing %v", err) + } + // Any further errors will close the underlying connection + defer func(conn net.Conn) { + if err != nil { + conn.Close() + } + }(conn) + var ( + isSecure bool + authInfo credentials.AuthInfo + ) + if creds := opts.TransportCredentials; creds != nil { + scheme = "https" + conn, authInfo, err = creds.ClientHandshake(connectCtx, addr.Authority, conn) + if err != nil { + // Credentials handshake errors are typically considered permanent + // to avoid retrying on e.g. bad certificates. + temp := isTemporary(err) + return nil, connectionErrorf(temp, err, "transport: authentication handshake failed: %v", err) + } + isSecure = true + } + kp := opts.KeepaliveParams + // Validate keepalive parameters. + if kp.Time == 0 { + kp.Time = defaultClientKeepaliveTime + } + if kp.Timeout == 0 { + kp.Timeout = defaultClientKeepaliveTimeout + } + dynamicWindow := true + icwz := int32(initialWindowSize) + if opts.InitialConnWindowSize >= defaultWindowSize { + icwz = opts.InitialConnWindowSize + dynamicWindow = false + } + var buf bytes.Buffer + writeBufSize := defaultWriteBufSize + if opts.WriteBufferSize > 0 { + writeBufSize = opts.WriteBufferSize + } + readBufSize := defaultReadBufSize + if opts.ReadBufferSize > 0 { + readBufSize = opts.ReadBufferSize + } + t := &http2Client{ + ctx: ctx, + cancel: cancel, + userAgent: opts.UserAgent, + md: addr.Metadata, + conn: conn, + remoteAddr: conn.RemoteAddr(), + localAddr: conn.LocalAddr(), + authInfo: authInfo, + // The client initiated stream id is odd starting from 1. + nextID: 1, + goAway: make(chan struct{}), + awakenKeepalive: make(chan struct{}, 1), + hBuf: &buf, + hEnc: hpack.NewEncoder(&buf), + framer: newFramer(conn, writeBufSize, readBufSize), + controlBuf: newControlBuffer(), + fc: &inFlow{limit: uint32(icwz)}, + sendQuotaPool: newQuotaPool(defaultWindowSize), + localSendQuota: newQuotaPool(defaultLocalSendQuota), + scheme: scheme, + state: reachable, + activeStreams: make(map[uint32]*Stream), + isSecure: isSecure, + creds: opts.PerRPCCredentials, + maxStreams: defaultMaxStreamsClient, + streamsQuota: newQuotaPool(defaultMaxStreamsClient), + streamSendQuota: defaultWindowSize, + kp: kp, + statsHandler: opts.StatsHandler, + initialWindowSize: initialWindowSize, + } + if opts.InitialWindowSize >= defaultWindowSize { + t.initialWindowSize = opts.InitialWindowSize + dynamicWindow = false + } + if dynamicWindow { + t.bdpEst = &bdpEstimator{ + bdp: initialWindowSize, + updateFlowControl: t.updateFlowControl, + } + } + // Make sure awakenKeepalive can't be written upon. + // keepalive routine will make it writable, if need be. + t.awakenKeepalive <- struct{}{} + if t.statsHandler != nil { + t.ctx = t.statsHandler.TagConn(t.ctx, &stats.ConnTagInfo{ + RemoteAddr: t.remoteAddr, + LocalAddr: t.localAddr, + }) + connBegin := &stats.ConnBegin{ + Client: true, + } + t.statsHandler.HandleConn(t.ctx, connBegin) + } + // Start the reader goroutine for incoming message. Each transport has + // a dedicated goroutine which reads HTTP2 frame from network. Then it + // dispatches the frame to the corresponding stream entity. + go t.reader() + // Send connection preface to server. + n, err := t.conn.Write(clientPreface) + if err != nil { + t.Close() + return nil, connectionErrorf(true, err, "transport: failed to write client preface: %v", err) + } + if n != len(clientPreface) { + t.Close() + return nil, connectionErrorf(true, err, "transport: preface mismatch, wrote %d bytes; want %d", n, len(clientPreface)) + } + if t.initialWindowSize != defaultWindowSize { + err = t.framer.fr.WriteSettings(http2.Setting{ + ID: http2.SettingInitialWindowSize, + Val: uint32(t.initialWindowSize), + }) + } else { + err = t.framer.fr.WriteSettings() + } + if err != nil { + t.Close() + return nil, connectionErrorf(true, err, "transport: failed to write initial settings frame: %v", err) + } + // Adjust the connection flow control window if needed. + if delta := uint32(icwz - defaultWindowSize); delta > 0 { + if err := t.framer.fr.WriteWindowUpdate(0, delta); err != nil { + t.Close() + return nil, connectionErrorf(true, err, "transport: failed to write window update: %v", err) + } + } + t.framer.writer.Flush() + go func() { + loopyWriter(t.ctx, t.controlBuf, t.itemHandler) + t.Close() + }() + if t.kp.Time != infinity { + go t.keepalive() + } + return t, nil +} + +func (t *http2Client) newStream(ctx context.Context, callHdr *CallHdr) *Stream { + // TODO(zhaoq): Handle uint32 overflow of Stream.id. + s := &Stream{ + id: t.nextID, + done: make(chan struct{}), + goAway: make(chan struct{}), + method: callHdr.Method, + sendCompress: callHdr.SendCompress, + buf: newRecvBuffer(), + fc: &inFlow{limit: uint32(t.initialWindowSize)}, + sendQuotaPool: newQuotaPool(int(t.streamSendQuota)), + headerChan: make(chan struct{}), + } + t.nextID += 2 + s.requestRead = func(n int) { + t.adjustWindow(s, uint32(n)) + } + // The client side stream context should have exactly the same life cycle with the user provided context. + // That means, s.ctx should be read-only. And s.ctx is done iff ctx is done. + // So we use the original context here instead of creating a copy. + s.ctx = ctx + s.trReader = &transportReader{ + reader: &recvBufferReader{ + ctx: s.ctx, + goAway: s.goAway, + recv: s.buf, + }, + windowHandler: func(n int) { + t.updateWindow(s, uint32(n)) + }, + } + s.waiters = waiters{ + ctx: s.ctx, + tctx: t.ctx, + done: s.done, + goAway: s.goAway, + } + return s +} + +// NewStream creates a stream and registers it into the transport as "active" +// streams. +func (t *http2Client) NewStream(ctx context.Context, callHdr *CallHdr) (_ *Stream, err error) { + pr := &peer.Peer{ + Addr: t.remoteAddr, + } + // Attach Auth info if there is any. + if t.authInfo != nil { + pr.AuthInfo = t.authInfo + } + ctx = peer.NewContext(ctx, pr) + var ( + authData = make(map[string]string) + audience string + ) + // Create an audience string only if needed. + if len(t.creds) > 0 || callHdr.Creds != nil { + // Construct URI required to get auth request metadata. + // Omit port if it is the default one. + host := strings.TrimSuffix(callHdr.Host, ":443") + pos := strings.LastIndex(callHdr.Method, "/") + if pos == -1 { + pos = len(callHdr.Method) + } + audience = "https://" + host + callHdr.Method[:pos] + } + for _, c := range t.creds { + data, err := c.GetRequestMetadata(ctx, audience) + if err != nil { + return nil, streamErrorf(codes.Internal, "transport: %v", err) + } + for k, v := range data { + // Capital header names are illegal in HTTP/2. + k = strings.ToLower(k) + authData[k] = v + } + } + callAuthData := map[string]string{} + // Check if credentials.PerRPCCredentials were provided via call options. + // Note: if these credentials are provided both via dial options and call + // options, then both sets of credentials will be applied. + if callCreds := callHdr.Creds; callCreds != nil { + if !t.isSecure && callCreds.RequireTransportSecurity() { + return nil, streamErrorf(codes.Unauthenticated, "transport: cannot send secure credentials on an insecure connection") + } + data, err := callCreds.GetRequestMetadata(ctx, audience) + if err != nil { + return nil, streamErrorf(codes.Internal, "transport: %v", err) + } + for k, v := range data { + // Capital header names are illegal in HTTP/2 + k = strings.ToLower(k) + callAuthData[k] = v + } + } + t.mu.Lock() + if t.activeStreams == nil { + t.mu.Unlock() + return nil, ErrConnClosing + } + if t.state == draining { + t.mu.Unlock() + return nil, errStreamDrain + } + if t.state != reachable { + t.mu.Unlock() + return nil, ErrConnClosing + } + t.mu.Unlock() + // Get a quota of 1 from streamsQuota. + if _, _, err := t.streamsQuota.get(1, waiters{ctx: ctx, tctx: t.ctx}); err != nil { + return nil, err + } + // TODO(mmukhi): Benchmark if the performance gets better if count the metadata and other header fields + // first and create a slice of that exact size. + // Make the slice of certain predictable size to reduce allocations made by append. + hfLen := 7 // :method, :scheme, :path, :authority, content-type, user-agent, te + hfLen += len(authData) + len(callAuthData) + headerFields := make([]hpack.HeaderField, 0, hfLen) + headerFields = append(headerFields, hpack.HeaderField{Name: ":method", Value: "POST"}) + headerFields = append(headerFields, hpack.HeaderField{Name: ":scheme", Value: t.scheme}) + headerFields = append(headerFields, hpack.HeaderField{Name: ":path", Value: callHdr.Method}) + headerFields = append(headerFields, hpack.HeaderField{Name: ":authority", Value: callHdr.Host}) + headerFields = append(headerFields, hpack.HeaderField{Name: "content-type", Value: "application/grpc"}) + headerFields = append(headerFields, hpack.HeaderField{Name: "user-agent", Value: t.userAgent}) + headerFields = append(headerFields, hpack.HeaderField{Name: "te", Value: "trailers"}) + + if callHdr.SendCompress != "" { + headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-encoding", Value: callHdr.SendCompress}) + } + if dl, ok := ctx.Deadline(); ok { + // Send out timeout regardless its value. The server can detect timeout context by itself. + // TODO(mmukhi): Perhaps this field should be updated when actually writing out to the wire. + timeout := dl.Sub(time.Now()) + headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-timeout", Value: encodeTimeout(timeout)}) + } + for k, v := range authData { + headerFields = append(headerFields, hpack.HeaderField{Name: k, Value: encodeMetadataHeader(k, v)}) + } + for k, v := range callAuthData { + headerFields = append(headerFields, hpack.HeaderField{Name: k, Value: encodeMetadataHeader(k, v)}) + } + if b := stats.OutgoingTags(ctx); b != nil { + headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-tags-bin", Value: encodeBinHeader(b)}) + } + if b := stats.OutgoingTrace(ctx); b != nil { + headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-trace-bin", Value: encodeBinHeader(b)}) + } + if md, ok := metadata.FromOutgoingContext(ctx); ok { + for k, vv := range md { + // HTTP doesn't allow you to set pseudoheaders after non pseudoheaders were set. + if isReservedHeader(k) { + continue + } + for _, v := range vv { + headerFields = append(headerFields, hpack.HeaderField{Name: k, Value: encodeMetadataHeader(k, v)}) + } + } + } + if md, ok := t.md.(*metadata.MD); ok { + for k, vv := range *md { + if isReservedHeader(k) { + continue + } + for _, v := range vv { + headerFields = append(headerFields, hpack.HeaderField{Name: k, Value: encodeMetadataHeader(k, v)}) + } + } + } + t.mu.Lock() + if t.state == draining { + t.mu.Unlock() + t.streamsQuota.add(1) + return nil, errStreamDrain + } + if t.state != reachable { + t.mu.Unlock() + return nil, ErrConnClosing + } + s := t.newStream(ctx, callHdr) + t.activeStreams[s.id] = s + // If the number of active streams change from 0 to 1, then check if keepalive + // has gone dormant. If so, wake it up. + if len(t.activeStreams) == 1 { + select { + case t.awakenKeepalive <- struct{}{}: + t.controlBuf.put(&ping{data: [8]byte{}}) + // Fill the awakenKeepalive channel again as this channel must be + // kept non-writable except at the point that the keepalive() + // goroutine is waiting either to be awaken or shutdown. + t.awakenKeepalive <- struct{}{} + default: + } + } + t.controlBuf.put(&headerFrame{ + streamID: s.id, + hf: headerFields, + endStream: false, + }) + t.mu.Unlock() + + if t.statsHandler != nil { + outHeader := &stats.OutHeader{ + Client: true, + FullMethod: callHdr.Method, + RemoteAddr: t.remoteAddr, + LocalAddr: t.localAddr, + Compression: callHdr.SendCompress, + } + t.statsHandler.HandleRPC(s.ctx, outHeader) + } + return s, nil +} + +// CloseStream clears the footprint of a stream when the stream is not needed any more. +// This must not be executed in reader's goroutine. +func (t *http2Client) CloseStream(s *Stream, err error) { + t.mu.Lock() + if t.activeStreams == nil { + t.mu.Unlock() + return + } + if err != nil { + // notify in-flight streams, before the deletion + s.write(recvMsg{err: err}) + } + delete(t.activeStreams, s.id) + if t.state == draining && len(t.activeStreams) == 0 { + // The transport is draining and s is the last live stream on t. + t.mu.Unlock() + t.Close() + return + } + t.mu.Unlock() + // rstStream is true in case the stream is being closed at the client-side + // and the server needs to be intimated about it by sending a RST_STREAM + // frame. + // To make sure this frame is written to the wire before the headers of the + // next stream waiting for streamsQuota, we add to streamsQuota pool only + // after having acquired the writableChan to send RST_STREAM out (look at + // the controller() routine). + var rstStream bool + var rstError http2.ErrCode + defer func() { + // In case, the client doesn't have to send RST_STREAM to server + // we can safely add back to streamsQuota pool now. + if !rstStream { + t.streamsQuota.add(1) + return + } + t.controlBuf.put(&resetStream{s.id, rstError}) + }() + s.mu.Lock() + rstStream = s.rstStream + rstError = s.rstError + if s.state == streamDone { + s.mu.Unlock() + return + } + if !s.headerDone { + close(s.headerChan) + s.headerDone = true + } + s.state = streamDone + s.mu.Unlock() + if _, ok := err.(StreamError); ok { + rstStream = true + rstError = http2.ErrCodeCancel + } +} + +// Close kicks off the shutdown process of the transport. This should be called +// only once on a transport. Once it is called, the transport should not be +// accessed any more. +func (t *http2Client) Close() error { + t.mu.Lock() + if t.state == closing { + t.mu.Unlock() + return nil + } + t.state = closing + t.mu.Unlock() + t.cancel() + err := t.conn.Close() + t.mu.Lock() + streams := t.activeStreams + t.activeStreams = nil + t.mu.Unlock() + // Notify all active streams. + for _, s := range streams { + s.mu.Lock() + if !s.headerDone { + close(s.headerChan) + s.headerDone = true + } + s.mu.Unlock() + s.write(recvMsg{err: ErrConnClosing}) + } + if t.statsHandler != nil { + connEnd := &stats.ConnEnd{ + Client: true, + } + t.statsHandler.HandleConn(t.ctx, connEnd) + } + return err +} + +// GracefulClose sets the state to draining, which prevents new streams from +// being created and causes the transport to be closed when the last active +// stream is closed. If there are no active streams, the transport is closed +// immediately. This does nothing if the transport is already draining or +// closing. +func (t *http2Client) GracefulClose() error { + t.mu.Lock() + switch t.state { + case closing, draining: + t.mu.Unlock() + return nil + } + t.state = draining + active := len(t.activeStreams) + t.mu.Unlock() + if active == 0 { + return t.Close() + } + return nil +} + +// Write formats the data into HTTP2 data frame(s) and sends it out. The caller +// should proceed only if Write returns nil. +func (t *http2Client) Write(s *Stream, hdr []byte, data []byte, opts *Options) error { + select { + case <-s.ctx.Done(): + return ContextErr(s.ctx.Err()) + case <-t.ctx.Done(): + return ErrConnClosing + default: + } + + if hdr == nil && data == nil && opts.Last { + // stream.CloseSend uses this to send an empty frame with endStream=True + t.controlBuf.put(&dataFrame{streamID: s.id, endStream: true, f: func() {}}) + return nil + } + // Add data to header frame so that we can equally distribute data across frames. + emptyLen := http2MaxFrameLen - len(hdr) + if emptyLen > len(data) { + emptyLen = len(data) + } + hdr = append(hdr, data[:emptyLen]...) + data = data[emptyLen:] + var ( + streamQuota int + streamQuotaVer uint32 + err error + ) + for idx, r := range [][]byte{hdr, data} { + for len(r) > 0 { + size := http2MaxFrameLen + if size > len(r) { + size = len(r) + } + if streamQuota == 0 { // Used up all the locally cached stream quota. + // Get all the stream quota there is. + streamQuota, streamQuotaVer, err = s.sendQuotaPool.get(math.MaxInt32, s.waiters) + if err != nil { + return err + } + } + if size > streamQuota { + size = streamQuota + } + + // Get size worth quota from transport. + tq, _, err := t.sendQuotaPool.get(size, s.waiters) + if err != nil { + return err + } + if tq < size { + size = tq + } + ltq, _, err := t.localSendQuota.get(size, s.waiters) + if err != nil { + return err + } + // even if ltq is smaller than size we don't adjust size since + // ltq is only a soft limit. + streamQuota -= size + p := r[:size] + var endStream bool + // See if this is the last frame to be written. + if opts.Last { + if len(r)-size == 0 { // No more data in r after this iteration. + if idx == 0 { // We're writing data header. + if len(data) == 0 { // There's no data to follow. + endStream = true + } + } else { // We're writing data. + endStream = true + } + } + } + success := func() { + ltq := ltq + t.controlBuf.put(&dataFrame{streamID: s.id, endStream: endStream, d: p, f: func() { t.localSendQuota.add(ltq) }}) + r = r[size:] + } + failure := func() { // The stream quota version must have changed. + // Our streamQuota cache is invalidated now, so give it back. + s.sendQuotaPool.lockedAdd(streamQuota + size) + } + if !s.sendQuotaPool.compareAndExecute(streamQuotaVer, success, failure) { + // Couldn't send this chunk out. + t.sendQuotaPool.add(size) + t.localSendQuota.add(ltq) + streamQuota = 0 + } + } + } + if streamQuota > 0 { // Add the left over quota back to stream. + s.sendQuotaPool.add(streamQuota) + } + if !opts.Last { + return nil + } + s.mu.Lock() + if s.state != streamDone { + s.state = streamWriteDone + } + s.mu.Unlock() + return nil +} + +func (t *http2Client) getStream(f http2.Frame) (*Stream, bool) { + t.mu.Lock() + defer t.mu.Unlock() + s, ok := t.activeStreams[f.Header().StreamID] + return s, ok +} + +// adjustWindow sends out extra window update over the initial window size +// of stream if the application is requesting data larger in size than +// the window. +func (t *http2Client) adjustWindow(s *Stream, n uint32) { + s.mu.Lock() + defer s.mu.Unlock() + if s.state == streamDone { + return + } + if w := s.fc.maybeAdjust(n); w > 0 { + // Piggyback connection's window update along. + if cw := t.fc.resetPendingUpdate(); cw > 0 { + t.controlBuf.put(&windowUpdate{0, cw}) + } + t.controlBuf.put(&windowUpdate{s.id, w}) + } +} + +// updateWindow adjusts the inbound quota for the stream and the transport. +// Window updates will deliver to the controller for sending when +// the cumulative quota exceeds the corresponding threshold. +func (t *http2Client) updateWindow(s *Stream, n uint32) { + s.mu.Lock() + defer s.mu.Unlock() + if s.state == streamDone { + return + } + if w := s.fc.onRead(n); w > 0 { + if cw := t.fc.resetPendingUpdate(); cw > 0 { + t.controlBuf.put(&windowUpdate{0, cw}) + } + t.controlBuf.put(&windowUpdate{s.id, w}) + } +} + +// updateFlowControl updates the incoming flow control windows +// for the transport and the stream based on the current bdp +// estimation. +func (t *http2Client) updateFlowControl(n uint32) { + t.mu.Lock() + for _, s := range t.activeStreams { + s.fc.newLimit(n) + } + t.initialWindowSize = int32(n) + t.mu.Unlock() + t.controlBuf.put(&windowUpdate{0, t.fc.newLimit(n)}) + t.controlBuf.put(&settings{ + ss: []http2.Setting{ + { + ID: http2.SettingInitialWindowSize, + Val: uint32(n), + }, + }, + }) +} + +func (t *http2Client) handleData(f *http2.DataFrame) { + size := f.Header().Length + var sendBDPPing bool + if t.bdpEst != nil { + sendBDPPing = t.bdpEst.add(uint32(size)) + } + // Decouple connection's flow control from application's read. + // An update on connection's flow control should not depend on + // whether user application has read the data or not. Such a + // restriction is already imposed on the stream's flow control, + // and therefore the sender will be blocked anyways. + // Decoupling the connection flow control will prevent other + // active(fast) streams from starving in presence of slow or + // inactive streams. + // + // Furthermore, if a bdpPing is being sent out we can piggyback + // connection's window update for the bytes we just received. + if sendBDPPing { + if size != 0 { // Could've been an empty data frame. + t.controlBuf.put(&windowUpdate{0, uint32(size)}) + } + t.controlBuf.put(bdpPing) + } else { + if err := t.fc.onData(uint32(size)); err != nil { + t.Close() + return + } + if w := t.fc.onRead(uint32(size)); w > 0 { + t.controlBuf.put(&windowUpdate{0, w}) + } + } + // Select the right stream to dispatch. + s, ok := t.getStream(f) + if !ok { + return + } + if size > 0 { + s.mu.Lock() + if s.state == streamDone { + s.mu.Unlock() + return + } + if err := s.fc.onData(uint32(size)); err != nil { + s.rstStream = true + s.rstError = http2.ErrCodeFlowControl + s.finish(status.New(codes.Internal, err.Error())) + s.mu.Unlock() + s.write(recvMsg{err: io.EOF}) + return + } + if f.Header().Flags.Has(http2.FlagDataPadded) { + if w := s.fc.onRead(uint32(size) - uint32(len(f.Data()))); w > 0 { + t.controlBuf.put(&windowUpdate{s.id, w}) + } + } + s.mu.Unlock() + // TODO(bradfitz, zhaoq): A copy is required here because there is no + // guarantee f.Data() is consumed before the arrival of next frame. + // Can this copy be eliminated? + if len(f.Data()) > 0 { + data := make([]byte, len(f.Data())) + copy(data, f.Data()) + s.write(recvMsg{data: data}) + } + } + // The server has closed the stream without sending trailers. Record that + // the read direction is closed, and set the status appropriately. + if f.FrameHeader.Flags.Has(http2.FlagDataEndStream) { + s.mu.Lock() + if s.state == streamDone { + s.mu.Unlock() + return + } + s.finish(status.New(codes.Internal, "server closed the stream without sending trailers")) + s.mu.Unlock() + s.write(recvMsg{err: io.EOF}) + } +} + +func (t *http2Client) handleRSTStream(f *http2.RSTStreamFrame) { + s, ok := t.getStream(f) + if !ok { + return + } + s.mu.Lock() + if s.state == streamDone { + s.mu.Unlock() + return + } + if !s.headerDone { + close(s.headerChan) + s.headerDone = true + } + + code := http2.ErrCode(f.ErrCode) + if code == http2.ErrCodeRefusedStream { + // The stream was unprocessed by the server. + s.unprocessed = true + } + statusCode, ok := http2ErrConvTab[code] + if !ok { + warningf("transport: http2Client.handleRSTStream found no mapped gRPC status for the received http2 error %v", f.ErrCode) + statusCode = codes.Unknown + } + s.finish(status.Newf(statusCode, "stream terminated by RST_STREAM with error code: %v", f.ErrCode)) + s.mu.Unlock() + s.write(recvMsg{err: io.EOF}) +} + +func (t *http2Client) handleSettings(f *http2.SettingsFrame, isFirst bool) { + if f.IsAck() { + return + } + var rs []http2.Setting + var ps []http2.Setting + isMaxConcurrentStreamsMissing := true + f.ForeachSetting(func(s http2.Setting) error { + if s.ID == http2.SettingMaxConcurrentStreams { + isMaxConcurrentStreamsMissing = false + } + if t.isRestrictive(s) { + rs = append(rs, s) + } else { + ps = append(ps, s) + } + return nil + }) + if isFirst && isMaxConcurrentStreamsMissing { + // This means server is imposing no limits on + // maximum number of concurrent streams initiated by client. + // So we must remove our self-imposed limit. + ps = append(ps, http2.Setting{ + ID: http2.SettingMaxConcurrentStreams, + Val: math.MaxUint32, + }) + } + t.applySettings(rs) + t.controlBuf.put(&settingsAck{}) + t.applySettings(ps) +} + +func (t *http2Client) isRestrictive(s http2.Setting) bool { + switch s.ID { + case http2.SettingMaxConcurrentStreams: + return int(s.Val) < t.maxStreams + case http2.SettingInitialWindowSize: + // Note: we don't acquire a lock here to read streamSendQuota + // because the same goroutine updates it later. + return s.Val < t.streamSendQuota + } + return false +} + +func (t *http2Client) handlePing(f *http2.PingFrame) { + if f.IsAck() { + // Maybe it's a BDP ping. + if t.bdpEst != nil { + t.bdpEst.calculate(f.Data) + } + return + } + pingAck := &ping{ack: true} + copy(pingAck.data[:], f.Data[:]) + t.controlBuf.put(pingAck) +} + +func (t *http2Client) handleGoAway(f *http2.GoAwayFrame) { + t.mu.Lock() + if t.state != reachable && t.state != draining { + t.mu.Unlock() + return + } + if f.ErrCode == http2.ErrCodeEnhanceYourCalm { + infof("Client received GoAway with http2.ErrCodeEnhanceYourCalm.") + } + id := f.LastStreamID + if id > 0 && id%2 != 1 { + t.mu.Unlock() + t.Close() + return + } + // A client can receive multiple GoAways from the server (see + // https://github.com/grpc/grpc-go/issues/1387). The idea is that the first + // GoAway will be sent with an ID of MaxInt32 and the second GoAway will be + // sent after an RTT delay with the ID of the last stream the server will + // process. + // + // Therefore, when we get the first GoAway we don't necessarily close any + // streams. While in case of second GoAway we close all streams created after + // the GoAwayId. This way streams that were in-flight while the GoAway from + // server was being sent don't get killed. + select { + case <-t.goAway: // t.goAway has been closed (i.e.,multiple GoAways). + // If there are multiple GoAways the first one should always have an ID greater than the following ones. + if id > t.prevGoAwayID { + t.mu.Unlock() + t.Close() + return + } + default: + t.setGoAwayReason(f) + close(t.goAway) + t.state = draining + } + // All streams with IDs greater than the GoAwayId + // and smaller than the previous GoAway ID should be killed. + upperLimit := t.prevGoAwayID + if upperLimit == 0 { // This is the first GoAway Frame. + upperLimit = math.MaxUint32 // Kill all streams after the GoAway ID. + } + for streamID, stream := range t.activeStreams { + if streamID > id && streamID <= upperLimit { + // The stream was unprocessed by the server. + stream.mu.Lock() + stream.unprocessed = true + stream.finish(statusGoAway) + stream.mu.Unlock() + close(stream.goAway) + } + } + t.prevGoAwayID = id + active := len(t.activeStreams) + t.mu.Unlock() + if active == 0 { + t.Close() + } +} + +// setGoAwayReason sets the value of t.goAwayReason based +// on the GoAway frame received. +// It expects a lock on transport's mutext to be held by +// the caller. +func (t *http2Client) setGoAwayReason(f *http2.GoAwayFrame) { + t.goAwayReason = GoAwayNoReason + switch f.ErrCode { + case http2.ErrCodeEnhanceYourCalm: + if string(f.DebugData()) == "too_many_pings" { + t.goAwayReason = GoAwayTooManyPings + } + } +} + +func (t *http2Client) GetGoAwayReason() GoAwayReason { + t.mu.Lock() + defer t.mu.Unlock() + return t.goAwayReason +} + +func (t *http2Client) handleWindowUpdate(f *http2.WindowUpdateFrame) { + id := f.Header().StreamID + incr := f.Increment + if id == 0 { + t.sendQuotaPool.add(int(incr)) + return + } + if s, ok := t.getStream(f); ok { + s.sendQuotaPool.add(int(incr)) + } +} + +// operateHeaders takes action on the decoded headers. +func (t *http2Client) operateHeaders(frame *http2.MetaHeadersFrame) { + s, ok := t.getStream(frame) + if !ok { + return + } + s.mu.Lock() + s.bytesReceived = true + s.mu.Unlock() + var state decodeState + if err := state.decodeResponseHeader(frame); err != nil { + s.mu.Lock() + if !s.headerDone { + close(s.headerChan) + s.headerDone = true + } + s.mu.Unlock() + s.write(recvMsg{err: err}) + // Something wrong. Stops reading even when there is remaining. + return + } + + endStream := frame.StreamEnded() + var isHeader bool + defer func() { + if t.statsHandler != nil { + if isHeader { + inHeader := &stats.InHeader{ + Client: true, + WireLength: int(frame.Header().Length), + } + t.statsHandler.HandleRPC(s.ctx, inHeader) + } else { + inTrailer := &stats.InTrailer{ + Client: true, + WireLength: int(frame.Header().Length), + } + t.statsHandler.HandleRPC(s.ctx, inTrailer) + } + } + }() + + s.mu.Lock() + if !endStream { + s.recvCompress = state.encoding + } + if !s.headerDone { + if !endStream && len(state.mdata) > 0 { + s.header = state.mdata + } + close(s.headerChan) + s.headerDone = true + isHeader = true + } + if !endStream || s.state == streamDone { + s.mu.Unlock() + return + } + + if len(state.mdata) > 0 { + s.trailer = state.mdata + } + s.finish(state.status()) + s.mu.Unlock() + s.write(recvMsg{err: io.EOF}) +} + +func handleMalformedHTTP2(s *Stream, err error) { + s.mu.Lock() + if !s.headerDone { + close(s.headerChan) + s.headerDone = true + } + s.mu.Unlock() + s.write(recvMsg{err: err}) +} + +// reader runs as a separate goroutine in charge of reading data from network +// connection. +// +// TODO(zhaoq): currently one reader per transport. Investigate whether this is +// optimal. +// TODO(zhaoq): Check the validity of the incoming frame sequence. +func (t *http2Client) reader() { + // Check the validity of server preface. + frame, err := t.framer.fr.ReadFrame() + if err != nil { + t.Close() + return + } + atomic.CompareAndSwapUint32(&t.activity, 0, 1) + sf, ok := frame.(*http2.SettingsFrame) + if !ok { + t.Close() + return + } + t.handleSettings(sf, true) + + // loop to keep reading incoming messages on this transport. + for { + frame, err := t.framer.fr.ReadFrame() + atomic.CompareAndSwapUint32(&t.activity, 0, 1) + if err != nil { + // Abort an active stream if the http2.Framer returns a + // http2.StreamError. This can happen only if the server's response + // is malformed http2. + if se, ok := err.(http2.StreamError); ok { + t.mu.Lock() + s := t.activeStreams[se.StreamID] + t.mu.Unlock() + if s != nil { + // use error detail to provide better err message + handleMalformedHTTP2(s, streamErrorf(http2ErrConvTab[se.Code], "%v", t.framer.fr.ErrorDetail())) + } + continue + } else { + // Transport error. + t.Close() + return + } + } + switch frame := frame.(type) { + case *http2.MetaHeadersFrame: + t.operateHeaders(frame) + case *http2.DataFrame: + t.handleData(frame) + case *http2.RSTStreamFrame: + t.handleRSTStream(frame) + case *http2.SettingsFrame: + t.handleSettings(frame, false) + case *http2.PingFrame: + t.handlePing(frame) + case *http2.GoAwayFrame: + t.handleGoAway(frame) + case *http2.WindowUpdateFrame: + t.handleWindowUpdate(frame) + default: + errorf("transport: http2Client.reader got unhandled frame type %v.", frame) + } + } +} + +func (t *http2Client) applySettings(ss []http2.Setting) { + for _, s := range ss { + switch s.ID { + case http2.SettingMaxConcurrentStreams: + // TODO(zhaoq): This is a hack to avoid significant refactoring of the + // code to deal with the unrealistic int32 overflow. Probably will try + // to find a better way to handle this later. + if s.Val > math.MaxInt32 { + s.Val = math.MaxInt32 + } + ms := t.maxStreams + t.maxStreams = int(s.Val) + t.streamsQuota.add(int(s.Val) - ms) + case http2.SettingInitialWindowSize: + t.mu.Lock() + for _, stream := range t.activeStreams { + // Adjust the sending quota for each stream. + stream.sendQuotaPool.addAndUpdate(int(s.Val) - int(t.streamSendQuota)) + } + t.streamSendQuota = s.Val + t.mu.Unlock() + } + } +} + +// TODO(mmukhi): A lot of this code(and code in other places in the tranpsort layer) +// is duplicated between the client and the server. +// The transport layer needs to be refactored to take care of this. +func (t *http2Client) itemHandler(i item) error { + var err error + defer func() { + if err != nil { + errorf(" error in itemHandler: %v", err) + } + }() + switch i := i.(type) { + case *dataFrame: + err = t.framer.fr.WriteData(i.streamID, i.endStream, i.d) + if err == nil { + i.f() + } + case *headerFrame: + t.hBuf.Reset() + for _, f := range i.hf { + t.hEnc.WriteField(f) + } + endHeaders := false + first := true + for !endHeaders { + size := t.hBuf.Len() + if size > http2MaxFrameLen { + size = http2MaxFrameLen + } else { + endHeaders = true + } + if first { + first = false + err = t.framer.fr.WriteHeaders(http2.HeadersFrameParam{ + StreamID: i.streamID, + BlockFragment: t.hBuf.Next(size), + EndStream: i.endStream, + EndHeaders: endHeaders, + }) + } else { + err = t.framer.fr.WriteContinuation( + i.streamID, + endHeaders, + t.hBuf.Next(size), + ) + } + if err != nil { + return err + } + } + case *windowUpdate: + err = t.framer.fr.WriteWindowUpdate(i.streamID, i.increment) + case *settings: + err = t.framer.fr.WriteSettings(i.ss...) + case *settingsAck: + err = t.framer.fr.WriteSettingsAck() + case *resetStream: + // If the server needs to be to intimated about stream closing, + // then we need to make sure the RST_STREAM frame is written to + // the wire before the headers of the next stream waiting on + // streamQuota. We ensure this by adding to the streamsQuota pool + // only after having acquired the writableChan to send RST_STREAM. + err = t.framer.fr.WriteRSTStream(i.streamID, i.code) + t.streamsQuota.add(1) + case *flushIO: + err = t.framer.writer.Flush() + case *ping: + if !i.ack { + t.bdpEst.timesnap(i.data) + } + err = t.framer.fr.WritePing(i.ack, i.data) + default: + errorf("transport: http2Client.controller got unexpected item type %v", i) + } + return err +} + +// keepalive running in a separate goroutune makes sure the connection is alive by sending pings. +func (t *http2Client) keepalive() { + p := &ping{data: [8]byte{}} + timer := time.NewTimer(t.kp.Time) + for { + select { + case <-timer.C: + if atomic.CompareAndSwapUint32(&t.activity, 1, 0) { + timer.Reset(t.kp.Time) + continue + } + // Check if keepalive should go dormant. + t.mu.Lock() + if len(t.activeStreams) < 1 && !t.kp.PermitWithoutStream { + // Make awakenKeepalive writable. + <-t.awakenKeepalive + t.mu.Unlock() + select { + case <-t.awakenKeepalive: + // If the control gets here a ping has been sent + // need to reset the timer with keepalive.Timeout. + case <-t.ctx.Done(): + return + } + } else { + t.mu.Unlock() + // Send ping. + t.controlBuf.put(p) + } + + // By the time control gets here a ping has been sent one way or the other. + timer.Reset(t.kp.Timeout) + select { + case <-timer.C: + if atomic.CompareAndSwapUint32(&t.activity, 1, 0) { + timer.Reset(t.kp.Time) + continue + } + t.Close() + return + case <-t.ctx.Done(): + if !timer.Stop() { + <-timer.C + } + return + } + case <-t.ctx.Done(): + if !timer.Stop() { + <-timer.C + } + return + } + } +} + +func (t *http2Client) Error() <-chan struct{} { + return t.ctx.Done() +} + +func (t *http2Client) GoAway() <-chan struct{} { + return t.goAway +} diff --git a/vendor/google.golang.org/grpc/transport/http2_server.go b/vendor/google.golang.org/grpc/transport/http2_server.go new file mode 100644 index 0000000000..4a95363cc4 --- /dev/null +++ b/vendor/google.golang.org/grpc/transport/http2_server.go @@ -0,0 +1,1202 @@ +/* + * + * Copyright 2014 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. + * + */ + +package transport + +import ( + "bytes" + "errors" + "fmt" + "io" + "math" + "math/rand" + "net" + "strconv" + "sync" + "sync/atomic" + "time" + + "github.com/golang/protobuf/proto" + "golang.org/x/net/context" + "golang.org/x/net/http2" + "golang.org/x/net/http2/hpack" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/keepalive" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/peer" + "google.golang.org/grpc/stats" + "google.golang.org/grpc/status" + "google.golang.org/grpc/tap" +) + +// ErrIllegalHeaderWrite indicates that setting header is illegal because of +// the stream's state. +var ErrIllegalHeaderWrite = errors.New("transport: the stream is done or WriteHeader was already called") + +// http2Server implements the ServerTransport interface with HTTP2. +type http2Server struct { + ctx context.Context + cancel context.CancelFunc + conn net.Conn + remoteAddr net.Addr + localAddr net.Addr + maxStreamID uint32 // max stream ID ever seen + authInfo credentials.AuthInfo // auth info about the connection + inTapHandle tap.ServerInHandle + framer *framer + hBuf *bytes.Buffer // the buffer for HPACK encoding + hEnc *hpack.Encoder // HPACK encoder + // The max number of concurrent streams. + maxStreams uint32 + // controlBuf delivers all the control related tasks (e.g., window + // updates, reset streams, and various settings) to the controller. + controlBuf *controlBuffer + fc *inFlow + // sendQuotaPool provides flow control to outbound message. + sendQuotaPool *quotaPool + // localSendQuota limits the amount of data that can be scheduled + // for writing before it is actually written out. + localSendQuota *quotaPool + stats stats.Handler + // Flag to keep track of reading activity on transport. + // 1 is true and 0 is false. + activity uint32 // Accessed atomically. + // Keepalive and max-age parameters for the server. + kp keepalive.ServerParameters + + // Keepalive enforcement policy. + kep keepalive.EnforcementPolicy + // The time instance last ping was received. + lastPingAt time.Time + // Number of times the client has violated keepalive ping policy so far. + pingStrikes uint8 + // Flag to signify that number of ping strikes should be reset to 0. + // This is set whenever data or header frames are sent. + // 1 means yes. + resetPingStrikes uint32 // Accessed atomically. + initialWindowSize int32 + bdpEst *bdpEstimator + + mu sync.Mutex // guard the following + + // drainChan is initialized when drain(...) is called the first time. + // After which the server writes out the first GoAway(with ID 2^31-1) frame. + // Then an independent goroutine will be launched to later send the second GoAway. + // During this time we don't want to write another first GoAway(with ID 2^31 -1) frame. + // Thus call to drain(...) will be a no-op if drainChan is already initialized since draining is + // already underway. + drainChan chan struct{} + state transportState + activeStreams map[uint32]*Stream + // the per-stream outbound flow control window size set by the peer. + streamSendQuota uint32 + // idle is the time instant when the connection went idle. + // This is either the beginning of the connection or when the number of + // RPCs go down to 0. + // When the connection is busy, this value is set to 0. + idle time.Time +} + +// newHTTP2Server constructs a ServerTransport based on HTTP2. ConnectionError is +// returned if something goes wrong. +func newHTTP2Server(conn net.Conn, config *ServerConfig) (_ ServerTransport, err error) { + writeBufSize := defaultWriteBufSize + if config.WriteBufferSize > 0 { + writeBufSize = config.WriteBufferSize + } + readBufSize := defaultReadBufSize + if config.ReadBufferSize > 0 { + readBufSize = config.ReadBufferSize + } + framer := newFramer(conn, writeBufSize, readBufSize) + // Send initial settings as connection preface to client. + var isettings []http2.Setting + // TODO(zhaoq): Have a better way to signal "no limit" because 0 is + // permitted in the HTTP2 spec. + maxStreams := config.MaxStreams + if maxStreams == 0 { + maxStreams = math.MaxUint32 + } else { + isettings = append(isettings, http2.Setting{ + ID: http2.SettingMaxConcurrentStreams, + Val: maxStreams, + }) + } + dynamicWindow := true + iwz := int32(initialWindowSize) + if config.InitialWindowSize >= defaultWindowSize { + iwz = config.InitialWindowSize + dynamicWindow = false + } + icwz := int32(initialWindowSize) + if config.InitialConnWindowSize >= defaultWindowSize { + icwz = config.InitialConnWindowSize + dynamicWindow = false + } + if iwz != defaultWindowSize { + isettings = append(isettings, http2.Setting{ + ID: http2.SettingInitialWindowSize, + Val: uint32(iwz)}) + } + if err := framer.fr.WriteSettings(isettings...); err != nil { + return nil, connectionErrorf(false, err, "transport: %v", err) + } + // Adjust the connection flow control window if needed. + if delta := uint32(icwz - defaultWindowSize); delta > 0 { + if err := framer.fr.WriteWindowUpdate(0, delta); err != nil { + return nil, connectionErrorf(false, err, "transport: %v", err) + } + } + kp := config.KeepaliveParams + if kp.MaxConnectionIdle == 0 { + kp.MaxConnectionIdle = defaultMaxConnectionIdle + } + if kp.MaxConnectionAge == 0 { + kp.MaxConnectionAge = defaultMaxConnectionAge + } + // Add a jitter to MaxConnectionAge. + kp.MaxConnectionAge += getJitter(kp.MaxConnectionAge) + if kp.MaxConnectionAgeGrace == 0 { + kp.MaxConnectionAgeGrace = defaultMaxConnectionAgeGrace + } + if kp.Time == 0 { + kp.Time = defaultServerKeepaliveTime + } + if kp.Timeout == 0 { + kp.Timeout = defaultServerKeepaliveTimeout + } + kep := config.KeepalivePolicy + if kep.MinTime == 0 { + kep.MinTime = defaultKeepalivePolicyMinTime + } + var buf bytes.Buffer + ctx, cancel := context.WithCancel(context.Background()) + t := &http2Server{ + ctx: ctx, + cancel: cancel, + conn: conn, + remoteAddr: conn.RemoteAddr(), + localAddr: conn.LocalAddr(), + authInfo: config.AuthInfo, + framer: framer, + hBuf: &buf, + hEnc: hpack.NewEncoder(&buf), + maxStreams: maxStreams, + inTapHandle: config.InTapHandle, + controlBuf: newControlBuffer(), + fc: &inFlow{limit: uint32(icwz)}, + sendQuotaPool: newQuotaPool(defaultWindowSize), + localSendQuota: newQuotaPool(defaultLocalSendQuota), + state: reachable, + activeStreams: make(map[uint32]*Stream), + streamSendQuota: defaultWindowSize, + stats: config.StatsHandler, + kp: kp, + idle: time.Now(), + kep: kep, + initialWindowSize: iwz, + } + if dynamicWindow { + t.bdpEst = &bdpEstimator{ + bdp: initialWindowSize, + updateFlowControl: t.updateFlowControl, + } + } + if t.stats != nil { + t.ctx = t.stats.TagConn(t.ctx, &stats.ConnTagInfo{ + RemoteAddr: t.remoteAddr, + LocalAddr: t.localAddr, + }) + connBegin := &stats.ConnBegin{} + t.stats.HandleConn(t.ctx, connBegin) + } + t.framer.writer.Flush() + + // Check the validity of client preface. + preface := make([]byte, len(clientPreface)) + if _, err := io.ReadFull(t.conn, preface); err != nil { + return nil, connectionErrorf(false, err, "transport: http2Server.HandleStreams failed to receive the preface from client: %v", err) + } + if !bytes.Equal(preface, clientPreface) { + return nil, connectionErrorf(false, nil, "transport: http2Server.HandleStreams received bogus greeting from client: %q", preface) + } + + frame, err := t.framer.fr.ReadFrame() + if err == io.EOF || err == io.ErrUnexpectedEOF { + t.Close() + return + } + if err != nil { + return nil, connectionErrorf(false, err, "transport: http2Server.HandleStreams failed to read initial settings frame: %v", err) + } + atomic.StoreUint32(&t.activity, 1) + sf, ok := frame.(*http2.SettingsFrame) + if !ok { + return nil, connectionErrorf(false, nil, "transport: http2Server.HandleStreams saw invalid preface type %T from client", frame) + } + t.handleSettings(sf) + + go func() { + loopyWriter(t.ctx, t.controlBuf, t.itemHandler) + t.Close() + }() + go t.keepalive() + return t, nil +} + +// operateHeader takes action on the decoded headers. +func (t *http2Server) operateHeaders(frame *http2.MetaHeadersFrame, handle func(*Stream), traceCtx func(context.Context, string) context.Context) (close bool) { + streamID := frame.Header().StreamID + + var state decodeState + for _, hf := range frame.Fields { + if err := state.processHeaderField(hf); err != nil { + if se, ok := err.(StreamError); ok { + t.controlBuf.put(&resetStream{streamID, statusCodeConvTab[se.Code]}) + } + return + } + } + + buf := newRecvBuffer() + s := &Stream{ + id: streamID, + st: t, + buf: buf, + fc: &inFlow{limit: uint32(t.initialWindowSize)}, + recvCompress: state.encoding, + method: state.method, + } + + if frame.StreamEnded() { + // s is just created by the caller. No lock needed. + s.state = streamReadDone + } + if state.timeoutSet { + s.ctx, s.cancel = context.WithTimeout(t.ctx, state.timeout) + } else { + s.ctx, s.cancel = context.WithCancel(t.ctx) + } + pr := &peer.Peer{ + Addr: t.remoteAddr, + } + // Attach Auth info if there is any. + if t.authInfo != nil { + pr.AuthInfo = t.authInfo + } + s.ctx = peer.NewContext(s.ctx, pr) + // Cache the current stream to the context so that the server application + // can find out. Required when the server wants to send some metadata + // back to the client (unary call only). + s.ctx = newContextWithStream(s.ctx, s) + // Attach the received metadata to the context. + if len(state.mdata) > 0 { + s.ctx = metadata.NewIncomingContext(s.ctx, state.mdata) + } + if state.statsTags != nil { + s.ctx = stats.SetIncomingTags(s.ctx, state.statsTags) + } + if state.statsTrace != nil { + s.ctx = stats.SetIncomingTrace(s.ctx, state.statsTrace) + } + if t.inTapHandle != nil { + var err error + info := &tap.Info{ + FullMethodName: state.method, + } + s.ctx, err = t.inTapHandle(s.ctx, info) + if err != nil { + warningf("transport: http2Server.operateHeaders got an error from InTapHandle: %v", err) + t.controlBuf.put(&resetStream{s.id, http2.ErrCodeRefusedStream}) + return + } + } + t.mu.Lock() + if t.state != reachable { + t.mu.Unlock() + return + } + if uint32(len(t.activeStreams)) >= t.maxStreams { + t.mu.Unlock() + t.controlBuf.put(&resetStream{streamID, http2.ErrCodeRefusedStream}) + return + } + if streamID%2 != 1 || streamID <= t.maxStreamID { + t.mu.Unlock() + // illegal gRPC stream id. + errorf("transport: http2Server.HandleStreams received an illegal stream id: %v", streamID) + return true + } + t.maxStreamID = streamID + s.sendQuotaPool = newQuotaPool(int(t.streamSendQuota)) + t.activeStreams[streamID] = s + if len(t.activeStreams) == 1 { + t.idle = time.Time{} + } + t.mu.Unlock() + s.requestRead = func(n int) { + t.adjustWindow(s, uint32(n)) + } + s.ctx = traceCtx(s.ctx, s.method) + if t.stats != nil { + s.ctx = t.stats.TagRPC(s.ctx, &stats.RPCTagInfo{FullMethodName: s.method}) + inHeader := &stats.InHeader{ + FullMethod: s.method, + RemoteAddr: t.remoteAddr, + LocalAddr: t.localAddr, + Compression: s.recvCompress, + WireLength: int(frame.Header().Length), + } + t.stats.HandleRPC(s.ctx, inHeader) + } + s.trReader = &transportReader{ + reader: &recvBufferReader{ + ctx: s.ctx, + recv: s.buf, + }, + windowHandler: func(n int) { + t.updateWindow(s, uint32(n)) + }, + } + s.waiters = waiters{ + ctx: s.ctx, + tctx: t.ctx, + } + handle(s) + return +} + +// HandleStreams receives incoming streams using the given handler. This is +// typically run in a separate goroutine. +// traceCtx attaches trace to ctx and returns the new context. +func (t *http2Server) HandleStreams(handle func(*Stream), traceCtx func(context.Context, string) context.Context) { + for { + frame, err := t.framer.fr.ReadFrame() + atomic.StoreUint32(&t.activity, 1) + if err != nil { + if se, ok := err.(http2.StreamError); ok { + t.mu.Lock() + s := t.activeStreams[se.StreamID] + t.mu.Unlock() + if s != nil { + t.closeStream(s) + } + t.controlBuf.put(&resetStream{se.StreamID, se.Code}) + continue + } + if err == io.EOF || err == io.ErrUnexpectedEOF { + t.Close() + return + } + warningf("transport: http2Server.HandleStreams failed to read frame: %v", err) + t.Close() + return + } + switch frame := frame.(type) { + case *http2.MetaHeadersFrame: + if t.operateHeaders(frame, handle, traceCtx) { + t.Close() + break + } + case *http2.DataFrame: + t.handleData(frame) + case *http2.RSTStreamFrame: + t.handleRSTStream(frame) + case *http2.SettingsFrame: + t.handleSettings(frame) + case *http2.PingFrame: + t.handlePing(frame) + case *http2.WindowUpdateFrame: + t.handleWindowUpdate(frame) + case *http2.GoAwayFrame: + // TODO: Handle GoAway from the client appropriately. + default: + errorf("transport: http2Server.HandleStreams found unhandled frame type %v.", frame) + } + } +} + +func (t *http2Server) getStream(f http2.Frame) (*Stream, bool) { + t.mu.Lock() + defer t.mu.Unlock() + if t.activeStreams == nil { + // The transport is closing. + return nil, false + } + s, ok := t.activeStreams[f.Header().StreamID] + if !ok { + // The stream is already done. + return nil, false + } + return s, true +} + +// adjustWindow sends out extra window update over the initial window size +// of stream if the application is requesting data larger in size than +// the window. +func (t *http2Server) adjustWindow(s *Stream, n uint32) { + s.mu.Lock() + defer s.mu.Unlock() + if s.state == streamDone { + return + } + if w := s.fc.maybeAdjust(n); w > 0 { + if cw := t.fc.resetPendingUpdate(); cw > 0 { + t.controlBuf.put(&windowUpdate{0, cw}) + } + t.controlBuf.put(&windowUpdate{s.id, w}) + } +} + +// updateWindow adjusts the inbound quota for the stream and the transport. +// Window updates will deliver to the controller for sending when +// the cumulative quota exceeds the corresponding threshold. +func (t *http2Server) updateWindow(s *Stream, n uint32) { + s.mu.Lock() + defer s.mu.Unlock() + if s.state == streamDone { + return + } + if w := s.fc.onRead(n); w > 0 { + if cw := t.fc.resetPendingUpdate(); cw > 0 { + t.controlBuf.put(&windowUpdate{0, cw}) + } + t.controlBuf.put(&windowUpdate{s.id, w}) + } +} + +// updateFlowControl updates the incoming flow control windows +// for the transport and the stream based on the current bdp +// estimation. +func (t *http2Server) updateFlowControl(n uint32) { + t.mu.Lock() + for _, s := range t.activeStreams { + s.fc.newLimit(n) + } + t.initialWindowSize = int32(n) + t.mu.Unlock() + t.controlBuf.put(&windowUpdate{0, t.fc.newLimit(n)}) + t.controlBuf.put(&settings{ + ss: []http2.Setting{ + { + ID: http2.SettingInitialWindowSize, + Val: uint32(n), + }, + }, + }) + +} + +func (t *http2Server) handleData(f *http2.DataFrame) { + size := f.Header().Length + var sendBDPPing bool + if t.bdpEst != nil { + sendBDPPing = t.bdpEst.add(uint32(size)) + } + // Decouple connection's flow control from application's read. + // An update on connection's flow control should not depend on + // whether user application has read the data or not. Such a + // restriction is already imposed on the stream's flow control, + // and therefore the sender will be blocked anyways. + // Decoupling the connection flow control will prevent other + // active(fast) streams from starving in presence of slow or + // inactive streams. + // + // Furthermore, if a bdpPing is being sent out we can piggyback + // connection's window update for the bytes we just received. + if sendBDPPing { + if size != 0 { // Could be an empty frame. + t.controlBuf.put(&windowUpdate{0, uint32(size)}) + } + t.controlBuf.put(bdpPing) + } else { + if err := t.fc.onData(uint32(size)); err != nil { + errorf("transport: http2Server %v", err) + t.Close() + return + } + if w := t.fc.onRead(uint32(size)); w > 0 { + t.controlBuf.put(&windowUpdate{0, w}) + } + } + // Select the right stream to dispatch. + s, ok := t.getStream(f) + if !ok { + return + } + if size > 0 { + s.mu.Lock() + if s.state == streamDone { + s.mu.Unlock() + return + } + if err := s.fc.onData(uint32(size)); err != nil { + s.mu.Unlock() + t.closeStream(s) + t.controlBuf.put(&resetStream{s.id, http2.ErrCodeFlowControl}) + return + } + if f.Header().Flags.Has(http2.FlagDataPadded) { + if w := s.fc.onRead(uint32(size) - uint32(len(f.Data()))); w > 0 { + t.controlBuf.put(&windowUpdate{s.id, w}) + } + } + s.mu.Unlock() + // TODO(bradfitz, zhaoq): A copy is required here because there is no + // guarantee f.Data() is consumed before the arrival of next frame. + // Can this copy be eliminated? + if len(f.Data()) > 0 { + data := make([]byte, len(f.Data())) + copy(data, f.Data()) + s.write(recvMsg{data: data}) + } + } + if f.Header().Flags.Has(http2.FlagDataEndStream) { + // Received the end of stream from the client. + s.mu.Lock() + if s.state != streamDone { + s.state = streamReadDone + } + s.mu.Unlock() + s.write(recvMsg{err: io.EOF}) + } +} + +func (t *http2Server) handleRSTStream(f *http2.RSTStreamFrame) { + s, ok := t.getStream(f) + if !ok { + return + } + t.closeStream(s) +} + +func (t *http2Server) handleSettings(f *http2.SettingsFrame) { + if f.IsAck() { + return + } + var rs []http2.Setting + var ps []http2.Setting + f.ForeachSetting(func(s http2.Setting) error { + if t.isRestrictive(s) { + rs = append(rs, s) + } else { + ps = append(ps, s) + } + return nil + }) + t.applySettings(rs) + t.controlBuf.put(&settingsAck{}) + t.applySettings(ps) +} + +func (t *http2Server) isRestrictive(s http2.Setting) bool { + switch s.ID { + case http2.SettingInitialWindowSize: + // Note: we don't acquire a lock here to read streamSendQuota + // because the same goroutine updates it later. + return s.Val < t.streamSendQuota + } + return false +} + +func (t *http2Server) applySettings(ss []http2.Setting) { + for _, s := range ss { + if s.ID == http2.SettingInitialWindowSize { + t.mu.Lock() + for _, stream := range t.activeStreams { + stream.sendQuotaPool.addAndUpdate(int(s.Val) - int(t.streamSendQuota)) + } + t.streamSendQuota = s.Val + t.mu.Unlock() + } + + } +} + +const ( + maxPingStrikes = 2 + defaultPingTimeout = 2 * time.Hour +) + +func (t *http2Server) handlePing(f *http2.PingFrame) { + if f.IsAck() { + if f.Data == goAwayPing.data && t.drainChan != nil { + close(t.drainChan) + return + } + // Maybe it's a BDP ping. + if t.bdpEst != nil { + t.bdpEst.calculate(f.Data) + } + return + } + pingAck := &ping{ack: true} + copy(pingAck.data[:], f.Data[:]) + t.controlBuf.put(pingAck) + + now := time.Now() + defer func() { + t.lastPingAt = now + }() + // A reset ping strikes means that we don't need to check for policy + // violation for this ping and the pingStrikes counter should be set + // to 0. + if atomic.CompareAndSwapUint32(&t.resetPingStrikes, 1, 0) { + t.pingStrikes = 0 + return + } + t.mu.Lock() + ns := len(t.activeStreams) + t.mu.Unlock() + if ns < 1 && !t.kep.PermitWithoutStream { + // Keepalive shouldn't be active thus, this new ping should + // have come after at least defaultPingTimeout. + if t.lastPingAt.Add(defaultPingTimeout).After(now) { + t.pingStrikes++ + } + } else { + // Check if keepalive policy is respected. + if t.lastPingAt.Add(t.kep.MinTime).After(now) { + t.pingStrikes++ + } + } + + if t.pingStrikes > maxPingStrikes { + // Send goaway and close the connection. + errorf("transport: Got too many pings from the client, closing the connection.") + t.controlBuf.put(&goAway{code: http2.ErrCodeEnhanceYourCalm, debugData: []byte("too_many_pings"), closeConn: true}) + } +} + +func (t *http2Server) handleWindowUpdate(f *http2.WindowUpdateFrame) { + id := f.Header().StreamID + incr := f.Increment + if id == 0 { + t.sendQuotaPool.add(int(incr)) + return + } + if s, ok := t.getStream(f); ok { + s.sendQuotaPool.add(int(incr)) + } +} + +// WriteHeader sends the header metedata md back to the client. +func (t *http2Server) WriteHeader(s *Stream, md metadata.MD) error { + select { + case <-s.ctx.Done(): + return ContextErr(s.ctx.Err()) + case <-t.ctx.Done(): + return ErrConnClosing + default: + } + + s.mu.Lock() + if s.headerOk || s.state == streamDone { + s.mu.Unlock() + return ErrIllegalHeaderWrite + } + s.headerOk = true + if md.Len() > 0 { + if s.header.Len() > 0 { + s.header = metadata.Join(s.header, md) + } else { + s.header = md + } + } + md = s.header + s.mu.Unlock() + // TODO(mmukhi): Benchmark if the performance gets better if count the metadata and other header fields + // first and create a slice of that exact size. + headerFields := make([]hpack.HeaderField, 0, 2) // at least :status, content-type will be there if none else. + headerFields = append(headerFields, hpack.HeaderField{Name: ":status", Value: "200"}) + headerFields = append(headerFields, hpack.HeaderField{Name: "content-type", Value: "application/grpc"}) + if s.sendCompress != "" { + headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-encoding", Value: s.sendCompress}) + } + for k, vv := range md { + if isReservedHeader(k) { + // Clients don't tolerate reading restricted headers after some non restricted ones were sent. + continue + } + for _, v := range vv { + headerFields = append(headerFields, hpack.HeaderField{Name: k, Value: encodeMetadataHeader(k, v)}) + } + } + t.controlBuf.put(&headerFrame{ + streamID: s.id, + hf: headerFields, + endStream: false, + }) + if t.stats != nil { + outHeader := &stats.OutHeader{ + //WireLength: // TODO(mmukhi): Revisit this later, if needed. + } + t.stats.HandleRPC(s.Context(), outHeader) + } + return nil +} + +// WriteStatus sends stream status to the client and terminates the stream. +// There is no further I/O operations being able to perform on this stream. +// TODO(zhaoq): Now it indicates the end of entire stream. Revisit if early +// OK is adopted. +func (t *http2Server) WriteStatus(s *Stream, st *status.Status) error { + select { + case <-t.ctx.Done(): + return ErrConnClosing + default: + } + + var headersSent, hasHeader bool + s.mu.Lock() + if s.state == streamDone { + s.mu.Unlock() + return nil + } + if s.headerOk { + headersSent = true + } + if s.header.Len() > 0 { + hasHeader = true + } + s.mu.Unlock() + + if !headersSent && hasHeader { + t.WriteHeader(s, nil) + headersSent = true + } + + // TODO(mmukhi): Benchmark if the performance gets better if count the metadata and other header fields + // first and create a slice of that exact size. + headerFields := make([]hpack.HeaderField, 0, 2) // grpc-status and grpc-message will be there if none else. + if !headersSent { + headerFields = append(headerFields, hpack.HeaderField{Name: ":status", Value: "200"}) + headerFields = append(headerFields, hpack.HeaderField{Name: "content-type", Value: "application/grpc"}) + } + headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-status", Value: strconv.Itoa(int(st.Code()))}) + headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-message", Value: encodeGrpcMessage(st.Message())}) + + if p := st.Proto(); p != nil && len(p.Details) > 0 { + stBytes, err := proto.Marshal(p) + if err != nil { + // TODO: return error instead, when callers are able to handle it. + panic(err) + } + + headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-status-details-bin", Value: encodeBinHeader(stBytes)}) + } + + // Attach the trailer metadata. + for k, vv := range s.trailer { + // Clients don't tolerate reading restricted headers after some non restricted ones were sent. + if isReservedHeader(k) { + continue + } + for _, v := range vv { + headerFields = append(headerFields, hpack.HeaderField{Name: k, Value: encodeMetadataHeader(k, v)}) + } + } + t.controlBuf.put(&headerFrame{ + streamID: s.id, + hf: headerFields, + endStream: true, + }) + if t.stats != nil { + t.stats.HandleRPC(s.Context(), &stats.OutTrailer{}) + } + t.closeStream(s) + return nil +} + +// Write converts the data into HTTP2 data frame and sends it out. Non-nil error +// is returns if it fails (e.g., framing error, transport error). +func (t *http2Server) Write(s *Stream, hdr []byte, data []byte, opts *Options) error { + select { + case <-s.ctx.Done(): + return ContextErr(s.ctx.Err()) + case <-t.ctx.Done(): + return ErrConnClosing + default: + } + + var writeHeaderFrame bool + s.mu.Lock() + if s.state == streamDone { + s.mu.Unlock() + return streamErrorf(codes.Unknown, "the stream has been done") + } + if !s.headerOk { + writeHeaderFrame = true + } + s.mu.Unlock() + if writeHeaderFrame { + t.WriteHeader(s, nil) + } + // Add data to header frame so that we can equally distribute data across frames. + emptyLen := http2MaxFrameLen - len(hdr) + if emptyLen > len(data) { + emptyLen = len(data) + } + hdr = append(hdr, data[:emptyLen]...) + data = data[emptyLen:] + var ( + streamQuota int + streamQuotaVer uint32 + err error + ) + for _, r := range [][]byte{hdr, data} { + for len(r) > 0 { + size := http2MaxFrameLen + if size > len(r) { + size = len(r) + } + if streamQuota == 0 { // Used up all the locally cached stream quota. + // Get all the stream quota there is. + streamQuota, streamQuotaVer, err = s.sendQuotaPool.get(math.MaxInt32, s.waiters) + if err != nil { + return err + } + } + if size > streamQuota { + size = streamQuota + } + // Get size worth quota from transport. + tq, _, err := t.sendQuotaPool.get(size, s.waiters) + if err != nil { + return err + } + if tq < size { + size = tq + } + ltq, _, err := t.localSendQuota.get(size, s.waiters) + if err != nil { + return err + } + // even if ltq is smaller than size we don't adjust size since, + // ltq is only a soft limit. + streamQuota -= size + p := r[:size] + // Reset ping strikes when sending data since this might cause + // the peer to send ping. + atomic.StoreUint32(&t.resetPingStrikes, 1) + success := func() { + ltq := ltq + t.controlBuf.put(&dataFrame{streamID: s.id, endStream: false, d: p, f: func() { + t.localSendQuota.add(ltq) + }}) + r = r[size:] + } + failure := func() { // The stream quota version must have changed. + // Our streamQuota cache is invalidated now, so give it back. + s.sendQuotaPool.lockedAdd(streamQuota + size) + } + if !s.sendQuotaPool.compareAndExecute(streamQuotaVer, success, failure) { + // Couldn't send this chunk out. + t.sendQuotaPool.add(size) + t.localSendQuota.add(ltq) + streamQuota = 0 + } + } + } + if streamQuota > 0 { + // ADd the left over quota back to stream. + s.sendQuotaPool.add(streamQuota) + } + return nil +} + +// keepalive running in a separate goroutine does the following: +// 1. Gracefully closes an idle connection after a duration of keepalive.MaxConnectionIdle. +// 2. Gracefully closes any connection after a duration of keepalive.MaxConnectionAge. +// 3. Forcibly closes a connection after an additive period of keepalive.MaxConnectionAgeGrace over keepalive.MaxConnectionAge. +// 4. Makes sure a connection is alive by sending pings with a frequency of keepalive.Time and closes a non-responsive connection +// after an additional duration of keepalive.Timeout. +func (t *http2Server) keepalive() { + p := &ping{} + var pingSent bool + maxIdle := time.NewTimer(t.kp.MaxConnectionIdle) + maxAge := time.NewTimer(t.kp.MaxConnectionAge) + keepalive := time.NewTimer(t.kp.Time) + // NOTE: All exit paths of this function should reset their + // respective timers. A failure to do so will cause the + // following clean-up to deadlock and eventually leak. + defer func() { + if !maxIdle.Stop() { + <-maxIdle.C + } + if !maxAge.Stop() { + <-maxAge.C + } + if !keepalive.Stop() { + <-keepalive.C + } + }() + for { + select { + case <-maxIdle.C: + t.mu.Lock() + idle := t.idle + if idle.IsZero() { // The connection is non-idle. + t.mu.Unlock() + maxIdle.Reset(t.kp.MaxConnectionIdle) + continue + } + val := t.kp.MaxConnectionIdle - time.Since(idle) + t.mu.Unlock() + if val <= 0 { + // The connection has been idle for a duration of keepalive.MaxConnectionIdle or more. + // Gracefully close the connection. + t.drain(http2.ErrCodeNo, []byte{}) + // Reseting the timer so that the clean-up doesn't deadlock. + maxIdle.Reset(infinity) + return + } + maxIdle.Reset(val) + case <-maxAge.C: + t.drain(http2.ErrCodeNo, []byte{}) + maxAge.Reset(t.kp.MaxConnectionAgeGrace) + select { + case <-maxAge.C: + // Close the connection after grace period. + t.Close() + // Reseting the timer so that the clean-up doesn't deadlock. + maxAge.Reset(infinity) + case <-t.ctx.Done(): + } + return + case <-keepalive.C: + if atomic.CompareAndSwapUint32(&t.activity, 1, 0) { + pingSent = false + keepalive.Reset(t.kp.Time) + continue + } + if pingSent { + t.Close() + // Reseting the timer so that the clean-up doesn't deadlock. + keepalive.Reset(infinity) + return + } + pingSent = true + t.controlBuf.put(p) + keepalive.Reset(t.kp.Timeout) + case <-t.ctx.Done(): + return + } + } +} + +var goAwayPing = &ping{data: [8]byte{1, 6, 1, 8, 0, 3, 3, 9}} + +// TODO(mmukhi): A lot of this code(and code in other places in the tranpsort layer) +// is duplicated between the client and the server. +// The transport layer needs to be refactored to take care of this. +func (t *http2Server) itemHandler(i item) error { + switch i := i.(type) { + case *dataFrame: + if err := t.framer.fr.WriteData(i.streamID, i.endStream, i.d); err != nil { + return err + } + i.f() + return nil + case *headerFrame: + t.hBuf.Reset() + for _, f := range i.hf { + t.hEnc.WriteField(f) + } + first := true + endHeaders := false + for !endHeaders { + size := t.hBuf.Len() + if size > http2MaxFrameLen { + size = http2MaxFrameLen + } else { + endHeaders = true + } + var err error + if first { + first = false + err = t.framer.fr.WriteHeaders(http2.HeadersFrameParam{ + StreamID: i.streamID, + BlockFragment: t.hBuf.Next(size), + EndStream: i.endStream, + EndHeaders: endHeaders, + }) + } else { + err = t.framer.fr.WriteContinuation( + i.streamID, + endHeaders, + t.hBuf.Next(size), + ) + } + if err != nil { + return err + } + } + atomic.StoreUint32(&t.resetPingStrikes, 1) + return nil + case *windowUpdate: + return t.framer.fr.WriteWindowUpdate(i.streamID, i.increment) + case *settings: + return t.framer.fr.WriteSettings(i.ss...) + case *settingsAck: + return t.framer.fr.WriteSettingsAck() + case *resetStream: + return t.framer.fr.WriteRSTStream(i.streamID, i.code) + case *goAway: + t.mu.Lock() + if t.state == closing { + t.mu.Unlock() + // The transport is closing. + return fmt.Errorf("transport: Connection closing") + } + sid := t.maxStreamID + if !i.headsUp { + // Stop accepting more streams now. + t.state = draining + t.mu.Unlock() + if err := t.framer.fr.WriteGoAway(sid, i.code, i.debugData); err != nil { + return err + } + if i.closeConn { + // Abruptly close the connection following the GoAway (via + // loopywriter). But flush out what's inside the buffer first. + t.framer.writer.Flush() + return fmt.Errorf("transport: Connection closing") + } + return nil + } + t.mu.Unlock() + // For a graceful close, send out a GoAway with stream ID of MaxUInt32, + // Follow that with a ping and wait for the ack to come back or a timer + // to expire. During this time accept new streams since they might have + // originated before the GoAway reaches the client. + // After getting the ack or timer expiration send out another GoAway this + // time with an ID of the max stream server intends to process. + if err := t.framer.fr.WriteGoAway(math.MaxUint32, http2.ErrCodeNo, []byte{}); err != nil { + return err + } + if err := t.framer.fr.WritePing(false, goAwayPing.data); err != nil { + return err + } + go func() { + timer := time.NewTimer(time.Minute) + defer timer.Stop() + select { + case <-t.drainChan: + case <-timer.C: + case <-t.ctx.Done(): + return + } + t.controlBuf.put(&goAway{code: i.code, debugData: i.debugData}) + }() + return nil + case *flushIO: + return t.framer.writer.Flush() + case *ping: + if !i.ack { + t.bdpEst.timesnap(i.data) + } + return t.framer.fr.WritePing(i.ack, i.data) + default: + err := status.Errorf(codes.Internal, "transport: http2Server.controller got unexpected item type %t", i) + errorf("%v", err) + return err + } +} + +// Close starts shutting down the http2Server transport. +// TODO(zhaoq): Now the destruction is not blocked on any pending streams. This +// could cause some resource issue. Revisit this later. +func (t *http2Server) Close() error { + t.mu.Lock() + if t.state == closing { + t.mu.Unlock() + return errors.New("transport: Close() was already called") + } + t.state = closing + streams := t.activeStreams + t.activeStreams = nil + t.mu.Unlock() + t.cancel() + err := t.conn.Close() + // Cancel all active streams. + for _, s := range streams { + s.cancel() + } + if t.stats != nil { + connEnd := &stats.ConnEnd{} + t.stats.HandleConn(t.ctx, connEnd) + } + return err +} + +// closeStream clears the footprint of a stream when the stream is not needed +// any more. +func (t *http2Server) closeStream(s *Stream) { + t.mu.Lock() + delete(t.activeStreams, s.id) + if len(t.activeStreams) == 0 { + t.idle = time.Now() + } + if t.state == draining && len(t.activeStreams) == 0 { + defer t.Close() + } + t.mu.Unlock() + // In case stream sending and receiving are invoked in separate + // goroutines (e.g., bi-directional streaming), cancel needs to be + // called to interrupt the potential blocking on other goroutines. + s.cancel() + s.mu.Lock() + if s.state == streamDone { + s.mu.Unlock() + return + } + s.state = streamDone + s.mu.Unlock() +} + +func (t *http2Server) RemoteAddr() net.Addr { + return t.remoteAddr +} + +func (t *http2Server) Drain() { + t.drain(http2.ErrCodeNo, []byte{}) +} + +func (t *http2Server) drain(code http2.ErrCode, debugData []byte) { + t.mu.Lock() + defer t.mu.Unlock() + if t.drainChan != nil { + return + } + t.drainChan = make(chan struct{}) + t.controlBuf.put(&goAway{code: code, debugData: debugData, headsUp: true}) +} + +var rgen = rand.New(rand.NewSource(time.Now().UnixNano())) + +func getJitter(v time.Duration) time.Duration { + if v == infinity { + return 0 + } + // Generate a jitter between +/- 10% of the value. + r := int64(v / 10) + j := rgen.Int63n(2*r) - r + return time.Duration(j) +} diff --git a/vendor/google.golang.org/grpc/transport/http_util.go b/vendor/google.golang.org/grpc/transport/http_util.go new file mode 100644 index 0000000000..39f878cfd5 --- /dev/null +++ b/vendor/google.golang.org/grpc/transport/http_util.go @@ -0,0 +1,489 @@ +/* + * + * Copyright 2014 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. + * + */ + +package transport + +import ( + "bufio" + "bytes" + "encoding/base64" + "fmt" + "io" + "net" + "net/http" + "strconv" + "strings" + "time" + + "github.com/golang/protobuf/proto" + "golang.org/x/net/http2" + "golang.org/x/net/http2/hpack" + spb "google.golang.org/genproto/googleapis/rpc/status" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +const ( + // http2MaxFrameLen specifies the max length of a HTTP2 frame. + http2MaxFrameLen = 16384 // 16KB frame + // http://http2.github.io/http2-spec/#SettingValues + http2InitHeaderTableSize = 4096 + // http2IOBufSize specifies the buffer size for sending frames. + defaultWriteBufSize = 32 * 1024 + defaultReadBufSize = 32 * 1024 +) + +var ( + clientPreface = []byte(http2.ClientPreface) + http2ErrConvTab = map[http2.ErrCode]codes.Code{ + http2.ErrCodeNo: codes.Internal, + http2.ErrCodeProtocol: codes.Internal, + http2.ErrCodeInternal: codes.Internal, + http2.ErrCodeFlowControl: codes.ResourceExhausted, + http2.ErrCodeSettingsTimeout: codes.Internal, + http2.ErrCodeStreamClosed: codes.Internal, + http2.ErrCodeFrameSize: codes.Internal, + http2.ErrCodeRefusedStream: codes.Unavailable, + http2.ErrCodeCancel: codes.Canceled, + http2.ErrCodeCompression: codes.Internal, + http2.ErrCodeConnect: codes.Internal, + http2.ErrCodeEnhanceYourCalm: codes.ResourceExhausted, + http2.ErrCodeInadequateSecurity: codes.PermissionDenied, + http2.ErrCodeHTTP11Required: codes.FailedPrecondition, + } + statusCodeConvTab = map[codes.Code]http2.ErrCode{ + codes.Internal: http2.ErrCodeInternal, + codes.Canceled: http2.ErrCodeCancel, + codes.Unavailable: http2.ErrCodeRefusedStream, + codes.ResourceExhausted: http2.ErrCodeEnhanceYourCalm, + codes.PermissionDenied: http2.ErrCodeInadequateSecurity, + } + httpStatusConvTab = map[int]codes.Code{ + // 400 Bad Request - INTERNAL. + http.StatusBadRequest: codes.Internal, + // 401 Unauthorized - UNAUTHENTICATED. + http.StatusUnauthorized: codes.Unauthenticated, + // 403 Forbidden - PERMISSION_DENIED. + http.StatusForbidden: codes.PermissionDenied, + // 404 Not Found - UNIMPLEMENTED. + http.StatusNotFound: codes.Unimplemented, + // 429 Too Many Requests - UNAVAILABLE. + http.StatusTooManyRequests: codes.Unavailable, + // 502 Bad Gateway - UNAVAILABLE. + http.StatusBadGateway: codes.Unavailable, + // 503 Service Unavailable - UNAVAILABLE. + http.StatusServiceUnavailable: codes.Unavailable, + // 504 Gateway timeout - UNAVAILABLE. + http.StatusGatewayTimeout: codes.Unavailable, + } +) + +// Records the states during HPACK decoding. Must be reset once the +// decoding of the entire headers are finished. +type decodeState struct { + encoding string + // statusGen caches the stream status received from the trailer the server + // sent. Client side only. Do not access directly. After all trailers are + // parsed, use the status method to retrieve the status. + statusGen *status.Status + // rawStatusCode and rawStatusMsg are set from the raw trailer fields and are not + // intended for direct access outside of parsing. + rawStatusCode *int + rawStatusMsg string + httpStatus *int + // Server side only fields. + timeoutSet bool + timeout time.Duration + method string + // key-value metadata map from the peer. + mdata map[string][]string + statsTags []byte + statsTrace []byte +} + +// isReservedHeader checks whether hdr belongs to HTTP2 headers +// reserved by gRPC protocol. Any other headers are classified as the +// user-specified metadata. +func isReservedHeader(hdr string) bool { + if hdr != "" && hdr[0] == ':' { + return true + } + switch hdr { + case "content-type", + "grpc-message-type", + "grpc-encoding", + "grpc-message", + "grpc-status", + "grpc-timeout", + "grpc-status-details-bin", + "te": + return true + default: + return false + } +} + +// isWhitelistedPseudoHeader checks whether hdr belongs to HTTP2 pseudoheaders +// that should be propagated into metadata visible to users. +func isWhitelistedPseudoHeader(hdr string) bool { + switch hdr { + case ":authority": + return true + default: + return false + } +} + +func validContentType(t string) bool { + e := "application/grpc" + if !strings.HasPrefix(t, e) { + return false + } + // Support variations on the content-type + // (e.g. "application/grpc+blah", "application/grpc;blah"). + if len(t) > len(e) && t[len(e)] != '+' && t[len(e)] != ';' { + return false + } + return true +} + +func (d *decodeState) status() *status.Status { + if d.statusGen == nil { + // No status-details were provided; generate status using code/msg. + d.statusGen = status.New(codes.Code(int32(*(d.rawStatusCode))), d.rawStatusMsg) + } + return d.statusGen +} + +const binHdrSuffix = "-bin" + +func encodeBinHeader(v []byte) string { + return base64.RawStdEncoding.EncodeToString(v) +} + +func decodeBinHeader(v string) ([]byte, error) { + if len(v)%4 == 0 { + // Input was padded, or padding was not necessary. + return base64.StdEncoding.DecodeString(v) + } + return base64.RawStdEncoding.DecodeString(v) +} + +func encodeMetadataHeader(k, v string) string { + if strings.HasSuffix(k, binHdrSuffix) { + return encodeBinHeader(([]byte)(v)) + } + return v +} + +func decodeMetadataHeader(k, v string) (string, error) { + if strings.HasSuffix(k, binHdrSuffix) { + b, err := decodeBinHeader(v) + return string(b), err + } + return v, nil +} + +func (d *decodeState) decodeResponseHeader(frame *http2.MetaHeadersFrame) error { + for _, hf := range frame.Fields { + if err := d.processHeaderField(hf); err != nil { + return err + } + } + + // If grpc status exists, no need to check further. + if d.rawStatusCode != nil || d.statusGen != nil { + return nil + } + + // If grpc status doesn't exist and http status doesn't exist, + // then it's a malformed header. + if d.httpStatus == nil { + return streamErrorf(codes.Internal, "malformed header: doesn't contain status(gRPC or HTTP)") + } + + if *(d.httpStatus) != http.StatusOK { + code, ok := httpStatusConvTab[*(d.httpStatus)] + if !ok { + code = codes.Unknown + } + return streamErrorf(code, http.StatusText(*(d.httpStatus))) + } + + // gRPC status doesn't exist and http status is OK. + // Set rawStatusCode to be unknown and return nil error. + // So that, if the stream has ended this Unknown status + // will be propogated to the user. + // Otherwise, it will be ignored. In which case, status from + // a later trailer, that has StreamEnded flag set, is propogated. + code := int(codes.Unknown) + d.rawStatusCode = &code + return nil + +} + +func (d *decodeState) addMetadata(k, v string) { + if d.mdata == nil { + d.mdata = make(map[string][]string) + } + d.mdata[k] = append(d.mdata[k], v) +} + +func (d *decodeState) processHeaderField(f hpack.HeaderField) error { + switch f.Name { + case "content-type": + if !validContentType(f.Value) { + return streamErrorf(codes.FailedPrecondition, "transport: received the unexpected content-type %q", f.Value) + } + case "grpc-encoding": + d.encoding = f.Value + case "grpc-status": + code, err := strconv.Atoi(f.Value) + if err != nil { + return streamErrorf(codes.Internal, "transport: malformed grpc-status: %v", err) + } + d.rawStatusCode = &code + case "grpc-message": + d.rawStatusMsg = decodeGrpcMessage(f.Value) + case "grpc-status-details-bin": + v, err := decodeBinHeader(f.Value) + if err != nil { + return streamErrorf(codes.Internal, "transport: malformed grpc-status-details-bin: %v", err) + } + s := &spb.Status{} + if err := proto.Unmarshal(v, s); err != nil { + return streamErrorf(codes.Internal, "transport: malformed grpc-status-details-bin: %v", err) + } + d.statusGen = status.FromProto(s) + case "grpc-timeout": + d.timeoutSet = true + var err error + if d.timeout, err = decodeTimeout(f.Value); err != nil { + return streamErrorf(codes.Internal, "transport: malformed time-out: %v", err) + } + case ":path": + d.method = f.Value + case ":status": + code, err := strconv.Atoi(f.Value) + if err != nil { + return streamErrorf(codes.Internal, "transport: malformed http-status: %v", err) + } + d.httpStatus = &code + case "grpc-tags-bin": + v, err := decodeBinHeader(f.Value) + if err != nil { + return streamErrorf(codes.Internal, "transport: malformed grpc-tags-bin: %v", err) + } + d.statsTags = v + d.addMetadata(f.Name, string(v)) + case "grpc-trace-bin": + v, err := decodeBinHeader(f.Value) + if err != nil { + return streamErrorf(codes.Internal, "transport: malformed grpc-trace-bin: %v", err) + } + d.statsTrace = v + d.addMetadata(f.Name, string(v)) + default: + if isReservedHeader(f.Name) && !isWhitelistedPseudoHeader(f.Name) { + break + } + v, err := decodeMetadataHeader(f.Name, f.Value) + if err != nil { + errorf("Failed to decode metadata header (%q, %q): %v", f.Name, f.Value, err) + return nil + } + d.addMetadata(f.Name, string(v)) + } + return nil +} + +type timeoutUnit uint8 + +const ( + hour timeoutUnit = 'H' + minute timeoutUnit = 'M' + second timeoutUnit = 'S' + millisecond timeoutUnit = 'm' + microsecond timeoutUnit = 'u' + nanosecond timeoutUnit = 'n' +) + +func timeoutUnitToDuration(u timeoutUnit) (d time.Duration, ok bool) { + switch u { + case hour: + return time.Hour, true + case minute: + return time.Minute, true + case second: + return time.Second, true + case millisecond: + return time.Millisecond, true + case microsecond: + return time.Microsecond, true + case nanosecond: + return time.Nanosecond, true + default: + } + return +} + +const maxTimeoutValue int64 = 100000000 - 1 + +// div does integer division and round-up the result. Note that this is +// equivalent to (d+r-1)/r but has less chance to overflow. +func div(d, r time.Duration) int64 { + if m := d % r; m > 0 { + return int64(d/r + 1) + } + return int64(d / r) +} + +// TODO(zhaoq): It is the simplistic and not bandwidth efficient. Improve it. +func encodeTimeout(t time.Duration) string { + if t <= 0 { + return "0n" + } + if d := div(t, time.Nanosecond); d <= maxTimeoutValue { + return strconv.FormatInt(d, 10) + "n" + } + if d := div(t, time.Microsecond); d <= maxTimeoutValue { + return strconv.FormatInt(d, 10) + "u" + } + if d := div(t, time.Millisecond); d <= maxTimeoutValue { + return strconv.FormatInt(d, 10) + "m" + } + if d := div(t, time.Second); d <= maxTimeoutValue { + return strconv.FormatInt(d, 10) + "S" + } + if d := div(t, time.Minute); d <= maxTimeoutValue { + return strconv.FormatInt(d, 10) + "M" + } + // Note that maxTimeoutValue * time.Hour > MaxInt64. + return strconv.FormatInt(div(t, time.Hour), 10) + "H" +} + +func decodeTimeout(s string) (time.Duration, error) { + size := len(s) + if size < 2 { + return 0, fmt.Errorf("transport: timeout string is too short: %q", s) + } + unit := timeoutUnit(s[size-1]) + d, ok := timeoutUnitToDuration(unit) + if !ok { + return 0, fmt.Errorf("transport: timeout unit is not recognized: %q", s) + } + t, err := strconv.ParseInt(s[:size-1], 10, 64) + if err != nil { + return 0, err + } + return d * time.Duration(t), nil +} + +const ( + spaceByte = ' ' + tildaByte = '~' + percentByte = '%' +) + +// encodeGrpcMessage is used to encode status code in header field +// "grpc-message". +// It checks to see if each individual byte in msg is an +// allowable byte, and then either percent encoding or passing it through. +// When percent encoding, the byte is converted into hexadecimal notation +// with a '%' prepended. +func encodeGrpcMessage(msg string) string { + if msg == "" { + return "" + } + lenMsg := len(msg) + for i := 0; i < lenMsg; i++ { + c := msg[i] + if !(c >= spaceByte && c < tildaByte && c != percentByte) { + return encodeGrpcMessageUnchecked(msg) + } + } + return msg +} + +func encodeGrpcMessageUnchecked(msg string) string { + var buf bytes.Buffer + lenMsg := len(msg) + for i := 0; i < lenMsg; i++ { + c := msg[i] + if c >= spaceByte && c < tildaByte && c != percentByte { + buf.WriteByte(c) + } else { + buf.WriteString(fmt.Sprintf("%%%02X", c)) + } + } + return buf.String() +} + +// decodeGrpcMessage decodes the msg encoded by encodeGrpcMessage. +func decodeGrpcMessage(msg string) string { + if msg == "" { + return "" + } + lenMsg := len(msg) + for i := 0; i < lenMsg; i++ { + if msg[i] == percentByte && i+2 < lenMsg { + return decodeGrpcMessageUnchecked(msg) + } + } + return msg +} + +func decodeGrpcMessageUnchecked(msg string) string { + var buf bytes.Buffer + lenMsg := len(msg) + for i := 0; i < lenMsg; i++ { + c := msg[i] + if c == percentByte && i+2 < lenMsg { + parsed, err := strconv.ParseUint(msg[i+1:i+3], 16, 8) + if err != nil { + buf.WriteByte(c) + } else { + buf.WriteByte(byte(parsed)) + i += 2 + } + } else { + buf.WriteByte(c) + } + } + return buf.String() +} + +type framer struct { + numWriters int32 + reader io.Reader + writer *bufio.Writer + fr *http2.Framer +} + +func newFramer(conn net.Conn, writeBufferSize, readBufferSize int) *framer { + f := &framer{ + reader: bufio.NewReaderSize(conn, readBufferSize), + writer: bufio.NewWriterSize(conn, writeBufferSize), + } + f.fr = http2.NewFramer(f.writer, f.reader) + // Opt-in to Frame reuse API on framer to reduce garbage. + // Frames aren't safe to read from after a subsequent call to ReadFrame. + f.fr.SetReuseFrames() + f.fr.ReadMetaHeaders = hpack.NewDecoder(http2InitHeaderTableSize, nil) + return f +} diff --git a/vendor/google.golang.org/grpc/transport/http_util_test.go b/vendor/google.golang.org/grpc/transport/http_util_test.go new file mode 100644 index 0000000000..4ebb239050 --- /dev/null +++ b/vendor/google.golang.org/grpc/transport/http_util_test.go @@ -0,0 +1,175 @@ +/* + * + * Copyright 2014 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. + * + */ + +package transport + +import ( + "fmt" + "reflect" + "testing" + "time" +) + +func TestTimeoutEncode(t *testing.T) { + for _, test := range []struct { + in string + out string + }{ + {"12345678ns", "12345678n"}, + {"123456789ns", "123457u"}, + {"12345678us", "12345678u"}, + {"123456789us", "123457m"}, + {"12345678ms", "12345678m"}, + {"123456789ms", "123457S"}, + {"12345678s", "12345678S"}, + {"123456789s", "2057614M"}, + {"12345678m", "12345678M"}, + {"123456789m", "2057614H"}, + } { + d, err := time.ParseDuration(test.in) + if err != nil { + t.Fatalf("failed to parse duration string %s: %v", test.in, err) + } + out := encodeTimeout(d) + if out != test.out { + t.Fatalf("timeoutEncode(%s) = %s, want %s", test.in, out, test.out) + } + } +} + +func TestTimeoutDecode(t *testing.T) { + for _, test := range []struct { + // input + s string + // output + d time.Duration + err error + }{ + {"1234S", time.Second * 1234, nil}, + {"1234x", 0, fmt.Errorf("transport: timeout unit is not recognized: %q", "1234x")}, + {"1", 0, fmt.Errorf("transport: timeout string is too short: %q", "1")}, + {"", 0, fmt.Errorf("transport: timeout string is too short: %q", "")}, + } { + d, err := decodeTimeout(test.s) + if d != test.d || fmt.Sprint(err) != fmt.Sprint(test.err) { + t.Fatalf("timeoutDecode(%q) = %d, %v, want %d, %v", test.s, int64(d), err, int64(test.d), test.err) + } + } +} + +func TestValidContentType(t *testing.T) { + tests := []struct { + h string + want bool + }{ + {"application/grpc", true}, + {"application/grpc+", true}, + {"application/grpc+blah", true}, + {"application/grpc;", true}, + {"application/grpc;blah", true}, + {"application/grpcd", false}, + {"application/grpd", false}, + {"application/grp", false}, + } + for _, tt := range tests { + got := validContentType(tt.h) + if got != tt.want { + t.Errorf("validContentType(%q) = %v; want %v", tt.h, got, tt.want) + } + } +} + +func TestEncodeGrpcMessage(t *testing.T) { + for _, tt := range []struct { + input string + expected string + }{ + {"", ""}, + {"Hello", "Hello"}, + {"my favorite character is \u0000", "my favorite character is %00"}, + {"my favorite character is %", "my favorite character is %25"}, + } { + actual := encodeGrpcMessage(tt.input) + if tt.expected != actual { + t.Errorf("encodeGrpcMessage(%v) = %v, want %v", tt.input, actual, tt.expected) + } + } +} + +func TestDecodeGrpcMessage(t *testing.T) { + for _, tt := range []struct { + input string + expected string + }{ + {"", ""}, + {"Hello", "Hello"}, + {"H%61o", "Hao"}, + {"H%6", "H%6"}, + {"%G0", "%G0"}, + {"%E7%B3%BB%E7%BB%9F", "系统"}, + } { + actual := decodeGrpcMessage(tt.input) + if tt.expected != actual { + t.Errorf("dncodeGrpcMessage(%v) = %v, want %v", tt.input, actual, tt.expected) + } + } +} + +const binaryValue = string(128) + +func TestEncodeMetadataHeader(t *testing.T) { + for _, test := range []struct { + // input + kin string + vin string + // output + vout string + }{ + {"key", "abc", "abc"}, + {"KEY", "abc", "abc"}, + {"key-bin", "abc", "YWJj"}, + {"key-bin", binaryValue, "woA"}, + } { + v := encodeMetadataHeader(test.kin, test.vin) + if !reflect.DeepEqual(v, test.vout) { + t.Fatalf("encodeMetadataHeader(%q, %q) = %q, want %q", test.kin, test.vin, v, test.vout) + } + } +} + +func TestDecodeMetadataHeader(t *testing.T) { + for _, test := range []struct { + // input + kin string + vin string + // output + vout string + err error + }{ + {"a", "abc", "abc", nil}, + {"key-bin", "Zm9vAGJhcg==", "foo\x00bar", nil}, + {"key-bin", "Zm9vAGJhcg", "foo\x00bar", nil}, + {"key-bin", "woA=", binaryValue, nil}, + {"a", "abc,efg", "abc,efg", nil}, + } { + v, err := decodeMetadataHeader(test.kin, test.vin) + if !reflect.DeepEqual(v, test.vout) || !reflect.DeepEqual(err, test.err) { + t.Fatalf("decodeMetadataHeader(%q, %q) = %q, %v, want %q, %v", test.kin, test.vin, v, err, test.vout, test.err) + } + } +} diff --git a/vendor/google.golang.org/grpc/transport/log.go b/vendor/google.golang.org/grpc/transport/log.go new file mode 100644 index 0000000000..ac8e358c5c --- /dev/null +++ b/vendor/google.golang.org/grpc/transport/log.go @@ -0,0 +1,50 @@ +/* + * + * Copyright 2017 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. + * + */ + +// This file contains wrappers for grpclog functions. +// The transport package only logs to verbose level 2 by default. + +package transport + +import "google.golang.org/grpc/grpclog" + +const logLevel = 2 + +func infof(format string, args ...interface{}) { + if grpclog.V(logLevel) { + grpclog.Infof(format, args...) + } +} + +func warningf(format string, args ...interface{}) { + if grpclog.V(logLevel) { + grpclog.Warningf(format, args...) + } +} + +func errorf(format string, args ...interface{}) { + if grpclog.V(logLevel) { + grpclog.Errorf(format, args...) + } +} + +func fatalf(format string, args ...interface{}) { + if grpclog.V(logLevel) { + grpclog.Fatalf(format, args...) + } +} diff --git a/vendor/google.golang.org/grpc/transport/transport.go b/vendor/google.golang.org/grpc/transport/transport.go new file mode 100644 index 0000000000..b7a5dbe420 --- /dev/null +++ b/vendor/google.golang.org/grpc/transport/transport.go @@ -0,0 +1,749 @@ +/* + * + * Copyright 2014 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. + * + */ + +// Package transport defines and implements message oriented communication +// channel to complete various transactions (e.g., an RPC). It is meant for +// grpc-internal usage and is not intended to be imported directly by users. +package transport // import "google.golang.org/grpc/transport" + +import ( + "fmt" + "io" + "net" + "sync" + "time" + + "golang.org/x/net/context" + "golang.org/x/net/http2" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/keepalive" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/stats" + "google.golang.org/grpc/status" + "google.golang.org/grpc/tap" +) + +// recvMsg represents the received msg from the transport. All transport +// protocol specific info has been removed. +type recvMsg struct { + data []byte + // nil: received some data + // io.EOF: stream is completed. data is nil. + // other non-nil error: transport failure. data is nil. + err error +} + +// recvBuffer is an unbounded channel of recvMsg structs. +// Note recvBuffer differs from controlBuffer only in that recvBuffer +// holds a channel of only recvMsg structs instead of objects implementing "item" interface. +// recvBuffer is written to much more often than +// controlBuffer and using strict recvMsg structs helps avoid allocation in "recvBuffer.put" +type recvBuffer struct { + c chan recvMsg + mu sync.Mutex + backlog []recvMsg +} + +func newRecvBuffer() *recvBuffer { + b := &recvBuffer{ + c: make(chan recvMsg, 1), + } + return b +} + +func (b *recvBuffer) put(r recvMsg) { + b.mu.Lock() + if len(b.backlog) == 0 { + select { + case b.c <- r: + b.mu.Unlock() + return + default: + } + } + b.backlog = append(b.backlog, r) + b.mu.Unlock() +} + +func (b *recvBuffer) load() { + b.mu.Lock() + if len(b.backlog) > 0 { + select { + case b.c <- b.backlog[0]: + b.backlog[0] = recvMsg{} + b.backlog = b.backlog[1:] + default: + } + } + b.mu.Unlock() +} + +// get returns the channel that receives a recvMsg in the buffer. +// +// Upon receipt of a recvMsg, the caller should call load to send another +// recvMsg onto the channel if there is any. +func (b *recvBuffer) get() <-chan recvMsg { + return b.c +} + +// recvBufferReader implements io.Reader interface to read the data from +// recvBuffer. +type recvBufferReader struct { + ctx context.Context + goAway chan struct{} + recv *recvBuffer + last []byte // Stores the remaining data in the previous calls. + err error +} + +// Read reads the next len(p) bytes from last. If last is drained, it tries to +// read additional data from recv. It blocks if there no additional data available +// in recv. If Read returns any non-nil error, it will continue to return that error. +func (r *recvBufferReader) Read(p []byte) (n int, err error) { + if r.err != nil { + return 0, r.err + } + n, r.err = r.read(p) + return n, r.err +} + +func (r *recvBufferReader) read(p []byte) (n int, err error) { + if r.last != nil && len(r.last) > 0 { + // Read remaining data left in last call. + copied := copy(p, r.last) + r.last = r.last[copied:] + return copied, nil + } + select { + case <-r.ctx.Done(): + return 0, ContextErr(r.ctx.Err()) + case <-r.goAway: + return 0, errStreamDrain + case m := <-r.recv.get(): + r.recv.load() + if m.err != nil { + return 0, m.err + } + copied := copy(p, m.data) + r.last = m.data[copied:] + return copied, nil + } +} + +// All items in an out of a controlBuffer should be the same type. +type item interface { + item() +} + +// controlBuffer is an unbounded channel of item. +type controlBuffer struct { + c chan item + mu sync.Mutex + backlog []item +} + +func newControlBuffer() *controlBuffer { + b := &controlBuffer{ + c: make(chan item, 1), + } + return b +} + +func (b *controlBuffer) put(r item) { + b.mu.Lock() + if len(b.backlog) == 0 { + select { + case b.c <- r: + b.mu.Unlock() + return + default: + } + } + b.backlog = append(b.backlog, r) + b.mu.Unlock() +} + +func (b *controlBuffer) load() { + b.mu.Lock() + if len(b.backlog) > 0 { + select { + case b.c <- b.backlog[0]: + b.backlog[0] = nil + b.backlog = b.backlog[1:] + default: + } + } + b.mu.Unlock() +} + +// get returns the channel that receives an item in the buffer. +// +// Upon receipt of an item, the caller should call load to send another +// item onto the channel if there is any. +func (b *controlBuffer) get() <-chan item { + return b.c +} + +type streamState uint8 + +const ( + streamActive streamState = iota + streamWriteDone // EndStream sent + streamReadDone // EndStream received + streamDone // the entire stream is finished. +) + +// Stream represents an RPC in the transport layer. +type Stream struct { + id uint32 + st ServerTransport // nil for client side Stream + ctx context.Context // the associated context of the stream + cancel context.CancelFunc // always nil for client side Stream + done chan struct{} // closed when the final status arrives + goAway chan struct{} // closed when a GOAWAY control message is received + method string // the associated RPC method of the stream + recvCompress string + sendCompress string + buf *recvBuffer + trReader io.Reader + fc *inFlow + recvQuota uint32 + waiters waiters + + // Callback to state application's intentions to read data. This + // is used to adjust flow control, if needed. + requestRead func(int) + + sendQuotaPool *quotaPool + headerChan chan struct{} // closed to indicate the end of header metadata. + headerDone bool // set when headerChan is closed. Used to avoid closing headerChan multiple times. + header metadata.MD // the received header metadata. + trailer metadata.MD // the key-value map of trailer metadata. + + mu sync.RWMutex // guard the following + headerOk bool // becomes true from the first header is about to send + state streamState + + status *status.Status // the status error received from the server + + rstStream bool // indicates whether a RST_STREAM frame needs to be sent + rstError http2.ErrCode // the error that needs to be sent along with the RST_STREAM frame + + bytesReceived bool // indicates whether any bytes have been received on this stream + unprocessed bool // set if the server sends a refused stream or GOAWAY including this stream +} + +// RecvCompress returns the compression algorithm applied to the inbound +// message. It is empty string if there is no compression applied. +func (s *Stream) RecvCompress() string { + if s.headerChan != nil { + <-s.headerChan + } + return s.recvCompress +} + +// SetSendCompress sets the compression algorithm to the stream. +func (s *Stream) SetSendCompress(str string) { + s.sendCompress = str +} + +// Done returns a chanel which is closed when it receives the final status +// from the server. +func (s *Stream) Done() <-chan struct{} { + return s.done +} + +// GoAway returns a channel which is closed when the server sent GoAways signal +// before this stream was initiated. +func (s *Stream) GoAway() <-chan struct{} { + return s.goAway +} + +// Header acquires the key-value pairs of header metadata once it +// is available. It blocks until i) the metadata is ready or ii) there is no +// header metadata or iii) the stream is canceled/expired. +func (s *Stream) Header() (metadata.MD, error) { + var err error + select { + case <-s.ctx.Done(): + err = ContextErr(s.ctx.Err()) + case <-s.goAway: + err = errStreamDrain + case <-s.headerChan: + return s.header.Copy(), nil + } + // Even if the stream is closed, header is returned if available. + select { + case <-s.headerChan: + return s.header.Copy(), nil + default: + } + return nil, err +} + +// Trailer returns the cached trailer metedata. Note that if it is not called +// after the entire stream is done, it could return an empty MD. Client +// side only. +func (s *Stream) Trailer() metadata.MD { + s.mu.RLock() + c := s.trailer.Copy() + s.mu.RUnlock() + return c +} + +// ServerTransport returns the underlying ServerTransport for the stream. +// The client side stream always returns nil. +func (s *Stream) ServerTransport() ServerTransport { + return s.st +} + +// Context returns the context of the stream. +func (s *Stream) Context() context.Context { + return s.ctx +} + +// Method returns the method for the stream. +func (s *Stream) Method() string { + return s.method +} + +// Status returns the status received from the server. +func (s *Stream) Status() *status.Status { + return s.status +} + +// SetHeader sets the header metadata. This can be called multiple times. +// Server side only. +func (s *Stream) SetHeader(md metadata.MD) error { + s.mu.Lock() + if s.headerOk || s.state == streamDone { + s.mu.Unlock() + return ErrIllegalHeaderWrite + } + if md.Len() == 0 { + s.mu.Unlock() + return nil + } + s.header = metadata.Join(s.header, md) + s.mu.Unlock() + return nil +} + +// SetTrailer sets the trailer metadata which will be sent with the RPC status +// by the server. This can be called multiple times. Server side only. +func (s *Stream) SetTrailer(md metadata.MD) error { + if md.Len() == 0 { + return nil + } + s.mu.Lock() + s.trailer = metadata.Join(s.trailer, md) + s.mu.Unlock() + return nil +} + +func (s *Stream) write(m recvMsg) { + s.buf.put(m) +} + +// Read reads all p bytes from the wire for this stream. +func (s *Stream) Read(p []byte) (n int, err error) { + // Don't request a read if there was an error earlier + if er := s.trReader.(*transportReader).er; er != nil { + return 0, er + } + s.requestRead(len(p)) + return io.ReadFull(s.trReader, p) +} + +// tranportReader reads all the data available for this Stream from the transport and +// passes them into the decoder, which converts them into a gRPC message stream. +// The error is io.EOF when the stream is done or another non-nil error if +// the stream broke. +type transportReader struct { + reader io.Reader + // The handler to control the window update procedure for both this + // particular stream and the associated transport. + windowHandler func(int) + er error +} + +func (t *transportReader) Read(p []byte) (n int, err error) { + n, err = t.reader.Read(p) + if err != nil { + t.er = err + return + } + t.windowHandler(n) + return +} + +// finish sets the stream's state and status, and closes the done channel. +// s.mu must be held by the caller. st must always be non-nil. +func (s *Stream) finish(st *status.Status) { + s.status = st + s.state = streamDone + close(s.done) +} + +// BytesReceived indicates whether any bytes have been received on this stream. +func (s *Stream) BytesReceived() bool { + s.mu.Lock() + br := s.bytesReceived + s.mu.Unlock() + return br +} + +// Unprocessed indicates whether the server did not process this stream -- +// i.e. it sent a refused stream or GOAWAY including this stream ID. +func (s *Stream) Unprocessed() bool { + s.mu.Lock() + br := s.unprocessed + s.mu.Unlock() + return br +} + +// GoString is implemented by Stream so context.String() won't +// race when printing %#v. +func (s *Stream) GoString() string { + return fmt.Sprintf("", s, s.method) +} + +// The key to save transport.Stream in the context. +type streamKey struct{} + +// newContextWithStream creates a new context from ctx and attaches stream +// to it. +func newContextWithStream(ctx context.Context, stream *Stream) context.Context { + return context.WithValue(ctx, streamKey{}, stream) +} + +// StreamFromContext returns the stream saved in ctx. +func StreamFromContext(ctx context.Context) (s *Stream, ok bool) { + s, ok = ctx.Value(streamKey{}).(*Stream) + return +} + +// state of transport +type transportState int + +const ( + reachable transportState = iota + closing + draining +) + +// ServerConfig consists of all the configurations to establish a server transport. +type ServerConfig struct { + MaxStreams uint32 + AuthInfo credentials.AuthInfo + InTapHandle tap.ServerInHandle + StatsHandler stats.Handler + KeepaliveParams keepalive.ServerParameters + KeepalivePolicy keepalive.EnforcementPolicy + InitialWindowSize int32 + InitialConnWindowSize int32 + WriteBufferSize int + ReadBufferSize int +} + +// NewServerTransport creates a ServerTransport with conn or non-nil error +// if it fails. +func NewServerTransport(protocol string, conn net.Conn, config *ServerConfig) (ServerTransport, error) { + return newHTTP2Server(conn, config) +} + +// ConnectOptions covers all relevant options for communicating with the server. +type ConnectOptions struct { + // UserAgent is the application user agent. + UserAgent string + // Authority is the :authority pseudo-header to use. This field has no effect if + // TransportCredentials is set. + Authority string + // Dialer specifies how to dial a network address. + Dialer func(context.Context, string) (net.Conn, error) + // FailOnNonTempDialError specifies if gRPC fails on non-temporary dial errors. + FailOnNonTempDialError bool + // PerRPCCredentials stores the PerRPCCredentials required to issue RPCs. + PerRPCCredentials []credentials.PerRPCCredentials + // TransportCredentials stores the Authenticator required to setup a client connection. + TransportCredentials credentials.TransportCredentials + // KeepaliveParams stores the keepalive parameters. + KeepaliveParams keepalive.ClientParameters + // StatsHandler stores the handler for stats. + StatsHandler stats.Handler + // InitialWindowSize sets the initial window size for a stream. + InitialWindowSize int32 + // InitialConnWindowSize sets the initial window size for a connection. + InitialConnWindowSize int32 + // WriteBufferSize sets the size of write buffer which in turn determines how much data can be batched before it's written on the wire. + WriteBufferSize int + // ReadBufferSize sets the size of read buffer, which in turn determines how much data can be read at most for one read syscall. + ReadBufferSize int +} + +// TargetInfo contains the information of the target such as network address and metadata. +type TargetInfo struct { + Addr string + Metadata interface{} + Authority string +} + +// NewClientTransport establishes the transport with the required ConnectOptions +// and returns it to the caller. +func NewClientTransport(ctx context.Context, target TargetInfo, opts ConnectOptions, timeout time.Duration) (ClientTransport, error) { + return newHTTP2Client(ctx, target, opts, timeout) +} + +// Options provides additional hints and information for message +// transmission. +type Options struct { + // Last indicates whether this write is the last piece for + // this stream. + Last bool + + // Delay is a hint to the transport implementation for whether + // the data could be buffered for a batching write. The + // transport implementation may ignore the hint. + Delay bool +} + +// CallHdr carries the information of a particular RPC. +type CallHdr struct { + // Host specifies the peer's host. + Host string + + // Method specifies the operation to perform. + Method string + + // SendCompress specifies the compression algorithm applied on + // outbound message. + SendCompress string + + // Creds specifies credentials.PerRPCCredentials for a call. + Creds credentials.PerRPCCredentials + + // Flush indicates whether a new stream command should be sent + // to the peer without waiting for the first data. This is + // only a hint. + // If it's true, the transport may modify the flush decision + // for performance purposes. + // If it's false, new stream will never be flushed. + Flush bool +} + +// ClientTransport is the common interface for all gRPC client-side transport +// implementations. +type ClientTransport interface { + // Close tears down this transport. Once it returns, the transport + // should not be accessed any more. The caller must make sure this + // is called only once. + Close() error + + // GracefulClose starts to tear down the transport. It stops accepting + // new RPCs and wait the completion of the pending RPCs. + GracefulClose() error + + // Write sends the data for the given stream. A nil stream indicates + // the write is to be performed on the transport as a whole. + Write(s *Stream, hdr []byte, data []byte, opts *Options) error + + // NewStream creates a Stream for an RPC. + NewStream(ctx context.Context, callHdr *CallHdr) (*Stream, error) + + // CloseStream clears the footprint of a stream when the stream is + // not needed any more. The err indicates the error incurred when + // CloseStream is called. Must be called when a stream is finished + // unless the associated transport is closing. + CloseStream(stream *Stream, err error) + + // Error returns a channel that is closed when some I/O error + // happens. Typically the caller should have a goroutine to monitor + // this in order to take action (e.g., close the current transport + // and create a new one) in error case. It should not return nil + // once the transport is initiated. + Error() <-chan struct{} + + // GoAway returns a channel that is closed when ClientTransport + // receives the draining signal from the server (e.g., GOAWAY frame in + // HTTP/2). + GoAway() <-chan struct{} + + // GetGoAwayReason returns the reason why GoAway frame was received. + GetGoAwayReason() GoAwayReason +} + +// ServerTransport is the common interface for all gRPC server-side transport +// implementations. +// +// Methods may be called concurrently from multiple goroutines, but +// Write methods for a given Stream will be called serially. +type ServerTransport interface { + // HandleStreams receives incoming streams using the given handler. + HandleStreams(func(*Stream), func(context.Context, string) context.Context) + + // WriteHeader sends the header metadata for the given stream. + // WriteHeader may not be called on all streams. + WriteHeader(s *Stream, md metadata.MD) error + + // Write sends the data for the given stream. + // Write may not be called on all streams. + Write(s *Stream, hdr []byte, data []byte, opts *Options) error + + // WriteStatus sends the status of a stream to the client. WriteStatus is + // the final call made on a stream and always occurs. + WriteStatus(s *Stream, st *status.Status) error + + // Close tears down the transport. Once it is called, the transport + // should not be accessed any more. All the pending streams and their + // handlers will be terminated asynchronously. + Close() error + + // RemoteAddr returns the remote network address. + RemoteAddr() net.Addr + + // Drain notifies the client this ServerTransport stops accepting new RPCs. + Drain() +} + +// streamErrorf creates an StreamError with the specified error code and description. +func streamErrorf(c codes.Code, format string, a ...interface{}) StreamError { + return StreamError{ + Code: c, + Desc: fmt.Sprintf(format, a...), + } +} + +// connectionErrorf creates an ConnectionError with the specified error description. +func connectionErrorf(temp bool, e error, format string, a ...interface{}) ConnectionError { + return ConnectionError{ + Desc: fmt.Sprintf(format, a...), + temp: temp, + err: e, + } +} + +// ConnectionError is an error that results in the termination of the +// entire connection and the retry of all the active streams. +type ConnectionError struct { + Desc string + temp bool + err error +} + +func (e ConnectionError) Error() string { + return fmt.Sprintf("connection error: desc = %q", e.Desc) +} + +// Temporary indicates if this connection error is temporary or fatal. +func (e ConnectionError) Temporary() bool { + return e.temp +} + +// Origin returns the original error of this connection error. +func (e ConnectionError) Origin() error { + // Never return nil error here. + // If the original error is nil, return itself. + if e.err == nil { + return e + } + return e.err +} + +var ( + // ErrConnClosing indicates that the transport is closing. + ErrConnClosing = connectionErrorf(true, nil, "transport is closing") + // errStreamDrain indicates that the stream is rejected by the server because + // the server stops accepting new RPCs. + // TODO: delete this error; it is no longer necessary. + errStreamDrain = streamErrorf(codes.Unavailable, "the server stops accepting new RPCs") + // StatusGoAway indicates that the server sent a GOAWAY that included this + // stream's ID in unprocessed RPCs. + statusGoAway = status.New(codes.Unavailable, "the server stopped accepting new RPCs") +) + +// TODO: See if we can replace StreamError with status package errors. + +// StreamError is an error that only affects one stream within a connection. +type StreamError struct { + Code codes.Code + Desc string +} + +func (e StreamError) Error() string { + return fmt.Sprintf("stream error: code = %s desc = %q", e.Code, e.Desc) +} + +// waiters are passed to quotaPool get methods to +// wait on in addition to waiting on quota. +type waiters struct { + ctx context.Context + tctx context.Context + done chan struct{} + goAway chan struct{} +} + +// GoAwayReason contains the reason for the GoAway frame received. +type GoAwayReason uint8 + +const ( + // GoAwayInvalid indicates that no GoAway frame is received. + GoAwayInvalid GoAwayReason = 0 + // GoAwayNoReason is the default value when GoAway frame is received. + GoAwayNoReason GoAwayReason = 1 + // GoAwayTooManyPings indicates that a GoAway frame with + // ErrCodeEnhanceYourCalm was received and that the debug data said + // "too_many_pings". + GoAwayTooManyPings GoAwayReason = 2 +) + +// loopyWriter is run in a separate go routine. It is the single code path that will +// write data on wire. +func loopyWriter(ctx context.Context, cbuf *controlBuffer, handler func(item) error) { + for { + select { + case i := <-cbuf.get(): + cbuf.load() + if err := handler(i); err != nil { + errorf("transport: Error while handling item. Err: %v", err) + return + } + case <-ctx.Done(): + return + } + hasData: + for { + select { + case i := <-cbuf.get(): + cbuf.load() + if err := handler(i); err != nil { + errorf("transport: Error while handling item. Err: %v", err) + return + } + case <-ctx.Done(): + return + default: + if err := handler(&flushIO{}); err != nil { + errorf("transport: Error while flushing. Err: %v", err) + return + } + break hasData + } + } + } +} diff --git a/vendor/google.golang.org/grpc/transport/transport_test.go b/vendor/google.golang.org/grpc/transport/transport_test.go new file mode 100644 index 0000000000..3e29c91795 --- /dev/null +++ b/vendor/google.golang.org/grpc/transport/transport_test.go @@ -0,0 +1,2264 @@ +/* + * + * Copyright 2014 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. + * + */ + +package transport + +import ( + "bufio" + "bytes" + "encoding/binary" + "errors" + "fmt" + "io" + "math" + "net" + "net/http" + "reflect" + "strconv" + "strings" + "sync" + "testing" + "time" + + "golang.org/x/net/context" + "golang.org/x/net/http2" + "golang.org/x/net/http2/hpack" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/keepalive" + "google.golang.org/grpc/status" +) + +type server struct { + lis net.Listener + port string + startedErr chan error // error (or nil) with server start value + mu sync.Mutex + conns map[ServerTransport]bool + h *testStreamHandler +} + +var ( + expectedRequest = []byte("ping") + expectedResponse = []byte("pong") + expectedRequestLarge = make([]byte, initialWindowSize*2) + expectedResponseLarge = make([]byte, initialWindowSize*2) + expectedInvalidHeaderField = "invalid/content-type" +) + +type testStreamHandler struct { + t *http2Server + notify chan struct{} +} + +type hType int + +const ( + normal hType = iota + suspended + notifyCall + misbehaved + encodingRequiredStatus + invalidHeaderField + delayRead + delayWrite + pingpong +) + +func (h *testStreamHandler) handleStreamAndNotify(s *Stream) { + if h.notify == nil { + return + } + go func() { + select { + case <-h.notify: + default: + close(h.notify) + } + }() +} + +func (h *testStreamHandler) handleStream(t *testing.T, s *Stream) { + req := expectedRequest + resp := expectedResponse + if s.Method() == "foo.Large" { + req = expectedRequestLarge + resp = expectedResponseLarge + } + p := make([]byte, len(req)) + _, err := s.Read(p) + if err != nil { + return + } + if !bytes.Equal(p, req) { + t.Fatalf("handleStream got %v, want %v", p, req) + } + // send a response back to the client. + h.t.Write(s, nil, resp, &Options{}) + // send the trailer to end the stream. + h.t.WriteStatus(s, status.New(codes.OK, "")) +} + +func (h *testStreamHandler) handleStreamPingPong(t *testing.T, s *Stream) { + header := make([]byte, 5) + for { + if _, err := s.Read(header); err != nil { + if err == io.EOF { + h.t.WriteStatus(s, status.New(codes.OK, "")) + return + } + t.Fatalf("Error on server while reading data header: %v", err) + } + sz := binary.BigEndian.Uint32(header[1:]) + msg := make([]byte, int(sz)) + if _, err := s.Read(msg); err != nil { + t.Fatalf("Error on server while reading message: %v", err) + } + buf := make([]byte, sz+5) + buf[0] = byte(0) + binary.BigEndian.PutUint32(buf[1:], uint32(sz)) + copy(buf[5:], msg) + h.t.Write(s, nil, buf, &Options{}) + } +} + +func (h *testStreamHandler) handleStreamMisbehave(t *testing.T, s *Stream) { + conn, ok := s.ServerTransport().(*http2Server) + if !ok { + t.Fatalf("Failed to convert %v to *http2Server", s.ServerTransport()) + } + var sent int + p := make([]byte, http2MaxFrameLen) + for sent < initialWindowSize { + n := initialWindowSize - sent + // The last message may be smaller than http2MaxFrameLen + if n <= http2MaxFrameLen { + if s.Method() == "foo.Connection" { + // Violate connection level flow control window of client but do not + // violate any stream level windows. + p = make([]byte, n) + } else { + // Violate stream level flow control window of client. + p = make([]byte, n+1) + } + } + conn.controlBuf.put(&dataFrame{s.id, false, p, func() {}}) + sent += len(p) + } +} + +func (h *testStreamHandler) handleStreamEncodingRequiredStatus(t *testing.T, s *Stream) { + // raw newline is not accepted by http2 framer so it must be encoded. + h.t.WriteStatus(s, encodingTestStatus) +} + +func (h *testStreamHandler) handleStreamInvalidHeaderField(t *testing.T, s *Stream) { + headerFields := []hpack.HeaderField{} + headerFields = append(headerFields, hpack.HeaderField{Name: "content-type", Value: expectedInvalidHeaderField}) + h.t.controlBuf.put(&headerFrame{ + streamID: s.id, + hf: headerFields, + endStream: false, + }) +} + +func (h *testStreamHandler) handleStreamDelayRead(t *testing.T, s *Stream) { + req := expectedRequest + resp := expectedResponse + if s.Method() == "foo.Large" { + req = expectedRequestLarge + resp = expectedResponseLarge + } + p := make([]byte, len(req)) + + // Wait before reading. Give time to client to start sending + // before server starts reading. + time.Sleep(2 * time.Second) + _, err := s.Read(p) + if err != nil { + t.Fatalf("s.Read(_) = _, %v, want _, ", err) + return + } + + if !bytes.Equal(p, req) { + t.Fatalf("handleStream got %v, want %v", p, req) + } + // send a response back to the client. + h.t.Write(s, nil, resp, &Options{}) + // send the trailer to end the stream. + h.t.WriteStatus(s, status.New(codes.OK, "")) +} + +func (h *testStreamHandler) handleStreamDelayWrite(t *testing.T, s *Stream) { + req := expectedRequest + resp := expectedResponse + if s.Method() == "foo.Large" { + req = expectedRequestLarge + resp = expectedResponseLarge + } + p := make([]byte, len(req)) + _, err := s.Read(p) + if err != nil { + t.Fatalf("s.Read(_) = _, %v, want _, ", err) + return + } + if !bytes.Equal(p, req) { + t.Fatalf("handleStream got %v, want %v", p, req) + } + + // Wait before sending. Give time to client to start reading + // before server starts sending. + time.Sleep(2 * time.Second) + h.t.Write(s, nil, resp, &Options{}) + // send the trailer to end the stream. + h.t.WriteStatus(s, status.New(codes.OK, "")) +} + +// start starts server. Other goroutines should block on s.readyChan for further operations. +func (s *server) start(t *testing.T, port int, serverConfig *ServerConfig, ht hType) { + var err error + if port == 0 { + s.lis, err = net.Listen("tcp", "localhost:0") + } else { + s.lis, err = net.Listen("tcp", "localhost:"+strconv.Itoa(port)) + } + if err != nil { + s.startedErr <- fmt.Errorf("failed to listen: %v", err) + return + } + _, p, err := net.SplitHostPort(s.lis.Addr().String()) + if err != nil { + s.startedErr <- fmt.Errorf("failed to parse listener address: %v", err) + return + } + s.port = p + s.conns = make(map[ServerTransport]bool) + s.startedErr <- nil + for { + conn, err := s.lis.Accept() + if err != nil { + return + } + transport, err := NewServerTransport("http2", conn, serverConfig) + if err != nil { + return + } + s.mu.Lock() + if s.conns == nil { + s.mu.Unlock() + transport.Close() + return + } + s.conns[transport] = true + h := &testStreamHandler{t: transport.(*http2Server)} + s.h = h + s.mu.Unlock() + switch ht { + case notifyCall: + go transport.HandleStreams(h.handleStreamAndNotify, + func(ctx context.Context, _ string) context.Context { + return ctx + }) + case suspended: + go transport.HandleStreams(func(*Stream) {}, // Do nothing to handle the stream. + func(ctx context.Context, method string) context.Context { + return ctx + }) + case misbehaved: + go transport.HandleStreams(func(s *Stream) { + go h.handleStreamMisbehave(t, s) + }, func(ctx context.Context, method string) context.Context { + return ctx + }) + case encodingRequiredStatus: + go transport.HandleStreams(func(s *Stream) { + go h.handleStreamEncodingRequiredStatus(t, s) + }, func(ctx context.Context, method string) context.Context { + return ctx + }) + case invalidHeaderField: + go transport.HandleStreams(func(s *Stream) { + go h.handleStreamInvalidHeaderField(t, s) + }, func(ctx context.Context, method string) context.Context { + return ctx + }) + case delayRead: + go transport.HandleStreams(func(s *Stream) { + go h.handleStreamDelayRead(t, s) + }, func(ctx context.Context, method string) context.Context { + return ctx + }) + case delayWrite: + go transport.HandleStreams(func(s *Stream) { + go h.handleStreamDelayWrite(t, s) + }, func(ctx context.Context, method string) context.Context { + return ctx + }) + case pingpong: + go transport.HandleStreams(func(s *Stream) { + go h.handleStreamPingPong(t, s) + }, func(ctx context.Context, method string) context.Context { + return ctx + }) + default: + go transport.HandleStreams(func(s *Stream) { + go h.handleStream(t, s) + }, func(ctx context.Context, method string) context.Context { + return ctx + }) + } + } +} + +func (s *server) wait(t *testing.T, timeout time.Duration) { + select { + case err := <-s.startedErr: + if err != nil { + t.Fatal(err) + } + case <-time.After(timeout): + t.Fatalf("Timed out after %v waiting for server to be ready", timeout) + } +} + +func (s *server) stop() { + s.lis.Close() + s.mu.Lock() + for c := range s.conns { + c.Close() + } + s.conns = nil + s.mu.Unlock() +} + +func setUp(t *testing.T, port int, maxStreams uint32, ht hType) (*server, ClientTransport) { + return setUpWithOptions(t, port, &ServerConfig{MaxStreams: maxStreams}, ht, ConnectOptions{}) +} + +func setUpWithOptions(t *testing.T, port int, serverConfig *ServerConfig, ht hType, copts ConnectOptions) (*server, ClientTransport) { + server := &server{startedErr: make(chan error, 1)} + go server.start(t, port, serverConfig, ht) + server.wait(t, 2*time.Second) + addr := "localhost:" + server.port + var ( + ct ClientTransport + connErr error + ) + target := TargetInfo{ + Addr: addr, + } + ct, connErr = NewClientTransport(context.Background(), target, copts, 2*time.Second) + if connErr != nil { + t.Fatalf("failed to create transport: %v", connErr) + } + return server, ct +} + +func setUpWithNoPingServer(t *testing.T, copts ConnectOptions, done chan net.Conn) ClientTransport { + lis, err := net.Listen("tcp", "localhost:0") + if err != nil { + t.Fatalf("Failed to listen: %v", err) + } + // Launch a non responsive server. + go func() { + defer lis.Close() + conn, err := lis.Accept() + if err != nil { + t.Errorf("Error at server-side while accepting: %v", err) + close(done) + return + } + done <- conn + }() + tr, err := NewClientTransport(context.Background(), TargetInfo{Addr: lis.Addr().String()}, copts, 2*time.Second) + if err != nil { + // Server clean-up. + lis.Close() + if conn, ok := <-done; ok { + conn.Close() + } + t.Fatalf("Failed to dial: %v", err) + } + return tr +} + +// TestInflightStreamClosing ensures that closing in-flight stream +// sends StreamError to concurrent stream reader. +func TestInflightStreamClosing(t *testing.T) { + serverConfig := &ServerConfig{} + server, client := setUpWithOptions(t, 0, serverConfig, suspended, ConnectOptions{}) + defer server.stop() + defer client.Close() + + stream, err := client.NewStream(context.Background(), &CallHdr{}) + if err != nil { + t.Fatalf("Client failed to create RPC request: %v", err) + } + + donec := make(chan struct{}) + serr := StreamError{Desc: "client connection is closing"} + go func() { + defer close(donec) + if _, err := stream.Read(make([]byte, defaultWindowSize)); err != serr { + t.Errorf("unexpected Stream error %v, expected %v", err, serr) + } + }() + + // should unblock concurrent stream.Read + client.CloseStream(stream, serr) + + // wait for stream.Read error + timeout := time.NewTimer(5 * time.Second) + select { + case <-donec: + if !timeout.Stop() { + <-timeout.C + } + case <-timeout.C: + t.Fatalf("Test timed out, expected a StreamError.") + } +} + +// TestMaxConnectionIdle tests that a server will send GoAway to a idle client. +// An idle client is one who doesn't make any RPC calls for a duration of +// MaxConnectionIdle time. +func TestMaxConnectionIdle(t *testing.T) { + serverConfig := &ServerConfig{ + KeepaliveParams: keepalive.ServerParameters{ + MaxConnectionIdle: 2 * time.Second, + }, + } + server, client := setUpWithOptions(t, 0, serverConfig, suspended, ConnectOptions{}) + defer server.stop() + defer client.Close() + stream, err := client.NewStream(context.Background(), &CallHdr{Flush: true}) + if err != nil { + t.Fatalf("Client failed to create RPC request: %v", err) + } + stream.mu.Lock() + stream.rstStream = true + stream.mu.Unlock() + client.CloseStream(stream, nil) + // wait for server to see that closed stream and max-age logic to send goaway after no new RPCs are mode + timeout := time.NewTimer(time.Second * 4) + select { + case <-client.GoAway(): + if !timeout.Stop() { + <-timeout.C + } + case <-timeout.C: + t.Fatalf("Test timed out, expected a GoAway from the server.") + } +} + +// TestMaxConenctionIdleNegative tests that a server will not send GoAway to a non-idle(busy) client. +func TestMaxConnectionIdleNegative(t *testing.T) { + serverConfig := &ServerConfig{ + KeepaliveParams: keepalive.ServerParameters{ + MaxConnectionIdle: 2 * time.Second, + }, + } + server, client := setUpWithOptions(t, 0, serverConfig, suspended, ConnectOptions{}) + defer server.stop() + defer client.Close() + _, err := client.NewStream(context.Background(), &CallHdr{Flush: true}) + if err != nil { + t.Fatalf("Client failed to create RPC request: %v", err) + } + timeout := time.NewTimer(time.Second * 4) + select { + case <-client.GoAway(): + if !timeout.Stop() { + <-timeout.C + } + t.Fatalf("A non-idle client received a GoAway.") + case <-timeout.C: + } + +} + +// TestMaxConnectionAge tests that a server will send GoAway after a duration of MaxConnectionAge. +func TestMaxConnectionAge(t *testing.T) { + serverConfig := &ServerConfig{ + KeepaliveParams: keepalive.ServerParameters{ + MaxConnectionAge: 2 * time.Second, + }, + } + server, client := setUpWithOptions(t, 0, serverConfig, suspended, ConnectOptions{}) + defer server.stop() + defer client.Close() + _, err := client.NewStream(context.Background(), &CallHdr{}) + if err != nil { + t.Fatalf("Client failed to create stream: %v", err) + } + // Wait for max-age logic to send GoAway. + timeout := time.NewTimer(4 * time.Second) + select { + case <-client.GoAway(): + if !timeout.Stop() { + <-timeout.C + } + case <-timeout.C: + t.Fatalf("Test timer out, expected a GoAway from the server.") + } +} + +// TestKeepaliveServer tests that a server closes connection with a client that doesn't respond to keepalive pings. +func TestKeepaliveServer(t *testing.T) { + serverConfig := &ServerConfig{ + KeepaliveParams: keepalive.ServerParameters{ + Time: 2 * time.Second, + Timeout: 1 * time.Second, + }, + } + server, c := setUpWithOptions(t, 0, serverConfig, suspended, ConnectOptions{}) + defer server.stop() + defer c.Close() + client, err := net.Dial("tcp", server.lis.Addr().String()) + if err != nil { + t.Fatalf("Failed to dial: %v", err) + } + defer client.Close() + + // Set read deadline on client conn so that it doesn't block forever in errorsome cases. + client.SetDeadline(time.Now().Add(10 * time.Second)) + + if n, err := client.Write(clientPreface); err != nil || n != len(clientPreface) { + t.Fatalf("Error writing client preface; n=%v, err=%v", n, err) + } + framer := newFramer(client, defaultWriteBufSize, defaultReadBufSize) + if err := framer.fr.WriteSettings(http2.Setting{}); err != nil { + t.Fatal("Error writing settings frame:", err) + } + framer.writer.Flush() + // Wait for keepalive logic to close the connection. + time.Sleep(4 * time.Second) + b := make([]byte, 24) + for { + _, err = client.Read(b) + if err == nil { + continue + } + if err != io.EOF { + t.Fatalf("client.Read(_) = _,%v, want io.EOF", err) + } + break + } +} + +// TestKeepaliveServerNegative tests that a server doesn't close connection with a client that responds to keepalive pings. +func TestKeepaliveServerNegative(t *testing.T) { + serverConfig := &ServerConfig{ + KeepaliveParams: keepalive.ServerParameters{ + Time: 2 * time.Second, + Timeout: 1 * time.Second, + }, + } + server, client := setUpWithOptions(t, 0, serverConfig, suspended, ConnectOptions{}) + defer server.stop() + defer client.Close() + // Give keepalive logic some time by sleeping. + time.Sleep(4 * time.Second) + // Assert that client is still active. + clientTr := client.(*http2Client) + clientTr.mu.Lock() + defer clientTr.mu.Unlock() + if clientTr.state != reachable { + t.Fatalf("Test failed: Expected server-client connection to be healthy.") + } +} + +func TestKeepaliveClientClosesIdleTransport(t *testing.T) { + done := make(chan net.Conn, 1) + tr := setUpWithNoPingServer(t, ConnectOptions{KeepaliveParams: keepalive.ClientParameters{ + Time: 2 * time.Second, // Keepalive time = 2 sec. + Timeout: 1 * time.Second, // Keepalive timeout = 1 sec. + PermitWithoutStream: true, // Run keepalive even with no RPCs. + }}, done) + defer tr.Close() + conn, ok := <-done + if !ok { + t.Fatalf("Server didn't return connection object") + } + defer conn.Close() + // Sleep for keepalive to close the connection. + time.Sleep(4 * time.Second) + // Assert that the connection was closed. + ct := tr.(*http2Client) + ct.mu.Lock() + defer ct.mu.Unlock() + if ct.state == reachable { + t.Fatalf("Test Failed: Expected client transport to have closed.") + } +} + +func TestKeepaliveClientStaysHealthyOnIdleTransport(t *testing.T) { + done := make(chan net.Conn, 1) + tr := setUpWithNoPingServer(t, ConnectOptions{KeepaliveParams: keepalive.ClientParameters{ + Time: 2 * time.Second, // Keepalive time = 2 sec. + Timeout: 1 * time.Second, // Keepalive timeout = 1 sec. + }}, done) + defer tr.Close() + conn, ok := <-done + if !ok { + t.Fatalf("server didn't reutrn connection object") + } + defer conn.Close() + // Give keepalive some time. + time.Sleep(4 * time.Second) + // Assert that connections is still healthy. + ct := tr.(*http2Client) + ct.mu.Lock() + defer ct.mu.Unlock() + if ct.state != reachable { + t.Fatalf("Test failed: Expected client transport to be healthy.") + } +} + +func TestKeepaliveClientClosesWithActiveStreams(t *testing.T) { + done := make(chan net.Conn, 1) + tr := setUpWithNoPingServer(t, ConnectOptions{KeepaliveParams: keepalive.ClientParameters{ + Time: 2 * time.Second, // Keepalive time = 2 sec. + Timeout: 1 * time.Second, // Keepalive timeout = 1 sec. + }}, done) + defer tr.Close() + conn, ok := <-done + if !ok { + t.Fatalf("Server didn't return connection object") + } + defer conn.Close() + // Create a stream. + _, err := tr.NewStream(context.Background(), &CallHdr{Flush: true}) + if err != nil { + t.Fatalf("Failed to create a new stream: %v", err) + } + // Give keepalive some time. + time.Sleep(4 * time.Second) + // Assert that transport was closed. + ct := tr.(*http2Client) + ct.mu.Lock() + defer ct.mu.Unlock() + if ct.state == reachable { + t.Fatalf("Test failed: Expected client transport to have closed.") + } +} + +func TestKeepaliveClientStaysHealthyWithResponsiveServer(t *testing.T) { + s, tr := setUpWithOptions(t, 0, &ServerConfig{MaxStreams: math.MaxUint32}, normal, ConnectOptions{KeepaliveParams: keepalive.ClientParameters{ + Time: 2 * time.Second, // Keepalive time = 2 sec. + Timeout: 1 * time.Second, // Keepalive timeout = 1 sec. + PermitWithoutStream: true, // Run keepalive even with no RPCs. + }}) + defer s.stop() + defer tr.Close() + // Give keep alive some time. + time.Sleep(4 * time.Second) + // Assert that transport is healthy. + ct := tr.(*http2Client) + ct.mu.Lock() + defer ct.mu.Unlock() + if ct.state != reachable { + t.Fatalf("Test failed: Expected client transport to be healthy.") + } +} + +func TestKeepaliveServerEnforcementWithAbusiveClientNoRPC(t *testing.T) { + serverConfig := &ServerConfig{ + KeepalivePolicy: keepalive.EnforcementPolicy{ + MinTime: 2 * time.Second, + }, + } + clientOptions := ConnectOptions{ + KeepaliveParams: keepalive.ClientParameters{ + Time: 50 * time.Millisecond, + Timeout: 50 * time.Millisecond, + PermitWithoutStream: true, + }, + } + server, client := setUpWithOptions(t, 0, serverConfig, normal, clientOptions) + defer server.stop() + defer client.Close() + + timeout := time.NewTimer(2 * time.Second) + select { + case <-client.GoAway(): + if !timeout.Stop() { + <-timeout.C + } + case <-timeout.C: + t.Fatalf("Test failed: Expected a GoAway from server.") + } + time.Sleep(500 * time.Millisecond) + ct := client.(*http2Client) + ct.mu.Lock() + defer ct.mu.Unlock() + if ct.state == reachable { + t.Fatalf("Test failed: Expected the connection to be closed.") + } +} + +func TestKeepaliveServerEnforcementWithAbusiveClientWithRPC(t *testing.T) { + serverConfig := &ServerConfig{ + KeepalivePolicy: keepalive.EnforcementPolicy{ + MinTime: 2 * time.Second, + }, + } + clientOptions := ConnectOptions{ + KeepaliveParams: keepalive.ClientParameters{ + Time: 50 * time.Millisecond, + Timeout: 50 * time.Millisecond, + }, + } + server, client := setUpWithOptions(t, 0, serverConfig, suspended, clientOptions) + defer server.stop() + defer client.Close() + + if _, err := client.NewStream(context.Background(), &CallHdr{Flush: true}); err != nil { + t.Fatalf("Client failed to create stream.") + } + timeout := time.NewTimer(2 * time.Second) + select { + case <-client.GoAway(): + if !timeout.Stop() { + <-timeout.C + } + case <-timeout.C: + t.Fatalf("Test failed: Expected a GoAway from server.") + } + time.Sleep(500 * time.Millisecond) + ct := client.(*http2Client) + ct.mu.Lock() + defer ct.mu.Unlock() + if ct.state == reachable { + t.Fatalf("Test failed: Expected the connection to be closed.") + } +} + +func TestKeepaliveServerEnforcementWithObeyingClientNoRPC(t *testing.T) { + serverConfig := &ServerConfig{ + KeepalivePolicy: keepalive.EnforcementPolicy{ + MinTime: 100 * time.Millisecond, + PermitWithoutStream: true, + }, + } + clientOptions := ConnectOptions{ + KeepaliveParams: keepalive.ClientParameters{ + Time: 101 * time.Millisecond, + Timeout: 50 * time.Millisecond, + PermitWithoutStream: true, + }, + } + server, client := setUpWithOptions(t, 0, serverConfig, normal, clientOptions) + defer server.stop() + defer client.Close() + + // Give keepalive enough time. + time.Sleep(2 * time.Second) + // Assert that connection is healthy. + ct := client.(*http2Client) + ct.mu.Lock() + defer ct.mu.Unlock() + if ct.state != reachable { + t.Fatalf("Test failed: Expected connection to be healthy.") + } +} + +func TestKeepaliveServerEnforcementWithObeyingClientWithRPC(t *testing.T) { + serverConfig := &ServerConfig{ + KeepalivePolicy: keepalive.EnforcementPolicy{ + MinTime: 100 * time.Millisecond, + }, + } + clientOptions := ConnectOptions{ + KeepaliveParams: keepalive.ClientParameters{ + Time: 101 * time.Millisecond, + Timeout: 50 * time.Millisecond, + }, + } + server, client := setUpWithOptions(t, 0, serverConfig, suspended, clientOptions) + defer server.stop() + defer client.Close() + + if _, err := client.NewStream(context.Background(), &CallHdr{Flush: true}); err != nil { + t.Fatalf("Client failed to create stream.") + } + + // Give keepalive enough time. + time.Sleep(2 * time.Second) + // Assert that connection is healthy. + ct := client.(*http2Client) + ct.mu.Lock() + defer ct.mu.Unlock() + if ct.state != reachable { + t.Fatalf("Test failed: Expected connection to be healthy.") + } +} + +func TestClientSendAndReceive(t *testing.T) { + server, ct := setUp(t, 0, math.MaxUint32, normal) + callHdr := &CallHdr{ + Host: "localhost", + Method: "foo.Small", + } + s1, err1 := ct.NewStream(context.Background(), callHdr) + if err1 != nil { + t.Fatalf("failed to open stream: %v", err1) + } + if s1.id != 1 { + t.Fatalf("wrong stream id: %d", s1.id) + } + s2, err2 := ct.NewStream(context.Background(), callHdr) + if err2 != nil { + t.Fatalf("failed to open stream: %v", err2) + } + if s2.id != 3 { + t.Fatalf("wrong stream id: %d", s2.id) + } + opts := Options{ + Last: true, + Delay: false, + } + if err := ct.Write(s1, nil, expectedRequest, &opts); err != nil && err != io.EOF { + t.Fatalf("failed to send data: %v", err) + } + p := make([]byte, len(expectedResponse)) + _, recvErr := s1.Read(p) + if recvErr != nil || !bytes.Equal(p, expectedResponse) { + t.Fatalf("Error: %v, want ; Result: %v, want %v", recvErr, p, expectedResponse) + } + _, recvErr = s1.Read(p) + if recvErr != io.EOF { + t.Fatalf("Error: %v; want ", recvErr) + } + ct.Close() + server.stop() +} + +func TestClientErrorNotify(t *testing.T) { + server, ct := setUp(t, 0, math.MaxUint32, normal) + go server.stop() + // ct.reader should detect the error and activate ct.Error(). + <-ct.Error() + ct.Close() +} + +func performOneRPC(ct ClientTransport) { + callHdr := &CallHdr{ + Host: "localhost", + Method: "foo.Small", + } + s, err := ct.NewStream(context.Background(), callHdr) + if err != nil { + return + } + opts := Options{ + Last: true, + Delay: false, + } + if err := ct.Write(s, []byte{}, expectedRequest, &opts); err == nil || err == io.EOF { + time.Sleep(5 * time.Millisecond) + // The following s.Recv()'s could error out because the + // underlying transport is gone. + // + // Read response + p := make([]byte, len(expectedResponse)) + s.Read(p) + // Read io.EOF + s.Read(p) + } +} + +func TestClientMix(t *testing.T) { + s, ct := setUp(t, 0, math.MaxUint32, normal) + go func(s *server) { + time.Sleep(5 * time.Second) + s.stop() + }(s) + go func(ct ClientTransport) { + <-ct.Error() + ct.Close() + }(ct) + for i := 0; i < 1000; i++ { + time.Sleep(10 * time.Millisecond) + go performOneRPC(ct) + } +} + +func TestLargeMessage(t *testing.T) { + server, ct := setUp(t, 0, math.MaxUint32, normal) + callHdr := &CallHdr{ + Host: "localhost", + Method: "foo.Large", + } + var wg sync.WaitGroup + for i := 0; i < 2; i++ { + wg.Add(1) + go func() { + defer wg.Done() + s, err := ct.NewStream(context.Background(), callHdr) + if err != nil { + t.Errorf("%v.NewStream(_, _) = _, %v, want _, ", ct, err) + } + if err := ct.Write(s, []byte{}, expectedRequestLarge, &Options{Last: true, Delay: false}); err != nil && err != io.EOF { + t.Errorf("%v.Write(_, _, _) = %v, want ", ct, err) + } + p := make([]byte, len(expectedResponseLarge)) + if _, err := s.Read(p); err != nil || !bytes.Equal(p, expectedResponseLarge) { + t.Errorf("s.Read(%v) = _, %v, want %v, ", err, p, expectedResponse) + } + if _, err = s.Read(p); err != io.EOF { + t.Errorf("Failed to complete the stream %v; want ", err) + } + }() + } + wg.Wait() + ct.Close() + server.stop() +} + +func TestLargeMessageWithDelayRead(t *testing.T) { + server, ct := setUp(t, 0, math.MaxUint32, delayRead) + callHdr := &CallHdr{ + Host: "localhost", + Method: "foo.Large", + } + var wg sync.WaitGroup + for i := 0; i < 2; i++ { + wg.Add(1) + go func() { + defer wg.Done() + s, err := ct.NewStream(context.Background(), callHdr) + if err != nil { + t.Errorf("%v.NewStream(_, _) = _, %v, want _, ", ct, err) + } + if err := ct.Write(s, []byte{}, expectedRequestLarge, &Options{Last: true, Delay: false}); err != nil && err != io.EOF { + t.Errorf("%v.Write(_, _, _) = %v, want ", ct, err) + } + p := make([]byte, len(expectedResponseLarge)) + + // Give time to server to begin sending before client starts reading. + time.Sleep(2 * time.Second) + if _, err := s.Read(p); err != nil || !bytes.Equal(p, expectedResponseLarge) { + t.Errorf("s.Read(_) = _, %v, want _, ", err) + } + if _, err = s.Read(p); err != io.EOF { + t.Errorf("Failed to complete the stream %v; want ", err) + } + }() + } + wg.Wait() + ct.Close() + server.stop() +} + +func TestLargeMessageDelayWrite(t *testing.T) { + server, ct := setUp(t, 0, math.MaxUint32, delayWrite) + callHdr := &CallHdr{ + Host: "localhost", + Method: "foo.Large", + } + var wg sync.WaitGroup + for i := 0; i < 2; i++ { + wg.Add(1) + go func() { + defer wg.Done() + s, err := ct.NewStream(context.Background(), callHdr) + if err != nil { + t.Errorf("%v.NewStream(_, _) = _, %v, want _, ", ct, err) + } + + // Give time to server to start reading before client starts sending. + time.Sleep(2 * time.Second) + if err := ct.Write(s, []byte{}, expectedRequestLarge, &Options{Last: true, Delay: false}); err != nil && err != io.EOF { + t.Errorf("%v.Write(_, _, _) = %v, want ", ct, err) + } + p := make([]byte, len(expectedResponseLarge)) + if _, err := s.Read(p); err != nil || !bytes.Equal(p, expectedResponseLarge) { + t.Errorf("io.ReadFull(%v) = _, %v, want %v, ", err, p, expectedResponse) + } + if _, err = s.Read(p); err != io.EOF { + t.Errorf("Failed to complete the stream %v; want ", err) + } + }() + } + wg.Wait() + ct.Close() + server.stop() +} + +func TestGracefulClose(t *testing.T) { + server, ct := setUp(t, 0, math.MaxUint32, normal) + callHdr := &CallHdr{ + Host: "localhost", + Method: "foo.Small", + } + s, err := ct.NewStream(context.Background(), callHdr) + if err != nil { + t.Fatalf("%v.NewStream(_, _) = _, %v, want _, ", ct, err) + } + if err = ct.GracefulClose(); err != nil { + t.Fatalf("%v.GracefulClose() = %v, want ", ct, err) + } + var wg sync.WaitGroup + // Expect the failure for all the follow-up streams because ct has been closed gracefully. + for i := 0; i < 100; i++ { + wg.Add(1) + go func() { + defer wg.Done() + if _, err := ct.NewStream(context.Background(), callHdr); err != errStreamDrain { + t.Errorf("%v.NewStream(_, _) = _, %v, want _, %v", ct, err, errStreamDrain) + } + }() + } + opts := Options{ + Last: true, + Delay: false, + } + // The stream which was created before graceful close can still proceed. + if err := ct.Write(s, nil, expectedRequest, &opts); err != nil && err != io.EOF { + t.Fatalf("%v.Write(_, _, _) = %v, want ", ct, err) + } + p := make([]byte, len(expectedResponse)) + if _, err := s.Read(p); err != nil || !bytes.Equal(p, expectedResponse) { + t.Fatalf("s.Read(%v) = _, %v, want %v, ", err, p, expectedResponse) + } + if _, err = s.Read(p); err != io.EOF { + t.Fatalf("Failed to complete the stream %v; want ", err) + } + wg.Wait() + ct.Close() + server.stop() +} + +func TestLargeMessageSuspension(t *testing.T) { + server, ct := setUp(t, 0, math.MaxUint32, suspended) + callHdr := &CallHdr{ + Host: "localhost", + Method: "foo.Large", + } + // Set a long enough timeout for writing a large message out. + ctx, cancel := context.WithTimeout(context.Background(), time.Second) + defer cancel() + s, err := ct.NewStream(ctx, callHdr) + if err != nil { + t.Fatalf("failed to open stream: %v", err) + } + // Write should not be done successfully due to flow control. + msg := make([]byte, initialWindowSize*8) + err = ct.Write(s, nil, msg, &Options{Last: true, Delay: false}) + expectedErr := streamErrorf(codes.DeadlineExceeded, "%v", context.DeadlineExceeded) + if err != expectedErr { + t.Fatalf("Write got %v, want %v", err, expectedErr) + } + ct.Close() + server.stop() +} + +func TestMaxStreams(t *testing.T) { + server, ct := setUp(t, 0, 1, suspended) + callHdr := &CallHdr{ + Host: "localhost", + Method: "foo.Large", + } + // Have a pending stream which takes all streams quota. + s, err := ct.NewStream(context.Background(), callHdr) + if err != nil { + t.Fatalf("Failed to open stream: %v", err) + } + cc, ok := ct.(*http2Client) + if !ok { + t.Fatalf("Failed to convert %v to *http2Client", ct) + } + done := make(chan struct{}) + ch := make(chan int) + ready := make(chan struct{}) + go func() { + for { + select { + case <-time.After(5 * time.Millisecond): + select { + case ch <- 0: + case <-ready: + return + } + case <-time.After(5 * time.Second): + close(done) + return + case <-ready: + return + } + } + }() + // Test these conditions until they pass or + // we reach the deadline (failure case). + for { + select { + case <-ch: + case <-done: + t.Fatalf("streamsQuota.quota shouldn't be non-zero.") + } + cc.streamsQuota.mu.Lock() + sq := cc.streamsQuota.quota + cc.streamsQuota.mu.Unlock() + if sq == 0 { + break + } + } + close(ready) + // Close the pending stream so that the streams quota becomes available for the next new stream. + ct.CloseStream(s, nil) + cc.streamsQuota.mu.Lock() + i := cc.streamsQuota.quota + cc.streamsQuota.mu.Unlock() + if i != 1 { + t.Fatalf("streamsQuota is %d, want 1.", i) + } + if _, err := ct.NewStream(context.Background(), callHdr); err != nil { + t.Fatalf("Failed to open stream: %v", err) + } + ct.Close() + server.stop() +} + +func TestServerContextCanceledOnClosedConnection(t *testing.T) { + server, ct := setUp(t, 0, math.MaxUint32, suspended) + callHdr := &CallHdr{ + Host: "localhost", + Method: "foo", + } + var sc *http2Server + // Wait until the server transport is setup. + for { + server.mu.Lock() + if len(server.conns) == 0 { + server.mu.Unlock() + time.Sleep(time.Millisecond) + continue + } + for k := range server.conns { + var ok bool + sc, ok = k.(*http2Server) + if !ok { + t.Fatalf("Failed to convert %v to *http2Server", k) + } + } + server.mu.Unlock() + break + } + cc, ok := ct.(*http2Client) + if !ok { + t.Fatalf("Failed to convert %v to *http2Client", ct) + } + s, err := ct.NewStream(context.Background(), callHdr) + if err != nil { + t.Fatalf("Failed to open stream: %v", err) + } + cc.controlBuf.put(&dataFrame{s.id, false, make([]byte, http2MaxFrameLen), func() {}}) + // Loop until the server side stream is created. + var ss *Stream + for { + time.Sleep(time.Second) + sc.mu.Lock() + if len(sc.activeStreams) == 0 { + sc.mu.Unlock() + continue + } + ss = sc.activeStreams[s.id] + sc.mu.Unlock() + break + } + cc.Close() + select { + case <-ss.Context().Done(): + if ss.Context().Err() != context.Canceled { + t.Fatalf("ss.Context().Err() got %v, want %v", ss.Context().Err(), context.Canceled) + } + case <-time.After(5 * time.Second): + t.Fatalf("Failed to cancel the context of the sever side stream.") + } + server.stop() +} + +func TestClientConnDecoupledFromApplicationRead(t *testing.T) { + connectOptions := ConnectOptions{ + InitialWindowSize: defaultWindowSize, + InitialConnWindowSize: defaultWindowSize, + } + server, client := setUpWithOptions(t, 0, &ServerConfig{}, notifyCall, connectOptions) + defer server.stop() + defer client.Close() + + waitWhileTrue(t, func() (bool, error) { + server.mu.Lock() + defer server.mu.Unlock() + + if len(server.conns) == 0 { + return true, fmt.Errorf("timed-out while waiting for connection to be created on the server") + } + return false, nil + }) + + var st *http2Server + server.mu.Lock() + for k := range server.conns { + st = k.(*http2Server) + } + notifyChan := make(chan struct{}) + server.h.notify = notifyChan + server.mu.Unlock() + cstream1, err := client.NewStream(context.Background(), &CallHdr{Flush: true}) + if err != nil { + t.Fatalf("Client failed to create first stream. Err: %v", err) + } + + <-notifyChan + var sstream1 *Stream + // Access stream on the server. + st.mu.Lock() + for _, v := range st.activeStreams { + if v.id == cstream1.id { + sstream1 = v + } + } + st.mu.Unlock() + if sstream1 == nil { + t.Fatalf("Didn't find stream corresponding to client cstream.id: %v on the server", cstream1.id) + } + // Exhaust client's connection window. + if err := st.Write(sstream1, []byte{}, make([]byte, defaultWindowSize), &Options{}); err != nil { + t.Fatalf("Server failed to write data. Err: %v", err) + } + notifyChan = make(chan struct{}) + server.mu.Lock() + server.h.notify = notifyChan + server.mu.Unlock() + // Create another stream on client. + cstream2, err := client.NewStream(context.Background(), &CallHdr{Flush: true}) + if err != nil { + t.Fatalf("Client failed to create second stream. Err: %v", err) + } + <-notifyChan + var sstream2 *Stream + st.mu.Lock() + for _, v := range st.activeStreams { + if v.id == cstream2.id { + sstream2 = v + } + } + st.mu.Unlock() + if sstream2 == nil { + t.Fatalf("Didn't find stream corresponding to client cstream.id: %v on the server", cstream2.id) + } + // Server should be able to send data on the new stream, even though the client hasn't read anything on the first stream. + if err := st.Write(sstream2, []byte{}, make([]byte, defaultWindowSize), &Options{}); err != nil { + t.Fatalf("Server failed to write data. Err: %v", err) + } + + // Client should be able to read data on second stream. + if _, err := cstream2.Read(make([]byte, defaultWindowSize)); err != nil { + t.Fatalf("_.Read(_) = _, %v, want _, ", err) + } + + // Client should be able to read data on first stream. + if _, err := cstream1.Read(make([]byte, defaultWindowSize)); err != nil { + t.Fatalf("_.Read(_) = _, %v, want _, ", err) + } +} + +func TestServerConnDecoupledFromApplicationRead(t *testing.T) { + serverConfig := &ServerConfig{ + InitialWindowSize: defaultWindowSize, + InitialConnWindowSize: defaultWindowSize, + } + server, client := setUpWithOptions(t, 0, serverConfig, suspended, ConnectOptions{}) + defer server.stop() + defer client.Close() + waitWhileTrue(t, func() (bool, error) { + server.mu.Lock() + defer server.mu.Unlock() + + if len(server.conns) == 0 { + return true, fmt.Errorf("timed-out while waiting for connection to be created on the server") + } + return false, nil + }) + var st *http2Server + server.mu.Lock() + for k := range server.conns { + st = k.(*http2Server) + } + server.mu.Unlock() + cstream1, err := client.NewStream(context.Background(), &CallHdr{Flush: true}) + if err != nil { + t.Fatalf("Failed to create 1st stream. Err: %v", err) + } + // Exhaust server's connection window. + if err := client.Write(cstream1, nil, make([]byte, defaultWindowSize), &Options{Last: true}); err != nil { + t.Fatalf("Client failed to write data. Err: %v", err) + } + //Client should be able to create another stream and send data on it. + cstream2, err := client.NewStream(context.Background(), &CallHdr{Flush: true}) + if err != nil { + t.Fatalf("Failed to create 2nd stream. Err: %v", err) + } + if err := client.Write(cstream2, nil, make([]byte, defaultWindowSize), &Options{}); err != nil { + t.Fatalf("Client failed to write data. Err: %v", err) + } + // Get the streams on server. + waitWhileTrue(t, func() (bool, error) { + st.mu.Lock() + defer st.mu.Unlock() + + if len(st.activeStreams) != 2 { + return true, fmt.Errorf("timed-out while waiting for server to have created the streams") + } + return false, nil + }) + var sstream1 *Stream + st.mu.Lock() + for _, v := range st.activeStreams { + if v.id == 1 { + sstream1 = v + } + } + st.mu.Unlock() + // Trying to write more on a max-ed out stream should result in a RST_STREAM from the server. + ct := client.(*http2Client) + ct.controlBuf.put(&dataFrame{cstream2.id, true, make([]byte, 1), func() {}}) + code := http2ErrConvTab[http2.ErrCodeFlowControl] + waitWhileTrue(t, func() (bool, error) { + cstream2.mu.Lock() + defer cstream2.mu.Unlock() + if cstream2.status.Code() != code { + return true, fmt.Errorf("want code = %v, got %v", code, cstream2.status.Code()) + } + return false, nil + }) + // Reading from the stream on server should succeed. + if _, err := sstream1.Read(make([]byte, defaultWindowSize)); err != nil { + t.Fatalf("_.Read(_) = %v, want ", err) + } + + if _, err := sstream1.Read(make([]byte, 1)); err != io.EOF { + t.Fatalf("_.Read(_) = %v, want io.EOF", err) + } + +} + +func TestServerWithMisbehavedClient(t *testing.T) { + server, ct := setUp(t, 0, math.MaxUint32, suspended) + callHdr := &CallHdr{ + Host: "localhost", + Method: "foo", + } + var sc *http2Server + // Wait until the server transport is setup. + for { + server.mu.Lock() + if len(server.conns) == 0 { + server.mu.Unlock() + time.Sleep(time.Millisecond) + continue + } + for k := range server.conns { + var ok bool + sc, ok = k.(*http2Server) + if !ok { + t.Fatalf("Failed to convert %v to *http2Server", k) + } + } + server.mu.Unlock() + break + } + cc, ok := ct.(*http2Client) + if !ok { + t.Fatalf("Failed to convert %v to *http2Client", ct) + } + // Test server behavior for violation of stream flow control window size restriction. + s, err := ct.NewStream(context.Background(), callHdr) + if err != nil { + t.Fatalf("Failed to open stream: %v", err) + } + var sent int + // Drain the stream flow control window + cc.controlBuf.put(&dataFrame{s.id, false, make([]byte, http2MaxFrameLen), func() {}}) + sent += http2MaxFrameLen + // Wait until the server creates the corresponding stream and receive some data. + var ss *Stream + for { + time.Sleep(time.Millisecond) + sc.mu.Lock() + if len(sc.activeStreams) == 0 { + sc.mu.Unlock() + continue + } + ss = sc.activeStreams[s.id] + sc.mu.Unlock() + ss.fc.mu.Lock() + if ss.fc.pendingData > 0 { + ss.fc.mu.Unlock() + break + } + ss.fc.mu.Unlock() + } + if ss.fc.pendingData != http2MaxFrameLen || ss.fc.pendingUpdate != 0 || sc.fc.pendingData != 0 || sc.fc.pendingUpdate != 0 { + t.Fatalf("Server mistakenly updates inbound flow control params: got %d, %d, %d, %d; want %d, %d, %d, %d", ss.fc.pendingData, ss.fc.pendingUpdate, sc.fc.pendingData, sc.fc.pendingUpdate, http2MaxFrameLen, 0, 0, 0) + } + // Keep sending until the server inbound window is drained for that stream. + for sent <= initialWindowSize { + cc.controlBuf.put(&dataFrame{s.id, false, make([]byte, 1), func() {}}) + sent++ + } + // Server sent a resetStream for s already. + code := http2ErrConvTab[http2.ErrCodeFlowControl] + if _, err := s.Read(make([]byte, 1)); err != io.EOF { + t.Fatalf("%v got err %v want ", s, err) + } + if s.status.Code() != code { + t.Fatalf("%v got status %v; want Code=%v", s, s.status, code) + } + + ct.CloseStream(s, nil) + ct.Close() + server.stop() +} + +func TestClientWithMisbehavedServer(t *testing.T) { + // Turn off BDP estimation so that the server can + // violate stream window. + connectOptions := ConnectOptions{ + InitialWindowSize: initialWindowSize, + } + server, ct := setUpWithOptions(t, 0, &ServerConfig{}, misbehaved, connectOptions) + callHdr := &CallHdr{ + Host: "localhost", + Method: "foo.Stream", + } + conn, ok := ct.(*http2Client) + if !ok { + t.Fatalf("Failed to convert %v to *http2Client", ct) + } + // Test the logic for the violation of stream flow control window size restriction. + s, err := ct.NewStream(context.Background(), callHdr) + if err != nil { + t.Fatalf("Failed to open stream: %v", err) + } + d := make([]byte, 1) + if err := ct.Write(s, nil, d, &Options{Last: true, Delay: false}); err != nil && err != io.EOF { + t.Fatalf("Failed to write: %v", err) + } + // Read without window update. + for { + p := make([]byte, http2MaxFrameLen) + if _, err = s.trReader.(*transportReader).reader.Read(p); err != nil { + break + } + } + if s.fc.pendingData <= initialWindowSize || s.fc.pendingUpdate != 0 || conn.fc.pendingData != 0 || conn.fc.pendingUpdate != 0 { + t.Fatalf("Client mistakenly updates inbound flow control params: got %d, %d, %d, %d; want >%d, %d, %d, >%d", s.fc.pendingData, s.fc.pendingUpdate, conn.fc.pendingData, conn.fc.pendingUpdate, initialWindowSize, 0, 0, 0) + } + + if err != io.EOF { + t.Fatalf("Got err %v, want ", err) + } + if s.status.Code() != codes.Internal { + t.Fatalf("Got s.status %v, want s.status.Code()=Internal", s.status) + } + + conn.CloseStream(s, err) + ct.Close() + server.stop() +} + +var encodingTestStatus = status.New(codes.Internal, "\n") + +func TestEncodingRequiredStatus(t *testing.T) { + server, ct := setUp(t, 0, math.MaxUint32, encodingRequiredStatus) + callHdr := &CallHdr{ + Host: "localhost", + Method: "foo", + } + s, err := ct.NewStream(context.Background(), callHdr) + if err != nil { + return + } + opts := Options{ + Last: true, + Delay: false, + } + if err := ct.Write(s, nil, expectedRequest, &opts); err != nil && err != io.EOF { + t.Fatalf("Failed to write the request: %v", err) + } + p := make([]byte, http2MaxFrameLen) + if _, err := s.trReader.(*transportReader).Read(p); err != io.EOF { + t.Fatalf("Read got error %v, want %v", err, io.EOF) + } + if !reflect.DeepEqual(s.Status(), encodingTestStatus) { + t.Fatalf("stream with status %v, want %v", s.Status(), encodingTestStatus) + } + ct.Close() + server.stop() +} + +func TestInvalidHeaderField(t *testing.T) { + server, ct := setUp(t, 0, math.MaxUint32, invalidHeaderField) + callHdr := &CallHdr{ + Host: "localhost", + Method: "foo", + } + s, err := ct.NewStream(context.Background(), callHdr) + if err != nil { + return + } + opts := Options{ + Last: true, + Delay: false, + } + if err := ct.Write(s, nil, expectedRequest, &opts); err != nil && err != io.EOF { + t.Fatalf("Failed to write the request: %v", err) + } + p := make([]byte, http2MaxFrameLen) + _, err = s.trReader.(*transportReader).Read(p) + if se, ok := err.(StreamError); !ok || se.Code != codes.FailedPrecondition || !strings.Contains(err.Error(), expectedInvalidHeaderField) { + t.Fatalf("Read got error %v, want error with code %s and contains %q", err, codes.FailedPrecondition, expectedInvalidHeaderField) + } + ct.Close() + server.stop() +} + +func TestStreamContext(t *testing.T) { + expectedStream := &Stream{} + ctx := newContextWithStream(context.Background(), expectedStream) + s, ok := StreamFromContext(ctx) + if !ok || expectedStream != s { + t.Fatalf("GetStreamFromContext(%v) = %v, %t, want: %v, true", ctx, s, ok, expectedStream) + } +} + +func TestIsReservedHeader(t *testing.T) { + tests := []struct { + h string + want bool + }{ + {"", false}, // but should be rejected earlier + {"foo", false}, + {"content-type", true}, + {"grpc-message-type", true}, + {"grpc-encoding", true}, + {"grpc-message", true}, + {"grpc-status", true}, + {"grpc-timeout", true}, + {"te", true}, + } + for _, tt := range tests { + got := isReservedHeader(tt.h) + if got != tt.want { + t.Errorf("isReservedHeader(%q) = %v; want %v", tt.h, got, tt.want) + } + } +} + +func TestContextErr(t *testing.T) { + for _, test := range []struct { + // input + errIn error + // outputs + errOut StreamError + }{ + {context.DeadlineExceeded, StreamError{codes.DeadlineExceeded, context.DeadlineExceeded.Error()}}, + {context.Canceled, StreamError{codes.Canceled, context.Canceled.Error()}}, + } { + err := ContextErr(test.errIn) + if err != test.errOut { + t.Fatalf("ContextErr{%v} = %v \nwant %v", test.errIn, err, test.errOut) + } + } +} + +func max(a, b int32) int32 { + if a > b { + return a + } + return b +} + +type windowSizeConfig struct { + serverStream int32 + serverConn int32 + clientStream int32 + clientConn int32 +} + +func TestAccountCheckWindowSizeWithLargeWindow(t *testing.T) { + wc := windowSizeConfig{ + serverStream: 10 * 1024 * 1024, + serverConn: 12 * 1024 * 1024, + clientStream: 6 * 1024 * 1024, + clientConn: 8 * 1024 * 1024, + } + testAccountCheckWindowSize(t, wc) +} + +func TestAccountCheckWindowSizeWithSmallWindow(t *testing.T) { + wc := windowSizeConfig{ + serverStream: defaultWindowSize, + // Note this is smaller than initialConnWindowSize which is the current default. + serverConn: defaultWindowSize, + clientStream: defaultWindowSize, + clientConn: defaultWindowSize, + } + testAccountCheckWindowSize(t, wc) +} + +func testAccountCheckWindowSize(t *testing.T, wc windowSizeConfig) { + serverConfig := &ServerConfig{ + InitialWindowSize: wc.serverStream, + InitialConnWindowSize: wc.serverConn, + } + connectOptions := ConnectOptions{ + InitialWindowSize: wc.clientStream, + InitialConnWindowSize: wc.clientConn, + } + server, client := setUpWithOptions(t, 0, serverConfig, suspended, connectOptions) + defer server.stop() + defer client.Close() + + // Wait for server conns to be populated with new server transport. + waitWhileTrue(t, func() (bool, error) { + server.mu.Lock() + defer server.mu.Unlock() + if len(server.conns) == 0 { + return true, fmt.Errorf("timed out waiting for server transport to be created") + } + return false, nil + }) + var st *http2Server + server.mu.Lock() + for k := range server.conns { + st = k.(*http2Server) + } + server.mu.Unlock() + ct := client.(*http2Client) + cstream, err := client.NewStream(context.Background(), &CallHdr{Flush: true}) + if err != nil { + t.Fatalf("Failed to create stream. Err: %v", err) + } + // Wait for server to receive headers. + waitWhileTrue(t, func() (bool, error) { + st.mu.Lock() + defer st.mu.Unlock() + if len(st.activeStreams) == 0 { + return true, fmt.Errorf("timed out waiting for server to receive headers") + } + return false, nil + }) + // Sleeping to make sure the settings are applied in case of negative test. + time.Sleep(time.Second) + + waitWhileTrue(t, func() (bool, error) { + st.fc.mu.Lock() + lim := st.fc.limit + st.fc.mu.Unlock() + if lim != uint32(serverConfig.InitialConnWindowSize) { + return true, fmt.Errorf("Server transport flow control window size: got %v, want %v", lim, serverConfig.InitialConnWindowSize) + } + return false, nil + }) + + ctx, cancel := context.WithTimeout(context.Background(), time.Second) + serverSendQuota, _, err := st.sendQuotaPool.get(math.MaxInt32, waiters{ + ctx: ctx, + tctx: st.ctx, + done: nil, + goAway: nil, + }) + if err != nil { + t.Fatalf("Error while acquiring sendQuota on server. Err: %v", err) + } + cancel() + st.sendQuotaPool.add(serverSendQuota) + if serverSendQuota != int(connectOptions.InitialConnWindowSize) { + t.Fatalf("Server send quota(%v) not equal to client's window size(%v) on conn.", serverSendQuota, connectOptions.InitialConnWindowSize) + } + st.mu.Lock() + ssq := st.streamSendQuota + st.mu.Unlock() + if ssq != uint32(connectOptions.InitialWindowSize) { + t.Fatalf("Server stream send quota(%v) not equal to client's window size(%v) on stream.", ssq, connectOptions.InitialWindowSize) + } + ct.fc.mu.Lock() + limit := ct.fc.limit + ct.fc.mu.Unlock() + if limit != uint32(connectOptions.InitialConnWindowSize) { + t.Fatalf("Client transport flow control window size is %v, want %v", limit, connectOptions.InitialConnWindowSize) + } + ctx, cancel = context.WithTimeout(context.Background(), time.Second) + clientSendQuota, _, err := ct.sendQuotaPool.get(math.MaxInt32, waiters{ + ctx: ctx, + tctx: ct.ctx, + done: nil, + goAway: nil, + }) + if err != nil { + t.Fatalf("Error while acquiring sendQuota on client. Err: %v", err) + } + cancel() + ct.sendQuotaPool.add(clientSendQuota) + if clientSendQuota != int(serverConfig.InitialConnWindowSize) { + t.Fatalf("Client send quota(%v) not equal to server's window size(%v) on conn.", clientSendQuota, serverConfig.InitialConnWindowSize) + } + ct.mu.Lock() + ssq = ct.streamSendQuota + ct.mu.Unlock() + if ssq != uint32(serverConfig.InitialWindowSize) { + t.Fatalf("Client stream send quota(%v) not equal to server's window size(%v) on stream.", ssq, serverConfig.InitialWindowSize) + } + cstream.fc.mu.Lock() + limit = cstream.fc.limit + cstream.fc.mu.Unlock() + if limit != uint32(connectOptions.InitialWindowSize) { + t.Fatalf("Client stream flow control window size is %v, want %v", limit, connectOptions.InitialWindowSize) + } + var sstream *Stream + st.mu.Lock() + for _, v := range st.activeStreams { + sstream = v + } + st.mu.Unlock() + sstream.fc.mu.Lock() + limit = sstream.fc.limit + sstream.fc.mu.Unlock() + if limit != uint32(serverConfig.InitialWindowSize) { + t.Fatalf("Server stream flow control window size is %v, want %v", limit, serverConfig.InitialWindowSize) + } +} + +// Check accounting on both sides after sending and receiving large messages. +func TestAccountCheckExpandingWindow(t *testing.T) { + server, client := setUp(t, 0, 0, pingpong) + defer server.stop() + defer client.Close() + waitWhileTrue(t, func() (bool, error) { + server.mu.Lock() + defer server.mu.Unlock() + if len(server.conns) == 0 { + return true, fmt.Errorf("timed out while waiting for server transport to be created") + } + return false, nil + }) + var st *http2Server + server.mu.Lock() + for k := range server.conns { + st = k.(*http2Server) + } + server.mu.Unlock() + ct := client.(*http2Client) + cstream, err := client.NewStream(context.Background(), &CallHdr{Flush: true}) + if err != nil { + t.Fatalf("Failed to create stream. Err: %v", err) + } + + msgSize := 65535 * 16 * 2 + msg := make([]byte, msgSize) + buf := make([]byte, msgSize+5) + buf[0] = byte(0) + binary.BigEndian.PutUint32(buf[1:], uint32(msgSize)) + copy(buf[5:], msg) + opts := Options{} + header := make([]byte, 5) + for i := 1; i <= 10; i++ { + if err := ct.Write(cstream, nil, buf, &opts); err != nil { + t.Fatalf("Error on client while writing message: %v", err) + } + if _, err := cstream.Read(header); err != nil { + t.Fatalf("Error on client while reading data frame header: %v", err) + } + sz := binary.BigEndian.Uint32(header[1:]) + recvMsg := make([]byte, int(sz)) + if _, err := cstream.Read(recvMsg); err != nil { + t.Fatalf("Error on client while reading data: %v", err) + } + if len(recvMsg) != len(msg) { + t.Fatalf("Length of message received by client: %v, want: %v", len(recvMsg), len(msg)) + } + } + defer func() { + ct.Write(cstream, nil, nil, &Options{Last: true}) // Close the stream. + if _, err := cstream.Read(header); err != io.EOF { + t.Fatalf("Client expected an EOF from the server. Got: %v", err) + } + }() + var sstream *Stream + st.mu.Lock() + for _, v := range st.activeStreams { + sstream = v + } + st.mu.Unlock() + + waitWhileTrue(t, func() (bool, error) { + // Check that pendingData and delta on flow control windows on both sides are 0. + cstream.fc.mu.Lock() + if cstream.fc.delta != 0 { + cstream.fc.mu.Unlock() + return true, fmt.Errorf("delta on flow control window of client stream is non-zero") + } + if cstream.fc.pendingData != 0 { + cstream.fc.mu.Unlock() + return true, fmt.Errorf("pendingData on flow control window of client stream is non-zero") + } + cstream.fc.mu.Unlock() + sstream.fc.mu.Lock() + if sstream.fc.delta != 0 { + sstream.fc.mu.Unlock() + return true, fmt.Errorf("delta on flow control window of server stream is non-zero") + } + if sstream.fc.pendingData != 0 { + sstream.fc.mu.Unlock() + return true, fmt.Errorf("pendingData on flow control window of sercer stream is non-zero") + } + sstream.fc.mu.Unlock() + ct.fc.mu.Lock() + if ct.fc.delta != 0 { + ct.fc.mu.Unlock() + return true, fmt.Errorf("delta on flow control window of client transport is non-zero") + } + if ct.fc.pendingData != 0 { + ct.fc.mu.Unlock() + return true, fmt.Errorf("pendingData on flow control window of client transport is non-zero") + } + ct.fc.mu.Unlock() + st.fc.mu.Lock() + if st.fc.delta != 0 { + st.fc.mu.Unlock() + return true, fmt.Errorf("delta on flow control window of server transport is non-zero") + } + if st.fc.pendingData != 0 { + st.fc.mu.Unlock() + return true, fmt.Errorf("pendingData on flow control window of server transport is non-zero") + } + st.fc.mu.Unlock() + + // Check flow conrtrol window on client stream is equal to out flow on server stream. + ctx, cancel := context.WithTimeout(context.Background(), time.Second) + serverStreamSendQuota, _, err := sstream.sendQuotaPool.get(math.MaxInt32, waiters{ + ctx: ctx, + tctx: context.Background(), + done: nil, + goAway: nil, + }) + cancel() + if err != nil { + return true, fmt.Errorf("error while acquiring server stream send quota. Err: %v", err) + } + sstream.sendQuotaPool.add(serverStreamSendQuota) + cstream.fc.mu.Lock() + clientEst := cstream.fc.limit - cstream.fc.pendingUpdate + cstream.fc.mu.Unlock() + if uint32(serverStreamSendQuota) != clientEst { + return true, fmt.Errorf("server stream outflow: %v, estimated by client: %v", serverStreamSendQuota, clientEst) + } + + // Check flow control window on server stream is equal to out flow on client stream. + ctx, cancel = context.WithTimeout(context.Background(), time.Second) + clientStreamSendQuota, _, err := cstream.sendQuotaPool.get(math.MaxInt32, waiters{ + ctx: ctx, + tctx: context.Background(), + done: nil, + goAway: nil, + }) + cancel() + if err != nil { + return true, fmt.Errorf("error while acquiring client stream send quota. Err: %v", err) + } + cstream.sendQuotaPool.add(clientStreamSendQuota) + sstream.fc.mu.Lock() + serverEst := sstream.fc.limit - sstream.fc.pendingUpdate + sstream.fc.mu.Unlock() + if uint32(clientStreamSendQuota) != serverEst { + return true, fmt.Errorf("client stream outflow: %v. estimated by server: %v", clientStreamSendQuota, serverEst) + } + + // Check flow control window on client transport is equal to out flow of server transport. + ctx, cancel = context.WithTimeout(context.Background(), time.Second) + serverTrSendQuota, _, err := st.sendQuotaPool.get(math.MaxInt32, waiters{ + ctx: ctx, + tctx: st.ctx, + done: nil, + goAway: nil, + }) + cancel() + if err != nil { + return true, fmt.Errorf("error while acquring server transport send quota. Err: %v", err) + } + st.sendQuotaPool.add(serverTrSendQuota) + ct.fc.mu.Lock() + clientEst = ct.fc.limit - ct.fc.pendingUpdate + ct.fc.mu.Unlock() + if uint32(serverTrSendQuota) != clientEst { + return true, fmt.Errorf("server transport outflow: %v, estimated by client: %v", serverTrSendQuota, clientEst) + } + + // Check flow control window on server transport is equal to out flow of client transport. + ctx, cancel = context.WithTimeout(context.Background(), time.Second) + clientTrSendQuota, _, err := ct.sendQuotaPool.get(math.MaxInt32, waiters{ + ctx: ctx, + tctx: ct.ctx, + done: nil, + goAway: nil, + }) + cancel() + if err != nil { + return true, fmt.Errorf("error while acquiring client transport send quota. Err: %v", err) + } + ct.sendQuotaPool.add(clientTrSendQuota) + st.fc.mu.Lock() + serverEst = st.fc.limit - st.fc.pendingUpdate + st.fc.mu.Unlock() + if uint32(clientTrSendQuota) != serverEst { + return true, fmt.Errorf("client transport outflow: %v, estimated by client: %v", clientTrSendQuota, serverEst) + } + + return false, nil + }) + +} + +func waitWhileTrue(t *testing.T, condition func() (bool, error)) { + var ( + wait bool + err error + ) + timer := time.NewTimer(time.Second * 5) + for { + wait, err = condition() + if wait { + select { + case <-timer.C: + t.Fatalf(err.Error()) + default: + time.Sleep(50 * time.Millisecond) + continue + } + } + if !timer.Stop() { + <-timer.C + } + break + } +} + +// A function of type writeHeaders writes out +// http status with the given stream ID using the given framer. +type writeHeaders func(*http2.Framer, uint32, int) error + +func writeOneHeader(framer *http2.Framer, sid uint32, httpStatus int) error { + var buf bytes.Buffer + henc := hpack.NewEncoder(&buf) + henc.WriteField(hpack.HeaderField{Name: ":status", Value: fmt.Sprint(httpStatus)}) + return framer.WriteHeaders(http2.HeadersFrameParam{ + StreamID: sid, + BlockFragment: buf.Bytes(), + EndStream: true, + EndHeaders: true, + }) +} + +func writeTwoHeaders(framer *http2.Framer, sid uint32, httpStatus int) error { + var buf bytes.Buffer + henc := hpack.NewEncoder(&buf) + henc.WriteField(hpack.HeaderField{ + Name: ":status", + Value: fmt.Sprint(http.StatusOK), + }) + if err := framer.WriteHeaders(http2.HeadersFrameParam{ + StreamID: sid, + BlockFragment: buf.Bytes(), + EndHeaders: true, + }); err != nil { + return err + } + buf.Reset() + henc.WriteField(hpack.HeaderField{ + Name: ":status", + Value: fmt.Sprint(httpStatus), + }) + return framer.WriteHeaders(http2.HeadersFrameParam{ + StreamID: sid, + BlockFragment: buf.Bytes(), + EndStream: true, + EndHeaders: true, + }) +} + +type httpServer struct { + conn net.Conn + httpStatus int + wh writeHeaders +} + +func (s *httpServer) start(t *testing.T, lis net.Listener) { + // Launch an HTTP server to send back header with httpStatus. + go func() { + var err error + s.conn, err = lis.Accept() + if err != nil { + t.Errorf("Error accepting connection: %v", err) + return + } + defer s.conn.Close() + // Read preface sent by client. + if _, err = io.ReadFull(s.conn, make([]byte, len(http2.ClientPreface))); err != nil { + t.Errorf("Error at server-side while reading preface from cleint. Err: %v", err) + return + } + reader := bufio.NewReaderSize(s.conn, defaultWriteBufSize) + writer := bufio.NewWriterSize(s.conn, defaultReadBufSize) + framer := http2.NewFramer(writer, reader) + if err = framer.WriteSettingsAck(); err != nil { + t.Errorf("Error at server-side while sending Settings ack. Err: %v", err) + return + } + var sid uint32 + // Read frames until a header is received. + for { + frame, err := framer.ReadFrame() + if err != nil { + t.Errorf("Error at server-side while reading frame. Err: %v", err) + return + } + if hframe, ok := frame.(*http2.HeadersFrame); ok { + sid = hframe.Header().StreamID + break + } + } + if err = s.wh(framer, sid, s.httpStatus); err != nil { + t.Errorf("Error at server-side while writing headers. Err: %v", err) + return + } + writer.Flush() + }() +} + +func (s *httpServer) cleanUp() { + if s.conn != nil { + s.conn.Close() + } +} + +func setUpHTTPStatusTest(t *testing.T, httpStatus int, wh writeHeaders) (stream *Stream, cleanUp func()) { + var ( + err error + lis net.Listener + server *httpServer + client ClientTransport + ) + cleanUp = func() { + if lis != nil { + lis.Close() + } + if server != nil { + server.cleanUp() + } + if client != nil { + client.Close() + } + } + defer func() { + if err != nil { + cleanUp() + } + }() + lis, err = net.Listen("tcp", "localhost:0") + if err != nil { + t.Fatalf("Failed to listen. Err: %v", err) + } + server = &httpServer{ + httpStatus: httpStatus, + wh: wh, + } + server.start(t, lis) + client, err = newHTTP2Client(context.Background(), TargetInfo{Addr: lis.Addr().String()}, ConnectOptions{}, 2*time.Second) + if err != nil { + t.Fatalf("Error creating client. Err: %v", err) + } + stream, err = client.NewStream(context.Background(), &CallHdr{Method: "bogus/method", Flush: true}) + if err != nil { + t.Fatalf("Error creating stream at client-side. Err: %v", err) + } + return +} + +func TestHTTPToGRPCStatusMapping(t *testing.T) { + for k := range httpStatusConvTab { + testHTTPToGRPCStatusMapping(t, k, writeOneHeader) + } +} + +func testHTTPToGRPCStatusMapping(t *testing.T, httpStatus int, wh writeHeaders) { + stream, cleanUp := setUpHTTPStatusTest(t, httpStatus, wh) + defer cleanUp() + want := httpStatusConvTab[httpStatus] + buf := make([]byte, 8) + _, err := stream.Read(buf) + if err == nil { + t.Fatalf("Stream.Read(_) unexpectedly returned no error. Expected stream error with code %v", want) + } + serr, ok := err.(StreamError) + if !ok { + t.Fatalf("err.(Type) = %T, want StreamError", err) + } + if want != serr.Code { + t.Fatalf("Want error code: %v, got: %v", want, serr.Code) + } +} + +func TestHTTPStatusOKAndMissingGRPCStatus(t *testing.T) { + stream, cleanUp := setUpHTTPStatusTest(t, http.StatusOK, writeOneHeader) + defer cleanUp() + buf := make([]byte, 8) + _, err := stream.Read(buf) + if err != io.EOF { + t.Fatalf("stream.Read(_) = _, %v, want _, io.EOF", err) + } + want := codes.Unknown + stream.mu.Lock() + defer stream.mu.Unlock() + if stream.status.Code() != want { + t.Fatalf("Status code of stream: %v, want: %v", stream.status.Code(), want) + } +} + +func TestHTTPStatusNottOKAndMissingGRPCStatusInSecondHeader(t *testing.T) { + testHTTPToGRPCStatusMapping(t, http.StatusUnauthorized, writeTwoHeaders) +} + +// If any error occurs on a call to Stream.Read, future calls +// should continue to return that same error. +func TestReadGivesSameErrorAfterAnyErrorOccurs(t *testing.T) { + testRecvBuffer := newRecvBuffer() + s := &Stream{ + ctx: context.Background(), + goAway: make(chan struct{}), + buf: testRecvBuffer, + requestRead: func(int) {}, + } + s.trReader = &transportReader{ + reader: &recvBufferReader{ + ctx: s.ctx, + goAway: s.goAway, + recv: s.buf, + }, + windowHandler: func(int) {}, + } + testData := make([]byte, 1) + testData[0] = 5 + testErr := errors.New("test error") + s.write(recvMsg{data: testData, err: testErr}) + + inBuf := make([]byte, 1) + actualCount, actualErr := s.Read(inBuf) + if actualCount != 0 { + t.Errorf("actualCount, _ := s.Read(_) differs; want 0; got %v", actualCount) + } + if actualErr.Error() != testErr.Error() { + t.Errorf("_ , actualErr := s.Read(_) differs; want actualErr.Error() to be %v; got %v", testErr.Error(), actualErr.Error()) + } + + s.write(recvMsg{data: testData, err: nil}) + s.write(recvMsg{data: testData, err: errors.New("different error from first")}) + + for i := 0; i < 2; i++ { + inBuf := make([]byte, 1) + actualCount, actualErr := s.Read(inBuf) + if actualCount != 0 { + t.Errorf("actualCount, _ := s.Read(_) differs; want %v; got %v", 0, actualCount) + } + if actualErr.Error() != testErr.Error() { + t.Errorf("_ , actualErr := s.Read(_) differs; want actualErr.Error() to be %v; got %v", testErr.Error(), actualErr.Error()) + } + } +} + +func TestPingPong1B(t *testing.T) { + runPingPongTest(t, 1) +} + +func TestPingPong1KB(t *testing.T) { + runPingPongTest(t, 1024) +} + +func TestPingPong64KB(t *testing.T) { + runPingPongTest(t, 65536) +} + +func TestPingPong1MB(t *testing.T) { + runPingPongTest(t, 1048576) +} + +//This is a stress-test of flow control logic. +func runPingPongTest(t *testing.T, msgSize int) { + server, client := setUp(t, 0, 0, pingpong) + defer server.stop() + defer client.Close() + waitWhileTrue(t, func() (bool, error) { + server.mu.Lock() + defer server.mu.Unlock() + if len(server.conns) == 0 { + return true, fmt.Errorf("timed out while waiting for server transport to be created") + } + return false, nil + }) + ct := client.(*http2Client) + stream, err := client.NewStream(context.Background(), &CallHdr{}) + if err != nil { + t.Fatalf("Failed to create stream. Err: %v", err) + } + msg := make([]byte, msgSize) + outgoingHeader := make([]byte, 5) + outgoingHeader[0] = byte(0) + binary.BigEndian.PutUint32(outgoingHeader[1:], uint32(msgSize)) + opts := &Options{} + incomingHeader := make([]byte, 5) + done := make(chan struct{}) + go func() { + timer := time.NewTimer(time.Second * 5) + <-timer.C + close(done) + }() + for { + select { + case <-done: + ct.Write(stream, nil, nil, &Options{Last: true}) + if _, err := stream.Read(incomingHeader); err != io.EOF { + t.Fatalf("Client expected EOF from the server. Got: %v", err) + } + return + default: + if err := ct.Write(stream, outgoingHeader, msg, opts); err != nil { + t.Fatalf("Error on client while writing message. Err: %v", err) + } + if _, err := stream.Read(incomingHeader); err != nil { + t.Fatalf("Error on client while reading data header. Err: %v", err) + } + sz := binary.BigEndian.Uint32(incomingHeader[1:]) + recvMsg := make([]byte, int(sz)) + if _, err := stream.Read(recvMsg); err != nil { + t.Fatalf("Error on client while reading data. Err: %v", err) + } + } + } +} diff --git a/vendor/google.golang.org/grpc/vet.sh b/vendor/google.golang.org/grpc/vet.sh new file mode 100755 index 0000000000..02d4bae39a --- /dev/null +++ b/vendor/google.golang.org/grpc/vet.sh @@ -0,0 +1,85 @@ +#!/bin/bash + +set -ex # Exit on error; debugging enabled. +set -o pipefail # Fail a pipe if any sub-command fails. + +die() { + echo "$@" >&2 + exit 1 +} + +PATH="$GOPATH/bin:$GOROOT/bin:$PATH" + +# Check proto in manual runs or cron runs. +if [[ "$TRAVIS" != "true" || "$TRAVIS_EVENT_TYPE" = "cron" ]]; then + check_proto="true" +fi + +if [ "$1" = "-install" ]; then + go get -d \ + google.golang.org/grpc/... + go get -u \ + github.com/golang/lint/golint \ + golang.org/x/tools/cmd/goimports \ + honnef.co/go/tools/cmd/staticcheck \ + github.com/client9/misspell/cmd/misspell \ + github.com/golang/protobuf/protoc-gen-go \ + golang.org/x/tools/cmd/stringer + if [[ "$check_proto" = "true" ]]; then + if [[ "$TRAVIS" = "true" ]]; then + PROTOBUF_VERSION=3.3.0 + PROTOC_FILENAME=protoc-${PROTOBUF_VERSION}-linux-x86_64.zip + pushd /home/travis + wget https://github.com/google/protobuf/releases/download/v${PROTOBUF_VERSION}/${PROTOC_FILENAME} + unzip ${PROTOC_FILENAME} + bin/protoc --version + popd + elif ! which protoc > /dev/null; then + die "Please install protoc into your path" + fi + fi + exit 0 +elif [[ "$#" -ne 0 ]]; then + die "Unknown argument(s): $*" +fi + +# TODO: Remove this check and the mangling below once "context" is imported +# directly. +if git status --porcelain | read; then + die "Uncommitted or untracked files found; commit changes first" +fi + +git ls-files "*.go" | xargs grep -L "\(Copyright [0-9]\{4,\} gRPC authors\)\|DO NOT EDIT" 2>&1 | tee /dev/stderr | (! read) +gofmt -s -d -l . 2>&1 | tee /dev/stderr | (! read) +goimports -l . 2>&1 | tee /dev/stderr | (! read) +golint ./... 2>&1 | (grep -vE "(_mock|_string|\.pb)\.go:" || true) | tee /dev/stderr | (! read) + +# Undo any edits made by this script. +cleanup() { + git reset --hard HEAD +} +trap cleanup EXIT + +# Rewrite golang.org/x/net/context -> context imports (see grpc/grpc-go#1484). +# TODO: Remove this mangling once "context" is imported directly (grpc/grpc-go#711). +git ls-files "*.go" | xargs sed -i 's:"golang.org/x/net/context":"context":' +set +o pipefail +# TODO: Stop filtering pb.go files once golang/protobuf#214 is fixed. +go tool vet -all . 2>&1 | grep -vF '.pb.go:' | tee /dev/stderr | (! read) +set -o pipefail +git reset --hard HEAD + +if [[ "$check_proto" = "true" ]]; then + PATH="/home/travis/bin:$PATH" make proto && \ + git status --porcelain 2>&1 | (! read) || \ + (git status; git --no-pager diff; exit 1) +fi + +# TODO(menghanl): fix errors in transport_test. +staticcheck -ignore ' +google.golang.org/grpc/transport/transport_test.go:SA2002 +google.golang.org/grpc/benchmark/benchmain/main.go:SA1019 +google.golang.org/grpc/stats/stats_test.go:SA1019 +google.golang.org/grpc/test/end2end_test.go:SA1019 +' ./... +misspell -error .